@intentic/sandbox-contract 1.247.0 → 1.249.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 +18 -15
- package/dist/chores/chores.d.ts.map +1 -1
- package/dist/chores/chores.js.map +1 -1
- package/dist/chores/digest.d.ts.map +1 -1
- package/dist/chores/digest.js.map +1 -1
- package/dist/chores/extension-update.d.ts.map +1 -1
- package/dist/chores/extension-update.js.map +1 -1
- package/dist/chores/fix-deps.d.ts.map +1 -1
- package/dist/chores/fix-deps.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/probes.d.ts.map +1 -1
- package/dist/chores/probes.js.map +1 -1
- package/dist/chores/prompt.d.ts.map +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 +7 -1
- package/dist/chores/verdict.d.ts.map +1 -1
- package/dist/chores/verdict.js +8 -0
- package/dist/chores/verdict.js.map +1 -1
- package/dist/contracts/accounts.contract.d.ts.map +1 -1
- package/dist/contracts/accounts.contract.js.map +1 -1
- package/dist/contracts/activity.contract.d.ts +1 -0
- package/dist/contracts/activity.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.d.ts +13 -205
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.js +2 -1
- package/dist/contracts/agent.contract.js.map +1 -1
- package/dist/contracts/agents.contract.d.ts +228 -54
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +11 -2
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/automations.contract.d.ts +35 -17
- package/dist/contracts/automations.contract.d.ts.map +1 -1
- package/dist/contracts/automations.contract.js +10 -1
- package/dist/contracts/automations.contract.js.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts +0 -12
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.js +1 -1
- package/dist/contracts/capabilities.contract.js.map +1 -1
- package/dist/contracts/chores.contract.d.ts.map +1 -1
- package/dist/contracts/chores.contract.js.map +1 -1
- package/dist/contracts/ci.contract.d.ts +9 -0
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/endpoints.contract.d.ts.map +1 -1
- package/dist/contracts/endpoints.contract.js.map +1 -1
- package/dist/contracts/exit.contract.d.ts.map +1 -1
- package/dist/contracts/exit.contract.js +1 -1
- package/dist/contracts/exit.contract.js.map +1 -1
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.js.map +1 -1
- package/dist/contracts/git.contract.d.ts +45 -6
- package/dist/contracts/git.contract.d.ts.map +1 -1
- package/dist/contracts/git.contract.js +9 -9
- package/dist/contracts/git.contract.js.map +1 -1
- package/dist/contracts/host.contract.d.ts +2 -0
- package/dist/contracts/host.contract.d.ts.map +1 -1
- package/dist/contracts/host.contract.js.map +1 -1
- package/dist/contracts/intentic.contract.js +1 -1
- package/dist/contracts/intentic.contract.js.map +1 -1
- package/dist/contracts/logs.contract.d.ts.map +1 -1
- package/dist/contracts/logs.contract.js.map +1 -1
- package/dist/contracts/loops.contract.d.ts.map +1 -1
- package/dist/contracts/loops.contract.js.map +1 -1
- package/dist/contracts/personas.contract.d.ts +39 -4
- package/dist/contracts/personas.contract.d.ts.map +1 -1
- package/dist/contracts/personas.contract.js +10 -1
- package/dist/contracts/personas.contract.js.map +1 -1
- package/dist/contracts/providers.contract.d.ts.map +1 -1
- package/dist/contracts/providers.contract.js.map +1 -1
- package/dist/contracts/runner.contract.d.ts +6 -80
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.js +2 -2
- package/dist/contracts/runner.contract.js.map +1 -1
- package/dist/contracts/safety.contract.d.ts.map +1 -1
- package/dist/contracts/safety.contract.js +1 -1
- package/dist/contracts/safety.contract.js.map +1 -1
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +2 -41
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/sessions.contract.js +1 -1
- package/dist/contracts/sessions.contract.js.map +1 -1
- package/dist/contracts/settings.contract.d.ts +10 -10
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.js.map +1 -1
- package/dist/contracts/share.contract.d.ts.map +1 -1
- package/dist/contracts/share.contract.js.map +1 -1
- package/dist/contracts/skills.contract.d.ts.map +1 -1
- package/dist/contracts/skills.contract.js.map +1 -1
- package/dist/contracts/system.contract.d.ts +49 -73
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +12 -2
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/contracts/usage.contract.d.ts.map +1 -1
- package/dist/contracts/usage.contract.js.map +1 -1
- package/dist/contracts/vpn.contract.d.ts.map +1 -1
- package/dist/contracts/vpn.contract.js +1 -1
- package/dist/contracts/vpn.contract.js.map +1 -1
- package/dist/contracts/webext.contract.d.ts.map +1 -1
- package/dist/contracts/webext.contract.js.map +1 -1
- package/dist/contracts/workflows.contract.d.ts +7 -6
- package/dist/contracts/workflows.contract.d.ts.map +1 -1
- package/dist/contracts/workflows.contract.js +12 -3
- package/dist/contracts/workflows.contract.js.map +1 -1
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/events/agent-events.d.ts +1237 -0
- package/dist/events/agent-events.d.ts.map +1 -0
- package/dist/events/agent-events.js +226 -0
- package/dist/events/agent-events.js.map +1 -0
- package/dist/events/cards.d.ts +404 -0
- package/dist/events/cards.d.ts.map +1 -0
- package/dist/events/cards.js +179 -0
- package/dist/events/cards.js.map +1 -0
- package/dist/events/resume.d.ts +23 -0
- package/dist/events/resume.d.ts.map +1 -0
- package/dist/events/resume.js +31 -0
- package/dist/events/resume.js.map +1 -0
- package/dist/events/system-events.d.ts +615 -0
- package/dist/events/system-events.d.ts.map +1 -0
- package/dist/events/system-events.js +64 -0
- package/dist/events/system-events.js.map +1 -0
- package/dist/events/transcript.d.ts +1755 -0
- package/dist/events/transcript.d.ts.map +1 -0
- package/dist/events/transcript.js +205 -0
- package/dist/events/transcript.js.map +1 -0
- package/dist/ids/conversation-ids.d.ts +8 -0
- package/dist/ids/conversation-ids.d.ts.map +1 -0
- package/dist/{conversation-ids.js → ids/conversation-ids.js} +13 -0
- package/dist/ids/conversation-ids.js.map +1 -0
- package/dist/ids/hostnames.d.ts.map +1 -0
- package/dist/ids/hostnames.js.map +1 -0
- package/dist/ids/session-names.d.ts.map +1 -0
- package/dist/ids/session-names.js.map +1 -0
- package/dist/ids/share-paths.d.ts.map +1 -0
- package/dist/ids/share-paths.js.map +1 -0
- package/dist/{tunnel-ids.d.ts → ids/tunnel-ids.d.ts} +1 -0
- package/dist/ids/tunnel-ids.d.ts.map +1 -0
- package/dist/{tunnel-ids.js → ids/tunnel-ids.js} +1 -0
- package/dist/ids/tunnel-ids.js.map +1 -0
- package/dist/index.d.ts +464 -447
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -47
- package/dist/index.js.map +1 -1
- package/dist/{agent-catalog.d.ts → models/agent-catalog.d.ts} +2 -2
- package/dist/models/agent-catalog.d.ts.map +1 -0
- package/dist/models/agent-catalog.js.map +1 -0
- package/dist/models/agent-runtimes.d.ts.map +1 -0
- package/dist/models/agent-runtimes.js.map +1 -0
- package/dist/{fast-tier.d.ts → models/fast-tier.d.ts} +1 -1
- package/dist/models/fast-tier.d.ts.map +1 -0
- package/dist/models/fast-tier.js.map +1 -0
- package/dist/models/model-order.d.ts.map +1 -0
- package/dist/models/model-order.js.map +1 -0
- package/dist/{model-pins.d.ts → models/model-pins.d.ts} +2 -4
- package/dist/models/model-pins.d.ts.map +1 -0
- package/dist/models/model-pins.js +22 -0
- package/dist/models/model-pins.js.map +1 -0
- package/dist/{model-roles.d.ts → models/model-roles.d.ts} +25 -30
- package/dist/models/model-roles.d.ts.map +1 -0
- package/dist/{model-roles.js → models/model-roles.js} +30 -27
- package/dist/models/model-roles.js.map +1 -0
- package/dist/{plan-pools.d.ts → models/plan-pools.d.ts} +1 -1
- package/dist/models/plan-pools.d.ts.map +1 -0
- package/dist/models/plan-pools.js.map +1 -0
- package/dist/models/prompt-complexity.d.ts.map +1 -0
- package/dist/models/prompt-complexity.js.map +1 -0
- package/dist/models/provider-specs.d.ts.map +1 -0
- package/dist/models/provider-specs.js.map +1 -0
- package/dist/policy/approvals-execution.d.ts.map +1 -0
- package/dist/policy/approvals-execution.js.map +1 -0
- package/dist/{batch-runs.d.ts → policy/batch-runs.d.ts} +5 -1
- package/dist/policy/batch-runs.d.ts.map +1 -0
- package/dist/{batch-runs.js → policy/batch-runs.js} +10 -7
- package/dist/policy/batch-runs.js.map +1 -0
- package/dist/policy/capability-env.d.ts.map +1 -0
- package/dist/policy/capability-env.js.map +1 -0
- package/dist/policy/capability-secrets.d.ts.map +1 -0
- package/dist/policy/capability-secrets.js.map +1 -0
- package/dist/{card-status.d.ts → policy/card-status.d.ts} +2 -2
- package/dist/policy/card-status.d.ts.map +1 -0
- package/dist/{card-status.js → policy/card-status.js} +1 -5
- package/dist/policy/card-status.js.map +1 -0
- package/dist/{command-classes.d.ts → policy/command-classes.d.ts} +6 -2
- package/dist/policy/command-classes.d.ts.map +1 -0
- package/dist/{command-classes.js → policy/command-classes.js} +48 -11
- package/dist/policy/command-classes.js.map +1 -0
- package/dist/{command-run.d.ts → policy/command-run.d.ts} +1 -1
- package/dist/policy/command-run.d.ts.map +1 -0
- package/dist/policy/command-run.js.map +1 -0
- package/dist/policy/control-scopes.d.ts +16 -0
- package/dist/policy/control-scopes.d.ts.map +1 -0
- package/dist/policy/control-scopes.js +26 -0
- package/dist/policy/control-scopes.js.map +1 -0
- package/dist/policy/credential-material.d.ts.map +1 -0
- package/dist/policy/credential-material.js.map +1 -0
- package/dist/policy/needs-action.d.ts.map +1 -0
- package/dist/policy/needs-action.js.map +1 -0
- package/dist/policy/output-fields.d.ts.map +1 -0
- package/dist/policy/output-fields.js.map +1 -0
- package/dist/policy/overlay-lint.d.ts.map +1 -0
- package/dist/policy/overlay-lint.js.map +1 -0
- package/dist/policy/owner-ticket.d.ts.map +1 -0
- package/dist/{owner-ticket.js → policy/owner-ticket.js} +1 -1
- package/dist/policy/owner-ticket.js.map +1 -0
- package/dist/{safety-policy.d.ts → policy/safety-policy.d.ts} +6 -5
- package/dist/policy/safety-policy.d.ts.map +1 -0
- package/dist/{safety-policy.js → policy/safety-policy.js} +12 -12
- package/dist/policy/safety-policy.js.map +1 -0
- package/dist/policy/search-globs.d.ts.map +1 -0
- package/dist/policy/search-globs.js.map +1 -0
- package/dist/protocol/container-requirements.d.ts +20 -0
- package/dist/protocol/container-requirements.d.ts.map +1 -0
- package/dist/protocol/container-requirements.js +23 -0
- package/dist/protocol/container-requirements.js.map +1 -0
- package/dist/{host-protocol.d.ts → protocol/host-protocol.d.ts} +1 -0
- package/dist/protocol/host-protocol.d.ts.map +1 -0
- package/dist/{host-protocol.js → protocol/host-protocol.js} +1 -0
- package/dist/protocol/host-protocol.js.map +1 -0
- package/dist/protocol/ingress-contract.d.ts.map +1 -0
- package/dist/{ingress-contract.js → protocol/ingress-contract.js} +1 -1
- package/dist/protocol/ingress-contract.js.map +1 -0
- package/dist/protocol/ingress-protocol.d.ts.map +1 -0
- package/dist/protocol/ingress-protocol.js.map +1 -0
- package/dist/protocol/listener-protocol.d.ts.map +1 -0
- package/dist/{listener-protocol.js → protocol/listener-protocol.js} +1 -1
- package/dist/protocol/listener-protocol.js.map +1 -0
- package/dist/{peer-dial.d.ts → protocol/peer-dial.d.ts} +4 -1
- package/dist/protocol/peer-dial.d.ts.map +1 -0
- package/dist/{peer-dial.js → protocol/peer-dial.js} +51 -10
- package/dist/protocol/peer-dial.js.map +1 -0
- package/dist/protocol/peer-mcp-server.d.ts.map +1 -0
- package/dist/protocol/peer-mcp-server.js.map +1 -0
- package/dist/protocol/request-id.d.ts.map +1 -0
- package/dist/protocol/request-id.js.map +1 -0
- package/dist/protocol/routes.d.ts.map +1 -0
- package/dist/protocol/routes.js.map +1 -0
- package/dist/{runner-protocol.d.ts → protocol/runner-protocol.d.ts} +1 -0
- package/dist/protocol/runner-protocol.d.ts.map +1 -0
- package/dist/{runner-protocol.js → protocol/runner-protocol.js} +2 -1
- package/dist/protocol/runner-protocol.js.map +1 -0
- package/dist/protocol/sse.d.ts.map +1 -0
- package/dist/protocol/sse.js.map +1 -0
- package/dist/{terminal-protocol.d.ts → protocol/terminal-protocol.d.ts} +1 -3
- package/dist/protocol/terminal-protocol.d.ts.map +1 -0
- package/dist/protocol/terminal-protocol.js.map +1 -0
- package/dist/protocol/webext-links.d.ts.map +1 -0
- package/dist/protocol/webext-links.js.map +1 -0
- package/dist/{webext-protocol.d.ts → protocol/webext-protocol.d.ts} +1 -0
- package/dist/protocol/webext-protocol.d.ts.map +1 -0
- package/dist/{webext-protocol.js → protocol/webext-protocol.js} +1 -0
- package/dist/protocol/webext-protocol.js.map +1 -0
- package/dist/schemas/activity.d.ts +2 -0
- package/dist/schemas/activity.d.ts.map +1 -1
- package/dist/schemas/activity.js +4 -0
- package/dist/schemas/activity.js.map +1 -1
- package/dist/schemas/agent.d.ts +17 -4
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +21 -4
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents.d.ts +17 -4
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +15 -4
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/approvals.d.ts.map +1 -1
- package/dist/schemas/approvals.js.map +1 -1
- package/dist/schemas/automations.d.ts +54 -28
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js +26 -8
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/capabilities.d.ts +0 -8
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +0 -4
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/ci.d.ts +10 -0
- package/dist/schemas/ci.d.ts.map +1 -1
- package/dist/schemas/ci.js +9 -1
- package/dist/schemas/ci.js.map +1 -1
- package/dist/schemas/codebase-health.d.ts.map +1 -1
- package/dist/schemas/codebase-health.js.map +1 -1
- package/dist/schemas/devices.d.ts +90 -0
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +10 -1
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/engines.d.ts.map +1 -1
- package/dist/schemas/engines.js.map +1 -1
- package/dist/schemas/environment.d.ts.map +1 -1
- package/dist/schemas/environment.js.map +1 -1
- package/dist/schemas/exit.d.ts.map +1 -1
- package/dist/schemas/exit.js.map +1 -1
- package/dist/schemas/extension-updates.d.ts.map +1 -1
- package/dist/schemas/extension-updates.js.map +1 -1
- package/dist/schemas/git-history.d.ts.map +1 -1
- package/dist/schemas/git-history.js.map +1 -1
- package/dist/schemas/git.d.ts +80 -16
- package/dist/schemas/git.d.ts.map +1 -1
- package/dist/schemas/git.js +37 -25
- package/dist/schemas/git.js.map +1 -1
- package/dist/schemas/history.d.ts.map +1 -1
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/inventory.d.ts.map +1 -1
- package/dist/schemas/inventory.js.map +1 -1
- package/dist/schemas/issues.d.ts +0 -1
- package/dist/schemas/issues.d.ts.map +1 -1
- package/dist/schemas/issues.js +0 -1
- package/dist/schemas/issues.js.map +1 -1
- package/dist/schemas/logs.d.ts.map +1 -1
- package/dist/schemas/logs.js.map +1 -1
- package/dist/schemas/loops.d.ts.map +1 -1
- package/dist/schemas/loops.js +1 -1
- package/dist/schemas/loops.js.map +1 -1
- package/dist/schemas/maintenance.d.ts.map +1 -1
- package/dist/schemas/maintenance.js.map +1 -1
- package/dist/schemas/marketplace.d.ts +0 -4
- package/dist/schemas/marketplace.d.ts.map +1 -1
- package/dist/schemas/panels.d.ts.map +1 -1
- package/dist/schemas/panels.js.map +1 -1
- package/dist/schemas/personas.d.ts +49 -4
- package/dist/schemas/personas.d.ts.map +1 -1
- package/dist/schemas/personas.js +32 -5
- package/dist/schemas/personas.js.map +1 -1
- package/dist/schemas/plan-limits.d.ts +2 -4
- package/dist/schemas/plan-limits.d.ts.map +1 -1
- package/dist/schemas/plan-limits.js +5 -8
- package/dist/schemas/plan-limits.js.map +1 -1
- package/dist/schemas/ports.d.ts.map +1 -1
- package/dist/schemas/ports.js.map +1 -1
- package/dist/schemas/provider-oauth.d.ts.map +1 -1
- package/dist/schemas/provider-oauth.js.map +1 -1
- package/dist/schemas/provider-subscriptions.d.ts +1 -1
- package/dist/schemas/provider-subscriptions.d.ts.map +1 -1
- package/dist/schemas/provider-subscriptions.js +1 -1
- package/dist/schemas/provider-subscriptions.js.map +1 -1
- package/dist/schemas/public.d.ts.map +1 -1
- package/dist/schemas/public.js.map +1 -1
- package/dist/schemas/push.d.ts.map +1 -1
- package/dist/schemas/push.js.map +1 -1
- package/dist/schemas/secrets.d.ts.map +1 -1
- package/dist/schemas/secrets.js.map +1 -1
- package/dist/schemas/settings.d.ts +7 -5
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +18 -8
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/share.d.ts.map +1 -1
- package/dist/schemas/share.js.map +1 -1
- package/dist/schemas/shared.d.ts +4 -0
- package/dist/schemas/shared.d.ts.map +1 -1
- package/dist/schemas/shared.js +3 -0
- package/dist/schemas/shared.js.map +1 -1
- package/dist/schemas/system.d.ts +6 -0
- package/dist/schemas/system.d.ts.map +1 -1
- package/dist/schemas/system.js +10 -0
- package/dist/schemas/system.js.map +1 -1
- package/dist/schemas/terminal.d.ts.map +1 -1
- package/dist/schemas/terminal.js.map +1 -1
- package/dist/schemas/usage.d.ts.map +1 -1
- package/dist/schemas/usage.js.map +1 -1
- package/dist/schemas/vpn.d.ts.map +1 -1
- package/dist/schemas/vpn.js.map +1 -1
- package/dist/schemas/webext.d.ts.map +1 -1
- package/dist/schemas/webext.js.map +1 -1
- package/dist/schemas/workflows.d.ts +66 -9
- package/dist/schemas/workflows.d.ts.map +1 -1
- package/dist/schemas/workflows.js +6 -5
- package/dist/schemas/workflows.js.map +1 -1
- package/dist/schemas/workspace-repos.d.ts.map +1 -1
- package/dist/schemas/workspace-repos.js.map +1 -1
- package/dist/schemas/workspace-search.d.ts.map +1 -1
- package/dist/schemas/workspace-search.js.map +1 -1
- package/dist/schemas/workspace-setup.d.ts.map +1 -1
- package/dist/schemas/workspace-setup.js.map +1 -1
- package/dist/schemas/workspace-tree.d.ts.map +1 -1
- package/dist/schemas/workspace-tree.js.map +1 -1
- package/dist/state/arrival.d.ts.map +1 -0
- package/dist/{arrival.js → state/arrival.js} +1 -1
- package/dist/state/arrival.js.map +1 -0
- package/dist/state/contract-lock.d.ts.map +1 -0
- package/dist/{contract-lock.js → state/contract-lock.js} +1 -1
- package/dist/state/contract-lock.js.map +1 -0
- package/dist/{definition.d.ts → state/definition.d.ts} +21 -17
- package/dist/state/definition.d.ts.map +1 -0
- package/dist/{definition.js → state/definition.js} +4 -4
- package/dist/state/definition.js.map +1 -0
- package/dist/state/history-state.d.ts.map +1 -0
- package/dist/{history-state.js → state/history-state.js} +1 -0
- package/dist/state/history-state.js.map +1 -0
- package/dist/state/runtime-state.d.ts.map +1 -0
- package/dist/state/runtime-state.js.map +1 -0
- package/dist/state/starter.d.ts.map +1 -0
- package/dist/state/starter.js.map +1 -0
- package/dist/state/state-portability.d.ts.map +1 -0
- package/dist/state/state-portability.js.map +1 -0
- package/dist/state/versions.d.ts.map +1 -0
- package/dist/state/versions.js.map +1 -0
- package/dist/{workspace-state.d.ts → state/workspace-state.d.ts} +8 -5
- package/dist/state/workspace-state.d.ts.map +1 -0
- package/dist/{workspace-state.js → state/workspace-state.js} +25 -1
- package/dist/state/workspace-state.js.map +1 -0
- package/dist/{documents.d.ts → text/documents.d.ts} +1 -1
- package/dist/text/documents.d.ts.map +1 -0
- package/dist/{documents.js → text/documents.js} +1 -1
- package/dist/text/documents.js.map +1 -0
- package/dist/text/embed.d.ts.map +1 -0
- package/dist/text/embed.js.map +1 -0
- package/dist/text/mentions.d.ts.map +1 -0
- package/dist/text/mentions.js.map +1 -0
- package/dist/text/model-answer.d.ts +3 -0
- package/dist/text/model-answer.d.ts.map +1 -0
- package/dist/text/model-answer.js +3 -0
- package/dist/text/model-answer.js.map +1 -0
- package/dist/text/path-refs.d.ts.map +1 -0
- package/dist/text/path-refs.js.map +1 -0
- package/dist/{shell-regions.d.ts → text/shell-regions.d.ts} +1 -1
- package/dist/text/shell-regions.d.ts.map +1 -0
- package/dist/text/shell-regions.js.map +1 -0
- package/dist/text/title.d.ts.map +1 -0
- package/dist/text/title.js.map +1 -0
- package/dist/{transcript-fold.d.ts → text/transcript-fold.d.ts} +2 -1
- package/dist/text/transcript-fold.d.ts.map +1 -0
- package/dist/{transcript-fold.js → text/transcript-fold.js} +2 -16
- package/dist/text/transcript-fold.js.map +1 -0
- package/dist/text/whisper.d.ts +3 -0
- package/dist/text/whisper.d.ts.map +1 -0
- package/dist/text/whisper.js +11 -0
- package/dist/text/whisper.js.map +1 -0
- package/dist/{workflow-faults.d.ts → text/workflow-faults.d.ts} +1 -1
- package/dist/text/workflow-faults.d.ts.map +1 -0
- package/dist/{workflow-faults.js → text/workflow-faults.js} +1 -1
- package/dist/text/workflow-faults.js.map +1 -0
- package/package.json +70 -70
- package/src/chores/chores.test.ts +4 -10
- package/src/chores/chores.ts +148 -392
- package/src/chores/digest.ts +8 -28
- package/src/chores/extension-update.ts +3 -8
- package/src/chores/fix-deps.ts +4 -18
- package/src/chores/index.ts +2 -2
- package/src/chores/probes.test.ts +7 -43
- package/src/chores/probes.ts +62 -167
- package/src/chores/prompt.ts +10 -34
- package/src/chores/stack.test.ts +6 -45
- package/src/chores/stack.ts +27 -118
- package/src/chores/verdict.test.ts +101 -80
- package/src/chores/verdict.ts +54 -99
- package/src/contracts/accounts.contract.ts +4 -19
- package/src/contracts/agent.contract.ts +7 -22
- package/src/contracts/agents.contract.ts +25 -71
- package/src/contracts/automations.contract.ts +14 -30
- package/src/contracts/capabilities.contract.ts +8 -35
- package/src/contracts/chores.contract.ts +4 -15
- package/src/contracts/endpoints.contract.ts +5 -22
- package/src/contracts/exit.contract.ts +7 -30
- package/src/contracts/extensions.contract.ts +8 -30
- package/src/contracts/git.contract.ts +25 -49
- package/src/contracts/host.contract.ts +9 -44
- package/src/contracts/intentic.contract.ts +1 -1
- package/src/contracts/logs.contract.ts +3 -13
- package/src/contracts/loops.contract.ts +9 -40
- package/src/contracts/personas.contract.ts +22 -30
- package/src/contracts/providers.contract.ts +4 -17
- package/src/contracts/runner.contract.ts +12 -39
- package/src/contracts/safety.contract.ts +5 -14
- package/src/contracts/secrets.contract.ts +4 -22
- package/src/contracts/sessions.contract.ts +1 -1
- package/src/contracts/settings.contract.ts +4 -10
- package/src/contracts/share.contract.ts +3 -9
- package/src/contracts/skills.contract.ts +4 -15
- package/src/contracts/system.contract.ts +26 -52
- package/src/contracts/usage.contract.ts +7 -21
- package/src/contracts/vpn.contract.ts +9 -16
- package/src/contracts/webext.contract.ts +9 -25
- package/src/contracts/workflows.contract.ts +34 -58
- package/src/contracts/workspace.contract.ts +19 -50
- package/src/events/agent-events.ts +345 -0
- package/src/events/cards.ts +286 -0
- package/src/{events.test.ts → events/resume.test.ts} +4 -19
- package/src/events/resume.ts +60 -0
- package/src/events/system-events.ts +139 -0
- package/src/events/transcript.ts +320 -0
- package/src/{conversation-ids.test.ts → ids/conversation-ids.test.ts} +25 -13
- package/src/ids/conversation-ids.ts +178 -0
- package/src/ids/hostnames.ts +129 -0
- package/src/ids/session-names.ts +29 -0
- package/src/ids/share-paths.ts +43 -0
- package/src/{tunnel-ids.test.ts → ids/tunnel-ids.test.ts} +1 -14
- package/src/ids/tunnel-ids.ts +29 -0
- package/src/index.ts +71 -88
- package/src/{agent-catalog.test.ts → models/agent-catalog.test.ts} +19 -93
- package/src/models/agent-catalog.ts +174 -0
- package/src/models/agent-runtimes.ts +201 -0
- package/src/models/capability-ledger.test.ts +84 -0
- package/src/{fast-tier.test.ts → models/fast-tier.test.ts} +7 -18
- package/src/models/fast-tier.ts +36 -0
- package/src/{model-order.test.ts → models/model-order.test.ts} +19 -40
- package/src/models/model-order.ts +163 -0
- package/src/models/model-pins.test.ts +87 -0
- package/src/models/model-pins.ts +57 -0
- package/src/models/model-roles.test.ts +38 -0
- package/src/models/model-roles.ts +180 -0
- package/src/{plan-pools.test.ts → models/plan-pools.test.ts} +6 -11
- package/src/models/plan-pools.ts +65 -0
- package/src/{prompt-complexity.test.ts → models/prompt-complexity.test.ts} +8 -60
- package/src/models/prompt-complexity.ts +215 -0
- package/src/{provider-specs.test.ts → models/provider-specs.test.ts} +18 -47
- package/src/models/provider-specs.ts +272 -0
- package/src/policy/approvals-execution.ts +58 -0
- package/src/{batch-runs.test.ts → policy/batch-runs.test.ts} +4 -20
- package/src/policy/batch-runs.ts +137 -0
- package/src/policy/capability-secrets.ts +5 -0
- package/src/{card-status.ts → policy/card-status.ts} +11 -26
- package/src/{command-classes.test.ts → policy/command-classes.test.ts} +11 -118
- package/src/policy/command-classes.ts +395 -0
- package/src/policy/command-run.ts +65 -0
- package/src/policy/control-scopes.ts +38 -0
- package/src/{credential-material.test.ts → policy/credential-material.test.ts} +4 -26
- package/src/policy/credential-material.ts +91 -0
- package/src/policy/needs-action.ts +5 -0
- package/src/policy/output-fields.ts +86 -0
- package/src/policy/overlay-lint.ts +100 -0
- package/src/{owner-ticket.test.ts → policy/owner-ticket.test.ts} +1 -1
- package/src/{owner-ticket.ts → policy/owner-ticket.ts} +9 -31
- package/src/policy/safety-policy.test.ts +84 -0
- package/src/policy/safety-policy.ts +142 -0
- package/src/policy/search-globs.ts +60 -0
- package/src/protocol/container-requirements.test.ts +72 -0
- package/src/protocol/container-requirements.ts +58 -0
- package/src/protocol/host-protocol.ts +29 -0
- package/src/protocol/ingress-contract.ts +103 -0
- package/src/{ingress-protocol.test.ts → protocol/ingress-protocol.test.ts} +25 -90
- package/src/protocol/ingress-protocol.ts +441 -0
- package/src/protocol/listener-protocol.ts +75 -0
- package/src/{peer-dial.test.ts → protocol/peer-dial.test.ts} +52 -1
- package/src/protocol/peer-dial.ts +207 -0
- package/src/{peer-mcp-server.ts → protocol/peer-mcp-server.ts} +16 -41
- package/src/protocol/request-id.ts +5 -0
- package/src/{routes.test.ts → protocol/routes.test.ts} +14 -22
- package/src/protocol/routes.ts +159 -0
- package/src/protocol/runner-protocol.ts +197 -0
- package/src/protocol/terminal-protocol.ts +13 -0
- package/src/protocol/webext-links.ts +50 -0
- package/src/protocol/webext-protocol.ts +24 -0
- package/src/schemas/activity.ts +22 -30
- package/src/schemas/agent.ts +130 -238
- package/src/schemas/agents.ts +165 -483
- package/src/schemas/approvals.ts +23 -71
- package/src/schemas/automations.ts +145 -249
- package/src/schemas/capabilities.ts +127 -414
- package/src/schemas/ci.ts +56 -108
- package/src/schemas/codebase-health.ts +7 -11
- package/src/schemas/devices.ts +98 -321
- package/src/schemas/engines.ts +16 -44
- package/src/schemas/environment.ts +41 -91
- package/src/schemas/exit.ts +24 -81
- package/src/schemas/extension-updates.ts +42 -87
- package/src/schemas/git-history.ts +30 -84
- package/src/schemas/git.ts +141 -256
- package/src/schemas/history.ts +14 -40
- package/src/schemas/hosts.ts +9 -15
- package/src/schemas/inventory.ts +8 -10
- package/src/schemas/issues.ts +66 -134
- package/src/schemas/logs.ts +15 -34
- package/src/schemas/loops.ts +46 -163
- package/src/schemas/maintenance.ts +47 -172
- package/src/schemas/panels.ts +20 -45
- package/src/schemas/personas.ts +85 -168
- package/src/schemas/plan-limits.ts +58 -197
- package/src/schemas/ports.ts +14 -32
- package/src/schemas/provider-oauth.ts +23 -76
- package/src/schemas/provider-subscriptions.ts +4 -13
- package/src/schemas/public.ts +4 -15
- package/src/schemas/push.ts +8 -36
- package/src/schemas/secrets.ts +20 -64
- package/src/schemas/settings.ts +177 -597
- package/src/schemas/share.ts +14 -32
- package/src/schemas/shared.ts +14 -13
- package/src/schemas/system.ts +46 -78
- package/src/schemas/terminal.ts +41 -120
- package/src/schemas/usage.ts +44 -233
- package/src/schemas/version-seam.test.ts +9 -26
- package/src/schemas/vpn.ts +27 -64
- package/src/schemas/webext.ts +22 -53
- package/src/schemas/workflows.ts +57 -183
- package/src/schemas/workspace-repos.ts +12 -24
- package/src/schemas/workspace-search.ts +17 -35
- package/src/schemas/workspace-setup.ts +4 -11
- package/src/schemas/workspace-tree.ts +32 -91
- package/src/state/arrival.ts +109 -0
- package/src/state/contract-lock.test.ts +17 -0
- package/src/state/contract-lock.ts +49 -0
- package/src/state/definition.ts +143 -0
- package/src/state/history-state.ts +103 -0
- package/src/{runtime-state.test.ts → state/runtime-state.test.ts} +3 -10
- package/src/state/runtime-state.ts +62 -0
- package/src/state/starter.ts +5 -0
- package/src/state/state-portability.ts +27 -0
- package/src/state/versions.ts +26 -0
- package/src/{workspace-state.test.ts → state/workspace-state.test.ts} +65 -173
- package/src/state/workspace-state.ts +669 -0
- package/src/{documents.test.ts → text/documents.test.ts} +1 -1
- package/src/text/documents.ts +42 -0
- package/src/text/embed.ts +132 -0
- package/src/text/mentions.ts +21 -0
- package/src/text/model-answer.ts +9 -0
- package/src/text/path-refs.ts +39 -0
- package/src/text/shell-regions.ts +224 -0
- package/src/{title.test.ts → text/title.test.ts} +13 -32
- package/src/text/title.ts +202 -0
- package/src/{transcript-fold.test.ts → text/transcript-fold.test.ts} +5 -83
- package/src/{transcript-fold.ts → text/transcript-fold.ts} +65 -170
- package/src/text/whisper.test.ts +19 -0
- package/src/text/whisper.ts +17 -0
- package/src/{workflow-faults.test.ts → text/workflow-faults.test.ts} +6 -24
- package/src/{workflow-faults.ts → text/workflow-faults.ts} +20 -60
- package/dist/agent-catalog.d.ts.map +0 -1
- package/dist/agent-catalog.js.map +0 -1
- package/dist/agent-runtimes.d.ts.map +0 -1
- package/dist/agent-runtimes.js.map +0 -1
- package/dist/approvals-execution.d.ts.map +0 -1
- package/dist/approvals-execution.js.map +0 -1
- package/dist/arrival.d.ts.map +0 -1
- package/dist/arrival.js.map +0 -1
- package/dist/batch-runs.d.ts.map +0 -1
- package/dist/batch-runs.js.map +0 -1
- package/dist/capability-env.d.ts.map +0 -1
- package/dist/capability-env.js.map +0 -1
- package/dist/capability-secrets.d.ts.map +0 -1
- package/dist/capability-secrets.js.map +0 -1
- package/dist/card-status.d.ts.map +0 -1
- package/dist/card-status.js.map +0 -1
- package/dist/command-classes.d.ts.map +0 -1
- package/dist/command-classes.js.map +0 -1
- package/dist/command-run.d.ts.map +0 -1
- package/dist/command-run.js.map +0 -1
- package/dist/contract-lock.d.ts.map +0 -1
- package/dist/contract-lock.js.map +0 -1
- package/dist/conversation-ids.d.ts +0 -4
- package/dist/conversation-ids.d.ts.map +0 -1
- package/dist/conversation-ids.js.map +0 -1
- package/dist/credential-material.d.ts.map +0 -1
- package/dist/credential-material.js.map +0 -1
- package/dist/definition.d.ts.map +0 -1
- package/dist/definition.js.map +0 -1
- package/dist/documents.d.ts.map +0 -1
- package/dist/documents.js.map +0 -1
- package/dist/embed.d.ts.map +0 -1
- package/dist/embed.js.map +0 -1
- package/dist/events.d.ts +0 -4336
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js +0 -725
- package/dist/events.js.map +0 -1
- package/dist/fast-tier.d.ts.map +0 -1
- package/dist/fast-tier.js.map +0 -1
- package/dist/history-state.d.ts.map +0 -1
- package/dist/history-state.js.map +0 -1
- package/dist/host-protocol.d.ts.map +0 -1
- package/dist/host-protocol.js.map +0 -1
- package/dist/hostnames.d.ts.map +0 -1
- package/dist/hostnames.js.map +0 -1
- package/dist/ingress-contract.d.ts.map +0 -1
- package/dist/ingress-contract.js.map +0 -1
- package/dist/ingress-protocol.d.ts.map +0 -1
- package/dist/ingress-protocol.js.map +0 -1
- package/dist/listener-protocol.d.ts.map +0 -1
- package/dist/listener-protocol.js.map +0 -1
- package/dist/mentions.d.ts.map +0 -1
- package/dist/mentions.js.map +0 -1
- package/dist/model-order.d.ts.map +0 -1
- package/dist/model-order.js.map +0 -1
- package/dist/model-pins.d.ts.map +0 -1
- package/dist/model-pins.js +0 -45
- package/dist/model-pins.js.map +0 -1
- package/dist/model-roles.d.ts.map +0 -1
- package/dist/model-roles.js.map +0 -1
- package/dist/needs-action.d.ts.map +0 -1
- package/dist/needs-action.js.map +0 -1
- package/dist/output-fields.d.ts.map +0 -1
- package/dist/output-fields.js.map +0 -1
- package/dist/overlay-lint.d.ts.map +0 -1
- package/dist/overlay-lint.js.map +0 -1
- package/dist/owner-ticket.d.ts.map +0 -1
- package/dist/owner-ticket.js.map +0 -1
- package/dist/path-refs.d.ts.map +0 -1
- package/dist/path-refs.js.map +0 -1
- package/dist/peer-dial.d.ts.map +0 -1
- package/dist/peer-dial.js.map +0 -1
- package/dist/peer-mcp-server.d.ts.map +0 -1
- package/dist/peer-mcp-server.js.map +0 -1
- package/dist/plan-pools.d.ts.map +0 -1
- package/dist/plan-pools.js.map +0 -1
- package/dist/prompt-complexity.d.ts.map +0 -1
- package/dist/prompt-complexity.js.map +0 -1
- package/dist/provider-specs.d.ts.map +0 -1
- package/dist/provider-specs.js.map +0 -1
- package/dist/request-id.d.ts.map +0 -1
- package/dist/request-id.js.map +0 -1
- package/dist/routes.d.ts.map +0 -1
- package/dist/routes.js.map +0 -1
- package/dist/runner-protocol.d.ts.map +0 -1
- package/dist/runner-protocol.js.map +0 -1
- package/dist/runtime-state.d.ts.map +0 -1
- package/dist/runtime-state.js.map +0 -1
- package/dist/safety-policy.d.ts.map +0 -1
- package/dist/safety-policy.js.map +0 -1
- package/dist/schemas/context.d.ts +0 -30
- package/dist/schemas/context.d.ts.map +0 -1
- package/dist/schemas/context.js +0 -34
- package/dist/schemas/context.js.map +0 -1
- package/dist/search-globs.d.ts.map +0 -1
- package/dist/search-globs.js.map +0 -1
- package/dist/session-names.d.ts.map +0 -1
- package/dist/session-names.js.map +0 -1
- package/dist/share-paths.d.ts.map +0 -1
- package/dist/share-paths.js.map +0 -1
- package/dist/shell-regions.d.ts.map +0 -1
- package/dist/shell-regions.js.map +0 -1
- package/dist/sse.d.ts.map +0 -1
- package/dist/sse.js.map +0 -1
- package/dist/starter.d.ts.map +0 -1
- package/dist/starter.js.map +0 -1
- package/dist/state-portability.d.ts.map +0 -1
- package/dist/state-portability.js.map +0 -1
- package/dist/terminal-protocol.d.ts.map +0 -1
- package/dist/terminal-protocol.js.map +0 -1
- package/dist/title.d.ts.map +0 -1
- package/dist/title.js.map +0 -1
- package/dist/transcript-fold.d.ts.map +0 -1
- package/dist/transcript-fold.js.map +0 -1
- package/dist/tunnel-ids.d.ts.map +0 -1
- package/dist/tunnel-ids.js.map +0 -1
- package/dist/versions.d.ts.map +0 -1
- package/dist/versions.js.map +0 -1
- package/dist/webext-links.d.ts.map +0 -1
- package/dist/webext-links.js.map +0 -1
- package/dist/webext-protocol.d.ts.map +0 -1
- package/dist/webext-protocol.js.map +0 -1
- package/dist/workflow-faults.d.ts.map +0 -1
- package/dist/workflow-faults.js.map +0 -1
- package/dist/workspace-state.d.ts.map +0 -1
- package/dist/workspace-state.js.map +0 -1
- package/src/agent-catalog.ts +0 -316
- package/src/agent-runtimes.ts +0 -419
- package/src/approvals-execution.ts +0 -96
- package/src/arrival.ts +0 -160
- package/src/batch-runs.ts +0 -188
- package/src/capability-ledger.test.ts +0 -140
- package/src/capability-secrets.ts +0 -20
- package/src/command-classes.ts +0 -617
- package/src/command-run.ts +0 -78
- package/src/contract-lock.test.ts +0 -23
- package/src/contract-lock.ts +0 -66
- package/src/conversation-ids.ts +0 -207
- package/src/credential-material.ts +0 -181
- package/src/definition.ts +0 -207
- package/src/documents.ts +0 -67
- package/src/embed.ts +0 -164
- package/src/events.ts +0 -1870
- package/src/fast-tier.ts +0 -72
- package/src/history-state.ts +0 -174
- package/src/host-protocol.ts +0 -36
- package/src/hostnames.ts +0 -180
- package/src/ingress-contract.ts +0 -157
- package/src/ingress-protocol.ts +0 -625
- package/src/listener-protocol.ts +0 -96
- package/src/mentions.ts +0 -25
- package/src/model-order.ts +0 -262
- package/src/model-pins.test.ts +0 -202
- package/src/model-pins.ts +0 -183
- package/src/model-roles.ts +0 -224
- package/src/needs-action.ts +0 -14
- package/src/output-fields.ts +0 -111
- package/src/overlay-lint.ts +0 -116
- package/src/path-refs.ts +0 -59
- package/src/peer-dial.ts +0 -163
- package/src/plan-pools.ts +0 -92
- package/src/prompt-complexity.ts +0 -334
- package/src/provider-specs.ts +0 -432
- package/src/request-id.ts +0 -41
- package/src/routes.ts +0 -219
- package/src/runner-protocol.ts +0 -239
- package/src/runtime-state.ts +0 -140
- package/src/safety-policy.test.ts +0 -88
- package/src/safety-policy.ts +0 -258
- package/src/schemas/context.ts +0 -87
- package/src/search-globs.ts +0 -76
- package/src/session-names.ts +0 -44
- package/src/share-paths.ts +0 -68
- package/src/shell-regions.ts +0 -289
- package/src/starter.ts +0 -13
- package/src/state-portability.ts +0 -56
- package/src/terminal-protocol.ts +0 -16
- package/src/title.ts +0 -267
- package/src/tunnel-ids.ts +0 -57
- package/src/versions.ts +0 -48
- package/src/webext-links.ts +0 -90
- package/src/webext-protocol.ts +0 -27
- package/src/workspace-state.ts +0 -1096
- /package/dist/{hostnames.d.ts → ids/hostnames.d.ts} +0 -0
- /package/dist/{hostnames.js → ids/hostnames.js} +0 -0
- /package/dist/{session-names.d.ts → ids/session-names.d.ts} +0 -0
- /package/dist/{session-names.js → ids/session-names.js} +0 -0
- /package/dist/{share-paths.d.ts → ids/share-paths.d.ts} +0 -0
- /package/dist/{share-paths.js → ids/share-paths.js} +0 -0
- /package/dist/{agent-catalog.js → models/agent-catalog.js} +0 -0
- /package/dist/{agent-runtimes.d.ts → models/agent-runtimes.d.ts} +0 -0
- /package/dist/{agent-runtimes.js → models/agent-runtimes.js} +0 -0
- /package/dist/{fast-tier.js → models/fast-tier.js} +0 -0
- /package/dist/{model-order.d.ts → models/model-order.d.ts} +0 -0
- /package/dist/{model-order.js → models/model-order.js} +0 -0
- /package/dist/{plan-pools.js → models/plan-pools.js} +0 -0
- /package/dist/{prompt-complexity.d.ts → models/prompt-complexity.d.ts} +0 -0
- /package/dist/{prompt-complexity.js → models/prompt-complexity.js} +0 -0
- /package/dist/{provider-specs.d.ts → models/provider-specs.d.ts} +0 -0
- /package/dist/{provider-specs.js → models/provider-specs.js} +0 -0
- /package/dist/{approvals-execution.d.ts → policy/approvals-execution.d.ts} +0 -0
- /package/dist/{approvals-execution.js → policy/approvals-execution.js} +0 -0
- /package/dist/{capability-env.d.ts → policy/capability-env.d.ts} +0 -0
- /package/dist/{capability-env.js → policy/capability-env.js} +0 -0
- /package/dist/{capability-secrets.d.ts → policy/capability-secrets.d.ts} +0 -0
- /package/dist/{capability-secrets.js → policy/capability-secrets.js} +0 -0
- /package/dist/{command-run.js → policy/command-run.js} +0 -0
- /package/dist/{credential-material.d.ts → policy/credential-material.d.ts} +0 -0
- /package/dist/{credential-material.js → policy/credential-material.js} +0 -0
- /package/dist/{needs-action.d.ts → policy/needs-action.d.ts} +0 -0
- /package/dist/{needs-action.js → policy/needs-action.js} +0 -0
- /package/dist/{output-fields.d.ts → policy/output-fields.d.ts} +0 -0
- /package/dist/{output-fields.js → policy/output-fields.js} +0 -0
- /package/dist/{overlay-lint.d.ts → policy/overlay-lint.d.ts} +0 -0
- /package/dist/{overlay-lint.js → policy/overlay-lint.js} +0 -0
- /package/dist/{owner-ticket.d.ts → policy/owner-ticket.d.ts} +0 -0
- /package/dist/{search-globs.d.ts → policy/search-globs.d.ts} +0 -0
- /package/dist/{search-globs.js → policy/search-globs.js} +0 -0
- /package/dist/{ingress-contract.d.ts → protocol/ingress-contract.d.ts} +0 -0
- /package/dist/{ingress-protocol.d.ts → protocol/ingress-protocol.d.ts} +0 -0
- /package/dist/{ingress-protocol.js → protocol/ingress-protocol.js} +0 -0
- /package/dist/{listener-protocol.d.ts → protocol/listener-protocol.d.ts} +0 -0
- /package/dist/{peer-mcp-server.d.ts → protocol/peer-mcp-server.d.ts} +0 -0
- /package/dist/{peer-mcp-server.js → protocol/peer-mcp-server.js} +0 -0
- /package/dist/{request-id.d.ts → protocol/request-id.d.ts} +0 -0
- /package/dist/{request-id.js → protocol/request-id.js} +0 -0
- /package/dist/{routes.d.ts → protocol/routes.d.ts} +0 -0
- /package/dist/{routes.js → protocol/routes.js} +0 -0
- /package/dist/{sse.d.ts → protocol/sse.d.ts} +0 -0
- /package/dist/{sse.js → protocol/sse.js} +0 -0
- /package/dist/{terminal-protocol.js → protocol/terminal-protocol.js} +0 -0
- /package/dist/{webext-links.d.ts → protocol/webext-links.d.ts} +0 -0
- /package/dist/{webext-links.js → protocol/webext-links.js} +0 -0
- /package/dist/{arrival.d.ts → state/arrival.d.ts} +0 -0
- /package/dist/{contract-lock.d.ts → state/contract-lock.d.ts} +0 -0
- /package/dist/{history-state.d.ts → state/history-state.d.ts} +0 -0
- /package/dist/{runtime-state.d.ts → state/runtime-state.d.ts} +0 -0
- /package/dist/{runtime-state.js → state/runtime-state.js} +0 -0
- /package/dist/{starter.d.ts → state/starter.d.ts} +0 -0
- /package/dist/{starter.js → state/starter.js} +0 -0
- /package/dist/{state-portability.d.ts → state/state-portability.d.ts} +0 -0
- /package/dist/{state-portability.js → state/state-portability.js} +0 -0
- /package/dist/{versions.d.ts → state/versions.d.ts} +0 -0
- /package/dist/{versions.js → state/versions.js} +0 -0
- /package/dist/{embed.d.ts → text/embed.d.ts} +0 -0
- /package/dist/{embed.js → text/embed.js} +0 -0
- /package/dist/{mentions.d.ts → text/mentions.d.ts} +0 -0
- /package/dist/{mentions.js → text/mentions.js} +0 -0
- /package/dist/{path-refs.d.ts → text/path-refs.d.ts} +0 -0
- /package/dist/{path-refs.js → text/path-refs.js} +0 -0
- /package/dist/{shell-regions.js → text/shell-regions.js} +0 -0
- /package/dist/{title.d.ts → text/title.d.ts} +0 -0
- /package/dist/{title.js → text/title.js} +0 -0
- /package/src/{hostnames.test.ts → ids/hostnames.test.ts} +0 -0
- /package/src/{share-paths.test.ts → ids/share-paths.test.ts} +0 -0
- /package/src/{capability-env.ts → policy/capability-env.ts} +0 -0
- /package/src/{overlay-lint.test.ts → policy/overlay-lint.test.ts} +0 -0
- /package/src/{search-globs.test.ts → policy/search-globs.test.ts} +0 -0
- /package/src/{ingress-contract.test.ts → protocol/ingress-contract.test.ts} +0 -0
- /package/src/{peer-mcp-server.test.ts → protocol/peer-mcp-server.test.ts} +0 -0
- /package/src/{sse.ts → protocol/sse.ts} +0 -0
- /package/src/{versions.test.ts → state/versions.test.ts} +0 -0
- /package/src/{embed.test.ts → text/embed.test.ts} +0 -0
- /package/src/{mentions.test.ts → text/mentions.test.ts} +0 -0
- /package/src/{path-refs.test.ts → text/path-refs.test.ts} +0 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AgentProviderSchema } from "../schemas/agent.js";
|
|
3
|
+
import { CredentialGateKindSchema, CredentialGateScopeSchema, CredentialLaneSchema } from "../schemas/secrets.js";
|
|
4
|
+
|
|
5
|
+
// Cards a turn raises to ask the person something mid-turn; each pauses the turn until `POST /agent/reply` answers it.
|
|
6
|
+
// Shapes shared by the daemon that raises them, the browser that draws them, and the transcript that records them
|
|
7
|
+
// (transcript.ts).
|
|
8
|
+
|
|
9
|
+
// One interactive question the agent asks via the `ask` tool (mirrors AskUserQuestion's input shape).
|
|
10
|
+
export const AskOptionSchema = z.object({
|
|
11
|
+
label: z.string().describe("The choice, in a few words."),
|
|
12
|
+
description: z.string().describe("What picking it means."),
|
|
13
|
+
preview: z.string().optional().describe("Something to look at while deciding: a mock-up, a snippet, a layout."),
|
|
14
|
+
});
|
|
15
|
+
export type AskOption = z.infer<typeof AskOptionSchema>;
|
|
16
|
+
|
|
17
|
+
export const AskQuestionSchema = z.object({
|
|
18
|
+
question: z.string().describe("What the agent is asking."),
|
|
19
|
+
header: z.string().describe("A short label for the question."),
|
|
20
|
+
multiSelect: z.boolean().describe("Whether more than one answer can be picked."),
|
|
21
|
+
options: z.array(AskOptionSchema).describe("The choices offered. A free-text answer is always possible as well."),
|
|
22
|
+
});
|
|
23
|
+
export type AskQuestion = z.infer<typeof AskQuestionSchema>;
|
|
24
|
+
|
|
25
|
+
// The command a card is holding, as data rather than prose. `spans` is carried from the classifier's own match (never
|
|
26
|
+
// re-derived), offset into `text` after truncation.
|
|
27
|
+
export const ProgramAskSchema = z.object({
|
|
28
|
+
text: z.string().describe("What would run."),
|
|
29
|
+
language: z.enum(["bash", "javascript"]).describe("Which of the two backends it is written for, named as the grammar that colours it."),
|
|
30
|
+
truncated: z
|
|
31
|
+
.boolean()
|
|
32
|
+
.describe(
|
|
33
|
+
"Whether this is an excerpt of a longer program, so the card can say so instead of ending mid-word. An excerpt always carries the flagged fragment: the beginning, then a window around the fragment, with any skipped middle written into the text as a bracketed count.",
|
|
34
|
+
),
|
|
35
|
+
spans: z
|
|
36
|
+
.array(z.object({ start: z.number().int().nonnegative(), end: z.number().int().nonnegative() }))
|
|
37
|
+
.describe(
|
|
38
|
+
"Which fragments of the text the pattern match fired on: every matched class's, or, under the hard rule, only the class the title names. Offsets into text, in order, never overlapping.",
|
|
39
|
+
),
|
|
40
|
+
});
|
|
41
|
+
export type ProgramAsk = z.infer<typeof ProgramAskSchema>;
|
|
42
|
+
|
|
43
|
+
// One per-tool permission prompt (SDK's canUseTool, surfaced as a card); the daemon passes the bridge's own rendered
|
|
44
|
+
// strings through unchanged. `alwaysLabel` is present only when the SDK offered a rule to persist.
|
|
45
|
+
export const PermissionAskSchema = z.object({
|
|
46
|
+
toolName: z.string().describe("Which tool it wants to use."),
|
|
47
|
+
// The whole prompt sentence, exactly as the runtime words it, when the bridge rendered one.
|
|
48
|
+
title: z.string().optional().describe("The whole question, as a sentence, exactly as the runtime words it."),
|
|
49
|
+
// Short noun phrase for the allow button ("Read file").
|
|
50
|
+
displayName: z.string().optional().describe("A short phrase for the button, such as read file."),
|
|
51
|
+
description: z.string().optional().describe("More about what it is asking for."),
|
|
52
|
+
// Why the prompt fired ('rule' | 'mode' | 'classifier' | …), shown as the card's muted subline.
|
|
53
|
+
reason: z.string().optional().describe("Why it is asking at all: a rule, the current mode, something that looked risky."),
|
|
54
|
+
// The file the request is about, when it is about one, workspace-root-relative.
|
|
55
|
+
path: z.string().optional().describe("Which file it concerns, when it concerns one."),
|
|
56
|
+
alwaysLabel: z
|
|
57
|
+
.string()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe(
|
|
60
|
+
"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.",
|
|
61
|
+
),
|
|
62
|
+
program: ProgramAskSchema.optional().describe(
|
|
63
|
+
"The program this card is holding, when the card is about one. Present on a command gate's card and absent on every other permission ask.",
|
|
64
|
+
),
|
|
65
|
+
// The judge's own sentence, present only when the title can't say it; never written by the agent being gated.
|
|
66
|
+
explain: z
|
|
67
|
+
.string()
|
|
68
|
+
.optional()
|
|
69
|
+
.describe(
|
|
70
|
+
"One plain sentence saying what the program does and why it is being asked about, where the title says something else. Written by the judge that read your safety policy, never by the agent being gated.",
|
|
71
|
+
),
|
|
72
|
+
});
|
|
73
|
+
export type PermissionAsk = z.infer<typeof PermissionAskSchema>;
|
|
74
|
+
|
|
75
|
+
// One missing capability asked for; `card`/`name` are resolved by the daemon from the catalog it validates against. The
|
|
76
|
+
// model contributes only `why`, so the card can't misrepresent what's being connected.
|
|
77
|
+
export const CapabilityOfferSchema = z.object({
|
|
78
|
+
// The catalog card being asked for, and how the catalog itself titles it ("Notion", "GitHub", "Docker").
|
|
79
|
+
card: z.string().describe("Which connection is being asked for."),
|
|
80
|
+
name: z.string().describe("What it is called, as the catalogue titles it rather than as the agent named it."),
|
|
81
|
+
// The agent's one-line case for connecting it, the only prose on the card that is the model's.
|
|
82
|
+
why: z.string().optional().describe("The agent's case for connecting it, and the only words on this card that are the agent's."),
|
|
83
|
+
});
|
|
84
|
+
export type CapabilityOffer = z.infer<typeof CapabilityOfferSchema>;
|
|
85
|
+
|
|
86
|
+
// One outbound USDC payment offered; every number is the daemon's own arithmetic over the endpoint's challenge and the
|
|
87
|
+
// wallet's ledger. The model contributes only `why`, so the price can't be misquoted.
|
|
88
|
+
export const PaymentOfferSchema = z.object({
|
|
89
|
+
// The paid resource, as the endpoint's challenge stated it.
|
|
90
|
+
url: z.string().describe("What is being paid for."),
|
|
91
|
+
description: z.string().optional().describe("What the endpoint says it is."),
|
|
92
|
+
// Where the money goes, verbatim off the challenge: recipient address, CAIP-2 network, token contract.
|
|
93
|
+
payTo: z.string().describe("Where the money goes, taken verbatim from the endpoint's own demand."),
|
|
94
|
+
network: z.string().describe("On which network."),
|
|
95
|
+
asset: z.string().describe("In which token."),
|
|
96
|
+
// The token's display name ("USDC"), dollar-pegged, so every amount below reads as USD.
|
|
97
|
+
assetName: z.string().describe("That token's name. It is pegged to the dollar, which is what lets every amount here read as dollars."),
|
|
98
|
+
// The exact price; the x402 exact scheme has no ranges, so this is the whole spend, not a ceiling.
|
|
99
|
+
amountUsd: z.string().describe("The exact price. Not a ceiling: this scheme has no ranges, so this is the whole spend."),
|
|
100
|
+
// The wallet's meter as the daemon's ledger states it, what "spent today / cap" renders from.
|
|
101
|
+
spentTodayUsd: z.string().describe("What has already gone out today."),
|
|
102
|
+
dailyCapUsd: z.string().describe("What may go out in a day."),
|
|
103
|
+
// The agent's one-line case for paying, the only prose on the card that is the model's.
|
|
104
|
+
why: z.string().optional().describe("The agent's case for paying, and the only words on this card that are the agent's."),
|
|
105
|
+
});
|
|
106
|
+
export type PaymentOffer = z.infer<typeof PaymentOfferSchema>;
|
|
107
|
+
|
|
108
|
+
// One gated credential asked for; every field but `why` is the daemon's own, off the gate policy and the exit that
|
|
109
|
+
// would spend it. `approvers` are shown since the card addresses a named list, not the owner.
|
|
110
|
+
export const CredentialOfferSchema = z.object({
|
|
111
|
+
// The gate's subject: a secret's reference name (`DATABASE_URL`) or a capability id (`reddit`).
|
|
112
|
+
subject: z.string().describe("Which credential is being asked for."),
|
|
113
|
+
kind: CredentialGateKindSchema,
|
|
114
|
+
lane: CredentialLaneSchema,
|
|
115
|
+
// Where it would go, in the reader's terms; reference-form, never a value, so it can be shown safely.
|
|
116
|
+
detail: z
|
|
117
|
+
.string()
|
|
118
|
+
.optional()
|
|
119
|
+
.describe("Where it would go: the start of the command, the site, or what is being mounted. Never a value: the command still reads as a reference at this point."),
|
|
120
|
+
// The agent's one-line case, the only prose on the card that is the model's.
|
|
121
|
+
why: z.string().optional().describe("The agent's case for using it, and the only words on this card that are the agent's."),
|
|
122
|
+
approvers: z.array(z.string()).describe("Who may release it. A click from anyone else is refused and leaves the card standing."),
|
|
123
|
+
scope: CredentialGateScopeSchema,
|
|
124
|
+
});
|
|
125
|
+
export type CredentialOffer = z.infer<typeof CredentialOfferSchema>;
|
|
126
|
+
|
|
127
|
+
// One provider-advertised slash command (ACP's available_commands, or a Claude Code session's supportedCommands).
|
|
128
|
+
// `hint` is the argument placeholder the popover shows after the name.
|
|
129
|
+
export const AgentCommandSchema = z.object({
|
|
130
|
+
name: z.string().describe("What to type, without the leading slash."),
|
|
131
|
+
description: z.string().describe("What it does."),
|
|
132
|
+
hint: z.string().optional().describe("What its argument should look like, shown after the name."),
|
|
133
|
+
});
|
|
134
|
+
export type AgentCommand = z.infer<typeof AgentCommandSchema>;
|
|
135
|
+
|
|
136
|
+
// GET /agent/commands: which provider's last-published list to read; absent means claude, matching AgentTurn.
|
|
137
|
+
export const AgentCommandsQuerySchema = z.object({
|
|
138
|
+
agent: AgentProviderSchema.optional().describe("Whose commands to read. Leave it out for Claude."),
|
|
139
|
+
});
|
|
140
|
+
export const AgentCommandsSchema = z.object({
|
|
141
|
+
commands: z.array(AgentCommandSchema).describe("The shortcut commands, as the provider last published them."),
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// One TodoWrite/Task checklist item, surfaced live so the UI shows the agent's plan-of-work.
|
|
145
|
+
export const TodoItemSchema = z.object({
|
|
146
|
+
content: z.string().describe("The item, as the agent wrote it."),
|
|
147
|
+
status: z.enum(["pending", "in_progress", "completed"]).describe("Where it is."),
|
|
148
|
+
activeForm: z
|
|
149
|
+
.string()
|
|
150
|
+
.optional()
|
|
151
|
+
.describe("How to phrase it while it is happening, so a screen can say what the agent is doing rather than what it plans to do."),
|
|
152
|
+
});
|
|
153
|
+
export type TodoItem = z.infer<typeof TodoItemSchema>;
|
|
154
|
+
|
|
155
|
+
// Context-window fill for a conversation: tokens the latest request sent vs. the model's window, so the UI can warn
|
|
156
|
+
// near auto-compaction. Per-conversation, unlike the account-wide usage.
|
|
157
|
+
export const ContextUsageSchema = z.object({
|
|
158
|
+
tokens: z.number().describe("How much the latest request sent, all told."),
|
|
159
|
+
contextWindow: z.number().describe("How much the model can hold. The gap between these two is how close the conversation is to being compacted."),
|
|
160
|
+
});
|
|
161
|
+
export type ContextUsage = z.infer<typeof ContextUsageSchema>;
|
|
162
|
+
|
|
163
|
+
// ACP-aligned tool taxonomy (Agent Client Protocol's ToolKind, verbatim): what a tool call does, driving the card icon
|
|
164
|
+
// regardless of which backend named the tool.
|
|
165
|
+
export const ToolKindSchema = z.enum(["read", "edit", "delete", "move", "search", "execute", "think", "fetch", "other"]);
|
|
166
|
+
export type ToolKind = z.infer<typeof ToolKindSchema>;
|
|
167
|
+
|
|
168
|
+
export const ToolCallStatusSchema = z.enum(["pending", "in_progress", "completed", "failed"]);
|
|
169
|
+
export type ToolCallStatus = z.infer<typeof ToolCallStatusSchema>;
|
|
170
|
+
|
|
171
|
+
// A file a tool call touches. Workspace-root-relative, forward-slash; adapters normalize from the turn's cwd. `line` is
|
|
172
|
+
// 1-based.
|
|
173
|
+
export const ToolCallLocationSchema = z.object({
|
|
174
|
+
path: z.string().describe("The file, as a workspace path, whatever directory the tool was run from."),
|
|
175
|
+
line: z.number().optional().describe("Which line, counting from one."),
|
|
176
|
+
});
|
|
177
|
+
export type ToolCallLocation = z.infer<typeof ToolCallLocationSchema>;
|
|
178
|
+
|
|
179
|
+
// Structured tool output (ACP's ToolCallContent, verbatim); `diff` is hunk-level for edits, whole-file for Write.
|
|
180
|
+
// `image` is a workspace path, not bytes, so it stays openable without bloating the stream.
|
|
181
|
+
export const ToolCallContentSchema = z.discriminatedUnion("type", [
|
|
182
|
+
z.object({
|
|
183
|
+
type: z.literal("text").describe("Plain output."),
|
|
184
|
+
text: z.string().describe("What the tool said."),
|
|
185
|
+
}),
|
|
186
|
+
z.object({
|
|
187
|
+
type: z.literal("diff").describe("A change to a file."),
|
|
188
|
+
path: z.string().describe("Which file, as a workspace path."),
|
|
189
|
+
oldText: z.string().optional().describe("What was there. Absent for a new file, or where the previous contents are not known."),
|
|
190
|
+
newText: z.string().describe("What is there now."),
|
|
191
|
+
truncated: z.boolean().optional().describe("One of the two sides was too large to send whole."),
|
|
192
|
+
}),
|
|
193
|
+
z.object({
|
|
194
|
+
type: z.literal("image").describe("A picture the tool produced."),
|
|
195
|
+
path: z
|
|
196
|
+
.string()
|
|
197
|
+
.describe(
|
|
198
|
+
"Where it is, as a workspace path. A path rather than the bytes, because the workspace already serves it, sending it inline would bloat every stored record, and this way the picture stays openable afterwards.",
|
|
199
|
+
),
|
|
200
|
+
}),
|
|
201
|
+
]);
|
|
202
|
+
export type ToolCallContent = z.infer<typeof ToolCallContentSchema>;
|
|
203
|
+
|
|
204
|
+
// The document a parked card is asking about, carried by value: the bytes are already in hand, and a restored
|
|
205
|
+
// transcript has no workspace to fetch a path from. `path` rides along for an overflow.
|
|
206
|
+
export const CardDocumentSchema = z.object({
|
|
207
|
+
path: z.string().describe("Where it lives, as a workspace path."),
|
|
208
|
+
title: z.string().describe("What it is called: its opening heading, or its file name."),
|
|
209
|
+
markdown: z.string().describe("The document itself."),
|
|
210
|
+
truncated: z.boolean().optional().describe("It was clipped at the wire cap; the file on disk has more."),
|
|
211
|
+
plan: z.boolean().optional().describe("It is one of the CLI's plan files, written to be approved rather than merely read."),
|
|
212
|
+
});
|
|
213
|
+
export type CardDocument = z.infer<typeof CardDocumentSchema>;
|
|
214
|
+
|
|
215
|
+
// One card's fields, spelled once: the raising frame, the parked-card journal entry, and the transcript row all share
|
|
216
|
+
// this shape rather than declaring it three times.
|
|
217
|
+
const REQUEST_ID = z.string().describe("What to send back when you answer.");
|
|
218
|
+
export const planCard = {
|
|
219
|
+
requestId: REQUEST_ID,
|
|
220
|
+
text: z.string().describe("The plan itself."),
|
|
221
|
+
// Present when the plan prose points at a document; absent when the text already is the whole plan.
|
|
222
|
+
document: CardDocumentSchema.optional().describe("The write-up this plan refers to, when the plan itself is a pointer to one."),
|
|
223
|
+
};
|
|
224
|
+
export const questionCard = {
|
|
225
|
+
requestId: REQUEST_ID,
|
|
226
|
+
questions: z.array(AskQuestionSchema).describe("What it wants to know."),
|
|
227
|
+
document: CardDocumentSchema.optional().describe("The document this turn wrote and is asking about, so the choice can be read beside it."),
|
|
228
|
+
};
|
|
229
|
+
export const permissionCard = { requestId: REQUEST_ID };
|
|
230
|
+
// The agent's browser is parked on something it can't clear itself (captcha, password, phone check). `session` names it
|
|
231
|
+
// on /browsers; `account` says whose login is stuck.
|
|
232
|
+
export const browserHelpCard = {
|
|
233
|
+
requestId: z.string(),
|
|
234
|
+
session: z.string(),
|
|
235
|
+
account: z.string(),
|
|
236
|
+
message: z.string(),
|
|
237
|
+
};
|
|
238
|
+
// The agent's terminal is sitting at a prompt it can't answer (OTP, security-key touch, confirm). `session` names it on
|
|
239
|
+
// the terminal panel, same division as the browser card.
|
|
240
|
+
export const terminalHelpCard = {
|
|
241
|
+
requestId: z.string(),
|
|
242
|
+
session: z.string(),
|
|
243
|
+
message: z.string(),
|
|
244
|
+
};
|
|
245
|
+
export const capabilityOfferCard = { requestId: z.string(), offer: CapabilityOfferSchema };
|
|
246
|
+
export const paymentOfferCard = { requestId: z.string(), offer: PaymentOfferSchema };
|
|
247
|
+
export const credentialOfferCard = { requestId: z.string(), offer: CredentialOfferSchema };
|
|
248
|
+
|
|
249
|
+
// How an accepted capability offer ended, shared by the frame that reports it and the record that keeps it, so a
|
|
250
|
+
// reopened receipt matches the live card.
|
|
251
|
+
export const CapabilityOutcomeSchema = z.object({
|
|
252
|
+
outcome: z.enum(["connected", "unfinished"]),
|
|
253
|
+
id: z.string().optional(),
|
|
254
|
+
});
|
|
255
|
+
export type CapabilityOutcome = z.infer<typeof CapabilityOutcomeSchema>;
|
|
256
|
+
export const PaymentReceiptSchema = z.object({
|
|
257
|
+
outcome: z.enum(["paid", "failed"]),
|
|
258
|
+
amountUsd: z.string(),
|
|
259
|
+
transaction: z.string().optional(),
|
|
260
|
+
network: z.string().optional(),
|
|
261
|
+
});
|
|
262
|
+
export type PaymentReceipt = z.infer<typeof PaymentReceiptSchema>;
|
|
263
|
+
// Who released a gated credential, or that someone refused it. `released` carries the approver's verified identity, not
|
|
264
|
+
// what the click claimed.
|
|
265
|
+
export const CredentialReceiptSchema = z.object({
|
|
266
|
+
outcome: z.enum(["released", "refused"]),
|
|
267
|
+
approvedBy: z.string().optional(),
|
|
268
|
+
});
|
|
269
|
+
export type CredentialReceipt = z.infer<typeof CredentialReceiptSchema>;
|
|
270
|
+
|
|
271
|
+
// The three cards a turn journal can restore verbatim after a daemon restart. `browser_help`/`terminal_help` are
|
|
272
|
+
// excluded: their Chromium/waiting command dies with the container, so those can only be reported, not restored.
|
|
273
|
+
export const PlanCardSchema = z.object({
|
|
274
|
+
kind: z.literal("plan").describe("The agent has written a plan and is waiting for a yes."),
|
|
275
|
+
...planCard,
|
|
276
|
+
});
|
|
277
|
+
export const QuestionCardSchema = z.object({
|
|
278
|
+
kind: z.literal("question").describe("The agent has asked you something and is waiting."),
|
|
279
|
+
...questionCard,
|
|
280
|
+
});
|
|
281
|
+
export const PermissionCardSchema = PermissionAskSchema.extend({
|
|
282
|
+
kind: z.literal("permission").describe("The agent wants to use a tool it needs permission for."),
|
|
283
|
+
...permissionCard,
|
|
284
|
+
});
|
|
285
|
+
export const ParkedCardSchema = z.discriminatedUnion("kind", [PlanCardSchema, QuestionCardSchema, PermissionCardSchema]);
|
|
286
|
+
export type ParkedCard = z.infer<typeof ParkedCardSchema>;
|
|
@@ -1,54 +1,40 @@
|
|
|
1
1
|
import { expect, test } from "vitest";
|
|
2
|
-
import { RESUME_NOTES, resumeDisclosure, withResumeNote, withoutResumeNote } from "./
|
|
2
|
+
import { RESUME_NOTES, resumeDisclosure, withResumeNote, withoutResumeNote } from "./resume.js";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* mismatch between the two halves fails silently and cosmetically: a paragraph of machine prose rendered as
|
|
7
|
-
* something the user typed, which is exactly the kind of drift that stays broken. */
|
|
4
|
+
// Wrapping then unwrapping a resume note must return the exact original prompt; a mismatch leaks machine narration into
|
|
5
|
+
// the user's own words on screen.
|
|
8
6
|
test("a resume note round-trips back to the user's own words", () => {
|
|
9
7
|
for (const note of Object.values(RESUME_NOTES)) {
|
|
10
8
|
expect(withoutResumeNote(withResumeNote("ship the parser", note))).toBe("ship the parser");
|
|
11
9
|
}
|
|
12
10
|
});
|
|
13
11
|
|
|
14
|
-
//
|
|
12
|
+
// The prompt itself contains blank lines, to prove only the note's own separator is stripped.
|
|
15
13
|
test("stripping takes the note and nothing of the prompt", () => {
|
|
16
14
|
const prompt = "step one\n\nstep two\n\nstep three";
|
|
17
15
|
expect(withoutResumeNote(withResumeNote(prompt, RESUME_NOTES.outage))).toBe(prompt);
|
|
18
16
|
});
|
|
19
17
|
|
|
20
|
-
// An ordinary prompt passes through untouched, so every attach head can be handed through it.
|
|
21
18
|
test("a prompt that is not a resume is left alone", () => {
|
|
22
19
|
expect(withoutResumeNote("just a question")).toBe("just a question");
|
|
23
20
|
expect(withoutResumeNote("")).toBe("");
|
|
24
21
|
});
|
|
25
22
|
|
|
26
|
-
// Wrapping is idempotent: a resume that dies the same way again is re-recorded from its own input, and a second
|
|
27
|
-
// note stacked on the first would grow the prompt on every attempt.
|
|
28
23
|
test("wrapping an already-wrapped prompt adds nothing", () => {
|
|
29
24
|
const once = withResumeNote("retry me", RESUME_NOTES.restart);
|
|
30
25
|
expect(withResumeNote(once, RESUME_NOTES.restart)).toBe(once);
|
|
31
26
|
expect(withResumeNote(once, RESUME_NOTES.auth)).toBe(once);
|
|
32
27
|
});
|
|
33
28
|
|
|
34
|
-
/* THE OTHER HALF OF THE ROUND TRIP: taking the note off is what keeps it out of the user's words, and this is
|
|
35
|
-
* what puts it back on screen as something that happened instead. Every reader of a stored prompt asks the same
|
|
36
|
-
* question here, so a note nobody could disclose is a note that silently reads as the user's own sentence. */
|
|
37
29
|
test("a re-run discloses as a notice, and the answered case as a note on the message", () => {
|
|
38
30
|
for (const reason of ["auth", "outage", "restart"] as const) {
|
|
39
31
|
const disclosure = resumeDisclosure(withResumeNote("ship the parser", RESUME_NOTES[reason]));
|
|
40
32
|
expect(disclosure?.kind).toBe("notice");
|
|
41
33
|
}
|
|
42
|
-
// The answer is new words the user really did type, so nothing is dropped: the interruption rides them.
|
|
43
34
|
const answered = resumeDisclosure(withResumeNote("option two", RESUME_NOTES.answered));
|
|
44
35
|
expect(answered).toEqual({ kind: "note", note: { title: expect.any(String), text: RESUME_NOTES.answered } });
|
|
45
36
|
});
|
|
46
37
|
|
|
47
|
-
/* THE THREE SPENT-ALLOWANCE NOTES OPEN ON THE SAME SENTENCE, and both readers of a note resolve it by PREFIX
|
|
48
|
-
* (withoutResumeNote, resumeDisclosure). So one of them growing into a prefix of another is a silent swap rather
|
|
49
|
-
* than a failure: a press that moved the turn onto an account with headroom would report itself as an ordinary
|
|
50
|
-
* re-run, and the reader would be told nothing about the one fact that explains why this press worked where the
|
|
51
|
-
* last one bounced. Each resolves to its own line, or this is broken. */
|
|
52
38
|
test("the spent-allowance notes do not disclose as each other", () => {
|
|
53
39
|
const lines = (["limit", "switched", "refused"] as const).map((reason) => {
|
|
54
40
|
const disclosure = resumeDisclosure(withResumeNote("ship the parser", RESUME_NOTES[reason]));
|
|
@@ -58,7 +44,6 @@ test("the spent-allowance notes do not disclose as each other", () => {
|
|
|
58
44
|
expect(new Set(lines).size).toBe(3);
|
|
59
45
|
});
|
|
60
46
|
|
|
61
|
-
// Same guarantee withoutResumeNote gives: an ordinary prompt is not a resume of anything.
|
|
62
47
|
test("a prompt that is not a resume discloses nothing", () => {
|
|
63
48
|
expect(resumeDisclosure("just a question")).toBeUndefined();
|
|
64
49
|
expect(resumeDisclosure("")).toBeUndefined();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { TurnNote } from "./transcript.js";
|
|
2
|
+
|
|
3
|
+
// What a resumed turn's prompt says happened; lives on the wire since the client must recognise it too.
|
|
4
|
+
|
|
5
|
+
// The shared prefix lets a joining window reuse the existing bubble, not render the note as a new message.
|
|
6
|
+
// What follows the note is the original request repeated; `answered` carries the user's actual answer instead.
|
|
7
|
+
const REPEATED =
|
|
8
|
+
"The interrupted request is repeated below, where part of it was already completed in this session, continue from that point instead of starting over.";
|
|
9
|
+
export const RESUME_NOTES = {
|
|
10
|
+
auth: `The Claude credential that interrupted this conversation has been renewed, and this turn resumed automatically. ${REPEATED}`,
|
|
11
|
+
outage: `The model provider was briefly unavailable and interrupted this conversation; this turn resumed automatically. ${REPEATED}`,
|
|
12
|
+
restart: `The sandbox restarted while this turn was running, which stopped it, and this turn resumed automatically once it came back. ${REPEATED}`,
|
|
13
|
+
// Three notes, one allowance failure: `limit` continues, `switched` opens fresh, `refused` says the opposite.
|
|
14
|
+
limit: `The model provider's usage allowance ran out while this turn was running, which stopped it, and it has been sent again. ${REPEATED}`,
|
|
15
|
+
switched:
|
|
16
|
+
"The model provider's usage allowance ran out while this turn was running, which stopped it, and it has been sent again on a different account, which starts a fresh session. The conversation so far has been carried across above, including the part of the request that was already completed, and the sandbox has measured where the work actually stands (the files changed on this branch, what was verified, what the checklist still holds) in the note headed 'Where the work stands': trust that note over anything recalled, then continue from that point instead of starting over.",
|
|
17
|
+
// `carried` switches account but keeps the session, so REPEATED stays true here, unlike `switched`.
|
|
18
|
+
carried: `The model provider's usage allowance ran out while this turn was running, which stopped it, and it has been sent again on a different account of the same provider, in this same session: everything you knew is still here. ${REPEATED}`,
|
|
19
|
+
refused:
|
|
20
|
+
"The model provider refused the previous attempt at this request outright, because its usage allowance was spent: no part of the request below was read or acted on, and nothing has been done towards it. It has been sent again, and starts from the beginning. Where the sandbox has measured earlier work on this branch, it is in the note headed 'Where the work stands'.",
|
|
21
|
+
// A turn parked on the user when the daemon died; what follows the note is their actual answer, not a repeat.
|
|
22
|
+
answered:
|
|
23
|
+
"The sandbox restarted while this conversation was waiting for the user to respond; it is back, and their response follows below: continue from where the session left off.",
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
// The prompt a resume actually sends: the note (each carries its own account of what follows), then the original words.
|
|
27
|
+
export const withResumeNote = (prompt: string, note: string): string =>
|
|
28
|
+
Object.values(RESUME_NOTES).some((known) => prompt.startsWith(known)) ? prompt : `${note}\n\n${prompt}`;
|
|
29
|
+
|
|
30
|
+
// The user's own words inside a resumed prompt, note and explanation stripped. Returns the prompt unchanged when it
|
|
31
|
+
// isn't a resume, so any attach head can pass through it.
|
|
32
|
+
export const withoutResumeNote = (prompt: string): string => {
|
|
33
|
+
const note = Object.values(RESUME_NOTES).find((known) => prompt.startsWith(known));
|
|
34
|
+
return note === undefined ? prompt : prompt.slice(prompt.indexOf("\n\n") + 2);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type ResumeReason = keyof typeof RESUME_NOTES;
|
|
38
|
+
|
|
39
|
+
// How a resumed turn's interruption reads to a person: `notice` for the whole-turn re-runs, a muted line with the
|
|
40
|
+
// repeat dropped; `note` for the answered case, the user's real answer disclosed normally.
|
|
41
|
+
export type ResumeDisclosure = { readonly kind: "notice"; readonly text: string } | { readonly kind: "note"; readonly note: TurnNote };
|
|
42
|
+
|
|
43
|
+
const RESUME_DISCLOSURES: Record<ResumeReason, ResumeDisclosure> = {
|
|
44
|
+
auth: { kind: "notice", text: "Claude sign-in renewed, this turn picked up where it left off." },
|
|
45
|
+
outage: { kind: "notice", text: "The model provider came back, this turn picked up where it left off." },
|
|
46
|
+
restart: { kind: "notice", text: "The sandbox came back, this turn picked up where it left off." },
|
|
47
|
+
// None of these four auto-resumed, a person pressed Continue; `switched`/`carried` name the differing account.
|
|
48
|
+
limit: { kind: "notice", text: "Sent again after the allowance ran out mid-turn, picking up where it left off." },
|
|
49
|
+
switched: { kind: "notice", text: "Sent again on the switched account after the allowance ran out mid-turn, in a fresh session." },
|
|
50
|
+
carried: { kind: "notice", text: "Sent again on the switched account after the allowance ran out mid-turn, carrying the session with it." },
|
|
51
|
+
refused: { kind: "notice", text: "Sent again after the allowance refused it: nothing had run." },
|
|
52
|
+
answered: { kind: "note", note: { title: "Picked back up after a sandbox restart", text: RESUME_NOTES.answered } },
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// What a stored prompt's resume note should be shown as; undefined when the prompt isn't a resume, so any reader can
|
|
56
|
+
// ask without checking first.
|
|
57
|
+
export const resumeDisclosure = (prompt: string): ResumeDisclosure | undefined => {
|
|
58
|
+
const reason = (Object.keys(RESUME_NOTES) as ResumeReason[]).find((key) => prompt.startsWith(RESUME_NOTES[key]));
|
|
59
|
+
return reason === undefined ? undefined : RESUME_DISCLOSURES[reason];
|
|
60
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AgentSummarySchema } from "../schemas/agents.js";
|
|
3
|
+
import { AccountUsageSchema, ProviderRefusalSchema } from "../schemas/plan-limits.js";
|
|
4
|
+
import { MemberRoleSchema } from "../schemas/shared.js";
|
|
5
|
+
|
|
6
|
+
// Frames about the sandbox rather than a turn: liveness, boot progress, what moved (repos, refs, running processes,
|
|
7
|
+
// presence, the fleet), and account headroom. One stream carries them all.
|
|
8
|
+
|
|
9
|
+
// One parsed line from `intentic … --output ndjson`; open-ended, so any string `kind` plus extra fields pass through.
|
|
10
|
+
// The apply-events tail also mints `start`/`exit`/`heartbeat` sentinel kinds alongside the engine's own.
|
|
11
|
+
export const IntenticLineSchema = z.looseObject({ kind: z.string() });
|
|
12
|
+
export type IntenticLine = z.infer<typeof IntenticLineSchema>;
|
|
13
|
+
|
|
14
|
+
// Liveness heartbeat; the browser's watchdog trips if frames stop. `rev` is the fleet revision as of an empty send
|
|
15
|
+
// queue: a mismatch proves a dropped roster snapshot, and the browser re-fetches via GET /agents.
|
|
16
|
+
export const HeartbeatSchema = z.object({ kind: z.literal("heartbeat"), rev: z.number() });
|
|
17
|
+
export type Heartbeat = z.infer<typeof HeartbeatSchema>;
|
|
18
|
+
|
|
19
|
+
// One step of the daemon's boot chain; `key` is its stable id, `label` the words shown. A failed step still counts as
|
|
20
|
+
// finished: the boot chain logs and continues rather than holding the gate closed.
|
|
21
|
+
export const BootStepSchema = z.object({
|
|
22
|
+
key: z.string(),
|
|
23
|
+
label: z.string(),
|
|
24
|
+
state: z.enum(["pending", "running", "done", "failed"]),
|
|
25
|
+
// Elapsed ms, once the step has finished.
|
|
26
|
+
ms: z.number().optional(),
|
|
27
|
+
});
|
|
28
|
+
export type BootStep = z.infer<typeof BootStepSchema>;
|
|
29
|
+
|
|
30
|
+
// Where the daemon stands in its boot; listeners come up before state converges, so it can be reachable yet unable to
|
|
31
|
+
// answer for a few seconds. The step list is sent whole, pending steps included, so the UI can name what's slow.
|
|
32
|
+
export const BootProgressSchema = z.object({
|
|
33
|
+
// False only while the chain is still converging; the browser holds every daemon read until this is true.
|
|
34
|
+
ready: z.boolean(),
|
|
35
|
+
// Epoch ms the daemon started converging, so the browser can show elapsed time across a reconnect.
|
|
36
|
+
startedAt: z.number(),
|
|
37
|
+
steps: z.array(BootStepSchema),
|
|
38
|
+
});
|
|
39
|
+
export type BootProgress = z.infer<typeof BootProgressSchema>;
|
|
40
|
+
|
|
41
|
+
// Pushed on every step transition and once more when the gate opens; rides /events, which answers before the gate so
|
|
42
|
+
// this can be delivered while everything else waits.
|
|
43
|
+
export const BootSchema = z.object({ kind: z.literal("boot"), ...BootProgressSchema.shape });
|
|
44
|
+
export type Boot = z.infer<typeof BootSchema>;
|
|
45
|
+
|
|
46
|
+
// The stream's first frame: `workspaceId` and `build` key the browser's persisted cache, so a wiped workspace or new
|
|
47
|
+
// image doesn't hydrate stale data. `routes`/`shapes` turn a version-skewed 404 or missing field into a named gap.
|
|
48
|
+
export const HelloSchema = z.object({
|
|
49
|
+
kind: z.literal("hello"),
|
|
50
|
+
workspaceId: z.string(),
|
|
51
|
+
routes: z.array(z.string()).optional(),
|
|
52
|
+
shapes: z.record(z.string(), z.string()).optional(),
|
|
53
|
+
build: z.string().optional(),
|
|
54
|
+
boot: BootProgressSchema.optional(),
|
|
55
|
+
});
|
|
56
|
+
export type Hello = z.infer<typeof HelloSchema>;
|
|
57
|
+
|
|
58
|
+
// The full discovered repo set (sorted, root-relative ids), pushed on any change. The watcher ignores `.git`, so the
|
|
59
|
+
// daemon diffs its own discovery instead of detecting a new repo from a path. Snapshot, not diff.
|
|
60
|
+
export const ReposChangedSchema = z.object({ kind: z.literal("reposChanged"), repos: z.array(z.string()) });
|
|
61
|
+
export type ReposChanged = z.infer<typeof ReposChangedSchema>;
|
|
62
|
+
|
|
63
|
+
// A batch of workspace paths that changed on disk, root-relative forward-slash; the agent edits out-of-band so there's
|
|
64
|
+
// no HTTP mutation to hang an invalidation on. An empty array means refetch the whole tree.
|
|
65
|
+
export const WorkspaceChangedSchema = z.object({ kind: z.literal("workspaceChanged"), paths: z.array(z.string()) });
|
|
66
|
+
export type WorkspaceChanged = z.infer<typeof WorkspaceChangedSchema>;
|
|
67
|
+
|
|
68
|
+
// Repos whose refs moved (commit, checkout, branch, rebase); a repo's git dir lives outside /work and the watcher
|
|
69
|
+
// ignores `.git`, so no workspace path can say this. Diff, not snapshot: an absent repo didn't move, it didn't vanish.
|
|
70
|
+
export const RefsChangedSchema = z.object({ kind: z.literal("refsChanged"), repos: z.array(z.string()) });
|
|
71
|
+
export type RefsChanged = z.infer<typeof RefsChangedSchema>;
|
|
72
|
+
|
|
73
|
+
// Which running-thing domain just moved (a session, a port, a browser, a subagent); none of it lives on disk, so
|
|
74
|
+
// `workspaceChanged` can't name it. Carries only the domain, never the roster, so an uninvolved tab pays no request.
|
|
75
|
+
export const RuntimeChangedSchema = z.object({ kind: z.literal("runtimeChanged"), domains: z.array(z.string()) });
|
|
76
|
+
export type RuntimeChanged = z.infer<typeof RuntimeChangedSchema>;
|
|
77
|
+
|
|
78
|
+
// One connected browser tab of a sandbox member; identity from the verified Google ID token, activity from the tab's
|
|
79
|
+
// own /system/presence reports. No timestamps: an entry lives exactly as long as its /events connection.
|
|
80
|
+
export const PresenceUserSchema = z.object({
|
|
81
|
+
// Per-connection id, minted by the browser for each /events attempt, never reused across reconnects.
|
|
82
|
+
clientId: z.string(),
|
|
83
|
+
email: z.string(),
|
|
84
|
+
name: z.string().optional(),
|
|
85
|
+
picture: z.string().optional(),
|
|
86
|
+
// The caller's trust tier, resolved at connection time; on the roster so a tab can also read its own role.
|
|
87
|
+
role: MemberRoleSchema,
|
|
88
|
+
idle: z.boolean(),
|
|
89
|
+
// Route/view name the tab is on ("workspace", "automations", "ext:<id>/<key>", …).
|
|
90
|
+
view: z.string().optional(),
|
|
91
|
+
// The chat conversation the tab has active.
|
|
92
|
+
sessionId: z.string().optional(),
|
|
93
|
+
// The workspace file the tab has open (root-relative, forward-slash).
|
|
94
|
+
path: z.string().optional(),
|
|
95
|
+
});
|
|
96
|
+
export type PresenceUser = z.infer<typeof PresenceUserSchema>;
|
|
97
|
+
|
|
98
|
+
// The full roster of connected members, broadcast on every change; snapshot not diff, so a reconnecting browser is
|
|
99
|
+
// consistent from its first frame.
|
|
100
|
+
export const PresenceSchema = z.object({ kind: z.literal("presence"), users: z.array(PresenceUserSchema) });
|
|
101
|
+
export type Presence = z.infer<typeof PresenceSchema>;
|
|
102
|
+
|
|
103
|
+
// The full fleet roster, snapshot per change; unlike presence, not last-frame-wins: the browser applies a frame only if
|
|
104
|
+
// `rev` is newer, since GET /agents and optimistic writes can race it out of order.
|
|
105
|
+
export const AgentsSchema = z.object({ kind: z.literal("agents"), agents: z.array(AgentSummarySchema), rev: z.number() });
|
|
106
|
+
export type Agents = z.infer<typeof AgentsSchema>;
|
|
107
|
+
|
|
108
|
+
// An account's headroom just moved, keyed as the daemon's store keys it. Snapshot per account, last frame wins; `usage`
|
|
109
|
+
// absent means the account was disconnected.
|
|
110
|
+
export const AccountUsageChangedSchema = z.object({
|
|
111
|
+
kind: z.literal("accountUsage"),
|
|
112
|
+
// The provider whose row this account is; the key alone doesn't say it (a native id is bare).
|
|
113
|
+
provider: z.string(),
|
|
114
|
+
account: z.string(),
|
|
115
|
+
usage: AccountUsageSchema.optional(),
|
|
116
|
+
});
|
|
117
|
+
export type AccountUsageChanged = z.infer<typeof AccountUsageChangedSchema>;
|
|
118
|
+
|
|
119
|
+
// A provider's last refusal was recorded or settled, the observed half of "can I run on this". `refusal` absent means
|
|
120
|
+
// settled, nothing stands.
|
|
121
|
+
export const ProviderRefusalChangedSchema = z.object({ kind: z.literal("providerRefusal"), provider: z.string(), refusal: ProviderRefusalSchema.optional() });
|
|
122
|
+
export type ProviderRefusalChanged = z.infer<typeof ProviderRefusalChangedSchema>;
|
|
123
|
+
|
|
124
|
+
// The /events stream union: hello, heartbeats, boot progress, workspace/repo/ref/runtime changes, presence and fleet
|
|
125
|
+
// rosters, account headroom and refusal changes. oRPC validates every frame against this.
|
|
126
|
+
export const SystemEventSchema = z.discriminatedUnion("kind", [
|
|
127
|
+
HelloSchema,
|
|
128
|
+
HeartbeatSchema,
|
|
129
|
+
BootSchema,
|
|
130
|
+
WorkspaceChangedSchema,
|
|
131
|
+
ReposChangedSchema,
|
|
132
|
+
RefsChangedSchema,
|
|
133
|
+
RuntimeChangedSchema,
|
|
134
|
+
PresenceSchema,
|
|
135
|
+
AgentsSchema,
|
|
136
|
+
AccountUsageChangedSchema,
|
|
137
|
+
ProviderRefusalChangedSchema,
|
|
138
|
+
]);
|
|
139
|
+
export type SystemEvent = z.infer<typeof SystemEventSchema>;
|