fix(sdk): restore native ESM imports and action exports

This commit is contained in:
DrSmoothl committed 2026-10-23 13:04:33 +08:00
1 parent f8cb15c27b
commit b997de44a2
33 files changed
+482 -81

No files matched your search

+3 -3
View File
@@ -13,9 +13,9 @@ import type {
ShareSegment,
VideoSegment,
XmlSegment,
} from '../types/index';
import { segmentsToCQString } from './cq-format';
import { segments } from './segments';
} from '../types/index.js';
import { segmentsToCQString } from './cq-format.js';
import { segments } from './segments.js';
export interface MessageChainSender {
sendGroupMessage(
+1 -1
View File
@@ -1,4 +1,4 @@
import type { AnyMessageSegment } from '../types/index';
import type { AnyMessageSegment } from '../types/index.js';
export function escapeCqText(text: string): string {
return text.replaceAll('&', '&').replaceAll('[', '[').replaceAll(']', ']');
+4 -4
View File
@@ -1,7 +1,7 @@
import { normalizeMessage, chain } from './chain';
import { escapeCqText, segmentsToCQString } from './cq-format';
import { segments } from './segments';
import type { AnyMessageSegment, FaceSegment, OutgoingMessage } from '../types/index';
import { normalizeMessage, chain } from './chain.js';
import { escapeCqText, segmentsToCQString } from './cq-format.js';
import { segments } from './segments.js';
import type { AnyMessageSegment, FaceSegment, OutgoingMessage } from '../types/index.js';
const CQ_REGEX = /\[CQ:([a-zA-Z0-9_.-]+)(?:,([^\]]*))?\]/g;
+5 -5
View File
@@ -1,6 +1,6 @@
import { segments } from './segments';
import { segments } from './segments.js';
export { MessageChain } from './chain';
export { MessageChain } from './chain.js';
export {
at,
atAll,
@@ -23,9 +23,9 @@ export {
text,
video,
xml,
} from './chain';
export { escapeCqParam, escapeCqText } from './cq-format';
export { fromCQString, parseSegments, toCQString } from './cq';
} from './chain.js';
export { escapeCqParam, escapeCqText } from './cq-format.js';
export { fromCQString, parseSegments, toCQString } from './cq.js';
export { segments };
export const message = {
+1 -1
View File
@@ -19,7 +19,7 @@ import type {
TextSegment,
VideoSegment,
XmlSegment,
} from '../types/index';
} from '../types/index.js';
function seg<TType extends string, TData extends Record<string, unknown>>(
type: TType,