@brightbeamai/chap-coordinator 0.2.8
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/LICENSE +201 -0
- package/README.md +271 -0
- package/dist/api-C3nkEk-B.d.cts +260 -0
- package/dist/api-CmSvlIqO.d.ts +260 -0
- package/dist/api.cjs +125 -0
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.cts +4 -0
- package/dist/api.d.ts +4 -0
- package/dist/api.js +98 -0
- package/dist/api.js.map +1 -0
- package/dist/index.cjs +2804 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +175 -0
- package/dist/index.d.ts +175 -0
- package/dist/index.js +2762 -0
- package/dist/index.js.map +1 -0
- package/dist/jsonrpc.cjs +103 -0
- package/dist/jsonrpc.cjs.map +1 -0
- package/dist/jsonrpc.d.cts +65 -0
- package/dist/jsonrpc.d.ts +65 -0
- package/dist/jsonrpc.js +76 -0
- package/dist/jsonrpc.js.map +1 -0
- package/dist/methods.cjs +19 -0
- package/dist/methods.cjs.map +1 -0
- package/dist/methods.d.cts +455 -0
- package/dist/methods.d.ts +455 -0
- package/dist/methods.js +1 -0
- package/dist/methods.js.map +1 -0
- package/dist/patch.cjs +277 -0
- package/dist/patch.cjs.map +1 -0
- package/dist/patch.d.cts +29 -0
- package/dist/patch.d.ts +29 -0
- package/dist/patch.js +250 -0
- package/dist/patch.js.map +1 -0
- package/dist/storage/sqlite.cjs +94 -0
- package/dist/storage/sqlite.cjs.map +1 -0
- package/dist/storage/sqlite.d.cts +67 -0
- package/dist/storage/sqlite.d.ts +67 -0
- package/dist/storage/sqlite.js +76 -0
- package/dist/storage/sqlite.js.map +1 -0
- package/dist/storage/store.cjs +45 -0
- package/dist/storage/store.cjs.map +1 -0
- package/dist/storage/store.d.cts +53 -0
- package/dist/storage/store.d.ts +53 -0
- package/dist/storage/store.js +20 -0
- package/dist/storage/store.js.map +1 -0
- package/dist/types.cjs +34 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +287 -0
- package/dist/types.d.ts +287 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +52 -0
package/dist/jsonrpc.cjs
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/jsonrpc.ts
|
|
21
|
+
var jsonrpc_exports = {};
|
|
22
|
+
__export(jsonrpc_exports, {
|
|
23
|
+
E: () => E,
|
|
24
|
+
isValidEnvelope: () => isValidEnvelope,
|
|
25
|
+
rpcError: () => rpcError
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(jsonrpc_exports);
|
|
28
|
+
var E = {
|
|
29
|
+
// JSON-RPC 2.0 standard
|
|
30
|
+
PARSE: -32700,
|
|
31
|
+
REQUEST: -32600,
|
|
32
|
+
METHOD: -32601,
|
|
33
|
+
PARAMS: -32602,
|
|
34
|
+
INTERNAL: -32603,
|
|
35
|
+
// review/1.0 profile
|
|
36
|
+
NOT_REVIEWABLE: -32010,
|
|
37
|
+
NOT_AUTHORISED: -32011,
|
|
38
|
+
PATCH_FAILED: -32012,
|
|
39
|
+
REVIEW_LAPSED: -32013,
|
|
40
|
+
// whisper/1.0 profile (profiles/whisper.md S6)
|
|
41
|
+
WHISPER_ALREADY_ANSWERED: -32020,
|
|
42
|
+
WHISPER_LAPSED: -32021,
|
|
43
|
+
WHISPER_OPTION_NOT_IN_SET: -32022,
|
|
44
|
+
// deliberation/1.0 profile (profiles/deliberation.md S5)
|
|
45
|
+
DELIB_VOTER_NOT_IN_LIST: -32030,
|
|
46
|
+
DELIB_ALREADY_VOTED: -32031,
|
|
47
|
+
DELIB_CLOSED_OR_LAPSED: -32032,
|
|
48
|
+
DELIB_UNKNOWN_RULE: -32033,
|
|
49
|
+
// modes/1.0 profile (profiles/modes.md S6)
|
|
50
|
+
MODE_CEILING_EXCEEDED: -32040,
|
|
51
|
+
MODE_STEP_UP_REQUIRED: -32041,
|
|
52
|
+
// handoff/1.0 profile (profiles/handoff.md S6)
|
|
53
|
+
HANDOFF_TASKS_NOT_ASSIGNED_TO_PROPOSER: -32050,
|
|
54
|
+
HANDOFF_ALREADY_RESOLVED: -32051,
|
|
55
|
+
HANDOFF_RECIPIENT_NOT_MEMBER: -32052,
|
|
56
|
+
// control/1.0 profile (profiles/control.md S6)
|
|
57
|
+
CONTROL_STEP_UP_REQUIRED: -32060,
|
|
58
|
+
CONTROL_NOT_AUTHORISED: -32061,
|
|
59
|
+
CONTROL_SNAPSHOT_NOT_FOUND: -32062,
|
|
60
|
+
CONTROL_WORKSPACE_PAUSED: -32063,
|
|
61
|
+
// security-signed/1.0 profile (profiles/security-signed.md S7)
|
|
62
|
+
SIG_VERIFY_FAILED: -32070,
|
|
63
|
+
SIG_KEY_NOT_FOUND: -32071,
|
|
64
|
+
SIG_KEY_REVOKED: -32072,
|
|
65
|
+
SIG_ROTATION_KEY_MISMATCH: -32073,
|
|
66
|
+
// audit-scitt/1.0 profile (profiles/audit-scitt.md S8)
|
|
67
|
+
SCITT_UNREACHABLE: -32080,
|
|
68
|
+
SCITT_STATEMENT_REJECTED: -32081,
|
|
69
|
+
SCITT_RECEIPT_INVALID: -32082,
|
|
70
|
+
// identity-oidc/1.0 profile (profiles/identity-oidc.md S8)
|
|
71
|
+
OIDC_STEP_UP_REQUIRED: -32402,
|
|
72
|
+
OIDC_TOKEN_INVALID: -32403,
|
|
73
|
+
OIDC_CNF_MISMATCH: -32404,
|
|
74
|
+
OIDC_SCOPE_MISSING: -32405,
|
|
75
|
+
// identity-vc/1.0 profile (profiles/identity-vc.md S8)
|
|
76
|
+
VC_VP_INVALID: -32410,
|
|
77
|
+
VC_HOLDER_BINDING_INVALID: -32411,
|
|
78
|
+
VC_CREDENTIAL_REVOKED: -32412,
|
|
79
|
+
VC_SCHEMA_UNKNOWN: -32413,
|
|
80
|
+
// routing/1.0 profile (profiles/routing.md S3-S5)
|
|
81
|
+
ROUTING_NO_ELIGIBLE_ASSIGNEE: -32510,
|
|
82
|
+
ROUTING_POLICY_VIOLATION: -32511,
|
|
83
|
+
ROUTING_AUTO_ESCALATION_TRIGGERED: -32512,
|
|
84
|
+
ROUTING_CANDIDATES_EMPTY: -32513,
|
|
85
|
+
ROUTING_DEPTH_NOT_APPLICABLE: -32514,
|
|
86
|
+
ROUTING_POLICY_UNREACHABLE: -32515,
|
|
87
|
+
ROUTING_ESC_TARGET_UNAVAILABLE: -32516
|
|
88
|
+
};
|
|
89
|
+
function rpcError(code, message, data) {
|
|
90
|
+
return { code, message, ...data !== void 0 ? { data } : {} };
|
|
91
|
+
}
|
|
92
|
+
function isValidEnvelope(env) {
|
|
93
|
+
if (typeof env !== "object" || env === null) return false;
|
|
94
|
+
const e = env;
|
|
95
|
+
return e.jsonrpc === "2.0";
|
|
96
|
+
}
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
E,
|
|
100
|
+
isValidEnvelope,
|
|
101
|
+
rpcError
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=jsonrpc.cjs.map
|
|
@@ -0,0 +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\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\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;AAAA,EAGhB,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;AAAA,EAG3B,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":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @brightbeamai/chap-coordinator/jsonrpc
|
|
3
|
+
*
|
|
4
|
+
* Error codes (JSON-RPC standard + CHAP private range) and helpers.
|
|
5
|
+
*
|
|
6
|
+
* Error code allocations come directly from each profile spec. See
|
|
7
|
+
* profiles/*.md for the authoritative definitions.
|
|
8
|
+
*/
|
|
9
|
+
declare const E: {
|
|
10
|
+
readonly PARSE: -32700;
|
|
11
|
+
readonly REQUEST: -32600;
|
|
12
|
+
readonly METHOD: -32601;
|
|
13
|
+
readonly PARAMS: -32602;
|
|
14
|
+
readonly INTERNAL: -32603;
|
|
15
|
+
readonly NOT_REVIEWABLE: -32010;
|
|
16
|
+
readonly NOT_AUTHORISED: -32011;
|
|
17
|
+
readonly PATCH_FAILED: -32012;
|
|
18
|
+
readonly REVIEW_LAPSED: -32013;
|
|
19
|
+
readonly WHISPER_ALREADY_ANSWERED: -32020;
|
|
20
|
+
readonly WHISPER_LAPSED: -32021;
|
|
21
|
+
readonly WHISPER_OPTION_NOT_IN_SET: -32022;
|
|
22
|
+
readonly DELIB_VOTER_NOT_IN_LIST: -32030;
|
|
23
|
+
readonly DELIB_ALREADY_VOTED: -32031;
|
|
24
|
+
readonly DELIB_CLOSED_OR_LAPSED: -32032;
|
|
25
|
+
readonly DELIB_UNKNOWN_RULE: -32033;
|
|
26
|
+
readonly MODE_CEILING_EXCEEDED: -32040;
|
|
27
|
+
readonly MODE_STEP_UP_REQUIRED: -32041;
|
|
28
|
+
readonly HANDOFF_TASKS_NOT_ASSIGNED_TO_PROPOSER: -32050;
|
|
29
|
+
readonly HANDOFF_ALREADY_RESOLVED: -32051;
|
|
30
|
+
readonly HANDOFF_RECIPIENT_NOT_MEMBER: -32052;
|
|
31
|
+
readonly CONTROL_STEP_UP_REQUIRED: -32060;
|
|
32
|
+
readonly CONTROL_NOT_AUTHORISED: -32061;
|
|
33
|
+
readonly CONTROL_SNAPSHOT_NOT_FOUND: -32062;
|
|
34
|
+
readonly CONTROL_WORKSPACE_PAUSED: -32063;
|
|
35
|
+
readonly SIG_VERIFY_FAILED: -32070;
|
|
36
|
+
readonly SIG_KEY_NOT_FOUND: -32071;
|
|
37
|
+
readonly SIG_KEY_REVOKED: -32072;
|
|
38
|
+
readonly SIG_ROTATION_KEY_MISMATCH: -32073;
|
|
39
|
+
readonly SCITT_UNREACHABLE: -32080;
|
|
40
|
+
readonly SCITT_STATEMENT_REJECTED: -32081;
|
|
41
|
+
readonly SCITT_RECEIPT_INVALID: -32082;
|
|
42
|
+
readonly OIDC_STEP_UP_REQUIRED: -32402;
|
|
43
|
+
readonly OIDC_TOKEN_INVALID: -32403;
|
|
44
|
+
readonly OIDC_CNF_MISMATCH: -32404;
|
|
45
|
+
readonly OIDC_SCOPE_MISSING: -32405;
|
|
46
|
+
readonly VC_VP_INVALID: -32410;
|
|
47
|
+
readonly VC_HOLDER_BINDING_INVALID: -32411;
|
|
48
|
+
readonly VC_CREDENTIAL_REVOKED: -32412;
|
|
49
|
+
readonly VC_SCHEMA_UNKNOWN: -32413;
|
|
50
|
+
readonly ROUTING_NO_ELIGIBLE_ASSIGNEE: -32510;
|
|
51
|
+
readonly ROUTING_POLICY_VIOLATION: -32511;
|
|
52
|
+
readonly ROUTING_AUTO_ESCALATION_TRIGGERED: -32512;
|
|
53
|
+
readonly ROUTING_CANDIDATES_EMPTY: -32513;
|
|
54
|
+
readonly ROUTING_DEPTH_NOT_APPLICABLE: -32514;
|
|
55
|
+
readonly ROUTING_POLICY_UNREACHABLE: -32515;
|
|
56
|
+
readonly ROUTING_ESC_TARGET_UNAVAILABLE: -32516;
|
|
57
|
+
};
|
|
58
|
+
declare function rpcError(code: number, message: string, data?: unknown): {
|
|
59
|
+
data?: {} | null | undefined;
|
|
60
|
+
code: number;
|
|
61
|
+
message: string;
|
|
62
|
+
};
|
|
63
|
+
declare function isValidEnvelope(env: unknown): boolean;
|
|
64
|
+
|
|
65
|
+
export { E, isValidEnvelope, rpcError };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @brightbeamai/chap-coordinator/jsonrpc
|
|
3
|
+
*
|
|
4
|
+
* Error codes (JSON-RPC standard + CHAP private range) and helpers.
|
|
5
|
+
*
|
|
6
|
+
* Error code allocations come directly from each profile spec. See
|
|
7
|
+
* profiles/*.md for the authoritative definitions.
|
|
8
|
+
*/
|
|
9
|
+
declare const E: {
|
|
10
|
+
readonly PARSE: -32700;
|
|
11
|
+
readonly REQUEST: -32600;
|
|
12
|
+
readonly METHOD: -32601;
|
|
13
|
+
readonly PARAMS: -32602;
|
|
14
|
+
readonly INTERNAL: -32603;
|
|
15
|
+
readonly NOT_REVIEWABLE: -32010;
|
|
16
|
+
readonly NOT_AUTHORISED: -32011;
|
|
17
|
+
readonly PATCH_FAILED: -32012;
|
|
18
|
+
readonly REVIEW_LAPSED: -32013;
|
|
19
|
+
readonly WHISPER_ALREADY_ANSWERED: -32020;
|
|
20
|
+
readonly WHISPER_LAPSED: -32021;
|
|
21
|
+
readonly WHISPER_OPTION_NOT_IN_SET: -32022;
|
|
22
|
+
readonly DELIB_VOTER_NOT_IN_LIST: -32030;
|
|
23
|
+
readonly DELIB_ALREADY_VOTED: -32031;
|
|
24
|
+
readonly DELIB_CLOSED_OR_LAPSED: -32032;
|
|
25
|
+
readonly DELIB_UNKNOWN_RULE: -32033;
|
|
26
|
+
readonly MODE_CEILING_EXCEEDED: -32040;
|
|
27
|
+
readonly MODE_STEP_UP_REQUIRED: -32041;
|
|
28
|
+
readonly HANDOFF_TASKS_NOT_ASSIGNED_TO_PROPOSER: -32050;
|
|
29
|
+
readonly HANDOFF_ALREADY_RESOLVED: -32051;
|
|
30
|
+
readonly HANDOFF_RECIPIENT_NOT_MEMBER: -32052;
|
|
31
|
+
readonly CONTROL_STEP_UP_REQUIRED: -32060;
|
|
32
|
+
readonly CONTROL_NOT_AUTHORISED: -32061;
|
|
33
|
+
readonly CONTROL_SNAPSHOT_NOT_FOUND: -32062;
|
|
34
|
+
readonly CONTROL_WORKSPACE_PAUSED: -32063;
|
|
35
|
+
readonly SIG_VERIFY_FAILED: -32070;
|
|
36
|
+
readonly SIG_KEY_NOT_FOUND: -32071;
|
|
37
|
+
readonly SIG_KEY_REVOKED: -32072;
|
|
38
|
+
readonly SIG_ROTATION_KEY_MISMATCH: -32073;
|
|
39
|
+
readonly SCITT_UNREACHABLE: -32080;
|
|
40
|
+
readonly SCITT_STATEMENT_REJECTED: -32081;
|
|
41
|
+
readonly SCITT_RECEIPT_INVALID: -32082;
|
|
42
|
+
readonly OIDC_STEP_UP_REQUIRED: -32402;
|
|
43
|
+
readonly OIDC_TOKEN_INVALID: -32403;
|
|
44
|
+
readonly OIDC_CNF_MISMATCH: -32404;
|
|
45
|
+
readonly OIDC_SCOPE_MISSING: -32405;
|
|
46
|
+
readonly VC_VP_INVALID: -32410;
|
|
47
|
+
readonly VC_HOLDER_BINDING_INVALID: -32411;
|
|
48
|
+
readonly VC_CREDENTIAL_REVOKED: -32412;
|
|
49
|
+
readonly VC_SCHEMA_UNKNOWN: -32413;
|
|
50
|
+
readonly ROUTING_NO_ELIGIBLE_ASSIGNEE: -32510;
|
|
51
|
+
readonly ROUTING_POLICY_VIOLATION: -32511;
|
|
52
|
+
readonly ROUTING_AUTO_ESCALATION_TRIGGERED: -32512;
|
|
53
|
+
readonly ROUTING_CANDIDATES_EMPTY: -32513;
|
|
54
|
+
readonly ROUTING_DEPTH_NOT_APPLICABLE: -32514;
|
|
55
|
+
readonly ROUTING_POLICY_UNREACHABLE: -32515;
|
|
56
|
+
readonly ROUTING_ESC_TARGET_UNAVAILABLE: -32516;
|
|
57
|
+
};
|
|
58
|
+
declare function rpcError(code: number, message: string, data?: unknown): {
|
|
59
|
+
data?: {} | null | undefined;
|
|
60
|
+
code: number;
|
|
61
|
+
message: string;
|
|
62
|
+
};
|
|
63
|
+
declare function isValidEnvelope(env: unknown): boolean;
|
|
64
|
+
|
|
65
|
+
export { E, isValidEnvelope, rpcError };
|
package/dist/jsonrpc.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// src/jsonrpc.ts
|
|
2
|
+
var E = {
|
|
3
|
+
// JSON-RPC 2.0 standard
|
|
4
|
+
PARSE: -32700,
|
|
5
|
+
REQUEST: -32600,
|
|
6
|
+
METHOD: -32601,
|
|
7
|
+
PARAMS: -32602,
|
|
8
|
+
INTERNAL: -32603,
|
|
9
|
+
// review/1.0 profile
|
|
10
|
+
NOT_REVIEWABLE: -32010,
|
|
11
|
+
NOT_AUTHORISED: -32011,
|
|
12
|
+
PATCH_FAILED: -32012,
|
|
13
|
+
REVIEW_LAPSED: -32013,
|
|
14
|
+
// whisper/1.0 profile (profiles/whisper.md S6)
|
|
15
|
+
WHISPER_ALREADY_ANSWERED: -32020,
|
|
16
|
+
WHISPER_LAPSED: -32021,
|
|
17
|
+
WHISPER_OPTION_NOT_IN_SET: -32022,
|
|
18
|
+
// deliberation/1.0 profile (profiles/deliberation.md S5)
|
|
19
|
+
DELIB_VOTER_NOT_IN_LIST: -32030,
|
|
20
|
+
DELIB_ALREADY_VOTED: -32031,
|
|
21
|
+
DELIB_CLOSED_OR_LAPSED: -32032,
|
|
22
|
+
DELIB_UNKNOWN_RULE: -32033,
|
|
23
|
+
// modes/1.0 profile (profiles/modes.md S6)
|
|
24
|
+
MODE_CEILING_EXCEEDED: -32040,
|
|
25
|
+
MODE_STEP_UP_REQUIRED: -32041,
|
|
26
|
+
// handoff/1.0 profile (profiles/handoff.md S6)
|
|
27
|
+
HANDOFF_TASKS_NOT_ASSIGNED_TO_PROPOSER: -32050,
|
|
28
|
+
HANDOFF_ALREADY_RESOLVED: -32051,
|
|
29
|
+
HANDOFF_RECIPIENT_NOT_MEMBER: -32052,
|
|
30
|
+
// control/1.0 profile (profiles/control.md S6)
|
|
31
|
+
CONTROL_STEP_UP_REQUIRED: -32060,
|
|
32
|
+
CONTROL_NOT_AUTHORISED: -32061,
|
|
33
|
+
CONTROL_SNAPSHOT_NOT_FOUND: -32062,
|
|
34
|
+
CONTROL_WORKSPACE_PAUSED: -32063,
|
|
35
|
+
// security-signed/1.0 profile (profiles/security-signed.md S7)
|
|
36
|
+
SIG_VERIFY_FAILED: -32070,
|
|
37
|
+
SIG_KEY_NOT_FOUND: -32071,
|
|
38
|
+
SIG_KEY_REVOKED: -32072,
|
|
39
|
+
SIG_ROTATION_KEY_MISMATCH: -32073,
|
|
40
|
+
// audit-scitt/1.0 profile (profiles/audit-scitt.md S8)
|
|
41
|
+
SCITT_UNREACHABLE: -32080,
|
|
42
|
+
SCITT_STATEMENT_REJECTED: -32081,
|
|
43
|
+
SCITT_RECEIPT_INVALID: -32082,
|
|
44
|
+
// identity-oidc/1.0 profile (profiles/identity-oidc.md S8)
|
|
45
|
+
OIDC_STEP_UP_REQUIRED: -32402,
|
|
46
|
+
OIDC_TOKEN_INVALID: -32403,
|
|
47
|
+
OIDC_CNF_MISMATCH: -32404,
|
|
48
|
+
OIDC_SCOPE_MISSING: -32405,
|
|
49
|
+
// identity-vc/1.0 profile (profiles/identity-vc.md S8)
|
|
50
|
+
VC_VP_INVALID: -32410,
|
|
51
|
+
VC_HOLDER_BINDING_INVALID: -32411,
|
|
52
|
+
VC_CREDENTIAL_REVOKED: -32412,
|
|
53
|
+
VC_SCHEMA_UNKNOWN: -32413,
|
|
54
|
+
// routing/1.0 profile (profiles/routing.md S3-S5)
|
|
55
|
+
ROUTING_NO_ELIGIBLE_ASSIGNEE: -32510,
|
|
56
|
+
ROUTING_POLICY_VIOLATION: -32511,
|
|
57
|
+
ROUTING_AUTO_ESCALATION_TRIGGERED: -32512,
|
|
58
|
+
ROUTING_CANDIDATES_EMPTY: -32513,
|
|
59
|
+
ROUTING_DEPTH_NOT_APPLICABLE: -32514,
|
|
60
|
+
ROUTING_POLICY_UNREACHABLE: -32515,
|
|
61
|
+
ROUTING_ESC_TARGET_UNAVAILABLE: -32516
|
|
62
|
+
};
|
|
63
|
+
function rpcError(code, message, data) {
|
|
64
|
+
return { code, message, ...data !== void 0 ? { data } : {} };
|
|
65
|
+
}
|
|
66
|
+
function isValidEnvelope(env) {
|
|
67
|
+
if (typeof env !== "object" || env === null) return false;
|
|
68
|
+
const e = env;
|
|
69
|
+
return e.jsonrpc === "2.0";
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
E,
|
|
73
|
+
isValidEnvelope,
|
|
74
|
+
rpcError
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=jsonrpc.js.map
|
|
@@ -0,0 +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\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\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;AAAA,EAGhB,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;AAAA,EAG3B,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":[]}
|
package/dist/methods.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/methods.ts
|
|
17
|
+
var methods_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(methods_exports);
|
|
19
|
+
//# sourceMappingURL=methods.cjs.map
|
|
@@ -0,0 +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 v0.2 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}\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 from_seq?: number;\n to_seq?: number;\n}\nexport interface AuditVerifyChainResult {\n valid: boolean;\n breaks?: number[];\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":[]}
|