@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.
Files changed (93) hide show
  1. package/dist/conformance/index.d.ts +1 -0
  2. package/dist/conformance/index.d.ts.map +1 -1
  3. package/dist/conformance/index.js +1 -0
  4. package/dist/conformance/index.js.map +1 -1
  5. package/dist/conformance/stdio-harness/child-process-harness.d.ts +59 -0
  6. package/dist/conformance/stdio-harness/child-process-harness.d.ts.map +1 -0
  7. package/dist/conformance/stdio-harness/child-process-harness.js +279 -0
  8. package/dist/conformance/stdio-harness/child-process-harness.js.map +1 -0
  9. package/dist/conformance/stdio-harness/dual-transport-oracle.d.ts +26 -0
  10. package/dist/conformance/stdio-harness/dual-transport-oracle.d.ts.map +1 -0
  11. package/dist/conformance/stdio-harness/dual-transport-oracle.js +32 -0
  12. package/dist/conformance/stdio-harness/dual-transport-oracle.js.map +1 -0
  13. package/dist/conformance/stdio-harness/harness-process-spawn.d.ts +27 -0
  14. package/dist/conformance/stdio-harness/harness-process-spawn.d.ts.map +1 -0
  15. package/dist/conformance/stdio-harness/harness-process-spawn.js +43 -0
  16. package/dist/conformance/stdio-harness/harness-process-spawn.js.map +1 -0
  17. package/dist/conformance/stdio-harness/index.d.ts +5 -0
  18. package/dist/conformance/stdio-harness/index.d.ts.map +1 -0
  19. package/dist/conformance/stdio-harness/index.js +4 -0
  20. package/dist/conformance/stdio-harness/index.js.map +1 -0
  21. package/dist/conformance/stdio-harness/ndjson-frame.d.ts +26 -0
  22. package/dist/conformance/stdio-harness/ndjson-frame.d.ts.map +1 -0
  23. package/dist/conformance/stdio-harness/ndjson-frame.js +119 -0
  24. package/dist/conformance/stdio-harness/ndjson-frame.js.map +1 -0
  25. package/dist/conformance/stdio-harness/node-process-tree-runtime.d.ts +15 -0
  26. package/dist/conformance/stdio-harness/node-process-tree-runtime.d.ts.map +1 -0
  27. package/dist/conformance/stdio-harness/node-process-tree-runtime.js +78 -0
  28. package/dist/conformance/stdio-harness/node-process-tree-runtime.js.map +1 -0
  29. package/dist/conformance/stdio-harness/process-tree-controller.d.ts +51 -0
  30. package/dist/conformance/stdio-harness/process-tree-controller.d.ts.map +1 -0
  31. package/dist/conformance/stdio-harness/process-tree-controller.js +162 -0
  32. package/dist/conformance/stdio-harness/process-tree-controller.js.map +1 -0
  33. package/dist/conformance/stdio-harness/windows-sentinel.d.ts +15 -0
  34. package/dist/conformance/stdio-harness/windows-sentinel.d.ts.map +1 -0
  35. package/dist/conformance/stdio-harness/windows-sentinel.js +160 -0
  36. package/dist/conformance/stdio-harness/windows-sentinel.js.map +1 -0
  37. package/dist/conformance/stdio-harness/wire-shape.d.ts +18 -0
  38. package/dist/conformance/stdio-harness/wire-shape.d.ts.map +1 -0
  39. package/dist/conformance/stdio-harness/wire-shape.js +2 -0
  40. package/dist/conformance/stdio-harness/wire-shape.js.map +1 -0
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +3 -0
  44. package/dist/index.js.map +1 -1
  45. package/dist/wire/constants.d.ts +36 -0
  46. package/dist/wire/constants.d.ts.map +1 -0
  47. package/dist/wire/constants.js +36 -0
  48. package/dist/wire/constants.js.map +1 -0
  49. package/dist/wire/disposition-fixtures.d.ts +99 -0
  50. package/dist/wire/disposition-fixtures.d.ts.map +1 -0
  51. package/dist/wire/disposition-fixtures.js +623 -0
  52. package/dist/wire/disposition-fixtures.js.map +1 -0
  53. package/dist/wire/disposition.d.ts +100 -0
  54. package/dist/wire/disposition.d.ts.map +1 -0
  55. package/dist/wire/disposition.js +205 -0
  56. package/dist/wire/disposition.js.map +1 -0
  57. package/dist/wire/envelope.d.ts +253 -0
  58. package/dist/wire/envelope.d.ts.map +1 -0
  59. package/dist/wire/envelope.js +19 -0
  60. package/dist/wire/envelope.js.map +1 -0
  61. package/dist/wire/errors.d.ts +222 -0
  62. package/dist/wire/errors.d.ts.map +1 -0
  63. package/dist/wire/errors.js +153 -0
  64. package/dist/wire/errors.js.map +1 -0
  65. package/dist/wire/grants.d.ts +57 -0
  66. package/dist/wire/grants.d.ts.map +1 -0
  67. package/dist/wire/grants.js +59 -0
  68. package/dist/wire/grants.js.map +1 -0
  69. package/dist/wire/handshake.d.ts +100 -0
  70. package/dist/wire/handshake.d.ts.map +1 -0
  71. package/dist/wire/handshake.js +70 -0
  72. package/dist/wire/handshake.js.map +1 -0
  73. package/dist/wire/index.d.ts +26 -0
  74. package/dist/wire/index.d.ts.map +1 -0
  75. package/dist/wire/index.js +45 -0
  76. package/dist/wire/index.js.map +1 -0
  77. package/dist/wire/registry.d.ts +90 -0
  78. package/dist/wire/registry.d.ts.map +1 -0
  79. package/dist/wire/registry.js +232 -0
  80. package/dist/wire/registry.js.map +1 -0
  81. package/dist/wire/request-id.d.ts +34 -0
  82. package/dist/wire/request-id.d.ts.map +1 -0
  83. package/dist/wire/request-id.js +40 -0
  84. package/dist/wire/request-id.js.map +1 -0
  85. package/dist/wire/row-shapes.d.ts +212 -0
  86. package/dist/wire/row-shapes.d.ts.map +1 -0
  87. package/dist/wire/row-shapes.js +59 -0
  88. package/dist/wire/row-shapes.js.map +1 -0
  89. package/dist/wire/wire-uint53.d.ts +26 -0
  90. package/dist/wire/wire-uint53.d.ts.map +1 -0
  91. package/dist/wire/wire-uint53.js +32 -0
  92. package/dist/wire/wire-uint53.js.map +1 -0
  93. package/package.json +3 -3
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Per-row input/result shapes for the 12-row method registry.
3
+ * Mechanized from #1165 frozen shape.
4
+ *
5
+ * CLOSED rows (5, 7, 10, 11, 12): full executable shapes with bounds.
6
+ * RESERVED rows (1, 2, 3, 4, 6, 8, 9): type stubs only — no executable
7
+ * contract may be exported until the row's matrix entries close.
8
+ *
9
+ * Each closed row's shape is additionalProperties: false.
10
+ * Bounds constants are provided for runtime validation.
11
+ */
12
+ import type { GrantSnapshot } from './grants.js';
13
+ /**
14
+ * Row 5 input: subscribe to a handle for event delivery.
15
+ * Wire shape: `{ handle: string }` — additionalProperties: false.
16
+ *
17
+ * The handle is a reference identifier (1..256 code points, M4 CLOSED).
18
+ * The peer responds with a subscriptionId for subsequent read/ack calls.
19
+ */
20
+ export interface SubscribeInput {
21
+ /** M4 CLOSED — 1..256 code points. */
22
+ readonly handle: string;
23
+ }
24
+ /**
25
+ * Row 5 result: the created subscription identifier.
26
+ * Wire shape: `{ subscriptionId: string }` — additionalProperties: false.
27
+ */
28
+ export interface SubscribeResult {
29
+ /** M4 CLOSED — 1..128 code points. */
30
+ readonly subscriptionId: string;
31
+ }
32
+ /** Minimum code-point length for subscribe handle. */
33
+ export declare const SUBSCRIBE_HANDLE_MIN_LENGTH: 1;
34
+ /** Maximum code-point length for subscribe handle. */
35
+ export declare const SUBSCRIBE_HANDLE_MAX_LENGTH: 256;
36
+ /**
37
+ * Maximum compact-JSON encoded bytes for subscribe handle.
38
+ * Worst case: every code point is a 6-byte escape (\uXXXX).
39
+ * 6 * 256 + 2 quotes = 1538 bytes.
40
+ */
41
+ export declare const SUBSCRIBE_HANDLE_MAX_ENCODED_BYTES: 1538;
42
+ /** Minimum code-point length for subscriptionId. */
43
+ export declare const SUBSCRIBE_SUBSCRIPTION_ID_MIN_LENGTH: 1;
44
+ /** Maximum code-point length for subscriptionId. */
45
+ export declare const SUBSCRIBE_SUBSCRIPTION_ID_MAX_LENGTH: 128;
46
+ /**
47
+ * Maximum compact-JSON encoded bytes for subscriptionId.
48
+ * 6 * 128 + 2 quotes = 770 bytes.
49
+ */
50
+ export declare const SUBSCRIBE_SUBSCRIPTION_ID_MAX_ENCODED_BYTES: 770;
51
+ /**
52
+ * Row 7 input: acknowledge consumed events on a subscription.
53
+ * Wire shape: `{ subscriptionId, ackToken }` — additionalProperties: false.
54
+ *
55
+ * Closed shape per R3 addendum (owner-specified).
56
+ */
57
+ export interface MessagingAckRequest {
58
+ /** M4 CLOSED — 1..128 code points. */
59
+ readonly subscriptionId: string;
60
+ /** M4 CLOSED — 1..512 code points. */
61
+ readonly ackToken: string;
62
+ }
63
+ /**
64
+ * Row 7 result: null.
65
+ * Ack is fire-and-confirm — a null result signals success.
66
+ */
67
+ export type MessagingAckResult = null;
68
+ /** Minimum code-point length for ack subscriptionId. */
69
+ export declare const ACK_SUBSCRIPTION_ID_MIN_LENGTH: 1;
70
+ /** Maximum code-point length for ack subscriptionId. */
71
+ export declare const ACK_SUBSCRIPTION_ID_MAX_LENGTH: 128;
72
+ /**
73
+ * Maximum compact-JSON encoded bytes for ack subscriptionId.
74
+ * 6 * 128 + 2 quotes = 770 bytes.
75
+ */
76
+ export declare const ACK_SUBSCRIPTION_ID_MAX_ENCODED_BYTES: 770;
77
+ /** Minimum code-point length for ackToken. */
78
+ export declare const ACK_TOKEN_MIN_LENGTH: 1;
79
+ /** Maximum code-point length for ackToken. */
80
+ export declare const ACK_TOKEN_MAX_LENGTH: 512;
81
+ /**
82
+ * Maximum compact-JSON encoded bytes for ackToken.
83
+ * 6 * 512 + 2 quotes = 3074 bytes.
84
+ */
85
+ export declare const ACK_TOKEN_MAX_ENCODED_BYTES: 3074;
86
+ /**
87
+ * Row 10 input: grant-change notification payload.
88
+ *
89
+ * This is a NOTIFICATION (no id, no response). In v0, row 10 is the
90
+ * only legal notification — all other rows are request/response.
91
+ *
92
+ * The input shape is the GrantSnapshot defined in grants.ts:
93
+ * { grantRevision: WireUInt53, effectiveGrants: Capability[] 0..17 }
94
+ *
95
+ * additionalProperties: false. CLOSED.
96
+ */
97
+ export type GrantsChangedInput = GrantSnapshot;
98
+ export type { GrantSnapshot } from './grants.js';
99
+ /**
100
+ * Row 11 input: liveness ping carrying a nonce.
101
+ * Wire shape: `{ nonce: string }` — additionalProperties: false.
102
+ *
103
+ * The peer MUST echo the nonce verbatim in the result.
104
+ */
105
+ export interface PingInput {
106
+ /** M4 CLOSED — string 1..512 code points. */
107
+ readonly nonce: string;
108
+ }
109
+ /**
110
+ * Row 11 result: echo of the input nonce.
111
+ * Wire shape: `{ nonce: string }` — additionalProperties: false.
112
+ *
113
+ * The nonce in the result MUST be byte-equal to the nonce in the input.
114
+ */
115
+ export interface PingResult {
116
+ /** Byte-equal echo of the input nonce. */
117
+ readonly nonce: string;
118
+ }
119
+ /** Minimum code-point length for ping nonce. */
120
+ export declare const PING_NONCE_MIN_LENGTH: 1;
121
+ /** Maximum code-point length for ping nonce. */
122
+ export declare const PING_NONCE_MAX_LENGTH: 512;
123
+ /**
124
+ * Maximum compact-JSON encoded bytes for ping nonce.
125
+ * Worst case: every code point is a 6-byte escape (\uXXXX).
126
+ * 6 * 512 + 2 quotes = 3074 bytes.
127
+ */
128
+ export declare const PING_NONCE_MAX_ENCODED_BYTES: 3074;
129
+ /**
130
+ * Row 12 input: graceful drain with a drain-specific deadline.
131
+ * Wire shape: `{ deadlineUnixMs: number }` — additionalProperties: false.
132
+ *
133
+ * Note: this deadlineUnixMs is the drain-specific deadline in
134
+ * `params.input`, distinct from the request-level deadline in
135
+ * `params.meta.deadlineUnixMs` (CallMeta). Both may coexist.
136
+ *
137
+ * W2 covers "row 12 `params.input.deadlineUnixMs`".
138
+ */
139
+ export interface DrainInput {
140
+ /**
141
+ * Drain-specific deadline.
142
+ * WireUInt53(1, 9_007_199_254_740_991) — same profile as CallMeta.
143
+ */
144
+ readonly deadlineUnixMs: number;
145
+ }
146
+ /**
147
+ * Row 12 result: null.
148
+ * Drain is fire-and-confirm — a null result signals the plugin
149
+ * has completed its graceful shutdown sequence.
150
+ */
151
+ export type DrainResult = null;
152
+ /**
153
+ * Row 1 — broker.hello: RESERVED (H1/H3/H4/H5/H6).
154
+ *
155
+ * Plugin → Host handshake. CandidateHello → SessionBinding.
156
+ * See handshake.ts for structural types.
157
+ * No executable wire input/result contract until reserved entries close.
158
+ */
159
+ export type HelloInput = never;
160
+ export type HelloResult = never;
161
+ /**
162
+ * Row 2 — broker.ready: RESERVED (H1/H3/H4/H5/H6).
163
+ *
164
+ * Plugin → Host activation. The structural type (BrokerReadyParams)
165
+ * exists in handshake.ts, but the wire input/result shapes remain
166
+ * reserved until the row's matrix entries close.
167
+ */
168
+ export type ReadyInput = never;
169
+ export type ReadyResult = never;
170
+ /**
171
+ * Row 3 — messaging.send: RESERVED (M1/M2/M5/I1).
172
+ *
173
+ * Plugin → Host message send. The domain types (MessageDraft,
174
+ * SendReceipt) exist in the generated contract types, but the wire
175
+ * input/result shapes remain reserved until the row's matrix entries close.
176
+ */
177
+ export type SendInput = never;
178
+ export type SendResult = never;
179
+ /**
180
+ * Row 4 — messaging.appendElements: RESERVED (M1/M2/M5/I1).
181
+ *
182
+ * Plugin → Host element append. The domain types exist in the
183
+ * generated contract types, but the wire input/result shapes remain
184
+ * reserved until the row's matrix entries close.
185
+ */
186
+ export type AppendInput = never;
187
+ export type AppendResult = never;
188
+ /**
189
+ * Row 6 — messaging.read: RESERVED (M1/M2/M3/M4/M5/M6/M7/I1).
190
+ *
191
+ * Plugin → Host subscription read. The wire input/result shapes
192
+ * remain reserved until the row's matrix entries close.
193
+ */
194
+ export type ReadInput = never;
195
+ export type ReadResult = never;
196
+ /**
197
+ * Row 8 — messaging.snapshot: RESERVED (M1/M2/M5/M7/I1).
198
+ *
199
+ * Plugin → Host snapshot request. The wire input/result shapes
200
+ * remain reserved until the row's matrix entries close.
201
+ */
202
+ export type SnapshotInput = never;
203
+ export type SnapshotResult = never;
204
+ /**
205
+ * Row 9 — host.messaging.deliver: RESERVED (M1/M2/M5/M7/I1).
206
+ *
207
+ * Host → Plugin delivery push. The wire input/result shapes
208
+ * remain reserved until the row's matrix entries close.
209
+ */
210
+ export type DeliverInput = never;
211
+ export type DeliverResult = never;
212
+ //# sourceMappingURL=row-shapes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row-shapes.d.ts","sourceRoot":"","sources":["../../src/wire/row-shapes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAA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M,YAAY,GAAG,KAAK,CAAC;AACjC,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Per-row input/result shapes for the 12-row method registry.
3
+ * Mechanized from #1165 frozen shape.
4
+ *
5
+ * CLOSED rows (5, 7, 10, 11, 12): full executable shapes with bounds.
6
+ * RESERVED rows (1, 2, 3, 4, 6, 8, 9): type stubs only — no executable
7
+ * contract may be exported until the row's matrix entries close.
8
+ *
9
+ * Each closed row's shape is additionalProperties: false.
10
+ * Bounds constants are provided for runtime validation.
11
+ */
12
+ /** Minimum code-point length for subscribe handle. */
13
+ export const SUBSCRIBE_HANDLE_MIN_LENGTH = 1;
14
+ /** Maximum code-point length for subscribe handle. */
15
+ export const SUBSCRIBE_HANDLE_MAX_LENGTH = 256;
16
+ /**
17
+ * Maximum compact-JSON encoded bytes for subscribe handle.
18
+ * Worst case: every code point is a 6-byte escape (\uXXXX).
19
+ * 6 * 256 + 2 quotes = 1538 bytes.
20
+ */
21
+ export const SUBSCRIBE_HANDLE_MAX_ENCODED_BYTES = 1538;
22
+ /** Minimum code-point length for subscriptionId. */
23
+ export const SUBSCRIBE_SUBSCRIPTION_ID_MIN_LENGTH = 1;
24
+ /** Maximum code-point length for subscriptionId. */
25
+ export const SUBSCRIBE_SUBSCRIPTION_ID_MAX_LENGTH = 128;
26
+ /**
27
+ * Maximum compact-JSON encoded bytes for subscriptionId.
28
+ * 6 * 128 + 2 quotes = 770 bytes.
29
+ */
30
+ export const SUBSCRIBE_SUBSCRIPTION_ID_MAX_ENCODED_BYTES = 770;
31
+ /** Minimum code-point length for ack subscriptionId. */
32
+ export const ACK_SUBSCRIPTION_ID_MIN_LENGTH = 1;
33
+ /** Maximum code-point length for ack subscriptionId. */
34
+ export const ACK_SUBSCRIPTION_ID_MAX_LENGTH = 128;
35
+ /**
36
+ * Maximum compact-JSON encoded bytes for ack subscriptionId.
37
+ * 6 * 128 + 2 quotes = 770 bytes.
38
+ */
39
+ export const ACK_SUBSCRIPTION_ID_MAX_ENCODED_BYTES = 770;
40
+ /** Minimum code-point length for ackToken. */
41
+ export const ACK_TOKEN_MIN_LENGTH = 1;
42
+ /** Maximum code-point length for ackToken. */
43
+ export const ACK_TOKEN_MAX_LENGTH = 512;
44
+ /**
45
+ * Maximum compact-JSON encoded bytes for ackToken.
46
+ * 6 * 512 + 2 quotes = 3074 bytes.
47
+ */
48
+ export const ACK_TOKEN_MAX_ENCODED_BYTES = 3074;
49
+ /** Minimum code-point length for ping nonce. */
50
+ export const PING_NONCE_MIN_LENGTH = 1;
51
+ /** Maximum code-point length for ping nonce. */
52
+ export const PING_NONCE_MAX_LENGTH = 512;
53
+ /**
54
+ * Maximum compact-JSON encoded bytes for ping nonce.
55
+ * Worst case: every code point is a 6-byte escape (\uXXXX).
56
+ * 6 * 512 + 2 quotes = 3074 bytes.
57
+ */
58
+ export const PING_NONCE_MAX_ENCODED_BYTES = 3074;
59
+ //# sourceMappingURL=row-shapes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row-shapes.js","sourceRoot":"","sources":["../../src/wire/row-shapes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA8BH,sDAAsD;AACtD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAU,CAAC;AAEtD,sDAAsD;AACtD,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAY,CAAC;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAa,CAAC;AAEhE,oDAAoD;AACpD,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAU,CAAC;AAE/D,oDAAoD;AACpD,MAAM,CAAC,MAAM,oCAAoC,GAAG,GAAY,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,GAAY,CAAC;AAyBxE,wDAAwD;AACxD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAU,CAAC;AAEzD,wDAAwD;AACxD,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAY,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,GAAY,CAAC;AAElE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAU,CAAC;AAE/C,8CAA8C;AAC9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAY,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAa,CAAC;AAiDzD,gDAAgD;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAU,CAAC;AAEhD,gDAAgD;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAY,CAAC;AAElD;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAa,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * WireUInt53 — the single contract-owned numeric profile.
3
+ * Mechanized from the #1165 frozen shape.
4
+ *
5
+ * Raw JSON lexeme: canonical decimal digits 0|[1-9][0-9]*
6
+ * No sign, no decimal point, no exponent, no leading zeros.
7
+ * Raw token length ≤ 16 characters.
8
+ * Parsed value: non-negative safe integer.
9
+ */
10
+ /** Maximum safe integer (2^53 - 1). */
11
+ export declare const WIRE_UINT53_MAX: 9007199254740991;
12
+ /** Pattern for canonical decimal integer raw tokens. */
13
+ export declare const WIRE_UINT53_RAW_PATTERN: RegExp;
14
+ /** Maximum raw token length (digit count of 2^53-1). */
15
+ export declare const WIRE_UINT53_MAX_RAW_LENGTH: 16;
16
+ /**
17
+ * Validate a parsed number as a WireUInt53.
18
+ * Checks Number.isSafeInteger and non-negative.
19
+ */
20
+ export declare function isWireUInt53(value: number, min?: number, max?: number): boolean;
21
+ /**
22
+ * Validate a raw JSON token as a canonical WireUInt53 lexeme.
23
+ * Must be checked BEFORE JSON.parse (pre-dispatch).
24
+ */
25
+ export declare function isCanonicalUInt53Token(rawToken: string): boolean;
26
+ //# sourceMappingURL=wire-uint53.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire-uint53.d.ts","sourceRoot":"","sources":["../../src/wire/wire-uint53.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uCAAuC;AACvC,eAAO,MAAM,eAAe,EAAG,gBAA8B,CAAC;AAE9D,wDAAwD;AACxD,eAAO,MAAM,uBAAuB,QAAwB,CAAC;AAE7D,wDAAwD;AACxD,eAAO,MAAM,0BAA0B,EAAG,EAAW,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,GAAE,MAAU,EAAE,GAAG,GAAE,MAAwB,GAAG,OAAO,CAEnG;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGhE"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * WireUInt53 — the single contract-owned numeric profile.
3
+ * Mechanized from the #1165 frozen shape.
4
+ *
5
+ * Raw JSON lexeme: canonical decimal digits 0|[1-9][0-9]*
6
+ * No sign, no decimal point, no exponent, no leading zeros.
7
+ * Raw token length ≤ 16 characters.
8
+ * Parsed value: non-negative safe integer.
9
+ */
10
+ /** Maximum safe integer (2^53 - 1). */
11
+ export const WIRE_UINT53_MAX = 9_007_199_254_740_991;
12
+ /** Pattern for canonical decimal integer raw tokens. */
13
+ export const WIRE_UINT53_RAW_PATTERN = /^(?:0|[1-9][0-9]*)$/;
14
+ /** Maximum raw token length (digit count of 2^53-1). */
15
+ export const WIRE_UINT53_MAX_RAW_LENGTH = 16;
16
+ /**
17
+ * Validate a parsed number as a WireUInt53.
18
+ * Checks Number.isSafeInteger and non-negative.
19
+ */
20
+ export function isWireUInt53(value, min = 0, max = WIRE_UINT53_MAX) {
21
+ return Number.isSafeInteger(value) && value >= min && value <= max;
22
+ }
23
+ /**
24
+ * Validate a raw JSON token as a canonical WireUInt53 lexeme.
25
+ * Must be checked BEFORE JSON.parse (pre-dispatch).
26
+ */
27
+ export function isCanonicalUInt53Token(rawToken) {
28
+ if (rawToken.length === 0 || rawToken.length > WIRE_UINT53_MAX_RAW_LENGTH)
29
+ return false;
30
+ return WIRE_UINT53_RAW_PATTERN.test(rawToken);
31
+ }
32
+ //# sourceMappingURL=wire-uint53.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire-uint53.js","sourceRoot":"","sources":["../../src/wire/wire-uint53.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uCAAuC;AACvC,MAAM,CAAC,MAAM,eAAe,GAAG,qBAA8B,CAAC;AAE9D,wDAAwD;AACxD,MAAM,CAAC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE7D,wDAAwD;AACxD,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAW,CAAC;AAEtD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,MAAc,CAAC,EAAE,MAAc,eAAe;IACxF,OAAO,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI,GAAG,CAAC;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,0BAA0B;QAAE,OAAO,KAAK,CAAC;IACxF,OAAO,uBAAuB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAChD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clowder-ai/plugin-contract",
3
- "version": "0.1.0-beta.2",
3
+ "version": "0.1.0-beta.3",
4
4
  "private": false,
5
5
  "description": "Clowder AI plugin contract — the single machine-readable truth source for plugin schema, types, capability table, and conformance fixtures (P15)",
6
6
  "license": "MIT",
@@ -31,9 +31,9 @@
31
31
  "scripts": {
32
32
  "generate": "node --import tsx src/codegen/generate-contract.ts",
33
33
  "generate:check": "node --import tsx src/codegen/generate-contract.ts --check",
34
- "build": "pnpm clean && tsc -p tsconfig.build.json",
34
+ "build": "pnpm clean && tsc -p tsconfig.build.json && node --test scripts/conformance-public-boundary.test.mjs",
35
35
  "typecheck": "tsc --noEmit",
36
- "test": "node --import tsx --test src/**/*.test.ts",
36
+ "test": "node --import tsx --test src/**/*.test.ts src/**/**/*.test.ts",
37
37
  "conformance": "node --import tsx src/conformance/runner.ts",
38
38
  "lint": "tsc --noEmit",
39
39
  "clean": "rm -rf dist",