@agent-vm/agent-portal-sdk 0.0.148 → 0.0.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contract-fixtures/portable-contracts/approval/managed-google-challenge.fixture.json +66 -0
- package/contract-fixtures/portable-contracts/discovery/describe-result.fixture.json +5 -1
- package/contract-fixtures/portable-contracts/discovery/google-describe-duplicate-availability.fixture.json +103 -0
- package/contract-fixtures/portable-contracts/discovery/google-describe-duplicate-requirements.fixture.json +83 -0
- package/contract-fixtures/portable-contracts/discovery/google-describe-unverified-ready.fixture.json +78 -0
- package/contract-fixtures/portable-contracts/discovery/google-describe-valid.fixture.json +144 -0
- package/contract-fixtures/portable-contracts/discovery/google-list-duplicate-availability.fixture.json +109 -0
- package/contract-fixtures/portable-contracts/discovery/google-list-duplicate-requirements.fixture.json +89 -0
- package/contract-fixtures/portable-contracts/discovery/google-list-unverified-ready.fixture.json +84 -0
- package/contract-fixtures/portable-contracts/discovery/google-list-valid.fixture.json +156 -0
- package/contract-fixtures/portable-contracts/discovery/google-search-duplicate-availability.fixture.json +108 -0
- package/contract-fixtures/portable-contracts/discovery/google-search-duplicate-requirements.fixture.json +88 -0
- package/contract-fixtures/portable-contracts/discovery/google-search-unverified-ready.fixture.json +83 -0
- package/contract-fixtures/portable-contracts/discovery/google-search-valid.fixture.json +154 -0
- package/contract-fixtures/portable-contracts/discovery/list-result.fixture.json +5 -1
- package/contract-fixtures/portable-contracts/discovery/search-result.fixture.json +5 -1
- package/contract-fixtures/portable-contracts/files/attachment-cleaned-result.fixture.json +16 -0
- package/contract-fixtures/portable-contracts/files/attachment-parent-path-rejected.fixture.json +17 -0
- package/contract-fixtures/portable-contracts/files/attachment-public-request.fixture.json +26 -0
- package/contract-fixtures/portable-contracts/files/attachment-public-result.fixture.json +26 -0
- package/contract-fixtures/portable-contracts/files/attachment-recipient-rejected.fixture.json +19 -0
- package/contract-fixtures/portable-contracts/files/attachment-settle-request.fixture.json +20 -0
- package/contract-fixtures/portable-contracts/files/attachment-stage-request.fixture.json +26 -0
- package/contract-fixtures/portable-contracts/files/attachment-staged-result.fixture.json +24 -0
- package/contract-fixtures/portable-contracts/files/file-list-request.fixture.json +14 -0
- package/contract-fixtures/portable-contracts/files/file-listed-result.fixture.json +21 -0
- package/contract-fixtures/portable-contracts/files/file-materialized-result.fixture.json +17 -0
- package/contract-fixtures/portable-contracts/files/file-request-root-rejected.fixture.json +15 -0
- package/contract-fixtures/portable-contracts/files/file-result-payload-rejected.fixture.json +18 -0
- package/contract-fixtures/portable-contracts/outcomes/completed-file-delivery-partial.fixture.json +84 -0
- package/contract-fixtures/portable-contracts/outcomes/invalid-retryable-file-delivery.fixture.json +40 -0
- package/dist/approval-surface/index.d.ts +1 -1
- package/dist/approval-surface/index.js +1 -1
- package/dist/{approval-surface-phfnKUSF.js → approval-surface-CfbAG-81.js} +4 -4
- package/dist/{approval-surface-phfnKUSF.js.map → approval-surface-CfbAG-81.js.map} +1 -1
- package/dist/artifact-surface/index.js +1 -1
- package/dist/{artifact-surface-CHEu4tDd.js → artifact-surface-Db5KQOA0.js} +2 -2
- package/dist/{artifact-surface-CHEu4tDd.js.map → artifact-surface-Db5KQOA0.js.map} +1 -1
- package/dist/capability-description-surface/index.d.ts +1 -1
- package/dist/capability-description-surface/index.js +2 -2
- package/dist/capability-description-surface-DKZLjpG4.js +2 -0
- package/dist/{capability-descriptor-schema-B_0vLQ3E.js → capability-descriptor-schema-5evBt6Hl.js} +2 -2
- package/dist/{capability-descriptor-schema-B_0vLQ3E.js.map → capability-descriptor-schema-5evBt6Hl.js.map} +1 -1
- package/dist/cli/tool-portal.js +5 -5
- package/dist/contracts/index.js +1 -1
- package/dist/{contracts-X9wWs2lP.js → contracts-K6l783Yb.js} +5 -5
- package/dist/{contracts-X9wWs2lP.js.map → contracts-K6l783Yb.js.map} +1 -1
- package/dist/gateway-runtime-client/index.d.ts +5 -3
- package/dist/gateway-runtime-client/index.d.ts.map +1 -1
- package/dist/gateway-runtime-client/index.js +13 -6
- package/dist/gateway-runtime-client/index.js.map +1 -1
- package/dist/{index-C2axvEYg.d.ts → index-BSG2bf1j.d.ts} +3 -3
- package/dist/{index-C2axvEYg.d.ts.map → index-BSG2bf1j.d.ts.map} +1 -1
- package/dist/{index-DZJH4Rau.d.ts → index-Ba_G25p_.d.ts} +11 -11
- package/dist/{index-DZJH4Rau.d.ts.map → index-Ba_G25p_.d.ts.map} +1 -1
- package/dist/{index-uDfElZ9U.d.ts → index-ByBEiqZp.d.ts} +177 -93
- package/dist/index-ByBEiqZp.d.ts.map +1 -0
- package/dist/{index-ex2lEawY.d.ts → index-C5NsqQls.d.ts} +28 -6
- package/dist/index-C5NsqQls.d.ts.map +1 -0
- package/dist/{index-DTTEu7ZT.d.ts → index-C8gs_YWX.d.ts} +121 -5
- package/dist/{index-DTTEu7ZT.d.ts.map → index-C8gs_YWX.d.ts.map} +1 -1
- package/dist/{index-C-QFWaH5.d.ts → index-E3B9TETl.d.ts} +11 -1
- package/dist/index-E3B9TETl.d.ts.map +1 -0
- package/dist/index.d.ts +7 -7
- package/dist/index.js +15 -15
- package/dist/{json-value-schema-Br5M7d7X.js → json-value-schema-rxMrw9uZ.js} +2 -2
- package/dist/{json-value-schema-Br5M7d7X.js.map → json-value-schema-rxMrw9uZ.js.map} +1 -1
- package/dist/{namespace-discovery-schema-DwbJHVLu.js → namespace-discovery-schema-BBWRZZnD.js} +2 -2
- package/dist/{namespace-discovery-schema-DwbJHVLu.js.map → namespace-discovery-schema-BBWRZZnD.js.map} +1 -1
- package/dist/portable-contracts/index.d.ts +1 -1
- package/dist/portable-contracts/index.js +2 -2
- package/dist/{portable-contracts-CWLiYrVU.js → portable-contracts-D7axGgu1.js} +75 -15
- package/dist/portable-contracts-D7axGgu1.js.map +1 -0
- package/dist/{portable-refinement-authoring-C1Q92x2G.js → portable-refinement-authoring-oFICWLOo.js} +16 -2
- package/dist/portable-refinement-authoring-oFICWLOo.js.map +1 -0
- package/dist/{portal-call-request-schema-Cl0kTLaX.js → portal-call-request-schema-B1dbBjmW.js} +4 -4
- package/dist/{portal-call-request-schema-Cl0kTLaX.js.map → portal-call-request-schema-B1dbBjmW.js.map} +1 -1
- package/dist/{portal-call-result-schema-Mv2Dv1HJ.d.ts → portal-call-result-schema-CjfCOa84.d.ts} +1071 -495
- package/dist/portal-call-result-schema-CjfCOa84.d.ts.map +1 -0
- package/dist/{portal-call-result-schema-DM77S9CA.js → portal-call-result-schema-DVJ6FyTz.js} +24 -8
- package/dist/portal-call-result-schema-DVJ6FyTz.js.map +1 -0
- package/dist/portal-call-surface/index.d.ts +3 -3
- package/dist/portal-call-surface/index.js +4 -4
- package/dist/portal-call-surface-BPVX-rjw.js +175 -0
- package/dist/portal-call-surface-BPVX-rjw.js.map +1 -0
- package/dist/portal-event-surface/index.d.ts +1 -1
- package/dist/portal-event-surface/index.js +1 -1
- package/dist/{portal-event-surface-Bp3rXsBz.js → portal-event-surface-Z76kra2a.js} +2 -2
- package/dist/{portal-event-surface-Bp3rXsBz.js.map → portal-event-surface-Z76kra2a.js.map} +1 -1
- package/dist/{request-id-schema-Hq_6lSFV.js → request-id-schema-DQ84TX-D.js} +2 -2
- package/dist/{request-id-schema-Hq_6lSFV.js.map → request-id-schema-DQ84TX-D.js.map} +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +2 -2
- package/dist/tool-portal-mcp-client/index.d.ts +1 -1
- package/dist/tool-portal-mcp-client/index.js +1 -1
- package/dist/tool-portal-mcp-client/node-tool-portal-mcp-transport.d.ts +1 -1
- package/dist/{tool-portal-mcp-client-DsDi2iJc.js → tool-portal-mcp-client-DSDLoZ5e.js} +5 -5
- package/dist/{tool-portal-mcp-client-DsDi2iJc.js.map → tool-portal-mcp-client-DSDLoZ5e.js.map} +1 -1
- package/package.json +2 -2
- package/portable-contract-schema-manifest.json +1614 -366
- package/dist/capability-description-surface-YqGm-nS_.js +0 -2
- package/dist/index-C-QFWaH5.d.ts.map +0 -1
- package/dist/index-ex2lEawY.d.ts.map +0 -1
- package/dist/index-uDfElZ9U.d.ts.map +0 -1
- package/dist/portable-contracts-CWLiYrVU.js.map +0 -1
- package/dist/portable-refinement-authoring-C1Q92x2G.js.map +0 -1
- package/dist/portal-call-result-schema-DM77S9CA.js.map +0 -1
- package/dist/portal-call-result-schema-Mv2Dv1HJ.d.ts.map +0 -1
- package/dist/portal-call-surface-B952nh-H.js +0 -84
- package/dist/portal-call-surface-B952nh-H.js.map +0 -1
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
"ok": true
|
|
18
18
|
},
|
|
19
19
|
"canonicalJson": "{\"items\":[{\"id\":\"search-1\",\"status\":\"ok\",\"value\":{\"namespaceDiscovery\":[],\"tools\":[]}}],\"ok\":true}",
|
|
20
|
-
"refinementIdentities": [
|
|
20
|
+
"refinementIdentities": [
|
|
21
|
+
"portal.google.discovery-policy",
|
|
22
|
+
"portal.request-id.not-reserved",
|
|
23
|
+
"portal.result.aggregate-status"
|
|
24
|
+
]
|
|
21
25
|
}
|
|
22
26
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "attachment-cleaned-result",
|
|
3
|
+
"schemaId": "portal.attachment.result",
|
|
4
|
+
"tags": ["native-attachment", "accepted"],
|
|
5
|
+
"input": {
|
|
6
|
+
"kind": "cleaned"
|
|
7
|
+
},
|
|
8
|
+
"expectation": {
|
|
9
|
+
"kind": "accepted",
|
|
10
|
+
"normalized": {
|
|
11
|
+
"kind": "cleaned"
|
|
12
|
+
},
|
|
13
|
+
"canonicalJson": "{\"kind\":\"cleaned\"}",
|
|
14
|
+
"refinementIdentities": []
|
|
15
|
+
}
|
|
16
|
+
}
|
package/contract-fixtures/portable-contracts/files/attachment-parent-path-rejected.fixture.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "attachment-parent-path-rejected",
|
|
3
|
+
"schemaId": "portal.attachment.result",
|
|
4
|
+
"tags": ["native-attachment", "rejected"],
|
|
5
|
+
"input": {
|
|
6
|
+
"kind": "staged",
|
|
7
|
+
"stagingId": "11111111-1111-4111-8111-111111111111",
|
|
8
|
+
"path": "/home/hermes/.cache/agent-vm-native/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/portal-native-sun-11111111-1111-4111-8111-111111111111/../report.bin",
|
|
9
|
+
"byteLength": 4,
|
|
10
|
+
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
11
|
+
},
|
|
12
|
+
"expectation": {
|
|
13
|
+
"kind": "rejected",
|
|
14
|
+
"errorCodes": ["portable.schema.invalid-union"],
|
|
15
|
+
"refinementIdentities": []
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "attachment-public-request",
|
|
3
|
+
"schemaId": "portal.file.request",
|
|
4
|
+
"tags": ["native-attachment", "accepted"],
|
|
5
|
+
"input": {
|
|
6
|
+
"action": "attach",
|
|
7
|
+
"source": {
|
|
8
|
+
"kind": "tool-vm-file",
|
|
9
|
+
"path": "report.bin"
|
|
10
|
+
},
|
|
11
|
+
"caption": "Report"
|
|
12
|
+
},
|
|
13
|
+
"expectation": {
|
|
14
|
+
"kind": "accepted",
|
|
15
|
+
"normalized": {
|
|
16
|
+
"action": "attach",
|
|
17
|
+
"source": {
|
|
18
|
+
"kind": "tool-vm-file",
|
|
19
|
+
"path": "report.bin"
|
|
20
|
+
},
|
|
21
|
+
"caption": "Report"
|
|
22
|
+
},
|
|
23
|
+
"canonicalJson": "{\"action\":\"attach\",\"caption\":\"Report\",\"source\":{\"kind\":\"tool-vm-file\",\"path\":\"report.bin\"}}",
|
|
24
|
+
"refinementIdentities": []
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "attachment-public-result",
|
|
3
|
+
"schemaId": "portal.file.result",
|
|
4
|
+
"tags": ["native-attachment", "accepted"],
|
|
5
|
+
"input": {
|
|
6
|
+
"kind": "attached",
|
|
7
|
+
"messageId": "native-message",
|
|
8
|
+
"fileName": "report.bin",
|
|
9
|
+
"byteLength": 4,
|
|
10
|
+
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
11
|
+
"cleanup": "complete"
|
|
12
|
+
},
|
|
13
|
+
"expectation": {
|
|
14
|
+
"kind": "accepted",
|
|
15
|
+
"normalized": {
|
|
16
|
+
"kind": "attached",
|
|
17
|
+
"messageId": "native-message",
|
|
18
|
+
"fileName": "report.bin",
|
|
19
|
+
"byteLength": 4,
|
|
20
|
+
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
21
|
+
"cleanup": "complete"
|
|
22
|
+
},
|
|
23
|
+
"canonicalJson": "{\"byteLength\":4,\"cleanup\":\"complete\",\"fileName\":\"report.bin\",\"kind\":\"attached\",\"messageId\":\"native-message\",\"sha256\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}",
|
|
24
|
+
"refinementIdentities": []
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "attachment-recipient-rejected",
|
|
3
|
+
"schemaId": "portal.attachment.request",
|
|
4
|
+
"tags": ["native-attachment", "rejected"],
|
|
5
|
+
"input": {
|
|
6
|
+
"action": "stage",
|
|
7
|
+
"source": {
|
|
8
|
+
"kind": "operation-file",
|
|
9
|
+
"referenceId": "55555555-5555-4555-8555-555555555555",
|
|
10
|
+
"path": "./report.bin"
|
|
11
|
+
},
|
|
12
|
+
"recipient": "caller-selected"
|
|
13
|
+
},
|
|
14
|
+
"expectation": {
|
|
15
|
+
"kind": "rejected",
|
|
16
|
+
"errorCodes": ["portable.schema.invalid-union"],
|
|
17
|
+
"refinementIdentities": []
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "attachment-settle-request",
|
|
3
|
+
"schemaId": "portal.attachment.request",
|
|
4
|
+
"tags": ["native-attachment", "accepted"],
|
|
5
|
+
"input": {
|
|
6
|
+
"action": "settle",
|
|
7
|
+
"stagingId": "11111111-1111-4111-8111-111111111111",
|
|
8
|
+
"outcome": "unconfirmed"
|
|
9
|
+
},
|
|
10
|
+
"expectation": {
|
|
11
|
+
"kind": "accepted",
|
|
12
|
+
"normalized": {
|
|
13
|
+
"action": "settle",
|
|
14
|
+
"stagingId": "11111111-1111-4111-8111-111111111111",
|
|
15
|
+
"outcome": "unconfirmed"
|
|
16
|
+
},
|
|
17
|
+
"canonicalJson": "{\"action\":\"settle\",\"outcome\":\"unconfirmed\",\"stagingId\":\"11111111-1111-4111-8111-111111111111\"}",
|
|
18
|
+
"refinementIdentities": []
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "attachment-stage-request",
|
|
3
|
+
"schemaId": "portal.attachment.request",
|
|
4
|
+
"tags": ["native-attachment", "accepted"],
|
|
5
|
+
"input": {
|
|
6
|
+
"action": "stage",
|
|
7
|
+
"source": {
|
|
8
|
+
"kind": "operation-file",
|
|
9
|
+
"referenceId": "55555555-5555-4555-8555-555555555555",
|
|
10
|
+
"path": "./report.bin"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"expectation": {
|
|
14
|
+
"kind": "accepted",
|
|
15
|
+
"normalized": {
|
|
16
|
+
"action": "stage",
|
|
17
|
+
"source": {
|
|
18
|
+
"kind": "operation-file",
|
|
19
|
+
"referenceId": "55555555-5555-4555-8555-555555555555",
|
|
20
|
+
"path": "./report.bin"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"canonicalJson": "{\"action\":\"stage\",\"source\":{\"kind\":\"operation-file\",\"path\":\"./report.bin\",\"referenceId\":\"55555555-5555-4555-8555-555555555555\"}}",
|
|
24
|
+
"refinementIdentities": []
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "attachment-staged-result",
|
|
3
|
+
"schemaId": "portal.attachment.result",
|
|
4
|
+
"tags": ["native-attachment", "accepted"],
|
|
5
|
+
"input": {
|
|
6
|
+
"kind": "staged",
|
|
7
|
+
"stagingId": "11111111-1111-4111-8111-111111111111",
|
|
8
|
+
"path": "/home/hermes/.cache/agent-vm-native/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/portal-native-sun-11111111-1111-4111-8111-111111111111/report.bin",
|
|
9
|
+
"byteLength": 4,
|
|
10
|
+
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
11
|
+
},
|
|
12
|
+
"expectation": {
|
|
13
|
+
"kind": "accepted",
|
|
14
|
+
"normalized": {
|
|
15
|
+
"kind": "staged",
|
|
16
|
+
"stagingId": "11111111-1111-4111-8111-111111111111",
|
|
17
|
+
"path": "/home/hermes/.cache/agent-vm-native/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/portal-native-sun-11111111-1111-4111-8111-111111111111/report.bin",
|
|
18
|
+
"byteLength": 4,
|
|
19
|
+
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
20
|
+
},
|
|
21
|
+
"canonicalJson": "{\"byteLength\":4,\"kind\":\"staged\",\"path\":\"/home/hermes/.cache/agent-vm-native/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/portal-native-sun-11111111-1111-4111-8111-111111111111/report.bin\",\"sha256\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"stagingId\":\"11111111-1111-4111-8111-111111111111\"}",
|
|
22
|
+
"refinementIdentities": []
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "file-list-request",
|
|
3
|
+
"schemaId": "portal.file.request",
|
|
4
|
+
"tags": ["operation-file", "rejected", "obsolete-rpc"],
|
|
5
|
+
"input": {
|
|
6
|
+
"action": "list",
|
|
7
|
+
"referenceId": "55555555-5555-4555-8555-555555555555"
|
|
8
|
+
},
|
|
9
|
+
"expectation": {
|
|
10
|
+
"kind": "rejected",
|
|
11
|
+
"errorCodes": ["portable.schema.invalid-union"],
|
|
12
|
+
"refinementIdentities": []
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "file-listed-result",
|
|
3
|
+
"schemaId": "portal.file.result",
|
|
4
|
+
"tags": ["operation-file", "rejected", "obsolete-rpc"],
|
|
5
|
+
"input": {
|
|
6
|
+
"kind": "listed",
|
|
7
|
+
"entries": [
|
|
8
|
+
{
|
|
9
|
+
"name": "report.pdf",
|
|
10
|
+
"kind": "file",
|
|
11
|
+
"byteLength": 5
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"limitReached": false
|
|
15
|
+
},
|
|
16
|
+
"expectation": {
|
|
17
|
+
"kind": "rejected",
|
|
18
|
+
"errorCodes": ["portable.schema.invalid-union"],
|
|
19
|
+
"refinementIdentities": []
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "file-materialized-result",
|
|
3
|
+
"schemaId": "portal.file.result",
|
|
4
|
+
"tags": ["operation-file", "rejected", "obsolete-rpc"],
|
|
5
|
+
"input": {
|
|
6
|
+
"kind": "materialized",
|
|
7
|
+
"path": "/work/portal-file-example/report.pdf",
|
|
8
|
+
"byteLength": 0,
|
|
9
|
+
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
10
|
+
"cleanup": "complete"
|
|
11
|
+
},
|
|
12
|
+
"expectation": {
|
|
13
|
+
"kind": "rejected",
|
|
14
|
+
"errorCodes": ["portable.schema.invalid-union"],
|
|
15
|
+
"refinementIdentities": []
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "file-request-root-rejected",
|
|
3
|
+
"schemaId": "portal.file.request",
|
|
4
|
+
"tags": ["operation-file", "rejected", "obsolete-rpc"],
|
|
5
|
+
"input": {
|
|
6
|
+
"action": "list",
|
|
7
|
+
"referenceId": "55555555-5555-4555-8555-555555555555",
|
|
8
|
+
"root": "/etc"
|
|
9
|
+
},
|
|
10
|
+
"expectation": {
|
|
11
|
+
"kind": "rejected",
|
|
12
|
+
"errorCodes": ["portable.schema.invalid-union"],
|
|
13
|
+
"refinementIdentities": []
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "file-result-payload-rejected",
|
|
3
|
+
"schemaId": "portal.file.result",
|
|
4
|
+
"tags": ["operation-file", "rejected", "obsolete-rpc"],
|
|
5
|
+
"input": {
|
|
6
|
+
"kind": "materialized",
|
|
7
|
+
"path": "/work/result",
|
|
8
|
+
"byteLength": 0,
|
|
9
|
+
"sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
10
|
+
"cleanup": "complete",
|
|
11
|
+
"contentBase64": "AA=="
|
|
12
|
+
},
|
|
13
|
+
"expectation": {
|
|
14
|
+
"kind": "rejected",
|
|
15
|
+
"errorCodes": ["portable.schema.invalid-union"],
|
|
16
|
+
"refinementIdentities": []
|
|
17
|
+
}
|
|
18
|
+
}
|
package/contract-fixtures/portable-contracts/outcomes/completed-file-delivery-partial.fixture.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "completed-file-delivery-partial",
|
|
3
|
+
"schemaId": "portal.call.result",
|
|
4
|
+
"tags": ["accepted", "outcome", "aggregate-status"],
|
|
5
|
+
"input": {
|
|
6
|
+
"items": [
|
|
7
|
+
{
|
|
8
|
+
"artifacts": [
|
|
9
|
+
{
|
|
10
|
+
"byteLength": 3,
|
|
11
|
+
"expiresAt": "2099-01-01T00:00:00.000Z",
|
|
12
|
+
"fingerprint": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
13
|
+
"id": "complete-file"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"error": {
|
|
17
|
+
"code": "execution_failed",
|
|
18
|
+
"message": "One output could not be delivered."
|
|
19
|
+
},
|
|
20
|
+
"id": "call-1",
|
|
21
|
+
"operationId": "operation-1",
|
|
22
|
+
"outcome": {
|
|
23
|
+
"certainty": "proven",
|
|
24
|
+
"completion": "failed",
|
|
25
|
+
"kind": "completed",
|
|
26
|
+
"retryClass": "forbidden"
|
|
27
|
+
},
|
|
28
|
+
"owningGeneration": "generation-1",
|
|
29
|
+
"status": "error",
|
|
30
|
+
"value": {
|
|
31
|
+
"delivery": "partial",
|
|
32
|
+
"remoteExecution": {
|
|
33
|
+
"exitCode": 0
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"ok": false
|
|
39
|
+
},
|
|
40
|
+
"expectation": {
|
|
41
|
+
"kind": "accepted",
|
|
42
|
+
"normalized": {
|
|
43
|
+
"items": [
|
|
44
|
+
{
|
|
45
|
+
"artifacts": [
|
|
46
|
+
{
|
|
47
|
+
"byteLength": 3,
|
|
48
|
+
"expiresAt": "2099-01-01T00:00:00.000Z",
|
|
49
|
+
"fingerprint": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
50
|
+
"id": "complete-file"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"error": {
|
|
54
|
+
"code": "execution_failed",
|
|
55
|
+
"message": "One output could not be delivered."
|
|
56
|
+
},
|
|
57
|
+
"id": "call-1",
|
|
58
|
+
"operationId": "operation-1",
|
|
59
|
+
"outcome": {
|
|
60
|
+
"certainty": "proven",
|
|
61
|
+
"completion": "failed",
|
|
62
|
+
"kind": "completed",
|
|
63
|
+
"retryClass": "forbidden"
|
|
64
|
+
},
|
|
65
|
+
"owningGeneration": "generation-1",
|
|
66
|
+
"status": "error",
|
|
67
|
+
"value": {
|
|
68
|
+
"delivery": "partial",
|
|
69
|
+
"remoteExecution": {
|
|
70
|
+
"exitCode": 0
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"ok": false
|
|
76
|
+
},
|
|
77
|
+
"canonicalJson": "{\"items\":[{\"artifacts\":[{\"byteLength\":3,\"expiresAt\":\"2099-01-01T00:00:00.000Z\",\"fingerprint\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"id\":\"complete-file\"}],\"error\":{\"code\":\"execution_failed\",\"message\":\"One output could not be delivered.\"},\"id\":\"call-1\",\"operationId\":\"operation-1\",\"outcome\":{\"certainty\":\"proven\",\"completion\":\"failed\",\"kind\":\"completed\",\"retryClass\":\"forbidden\"},\"owningGeneration\":\"generation-1\",\"status\":\"error\",\"value\":{\"delivery\":\"partial\",\"remoteExecution\":{\"exitCode\":0}}}],\"ok\":false}",
|
|
78
|
+
"refinementIdentities": [
|
|
79
|
+
"portal.request-id.not-reserved",
|
|
80
|
+
"portal.result.aggregate-status",
|
|
81
|
+
"portal.result.outcome-algebra"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
package/contract-fixtures/portable-contracts/outcomes/invalid-retryable-file-delivery.fixture.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"caseId": "invalid-retryable-file-delivery",
|
|
3
|
+
"schemaId": "portal.call.item-result",
|
|
4
|
+
"tags": ["rejected", "outcome", "result-discriminant"],
|
|
5
|
+
"input": {
|
|
6
|
+
"artifacts": [
|
|
7
|
+
{
|
|
8
|
+
"byteLength": 3,
|
|
9
|
+
"expiresAt": "2099-01-01T00:00:00.000Z",
|
|
10
|
+
"fingerprint": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
11
|
+
"id": "complete-file"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"error": {
|
|
15
|
+
"code": "execution_failed",
|
|
16
|
+
"message": "One output could not be delivered."
|
|
17
|
+
},
|
|
18
|
+
"id": "call-1",
|
|
19
|
+
"operationId": "operation-1",
|
|
20
|
+
"outcome": {
|
|
21
|
+
"certainty": "proven",
|
|
22
|
+
"completion": "failed",
|
|
23
|
+
"kind": "completed",
|
|
24
|
+
"retryClass": "policy-gated"
|
|
25
|
+
},
|
|
26
|
+
"owningGeneration": "generation-1",
|
|
27
|
+
"status": "error",
|
|
28
|
+
"value": {
|
|
29
|
+
"delivery": "partial",
|
|
30
|
+
"remoteExecution": {
|
|
31
|
+
"exitCode": 0
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"expectation": {
|
|
36
|
+
"kind": "rejected",
|
|
37
|
+
"errorCodes": ["portal.result.status-shape"],
|
|
38
|
+
"refinementIdentities": ["portal.request-id.not-reserved"]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
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-C5NsqQls.js";
|
|
2
2
|
export { ApprovalChallengeReference, ApprovalChallengeReferenceSchema, ApprovalDecisionReference, ApprovalDecisionReferenceSchema, ApprovalPresentationOutcome, ApprovalPresentationOutcomeSchema, ApprovalRequiredResult, ApprovalRequiredResultSchema, GatewayApprovalDecisionRequest, GatewayApprovalDecisionRequestSchema, GatewayApprovalDecisionResult, GatewayApprovalDecisionResultSchema, GatewayApprovalPresentationRequest, GatewayApprovalPresentationRequestSchema, sanitizeGatewayApprovalArguments };
|
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
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-CfbAG-81.js";
|
|
2
2
|
export { ApprovalChallengeReferenceSchema, ApprovalDecisionReferenceSchema, ApprovalPresentationOutcomeSchema, ApprovalRequiredResultSchema, GatewayApprovalDecisionRequestSchema, GatewayApprovalDecisionResultSchema, GatewayApprovalPresentationRequestSchema, sanitizeGatewayApprovalArguments };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as ItemIdSchema } from "./request-id-schema-
|
|
3
|
-
import { n as PortalApprovalRequiredCallItemResultSchema, t as PortalApprovalChallengeSchema } from "./portal-call-result-schema-
|
|
1
|
+
import { r as withPortableSuperRefinement } from "./portable-refinement-authoring-oFICWLOo.js";
|
|
2
|
+
import { t as ItemIdSchema } from "./request-id-schema-DQ84TX-D.js";
|
|
3
|
+
import { n as PortalApprovalRequiredCallItemResultSchema, t as PortalApprovalChallengeSchema } from "./portal-call-result-schema-DVJ6FyTz.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/approval-surface/models/approval-decision-reference-schema.ts
|
|
6
6
|
const ApprovalDecisionReferenceSchema = z.object({
|
|
@@ -129,4 +129,4 @@ function sanitizeGatewayApprovalArguments(argumentsValue) {
|
|
|
129
129
|
//#endregion
|
|
130
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
131
|
|
|
132
|
-
//# sourceMappingURL=approval-surface-
|
|
132
|
+
//# sourceMappingURL=approval-surface-CfbAG-81.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-surface-phfnKUSF.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":";;;;;AAQA,MAAa,kCAAkC,EAC7C,OAAO;CACP,YAAY,EAAE,QAAQ,CAAC,IAAI,EAAE;CAC7B,QAAQ;CACR,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,QAAQ,EAAE,KAAK;EAAC;EAAY;EAAU;EAAU,CAAC;CACjD,CAAC,CACD,QAAQ;AAIV,MAAa,+BAA+B;AAE5C,MAAa,mCAAmC;;;AChBhD,MAAM,iCAAiC;AACvC,MAAM,mCAAmC;AACzC,MA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AI,OAAO,UAAU,UAAU,OAAO;CAEtC,MAAM,gBAAgB,OAAO,QAAQ,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,cACjE,QAAQ,cAAc,SAAS,CAC/B;CACD,MAAM,qBAAqB,cAAc,SAAS;CAClD,MAAM,qBAAqB,qBACxB,mCAAmC,IACnC;CACH,MAAM,mBAAmB,cACvB,MAAM,GAAG,mBAAmB,CAC5B,KACC,CAAC,KAAK,gBACN,CACC,KACA,qBAAqB,KAAK,IAAI,GAC3B,0BACA,sBAAsB,YAAY,QAAQ,EAAE,CAC/C,CACF;CACF,IAAI,oBACH,iBAAiB,KAAK,CACrB,2BACA;EACC,cAAc,cAAc,SAAS;EACrC,OAAO;EACP,CACD,CAAC;CAEH,OAAO,OAAO,YAAY,iBAAiB;;AAG5C,SAAgB,iCAAiC,gBAAiC;CACjF,MAAM,UAAU,KAAK,UAAU,sBAAsB,gBAAgB,EAAE,CAAC;CACxE,MAAM,aAAa,IAAI,aAAa,CAAC,OAAO,QAAQ,CAAC;CACrD,IAAI,cAAc,gCAAgC,OAAO;CACzD,OAAO,KAAK,UAAU;EACrB,cAAc,aAAa;EAC3B,OAAO;EACP,CAAC"}
|
|
1
|
+
{"version":3,"file":"approval-surface-CfbAG-81.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":";;;;;AAQA,MAAa,kCAAkC,EAC7C,OAAO;CACP,YAAY,EAAE,QAAQ,CAAC,IAAI,EAAE;CAC7B,QAAQ;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AAM,WAAW,MACf,MAAM,GAAG,iCAAiC,CAC1C,KAAK,SAAS,sBAAsB,MAAM,QAAQ,EAAE,CAAC;EACvD,IAAI,MAAM,SAAS,kCAClB,SAAS,mCAAmC,KAAK;GAChD,cAAc,MAAM,UAAU,mCAAmC;GACjE,OAAO;GACP;EAEF,OAAO;;CAER,IAAI,OAAO,UAAU,UAAU,OAAO;CAEtC,MAAM,gBAAgB,OAAO,QAAQ,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,cACjE,QAAQ,cAAc,SAAS,CAC/B;CACD,MAAM,qBAAqB,cAAc,SAAS;CAClD,MAAM,qBAAqB,qBACxB,mCAAmC,IACnC;CACH,MAAM,mBAAmB,cACvB,MAAM,GAAG,mBAAmB,CAC5B,KACC,CAAC,KAAK,gBACN,CACC,KACA,qBAAqB,KAAK,IAAI,GAC3B,0BACA,sBAAsB,YAAY,QAAQ,EAAE,CAC/C,CACF;CACF,IAAI,oBACH,iBAAiB,KAAK,CACrB,2BACA;EACC,cAAc,cAAc,SAAS;EACrC,OAAO;EACP,CACD,CAAC;CAEH,OAAO,OAAO,YAAY,iBAAiB;;AAG5C,SAAgB,iCAAiC,gBAAiC;CACjF,MAAM,UAAU,KAAK,UAAU,sBAAsB,gBAAgB,EAAE,CAAC;CACxE,MAAM,aAAa,IAAI,aAAa,CAAC,OAAO,QAAQ,CAAC;CACrD,IAAI,cAAc,gCAAgC,OAAO;CACzD,OAAO,KAAK,UAAU;EACrB,cAAc,aAAa;EAC3B,OAAO;EACP,CAAC"}
|
|
@@ -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-
|
|
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-Db5KQOA0.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-
|
|
2
|
+
import { o as JsonValueSchema } from "./json-value-schema-rxMrw9uZ.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-
|
|
65
|
+
//# sourceMappingURL=artifact-surface-Db5KQOA0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-surface-
|
|
1
|
+
{"version":3,"file":"artifact-surface-Db5KQOA0.js","names":[],"sources":["../src/artifact-surface/models/portal-artifact-contract-schema.ts","../src/artifact-surface/artifact-read-resource-uri.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { JsonValueSchema } from '../../contract-primitives/models/json-value-schema.js';\nimport { ArtifactReferenceSchema } from './artifact-reference-schema.js';\n\nexport const PortalArtifactRecordSchema = z\n\t.object({\n\t\tmetadata: z.record(z.string(), JsonValueSchema).optional(),\n\t\treference: ArtifactReferenceSchema,\n\t\tredactionProfile: z.string().min(1),\n\t})\n\t.strict();\n\nexport type PortalArtifactRecord = z.infer<typeof PortalArtifactRecordSchema>;\n\nexport const PortalArtifactReadRequestSchema = z\n\t.object({\n\t\tmaxBytes: z\n\t\t\t.number()\n\t\t\t.int()\n\t\t\t.positive()\n\t\t\t.max(16 * 1024 * 1024),\n\t\toffsetBytes: z.number().int().nonnegative().default(0),\n\t\treference: ArtifactReferenceSchema,\n\t})\n\t.strict();\n\nexport type PortalArtifactReadRequest = z.infer<typeof PortalArtifactReadRequestSchema>;\n\nexport const PortalArtifactReadResultSchema = z\n\t.object({\n\t\tcontentBase64: z.string(),\n\t\tmediaType: z.string().optional(),\n\t\toffsetBytes: z.number().int().nonnegative(),\n\t\treference: ArtifactReferenceSchema,\n\t\ttruncated: z.boolean().default(false),\n\t})\n\t.strict();\n\nexport type PortalArtifactReadResult = z.infer<typeof PortalArtifactReadResultSchema>;\n\nexport const PortalArtifactRedactorSchema = z\n\t.object({\n\t\tmaxModelVisibleBytes: z.number().int().nonnegative(),\n\t\tprofile: z.string().min(1),\n\t})\n\t.strict();\n\nexport type PortalArtifactRedactor = z.infer<typeof PortalArtifactRedactorSchema>;\n","import { z } from 'zod';\n\nimport {\n\tPortalArtifactReadRequestSchema,\n\ttype PortalArtifactReadRequest,\n} from './models/portal-artifact-contract-schema.js';\n\nexport const PORTAL_ARTIFACT_READ_REQUEST_META_KEY = 'agent-vm/artifact-read-request';\n\nconst artifactReadResourceProtocol = 'agent-vm-artifact:';\nconst artifactReadResourceHost = 'read';\n\nexport const PortalArtifactReadResourceRequestSchema = z\n\t.object({\n\t\t_meta: z\n\t\t\t.object({\n\t\t\t\t[PORTAL_ARTIFACT_READ_REQUEST_META_KEY]: PortalArtifactReadRequestSchema,\n\t\t\t})\n\t\t\t.strict(),\n\t\turi: z.string().min(1),\n\t})\n\t.strict();\n\nexport type PortalArtifactReadResourceRequest = z.infer<\n\ttypeof PortalArtifactReadResourceRequestSchema\n>;\n\nfunction createOpaqueArtifactResourceUri(artifactId: string): string {\n\tconst resourceUri = new URL(`${artifactReadResourceProtocol}//${artifactReadResourceHost}`);\n\tresourceUri.searchParams.set('id', artifactId);\n\treturn resourceUri.toString();\n}\n\nfunction parseOpaqueArtifactResourceId(uri: string): string {\n\tconst resourceUri = new URL(uri);\n\tif (\n\t\tresourceUri.protocol !== artifactReadResourceProtocol ||\n\t\tresourceUri.hostname !== artifactReadResourceHost ||\n\t\tresourceUri.port.length > 0 ||\n\t\tresourceUri.username.length > 0 ||\n\t\tresourceUri.password.length > 0 ||\n\t\t(resourceUri.pathname.length > 0 && resourceUri.pathname !== '/') ||\n\t\tresourceUri.hash.length > 0 ||\n\t\t[...resourceUri.searchParams.keys()].some((parameterName) => parameterName !== 'id')\n\t) {\n\t\tthrow new TypeError('Artifact read resource URI has an invalid origin or field.');\n\t}\n\tconst artifactIds = resourceUri.searchParams.getAll('id');\n\tif (artifactIds.length !== 1 || artifactIds[0] === undefined || artifactIds[0].length === 0) {\n\t\tthrow new TypeError('Artifact read resource URI requires one opaque artifact identifier.');\n\t}\n\treturn artifactIds[0];\n}\n\n/** Build one standard MCP read request whose URI exposes only the opaque artifact ID. */\nexport function createPortalArtifactReadResourceRequest(\n\trequest: PortalArtifactReadRequest,\n): PortalArtifactReadResourceRequest {\n\tconst parsedRequest = PortalArtifactReadRequestSchema.parse(request);\n\treturn PortalArtifactReadResourceRequestSchema.parse({\n\t\t_meta: { [PORTAL_ARTIFACT_READ_REQUEST_META_KEY]: parsedRequest },\n\t\turi: createOpaqueArtifactResourceUri(parsedRequest.reference.id),\n\t});\n}\n\n/** Recover and validate the complete public read request from standard MCP params. */\nexport function parsePortalArtifactReadResourceRequest(\n\tresourceRequest: unknown,\n): PortalArtifactReadRequest {\n\tconst parsedResourceRequest = PortalArtifactReadResourceRequestSchema.parse(resourceRequest);\n\t// oxlint-disable-next-line no-underscore-dangle -- `_meta` is the standard MCP protocol field name.\n\tconst publicRequest = parsedResourceRequest._meta[PORTAL_ARTIFACT_READ_REQUEST_META_KEY];\n\tif (parseOpaqueArtifactResourceId(parsedResourceRequest.uri) !== publicRequest.reference.id) {\n\t\tthrow new TypeError('Artifact read resource URI does not match its public request.');\n\t}\n\treturn publicRequest;\n}\n"],"mappings":";;;;AAKA,MAAa,6BAA6B,EACxC,OAAO;CACP,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,CAAC,UAAU;CAC1D,WAAW;CACX,kBAAkB,EAAE,QAAQ,CAAC,IAAI,EAAE;CACnC,CAAC,CACD,QAAQ;AAIV,MAAa,kCAAkC,EAC7C,OAAO;CACP,UAAU,EACR,QAAQ,CACR,KAAK,CACL,UAAU,CACV,IAAI,KAAK,OAAO,KAAK;CACvB,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE;CACtD,WAAW;CACX,CAAC,CACD,QAAQ;AAIV,MAAa,iCAAiC,EAC5C,OAAO;CACP,eAAe,EAAE,QAAQ;CACzB,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa;CAC3C,WAAW;CACX,WAAW,EAAE,SAAS,CAAC,QAAQ,MAAM;CACrC,CAAC,CACD,QAAQ;AAIV,MAAa,+BAA+B,EAC1C,OAAO;CACP,sBAAsB,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa;CACpD,SAAS,EAAE,QAAQ,CAAC,IAAI,EAAE;CAC1B,CAAC,CACD,QAAQ;;;ACvCV,M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,UAAU,IACxF,MAAM,IAAI,UAAU,gEAAgE;CAErF,OAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as compactCapabilitySummaryDescription, S as ToolSchemaSummarySchema, _ as ToolSafetySummary, a as CapabilitySearchMatch, b as ToolSchemaHintSchema, c as CapabilitySummarySchema, d as ResultExpectation, f as ResultExpectationSchema, g as ToolCallDispositionSchema, h as ToolCallDisposition, i as CapabilityDiscoveryMetadataSchema, l as CompactCapabilityDescriptionCodePointLimit, m as SafeCallingHintSchema, n as CapabilityDescriptorSchema, o as CapabilitySearchMatchSchema, p as SafeCallingHint, r as CapabilityDiscoveryMetadata, s as CapabilitySummary, t as CapabilityDescriptor, u as JsonSchemaDocumentSchema, v as ToolSafetySummarySchema, x as ToolSchemaSummary, y as ToolSchemaHint } from "../index-
|
|
1
|
+
import { C as compactCapabilitySummaryDescription, S as ToolSchemaSummarySchema, _ as ToolSafetySummary, a as CapabilitySearchMatch, b as ToolSchemaHintSchema, c as CapabilitySummarySchema, d as ResultExpectation, f as ResultExpectationSchema, g as ToolCallDispositionSchema, h as ToolCallDisposition, i as CapabilityDiscoveryMetadataSchema, l as CompactCapabilityDescriptionCodePointLimit, m as SafeCallingHintSchema, n as CapabilityDescriptorSchema, o as CapabilitySearchMatchSchema, p as SafeCallingHint, r as CapabilityDiscoveryMetadata, s as CapabilitySummary, t as CapabilityDescriptor, u as JsonSchemaDocumentSchema, v as ToolSafetySummarySchema, x as ToolSchemaSummary, y as ToolSchemaHint } from "../index-ByBEiqZp.js";
|
|
2
2
|
export { CapabilityDescriptor, CapabilityDescriptorSchema, CapabilityDiscoveryMetadata, CapabilityDiscoveryMetadataSchema, CapabilitySearchMatch, CapabilitySearchMatchSchema, CapabilitySummary, CapabilitySummarySchema, CompactCapabilityDescriptionCodePointLimit, JsonSchemaDocumentSchema, ResultExpectation, ResultExpectationSchema, SafeCallingHint, SafeCallingHintSchema, ToolCallDisposition, ToolCallDispositionSchema, ToolSafetySummary, ToolSafetySummarySchema, ToolSchemaHint, ToolSchemaHintSchema, ToolSchemaSummary, ToolSchemaSummarySchema, compactCapabilitySummaryDescription };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as CompactCapabilityDescriptionCodePointLimit, c as SafeCallingHintSchema, d as ToolSchemaHintSchema, f as ToolSchemaSummarySchema, i as CapabilitySummarySchema, l as ToolCallDispositionSchema, n as CapabilityDiscoveryMetadataSchema, o as JsonSchemaDocumentSchema, p as compactCapabilitySummaryDescription, r as CapabilitySearchMatchSchema, s as ResultExpectationSchema, t as CapabilityDescriptorSchema, u as ToolSafetySummarySchema } from "../capability-descriptor-schema-
|
|
2
|
-
import "../capability-description-surface-
|
|
1
|
+
import { a as CompactCapabilityDescriptionCodePointLimit, c as SafeCallingHintSchema, d as ToolSchemaHintSchema, f as ToolSchemaSummarySchema, i as CapabilitySummarySchema, l as ToolCallDispositionSchema, n as CapabilityDiscoveryMetadataSchema, o as JsonSchemaDocumentSchema, p as compactCapabilitySummaryDescription, r as CapabilitySearchMatchSchema, s as ResultExpectationSchema, t as CapabilityDescriptorSchema, u as ToolSafetySummarySchema } from "../capability-descriptor-schema-5evBt6Hl.js";
|
|
2
|
+
import "../capability-description-surface-DKZLjpG4.js";
|
|
3
3
|
export { CapabilityDescriptorSchema, CapabilityDiscoveryMetadataSchema, CapabilitySearchMatchSchema, CapabilitySummarySchema, CompactCapabilityDescriptionCodePointLimit, JsonSchemaDocumentSchema, ResultExpectationSchema, SafeCallingHintSchema, ToolCallDispositionSchema, ToolSafetySummarySchema, ToolSchemaHintSchema, ToolSchemaSummarySchema, compactCapabilitySummaryDescription };
|
package/dist/{capability-descriptor-schema-B_0vLQ3E.js → capability-descriptor-schema-5evBt6Hl.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as NamespaceNameSchema, t as CapabilityNameSchema } from "./capability-reference-schema-K7qXJgEa.js";
|
|
2
|
-
import { o as JsonValueSchema } from "./json-value-schema-
|
|
2
|
+
import { o as JsonValueSchema } from "./json-value-schema-rxMrw9uZ.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { oauthToolAvailabilitySchema, oauthToolRequirementSchema } from "@agent-vm/oauth-broker-contracts";
|
|
5
5
|
//#region src/capability-description-surface/models/capability-descriptor-schema.ts
|
|
@@ -112,4 +112,4 @@ const CapabilityDescriptorSchema = z.object({
|
|
|
112
112
|
//#endregion
|
|
113
113
|
export { CompactCapabilityDescriptionCodePointLimit as a, SafeCallingHintSchema as c, ToolSchemaHintSchema as d, ToolSchemaSummarySchema as f, CapabilitySummarySchema as i, ToolCallDispositionSchema as l, CapabilityDiscoveryMetadataSchema as n, JsonSchemaDocumentSchema as o, compactCapabilitySummaryDescription as p, CapabilitySearchMatchSchema as r, ResultExpectationSchema as s, CapabilityDescriptorSchema as t, ToolSafetySummarySchema as u };
|
|
114
114
|
|
|
115
|
-
//# sourceMappingURL=capability-descriptor-schema-
|
|
115
|
+
//# sourceMappingURL=capability-descriptor-schema-5evBt6Hl.js.map
|