@clowder-ai/plugin-contract 0.1.0-beta.2 → 0.1.0-beta.3
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/conformance/index.d.ts +1 -0
- package/dist/conformance/index.d.ts.map +1 -1
- package/dist/conformance/index.js +1 -0
- package/dist/conformance/index.js.map +1 -1
- package/dist/conformance/stdio-harness/child-process-harness.d.ts +59 -0
- package/dist/conformance/stdio-harness/child-process-harness.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/child-process-harness.js +279 -0
- package/dist/conformance/stdio-harness/child-process-harness.js.map +1 -0
- package/dist/conformance/stdio-harness/dual-transport-oracle.d.ts +26 -0
- package/dist/conformance/stdio-harness/dual-transport-oracle.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/dual-transport-oracle.js +32 -0
- package/dist/conformance/stdio-harness/dual-transport-oracle.js.map +1 -0
- package/dist/conformance/stdio-harness/harness-process-spawn.d.ts +27 -0
- package/dist/conformance/stdio-harness/harness-process-spawn.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/harness-process-spawn.js +43 -0
- package/dist/conformance/stdio-harness/harness-process-spawn.js.map +1 -0
- package/dist/conformance/stdio-harness/index.d.ts +5 -0
- package/dist/conformance/stdio-harness/index.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/index.js +4 -0
- package/dist/conformance/stdio-harness/index.js.map +1 -0
- package/dist/conformance/stdio-harness/ndjson-frame.d.ts +26 -0
- package/dist/conformance/stdio-harness/ndjson-frame.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/ndjson-frame.js +119 -0
- package/dist/conformance/stdio-harness/ndjson-frame.js.map +1 -0
- package/dist/conformance/stdio-harness/node-process-tree-runtime.d.ts +15 -0
- package/dist/conformance/stdio-harness/node-process-tree-runtime.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/node-process-tree-runtime.js +78 -0
- package/dist/conformance/stdio-harness/node-process-tree-runtime.js.map +1 -0
- package/dist/conformance/stdio-harness/process-tree-controller.d.ts +51 -0
- package/dist/conformance/stdio-harness/process-tree-controller.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/process-tree-controller.js +162 -0
- package/dist/conformance/stdio-harness/process-tree-controller.js.map +1 -0
- package/dist/conformance/stdio-harness/windows-sentinel.d.ts +15 -0
- package/dist/conformance/stdio-harness/windows-sentinel.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/windows-sentinel.js +160 -0
- package/dist/conformance/stdio-harness/windows-sentinel.js.map +1 -0
- package/dist/conformance/stdio-harness/wire-shape.d.ts +18 -0
- package/dist/conformance/stdio-harness/wire-shape.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/wire-shape.js +2 -0
- package/dist/conformance/stdio-harness/wire-shape.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/wire/constants.d.ts +36 -0
- package/dist/wire/constants.d.ts.map +1 -0
- package/dist/wire/constants.js +36 -0
- package/dist/wire/constants.js.map +1 -0
- package/dist/wire/disposition-fixtures.d.ts +99 -0
- package/dist/wire/disposition-fixtures.d.ts.map +1 -0
- package/dist/wire/disposition-fixtures.js +623 -0
- package/dist/wire/disposition-fixtures.js.map +1 -0
- package/dist/wire/disposition.d.ts +100 -0
- package/dist/wire/disposition.d.ts.map +1 -0
- package/dist/wire/disposition.js +205 -0
- package/dist/wire/disposition.js.map +1 -0
- package/dist/wire/envelope.d.ts +253 -0
- package/dist/wire/envelope.d.ts.map +1 -0
- package/dist/wire/envelope.js +19 -0
- package/dist/wire/envelope.js.map +1 -0
- package/dist/wire/errors.d.ts +222 -0
- package/dist/wire/errors.d.ts.map +1 -0
- package/dist/wire/errors.js +153 -0
- package/dist/wire/errors.js.map +1 -0
- package/dist/wire/grants.d.ts +57 -0
- package/dist/wire/grants.d.ts.map +1 -0
- package/dist/wire/grants.js +59 -0
- package/dist/wire/grants.js.map +1 -0
- package/dist/wire/handshake.d.ts +100 -0
- package/dist/wire/handshake.d.ts.map +1 -0
- package/dist/wire/handshake.js +70 -0
- package/dist/wire/handshake.js.map +1 -0
- package/dist/wire/index.d.ts +26 -0
- package/dist/wire/index.d.ts.map +1 -0
- package/dist/wire/index.js +45 -0
- package/dist/wire/index.js.map +1 -0
- package/dist/wire/registry.d.ts +90 -0
- package/dist/wire/registry.d.ts.map +1 -0
- package/dist/wire/registry.js +232 -0
- package/dist/wire/registry.js.map +1 -0
- package/dist/wire/request-id.d.ts +34 -0
- package/dist/wire/request-id.d.ts.map +1 -0
- package/dist/wire/request-id.js +40 -0
- package/dist/wire/request-id.js.map +1 -0
- package/dist/wire/row-shapes.d.ts +212 -0
- package/dist/wire/row-shapes.d.ts.map +1 -0
- package/dist/wire/row-shapes.js +59 -0
- package/dist/wire/row-shapes.js.map +1 -0
- package/dist/wire/wire-uint53.d.ts +26 -0
- package/dist/wire/wire-uint53.d.ts.map +1 -0
- package/dist/wire/wire-uint53.js +32 -0
- package/dist/wire/wire-uint53.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-dispatch disposition table -- T-A through T-L.
|
|
3
|
+
* Mechanized verbatim from #1165 R35/R39/R44.
|
|
4
|
+
*
|
|
5
|
+
* Every raw-frame/profile/request rejection class has exactly one
|
|
6
|
+
* deterministic transport disposition. The table is frozen: adding
|
|
7
|
+
* or reordering rows requires a contract revision.
|
|
8
|
+
*
|
|
9
|
+
* Three outcome classes:
|
|
10
|
+
* - close: connection is torn down, no error response emitted.
|
|
11
|
+
* - respond: an error response is emitted (standard or application).
|
|
12
|
+
* - accept: frame is valid, dispatched or settled, no error response.
|
|
13
|
+
*
|
|
14
|
+
* Derived subsets (exported):
|
|
15
|
+
* - CLOSE_CLASSES: close with no response (T-A, T-C, T-E, T-H, T-I, T-K).
|
|
16
|
+
* - RESPOND_CLASSES: respond with an error (T-B, T-D, T-F, T-G).
|
|
17
|
+
* - ACCEPT_CLASSES: accept and process (T-J, T-L).
|
|
18
|
+
*
|
|
19
|
+
* These subsets are used in byte-proof exclusion: close/accept classes
|
|
20
|
+
* are excluded from error byte proofs because they never emit an error
|
|
21
|
+
* response onto the wire.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* The 12 pre-dispatch disposition classes, T-A through T-L.
|
|
25
|
+
* Mechanized from #1165 R35.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DISPOSITION_CLASSES: readonly ["T-A", "T-B", "T-C", "T-D", "T-E", "T-F", "T-G", "T-H", "T-I", "T-J", "T-K", "T-L"];
|
|
28
|
+
/** Union of all disposition class identifiers. */
|
|
29
|
+
export type DispositionClass = (typeof DISPOSITION_CLASSES)[number];
|
|
30
|
+
/**
|
|
31
|
+
* The three possible transport outcomes for a pre-dispatch rejection.
|
|
32
|
+
* - close: tear down the connection, emit nothing.
|
|
33
|
+
* - respond: emit an error response frame.
|
|
34
|
+
* - accept: frame is valid, pass to dispatch/settlement.
|
|
35
|
+
*/
|
|
36
|
+
export type DispositionOutcome = 'close' | 'respond' | 'accept';
|
|
37
|
+
/**
|
|
38
|
+
* A single row of the disposition table.
|
|
39
|
+
*
|
|
40
|
+
* @property class - The disposition class identifier (T-A .. T-L).
|
|
41
|
+
* @property outcome - Transport outcome: close, respond, or accept.
|
|
42
|
+
* @property emitsResponse - Whether an error response is written to the wire.
|
|
43
|
+
* @property dispatches - Whether the frame reaches the dispatch layer.
|
|
44
|
+
* @property description - Human-readable description from #1165.
|
|
45
|
+
* @property errorCodes - Error codes emitted for respond classes, empty for close/accept.
|
|
46
|
+
* @property predicate - Deterministic decision rule (human-readable, machine-checkable).
|
|
47
|
+
* @property canonicalExample - Minimal compact JSON string exemplifying this class.
|
|
48
|
+
*/
|
|
49
|
+
export interface DispositionEntry {
|
|
50
|
+
readonly class: DispositionClass;
|
|
51
|
+
readonly outcome: DispositionOutcome;
|
|
52
|
+
readonly emitsResponse: boolean;
|
|
53
|
+
readonly dispatches: boolean;
|
|
54
|
+
readonly description: string;
|
|
55
|
+
/** Error codes emitted for respond classes, empty array for close/accept. */
|
|
56
|
+
readonly errorCodes: readonly number[];
|
|
57
|
+
/** Deterministic predicate -- human-readable, machine-checkable decision rule. */
|
|
58
|
+
readonly predicate: string;
|
|
59
|
+
/** Canonical frame example (compact JSON string) for this class. */
|
|
60
|
+
readonly canonicalExample: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The complete pre-dispatch disposition table.
|
|
64
|
+
* Every row is mechanized from #1165 R35/R39/R44 -- no interpretation.
|
|
65
|
+
*
|
|
66
|
+
* | # | Rejection class | Disposition |
|
|
67
|
+
* |-----|--------------------------------------------------------|-----------------------------------|
|
|
68
|
+
* | T-A | transport/framing failure | close, no response |
|
|
69
|
+
* | T-B | JSON parse error | respond Parse error, id: null |
|
|
70
|
+
* | T-C | frame-canonicality failure | close, no response |
|
|
71
|
+
* | T-D | canonical idless non-response-candidate non-Request | respond Invalid Request, id: null |
|
|
72
|
+
* | T-E | detected but profile-invalid id | close, no response |
|
|
73
|
+
* | T-F | valid id, envelope violation | respond standard error, id echoed |
|
|
74
|
+
* | T-G | valid id Request, value violation | respond error, id echoed |
|
|
75
|
+
* | T-H | response candidate validation/correlation failure | close, no response |
|
|
76
|
+
* | T-I | in-flight id collision | close, no response |
|
|
77
|
+
* | T-J | legal Notification (row 10) | accept, dispatch, no response |
|
|
78
|
+
* | T-K | valid Notification, v0 violation | close, no response, zero dispatch |
|
|
79
|
+
* | T-L | valid correlated response | accept, settle, no response |
|
|
80
|
+
*/
|
|
81
|
+
export declare const DISPOSITION_TABLE: Record<DispositionClass, DispositionEntry>;
|
|
82
|
+
/**
|
|
83
|
+
* Disposition classes that close the connection with no response.
|
|
84
|
+
* These are excluded from error byte proofs (no error frame emitted).
|
|
85
|
+
* Mechanized from #1165 R35/R44.
|
|
86
|
+
*/
|
|
87
|
+
export declare const CLOSE_CLASSES: readonly DispositionClass[];
|
|
88
|
+
/**
|
|
89
|
+
* Disposition classes that emit an error response.
|
|
90
|
+
* These are the only classes that produce error frames on the wire.
|
|
91
|
+
* Mechanized from #1165 R35/R39.
|
|
92
|
+
*/
|
|
93
|
+
export declare const RESPOND_CLASSES: readonly DispositionClass[];
|
|
94
|
+
/**
|
|
95
|
+
* Disposition classes that accept the frame for dispatch or settlement.
|
|
96
|
+
* These are excluded from error byte proofs (no error frame emitted).
|
|
97
|
+
* Mechanized from #1165 R35.
|
|
98
|
+
*/
|
|
99
|
+
export declare const ACCEPT_CLASSES: readonly DispositionClass[];
|
|
100
|
+
//# sourceMappingURL=disposition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disposition.d.ts","sourceRoot":"","sources":["../../src/wire/disposition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,+FAGtB,CAAC;AAEX,kDAAkD;AAClD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAMpE;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAMhE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,kFAAkF;IAClF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,CAyH/D,CAAC;AAMX;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,gBAAgB,EAE3C,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,gBAAgB,EAE7C,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,gBAAgB,EAE5C,CAAC"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-dispatch disposition table -- T-A through T-L.
|
|
3
|
+
* Mechanized verbatim from #1165 R35/R39/R44.
|
|
4
|
+
*
|
|
5
|
+
* Every raw-frame/profile/request rejection class has exactly one
|
|
6
|
+
* deterministic transport disposition. The table is frozen: adding
|
|
7
|
+
* or reordering rows requires a contract revision.
|
|
8
|
+
*
|
|
9
|
+
* Three outcome classes:
|
|
10
|
+
* - close: connection is torn down, no error response emitted.
|
|
11
|
+
* - respond: an error response is emitted (standard or application).
|
|
12
|
+
* - accept: frame is valid, dispatched or settled, no error response.
|
|
13
|
+
*
|
|
14
|
+
* Derived subsets (exported):
|
|
15
|
+
* - CLOSE_CLASSES: close with no response (T-A, T-C, T-E, T-H, T-I, T-K).
|
|
16
|
+
* - RESPOND_CLASSES: respond with an error (T-B, T-D, T-F, T-G).
|
|
17
|
+
* - ACCEPT_CLASSES: accept and process (T-J, T-L).
|
|
18
|
+
*
|
|
19
|
+
* These subsets are used in byte-proof exclusion: close/accept classes
|
|
20
|
+
* are excluded from error byte proofs because they never emit an error
|
|
21
|
+
* response onto the wire.
|
|
22
|
+
*/
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Disposition class enum
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
/**
|
|
27
|
+
* The 12 pre-dispatch disposition classes, T-A through T-L.
|
|
28
|
+
* Mechanized from #1165 R35.
|
|
29
|
+
*/
|
|
30
|
+
export const DISPOSITION_CLASSES = [
|
|
31
|
+
'T-A', 'T-B', 'T-C', 'T-D', 'T-E', 'T-F',
|
|
32
|
+
'T-G', 'T-H', 'T-I', 'T-J', 'T-K', 'T-L',
|
|
33
|
+
];
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// The frozen table (R35/R39/R44)
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
/**
|
|
38
|
+
* The complete pre-dispatch disposition table.
|
|
39
|
+
* Every row is mechanized from #1165 R35/R39/R44 -- no interpretation.
|
|
40
|
+
*
|
|
41
|
+
* | # | Rejection class | Disposition |
|
|
42
|
+
* |-----|--------------------------------------------------------|-----------------------------------|
|
|
43
|
+
* | T-A | transport/framing failure | close, no response |
|
|
44
|
+
* | T-B | JSON parse error | respond Parse error, id: null |
|
|
45
|
+
* | T-C | frame-canonicality failure | close, no response |
|
|
46
|
+
* | T-D | canonical idless non-response-candidate non-Request | respond Invalid Request, id: null |
|
|
47
|
+
* | T-E | detected but profile-invalid id | close, no response |
|
|
48
|
+
* | T-F | valid id, envelope violation | respond standard error, id echoed |
|
|
49
|
+
* | T-G | valid id Request, value violation | respond error, id echoed |
|
|
50
|
+
* | T-H | response candidate validation/correlation failure | close, no response |
|
|
51
|
+
* | T-I | in-flight id collision | close, no response |
|
|
52
|
+
* | T-J | legal Notification (row 10) | accept, dispatch, no response |
|
|
53
|
+
* | T-K | valid Notification, v0 violation | close, no response, zero dispatch |
|
|
54
|
+
* | T-L | valid correlated response | accept, settle, no response |
|
|
55
|
+
*/
|
|
56
|
+
export const DISPOSITION_TABLE = {
|
|
57
|
+
'T-A': {
|
|
58
|
+
class: 'T-A',
|
|
59
|
+
outcome: 'close',
|
|
60
|
+
emitsResponse: false,
|
|
61
|
+
dispatches: false,
|
|
62
|
+
description: 'transport/framing failure',
|
|
63
|
+
errorCodes: [],
|
|
64
|
+
predicate: 'transport/framing failure before JSON parse',
|
|
65
|
+
canonicalExample: '\\xFF',
|
|
66
|
+
},
|
|
67
|
+
'T-B': {
|
|
68
|
+
class: 'T-B',
|
|
69
|
+
outcome: 'respond',
|
|
70
|
+
emitsResponse: true,
|
|
71
|
+
dispatches: false,
|
|
72
|
+
description: 'JSON parse error',
|
|
73
|
+
errorCodes: [-32700],
|
|
74
|
+
predicate: 'JSON parse fails on well-framed UTF-8 input',
|
|
75
|
+
canonicalExample: '{invalid json',
|
|
76
|
+
},
|
|
77
|
+
'T-C': {
|
|
78
|
+
class: 'T-C',
|
|
79
|
+
outcome: 'close',
|
|
80
|
+
emitsResponse: false,
|
|
81
|
+
dispatches: false,
|
|
82
|
+
description: 'frame-canonicality failure',
|
|
83
|
+
errorCodes: [],
|
|
84
|
+
predicate: 'frame parsed but fails compact-canonical check (whitespace, duplicate keys, non-scalar strings, non-canonical numbers)',
|
|
85
|
+
canonicalExample: '{ "jsonrpc":"2.0" }',
|
|
86
|
+
},
|
|
87
|
+
'T-D': {
|
|
88
|
+
class: 'T-D',
|
|
89
|
+
outcome: 'respond',
|
|
90
|
+
emitsResponse: true,
|
|
91
|
+
dispatches: false,
|
|
92
|
+
description: 'canonical idless non-response-candidate non-Request',
|
|
93
|
+
errorCodes: [-32600],
|
|
94
|
+
predicate: 'canonical object, no valid id, not a response candidate (no result/error without method)',
|
|
95
|
+
canonicalExample: '{"jsonrpc":"2.0","method":0}',
|
|
96
|
+
},
|
|
97
|
+
'T-E': {
|
|
98
|
+
class: 'T-E',
|
|
99
|
+
outcome: 'close',
|
|
100
|
+
emitsResponse: false,
|
|
101
|
+
dispatches: false,
|
|
102
|
+
description: 'detected but profile-invalid id',
|
|
103
|
+
errorCodes: [],
|
|
104
|
+
predicate: 'id field detected but fails RequestId profile (not ASCII, not 1..128, wrong grammar)',
|
|
105
|
+
canonicalExample: '{"jsonrpc":"2.0","id":"","method":"broker.hello","params":{"meta":{"deadlineUnixMs":1},"input":{}}}',
|
|
106
|
+
},
|
|
107
|
+
'T-F': {
|
|
108
|
+
class: 'T-F',
|
|
109
|
+
outcome: 'respond',
|
|
110
|
+
emitsResponse: true,
|
|
111
|
+
dispatches: false,
|
|
112
|
+
description: 'valid id, envelope violation',
|
|
113
|
+
errorCodes: [-32600, -32601, -32602, -32603],
|
|
114
|
+
predicate: 'profile-valid id but envelope violates jsonrpc/method/params structure',
|
|
115
|
+
canonicalExample: '{"jsonrpc":"2.0","id":"a","method":"broker.hello"}',
|
|
116
|
+
},
|
|
117
|
+
'T-G': {
|
|
118
|
+
class: 'T-G',
|
|
119
|
+
outcome: 'respond',
|
|
120
|
+
emitsResponse: true,
|
|
121
|
+
dispatches: false,
|
|
122
|
+
description: 'valid id Request, value violation',
|
|
123
|
+
errorCodes: [-32090, -32091, -32092, -32093, -32094, -32602],
|
|
124
|
+
predicate: 'valid id Request with valid envelope but value-level violation (params content)',
|
|
125
|
+
canonicalExample: '{"jsonrpc":"2.0","id":"a","method":"host.lifecycle.ping","params":{"meta":{"deadlineUnixMs":1},"input":{"nonce":""}}}',
|
|
126
|
+
},
|
|
127
|
+
'T-H': {
|
|
128
|
+
class: 'T-H',
|
|
129
|
+
outcome: 'close',
|
|
130
|
+
emitsResponse: false,
|
|
131
|
+
dispatches: false,
|
|
132
|
+
description: 'response candidate validation/correlation failure',
|
|
133
|
+
errorCodes: [],
|
|
134
|
+
predicate: 'response candidate (has result or error, no method) that fails validation or correlation',
|
|
135
|
+
canonicalExample: '{"jsonrpc":"2.0","id":"phantom","result":null}',
|
|
136
|
+
},
|
|
137
|
+
'T-I': {
|
|
138
|
+
class: 'T-I',
|
|
139
|
+
outcome: 'close',
|
|
140
|
+
emitsResponse: false,
|
|
141
|
+
dispatches: false,
|
|
142
|
+
description: 'in-flight id collision',
|
|
143
|
+
errorCodes: [],
|
|
144
|
+
predicate: 'valid Request with id that collides with an in-flight request id',
|
|
145
|
+
canonicalExample: '{"jsonrpc":"2.0","id":"dup","method":"broker.hello","params":{"meta":{"deadlineUnixMs":1},"input":{}}}',
|
|
146
|
+
},
|
|
147
|
+
'T-J': {
|
|
148
|
+
class: 'T-J',
|
|
149
|
+
outcome: 'accept',
|
|
150
|
+
emitsResponse: false,
|
|
151
|
+
dispatches: true,
|
|
152
|
+
description: 'legal Notification (row 10)',
|
|
153
|
+
errorCodes: [],
|
|
154
|
+
predicate: 'legal Notification: no id, valid method=host.grants.changed (row 10 in v0)',
|
|
155
|
+
canonicalExample: '{"jsonrpc":"2.0","method":"host.grants.changed","params":{"meta":{"deadlineUnixMs":1},"input":{"grantRevision":0,"effectiveGrants":[]}}}',
|
|
156
|
+
},
|
|
157
|
+
'T-K': {
|
|
158
|
+
class: 'T-K',
|
|
159
|
+
outcome: 'close',
|
|
160
|
+
emitsResponse: false,
|
|
161
|
+
dispatches: false,
|
|
162
|
+
description: 'valid Notification, v0 violation',
|
|
163
|
+
errorCodes: [],
|
|
164
|
+
predicate: 'valid Notification structure but method is not row 10 (v0 violation)',
|
|
165
|
+
canonicalExample: '{"jsonrpc":"2.0","method":"host.lifecycle.ping","params":{"meta":{"deadlineUnixMs":1},"input":{"nonce":"x"}}}',
|
|
166
|
+
},
|
|
167
|
+
'T-L': {
|
|
168
|
+
class: 'T-L',
|
|
169
|
+
outcome: 'accept',
|
|
170
|
+
emitsResponse: false,
|
|
171
|
+
dispatches: false,
|
|
172
|
+
description: 'valid correlated response',
|
|
173
|
+
errorCodes: [],
|
|
174
|
+
predicate: 'valid correlated response matching an in-flight request',
|
|
175
|
+
canonicalExample: '{"jsonrpc":"2.0","id":"req-1","result":{"nonce":"x"}}',
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
// ---------------------------------------------------------------------------
|
|
179
|
+
// Derived subsets for byte-proof exclusion
|
|
180
|
+
// ---------------------------------------------------------------------------
|
|
181
|
+
/**
|
|
182
|
+
* Disposition classes that close the connection with no response.
|
|
183
|
+
* These are excluded from error byte proofs (no error frame emitted).
|
|
184
|
+
* Mechanized from #1165 R35/R44.
|
|
185
|
+
*/
|
|
186
|
+
export const CLOSE_CLASSES = [
|
|
187
|
+
'T-A', 'T-C', 'T-E', 'T-H', 'T-I', 'T-K',
|
|
188
|
+
];
|
|
189
|
+
/**
|
|
190
|
+
* Disposition classes that emit an error response.
|
|
191
|
+
* These are the only classes that produce error frames on the wire.
|
|
192
|
+
* Mechanized from #1165 R35/R39.
|
|
193
|
+
*/
|
|
194
|
+
export const RESPOND_CLASSES = [
|
|
195
|
+
'T-B', 'T-D', 'T-F', 'T-G',
|
|
196
|
+
];
|
|
197
|
+
/**
|
|
198
|
+
* Disposition classes that accept the frame for dispatch or settlement.
|
|
199
|
+
* These are excluded from error byte proofs (no error frame emitted).
|
|
200
|
+
* Mechanized from #1165 R35.
|
|
201
|
+
*/
|
|
202
|
+
export const ACCEPT_CLASSES = [
|
|
203
|
+
'T-J', 'T-L',
|
|
204
|
+
];
|
|
205
|
+
//# sourceMappingURL=disposition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disposition.js","sourceRoot":"","sources":["../../src/wire/disposition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IACxC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;CAChC,CAAC;AA+CX,8EAA8E;AAC9E,iCAAiC;AACjC,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA+C;IAC3E,KAAK,EAAE;QACL,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,OAAO;QAChB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,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C;QAC/C,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,sEAAsE;QACjF,gBAAgB,EAAE,+GAA+G;KAClI;IACD,KAAK,EAAE;QACL,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,QAAQ;QACjB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,2BAA2B;QACxC,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,yDAAyD;QACpE,gBAAgB,EAAE,uDAAuD;KAC1E;CACO,CAAC;AAEX,8EAA8E;AAC9E,2CAA2C;AAC3C,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAgC;IACxD,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;CAChC,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAgC;IAC1D,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;CAClB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgC;IACzD,KAAK,EAAE,KAAK;CACJ,CAAC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire envelope family — closed outer JSON-RPC structures.
|
|
3
|
+
* Mechanized from #1165 R23/R24/R26.
|
|
4
|
+
*
|
|
5
|
+
* The outer envelope family is closed (additionalProperties: false):
|
|
6
|
+
* - WireRequest: id + method + params (request/response)
|
|
7
|
+
* - WireNotification: method + params, no id (row 10 only in v0)
|
|
8
|
+
* - WireSuccessResponse: id + result, no error
|
|
9
|
+
* - WireApplicationErrorResponse: id + error (with data)
|
|
10
|
+
* - WireStandardErrorResponse: id|null + error (no data)
|
|
11
|
+
*
|
|
12
|
+
* Result/error mutual exclusivity is structural — a response carries
|
|
13
|
+
* exactly one of result or error, never both, never neither.
|
|
14
|
+
*
|
|
15
|
+
* This module defines nothing new — every shape traces to a frozen
|
|
16
|
+
* #1165 revision.
|
|
17
|
+
*/
|
|
18
|
+
import type { RequestId } from './request-id.js';
|
|
19
|
+
import type { HandshakeRejectedError, DeliveryRejectedError, DomainError, DeadlineExpiredError, SnapshotUnavailableError, ParseError, InvalidRequestError, MethodNotFoundError, InvalidParamsError, InternalError } from './errors.js';
|
|
20
|
+
/**
|
|
21
|
+
* Call metadata carried in every request's `params.meta`.
|
|
22
|
+
* Closed surface — v0 defines exactly one field.
|
|
23
|
+
*
|
|
24
|
+
* additionalProperties: false — no members beyond deadlineUnixMs.
|
|
25
|
+
*/
|
|
26
|
+
export interface CallMeta {
|
|
27
|
+
/**
|
|
28
|
+
* Host-capped absolute deadline.
|
|
29
|
+
* WireUInt53(1, 9_007_199_254_740_991) — zero is forbidden.
|
|
30
|
+
*
|
|
31
|
+
* The Host sets this ceiling; plugins observe it.
|
|
32
|
+
* Must be a positive safe integer (never 0, never negative).
|
|
33
|
+
*/
|
|
34
|
+
readonly deadlineUnixMs: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Generic JSON-RPC request envelope.
|
|
38
|
+
*
|
|
39
|
+
* An object carrying an `id` is a Request — the peer MUST respond.
|
|
40
|
+
* Parameterized by method name M and input shape I.
|
|
41
|
+
*
|
|
42
|
+
* additionalProperties: false — no members beyond jsonrpc, id, method, params.
|
|
43
|
+
*/
|
|
44
|
+
export interface WireRequest<M extends string = string, I = unknown> {
|
|
45
|
+
readonly jsonrpc: '2.0';
|
|
46
|
+
/** Validated RequestId — byte-equal echo expected in the response. */
|
|
47
|
+
readonly id: RequestId;
|
|
48
|
+
readonly method: M;
|
|
49
|
+
readonly params: {
|
|
50
|
+
readonly meta: CallMeta;
|
|
51
|
+
readonly input: I;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Generic JSON-RPC notification envelope (no `id`).
|
|
56
|
+
*
|
|
57
|
+
* In v0, only row 10 (host.grants.changed) is a legal notification.
|
|
58
|
+
* An object without `id` is a notification — no response may be sent.
|
|
59
|
+
*
|
|
60
|
+
* additionalProperties: false — no members beyond jsonrpc, method, params.
|
|
61
|
+
*/
|
|
62
|
+
export interface WireNotification<M extends string = string, I = unknown> {
|
|
63
|
+
readonly jsonrpc: '2.0';
|
|
64
|
+
readonly method: M;
|
|
65
|
+
readonly params: {
|
|
66
|
+
readonly meta: CallMeta;
|
|
67
|
+
readonly input: I;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Generic JSON-RPC success response envelope.
|
|
72
|
+
*
|
|
73
|
+
* Carries `result`, never `error`. Mutual exclusivity is structural.
|
|
74
|
+
* additionalProperties: false — no members beyond jsonrpc, id, result.
|
|
75
|
+
*/
|
|
76
|
+
export interface WireSuccessResponse<R = unknown> {
|
|
77
|
+
readonly jsonrpc: '2.0';
|
|
78
|
+
/** Byte-equal echo of the originating request's id. */
|
|
79
|
+
readonly id: RequestId;
|
|
80
|
+
readonly result: R;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* JSON-RPC error response — application variant (with typed `data`).
|
|
84
|
+
*
|
|
85
|
+
* Application errors (-32090 through -32094) carry a `data` field
|
|
86
|
+
* with domain-specific payload. See errors.ts for the 5 concrete
|
|
87
|
+
* application error shapes.
|
|
88
|
+
*
|
|
89
|
+
* The `result` member is forbidden (structural mutual exclusivity).
|
|
90
|
+
* additionalProperties: false.
|
|
91
|
+
*/
|
|
92
|
+
export interface WireApplicationErrorResponse<D = unknown> {
|
|
93
|
+
readonly jsonrpc: '2.0';
|
|
94
|
+
/** Byte-equal echo of the originating request's id. */
|
|
95
|
+
readonly id: RequestId;
|
|
96
|
+
readonly error: {
|
|
97
|
+
readonly code: number;
|
|
98
|
+
readonly message: string;
|
|
99
|
+
readonly data: D;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* JSON-RPC error response — standard variant (no `data` field).
|
|
104
|
+
*
|
|
105
|
+
* Standard errors (-32700, -32600, -32601, -32602, -32603) never carry
|
|
106
|
+
* `data`. See errors.ts for the 6 concrete standard error variants.
|
|
107
|
+
*
|
|
108
|
+
* The id field is `RequestId | null`:
|
|
109
|
+
* - null occurs only for Parse error (-32700) and Invalid Request
|
|
110
|
+
* (-32600) when no valid id could be extracted from the frame.
|
|
111
|
+
* - All other standard errors echo the originating request's id.
|
|
112
|
+
*
|
|
113
|
+
* The `result` member is forbidden (structural mutual exclusivity).
|
|
114
|
+
* additionalProperties: false.
|
|
115
|
+
*/
|
|
116
|
+
export interface WireStandardErrorResponse {
|
|
117
|
+
readonly jsonrpc: '2.0';
|
|
118
|
+
/** RequestId echo, or null for Parse error / Invalid Request no-id arm. */
|
|
119
|
+
readonly id: RequestId | null;
|
|
120
|
+
readonly error: {
|
|
121
|
+
readonly code: number;
|
|
122
|
+
readonly message: string;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* HANDSHAKE_REJECTED (-32090) envelope.
|
|
127
|
+
* additionalProperties: false.
|
|
128
|
+
*/
|
|
129
|
+
export interface HandshakeRejectedEnvelope {
|
|
130
|
+
readonly jsonrpc: '2.0';
|
|
131
|
+
readonly id: RequestId;
|
|
132
|
+
readonly error: HandshakeRejectedError;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* DELIVERY_REJECTED (-32091) envelope.
|
|
136
|
+
* additionalProperties: false.
|
|
137
|
+
*/
|
|
138
|
+
export interface DeliveryRejectedEnvelope {
|
|
139
|
+
readonly jsonrpc: '2.0';
|
|
140
|
+
readonly id: RequestId;
|
|
141
|
+
readonly error: DeliveryRejectedError;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* DOMAIN_ERROR (-32092) envelope.
|
|
145
|
+
* additionalProperties: false.
|
|
146
|
+
*/
|
|
147
|
+
export interface DomainErrorEnvelope {
|
|
148
|
+
readonly jsonrpc: '2.0';
|
|
149
|
+
readonly id: RequestId;
|
|
150
|
+
readonly error: DomainError;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* DEADLINE_EXPIRED (-32093) envelope.
|
|
154
|
+
* additionalProperties: false.
|
|
155
|
+
*/
|
|
156
|
+
export interface DeadlineExpiredEnvelope {
|
|
157
|
+
readonly jsonrpc: '2.0';
|
|
158
|
+
readonly id: RequestId;
|
|
159
|
+
readonly error: DeadlineExpiredError;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* SNAPSHOT_UNAVAILABLE (-32094) envelope.
|
|
163
|
+
* additionalProperties: false.
|
|
164
|
+
*/
|
|
165
|
+
export interface SnapshotUnavailableEnvelope {
|
|
166
|
+
readonly jsonrpc: '2.0';
|
|
167
|
+
readonly id: RequestId;
|
|
168
|
+
readonly error: SnapshotUnavailableError;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Parse error (-32700) envelope.
|
|
172
|
+
* id is ALWAYS null — no valid frame was parsed.
|
|
173
|
+
* additionalProperties: false.
|
|
174
|
+
*/
|
|
175
|
+
export interface ParseErrorEnvelope {
|
|
176
|
+
readonly jsonrpc: '2.0';
|
|
177
|
+
readonly id: null;
|
|
178
|
+
readonly error: ParseError;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Invalid Request (-32600) null-id arm envelope.
|
|
182
|
+
* id is null — true detection failure, no valid id could be extracted.
|
|
183
|
+
* additionalProperties: false.
|
|
184
|
+
*/
|
|
185
|
+
export interface InvalidRequestNullIdEnvelope {
|
|
186
|
+
readonly jsonrpc: '2.0';
|
|
187
|
+
readonly id: null;
|
|
188
|
+
readonly error: InvalidRequestError;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Invalid Request (-32600) valid-id arm envelope.
|
|
192
|
+
* id is a byte-equal RequestId echo from the malformed request.
|
|
193
|
+
* additionalProperties: false.
|
|
194
|
+
*/
|
|
195
|
+
export interface InvalidRequestValidIdEnvelope {
|
|
196
|
+
readonly jsonrpc: '2.0';
|
|
197
|
+
readonly id: RequestId;
|
|
198
|
+
readonly error: InvalidRequestError;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Method not found (-32601) envelope.
|
|
202
|
+
* id is a byte-equal RequestId echo.
|
|
203
|
+
* additionalProperties: false.
|
|
204
|
+
*/
|
|
205
|
+
export interface MethodNotFoundEnvelope {
|
|
206
|
+
readonly jsonrpc: '2.0';
|
|
207
|
+
readonly id: RequestId;
|
|
208
|
+
readonly error: MethodNotFoundError;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Invalid params (-32602) envelope.
|
|
212
|
+
* id is a byte-equal RequestId echo.
|
|
213
|
+
* additionalProperties: false.
|
|
214
|
+
*/
|
|
215
|
+
export interface InvalidParamsEnvelope {
|
|
216
|
+
readonly jsonrpc: '2.0';
|
|
217
|
+
readonly id: RequestId;
|
|
218
|
+
readonly error: InvalidParamsError;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Internal error (-32603) envelope.
|
|
222
|
+
* id is a byte-equal RequestId echo.
|
|
223
|
+
* additionalProperties: false.
|
|
224
|
+
*/
|
|
225
|
+
export interface InternalErrorEnvelope {
|
|
226
|
+
readonly jsonrpc: '2.0';
|
|
227
|
+
readonly id: RequestId;
|
|
228
|
+
readonly error: InternalError;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Closed union of all 11 error envelope variants.
|
|
232
|
+
*
|
|
233
|
+
* 5 application error envelopes (all id: RequestId, error carries data):
|
|
234
|
+
* HandshakeRejected, DeliveryRejected, DomainError,
|
|
235
|
+
* DeadlineExpired, SnapshotUnavailable
|
|
236
|
+
*
|
|
237
|
+
* 6 standard error envelopes (no data, varying id):
|
|
238
|
+
* ParseError (id: null), InvalidRequest null-id (id: null),
|
|
239
|
+
* InvalidRequest valid-id (id: RequestId),
|
|
240
|
+
* MethodNotFound, InvalidParams, InternalError (all id: RequestId)
|
|
241
|
+
*/
|
|
242
|
+
export type ClosedWireErrorResponse = HandshakeRejectedEnvelope | DeliveryRejectedEnvelope | DomainErrorEnvelope | DeadlineExpiredEnvelope | SnapshotUnavailableEnvelope | ParseErrorEnvelope | InvalidRequestNullIdEnvelope | InvalidRequestValidIdEnvelope | MethodNotFoundEnvelope | InvalidParamsEnvelope | InternalErrorEnvelope;
|
|
243
|
+
/**
|
|
244
|
+
* Either error variant — closed union of all 11 concrete error envelope shapes.
|
|
245
|
+
* Replaces the previous generic union with the mechanized closed form.
|
|
246
|
+
*/
|
|
247
|
+
export type WireErrorResponse = ClosedWireErrorResponse;
|
|
248
|
+
/**
|
|
249
|
+
* Any JSON-RPC response — success or error, never both.
|
|
250
|
+
* Discriminated at runtime by the presence of `result` vs `error`.
|
|
251
|
+
*/
|
|
252
|
+
export type WireResponse = WireSuccessResponse | WireErrorResponse;
|
|
253
|
+
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/wire/envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,EACX,oBAAoB,EACpB,wBAAwB,EACxB,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACd,MAAM,aAAa,CAAC;AAMrB;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO;IACjE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,C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
2
|
+
* Wire envelope family — closed outer JSON-RPC structures.
|
|
3
|
+
* Mechanized from #1165 R23/R24/R26.
|
|
4
|
+
*
|
|
5
|
+
* The outer envelope family is closed (additionalProperties: false):
|
|
6
|
+
* - WireRequest: id + method + params (request/response)
|
|
7
|
+
* - WireNotification: method + params, no id (row 10 only in v0)
|
|
8
|
+
* - WireSuccessResponse: id + result, no error
|
|
9
|
+
* - WireApplicationErrorResponse: id + error (with data)
|
|
10
|
+
* - WireStandardErrorResponse: id|null + error (no data)
|
|
11
|
+
*
|
|
12
|
+
* Result/error mutual exclusivity is structural — a response carries
|
|
13
|
+
* exactly one of result or error, never both, never neither.
|
|
14
|
+
*
|
|
15
|
+
* This module defines nothing new — every shape traces to a frozen
|
|
16
|
+
* #1165 revision.
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.js","sourceRoot":"","sources":["../../src/wire/envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|