@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
package/src/events/requests.ts
CHANGED
|
@@ -371,8 +371,10 @@ export const CredentialReceiptSchema = z.object({
|
|
|
371
371
|
});
|
|
372
372
|
export type CredentialReceipt = z.infer<typeof CredentialReceiptSchema>;
|
|
373
373
|
|
|
374
|
-
// The
|
|
375
|
-
// excluded: their Chromium/waiting command dies with the container, so those
|
|
374
|
+
// The requests a turn journal can restore verbatim after a daemon restart, raised by the turn itself or by a gate it
|
|
375
|
+
// called. `browser_help`/`terminal_help` are excluded: their Chromium/waiting command dies with the container, so those
|
|
376
|
+
// can only be reported, not restored. A gate's offer comes back as a card whose answer is told to a turn of its own,
|
|
377
|
+
// since the call that raised it died with the daemon: a yes is the agent's to act on by asking again.
|
|
376
378
|
export const PlanRequestSchema = z.object({
|
|
377
379
|
kind: z.literal("plan").describe("The agent has written a plan and is waiting for a yes."),
|
|
378
380
|
...planRequest,
|
|
@@ -385,5 +387,41 @@ export const PermissionRequestSchema = PermissionAskSchema.extend({
|
|
|
385
387
|
kind: z.literal("permission").describe("The agent wants to use a tool it needs permission for."),
|
|
386
388
|
...permissionRequest,
|
|
387
389
|
});
|
|
388
|
-
export const
|
|
390
|
+
export const PageAskRequestSchema = z.object({
|
|
391
|
+
kind: z.literal("page_ask").describe("The agent has shown a page to be answered on and is waiting."),
|
|
392
|
+
...pageAskRequest,
|
|
393
|
+
});
|
|
394
|
+
export const CapabilityOfferRequestSchema = z.object({
|
|
395
|
+
kind: z.literal("capability_offer").describe("The agent asks for something to be connected."),
|
|
396
|
+
...capabilityOfferRequest,
|
|
397
|
+
});
|
|
398
|
+
export const PaymentOfferRequestSchema = z.object({
|
|
399
|
+
kind: z.literal("payment_offer").describe("The agent asks to pay for something."),
|
|
400
|
+
...paymentOfferRequest,
|
|
401
|
+
});
|
|
402
|
+
export const CredentialOfferRequestSchema = z.object({
|
|
403
|
+
kind: z.literal("credential_offer").describe("The agent asks a named person to release a credential."),
|
|
404
|
+
...credentialOfferRequest,
|
|
405
|
+
});
|
|
406
|
+
export const ParkedRequestSchema = z.discriminatedUnion("kind", [
|
|
407
|
+
PlanRequestSchema,
|
|
408
|
+
QuestionRequestSchema,
|
|
409
|
+
PermissionRequestSchema,
|
|
410
|
+
PageAskRequestSchema,
|
|
411
|
+
CapabilityOfferRequestSchema,
|
|
412
|
+
PaymentOfferRequestSchema,
|
|
413
|
+
CredentialOfferRequestSchema,
|
|
414
|
+
]);
|
|
415
|
+
// Whether a frame is a card the journal keeps for a restart to put back; a record, so a kind added above fails to compile
|
|
416
|
+
// until it is named here.
|
|
417
|
+
const RESTORABLE = {
|
|
418
|
+
plan: true,
|
|
419
|
+
question: true,
|
|
420
|
+
permission: true,
|
|
421
|
+
page_ask: true,
|
|
422
|
+
capability_offer: true,
|
|
423
|
+
payment_offer: true,
|
|
424
|
+
credential_offer: true,
|
|
425
|
+
} as const satisfies Record<ParkedRequest["kind"], true>;
|
|
426
|
+
export const isRestorableRequest = (event: { readonly kind: string }): event is ParkedRequest => Object.hasOwn(RESTORABLE, event.kind);
|
|
389
427
|
export type ParkedRequest = z.infer<typeof ParkedRequestSchema>;
|
|
@@ -16,13 +16,22 @@ export const NoticeCodeSchema = z.object({
|
|
|
16
16
|
});
|
|
17
17
|
export type NoticeCode = z.infer<typeof NoticeCodeSchema>;
|
|
18
18
|
|
|
19
|
+
/** A failure's facts as every failure notice carries them (the `failure` params below), before the clause it adds. */
|
|
20
|
+
export interface FailureSaid {
|
|
21
|
+
readonly message: string;
|
|
22
|
+
readonly error?: string | undefined;
|
|
23
|
+
readonly own?: boolean | undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
const count = z.number().int().nonnegative();
|
|
20
27
|
|
|
21
|
-
// A failure's own sentence, which the notice's clause follows
|
|
22
|
-
//
|
|
28
|
+
// A failure's own sentence, which the notice's clause follows, its failure code (`error`; absent for a failure nobody
|
|
29
|
+
// named), and whether the sandbox worded the sentence (`own`). Absent `own`, the sentence is the provider's or the
|
|
30
|
+
// harness's: a reader leads with its own line for the code and keeps those words behind a press.
|
|
23
31
|
const failure = {
|
|
24
32
|
message: z.string(),
|
|
25
33
|
error: z.string().optional(),
|
|
34
|
+
own: z.boolean().optional(),
|
|
26
35
|
};
|
|
27
36
|
|
|
28
37
|
// The re-runs a resumed turn's row can name (events/resume.ts); a reason a reader does not know draws the row's text.
|
|
@@ -63,6 +72,9 @@ export const SandboxNoticeSchema = z.discriminatedUnion("code", [
|
|
|
63
72
|
z.object({ code: z.literal("renewalWithdrawn"), params: z.object(failure) }),
|
|
64
73
|
z.object({ code: z.literal("reconnect"), params: z.object(failure) }),
|
|
65
74
|
z.object({ code: z.literal("undelivered"), params: z.object({ ...failure, unattended: z.boolean().optional() }) }),
|
|
75
|
+
// A door refusal that came after the turn had already run (a trial spent mid-turn): what it did stays, nothing is
|
|
76
|
+
// held, and `switchModel` when another model gets past the refusal.
|
|
77
|
+
z.object({ code: z.literal("stoppedPartway"), params: z.object({ ...failure, switchModel: z.boolean().optional() }) }),
|
|
66
78
|
// A turn the sandbox kept whole, its message above; `memory` when a memory hold kept it.
|
|
67
79
|
z.object({ code: z.literal("kept"), params: z.object({ ...failure, memory: z.boolean().optional() }) }),
|
|
68
80
|
z.object({ code: z.literal("memoryHeld"), params: z.object(failure) }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { AgentSummarySchema } from "../schemas/agents.js";
|
|
3
|
-
import { AccountUsageSchema, ProviderRefusalSchema } from "../schemas/providers/plan-limits.js";
|
|
3
|
+
import { AccountUsageSchema, type ProviderRefusal, ProviderRefusalSchema } from "../schemas/providers/plan-limits.js";
|
|
4
4
|
import { MemberRoleSchema } from "../schemas/shared.js";
|
|
5
5
|
import { WorkspaceTreeDeltaSchema } from "../schemas/workspace/workspace-tree.js";
|
|
6
6
|
|
|
@@ -147,11 +147,21 @@ export const AccountUsageChangedSchema = z.object({
|
|
|
147
147
|
});
|
|
148
148
|
export type AccountUsageChanged = z.infer<typeof AccountUsageChangedSchema>;
|
|
149
149
|
|
|
150
|
-
// A provider's
|
|
151
|
-
//
|
|
152
|
-
|
|
150
|
+
// A provider's refusals on file changed (one recorded, settled or forgotten), the observed half of "can I run on this":
|
|
151
|
+
// every one it still holds, so a window judges by exactly what the daemon does. Empty means nothing stands. A daemon at
|
|
152
|
+
// the floor sends only its last `refusal` (absent: settled), so `refusals` stays optional; read both with refusalsOf.
|
|
153
|
+
export const ProviderRefusalChangedSchema = z.object({
|
|
154
|
+
kind: z.literal("providerRefusal"),
|
|
155
|
+
provider: z.string(),
|
|
156
|
+
refusals: z.array(ProviderRefusalSchema).optional(),
|
|
157
|
+
refusal: ProviderRefusalSchema.optional(),
|
|
158
|
+
});
|
|
153
159
|
export type ProviderRefusalChanged = z.infer<typeof ProviderRefusalChangedSchema>;
|
|
154
160
|
|
|
161
|
+
// Every refusal a frame says stands, from a daemon that sends the whole list or one at the floor that sends its last.
|
|
162
|
+
export const refusalsOf = (event: ProviderRefusalChanged): readonly ProviderRefusal[] =>
|
|
163
|
+
event.refusals ?? (event.refusal === undefined ? [] : [event.refusal]);
|
|
164
|
+
|
|
155
165
|
// What moved in the shared tree, once the daemon's resident copy re-listed a batch: a tab holding the generation it
|
|
156
166
|
// counts from patches its tree, and one holding any other fetches it afresh.
|
|
157
167
|
export const TreeChangedSchema = WorkspaceTreeDeltaSchema.extend({ kind: z.literal("treeChanged") });
|
package/src/events/transcript.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { AgentHarnessSchema, AgentProviderSchema } from "../schemas/agent.js";
|
|
3
2
|
import { ShareDetailSchema } from "../schemas/share.js";
|
|
4
3
|
import { TurnErrandSchema, TurnSpeakerSchema } from "../schemas/speaker.js";
|
|
5
|
-
import { SubagentKindSchema, SubagentStatusSchema, SubagentVerificationSchema } from "../schemas/terminal.js";
|
|
4
|
+
import { SubagentKindSchema, SubagentSdkRecordSchema, SubagentStatusSchema, SubagentVerificationSchema } from "../schemas/terminal.js";
|
|
6
5
|
import { NeedSchema } from "../schemas/needs.js";
|
|
7
6
|
import { HeldEndingSchema, RetryLadderSchema } from "../schemas/turn-break.js";
|
|
8
7
|
import { HandoffOfferSchema } from "../schemas/providers/handoff.js";
|
|
@@ -172,6 +171,9 @@ export const TranscriptSubagentSchema = z.object({
|
|
|
172
171
|
summary: z.string().optional(),
|
|
173
172
|
error: z.string().optional(),
|
|
174
173
|
verification: SubagentVerificationSchema.optional(),
|
|
174
|
+
sdk: SubagentSdkRecordSchema.optional().describe(
|
|
175
|
+
"Where the Claude runtime keeps this in-process subagent's own record, so its whole run reads back once nothing in memory remembers it. Absent for every other kind, and until the daemon has paired it.",
|
|
176
|
+
),
|
|
175
177
|
});
|
|
176
178
|
export type TranscriptSubagent = z.infer<typeof TranscriptSubagentSchema>;
|
|
177
179
|
// Mutable, unlike most of this file: the fold settles a card in place when its result lands turns later, saving a
|
|
@@ -269,6 +271,15 @@ export const TranscriptRowSchema = z.object({
|
|
|
269
271
|
"Who said it. A notice is neither side: it is something that happened to the turn, recorded so a reopened conversation can say it. Without those, a turn a provider refused ends on the user's message and reads as broken.",
|
|
270
272
|
),
|
|
271
273
|
text: z.string().describe("The words."),
|
|
274
|
+
// The row's own name, minted once where the row is made (the live fold, or the record for a row written outside a
|
|
275
|
+
// run) and carried on every copy: the live head's, each patch's, the record's, a client's mirror. Positions move
|
|
276
|
+
// under a rewind and contents grow while a run streams, so this is how a reader says "this row" across all of them.
|
|
277
|
+
rowId: z
|
|
278
|
+
.string()
|
|
279
|
+
.optional()
|
|
280
|
+
.describe(
|
|
281
|
+
"The row's own id: the same on the live turn's copy, every change to it, the record, and a reader's own copy, so a reader updates the row it already holds instead of matching it by content. Rows recorded before rows had ids are named by their position (`@12`). Absent from a sandbox older than ids.",
|
|
282
|
+
),
|
|
272
283
|
// Which run produced this row, carried on every copy of it: the live head's, the record's, a client's mirror.
|
|
273
284
|
// It is how a client says "I am already showing this run" without comparing content, which cannot answer that
|
|
274
285
|
// while the run's last row is still growing.
|
|
@@ -339,9 +350,10 @@ export const TranscriptRowSchema = z.object({
|
|
|
339
350
|
),
|
|
340
351
|
// The follow-up this notice offers, by name; the chat decides what it does, and whether it stands. `sendAnyway` sends
|
|
341
352
|
// the held message; `sandboxMemory` offers that and a raise of the sandbox's memory; `sendAgain` sends a turn the
|
|
342
|
-
// sandbox kept after a refusal no raise would clear
|
|
353
|
+
// sandbox kept after a refusal no raise would clear; `switchModel` opens the model list for a turn a model's refusal
|
|
354
|
+
// stopped partway, so the same conversation carries on with another.
|
|
343
355
|
noticeAction: z
|
|
344
|
-
.enum(["landHold", "depsInstall", "watchStop", "sandboxMemory", "sendAnyway", "sendAgain"])
|
|
356
|
+
.enum(["landHold", "depsInstall", "watchStop", "sandboxMemory", "sendAnyway", "sendAgain", "switchModel"])
|
|
345
357
|
.optional()
|
|
346
358
|
.describe("A one-press follow-up this notice offers, by name. The chat decides what it does and whether it still applies."),
|
|
347
359
|
// Where a refused turn's words wait decides what the notice's press does: the conversation's queue, or the sandbox.
|
|
@@ -416,33 +428,45 @@ export const holdsRequest = (row: TranscriptRequests): boolean => REQUEST_FIELDS
|
|
|
416
428
|
// Whether a row is holding the turn open on a card nobody has answered.
|
|
417
429
|
export const isAwaitingDecision = (row: TranscriptRequests): boolean => REQUEST_FIELDS.some((field) => row[field]?.status === "pending");
|
|
418
430
|
|
|
431
|
+
// The row a patch changes, by its own id, beside the index older readers count from.
|
|
432
|
+
const patchRowId = z
|
|
433
|
+
.string()
|
|
434
|
+
.optional()
|
|
435
|
+
.describe("The id of the row this changes. A reader holding a row by that id changes it there, wherever it sits; `index` is for one that does not.");
|
|
436
|
+
|
|
419
437
|
// One change to a run's rows, so a client keeps rows rather than frames. Prose/thinking append to a row or a card; a
|
|
420
438
|
// `tool` card replaces its own fields by id, never its nested calls or thinking, which arrive by their own patches;
|
|
421
|
-
// everything else replaces its row; `drop` removes a row that opened and never wrote.
|
|
439
|
+
// everything else replaces its row; `drop` removes a row that opened and never wrote. Each names its row twice: by
|
|
440
|
+
// `index` from where the run's rows start, and by `rowId`, which needs no counting and survives a row dropped above it.
|
|
422
441
|
export const TranscriptPatchSchema = z.discriminatedUnion("op", [
|
|
423
442
|
z.object({ op: z.literal("append").describe("A new row at the end."), row: TranscriptRowSchema }),
|
|
424
443
|
z.object({
|
|
425
444
|
op: z.literal("replace").describe("This row, whole, in place of the one at that index."),
|
|
426
445
|
index: z.number().int().nonnegative(),
|
|
446
|
+
rowId: patchRowId,
|
|
427
447
|
row: TranscriptRowSchema,
|
|
428
448
|
}),
|
|
429
449
|
z.object({
|
|
430
450
|
op: z.literal("drop").describe("The row at that index is gone: it was opened and never written into."),
|
|
431
451
|
index: z.number().int().nonnegative(),
|
|
452
|
+
rowId: patchRowId,
|
|
432
453
|
}),
|
|
433
454
|
z.object({
|
|
434
455
|
op: z.literal("text").describe("More of the agent's prose, onto that row's text."),
|
|
435
456
|
index: z.number().int().nonnegative(),
|
|
457
|
+
rowId: patchRowId,
|
|
436
458
|
text: z.string(),
|
|
437
459
|
}),
|
|
438
460
|
z.object({
|
|
439
461
|
op: z.literal("thinking").describe("More of the agent's reasoning, onto that row's thinking."),
|
|
440
462
|
index: z.number().int().nonnegative(),
|
|
463
|
+
rowId: patchRowId,
|
|
441
464
|
text: z.string(),
|
|
442
465
|
}),
|
|
443
466
|
z.object({
|
|
444
467
|
op: z.literal("toolThinking").describe("More of a delegated subagent's reasoning, onto the thinking of the card that started it."),
|
|
445
468
|
index: z.number().int().nonnegative(),
|
|
469
|
+
rowId: patchRowId,
|
|
446
470
|
id: z.string().describe("The card's id, matched wherever it nests."),
|
|
447
471
|
text: z.string(),
|
|
448
472
|
}),
|
|
@@ -453,6 +477,7 @@ export const TranscriptPatchSchema = z.discriminatedUnion("op", [
|
|
|
453
477
|
"A tool card's own fields: new, or the latest state of one already there, matched by id wherever it nests. Carries no `children` or `thinking`; a card already there keeps its own.",
|
|
454
478
|
),
|
|
455
479
|
index: z.number().int().nonnegative(),
|
|
480
|
+
rowId: patchRowId,
|
|
456
481
|
tool: TranscriptToolSchema,
|
|
457
482
|
parent: z.string().optional().describe("The card this one nests under, when it is a delegated subagent's own call."),
|
|
458
483
|
}),
|
|
@@ -527,29 +552,6 @@ export const TurnEndingSchema = z.object({
|
|
|
527
552
|
});
|
|
528
553
|
export type TurnEnding = z.infer<typeof TurnEndingSchema>;
|
|
529
554
|
|
|
530
|
-
// The record a reopened tab rebuilds from: messages plus what the session is bound to (provider, runtime, account). A
|
|
531
|
-
// client can't derive these: after a mid-chat switch, its own picks belong to a different session.
|
|
532
|
-
export const AgentTranscriptSchema = SessionTranscriptSchema.extend({
|
|
533
|
-
sessionId: z.string().optional().describe("The provider session behind the last turn, when there is one."),
|
|
534
|
-
provider: AgentProviderSchema.optional().describe("Which provider minted that session."),
|
|
535
|
-
harness: AgentHarnessSchema.optional().describe("Which runtime minted it: a session resumes only on the loop that opened it."),
|
|
536
|
-
account: z
|
|
537
|
-
.string()
|
|
538
|
-
.optional()
|
|
539
|
-
.describe("Which stored account it belongs to, as the daemon resolved it. Absent when no stored account paid for the turn."),
|
|
540
|
-
// How the last turn ended, for endings that leave a live session with just a press to offer; absent otherwise.
|
|
541
|
-
ending: TurnEndingSchema.optional().describe(
|
|
542
|
-
"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.",
|
|
543
|
-
),
|
|
544
|
-
// `from` offsets every `rewindIndex` here, and is the `before` for the page above; `more` flags older messages.
|
|
545
|
-
from: z
|
|
546
|
-
.number()
|
|
547
|
-
.int()
|
|
548
|
-
.nonnegative()
|
|
549
|
-
.describe("Where the first message sits in the whole record, and the `before` that asks for the page above this one."),
|
|
550
|
-
more: z.boolean().describe("Whether older messages precede this page."),
|
|
551
|
-
});
|
|
552
|
-
|
|
553
555
|
// A delegation's own run, fetched when its card opens; empty when the record no longer holds it.
|
|
554
556
|
export const AgentToolChildrenSchema = z.object({
|
|
555
557
|
children: z.array(TranscriptToolSchema).describe("The calls the delegated agent made, in the order it made them."),
|
|
@@ -8,6 +8,13 @@ export const CONVERSATION_ID = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/;
|
|
|
8
8
|
// Safe to interpolate into a path or a branch name. `false` for anything else, including the empty string.
|
|
9
9
|
export const isConversationId = (value: string): boolean => CONVERSATION_ID.test(value);
|
|
10
10
|
|
|
11
|
+
// The longest title a conversation opens with (AgentTurn.title). A title made by joining words (a fresh session's
|
|
12
|
+
// "Code review: " and its origin's whole title) runs past it easily, and a turn naming one is refused outright, so a
|
|
13
|
+
// sender clips it first rather than lose the turn to its name.
|
|
14
|
+
export const CONVERSATION_TITLE_MAX = 80;
|
|
15
|
+
export const clipTitle = (title: string): string =>
|
|
16
|
+
title.length <= CONVERSATION_TITLE_MAX ? title : `${title.slice(0, CONVERSATION_TITLE_MAX - 1).trimEnd()}…`;
|
|
17
|
+
|
|
11
18
|
// Short (nothing over seven letters) and visually distinct: no near-rhymes, no shared first syllable.
|
|
12
19
|
const ADJECTIVES = [
|
|
13
20
|
"amber",
|
|
@@ -59,8 +59,8 @@ test("a project dir is exactly one valid name under the workspace root", () => {
|
|
|
59
59
|
expect(projectDirNameOf("/srv/work/my-app", "/srv/work")).toBe("my-app");
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
// A second folder of the same name takes a name that says which one it is: its parent's in front (
|
|
63
|
-
//
|
|
62
|
+
// A second folder of the same name takes a name that says which one it is: its parent's in front. Where a folder is (a
|
|
63
|
+
// drive, a network share) never lends a name.
|
|
64
64
|
const NAMED: readonly { readonly path: string; readonly names: string[] }[] = [
|
|
65
65
|
{ path: "C:\\Users\\ada\\code\\app", names: ["app-project", "code-app", "ada-code-app"] },
|
|
66
66
|
{ path: "C:\\Users\\ada\\work\\My App", names: ["My-App", "work-My-App", "ada-work-My-App"] },
|
package/src/ids/project-dir.ts
CHANGED
|
@@ -56,10 +56,10 @@ export const projectDirNameFor = (folderBasename: string): string => {
|
|
|
56
56
|
return RESERVED_PROJECT_DIR_NAMES.includes(name) ? `${name}-project` : name;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
// The names a folder may take in
|
|
60
|
-
//
|
|
61
|
-
// twice.
|
|
62
|
-
//
|
|
59
|
+
// The names a folder may take in a sandbox's /work, best first: its own name, then its parent's name in front of it,
|
|
60
|
+
// then its grandparent's too (`app`, `code-app`, `radar-code-app`), each one `isProjectDirName` accepts and none
|
|
61
|
+
// twice. Written (2026-10-12) for the desktop app's one sandbox per computer, where a second folder called `app` read as
|
|
62
|
+
// `code-app` rather than `app-2`; since 2026-10-21 each folder has a sandbox of its own and takes its own name. A
|
|
63
63
|
// drive (`C:`) and a network share's server and share (`\\server\share`, `\\wsl.localhost\<distro>`) are where a folder
|
|
64
64
|
// is, not what it is called, so they never lend a name.
|
|
65
65
|
export const projectDirCandidates = (hostPath: string): string[] => {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// A transcript row's own name (TranscriptRow.rowId). Minted once, where the row is made: the live fold for a run's rows,
|
|
2
|
+
// the record for a row written outside a run. Random rather than counted, since two makers (a run and a placed line) can
|
|
3
|
+
// write into one conversation without asking each other, and nothing reads order out of it: position is the record's.
|
|
4
|
+
|
|
5
|
+
const ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
6
|
+
// Twelve characters of base 36, about 62 bits: unique within any conversation by a wide margin, and short, since every
|
|
7
|
+
// row of every record carries one.
|
|
8
|
+
const LENGTH = 12;
|
|
9
|
+
|
|
10
|
+
export const newRowId = (): string => {
|
|
11
|
+
let id = "";
|
|
12
|
+
for (const byte of globalThis.crypto.getRandomValues(new Uint8Array(LENGTH))) {
|
|
13
|
+
id += ALPHABET[byte % ALPHABET.length];
|
|
14
|
+
}
|
|
15
|
+
return id;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// The name of a row recorded before rows had ids: its position, which never moves for a row that stays (a rewind only
|
|
19
|
+
// drops rows after the point it keeps, and what is written after gets minted ids). The `@` keeps it apart from a minted id.
|
|
20
|
+
export const positionRowId = (position: number): string => `@${position}`;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import type { AgentAttention } from "../schemas/agents.js";
|
|
2
2
|
import type { AutomationApproval } from "../schemas/automations.js";
|
|
3
|
+
import { goesBySelf } from "../schemas/agent-next.js";
|
|
3
4
|
import { parentOf } from "./agent-starter.js";
|
|
4
|
-
import {
|
|
5
|
-
type AgentStanding,
|
|
6
|
-
blocked,
|
|
7
|
-
heardByParent,
|
|
8
|
-
limitScheduled,
|
|
9
|
-
onlyOwnerCanAnswer,
|
|
10
|
-
scheduledSend,
|
|
11
|
-
turnInFlight,
|
|
12
|
-
turnWorking,
|
|
13
|
-
watching,
|
|
14
|
-
} from "./agent-standing.js";
|
|
5
|
+
import { type AgentStanding, blocked, heardByParent, onlyOwnerCanAnswer, turnInFlight, turnWorking, watching } from "./agent-standing.js";
|
|
15
6
|
|
|
16
7
|
// The lane every surface files a conversation in, and what of a fleet calls the person. Moved here from the editor
|
|
17
8
|
// (_editor/web/src/models/agent-status/agentStatus-lanes.ts, which re-exports it) on 2026-10-16, so the daemon's
|
|
@@ -23,11 +14,15 @@ import {
|
|
|
23
14
|
// reader's once it no longer does: nothing running there to hear it and nothing armed to wake it, which is a parent out
|
|
24
15
|
// of Active. That holds only until the parent moves past it (heardByParent). After that the stop is the family's
|
|
25
16
|
// history, drawn in the tray, and no longer something the reader owes a press. The sandbox draws the same line for a
|
|
26
|
-
// child's land news (subagents/child-lands.ts): the parent's while it has a live turn, the owner's after.
|
|
17
|
+
// child's land news (subagents/child-lands.ts): the parent's while it has a live turn, the owner's after. A fresh
|
|
18
|
+
// session is the exception: its parent never supervises it (nothing it does is reported there), so whatever it stops on
|
|
19
|
+
// is the reader's from the start, through its parent's card, however busy the parent is.
|
|
27
20
|
export const callsOwner = (
|
|
28
21
|
child: AgentStanding & { readonly updatedAt: number },
|
|
29
22
|
family: { readonly child: FleetLane; readonly parent: FleetLane; readonly parentAt: number },
|
|
30
|
-
): boolean =>
|
|
23
|
+
): boolean =>
|
|
24
|
+
onlyOwnerCanAnswer(child) ||
|
|
25
|
+
(family.child === "attention" && (family.parent !== "active" || child.fresh !== undefined) && !heardByParent(child, family.parentAt));
|
|
31
26
|
|
|
32
27
|
export type FleetLane = "attention" | "active" | "finished";
|
|
33
28
|
|
|
@@ -46,7 +41,7 @@ export const NO_ATTENTION: AgentAttention = {
|
|
|
46
41
|
// "finished" needs no explicit timer since auto-land already flips a cleanly-completed turn to landed/idle within
|
|
47
42
|
// ms, and any follow-up message moves the card back to active. Unread stays a badge, not a lane.
|
|
48
43
|
export const laneOf = (agent: AgentStanding): FleetLane => {
|
|
49
|
-
// A spent allowance nothing
|
|
44
|
+
// A spent allowance nothing carries on reaches Attention through `blocked` alone, no branch of its own, and ahead
|
|
50
45
|
// of the `watching` branch below: a watch is the agent's own plan for waiting, a spent allowance an obstacle in
|
|
51
46
|
// the way of it, and a watch firing into a shut window runs nothing (turn-admission.ts holds its words back).
|
|
52
47
|
if (blocked(agent) || agent.status === "awaiting" || agent.status === "conflict") {
|
|
@@ -70,15 +65,10 @@ export const laneOf = (agent: AgentStanding): FleetLane => {
|
|
|
70
65
|
if (watching(agent)) {
|
|
71
66
|
return "active";
|
|
72
67
|
}
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
if (
|
|
77
|
-
return "active";
|
|
78
|
-
}
|
|
79
|
-
// Messages booked for later are the same: the conversation starts again by itself, at a time or once the agent it
|
|
80
|
-
// waits for has landed, so filing it Finished would announce as done work that has not started yet.
|
|
81
|
-
if (scheduledSend(agent)) {
|
|
68
|
+
// Whatever carries it on by itself (`next`: a held turn re-run or moved, a send once memory frees, messages booked
|
|
69
|
+
// for a time or another agent's land) is Active: filing it Finished would announce as over work that resumes or has
|
|
70
|
+
// not started yet. An ending it answers reached here because `blocked` let it through on the same reading.
|
|
71
|
+
if (goesBySelf(agent)) {
|
|
82
72
|
return "active";
|
|
83
73
|
}
|
|
84
74
|
// `landed`/`idle`/`ready` all finish here: `ready` is work held on the branch because auto-land is off, still
|
|
@@ -127,7 +117,9 @@ export const attentionCalls = (agents: readonly CallerStanding[]): readonly { re
|
|
|
127
117
|
const calls: { readonly id: string; readonly card: string }[] = [];
|
|
128
118
|
for (const agent of agents) {
|
|
129
119
|
const parent = parentIn(agent);
|
|
130
|
-
|
|
120
|
+
// Words left in a child's composer give it a card of its own (childFold.standsAlone), except a fresh session's:
|
|
121
|
+
// its composer is the person's anyway, and it rides its origin's card whatever it holds.
|
|
122
|
+
if (parent === undefined || (agent.unsent === true && agent.fresh === undefined)) {
|
|
131
123
|
if (laneOf(agent) === "attention") {
|
|
132
124
|
calls.push({ id: agent.id, card: agent.id });
|
|
133
125
|
}
|
|
@@ -252,7 +252,7 @@ export const ACP: AgentCapabilities = {
|
|
|
252
252
|
isolation: "cwd",
|
|
253
253
|
commands: true,
|
|
254
254
|
terminals: true,
|
|
255
|
-
// A failure the agent words as a spent allowance or an outgrown window is coded (
|
|
255
|
+
// A failure the agent words as a spent allowance or an outgrown window is coded (error-frames.ts codedFailure), but the
|
|
256
256
|
// words are each agent's own and the protocol marks no outage, so nothing promises the codes auto-resume keys off.
|
|
257
257
|
recovery: false,
|
|
258
258
|
warm: false,
|
|
@@ -332,7 +332,7 @@ export const PI: AgentCapabilities = {
|
|
|
332
332
|
// session, as the Claude loop's Bash hook does (pi-hooks.ts).
|
|
333
333
|
terminals: true,
|
|
334
334
|
// Pi reports a provider failure as its own event (auto_retry_end, an errored message_end) carrying the provider's
|
|
335
|
-
// sentence, status code included, which the shared rules code (
|
|
335
|
+
// sentence, status code included, which the shared rules code (error-frames.ts codedFailure).
|
|
336
336
|
recovery: true,
|
|
337
337
|
warm: false,
|
|
338
338
|
// `--system-prompt` replaces Pi's base and `--append-system-prompt` adds to it, both per process; `--no-context-files`
|