@canonmsg/backend-contracts 2.2.0 → 3.0.0
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/canon-verb-wire.schema.json +155 -4
- package/dist/canon-verbs.limits.json +9 -1
- package/dist/canon-verbs.schema.json +161 -9
- package/dist/cjs/contactRequest.js +4 -1
- package/dist/cjs/environment.js +29 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/verbContract.js +70 -1
- package/dist/cjs/verbSchemas.js +88 -10
- package/dist/cjs/verbWire.js +5 -2
- package/dist/contactRequest.d.ts +1 -0
- package/dist/contactRequest.js +4 -1
- package/dist/environment.d.ts +25 -0
- package/dist/environment.js +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/verbContract.d.ts +66 -4
- package/dist/verbContract.js +68 -0
- package/dist/verbSchemas.d.ts +281 -2
- package/dist/verbSchemas.js +87 -9
- package/dist/verbWire.d.ts +145 -6
- package/dist/verbWire.js +5 -2
- package/package.json +2 -2
package/dist/verbSchemas.d.ts
CHANGED
|
@@ -28,6 +28,146 @@
|
|
|
28
28
|
* endpoints validate against these schemas directly).
|
|
29
29
|
*/
|
|
30
30
|
import { type CanonVerbName } from './verbContract.js';
|
|
31
|
+
export declare const VERB_NATIVE_METADATA_JSON_SCHEMA: {
|
|
32
|
+
readonly type: "object";
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly maxProperties: 24;
|
|
35
|
+
readonly additionalProperties: false;
|
|
36
|
+
readonly properties: {
|
|
37
|
+
readonly runtime: {
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
40
|
+
readonly maxLength: 256;
|
|
41
|
+
};
|
|
42
|
+
readonly method: {
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
readonly pattern: "^[A-Za-z0-9_][A-Za-z0-9_./:\\-]{0,255}$";
|
|
45
|
+
readonly maxLength: 256;
|
|
46
|
+
};
|
|
47
|
+
readonly requestId: {
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
50
|
+
readonly maxLength: 256;
|
|
51
|
+
};
|
|
52
|
+
readonly provider: {
|
|
53
|
+
readonly type: "string";
|
|
54
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
55
|
+
readonly maxLength: 256;
|
|
56
|
+
};
|
|
57
|
+
readonly origin: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
60
|
+
readonly maxLength: 256;
|
|
61
|
+
};
|
|
62
|
+
readonly surface: {
|
|
63
|
+
readonly type: "string";
|
|
64
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
65
|
+
readonly maxLength: 256;
|
|
66
|
+
};
|
|
67
|
+
readonly threadId: {
|
|
68
|
+
readonly type: "string";
|
|
69
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
70
|
+
readonly maxLength: 256;
|
|
71
|
+
};
|
|
72
|
+
readonly turnId: {
|
|
73
|
+
readonly type: "string";
|
|
74
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
75
|
+
readonly maxLength: 256;
|
|
76
|
+
};
|
|
77
|
+
readonly runId: {
|
|
78
|
+
readonly type: "string";
|
|
79
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
80
|
+
readonly maxLength: 256;
|
|
81
|
+
};
|
|
82
|
+
readonly itemId: {
|
|
83
|
+
readonly type: "string";
|
|
84
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
85
|
+
readonly maxLength: 256;
|
|
86
|
+
};
|
|
87
|
+
readonly toolCallId: {
|
|
88
|
+
readonly type: "string";
|
|
89
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
90
|
+
readonly maxLength: 256;
|
|
91
|
+
};
|
|
92
|
+
readonly approvalId: {
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
95
|
+
readonly maxLength: 256;
|
|
96
|
+
};
|
|
97
|
+
readonly pluginId: {
|
|
98
|
+
readonly type: "string";
|
|
99
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
100
|
+
readonly maxLength: 256;
|
|
101
|
+
};
|
|
102
|
+
readonly sessionKey: {
|
|
103
|
+
readonly type: "string";
|
|
104
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
105
|
+
readonly maxLength: 256;
|
|
106
|
+
};
|
|
107
|
+
readonly nodeId: {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
110
|
+
readonly maxLength: 256;
|
|
111
|
+
};
|
|
112
|
+
readonly handles: {
|
|
113
|
+
readonly type: "object";
|
|
114
|
+
readonly maxProperties: 16;
|
|
115
|
+
readonly propertyNames: {
|
|
116
|
+
readonly pattern: "^[A-Za-z0-9_.:-]{1,80}$";
|
|
117
|
+
};
|
|
118
|
+
readonly additionalProperties: {
|
|
119
|
+
readonly type: "string";
|
|
120
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
121
|
+
readonly maxLength: 256;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export declare const VERB_SESSION_CONFIG_JSON_SCHEMA: {
|
|
127
|
+
readonly type: "object";
|
|
128
|
+
readonly description: string;
|
|
129
|
+
readonly additionalProperties: false;
|
|
130
|
+
readonly properties: {
|
|
131
|
+
readonly model: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
134
|
+
readonly maxLength: 256;
|
|
135
|
+
};
|
|
136
|
+
readonly permissionMode: {
|
|
137
|
+
readonly type: "string";
|
|
138
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
139
|
+
readonly maxLength: 256;
|
|
140
|
+
};
|
|
141
|
+
readonly effort: {
|
|
142
|
+
readonly type: "string";
|
|
143
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
144
|
+
readonly maxLength: 256;
|
|
145
|
+
};
|
|
146
|
+
readonly workspaceId: {
|
|
147
|
+
readonly type: "string";
|
|
148
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
149
|
+
readonly maxLength: 256;
|
|
150
|
+
};
|
|
151
|
+
readonly executionMode: {
|
|
152
|
+
readonly enum: readonly ["worktree", "locked"];
|
|
153
|
+
};
|
|
154
|
+
readonly runtimeControlValues: {
|
|
155
|
+
readonly type: "object";
|
|
156
|
+
readonly maxProperties: 24;
|
|
157
|
+
readonly propertyNames: {
|
|
158
|
+
readonly pattern: "^[A-Za-z0-9_-]{1,80}$";
|
|
159
|
+
readonly not: {
|
|
160
|
+
readonly enum: readonly ["model", "workspace", "executionMode", "permissionMode", "effort", "interrupt", "runtimeControlValues", "updatedAt", "updatedBy"];
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
readonly additionalProperties: {
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
166
|
+
readonly maxLength: 256;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
31
171
|
export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
32
172
|
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
33
173
|
readonly $id: "https://canonmsg.com/schemas/canon.verbs.v1.json";
|
|
@@ -372,7 +512,142 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
372
512
|
readonly native: {
|
|
373
513
|
readonly type: "object";
|
|
374
514
|
readonly description: string;
|
|
375
|
-
readonly
|
|
515
|
+
readonly maxProperties: 24;
|
|
516
|
+
readonly additionalProperties: false;
|
|
517
|
+
readonly properties: {
|
|
518
|
+
readonly runtime: {
|
|
519
|
+
readonly type: "string";
|
|
520
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
521
|
+
readonly maxLength: 256;
|
|
522
|
+
};
|
|
523
|
+
readonly method: {
|
|
524
|
+
readonly type: "string";
|
|
525
|
+
readonly pattern: "^[A-Za-z0-9_][A-Za-z0-9_./:\\-]{0,255}$";
|
|
526
|
+
readonly maxLength: 256;
|
|
527
|
+
};
|
|
528
|
+
readonly requestId: {
|
|
529
|
+
readonly type: "string";
|
|
530
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
531
|
+
readonly maxLength: 256;
|
|
532
|
+
};
|
|
533
|
+
readonly provider: {
|
|
534
|
+
readonly type: "string";
|
|
535
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
536
|
+
readonly maxLength: 256;
|
|
537
|
+
};
|
|
538
|
+
readonly origin: {
|
|
539
|
+
readonly type: "string";
|
|
540
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
541
|
+
readonly maxLength: 256;
|
|
542
|
+
};
|
|
543
|
+
readonly surface: {
|
|
544
|
+
readonly type: "string";
|
|
545
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
546
|
+
readonly maxLength: 256;
|
|
547
|
+
};
|
|
548
|
+
readonly threadId: {
|
|
549
|
+
readonly type: "string";
|
|
550
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
551
|
+
readonly maxLength: 256;
|
|
552
|
+
};
|
|
553
|
+
readonly turnId: {
|
|
554
|
+
readonly type: "string";
|
|
555
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
556
|
+
readonly maxLength: 256;
|
|
557
|
+
};
|
|
558
|
+
readonly runId: {
|
|
559
|
+
readonly type: "string";
|
|
560
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
561
|
+
readonly maxLength: 256;
|
|
562
|
+
};
|
|
563
|
+
readonly itemId: {
|
|
564
|
+
readonly type: "string";
|
|
565
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
566
|
+
readonly maxLength: 256;
|
|
567
|
+
};
|
|
568
|
+
readonly toolCallId: {
|
|
569
|
+
readonly type: "string";
|
|
570
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
571
|
+
readonly maxLength: 256;
|
|
572
|
+
};
|
|
573
|
+
readonly approvalId: {
|
|
574
|
+
readonly type: "string";
|
|
575
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
576
|
+
readonly maxLength: 256;
|
|
577
|
+
};
|
|
578
|
+
readonly pluginId: {
|
|
579
|
+
readonly type: "string";
|
|
580
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
581
|
+
readonly maxLength: 256;
|
|
582
|
+
};
|
|
583
|
+
readonly sessionKey: {
|
|
584
|
+
readonly type: "string";
|
|
585
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
586
|
+
readonly maxLength: 256;
|
|
587
|
+
};
|
|
588
|
+
readonly nodeId: {
|
|
589
|
+
readonly type: "string";
|
|
590
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
591
|
+
readonly maxLength: 256;
|
|
592
|
+
};
|
|
593
|
+
readonly handles: {
|
|
594
|
+
readonly type: "object";
|
|
595
|
+
readonly maxProperties: 16;
|
|
596
|
+
readonly propertyNames: {
|
|
597
|
+
readonly pattern: "^[A-Za-z0-9_.:-]{1,80}$";
|
|
598
|
+
};
|
|
599
|
+
readonly additionalProperties: {
|
|
600
|
+
readonly type: "string";
|
|
601
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
602
|
+
readonly maxLength: 256;
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
};
|
|
606
|
+
};
|
|
607
|
+
readonly sessionConfig: {
|
|
608
|
+
readonly type: "object";
|
|
609
|
+
readonly description: string;
|
|
610
|
+
readonly additionalProperties: false;
|
|
611
|
+
readonly properties: {
|
|
612
|
+
readonly model: {
|
|
613
|
+
readonly type: "string";
|
|
614
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
615
|
+
readonly maxLength: 256;
|
|
616
|
+
};
|
|
617
|
+
readonly permissionMode: {
|
|
618
|
+
readonly type: "string";
|
|
619
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
620
|
+
readonly maxLength: 256;
|
|
621
|
+
};
|
|
622
|
+
readonly effort: {
|
|
623
|
+
readonly type: "string";
|
|
624
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
625
|
+
readonly maxLength: 256;
|
|
626
|
+
};
|
|
627
|
+
readonly workspaceId: {
|
|
628
|
+
readonly type: "string";
|
|
629
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
630
|
+
readonly maxLength: 256;
|
|
631
|
+
};
|
|
632
|
+
readonly executionMode: {
|
|
633
|
+
readonly enum: readonly ["worktree", "locked"];
|
|
634
|
+
};
|
|
635
|
+
readonly runtimeControlValues: {
|
|
636
|
+
readonly type: "object";
|
|
637
|
+
readonly maxProperties: 24;
|
|
638
|
+
readonly propertyNames: {
|
|
639
|
+
readonly pattern: "^[A-Za-z0-9_-]{1,80}$";
|
|
640
|
+
readonly not: {
|
|
641
|
+
readonly enum: readonly ["model", "workspace", "executionMode", "permissionMode", "effort", "interrupt", "runtimeControlValues", "updatedAt", "updatedBy"];
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
readonly additionalProperties: {
|
|
645
|
+
readonly type: "string";
|
|
646
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
647
|
+
readonly maxLength: 256;
|
|
648
|
+
};
|
|
649
|
+
};
|
|
650
|
+
};
|
|
376
651
|
};
|
|
377
652
|
readonly send_to_input: {
|
|
378
653
|
readonly type: "object";
|
|
@@ -413,7 +688,11 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
413
688
|
$ref: string;
|
|
414
689
|
};
|
|
415
690
|
readonly sessionConfig: {
|
|
416
|
-
readonly
|
|
691
|
+
readonly oneOf: readonly [{
|
|
692
|
+
$ref: string;
|
|
693
|
+
}, {
|
|
694
|
+
readonly type: "null";
|
|
695
|
+
}];
|
|
417
696
|
readonly description: string;
|
|
418
697
|
};
|
|
419
698
|
readonly messageOptions: {
|
package/dist/verbSchemas.js
CHANGED
|
@@ -247,12 +247,89 @@ const runtimeCardDef = {
|
|
|
247
247
|
blocks: { type: 'array', minItems: 1, maxItems: VERB_LIMITS.cardServerBlocks },
|
|
248
248
|
},
|
|
249
249
|
};
|
|
250
|
-
const
|
|
250
|
+
const runtimeCorrelationValueDef = {
|
|
251
|
+
type: 'string',
|
|
252
|
+
pattern: VERB_ID_PATTERNS.runtimeCorrelationValue,
|
|
253
|
+
maxLength: VERB_LIMITS.nativeValueChars,
|
|
254
|
+
};
|
|
255
|
+
const runtimeMethodDef = {
|
|
256
|
+
type: 'string',
|
|
257
|
+
pattern: VERB_ID_PATTERNS.runtimeMethod,
|
|
258
|
+
maxLength: VERB_LIMITS.nativeValueChars,
|
|
259
|
+
};
|
|
260
|
+
export const VERB_NATIVE_METADATA_JSON_SCHEMA = {
|
|
251
261
|
type: 'object',
|
|
252
|
-
description:
|
|
253
|
-
+
|
|
254
|
-
|
|
255
|
-
additionalProperties:
|
|
262
|
+
description: 'Content-free runtime correlation ids. Commands, paths, prompts, summaries, '
|
|
263
|
+
+ 'and model labels are not permitted in this public envelope.',
|
|
264
|
+
maxProperties: VERB_LIMITS.nativeKeys,
|
|
265
|
+
additionalProperties: false,
|
|
266
|
+
properties: {
|
|
267
|
+
runtime: runtimeCorrelationValueDef,
|
|
268
|
+
method: runtimeMethodDef,
|
|
269
|
+
requestId: runtimeCorrelationValueDef,
|
|
270
|
+
provider: runtimeCorrelationValueDef,
|
|
271
|
+
origin: runtimeCorrelationValueDef,
|
|
272
|
+
surface: runtimeCorrelationValueDef,
|
|
273
|
+
threadId: runtimeCorrelationValueDef,
|
|
274
|
+
turnId: runtimeCorrelationValueDef,
|
|
275
|
+
runId: runtimeCorrelationValueDef,
|
|
276
|
+
itemId: runtimeCorrelationValueDef,
|
|
277
|
+
toolCallId: runtimeCorrelationValueDef,
|
|
278
|
+
approvalId: runtimeCorrelationValueDef,
|
|
279
|
+
pluginId: runtimeCorrelationValueDef,
|
|
280
|
+
sessionKey: runtimeCorrelationValueDef,
|
|
281
|
+
nodeId: runtimeCorrelationValueDef,
|
|
282
|
+
handles: {
|
|
283
|
+
type: 'object',
|
|
284
|
+
maxProperties: VERB_LIMITS.nativeHandles,
|
|
285
|
+
propertyNames: { pattern: VERB_ID_PATTERNS.runtimeHandleKey },
|
|
286
|
+
additionalProperties: runtimeCorrelationValueDef,
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
const sessionConfigValueDef = {
|
|
291
|
+
type: 'string',
|
|
292
|
+
pattern: VERB_ID_PATTERNS.runtimeOptionValue,
|
|
293
|
+
maxLength: VERB_LIMITS.sessionConfigValueChars,
|
|
294
|
+
};
|
|
295
|
+
export const VERB_SESSION_CONFIG_JSON_SCHEMA = {
|
|
296
|
+
type: 'object',
|
|
297
|
+
description: 'Typed setup policy for an agent target. Values are stable runtime-advertised '
|
|
298
|
+
+ 'option ids and are validated against the target descriptor before session creation; '
|
|
299
|
+
+ 'labels, prompts, workspace paths, and arbitrary fields are not permitted.',
|
|
300
|
+
additionalProperties: false,
|
|
301
|
+
properties: {
|
|
302
|
+
model: sessionConfigValueDef,
|
|
303
|
+
permissionMode: sessionConfigValueDef,
|
|
304
|
+
effort: sessionConfigValueDef,
|
|
305
|
+
workspaceId: {
|
|
306
|
+
type: 'string',
|
|
307
|
+
pattern: VERB_ID_PATTERNS.workspaceOptionId,
|
|
308
|
+
maxLength: VERB_LIMITS.sessionConfigValueChars,
|
|
309
|
+
},
|
|
310
|
+
executionMode: { enum: ['worktree', 'locked'] },
|
|
311
|
+
runtimeControlValues: {
|
|
312
|
+
type: 'object',
|
|
313
|
+
maxProperties: VERB_LIMITS.sessionConfigValues,
|
|
314
|
+
propertyNames: {
|
|
315
|
+
pattern: VERB_ID_PATTERNS.runtimeControlId,
|
|
316
|
+
not: {
|
|
317
|
+
enum: [
|
|
318
|
+
'model',
|
|
319
|
+
'workspace',
|
|
320
|
+
'executionMode',
|
|
321
|
+
'permissionMode',
|
|
322
|
+
'effort',
|
|
323
|
+
'interrupt',
|
|
324
|
+
'runtimeControlValues',
|
|
325
|
+
'updatedAt',
|
|
326
|
+
'updatedBy',
|
|
327
|
+
],
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
additionalProperties: sessionConfigValueDef,
|
|
331
|
+
},
|
|
332
|
+
},
|
|
256
333
|
};
|
|
257
334
|
const timeoutFields = (maxMs, ceilingNote) => ({
|
|
258
335
|
timeoutMs: {
|
|
@@ -265,7 +342,7 @@ const timeoutFields = (maxMs, ceilingNote) => ({
|
|
|
265
342
|
type: 'integer',
|
|
266
343
|
minimum: 0,
|
|
267
344
|
description: 'Absolute epoch-ms deadline. The REST interaction creators REQUIRE a deadline '
|
|
268
|
-
+ '(
|
|
345
|
+
+ '(input interactions also require input subtype kind): bindings must fill defaults '
|
|
269
346
|
+ 'and convert timeoutMs into expiresAt before calling the endpoint.',
|
|
270
347
|
},
|
|
271
348
|
});
|
|
@@ -308,7 +385,7 @@ const send_to_input = {
|
|
|
308
385
|
},
|
|
309
386
|
sessionSelection: REF('sessionSelection'),
|
|
310
387
|
sessionConfig: {
|
|
311
|
-
|
|
388
|
+
oneOf: [REF('sessionConfig'), { type: 'null' }],
|
|
312
389
|
description: 'Coding-agent session setup (model/permissionMode/effort/workspaceId/executionMode); '
|
|
313
390
|
+ 'only applied to agent targets, stripped for humans.',
|
|
314
391
|
},
|
|
@@ -539,7 +616,7 @@ const check_approval_input = {
|
|
|
539
616
|
};
|
|
540
617
|
const check_approval_result = {
|
|
541
618
|
description: "'unknown' is NOT a denial — only 'resolved' carries a decision. Canonical statuses map "
|
|
542
|
-
+ 'from the
|
|
619
|
+
+ 'from the approval interaction consume result as: allow/deny -> resolved.decision, timeout -> '
|
|
543
620
|
+ 'expired, pending -> pending, HTTP 404 RUNTIME_APPROVAL_NOT_FOUND -> unknown.',
|
|
544
621
|
oneOf: [
|
|
545
622
|
{
|
|
@@ -1000,7 +1077,8 @@ export const CANON_VERBS_JSON_SCHEMA = {
|
|
|
1000
1077
|
unifiedDiff: unifiedDiffDef,
|
|
1001
1078
|
sessionRule: sessionRuleDef,
|
|
1002
1079
|
runtimeCard: runtimeCardDef,
|
|
1003
|
-
native:
|
|
1080
|
+
native: VERB_NATIVE_METADATA_JSON_SCHEMA,
|
|
1081
|
+
sessionConfig: VERB_SESSION_CONFIG_JSON_SCHEMA,
|
|
1004
1082
|
send_to_input,
|
|
1005
1083
|
send_to_result,
|
|
1006
1084
|
request_input_input,
|
package/dist/verbWire.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* cards, prompts, questions, tool names/summaries, details, diffs, and
|
|
26
26
|
* self-contexts are body.
|
|
27
27
|
*/
|
|
28
|
-
import { type CanonVerbName, type VerbSessionSelection } from './verbContract.js';
|
|
28
|
+
import { type CanonVerbName, type VerbNativeMetadata, type VerbSessionConfig, type VerbSessionSelection } from './verbContract.js';
|
|
29
29
|
export declare const CANON_VERB_WIRE_SCHEMA_VERSION = "canon.verb-wire.v1";
|
|
30
30
|
export declare const CANON_VERB_WIRE_SCHEMA_ID = "https://canonmsg.com/schemas/canon.verb-wire.v1.json";
|
|
31
31
|
export type VerbWireBody = {
|
|
@@ -53,8 +53,9 @@ export interface VerbWireTurn {
|
|
|
53
53
|
* Documented leak decisions (see e2ee-mls.md §10): `mentions` stays
|
|
54
54
|
* plaintext for routing + mention-piercing pushes (D3); `contactUserId` on
|
|
55
55
|
* share_contact reveals who was shared (explicitly accepted for v1);
|
|
56
|
-
* `sessionConfig`
|
|
57
|
-
*
|
|
56
|
+
* `sessionConfig` carries only typed runtime option ids; `native` carries only
|
|
57
|
+
* typed correlation ids. Paths, labels, prompts, summaries, and other free
|
|
58
|
+
* text belong in the body or owner-local runtime state.
|
|
58
59
|
*/
|
|
59
60
|
export interface CanonVerbWireEnvelope {
|
|
60
61
|
conversationId?: string;
|
|
@@ -74,7 +75,7 @@ export interface CanonVerbWireEnvelope {
|
|
|
74
75
|
risk?: 'low' | 'normal' | 'high' | 'destructive';
|
|
75
76
|
category?: 'command' | 'file' | 'network' | 'browser' | 'mcp' | 'plugin' | 'canon' | 'tool';
|
|
76
77
|
sessionSelection?: VerbSessionSelection;
|
|
77
|
-
sessionConfig?:
|
|
78
|
+
sessionConfig?: VerbSessionConfig | null;
|
|
78
79
|
idempotencyKey?: string;
|
|
79
80
|
/** Target-message reference for react/forward — routing, not content. */
|
|
80
81
|
messageId?: string;
|
|
@@ -84,7 +85,7 @@ export interface CanonVerbWireEnvelope {
|
|
|
84
85
|
/** Group-membership routing ids (create_group) — distinct from mentions. */
|
|
85
86
|
memberIds?: string[];
|
|
86
87
|
turn?: VerbWireTurn;
|
|
87
|
-
native?:
|
|
88
|
+
native?: VerbNativeMetadata;
|
|
88
89
|
runtimeId?: string;
|
|
89
90
|
limit?: number;
|
|
90
91
|
}
|
|
@@ -268,7 +269,53 @@ export declare const CANON_VERB_WIRE_JSON_SCHEMA: {
|
|
|
268
269
|
}];
|
|
269
270
|
};
|
|
270
271
|
readonly sessionConfig: {
|
|
271
|
-
readonly
|
|
272
|
+
readonly oneOf: readonly [{
|
|
273
|
+
readonly type: "object";
|
|
274
|
+
readonly description: string;
|
|
275
|
+
readonly additionalProperties: false;
|
|
276
|
+
readonly properties: {
|
|
277
|
+
readonly model: {
|
|
278
|
+
readonly type: "string";
|
|
279
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
280
|
+
readonly maxLength: 256;
|
|
281
|
+
};
|
|
282
|
+
readonly permissionMode: {
|
|
283
|
+
readonly type: "string";
|
|
284
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
285
|
+
readonly maxLength: 256;
|
|
286
|
+
};
|
|
287
|
+
readonly effort: {
|
|
288
|
+
readonly type: "string";
|
|
289
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
290
|
+
readonly maxLength: 256;
|
|
291
|
+
};
|
|
292
|
+
readonly workspaceId: {
|
|
293
|
+
readonly type: "string";
|
|
294
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
295
|
+
readonly maxLength: 256;
|
|
296
|
+
};
|
|
297
|
+
readonly executionMode: {
|
|
298
|
+
readonly enum: readonly ["worktree", "locked"];
|
|
299
|
+
};
|
|
300
|
+
readonly runtimeControlValues: {
|
|
301
|
+
readonly type: "object";
|
|
302
|
+
readonly maxProperties: 24;
|
|
303
|
+
readonly propertyNames: {
|
|
304
|
+
readonly pattern: "^[A-Za-z0-9_-]{1,80}$";
|
|
305
|
+
readonly not: {
|
|
306
|
+
readonly enum: readonly ["model", "workspace", "executionMode", "permissionMode", "effort", "interrupt", "runtimeControlValues", "updatedAt", "updatedBy"];
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
readonly additionalProperties: {
|
|
310
|
+
readonly type: "string";
|
|
311
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
312
|
+
readonly maxLength: 256;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
}, {
|
|
317
|
+
readonly type: "null";
|
|
318
|
+
}];
|
|
272
319
|
};
|
|
273
320
|
readonly idempotencyKey: {
|
|
274
321
|
readonly type: "string";
|
|
@@ -307,6 +354,98 @@ export declare const CANON_VERB_WIRE_JSON_SCHEMA: {
|
|
|
307
354
|
};
|
|
308
355
|
readonly native: {
|
|
309
356
|
readonly type: "object";
|
|
357
|
+
readonly description: string;
|
|
358
|
+
readonly maxProperties: 24;
|
|
359
|
+
readonly additionalProperties: false;
|
|
360
|
+
readonly properties: {
|
|
361
|
+
readonly runtime: {
|
|
362
|
+
readonly type: "string";
|
|
363
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
364
|
+
readonly maxLength: 256;
|
|
365
|
+
};
|
|
366
|
+
readonly method: {
|
|
367
|
+
readonly type: "string";
|
|
368
|
+
readonly pattern: "^[A-Za-z0-9_][A-Za-z0-9_./:\\-]{0,255}$";
|
|
369
|
+
readonly maxLength: 256;
|
|
370
|
+
};
|
|
371
|
+
readonly requestId: {
|
|
372
|
+
readonly type: "string";
|
|
373
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
374
|
+
readonly maxLength: 256;
|
|
375
|
+
};
|
|
376
|
+
readonly provider: {
|
|
377
|
+
readonly type: "string";
|
|
378
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
379
|
+
readonly maxLength: 256;
|
|
380
|
+
};
|
|
381
|
+
readonly origin: {
|
|
382
|
+
readonly type: "string";
|
|
383
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
384
|
+
readonly maxLength: 256;
|
|
385
|
+
};
|
|
386
|
+
readonly surface: {
|
|
387
|
+
readonly type: "string";
|
|
388
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
389
|
+
readonly maxLength: 256;
|
|
390
|
+
};
|
|
391
|
+
readonly threadId: {
|
|
392
|
+
readonly type: "string";
|
|
393
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
394
|
+
readonly maxLength: 256;
|
|
395
|
+
};
|
|
396
|
+
readonly turnId: {
|
|
397
|
+
readonly type: "string";
|
|
398
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
399
|
+
readonly maxLength: 256;
|
|
400
|
+
};
|
|
401
|
+
readonly runId: {
|
|
402
|
+
readonly type: "string";
|
|
403
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
404
|
+
readonly maxLength: 256;
|
|
405
|
+
};
|
|
406
|
+
readonly itemId: {
|
|
407
|
+
readonly type: "string";
|
|
408
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
409
|
+
readonly maxLength: 256;
|
|
410
|
+
};
|
|
411
|
+
readonly toolCallId: {
|
|
412
|
+
readonly type: "string";
|
|
413
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
414
|
+
readonly maxLength: 256;
|
|
415
|
+
};
|
|
416
|
+
readonly approvalId: {
|
|
417
|
+
readonly type: "string";
|
|
418
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
419
|
+
readonly maxLength: 256;
|
|
420
|
+
};
|
|
421
|
+
readonly pluginId: {
|
|
422
|
+
readonly type: "string";
|
|
423
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
424
|
+
readonly maxLength: 256;
|
|
425
|
+
};
|
|
426
|
+
readonly sessionKey: {
|
|
427
|
+
readonly type: "string";
|
|
428
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
429
|
+
readonly maxLength: 256;
|
|
430
|
+
};
|
|
431
|
+
readonly nodeId: {
|
|
432
|
+
readonly type: "string";
|
|
433
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
434
|
+
readonly maxLength: 256;
|
|
435
|
+
};
|
|
436
|
+
readonly handles: {
|
|
437
|
+
readonly type: "object";
|
|
438
|
+
readonly maxProperties: 16;
|
|
439
|
+
readonly propertyNames: {
|
|
440
|
+
readonly pattern: "^[A-Za-z0-9_.:-]{1,80}$";
|
|
441
|
+
};
|
|
442
|
+
readonly additionalProperties: {
|
|
443
|
+
readonly type: "string";
|
|
444
|
+
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
445
|
+
readonly maxLength: 256;
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
};
|
|
310
449
|
};
|
|
311
450
|
readonly runtimeId: {
|
|
312
451
|
readonly type: "string";
|
package/dist/verbWire.js
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* self-contexts are body.
|
|
27
27
|
*/
|
|
28
28
|
import { CANON_VERB_NAMES, VERB_ID_PATTERNS, VERB_LIMITS, } from './verbContract.js';
|
|
29
|
+
import { VERB_NATIVE_METADATA_JSON_SCHEMA, VERB_SESSION_CONFIG_JSON_SCHEMA, } from './verbSchemas.js';
|
|
29
30
|
export const CANON_VERB_WIRE_SCHEMA_VERSION = 'canon.verb-wire.v1';
|
|
30
31
|
export const CANON_VERB_WIRE_SCHEMA_ID = 'https://canonmsg.com/schemas/canon.verb-wire.v1.json';
|
|
31
32
|
// ---------------------------------------------------------------------------
|
|
@@ -198,7 +199,9 @@ const wireEnvelopeDef = {
|
|
|
198
199
|
},
|
|
199
200
|
],
|
|
200
201
|
},
|
|
201
|
-
sessionConfig: {
|
|
202
|
+
sessionConfig: {
|
|
203
|
+
oneOf: [VERB_SESSION_CONFIG_JSON_SCHEMA, { type: 'null' }],
|
|
204
|
+
},
|
|
202
205
|
idempotencyKey: {
|
|
203
206
|
type: 'string',
|
|
204
207
|
pattern: VERB_ID_PATTERNS.runtimeId,
|
|
@@ -221,7 +224,7 @@ const wireEnvelopeDef = {
|
|
|
221
224
|
+ 'overload the mention slot.',
|
|
222
225
|
},
|
|
223
226
|
turn: { $ref: '#/$defs/turn' },
|
|
224
|
-
native:
|
|
227
|
+
native: VERB_NATIVE_METADATA_JSON_SCHEMA,
|
|
225
228
|
runtimeId: { type: 'string', maxLength: VERB_LIMITS.turnIdChars },
|
|
226
229
|
limit: { type: 'integer', minimum: 1 },
|
|
227
230
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonmsg/backend-contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Canon backend contract helpers shared by Functions and stream-service",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@canonmsg/rich-cards": "^0.8.
|
|
46
|
+
"@canonmsg/rich-cards": "^0.8.4",
|
|
47
47
|
"@types/node": "^22.0.0",
|
|
48
48
|
"ajv": "^8.20.0",
|
|
49
49
|
"typescript": "~5.7.0",
|