@intentic/sandbox-contract 1.344.0 → 1.346.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -9
- package/dist/contracts/accounts.contract.d.ts +24 -80
- package/dist/contracts/accounts.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.d.ts +247 -8
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.js +13 -2
- package/dist/contracts/agent.contract.js.map +1 -1
- package/dist/contracts/agents.contract.d.ts +1570 -33
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +47 -4
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/device.contract.d.ts +244 -1
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/device.contract.js +5 -1
- package/dist/contracts/device.contract.js.map +1 -1
- package/dist/contracts/endpoints.contract.d.ts +2 -1
- package/dist/contracts/endpoints.contract.d.ts.map +1 -1
- package/dist/contracts/endpoints.contract.js +1 -0
- package/dist/contracts/endpoints.contract.js.map +1 -1
- package/dist/contracts/providers.contract.d.ts +0 -1
- package/dist/contracts/providers.contract.d.ts.map +1 -1
- package/dist/contracts/push.contract.d.ts +11 -0
- package/dist/contracts/push.contract.d.ts.map +1 -1
- package/dist/contracts/push.contract.js +10 -1
- package/dist/contracts/push.contract.js.map +1 -1
- package/dist/contracts/runner.contract.d.ts +149 -123
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.d.ts +169 -0
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js +35 -0
- package/dist/contracts/secrets.contract.js.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +2 -0
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +37 -0
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +235 -31
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/translator.contract.d.ts +24 -80
- package/dist/contracts/translator.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.d.ts +11 -0
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js +11 -1
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/events/agent-events.d.ts +60 -0
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-events.js +44 -38
- package/dist/events/agent-events.js.map +1 -1
- package/dist/events/agent-transcript.d.ts +727 -0
- package/dist/events/agent-transcript.d.ts.map +1 -0
- package/dist/events/agent-transcript.js +34 -0
- package/dist/events/agent-transcript.js.map +1 -0
- package/dist/events/agent-words.d.ts +5 -0
- package/dist/events/agent-words.d.ts.map +1 -1
- package/dist/events/agent-words.js +9 -0
- package/dist/events/agent-words.js.map +1 -1
- package/dist/events/failure-rows.d.ts +14 -0
- package/dist/events/failure-rows.d.ts.map +1 -0
- package/dist/events/failure-rows.js +109 -0
- package/dist/events/failure-rows.js.map +1 -0
- package/dist/events/requests.d.ts +143 -0
- package/dist/events/requests.d.ts.map +1 -1
- package/dist/events/requests.js +35 -1
- package/dist/events/requests.js.map +1 -1
- package/dist/events/sandbox-notice.d.ts +23 -0
- package/dist/events/sandbox-notice.d.ts.map +1 -1
- package/dist/events/sandbox-notice.js +2 -0
- package/dist/events/sandbox-notice.js.map +1 -1
- package/dist/events/system-events.d.ts +156 -0
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/system-events.js +7 -1
- package/dist/events/system-events.js.map +1 -1
- package/dist/events/transcript.d.ts +20 -720
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/events/transcript.js +17 -19
- package/dist/events/transcript.js.map +1 -1
- package/dist/ids/conversation-ids.d.ts +2 -0
- package/dist/ids/conversation-ids.d.ts.map +1 -1
- package/dist/ids/conversation-ids.js +2 -0
- package/dist/ids/conversation-ids.js.map +1 -1
- package/dist/ids/row-ids.d.ts +3 -0
- package/dist/ids/row-ids.d.ts.map +1 -0
- package/dist/ids/row-ids.js +11 -0
- package/dist/ids/row-ids.js.map +1 -0
- package/dist/index.d.ts +2296 -199
- package/dist/index.d.ts.map +1 -1
- package/dist/models/agent-lanes.d.ts.map +1 -1
- package/dist/models/agent-lanes.js +6 -7
- package/dist/models/agent-lanes.js.map +1 -1
- package/dist/models/agent-standing.d.ts +6 -19
- package/dist/models/agent-standing.d.ts.map +1 -1
- package/dist/models/agent-standing.js +14 -38
- package/dist/models/agent-standing.js.map +1 -1
- package/dist/models/model-pins.d.ts +3 -0
- package/dist/models/model-pins.d.ts.map +1 -1
- package/dist/models/model-pins.js +2 -0
- package/dist/models/model-pins.js.map +1 -1
- package/dist/models/plan-pools.d.ts +26 -4
- package/dist/models/plan-pools.d.ts.map +1 -1
- package/dist/models/plan-pools.js +159 -40
- package/dist/models/plan-pools.js.map +1 -1
- package/dist/netd/generated/wire.d.ts +5 -0
- package/dist/netd/generated/wire.d.ts.map +1 -1
- package/dist/policy/command-classes.d.ts +1 -1
- package/dist/policy/command-classes.d.ts.map +1 -1
- package/dist/policy/command-classes.js +2 -2
- package/dist/policy/command-classes.js.map +1 -1
- package/dist/policy/keyring-origins.d.ts +27 -0
- package/dist/policy/keyring-origins.d.ts.map +1 -0
- package/dist/policy/keyring-origins.js +213 -0
- package/dist/policy/keyring-origins.js.map +1 -0
- package/dist/policy/keyring-seal.d.ts +9 -0
- package/dist/policy/keyring-seal.d.ts.map +1 -1
- package/dist/policy/keyring-seal.js +18 -6
- package/dist/policy/keyring-seal.js.map +1 -1
- package/dist/policy/safety-policy.d.ts +1 -1
- package/dist/policy/safety-policy.d.ts.map +1 -1
- package/dist/policy/safety-policy.js +1 -1
- package/dist/policy/safety-policy.js.map +1 -1
- package/dist/policy/turned-away.d.ts +1 -0
- package/dist/policy/turned-away.d.ts.map +1 -1
- package/dist/policy/turned-away.js +10 -0
- package/dist/policy/turned-away.js.map +1 -1
- package/dist/protocol/doors/host-protocol.d.ts +1 -0
- package/dist/protocol/doors/host-protocol.d.ts.map +1 -1
- package/dist/protocol/doors/host-protocol.js +1 -0
- package/dist/protocol/doors/host-protocol.js.map +1 -1
- package/dist/protocol/doors/runner-protocol.d.ts +1 -0
- package/dist/protocol/doors/runner-protocol.d.ts.map +1 -1
- package/dist/protocol/doors/runner-protocol.js +1 -0
- package/dist/protocol/doors/runner-protocol.js.map +1 -1
- package/dist/protocol/doors/webext-links.d.ts +1 -0
- package/dist/protocol/doors/webext-links.d.ts.map +1 -1
- package/dist/protocol/doors/webext-links.js +1 -0
- package/dist/protocol/doors/webext-links.js.map +1 -1
- package/dist/protocol/peer-dial.d.ts +2 -0
- package/dist/protocol/peer-dial.d.ts.map +1 -1
- package/dist/protocol/peer-dial.js +62 -29
- package/dist/protocol/peer-dial.js.map +1 -1
- package/dist/protocol/raw/raw-json-routes.d.ts +179 -1
- package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-json-routes.js +5 -0
- package/dist/protocol/raw/raw-json-routes.js.map +1 -1
- package/dist/protocol/raw/raw-routes.d.ts +35 -0
- package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.js +9 -0
- package/dist/protocol/raw/raw-routes.js.map +1 -1
- package/dist/schemas/agent-next.d.ts +21 -0
- package/dist/schemas/agent-next.d.ts.map +1 -0
- package/dist/schemas/agent-next.js +21 -0
- package/dist/schemas/agent-next.js.map +1 -0
- package/dist/schemas/agent-place.d.ts +10 -0
- package/dist/schemas/agent-place.d.ts.map +1 -0
- package/dist/schemas/agent-place.js +15 -0
- package/dist/schemas/agent-place.js.map +1 -0
- package/dist/schemas/agent-search.d.ts +45 -0
- package/dist/schemas/agent-search.d.ts.map +1 -0
- package/dist/schemas/agent-search.js +28 -0
- package/dist/schemas/agent-search.js.map +1 -0
- package/dist/schemas/agent.d.ts +120 -78
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +40 -49
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents-list.d.ts +54 -0
- package/dist/schemas/agents-list.d.ts.map +1 -1
- package/dist/schemas/agents.d.ts +165 -59
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +25 -50
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/attach.d.ts +8 -0
- package/dist/schemas/attach.d.ts.map +1 -0
- package/dist/schemas/attach.js +14 -0
- package/dist/schemas/attach.js.map +1 -0
- package/dist/schemas/command-admission.d.ts +71 -0
- package/dist/schemas/command-admission.d.ts.map +1 -0
- package/dist/schemas/command-admission.js +27 -0
- package/dist/schemas/command-admission.js.map +1 -0
- package/dist/schemas/compose-overlay.d.ts +9 -0
- package/dist/schemas/compose-overlay.d.ts.map +1 -0
- package/dist/schemas/compose-overlay.js +11 -0
- package/dist/schemas/compose-overlay.js.map +1 -0
- package/dist/schemas/composer-drafts.d.ts +169 -0
- package/dist/schemas/composer-drafts.d.ts.map +1 -0
- package/dist/schemas/composer-drafts.js +60 -0
- package/dist/schemas/composer-drafts.js.map +1 -0
- package/dist/schemas/conversation-links.d.ts +44 -0
- package/dist/schemas/conversation-links.d.ts.map +1 -0
- package/dist/schemas/conversation-links.js +35 -0
- package/dist/schemas/conversation-links.js.map +1 -0
- package/dist/schemas/data-protection.d.ts +1 -1
- package/dist/schemas/data-protection.d.ts.map +1 -1
- package/dist/schemas/device-commands.d.ts +63 -0
- package/dist/schemas/device-commands.d.ts.map +1 -0
- package/dist/schemas/device-commands.js +42 -0
- package/dist/schemas/device-commands.js.map +1 -0
- package/dist/schemas/device-folder.d.ts +11 -0
- package/dist/schemas/device-folder.d.ts.map +1 -1
- package/dist/schemas/device-folder.js +1 -0
- package/dist/schemas/device-folder.js.map +1 -1
- package/dist/schemas/devices.d.ts +18 -68
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +8 -45
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/environment.d.ts.map +1 -1
- package/dist/schemas/environment.js.map +1 -1
- package/dist/schemas/hosts.d.ts +29 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +23 -0
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/keyring-native.d.ts +137 -0
- package/dist/schemas/keyring-native.d.ts.map +1 -0
- package/dist/schemas/keyring-native.js +69 -0
- package/dist/schemas/keyring-native.js.map +1 -0
- package/dist/schemas/keyring.d.ts +413 -0
- package/dist/schemas/keyring.d.ts.map +1 -1
- package/dist/schemas/keyring.js +139 -4
- package/dist/schemas/keyring.js.map +1 -1
- package/dist/schemas/phone-passwords.d.ts +186 -0
- package/dist/schemas/phone-passwords.d.ts.map +1 -0
- package/dist/schemas/phone-passwords.js +25 -0
- package/dist/schemas/phone-passwords.js.map +1 -0
- package/dist/schemas/privacy-egress.d.ts +41 -0
- package/dist/schemas/privacy-egress.d.ts.map +1 -0
- package/dist/schemas/privacy-egress.js +30 -0
- package/dist/schemas/privacy-egress.js.map +1 -0
- package/dist/schemas/privacy.d.ts +1 -0
- package/dist/schemas/privacy.d.ts.map +1 -1
- package/dist/schemas/privacy.js +1 -0
- package/dist/schemas/privacy.js.map +1 -1
- package/dist/schemas/providers/plan-limits.d.ts +76 -130
- package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
- package/dist/schemas/providers/plan-limits.js +36 -23
- package/dist/schemas/providers/plan-limits.js.map +1 -1
- package/dist/schemas/providers/provider-oauth.d.ts +24 -82
- package/dist/schemas/providers/provider-oauth.d.ts.map +1 -1
- package/dist/schemas/providers/provider-oauth.js +1 -6
- package/dist/schemas/providers/provider-oauth.js.map +1 -1
- package/dist/schemas/providers/refusals.d.ts +64 -0
- package/dist/schemas/providers/refusals.d.ts.map +1 -0
- package/dist/schemas/providers/refusals.js +33 -0
- package/dist/schemas/providers/refusals.js.map +1 -0
- package/dist/schemas/providers/usage.d.ts +1 -0
- package/dist/schemas/providers/usage.d.ts.map +1 -1
- package/dist/schemas/providers/usage.js +1 -0
- package/dist/schemas/providers/usage.js.map +1 -1
- package/dist/schemas/push.d.ts +13 -0
- package/dist/schemas/push.d.ts.map +1 -1
- package/dist/schemas/push.js +11 -1
- package/dist/schemas/push.js.map +1 -1
- package/dist/schemas/sandbox-passwords.d.ts +288 -0
- package/dist/schemas/sandbox-passwords.d.ts.map +1 -0
- package/dist/schemas/sandbox-passwords.js +66 -0
- package/dist/schemas/sandbox-passwords.js.map +1 -0
- package/dist/schemas/secrets.d.ts +2 -0
- package/dist/schemas/secrets.d.ts.map +1 -1
- package/dist/schemas/secrets.js +4 -0
- package/dist/schemas/secrets.js.map +1 -1
- package/dist/schemas/sessions.js +1 -1
- package/dist/schemas/sessions.js.map +1 -1
- package/dist/schemas/settings-savings.d.ts +709 -0
- package/dist/schemas/settings-savings.d.ts.map +1 -0
- package/dist/schemas/settings-savings.js +53 -0
- package/dist/schemas/settings-savings.js.map +1 -0
- package/dist/schemas/settings.d.ts +7 -671
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +5 -50
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/system.d.ts +16 -0
- package/dist/schemas/system.d.ts.map +1 -1
- package/dist/schemas/system.js +11 -0
- package/dist/schemas/system.js.map +1 -1
- package/dist/schemas/terminal.d.ts +5 -0
- package/dist/schemas/terminal.d.ts.map +1 -1
- package/dist/schemas/terminal.js +4 -0
- package/dist/schemas/terminal.js.map +1 -1
- package/dist/schemas/work-assurance.d.ts +24 -0
- package/dist/schemas/work-assurance.d.ts.map +1 -0
- package/dist/schemas/work-assurance.js +23 -0
- package/dist/schemas/work-assurance.js.map +1 -0
- package/dist/schemas/workspace/workspace-tree.d.ts +23 -0
- package/dist/schemas/workspace/workspace-tree.d.ts.map +1 -1
- package/dist/schemas/workspace/workspace-tree.js +20 -0
- package/dist/schemas/workspace/workspace-tree.js.map +1 -1
- package/dist/state/auth-state.d.ts +4 -0
- package/dist/state/auth-state.d.ts.map +1 -0
- package/dist/state/auth-state.js +37 -0
- package/dist/state/auth-state.js.map +1 -0
- package/dist/state/definition.d.ts +12 -0
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/runtime-state.d.ts +3 -0
- package/dist/state/runtime-state.d.ts.map +1 -1
- package/dist/state/runtime-state.js +1 -0
- package/dist/state/runtime-state.js.map +1 -1
- package/dist/state/sandbox-build.d.ts +20 -0
- package/dist/state/sandbox-build.d.ts.map +1 -0
- package/dist/state/sandbox-build.js +43 -0
- package/dist/state/sandbox-build.js.map +1 -0
- package/dist/state/ways-back.d.ts +4 -0
- package/dist/state/ways-back.d.ts.map +1 -0
- package/dist/state/ways-back.js +8 -0
- package/dist/state/ways-back.js.map +1 -0
- package/dist/text/land-rows.d.ts +14 -0
- package/dist/text/land-rows.d.ts.map +1 -0
- package/dist/text/land-rows.js +86 -0
- package/dist/text/land-rows.js.map +1 -0
- package/dist/text/transcript-fold.d.ts +4 -2
- package/dist/text/transcript-fold.d.ts.map +1 -1
- package/dist/text/transcript-fold.js +21 -187
- package/dist/text/transcript-fold.js.map +1 -1
- package/dist/webext/index.d.ts +1 -0
- package/dist/webext/index.d.ts.map +1 -1
- package/dist/webext/index.js +1 -0
- package/dist/webext/index.js.map +1 -1
- package/package.json +7 -6
- package/src/contracts/agent.contract.ts +13 -1
- package/src/contracts/agents.contract.ts +53 -28
- package/src/contracts/device.contract.ts +16 -0
- package/src/contracts/endpoints.contract.ts +3 -0
- package/src/contracts/push.contract.ts +23 -1
- package/src/contracts/secrets.contract.ts +39 -0
- package/src/contracts/workspace.contract.ts +16 -0
- package/src/events/agent-events.ts +99 -79
- package/src/events/agent-transcript.ts +48 -0
- package/src/events/agent-words.ts +13 -0
- package/src/events/failure-rows.ts +148 -0
- package/src/events/requests.ts +41 -3
- package/src/events/sandbox-notice.ts +14 -2
- package/src/events/system-events.ts +14 -4
- package/src/events/transcript.ts +30 -28
- package/src/ids/conversation-ids.ts +7 -0
- package/src/ids/project-dir.test.ts +2 -2
- package/src/ids/project-dir.ts +4 -4
- package/src/ids/row-ids.ts +20 -0
- package/src/models/agent-lanes.ts +16 -24
- package/src/models/agent-runtimes.ts +2 -2
- package/src/models/agent-standing.ts +38 -95
- package/src/models/model-pins.test.ts +31 -1
- package/src/models/model-pins.ts +17 -0
- package/src/models/plan-pools.test.ts +274 -31
- package/src/models/plan-pools.ts +294 -79
- package/src/netd/generated/netd-wire.json +25 -0
- package/src/netd/generated/wire.ts +1 -1
- package/src/policy/command-classes.ts +2 -2
- package/src/policy/keyring-origins.test.ts +132 -0
- package/src/policy/keyring-origins.ts +287 -0
- package/src/policy/keyring-seal.test.ts +37 -2
- package/src/policy/keyring-seal.ts +33 -7
- package/src/policy/safety-policy.ts +1 -1
- package/src/policy/tests/safety-policy.test.ts +1 -1
- package/src/policy/turned-away.ts +15 -0
- package/src/protocol/doors/host-protocol.ts +3 -0
- package/src/protocol/doors/runner-protocol.ts +4 -1
- package/src/protocol/doors/webext-links.ts +3 -0
- package/src/protocol/peer-dial.test.ts +90 -4
- package/src/protocol/peer-dial.ts +83 -39
- package/src/protocol/raw/raw-json-routes.ts +13 -0
- package/src/protocol/raw/raw-routes.ts +13 -1
- package/src/schemas/agent-next.ts +34 -0
- package/src/schemas/agent-place.ts +22 -0
- package/src/schemas/agent-search.ts +51 -0
- package/src/schemas/agent.ts +63 -90
- package/src/schemas/agents.ts +55 -99
- package/src/schemas/attach.ts +23 -0
- package/src/schemas/command-admission.ts +57 -0
- package/src/schemas/compose-overlay.test.ts +35 -0
- package/src/schemas/compose-overlay.ts +19 -0
- package/src/schemas/composer-drafts.ts +86 -0
- package/src/schemas/conversation-links.ts +62 -0
- package/src/schemas/data-protection.ts +1 -1
- package/src/schemas/device-commands.ts +89 -0
- package/src/schemas/device-folder.ts +9 -0
- package/src/schemas/devices.ts +28 -110
- package/src/schemas/environment.ts +8 -9
- package/src/schemas/hosts.ts +60 -0
- package/src/schemas/keyring-native.test.ts +13 -0
- package/src/schemas/keyring-native.ts +101 -0
- package/src/schemas/keyring.ts +202 -4
- package/src/schemas/machine-presence.test.ts +33 -0
- package/src/schemas/phone-passwords.ts +51 -0
- package/src/schemas/privacy-egress.test.ts +83 -0
- package/src/schemas/privacy-egress.ts +86 -0
- package/src/schemas/privacy.ts +4 -0
- package/src/schemas/project-delivery.ts +1 -1
- package/src/schemas/providers/plan-limits.test.ts +16 -0
- package/src/schemas/providers/plan-limits.ts +55 -49
- package/src/schemas/providers/provider-oauth.ts +1 -13
- package/src/schemas/providers/refusals.ts +62 -0
- package/src/schemas/providers/usage.ts +2 -0
- package/src/schemas/push.ts +19 -3
- package/src/schemas/sandbox-passwords.ts +88 -0
- package/src/schemas/secrets.ts +4 -0
- package/src/schemas/sessions.ts +1 -1
- package/src/schemas/settings-savings.ts +125 -0
- package/src/schemas/settings.ts +10 -116
- package/src/schemas/system.ts +15 -0
- package/src/schemas/terminal.ts +8 -0
- package/src/schemas/work-assurance.ts +36 -0
- package/src/schemas/workspace/workspace-tree.ts +32 -0
- package/src/state/auth-state.ts +89 -0
- package/src/state/runtime-state.ts +10 -4
- package/src/state/sandbox-build.test.ts +95 -0
- package/src/state/sandbox-build.ts +96 -0
- package/src/state/ways-back.test.ts +36 -0
- package/src/state/ways-back.ts +19 -0
- package/src/state/workspace-state.ts +1 -1
- package/src/text/land-rows.ts +111 -0
- package/src/text/transcript-fold.test.ts +105 -9
- package/src/text/transcript-fold.ts +30 -232
- package/src/webext/index.ts +2 -0
- package/dist/events/undelivered.d.ts +0 -6
- package/dist/events/undelivered.d.ts.map +0 -1
- package/dist/events/undelivered.js +0 -9
- package/dist/events/undelivered.js.map +0 -1
- package/dist/state/history-state.d.ts +0 -3
- package/dist/state/history-state.d.ts.map +0 -1
- package/dist/state/history-state.js +0 -137
- package/dist/state/history-state.js.map +0 -1
- package/src/events/undelivered.ts +0 -15
- package/src/state/history-state.ts +0 -270
|
@@ -9,9 +9,16 @@ import { OkSchema } from "../schemas/shared.js";
|
|
|
9
9
|
import { ProjectDeliveryResultSchema, ProjectDeliverySchema } from "../schemas/project-delivery.js";
|
|
10
10
|
import { DialLoopbackSchema, StageArtifactResultSchema, StageArtifactSchema } from "../schemas/device-artifacts.js";
|
|
11
11
|
import {
|
|
12
|
+
KeyringCaptureItemSchema,
|
|
13
|
+
KeyringCaptureResultSchema,
|
|
12
14
|
KeyringCopiesSchema,
|
|
13
15
|
KeyringInboxItemSchema,
|
|
14
16
|
KeyringInboxResultSchema,
|
|
17
|
+
KeyringNeedResultSchema,
|
|
18
|
+
KeyringNeedSchema,
|
|
19
|
+
KeyringPhoneFillResultSchema,
|
|
20
|
+
KeyringPhoneKeysSchema,
|
|
21
|
+
KeyringPhonePairResultSchema,
|
|
15
22
|
KeyringReleaseResultSchema,
|
|
16
23
|
KeyringSharesSchema,
|
|
17
24
|
KeyringSyncDeliverResultSchema,
|
|
@@ -23,6 +30,7 @@ import {
|
|
|
23
30
|
KeyringTypeInputSchema,
|
|
24
31
|
KeyringTypeResultSchema,
|
|
25
32
|
SignedKeyringGrantSchema,
|
|
33
|
+
SignedKeyringPhoneFillSchema,
|
|
26
34
|
} from "../schemas/keyring.js";
|
|
27
35
|
|
|
28
36
|
// What a connected device can be asked, over the socket it opened; the machine is the oRPC server, the daemon the
|
|
@@ -76,4 +84,12 @@ export const deviceContract = {
|
|
|
76
84
|
keyringSyncPair: oc.input(KeyringSyncPairSchema).output(KeyringSyncPairResultSchema),
|
|
77
85
|
keyringSyncOutbox: oc.output(KeyringSyncOutboxSchema),
|
|
78
86
|
keyringSyncDeliver: oc.input(KeyringSyncDeliverSchema).output(KeyringSyncDeliverResultSchema),
|
|
87
|
+
// The Passwords app (2026-10-19). A credential seen in this sandbox (a terminal prompt the person typed into) or on
|
|
88
|
+
// the owner's phone, sealed to the keyring's inbox key: kept when remembering is on for its source.
|
|
89
|
+
keyringCapture: oc.input(KeyringCaptureItemSchema).output(KeyringCaptureResultSchema),
|
|
90
|
+
// An agent's need, by where the credential is to be used: the keyring matches, asks the person, and shares.
|
|
91
|
+
keyringNeed: oc.input(KeyringNeedSchema).output(KeyringNeedResultSchema),
|
|
92
|
+
// The owner's phone, paired with this computer's keyring and filling its autofill, carried by this sandbox.
|
|
93
|
+
keyringPhonePair: oc.input(KeyringPhoneKeysSchema).output(KeyringPhonePairResultSchema),
|
|
94
|
+
keyringPhoneFill: oc.input(SignedKeyringPhoneFillSchema).output(KeyringPhoneFillResultSchema),
|
|
79
95
|
};
|
|
@@ -24,6 +24,9 @@ export const TrialStatusSchema = z.object({
|
|
|
24
24
|
retryAt: z.string().optional(),
|
|
25
25
|
// The real model that served the last trial message; the published id only names the trial ladder.
|
|
26
26
|
servedModel: z.string().optional(),
|
|
27
|
+
// Steps a task started while some of the allowance was left may still run today to finish past it (the platform's
|
|
28
|
+
// turn grace); absent where the platform grants none.
|
|
29
|
+
grace: z.number().int().nonnegative().optional(),
|
|
27
30
|
});
|
|
28
31
|
export type TrialStatusResponse = z.infer<typeof TrialStatusSchema>;
|
|
29
32
|
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { procedure } from "../protocol/route-meta.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
PushChannelIdSchema,
|
|
4
|
+
PushChannelSchema,
|
|
5
|
+
PushConfigQuerySchema,
|
|
6
|
+
PushConfigSchema,
|
|
7
|
+
PushSentNotificationSchema,
|
|
8
|
+
PushSentQuerySchema,
|
|
9
|
+
PushTestSchema,
|
|
10
|
+
} from "../schemas/push.js";
|
|
3
11
|
import { OkSchema } from "../schemas/shared.js";
|
|
4
12
|
|
|
5
13
|
// A member's own devices, which no control token reaches.
|
|
@@ -11,6 +19,8 @@ const pushRoute = procedure.meta({ control: "never" });
|
|
|
11
19
|
// automation is waiting for approval. A channel is either a browser's web-push subscription or a native
|
|
12
20
|
// install reached through the platform's push relay, see PushChannelSchema for the split and why.
|
|
13
21
|
//
|
|
22
|
+
// `notification` is the words of one the caller's devices were sent, for a native app whose push carried only its tag.
|
|
23
|
+
//
|
|
14
24
|
// `test` exists because a notification pipeline has four independent failure points the user cannot inspect
|
|
15
25
|
// (device permission, service-worker or shell registration, the daemon's key, the push service itself), a
|
|
16
26
|
// button that proves the whole chain end-to-end is worth more than any amount of status rendering.
|
|
@@ -56,4 +66,16 @@ export const pushContract = {
|
|
|
56
66
|
})
|
|
57
67
|
.meta({ floor: "collaborator" })
|
|
58
68
|
.output(PushTestSchema),
|
|
69
|
+
// A read at the default viewer floor: the gate is the recipient check in the handler, which answers only what was sent
|
|
70
|
+
// to the caller's own devices, and answers not found for everything else.
|
|
71
|
+
notification: pushRoute
|
|
72
|
+
.route({
|
|
73
|
+
method: "GET",
|
|
74
|
+
path: "/push/notification",
|
|
75
|
+
summary: "What a notification said",
|
|
76
|
+
description:
|
|
77
|
+
"The notification this sandbox last sent to your devices under a tag: its words, where it points, and when it went. For a native app whose push carries only the tag, so the words never pass through the push service. Not found once it is no longer kept (the newest 200 tags for a day, never across a restart) and for a tag none of your devices was sent.",
|
|
78
|
+
})
|
|
79
|
+
.input(PushSentQuerySchema)
|
|
80
|
+
.output(PushSentNotificationSchema),
|
|
59
81
|
};
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
SecretRevealSchema,
|
|
27
27
|
SecretSetSchema,
|
|
28
28
|
} from "../schemas/secrets.js";
|
|
29
|
+
import { SandboxNeedsSchema, SandboxPasswordsActivitySchema, SandboxPasswordsSchema, SecretWantResultSchema, SecretWantSchema } from "../schemas/sandbox-passwords.js";
|
|
29
30
|
import { OkSchema } from "../schemas/shared.js";
|
|
30
31
|
|
|
31
32
|
// Credentials are the operating tier's, reads included: maintainer is the highest revokable grant, and no token's.
|
|
@@ -207,6 +208,44 @@ export const secretsContract = {
|
|
|
207
208
|
.meta({ panel: false })
|
|
208
209
|
.input(SandboxKeyringPairSchema)
|
|
209
210
|
.output(SandboxKeyringPairResultSchema),
|
|
211
|
+
// An agent's need, by place rather than by name (schemas/sandbox-passwords.ts): the owner's keyrings match it and ask.
|
|
212
|
+
want: secretRoute
|
|
213
|
+
.route({
|
|
214
|
+
method: "POST",
|
|
215
|
+
path: "/secrets/want",
|
|
216
|
+
summary: "Ask the owner's computers for a credential by where it is used",
|
|
217
|
+
description:
|
|
218
|
+
"Asks each of the owner's computers with Passwords set up, most recently used first, for a credential that works at the place named (a site, a program, an ssh target, a git host). The person there is asked whether this sandbox may use it, and on what terms. Answers the name a reference uses once allowed, or that the answer is awaited in Passwords. Never a value.",
|
|
219
|
+
})
|
|
220
|
+
// The `secrets want` CLI and type_secret by place, on the agent token: it asks a person, and hands no value back.
|
|
221
|
+
.meta({ agent: true })
|
|
222
|
+
.input(SecretWantSchema)
|
|
223
|
+
.output(SecretWantResultSchema),
|
|
224
|
+
passwords: secretRoute
|
|
225
|
+
.route({
|
|
226
|
+
method: "GET",
|
|
227
|
+
path: "/secrets/passwords",
|
|
228
|
+
summary: "The passwords this sandbox may use",
|
|
229
|
+
description:
|
|
230
|
+
"Every entry the keyrings on the owner's computers share with this sandbox, where each works and how this sandbox may use it, and each computer's Passwords state. Names and places only, never values.",
|
|
231
|
+
})
|
|
232
|
+
.output(SandboxPasswordsSchema),
|
|
233
|
+
passwordNeeds: secretRoute
|
|
234
|
+
.route({
|
|
235
|
+
method: "GET",
|
|
236
|
+
path: "/secrets/passwords/needs",
|
|
237
|
+
summary: "Credentials this sandbox asked for that wait for an answer",
|
|
238
|
+
description: "The needs this sandbox raised (`secrets want`) that the owner has not answered yet, and on which computer each waits.",
|
|
239
|
+
})
|
|
240
|
+
.output(SandboxNeedsSchema),
|
|
241
|
+
passwordActivity: secretRoute
|
|
242
|
+
.route({
|
|
243
|
+
method: "GET",
|
|
244
|
+
path: "/secrets/passwords/activity",
|
|
245
|
+
summary: "This sandbox's uses of the owner's passwords",
|
|
246
|
+
description: "Each time this sandbox used a password one of the owner's keyrings keeps, newest first, from its own use ledger. Never a value.",
|
|
247
|
+
})
|
|
248
|
+
.output(SandboxPasswordsActivitySchema),
|
|
210
249
|
// The credential gateway's say over one connection: how its credential reaches the agent, and what it may do there.
|
|
211
250
|
policy: secretRoute
|
|
212
251
|
.route({
|
|
@@ -25,6 +25,8 @@ import {
|
|
|
25
25
|
WorkspaceDerivedQuerySchema,
|
|
26
26
|
WorkspaceDerivedSchema,
|
|
27
27
|
WorkspaceDeletedSchema,
|
|
28
|
+
WorkspaceDimensionsQuerySchema,
|
|
29
|
+
WorkspaceDimensionsSchema,
|
|
28
30
|
WorkspaceDirSchema,
|
|
29
31
|
WorkspaceExtractSchema,
|
|
30
32
|
WorkspaceRestoredSchema,
|
|
@@ -110,6 +112,20 @@ export const workspaceContract = {
|
|
|
110
112
|
.meta({ floor: "viewer", guest: true })
|
|
111
113
|
.input(WorkspaceDerivedQuerySchema)
|
|
112
114
|
.output(WorkspaceDerivedSchema),
|
|
115
|
+
// A folder's pictures measured at once, so a gallery lays out its rows before the pictures themselves arrive. A body,
|
|
116
|
+
// not a query: the paths are a folder's worth.
|
|
117
|
+
dimensions: procedure
|
|
118
|
+
.route({
|
|
119
|
+
method: "POST",
|
|
120
|
+
path: "/workspace/dimensions",
|
|
121
|
+
summary: "Measure pictures and videos",
|
|
122
|
+
description:
|
|
123
|
+
"The width and height each picture or video is shown at, and a video's running time, for a list of workspace files. Only the files' headers are read, so a folder's worth costs little; a gallery uses it to lay out its rows before any picture has loaded. A file that is not a picture, or cannot be read, is simply left out.",
|
|
124
|
+
})
|
|
125
|
+
// Measuring is reading a file's header, and the answer is a few numbers per file.
|
|
126
|
+
.meta({ floor: "viewer", guest: true })
|
|
127
|
+
.input(WorkspaceDimensionsQuerySchema)
|
|
128
|
+
.output(WorkspaceDimensionsSchema),
|
|
113
129
|
// Mints the ticket GET /workspace/media (a plain Hono byte-range route, no oRPC shape) requires to stream.
|
|
114
130
|
mediaTicket: procedure
|
|
115
131
|
.route({
|
|
@@ -8,7 +8,8 @@ import { FastModeStateSchema } from "../schemas/providers/fast-mode.js";
|
|
|
8
8
|
import { NeedSchema } from "../schemas/needs.js";
|
|
9
9
|
import { PromptCacheOpeningSchema, PromptFingerprintSchema } from "../schemas/keep-warm.js";
|
|
10
10
|
import { AgentReplySchema, UsageWindowSchema } from "../schemas/providers/plan-limits.js";
|
|
11
|
-
import {
|
|
11
|
+
import { PrivacyBypassSchema } from "../schemas/privacy-egress.js";
|
|
12
|
+
import { SubagentKindSchema, SubagentSdkRecordSchema, SubagentStatusSchema, SubagentVerificationSchema } from "../schemas/terminal.js";
|
|
12
13
|
import { RetryLadderSchema } from "../schemas/turn-break.js";
|
|
13
14
|
import { HandedOffSchema, HandoffOfferSchema } from "../schemas/providers/handoff.js";
|
|
14
15
|
import { AgentCommandSchema, browserHelpRequest, capabilityOfferRequest, CapabilityOutcomeSchema, ContextUsageSchema, credentialOfferRequest, CredentialReceiptSchema, pageAskRequest, PageSchema, paymentOfferRequest, PaymentReceiptSchema, PermissionRequestSchema, PlanRequestSchema, QuestionRequestSchema, terminalHelpRequest, TodoItemSchema, ToolCallContentSchema, ToolCallLocationSchema, ToolCallStatusSchema, ToolKindSchema } from "./requests.js";
|
|
@@ -19,6 +20,87 @@ import { agentNoticeEvent, agentStatusEvent } from "./agent-ui.js";
|
|
|
19
20
|
// Every frame an agent turn streams, as one `kind`-discriminated union: turn facts (session, standing, cost) and the
|
|
20
21
|
// attach stream a window joins through. One closed vocabulary, kept in one file.
|
|
21
22
|
|
|
23
|
+
// What a failure is, by name: the one vocabulary every runtime's failure is read into at its boundary (a runtime's typed
|
|
24
|
+
// error, or the shared reading of its words), and the one a reader draws a failure's line from. A failure none of these
|
|
25
|
+
// names goes out with no code: the unclassified kind, said as such, never a guess.
|
|
26
|
+
export const AgentErrorCodeSchema = z.enum([
|
|
27
|
+
"session-not-found",
|
|
28
|
+
"rate_limit",
|
|
29
|
+
// Codex ran the turn but warned about it (fallback model metadata); a notice, not a failure.
|
|
30
|
+
"codex-advisory",
|
|
31
|
+
"codex-reauth",
|
|
32
|
+
// An ACP capability requires its own loginCommand, not a native provider account reconnect.
|
|
33
|
+
"acp-auth-required",
|
|
34
|
+
// The Claude subscription credential is dead; only a reconnect fixes it, unlike no account connected.
|
|
35
|
+
"claude-reauth",
|
|
36
|
+
// The API refused this turn's token mid-flight, usually superseded by a rotation already re-minting.
|
|
37
|
+
"claude-token-refused",
|
|
38
|
+
// The account authenticates and has real usage pools, but the org disabled Claude Code for this seat.
|
|
39
|
+
"claude-not-entitled",
|
|
40
|
+
// Any other provider's account signs in but is refused service outright, for every model (Cursor's
|
|
41
|
+
// `[role_forbidden]` for a non-billable admin): filed against the account, so placement skips it.
|
|
42
|
+
"account-not-entitled",
|
|
43
|
+
// The provider failed transiently and in-turn retries did not outlast it; the daemon retries on
|
|
44
|
+
// backoff.
|
|
45
|
+
"provider-outage",
|
|
46
|
+
// The platform-owned free-trial pool failed after its bounded key walk; the failed call is refunded.
|
|
47
|
+
"trial-unavailable",
|
|
48
|
+
// The trial answered, but the selected upstream model/request cannot run through this sandbox.
|
|
49
|
+
"trial-model-unavailable",
|
|
50
|
+
// This account's platform-owned daily trial allowance is spent until its UTC reset.
|
|
51
|
+
"trial-exhausted",
|
|
52
|
+
// The harness read the message as a slash command it doesn't have; the model never saw it.
|
|
53
|
+
"unknown-command",
|
|
54
|
+
"grok-model-invalid",
|
|
55
|
+
"codex-model-invalid",
|
|
56
|
+
// The model is real and listed, but this plan's subscription does not have access to it.
|
|
57
|
+
"model-unavailable",
|
|
58
|
+
// The model cannot hold a turn this size, refused before sending; retrying the same request never
|
|
59
|
+
// helps.
|
|
60
|
+
"context-window-too-small",
|
|
61
|
+
// The model can only write one-shot jobs (Model.helperOnly: its server says it cannot call tools, or
|
|
62
|
+
// it is the quick-jobs local model), refused before sending; the words wait for another model.
|
|
63
|
+
"model-helper-only",
|
|
64
|
+
// The privacy shield is on, the provider is untrusted, and the runtime is one it cannot read by content at
|
|
65
|
+
// all (an ACP agent, Pi), refused before sending; the words wait for a covered provider.
|
|
66
|
+
"privacy-unshielded",
|
|
67
|
+
// The turn carries a tool list (an automation's `allowedTools`) and its runtime cannot keep one
|
|
68
|
+
// (AgentCapabilities.toolAllowlist), refused before sending; the words wait for a runtime that can.
|
|
69
|
+
"tools-unenforced",
|
|
70
|
+
// The protected execution-domain policy is unsupported or unreadable; refused before any model/helper ran.
|
|
71
|
+
"agent-domain-refused",
|
|
72
|
+
// The privacy shield found personal data in instructions the runtime loads itself, past every channel it
|
|
73
|
+
// could mask (Cursor's project rules, AGENTS.md), refused before sending; the words wait for the owner to
|
|
74
|
+
// let the provider read this conversation, trust it, or take the data out of those files.
|
|
75
|
+
"privacy-instructions",
|
|
76
|
+
// The session outgrew the model's context window mid-turn; resuming that session only overflows again,
|
|
77
|
+
// so the daemon re-runs the turn once in a fresh session carrying the hand-off.
|
|
78
|
+
"context-overflow",
|
|
79
|
+
"subscription-required",
|
|
80
|
+
"agent-busy",
|
|
81
|
+
// The sandbox is short of memory, held before anything spawned: a person once per spell, after which
|
|
82
|
+
// their sends run; background work on every short reading. Transient, no clock.
|
|
83
|
+
"sandbox-memory-low",
|
|
84
|
+
// The conversation's own view of the workspace (its mount namespace) did not come up in time, twice,
|
|
85
|
+
// before anything ran: the sandbox too loaded to set it up. Held like a memory hold, and sent again by
|
|
86
|
+
// itself once the sandbox has had room for a while (the memory wall's answer).
|
|
87
|
+
"workspace-setup",
|
|
88
|
+
// The history volume cannot fit a new conversation checkout while keeping its free-space floor.
|
|
89
|
+
"sandbox-disk-low",
|
|
90
|
+
// The runtime hit its own iteration ceiling and stopped; the work may be half done, so the user
|
|
91
|
+
// decides.
|
|
92
|
+
"turn-cap",
|
|
93
|
+
// The harness ended the turn without succeeding, with no modelled reason; the vendor's subtype rides
|
|
94
|
+
// verbatim.
|
|
95
|
+
"harness-incomplete",
|
|
96
|
+
// The installed engine is too old for the model; the provider names the version required, on `engine`.
|
|
97
|
+
"engine-version-floor",
|
|
98
|
+
// The provider's safety classifier stopped the turn partway, often a false positive on ordinary work.
|
|
99
|
+
// Held for a person: retry on the same model without the stopped response, or go on with another.
|
|
100
|
+
"safeguard-flagged",
|
|
101
|
+
]);
|
|
102
|
+
export type AgentErrorCode = z.infer<typeof AgentErrorCodeSchema>;
|
|
103
|
+
|
|
22
104
|
// One frame per emission, `kind`-discriminated; the daemon maps SDK message types onto this closed set, dropping any
|
|
23
105
|
// without a UI mapping. `plan`/`question`/`permission` pause until `resolved` names the same requestId.
|
|
24
106
|
export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
@@ -142,6 +224,9 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
|
142
224
|
error: z.string().optional(),
|
|
143
225
|
// Whether anything checked the work this report describes; rides the frame that ends the child.
|
|
144
226
|
verification: SubagentVerificationSchema.optional(),
|
|
227
|
+
// Where the Claude runtime keeps an in-process child's own record, said once the daemon has paired it, so the
|
|
228
|
+
// card the turn settles into can name it after a restart.
|
|
229
|
+
sdk: SubagentSdkRecordSchema.optional(),
|
|
145
230
|
}),
|
|
146
231
|
z.object({ kind: z.literal("todos"), items: z.array(TodoItemSchema) }),
|
|
147
232
|
// The provider's own slash commands, replaced whole each time; the composer's `/` popover lists them, invoking one
|
|
@@ -268,84 +353,13 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
|
268
353
|
z.object({
|
|
269
354
|
kind: z.literal("error"),
|
|
270
355
|
message: z.string(),
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
// An ACP capability requires its own loginCommand, not a native provider account reconnect.
|
|
279
|
-
"acp-auth-required",
|
|
280
|
-
// The Claude subscription credential is dead; only a reconnect fixes it, unlike no account connected.
|
|
281
|
-
"claude-reauth",
|
|
282
|
-
// The API refused this turn's token mid-flight, usually superseded by a rotation already re-minting.
|
|
283
|
-
"claude-token-refused",
|
|
284
|
-
// The account authenticates and has real usage pools, but the org disabled Claude Code for this seat.
|
|
285
|
-
"claude-not-entitled",
|
|
286
|
-
// Any other provider's account signs in but is refused service outright, for every model (Cursor's
|
|
287
|
-
// `[role_forbidden]` for a non-billable admin): filed against the account, so placement skips it.
|
|
288
|
-
"account-not-entitled",
|
|
289
|
-
// The provider failed transiently and in-turn retries did not outlast it; the daemon retries on
|
|
290
|
-
// backoff.
|
|
291
|
-
"provider-outage",
|
|
292
|
-
// The platform-owned free-trial pool failed after its bounded key walk; the failed call is refunded.
|
|
293
|
-
"trial-unavailable",
|
|
294
|
-
// The trial answered, but the selected upstream model/request cannot run through this sandbox.
|
|
295
|
-
"trial-model-unavailable",
|
|
296
|
-
// This account's platform-owned daily trial allowance is spent until its UTC reset.
|
|
297
|
-
"trial-exhausted",
|
|
298
|
-
// The harness read the message as a slash command it doesn't have; the model never saw it.
|
|
299
|
-
"unknown-command",
|
|
300
|
-
"grok-model-invalid",
|
|
301
|
-
"codex-model-invalid",
|
|
302
|
-
// The model is real and listed, but this plan's subscription does not have access to it.
|
|
303
|
-
"model-unavailable",
|
|
304
|
-
// The model cannot hold a turn this size, refused before sending; retrying the same request never
|
|
305
|
-
// helps.
|
|
306
|
-
"context-window-too-small",
|
|
307
|
-
// The model can only write one-shot jobs (Model.helperOnly: its server says it cannot call tools, or
|
|
308
|
-
// it is the quick-jobs local model), refused before sending; the words wait for another model.
|
|
309
|
-
"model-helper-only",
|
|
310
|
-
// The privacy shield is on, the provider is untrusted, and the runtime is one it cannot read by content at
|
|
311
|
-
// all (an ACP agent, Pi), refused before sending; the words wait for a covered provider.
|
|
312
|
-
"privacy-unshielded",
|
|
313
|
-
// The turn carries a tool list (an automation's `allowedTools`) and its runtime cannot keep one
|
|
314
|
-
// (AgentCapabilities.toolAllowlist), refused before sending; the words wait for a runtime that can.
|
|
315
|
-
"tools-unenforced",
|
|
316
|
-
// The protected execution-domain policy is unsupported or unreadable; refused before any model/helper ran.
|
|
317
|
-
"agent-domain-refused",
|
|
318
|
-
// The privacy shield found personal data in instructions the runtime loads itself, past every channel it
|
|
319
|
-
// could mask (Cursor's project rules, AGENTS.md), refused before sending; the words wait for the owner to
|
|
320
|
-
// let the provider read this conversation, trust it, or take the data out of those files.
|
|
321
|
-
"privacy-instructions",
|
|
322
|
-
// The session outgrew the model's context window mid-turn; resuming that session only overflows again,
|
|
323
|
-
// so the daemon re-runs the turn once in a fresh session carrying the hand-off.
|
|
324
|
-
"context-overflow",
|
|
325
|
-
"subscription-required",
|
|
326
|
-
"agent-busy",
|
|
327
|
-
// The sandbox is short of memory, held before anything spawned: a person once per spell, after which
|
|
328
|
-
// their sends run; background work on every short reading. Transient, no clock.
|
|
329
|
-
"sandbox-memory-low",
|
|
330
|
-
// The conversation's own view of the workspace (its mount namespace) did not come up in time, twice,
|
|
331
|
-
// before anything ran: the sandbox too loaded to set it up. Held like a memory hold, and sent again by
|
|
332
|
-
// itself once the sandbox has had room for a while (the memory wall's answer).
|
|
333
|
-
"workspace-setup",
|
|
334
|
-
// The history volume cannot fit a new conversation checkout while keeping its free-space floor.
|
|
335
|
-
"sandbox-disk-low",
|
|
336
|
-
// The runtime hit its own iteration ceiling and stopped; the work may be half done, so the user
|
|
337
|
-
// decides.
|
|
338
|
-
"turn-cap",
|
|
339
|
-
// The harness ended the turn without succeeding, with no modelled reason; the vendor's subtype rides
|
|
340
|
-
// verbatim.
|
|
341
|
-
"harness-incomplete",
|
|
342
|
-
// The installed engine is too old for the model; the provider names the version required, on `engine`.
|
|
343
|
-
"engine-version-floor",
|
|
344
|
-
// The provider's safety classifier stopped the turn partway, often a false positive on ordinary work.
|
|
345
|
-
// Held for a person: retry on the same model without the stopped response, or go on with another.
|
|
346
|
-
"safeguard-flagged",
|
|
347
|
-
])
|
|
348
|
-
.optional(),
|
|
356
|
+
// Who worded `message`. Absent, it is the provider's or the harness's own words, which a reader keeps behind a
|
|
357
|
+
// press and leads with a line of its own for the code: nothing the sandbox forgot to mark is ever a raw headline.
|
|
358
|
+
own: z
|
|
359
|
+
.boolean()
|
|
360
|
+
.optional()
|
|
361
|
+
.describe("The message is the sandbox's own sentence, fit to be the notice's line. Absent, it is what the provider or the harness said."),
|
|
362
|
+
code: AgentErrorCodeSchema.optional(),
|
|
349
363
|
// safeguard-flagged only: what the classifier named, and where a retry resumes the session from.
|
|
350
364
|
refusal: z
|
|
351
365
|
.object({
|
|
@@ -356,6 +370,12 @@ export const AgentEventSchema = z.discriminatedUnion("kind", [
|
|
|
356
370
|
.describe("The last session entry before the stopped response: a retry resumes the session there, so the model never sees what was stopped."),
|
|
357
371
|
})
|
|
358
372
|
.optional(),
|
|
373
|
+
// A privacy refusal only: the route the shield's verdict refused (shieldVerdict's `refuse.route`), typed, so a
|
|
374
|
+
// reader acts on where the bytes would have gone rather than on the sentence. Absent for a policy that could
|
|
375
|
+
// not be read, which refuses whatever the route.
|
|
376
|
+
privacyRoute: PrivacyBypassSchema.optional().describe(
|
|
377
|
+
"Where the bytes would have gone past the privacy shield: a runtime it cannot read, a runner calling its provider from its own machine, the container's own key, or a shared server started before the shield was on.",
|
|
378
|
+
),
|
|
359
379
|
// Which engine, the version refused, and the floor the provider requires; lets the client offer an install.
|
|
360
380
|
engine: z
|
|
361
381
|
.object({
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AgentHarnessSchema, AgentProviderSchema } from "../schemas/agent.js";
|
|
3
|
+
import { SessionTranscriptSchema, TurnEndingSchema } from "./transcript.js";
|
|
4
|
+
|
|
5
|
+
// The record a reopened tab rebuilds from: messages plus what the session is bound to (provider, runtime, account). A
|
|
6
|
+
// client can't derive these: after a mid-chat switch, its own picks belong to a different session.
|
|
7
|
+
export const AgentTranscriptSchema = SessionTranscriptSchema.extend({
|
|
8
|
+
sessionId: z.string().optional().describe("The provider session behind the last turn, when there is one."),
|
|
9
|
+
provider: AgentProviderSchema.optional().describe("Which provider minted that session."),
|
|
10
|
+
harness: AgentHarnessSchema.optional().describe("Which runtime minted it: a session resumes only on the loop that opened it."),
|
|
11
|
+
account: z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe("Which stored account it belongs to, as the daemon resolved it. Absent when no stored account paid for the turn."),
|
|
15
|
+
// How the last turn ended, for endings that leave a live session with just a press to offer; absent otherwise.
|
|
16
|
+
ending: TurnEndingSchema.optional().describe(
|
|
17
|
+
"How the last turn ended, when it left work behind that one press finishes. Absent for a conversation whose last turn ended on its own, and for the failures that name something to repair first.",
|
|
18
|
+
),
|
|
19
|
+
// `from` offsets every `rewindIndex` here, and is the `before` for the page above; `more` flags older messages.
|
|
20
|
+
from: z
|
|
21
|
+
.number()
|
|
22
|
+
.int()
|
|
23
|
+
.nonnegative()
|
|
24
|
+
.describe("Where the first message sits in the whole record, and the `before` that asks for the page above this one."),
|
|
25
|
+
more: z.boolean().describe("Whether older messages precede this page."),
|
|
26
|
+
// The cursor a reader keeps between reads: `through` (with the id of the row just before it) is the `after` of its
|
|
27
|
+
// next read, which then carries only what the record gained since.
|
|
28
|
+
through: z
|
|
29
|
+
.number()
|
|
30
|
+
.int()
|
|
31
|
+
.nonnegative()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe(
|
|
34
|
+
"The position just past this page's last message: pass it back as `after`, with that message's `rowId` as `afterRow`, to read only what the record gains from here on. Absent from a sandbox older than reading forward.",
|
|
35
|
+
),
|
|
36
|
+
continuous: z
|
|
37
|
+
.boolean()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe(
|
|
40
|
+
"Answered to a read with `after`: true when these messages carry on exactly from there, to be added to what the reader holds; false when the record no longer runs through that point (a rewind since, or more written than one page carries), so this is its latest page instead, to replace what the reader holds.",
|
|
41
|
+
),
|
|
42
|
+
live: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe(
|
|
46
|
+
"The run going on in this conversation right now, which the record does not hold yet: attach to it for its rows as they are drawn. Absent when nothing runs.",
|
|
47
|
+
),
|
|
48
|
+
});
|
|
@@ -48,8 +48,20 @@ export interface ChildReportFields {
|
|
|
48
48
|
// Where its work went, in the daemon's words: into the parent's own checkout, or held off it by a clash. Undefined
|
|
49
49
|
// for a child whose work lands as any conversation's does.
|
|
50
50
|
readonly landing?: string | undefined;
|
|
51
|
+
// For a child spawned with a result schema: the value it handed back, written out as JSON, or why it handed none.
|
|
52
|
+
readonly result?: { readonly json: string } | { readonly missing: string } | undefined;
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
// The result a child spawned with a schema handed back, in words; nothing for a child spawned without one.
|
|
56
|
+
const resultLines = (result: ChildReportFields["result"]): readonly string[] => {
|
|
57
|
+
if (result === undefined) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
return "json" in result
|
|
61
|
+
? ["", "Result (it matches the schema you gave it):", "```json", result.json, "```"]
|
|
62
|
+
: ["", `Result: none. ${result.missing} Ask it for one with send.`];
|
|
63
|
+
};
|
|
64
|
+
|
|
53
65
|
// The wait tool's `verification` field, in words.
|
|
54
66
|
const verificationLine = (verification: SubagentVerification | undefined): string | undefined => {
|
|
55
67
|
if (verification === undefined) {
|
|
@@ -76,6 +88,7 @@ export const childReportPrompt = (fields: ChildReportFields): string => {
|
|
|
76
88
|
...(verification === undefined ? [] : [verification]),
|
|
77
89
|
"",
|
|
78
90
|
fields.report.trim() === "" ? "(It ended without a closing report.)" : fields.report.trim(),
|
|
91
|
+
...resultLines(fields.result),
|
|
79
92
|
"",
|
|
80
93
|
`${fields.landing ?? "Its changes are in its own worktree and land the way any agent's do."} Its account of its own work is a claim, not ` +
|
|
81
94
|
"a result: check what matters before you build on it, and follow up with the subagents tools as you would mid-turn.",
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { AgentEvent } from "./agent-events.js";
|
|
2
|
+
import { type FailureSaid, type NoticeCode, noticeCode } from "./sandbox-notice.js";
|
|
3
|
+
import type { TranscriptRow } from "./transcript.js";
|
|
4
|
+
import { anotherModelClears, turnedAwayCode } from "../policy/turned-away.js";
|
|
5
|
+
|
|
6
|
+
/* EVERY ROW A FAILURE LEAVES, in one place: the fold's one way from an `error` frame to a notice. Each row is coded,
|
|
7
|
+
whatever the frame carried, so no reader ever has to guess from a row's words whether it is a failure, or what kind:
|
|
8
|
+
a failure nobody named is `failed` with no `error`, the unclassified kind, never bare text (2026-10-20: a week of
|
|
9
|
+
transcripts held 105 failure rows written as bare provider words, a spent allowance's among them, against 34 coded). */
|
|
10
|
+
|
|
11
|
+
type ErrorFrame = Extract<AgentEvent, { kind: "error" }>;
|
|
12
|
+
type FailureRow = TranscriptRow & { readonly noticeCode: NoticeCode };
|
|
13
|
+
|
|
14
|
+
// A failure's own sentence, its code and who worded it, which every failure row carries ahead of the clause it adds.
|
|
15
|
+
const failureOf = (event: ErrorFrame): FailureSaid => ({ message: event.message, error: event.code, own: event.own === true ? true : undefined });
|
|
16
|
+
|
|
17
|
+
const failedRow = (event: ErrorFrame): FailureRow => ({
|
|
18
|
+
role: "notice",
|
|
19
|
+
text: event.message,
|
|
20
|
+
noticeCode: noticeCode({ code: "failed", params: failureOf(event) }),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// The row a refusal that ran nothing leaves when the conversation's queue holds the words (heldRow). A turn somebody typed
|
|
24
|
+
// is held in its conversation's queue for another press; a turn that started itself (an automation, a loop, a watch wake)
|
|
25
|
+
// has no typed message and nobody watching, so promising a resend there names a composer the reader is not looking at.
|
|
26
|
+
// Neither version promises a retry: whether one comes is the scheduler's decision, not this row's to state.
|
|
27
|
+
const undeliveredRow = (said: FailureSaid, unattended: boolean): FailureRow => ({
|
|
28
|
+
role: "notice",
|
|
29
|
+
text: unattended
|
|
30
|
+
? `${said.message} Nothing ran, and nothing is held: this run started on its own, so there is no message waiting to be sent again.`
|
|
31
|
+
: `${said.message} Your message was not delivered: it is held for you to send again.`,
|
|
32
|
+
noticeCode: noticeCode({ code: "undelivered", params: { ...said, unattended: unattended || undefined } }),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// The row the same refusal leaves once the turn had already run: a trial spent, or a model refused, on a later step. The
|
|
36
|
+
// message was read and acted on, so it is neither undelivered nor held (turn-runs keeps only a turn turned away at the
|
|
37
|
+
// door), and saying so invited a resend of something that had already changed files (onboarding review 2026-10-18,
|
|
38
|
+
// F07). What it did stays in the conversation's copy; the press, when another model gets past the refusal, carries on there.
|
|
39
|
+
const stoppedPartwayRow = (said: FailureSaid, switchModel: boolean): FailureRow => {
|
|
40
|
+
const row: FailureRow = {
|
|
41
|
+
role: "notice",
|
|
42
|
+
text: switchModel
|
|
43
|
+
? `${said.message} The run stopped partway. The changes it made so far are kept: continue with another model to pick up from here.`
|
|
44
|
+
: `${said.message} The run stopped partway. The changes it made so far are kept: send a message to pick up from here.`,
|
|
45
|
+
noticeCode: noticeCode({ code: "stoppedPartway", params: { ...said, switchModel: switchModel || undefined } }),
|
|
46
|
+
};
|
|
47
|
+
if (switchModel) {
|
|
48
|
+
row.noticeAction = "switchModel";
|
|
49
|
+
}
|
|
50
|
+
return row;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// The press a memory hold offers: the raise rides along only when the hold carried a ceiling to size it by, since a
|
|
54
|
+
// stall names none and raising one would not clear it.
|
|
55
|
+
const memoryPress = (event: ErrorFrame): "sendAnyway" | "sandboxMemory" => (event.memory === undefined ? "sendAnyway" : "sandboxMemory");
|
|
56
|
+
|
|
57
|
+
// A memory hold is asked once and never again that spell (resource-budget.ts), so the next send always runs. A turn the
|
|
58
|
+
// sandbox started itself (a fix press, a peer's message, a re-run) was never in a composer: its message stays above, and
|
|
59
|
+
// the press asks the sandbox to run the turn it kept rather than sending a queue that holds nothing.
|
|
60
|
+
const heldRow = (event: ErrorFrame): FailureRow => {
|
|
61
|
+
const unattended = event.unattended === true;
|
|
62
|
+
const memory = event.code === "sandbox-memory-low";
|
|
63
|
+
const said = failureOf(event);
|
|
64
|
+
if (event.held !== undefined && !unattended) {
|
|
65
|
+
return {
|
|
66
|
+
role: "notice",
|
|
67
|
+
text: memory
|
|
68
|
+
? `${event.message} Nothing has run yet: the message above is kept here, and sending it anyway starts it.`
|
|
69
|
+
: `${event.message} Nothing has run yet: the message above is kept here to send again once that is sorted.`,
|
|
70
|
+
noticeAction: memory ? memoryPress(event) : "sendAgain",
|
|
71
|
+
sandboxHeld: true,
|
|
72
|
+
noticeCode: noticeCode({ code: "kept", params: { ...said, memory: memory || undefined } }),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (!memory || unattended) {
|
|
76
|
+
return undeliveredRow(said, unattended);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
role: "notice",
|
|
80
|
+
text: `${event.message} Your message is held: send it again to start anyway.`,
|
|
81
|
+
noticeAction: memoryPress(event),
|
|
82
|
+
noticeCode: noticeCode({ code: "memoryHeld", params: said }),
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// What an armed credential renewal promises, and what its row says instead once a later failure in the same run took
|
|
87
|
+
// that promise back (TranscriptFold.withdrawRenewal).
|
|
88
|
+
export const RENEWING = "The credential is being renewed and this turn continues automatically.";
|
|
89
|
+
export const RENEWAL_WITHDRAWN =
|
|
90
|
+
"The credential was being renewed, but the turn stopped before it could continue: it will not carry on by itself, so press Continue to pick it back up.";
|
|
91
|
+
|
|
92
|
+
// What a laddered wall's automatic re-runs are doing, said on the failure's own row so the count stays in the record.
|
|
93
|
+
const retryClause = (event: ErrorFrame): { text: string; code: NoticeCode } | undefined => {
|
|
94
|
+
const { retries } = event;
|
|
95
|
+
if (retries === undefined) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
const said = failureOf(event);
|
|
99
|
+
if (event.autoResume === "scheduled") {
|
|
100
|
+
return {
|
|
101
|
+
text: `Retrying by itself: attempt ${retries.made + 1} of ${retries.max}.`,
|
|
102
|
+
code: noticeCode({ code: "retrying", params: { ...said, attempt: retries.made + 1, of: retries.max } }),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return retries.made >= retries.max
|
|
106
|
+
? {
|
|
107
|
+
text: `Retried ${retries.made} of ${retries.max} times by itself; nothing more is sent automatically.`,
|
|
108
|
+
code: noticeCode({ code: "retried", params: { ...said, made: retries.made, of: retries.max } }),
|
|
109
|
+
}
|
|
110
|
+
: undefined;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/** The row a turn-ending failure leaves: its own sentence plus one clause on what happens next, coded whatever it was.
|
|
114
|
+
* The live wait itself is drawn by the chat, not stored here. `ran`: an assistant row stands, so a door refusal stopped
|
|
115
|
+
* the turn partway. */
|
|
116
|
+
export const errorRow = (event: ErrorFrame, ran: boolean): FailureRow => {
|
|
117
|
+
const { message, code } = event;
|
|
118
|
+
const said = failureOf(event);
|
|
119
|
+
if (code === "provider-outage") {
|
|
120
|
+
const retry = retryClause(event);
|
|
121
|
+
return retry === undefined
|
|
122
|
+
? {
|
|
123
|
+
role: "notice",
|
|
124
|
+
text: `${message} Nothing is retrying it, so the turn is waiting here.`,
|
|
125
|
+
noticeCode: noticeCode({ code: "outageWaiting", params: said }),
|
|
126
|
+
}
|
|
127
|
+
: { role: "notice", text: `${message} ${retry.text}`, noticeCode: retry.code };
|
|
128
|
+
}
|
|
129
|
+
if (code === "claude-token-refused") {
|
|
130
|
+
return event.autoResume === "scheduled"
|
|
131
|
+
? {
|
|
132
|
+
role: "notice",
|
|
133
|
+
text: `${message} ${RENEWING}`,
|
|
134
|
+
noticeWait: "credentialRenewal",
|
|
135
|
+
noticeCode: noticeCode({ code: "renewing", params: said }),
|
|
136
|
+
}
|
|
137
|
+
: {
|
|
138
|
+
role: "notice",
|
|
139
|
+
text: `${message} Reconnect the account to pick this conversation back up.`,
|
|
140
|
+
noticeCode: noticeCode({ code: "reconnect", params: said }),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
if (!turnedAwayCode(code)) {
|
|
144
|
+
const retry = retryClause(event);
|
|
145
|
+
return retry === undefined ? failedRow(event) : { role: "notice", text: `${message} ${retry.text}`, noticeCode: retry.code };
|
|
146
|
+
}
|
|
147
|
+
return ran && event.held === undefined ? stoppedPartwayRow(said, anotherModelClears(code)) : heldRow(event);
|
|
148
|
+
};
|