@canonmsg/backend-contracts 7.0.0 → 8.0.1
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/README.md +2 -2
- package/dist/agentBehaviorPolicy.d.ts +12 -20
- package/dist/agentBehaviorPolicy.js +19 -23
- package/dist/canon-verb-wire.schema.json +0 -67
- package/dist/canon-verbs.limits.json +0 -5
- package/dist/canon-verbs.schema.json +7 -176
- package/dist/cjs/agentBehaviorPolicy.js +20 -24
- package/dist/cjs/communication.js +0 -4
- package/dist/cjs/firestoreValues.js +1 -1
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/replyAuthority.js +2 -0
- package/dist/cjs/verbContract.js +1 -16
- package/dist/cjs/verbSchemas.js +11 -115
- package/dist/cjs/verbWire.js +1 -10
- package/dist/communication.d.ts +22 -4
- package/dist/communication.js +0 -4
- package/dist/firestoreValues.d.ts +1 -1
- package/dist/firestoreValues.js +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/replyAuthority.d.ts +12 -0
- package/dist/replyAuthority.js +1 -0
- package/dist/verbContract.d.ts +4 -48
- package/dist/verbContract.js +0 -15
- package/dist/verbSchemas.d.ts +3 -171
- package/dist/verbSchemas.js +10 -114
- package/dist/verbWire.d.ts +4 -55
- package/dist/verbWire.js +2 -11
- package/package.json +1 -1
- package/dist/accessPolicy.d.ts +0 -9
- package/dist/accessPolicy.js +0 -12
- package/dist/cjs/accessPolicy.js +0 -15
- package/dist/cjs/contactRequest.js +0 -114
- package/dist/contactRequest.d.ts +0 -36
- package/dist/contactRequest.js +0 -110
package/dist/verbSchemas.d.ts
CHANGED
|
@@ -123,51 +123,6 @@ export declare const VERB_NATIVE_METADATA_JSON_SCHEMA: {
|
|
|
123
123
|
};
|
|
124
124
|
};
|
|
125
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
|
-
};
|
|
171
126
|
export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
172
127
|
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
173
128
|
readonly $id: "https://canonmsg.com/schemas/canon.verbs.v1.json";
|
|
@@ -183,20 +138,6 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
183
138
|
};
|
|
184
139
|
readonly description: string;
|
|
185
140
|
};
|
|
186
|
-
readonly groupInviteRequirements: {
|
|
187
|
-
readonly type: "object";
|
|
188
|
-
readonly description: string;
|
|
189
|
-
readonly required: readonly ["policyApproval", "ownerSessionSetup"];
|
|
190
|
-
readonly additionalProperties: false;
|
|
191
|
-
readonly properties: {
|
|
192
|
-
readonly policyApproval: {
|
|
193
|
-
readonly type: "boolean";
|
|
194
|
-
};
|
|
195
|
-
readonly ownerSessionSetup: {
|
|
196
|
-
readonly type: "boolean";
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
141
|
readonly selfContext: {
|
|
201
142
|
readonly type: "object";
|
|
202
143
|
readonly description: string;
|
|
@@ -633,51 +574,6 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
633
574
|
};
|
|
634
575
|
};
|
|
635
576
|
};
|
|
636
|
-
readonly sessionConfig: {
|
|
637
|
-
readonly type: "object";
|
|
638
|
-
readonly description: string;
|
|
639
|
-
readonly additionalProperties: false;
|
|
640
|
-
readonly properties: {
|
|
641
|
-
readonly model: {
|
|
642
|
-
readonly type: "string";
|
|
643
|
-
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
644
|
-
readonly maxLength: 256;
|
|
645
|
-
};
|
|
646
|
-
readonly permissionMode: {
|
|
647
|
-
readonly type: "string";
|
|
648
|
-
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
649
|
-
readonly maxLength: 256;
|
|
650
|
-
};
|
|
651
|
-
readonly effort: {
|
|
652
|
-
readonly type: "string";
|
|
653
|
-
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
654
|
-
readonly maxLength: 256;
|
|
655
|
-
};
|
|
656
|
-
readonly workspaceId: {
|
|
657
|
-
readonly type: "string";
|
|
658
|
-
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
|
|
659
|
-
readonly maxLength: 256;
|
|
660
|
-
};
|
|
661
|
-
readonly executionMode: {
|
|
662
|
-
readonly enum: readonly ["worktree", "locked"];
|
|
663
|
-
};
|
|
664
|
-
readonly runtimeControlValues: {
|
|
665
|
-
readonly type: "object";
|
|
666
|
-
readonly maxProperties: 24;
|
|
667
|
-
readonly propertyNames: {
|
|
668
|
-
readonly pattern: "^[A-Za-z0-9_-]{1,80}$";
|
|
669
|
-
readonly not: {
|
|
670
|
-
readonly enum: readonly ["model", "workspace", "executionMode", "permissionMode", "effort", "interrupt", "runtimeControlValues", "updatedAt", "updatedBy"];
|
|
671
|
-
};
|
|
672
|
-
};
|
|
673
|
-
readonly additionalProperties: {
|
|
674
|
-
readonly type: "string";
|
|
675
|
-
readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:/@+\\-]{0,255}$";
|
|
676
|
-
readonly maxLength: 256;
|
|
677
|
-
};
|
|
678
|
-
};
|
|
679
|
-
};
|
|
680
|
-
};
|
|
681
577
|
readonly send_to_input: {
|
|
682
578
|
readonly type: "object";
|
|
683
579
|
readonly description: string;
|
|
@@ -716,14 +612,6 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
716
612
|
readonly sessionSelection: {
|
|
717
613
|
$ref: string;
|
|
718
614
|
};
|
|
719
|
-
readonly sessionConfig: {
|
|
720
|
-
readonly oneOf: readonly [{
|
|
721
|
-
$ref: string;
|
|
722
|
-
}, {
|
|
723
|
-
readonly type: "null";
|
|
724
|
-
}];
|
|
725
|
-
readonly description: string;
|
|
726
|
-
};
|
|
727
615
|
readonly messageOptions: {
|
|
728
616
|
$ref: string;
|
|
729
617
|
};
|
|
@@ -1452,7 +1340,7 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
1452
1340
|
readonly type: "array";
|
|
1453
1341
|
readonly items: {
|
|
1454
1342
|
readonly type: "object";
|
|
1455
|
-
readonly required: readonly ["userId", "requestId"
|
|
1343
|
+
readonly required: readonly ["userId", "requestId"];
|
|
1456
1344
|
readonly additionalProperties: true;
|
|
1457
1345
|
readonly properties: {
|
|
1458
1346
|
readonly userId: {
|
|
@@ -1461,9 +1349,6 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
1461
1349
|
readonly requestId: {
|
|
1462
1350
|
readonly type: "string";
|
|
1463
1351
|
};
|
|
1464
|
-
readonly requirements: {
|
|
1465
|
-
$ref: string;
|
|
1466
|
-
};
|
|
1467
1352
|
};
|
|
1468
1353
|
};
|
|
1469
1354
|
};
|
|
@@ -1502,7 +1387,7 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
1502
1387
|
};
|
|
1503
1388
|
};
|
|
1504
1389
|
readonly add_member_result: {
|
|
1505
|
-
readonly description:
|
|
1390
|
+
readonly description: "Targets needing policy approval yield an exact pending group invite.";
|
|
1506
1391
|
readonly oneOf: readonly [{
|
|
1507
1392
|
readonly type: "object";
|
|
1508
1393
|
readonly required: readonly ["status"];
|
|
@@ -1514,7 +1399,7 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
1514
1399
|
};
|
|
1515
1400
|
}, {
|
|
1516
1401
|
readonly type: "object";
|
|
1517
|
-
readonly required: readonly ["status", "requestId"
|
|
1402
|
+
readonly required: readonly ["status", "requestId"];
|
|
1518
1403
|
readonly additionalProperties: true;
|
|
1519
1404
|
readonly properties: {
|
|
1520
1405
|
readonly status: {
|
|
@@ -1523,9 +1408,6 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
1523
1408
|
readonly requestId: {
|
|
1524
1409
|
readonly type: "string";
|
|
1525
1410
|
};
|
|
1526
|
-
readonly requirements: {
|
|
1527
|
-
$ref: string;
|
|
1528
|
-
};
|
|
1529
1411
|
};
|
|
1530
1412
|
}];
|
|
1531
1413
|
};
|
|
@@ -1612,56 +1494,6 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
1612
1494
|
};
|
|
1613
1495
|
};
|
|
1614
1496
|
};
|
|
1615
|
-
readonly list_contact_requests_input: {
|
|
1616
|
-
readonly type: "object";
|
|
1617
|
-
readonly additionalProperties: false;
|
|
1618
|
-
readonly properties: {};
|
|
1619
|
-
};
|
|
1620
|
-
readonly list_contact_requests_result: {
|
|
1621
|
-
readonly type: "object";
|
|
1622
|
-
readonly description: string;
|
|
1623
|
-
readonly required: readonly ["requests"];
|
|
1624
|
-
readonly additionalProperties: true;
|
|
1625
|
-
readonly properties: {
|
|
1626
|
-
readonly requests: {
|
|
1627
|
-
readonly type: "array";
|
|
1628
|
-
readonly items: {
|
|
1629
|
-
readonly type: "object";
|
|
1630
|
-
readonly required: readonly ["id", "requesterId", "targetId", "status", "kind"];
|
|
1631
|
-
readonly additionalProperties: true;
|
|
1632
|
-
readonly properties: {
|
|
1633
|
-
readonly id: {
|
|
1634
|
-
readonly type: "string";
|
|
1635
|
-
};
|
|
1636
|
-
readonly requesterId: {
|
|
1637
|
-
readonly type: "string";
|
|
1638
|
-
};
|
|
1639
|
-
readonly requesterName: {
|
|
1640
|
-
readonly type: "string";
|
|
1641
|
-
};
|
|
1642
|
-
readonly targetId: {
|
|
1643
|
-
readonly type: "string";
|
|
1644
|
-
};
|
|
1645
|
-
readonly status: {
|
|
1646
|
-
readonly enum: readonly ["pending", "approved", "rejected", "expired"];
|
|
1647
|
-
};
|
|
1648
|
-
readonly kind: {
|
|
1649
|
-
readonly enum: readonly ["dm", "group_invite"];
|
|
1650
|
-
};
|
|
1651
|
-
readonly message: {
|
|
1652
|
-
readonly type: readonly ["string", "null"];
|
|
1653
|
-
};
|
|
1654
|
-
readonly createdAt: {
|
|
1655
|
-
readonly type: readonly ["string", "null"];
|
|
1656
|
-
};
|
|
1657
|
-
readonly expiresAt: {
|
|
1658
|
-
readonly type: readonly ["string", "null"];
|
|
1659
|
-
};
|
|
1660
|
-
};
|
|
1661
|
-
};
|
|
1662
|
-
};
|
|
1663
|
-
};
|
|
1664
|
-
};
|
|
1665
1497
|
readonly list_conversations_input: {
|
|
1666
1498
|
readonly type: "object";
|
|
1667
1499
|
readonly additionalProperties: false;
|
package/dist/verbSchemas.js
CHANGED
|
@@ -29,18 +29,6 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import { CANON_VERBS_SCHEMA_ID, CANON_VERB_NAMES, SELF_CONTEXT_TYPE, VERB_ID_PATTERNS, VERB_LIMITS, } from './verbContract.js';
|
|
31
31
|
const REF = (def) => ({ $ref: `#/$defs/${def}` });
|
|
32
|
-
const groupInviteRequirementsDef = {
|
|
33
|
-
type: 'object',
|
|
34
|
-
description: 'Independent gates on a pending group invite. policyApproval is social '
|
|
35
|
-
+ 'consent; ownerSessionSetup means the agent owner must choose the '
|
|
36
|
-
+ 'runtime session configuration before membership is activated.',
|
|
37
|
-
required: ['policyApproval', 'ownerSessionSetup'],
|
|
38
|
-
additionalProperties: false,
|
|
39
|
-
properties: {
|
|
40
|
-
policyApproval: { type: 'boolean' },
|
|
41
|
-
ownerSessionSetup: { type: 'boolean' },
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
32
|
const selfContextDef = {
|
|
45
33
|
type: 'object',
|
|
46
34
|
description: 'Private note-to-self attached to a cross-conversation send. Visible only to the '
|
|
@@ -310,50 +298,6 @@ export const VERB_NATIVE_METADATA_JSON_SCHEMA = {
|
|
|
310
298
|
},
|
|
311
299
|
},
|
|
312
300
|
};
|
|
313
|
-
const sessionConfigValueDef = {
|
|
314
|
-
type: 'string',
|
|
315
|
-
pattern: VERB_ID_PATTERNS.runtimeOptionValue,
|
|
316
|
-
maxLength: VERB_LIMITS.sessionConfigValueChars,
|
|
317
|
-
};
|
|
318
|
-
export const VERB_SESSION_CONFIG_JSON_SCHEMA = {
|
|
319
|
-
type: 'object',
|
|
320
|
-
description: 'Typed setup policy for an agent target. Values are stable runtime-advertised '
|
|
321
|
-
+ 'option ids and are validated against the target descriptor before session creation; '
|
|
322
|
-
+ 'labels, prompts, workspace paths, and arbitrary fields are not permitted.',
|
|
323
|
-
additionalProperties: false,
|
|
324
|
-
properties: {
|
|
325
|
-
model: sessionConfigValueDef,
|
|
326
|
-
permissionMode: sessionConfigValueDef,
|
|
327
|
-
effort: sessionConfigValueDef,
|
|
328
|
-
workspaceId: {
|
|
329
|
-
type: 'string',
|
|
330
|
-
pattern: VERB_ID_PATTERNS.workspaceOptionId,
|
|
331
|
-
maxLength: VERB_LIMITS.sessionConfigValueChars,
|
|
332
|
-
},
|
|
333
|
-
executionMode: { enum: ['worktree', 'locked'] },
|
|
334
|
-
runtimeControlValues: {
|
|
335
|
-
type: 'object',
|
|
336
|
-
maxProperties: VERB_LIMITS.sessionConfigValues,
|
|
337
|
-
propertyNames: {
|
|
338
|
-
pattern: VERB_ID_PATTERNS.runtimeControlId,
|
|
339
|
-
not: {
|
|
340
|
-
enum: [
|
|
341
|
-
'model',
|
|
342
|
-
'workspace',
|
|
343
|
-
'executionMode',
|
|
344
|
-
'permissionMode',
|
|
345
|
-
'effort',
|
|
346
|
-
'interrupt',
|
|
347
|
-
'runtimeControlValues',
|
|
348
|
-
'updatedAt',
|
|
349
|
-
'updatedBy',
|
|
350
|
-
],
|
|
351
|
-
},
|
|
352
|
-
},
|
|
353
|
-
additionalProperties: sessionConfigValueDef,
|
|
354
|
-
},
|
|
355
|
-
},
|
|
356
|
-
};
|
|
357
301
|
const timeoutFields = (maxMs, ceilingNote) => ({
|
|
358
302
|
timeoutMs: {
|
|
359
303
|
type: 'integer',
|
|
@@ -383,7 +327,7 @@ const send_to_input = {
|
|
|
383
327
|
+ 'sends -> admission resolve + create + send (the core reachOut composite). User '
|
|
384
328
|
+ 'targets resolve admission first: open targets get the message, approval-required '
|
|
385
329
|
+ 'targets get a contact request (send deferred and auto-fulfilled on approval), '
|
|
386
|
-
+ "
|
|
330
|
+
+ "closed targets surface as status 'unavailable' with reason closed.",
|
|
387
331
|
additionalProperties: false,
|
|
388
332
|
properties: {
|
|
389
333
|
targetConversationId: { type: 'string', pattern: VERB_ID_PATTERNS.runtimeId },
|
|
@@ -407,11 +351,6 @@ const send_to_input = {
|
|
|
407
351
|
+ `truncate to ${VERB_LIMITS.contactRequestNoteChars} chars.`,
|
|
408
352
|
},
|
|
409
353
|
sessionSelection: REF('sessionSelection'),
|
|
410
|
-
sessionConfig: {
|
|
411
|
-
oneOf: [REF('sessionConfig'), { type: 'null' }],
|
|
412
|
-
description: 'Coding-agent session setup (model/permissionMode/effort/workspaceId/executionMode); '
|
|
413
|
-
+ 'only applied to agent targets, stripped for humans.',
|
|
414
|
-
},
|
|
415
354
|
messageOptions: REF('messageOptions'),
|
|
416
355
|
},
|
|
417
356
|
oneOf: [
|
|
@@ -838,11 +777,9 @@ const create_group_input = {
|
|
|
838
777
|
description: "Create a group conversation. Each target's groupJoinPolicy is enforced "
|
|
839
778
|
+ 'server-side with staged admission: directly-addable members join at '
|
|
840
779
|
+ 'creation, approval-required members become pending group_invite '
|
|
841
|
-
+ 'requests;
|
|
842
|
-
+ 'owner requests; hard-denied members are skipped (see the result). A '
|
|
780
|
+
+ 'requests; hard-denied members are skipped (see the result). A '
|
|
843
781
|
+ 'creator-only group is valid when at least one requested member has a '
|
|
844
|
-
+ 'pending invite.
|
|
845
|
-
+ 'groups (403 CREATE_GROUP_CREATOR_SETUP_REQUIRED). Under MLS, membership '
|
|
782
|
+
+ 'pending invite. Under MLS, membership '
|
|
846
783
|
+ 'changes are Add/Remove proposals + Commit — a group operation is a '
|
|
847
784
|
+ 'cryptographic state change, not a codec swap.',
|
|
848
785
|
required: ['name', 'memberIds'],
|
|
@@ -861,8 +798,8 @@ const create_group_input = {
|
|
|
861
798
|
const create_group_result = {
|
|
862
799
|
type: 'object',
|
|
863
800
|
description: 'Staged admission: the group exists with the directly-added members; '
|
|
864
|
-
+ '`pending` lists group_invite requests awaiting policy approval
|
|
865
|
-
+ '
|
|
801
|
+
+ '`pending` lists group_invite requests awaiting policy approval; '
|
|
802
|
+
+ '`skipped` lists hard-denied targets.',
|
|
866
803
|
required: ['status', 'conversationId', 'added', 'pending', 'skipped'],
|
|
867
804
|
additionalProperties: true,
|
|
868
805
|
properties: {
|
|
@@ -876,12 +813,11 @@ const create_group_result = {
|
|
|
876
813
|
type: 'array',
|
|
877
814
|
items: {
|
|
878
815
|
type: 'object',
|
|
879
|
-
required: ['userId', 'requestId'
|
|
816
|
+
required: ['userId', 'requestId'],
|
|
880
817
|
additionalProperties: true,
|
|
881
818
|
properties: {
|
|
882
819
|
userId: { type: 'string' },
|
|
883
820
|
requestId: { type: 'string' },
|
|
884
|
-
requirements: REF('groupInviteRequirements'),
|
|
885
821
|
},
|
|
886
822
|
},
|
|
887
823
|
},
|
|
@@ -901,8 +837,8 @@ const create_group_result = {
|
|
|
901
837
|
};
|
|
902
838
|
const add_member_input = {
|
|
903
839
|
type: 'object',
|
|
904
|
-
description: 'A target needing policy approval
|
|
905
|
-
+ '
|
|
840
|
+
description: 'A target needing policy approval yields one pending group_invite. '
|
|
841
|
+
+ 'Under MLS an add is an Add proposal '
|
|
906
842
|
+ '+ Commit (new epoch), not a server-side membership write — the verb '
|
|
907
843
|
+ 'semantics are stable, the mechanism is not.',
|
|
908
844
|
required: ['conversationId', 'userId'],
|
|
@@ -913,8 +849,7 @@ const add_member_input = {
|
|
|
913
849
|
},
|
|
914
850
|
};
|
|
915
851
|
const add_member_result = {
|
|
916
|
-
description: 'Targets needing policy approval
|
|
917
|
-
+ 'pending group_invite routed to the target or agent owner.',
|
|
852
|
+
description: 'Targets needing policy approval yield an exact pending group invite.',
|
|
918
853
|
oneOf: [
|
|
919
854
|
{
|
|
920
855
|
type: 'object',
|
|
@@ -924,12 +859,11 @@ const add_member_result = {
|
|
|
924
859
|
},
|
|
925
860
|
{
|
|
926
861
|
type: 'object',
|
|
927
|
-
required: ['status', 'requestId'
|
|
862
|
+
required: ['status', 'requestId'],
|
|
928
863
|
additionalProperties: true,
|
|
929
864
|
properties: {
|
|
930
865
|
status: { const: 'pending' },
|
|
931
866
|
requestId: { type: 'string' },
|
|
932
|
-
requirements: REF('groupInviteRequirements'),
|
|
933
867
|
},
|
|
934
868
|
},
|
|
935
869
|
],
|
|
@@ -996,40 +930,6 @@ const list_contacts_result = {
|
|
|
996
930
|
},
|
|
997
931
|
},
|
|
998
932
|
};
|
|
999
|
-
const list_contact_requests_input = {
|
|
1000
|
-
type: 'object',
|
|
1001
|
-
additionalProperties: false,
|
|
1002
|
-
properties: {},
|
|
1003
|
-
};
|
|
1004
|
-
const list_contact_requests_result = {
|
|
1005
|
-
type: 'object',
|
|
1006
|
-
description: 'Pending inbound requests, newest first, capped at 100. Items are '
|
|
1007
|
-
+ 'SerializedContactRequest (backend-contracts contactRequest.ts). Read-only awareness: '
|
|
1008
|
-
+ "approval routes to the owner; agents cannot approve/reject.",
|
|
1009
|
-
required: ['requests'],
|
|
1010
|
-
additionalProperties: true,
|
|
1011
|
-
properties: {
|
|
1012
|
-
requests: {
|
|
1013
|
-
type: 'array',
|
|
1014
|
-
items: {
|
|
1015
|
-
type: 'object',
|
|
1016
|
-
required: ['id', 'requesterId', 'targetId', 'status', 'kind'],
|
|
1017
|
-
additionalProperties: true,
|
|
1018
|
-
properties: {
|
|
1019
|
-
id: { type: 'string' },
|
|
1020
|
-
requesterId: { type: 'string' },
|
|
1021
|
-
requesterName: { type: 'string' },
|
|
1022
|
-
targetId: { type: 'string' },
|
|
1023
|
-
status: { enum: ['pending', 'approved', 'rejected', 'expired'] },
|
|
1024
|
-
kind: { enum: ['dm', 'group_invite'] },
|
|
1025
|
-
message: { type: ['string', 'null'] },
|
|
1026
|
-
createdAt: { type: ['string', 'null'] },
|
|
1027
|
-
expiresAt: { type: ['string', 'null'] },
|
|
1028
|
-
},
|
|
1029
|
-
},
|
|
1030
|
-
},
|
|
1031
|
-
},
|
|
1032
|
-
};
|
|
1033
933
|
const list_conversations_input = {
|
|
1034
934
|
type: 'object',
|
|
1035
935
|
additionalProperties: false,
|
|
@@ -1123,7 +1023,6 @@ export const CANON_VERBS_JSON_SCHEMA = {
|
|
|
1123
1023
|
+ 'deliberately NOT verbs — they stay host-mediated.',
|
|
1124
1024
|
$defs: {
|
|
1125
1025
|
messageId: messageIdDef,
|
|
1126
|
-
groupInviteRequirements: groupInviteRequirementsDef,
|
|
1127
1026
|
selfContext: selfContextDef,
|
|
1128
1027
|
sessionSelection: sessionSelectionDef,
|
|
1129
1028
|
mediaAttachment: mediaAttachmentDef,
|
|
@@ -1136,7 +1035,6 @@ export const CANON_VERBS_JSON_SCHEMA = {
|
|
|
1136
1035
|
sessionRule: sessionRuleDef,
|
|
1137
1036
|
runtimeCard: runtimeCardDef,
|
|
1138
1037
|
native: VERB_NATIVE_METADATA_JSON_SCHEMA,
|
|
1139
|
-
sessionConfig: VERB_SESSION_CONFIG_JSON_SCHEMA,
|
|
1140
1038
|
send_to_input,
|
|
1141
1039
|
send_to_result,
|
|
1142
1040
|
request_input_input,
|
|
@@ -1165,8 +1063,6 @@ export const CANON_VERBS_JSON_SCHEMA = {
|
|
|
1165
1063
|
leave_conversation_result,
|
|
1166
1064
|
list_contacts_input,
|
|
1167
1065
|
list_contacts_result,
|
|
1168
|
-
list_contact_requests_input,
|
|
1169
|
-
list_contact_requests_result,
|
|
1170
1066
|
list_conversations_input,
|
|
1171
1067
|
list_conversations_result,
|
|
1172
1068
|
no_reply_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 VerbNativeMetadata, type
|
|
28
|
+
import { type CanonVerbName, type VerbNativeMetadata, 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,7 @@ 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
|
-
* `
|
|
57
|
-
* typed correlation ids. Paths, labels, prompts, summaries, and other free
|
|
56
|
+
* `native` carries only typed correlation ids. Paths, labels, prompts, summaries, and other free
|
|
58
57
|
* text belong in the body or owner-local runtime state.
|
|
59
58
|
*/
|
|
60
59
|
export interface CanonVerbWireEnvelope {
|
|
@@ -75,7 +74,6 @@ export interface CanonVerbWireEnvelope {
|
|
|
75
74
|
risk?: 'low' | 'normal' | 'high' | 'destructive';
|
|
76
75
|
category?: 'command' | 'file' | 'network' | 'browser' | 'mcp' | 'plugin' | 'canon' | 'tool';
|
|
77
76
|
sessionSelection?: VerbSessionSelection;
|
|
78
|
-
sessionConfig?: VerbSessionConfig | null;
|
|
79
77
|
idempotencyKey?: string;
|
|
80
78
|
/** Target-message reference for react/forward — routing, not content. */
|
|
81
79
|
messageId?: string;
|
|
@@ -137,7 +135,7 @@ export declare const CANON_VERB_WIRE_JSON_SCHEMA: {
|
|
|
137
135
|
readonly const: "canon.verb-wire.v1";
|
|
138
136
|
};
|
|
139
137
|
readonly verb: {
|
|
140
|
-
readonly enum: readonly ["send_to", "request_input", "request_approval", "check_approval", "send_card", "request_card", "share_contact", "react", "forward", "create_group", "add_member", "remove_member", "leave_conversation", "list_contacts", "
|
|
138
|
+
readonly enum: readonly ["send_to", "request_input", "request_approval", "check_approval", "send_card", "request_card", "share_contact", "react", "forward", "create_group", "add_member", "remove_member", "leave_conversation", "list_contacts", "list_conversations", "no_reply"];
|
|
141
139
|
};
|
|
142
140
|
readonly envelope: {
|
|
143
141
|
readonly $ref: "#/$defs/envelope";
|
|
@@ -268,55 +266,6 @@ export declare const CANON_VERB_WIRE_JSON_SCHEMA: {
|
|
|
268
266
|
};
|
|
269
267
|
}];
|
|
270
268
|
};
|
|
271
|
-
readonly sessionConfig: {
|
|
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
|
-
}];
|
|
319
|
-
};
|
|
320
269
|
readonly idempotencyKey: {
|
|
321
270
|
readonly type: "string";
|
|
322
271
|
readonly pattern: "^[A-Za-z0-9_.:-]{1,160}$";
|
|
@@ -509,7 +458,7 @@ export declare const CANON_VERB_WIRE_JSON_SCHEMA: {
|
|
|
509
458
|
readonly const: "canon.verb-wire.v1";
|
|
510
459
|
};
|
|
511
460
|
readonly verb: {
|
|
512
|
-
readonly enum: readonly ["send_to", "request_input", "request_approval", "check_approval", "send_card", "request_card", "share_contact", "react", "forward", "create_group", "add_member", "remove_member", "leave_conversation", "list_contacts", "
|
|
461
|
+
readonly enum: readonly ["send_to", "request_input", "request_approval", "check_approval", "send_card", "request_card", "share_contact", "react", "forward", "create_group", "add_member", "remove_member", "leave_conversation", "list_contacts", "list_conversations", "no_reply"];
|
|
513
462
|
};
|
|
514
463
|
readonly result: {
|
|
515
464
|
readonly $ref: "#/$defs/body";
|
package/dist/verbWire.js
CHANGED
|
@@ -26,7 +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
|
|
29
|
+
import { VERB_NATIVE_METADATA_JSON_SCHEMA } from './verbSchemas.js';
|
|
30
30
|
export const CANON_VERB_WIRE_SCHEMA_VERSION = 'canon.verb-wire.v1';
|
|
31
31
|
export const CANON_VERB_WIRE_SCHEMA_ID = 'https://canonmsg.com/schemas/canon.verb-wire.v1.json';
|
|
32
32
|
// ---------------------------------------------------------------------------
|
|
@@ -41,7 +41,6 @@ export const VERB_WIRE_ENVELOPE_FIELDS = {
|
|
|
41
41
|
'canonContactId',
|
|
42
42
|
'sourceConversationId',
|
|
43
43
|
'sessionSelection',
|
|
44
|
-
'sessionConfig',
|
|
45
44
|
'idempotencyKey',
|
|
46
45
|
'replyTo',
|
|
47
46
|
'replyToPosition',
|
|
@@ -110,7 +109,6 @@ export const VERB_WIRE_ENVELOPE_FIELDS = {
|
|
|
110
109
|
optional: [],
|
|
111
110
|
},
|
|
112
111
|
list_contacts: { required: [], optional: [] },
|
|
113
|
-
list_contact_requests: { required: [], optional: [] },
|
|
114
112
|
list_conversations: { required: [], optional: ['limit'] },
|
|
115
113
|
no_reply: { required: [], optional: ['conversationId', 'messageId'] },
|
|
116
114
|
};
|
|
@@ -200,9 +198,6 @@ const wireEnvelopeDef = {
|
|
|
200
198
|
},
|
|
201
199
|
],
|
|
202
200
|
},
|
|
203
|
-
sessionConfig: {
|
|
204
|
-
oneOf: [VERB_SESSION_CONFIG_JSON_SCHEMA, { type: 'null' }],
|
|
205
|
-
},
|
|
206
201
|
idempotencyKey: {
|
|
207
202
|
type: 'string',
|
|
208
203
|
pattern: VERB_ID_PATTERNS.runtimeId,
|
|
@@ -336,7 +331,6 @@ export function projectVerbIntentToWire(verb, intent, options) {
|
|
|
336
331
|
canonContactId: input.canonContactId,
|
|
337
332
|
sourceConversationId: input.sourceConversationId,
|
|
338
333
|
sessionSelection: input.sessionSelection,
|
|
339
|
-
sessionConfig: input.sessionConfig,
|
|
340
334
|
idempotencyKey: messageOptions.messageId,
|
|
341
335
|
replyTo: messageOptions.replyTo,
|
|
342
336
|
replyToPosition: messageOptions.replyToPosition,
|
|
@@ -463,8 +457,7 @@ export function projectVerbIntentToWire(verb, intent, options) {
|
|
|
463
457
|
envelope = compact({ conversationId: input.conversationId });
|
|
464
458
|
break;
|
|
465
459
|
}
|
|
466
|
-
case 'list_contacts':
|
|
467
|
-
case 'list_contact_requests': {
|
|
460
|
+
case 'list_contacts': {
|
|
468
461
|
break;
|
|
469
462
|
}
|
|
470
463
|
case 'list_conversations': {
|
|
@@ -516,7 +509,6 @@ export function mergeVerbWireToIntent(request) {
|
|
|
516
509
|
canonContactId: envelope.canonContactId,
|
|
517
510
|
sourceConversationId: envelope.sourceConversationId,
|
|
518
511
|
sessionSelection: envelope.sessionSelection,
|
|
519
|
-
sessionConfig: envelope.sessionConfig,
|
|
520
512
|
text: value.text,
|
|
521
513
|
selfContext: value.selfContext,
|
|
522
514
|
requestMessage: value.requestMessage,
|
|
@@ -609,7 +601,6 @@ export function mergeVerbWireToIntent(request) {
|
|
|
609
601
|
case 'leave_conversation':
|
|
610
602
|
return compact({ conversationId: envelope.conversationId });
|
|
611
603
|
case 'list_contacts':
|
|
612
|
-
case 'list_contact_requests':
|
|
613
604
|
return {};
|
|
614
605
|
case 'list_conversations':
|
|
615
606
|
return compact({ limit: envelope.limit });
|
package/package.json
CHANGED
package/dist/accessPolicy.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** The canonical access triplet's policy values (`inboundPolicy`, `groupJoinPolicy`). */
|
|
2
|
-
export type CanonicalPolicy = 'open' | 'approval-required' | 'owner-only';
|
|
3
|
-
/**
|
|
4
|
-
* Read a stored policy field, defaulting to the value Canon assigns on account
|
|
5
|
-
* creation. Anything unrecognized — missing, misspelled, or the retired
|
|
6
|
-
* `'private'` enum — reads as 'approval-required'. This must never widen to
|
|
7
|
-
* 'open'.
|
|
8
|
-
*/
|
|
9
|
-
export declare function readCanonicalPolicy(value: unknown): CanonicalPolicy;
|
package/dist/accessPolicy.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read a stored policy field, defaulting to the value Canon assigns on account
|
|
3
|
-
* creation. Anything unrecognized — missing, misspelled, or the retired
|
|
4
|
-
* `'private'` enum — reads as 'approval-required'. This must never widen to
|
|
5
|
-
* 'open'.
|
|
6
|
-
*/
|
|
7
|
-
export function readCanonicalPolicy(value) {
|
|
8
|
-
if (value === 'open' || value === 'approval-required' || value === 'owner-only') {
|
|
9
|
-
return value;
|
|
10
|
-
}
|
|
11
|
-
return 'approval-required';
|
|
12
|
-
}
|