@suveren/gateway 0.14.0 → 0.15.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.
@@ -14,7 +14,7 @@
14
14
  <meta name="apple-mobile-web-app-title" content="Suveren" />
15
15
  <meta name="theme-color" content="#111111" />
16
16
  <title>Suveren</title>
17
- <script type="module" crossorigin src="/assets/index-Cg6VaGKb.js"></script>
17
+ <script type="module" crossorigin src="/assets/index-Bu58Y583.js"></script>
18
18
  <link rel="stylesheet" crossorigin href="/assets/index-y1OFeYnS.css">
19
19
  </head>
20
20
  <body>
@@ -467,6 +467,11 @@ interface ExecutionPath {
467
467
  *
468
468
  * Supports both v0.3 (frameSchema) and v0.4 (boundsSchema + contextSchema).
469
469
  */
470
+ /**
471
+ * A commitment mode a person can choose when signing a mandate. (`review_above_cap`
472
+ * is not chosen by the signer — it follows from team caps.)
473
+ */
474
+ type SignableCommitmentMode = 'automatic' | 'review';
470
475
  interface AgentProfile {
471
476
  id: string;
472
477
  name?: string;
@@ -508,6 +513,18 @@ interface AgentProfile {
508
513
  * a forwarded message has usually lost the footer that carried it.
509
514
  */
510
515
  receipt_lookup?: boolean;
516
+ /**
517
+ * The commitment modes a mandate under this profile may be signed with.
518
+ * Absent → every mode (`automatic`, `review`), as before this field existed.
519
+ *
520
+ * Lets a profile be review-only: every action it governs then needs a
521
+ * person's approval, whatever the signer would have picked. The Authority
522
+ * Server refuses to sign a mandate whose `commitment_mode` is not listed;
523
+ * a mandate screen offers only the listed modes. Fail-closed: a declared
524
+ * list with no valid entry allows nothing — a malformed declaration never
525
+ * widens what a profile allows. See {@link allowedCommitmentModes}.
526
+ */
527
+ commitment_modes?: readonly SignableCommitmentMode[];
511
528
  /**
512
529
  * v0.3 frame schema (deprecated, kept for backward compat).
513
530
  * Used when boundsSchema is not present.
@@ -1081,6 +1098,31 @@ declare function computeBoundsHash(params: AgentBoundsParams, profile: AgentProf
1081
1098
  */
1082
1099
  declare function computeContextHash(params: AgentContextParams, profile: AgentProfile): string;
1083
1100
 
1101
+ /**
1102
+ * Which commitment modes a profile allows its mandates to be signed with
1103
+ * (`AgentProfile.commitment_modes`). One source for the Authority Server's
1104
+ * refusal and the mandate screen's choice, so the two cannot disagree.
1105
+ */
1106
+
1107
+ /** Every mode a signer can choose, in the order a mandate screen shows them. */
1108
+ declare const SIGNABLE_COMMITMENT_MODES: readonly SignableCommitmentMode[];
1109
+ /**
1110
+ * The modes a mandate under this profile may carry, in display order.
1111
+ * No declaration → all of them. A declaration is read fail-closed: entries
1112
+ * that are not a signable mode are dropped, so a malformed list can only
1113
+ * narrow — `[]`, `"review"` (not a list) or `["reveiw"]` allow nothing.
1114
+ */
1115
+ declare function allowedCommitmentModes(profile: AgentProfile): readonly SignableCommitmentMode[];
1116
+ /** Whether a mandate under this profile may be signed with `mode`. */
1117
+ declare function isCommitmentModeAllowed(profile: AgentProfile, mode: string): boolean;
1118
+ /**
1119
+ * Authoring check for a profile's `commitment_modes` declaration — for
1120
+ * hap-profiles CI, an authoring tool or a test. Like `validateBoundsRequiredFor`
1121
+ * it is not wired into profile loading; enforcement reads the declaration
1122
+ * fail-closed through `allowedCommitmentModes`. Empty array = nothing to fix.
1123
+ */
1124
+ declare function validateCommitmentModes(profile: AgentProfile): string[];
1125
+
1084
1126
  /**
1085
1127
  * Attestation Encoding, Decoding, and Verification
1086
1128
  *
@@ -1401,4 +1443,4 @@ interface ReceiptPayload {
1401
1443
  */
1402
1444
  declare function verifyReceiptSignature(receipt: ReceiptPayload, publicKeyHex: string): Promise<void>;
1403
1445
 
1404
- export { type AgentBoundsParams, type AgentContextParams, type AgentFrameParams, type AgentProfile, type ApprovalObject, type Attestation, type AttestationHeader, type AttestationPayload, type BoundType, CanonicalValueError, type ContentBinding, ContentBindingError, type ContentBindingErrorCode, type CumulativeFieldDef, type CumulativeWindow, type DeclaredFieldDef, type ExecutionContextFieldDef, type ExecutionLogEntry, type ExecutionLogQuery, type ExecutionMappingTransform, type ExecutionMappingValue, type ExecutionPath, type FieldConstraint, type FieldUnit, type GateQuestion, type GatekeeperError, type GatekeeperRequest, type GatekeeperResult, type MandateBinding, MandateError, type MandateProjection, type OwnerMandate, type ProfileBoundsField, type ProfileContextField, type ProfileFrameField, type ProfileToolGating, type ProfileToolGatingEntry, type ReceiptPayload, type ResolvedDomain, type SigningSurface, type Subject, type SubjectValidation, approvalSigningBytes, attestationId, bindingAppliesTo, boundActionTypes, buildMandateProjection, canonicalBounds, canonicalContext, canonicalFrame, canonicalize, canonicalizeText, checkAttestationExpiry, clearProfiles, computeBoundsHash, computeContentHash, computeContextHash, computeFieldsContentHash, computeFrameHash, computeIntentDisclosureHash, computeIntentHash, contentCanonicalBytes, decodeAttestationBlob, decodeDidKey, deriveIdentityLine, encodeAttestationBlob, encodeDidKey, frameHash, getAllProfiles, getProfile, intentDisclosureCanonicalBytes, isFieldBinding, isKeyBearingDid, isV4Attestation, listProfiles, mandateSigningBytes, registerProfile, selectBoundFields, signApproval, signMandateProjection, validateBoundsParams, validateBoundsRequiredFor, validateContextParams, validateFrameParams, validateSubject, verify, verifyApproval, verifyAttestation, verifyAttestationSignature, verifyAttestationV4, verifyBoundsHash, verifyContextHash, verifyFrameHash, verifyOwnerMandate, verifyOwnerMandates, verifyReceiptSignature };
1446
+ export { type AgentBoundsParams, type AgentContextParams, type AgentFrameParams, type AgentProfile, type ApprovalObject, type Attestation, type AttestationHeader, type AttestationPayload, type BoundType, CanonicalValueError, type ContentBinding, ContentBindingError, type ContentBindingErrorCode, type CumulativeFieldDef, type CumulativeWindow, type DeclaredFieldDef, type ExecutionContextFieldDef, type ExecutionLogEntry, type ExecutionLogQuery, type ExecutionMappingTransform, type ExecutionMappingValue, type ExecutionPath, type FieldConstraint, type FieldUnit, type GateQuestion, type GatekeeperError, type GatekeeperRequest, type GatekeeperResult, type MandateBinding, MandateError, type MandateProjection, type OwnerMandate, type ProfileBoundsField, type ProfileContextField, type ProfileFrameField, type ProfileToolGating, type ProfileToolGatingEntry, type ReceiptPayload, type ResolvedDomain, SIGNABLE_COMMITMENT_MODES, type SignableCommitmentMode, type SigningSurface, type Subject, type SubjectValidation, allowedCommitmentModes, approvalSigningBytes, attestationId, bindingAppliesTo, boundActionTypes, buildMandateProjection, canonicalBounds, canonicalContext, canonicalFrame, canonicalize, canonicalizeText, checkAttestationExpiry, clearProfiles, computeBoundsHash, computeContentHash, computeContextHash, computeFieldsContentHash, computeFrameHash, computeIntentDisclosureHash, computeIntentHash, contentCanonicalBytes, decodeAttestationBlob, decodeDidKey, deriveIdentityLine, encodeAttestationBlob, encodeDidKey, frameHash, getAllProfiles, getProfile, intentDisclosureCanonicalBytes, isCommitmentModeAllowed, isFieldBinding, isKeyBearingDid, isV4Attestation, listProfiles, mandateSigningBytes, registerProfile, selectBoundFields, signApproval, signMandateProjection, validateBoundsParams, validateBoundsRequiredFor, validateCommitmentModes, validateContextParams, validateFrameParams, validateSubject, verify, verifyApproval, verifyAttestation, verifyAttestationSignature, verifyAttestationV4, verifyBoundsHash, verifyContextHash, verifyFrameHash, verifyOwnerMandate, verifyOwnerMandates, verifyReceiptSignature };
@@ -467,6 +467,11 @@ interface ExecutionPath {
467
467
  *
468
468
  * Supports both v0.3 (frameSchema) and v0.4 (boundsSchema + contextSchema).
469
469
  */
470
+ /**
471
+ * A commitment mode a person can choose when signing a mandate. (`review_above_cap`
472
+ * is not chosen by the signer — it follows from team caps.)
473
+ */
474
+ type SignableCommitmentMode = 'automatic' | 'review';
470
475
  interface AgentProfile {
471
476
  id: string;
472
477
  name?: string;
@@ -508,6 +513,18 @@ interface AgentProfile {
508
513
  * a forwarded message has usually lost the footer that carried it.
509
514
  */
510
515
  receipt_lookup?: boolean;
516
+ /**
517
+ * The commitment modes a mandate under this profile may be signed with.
518
+ * Absent → every mode (`automatic`, `review`), as before this field existed.
519
+ *
520
+ * Lets a profile be review-only: every action it governs then needs a
521
+ * person's approval, whatever the signer would have picked. The Authority
522
+ * Server refuses to sign a mandate whose `commitment_mode` is not listed;
523
+ * a mandate screen offers only the listed modes. Fail-closed: a declared
524
+ * list with no valid entry allows nothing — a malformed declaration never
525
+ * widens what a profile allows. See {@link allowedCommitmentModes}.
526
+ */
527
+ commitment_modes?: readonly SignableCommitmentMode[];
511
528
  /**
512
529
  * v0.3 frame schema (deprecated, kept for backward compat).
513
530
  * Used when boundsSchema is not present.
@@ -1081,6 +1098,31 @@ declare function computeBoundsHash(params: AgentBoundsParams, profile: AgentProf
1081
1098
  */
1082
1099
  declare function computeContextHash(params: AgentContextParams, profile: AgentProfile): string;
1083
1100
 
1101
+ /**
1102
+ * Which commitment modes a profile allows its mandates to be signed with
1103
+ * (`AgentProfile.commitment_modes`). One source for the Authority Server's
1104
+ * refusal and the mandate screen's choice, so the two cannot disagree.
1105
+ */
1106
+
1107
+ /** Every mode a signer can choose, in the order a mandate screen shows them. */
1108
+ declare const SIGNABLE_COMMITMENT_MODES: readonly SignableCommitmentMode[];
1109
+ /**
1110
+ * The modes a mandate under this profile may carry, in display order.
1111
+ * No declaration → all of them. A declaration is read fail-closed: entries
1112
+ * that are not a signable mode are dropped, so a malformed list can only
1113
+ * narrow — `[]`, `"review"` (not a list) or `["reveiw"]` allow nothing.
1114
+ */
1115
+ declare function allowedCommitmentModes(profile: AgentProfile): readonly SignableCommitmentMode[];
1116
+ /** Whether a mandate under this profile may be signed with `mode`. */
1117
+ declare function isCommitmentModeAllowed(profile: AgentProfile, mode: string): boolean;
1118
+ /**
1119
+ * Authoring check for a profile's `commitment_modes` declaration — for
1120
+ * hap-profiles CI, an authoring tool or a test. Like `validateBoundsRequiredFor`
1121
+ * it is not wired into profile loading; enforcement reads the declaration
1122
+ * fail-closed through `allowedCommitmentModes`. Empty array = nothing to fix.
1123
+ */
1124
+ declare function validateCommitmentModes(profile: AgentProfile): string[];
1125
+
1084
1126
  /**
1085
1127
  * Attestation Encoding, Decoding, and Verification
1086
1128
  *
@@ -1401,4 +1443,4 @@ interface ReceiptPayload {
1401
1443
  */
1402
1444
  declare function verifyReceiptSignature(receipt: ReceiptPayload, publicKeyHex: string): Promise<void>;
1403
1445
 
1404
- export { type AgentBoundsParams, type AgentContextParams, type AgentFrameParams, type AgentProfile, type ApprovalObject, type Attestation, type AttestationHeader, type AttestationPayload, type BoundType, CanonicalValueError, type ContentBinding, ContentBindingError, type ContentBindingErrorCode, type CumulativeFieldDef, type CumulativeWindow, type DeclaredFieldDef, type ExecutionContextFieldDef, type ExecutionLogEntry, type ExecutionLogQuery, type ExecutionMappingTransform, type ExecutionMappingValue, type ExecutionPath, type FieldConstraint, type FieldUnit, type GateQuestion, type GatekeeperError, type GatekeeperRequest, type GatekeeperResult, type MandateBinding, MandateError, type MandateProjection, type OwnerMandate, type ProfileBoundsField, type ProfileContextField, type ProfileFrameField, type ProfileToolGating, type ProfileToolGatingEntry, type ReceiptPayload, type ResolvedDomain, type SigningSurface, type Subject, type SubjectValidation, approvalSigningBytes, attestationId, bindingAppliesTo, boundActionTypes, buildMandateProjection, canonicalBounds, canonicalContext, canonicalFrame, canonicalize, canonicalizeText, checkAttestationExpiry, clearProfiles, computeBoundsHash, computeContentHash, computeContextHash, computeFieldsContentHash, computeFrameHash, computeIntentDisclosureHash, computeIntentHash, contentCanonicalBytes, decodeAttestationBlob, decodeDidKey, deriveIdentityLine, encodeAttestationBlob, encodeDidKey, frameHash, getAllProfiles, getProfile, intentDisclosureCanonicalBytes, isFieldBinding, isKeyBearingDid, isV4Attestation, listProfiles, mandateSigningBytes, registerProfile, selectBoundFields, signApproval, signMandateProjection, validateBoundsParams, validateBoundsRequiredFor, validateContextParams, validateFrameParams, validateSubject, verify, verifyApproval, verifyAttestation, verifyAttestationSignature, verifyAttestationV4, verifyBoundsHash, verifyContextHash, verifyFrameHash, verifyOwnerMandate, verifyOwnerMandates, verifyReceiptSignature };
1446
+ export { type AgentBoundsParams, type AgentContextParams, type AgentFrameParams, type AgentProfile, type ApprovalObject, type Attestation, type AttestationHeader, type AttestationPayload, type BoundType, CanonicalValueError, type ContentBinding, ContentBindingError, type ContentBindingErrorCode, type CumulativeFieldDef, type CumulativeWindow, type DeclaredFieldDef, type ExecutionContextFieldDef, type ExecutionLogEntry, type ExecutionLogQuery, type ExecutionMappingTransform, type ExecutionMappingValue, type ExecutionPath, type FieldConstraint, type FieldUnit, type GateQuestion, type GatekeeperError, type GatekeeperRequest, type GatekeeperResult, type MandateBinding, MandateError, type MandateProjection, type OwnerMandate, type ProfileBoundsField, type ProfileContextField, type ProfileFrameField, type ProfileToolGating, type ProfileToolGatingEntry, type ReceiptPayload, type ResolvedDomain, SIGNABLE_COMMITMENT_MODES, type SignableCommitmentMode, type SigningSurface, type Subject, type SubjectValidation, allowedCommitmentModes, approvalSigningBytes, attestationId, bindingAppliesTo, boundActionTypes, buildMandateProjection, canonicalBounds, canonicalContext, canonicalFrame, canonicalize, canonicalizeText, checkAttestationExpiry, clearProfiles, computeBoundsHash, computeContentHash, computeContextHash, computeFieldsContentHash, computeFrameHash, computeIntentDisclosureHash, computeIntentHash, contentCanonicalBytes, decodeAttestationBlob, decodeDidKey, deriveIdentityLine, encodeAttestationBlob, encodeDidKey, frameHash, getAllProfiles, getProfile, intentDisclosureCanonicalBytes, isCommitmentModeAllowed, isFieldBinding, isKeyBearingDid, isV4Attestation, listProfiles, mandateSigningBytes, registerProfile, selectBoundFields, signApproval, signMandateProjection, validateBoundsParams, validateBoundsRequiredFor, validateCommitmentModes, validateContextParams, validateFrameParams, validateSubject, verify, verifyApproval, verifyAttestation, verifyAttestationSignature, verifyAttestationV4, verifyBoundsHash, verifyContextHash, verifyFrameHash, verifyOwnerMandate, verifyOwnerMandates, verifyReceiptSignature };
@@ -33,6 +33,8 @@ __export(index_exports, {
33
33
  CanonicalValueError: () => CanonicalValueError,
34
34
  ContentBindingError: () => ContentBindingError,
35
35
  MandateError: () => MandateError,
36
+ SIGNABLE_COMMITMENT_MODES: () => SIGNABLE_COMMITMENT_MODES,
37
+ allowedCommitmentModes: () => allowedCommitmentModes,
36
38
  approvalSigningBytes: () => approvalSigningBytes,
37
39
  attestationId: () => attestationId,
38
40
  bindingAppliesTo: () => bindingAppliesTo,
@@ -62,6 +64,7 @@ __export(index_exports, {
62
64
  getAllProfiles: () => getAllProfiles,
63
65
  getProfile: () => getProfile,
64
66
  intentDisclosureCanonicalBytes: () => intentDisclosureCanonicalBytes,
67
+ isCommitmentModeAllowed: () => isCommitmentModeAllowed,
65
68
  isFieldBinding: () => isFieldBinding,
66
69
  isKeyBearingDid: () => isKeyBearingDid,
67
70
  isV4Attestation: () => isV4Attestation,
@@ -73,6 +76,7 @@ __export(index_exports, {
73
76
  signMandateProjection: () => signMandateProjection,
74
77
  validateBoundsParams: () => validateBoundsParams,
75
78
  validateBoundsRequiredFor: () => validateBoundsRequiredFor,
79
+ validateCommitmentModes: () => validateCommitmentModes,
76
80
  validateContextParams: () => validateContextParams,
77
81
  validateFrameParams: () => validateFrameParams,
78
82
  validateSubject: () => validateSubject,
@@ -478,6 +482,33 @@ function computeContextHash(params, profile) {
478
482
  return `sha256:${hash}`;
479
483
  }
480
484
 
485
+ // src/commitment-modes.ts
486
+ var SIGNABLE_COMMITMENT_MODES = ["review", "automatic"];
487
+ var isSignable = (v) => typeof v === "string" && SIGNABLE_COMMITMENT_MODES.includes(v);
488
+ function allowedCommitmentModes(profile) {
489
+ const declared = profile.commitment_modes;
490
+ if (declared === void 0) return SIGNABLE_COMMITMENT_MODES;
491
+ if (!Array.isArray(declared)) return [];
492
+ return SIGNABLE_COMMITMENT_MODES.filter((m) => declared.includes(m));
493
+ }
494
+ function isCommitmentModeAllowed(profile, mode) {
495
+ return isSignable(mode) && allowedCommitmentModes(profile).includes(mode);
496
+ }
497
+ function validateCommitmentModes(profile) {
498
+ const declared = profile.commitment_modes;
499
+ if (declared === void 0) return [];
500
+ if (!Array.isArray(declared)) return ["commitment_modes must be a list of modes."];
501
+ const errors = [];
502
+ if (declared.length === 0) errors.push("commitment_modes is empty \u2014 no mandate could ever be signed under this profile.");
503
+ const seen = /* @__PURE__ */ new Set();
504
+ for (const m of declared) {
505
+ if (!isSignable(m)) errors.push(`commitment_modes: "${String(m)}" is not a mode a signer can choose (${SIGNABLE_COMMITMENT_MODES.join(", ")}).`);
506
+ if (seen.has(m)) errors.push(`commitment_modes: "${String(m)}" appears twice.`);
507
+ seen.add(m);
508
+ }
509
+ return errors;
510
+ }
511
+
481
512
  // src/attestation.ts
482
513
  var import_crypto4 = require("crypto");
483
514
  var ed = __toESM(require("@noble/ed25519"));
@@ -1276,6 +1307,8 @@ async function verifyReceiptSignature(receipt, publicKeyHex) {
1276
1307
  CanonicalValueError,
1277
1308
  ContentBindingError,
1278
1309
  MandateError,
1310
+ SIGNABLE_COMMITMENT_MODES,
1311
+ allowedCommitmentModes,
1279
1312
  approvalSigningBytes,
1280
1313
  attestationId,
1281
1314
  bindingAppliesTo,
@@ -1305,6 +1338,7 @@ async function verifyReceiptSignature(receipt, publicKeyHex) {
1305
1338
  getAllProfiles,
1306
1339
  getProfile,
1307
1340
  intentDisclosureCanonicalBytes,
1341
+ isCommitmentModeAllowed,
1308
1342
  isFieldBinding,
1309
1343
  isKeyBearingDid,
1310
1344
  isV4Attestation,
@@ -1316,6 +1350,7 @@ async function verifyReceiptSignature(receipt, publicKeyHex) {
1316
1350
  signMandateProjection,
1317
1351
  validateBoundsParams,
1318
1352
  validateBoundsRequiredFor,
1353
+ validateCommitmentModes,
1319
1354
  validateContextParams,
1320
1355
  validateFrameParams,
1321
1356
  validateSubject,
@@ -386,6 +386,33 @@ function computeContextHash(params, profile) {
386
386
  return `sha256:${hash}`;
387
387
  }
388
388
 
389
+ // src/commitment-modes.ts
390
+ var SIGNABLE_COMMITMENT_MODES = ["review", "automatic"];
391
+ var isSignable = (v) => typeof v === "string" && SIGNABLE_COMMITMENT_MODES.includes(v);
392
+ function allowedCommitmentModes(profile) {
393
+ const declared = profile.commitment_modes;
394
+ if (declared === void 0) return SIGNABLE_COMMITMENT_MODES;
395
+ if (!Array.isArray(declared)) return [];
396
+ return SIGNABLE_COMMITMENT_MODES.filter((m) => declared.includes(m));
397
+ }
398
+ function isCommitmentModeAllowed(profile, mode) {
399
+ return isSignable(mode) && allowedCommitmentModes(profile).includes(mode);
400
+ }
401
+ function validateCommitmentModes(profile) {
402
+ const declared = profile.commitment_modes;
403
+ if (declared === void 0) return [];
404
+ if (!Array.isArray(declared)) return ["commitment_modes must be a list of modes."];
405
+ const errors = [];
406
+ if (declared.length === 0) errors.push("commitment_modes is empty \u2014 no mandate could ever be signed under this profile.");
407
+ const seen = /* @__PURE__ */ new Set();
408
+ for (const m of declared) {
409
+ if (!isSignable(m)) errors.push(`commitment_modes: "${String(m)}" is not a mode a signer can choose (${SIGNABLE_COMMITMENT_MODES.join(", ")}).`);
410
+ if (seen.has(m)) errors.push(`commitment_modes: "${String(m)}" appears twice.`);
411
+ seen.add(m);
412
+ }
413
+ return errors;
414
+ }
415
+
389
416
  // src/attestation.ts
390
417
  import { createHash as createHash4 } from "crypto";
391
418
  import * as ed from "@noble/ed25519";
@@ -1183,6 +1210,8 @@ export {
1183
1210
  CanonicalValueError,
1184
1211
  ContentBindingError,
1185
1212
  MandateError,
1213
+ SIGNABLE_COMMITMENT_MODES,
1214
+ allowedCommitmentModes,
1186
1215
  approvalSigningBytes,
1187
1216
  attestationId,
1188
1217
  bindingAppliesTo,
@@ -1212,6 +1241,7 @@ export {
1212
1241
  getAllProfiles,
1213
1242
  getProfile,
1214
1243
  intentDisclosureCanonicalBytes,
1244
+ isCommitmentModeAllowed,
1215
1245
  isFieldBinding,
1216
1246
  isKeyBearingDid,
1217
1247
  isV4Attestation,
@@ -1223,6 +1253,7 @@ export {
1223
1253
  signMandateProjection,
1224
1254
  validateBoundsParams,
1225
1255
  validateBoundsRequiredFor,
1256
+ validateCommitmentModes,
1226
1257
  validateContextParams,
1227
1258
  validateFrameParams,
1228
1259
  validateSubject,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humanagencyp/hap-core",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Core types, cryptographic primitives, and verification logic for the Human Agency Protocol",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Which commitment modes a profile allows its mandates to be signed with
3
+ * (`AgentProfile.commitment_modes`). One source for the Authority Server's
4
+ * refusal and the mandate screen's choice, so the two cannot disagree.
5
+ */
6
+ import type { AgentProfile, SignableCommitmentMode } from './types';
7
+
8
+ /** Every mode a signer can choose, in the order a mandate screen shows them. */
9
+ export const SIGNABLE_COMMITMENT_MODES: readonly SignableCommitmentMode[] = ['review', 'automatic'];
10
+
11
+ const isSignable = (v: unknown): v is SignableCommitmentMode =>
12
+ typeof v === 'string' && (SIGNABLE_COMMITMENT_MODES as readonly string[]).includes(v);
13
+
14
+ /**
15
+ * The modes a mandate under this profile may carry, in display order.
16
+ * No declaration → all of them. A declaration is read fail-closed: entries
17
+ * that are not a signable mode are dropped, so a malformed list can only
18
+ * narrow — `[]`, `"review"` (not a list) or `["reveiw"]` allow nothing.
19
+ */
20
+ export function allowedCommitmentModes(profile: AgentProfile): readonly SignableCommitmentMode[] {
21
+ const declared = (profile as { commitment_modes?: unknown }).commitment_modes;
22
+ if (declared === undefined) return SIGNABLE_COMMITMENT_MODES;
23
+ if (!Array.isArray(declared)) return [];
24
+ return SIGNABLE_COMMITMENT_MODES.filter((m) => declared.includes(m));
25
+ }
26
+
27
+ /** Whether a mandate under this profile may be signed with `mode`. */
28
+ export function isCommitmentModeAllowed(profile: AgentProfile, mode: string): boolean {
29
+ return isSignable(mode) && allowedCommitmentModes(profile).includes(mode);
30
+ }
31
+
32
+ /**
33
+ * Authoring check for a profile's `commitment_modes` declaration — for
34
+ * hap-profiles CI, an authoring tool or a test. Like `validateBoundsRequiredFor`
35
+ * it is not wired into profile loading; enforcement reads the declaration
36
+ * fail-closed through `allowedCommitmentModes`. Empty array = nothing to fix.
37
+ */
38
+ export function validateCommitmentModes(profile: AgentProfile): string[] {
39
+ const declared = (profile as { commitment_modes?: unknown }).commitment_modes;
40
+ if (declared === undefined) return [];
41
+ if (!Array.isArray(declared)) return ['commitment_modes must be a list of modes.'];
42
+ const errors: string[] = [];
43
+ if (declared.length === 0) errors.push('commitment_modes is empty — no mandate could ever be signed under this profile.');
44
+ const seen = new Set<unknown>();
45
+ for (const m of declared) {
46
+ if (!isSignable(m)) errors.push(`commitment_modes: "${String(m)}" is not a mode a signer can choose (${SIGNABLE_COMMITMENT_MODES.join(', ')}).`);
47
+ if (seen.has(m)) errors.push(`commitment_modes: "${String(m)}" appears twice.`);
48
+ seen.add(m);
49
+ }
50
+ return errors;
51
+ }
@@ -10,6 +10,7 @@ export * from './content-binding';
10
10
  export * from './intent-disclosure';
11
11
  export * from './identity';
12
12
  export * from './frame';
13
+ export * from './commitment-modes';
13
14
  export * from './attestation';
14
15
  export * from './gatekeeper';
15
16
  export * from './profiles';
@@ -479,6 +479,12 @@ export interface ExecutionPath {
479
479
  *
480
480
  * Supports both v0.3 (frameSchema) and v0.4 (boundsSchema + contextSchema).
481
481
  */
482
+ /**
483
+ * A commitment mode a person can choose when signing a mandate. (`review_above_cap`
484
+ * is not chosen by the signer — it follows from team caps.)
485
+ */
486
+ export type SignableCommitmentMode = 'automatic' | 'review';
487
+
482
488
  export interface AgentProfile {
483
489
  id: string;
484
490
  name?: string;
@@ -523,6 +529,19 @@ export interface AgentProfile {
523
529
  */
524
530
  receipt_lookup?: boolean;
525
531
 
532
+ /**
533
+ * The commitment modes a mandate under this profile may be signed with.
534
+ * Absent → every mode (`automatic`, `review`), as before this field existed.
535
+ *
536
+ * Lets a profile be review-only: every action it governs then needs a
537
+ * person's approval, whatever the signer would have picked. The Authority
538
+ * Server refuses to sign a mandate whose `commitment_mode` is not listed;
539
+ * a mandate screen offers only the listed modes. Fail-closed: a declared
540
+ * list with no valid entry allows nothing — a malformed declaration never
541
+ * widens what a profile allows. See {@link allowedCommitmentModes}.
542
+ */
543
+ commitment_modes?: readonly SignableCommitmentMode[];
544
+
526
545
  /**
527
546
  * v0.3 frame schema (deprecated, kept for backward compat).
528
547
  * Used when boundsSchema is not present.
@@ -1,4 +1,10 @@
1
- # MCP TypeScript SDK [![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fsdk)](https://www.npmjs.com/package/@modelcontextprotocol/sdk) [![MIT licensed](https://img.shields.io/npm/l/%40modelcontextprotocol%2Fsdk)](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/LICENSE)
1
+ # MCP TypeScript SDK [![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fsdk)](https://www.npmjs.com/package/@modelcontextprotocol/sdk) [![MIT licensed](https://img.shields.io/npm/l/%40modelcontextprotocol%2Fsdk)](https://github.com/modelcontextprotocol/typescript-sdk/blob/v1.x/LICENSE)
2
+
3
+ > **This is v1.x of the MCP TypeScript SDK, the maintenance line.** It implements the MCP spec up to 2025-11-25. Support for the [2026-07-28 spec](https://modelcontextprotocol.io/specification/2026-07-28) is not planned for v1.x: it is in v2, the current stable release, which
4
+ > ships as separate packages, [`@modelcontextprotocol/server`](https://www.npmjs.com/package/@modelcontextprotocol/server) and [`@modelcontextprotocol/client`](https://www.npmjs.com/package/@modelcontextprotocol/client). See the
5
+ > [v2 documentation](https://ts.sdk.modelcontextprotocol.io/v2/) and the [migration guide](https://ts.sdk.modelcontextprotocol.io/v2/migration/upgrade-to-v2).
6
+ >
7
+ > **Staying on v1.x?** It continues to receive bug fixes and security updates for at least six months after the v2 release (2026-07-27). The v1 documentation is at <https://ts.sdk.modelcontextprotocol.io/>.
2
8
 
3
9
  <details>
4
10
  <summary>Table of Contents</summary>
@@ -17,7 +23,7 @@
17
23
  ## Overview
18
24
 
19
25
  The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This TypeScript SDK implements
20
- [the full MCP specification](https://modelcontextprotocol.io/specification/draft), making it easy to:
26
+ [the 2025-11-25 MCP specification](https://modelcontextprotocol.io/specification/2025-11-25), making it easy to:
21
27
 
22
28
  - Create MCP servers that expose resources, prompts and tools
23
29
  - Build MCP clients that can connect to any MCP server
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelcontextprotocol/sdk",
3
- "version": "1.32.0",
3
+ "version": "1.32.1",
4
4
  "description": "Model Context Protocol implementation for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Anthropic, PBC (https://anthropic.com)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suveren/gateway",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Suveren gateway — local agent gateway built in compliance with the Human Agency Protocol (HAP). Runs the UI, control plane, and MCP server in one Node process.",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -24,7 +24,7 @@
24
24
  "node": ">=22"
25
25
  },
26
26
  "dependencies": {
27
- "@hap/core": "npm:@humanagencyp/hap-core@^0.11.0",
27
+ "@hap/core": "npm:@humanagencyp/hap-core@^0.11.1",
28
28
  "@hpke/core": "^1.9.0",
29
29
  "express": "^4.18.0",
30
30
  "http-proxy-middleware": "^3.0.0",
@@ -28,6 +28,7 @@
28
28
  "github.com/humanagencyprotocol/hap-profiles/customers@0.8": "customers/0.8.profile.json",
29
29
  "github.com/humanagencyprotocol/hap-profiles/email@0.7": "email/0.7.profile.json",
30
30
  "github.com/humanagencyprotocol/hap-profiles/sales@0.3": "sales/0.3.profile.json",
31
- "github.com/humanagencyprotocol/hap-profiles/purchase@0.6": "purchase/0.6.profile.json"
31
+ "github.com/humanagencyprotocol/hap-profiles/purchase@0.6": "purchase/0.6.profile.json",
32
+ "github.com/humanagencyprotocol/hap-profiles/reporting@0.1": "reporting/0.1.profile.json"
32
33
  }
33
34
  }
@@ -0,0 +1,83 @@
1
+ {
2
+ "id": "github.com/humanagencyprotocol/hap-profiles/reporting@0.1",
3
+ "name": "Reporting",
4
+ "version": "0.1",
5
+ "description": "Reporting authority — lets an agent read the evidence a gateway holds (tickets, approvals, mandates, records in the systems it connects) and write one report stored on that machine. Changes no system.",
6
+ "boundsSchema": {
7
+ "actionTypes": [
8
+ "report"
9
+ ],
10
+ "keyOrder": [
11
+ "profile",
12
+ "read_access",
13
+ "report_daily_max"
14
+ ],
15
+ "fields": {
16
+ "profile": {
17
+ "type": "string",
18
+ "required": true
19
+ },
20
+ "read_access": {
21
+ "type": "string",
22
+ "required": true,
23
+ "displayName": "Read evidence",
24
+ "description": "Allow the agent to read tickets, approvals, mandates and the records in connected systems, to build a report",
25
+ "boundType": {
26
+ "kind": "enum",
27
+ "values": [
28
+ "unlimited",
29
+ "none"
30
+ ]
31
+ },
32
+ "toolsDescription": "tickets, approvals, mandates, system records",
33
+ "default": "unlimited"
34
+ },
35
+ "report_daily_max": {
36
+ "type": "number",
37
+ "required": true,
38
+ "displayName": "Report updates per day",
39
+ "description": "Maximum times per day the agent may write or replace the report",
40
+ "unit": "count",
41
+ "boundType": {
42
+ "kind": "cumulative_count",
43
+ "window": "daily"
44
+ },
45
+ "appliesTo": [
46
+ "report"
47
+ ]
48
+ }
49
+ }
50
+ },
51
+ "executionContextSchema": {
52
+ "fields": {
53
+ "report_count_daily": {
54
+ "source": "cumulative",
55
+ "cumulativeField": "_count",
56
+ "window": "daily",
57
+ "description": "Running daily count of report writes",
58
+ "required": true,
59
+ "constraint": {
60
+ "type": "number",
61
+ "enforceable": [
62
+ "max"
63
+ ]
64
+ }
65
+ }
66
+ }
67
+ },
68
+ "requiredGates": [
69
+ "bounds",
70
+ "intent",
71
+ "commitment",
72
+ "decision_owner"
73
+ ],
74
+ "ttl": {
75
+ "default": 86400,
76
+ "max": 2592000
77
+ },
78
+ "retention_minimum": 7776000,
79
+ "content_binding": {
80
+ "version": "1",
81
+ "kind": "jcs"
82
+ }
83
+ }