@intentic/sandbox-contract 1.430.0 → 1.432.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 +22 -5
- package/dist/app-routes/app-pages.d.ts +1 -0
- package/dist/app-routes/app-pages.d.ts.map +1 -1
- package/dist/app-routes/app-pages.js +1 -0
- package/dist/app-routes/app-pages.js.map +1 -1
- package/dist/app-routes/index.d.ts +1 -0
- package/dist/app-routes/index.d.ts.map +1 -1
- package/dist/app-routes/index.js +1 -0
- package/dist/app-routes/index.js.map +1 -1
- package/dist/app-routes/return-path.d.ts +2 -0
- package/dist/app-routes/return-path.d.ts.map +1 -0
- package/dist/app-routes/return-path.js +8 -0
- package/dist/app-routes/return-path.js.map +1 -0
- package/dist/briefs/agent-ask.d.ts +10 -0
- package/dist/briefs/agent-ask.d.ts.map +1 -0
- package/dist/briefs/agent-ask.js +2 -0
- package/dist/briefs/agent-ask.js.map +1 -0
- package/dist/{chores/extension-update.d.ts → briefs/extension-update-brief.d.ts} +1 -1
- package/dist/briefs/extension-update-brief.d.ts.map +1 -0
- package/dist/{chores/extension-update.js → briefs/extension-update-brief.js} +2 -2
- package/dist/briefs/extension-update-brief.js.map +1 -0
- package/dist/chores/digest.d.ts.map +1 -1
- package/dist/chores/digest.js.map +1 -1
- package/dist/chores/index.d.ts +2 -2
- package/dist/chores/index.d.ts.map +1 -1
- package/dist/chores/index.js +1 -1
- package/dist/chores/index.js.map +1 -1
- package/dist/chores/prompt.d.ts +1 -9
- package/dist/chores/prompt.d.ts.map +1 -1
- package/dist/chores/prompt.js +1 -1
- package/dist/chores/prompt.js.map +1 -1
- package/dist/chores/stack.d.ts.map +1 -1
- package/dist/chores/stack.js.map +1 -1
- package/dist/chores/verdict.d.ts.map +1 -1
- package/dist/chores/verdict.js.map +1 -1
- package/dist/chores/workspace-scope.d.ts +1 -3
- package/dist/chores/workspace-scope.d.ts.map +1 -1
- package/dist/chores/workspace-scope.js +1 -3
- package/dist/chores/workspace-scope.js.map +1 -1
- package/dist/contracts/accounts.contract.d.ts.map +1 -1
- package/dist/contracts/accounts.contract.js +2 -0
- package/dist/contracts/accounts.contract.js.map +1 -1
- package/dist/contracts/agent.contract.d.ts +1226 -12
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.d.ts +2665 -733
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +35 -5
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/automations.contract.d.ts +90 -8
- package/dist/contracts/automations.contract.d.ts.map +1 -1
- package/dist/contracts/automations.contract.js +1 -0
- package/dist/contracts/automations.contract.js.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts +49 -0
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.js +24 -1
- package/dist/contracts/capabilities.contract.js.map +1 -1
- package/dist/contracts/ci.contract.d.ts +222 -95
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/ci.contract.js +87 -26
- package/dist/contracts/ci.contract.js.map +1 -1
- package/dist/contracts/device-ci-runners.contract.d.ts +108 -0
- package/dist/contracts/device-ci-runners.contract.d.ts.map +1 -0
- package/dist/contracts/device-ci-runners.contract.js +56 -0
- package/dist/contracts/device-ci-runners.contract.js.map +1 -0
- package/dist/contracts/device-stacks.contract.d.ts +129 -0
- package/dist/contracts/device-stacks.contract.d.ts.map +1 -0
- package/dist/contracts/device-stacks.contract.js +66 -0
- package/dist/contracts/device-stacks.contract.js.map +1 -0
- package/dist/contracts/device.contract.d.ts +74 -0
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.d.ts +604 -0
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.js +11 -2
- package/dist/contracts/extensions.contract.js.map +1 -1
- package/dist/contracts/git.contract.d.ts +7 -0
- package/dist/contracts/git.contract.d.ts.map +1 -1
- package/dist/contracts/needs.contract.d.ts +1097 -18
- package/dist/contracts/needs.contract.d.ts.map +1 -1
- package/dist/contracts/offload.contract.d.ts +25 -0
- package/dist/contracts/offload.contract.d.ts.map +1 -1
- package/dist/contracts/ports.contract.d.ts +8 -0
- package/dist/contracts/ports.contract.d.ts.map +1 -1
- package/dist/contracts/ports.contract.js +6 -5
- package/dist/contracts/ports.contract.js.map +1 -1
- package/dist/contracts/remote.contract.d.ts +1 -0
- package/dist/contracts/remote.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +1203 -9
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.js +49 -2
- package/dist/contracts/runner.contract.js.map +1 -1
- package/dist/contracts/runners.contract.d.ts +16 -0
- package/dist/contracts/runners.contract.d.ts.map +1 -0
- package/dist/contracts/runners.contract.js +15 -0
- package/dist/contracts/runners.contract.js.map +1 -0
- package/dist/contracts/safety.contract.d.ts.map +1 -1
- package/dist/contracts/safety.contract.js +1 -0
- package/dist/contracts/safety.contract.js.map +1 -1
- package/dist/contracts/seal.contract.d.ts +100 -0
- package/dist/contracts/seal.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.d.ts +15 -0
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js +27 -1
- package/dist/contracts/secrets.contract.js.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +159 -2
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +59 -42
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.js +19 -0
- package/dist/contracts/settings.contract.js.map +1 -1
- package/dist/contracts/skills.contract.d.ts +6 -0
- package/dist/contracts/skills.contract.d.ts.map +1 -1
- package/dist/contracts/stack-grants.contract.d.ts +418 -0
- package/dist/contracts/stack-grants.contract.d.ts.map +1 -0
- package/dist/contracts/stack-grants.contract.js +46 -0
- package/dist/contracts/stack-grants.contract.js.map +1 -0
- package/dist/contracts/system.contract.d.ts +516 -69
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +26 -45
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/contracts/usage.contract.d.ts +3 -0
- package/dist/contracts/usage.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.d.ts +0 -55
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js +0 -19
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/events/agent-events.d.ts +615 -8
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-events.js +2 -2
- package/dist/events/agent-events.js.map +1 -1
- package/dist/events/agent-transcript.d.ts +159 -2
- package/dist/events/agent-transcript.d.ts.map +1 -1
- 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 +22 -2
- package/dist/events/agent-words.js.map +1 -1
- package/dist/events/child-news.d.ts +32 -0
- package/dist/events/child-news.d.ts.map +1 -0
- package/dist/events/child-news.js +171 -0
- package/dist/events/child-news.js.map +1 -0
- package/dist/events/prompt-origins.d.ts +42 -0
- package/dist/events/prompt-origins.d.ts.map +1 -1
- package/dist/events/prompt-origins.js +28 -0
- package/dist/events/prompt-origins.js.map +1 -1
- package/dist/events/refusal-incidents.d.ts +1 -0
- package/dist/events/refusal-incidents.d.ts.map +1 -1
- package/dist/events/refusal-incidents.js +42 -19
- package/dist/events/refusal-incidents.js.map +1 -1
- package/dist/events/requests.d.ts +14 -0
- package/dist/events/requests.d.ts.map +1 -1
- package/dist/events/requests.js +12 -0
- package/dist/events/requests.js.map +1 -1
- package/dist/events/system-events.d.ts +98 -0
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/transcript.d.ts +799 -10
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/events/transcript.js +2 -1
- package/dist/events/transcript.js.map +1 -1
- package/dist/ids/conversation-ids.d.ts +1 -0
- package/dist/ids/conversation-ids.d.ts.map +1 -1
- package/dist/ids/conversation-ids.js +2 -1
- package/dist/ids/conversation-ids.js.map +1 -1
- package/dist/ids/project-id.d.ts.map +1 -1
- package/dist/ids/project-id.js +4 -4
- package/dist/ids/project-id.js.map +1 -1
- package/dist/ids/run-row-ids.d.ts +8 -0
- package/dist/ids/run-row-ids.d.ts.map +1 -0
- package/dist/ids/run-row-ids.js +32 -0
- package/dist/ids/run-row-ids.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/models/agent-catalog.d.ts.map +1 -1
- package/dist/models/agent-catalog.js +3 -2
- package/dist/models/agent-catalog.js.map +1 -1
- package/dist/models/agent-lanes.d.ts.map +1 -1
- package/dist/models/agent-lanes.js +4 -1
- package/dist/models/agent-lanes.js.map +1 -1
- package/dist/models/agent-runtimes.d.ts.map +1 -1
- package/dist/models/agent-runtimes.js +2 -2
- package/dist/models/agent-runtimes.js.map +1 -1
- package/dist/models/agent-standing.d.ts +6 -1
- package/dist/models/agent-standing.d.ts.map +1 -1
- package/dist/models/agent-standing.js +1 -0
- package/dist/models/agent-standing.js.map +1 -1
- package/dist/models/model-roles.d.ts +91 -37
- package/dist/models/model-roles.d.ts.map +1 -1
- package/dist/models/model-roles.js +106 -35
- package/dist/models/model-roles.js.map +1 -1
- package/dist/models/model-setups.d.ts +10 -8
- package/dist/models/model-setups.d.ts.map +1 -1
- package/dist/models/model-setups.js +15 -15
- package/dist/models/model-setups.js.map +1 -1
- package/dist/models/providers/provider-traits.d.ts +215 -0
- package/dist/models/providers/provider-traits.d.ts.map +1 -0
- package/dist/models/providers/provider-traits.js +60 -0
- package/dist/models/providers/provider-traits.js.map +1 -0
- package/dist/netd/browser-wire.d.ts +8 -0
- package/dist/netd/browser-wire.d.ts.map +1 -1
- package/dist/netd/browser-wire.js +5 -0
- package/dist/netd/browser-wire.js.map +1 -1
- package/dist/netd/generated/wire.d.ts +42 -1
- package/dist/netd/generated/wire.d.ts.map +1 -1
- package/dist/policy/admin/admin-grant.d.ts +21 -0
- package/dist/policy/admin/admin-grant.d.ts.map +1 -0
- package/dist/policy/admin/admin-grant.js +41 -0
- package/dist/policy/admin/admin-grant.js.map +1 -0
- package/dist/policy/approvals-execution.d.ts +5 -2
- package/dist/policy/approvals-execution.d.ts.map +1 -1
- package/dist/policy/approvals-execution.js +3 -4
- package/dist/policy/approvals-execution.js.map +1 -1
- package/dist/policy/batch-runs.d.ts +1 -1
- package/dist/policy/batch-runs.d.ts.map +1 -1
- package/dist/policy/batch-runs.js +2 -1
- package/dist/policy/batch-runs.js.map +1 -1
- package/dist/policy/capabilities/capability-kinds.d.ts +268 -0
- package/dist/policy/capabilities/capability-kinds.d.ts.map +1 -0
- package/dist/policy/capabilities/capability-kinds.js +47 -0
- package/dist/policy/capabilities/capability-kinds.js.map +1 -0
- package/dist/policy/command-classes.d.ts.map +1 -1
- package/dist/policy/command-classes.js +3 -1
- package/dist/policy/command-classes.js.map +1 -1
- package/dist/policy/device-programs.d.ts +79 -2
- package/dist/policy/device-programs.d.ts.map +1 -1
- package/dist/policy/device-programs.js +15 -16
- package/dist/policy/device-programs.js.map +1 -1
- package/dist/policy/message-limits.d.ts.map +1 -1
- package/dist/policy/message-limits.js.map +1 -1
- package/dist/policy/org-locks.d.ts +1 -1
- package/dist/policy/org-locks.d.ts.map +1 -1
- package/dist/policy/org-locks.js +1 -0
- package/dist/policy/org-locks.js.map +1 -1
- package/dist/policy/reserved-servers.d.ts.map +1 -1
- package/dist/policy/reserved-servers.js +5 -1
- package/dist/policy/reserved-servers.js.map +1 -1
- package/dist/policy/role-capability.d.ts.map +1 -1
- package/dist/policy/role-capability.js +2 -1
- package/dist/policy/role-capability.js.map +1 -1
- package/dist/policy/shell/command-normalise.d.ts +10 -0
- package/dist/policy/shell/command-normalise.d.ts.map +1 -0
- package/dist/policy/shell/command-normalise.js +153 -0
- package/dist/policy/shell/command-normalise.js.map +1 -0
- package/dist/policy/shell/workspace-root-exclude.d.ts +4 -0
- package/dist/policy/shell/workspace-root-exclude.d.ts.map +1 -0
- package/dist/policy/shell/workspace-root-exclude.js +4 -0
- package/dist/policy/shell/workspace-root-exclude.js.map +1 -0
- package/dist/protocol/doors/listener-protocol.d.ts +11 -0
- package/dist/protocol/doors/listener-protocol.d.ts.map +1 -1
- package/dist/protocol/doors/listener-protocol.js +5 -0
- package/dist/protocol/doors/listener-protocol.js.map +1 -1
- package/dist/protocol/doors/loopback-proof.d.ts +8 -0
- package/dist/protocol/doors/loopback-proof.d.ts.map +1 -0
- package/dist/protocol/doors/loopback-proof.js +11 -0
- package/dist/protocol/doors/loopback-proof.js.map +1 -0
- package/dist/protocol/doors/pass-scopes.d.ts +4 -0
- package/dist/protocol/doors/pass-scopes.d.ts.map +1 -0
- package/dist/protocol/doors/pass-scopes.js +3 -0
- package/dist/protocol/doors/pass-scopes.js.map +1 -0
- package/dist/protocol/doors/runner-protocol.d.ts +187 -0
- package/dist/protocol/doors/runner-protocol.d.ts.map +1 -1
- package/dist/protocol/doors/runner-protocol.js +48 -1
- package/dist/protocol/doors/runner-protocol.js.map +1 -1
- package/dist/protocol/doors/sandbox-pass.d.ts +19 -2
- package/dist/protocol/doors/sandbox-pass.d.ts.map +1 -1
- package/dist/protocol/doors/sandbox-pass.js +42 -10
- package/dist/protocol/doors/sandbox-pass.js.map +1 -1
- package/dist/protocol/doors/webext-links.d.ts.map +1 -1
- package/dist/protocol/doors/webext-links.js.map +1 -1
- package/dist/protocol/member-reach.d.ts +6 -0
- package/dist/protocol/member-reach.d.ts.map +1 -1
- package/dist/protocol/member-reach.js +24 -0
- package/dist/protocol/member-reach.js.map +1 -1
- package/dist/protocol/peer-mcp-server.d.ts +2 -0
- package/dist/protocol/peer-mcp-server.d.ts.map +1 -1
- package/dist/protocol/peer-mcp-server.js +1 -0
- package/dist/protocol/peer-mcp-server.js.map +1 -1
- package/dist/protocol/raw/extension-protocol.d.ts +518 -0
- package/dist/protocol/raw/extension-protocol.d.ts.map +1 -1
- package/dist/protocol/raw/extension-protocol.js +276 -0
- package/dist/protocol/raw/extension-protocol.js.map +1 -1
- package/dist/protocol/raw/raw-json-routes.d.ts +572 -0
- package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-json-routes.js +25 -2
- package/dist/protocol/raw/raw-json-routes.js.map +1 -1
- package/dist/protocol/raw/raw-routes.d.ts +245 -3
- package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.js +79 -36
- package/dist/protocol/raw/raw-routes.js.map +1 -1
- package/dist/protocol/route-meta.d.ts.map +1 -1
- package/dist/protocol/route-meta.js.map +1 -1
- package/dist/schemas/account-routes.d.ts +176 -0
- package/dist/schemas/account-routes.d.ts.map +1 -0
- package/dist/schemas/account-routes.js +73 -0
- package/dist/schemas/account-routes.js.map +1 -0
- package/dist/schemas/activity.d.ts.map +1 -1
- package/dist/schemas/activity.js.map +1 -1
- package/dist/schemas/agent-background.d.ts +48 -0
- package/dist/schemas/agent-background.d.ts.map +1 -0
- package/dist/schemas/agent-background.js +63 -0
- package/dist/schemas/agent-background.js.map +1 -0
- package/dist/schemas/agent-land.d.ts +7 -0
- package/dist/schemas/agent-land.d.ts.map +1 -1
- package/dist/schemas/agent-land.js +11 -0
- package/dist/schemas/agent-land.js.map +1 -1
- package/dist/schemas/agent.d.ts +4 -0
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +4 -2
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents-list.d.ts +40 -0
- package/dist/schemas/agents-list.d.ts.map +1 -1
- package/dist/schemas/agents.d.ts +668 -17
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +16 -41
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/auto-approve.d.ts +12 -0
- package/dist/schemas/auto-approve.d.ts.map +1 -0
- package/dist/schemas/auto-approve.js +12 -0
- package/dist/schemas/auto-approve.js.map +1 -0
- package/dist/schemas/automations.d.ts +170 -27
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js +26 -34
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/bridge-heads.d.ts +57 -0
- package/dist/schemas/bridge-heads.d.ts.map +1 -0
- package/dist/schemas/bridge-heads.js +22 -0
- package/dist/schemas/bridge-heads.js.map +1 -0
- package/dist/schemas/capabilities.d.ts +21 -0
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +6 -0
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/checkout-hooks.d.ts +24 -0
- package/dist/schemas/checkout-hooks.d.ts.map +1 -0
- package/dist/schemas/checkout-hooks.js +23 -0
- package/dist/schemas/checkout-hooks.js.map +1 -0
- package/dist/schemas/ci-deployments.d.ts +30 -0
- package/dist/schemas/ci-deployments.d.ts.map +1 -0
- package/dist/schemas/ci-deployments.js +18 -0
- package/dist/schemas/ci-deployments.js.map +1 -0
- package/dist/schemas/ci-fleet.d.ts +216 -0
- package/dist/schemas/ci-fleet.d.ts.map +1 -0
- package/dist/schemas/ci-fleet.js +87 -0
- package/dist/schemas/ci-fleet.js.map +1 -0
- package/dist/schemas/ci.d.ts +348 -21
- package/dist/schemas/ci.d.ts.map +1 -1
- package/dist/schemas/ci.js +110 -19
- package/dist/schemas/ci.js.map +1 -1
- package/dist/schemas/command-run.d.ts +29 -0
- package/dist/schemas/command-run.d.ts.map +1 -0
- package/dist/schemas/command-run.js +20 -0
- package/dist/schemas/command-run.js.map +1 -0
- package/dist/schemas/connection-hub.d.ts +3 -1
- package/dist/schemas/connection-hub.d.ts.map +1 -1
- package/dist/schemas/connection-hub.js +2 -1
- package/dist/schemas/connection-hub.js.map +1 -1
- package/dist/schemas/context-continues.d.ts.map +1 -1
- package/dist/schemas/context-continues.js +2 -2
- package/dist/schemas/context-continues.js.map +1 -1
- package/dist/schemas/data-protection.d.ts +15 -2
- package/dist/schemas/data-protection.d.ts.map +1 -1
- package/dist/schemas/data-protection.js +15 -23
- package/dist/schemas/data-protection.js.map +1 -1
- package/dist/schemas/device-stacks.d.ts +131 -0
- package/dist/schemas/device-stacks.d.ts.map +1 -1
- package/dist/schemas/device-stacks.js +81 -0
- package/dist/schemas/device-stacks.js.map +1 -1
- package/dist/schemas/devices.d.ts +137 -0
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +11 -2
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/environment.d.ts +1 -0
- package/dist/schemas/environment.d.ts.map +1 -1
- package/dist/schemas/environment.js +1 -0
- package/dist/schemas/environment.js.map +1 -1
- package/dist/schemas/extension-updates.d.ts +1186 -0
- package/dist/schemas/extension-updates.d.ts.map +1 -1
- package/dist/schemas/extension-updates.js +22 -4
- package/dist/schemas/extension-updates.js.map +1 -1
- package/dist/schemas/git/git.d.ts +13 -0
- package/dist/schemas/git/git.d.ts.map +1 -1
- package/dist/schemas/git/git.js +7 -7
- package/dist/schemas/git/git.js.map +1 -1
- package/dist/schemas/git/index-run.d.ts +1 -0
- package/dist/schemas/git/index-run.d.ts.map +1 -1
- package/dist/schemas/host-power.d.ts +76 -0
- package/dist/schemas/host-power.d.ts.map +1 -0
- package/dist/schemas/host-power.js +101 -0
- package/dist/schemas/host-power.js.map +1 -0
- package/dist/schemas/hosts.d.ts +365 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +33 -1
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/issues.d.ts +55 -225
- package/dist/schemas/issues.d.ts.map +1 -1
- package/dist/schemas/issues.js +21 -43
- package/dist/schemas/issues.js.map +1 -1
- package/dist/schemas/keyring-native.d.ts.map +1 -1
- package/dist/schemas/keyring-native.js +3 -1
- package/dist/schemas/keyring-native.js.map +1 -1
- package/dist/schemas/keyring.d.ts +1 -0
- package/dist/schemas/keyring.d.ts.map +1 -1
- package/dist/schemas/keyring.js +3 -1
- package/dist/schemas/keyring.js.map +1 -1
- package/dist/schemas/maintenance.d.ts.map +1 -1
- package/dist/schemas/maintenance.js.map +1 -1
- package/dist/schemas/members.d.ts.map +1 -1
- package/dist/schemas/members.js +2 -14
- package/dist/schemas/members.js.map +1 -1
- package/dist/schemas/metrics.d.ts +33 -0
- package/dist/schemas/metrics.d.ts.map +1 -1
- package/dist/schemas/metrics.js +26 -0
- package/dist/schemas/metrics.js.map +1 -1
- package/dist/schemas/need-kinds.d.ts +19 -0
- package/dist/schemas/need-kinds.d.ts.map +1 -0
- package/dist/schemas/need-kinds.js +7 -0
- package/dist/schemas/need-kinds.js.map +1 -0
- package/dist/schemas/needs.d.ts +868 -27
- package/dist/schemas/needs.d.ts.map +1 -1
- package/dist/schemas/needs.js +79 -9
- package/dist/schemas/needs.js.map +1 -1
- package/dist/schemas/offload.d.ts +61 -0
- package/dist/schemas/offload.d.ts.map +1 -1
- package/dist/schemas/offload.js +14 -1
- package/dist/schemas/offload.js.map +1 -1
- package/dist/schemas/outward-action.d.ts +39 -0
- package/dist/schemas/outward-action.d.ts.map +1 -0
- package/dist/schemas/outward-action.js +40 -0
- package/dist/schemas/outward-action.js.map +1 -0
- package/dist/schemas/ports.d.ts +4 -0
- package/dist/schemas/ports.d.ts.map +1 -1
- package/dist/schemas/ports.js +3 -0
- package/dist/schemas/ports.js.map +1 -1
- package/dist/schemas/providers/capacity.d.ts +6 -0
- package/dist/schemas/providers/capacity.d.ts.map +1 -1
- package/dist/schemas/providers/plan-limits.d.ts +1 -0
- package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
- package/dist/schemas/providers/plan-limits.js +1 -0
- package/dist/schemas/providers/plan-limits.js.map +1 -1
- package/dist/schemas/providers/refusals.d.ts +12 -0
- package/dist/schemas/providers/refusals.d.ts.map +1 -1
- package/dist/schemas/providers/refusals.js +4 -0
- package/dist/schemas/providers/refusals.js.map +1 -1
- package/dist/schemas/remote-access.d.ts +1 -0
- package/dist/schemas/remote-access.d.ts.map +1 -1
- package/dist/schemas/remote-access.js +1 -0
- package/dist/schemas/remote-access.js.map +1 -1
- package/dist/schemas/run-targets.d.ts.map +1 -1
- package/dist/schemas/run-targets.js +2 -1
- package/dist/schemas/run-targets.js.map +1 -1
- package/dist/schemas/runner-views.d.ts +24 -0
- package/dist/schemas/runner-views.d.ts.map +1 -0
- package/dist/schemas/runner-views.js +16 -0
- package/dist/schemas/runner-views.js.map +1 -0
- package/dist/schemas/sandbox-reach.d.ts +157 -0
- package/dist/schemas/sandbox-reach.d.ts.map +1 -0
- package/dist/schemas/sandbox-reach.js +112 -0
- package/dist/schemas/sandbox-reach.js.map +1 -0
- package/dist/schemas/secrets.d.ts +17 -0
- package/dist/schemas/secrets.d.ts.map +1 -1
- package/dist/schemas/secrets.js +12 -5
- package/dist/schemas/secrets.js.map +1 -1
- package/dist/schemas/settings-history.d.ts +1 -1
- package/dist/schemas/settings-history.d.ts.map +1 -1
- package/dist/schemas/settings-history.js +5 -4
- package/dist/schemas/settings-history.js.map +1 -1
- package/dist/schemas/settings-savings.d.ts +58 -0
- package/dist/schemas/settings-savings.d.ts.map +1 -1
- package/dist/schemas/settings-savings.js +22 -0
- package/dist/schemas/settings-savings.js.map +1 -1
- package/dist/schemas/settings.d.ts +20 -42
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +24 -7
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/stack-grants.d.ts +60 -0
- package/dist/schemas/stack-grants.d.ts.map +1 -0
- package/dist/schemas/stack-grants.js +33 -0
- package/dist/schemas/stack-grants.js.map +1 -0
- package/dist/schemas/system.d.ts +19 -0
- package/dist/schemas/system.d.ts.map +1 -1
- package/dist/schemas/system.js +9 -0
- package/dist/schemas/system.js.map +1 -1
- package/dist/schemas/terminal.d.ts +46 -0
- package/dist/schemas/terminal.d.ts.map +1 -1
- package/dist/schemas/terminal.js +19 -0
- package/dist/schemas/terminal.js.map +1 -1
- package/dist/schemas/watch-sources.d.ts +72 -0
- package/dist/schemas/watch-sources.d.ts.map +1 -0
- package/dist/schemas/watch-sources.js +88 -0
- package/dist/schemas/watch-sources.js.map +1 -0
- package/dist/schemas/workspace/workspace-search.d.ts.map +1 -1
- package/dist/schemas/workspace/workspace-search.js +1 -1
- package/dist/schemas/workspace/workspace-search.js.map +1 -1
- package/dist/schemas/wsl-memory.d.ts +76 -0
- package/dist/schemas/wsl-memory.d.ts.map +1 -0
- package/dist/schemas/wsl-memory.js +36 -0
- package/dist/schemas/wsl-memory.js.map +1 -0
- package/dist/state/auth-state.d.ts.map +1 -1
- package/dist/state/auth-state.js +3 -0
- package/dist/state/auth-state.js.map +1 -1
- package/dist/state/definition.d.ts +16 -8
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/runtime-state.d.ts +1 -1
- package/dist/state/runtime-state.d.ts.map +1 -1
- package/dist/state/runtime-state.js +1 -1
- package/dist/state/runtime-state.js.map +1 -1
- package/dist/state/workspace-state.d.ts +9 -4
- package/dist/state/workspace-state.d.ts.map +1 -1
- package/dist/state/workspace-state.js +9 -4
- package/dist/state/workspace-state.js.map +1 -1
- package/dist/sync/workspace-sync-ignores.d.ts +4 -0
- package/dist/sync/workspace-sync-ignores.d.ts.map +1 -0
- package/dist/sync/workspace-sync-ignores.js +75 -0
- package/dist/sync/workspace-sync-ignores.js.map +1 -0
- package/dist/text/pages.d.ts.map +1 -1
- package/dist/text/pages.js +17 -4
- package/dist/text/pages.js.map +1 -1
- package/dist/text/transcript-fold.js +2 -2
- package/dist/text/transcript-fold.js.map +1 -1
- package/package.json +5 -5
- package/src/app-routes/app-pages.ts +3 -0
- package/src/app-routes/index.ts +1 -0
- package/src/app-routes/return-path.ts +16 -0
- package/src/briefs/agent-ask.ts +23 -0
- package/src/{chores/extension-update.ts → briefs/extension-update-brief.ts} +3 -2
- package/src/chores/digest.ts +1 -0
- package/src/chores/index.ts +13 -2
- package/src/chores/prompt.ts +3 -18
- package/src/chores/stack.ts +1 -0
- package/src/chores/verdict.ts +1 -0
- package/src/chores/workspace-scope.ts +3 -8
- package/src/contracts/accounts.contract.ts +3 -0
- package/src/contracts/agents.contract.ts +41 -5
- package/src/contracts/automations.contract.ts +2 -0
- package/src/contracts/capabilities.contract.ts +31 -2
- package/src/contracts/ci.contract.ts +119 -37
- package/src/contracts/device-ci-runners.contract.ts +81 -0
- package/src/contracts/device-stacks.contract.ts +97 -0
- package/src/contracts/extensions.contract.ts +12 -1
- package/src/contracts/ports.contract.ts +6 -6
- package/src/contracts/runner.contract.ts +117 -3
- package/src/contracts/runners.contract.ts +19 -0
- package/src/contracts/safety.contract.ts +2 -0
- package/src/contracts/secrets.contract.ts +39 -0
- package/src/contracts/settings.contract.ts +26 -0
- package/src/contracts/stack-grants.contract.ts +51 -0
- package/src/contracts/system.contract.ts +36 -62
- package/src/contracts/workspace.contract.ts +0 -22
- package/src/events/agent-events.ts +3 -2
- package/src/events/agent-words.test.ts +19 -1
- package/src/events/agent-words.ts +36 -2
- package/src/events/child-news.test.ts +91 -0
- package/src/events/child-news.ts +269 -0
- package/src/events/prompt-origins.ts +35 -0
- package/src/events/refusal-incidents.ts +60 -19
- package/src/events/requests.ts +18 -0
- package/src/events/transcript.ts +10 -1
- package/src/ids/conversation-ids.test.ts +3 -1
- package/src/ids/conversation-ids.ts +6 -4
- package/src/ids/project-dir.test.ts +1 -1
- package/src/ids/project-dir.ts +1 -1
- package/src/ids/project-id.test.ts +14 -0
- package/src/ids/project-id.ts +6 -4
- package/src/ids/run-row-ids.test.ts +38 -0
- package/src/ids/run-row-ids.ts +49 -0
- package/src/index.ts +6 -6
- package/src/models/agent-catalog.test.ts +7 -4
- package/src/models/agent-catalog.ts +3 -2
- package/src/models/agent-lanes.ts +8 -1
- package/src/models/agent-runtimes.ts +7 -6
- package/src/models/agent-standing.ts +13 -0
- package/src/models/model-roles.test.ts +61 -4
- package/src/models/model-roles.ts +153 -49
- package/src/models/model-setups.ts +49 -26
- package/src/models/provider-specs.test.ts +2 -2
- package/src/models/providers/provider-traits.test.ts +71 -0
- package/src/models/providers/provider-traits.ts +144 -0
- package/src/netd/browser-wire.ts +13 -0
- package/src/netd/generated/browser-wire.json +10 -0
- package/src/netd/generated/netd-wire.json +224 -1
- package/src/netd/generated/wire.ts +18 -6
- package/src/netd/wire-manifests.test.ts +16 -0
- package/src/policy/admin/admin-grant.ts +69 -0
- package/src/policy/approvals-execution.ts +11 -6
- package/src/policy/batch-runs.ts +2 -2
- package/src/policy/capabilities/capability-kinds.test.ts +112 -0
- package/src/policy/capabilities/capability-kinds.ts +110 -0
- package/src/policy/command-classes.ts +5 -3
- package/src/policy/credential-material.ts +1 -1
- package/src/policy/device-programs.ts +29 -20
- package/src/policy/message-limits.ts +8 -4
- package/src/policy/org-locks.ts +1 -0
- package/src/policy/overlay-lint.ts +1 -1
- package/src/policy/reserved-servers.ts +5 -1
- package/src/policy/role-capability.ts +3 -1
- package/src/policy/shell/command-normalise.test.ts +72 -0
- package/src/policy/shell/command-normalise.ts +212 -0
- package/src/policy/shell/workspace-root-exclude.ts +11 -0
- package/src/policy/tests/admin-grant.test.ts +35 -0
- package/src/policy/tests/command-classes.test.ts +41 -0
- package/src/protocol/doors/listener-protocol.ts +32 -1
- package/src/protocol/doors/loopback-proof.ts +34 -0
- package/src/protocol/doors/pass-scopes.ts +12 -0
- package/src/protocol/doors/runner-protocol.ts +133 -4
- package/src/protocol/doors/sandbox-pass.test.ts +33 -1
- package/src/protocol/doors/sandbox-pass.ts +92 -16
- package/src/protocol/doors/webext-links.ts +3 -1
- package/src/protocol/ingress-contract.fixture.json +5 -1
- package/src/protocol/member-reach.test.ts +40 -1
- package/src/protocol/member-reach.ts +40 -0
- package/src/protocol/peer-mcp-server.ts +6 -0
- package/src/protocol/raw/extension-protocol.ts +469 -2
- package/src/protocol/raw/raw-json-routes.ts +45 -1
- package/src/protocol/raw/raw-routes.ts +133 -40
- package/src/protocol/route-meta.ts +4 -1
- package/src/schemas/account-routes.ts +126 -0
- package/src/schemas/activity.ts +6 -4
- package/src/schemas/agent-background.ts +104 -0
- package/src/schemas/agent-land.ts +21 -2
- package/src/schemas/agent.test.ts +3 -0
- package/src/schemas/agent.ts +10 -4
- package/src/schemas/agents.ts +26 -65
- package/src/schemas/auto-approve.ts +31 -0
- package/src/schemas/automations.ts +51 -42
- package/src/schemas/bridge-heads.ts +33 -0
- package/src/schemas/capabilities.ts +23 -0
- package/src/schemas/checkout-hooks.ts +44 -0
- package/src/schemas/ci-deployments.ts +26 -0
- package/src/schemas/ci-fleet.ts +180 -0
- package/src/schemas/ci.ts +185 -45
- package/src/schemas/command-run.ts +44 -0
- package/src/schemas/compose-overlay.test.ts +1 -1
- package/src/schemas/compose-overlay.ts +1 -1
- package/src/schemas/connection-hub.ts +4 -2
- package/src/schemas/context-continues.ts +6 -3
- package/src/schemas/data-protection.ts +28 -34
- package/src/schemas/device-stacks.ts +162 -3
- package/src/schemas/device-swaps.test.ts +1 -1
- package/src/schemas/devices.ts +31 -2
- package/src/schemas/egress-private.test.ts +1 -1
- package/src/schemas/environment.ts +4 -0
- package/src/schemas/extension-updates.ts +35 -7
- package/src/schemas/git/git.ts +14 -14
- package/src/schemas/host-power.test.ts +53 -0
- package/src/schemas/host-power.ts +173 -0
- package/src/schemas/hosts.test.ts +32 -0
- package/src/schemas/hosts.ts +86 -2
- package/src/schemas/intentic-os.ts +2 -2
- package/src/schemas/issues.ts +43 -86
- package/src/schemas/keyring-native.test.ts +11 -3
- package/src/schemas/keyring-native.ts +3 -1
- package/src/schemas/keyring.ts +6 -1
- package/src/schemas/maintenance.ts +4 -3
- package/src/schemas/members.ts +4 -16
- package/src/schemas/metrics.test.ts +9 -1
- package/src/schemas/metrics.ts +43 -0
- package/src/schemas/need-kinds.ts +13 -0
- package/src/schemas/needs.ts +118 -14
- package/src/schemas/offload.ts +37 -3
- package/src/schemas/outward-action.ts +47 -0
- package/src/schemas/ports.ts +5 -0
- package/src/schemas/providers/plan-limits.ts +1 -0
- package/src/schemas/providers/refusals.ts +9 -0
- package/src/schemas/remote-access.ts +3 -0
- package/src/schemas/run-targets.ts +2 -1
- package/src/schemas/runner-views.ts +27 -0
- package/src/schemas/sandbox-reach.ts +161 -0
- package/src/schemas/secrets.ts +23 -5
- package/src/schemas/settings-history.ts +10 -5
- package/src/schemas/settings-savings.ts +29 -0
- package/src/schemas/settings.test.ts +24 -23
- package/src/schemas/settings.ts +55 -22
- package/src/schemas/stack-grants.ts +59 -0
- package/src/schemas/state-plan.test.ts +1 -1
- package/src/schemas/state-plan.ts +2 -2
- package/src/schemas/system.ts +16 -1
- package/src/schemas/terminal.ts +28 -0
- package/src/schemas/updates.test.ts +1 -1
- package/src/schemas/updates.ts +1 -1
- package/src/schemas/version-seam.test.ts +4 -1
- package/src/schemas/watch-sources.ts +127 -0
- package/src/schemas/workspace/workspace-search.ts +5 -2
- package/src/schemas/wsl-memory.ts +59 -0
- package/src/state/auth-state.ts +10 -0
- package/src/state/runtime-state.test.ts +3 -2
- package/src/state/runtime-state.ts +3 -1
- package/src/state/update-probation.ts +1 -1
- package/src/state/ways-back.test.ts +1 -1
- package/src/state/workspace-state.test.ts +2 -0
- package/src/state/workspace-state.ts +21 -21
- package/src/sync/workspace-sync-ignores.test.ts +48 -0
- package/src/sync/workspace-sync-ignores.ts +143 -0
- package/src/text/embed.ts +2 -2
- package/src/text/pages.ts +34 -7
- package/src/text/transcript-fold.test.ts +40 -2
- package/src/text/transcript-fold.ts +2 -2
- package/dist/chores/extension-update.d.ts.map +0 -1
- package/dist/chores/extension-update.js.map +0 -1
- package/dist/contracts/chores.contract.d.ts +0 -213
- package/dist/contracts/chores.contract.d.ts.map +0 -1
- package/dist/contracts/chores.contract.js +0 -32
- package/dist/contracts/chores.contract.js.map +0 -1
- package/dist/contracts/issues.contract.d.ts +0 -95
- package/dist/contracts/issues.contract.d.ts.map +0 -1
- package/dist/contracts/issues.contract.js +0 -50
- package/dist/contracts/issues.contract.js.map +0 -1
- package/src/chores/chores.test.ts +0 -24
- package/src/chores/digest.test.ts +0 -27
- package/src/chores/probes.integration.test.ts +0 -494
- package/src/chores/stack.test.ts +0 -140
- package/src/chores/verdict.test.ts +0 -761
- package/src/contracts/chores.contract.ts +0 -39
- package/src/contracts/issues.contract.ts +0 -53
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { oneLine } from "@intentic/base/one-line";
|
|
2
|
+
import type { ChildNewsKind, TranscriptChildNews, TranscriptRow } from "./transcript.js";
|
|
3
|
+
|
|
4
|
+
// WHAT THE SANDBOX TELLS A PARENT ABOUT ONE OF ITS SUBAGENTS between its start and its report: it moved, it stays
|
|
5
|
+
// stopped, it starts again, a message to it did not go. The parent reads each as a prompt nobody typed; a reader draws
|
|
6
|
+
// it as news about that subagent, never as the owner's own words (2026-11-26: four of these, one cause, drew as four of
|
|
7
|
+
// the owner's bubbles and filled the screen). Composing and recognising stay one piece of knowledge here, so every
|
|
8
|
+
// sentence below is also what the parser anchors on: keep each one's opening and the words that follow the name
|
|
9
|
+
// unchanged across releases, or news already in a record reads as the owner's words again.
|
|
10
|
+
|
|
11
|
+
/** The subagent a piece of news is about: its id, and its title where the sentence names one. */
|
|
12
|
+
export interface NewsSubject {
|
|
13
|
+
readonly child: string;
|
|
14
|
+
readonly title?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// `sub-x7` or `sub-x7 ("Port the parser")`; a title is one line, since the parser reads the name off one.
|
|
18
|
+
const named = ({ child, title }: NewsSubject): string => {
|
|
19
|
+
const label = title === undefined ? "" : oneLine(title);
|
|
20
|
+
return label === "" ? `\`${child}\`` : `\`${child}\` ("${label}")`;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Paths and repos as a sentence names them: each in backticks, past `shown` the rest counted.
|
|
24
|
+
export const listed = (items: readonly string[], shown: number = items.length): string =>
|
|
25
|
+
[
|
|
26
|
+
items
|
|
27
|
+
.slice(0, shown)
|
|
28
|
+
.map((item) => `\`${item}\``)
|
|
29
|
+
.join(", "),
|
|
30
|
+
...(items.length > shown ? [`and ${items.length - shown} more`] : []),
|
|
31
|
+
].join(" ");
|
|
32
|
+
|
|
33
|
+
/** Its runner could not prepare its copy of the workspace, so it runs in this sandbox instead. */
|
|
34
|
+
export const movedHereWords = (who: NewsSubject, runner: string, failure: string): string =>
|
|
35
|
+
`Your subagent ${named(who)} could not start on the runner "${runner}": ${failure} It runs here, in this sandbox, instead, and its report reaches you when it ends.`;
|
|
36
|
+
|
|
37
|
+
/** It ended without running again, and nothing will run it again by itself. */
|
|
38
|
+
export const stoppedWords = (who: NewsSubject, why: string): string => `Your subagent ${named(who)} stays stopped: ${why}`;
|
|
39
|
+
|
|
40
|
+
/** A restart cut it before any model read its brief, so it starts again by itself. */
|
|
41
|
+
export const restartedWords = (who: NewsSubject): string =>
|
|
42
|
+
`Your subagent ${named(who)} had not started when the sandbox restarted, so it starts again by itself, from its task: its report reaches you when it ends.`;
|
|
43
|
+
|
|
44
|
+
/** Its turn opened on another model than it was spawned on. */
|
|
45
|
+
export const otherModelWords = (who: NewsSubject, served: string, asked: string): string =>
|
|
46
|
+
`Your subagent ${named(who)} runs this turn on ${served}, not on ${asked} as it was spawned: ${asked} was not offered when the turn started. Cancel it if that model will not do.`;
|
|
47
|
+
|
|
48
|
+
/** Refused where it ran, it moved itself to the next of its fallbacks (`provider/model` both). */
|
|
49
|
+
export const fellBackWords = (who: NewsSubject, from: string, to: string, refusal: string): string =>
|
|
50
|
+
`Your subagent ${named(who)} was refused on ${from} and moved itself to ${to}, the next of the fallbacks you gave it: it carries on in the same worktree, and its report comes when that turn ends. The refusal: ${refusal}`;
|
|
51
|
+
|
|
52
|
+
/** A turn started on it without its parent; `why` says what started it. */
|
|
53
|
+
export const workingWords = (who: NewsSubject, why: string): string =>
|
|
54
|
+
`Your subagent ${named(who)} is working: ${why}. Its report reaches you when it ends, like any turn of its: do not send it the task again or give the task to another agent meanwhile.`;
|
|
55
|
+
|
|
56
|
+
/** A start the owner had to allow never ran. */
|
|
57
|
+
export const notStartedWords = (child: string, why: string): string => `Your subagent \`${child}\` did not start: ${why}`;
|
|
58
|
+
|
|
59
|
+
/** The owner allowed a held start; `note` says what the start did beyond that. */
|
|
60
|
+
export const allowedWords = (child: string, note: string): string => `The owner allowed your subagent \`${child}\` to start. ${note}`;
|
|
61
|
+
|
|
62
|
+
/** A message the parent sent it never reached it. */
|
|
63
|
+
export const messageLostWords = (child: string, why: string): string => `Your message to subagent \`${child}\` did not go: ${why}`;
|
|
64
|
+
|
|
65
|
+
/** An answer the parent gave it never reached it. */
|
|
66
|
+
export const answerLostWords = (child: string, why: string): string => `Your answer to subagent \`${child}\` did not go: ${why}`;
|
|
67
|
+
|
|
68
|
+
/** One question a subagent stopped on, as its card asked it. */
|
|
69
|
+
export interface NewsQuestion {
|
|
70
|
+
readonly question: string;
|
|
71
|
+
readonly options: readonly { readonly label: string }[];
|
|
72
|
+
readonly multiSelect?: boolean | undefined;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const QUESTION_OPENS = "stopped on a question and is waiting for your answer";
|
|
76
|
+
|
|
77
|
+
/** It stopped on a question: the questions whole, options and all, and the door that answers them, since the parent may
|
|
78
|
+
* have no wait open to read them from. */
|
|
79
|
+
export const questionWords = (who: NewsSubject, questions: readonly NewsQuestion[]): string =>
|
|
80
|
+
[
|
|
81
|
+
`Your subagent ${named(who)} ${QUESTION_OPENS}; until you give one it does nothing and keeps its seat.`,
|
|
82
|
+
...questions.map((asked) => {
|
|
83
|
+
const options = asked.options.map((option) => option.label);
|
|
84
|
+
return `- ${asked.question}${options.length === 0 ? "" : ` (options: ${options.join(", ")}${asked.multiSelect === true ? "; pick any number" : ""})`}`;
|
|
85
|
+
}),
|
|
86
|
+
`Answer with answer(child: "${who.child}", answers: [{ question, picks }]), one entry per question in its own words. If it is not yours to decide, say so to the owner rather than guessing.`,
|
|
87
|
+
].join("\n");
|
|
88
|
+
|
|
89
|
+
/** A task handed to a linked sandbox stopped on a question over there. */
|
|
90
|
+
export const linkedQuestionWords = (child: string, sandbox: string, questions: readonly NewsQuestion[]): string =>
|
|
91
|
+
[
|
|
92
|
+
`Subagent \`${child}\`, the task you handed to the linked sandbox "${sandbox}", asks:`,
|
|
93
|
+
"",
|
|
94
|
+
...questions.map((entry) => {
|
|
95
|
+
const options = entry.options.map((option) => option.label).join(" / ");
|
|
96
|
+
return options === "" ? `- ${entry.question}` : `- ${entry.question} (${options})`;
|
|
97
|
+
}),
|
|
98
|
+
"",
|
|
99
|
+
`Answer it with answer(child: "${child}"), or send it words with send.`,
|
|
100
|
+
].join("\n");
|
|
101
|
+
|
|
102
|
+
/** Its work reached the main tree. */
|
|
103
|
+
export const landedWords = (who: NewsSubject, repos: readonly string[]): string =>
|
|
104
|
+
`Your subagent ${named(who)} landed in the main tree${repos.length === 0 ? "" : ` (${listed(repos)})`}.`;
|
|
105
|
+
|
|
106
|
+
// Paths a conflict sentence names before counting the rest.
|
|
107
|
+
const PATHS_NAMED = 5;
|
|
108
|
+
|
|
109
|
+
/** The owner's Land on it hit a merge conflict, so nothing of it reached the main tree. */
|
|
110
|
+
export const landConflictWords = (who: NewsSubject, paths: readonly string[]): string =>
|
|
111
|
+
[
|
|
112
|
+
`The owner pressed Land on your subagent ${named(who)}, and it hit a merge conflict${paths.length === 0 ? "" : ` on ${listed(paths, PATHS_NAMED)}`}: nothing of it reached the main tree.`,
|
|
113
|
+
"It lands once its branch is rebased onto the main line and the conflicts are resolved. The owner can have it do that from its card, or you can tell it to; a message you send while another turn runs on it waits for that turn to end.",
|
|
114
|
+
].join(" ");
|
|
115
|
+
|
|
116
|
+
/** Its finished work waits on its branch, and the parent's checkout moved under it; `line` says how. */
|
|
117
|
+
export const driftWords = (who: NewsSubject, line: string): string =>
|
|
118
|
+
`Your subagent ${named(who)} has finished work held on its branch, and your checkout moved under it: ${line} ` +
|
|
119
|
+
`Bring it in now while the clash is small (the merge tool, or \`agents merge ${who.child}\`, with conflict markers to resolve), or send it a message to rebase onto your checkout.`;
|
|
120
|
+
|
|
121
|
+
// THE PARSER. Each sentence is matched whole from its opening: the id, the title where it has one (lazy, so a title
|
|
122
|
+
// holding quotes or brackets still ends where the fixed words after it begin), then what each kind carries.
|
|
123
|
+
const NAME = "`([^`]+)`(?: \\(\"(.*?)\"\\))?";
|
|
124
|
+
const BARE = "`([^`]+)`";
|
|
125
|
+
|
|
126
|
+
interface Reading {
|
|
127
|
+
readonly kind: ChildNewsKind;
|
|
128
|
+
readonly pattern: RegExp;
|
|
129
|
+
// Whether the pattern reads a title after the id: then group 2 is the title and what the kind carries follows.
|
|
130
|
+
readonly titled: boolean;
|
|
131
|
+
readonly carries?: (rest: readonly (string | undefined)[]) => Carried;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
type Carried = Pick<TranscriptChildNews, "runner" | "model" | "cause">;
|
|
135
|
+
|
|
136
|
+
// What a kind carries, each field only where the sentence had it.
|
|
137
|
+
const carried = (fields: { readonly runner?: string | undefined; readonly model?: string | undefined; readonly cause?: string | undefined }): Carried => {
|
|
138
|
+
const kept: Carried = {};
|
|
139
|
+
if (fields.runner !== undefined) {
|
|
140
|
+
kept.runner = fields.runner;
|
|
141
|
+
}
|
|
142
|
+
if (fields.model !== undefined) {
|
|
143
|
+
kept.model = fields.model;
|
|
144
|
+
}
|
|
145
|
+
const cause = fields.cause?.trim();
|
|
146
|
+
if (cause !== undefined && cause !== "") {
|
|
147
|
+
kept.cause = cause;
|
|
148
|
+
}
|
|
149
|
+
return kept;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// The first question a subagent asks, without the options the sentence lists after it.
|
|
153
|
+
const firstQuestion = (prompt: string): Carried =>
|
|
154
|
+
carried({
|
|
155
|
+
cause: prompt
|
|
156
|
+
.split("\n")
|
|
157
|
+
.find((line) => line.startsWith("- "))
|
|
158
|
+
?.slice(2)
|
|
159
|
+
.replace(/ \(options: .*\)$/u, ""),
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const READINGS: readonly Reading[] = [
|
|
163
|
+
{
|
|
164
|
+
kind: "movedHere",
|
|
165
|
+
pattern: new RegExp(`^Your subagent ${NAME} could not start on the runner "([^"]+)": ([\\s\\S]*) It runs here, in this sandbox, instead, and its report reaches you when it ends\\.$`, "u"),
|
|
166
|
+
titled: true,
|
|
167
|
+
carries: ([runner, failure]) => carried({ runner, cause: failure }),
|
|
168
|
+
},
|
|
169
|
+
{ kind: "stopped", pattern: new RegExp(`^Your subagent ${NAME} stays stopped: ([\\s\\S]*)$`, "u"), titled: true, carries: ([why]) => carried({ cause: why }) },
|
|
170
|
+
{ kind: "restarted", pattern: new RegExp(`^Your subagent ${NAME} had not started when the sandbox restarted, so it starts again by itself`, "u"), titled: true },
|
|
171
|
+
{
|
|
172
|
+
kind: "otherModel",
|
|
173
|
+
pattern: new RegExp(`^Your subagent ${NAME} runs this turn on (\\S+), not on (\\S+) as it was spawned:`, "u"),
|
|
174
|
+
titled: true,
|
|
175
|
+
carries: ([served]) => carried({ model: served }),
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
kind: "fellBack",
|
|
179
|
+
pattern: new RegExp(`^Your subagent ${NAME} was refused on (\\S+) and moved itself to (\\S+), the next of the fallbacks you gave it:[\\s\\S]*? The refusal: ([\\s\\S]*)$`, "u"),
|
|
180
|
+
titled: true,
|
|
181
|
+
carries: ([, to, refusal]) => carried({ model: to, cause: refusal }),
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
kind: "working",
|
|
185
|
+
pattern: new RegExp(`^Your subagent ${NAME} is working: ([\\s\\S]*?)\\. Its report reaches you when it ends, like any turn of its`, "u"),
|
|
186
|
+
titled: true,
|
|
187
|
+
carries: ([why]) => carried({ cause: why }),
|
|
188
|
+
},
|
|
189
|
+
{ kind: "notStarted", pattern: new RegExp(`^Your subagent ${BARE} did not start: ([\\s\\S]*)$`, "u"), titled: false, carries: ([why]) => carried({ cause: why }) },
|
|
190
|
+
{ kind: "allowed", pattern: new RegExp(`^The owner allowed your subagent ${BARE} to start\\.`, "u"), titled: false },
|
|
191
|
+
{ kind: "messageLost", pattern: new RegExp(`^Your message to subagent ${BARE} did not go: ([\\s\\S]*)$`, "u"), titled: false, carries: ([why]) => carried({ cause: why }) },
|
|
192
|
+
{ kind: "answerLost", pattern: new RegExp(`^Your answer to subagent ${BARE} did not go: ([\\s\\S]*)$`, "u"), titled: false, carries: ([why]) => carried({ cause: why }) },
|
|
193
|
+
{ kind: "question", pattern: new RegExp(`^Your subagent ${NAME} ${QUESTION_OPENS};`, "u"), titled: true },
|
|
194
|
+
{ kind: "question", pattern: new RegExp(`^Subagent ${BARE}, the task you handed to the linked sandbox "[^"]*", asks:\\n`, "u"), titled: false },
|
|
195
|
+
{ kind: "landed", pattern: new RegExp(`^Your subagent ${NAME} landed in the main tree`, "u"), titled: true },
|
|
196
|
+
{ kind: "landConflict", pattern: new RegExp(`^The owner pressed Land on your subagent ${NAME}, and it hit a merge conflict`, "u"), titled: true },
|
|
197
|
+
{
|
|
198
|
+
kind: "drift",
|
|
199
|
+
pattern: new RegExp(`^Your subagent ${NAME} has finished work held on its branch, and your checkout moved under it: ([\\s\\S]*?) Bring it in now while the clash is small`, "u"),
|
|
200
|
+
titled: true,
|
|
201
|
+
carries: ([line]) => carried({ cause: line }),
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
|
|
205
|
+
/** Which subagent news a stored prompt is; undefined for every other prompt. */
|
|
206
|
+
export const childNewsOf = (prompt: string): TranscriptChildNews | undefined => {
|
|
207
|
+
for (const reading of READINGS) {
|
|
208
|
+
const match = reading.pattern.exec(prompt);
|
|
209
|
+
const from = match?.[1];
|
|
210
|
+
if (match === null || from === undefined) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
const title = reading.titled ? match[2] : undefined;
|
|
214
|
+
const rest = match.slice(reading.titled ? 3 : 2);
|
|
215
|
+
const news: TranscriptChildNews = { kind: reading.kind, from, sent: prompt };
|
|
216
|
+
if (title !== undefined && title !== "") {
|
|
217
|
+
news.title = title;
|
|
218
|
+
}
|
|
219
|
+
return Object.assign(news, reading.kind === "question" ? firstQuestion(prompt) : reading.carries?.(rest));
|
|
220
|
+
}
|
|
221
|
+
return undefined;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// The row's one line, for a reader with no words of its own for the kind; the prompt itself is disclosed under it.
|
|
225
|
+
const HEADLINE = {
|
|
226
|
+
movedHere: (news) => `could not start on the runner "${news.runner ?? ""}" and runs here instead`,
|
|
227
|
+
stopped: () => "stays stopped",
|
|
228
|
+
restarted: () => "starts again after a restart",
|
|
229
|
+
otherModel: (news) => `runs on ${news.model ?? "another model"}`,
|
|
230
|
+
fellBack: (news) => `moved to ${news.model ?? "its next fallback"}`,
|
|
231
|
+
working: () => "is working again",
|
|
232
|
+
notStarted: () => "did not start",
|
|
233
|
+
allowed: () => "was allowed to start",
|
|
234
|
+
messageLost: () => "did not get a message",
|
|
235
|
+
answerLost: () => "did not get an answer",
|
|
236
|
+
question: () => "asks a question",
|
|
237
|
+
landed: () => "landed",
|
|
238
|
+
landConflict: () => "hit a merge conflict on Land",
|
|
239
|
+
drift: () => "has held work your checkout moved under",
|
|
240
|
+
} as const satisfies Record<ChildNewsKind, (news: TranscriptChildNews) => string>;
|
|
241
|
+
|
|
242
|
+
const headline = (news: TranscriptChildNews): string => {
|
|
243
|
+
const sender = news.title === undefined ? news.from : `"${news.title}" (${news.from})`;
|
|
244
|
+
return `Subagent ${sender} ${HEADLINE[news.kind](news)}.`;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/** News about a subagent is a notice: it is neither this conversation's user nor its agent. */
|
|
248
|
+
export const childNewsRow = (prompt: string): TranscriptRow | undefined => {
|
|
249
|
+
const childNews = childNewsOf(prompt);
|
|
250
|
+
return childNews === undefined ? undefined : { role: "notice", text: headline(childNews), childNews };
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
/** A row recorded before news had a row of its own, as the user's: read as the news it is, keeping its place and its
|
|
254
|
+
* moment. Every other row comes back as it was, the same object. */
|
|
255
|
+
export const asChildNews = (row: TranscriptRow): TranscriptRow => {
|
|
256
|
+
if (row.role !== "user" || row.childNews !== undefined || row.speaker?.kind === "person" || row.speaker?.kind === "program") {
|
|
257
|
+
return row;
|
|
258
|
+
}
|
|
259
|
+
const news = childNewsRow(row.text);
|
|
260
|
+
if (news === undefined) {
|
|
261
|
+
return row;
|
|
262
|
+
}
|
|
263
|
+
const { sentAt, speaker: _speaker, errand: _errand, checkpointId: _checkpoint, rewindIndex: _rewind, ...kept } = row;
|
|
264
|
+
const read: TranscriptRow = { ...kept, ...news };
|
|
265
|
+
if (sentAt !== undefined) {
|
|
266
|
+
read.openedAt = sentAt;
|
|
267
|
+
}
|
|
268
|
+
return read;
|
|
269
|
+
};
|
|
@@ -43,6 +43,41 @@ export const TranscriptAgentWordsSchema = z.object({
|
|
|
43
43
|
});
|
|
44
44
|
export type TranscriptAgentWords = z.infer<typeof TranscriptAgentWordsSchema>;
|
|
45
45
|
|
|
46
|
+
// What the sandbox told a conversation about one of its subagents between the start and the report (child-news.ts): a
|
|
47
|
+
// move, a stop, a restart, a message that did not go. The parent reads it as a prompt; the row keeps that prompt and
|
|
48
|
+
// names the subagent, so a reader never draws it as the owner's own words.
|
|
49
|
+
export const ChildNewsKindSchema = z.enum([
|
|
50
|
+
"movedHere",
|
|
51
|
+
"stopped",
|
|
52
|
+
"restarted",
|
|
53
|
+
"otherModel",
|
|
54
|
+
"fellBack",
|
|
55
|
+
"working",
|
|
56
|
+
"notStarted",
|
|
57
|
+
"allowed",
|
|
58
|
+
"messageLost",
|
|
59
|
+
"answerLost",
|
|
60
|
+
"question",
|
|
61
|
+
"landed",
|
|
62
|
+
"landConflict",
|
|
63
|
+
"drift",
|
|
64
|
+
]);
|
|
65
|
+
export type ChildNewsKind = z.infer<typeof ChildNewsKindSchema>;
|
|
66
|
+
|
|
67
|
+
export const TranscriptChildNewsSchema = z.object({
|
|
68
|
+
kind: ChildNewsKindSchema.describe("What became of the subagent."),
|
|
69
|
+
from: z.string().describe("The subagent's id."),
|
|
70
|
+
title: z.string().optional().describe("The subagent's title, when the news named one."),
|
|
71
|
+
runner: z.string().optional().describe("The runner it could not start on (movedHere)."),
|
|
72
|
+
model: z.string().optional().describe("The model it runs on now, where that is the news (otherModel, fellBack)."),
|
|
73
|
+
cause: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Why, in the sandbox's own words, where the news says: the same words for every subagent one cause hit, so a reader says it once."),
|
|
77
|
+
sent: z.string().describe("The whole prompt the model received, disclosed under the row."),
|
|
78
|
+
});
|
|
79
|
+
export type TranscriptChildNews = z.infer<typeof TranscriptChildNewsSchema>;
|
|
80
|
+
|
|
46
81
|
// What a user row says the person was looking at when they sent it (the composer's "Viewing" chip): the file and the
|
|
47
82
|
// selected lines, never the selected text, which rode that one prompt and is not worth keeping on every copy of the row.
|
|
48
83
|
export const TranscriptEditorContextSchema = z.object({
|
|
@@ -10,7 +10,13 @@ import { type SandboxNotice, sandboxNoticeOf } from "./sandbox-notice.js";
|
|
|
10
10
|
|
|
11
11
|
The rows stay as they are in the record: the run is found again wherever it is drawn, so nothing about a stored
|
|
12
12
|
transcript, a rewind index or a fork changes. Only rows next to each other fold. A row between them (the person's
|
|
13
|
-
own message, a rebase, a different refusal) ends the run, since it is part of the story the reader is owed.
|
|
13
|
+
own message, a rebase, a different refusal) ends the run, since it is part of the story the reader is owed.
|
|
14
|
+
|
|
15
|
+
A wake is the exception (another agent's words, a watch, an answered need: a prompt nobody typed). When one wall
|
|
16
|
+
stands while a fleet of subagents reports back, every report wakes the conversation and is turned away in turn, and
|
|
17
|
+
the run read as report, refusal, report, refusal: seven subagents left fourteen rows and seventy lines on 2026-11-23.
|
|
18
|
+
The wakes the wall turned away fold into its run, and the run names them (`wakes`), so the reader still learns who
|
|
19
|
+
reported. A wake after the run's last refusal is the attempt in flight, and stays a row of its own. */
|
|
14
20
|
|
|
15
21
|
/** One refused attempt an incident folds: when it was refused, and the provider's own sentence for it. */
|
|
16
22
|
export interface IncidentAttempt {
|
|
@@ -26,6 +32,8 @@ export interface TranscriptIncident {
|
|
|
26
32
|
readonly attempts: readonly IncidentAttempt[];
|
|
27
33
|
// The run ended on the move (or a person's switch) that got the turn through, rather than on a refusal or a re-send.
|
|
28
34
|
readonly resolved: boolean;
|
|
35
|
+
// The wakes the wall turned away, by their index in the rows, oldest first: folded into the run, never drawn.
|
|
36
|
+
readonly wakes: readonly number[];
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
type Refusal = Extract<SandboxNotice, { code: "kept" | "undelivered" | "failed" }>;
|
|
@@ -68,40 +76,73 @@ const resent = (row: TranscriptRow): boolean => {
|
|
|
68
76
|
|
|
69
77
|
const movedOn = (row: TranscriptRow): boolean => codeOf(row, MOVED) !== undefined;
|
|
70
78
|
|
|
79
|
+
// A prompt nobody at the composer typed: another agent's words, a watch's wake, an answered need.
|
|
80
|
+
const isWake = (row: TranscriptRow): boolean =>
|
|
81
|
+
row.role === "notice" && (row.agentWords !== undefined || row.watchWake !== undefined || row.needWake !== undefined);
|
|
82
|
+
|
|
71
83
|
const attemptOf = (row: TranscriptRow, refusal: Refusal): IncidentAttempt =>
|
|
72
84
|
row.openedAt === undefined ? { said: refusal.params.message } : { at: row.openedAt, said: refusal.params.message };
|
|
73
85
|
|
|
86
|
+
// The wakes right above a first refusal, down to `floor`, which met the same wall: the first of them is what it turned away.
|
|
87
|
+
const wakesAbove = (rows: readonly TranscriptRow[], index: number, floor: number): number[] => {
|
|
88
|
+
let start = index;
|
|
89
|
+
while (start > floor && isWake(rows[start - 1]!)) {
|
|
90
|
+
start -= 1;
|
|
91
|
+
}
|
|
92
|
+
return Array.from({ length: index - start }, (_, offset) => start + offset);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// How far the run that opens on the refusal at `index` reaches: every same refusal, re-send and wake after it, up to and
|
|
96
|
+
// including the move or switch that ended it. A wake is joined only once a row after it carries the run on, since one
|
|
97
|
+
// after the last refusal is the attempt still in flight.
|
|
98
|
+
const runFrom = <R extends TranscriptRow>(rows: readonly R[], index: number, first: Refusal, resolves: (row: R) => boolean) => {
|
|
99
|
+
const attempts = [attemptOf(rows[index]!, first)];
|
|
100
|
+
const wakes: number[] = [];
|
|
101
|
+
let pending: number[] = [];
|
|
102
|
+
let to = index;
|
|
103
|
+
let resolved = false;
|
|
104
|
+
for (let next = index + 1; next < rows.length && !resolved; next += 1) {
|
|
105
|
+
const row = rows[next]!;
|
|
106
|
+
const again = refusalOf(row);
|
|
107
|
+
if (isWake(row)) {
|
|
108
|
+
pending.push(next);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (again !== undefined && sameRefusal(first, again)) {
|
|
112
|
+
attempts.push(attemptOf(row, again));
|
|
113
|
+
} else if (movedOn(row) || resolves(row)) {
|
|
114
|
+
resolved = true;
|
|
115
|
+
} else if (!resent(row)) {
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
wakes.push(...pending);
|
|
119
|
+
pending = [];
|
|
120
|
+
to = next;
|
|
121
|
+
}
|
|
122
|
+
return { to, attempts, resolved, wakes };
|
|
123
|
+
};
|
|
124
|
+
|
|
74
125
|
/**
|
|
75
126
|
* Every run of rows that says one refusal, in order. `resolves` names the reader's own rows that end one (the editor's
|
|
76
127
|
* line for an account a person switched to); the sandbox's own move (`accountMoved`) always does. A lone refusal is no
|
|
77
|
-
* run, and is drawn as itself.
|
|
128
|
+
* run, and is drawn as itself, as is one wake and the refusal it met.
|
|
78
129
|
*/
|
|
79
130
|
export const transcriptIncidents = <R extends TranscriptRow>(rows: readonly R[], resolves: (row: R) => boolean = () => false): TranscriptIncident[] => {
|
|
80
131
|
const found: TranscriptIncident[] = [];
|
|
81
132
|
let index = 0;
|
|
133
|
+
// The first row a run may reach back to: never into the run before it.
|
|
134
|
+
let floor = 0;
|
|
82
135
|
while (index < rows.length) {
|
|
83
136
|
const first = refusalOf(rows[index]!);
|
|
84
137
|
if (first === undefined) {
|
|
85
138
|
index += 1;
|
|
86
139
|
continue;
|
|
87
140
|
}
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const again = refusalOf(row);
|
|
94
|
-
if (again !== undefined && sameRefusal(first, again)) {
|
|
95
|
-
attempts.push(attemptOf(row, again));
|
|
96
|
-
} else if (movedOn(row) || resolves(row)) {
|
|
97
|
-
resolved = true;
|
|
98
|
-
} else if (!resent(row)) {
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
to = next;
|
|
102
|
-
}
|
|
103
|
-
if (to > index) {
|
|
104
|
-
found.push({ from: index, to, attempts, resolved });
|
|
141
|
+
const above = wakesAbove(rows, index, floor);
|
|
142
|
+
const { to, attempts, resolved, wakes } = runFrom(rows, index, first, resolves);
|
|
143
|
+
if (to > index || above.length > 1) {
|
|
144
|
+
found.push({ from: above[0] ?? index, to, attempts, resolved, wakes: [...above, ...wakes] });
|
|
145
|
+
floor = to + 1;
|
|
105
146
|
}
|
|
106
147
|
index = to + 1;
|
|
107
148
|
}
|
package/src/events/requests.ts
CHANGED
|
@@ -90,6 +90,10 @@ export const ChildAgentAskSchema = ChildRunSchema.extend({
|
|
|
90
90
|
.describe(
|
|
91
91
|
"What the parent would say to it: the prompt a described start opens on, the message it sends, or the answers it gives. Clipped for the request, with an ellipsis where it was cut.",
|
|
92
92
|
),
|
|
93
|
+
headings: z
|
|
94
|
+
.array(z.string())
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("The section names of the parent's whole words, in order, when they are a document of two sections or more: what the clipped message leaves out still shows by name."),
|
|
93
97
|
on: z.string().optional().describe('Which machine it runs on, when one is named: a runner, or "here" for this sandbox.'),
|
|
94
98
|
proposed: ChildRunSchema.optional().describe(
|
|
95
99
|
"What the agent asked to start it on, when the owner started it on something else instead. Present only once the request has settled that way.",
|
|
@@ -108,6 +112,12 @@ export const PermissionAskSchema = z.object({
|
|
|
108
112
|
description: z.string().optional().describe("More about what it is asking for."),
|
|
109
113
|
// Why the prompt fired ('rule' | 'mode' | 'classifier' | …), shown as the request's muted subline.
|
|
110
114
|
reason: z.string().optional().describe("Why it is asking at all: a rule, the current mode, something that looked risky."),
|
|
115
|
+
// Set where outside content in the turn is the whole reason it asks (the child-agent gate's taint floor), so the card
|
|
116
|
+
// can say that plainly to the owner instead of the agent-facing `reason`.
|
|
117
|
+
outside: z
|
|
118
|
+
.string()
|
|
119
|
+
.optional()
|
|
120
|
+
.describe("What brought outside content into the turn, in the words a person reads, when that alone is why it asks."),
|
|
111
121
|
// The file the request is about, when it is about one, workspace-root-relative.
|
|
112
122
|
path: z.string().optional().describe("Which file it concerns, when it concerns one."),
|
|
113
123
|
alwaysLabel: z
|
|
@@ -116,6 +126,14 @@ export const PermissionAskSchema = z.object({
|
|
|
116
126
|
.describe(
|
|
117
127
|
"The wording for an always-allow answer. Present only when there is something an always could actually remember; without it the only answers are once and no.",
|
|
118
128
|
),
|
|
129
|
+
// A second, lasting yes beside `alwaysLabel`, kept by the card's own gate past this conversation (a host added to a
|
|
130
|
+
// secret's host guard). Answered as `always` with `keep`; a runtime that knows nothing of it never offers it.
|
|
131
|
+
keepLabel: z
|
|
132
|
+
.string()
|
|
133
|
+
.optional()
|
|
134
|
+
.describe(
|
|
135
|
+
"The wording for a lasting answer the card's own gate keeps beyond this conversation, such as adding a host to a secret's host guard. Present only where there is one; only the owner's pick of it is kept, and anyone else's allows this once.",
|
|
136
|
+
),
|
|
119
137
|
alwaysAsks: z
|
|
120
138
|
.literal(true)
|
|
121
139
|
.optional()
|
package/src/events/transcript.ts
CHANGED
|
@@ -8,7 +8,13 @@ import { HeldEndingSchema, MemoryKillMarkSchema, RetryLadderSchema } from "../sc
|
|
|
8
8
|
import { HandoffOfferSchema } from "../schemas/providers/handoff.js";
|
|
9
9
|
import { NoticeCodeSchema } from "./sandbox-notice.js";
|
|
10
10
|
import { TranscriptAgentNoticeSchema } from "./agent-ui.js";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
TranscriptAgentWordsSchema,
|
|
13
|
+
TranscriptChildNewsSchema,
|
|
14
|
+
TranscriptEditorContextSchema,
|
|
15
|
+
TranscriptNeedWakeSchema,
|
|
16
|
+
TranscriptWatchWakeSchema,
|
|
17
|
+
} from "./prompt-origins.js";
|
|
12
18
|
import { ReviewFindingsSchema } from "./review.js";
|
|
13
19
|
import type { ToolCallContent, ToolCallLocation, ToolCallStatus, ToolKind } from "./requests.js";
|
|
14
20
|
import {
|
|
@@ -385,6 +391,9 @@ export const TranscriptRowSchema = z.object({
|
|
|
385
391
|
agentWords: TranscriptAgentWordsSchema.optional().describe(
|
|
386
392
|
"Another agent's words that reached this conversation, whose they are, and the prompt they came as.",
|
|
387
393
|
),
|
|
394
|
+
childNews: TranscriptChildNewsSchema.optional().describe(
|
|
395
|
+
"What the sandbox told this conversation about one of its subagents (a move, a stop, a message that did not go), and the prompt it came as.",
|
|
396
|
+
),
|
|
388
397
|
backgroundJob: TranscriptBackgroundJobSchema.optional().describe("The background job this row marks the start of."),
|
|
389
398
|
// Not a card: a page parks nothing, it is part of what the agent said. On the bubble whose tool call showed it.
|
|
390
399
|
page: PageSchema.optional().describe("A page the agent showed here, drawn inline."),
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
LAND_FIX_PREFIX,
|
|
6
6
|
LINKED_PREFIX,
|
|
7
7
|
LINK_CONVERSATION_PREFIX,
|
|
8
|
+
ROUTE_CONVERSATION_PREFIX,
|
|
8
9
|
looksDrawn,
|
|
9
10
|
SUBAGENT_PREFIX,
|
|
10
11
|
TAIL_ALPHABET,
|
|
@@ -79,6 +80,7 @@ test("no word collides with a derived id's prefix or a git name", () => {
|
|
|
79
80
|
LAND_FIX_PREFIX,
|
|
80
81
|
SUBAGENT_PREFIX,
|
|
81
82
|
LINK_CONVERSATION_PREFIX,
|
|
83
|
+
ROUTE_CONVERSATION_PREFIX,
|
|
82
84
|
LINKED_PREFIX,
|
|
83
85
|
"a-",
|
|
84
86
|
"wf-",
|
|
@@ -127,7 +129,7 @@ test("a drawn id, new or old, looks drawn; a route or a derived id does not", ()
|
|
|
127
129
|
// A subagent's and a link's conversations are drawn ids under a prefix, and their tails carry no digit about a third
|
|
128
130
|
// of the time, so the prefix must not hide them.
|
|
129
131
|
test("a drawn id under a subagent or link prefix still looks drawn, in either generation", () => {
|
|
130
|
-
for (const prefix of [SUBAGENT_PREFIX, LINK_CONVERSATION_PREFIX, LINKED_PREFIX]) {
|
|
132
|
+
for (const prefix of [SUBAGENT_PREFIX, LINK_CONVERSATION_PREFIX, ROUTE_CONVERSATION_PREFIX, LINKED_PREFIX]) {
|
|
131
133
|
expect(looksDrawn(`${prefix}${newConversationId()}`)).toBe(true);
|
|
132
134
|
expect(looksDrawn(`${prefix}otter-kmpq`)).toBe(true);
|
|
133
135
|
expect(looksDrawn(`${prefix}keen-pine-tkjf`)).toBe(true);
|
|
@@ -52,13 +52,15 @@ const tail = (): string => Array.from({ length: TAIL_LENGTH }, () => pick(TAIL_S
|
|
|
52
52
|
// A fresh id: `<word>-<tail>`, e.g. `otter-k7mq`; about ten characters against a UUID's thirty-six.
|
|
53
53
|
export const newConversationId = (): string => `${pick(CONVERSATION_WORDS)}-${tail()}`;
|
|
54
54
|
|
|
55
|
-
// A DRAWN ID WORN UNDER A PREFIX.
|
|
56
|
-
// of it: a spawned subagent (`sub-otter-k7mq`), a conversation a link opened here (`link-…`)
|
|
57
|
-
//
|
|
55
|
+
// A DRAWN ID WORN UNDER A PREFIX. Four kinds of conversation draw an id like any other and say what they are in front
|
|
56
|
+
// of it: a spawned subagent (`sub-otter-k7mq`), a conversation a link opened here (`link-…`), one another sandbox opened
|
|
57
|
+
// here acting for one of its people (`route-…`, 2026-11-24) and the roster entry for a task running on another sandbox
|
|
58
|
+
// (`linked-…`). Kept here beside the word list, since no word may read as one of them.
|
|
58
59
|
export const SUBAGENT_PREFIX = "sub-";
|
|
59
60
|
export const LINK_CONVERSATION_PREFIX = "link-";
|
|
61
|
+
export const ROUTE_CONVERSATION_PREFIX = "route-";
|
|
60
62
|
export const LINKED_PREFIX = "linked-";
|
|
61
|
-
const WRAPPING_PREFIXES = [SUBAGENT_PREFIX, LINK_CONVERSATION_PREFIX, LINKED_PREFIX];
|
|
63
|
+
const WRAPPING_PREFIXES = [SUBAGENT_PREFIX, LINK_CONVERSATION_PREFIX, ROUTE_CONVERSATION_PREFIX, LINKED_PREFIX];
|
|
62
64
|
const unwrapped = (id: string): string => {
|
|
63
65
|
const prefix = WRAPPING_PREFIXES.find((candidate) => id.startsWith(candidate));
|
|
64
66
|
return prefix === undefined ? id : id.slice(prefix.length);
|
|
@@ -3,7 +3,7 @@ import { MEMORY_FILE, PUBLIC_DIR, REFERENCE_DIR, WORKSPACE_ROOT } from "@intenti
|
|
|
3
3
|
import { STARTER_REPO } from "../state/starter.js";
|
|
4
4
|
import { isProjectDirName, projectDirCandidates, projectDirNameFor, projectDirNameOf, projectRemoteDir, RESERVED_PROJECT_DIR_NAMES } from "./project-dir.js";
|
|
5
5
|
|
|
6
|
-
// The cases `ic` is held to as well (
|
|
6
|
+
// The cases `ic` is held to as well (_hosts/ic/src/sandbox/project_dir.rs), read from the one file both run.
|
|
7
7
|
interface ProjectDirCases {
|
|
8
8
|
readonly names: readonly { readonly name: string; readonly valid: boolean }[];
|
|
9
9
|
readonly folders: readonly { readonly folder: string; readonly dirName: string }[];
|
package/src/ids/project-dir.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { STARTER_REPO } from "../state/starter.js";
|
|
|
4
4
|
// A PROJECT SANDBOX is made for one folder on the owner's computer, synced live into `/work/<name>` rather than into
|
|
5
5
|
// /work itself: the workspace root is the daemon's own, where it keeps its state, seeds its starter repo and serves
|
|
6
6
|
// `public/` to anyone with a link. `<name>` is derived from the folder's name once, on the owner's side, and every
|
|
7
|
-
// later reader (the sync agent, `ic`, the daemon) only validates it. `
|
|
7
|
+
// later reader (the sync agent, `ic`, the daemon) only validates it. `_hosts/ic/src/sandbox/project_dir.rs` holds the
|
|
8
8
|
// validation again for the host side; `project-dir.fixture.json` is the one set of cases both run.
|
|
9
9
|
|
|
10
10
|
// Top-level names the daemon treats as its own, so a project can never land on one: the public outbox, the reference
|
|
@@ -23,4 +23,18 @@ describe("project id", () => {
|
|
|
23
23
|
expect(normalizeProjectId(text)).toBeUndefined();
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
+
|
|
27
|
+
it("drops a query, a fragment and trailing slashes as before", () => {
|
|
28
|
+
expect(normalizeProjectId("https://github.com/acme/app.git//?ref=main#readme")).toBe("github.com/acme/app");
|
|
29
|
+
expect(normalizeProjectId("https://github.com//acme///app///")).toBe("github.com/acme/app");
|
|
30
|
+
expect(normalizeProjectId("https://github.com/acme/app#x?y")).toBe("github.com/acme/app");
|
|
31
|
+
expect(normalizeProjectId("github.com/acme/.git")).toBeUndefined();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("answers at once for a long run of `#` or `/`", () => {
|
|
35
|
+
// No clock: the old patterns were quadratic on these, so a return of them runs past the test's own timeout.
|
|
36
|
+
expect(normalizeProjectId(`#${"#".repeat(100_000)}`)).toBeUndefined();
|
|
37
|
+
expect(normalizeProjectId(`a${"/".repeat(100_000)}b?`)).toBeUndefined();
|
|
38
|
+
expect(normalizeProjectId(`github.com${"/".repeat(100_000)}acme/app${"/".repeat(100_000)}`)).toBe("github.com/acme/app");
|
|
39
|
+
});
|
|
26
40
|
});
|
package/src/ids/project-id.ts
CHANGED
|
@@ -24,11 +24,13 @@ export const normalizeProjectId = (raw: string): string | undefined => {
|
|
|
24
24
|
text = text.replace(/^[^@/]*@/, "");
|
|
25
25
|
text = text.replace(/^([^/:]+):\d+\//, "$1/");
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
// Cut at the first `?` or `#` and collapse slash runs before taking the trailing one: `/[?#].*$/` and `/\/+$/` retried
|
|
28
|
+
// from every `#` or `/` in a long remote, quadratic in its length.
|
|
29
|
+
const query = text.search(/[?#]/);
|
|
30
|
+
text = (query === -1 ? text : text.slice(0, query))
|
|
31
31
|
.replace(/\/+/g, "/")
|
|
32
|
+
.replace(/\/$/, "")
|
|
33
|
+
.replace(/\.git$/i, "")
|
|
32
34
|
.toLowerCase();
|
|
33
35
|
return text.length <= PROJECT_ID_MAX && PROJECT_ID.test(text) ? text : undefined;
|
|
34
36
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TranscriptPatch, TranscriptRow } from "../events/transcript.js";
|
|
2
|
+
import { RunRowIds } from "./run-row-ids.js";
|
|
3
|
+
|
|
4
|
+
// The stamp every server of a run puts on its rows (the sandbox daemon, the desktop app's agents on a computer): which
|
|
5
|
+
// run made a row, and the row's own id, kept in step with the fold's rows by following its patches.
|
|
6
|
+
|
|
7
|
+
const row = (text: string, rowId?: string): TranscriptRow => (rowId === undefined ? { role: `assistant`, text } : { role: `assistant`, text, rowId });
|
|
8
|
+
|
|
9
|
+
describe(`RunRowIds`, () => {
|
|
10
|
+
it(`keeps the ids its opening rows came with, and draws one for a row that has none`, () => {
|
|
11
|
+
const ids = new RunRowIds([row(`kept`, `row_kept`), row(`new`)]);
|
|
12
|
+
expect(ids.at(0)).toBe(`row_kept`);
|
|
13
|
+
expect(ids.at(1)).toEqual(expect.any(String));
|
|
14
|
+
expect(ids.at(1)).not.toBe(`row_kept`);
|
|
15
|
+
expect(ids.at(2)).toBeUndefined();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it(`stamps an appended row with its run and a fresh id, and names the row every later change is about`, () => {
|
|
19
|
+
const ids = new RunRowIds([]);
|
|
20
|
+
const appended = ids.stamp({ op: `append`, row: row(`hello`) }, `run-1`);
|
|
21
|
+
const rowId = ids.at(0);
|
|
22
|
+
expect(appended).toEqual({ op: `append`, row: { role: `assistant`, text: `hello`, run: `run-1`, rowId } });
|
|
23
|
+
expect(ids.stamp({ op: `text`, index: 0, text: ` there` }, `run-1`)).toEqual({ op: `text`, index: 0, rowId, text: ` there` });
|
|
24
|
+
const replaced: TranscriptPatch = ids.stamp({ op: `replace`, index: 0, row: row(`whole`) }, `run-1`);
|
|
25
|
+
expect(replaced).toEqual({ op: `replace`, index: 0, rowId, row: { role: `assistant`, text: `whole`, run: `run-1`, rowId } });
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it(`lets a dropped row's id go, so the rows after it keep their own`, () => {
|
|
29
|
+
const ids = new RunRowIds([row(`a`, `row_a`), row(`b`, `row_b`)]);
|
|
30
|
+
expect(ids.stamp({ op: `drop`, index: 0 }, `run-1`)).toEqual({ op: `drop`, index: 0, rowId: `row_a` });
|
|
31
|
+
expect(ids.at(0)).toBe(`row_b`);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it(`leaves a change to a row it never saw as it came`, () => {
|
|
35
|
+
const ids = new RunRowIds([]);
|
|
36
|
+
expect(ids.stamp({ op: `text`, index: 3, text: `late` }, `run-1`)).toEqual({ op: `text`, index: 3, text: `late` });
|
|
37
|
+
});
|
|
38
|
+
});
|