@clowder-ai/plugin-sdk 0.1.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract-mirror.d.ts +120 -0
- package/dist/contract-mirror.d.ts.map +1 -0
- package/dist/contract-mirror.js +179 -0
- package/dist/contract-mirror.js.map +1 -0
- package/dist/events-publisher.d.ts +34 -0
- package/dist/events-publisher.d.ts.map +1 -0
- package/dist/events-publisher.js +62 -0
- package/dist/events-publisher.js.map +1 -0
- package/dist/handshake-client.d.ts +66 -0
- package/dist/handshake-client.d.ts.map +1 -0
- package/dist/handshake-client.js +124 -0
- package/dist/handshake-client.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/standalone-host.d.ts +43 -0
- package/dist/standalone-host.d.ts.map +1 -0
- package/dist/standalone-host.js +195 -0
- package/dist/standalone-host.js.map +1 -0
- package/dist/stdio-runtime.d.ts +50 -0
- package/dist/stdio-runtime.d.ts.map +1 -0
- package/dist/stdio-runtime.js +294 -0
- package/dist/stdio-runtime.js.map +1 -0
- package/dist/wire-dispatch.d.ts +43 -0
- package/dist/wire-dispatch.d.ts.map +1 -0
- package/dist/wire-dispatch.js +999 -0
- package/dist/wire-dispatch.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire dispatch classifier — pre-dispatch frame classification per the
|
|
3
|
+
* disposition table (T-A through T-M, §3.8-1 plus beta.8 closure).
|
|
4
|
+
*
|
|
5
|
+
* This module classifies decoded NDJSON frames into one of the 13
|
|
6
|
+
* disposition classes. T-A (transport failure) and T-B (JSON parse error)
|
|
7
|
+
* are handled by the NDJSON frame decoder layer — this classifier covers
|
|
8
|
+
* T-C through T-M.
|
|
9
|
+
*
|
|
10
|
+
* A frame that passes all rejection checks returns disposition=null with
|
|
11
|
+
* outcome='accept', indicating a valid request that should be dispatched
|
|
12
|
+
* to a method handler.
|
|
13
|
+
*
|
|
14
|
+
* This module defines nothing new — every classification rule traces to
|
|
15
|
+
* the frozen disposition table in @clowder-ai/plugin-contract.
|
|
16
|
+
*/
|
|
17
|
+
import type { DecodedNdjsonFrame, JsonObject } from '@clowder-ai/plugin-contract/conformance';
|
|
18
|
+
import { type DispositionClass, type RequestSnapshot, type WireMethodName } from '@clowder-ai/plugin-contract';
|
|
19
|
+
export type { RequestSnapshot } from '@clowder-ai/plugin-contract';
|
|
20
|
+
export interface InFlightEntry {
|
|
21
|
+
readonly method: WireMethodName;
|
|
22
|
+
readonly requestSnapshot?: RequestSnapshot;
|
|
23
|
+
}
|
|
24
|
+
export interface DispatchResult {
|
|
25
|
+
/** T-class from the disposition table, or null for valid requests. */
|
|
26
|
+
readonly disposition: DispositionClass | null;
|
|
27
|
+
/** Required transport action: close, respond (with error), or accept. */
|
|
28
|
+
readonly outcome: 'close' | 'respond' | 'accept';
|
|
29
|
+
/** For 'respond': the error envelope to write back as NDJSON. */
|
|
30
|
+
readonly response?: JsonObject;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Classify a decoded NDJSON frame into a disposition class.
|
|
34
|
+
*
|
|
35
|
+
* Covers T-C through T-M of the disposition table. T-A and T-B
|
|
36
|
+
* are handled by the NDJSON frame decoder layer.
|
|
37
|
+
*
|
|
38
|
+
* @param frame Decoded frame with raw bytes and parsed value.
|
|
39
|
+
* @param inFlight Map of in-flight request IDs to their entry metadata.
|
|
40
|
+
* @returns The disposition result with class, outcome, and optional error response.
|
|
41
|
+
*/
|
|
42
|
+
export declare function classifyFrame(frame: DecodedNdjsonFrame, inFlight: ReadonlyMap<string, InFlightEntry>): DispatchResult;
|
|
43
|
+
//# sourceMappingURL=wire-dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-dispatch.d.ts","sourceRoot":"","sources":["../src/wire-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAE9F,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EA8CpB,MAAM,6BAA6B,CAAC;AAQrC,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC;CAC5C;AAED,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC9C,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC;AA+7BD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,GAC3C,cAAc,CAmEhB"}
|