@brightbeamai/chap-coordinator 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +54 -8
  2. package/dist/{api-59aU01Bs.d.cts → api-CjZQnj63.d.cts} +128 -14
  3. package/dist/{api-CxciGFHA.d.ts → api-DG0VFGVr.d.ts} +128 -14
  4. package/dist/api.cjs +3 -1
  5. package/dist/api.cjs.map +1 -1
  6. package/dist/api.d.cts +1 -1
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +3 -1
  9. package/dist/api.js.map +1 -1
  10. package/dist/index.cjs +1578 -276
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +20 -6
  13. package/dist/index.d.ts +20 -6
  14. package/dist/index.js +1577 -276
  15. package/dist/index.js.map +1 -1
  16. package/dist/jsonrpc.cjs +1 -0
  17. package/dist/jsonrpc.cjs.map +1 -1
  18. package/dist/jsonrpc.d.cts +1 -0
  19. package/dist/jsonrpc.d.ts +1 -0
  20. package/dist/jsonrpc.js +1 -0
  21. package/dist/jsonrpc.js.map +1 -1
  22. package/dist/methods.cjs.map +1 -1
  23. package/dist/methods.d.cts +36 -3
  24. package/dist/methods.d.ts +36 -3
  25. package/dist/patch.cjs +195 -61
  26. package/dist/patch.cjs.map +1 -1
  27. package/dist/patch.d.cts +16 -2
  28. package/dist/patch.d.ts +16 -2
  29. package/dist/patch.js +194 -61
  30. package/dist/patch.js.map +1 -1
  31. package/dist/storage/sqlite.cjs +81 -19
  32. package/dist/storage/sqlite.cjs.map +1 -1
  33. package/dist/storage/sqlite.d.cts +19 -9
  34. package/dist/storage/sqlite.d.ts +19 -9
  35. package/dist/storage/sqlite.js +81 -19
  36. package/dist/storage/sqlite.js.map +1 -1
  37. package/dist/storage/store.cjs +20 -15
  38. package/dist/storage/store.cjs.map +1 -1
  39. package/dist/storage/store.d.cts +24 -6
  40. package/dist/storage/store.d.ts +24 -6
  41. package/dist/storage/store.js +20 -15
  42. package/dist/storage/store.js.map +1 -1
  43. package/dist/types.cjs.map +1 -1
  44. package/dist/types.d.cts +56 -1
  45. package/dist/types.d.ts +56 -1
  46. package/dist/types.js.map +1 -1
  47. package/package.json +2 -2
package/dist/jsonrpc.cjs CHANGED
@@ -65,6 +65,7 @@ var E = {
65
65
  SIG_KEY_REVOKED: -32072,
66
66
  SIG_ROTATION_KEY_MISMATCH: -32073,
67
67
  SIG_ARTEFACT_DIGEST_MISMATCH: -32074,
68
+ SIG_ALREADY_ACCEPTED: -32075,
68
69
  // audit-scitt/1.0 profile (profiles/audit-scitt.md S8)
69
70
  SCITT_UNREACHABLE: -32080,
70
71
  SCITT_STATEMENT_REJECTED: -32081,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/jsonrpc.ts"],"sourcesContent":["/**\n * @brightbeamai/chap-coordinator/jsonrpc\n *\n * Error codes (JSON-RPC standard + CHAP private range) and helpers.\n *\n * Error code allocations come directly from each profile spec. See\n * profiles/*.md for the authoritative definitions.\n */\n\nexport const E = {\n // JSON-RPC 2.0 standard\n PARSE: -32700,\n REQUEST: -32600,\n METHOD: -32601,\n PARAMS: -32602,\n INTERNAL: -32603,\n\n // review/1.0 profile\n NOT_REVIEWABLE: -32010,\n NOT_AUTHORISED: -32011,\n PATCH_FAILED: -32012,\n REVIEW_LAPSED: -32013,\n REVIEW_ALREADY_OPEN: -32014,\n\n // whisper/1.0 profile (profiles/whisper.md S6)\n WHISPER_ALREADY_ANSWERED: -32020,\n WHISPER_LAPSED: -32021,\n WHISPER_OPTION_NOT_IN_SET: -32022,\n\n // deliberation/1.0 profile (profiles/deliberation.md S5)\n DELIB_VOTER_NOT_IN_LIST: -32030,\n DELIB_ALREADY_VOTED: -32031,\n DELIB_CLOSED_OR_LAPSED: -32032,\n DELIB_UNKNOWN_RULE: -32033,\n\n // modes/1.0 profile (profiles/modes.md S6)\n MODE_CEILING_EXCEEDED: -32040,\n MODE_STEP_UP_REQUIRED: -32041,\n\n // handoff/1.0 profile (profiles/handoff.md S6)\n HANDOFF_TASKS_NOT_ASSIGNED_TO_PROPOSER: -32050,\n HANDOFF_ALREADY_RESOLVED: -32051,\n HANDOFF_RECIPIENT_NOT_MEMBER: -32052,\n\n // control/1.0 profile (profiles/control.md S6)\n CONTROL_STEP_UP_REQUIRED: -32060,\n CONTROL_NOT_AUTHORISED: -32061,\n CONTROL_SNAPSHOT_NOT_FOUND: -32062,\n CONTROL_WORKSPACE_PAUSED: -32063,\n\n // security-signed/1.0 profile (profiles/security-signed.md S7)\n SIG_VERIFY_FAILED: -32070,\n SIG_KEY_NOT_FOUND: -32071,\n SIG_KEY_REVOKED: -32072,\n SIG_ROTATION_KEY_MISMATCH: -32073,\n SIG_ARTEFACT_DIGEST_MISMATCH: -32074,\n\n // audit-scitt/1.0 profile (profiles/audit-scitt.md S8)\n SCITT_UNREACHABLE: -32080,\n SCITT_STATEMENT_REJECTED: -32081,\n SCITT_RECEIPT_INVALID: -32082,\n\n // identity-oidc/1.0 profile (profiles/identity-oidc.md S8)\n OIDC_STEP_UP_REQUIRED: -32402,\n OIDC_TOKEN_INVALID: -32403,\n OIDC_CNF_MISMATCH: -32404,\n OIDC_SCOPE_MISSING: -32405,\n\n // identity-vc/1.0 profile (profiles/identity-vc.md S8)\n VC_VP_INVALID: -32410,\n VC_HOLDER_BINDING_INVALID: -32411,\n VC_CREDENTIAL_REVOKED: -32412,\n VC_SCHEMA_UNKNOWN: -32413,\n\n // routing/1.0 profile (profiles/routing.md S3-S5)\n ROUTING_NO_ELIGIBLE_ASSIGNEE: -32510,\n ROUTING_POLICY_VIOLATION: -32511,\n ROUTING_AUTO_ESCALATION_TRIGGERED: -32512,\n ROUTING_CANDIDATES_EMPTY: -32513,\n ROUTING_DEPTH_NOT_APPLICABLE: -32514,\n ROUTING_POLICY_UNREACHABLE: -32515,\n ROUTING_ESC_TARGET_UNAVAILABLE: -32516,\n} as const;\n\nexport function rpcError(code: number, message: string, data?: unknown) {\n return { code, message, ...(data !== undefined ? { data } : {}) };\n}\n\nexport function isValidEnvelope(env: unknown): boolean {\n if (typeof env !== \"object\" || env === null) return false;\n const e = env as Record<string, unknown>;\n return e.jsonrpc === \"2.0\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAM,IAAI;AAAA;AAAA,EAEf,OAAU;AAAA,EACV,SAAU;AAAA,EACV,QAAU;AAAA,EACV,QAAU;AAAA,EACV,UAAU;AAAA;AAAA,EAGV,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,cAAgB;AAAA,EAChB,eAAgB;AAAA,EAChB,qBAAqB;AAAA;AAAA,EAGrB,0BAA6B;AAAA,EAC7B,gBAA6B;AAAA,EAC7B,2BAA6B;AAAA;AAAA,EAG7B,yBAAyB;AAAA,EACzB,qBAAyB;AAAA,EACzB,wBAAyB;AAAA,EACzB,oBAAyB;AAAA;AAAA,EAGzB,uBAAyB;AAAA,EACzB,uBAAyB;AAAA;AAAA,EAGzB,wCAAwC;AAAA,EACxC,0BAAwC;AAAA,EACxC,8BAAwC;AAAA;AAAA,EAGxC,0BAA6B;AAAA,EAC7B,wBAA6B;AAAA,EAC7B,4BAA6B;AAAA,EAC7B,0BAA6B;AAAA;AAAA,EAG7B,mBAA2B;AAAA,EAC3B,mBAA2B;AAAA,EAC3B,iBAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,8BAA8B;AAAA;AAAA,EAG9B,mBAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,uBAA0B;AAAA;AAAA,EAG1B,uBAAuB;AAAA,EACvB,oBAAuB;AAAA,EACvB,mBAAuB;AAAA,EACvB,oBAAuB;AAAA;AAAA,EAGvB,eAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,uBAA2B;AAAA,EAC3B,mBAA2B;AAAA;AAAA,EAG3B,8BAAgC;AAAA,EAChC,0BAAgC;AAAA,EAChC,mCAAmC;AAAA,EACnC,0BAAgC;AAAA,EAChC,8BAAgC;AAAA,EAChC,4BAAgC;AAAA,EAChC,gCAAgC;AAClC;AAEO,SAAS,SAAS,MAAc,SAAiB,MAAgB;AACtE,SAAO,EAAE,MAAM,SAAS,GAAI,SAAS,SAAY,EAAE,KAAK,IAAI,CAAC,EAAG;AAClE;AAEO,SAAS,gBAAgB,KAAuB;AACrD,MAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM,QAAO;AACpD,QAAM,IAAI;AACV,SAAO,EAAE,YAAY;AACvB;","names":[]}
1
+ {"version":3,"sources":["../src/jsonrpc.ts"],"sourcesContent":["/**\n * @brightbeamai/chap-coordinator/jsonrpc\n *\n * Error codes (JSON-RPC standard + CHAP private range) and helpers.\n *\n * Error code allocations come directly from each profile spec. See\n * profiles/*.md for the authoritative definitions.\n */\n\nexport const E = {\n // JSON-RPC 2.0 standard\n PARSE: -32700,\n REQUEST: -32600,\n METHOD: -32601,\n PARAMS: -32602,\n INTERNAL: -32603,\n\n // review/1.0 profile\n NOT_REVIEWABLE: -32010,\n NOT_AUTHORISED: -32011,\n PATCH_FAILED: -32012,\n REVIEW_LAPSED: -32013,\n REVIEW_ALREADY_OPEN: -32014,\n\n // whisper/1.0 profile (profiles/whisper.md S6)\n WHISPER_ALREADY_ANSWERED: -32020,\n WHISPER_LAPSED: -32021,\n WHISPER_OPTION_NOT_IN_SET: -32022,\n\n // deliberation/1.0 profile (profiles/deliberation.md S5)\n DELIB_VOTER_NOT_IN_LIST: -32030,\n DELIB_ALREADY_VOTED: -32031,\n DELIB_CLOSED_OR_LAPSED: -32032,\n DELIB_UNKNOWN_RULE: -32033,\n\n // modes/1.0 profile (profiles/modes.md S6)\n MODE_CEILING_EXCEEDED: -32040,\n MODE_STEP_UP_REQUIRED: -32041,\n\n // handoff/1.0 profile (profiles/handoff.md S6)\n HANDOFF_TASKS_NOT_ASSIGNED_TO_PROPOSER: -32050,\n HANDOFF_ALREADY_RESOLVED: -32051,\n HANDOFF_RECIPIENT_NOT_MEMBER: -32052,\n\n // control/1.0 profile (profiles/control.md S6)\n CONTROL_STEP_UP_REQUIRED: -32060,\n CONTROL_NOT_AUTHORISED: -32061,\n CONTROL_SNAPSHOT_NOT_FOUND: -32062,\n CONTROL_WORKSPACE_PAUSED: -32063,\n\n // security-signed/1.0 profile (profiles/security-signed.md S7)\n SIG_VERIFY_FAILED: -32070,\n SIG_KEY_NOT_FOUND: -32071,\n SIG_KEY_REVOKED: -32072,\n SIG_ROTATION_KEY_MISMATCH: -32073,\n SIG_ARTEFACT_DIGEST_MISMATCH: -32074,\n SIG_ALREADY_ACCEPTED: -32075,\n\n // audit-scitt/1.0 profile (profiles/audit-scitt.md S8)\n SCITT_UNREACHABLE: -32080,\n SCITT_STATEMENT_REJECTED: -32081,\n SCITT_RECEIPT_INVALID: -32082,\n\n // identity-oidc/1.0 profile (profiles/identity-oidc.md S8)\n OIDC_STEP_UP_REQUIRED: -32402,\n OIDC_TOKEN_INVALID: -32403,\n OIDC_CNF_MISMATCH: -32404,\n OIDC_SCOPE_MISSING: -32405,\n\n // identity-vc/1.0 profile (profiles/identity-vc.md S8)\n VC_VP_INVALID: -32410,\n VC_HOLDER_BINDING_INVALID: -32411,\n VC_CREDENTIAL_REVOKED: -32412,\n VC_SCHEMA_UNKNOWN: -32413,\n\n // routing/1.0 profile (profiles/routing.md S3-S5)\n ROUTING_NO_ELIGIBLE_ASSIGNEE: -32510,\n ROUTING_POLICY_VIOLATION: -32511,\n ROUTING_AUTO_ESCALATION_TRIGGERED: -32512,\n ROUTING_CANDIDATES_EMPTY: -32513,\n ROUTING_DEPTH_NOT_APPLICABLE: -32514,\n ROUTING_POLICY_UNREACHABLE: -32515,\n ROUTING_ESC_TARGET_UNAVAILABLE: -32516,\n} as const;\n\nexport function rpcError(code: number, message: string, data?: unknown) {\n return { code, message, ...(data !== undefined ? { data } : {}) };\n}\n\nexport function isValidEnvelope(env: unknown): boolean {\n if (typeof env !== \"object\" || env === null) return false;\n const e = env as Record<string, unknown>;\n return e.jsonrpc === \"2.0\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,IAAM,IAAI;AAAA;AAAA,EAEf,OAAU;AAAA,EACV,SAAU;AAAA,EACV,QAAU;AAAA,EACV,QAAU;AAAA,EACV,UAAU;AAAA;AAAA,EAGV,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,cAAgB;AAAA,EAChB,eAAgB;AAAA,EAChB,qBAAqB;AAAA;AAAA,EAGrB,0BAA6B;AAAA,EAC7B,gBAA6B;AAAA,EAC7B,2BAA6B;AAAA;AAAA,EAG7B,yBAAyB;AAAA,EACzB,qBAAyB;AAAA,EACzB,wBAAyB;AAAA,EACzB,oBAAyB;AAAA;AAAA,EAGzB,uBAAyB;AAAA,EACzB,uBAAyB;AAAA;AAAA,EAGzB,wCAAwC;AAAA,EACxC,0BAAwC;AAAA,EACxC,8BAAwC;AAAA;AAAA,EAGxC,0BAA6B;AAAA,EAC7B,wBAA6B;AAAA,EAC7B,4BAA6B;AAAA,EAC7B,0BAA6B;AAAA;AAAA,EAG7B,mBAA2B;AAAA,EAC3B,mBAA2B;AAAA,EAC3B,iBAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,8BAA8B;AAAA,EAC9B,sBAA8B;AAAA;AAAA,EAG9B,mBAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,uBAA0B;AAAA;AAAA,EAG1B,uBAAuB;AAAA,EACvB,oBAAuB;AAAA,EACvB,mBAAuB;AAAA,EACvB,oBAAuB;AAAA;AAAA,EAGvB,eAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,uBAA2B;AAAA,EAC3B,mBAA2B;AAAA;AAAA,EAG3B,8BAAgC;AAAA,EAChC,0BAAgC;AAAA,EAChC,mCAAmC;AAAA,EACnC,0BAAgC;AAAA,EAChC,8BAAgC;AAAA,EAChC,4BAAgC;AAAA,EAChC,gCAAgC;AAClC;AAEO,SAAS,SAAS,MAAc,SAAiB,MAAgB;AACtE,SAAO,EAAE,MAAM,SAAS,GAAI,SAAS,SAAY,EAAE,KAAK,IAAI,CAAC,EAAG;AAClE;AAEO,SAAS,gBAAgB,KAAuB;AACrD,MAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM,QAAO;AACpD,QAAM,IAAI;AACV,SAAO,EAAE,YAAY;AACvB;","names":[]}
@@ -38,6 +38,7 @@ declare const E: {
38
38
  readonly SIG_KEY_REVOKED: -32072;
39
39
  readonly SIG_ROTATION_KEY_MISMATCH: -32073;
40
40
  readonly SIG_ARTEFACT_DIGEST_MISMATCH: -32074;
41
+ readonly SIG_ALREADY_ACCEPTED: -32075;
41
42
  readonly SCITT_UNREACHABLE: -32080;
42
43
  readonly SCITT_STATEMENT_REJECTED: -32081;
43
44
  readonly SCITT_RECEIPT_INVALID: -32082;
package/dist/jsonrpc.d.ts CHANGED
@@ -38,6 +38,7 @@ declare const E: {
38
38
  readonly SIG_KEY_REVOKED: -32072;
39
39
  readonly SIG_ROTATION_KEY_MISMATCH: -32073;
40
40
  readonly SIG_ARTEFACT_DIGEST_MISMATCH: -32074;
41
+ readonly SIG_ALREADY_ACCEPTED: -32075;
41
42
  readonly SCITT_UNREACHABLE: -32080;
42
43
  readonly SCITT_STATEMENT_REJECTED: -32081;
43
44
  readonly SCITT_RECEIPT_INVALID: -32082;
package/dist/jsonrpc.js CHANGED
@@ -39,6 +39,7 @@ var E = {
39
39
  SIG_KEY_REVOKED: -32072,
40
40
  SIG_ROTATION_KEY_MISMATCH: -32073,
41
41
  SIG_ARTEFACT_DIGEST_MISMATCH: -32074,
42
+ SIG_ALREADY_ACCEPTED: -32075,
42
43
  // audit-scitt/1.0 profile (profiles/audit-scitt.md S8)
43
44
  SCITT_UNREACHABLE: -32080,
44
45
  SCITT_STATEMENT_REJECTED: -32081,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/jsonrpc.ts"],"sourcesContent":["/**\n * @brightbeamai/chap-coordinator/jsonrpc\n *\n * Error codes (JSON-RPC standard + CHAP private range) and helpers.\n *\n * Error code allocations come directly from each profile spec. See\n * profiles/*.md for the authoritative definitions.\n */\n\nexport const E = {\n // JSON-RPC 2.0 standard\n PARSE: -32700,\n REQUEST: -32600,\n METHOD: -32601,\n PARAMS: -32602,\n INTERNAL: -32603,\n\n // review/1.0 profile\n NOT_REVIEWABLE: -32010,\n NOT_AUTHORISED: -32011,\n PATCH_FAILED: -32012,\n REVIEW_LAPSED: -32013,\n REVIEW_ALREADY_OPEN: -32014,\n\n // whisper/1.0 profile (profiles/whisper.md S6)\n WHISPER_ALREADY_ANSWERED: -32020,\n WHISPER_LAPSED: -32021,\n WHISPER_OPTION_NOT_IN_SET: -32022,\n\n // deliberation/1.0 profile (profiles/deliberation.md S5)\n DELIB_VOTER_NOT_IN_LIST: -32030,\n DELIB_ALREADY_VOTED: -32031,\n DELIB_CLOSED_OR_LAPSED: -32032,\n DELIB_UNKNOWN_RULE: -32033,\n\n // modes/1.0 profile (profiles/modes.md S6)\n MODE_CEILING_EXCEEDED: -32040,\n MODE_STEP_UP_REQUIRED: -32041,\n\n // handoff/1.0 profile (profiles/handoff.md S6)\n HANDOFF_TASKS_NOT_ASSIGNED_TO_PROPOSER: -32050,\n HANDOFF_ALREADY_RESOLVED: -32051,\n HANDOFF_RECIPIENT_NOT_MEMBER: -32052,\n\n // control/1.0 profile (profiles/control.md S6)\n CONTROL_STEP_UP_REQUIRED: -32060,\n CONTROL_NOT_AUTHORISED: -32061,\n CONTROL_SNAPSHOT_NOT_FOUND: -32062,\n CONTROL_WORKSPACE_PAUSED: -32063,\n\n // security-signed/1.0 profile (profiles/security-signed.md S7)\n SIG_VERIFY_FAILED: -32070,\n SIG_KEY_NOT_FOUND: -32071,\n SIG_KEY_REVOKED: -32072,\n SIG_ROTATION_KEY_MISMATCH: -32073,\n SIG_ARTEFACT_DIGEST_MISMATCH: -32074,\n\n // audit-scitt/1.0 profile (profiles/audit-scitt.md S8)\n SCITT_UNREACHABLE: -32080,\n SCITT_STATEMENT_REJECTED: -32081,\n SCITT_RECEIPT_INVALID: -32082,\n\n // identity-oidc/1.0 profile (profiles/identity-oidc.md S8)\n OIDC_STEP_UP_REQUIRED: -32402,\n OIDC_TOKEN_INVALID: -32403,\n OIDC_CNF_MISMATCH: -32404,\n OIDC_SCOPE_MISSING: -32405,\n\n // identity-vc/1.0 profile (profiles/identity-vc.md S8)\n VC_VP_INVALID: -32410,\n VC_HOLDER_BINDING_INVALID: -32411,\n VC_CREDENTIAL_REVOKED: -32412,\n VC_SCHEMA_UNKNOWN: -32413,\n\n // routing/1.0 profile (profiles/routing.md S3-S5)\n ROUTING_NO_ELIGIBLE_ASSIGNEE: -32510,\n ROUTING_POLICY_VIOLATION: -32511,\n ROUTING_AUTO_ESCALATION_TRIGGERED: -32512,\n ROUTING_CANDIDATES_EMPTY: -32513,\n ROUTING_DEPTH_NOT_APPLICABLE: -32514,\n ROUTING_POLICY_UNREACHABLE: -32515,\n ROUTING_ESC_TARGET_UNAVAILABLE: -32516,\n} as const;\n\nexport function rpcError(code: number, message: string, data?: unknown) {\n return { code, message, ...(data !== undefined ? { data } : {}) };\n}\n\nexport function isValidEnvelope(env: unknown): boolean {\n if (typeof env !== \"object\" || env === null) return false;\n const e = env as Record<string, unknown>;\n return e.jsonrpc === \"2.0\";\n}\n"],"mappings":";AASO,IAAM,IAAI;AAAA;AAAA,EAEf,OAAU;AAAA,EACV,SAAU;AAAA,EACV,QAAU;AAAA,EACV,QAAU;AAAA,EACV,UAAU;AAAA;AAAA,EAGV,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,cAAgB;AAAA,EAChB,eAAgB;AAAA,EAChB,qBAAqB;AAAA;AAAA,EAGrB,0BAA6B;AAAA,EAC7B,gBAA6B;AAAA,EAC7B,2BAA6B;AAAA;AAAA,EAG7B,yBAAyB;AAAA,EACzB,qBAAyB;AAAA,EACzB,wBAAyB;AAAA,EACzB,oBAAyB;AAAA;AAAA,EAGzB,uBAAyB;AAAA,EACzB,uBAAyB;AAAA;AAAA,EAGzB,wCAAwC;AAAA,EACxC,0BAAwC;AAAA,EACxC,8BAAwC;AAAA;AAAA,EAGxC,0BAA6B;AAAA,EAC7B,wBAA6B;AAAA,EAC7B,4BAA6B;AAAA,EAC7B,0BAA6B;AAAA;AAAA,EAG7B,mBAA2B;AAAA,EAC3B,mBAA2B;AAAA,EAC3B,iBAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,8BAA8B;AAAA;AAAA,EAG9B,mBAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,uBAA0B;AAAA;AAAA,EAG1B,uBAAuB;AAAA,EACvB,oBAAuB;AAAA,EACvB,mBAAuB;AAAA,EACvB,oBAAuB;AAAA;AAAA,EAGvB,eAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,uBAA2B;AAAA,EAC3B,mBAA2B;AAAA;AAAA,EAG3B,8BAAgC;AAAA,EAChC,0BAAgC;AAAA,EAChC,mCAAmC;AAAA,EACnC,0BAAgC;AAAA,EAChC,8BAAgC;AAAA,EAChC,4BAAgC;AAAA,EAChC,gCAAgC;AAClC;AAEO,SAAS,SAAS,MAAc,SAAiB,MAAgB;AACtE,SAAO,EAAE,MAAM,SAAS,GAAI,SAAS,SAAY,EAAE,KAAK,IAAI,CAAC,EAAG;AAClE;AAEO,SAAS,gBAAgB,KAAuB;AACrD,MAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM,QAAO;AACpD,QAAM,IAAI;AACV,SAAO,EAAE,YAAY;AACvB;","names":[]}
1
+ {"version":3,"sources":["../src/jsonrpc.ts"],"sourcesContent":["/**\n * @brightbeamai/chap-coordinator/jsonrpc\n *\n * Error codes (JSON-RPC standard + CHAP private range) and helpers.\n *\n * Error code allocations come directly from each profile spec. See\n * profiles/*.md for the authoritative definitions.\n */\n\nexport const E = {\n // JSON-RPC 2.0 standard\n PARSE: -32700,\n REQUEST: -32600,\n METHOD: -32601,\n PARAMS: -32602,\n INTERNAL: -32603,\n\n // review/1.0 profile\n NOT_REVIEWABLE: -32010,\n NOT_AUTHORISED: -32011,\n PATCH_FAILED: -32012,\n REVIEW_LAPSED: -32013,\n REVIEW_ALREADY_OPEN: -32014,\n\n // whisper/1.0 profile (profiles/whisper.md S6)\n WHISPER_ALREADY_ANSWERED: -32020,\n WHISPER_LAPSED: -32021,\n WHISPER_OPTION_NOT_IN_SET: -32022,\n\n // deliberation/1.0 profile (profiles/deliberation.md S5)\n DELIB_VOTER_NOT_IN_LIST: -32030,\n DELIB_ALREADY_VOTED: -32031,\n DELIB_CLOSED_OR_LAPSED: -32032,\n DELIB_UNKNOWN_RULE: -32033,\n\n // modes/1.0 profile (profiles/modes.md S6)\n MODE_CEILING_EXCEEDED: -32040,\n MODE_STEP_UP_REQUIRED: -32041,\n\n // handoff/1.0 profile (profiles/handoff.md S6)\n HANDOFF_TASKS_NOT_ASSIGNED_TO_PROPOSER: -32050,\n HANDOFF_ALREADY_RESOLVED: -32051,\n HANDOFF_RECIPIENT_NOT_MEMBER: -32052,\n\n // control/1.0 profile (profiles/control.md S6)\n CONTROL_STEP_UP_REQUIRED: -32060,\n CONTROL_NOT_AUTHORISED: -32061,\n CONTROL_SNAPSHOT_NOT_FOUND: -32062,\n CONTROL_WORKSPACE_PAUSED: -32063,\n\n // security-signed/1.0 profile (profiles/security-signed.md S7)\n SIG_VERIFY_FAILED: -32070,\n SIG_KEY_NOT_FOUND: -32071,\n SIG_KEY_REVOKED: -32072,\n SIG_ROTATION_KEY_MISMATCH: -32073,\n SIG_ARTEFACT_DIGEST_MISMATCH: -32074,\n SIG_ALREADY_ACCEPTED: -32075,\n\n // audit-scitt/1.0 profile (profiles/audit-scitt.md S8)\n SCITT_UNREACHABLE: -32080,\n SCITT_STATEMENT_REJECTED: -32081,\n SCITT_RECEIPT_INVALID: -32082,\n\n // identity-oidc/1.0 profile (profiles/identity-oidc.md S8)\n OIDC_STEP_UP_REQUIRED: -32402,\n OIDC_TOKEN_INVALID: -32403,\n OIDC_CNF_MISMATCH: -32404,\n OIDC_SCOPE_MISSING: -32405,\n\n // identity-vc/1.0 profile (profiles/identity-vc.md S8)\n VC_VP_INVALID: -32410,\n VC_HOLDER_BINDING_INVALID: -32411,\n VC_CREDENTIAL_REVOKED: -32412,\n VC_SCHEMA_UNKNOWN: -32413,\n\n // routing/1.0 profile (profiles/routing.md S3-S5)\n ROUTING_NO_ELIGIBLE_ASSIGNEE: -32510,\n ROUTING_POLICY_VIOLATION: -32511,\n ROUTING_AUTO_ESCALATION_TRIGGERED: -32512,\n ROUTING_CANDIDATES_EMPTY: -32513,\n ROUTING_DEPTH_NOT_APPLICABLE: -32514,\n ROUTING_POLICY_UNREACHABLE: -32515,\n ROUTING_ESC_TARGET_UNAVAILABLE: -32516,\n} as const;\n\nexport function rpcError(code: number, message: string, data?: unknown) {\n return { code, message, ...(data !== undefined ? { data } : {}) };\n}\n\nexport function isValidEnvelope(env: unknown): boolean {\n if (typeof env !== \"object\" || env === null) return false;\n const e = env as Record<string, unknown>;\n return e.jsonrpc === \"2.0\";\n}\n"],"mappings":";AASO,IAAM,IAAI;AAAA;AAAA,EAEf,OAAU;AAAA,EACV,SAAU;AAAA,EACV,QAAU;AAAA,EACV,QAAU;AAAA,EACV,UAAU;AAAA;AAAA,EAGV,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,cAAgB;AAAA,EAChB,eAAgB;AAAA,EAChB,qBAAqB;AAAA;AAAA,EAGrB,0BAA6B;AAAA,EAC7B,gBAA6B;AAAA,EAC7B,2BAA6B;AAAA;AAAA,EAG7B,yBAAyB;AAAA,EACzB,qBAAyB;AAAA,EACzB,wBAAyB;AAAA,EACzB,oBAAyB;AAAA;AAAA,EAGzB,uBAAyB;AAAA,EACzB,uBAAyB;AAAA;AAAA,EAGzB,wCAAwC;AAAA,EACxC,0BAAwC;AAAA,EACxC,8BAAwC;AAAA;AAAA,EAGxC,0BAA6B;AAAA,EAC7B,wBAA6B;AAAA,EAC7B,4BAA6B;AAAA,EAC7B,0BAA6B;AAAA;AAAA,EAG7B,mBAA2B;AAAA,EAC3B,mBAA2B;AAAA,EAC3B,iBAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,8BAA8B;AAAA,EAC9B,sBAA8B;AAAA;AAAA,EAG9B,mBAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,uBAA0B;AAAA;AAAA,EAG1B,uBAAuB;AAAA,EACvB,oBAAuB;AAAA,EACvB,mBAAuB;AAAA,EACvB,oBAAuB;AAAA;AAAA,EAGvB,eAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,uBAA2B;AAAA,EAC3B,mBAA2B;AAAA;AAAA,EAG3B,8BAAgC;AAAA,EAChC,0BAAgC;AAAA,EAChC,mCAAmC;AAAA,EACnC,0BAAgC;AAAA,EAChC,8BAAgC;AAAA,EAChC,4BAAgC;AAAA,EAChC,gCAAgC;AAClC;AAEO,SAAS,SAAS,MAAc,SAAiB,MAAgB;AACtE,SAAO,EAAE,MAAM,SAAS,GAAI,SAAS,SAAY,EAAE,KAAK,IAAI,CAAC,EAAG;AAClE;AAEO,SAAS,gBAAgB,KAAuB;AACrD,MAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM,QAAO;AACpD,QAAM,IAAI;AACV,SAAO,EAAE,YAAY;AACvB;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/methods.ts"],"sourcesContent":["/**\n * Typed method definitions.\n *\n * Every CHAP method that ships in either reference implementation\n * gets a typed `Params` and `Result` shape here. The Coordinator's\n * typed facade (`coord.workspace.create`, `coord.task.complete`, …)\n * uses these types so callers get autocomplete and compile-time\n * checking without having to remember field names.\n *\n * These types are hand-maintained against the canonical JSON Schemas\n * under `schemas/`. A future revision will generate this file from\n * the schemas automatically; for now the source of truth remains\n * the running tests under `tests/`.\n *\n * Scope: 39 method handlers shipped by both reference\n * implementations (Core + every shipped profile). Spec-only methods\n * are excluded - they would mislead callers into thinking the local\n * Coordinator can dispatch them.\n */\n\nimport type {\n ArtefactId, JsonPatchOp, ParticipantUri, TaskId,\n Workspace, WorkspaceId,\n} from \"./types.js\";\n\n// ---- shared building blocks ---------------------------------------\n\nexport interface WorkspaceParam { workspace: WorkspaceId }\nexport interface ActorParam { from: ParticipantUri }\nexport interface TaskParam { task_id: TaskId }\n\nexport interface OkResult { ok: true }\n\n// ============================================================\n// workspace.*\n// ============================================================\n\nexport interface WorkspaceCreateParams extends Partial<WorkspaceParam> {\n profiles?: string[];\n routing_policy_uri?: string;\n mode?: \"shadow\" | \"trial\" | \"production\";\n mode_ceiling?: \"shadow\" | \"trial\" | \"production\";\n}\nexport interface WorkspaceCreateResult { workspace: WorkspaceId }\n\nexport interface WorkspaceDescribeParams extends WorkspaceParam {}\nexport interface WorkspaceDescribeResult { workspace: Workspace }\n\nexport interface WorkspaceSetProfilesParams extends WorkspaceParam, ActorParam {\n profiles: string[];\n}\nexport type WorkspaceSetProfilesResult = OkResult;\n\n// ============================================================\n// participant.*\n// ============================================================\n\nexport interface ParticipantJoinParams extends WorkspaceParam, ActorParam {\n type: \"human\" | \"agent\" | \"service\" | \"group\" | \"workspace\";\n role?: string;\n scopes?: string[];\n capabilities?: Record<string, unknown>;\n oidc_token?: unknown;\n vc?: unknown;\n pubkey?: unknown;\n}\nexport type ParticipantJoinResult = OkResult;\n\nexport interface ParticipantLeaveParams extends WorkspaceParam, ActorParam {\n reason?: string;\n}\nexport type ParticipantLeaveResult = OkResult;\n\nexport interface ParticipantRotateKeyParams extends WorkspaceParam, ActorParam {\n pubkey: unknown;\n reason?: string;\n}\nexport type ParticipantRotateKeyResult = OkResult;\n\nexport interface ParticipantRevokeKeyParams extends WorkspaceParam, ActorParam {\n kid: string;\n reason?: string;\n}\nexport type ParticipantRevokeKeyResult = OkResult;\n\n// ============================================================\n// task.*\n// ============================================================\n\nexport interface TaskCreateParams extends WorkspaceParam, ActorParam {\n kind: string;\n input: unknown;\n assignee?: ParticipantUri;\n to?: ParticipantUri; // alias for assignee\n routing_hints?: Record<string, unknown>;\n deadline?: string;\n idempotency_key?: string;\n}\nexport interface TaskCreateResult { task_id: TaskId }\n\nexport interface TaskUpdateParams extends WorkspaceParam, ActorParam, TaskParam {\n state?: string;\n output?: unknown;\n progress?: Record<string, unknown>;\n}\nexport type TaskUpdateResult = OkResult;\n\nexport interface TaskCompleteParams extends WorkspaceParam, ActorParam, TaskParam {\n output?: unknown;\n confidence?: number | string;\n}\nexport type TaskCompleteResult = OkResult;\n\n// ============================================================\n// review.* and decide.*\n// ============================================================\n\nexport interface ReviewRequestParams extends WorkspaceParam, ActorParam, TaskParam {\n artefact: unknown;\n to: ParticipantUri | ParticipantUri[];\n rule?: string;\n deadline?: string;\n}\nexport interface ReviewRequestResult { state: string; review_id: TaskId }\n\nexport interface DecideApproveParams extends WorkspaceParam, ActorParam, TaskParam {\n rationale?: string;\n}\nexport type DecideApproveResult = OkResult;\n\nexport interface DecideRejectParams extends WorkspaceParam, ActorParam, TaskParam {\n rationale: string;\n category?: string;\n}\nexport type DecideRejectResult = OkResult;\n\nexport interface DecideOverrideParams extends WorkspaceParam, ActorParam, TaskParam {\n diff: JsonPatchOp[];\n rationale: string;\n tags?: string[];\n policy_refs?: string[];\n logical_id?: string;\n instance_id?: string;\n intent_preserved?: boolean;\n based_on_artefact?: unknown;\n}\nexport interface DecideOverrideResult {\n state: \"completed\";\n override_artefact_id: ArtefactId;\n applied: unknown;\n}\n\nexport interface AbstainDeclareParams extends WorkspaceParam, ActorParam, TaskParam {\n category: string;\n rationale?: string;\n}\nexport type AbstainDeclareResult = OkResult;\n\nexport interface EscalateRaiseParams extends WorkspaceParam, ActorParam, TaskParam {\n to?: ParticipantUri;\n rationale?: string;\n}\nexport interface EscalateRaiseResult { ok: true; to?: ParticipantUri }\n\n// ============================================================\n// whisper.* (whisper/1.0)\n// ============================================================\n\nexport interface WhisperAskParams extends WorkspaceParam, ActorParam, TaskParam {\n to: ParticipantUri;\n question: string;\n options?: string[];\n default_on_lapse?: string;\n lapse_ms?: number;\n}\nexport interface WhisperAskResult { whisper_id: string }\n\nexport interface WhisperAnswerParams extends WorkspaceParam, ActorParam {\n whisper_id: string;\n answer: string;\n}\nexport type WhisperAnswerResult = OkResult;\n\n// ============================================================\n// deliberate.* (deliberation/1.0)\n// ============================================================\n\nexport interface DeliberateOpenParams extends WorkspaceParam, ActorParam, TaskParam {\n rule: Record<string, unknown>;\n proposition: unknown;\n voters: ParticipantUri[];\n}\nexport interface DeliberateOpenResult { deliberation_id: string }\n\nexport interface DeliberateCommentParams extends WorkspaceParam, ActorParam {\n deliberation_id: string;\n text: string;\n}\nexport type DeliberateCommentResult = OkResult;\n\nexport interface DeliberateVoteParams extends WorkspaceParam, ActorParam {\n deliberation_id: string;\n vote: \"yea\" | \"nay\" | \"abstain\";\n weight?: number;\n rationale?: string;\n}\nexport type DeliberateVoteResult = OkResult;\n\nexport interface DeliberateCloseParams extends WorkspaceParam, ActorParam {\n deliberation_id: string;\n}\nexport interface DeliberateCloseResult { outcome: \"approved\" | \"rejected\" | \"no_quorum\" }\n\n// ============================================================\n// handoff.* (handoff/1.0)\n// ============================================================\n\nexport interface HandoffProposeParams extends WorkspaceParam, ActorParam {\n to: ParticipantUri;\n task_ids: TaskId[];\n summary: string;\n active_constraints?: Record<string, unknown>;\n}\nexport interface HandoffProposeResult { handoff_id: string }\n\nexport interface HandoffAcceptParams extends WorkspaceParam, ActorParam {\n handoff_id: string;\n}\nexport type HandoffAcceptResult = OkResult;\n\nexport interface HandoffDeclineParams extends WorkspaceParam, ActorParam {\n handoff_id: string;\n reason?: string;\n}\nexport type HandoffDeclineResult = OkResult;\n\n// ============================================================\n// control.* (control/1.0)\n// ============================================================\n\nexport interface ControlPauseParams extends WorkspaceParam, ActorParam {\n reason?: string;\n}\nexport type ControlPauseResult = OkResult;\n\nexport interface ControlResumeParams extends WorkspaceParam, ActorParam {\n reason?: string;\n}\nexport type ControlResumeResult = OkResult;\n\nexport interface ControlCancelParams extends WorkspaceParam, ActorParam, TaskParam {\n reason?: string;\n}\nexport type ControlCancelResult = OkResult;\n\nexport interface ControlSupersedeParams extends WorkspaceParam, ActorParam, TaskParam {\n replacement: unknown;\n logical_id?: string;\n intent_preserved?: boolean;\n reason?: string;\n}\nexport interface ControlSupersedeResult { artefact_id: ArtefactId }\n\nexport interface ControlSnapshotParams extends WorkspaceParam, ActorParam {\n label?: string;\n}\nexport interface ControlSnapshotResult { snapshot_id: string }\n\nexport interface ControlRollbackParams extends WorkspaceParam, ActorParam {\n snapshot_id: string;\n reason?: string;\n}\nexport type ControlRollbackResult = OkResult;\n\nexport interface ControlSetModeCeilingParams extends WorkspaceParam, ActorParam {\n ceiling: \"shadow\" | \"trial\" | \"production\";\n}\nexport type ControlSetModeCeilingResult = OkResult;\n\n// ============================================================\n// routing.* (routing/1.0)\n// ============================================================\n\nexport interface TaskRouteParams extends WorkspaceParam, ActorParam, TaskParam {\n candidates: ParticipantUri[];\n}\nexport interface TaskRouteResult {\n selected: ParticipantUri;\n rationale: Record<string, unknown>;\n}\n\nexport interface ReviewDepthParams extends WorkspaceParam, ActorParam, TaskParam {\n artefact?: unknown;\n hints?: Record<string, unknown>;\n}\nexport interface ReviewDepthResult {\n depth: \"skip\" | \"spot_check\" | \"full\" | \"escalated\";\n sampling_probability?: number;\n rationale: Record<string, unknown>;\n}\n\nexport interface EscalateAutoParams extends WorkspaceParam, ActorParam, TaskParam {\n hints?: Record<string, unknown>;\n}\nexport interface EscalateAutoResult {\n escalated: boolean;\n to?: ParticipantUri;\n triggered_rule?: Record<string, unknown>;\n}\n\n// ============================================================\n// audit.* (Core + audit-scitt/1.0)\n// ============================================================\n\nexport interface AuditReadParams extends WorkspaceParam {\n from_seq?: number;\n limit?: number;\n}\nexport interface AuditReadResult { entries: unknown[] }\n\nexport interface AuditSubmitToScittParams extends WorkspaceParam, ActorParam {\n seq: number;\n statement?: Record<string, unknown>;\n}\nexport interface AuditSubmitToScittResult { receipt: Record<string, unknown> }\n\nexport interface AuditVerifyReceiptParams extends WorkspaceParam {\n receipt: Record<string, unknown>;\n}\nexport interface AuditVerifyReceiptResult { valid: boolean }\n\nexport interface AuditVerifyChainParams extends WorkspaceParam {\n /** Not implemented. Supplying either is refused; see SPECIFICATION.md 10.2. */\n from_seq?: number;\n /** Not implemented. Supplying either is refused; see SPECIFICATION.md 10.2. */\n to_seq?: number;\n}\n/**\n * The verdict of a local prev_hash chain replay.\n *\n * `status` is terminal and the three outcomes are mutually exclusive: a\n * broken chain is a JSON-RPC error, an unevaluated range is\n * `not_evaluated`, and `verified` requires complete coverage. A caller\n * reading `ok` alone therefore fails closed on a range that was never\n * checked, instead of taking a pass over entries no evidence covers.\n */\nexport interface AuditVerifyChainResult {\n status: \"verified\" | \"not_evaluated\";\n /** True only when `status` is \"verified\". Never true beside a gap. */\n ok: boolean;\n /** Present only when `status` is \"not_evaluated\". */\n reason?: \"unchained_prefix\";\n entries_total: number;\n entries_checked: number;\n entries_unchecked: number;\n /** Seq of the first entry inside coverage; null when nothing was checked. */\n checked_from_seq: number | null;\n chain_head: string;\n}\n\n// ============================================================\n// Method-name → {params, result} map (single source of truth)\n// ============================================================\n\nexport interface MethodTable {\n \"workspace.create\": { params: WorkspaceCreateParams, result: WorkspaceCreateResult };\n \"workspace.describe\": { params: WorkspaceDescribeParams, result: WorkspaceDescribeResult };\n \"workspace.set_profiles\": { params: WorkspaceSetProfilesParams, result: WorkspaceSetProfilesResult };\n\n \"participant.join\": { params: ParticipantJoinParams, result: ParticipantJoinResult };\n \"participant.leave\": { params: ParticipantLeaveParams, result: ParticipantLeaveResult };\n \"participant.rotate_key\": { params: ParticipantRotateKeyParams, result: ParticipantRotateKeyResult };\n \"participant.revoke_key\": { params: ParticipantRevokeKeyParams, result: ParticipantRevokeKeyResult };\n\n \"task.create\": { params: TaskCreateParams, result: TaskCreateResult };\n \"task.update\": { params: TaskUpdateParams, result: TaskUpdateResult };\n \"task.complete\": { params: TaskCompleteParams, result: TaskCompleteResult };\n\n \"review.request\": { params: ReviewRequestParams, result: ReviewRequestResult };\n \"decide.approve\": { params: DecideApproveParams, result: DecideApproveResult };\n \"decide.reject\": { params: DecideRejectParams, result: DecideRejectResult };\n \"decide.override\": { params: DecideOverrideParams, result: DecideOverrideResult };\n \"abstain.declare\": { params: AbstainDeclareParams, result: AbstainDeclareResult };\n \"escalate.raise\": { params: EscalateRaiseParams, result: EscalateRaiseResult };\n\n \"whisper.ask\": { params: WhisperAskParams, result: WhisperAskResult };\n \"whisper.answer\": { params: WhisperAnswerParams, result: WhisperAnswerResult };\n\n \"deliberate.open\": { params: DeliberateOpenParams, result: DeliberateOpenResult };\n \"deliberate.comment\": { params: DeliberateCommentParams, result: DeliberateCommentResult };\n \"deliberate.vote\": { params: DeliberateVoteParams, result: DeliberateVoteResult };\n \"deliberate.close\": { params: DeliberateCloseParams, result: DeliberateCloseResult };\n\n \"handoff.propose\": { params: HandoffProposeParams, result: HandoffProposeResult };\n \"handoff.accept\": { params: HandoffAcceptParams, result: HandoffAcceptResult };\n \"handoff.decline\": { params: HandoffDeclineParams, result: HandoffDeclineResult };\n\n \"control.pause\": { params: ControlPauseParams, result: ControlPauseResult };\n \"control.resume\": { params: ControlResumeParams, result: ControlResumeResult };\n \"control.cancel\": { params: ControlCancelParams, result: ControlCancelResult };\n \"control.supersede\": { params: ControlSupersedeParams, result: ControlSupersedeResult };\n \"control.snapshot\": { params: ControlSnapshotParams, result: ControlSnapshotResult };\n \"control.rollback\": { params: ControlRollbackParams, result: ControlRollbackResult };\n \"control.set_mode_ceiling\": { params: ControlSetModeCeilingParams, result: ControlSetModeCeilingResult };\n\n \"task.route\": { params: TaskRouteParams, result: TaskRouteResult };\n \"review.depth\": { params: ReviewDepthParams, result: ReviewDepthResult };\n \"escalate.auto\": { params: EscalateAutoParams, result: EscalateAutoResult };\n\n \"audit.read\": { params: AuditReadParams, result: AuditReadResult };\n \"audit.submit_to_scitt\": { params: AuditSubmitToScittParams, result: AuditSubmitToScittResult };\n \"audit.verify_receipt\": { params: AuditVerifyReceiptParams, result: AuditVerifyReceiptResult };\n \"audit.verify_chain\": { params: AuditVerifyChainParams, result: AuditVerifyChainResult };\n}\n\nexport type MethodName = keyof MethodTable;\nexport type MethodParams<M extends MethodName> = MethodTable[M][\"params\"];\nexport type MethodResult<M extends MethodName> = MethodTable[M][\"result\"];\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/methods.ts"],"sourcesContent":["/**\n * Typed method definitions.\n *\n * Every CHAP method that ships in either reference implementation\n * gets a typed `Params` and `Result` shape here. The Coordinator's\n * typed facade (`coord.workspace.create`, `coord.task.complete`, …)\n * uses these types so callers get autocomplete and compile-time\n * checking without having to remember field names.\n *\n * These types are hand-maintained against the canonical JSON Schemas\n * under `schemas/`. A future revision will generate this file from\n * the schemas automatically; for now the source of truth remains\n * the running tests under `tests/`.\n *\n * Scope: 40 method handlers shipped by both reference\n * implementations (Core + every shipped profile). Spec-only methods\n * are excluded - they would mislead callers into thinking the local\n * Coordinator can dispatch them.\n */\n\nimport type {\n ArtefactId, JoinPolicy, JsonPatchOp, ParticipantType, ParticipantUri, SignaturePolicy, TaskId,\n Workspace, WorkspaceId,\n} from \"./types.js\";\n\n// ---- shared building blocks ---------------------------------------\n\nexport interface WorkspaceParam { workspace: WorkspaceId }\nexport interface ActorParam { from: ParticipantUri }\nexport interface TaskParam { task_id: TaskId }\n\nexport interface OkResult { ok: true }\n\n// ============================================================\n// workspace.*\n// ============================================================\n\nexport interface WorkspaceCreateParams extends Partial<WorkspaceParam> {\n profiles?: string[];\n routing_policy_uri?: string;\n mode?: \"shadow\" | \"trial\" | \"production\";\n mode_ceiling?: \"shadow\" | \"trial\" | \"production\";\n signature_policy?: SignaturePolicy;\n join_policy?: JoinPolicy;\n review_rule?: string;\n}\nexport interface WorkspaceCreateResult { workspace: WorkspaceId }\n\nexport interface WorkspaceDescribeParams extends WorkspaceParam {}\nexport interface WorkspaceDescribeResult { workspace: Workspace }\n\nexport interface WorkspaceSetProfilesParams extends WorkspaceParam, ActorParam {\n profiles: string[];\n}\nexport type WorkspaceSetProfilesResult = OkResult;\n\nexport interface WorkspaceInviteParams extends WorkspaceParam, ActorParam {\n uri: ParticipantUri;\n type: ParticipantType;\n role?: string;\n jwks?: { keys: Array<Record<string, unknown>> };\n oidc_sub?: string;\n}\nexport interface WorkspaceInviteResult {\n invited: true;\n uri: ParticipantUri;\n /** The kids registered, where the invitation was for a member that held no key in force. */\n registered?: string[];\n}\n\n// ============================================================\n// participant.*\n// ============================================================\n\nexport interface ParticipantJoinParams extends WorkspaceParam, ActorParam {\n type: \"human\" | \"agent\" | \"service\" | \"group\" | \"workspace\";\n role?: string;\n scopes?: string[];\n capabilities?: Record<string, unknown>;\n oidc_token?: unknown;\n vc?: unknown;\n pubkey?: unknown;\n}\nexport type ParticipantJoinResult = OkResult;\n\nexport interface ParticipantLeaveParams extends WorkspaceParam, ActorParam {\n reason?: string;\n}\nexport type ParticipantLeaveResult = OkResult;\n\nexport interface ParticipantRotateKeyParams extends WorkspaceParam, ActorParam {\n pubkey: unknown;\n reason?: string;\n}\nexport type ParticipantRotateKeyResult = OkResult;\n\nexport interface ParticipantRevokeKeyParams extends WorkspaceParam, ActorParam {\n kid: string;\n reason?: string;\n}\nexport type ParticipantRevokeKeyResult = OkResult;\n\n// ============================================================\n// task.*\n// ============================================================\n\nexport interface TaskCreateParams extends WorkspaceParam, ActorParam {\n kind: string;\n input: unknown;\n assignee?: ParticipantUri;\n to?: ParticipantUri; // alias for assignee\n routing_hints?: Record<string, unknown>;\n deadline?: string;\n idempotency_key?: string;\n}\nexport interface TaskCreateResult { task_id: TaskId }\n\nexport interface TaskUpdateParams extends WorkspaceParam, ActorParam, TaskParam {\n state?: string;\n output?: unknown;\n progress?: Record<string, unknown>;\n}\nexport type TaskUpdateResult = OkResult;\n\nexport interface TaskCompleteParams extends WorkspaceParam, ActorParam, TaskParam {\n output?: unknown;\n confidence?: number | string;\n}\nexport type TaskCompleteResult = OkResult;\n\n// ============================================================\n// review.* and decide.*\n// ============================================================\n\nexport interface ReviewRequestParams extends WorkspaceParam, ActorParam, TaskParam {\n artefact: unknown;\n to: ParticipantUri | ParticipantUri[];\n rule?: string;\n deadline?: string;\n}\nexport interface ReviewRequestResult { state: string; review_id: TaskId }\n\nexport interface ReviewAcknowledgeParams extends WorkspaceParam, ActorParam, TaskParam {}\n/** `requested_at` is when the round acknowledged opened, and names it. */\nexport interface ReviewAcknowledgeResult { acknowledged: true; requested_at: string }\n\nexport interface DecideApproveParams extends WorkspaceParam, ActorParam, TaskParam {\n rationale?: string;\n}\nexport type DecideApproveResult = OkResult;\n\nexport interface DecideRejectParams extends WorkspaceParam, ActorParam, TaskParam {\n rationale: string;\n category?: string;\n}\nexport type DecideRejectResult = OkResult;\n\nexport interface DecideOverrideParams extends WorkspaceParam, ActorParam, TaskParam {\n diff: JsonPatchOp[];\n rationale: string;\n tags?: string[];\n policy_refs?: string[];\n logical_id?: string;\n instance_id?: string;\n intent_preserved?: boolean;\n based_on_artefact?: unknown;\n}\nexport interface DecideOverrideResult {\n state: \"completed\";\n override_artefact_id: ArtefactId;\n applied: unknown;\n}\n\nexport interface AbstainDeclareParams extends WorkspaceParam, ActorParam, TaskParam {\n category: string;\n rationale?: string;\n}\nexport type AbstainDeclareResult = OkResult;\n\nexport interface EscalateRaiseParams extends WorkspaceParam, ActorParam, TaskParam {\n to?: ParticipantUri;\n rationale?: string;\n}\nexport interface EscalateRaiseResult { ok: true; to?: ParticipantUri }\n\n// ============================================================\n// whisper.* (whisper/1.0)\n// ============================================================\n\nexport interface WhisperAskParams extends WorkspaceParam, ActorParam, TaskParam {\n to: ParticipantUri;\n question: string;\n options?: string[];\n default_on_lapse?: string;\n lapse_ms?: number;\n}\nexport interface WhisperAskResult { whisper_id: string }\n\nexport interface WhisperAnswerParams extends WorkspaceParam, ActorParam {\n whisper_id: string;\n answer: string;\n}\nexport type WhisperAnswerResult = OkResult;\n\n// ============================================================\n// deliberate.* (deliberation/1.0)\n// ============================================================\n\nexport interface DeliberateOpenParams extends WorkspaceParam, ActorParam, TaskParam {\n rule: Record<string, unknown>;\n proposition: unknown;\n voters: ParticipantUri[];\n}\nexport interface DeliberateOpenResult { deliberation_id: string }\n\nexport interface DeliberateCommentParams extends WorkspaceParam, ActorParam {\n deliberation_id: string;\n text: string;\n}\nexport type DeliberateCommentResult = OkResult;\n\nexport interface DeliberateVoteParams extends WorkspaceParam, ActorParam {\n deliberation_id: string;\n vote: \"yea\" | \"nay\" | \"abstain\";\n weight?: number;\n rationale?: string;\n}\nexport type DeliberateVoteResult = OkResult;\n\nexport interface DeliberateCloseParams extends WorkspaceParam, ActorParam {\n deliberation_id: string;\n}\nexport interface DeliberateCloseResult { outcome: \"approved\" | \"rejected\" | \"no_quorum\" }\n\n// ============================================================\n// handoff.* (handoff/1.0)\n// ============================================================\n\nexport interface HandoffProposeParams extends WorkspaceParam, ActorParam {\n to: ParticipantUri;\n task_ids: TaskId[];\n summary: string;\n active_constraints?: Record<string, unknown>;\n}\nexport interface HandoffProposeResult { handoff_id: string }\n\nexport interface HandoffAcceptParams extends WorkspaceParam, ActorParam {\n handoff_id: string;\n}\nexport type HandoffAcceptResult = OkResult;\n\nexport interface HandoffDeclineParams extends WorkspaceParam, ActorParam {\n handoff_id: string;\n reason?: string;\n}\nexport type HandoffDeclineResult = OkResult;\n\n// ============================================================\n// control.* (control/1.0)\n// ============================================================\n\nexport interface ControlPauseParams extends WorkspaceParam, ActorParam {\n reason?: string;\n}\nexport type ControlPauseResult = OkResult;\n\nexport interface ControlResumeParams extends WorkspaceParam, ActorParam {\n reason?: string;\n}\nexport type ControlResumeResult = OkResult;\n\nexport interface ControlCancelParams extends WorkspaceParam, ActorParam, TaskParam {\n reason?: string;\n}\nexport type ControlCancelResult = OkResult;\n\nexport interface ControlSupersedeParams extends WorkspaceParam, ActorParam, TaskParam {\n replacement: unknown;\n logical_id?: string;\n intent_preserved?: boolean;\n reason?: string;\n}\nexport interface ControlSupersedeResult { artefact_id: ArtefactId }\n\nexport interface ControlSnapshotParams extends WorkspaceParam, ActorParam {\n label?: string;\n}\nexport interface ControlSnapshotResult { snapshot_id: string }\n\nexport interface ControlRollbackParams extends WorkspaceParam, ActorParam {\n snapshot_id: string;\n reason?: string;\n}\nexport type ControlRollbackResult = OkResult;\n\nexport interface ControlSetModeCeilingParams extends WorkspaceParam, ActorParam {\n ceiling: \"shadow\" | \"trial\" | \"production\";\n}\nexport type ControlSetModeCeilingResult = OkResult;\n\n// ============================================================\n// routing.* (routing/1.0)\n// ============================================================\n\nexport interface TaskRouteParams extends WorkspaceParam, ActorParam, TaskParam {\n candidates: ParticipantUri[];\n}\nexport interface TaskRouteResult {\n selected: ParticipantUri;\n rationale: Record<string, unknown>;\n}\n\nexport interface ReviewDepthParams extends WorkspaceParam, ActorParam, TaskParam {\n artefact?: unknown;\n hints?: Record<string, unknown>;\n}\nexport interface ReviewDepthResult {\n depth: \"skip\" | \"spot_check\" | \"full\" | \"escalated\";\n sampling_probability?: number;\n rationale: Record<string, unknown>;\n}\n\nexport interface EscalateAutoParams extends WorkspaceParam, ActorParam, TaskParam {\n hints?: Record<string, unknown>;\n}\nexport interface EscalateAutoResult {\n escalated: boolean;\n to?: ParticipantUri;\n triggered_rule?: Record<string, unknown>;\n}\n\n// ============================================================\n// audit.* (Core + audit-scitt/1.0)\n// ============================================================\n\nexport interface AuditReadParams extends WorkspaceParam {\n from_seq?: number;\n limit?: number;\n}\nexport interface AuditReadResult { entries: unknown[] }\n\nexport interface AuditSubmitToScittParams extends WorkspaceParam, ActorParam {\n seq: number;\n statement?: Record<string, unknown>;\n}\nexport interface AuditSubmitToScittResult { receipt: Record<string, unknown> }\n\nexport interface AuditVerifyReceiptParams extends WorkspaceParam {\n receipt: Record<string, unknown>;\n}\nexport interface AuditVerifyReceiptResult { valid: boolean }\n\nexport interface AuditVerifyChainParams extends WorkspaceParam {\n /** Not implemented. Supplying either is refused; see SPECIFICATION.md 10.2. */\n from_seq?: number;\n /** Not implemented. Supplying either is refused; see SPECIFICATION.md 10.2. */\n to_seq?: number;\n}\n/**\n * The verdict of a local prev_hash chain replay.\n *\n * `status` is terminal and the three outcomes are mutually exclusive: a\n * broken chain is a JSON-RPC error, an unevaluated range is\n * `not_evaluated`, and `verified` requires complete coverage. A caller\n * reading `ok` alone therefore fails closed on a range that was never\n * checked, instead of taking a pass over entries no evidence covers.\n */\nexport interface AuditVerifyChainResult {\n status: \"verified\" | \"not_evaluated\";\n /** True only when `status` is \"verified\". Never true beside a gap. */\n ok: boolean;\n /** Present only when `status` is \"not_evaluated\". */\n reason?: \"unchained_prefix\";\n entries_total: number;\n entries_checked: number;\n entries_unchecked: number;\n /** Seq of the first entry inside coverage; null when nothing was checked. */\n checked_from_seq: number | null;\n chain_head: string;\n}\n\n// ============================================================\n// Method-name → {params, result} map (single source of truth)\n// ============================================================\n\nexport interface MethodTable {\n \"workspace.create\": { params: WorkspaceCreateParams, result: WorkspaceCreateResult };\n \"workspace.describe\": { params: WorkspaceDescribeParams, result: WorkspaceDescribeResult };\n \"workspace.set_profiles\": { params: WorkspaceSetProfilesParams, result: WorkspaceSetProfilesResult };\n \"workspace.invite\": { params: WorkspaceInviteParams, result: WorkspaceInviteResult };\n\n \"participant.join\": { params: ParticipantJoinParams, result: ParticipantJoinResult };\n \"participant.leave\": { params: ParticipantLeaveParams, result: ParticipantLeaveResult };\n \"participant.rotate_key\": { params: ParticipantRotateKeyParams, result: ParticipantRotateKeyResult };\n \"participant.revoke_key\": { params: ParticipantRevokeKeyParams, result: ParticipantRevokeKeyResult };\n\n \"task.create\": { params: TaskCreateParams, result: TaskCreateResult };\n \"task.update\": { params: TaskUpdateParams, result: TaskUpdateResult };\n \"task.complete\": { params: TaskCompleteParams, result: TaskCompleteResult };\n\n \"review.request\": { params: ReviewRequestParams, result: ReviewRequestResult };\n \"review.acknowledge\": { params: ReviewAcknowledgeParams, result: ReviewAcknowledgeResult };\n \"decide.approve\": { params: DecideApproveParams, result: DecideApproveResult };\n \"decide.reject\": { params: DecideRejectParams, result: DecideRejectResult };\n \"decide.override\": { params: DecideOverrideParams, result: DecideOverrideResult };\n \"abstain.declare\": { params: AbstainDeclareParams, result: AbstainDeclareResult };\n \"escalate.raise\": { params: EscalateRaiseParams, result: EscalateRaiseResult };\n\n \"whisper.ask\": { params: WhisperAskParams, result: WhisperAskResult };\n \"whisper.answer\": { params: WhisperAnswerParams, result: WhisperAnswerResult };\n\n \"deliberate.open\": { params: DeliberateOpenParams, result: DeliberateOpenResult };\n \"deliberate.comment\": { params: DeliberateCommentParams, result: DeliberateCommentResult };\n \"deliberate.vote\": { params: DeliberateVoteParams, result: DeliberateVoteResult };\n \"deliberate.close\": { params: DeliberateCloseParams, result: DeliberateCloseResult };\n\n \"handoff.propose\": { params: HandoffProposeParams, result: HandoffProposeResult };\n \"handoff.accept\": { params: HandoffAcceptParams, result: HandoffAcceptResult };\n \"handoff.decline\": { params: HandoffDeclineParams, result: HandoffDeclineResult };\n\n \"control.pause\": { params: ControlPauseParams, result: ControlPauseResult };\n \"control.resume\": { params: ControlResumeParams, result: ControlResumeResult };\n \"control.cancel\": { params: ControlCancelParams, result: ControlCancelResult };\n \"control.supersede\": { params: ControlSupersedeParams, result: ControlSupersedeResult };\n \"control.snapshot\": { params: ControlSnapshotParams, result: ControlSnapshotResult };\n \"control.rollback\": { params: ControlRollbackParams, result: ControlRollbackResult };\n \"control.set_mode_ceiling\": { params: ControlSetModeCeilingParams, result: ControlSetModeCeilingResult };\n\n \"task.route\": { params: TaskRouteParams, result: TaskRouteResult };\n \"review.depth\": { params: ReviewDepthParams, result: ReviewDepthResult };\n \"escalate.auto\": { params: EscalateAutoParams, result: EscalateAutoResult };\n\n \"audit.read\": { params: AuditReadParams, result: AuditReadResult };\n \"audit.submit_to_scitt\": { params: AuditSubmitToScittParams, result: AuditSubmitToScittResult };\n \"audit.verify_receipt\": { params: AuditVerifyReceiptParams, result: AuditVerifyReceiptResult };\n \"audit.verify_chain\": { params: AuditVerifyChainParams, result: AuditVerifyChainResult };\n}\n\nexport type MethodName = keyof MethodTable;\nexport type MethodParams<M extends MethodName> = MethodTable[M][\"params\"];\nexport type MethodResult<M extends MethodName> = MethodTable[M][\"result\"];\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,4 +1,4 @@
1
- import { WorkspaceId, Workspace, ParticipantUri, TaskId, JsonPatchOp, ArtefactId } from './types.cjs';
1
+ import { WorkspaceId, SignaturePolicy, JoinPolicy, Workspace, ParticipantUri, ParticipantType, TaskId, JsonPatchOp, ArtefactId } from './types.cjs';
2
2
 
3
3
  /**
4
4
  * Typed method definitions.
@@ -14,7 +14,7 @@ import { WorkspaceId, Workspace, ParticipantUri, TaskId, JsonPatchOp, ArtefactId
14
14
  * the schemas automatically; for now the source of truth remains
15
15
  * the running tests under `tests/`.
16
16
  *
17
- * Scope: 39 method handlers shipped by both reference
17
+ * Scope: 40 method handlers shipped by both reference
18
18
  * implementations (Core + every shipped profile). Spec-only methods
19
19
  * are excluded - they would mislead callers into thinking the local
20
20
  * Coordinator can dispatch them.
@@ -37,6 +37,9 @@ interface WorkspaceCreateParams extends Partial<WorkspaceParam> {
37
37
  routing_policy_uri?: string;
38
38
  mode?: "shadow" | "trial" | "production";
39
39
  mode_ceiling?: "shadow" | "trial" | "production";
40
+ signature_policy?: SignaturePolicy;
41
+ join_policy?: JoinPolicy;
42
+ review_rule?: string;
40
43
  }
41
44
  interface WorkspaceCreateResult {
42
45
  workspace: WorkspaceId;
@@ -50,6 +53,21 @@ interface WorkspaceSetProfilesParams extends WorkspaceParam, ActorParam {
50
53
  profiles: string[];
51
54
  }
52
55
  type WorkspaceSetProfilesResult = OkResult;
56
+ interface WorkspaceInviteParams extends WorkspaceParam, ActorParam {
57
+ uri: ParticipantUri;
58
+ type: ParticipantType;
59
+ role?: string;
60
+ jwks?: {
61
+ keys: Array<Record<string, unknown>>;
62
+ };
63
+ oidc_sub?: string;
64
+ }
65
+ interface WorkspaceInviteResult {
66
+ invited: true;
67
+ uri: ParticipantUri;
68
+ /** The kids registered, where the invitation was for a member that held no key in force. */
69
+ registered?: string[];
70
+ }
53
71
  interface ParticipantJoinParams extends WorkspaceParam, ActorParam {
54
72
  type: "human" | "agent" | "service" | "group" | "workspace";
55
73
  role?: string;
@@ -107,6 +125,13 @@ interface ReviewRequestResult {
107
125
  state: string;
108
126
  review_id: TaskId;
109
127
  }
128
+ interface ReviewAcknowledgeParams extends WorkspaceParam, ActorParam, TaskParam {
129
+ }
130
+ /** `requested_at` is when the round acknowledged opened, and names it. */
131
+ interface ReviewAcknowledgeResult {
132
+ acknowledged: true;
133
+ requested_at: string;
134
+ }
110
135
  interface DecideApproveParams extends WorkspaceParam, ActorParam, TaskParam {
111
136
  rationale?: string;
112
137
  }
@@ -324,6 +349,10 @@ interface MethodTable {
324
349
  params: WorkspaceSetProfilesParams;
325
350
  result: WorkspaceSetProfilesResult;
326
351
  };
352
+ "workspace.invite": {
353
+ params: WorkspaceInviteParams;
354
+ result: WorkspaceInviteResult;
355
+ };
327
356
  "participant.join": {
328
357
  params: ParticipantJoinParams;
329
358
  result: ParticipantJoinResult;
@@ -356,6 +385,10 @@ interface MethodTable {
356
385
  params: ReviewRequestParams;
357
386
  result: ReviewRequestResult;
358
387
  };
388
+ "review.acknowledge": {
389
+ params: ReviewAcknowledgeParams;
390
+ result: ReviewAcknowledgeResult;
391
+ };
359
392
  "decide.approve": {
360
393
  params: DecideApproveParams;
361
394
  result: DecideApproveResult;
@@ -473,4 +506,4 @@ type MethodName = keyof MethodTable;
473
506
  type MethodParams<M extends MethodName> = MethodTable[M]["params"];
474
507
  type MethodResult<M extends MethodName> = MethodTable[M]["result"];
475
508
 
476
- export type { AbstainDeclareParams, AbstainDeclareResult, ActorParam, AuditReadParams, AuditReadResult, AuditSubmitToScittParams, AuditSubmitToScittResult, AuditVerifyChainParams, AuditVerifyChainResult, AuditVerifyReceiptParams, AuditVerifyReceiptResult, ControlCancelParams, ControlCancelResult, ControlPauseParams, ControlPauseResult, ControlResumeParams, ControlResumeResult, ControlRollbackParams, ControlRollbackResult, ControlSetModeCeilingParams, ControlSetModeCeilingResult, ControlSnapshotParams, ControlSnapshotResult, ControlSupersedeParams, ControlSupersedeResult, DecideApproveParams, DecideApproveResult, DecideOverrideParams, DecideOverrideResult, DecideRejectParams, DecideRejectResult, DeliberateCloseParams, DeliberateCloseResult, DeliberateCommentParams, DeliberateCommentResult, DeliberateOpenParams, DeliberateOpenResult, DeliberateVoteParams, DeliberateVoteResult, EscalateAutoParams, EscalateAutoResult, EscalateRaiseParams, EscalateRaiseResult, HandoffAcceptParams, HandoffAcceptResult, HandoffDeclineParams, HandoffDeclineResult, HandoffProposeParams, HandoffProposeResult, MethodName, MethodParams, MethodResult, MethodTable, OkResult, ParticipantJoinParams, ParticipantJoinResult, ParticipantLeaveParams, ParticipantLeaveResult, ParticipantRevokeKeyParams, ParticipantRevokeKeyResult, ParticipantRotateKeyParams, ParticipantRotateKeyResult, ReviewDepthParams, ReviewDepthResult, ReviewRequestParams, ReviewRequestResult, TaskCompleteParams, TaskCompleteResult, TaskCreateParams, TaskCreateResult, TaskParam, TaskRouteParams, TaskRouteResult, TaskUpdateParams, TaskUpdateResult, WhisperAnswerParams, WhisperAnswerResult, WhisperAskParams, WhisperAskResult, WorkspaceCreateParams, WorkspaceCreateResult, WorkspaceDescribeParams, WorkspaceDescribeResult, WorkspaceParam, WorkspaceSetProfilesParams, WorkspaceSetProfilesResult };
509
+ export type { AbstainDeclareParams, AbstainDeclareResult, ActorParam, AuditReadParams, AuditReadResult, AuditSubmitToScittParams, AuditSubmitToScittResult, AuditVerifyChainParams, AuditVerifyChainResult, AuditVerifyReceiptParams, AuditVerifyReceiptResult, ControlCancelParams, ControlCancelResult, ControlPauseParams, ControlPauseResult, ControlResumeParams, ControlResumeResult, ControlRollbackParams, ControlRollbackResult, ControlSetModeCeilingParams, ControlSetModeCeilingResult, ControlSnapshotParams, ControlSnapshotResult, ControlSupersedeParams, ControlSupersedeResult, DecideApproveParams, DecideApproveResult, DecideOverrideParams, DecideOverrideResult, DecideRejectParams, DecideRejectResult, DeliberateCloseParams, DeliberateCloseResult, DeliberateCommentParams, DeliberateCommentResult, DeliberateOpenParams, DeliberateOpenResult, DeliberateVoteParams, DeliberateVoteResult, EscalateAutoParams, EscalateAutoResult, EscalateRaiseParams, EscalateRaiseResult, HandoffAcceptParams, HandoffAcceptResult, HandoffDeclineParams, HandoffDeclineResult, HandoffProposeParams, HandoffProposeResult, MethodName, MethodParams, MethodResult, MethodTable, OkResult, ParticipantJoinParams, ParticipantJoinResult, ParticipantLeaveParams, ParticipantLeaveResult, ParticipantRevokeKeyParams, ParticipantRevokeKeyResult, ParticipantRotateKeyParams, ParticipantRotateKeyResult, ReviewAcknowledgeParams, ReviewAcknowledgeResult, ReviewDepthParams, ReviewDepthResult, ReviewRequestParams, ReviewRequestResult, TaskCompleteParams, TaskCompleteResult, TaskCreateParams, TaskCreateResult, TaskParam, TaskRouteParams, TaskRouteResult, TaskUpdateParams, TaskUpdateResult, WhisperAnswerParams, WhisperAnswerResult, WhisperAskParams, WhisperAskResult, WorkspaceCreateParams, WorkspaceCreateResult, WorkspaceDescribeParams, WorkspaceDescribeResult, WorkspaceInviteParams, WorkspaceInviteResult, WorkspaceParam, WorkspaceSetProfilesParams, WorkspaceSetProfilesResult };
package/dist/methods.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { WorkspaceId, Workspace, ParticipantUri, TaskId, JsonPatchOp, ArtefactId } from './types.js';
1
+ import { WorkspaceId, SignaturePolicy, JoinPolicy, Workspace, ParticipantUri, ParticipantType, TaskId, JsonPatchOp, ArtefactId } from './types.js';
2
2
 
3
3
  /**
4
4
  * Typed method definitions.
@@ -14,7 +14,7 @@ import { WorkspaceId, Workspace, ParticipantUri, TaskId, JsonPatchOp, ArtefactId
14
14
  * the schemas automatically; for now the source of truth remains
15
15
  * the running tests under `tests/`.
16
16
  *
17
- * Scope: 39 method handlers shipped by both reference
17
+ * Scope: 40 method handlers shipped by both reference
18
18
  * implementations (Core + every shipped profile). Spec-only methods
19
19
  * are excluded - they would mislead callers into thinking the local
20
20
  * Coordinator can dispatch them.
@@ -37,6 +37,9 @@ interface WorkspaceCreateParams extends Partial<WorkspaceParam> {
37
37
  routing_policy_uri?: string;
38
38
  mode?: "shadow" | "trial" | "production";
39
39
  mode_ceiling?: "shadow" | "trial" | "production";
40
+ signature_policy?: SignaturePolicy;
41
+ join_policy?: JoinPolicy;
42
+ review_rule?: string;
40
43
  }
41
44
  interface WorkspaceCreateResult {
42
45
  workspace: WorkspaceId;
@@ -50,6 +53,21 @@ interface WorkspaceSetProfilesParams extends WorkspaceParam, ActorParam {
50
53
  profiles: string[];
51
54
  }
52
55
  type WorkspaceSetProfilesResult = OkResult;
56
+ interface WorkspaceInviteParams extends WorkspaceParam, ActorParam {
57
+ uri: ParticipantUri;
58
+ type: ParticipantType;
59
+ role?: string;
60
+ jwks?: {
61
+ keys: Array<Record<string, unknown>>;
62
+ };
63
+ oidc_sub?: string;
64
+ }
65
+ interface WorkspaceInviteResult {
66
+ invited: true;
67
+ uri: ParticipantUri;
68
+ /** The kids registered, where the invitation was for a member that held no key in force. */
69
+ registered?: string[];
70
+ }
53
71
  interface ParticipantJoinParams extends WorkspaceParam, ActorParam {
54
72
  type: "human" | "agent" | "service" | "group" | "workspace";
55
73
  role?: string;
@@ -107,6 +125,13 @@ interface ReviewRequestResult {
107
125
  state: string;
108
126
  review_id: TaskId;
109
127
  }
128
+ interface ReviewAcknowledgeParams extends WorkspaceParam, ActorParam, TaskParam {
129
+ }
130
+ /** `requested_at` is when the round acknowledged opened, and names it. */
131
+ interface ReviewAcknowledgeResult {
132
+ acknowledged: true;
133
+ requested_at: string;
134
+ }
110
135
  interface DecideApproveParams extends WorkspaceParam, ActorParam, TaskParam {
111
136
  rationale?: string;
112
137
  }
@@ -324,6 +349,10 @@ interface MethodTable {
324
349
  params: WorkspaceSetProfilesParams;
325
350
  result: WorkspaceSetProfilesResult;
326
351
  };
352
+ "workspace.invite": {
353
+ params: WorkspaceInviteParams;
354
+ result: WorkspaceInviteResult;
355
+ };
327
356
  "participant.join": {
328
357
  params: ParticipantJoinParams;
329
358
  result: ParticipantJoinResult;
@@ -356,6 +385,10 @@ interface MethodTable {
356
385
  params: ReviewRequestParams;
357
386
  result: ReviewRequestResult;
358
387
  };
388
+ "review.acknowledge": {
389
+ params: ReviewAcknowledgeParams;
390
+ result: ReviewAcknowledgeResult;
391
+ };
359
392
  "decide.approve": {
360
393
  params: DecideApproveParams;
361
394
  result: DecideApproveResult;
@@ -473,4 +506,4 @@ type MethodName = keyof MethodTable;
473
506
  type MethodParams<M extends MethodName> = MethodTable[M]["params"];
474
507
  type MethodResult<M extends MethodName> = MethodTable[M]["result"];
475
508
 
476
- export type { AbstainDeclareParams, AbstainDeclareResult, ActorParam, AuditReadParams, AuditReadResult, AuditSubmitToScittParams, AuditSubmitToScittResult, AuditVerifyChainParams, AuditVerifyChainResult, AuditVerifyReceiptParams, AuditVerifyReceiptResult, ControlCancelParams, ControlCancelResult, ControlPauseParams, ControlPauseResult, ControlResumeParams, ControlResumeResult, ControlRollbackParams, ControlRollbackResult, ControlSetModeCeilingParams, ControlSetModeCeilingResult, ControlSnapshotParams, ControlSnapshotResult, ControlSupersedeParams, ControlSupersedeResult, DecideApproveParams, DecideApproveResult, DecideOverrideParams, DecideOverrideResult, DecideRejectParams, DecideRejectResult, DeliberateCloseParams, DeliberateCloseResult, DeliberateCommentParams, DeliberateCommentResult, DeliberateOpenParams, DeliberateOpenResult, DeliberateVoteParams, DeliberateVoteResult, EscalateAutoParams, EscalateAutoResult, EscalateRaiseParams, EscalateRaiseResult, HandoffAcceptParams, HandoffAcceptResult, HandoffDeclineParams, HandoffDeclineResult, HandoffProposeParams, HandoffProposeResult, MethodName, MethodParams, MethodResult, MethodTable, OkResult, ParticipantJoinParams, ParticipantJoinResult, ParticipantLeaveParams, ParticipantLeaveResult, ParticipantRevokeKeyParams, ParticipantRevokeKeyResult, ParticipantRotateKeyParams, ParticipantRotateKeyResult, ReviewDepthParams, ReviewDepthResult, ReviewRequestParams, ReviewRequestResult, TaskCompleteParams, TaskCompleteResult, TaskCreateParams, TaskCreateResult, TaskParam, TaskRouteParams, TaskRouteResult, TaskUpdateParams, TaskUpdateResult, WhisperAnswerParams, WhisperAnswerResult, WhisperAskParams, WhisperAskResult, WorkspaceCreateParams, WorkspaceCreateResult, WorkspaceDescribeParams, WorkspaceDescribeResult, WorkspaceParam, WorkspaceSetProfilesParams, WorkspaceSetProfilesResult };
509
+ export type { AbstainDeclareParams, AbstainDeclareResult, ActorParam, AuditReadParams, AuditReadResult, AuditSubmitToScittParams, AuditSubmitToScittResult, AuditVerifyChainParams, AuditVerifyChainResult, AuditVerifyReceiptParams, AuditVerifyReceiptResult, ControlCancelParams, ControlCancelResult, ControlPauseParams, ControlPauseResult, ControlResumeParams, ControlResumeResult, ControlRollbackParams, ControlRollbackResult, ControlSetModeCeilingParams, ControlSetModeCeilingResult, ControlSnapshotParams, ControlSnapshotResult, ControlSupersedeParams, ControlSupersedeResult, DecideApproveParams, DecideApproveResult, DecideOverrideParams, DecideOverrideResult, DecideRejectParams, DecideRejectResult, DeliberateCloseParams, DeliberateCloseResult, DeliberateCommentParams, DeliberateCommentResult, DeliberateOpenParams, DeliberateOpenResult, DeliberateVoteParams, DeliberateVoteResult, EscalateAutoParams, EscalateAutoResult, EscalateRaiseParams, EscalateRaiseResult, HandoffAcceptParams, HandoffAcceptResult, HandoffDeclineParams, HandoffDeclineResult, HandoffProposeParams, HandoffProposeResult, MethodName, MethodParams, MethodResult, MethodTable, OkResult, ParticipantJoinParams, ParticipantJoinResult, ParticipantLeaveParams, ParticipantLeaveResult, ParticipantRevokeKeyParams, ParticipantRevokeKeyResult, ParticipantRotateKeyParams, ParticipantRotateKeyResult, ReviewAcknowledgeParams, ReviewAcknowledgeResult, ReviewDepthParams, ReviewDepthResult, ReviewRequestParams, ReviewRequestResult, TaskCompleteParams, TaskCompleteResult, TaskCreateParams, TaskCreateResult, TaskParam, TaskRouteParams, TaskRouteResult, TaskUpdateParams, TaskUpdateResult, WhisperAnswerParams, WhisperAnswerResult, WhisperAskParams, WhisperAskResult, WorkspaceCreateParams, WorkspaceCreateResult, WorkspaceDescribeParams, WorkspaceDescribeResult, WorkspaceInviteParams, WorkspaceInviteResult, WorkspaceParam, WorkspaceSetProfilesParams, WorkspaceSetProfilesResult };