feat(onebot,mcp): catalog the Stream API actions (#163 phase 4)
Surface the six Stream API actions in the self-generated docs catalog under a new 流式接口 category: export each module's specs as an `actions` array (register now iterates it) and widen the doc collector's spec type to anything carrying describe() so defineStreamAction results qualify alongside defineAction. Regenerated the MCP catalog snapshot. End-to-end verified on a live account over HTTP: test_download_stream (10 frames + terminal), an upload_file_stream round-trip (200 KB chunked in → sent as a c2c file → download_file_stream back out, byte- and sha256-exact), and the SSRF guard rejecting a cloud-metadata URL.
This commit is contained in:
5 files changed
+814
-8
No files matched your search
@@ -368,11 +368,10 @@ const testDownloadStream = defineStreamAction({
|
||||
},
|
||||
});
|
||||
|
||||
export const actions = [downloadFileStream, downloadFileImageStream, downloadFileRecordStream, testDownloadStream];
|
||||
|
||||
export function register(h: ApiHandler, ctx: ApiActionContext): void {
|
||||
downloadFileStream.register(h, ctx);
|
||||
downloadFileImageStream.register(h, ctx);
|
||||
downloadFileRecordStream.register(h, ctx);
|
||||
testDownloadStream.register(h, ctx);
|
||||
for (const a of actions) a.register(h, ctx);
|
||||
}
|
||||
|
||||
// Exposed for tests.
|
||||
|
||||
@@ -359,9 +359,10 @@ const cleanStreamTempFile = defineAction({
|
||||
},
|
||||
});
|
||||
|
||||
export const actions = [uploadFileStream, cleanStreamTempFile];
|
||||
|
||||
export function register(h: ApiHandler, ctx: ApiActionContext): void {
|
||||
uploadFileStream.register(h, ctx);
|
||||
cleanStreamTempFile.register(h, ctx);
|
||||
for (const a of actions) a.register(h, ctx);
|
||||
}
|
||||
|
||||
// Exposed for tests.
|
||||
|
||||
Reference in new issue
Block a user