@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/index.d.cts CHANGED
@@ -1,11 +1,11 @@
1
- import { C as CoordinatorOptions, a as Coordinator } from './api-59aU01Bs.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-59aU01Bs.cjs';
1
+ import { C as CoordinatorOptions, a as Coordinator } from './api-CjZQnj63.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-CjZQnj63.cjs';
3
3
  export { MethodName, MethodParams, MethodResult, MethodTable } from './methods.cjs';
4
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';
5
+ export { ArtefactId, ArtefactRoutingHints, AuditListener, Deliberation, DeliberationVote, Handoff, HandoffTaskItem, Invitation, JoinPolicy, JsonPatchOp, Jwk, KeyRecord, Member, Mode, OverrideArtefact, ParticipantType, ParticipantUri, PauseScope, RefusalOutcome, ReviewDecision, RouteDecisionArtefact, SignaturePolicy, SnapshotArtefact, Task, TaskId, TaskRoutingHints, TaskState, WhisperPrompt, Workspace, WorkspaceId, WorkspaceState, modeLE } from './types.cjs';
6
6
  export { MemoryStore, Store, StoreChange, StoreConflictError, WorkspaceRecord } from './storage/store.cjs';
7
7
  export { E, isValidEnvelope, rpcError } from './jsonrpc.cjs';
8
- export { PatchError, applyJsonPatch, diffJsonPatch } from './patch.cjs';
8
+ export { DEFAULT_MAX_PATCHED_BYTES, PatchError, PatchLimits, applyJsonPatch, diffJsonPatch } from './patch.cjs';
9
9
  import { KeyObject } from 'node:crypto';
10
10
 
11
11
  /** The value an entry's chain link hashes. */
@@ -45,10 +45,12 @@ declare function contentHash(content: unknown): string;
45
45
  /**
46
46
  * @brightbeamai/chap-coordinator/crypto
47
47
  *
48
- * Ed25519 signing/verification for the security-signed/1.0 profile.
48
+ * Ed25519 signing/verification for the security-signed/1.0 profile, and
49
+ * verification of WebAuthn assertions, the signatures a browser's
50
+ * authenticator makes with a P-256 key.
49
51
  *
50
52
  * Uses Node's built-in crypto (no external dependencies). Keys are
51
- * represented as RFC 7517 JWKs with kty=OKP, crv=Ed25519.
53
+ * represented as RFC 7517 JWKs.
52
54
  */
53
55
 
54
56
  interface Jwk {
@@ -140,6 +142,15 @@ interface WrapMcpToolCallOptions {
140
142
  routingHints?: Record<string, unknown>;
141
143
  /** Optional confidence value attached to task.complete. */
142
144
  confidence?: number | string;
145
+ /**
146
+ * Create the task with ``review_required``, so ``task.complete`` holds the
147
+ * result as the artefact under review, opens a review addressed to the
148
+ * workspace's human members other than ``caller``, and leaves the task in
149
+ * ``review_requested`` until one of them decides. Where the workspace has
150
+ * no such member, this throws before anything is recorded. Default false:
151
+ * the task completes at once.
152
+ */
153
+ reviewRequired?: boolean;
143
154
  /** 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
155
  fulfils?: string;
145
156
  }
@@ -156,6 +167,9 @@ interface WrapResult {
156
167
  * The result artefact is the MCP tool's return value, plus a
157
168
  * ``citations[]`` entry with the input/output hashes per
158
169
  * ``integrations/CHAP-with-MCP.md`` §2.
170
+ *
171
+ * Throws when the coordinator refuses a call. A refused ``task.complete``
172
+ * leaves the task it names in progress, on the log.
159
173
  */
160
174
  declare function wrapMcpToolCall(coord: Coordinator, workspace: string, options: WrapMcpToolCallOptions): WrapResult;
161
175
  interface WrapA2aExchangeOptions {
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { C as CoordinatorOptions, a as Coordinator } from './api-CxciGFHA.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-CxciGFHA.js';
1
+ import { C as CoordinatorOptions, a as Coordinator } from './api-DG0VFGVr.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-DG0VFGVr.js';
3
3
  export { MethodName, MethodParams, MethodResult, MethodTable } from './methods.js';
4
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';
5
+ export { ArtefactId, ArtefactRoutingHints, AuditListener, Deliberation, DeliberationVote, Handoff, HandoffTaskItem, Invitation, JoinPolicy, JsonPatchOp, Jwk, KeyRecord, Member, Mode, OverrideArtefact, ParticipantType, ParticipantUri, PauseScope, RefusalOutcome, ReviewDecision, RouteDecisionArtefact, SignaturePolicy, SnapshotArtefact, Task, TaskId, TaskRoutingHints, TaskState, WhisperPrompt, Workspace, WorkspaceId, WorkspaceState, modeLE } from './types.js';
6
6
  export { MemoryStore, Store, StoreChange, StoreConflictError, WorkspaceRecord } from './storage/store.js';
7
7
  export { E, isValidEnvelope, rpcError } from './jsonrpc.js';
8
- export { PatchError, applyJsonPatch, diffJsonPatch } from './patch.js';
8
+ export { DEFAULT_MAX_PATCHED_BYTES, PatchError, PatchLimits, applyJsonPatch, diffJsonPatch } from './patch.js';
9
9
  import { KeyObject } from 'node:crypto';
10
10
 
11
11
  /** The value an entry's chain link hashes. */
@@ -45,10 +45,12 @@ declare function contentHash(content: unknown): string;
45
45
  /**
46
46
  * @brightbeamai/chap-coordinator/crypto
47
47
  *
48
- * Ed25519 signing/verification for the security-signed/1.0 profile.
48
+ * Ed25519 signing/verification for the security-signed/1.0 profile, and
49
+ * verification of WebAuthn assertions, the signatures a browser's
50
+ * authenticator makes with a P-256 key.
49
51
  *
50
52
  * Uses Node's built-in crypto (no external dependencies). Keys are
51
- * represented as RFC 7517 JWKs with kty=OKP, crv=Ed25519.
53
+ * represented as RFC 7517 JWKs.
52
54
  */
53
55
 
54
56
  interface Jwk {
@@ -140,6 +142,15 @@ interface WrapMcpToolCallOptions {
140
142
  routingHints?: Record<string, unknown>;
141
143
  /** Optional confidence value attached to task.complete. */
142
144
  confidence?: number | string;
145
+ /**
146
+ * Create the task with ``review_required``, so ``task.complete`` holds the
147
+ * result as the artefact under review, opens a review addressed to the
148
+ * workspace's human members other than ``caller``, and leaves the task in
149
+ * ``review_requested`` until one of them decides. Where the workspace has
150
+ * no such member, this throws before anything is recorded. Default false:
151
+ * the task completes at once.
152
+ */
153
+ reviewRequired?: boolean;
143
154
  /** 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
155
  fulfils?: string;
145
156
  }
@@ -156,6 +167,9 @@ interface WrapResult {
156
167
  * The result artefact is the MCP tool's return value, plus a
157
168
  * ``citations[]`` entry with the input/output hashes per
158
169
  * ``integrations/CHAP-with-MCP.md`` §2.
170
+ *
171
+ * Throws when the coordinator refuses a call. A refused ``task.complete``
172
+ * leaves the task it names in progress, on the log.
159
173
  */
160
174
  declare function wrapMcpToolCall(coord: Coordinator, workspace: string, options: WrapMcpToolCallOptions): WrapResult;
161
175
  interface WrapA2aExchangeOptions {