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.
This commit is contained in:
28 files changed
+1798
-37
No files matched your search
@@ -4,7 +4,7 @@ The SDK follows SemVer for its public package surface:
|
||||
|
||||
- Exported runtime values and classes from `@snowluma/sdk`.
|
||||
- Exported types from `@snowluma/sdk` and `@snowluma/sdk/types`.
|
||||
- Supported subpath exports: `client`, `messages`, `events`, `errors`, `actions`, and `types`.
|
||||
- Supported subpath exports: `client`, `messages`, `events`, `errors`, `actions`, `types`, and `node`.
|
||||
- Runtime behavior of typed client helpers, message builders, event helpers, and SDK error classes.
|
||||
|
||||
## Version policy
|
||||
@@ -15,8 +15,8 @@ The current Node.js requirement is `^24.22.1 || >=26.12.1`. Use the repository's
|
||||
|
||||
The SDK is an ES module package that supports native Node.js imports and bundler consumers. Its build uses `NodeNext`; relative source imports and re-exports must use `.js` specifiers so both emitted JavaScript and declarations resolve without a bundler. Package tests compile fresh output, load every runtime entry point with Node.js, and typecheck consumers with both NodeNext and bundler resolution.
|
||||
|
||||
- Major: removes or changes a public export, changes runtime behavior incompatibly, changes supported Node version, or changes package subpaths.
|
||||
- Minor: adds new public API, supports new SnowLuma actions, adds optional parameters, or adds error subclasses.
|
||||
- Major: removes or changes a public export, changes runtime behavior incompatibly, changes supported Node version, or removes/changes an existing package subpath.
|
||||
- Minor: adds new public API or package subpaths, supports new SnowLuma actions, adds optional parameters, or adds error subclasses.
|
||||
- Patch: fixes bugs, improves docs, narrows implementation details without breaking public types, or updates action metadata without changing call signatures.
|
||||
|
||||
## Release Checklist
|
||||
@@ -46,3 +46,5 @@ This local catalog is not a capability check against a connected server. Every k
|
||||
Stream result types describe individual frame payloads, including intermediate and terminal frames. Both built-in clients support `requestStream()` (envelopes) and `stream()` (payloads with API error handling), plus incremental file upload/download helpers; see [STREAMING.md](STREAMING.md). Existing `request()`, `call()`, `raw()`, `rawResponse()` and `downloadFile()` keep their single-response contracts. Custom subclasses that only implement `request()` remain valid; the default `requestStream()` explicitly reports unsupported streaming. Stream reset/error envelopes retain their existing error behavior. Album counts and IDs returned as decimal strings stay strings, and ordinary message IDs remain signed numbers.
|
||||
|
||||
The package consumer tests check complete action-map coverage, inferred results, compatibility aliases, and invalid input examples with both NodeNext and bundler resolution. The same parameter examples are checked against the server's real action parsers without starting QQ or executing actions.
|
||||
|
||||
Additive media-send methods, explicit quoted replies, and WebSocket event waits are described in [MESSAGING.md](MESSAGING.md). Existing string paths, ordinary `reply()` behavior, and handler/context types remain supported. The optional `node` subpath owns local filesystem access; browser-facing entry points stay free of Node imports. The runtime also propagates group-file chat publication failures instead of returning success after a failed publication; successful action response shapes are unchanged.
|
||||
Reference in new issue
Block a user