Files
SnowLuma/packages/sdk/src/index.ts
T
DrSmoothl fa5efcd310 feat(sdk): add media sends, quoted replies, and event waits
Add local media upload-and-send helpers with an optional Node file source
and stage-aware errors. Add explicit quoted replies and cancellable event
waits while preserving existing methods and handler contracts.

Propagate group-file publication failures instead of reporting success.
Cover cancellation, cleanup, signed message IDs, package exports, consumer
types, and real HTTP/WebSocket upload-to-send integration.

Validation: pnpm run ci (6231 tests passed, 9 skipped); SDK package contents
verified with npm pack --dry-run --ignore-scripts.
2026-10-23 19:45:47 +08:00

88 lines
1.9 KiB
TypeScript

export { SNOWLUMA_ACTIONS, isSnowLumaAction } from './actions.js';
export type { SnowLumaKnownAction } from './actions.js';
export { SnowLumaApiClient } from './client/api-client.js';
export { createHttpClient, SnowLumaHttpClient } from './client/http-client.js';
export type { SnowLumaHttpClientOptions } from './client/http-client.js';
export { createWebSocketClient, SnowLumaWebSocketClient } from './client/websocket-client.js';
export {
createSnowLumaApiError,
SnowLumaAbortError,
SnowLumaApiError,
SnowLumaAuthError,
SnowLumaConnectionError,
SnowLumaError,
SnowLumaMediaSendError,
SnowLumaParseError,
SnowLumaTimeoutError,
SnowLumaTransportError,
} from './errors.js';
export {
createEventContext,
isBotStatusEvent,
isGroupMessageEvent,
isMessageEvent,
isMetaEvent,
isNoticeEvent,
isPrivateMessageEvent,
isRequestEvent,
matchCommand,
noticeType,
requestType,
} from './events/index.js';
export {
at,
atAll,
br,
chain,
contact,
escapeCqParam,
escapeCqText,
face,
forward,
fromCQString,
image,
json,
location,
message,
MessageChain,
music,
node,
normalizeMessage,
parseSegments,
poke,
quoteMessage,
raw,
record,
reply,
share,
text,
toCQString,
video,
xml,
} from './messages/index.js';
export type {
EventWaitOptions,
ReconnectOptions,
SnowLumaWebSocketClientOptions,
SnowLumaWebSocketEvents,
WebSocketCloseInfo,
WebSocketConstructor,
} from './client/websocket-client.js';
export type {
CommandHandler,
CommandMatch,
CommandOptions,
EventHandler,
EventMiddleware,
EventNext,
EventPredicate,
MaybePromise,
RequestDecisionOptions,
SnowLumaEventContext,
SnowLumaEventContextWithQuote,
} from './events/index.js';
export type * from './types/index.js';