@agent-vm/agent-portal-sdk 0.0.141 → 0.0.143

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 (120) hide show
  1. package/contract-fixtures/portable-contracts/approval/decision-request-approved.fixture.json +18 -0
  2. package/contract-fixtures/portable-contracts/approval/decision-result-recorded.fixture.json +18 -0
  3. package/contract-fixtures/portable-contracts/approval/presentation-outcome-approved.fixture.json +16 -0
  4. package/contract-fixtures/portable-contracts/approval/presentation-request.fixture.json +32 -0
  5. package/contract-fixtures/portable-contracts/discovery/describe-result.fixture.json +7 -3
  6. package/contract-fixtures/portable-contracts/discovery/list-result.fixture.json +15 -3
  7. package/contract-fixtures/portable-contracts/discovery/search-result.fixture.json +7 -3
  8. package/contract-fixtures/portable-contracts/gateway/managed-agent-projection-hermes-valid.fixture.json +7 -4
  9. package/contract-fixtures/portable-contracts/gateway/managed-agent-projection-long-namespace-name.fixture.json +13 -6
  10. package/contract-fixtures/portable-contracts/gateway/managed-agent-projection-namespace-names-code-point-order.fixture.json +7 -4
  11. package/contract-fixtures/portable-contracts/gateway/managed-agent-projection-namespace-names-code-point-reverse.fixture.json +6 -3
  12. package/contract-fixtures/portable-contracts/gateway/managed-agent-projection-namespace-names-duplicate.fixture.json +6 -3
  13. package/contract-fixtures/portable-contracts/gateway/managed-agent-projection-namespace-names-unsorted.fixture.json +6 -3
  14. package/contract-fixtures/portable-contracts/gateway/managed-agent-projection-old-authority-rejected.fixture.json +5 -2
  15. package/contract-fixtures/portable-contracts/gateway/managed-agent-projection-openclaw-valid.fixture.json +7 -4
  16. package/contract-fixtures/portable-contracts/gateway/managed-agent-projection-self-root-rejected.fixture.json +5 -2
  17. package/contract-fixtures/portable-contracts/gateway/managed-agent-projection-work-root-rejected.fixture.json +5 -2
  18. package/dist/adapter-boundary/index.d.ts +1 -1
  19. package/dist/approval-surface/index.d.ts +2 -2
  20. package/dist/approval-surface/index.js +2 -2
  21. package/dist/approval-surface-Cqk_hAtN.js +132 -0
  22. package/dist/approval-surface-Cqk_hAtN.js.map +1 -0
  23. package/dist/artifact-surface/index.d.ts +1 -1
  24. package/dist/artifact-surface/index.js +1 -1
  25. package/dist/{artifact-surface-BIDasG5x.js → artifact-surface-CHEu4tDd.js} +2 -2
  26. package/dist/{artifact-surface-BIDasG5x.js.map → artifact-surface-CHEu4tDd.js.map} +1 -1
  27. package/dist/capability-description-surface/index.d.ts +1 -1
  28. package/dist/capability-description-surface/index.js +2 -2
  29. package/dist/capability-description-surface-CplIb93y.js +2 -0
  30. package/dist/{capability-descriptor-schema-DmzUtpji.js → capability-descriptor-schema-v9tj7yKr.js} +2 -2
  31. package/dist/{capability-descriptor-schema-DmzUtpji.js.map → capability-descriptor-schema-v9tj7yKr.js.map} +1 -1
  32. package/dist/cli/tool-portal.js +6 -6
  33. package/dist/contracts/index.d.ts +1 -1
  34. package/dist/contracts/index.js +1 -1
  35. package/dist/{contracts-3pjrcMjD.js → contracts-mBPxCxoG.js} +15 -14
  36. package/dist/{contracts-3pjrcMjD.js.map → contracts-mBPxCxoG.js.map} +1 -1
  37. package/dist/gateway-runtime-client/index.d.ts +11 -4
  38. package/dist/gateway-runtime-client/index.d.ts.map +1 -1
  39. package/dist/gateway-runtime-client/index.js +22 -5
  40. package/dist/gateway-runtime-client/index.js.map +1 -1
  41. package/dist/gateway-runtime-local-exec/gateway-runtime-local-exec-helper.js +1 -1
  42. package/dist/gateway-runtime-local-exec/index.js +1 -1
  43. package/dist/{gateway-runtime-local-exec-transport-DjxMXdT9.js → gateway-runtime-local-exec-transport-CO2bQ3wz.js} +1 -1
  44. package/dist/{gateway-runtime-local-exec-transport-DjxMXdT9.js.map → gateway-runtime-local-exec-transport-CO2bQ3wz.js.map} +1 -1
  45. package/dist/{index-D8uVfMBv.d.ts → index-BIvLq827.d.ts} +2 -2
  46. package/dist/{index-D8uVfMBv.d.ts.map → index-BIvLq827.d.ts.map} +1 -1
  47. package/dist/{index-BgKPbuap.d.ts → index-Badq9e6i.d.ts} +1 -1
  48. package/dist/{index-BgKPbuap.d.ts.map → index-Badq9e6i.d.ts.map} +1 -1
  49. package/dist/{index-DqMFYBbN.d.ts → index-C-QFWaH5.d.ts} +39 -6
  50. package/dist/index-C-QFWaH5.d.ts.map +1 -0
  51. package/dist/{index-B_xYdo3v.d.ts → index-DDLN0DE_.d.ts} +2 -2
  52. package/dist/{index-B_xYdo3v.d.ts.map → index-DDLN0DE_.d.ts.map} +1 -1
  53. package/dist/{index-B_FqoejO.d.ts → index-DTTEu7ZT.d.ts} +1 -1
  54. package/dist/{index-B_FqoejO.d.ts.map → index-DTTEu7ZT.d.ts.map} +1 -1
  55. package/dist/{index-BQ12JshX.d.ts → index-DZJH4Rau.d.ts} +1 -1
  56. package/dist/{index-BQ12JshX.d.ts.map → index-DZJH4Rau.d.ts.map} +1 -1
  57. package/dist/index-D_69tlLY.d.ts +29 -0
  58. package/dist/index-D_69tlLY.d.ts.map +1 -0
  59. package/dist/{index-yuB9HEo-.d.ts → index-S5RZg56U.d.ts} +4 -4
  60. package/dist/{index-yuB9HEo-.d.ts.map → index-S5RZg56U.d.ts.map} +1 -1
  61. package/dist/index-ex2lEawY.d.ts +124 -0
  62. package/dist/index-ex2lEawY.d.ts.map +1 -0
  63. package/dist/{index-C5NhyO2R.d.ts → index-tmZkznV6.d.ts} +5 -2
  64. package/dist/{index-C5NhyO2R.d.ts.map → index-tmZkznV6.d.ts.map} +1 -1
  65. package/dist/index.d.ts +12 -12
  66. package/dist/index.js +16 -15
  67. package/dist/{json-value-schema-BGfMDOGA.js → json-value-schema-Br5M7d7X.js} +2 -2
  68. package/dist/{json-value-schema-BGfMDOGA.js.map → json-value-schema-Br5M7d7X.js.map} +1 -1
  69. package/dist/{json-value-schema-C-87ATB3.d.ts → json-value-schema-CwDmttWU.d.ts} +1 -1
  70. package/dist/{json-value-schema-C-87ATB3.d.ts.map → json-value-schema-CwDmttWU.d.ts.map} +1 -1
  71. package/dist/namespace-discovery-schema-DwbJHVLu.js +21 -0
  72. package/dist/namespace-discovery-schema-DwbJHVLu.js.map +1 -0
  73. package/dist/{node-tool-portal-mcp-transport-CnB8MCW2.js → node-tool-portal-mcp-transport-xFo0i37Q.js} +1 -1
  74. package/dist/{node-tool-portal-mcp-transport-CnB8MCW2.js.map → node-tool-portal-mcp-transport-xFo0i37Q.js.map} +1 -1
  75. package/dist/portable-contracts/index.d.ts +1 -1
  76. package/dist/portable-contracts/index.js +2 -2
  77. package/dist/{portable-contracts-C5rtqe-H.js → portable-contracts-CKeFnjAA.js} +28 -11
  78. package/dist/portable-contracts-CKeFnjAA.js.map +1 -0
  79. package/dist/{portable-refinement-authoring-CvlKRs_Z.js → portable-refinement-authoring-C1Q92x2G.js} +29 -6
  80. package/dist/portable-refinement-authoring-C1Q92x2G.js.map +1 -0
  81. package/dist/{portal-call-request-schema-DYxcWijW.js → portal-call-request-schema-Cl0kTLaX.js} +4 -4
  82. package/dist/{portal-call-request-schema-DYxcWijW.js.map → portal-call-request-schema-Cl0kTLaX.js.map} +1 -1
  83. package/dist/{portal-call-result-schema-CVWMGu2y.js → portal-call-result-schema-B25_rzZZ.js} +20 -10
  84. package/dist/portal-call-result-schema-B25_rzZZ.js.map +1 -0
  85. package/dist/{portal-call-result-schema-DalyNrfW.d.ts → portal-call-result-schema-DIg2ERl4.d.ts} +1025 -59
  86. package/dist/portal-call-result-schema-DIg2ERl4.d.ts.map +1 -0
  87. package/dist/portal-call-surface/index.d.ts +3 -3
  88. package/dist/portal-call-surface/index.js +5 -5
  89. package/dist/{portal-call-surface-B_oQxm5X.js → portal-call-surface-qykVz_8k.js} +6 -6
  90. package/dist/{portal-call-surface-B_oQxm5X.js.map → portal-call-surface-qykVz_8k.js.map} +1 -1
  91. package/dist/{portal-error-schema-BCALC7xt.js → portal-error-schema-TSNrpQSy.js} +1 -1
  92. package/dist/{portal-error-schema-BCALC7xt.js.map → portal-error-schema-TSNrpQSy.js.map} +1 -1
  93. package/dist/portal-event-surface/index.d.ts +1 -1
  94. package/dist/portal-event-surface/index.js +2 -2
  95. package/dist/{portal-event-surface-DSWv7Kgi.js → portal-event-surface-Bp3rXsBz.js} +3 -3
  96. package/dist/{portal-event-surface-DSWv7Kgi.js.map → portal-event-surface-Bp3rXsBz.js.map} +1 -1
  97. package/dist/{request-id-schema-DGLLX-tp.js → request-id-schema-Hq_6lSFV.js} +2 -2
  98. package/dist/{request-id-schema-DGLLX-tp.js.map → request-id-schema-Hq_6lSFV.js.map} +1 -1
  99. package/dist/testing/index.d.ts +2 -2
  100. package/dist/testing/index.js +2 -2
  101. package/dist/tool-portal-mcp-client/index.d.ts +1 -1
  102. package/dist/tool-portal-mcp-client/index.js +1 -1
  103. package/dist/tool-portal-mcp-client/node-tool-portal-mcp-transport.d.ts +1 -1
  104. package/dist/tool-portal-mcp-client/node-tool-portal-mcp-transport.js +1 -1
  105. package/dist/{tool-portal-mcp-client-nMGxqQ-A.js → tool-portal-mcp-client-DZoloMod.js} +5 -5
  106. package/dist/{tool-portal-mcp-client-nMGxqQ-A.js.map → tool-portal-mcp-client-DZoloMod.js.map} +1 -1
  107. package/package.json +1 -1
  108. package/portable-contract-schema-manifest.json +275 -9
  109. package/dist/approval-surface-z5JUqa0K.js +0 -20
  110. package/dist/approval-surface-z5JUqa0K.js.map +0 -1
  111. package/dist/capability-description-surface-CyPgad9d.js +0 -2
  112. package/dist/index-BqWw914Z.d.ts +0 -64
  113. package/dist/index-BqWw914Z.d.ts.map +0 -1
  114. package/dist/index-DqMFYBbN.d.ts.map +0 -1
  115. package/dist/index-dKXgrOwm.d.ts +0 -17
  116. package/dist/index-dKXgrOwm.d.ts.map +0 -1
  117. package/dist/portable-contracts-C5rtqe-H.js.map +0 -1
  118. package/dist/portable-refinement-authoring-CvlKRs_Z.js.map +0 -1
  119. package/dist/portal-call-result-schema-CVWMGu2y.js.map +0 -1
  120. package/dist/portal-call-result-schema-DalyNrfW.d.ts.map +0 -1
@@ -0,0 +1,18 @@
1
+ {
2
+ "caseId": "gateway-approval-decision-request-approved",
3
+ "schemaId": "gateway.approval.decision-request",
4
+ "tags": ["accepted"],
5
+ "input": {
6
+ "challengeId": "11111111-1111-4111-8111-111111111111",
7
+ "decision": "approve"
8
+ },
9
+ "expectation": {
10
+ "kind": "accepted",
11
+ "normalized": {
12
+ "challengeId": "11111111-1111-4111-8111-111111111111",
13
+ "decision": "approve"
14
+ },
15
+ "canonicalJson": "{\"challengeId\":\"11111111-1111-4111-8111-111111111111\",\"decision\":\"approve\"}",
16
+ "refinementIdentities": []
17
+ }
18
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "caseId": "gateway-approval-decision-result-recorded",
3
+ "schemaId": "gateway.approval.decision-result",
4
+ "tags": ["accepted"],
5
+ "input": {
6
+ "kind": "recorded",
7
+ "state": "approved"
8
+ },
9
+ "expectation": {
10
+ "kind": "accepted",
11
+ "normalized": {
12
+ "kind": "recorded",
13
+ "state": "approved"
14
+ },
15
+ "canonicalJson": "{\"kind\":\"recorded\",\"state\":\"approved\"}",
16
+ "refinementIdentities": []
17
+ }
18
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "caseId": "gateway-approval-presentation-outcome-approved",
3
+ "schemaId": "gateway.approval.presentation-outcome",
4
+ "tags": ["accepted"],
5
+ "input": {
6
+ "kind": "approved"
7
+ },
8
+ "expectation": {
9
+ "kind": "accepted",
10
+ "normalized": {
11
+ "kind": "approved"
12
+ },
13
+ "canonicalJson": "{\"kind\":\"approved\"}",
14
+ "refinementIdentities": []
15
+ }
16
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "caseId": "gateway-approval-presentation-request",
3
+ "schemaId": "gateway.approval.presentation-request",
4
+ "tags": ["accepted", "byte-bound"],
5
+ "input": {
6
+ "allowedDecisions": ["approve", "deny"],
7
+ "challengeId": "11111111-1111-4111-8111-111111111111",
8
+ "display": {
9
+ "argumentsPreview": "{\"path\":\"README.md\"}"
10
+ },
11
+ "expiresAt": "2026-08-20T21:00:00.000Z",
12
+ "itemId": "call-a",
13
+ "name": "read",
14
+ "namespace": "files"
15
+ },
16
+ "expectation": {
17
+ "kind": "accepted",
18
+ "normalized": {
19
+ "allowedDecisions": ["approve", "deny"],
20
+ "challengeId": "11111111-1111-4111-8111-111111111111",
21
+ "display": {
22
+ "argumentsPreview": "{\"path\":\"README.md\"}"
23
+ },
24
+ "expiresAt": "2026-08-20T21:00:00.000Z",
25
+ "itemId": "call-a",
26
+ "name": "read",
27
+ "namespace": "files"
28
+ },
29
+ "canonicalJson": "{\"allowedDecisions\":[\"approve\",\"deny\"],\"challengeId\":\"11111111-1111-4111-8111-111111111111\",\"display\":{\"argumentsPreview\":\"{\\\"path\\\":\\\"README.md\\\"}\"},\"expiresAt\":\"2026-08-20T21:00:00.000Z\",\"itemId\":\"call-a\",\"name\":\"read\",\"namespace\":\"files\"}",
30
+ "refinementIdentities": ["gateway.approval.arguments-preview.utf8-bytes"]
31
+ }
32
+ }
@@ -3,16 +3,20 @@
3
3
  "schemaId": "portal.describe.result",
4
4
  "tags": ["accepted", "discovery", "result"],
5
5
  "input": {
6
- "items": [{ "id": "describe-1", "status": "ok", "value": { "tools": [] } }],
6
+ "items": [
7
+ { "id": "describe-1", "status": "ok", "value": { "namespaceDiscovery": [], "tools": [] } }
8
+ ],
7
9
  "ok": true
8
10
  },
9
11
  "expectation": {
10
12
  "kind": "accepted",
11
13
  "normalized": {
12
- "items": [{ "id": "describe-1", "status": "ok", "value": { "tools": [] } }],
14
+ "items": [
15
+ { "id": "describe-1", "status": "ok", "value": { "namespaceDiscovery": [], "tools": [] } }
16
+ ],
13
17
  "ok": true
14
18
  },
15
- "canonicalJson": "{\"items\":[{\"id\":\"describe-1\",\"status\":\"ok\",\"value\":{\"tools\":[]}}],\"ok\":true}",
19
+ "canonicalJson": "{\"items\":[{\"id\":\"describe-1\",\"status\":\"ok\",\"value\":{\"namespaceDiscovery\":[],\"tools\":[]}}],\"ok\":true}",
16
20
  "refinementIdentities": ["portal.request-id.not-reserved", "portal.result.aggregate-status"]
17
21
  }
18
22
  }
@@ -3,16 +3,28 @@
3
3
  "schemaId": "portal.list.result",
4
4
  "tags": ["accepted", "discovery", "result"],
5
5
  "input": {
6
- "items": [{ "id": "list-1", "status": "ok", "value": { "namespaces": [], "tools": [] } }],
6
+ "items": [
7
+ {
8
+ "id": "list-1",
9
+ "status": "ok",
10
+ "value": { "namespaceDiscovery": [], "namespaces": [], "tools": [] }
11
+ }
12
+ ],
7
13
  "ok": true
8
14
  },
9
15
  "expectation": {
10
16
  "kind": "accepted",
11
17
  "normalized": {
12
- "items": [{ "id": "list-1", "status": "ok", "value": { "namespaces": [], "tools": [] } }],
18
+ "items": [
19
+ {
20
+ "id": "list-1",
21
+ "status": "ok",
22
+ "value": { "namespaceDiscovery": [], "namespaces": [], "tools": [] }
23
+ }
24
+ ],
13
25
  "ok": true
14
26
  },
15
- "canonicalJson": "{\"items\":[{\"id\":\"list-1\",\"status\":\"ok\",\"value\":{\"namespaces\":[],\"tools\":[]}}],\"ok\":true}",
27
+ "canonicalJson": "{\"items\":[{\"id\":\"list-1\",\"status\":\"ok\",\"value\":{\"namespaceDiscovery\":[],\"namespaces\":[],\"tools\":[]}}],\"ok\":true}",
16
28
  "refinementIdentities": ["portal.request-id.not-reserved", "portal.result.aggregate-status"]
17
29
  }
18
30
  }
@@ -3,16 +3,20 @@
3
3
  "schemaId": "portal.search.result",
4
4
  "tags": ["accepted", "discovery", "result"],
5
5
  "input": {
6
- "items": [{ "id": "search-1", "status": "ok", "value": { "tools": [] } }],
6
+ "items": [
7
+ { "id": "search-1", "status": "ok", "value": { "namespaceDiscovery": [], "tools": [] } }
8
+ ],
7
9
  "ok": true
8
10
  },
9
11
  "expectation": {
10
12
  "kind": "accepted",
11
13
  "normalized": {
12
- "items": [{ "id": "search-1", "status": "ok", "value": { "tools": [] } }],
14
+ "items": [
15
+ { "id": "search-1", "status": "ok", "value": { "namespaceDiscovery": [], "tools": [] } }
16
+ ],
13
17
  "ok": true
14
18
  },
15
- "canonicalJson": "{\"items\":[{\"id\":\"search-1\",\"status\":\"ok\",\"value\":{\"tools\":[]}}],\"ok\":true}",
19
+ "canonicalJson": "{\"items\":[{\"id\":\"search-1\",\"status\":\"ok\",\"value\":{\"namespaceDiscovery\":[],\"tools\":[]}}],\"ok\":true}",
16
20
  "refinementIdentities": ["portal.request-id.not-reserved", "portal.result.aggregate-status"]
17
21
  }
18
22
  }
@@ -9,7 +9,7 @@
9
9
  "profileName": "reviewer"
10
10
  },
11
11
  "profileAssignmentRevision": "profile-assignment-b",
12
- "toolPortalNamespaceNames": ["filesystem"],
12
+ "toolPortalNamespaces": [{ "namespace": "filesystem", "summary": "Filesystem operations" }],
13
13
  "toolPortalProfileId": "review"
14
14
  },
15
15
  "expectation": {
@@ -21,10 +21,13 @@
21
21
  "profileName": "reviewer"
22
22
  },
23
23
  "profileAssignmentRevision": "profile-assignment-b",
24
- "toolPortalNamespaceNames": ["filesystem"],
24
+ "toolPortalNamespaces": [{ "namespace": "filesystem", "summary": "Filesystem operations" }],
25
25
  "toolPortalProfileId": "review"
26
26
  },
27
- "canonicalJson": "{\"agentId\":\"agent-b\",\"frameworkIdentity\":{\"kind\":\"hermes\",\"profileName\":\"reviewer\"},\"profileAssignmentRevision\":\"profile-assignment-b\",\"toolPortalNamespaceNames\":[\"filesystem\"],\"toolPortalProfileId\":\"review\"}",
28
- "refinementIdentities": ["gateway.managed-agent-projection.namespace-names"]
27
+ "canonicalJson": "{\"agentId\":\"agent-b\",\"frameworkIdentity\":{\"kind\":\"hermes\",\"profileName\":\"reviewer\"},\"profileAssignmentRevision\":\"profile-assignment-b\",\"toolPortalNamespaces\":[{\"namespace\":\"filesystem\",\"summary\":\"Filesystem operations\"}],\"toolPortalProfileId\":\"review\"}",
28
+ "refinementIdentities": [
29
+ "gateway.managed-agent-projection.namespaces",
30
+ "portal.namespace-discovery.summary-code-points"
31
+ ]
29
32
  }
30
33
  }
@@ -9,8 +9,10 @@
9
9
  "kind": "openclaw"
10
10
  },
11
11
  "profileAssignmentRevision": "profile-assignment-a",
12
- "toolPortalNamespaceNames": [
13
- "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
12
+ "toolPortalNamespaces": [
13
+ {
14
+ "namespace": "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
15
+ }
14
16
  ],
15
17
  "toolPortalProfileId": "engineering"
16
18
  },
@@ -23,12 +25,17 @@
23
25
  "kind": "openclaw"
24
26
  },
25
27
  "profileAssignmentRevision": "profile-assignment-a",
26
- "toolPortalNamespaceNames": [
27
- "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
28
+ "toolPortalNamespaces": [
29
+ {
30
+ "namespace": "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
31
+ }
28
32
  ],
29
33
  "toolPortalProfileId": "engineering"
30
34
  },
31
- "canonicalJson": "{\"agentId\":\"agent-a\",\"frameworkIdentity\":{\"agentId\":\"agent-a\",\"kind\":\"openclaw\"},\"profileAssignmentRevision\":\"profile-assignment-a\",\"toolPortalNamespaceNames\":[\"nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn\"],\"toolPortalProfileId\":\"engineering\"}",
32
- "refinementIdentities": ["gateway.managed-agent-projection.namespace-names"]
35
+ "canonicalJson": "{\"agentId\":\"agent-a\",\"frameworkIdentity\":{\"agentId\":\"agent-a\",\"kind\":\"openclaw\"},\"profileAssignmentRevision\":\"profile-assignment-a\",\"toolPortalNamespaces\":[{\"namespace\":\"nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn\"}],\"toolPortalProfileId\":\"engineering\"}",
36
+ "refinementIdentities": [
37
+ "gateway.managed-agent-projection.namespaces",
38
+ "portal.namespace-discovery.summary-code-points"
39
+ ]
33
40
  }
34
41
  }
@@ -9,7 +9,7 @@
9
9
  "kind": "openclaw"
10
10
  },
11
11
  "profileAssignmentRevision": "profile-assignment-a",
12
- "toolPortalNamespaceNames": ["\uE000", "\uD800\uDC00"],
12
+ "toolPortalNamespaces": [{ "namespace": "\uE000" }, { "namespace": "\uD800\uDC00" }],
13
13
  "toolPortalProfileId": "profile-a"
14
14
  },
15
15
  "expectation": {
@@ -21,10 +21,13 @@
21
21
  "kind": "openclaw"
22
22
  },
23
23
  "profileAssignmentRevision": "profile-assignment-a",
24
- "toolPortalNamespaceNames": ["\uE000", "\uD800\uDC00"],
24
+ "toolPortalNamespaces": [{ "namespace": "\uE000" }, { "namespace": "\uD800\uDC00" }],
25
25
  "toolPortalProfileId": "profile-a"
26
26
  },
27
- "canonicalJson": "{\"agentId\":\"agent-a\",\"frameworkIdentity\":{\"agentId\":\"agent-a\",\"kind\":\"openclaw\"},\"profileAssignmentRevision\":\"profile-assignment-a\",\"toolPortalNamespaceNames\":[\"\",\"𐀀\"],\"toolPortalProfileId\":\"profile-a\"}",
28
- "refinementIdentities": ["gateway.managed-agent-projection.namespace-names"]
27
+ "canonicalJson": "{\"agentId\":\"agent-a\",\"frameworkIdentity\":{\"agentId\":\"agent-a\",\"kind\":\"openclaw\"},\"profileAssignmentRevision\":\"profile-assignment-a\",\"toolPortalNamespaces\":[{\"namespace\":\"\"},{\"namespace\":\"𐀀\"}],\"toolPortalProfileId\":\"profile-a\"}",
28
+ "refinementIdentities": [
29
+ "gateway.managed-agent-projection.namespaces",
30
+ "portal.namespace-discovery.summary-code-points"
31
+ ]
29
32
  }
30
33
  }
@@ -15,12 +15,15 @@
15
15
  "kind": "openclaw"
16
16
  },
17
17
  "profileAssignmentRevision": "profile-assignment-a",
18
- "toolPortalNamespaceNames": ["\uD800\uDC00", "\uE000"],
18
+ "toolPortalNamespaces": [{ "namespace": "\uD800\uDC00" }, { "namespace": "\uE000" }],
19
19
  "toolPortalProfileId": "profile-a"
20
20
  },
21
21
  "expectation": {
22
22
  "kind": "rejected",
23
- "errorCodes": ["gateway.managed-agent-projection.namespace-names"],
24
- "refinementIdentities": ["gateway.managed-agent-projection.namespace-names"]
23
+ "errorCodes": ["gateway.managed-agent-projection.namespaces"],
24
+ "refinementIdentities": [
25
+ "gateway.managed-agent-projection.namespaces",
26
+ "portal.namespace-discovery.summary-code-points"
27
+ ]
25
28
  }
26
29
  }
@@ -9,12 +9,15 @@
9
9
  "kind": "openclaw"
10
10
  },
11
11
  "profileAssignmentRevision": "profile-assignment-a",
12
- "toolPortalNamespaceNames": ["filesystem", "filesystem"],
12
+ "toolPortalNamespaces": [{ "namespace": "filesystem" }, { "namespace": "filesystem" }],
13
13
  "toolPortalProfileId": "engineering"
14
14
  },
15
15
  "expectation": {
16
16
  "kind": "rejected",
17
- "errorCodes": ["gateway.managed-agent-projection.namespace-names"],
18
- "refinementIdentities": ["gateway.managed-agent-projection.namespace-names"]
17
+ "errorCodes": ["gateway.managed-agent-projection.namespaces"],
18
+ "refinementIdentities": [
19
+ "gateway.managed-agent-projection.namespaces",
20
+ "portal.namespace-discovery.summary-code-points"
21
+ ]
19
22
  }
20
23
  }
@@ -9,12 +9,15 @@
9
9
  "kind": "openclaw"
10
10
  },
11
11
  "profileAssignmentRevision": "profile-assignment-a",
12
- "toolPortalNamespaceNames": ["github", "filesystem"],
12
+ "toolPortalNamespaces": [{ "namespace": "github" }, { "namespace": "filesystem" }],
13
13
  "toolPortalProfileId": "engineering"
14
14
  },
15
15
  "expectation": {
16
16
  "kind": "rejected",
17
- "errorCodes": ["gateway.managed-agent-projection.namespace-names"],
18
- "refinementIdentities": ["gateway.managed-agent-projection.namespace-names"]
17
+ "errorCodes": ["gateway.managed-agent-projection.namespaces"],
18
+ "refinementIdentities": [
19
+ "gateway.managed-agent-projection.namespaces",
20
+ "portal.namespace-discovery.summary-code-points"
21
+ ]
19
22
  }
20
23
  }
@@ -10,12 +10,15 @@
10
10
  },
11
11
  "profileAssignmentRevision": "profile-assignment-a",
12
12
  "profileId": "retired-profile-selector",
13
- "toolPortalNamespaceNames": [],
13
+ "toolPortalNamespaces": [],
14
14
  "toolPortalProfileId": "engineering"
15
15
  },
16
16
  "expectation": {
17
17
  "kind": "rejected",
18
18
  "errorCodes": ["portable.object.unknown-field"],
19
- "refinementIdentities": ["gateway.managed-agent-projection.namespace-names"]
19
+ "refinementIdentities": [
20
+ "gateway.managed-agent-projection.namespaces",
21
+ "portal.namespace-discovery.summary-code-points"
22
+ ]
20
23
  }
21
24
  }
@@ -9,7 +9,7 @@
9
9
  "kind": "openclaw"
10
10
  },
11
11
  "profileAssignmentRevision": "profile-assignment-a",
12
- "toolPortalNamespaceNames": [],
12
+ "toolPortalNamespaces": [],
13
13
  "toolPortalProfileId": "engineering"
14
14
  },
15
15
  "expectation": {
@@ -21,10 +21,13 @@
21
21
  "kind": "openclaw"
22
22
  },
23
23
  "profileAssignmentRevision": "profile-assignment-a",
24
- "toolPortalNamespaceNames": [],
24
+ "toolPortalNamespaces": [],
25
25
  "toolPortalProfileId": "engineering"
26
26
  },
27
- "canonicalJson": "{\"agentId\":\"agent-a\",\"frameworkIdentity\":{\"agentId\":\"agent-a\",\"kind\":\"openclaw\"},\"profileAssignmentRevision\":\"profile-assignment-a\",\"toolPortalNamespaceNames\":[],\"toolPortalProfileId\":\"engineering\"}",
28
- "refinementIdentities": ["gateway.managed-agent-projection.namespace-names"]
27
+ "canonicalJson": "{\"agentId\":\"agent-a\",\"frameworkIdentity\":{\"agentId\":\"agent-a\",\"kind\":\"openclaw\"},\"profileAssignmentRevision\":\"profile-assignment-a\",\"toolPortalNamespaces\":[],\"toolPortalProfileId\":\"engineering\"}",
28
+ "refinementIdentities": [
29
+ "gateway.managed-agent-projection.namespaces",
30
+ "portal.namespace-discovery.summary-code-points"
31
+ ]
29
32
  }
30
33
  }
@@ -10,12 +10,15 @@
10
10
  },
11
11
  "profileAssignmentRevision": "profile-assignment-a",
12
12
  "selfRoot": "/zone/agents/agent-a/self",
13
- "toolPortalNamespaceNames": [],
13
+ "toolPortalNamespaces": [],
14
14
  "toolPortalProfileId": "engineering"
15
15
  },
16
16
  "expectation": {
17
17
  "kind": "rejected",
18
18
  "errorCodes": ["portable.object.unknown-field"],
19
- "refinementIdentities": ["gateway.managed-agent-projection.namespace-names"]
19
+ "refinementIdentities": [
20
+ "gateway.managed-agent-projection.namespaces",
21
+ "portal.namespace-discovery.summary-code-points"
22
+ ]
20
23
  }
21
24
  }
@@ -9,13 +9,16 @@
9
9
  "kind": "openclaw"
10
10
  },
11
11
  "profileAssignmentRevision": "profile-assignment-a",
12
- "toolPortalNamespaceNames": [],
12
+ "toolPortalNamespaces": [],
13
13
  "toolPortalProfileId": "engineering",
14
14
  "workRoot": "/zone/agents/agent-a/work"
15
15
  },
16
16
  "expectation": {
17
17
  "kind": "rejected",
18
18
  "errorCodes": ["portable.object.unknown-field"],
19
- "refinementIdentities": ["gateway.managed-agent-projection.namespace-names"]
19
+ "refinementIdentities": [
20
+ "gateway.managed-agent-projection.namespaces",
21
+ "portal.namespace-discovery.summary-code-points"
22
+ ]
20
23
  }
21
24
  }
@@ -1,2 +1,2 @@
1
- import { i as TrustedAgentScopeSchema, n as PortalAdapterEnvelopeSchema, r as TrustedAgentScope, t as PortalAdapterEnvelope } from "../index-BgKPbuap.js";
1
+ import { i as TrustedAgentScopeSchema, n as PortalAdapterEnvelopeSchema, r as TrustedAgentScope, t as PortalAdapterEnvelope } from "../index-Badq9e6i.js";
2
2
  export { PortalAdapterEnvelope, PortalAdapterEnvelopeSchema, TrustedAgentScope, TrustedAgentScopeSchema };
@@ -1,2 +1,2 @@
1
- import { a as ApprovalRequiredResult, i as ApprovalDecisionReferenceSchema, n as ApprovalChallengeReferenceSchema, o as ApprovalRequiredResultSchema, r as ApprovalDecisionReference, t as ApprovalChallengeReference } from "../index-BqWw914Z.js";
2
- export { ApprovalChallengeReference, ApprovalChallengeReferenceSchema, ApprovalDecisionReference, ApprovalDecisionReferenceSchema, ApprovalRequiredResult, ApprovalRequiredResultSchema };
1
+ import { a as GatewayApprovalDecisionResult, c as GatewayApprovalPresentationRequestSchema, d as ApprovalChallengeReferenceSchema, f as ApprovalDecisionReference, h as ApprovalRequiredResultSchema, i as GatewayApprovalDecisionRequestSchema, l as sanitizeGatewayApprovalArguments, m as ApprovalRequiredResult, n as ApprovalPresentationOutcomeSchema, o as GatewayApprovalDecisionResultSchema, p as ApprovalDecisionReferenceSchema, r as GatewayApprovalDecisionRequest, s as GatewayApprovalPresentationRequest, t as ApprovalPresentationOutcome, u as ApprovalChallengeReference } from "../index-ex2lEawY.js";
2
+ export { ApprovalChallengeReference, ApprovalChallengeReferenceSchema, ApprovalDecisionReference, ApprovalDecisionReferenceSchema, ApprovalPresentationOutcome, ApprovalPresentationOutcomeSchema, ApprovalRequiredResult, ApprovalRequiredResultSchema, GatewayApprovalDecisionRequest, GatewayApprovalDecisionRequestSchema, GatewayApprovalDecisionResult, GatewayApprovalDecisionResultSchema, GatewayApprovalPresentationRequest, GatewayApprovalPresentationRequestSchema, sanitizeGatewayApprovalArguments };
@@ -1,2 +1,2 @@
1
- import { n as ApprovalDecisionReferenceSchema, r as ApprovalRequiredResultSchema, t as ApprovalChallengeReferenceSchema } from "../approval-surface-z5JUqa0K.js";
2
- export { ApprovalChallengeReferenceSchema, ApprovalDecisionReferenceSchema, ApprovalRequiredResultSchema };
1
+ import { a as sanitizeGatewayApprovalArguments, c as ApprovalRequiredResultSchema, i as GatewayApprovalPresentationRequestSchema, n as GatewayApprovalDecisionRequestSchema, o as ApprovalChallengeReferenceSchema, r as GatewayApprovalDecisionResultSchema, s as ApprovalDecisionReferenceSchema, t as ApprovalPresentationOutcomeSchema } from "../approval-surface-Cqk_hAtN.js";
2
+ export { ApprovalChallengeReferenceSchema, ApprovalDecisionReferenceSchema, ApprovalPresentationOutcomeSchema, ApprovalRequiredResultSchema, GatewayApprovalDecisionRequestSchema, GatewayApprovalDecisionResultSchema, GatewayApprovalPresentationRequestSchema, sanitizeGatewayApprovalArguments };
@@ -0,0 +1,132 @@
1
+ import { n as withPortableSuperRefinement } from "./portable-refinement-authoring-C1Q92x2G.js";
2
+ import { t as ItemIdSchema } from "./request-id-schema-Hq_6lSFV.js";
3
+ import { n as PortalApprovalRequiredCallItemResultSchema, t as PortalApprovalChallengeSchema } from "./portal-call-result-schema-B25_rzZZ.js";
4
+ import { z } from "zod";
5
+ //#region src/approval-surface/models/approval-decision-reference-schema.ts
6
+ const ApprovalDecisionReferenceSchema = z.object({
7
+ approvalId: z.string().min(1),
8
+ callId: ItemIdSchema,
9
+ expiresAt: z.string().datetime(),
10
+ status: z.enum([
11
+ "approved",
12
+ "denied",
13
+ "expired"
14
+ ])
15
+ }).strict();
16
+ const ApprovalRequiredResultSchema = PortalApprovalRequiredCallItemResultSchema;
17
+ const ApprovalChallengeReferenceSchema = PortalApprovalChallengeSchema;
18
+ //#endregion
19
+ //#region src/approval-surface/models/gateway-approval-presentation-schema.ts
20
+ const MAXIMUM_APPROVAL_DISPLAY_DEPTH = 6;
21
+ const MAXIMUM_APPROVAL_DISPLAY_ENTRIES = 32;
22
+ const MAXIMUM_APPROVAL_DISPLAY_STRING_SCALARS = 256;
23
+ const MAXIMUM_APPROVAL_DISPLAY_BYTES = 4096;
24
+ const APPROVAL_REDACTED_VALUE = "[REDACTED]";
25
+ const APPROVAL_TRUNCATED_VALUE = "[TRUNCATED]";
26
+ const APPROVAL_TRUNCATION_FIELD = "$truncated";
27
+ const credentialKeyPattern = /(?:token|password|secret|authorization|cookie|api[ _-]?key|private[ _-]?key)/iu;
28
+ const credentialValuePattern = /(?:-----BEGIN [A-Z ]*PRIVATE KEY-----|\b(?:bearer|basic)\s+\S+|\b(?:api[ _-]?key|token|password|secret|authorization|cookie)\s*[:=]\s*\S+)/iu;
29
+ const GatewayApprovalPresentationRequestSchema = withPortableSuperRefinement({
30
+ refinement: (request, context) => {
31
+ if (new TextEncoder().encode(request.display.argumentsPreview).byteLength > MAXIMUM_APPROVAL_DISPLAY_BYTES) context.addIssue({
32
+ code: "custom",
33
+ message: "Approval argument preview exceeds the portable UTF-8 byte bound.",
34
+ path: ["display", "argumentsPreview"]
35
+ });
36
+ },
37
+ refinementIdentity: "gateway.approval.arguments-preview.utf8-bytes",
38
+ schema: z.object({
39
+ allowedDecisions: z.tuple([z.literal("approve"), z.literal("deny")]),
40
+ challengeId: z.string().uuid(),
41
+ display: z.object({ argumentsPreview: z.string().max(MAXIMUM_APPROVAL_DISPLAY_BYTES) }).strict(),
42
+ expiresAt: z.string().datetime(),
43
+ itemId: ItemIdSchema,
44
+ name: z.string().min(1).max(256),
45
+ namespace: z.string().min(1).max(256)
46
+ }).strict()
47
+ });
48
+ const ApprovalPresentationOutcomeSchema = z.discriminatedUnion("kind", [
49
+ z.object({ kind: z.literal("approved") }).strict(),
50
+ z.object({ kind: z.literal("denied") }).strict(),
51
+ z.object({
52
+ kind: z.literal("cancelled"),
53
+ reason: z.enum([
54
+ "challenge-expired",
55
+ "session-ended",
56
+ "user-cancelled"
57
+ ])
58
+ }).strict(),
59
+ z.object({
60
+ kind: z.literal("unavailable"),
61
+ reason: z.enum(["presenter-missing", "presentation-failed"])
62
+ }).strict()
63
+ ]);
64
+ const GatewayApprovalDecisionRequestSchema = z.object({
65
+ challengeId: z.string().uuid(),
66
+ decision: z.enum(["approve", "deny"])
67
+ }).strict();
68
+ const GatewayApprovalDecisionResultSchema = z.discriminatedUnion("kind", [z.object({
69
+ kind: z.literal("recorded"),
70
+ state: z.enum(["approved", "denied"])
71
+ }).strict(), z.object({
72
+ kind: z.literal("rejected"),
73
+ reason: z.enum([
74
+ "not-found",
75
+ "expired",
76
+ "stale-authority",
77
+ "principal-mismatch",
78
+ "already-decided",
79
+ "presenter-not-authorized"
80
+ ])
81
+ }).strict()]);
82
+ function truncateUnicodeScalars(value) {
83
+ const scalars = Array.from(value);
84
+ if (scalars.length <= MAXIMUM_APPROVAL_DISPLAY_STRING_SCALARS) return value;
85
+ return {
86
+ omittedCount: scalars.length - MAXIMUM_APPROVAL_DISPLAY_STRING_SCALARS,
87
+ value: APPROVAL_TRUNCATED_VALUE
88
+ };
89
+ }
90
+ function sanitizeApprovalValue(value, depth) {
91
+ if (depth >= MAXIMUM_APPROVAL_DISPLAY_DEPTH) return {
92
+ omittedCount: 1,
93
+ value: APPROVAL_TRUNCATED_VALUE
94
+ };
95
+ if (value === null || typeof value === "boolean") return value;
96
+ if (typeof value === "number") return Number.isFinite(value) ? value : String(value);
97
+ if (typeof value === "string") {
98
+ if (credentialValuePattern.test(value)) return APPROVAL_REDACTED_VALUE;
99
+ return truncateUnicodeScalars(value);
100
+ }
101
+ if (Array.isArray(value)) {
102
+ const included = value.slice(0, MAXIMUM_APPROVAL_DISPLAY_ENTRIES).map((item) => sanitizeApprovalValue(item, depth + 1));
103
+ if (value.length > MAXIMUM_APPROVAL_DISPLAY_ENTRIES) included[MAXIMUM_APPROVAL_DISPLAY_ENTRIES - 1] = {
104
+ omittedCount: value.length - (MAXIMUM_APPROVAL_DISPLAY_ENTRIES - 1),
105
+ value: APPROVAL_TRUNCATED_VALUE
106
+ };
107
+ return included;
108
+ }
109
+ if (typeof value !== "object") return "[UNSUPPORTED]";
110
+ const sortedEntries = Object.entries(value).toSorted(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey));
111
+ const requiresTruncation = sortedEntries.length > MAXIMUM_APPROVAL_DISPLAY_ENTRIES;
112
+ const includedEntryCount = requiresTruncation ? MAXIMUM_APPROVAL_DISPLAY_ENTRIES - 1 : MAXIMUM_APPROVAL_DISPLAY_ENTRIES;
113
+ const sanitizedEntries = sortedEntries.slice(0, includedEntryCount).map(([key, childValue]) => [key, credentialKeyPattern.test(key) ? APPROVAL_REDACTED_VALUE : sanitizeApprovalValue(childValue, depth + 1)]);
114
+ if (requiresTruncation) sanitizedEntries.push([APPROVAL_TRUNCATION_FIELD, {
115
+ omittedCount: sortedEntries.length - includedEntryCount,
116
+ value: APPROVAL_TRUNCATED_VALUE
117
+ }]);
118
+ return Object.fromEntries(sanitizedEntries);
119
+ }
120
+ function sanitizeGatewayApprovalArguments(argumentsValue) {
121
+ const preview = JSON.stringify(sanitizeApprovalValue(argumentsValue, 0));
122
+ const byteLength = new TextEncoder().encode(preview).byteLength;
123
+ if (byteLength <= MAXIMUM_APPROVAL_DISPLAY_BYTES) return preview;
124
+ return JSON.stringify({
125
+ omittedCount: byteLength - MAXIMUM_APPROVAL_DISPLAY_BYTES,
126
+ value: APPROVAL_TRUNCATED_VALUE
127
+ });
128
+ }
129
+ //#endregion
130
+ export { sanitizeGatewayApprovalArguments as a, ApprovalRequiredResultSchema as c, GatewayApprovalPresentationRequestSchema as i, GatewayApprovalDecisionRequestSchema as n, ApprovalChallengeReferenceSchema as o, GatewayApprovalDecisionResultSchema as r, ApprovalDecisionReferenceSchema as s, ApprovalPresentationOutcomeSchema as t };
131
+
132
+ //# sourceMappingURL=approval-surface-Cqk_hAtN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-surface-Cqk_hAtN.js","names":[],"sources":["../src/approval-surface/models/approval-decision-reference-schema.ts","../src/approval-surface/models/gateway-approval-presentation-schema.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { ItemIdSchema } from '../../contract-primitives/models/request-id-schema.js';\nimport {\n\tPortalApprovalChallengeSchema,\n\tPortalApprovalRequiredCallItemResultSchema,\n} from '../../portal-call-surface/models/portal-call-result-schema.js';\n\nexport const ApprovalDecisionReferenceSchema = z\n\t.object({\n\t\tapprovalId: z.string().min(1),\n\t\tcallId: ItemIdSchema,\n\t\texpiresAt: z.string().datetime(),\n\t\tstatus: z.enum(['approved', 'denied', 'expired']),\n\t})\n\t.strict();\n\nexport type ApprovalDecisionReference = z.infer<typeof ApprovalDecisionReferenceSchema>;\n\nexport const ApprovalRequiredResultSchema = PortalApprovalRequiredCallItemResultSchema;\n\nexport const ApprovalChallengeReferenceSchema = PortalApprovalChallengeSchema;\n\nexport type ApprovalRequiredResult = z.infer<typeof ApprovalRequiredResultSchema>;\nexport type ApprovalChallengeReference = z.infer<typeof ApprovalChallengeReferenceSchema>;\n","import { z } from 'zod';\n\nimport { ItemIdSchema } from '../../contract-primitives/models/request-id-schema.js';\nimport { withPortableSuperRefinement } from '../../portable-contracts/portable-refinement-authoring.js';\n\nconst MAXIMUM_APPROVAL_DISPLAY_DEPTH = 6;\nconst MAXIMUM_APPROVAL_DISPLAY_ENTRIES = 32;\nconst MAXIMUM_APPROVAL_DISPLAY_STRING_SCALARS = 256;\nconst MAXIMUM_APPROVAL_DISPLAY_BYTES = 4_096;\nconst APPROVAL_REDACTED_VALUE = '[REDACTED]';\nconst APPROVAL_TRUNCATED_VALUE = '[TRUNCATED]';\nconst APPROVAL_TRUNCATION_FIELD = '$truncated';\n\nconst credentialKeyPattern =\n\t/(?:token|password|secret|authorization|cookie|api[ _-]?key|private[ _-]?key)/iu;\nconst credentialValuePattern =\n\t/(?:-----BEGIN [A-Z ]*PRIVATE KEY-----|\\b(?:bearer|basic)\\s+\\S+|\\b(?:api[ _-]?key|token|password|secret|authorization|cookie)\\s*[:=]\\s*\\S+)/iu;\n\nexport const GatewayApprovalPresentationRequestSchema = withPortableSuperRefinement({\n\trefinement: (request, context) => {\n\t\tif (\n\t\t\tnew TextEncoder().encode(request.display.argumentsPreview).byteLength >\n\t\t\tMAXIMUM_APPROVAL_DISPLAY_BYTES\n\t\t) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: 'custom',\n\t\t\t\tmessage: 'Approval argument preview exceeds the portable UTF-8 byte bound.',\n\t\t\t\tpath: ['display', 'argumentsPreview'],\n\t\t\t});\n\t\t}\n\t},\n\trefinementIdentity: 'gateway.approval.arguments-preview.utf8-bytes',\n\tschema: z\n\t\t.object({\n\t\t\tallowedDecisions: z.tuple([z.literal('approve'), z.literal('deny')]),\n\t\t\tchallengeId: z.string().uuid(),\n\t\t\tdisplay: z\n\t\t\t\t.object({\n\t\t\t\t\targumentsPreview: z.string().max(MAXIMUM_APPROVAL_DISPLAY_BYTES),\n\t\t\t\t})\n\t\t\t\t.strict(),\n\t\t\texpiresAt: z.string().datetime(),\n\t\t\titemId: ItemIdSchema,\n\t\t\tname: z.string().min(1).max(256),\n\t\t\tnamespace: z.string().min(1).max(256),\n\t\t})\n\t\t.strict(),\n});\n\nexport const ApprovalPresentationOutcomeSchema = z.discriminatedUnion('kind', [\n\tz.object({ kind: z.literal('approved') }).strict(),\n\tz.object({ kind: z.literal('denied') }).strict(),\n\tz\n\t\t.object({\n\t\t\tkind: z.literal('cancelled'),\n\t\t\treason: z.enum(['challenge-expired', 'session-ended', 'user-cancelled']),\n\t\t})\n\t\t.strict(),\n\tz\n\t\t.object({\n\t\t\tkind: z.literal('unavailable'),\n\t\t\treason: z.enum(['presenter-missing', 'presentation-failed']),\n\t\t})\n\t\t.strict(),\n]);\n\nexport const GatewayApprovalDecisionRequestSchema = z\n\t.object({\n\t\tchallengeId: z.string().uuid(),\n\t\tdecision: z.enum(['approve', 'deny']),\n\t})\n\t.strict();\n\nexport const GatewayApprovalDecisionResultSchema = z.discriminatedUnion('kind', [\n\tz\n\t\t.object({\n\t\t\tkind: z.literal('recorded'),\n\t\t\tstate: z.enum(['approved', 'denied']),\n\t\t})\n\t\t.strict(),\n\tz\n\t\t.object({\n\t\t\tkind: z.literal('rejected'),\n\t\t\treason: z.enum([\n\t\t\t\t'not-found',\n\t\t\t\t'expired',\n\t\t\t\t'stale-authority',\n\t\t\t\t'principal-mismatch',\n\t\t\t\t'already-decided',\n\t\t\t\t'presenter-not-authorized',\n\t\t\t]),\n\t\t})\n\t\t.strict(),\n]);\n\nexport type GatewayApprovalPresentationRequest = z.infer<\n\ttypeof GatewayApprovalPresentationRequestSchema\n>;\nexport type ApprovalPresentationOutcome = z.infer<typeof ApprovalPresentationOutcomeSchema>;\nexport type GatewayApprovalDecisionRequest = z.infer<typeof GatewayApprovalDecisionRequestSchema>;\nexport type GatewayApprovalDecisionResult = z.infer<typeof GatewayApprovalDecisionResultSchema>;\n\ninterface ApprovalTruncationMarker {\n\treadonly omittedCount: number;\n\treadonly value: typeof APPROVAL_TRUNCATED_VALUE;\n}\n\ntype SanitizedApprovalValue =\n\t| ApprovalTruncationMarker\n\t| boolean\n\t| null\n\t| number\n\t| string\n\t| readonly SanitizedApprovalValue[]\n\t| { readonly [key: string]: SanitizedApprovalValue };\n\nfunction truncateUnicodeScalars(value: string): string | ApprovalTruncationMarker {\n\tconst scalars = Array.from(value);\n\tif (scalars.length <= MAXIMUM_APPROVAL_DISPLAY_STRING_SCALARS) return value;\n\treturn {\n\t\tomittedCount: scalars.length - MAXIMUM_APPROVAL_DISPLAY_STRING_SCALARS,\n\t\tvalue: APPROVAL_TRUNCATED_VALUE,\n\t};\n}\n\nfunction sanitizeApprovalValue(value: unknown, depth: number): SanitizedApprovalValue {\n\tif (depth >= MAXIMUM_APPROVAL_DISPLAY_DEPTH) {\n\t\treturn { omittedCount: 1, value: APPROVAL_TRUNCATED_VALUE };\n\t}\n\tif (value === null || typeof value === 'boolean') return value;\n\tif (typeof value === 'number') return Number.isFinite(value) ? value : String(value);\n\tif (typeof value === 'string') {\n\t\tif (credentialValuePattern.test(value)) return APPROVAL_REDACTED_VALUE;\n\t\treturn truncateUnicodeScalars(value);\n\t}\n\tif (Array.isArray(value)) {\n\t\tconst included = value\n\t\t\t.slice(0, MAXIMUM_APPROVAL_DISPLAY_ENTRIES)\n\t\t\t.map((item) => sanitizeApprovalValue(item, depth + 1));\n\t\tif (value.length > MAXIMUM_APPROVAL_DISPLAY_ENTRIES) {\n\t\t\tincluded[MAXIMUM_APPROVAL_DISPLAY_ENTRIES - 1] = {\n\t\t\t\tomittedCount: value.length - (MAXIMUM_APPROVAL_DISPLAY_ENTRIES - 1),\n\t\t\t\tvalue: APPROVAL_TRUNCATED_VALUE,\n\t\t\t};\n\t\t}\n\t\treturn included;\n\t}\n\tif (typeof value !== 'object') return '[UNSUPPORTED]';\n\n\tconst sortedEntries = Object.entries(value).toSorted(([leftKey], [rightKey]) =>\n\t\tleftKey.localeCompare(rightKey),\n\t);\n\tconst requiresTruncation = sortedEntries.length > MAXIMUM_APPROVAL_DISPLAY_ENTRIES;\n\tconst includedEntryCount = requiresTruncation\n\t\t? MAXIMUM_APPROVAL_DISPLAY_ENTRIES - 1\n\t\t: MAXIMUM_APPROVAL_DISPLAY_ENTRIES;\n\tconst sanitizedEntries = sortedEntries\n\t\t.slice(0, includedEntryCount)\n\t\t.map(\n\t\t\t([key, childValue]) =>\n\t\t\t\t[\n\t\t\t\t\tkey,\n\t\t\t\t\tcredentialKeyPattern.test(key)\n\t\t\t\t\t\t? APPROVAL_REDACTED_VALUE\n\t\t\t\t\t\t: sanitizeApprovalValue(childValue, depth + 1),\n\t\t\t\t] as const,\n\t\t);\n\tif (requiresTruncation) {\n\t\tsanitizedEntries.push([\n\t\t\tAPPROVAL_TRUNCATION_FIELD,\n\t\t\t{\n\t\t\t\tomittedCount: sortedEntries.length - includedEntryCount,\n\t\t\t\tvalue: APPROVAL_TRUNCATED_VALUE,\n\t\t\t},\n\t\t]);\n\t}\n\treturn Object.fromEntries(sanitizedEntries);\n}\n\nexport function sanitizeGatewayApprovalArguments(argumentsValue: unknown): string {\n\tconst preview = JSON.stringify(sanitizeApprovalValue(argumentsValue, 0));\n\tconst byteLength = new TextEncoder().encode(preview).byteLength;\n\tif (byteLength <= MAXIMUM_APPROVAL_DISPLAY_BYTES) return preview;\n\treturn JSON.stringify({\n\t\tomittedCount: byteLength - MAXIMUM_APPROVAL_DISPLAY_BYTES,\n\t\tvalue: APPROVAL_TRUNCATED_VALUE,\n\t});\n}\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import { a as PortalArtifactReadResourceRequestSchema, c as PortalArtifactReadRequest, d as PortalArtifactReadResultSchema, f as PortalArtifactRecord, h as PortalArtifactRedactorSchema, i as PortalArtifactReadResourceRequest, l as PortalArtifactReadRequestSchema, m as PortalArtifactRedactor, n as ArtifactReferenceSchema, o as createPortalArtifactReadResourceRequest, p as PortalArtifactRecordSchema, r as PORTAL_ARTIFACT_READ_REQUEST_META_KEY, s as parsePortalArtifactReadResourceRequest, t as ArtifactReference, u as PortalArtifactReadResult } from "../index-B_xYdo3v.js";
1
+ import { a as PortalArtifactReadResourceRequestSchema, c as PortalArtifactReadRequest, d as PortalArtifactReadResultSchema, f as PortalArtifactRecord, h as PortalArtifactRedactorSchema, i as PortalArtifactReadResourceRequest, l as PortalArtifactReadRequestSchema, m as PortalArtifactRedactor, n as ArtifactReferenceSchema, o as createPortalArtifactReadResourceRequest, p as PortalArtifactRecordSchema, r as PORTAL_ARTIFACT_READ_REQUEST_META_KEY, s as parsePortalArtifactReadResourceRequest, t as ArtifactReference, u as PortalArtifactReadResult } from "../index-DDLN0DE_.js";
2
2
  export { ArtifactReference, ArtifactReferenceSchema, PORTAL_ARTIFACT_READ_REQUEST_META_KEY, PortalArtifactReadRequest, PortalArtifactReadRequestSchema, PortalArtifactReadResourceRequest, PortalArtifactReadResourceRequestSchema, PortalArtifactReadResult, PortalArtifactReadResultSchema, PortalArtifactRecord, PortalArtifactRecordSchema, PortalArtifactRedactor, PortalArtifactRedactorSchema, createPortalArtifactReadResourceRequest, parsePortalArtifactReadResourceRequest };
@@ -1,3 +1,3 @@
1
1
  import { t as ArtifactReferenceSchema } from "../artifact-reference-schema-CiEjxYPd.js";
2
- import { a as PortalArtifactReadRequestSchema, c as PortalArtifactRedactorSchema, i as parsePortalArtifactReadResourceRequest, n as PortalArtifactReadResourceRequestSchema, o as PortalArtifactReadResultSchema, r as createPortalArtifactReadResourceRequest, s as PortalArtifactRecordSchema, t as PORTAL_ARTIFACT_READ_REQUEST_META_KEY } from "../artifact-surface-BIDasG5x.js";
2
+ import { a as PortalArtifactReadRequestSchema, c as PortalArtifactRedactorSchema, i as parsePortalArtifactReadResourceRequest, n as PortalArtifactReadResourceRequestSchema, o as PortalArtifactReadResultSchema, r as createPortalArtifactReadResourceRequest, s as PortalArtifactRecordSchema, t as PORTAL_ARTIFACT_READ_REQUEST_META_KEY } from "../artifact-surface-CHEu4tDd.js";
3
3
  export { ArtifactReferenceSchema, PORTAL_ARTIFACT_READ_REQUEST_META_KEY, PortalArtifactReadRequestSchema, PortalArtifactReadResourceRequestSchema, PortalArtifactReadResultSchema, PortalArtifactRecordSchema, PortalArtifactRedactorSchema, createPortalArtifactReadResourceRequest, parsePortalArtifactReadResourceRequest };
@@ -1,5 +1,5 @@
1
1
  import { t as ArtifactReferenceSchema } from "./artifact-reference-schema-CiEjxYPd.js";
2
- import { o as JsonValueSchema } from "./json-value-schema-BGfMDOGA.js";
2
+ import { o as JsonValueSchema } from "./json-value-schema-Br5M7d7X.js";
3
3
  import { z } from "zod";
4
4
  //#region src/artifact-surface/models/portal-artifact-contract-schema.ts
5
5
  const PortalArtifactRecordSchema = z.object({
@@ -62,4 +62,4 @@ function parsePortalArtifactReadResourceRequest(resourceRequest) {
62
62
  //#endregion
63
63
  export { PortalArtifactReadRequestSchema as a, PortalArtifactRedactorSchema as c, parsePortalArtifactReadResourceRequest as i, PortalArtifactReadResourceRequestSchema as n, PortalArtifactReadResultSchema as o, createPortalArtifactReadResourceRequest as r, PortalArtifactRecordSchema as s, PORTAL_ARTIFACT_READ_REQUEST_META_KEY as t };
64
64
 
65
- //# sourceMappingURL=artifact-surface-BIDasG5x.js.map
65
+ //# sourceMappingURL=artifact-surface-CHEu4tDd.js.map