@brightbeamai/chap-coordinator 0.2.12 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -7
- package/dist/{api-DiiL0sil.d.cts → api-BkvwN42r.d.cts} +40 -0
- package/dist/{api-BOGEBNmX.d.ts → api-Ddy9fqkY.d.ts} +40 -0
- package/dist/api.d.cts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/index.cjs +667 -143
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -7
- package/dist/index.d.ts +24 -7
- package/dist/index.js +663 -143
- package/dist/index.js.map +1 -1
- package/dist/methods.cjs.map +1 -1
- package/dist/methods.d.cts +1 -1
- package/dist/methods.d.ts +1 -1
- package/dist/patch.cjs +22 -6
- package/dist/patch.cjs.map +1 -1
- package/dist/patch.js +22 -6
- package/dist/patch.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +28 -9
- package/dist/types.d.ts +28 -9
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { C as CoordinatorOptions, a as Coordinator } from './api-
|
|
2
|
-
export { b as CoordinatorApi, c as CoordinatorError, d as CredentialVerifier, E as EscalationPolicyFn, H as Handler, I as IdFactory, P as PRIVILEGED_METHODS, R as ReviewDepthPolicyFn, e as RoutingPolicyFn, S as ScittReceiptVerifier, f as ScittSubmitter, T as TokenVerifier, g as call, m as makeApi } from './api-
|
|
1
|
+
import { C as CoordinatorOptions, a as Coordinator } from './api-BkvwN42r.cjs';
|
|
2
|
+
export { b as CoordinatorApi, c as CoordinatorError, d as CredentialVerifier, E as EscalationPolicyFn, H as Handler, I as IdFactory, P as PRIVILEGED_METHODS, R as ReviewDepthPolicyFn, e as RoutingPolicyFn, S as ScittReceiptVerifier, f as ScittSubmitter, T as TokenVerifier, g as call, m as makeApi } from './api-BkvwN42r.cjs';
|
|
3
3
|
export { MethodName, MethodParams, MethodResult, MethodTable } from './methods.cjs';
|
|
4
|
+
import { AuditEntry, Envelope } from './types.cjs';
|
|
5
|
+
export { ArtefactId, ArtefactRoutingHints, AuditListener, Deliberation, DeliberationVote, Handoff, HandoffTaskItem, JsonPatchOp, Jwk, KeyRecord, Member, Mode, OverrideArtefact, ParticipantType, ParticipantUri, PauseScope, RefusalOutcome, ReviewDecision, RouteDecisionArtefact, SnapshotArtefact, Task, TaskId, TaskRoutingHints, TaskState, WhisperPrompt, Workspace, WorkspaceId, WorkspaceState, modeLE } from './types.cjs';
|
|
4
6
|
export { MemoryStore, Store, WorkspaceRecord } from './storage/store.cjs';
|
|
5
|
-
export { ArtefactId, ArtefactRoutingHints, AuditEntry, AuditListener, Deliberation, DeliberationVote, Envelope, Handoff, HandoffTaskItem, JsonPatchOp, Jwk, KeyRecord, Member, Mode, OverrideArtefact, ParticipantType, ParticipantUri, PauseScope, ReviewDecision, RouteDecisionArtefact, SnapshotArtefact, Task, TaskId, TaskRoutingHints, TaskState, WhisperPrompt, Workspace, WorkspaceId, WorkspaceState, modeLE } from './types.cjs';
|
|
6
7
|
export { E, isValidEnvelope, rpcError } from './jsonrpc.cjs';
|
|
7
8
|
export { PatchError, applyJsonPatch, diffJsonPatch } from './patch.cjs';
|
|
8
9
|
import { KeyObject } from 'node:crypto';
|
|
9
10
|
|
|
11
|
+
/** The value an entry's chain link hashes. */
|
|
12
|
+
declare function entryRecord(entry: AuditEntry): unknown;
|
|
13
|
+
/** The call an entry records, whether it took effect or was refused. */
|
|
14
|
+
declare function entryCall(entry: AuditEntry): Envelope | undefined;
|
|
15
|
+
/** True when an entry records a refused call. */
|
|
16
|
+
declare function isRefusal(entry: AuditEntry): boolean;
|
|
17
|
+
/** chain_head = SHA-256( JCS(record) || prev_hash ). */
|
|
18
|
+
declare function linkHash(record: unknown, prev: string): string;
|
|
19
|
+
|
|
10
20
|
/**
|
|
11
21
|
* @brightbeamai/chap-coordinator/canonical
|
|
12
22
|
*
|
|
@@ -83,8 +93,11 @@ declare function deriveKeypair(uri: string): {
|
|
|
83
93
|
* CoordinatorOptions.
|
|
84
94
|
*
|
|
85
95
|
* The defaults shipped with the Coordinator (in profiles/routing.ts)
|
|
86
|
-
*
|
|
87
|
-
*
|
|
96
|
+
* apply the same review-depth and escalation rules. Routing differs: this
|
|
97
|
+
* routing policy takes the first candidate as given, so a first candidate
|
|
98
|
+
* who is not a member is refused with -32510 and one who is paused with
|
|
99
|
+
* -32063, where the built-in default passes over both. This factory exists
|
|
100
|
+
* so that the legacy call site can keep using:
|
|
88
101
|
*
|
|
89
102
|
* new Coordinator({ ...makeDefaultPolicy(SENIOR_URI), ... })
|
|
90
103
|
*
|
|
@@ -107,7 +120,7 @@ declare function makeDefaultPolicy(seniorTarget: string): Pick<CoordinatorOption
|
|
|
107
120
|
* happened outside CHAP, wrap it so the audit log carries a faithful,
|
|
108
121
|
* citable record.
|
|
109
122
|
*
|
|
110
|
-
* Spec target: CHAP 0.
|
|
123
|
+
* Spec target: CHAP 0.3. MCP 2026-07-28. A2A 1.0.
|
|
111
124
|
*/
|
|
112
125
|
|
|
113
126
|
interface WrapMcpToolCallOptions {
|
|
@@ -127,6 +140,8 @@ interface WrapMcpToolCallOptions {
|
|
|
127
140
|
routingHints?: Record<string, unknown>;
|
|
128
141
|
/** Optional confidence value attached to task.complete. */
|
|
129
142
|
confidence?: number | string;
|
|
143
|
+
/** Optional id of the decision this call fulfils; recorded as a ``fulfils`` link on the result artefact. Asserted by the caller and not verified by the coordinator. */
|
|
144
|
+
fulfils?: string;
|
|
130
145
|
}
|
|
131
146
|
interface WrapResult {
|
|
132
147
|
task_id: string;
|
|
@@ -158,6 +173,8 @@ interface WrapA2aExchangeOptions {
|
|
|
158
173
|
routingHints?: Record<string, unknown>;
|
|
159
174
|
/** Optional confidence value attached to task.complete. */
|
|
160
175
|
confidence?: number | string;
|
|
176
|
+
/** Optional id of the decision this exchange fulfils; recorded as a ``fulfils`` link on the result artefact. Asserted by the caller and not verified by the coordinator. */
|
|
177
|
+
fulfils?: string;
|
|
161
178
|
}
|
|
162
179
|
interface WrapA2aResult {
|
|
163
180
|
task_id: string;
|
|
@@ -172,4 +189,4 @@ interface WrapA2aResult {
|
|
|
172
189
|
*/
|
|
173
190
|
declare function wrapA2aMessageExchange(coord: Coordinator, workspace: string, options: WrapA2aExchangeOptions): WrapA2aResult;
|
|
174
191
|
|
|
175
|
-
export { Coordinator, CoordinatorOptions, type Jwk as CryptoJwk, type WrapA2aExchangeOptions, type WrapA2aResult, type WrapMcpToolCallOptions, type WrapResult, ZERO_HASH, canonicalize, contentHash, deriveKeypair, deriveSeed, jwkFromPrivateKey, makeDefaultPolicy, publicKeyBytes, publicKeyFromJwk, publicKeyFromRaw, sha256Hex, signEnvelope, verifyEnvelope, wrapA2aMessageExchange, wrapMcpToolCall };
|
|
192
|
+
export { AuditEntry, Coordinator, CoordinatorOptions, type Jwk as CryptoJwk, Envelope, type WrapA2aExchangeOptions, type WrapA2aResult, type WrapMcpToolCallOptions, type WrapResult, ZERO_HASH, canonicalize, contentHash, deriveKeypair, deriveSeed, entryCall, entryRecord, isRefusal, jwkFromPrivateKey, linkHash, makeDefaultPolicy, publicKeyBytes, publicKeyFromJwk, publicKeyFromRaw, sha256Hex, signEnvelope, verifyEnvelope, wrapA2aMessageExchange, wrapMcpToolCall };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { C as CoordinatorOptions, a as Coordinator } from './api-
|
|
2
|
-
export { b as CoordinatorApi, c as CoordinatorError, d as CredentialVerifier, E as EscalationPolicyFn, H as Handler, I as IdFactory, P as PRIVILEGED_METHODS, R as ReviewDepthPolicyFn, e as RoutingPolicyFn, S as ScittReceiptVerifier, f as ScittSubmitter, T as TokenVerifier, g as call, m as makeApi } from './api-
|
|
1
|
+
import { C as CoordinatorOptions, a as Coordinator } from './api-Ddy9fqkY.js';
|
|
2
|
+
export { b as CoordinatorApi, c as CoordinatorError, d as CredentialVerifier, E as EscalationPolicyFn, H as Handler, I as IdFactory, P as PRIVILEGED_METHODS, R as ReviewDepthPolicyFn, e as RoutingPolicyFn, S as ScittReceiptVerifier, f as ScittSubmitter, T as TokenVerifier, g as call, m as makeApi } from './api-Ddy9fqkY.js';
|
|
3
3
|
export { MethodName, MethodParams, MethodResult, MethodTable } from './methods.js';
|
|
4
|
+
import { AuditEntry, Envelope } from './types.js';
|
|
5
|
+
export { ArtefactId, ArtefactRoutingHints, AuditListener, Deliberation, DeliberationVote, Handoff, HandoffTaskItem, JsonPatchOp, Jwk, KeyRecord, Member, Mode, OverrideArtefact, ParticipantType, ParticipantUri, PauseScope, RefusalOutcome, ReviewDecision, RouteDecisionArtefact, SnapshotArtefact, Task, TaskId, TaskRoutingHints, TaskState, WhisperPrompt, Workspace, WorkspaceId, WorkspaceState, modeLE } from './types.js';
|
|
4
6
|
export { MemoryStore, Store, WorkspaceRecord } from './storage/store.js';
|
|
5
|
-
export { ArtefactId, ArtefactRoutingHints, AuditEntry, AuditListener, Deliberation, DeliberationVote, Envelope, Handoff, HandoffTaskItem, JsonPatchOp, Jwk, KeyRecord, Member, Mode, OverrideArtefact, ParticipantType, ParticipantUri, PauseScope, ReviewDecision, RouteDecisionArtefact, SnapshotArtefact, Task, TaskId, TaskRoutingHints, TaskState, WhisperPrompt, Workspace, WorkspaceId, WorkspaceState, modeLE } from './types.js';
|
|
6
7
|
export { E, isValidEnvelope, rpcError } from './jsonrpc.js';
|
|
7
8
|
export { PatchError, applyJsonPatch, diffJsonPatch } from './patch.js';
|
|
8
9
|
import { KeyObject } from 'node:crypto';
|
|
9
10
|
|
|
11
|
+
/** The value an entry's chain link hashes. */
|
|
12
|
+
declare function entryRecord(entry: AuditEntry): unknown;
|
|
13
|
+
/** The call an entry records, whether it took effect or was refused. */
|
|
14
|
+
declare function entryCall(entry: AuditEntry): Envelope | undefined;
|
|
15
|
+
/** True when an entry records a refused call. */
|
|
16
|
+
declare function isRefusal(entry: AuditEntry): boolean;
|
|
17
|
+
/** chain_head = SHA-256( JCS(record) || prev_hash ). */
|
|
18
|
+
declare function linkHash(record: unknown, prev: string): string;
|
|
19
|
+
|
|
10
20
|
/**
|
|
11
21
|
* @brightbeamai/chap-coordinator/canonical
|
|
12
22
|
*
|
|
@@ -83,8 +93,11 @@ declare function deriveKeypair(uri: string): {
|
|
|
83
93
|
* CoordinatorOptions.
|
|
84
94
|
*
|
|
85
95
|
* The defaults shipped with the Coordinator (in profiles/routing.ts)
|
|
86
|
-
*
|
|
87
|
-
*
|
|
96
|
+
* apply the same review-depth and escalation rules. Routing differs: this
|
|
97
|
+
* routing policy takes the first candidate as given, so a first candidate
|
|
98
|
+
* who is not a member is refused with -32510 and one who is paused with
|
|
99
|
+
* -32063, where the built-in default passes over both. This factory exists
|
|
100
|
+
* so that the legacy call site can keep using:
|
|
88
101
|
*
|
|
89
102
|
* new Coordinator({ ...makeDefaultPolicy(SENIOR_URI), ... })
|
|
90
103
|
*
|
|
@@ -107,7 +120,7 @@ declare function makeDefaultPolicy(seniorTarget: string): Pick<CoordinatorOption
|
|
|
107
120
|
* happened outside CHAP, wrap it so the audit log carries a faithful,
|
|
108
121
|
* citable record.
|
|
109
122
|
*
|
|
110
|
-
* Spec target: CHAP 0.
|
|
123
|
+
* Spec target: CHAP 0.3. MCP 2026-07-28. A2A 1.0.
|
|
111
124
|
*/
|
|
112
125
|
|
|
113
126
|
interface WrapMcpToolCallOptions {
|
|
@@ -127,6 +140,8 @@ interface WrapMcpToolCallOptions {
|
|
|
127
140
|
routingHints?: Record<string, unknown>;
|
|
128
141
|
/** Optional confidence value attached to task.complete. */
|
|
129
142
|
confidence?: number | string;
|
|
143
|
+
/** Optional id of the decision this call fulfils; recorded as a ``fulfils`` link on the result artefact. Asserted by the caller and not verified by the coordinator. */
|
|
144
|
+
fulfils?: string;
|
|
130
145
|
}
|
|
131
146
|
interface WrapResult {
|
|
132
147
|
task_id: string;
|
|
@@ -158,6 +173,8 @@ interface WrapA2aExchangeOptions {
|
|
|
158
173
|
routingHints?: Record<string, unknown>;
|
|
159
174
|
/** Optional confidence value attached to task.complete. */
|
|
160
175
|
confidence?: number | string;
|
|
176
|
+
/** Optional id of the decision this exchange fulfils; recorded as a ``fulfils`` link on the result artefact. Asserted by the caller and not verified by the coordinator. */
|
|
177
|
+
fulfils?: string;
|
|
161
178
|
}
|
|
162
179
|
interface WrapA2aResult {
|
|
163
180
|
task_id: string;
|
|
@@ -172,4 +189,4 @@ interface WrapA2aResult {
|
|
|
172
189
|
*/
|
|
173
190
|
declare function wrapA2aMessageExchange(coord: Coordinator, workspace: string, options: WrapA2aExchangeOptions): WrapA2aResult;
|
|
174
191
|
|
|
175
|
-
export { Coordinator, CoordinatorOptions, type Jwk as CryptoJwk, type WrapA2aExchangeOptions, type WrapA2aResult, type WrapMcpToolCallOptions, type WrapResult, ZERO_HASH, canonicalize, contentHash, deriveKeypair, deriveSeed, jwkFromPrivateKey, makeDefaultPolicy, publicKeyBytes, publicKeyFromJwk, publicKeyFromRaw, sha256Hex, signEnvelope, verifyEnvelope, wrapA2aMessageExchange, wrapMcpToolCall };
|
|
192
|
+
export { AuditEntry, Coordinator, CoordinatorOptions, type Jwk as CryptoJwk, Envelope, type WrapA2aExchangeOptions, type WrapA2aResult, type WrapMcpToolCallOptions, type WrapResult, ZERO_HASH, canonicalize, contentHash, deriveKeypair, deriveSeed, entryCall, entryRecord, isRefusal, jwkFromPrivateKey, linkHash, makeDefaultPolicy, publicKeyBytes, publicKeyFromJwk, publicKeyFromRaw, sha256Hex, signEnvelope, verifyEnvelope, wrapA2aMessageExchange, wrapMcpToolCall };
|