@intentic/sandbox-contract 1.232.0 → 1.234.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 +11 -5
- package/dist/agent-catalog.d.ts +4 -2
- package/dist/agent-catalog.d.ts.map +1 -1
- package/dist/agent-catalog.js +20 -14
- package/dist/agent-catalog.js.map +1 -1
- package/dist/chores/chores.d.ts +1 -1
- package/dist/chores/chores.d.ts.map +1 -1
- package/dist/chores/chores.js +36 -1
- package/dist/chores/chores.js.map +1 -1
- package/dist/chores/probes.d.ts +1 -1
- package/dist/chores/probes.d.ts.map +1 -1
- package/dist/chores/probes.js +70 -0
- package/dist/chores/probes.js.map +1 -1
- package/dist/chores/stack.d.ts.map +1 -1
- package/dist/chores/stack.js +2 -1
- package/dist/chores/stack.js.map +1 -1
- package/dist/chores/verdict.d.ts +1 -1
- package/dist/chores/verdict.d.ts.map +1 -1
- package/dist/command-classes.d.ts +17 -0
- package/dist/command-classes.d.ts.map +1 -0
- package/dist/command-classes.js +189 -0
- package/dist/command-classes.js.map +1 -0
- package/dist/contracts/activity.contract.js +1 -1
- package/dist/contracts/activity.contract.js.map +1 -1
- package/dist/contracts/agent.contract.d.ts +40 -2
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.js +4 -1
- package/dist/contracts/agent.contract.js.map +1 -1
- package/dist/contracts/agents.contract.d.ts +24 -0
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +5 -1
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/automations.contract.d.ts +30 -0
- package/dist/contracts/automations.contract.d.ts.map +1 -1
- package/dist/contracts/automations.contract.js +2 -1
- package/dist/contracts/automations.contract.js.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts +63 -0
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.js +3 -1
- package/dist/contracts/capabilities.contract.js.map +1 -1
- package/dist/contracts/chores.contract.d.ts +17 -0
- package/dist/contracts/chores.contract.d.ts.map +1 -1
- package/dist/contracts/chores.contract.js +2 -1
- package/dist/contracts/chores.contract.js.map +1 -1
- package/dist/contracts/ci.contract.js +2 -1
- package/dist/contracts/ci.contract.js.map +1 -1
- package/dist/contracts/claude.contract.js +2 -1
- package/dist/contracts/claude.contract.js.map +1 -1
- package/dist/contracts/cursor.contract.js +2 -1
- package/dist/contracts/cursor.contract.js.map +1 -1
- package/dist/contracts/drafts.contract.d.ts.map +1 -1
- package/dist/contracts/drafts.contract.js +2 -1
- package/dist/contracts/drafts.contract.js.map +1 -1
- package/dist/contracts/endpoints.contract.d.ts.map +1 -1
- package/dist/contracts/endpoints.contract.js +2 -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 +2 -1
- package/dist/contracts/exit.contract.js.map +1 -1
- package/dist/contracts/extensions.contract.d.ts +44 -0
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.js +4 -1
- package/dist/contracts/extensions.contract.js.map +1 -1
- package/dist/contracts/git.contract.d.ts.map +1 -1
- package/dist/contracts/git.contract.js +4 -1
- package/dist/contracts/git.contract.js.map +1 -1
- package/dist/contracts/grok.contract.d.ts.map +1 -1
- package/dist/contracts/grok.contract.js +2 -1
- package/dist/contracts/grok.contract.js.map +1 -1
- package/dist/contracts/history.contract.d.ts.map +1 -1
- package/dist/contracts/history.contract.js +2 -1
- package/dist/contracts/history.contract.js.map +1 -1
- package/dist/contracts/host.contract.d.ts +7 -0
- package/dist/contracts/host.contract.d.ts.map +1 -1
- package/dist/contracts/host.contract.js +4 -1
- package/dist/contracts/host.contract.js.map +1 -1
- package/dist/contracts/intentic.contract.d.ts.map +1 -1
- package/dist/contracts/intentic.contract.js +2 -1
- package/dist/contracts/intentic.contract.js.map +1 -1
- package/dist/contracts/inventory.contract.js +1 -1
- package/dist/contracts/inventory.contract.js.map +1 -1
- package/dist/contracts/issues.contract.d.ts +89 -0
- package/dist/contracts/issues.contract.d.ts.map +1 -0
- package/dist/contracts/issues.contract.js +50 -0
- package/dist/contracts/issues.contract.js.map +1 -0
- package/dist/contracts/logs.contract.d.ts.map +1 -1
- package/dist/contracts/logs.contract.js +1 -1
- package/dist/contracts/logs.contract.js.map +1 -1
- package/dist/contracts/loops.contract.js +2 -1
- package/dist/contracts/loops.contract.js.map +1 -1
- package/dist/contracts/panels.contract.d.ts.map +1 -1
- package/dist/contracts/panels.contract.js +2 -1
- package/dist/contracts/panels.contract.js.map +1 -1
- package/dist/contracts/personas.contract.js +2 -1
- package/dist/contracts/personas.contract.js.map +1 -1
- package/dist/contracts/ports.contract.d.ts.map +1 -1
- package/dist/contracts/ports.contract.js +2 -1
- package/dist/contracts/ports.contract.js.map +1 -1
- package/dist/contracts/prepush.contract.d.ts.map +1 -1
- package/dist/contracts/prepush.contract.js +2 -1
- package/dist/contracts/prepush.contract.js.map +1 -1
- package/dist/contracts/providers.contract.d.ts.map +1 -1
- package/dist/contracts/providers.contract.js +2 -1
- package/dist/contracts/providers.contract.js.map +1 -1
- package/dist/contracts/public.contract.d.ts.map +1 -1
- package/dist/contracts/public.contract.js +2 -1
- package/dist/contracts/public.contract.js.map +1 -1
- package/dist/contracts/push.contract.d.ts.map +1 -1
- package/dist/contracts/push.contract.js +2 -1
- package/dist/contracts/push.contract.js.map +1 -1
- package/dist/contracts/runner.contract.d.ts +127 -84
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.js +10 -2
- package/dist/contracts/runner.contract.js.map +1 -1
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js +2 -1
- package/dist/contracts/secrets.contract.js.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 +32 -0
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.js +3 -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 +2 -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 +2 -1
- package/dist/contracts/skills.contract.js.map +1 -1
- package/dist/contracts/system.contract.d.ts +31 -16
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +6 -1
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/contracts/translator.contract.d.ts.map +1 -1
- package/dist/contracts/translator.contract.js +4 -1
- package/dist/contracts/translator.contract.js.map +1 -1
- package/dist/contracts/usage.contract.js +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 +2 -1
- package/dist/contracts/vpn.contract.js.map +1 -1
- package/dist/contracts/webext.contract.d.ts +45 -0
- package/dist/contracts/webext.contract.d.ts.map +1 -0
- package/dist/contracts/webext.contract.js +12 -0
- package/dist/contracts/webext.contract.js.map +1 -0
- package/dist/contracts/workflows.contract.js +2 -1
- package/dist/contracts/workflows.contract.js.map +1 -1
- package/dist/contracts/workspace.contract.d.ts +2 -2
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js +7 -1
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/credential-material.d.ts +2 -0
- package/dist/credential-material.d.ts.map +1 -0
- package/dist/credential-material.js +36 -0
- package/dist/credential-material.js.map +1 -0
- package/dist/definition-action.d.ts +7 -0
- package/dist/definition-action.d.ts.map +1 -0
- package/dist/definition-action.js +3 -0
- package/dist/definition-action.js.map +1 -0
- package/dist/definition.d.ts +132 -21
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +29 -7
- package/dist/definition.js.map +1 -1
- package/dist/events.d.ts +101 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +25 -1
- package/dist/events.js.map +1 -1
- package/dist/fast-tier.d.ts +1 -1
- package/dist/fast-tier.d.ts.map +1 -1
- package/dist/history-state.d.ts.map +1 -1
- package/dist/history-state.js +2 -0
- package/dist/history-state.js.map +1 -1
- package/dist/hostnames.d.ts +2 -0
- package/dist/hostnames.d.ts.map +1 -1
- package/dist/hostnames.js +3 -1
- package/dist/hostnames.js.map +1 -1
- package/dist/index.d.ts +411 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -1
- package/dist/index.js.map +1 -1
- package/dist/listener-protocol.js +1 -1
- package/dist/listener-protocol.js.map +1 -1
- package/dist/quick-model.d.ts +1 -1
- package/dist/quick-model.d.ts.map +1 -1
- package/dist/runner-protocol.d.ts +18 -0
- package/dist/runner-protocol.d.ts.map +1 -1
- package/dist/runner-protocol.js +8 -4
- package/dist/runner-protocol.js.map +1 -1
- package/dist/runtime-state.d.ts +9 -0
- package/dist/runtime-state.d.ts.map +1 -1
- package/dist/runtime-state.js +3 -0
- package/dist/runtime-state.js.map +1 -1
- package/dist/schemas/activity.d.ts +112 -0
- package/dist/schemas/activity.d.ts.map +1 -0
- package/dist/schemas/activity.js +70 -0
- package/dist/schemas/activity.js.map +1 -0
- package/dist/schemas/agent.d.ts +195 -0
- package/dist/schemas/agent.d.ts.map +1 -0
- package/dist/schemas/agent.js +171 -0
- package/dist/schemas/agent.js.map +1 -0
- package/dist/schemas/agents.d.ts +690 -0
- package/dist/schemas/agents.d.ts.map +1 -0
- package/dist/schemas/agents.js +314 -0
- package/dist/schemas/agents.js.map +1 -0
- package/dist/schemas/automations.d.ts +781 -0
- package/dist/schemas/automations.d.ts.map +1 -0
- package/dist/schemas/automations.js +223 -0
- package/dist/schemas/automations.js.map +1 -0
- package/dist/schemas/capabilities.d.ts +753 -0
- package/dist/schemas/capabilities.d.ts.map +1 -0
- package/dist/schemas/capabilities.js +269 -0
- package/dist/schemas/capabilities.js.map +1 -0
- package/dist/schemas/ci.d.ts +179 -0
- package/dist/schemas/ci.d.ts.map +1 -0
- package/dist/schemas/ci.js +99 -0
- package/dist/schemas/ci.js.map +1 -0
- package/dist/schemas/claude-gate.d.ts +13 -0
- package/dist/schemas/claude-gate.d.ts.map +1 -0
- package/dist/schemas/claude-gate.js +8 -0
- package/dist/schemas/claude-gate.js.map +1 -0
- package/dist/schemas/codebase-health.d.ts +56 -0
- package/dist/schemas/codebase-health.d.ts.map +1 -0
- package/dist/schemas/codebase-health.js +43 -0
- package/dist/schemas/codebase-health.js.map +1 -0
- package/dist/schemas/computers.d.ts +386 -0
- package/dist/schemas/computers.d.ts.map +1 -0
- package/dist/schemas/computers.js +107 -0
- package/dist/schemas/computers.js.map +1 -0
- package/dist/schemas/drafts.d.ts +84 -0
- package/dist/schemas/drafts.d.ts.map +1 -0
- package/dist/schemas/drafts.js +44 -0
- package/dist/schemas/drafts.js.map +1 -0
- package/dist/schemas/environment.d.ts +349 -0
- package/dist/schemas/environment.d.ts.map +1 -0
- package/dist/schemas/environment.js +111 -0
- package/dist/schemas/environment.js.map +1 -0
- package/dist/schemas/exit.d.ts +151 -0
- package/dist/schemas/exit.d.ts.map +1 -0
- package/dist/schemas/exit.js +115 -0
- package/dist/schemas/exit.js.map +1 -0
- package/dist/schemas/extension-updates.d.ts +1016 -0
- package/dist/schemas/extension-updates.d.ts.map +1 -0
- package/dist/schemas/extension-updates.js +199 -0
- package/dist/schemas/extension-updates.js.map +1 -0
- package/dist/schemas/fast-mode.d.ts +8 -0
- package/dist/schemas/fast-mode.d.ts.map +1 -0
- package/dist/schemas/fast-mode.js +3 -0
- package/dist/schemas/fast-mode.js.map +1 -0
- package/dist/schemas/git-history.d.ts +238 -0
- package/dist/schemas/git-history.d.ts.map +1 -0
- package/dist/schemas/git-history.js +152 -0
- package/dist/schemas/git-history.js.map +1 -0
- package/dist/schemas/git.d.ts +471 -0
- package/dist/schemas/git.d.ts.map +1 -0
- package/dist/schemas/git.js +204 -0
- package/dist/schemas/git.js.map +1 -0
- package/dist/schemas/history.d.ts +100 -0
- package/dist/schemas/history.d.ts.map +1 -0
- package/dist/schemas/history.js +54 -0
- package/dist/schemas/history.js.map +1 -0
- package/dist/schemas/hosts.d.ts +41 -0
- package/dist/schemas/hosts.d.ts.map +1 -0
- package/dist/schemas/hosts.js +18 -0
- package/dist/schemas/hosts.js.map +1 -0
- package/dist/schemas/intentic.d.ts +5 -0
- package/dist/schemas/intentic.d.ts.map +1 -0
- package/dist/schemas/intentic.js +3 -0
- package/dist/schemas/intentic.js.map +1 -0
- package/dist/schemas/internal.d.ts +8 -0
- package/dist/schemas/internal.d.ts.map +1 -0
- package/dist/schemas/internal.js +12 -0
- package/dist/schemas/internal.js.map +1 -0
- package/dist/schemas/inventory.d.ts +171 -0
- package/dist/schemas/inventory.d.ts.map +1 -0
- package/dist/schemas/inventory.js +51 -0
- package/dist/schemas/inventory.js.map +1 -0
- package/dist/schemas/issues.d.ts +324 -0
- package/dist/schemas/issues.d.ts.map +1 -0
- package/dist/schemas/issues.js +107 -0
- package/dist/schemas/issues.js.map +1 -0
- package/dist/schemas/logs.d.ts +67 -0
- package/dist/schemas/logs.d.ts.map +1 -0
- package/dist/schemas/logs.js +54 -0
- package/dist/schemas/logs.js.map +1 -0
- package/dist/schemas/loops.d.ts +415 -0
- package/dist/schemas/loops.d.ts.map +1 -0
- package/dist/schemas/loops.js +188 -0
- package/dist/schemas/loops.js.map +1 -0
- package/dist/schemas/maintenance.d.ts +618 -0
- package/dist/schemas/maintenance.d.ts.map +1 -0
- package/dist/schemas/maintenance.js +222 -0
- package/dist/schemas/maintenance.js.map +1 -0
- package/dist/schemas/marketplace.d.ts +64 -0
- package/dist/schemas/marketplace.d.ts.map +1 -0
- package/dist/schemas/marketplace.js +17 -0
- package/dist/schemas/marketplace.js.map +1 -0
- package/dist/schemas/panels.d.ts +61 -0
- package/dist/schemas/panels.d.ts.map +1 -0
- package/dist/schemas/panels.js +51 -0
- package/dist/schemas/panels.js.map +1 -0
- package/dist/schemas/personas.d.ts +122 -0
- package/dist/schemas/personas.d.ts.map +1 -0
- package/dist/schemas/personas.js +102 -0
- package/dist/schemas/personas.js.map +1 -0
- package/dist/schemas/plan-limits.d.ts +172 -0
- package/dist/schemas/plan-limits.d.ts.map +1 -0
- package/dist/schemas/plan-limits.js +126 -0
- package/dist/schemas/plan-limits.js.map +1 -0
- package/dist/schemas/ports.d.ts +71 -0
- package/dist/schemas/ports.d.ts.map +1 -0
- package/dist/schemas/ports.js +42 -0
- package/dist/schemas/ports.js.map +1 -0
- package/dist/schemas/provider-oauth.d.ts +128 -0
- package/dist/schemas/provider-oauth.d.ts.map +1 -0
- package/dist/schemas/provider-oauth.js +91 -0
- package/dist/schemas/provider-oauth.js.map +1 -0
- package/dist/schemas/provider-subscriptions.d.ts +9 -0
- package/dist/schemas/provider-subscriptions.d.ts.map +1 -0
- package/dist/schemas/provider-subscriptions.js +3 -0
- package/dist/schemas/provider-subscriptions.js.map +1 -0
- package/dist/schemas/public.d.ts +32 -0
- package/dist/schemas/public.d.ts.map +1 -0
- package/dist/schemas/public.js +29 -0
- package/dist/schemas/public.js.map +1 -0
- package/dist/schemas/push.d.ts +55 -0
- package/dist/schemas/push.d.ts.map +1 -0
- package/dist/schemas/push.js +60 -0
- package/dist/schemas/push.js.map +1 -0
- package/dist/schemas/secrets.d.ts +86 -0
- package/dist/schemas/secrets.d.ts.map +1 -0
- package/dist/schemas/secrets.js +51 -0
- package/dist/schemas/secrets.js.map +1 -0
- package/dist/schemas/sessions.d.ts +32 -0
- package/dist/schemas/sessions.d.ts.map +1 -0
- package/dist/schemas/sessions.js +11 -0
- package/dist/schemas/sessions.js.map +1 -0
- package/dist/schemas/settings.d.ts +554 -0
- package/dist/schemas/settings.d.ts.map +1 -0
- package/dist/schemas/settings.js +263 -0
- package/dist/schemas/settings.js.map +1 -0
- package/dist/schemas/share.d.ts +49 -0
- package/dist/schemas/share.d.ts.map +1 -0
- package/dist/schemas/share.js +26 -0
- package/dist/schemas/share.js.map +1 -0
- package/dist/schemas/shared.d.ts +22 -0
- package/dist/schemas/shared.d.ts.map +1 -0
- package/dist/schemas/shared.js +16 -0
- package/dist/schemas/shared.js.map +1 -0
- package/dist/schemas/system.d.ts +86 -0
- package/dist/schemas/system.d.ts.map +1 -0
- package/dist/schemas/system.js +64 -0
- package/dist/schemas/system.js.map +1 -0
- package/dist/schemas/terminal.d.ts +230 -0
- package/dist/schemas/terminal.d.ts.map +1 -0
- package/dist/schemas/terminal.js +133 -0
- package/dist/schemas/terminal.js.map +1 -0
- package/dist/schemas/usage.d.ts +113 -0
- package/dist/schemas/usage.d.ts.map +1 -0
- package/dist/schemas/usage.js +91 -0
- package/dist/schemas/usage.js.map +1 -0
- package/dist/schemas/vpn.d.ts +229 -0
- package/dist/schemas/vpn.d.ts.map +1 -0
- package/dist/schemas/vpn.js +115 -0
- package/dist/schemas/vpn.js.map +1 -0
- package/dist/schemas/webext.d.ts +122 -0
- package/dist/schemas/webext.d.ts.map +1 -0
- package/dist/schemas/webext.js +45 -0
- package/dist/schemas/webext.js.map +1 -0
- package/dist/schemas/workflows.d.ts +881 -0
- package/dist/schemas/workflows.d.ts.map +1 -0
- package/dist/schemas/workflows.js +164 -0
- package/dist/schemas/workflows.js.map +1 -0
- package/dist/schemas/workspace-repos.d.ts +143 -0
- package/dist/schemas/workspace-repos.d.ts.map +1 -0
- package/dist/schemas/workspace-repos.js +87 -0
- package/dist/schemas/workspace-repos.js.map +1 -0
- package/dist/schemas/workspace-search.d.ts +170 -0
- package/dist/schemas/workspace-search.d.ts.map +1 -0
- package/dist/schemas/workspace-search.js +85 -0
- package/dist/schemas/workspace-search.js.map +1 -0
- package/dist/schemas/workspace-setup.d.ts +48 -0
- package/dist/schemas/workspace-setup.d.ts.map +1 -0
- package/dist/schemas/workspace-setup.js +26 -0
- package/dist/schemas/workspace-setup.js.map +1 -0
- package/dist/schemas/workspace-tree.d.ts +120 -0
- package/dist/schemas/workspace-tree.d.ts.map +1 -0
- package/dist/schemas/workspace-tree.js +111 -0
- package/dist/schemas/workspace-tree.js.map +1 -0
- package/dist/webext-links.d.ts +14 -0
- package/dist/webext-links.d.ts.map +1 -0
- package/dist/webext-links.js +25 -0
- package/dist/webext-links.js.map +1 -0
- package/dist/webext-protocol.d.ts +8 -0
- package/dist/webext-protocol.d.ts.map +1 -0
- package/dist/webext-protocol.js +7 -0
- package/dist/webext-protocol.js.map +1 -0
- package/dist/workflow-faults.d.ts +1 -1
- package/dist/workflow-faults.d.ts.map +1 -1
- package/dist/workspace-state.d.ts +12 -8
- package/dist/workspace-state.d.ts.map +1 -1
- package/dist/workspace-state.js +15 -10
- package/dist/workspace-state.js.map +1 -1
- package/package.json +19 -8
- package/src/agent-catalog.test.ts +56 -55
- package/src/agent-catalog.ts +33 -33
- package/src/capability-ledger.test.ts +11 -2
- package/src/chores/chores.test.ts +1 -1
- package/src/chores/chores.ts +67 -2
- package/src/chores/probes.test.ts +65 -0
- package/src/chores/probes.ts +133 -1
- package/src/chores/stack.test.ts +19 -0
- package/src/chores/stack.ts +19 -3
- package/src/chores/verdict.test.ts +40 -20
- package/src/chores/verdict.ts +1 -1
- package/src/command-classes.test.ts +445 -0
- package/src/command-classes.ts +468 -0
- package/src/contracts/activity.contract.ts +1 -1
- package/src/contracts/agent.contract.ts +4 -13
- package/src/contracts/agents.contract.ts +6 -6
- package/src/contracts/automations.contract.ts +2 -2
- package/src/contracts/capabilities.contract.ts +3 -4
- package/src/contracts/chores.contract.ts +2 -1
- package/src/contracts/ci.contract.ts +2 -2
- package/src/contracts/claude.contract.ts +2 -2
- package/src/contracts/cursor.contract.ts +2 -2
- package/src/contracts/drafts.contract.ts +2 -1
- package/src/contracts/endpoints.contract.ts +2 -1
- package/src/contracts/exit.contract.ts +2 -1
- package/src/contracts/extensions.contract.ts +8 -7
- package/src/contracts/git.contract.ts +19 -18
- package/src/contracts/grok.contract.ts +2 -1
- package/src/contracts/history.contract.ts +2 -1
- package/src/contracts/host.contract.ts +4 -1
- package/src/contracts/intentic.contract.ts +2 -1
- package/src/contracts/inventory.contract.ts +1 -1
- package/src/contracts/issues.contract.ts +60 -0
- package/src/contracts/logs.contract.ts +7 -1
- package/src/contracts/loops.contract.ts +2 -2
- package/src/contracts/panels.contract.ts +2 -1
- package/src/contracts/personas.contract.ts +3 -3
- package/src/contracts/ports.contract.ts +3 -2
- package/src/contracts/prepush.contract.ts +2 -1
- package/src/contracts/providers.contract.ts +2 -1
- package/src/contracts/public.contract.ts +3 -2
- package/src/contracts/push.contract.ts +2 -1
- package/src/contracts/runner.contract.ts +18 -2
- package/src/contracts/secrets.contract.ts +2 -1
- package/src/contracts/sessions.contract.ts +1 -1
- package/src/contracts/settings.contract.ts +3 -9
- package/src/contracts/share.contract.ts +3 -2
- package/src/contracts/skills.contract.ts +2 -1
- package/src/contracts/system.contract.ts +6 -9
- package/src/contracts/translator.contract.ts +4 -1
- package/src/contracts/usage.contract.ts +1 -1
- package/src/contracts/vpn.contract.ts +2 -8
- package/src/contracts/webext.contract.ts +37 -0
- package/src/contracts/workflows.contract.ts +2 -2
- package/src/contracts/workspace.contract.ts +10 -12
- package/src/conversation-ids.test.ts +1 -1
- package/src/credential-material.test.ts +120 -0
- package/src/credential-material.ts +100 -0
- package/src/definition-action.ts +8 -0
- package/src/definition.ts +74 -10
- package/src/events.ts +84 -22
- package/src/fast-tier.ts +1 -1
- package/src/history-state.ts +17 -0
- package/src/host-protocol.ts +1 -1
- package/src/hostnames.test.ts +2 -2
- package/src/hostnames.ts +18 -2
- package/src/index.ts +65 -1
- package/src/listener-protocol.ts +1 -1
- package/src/quick-model.ts +1 -1
- package/src/routes.test.ts +4 -2
- package/src/runner-protocol.ts +35 -5
- package/src/runtime-state.ts +16 -0
- package/src/schemas/activity.ts +123 -0
- package/src/schemas/agent.ts +422 -0
- package/src/schemas/agents.ts +802 -0
- package/src/schemas/automations.ts +522 -0
- package/src/schemas/capabilities.ts +729 -0
- package/src/schemas/ci.ts +235 -0
- package/src/schemas/claude-gate.ts +13 -0
- package/src/schemas/codebase-health.ts +64 -0
- package/src/schemas/computers.ts +287 -0
- package/src/schemas/drafts.ts +108 -0
- package/src/schemas/environment.ts +276 -0
- package/src/schemas/exit.ts +222 -0
- package/src/schemas/extension-updates.ts +324 -0
- package/src/schemas/fast-mode.ts +8 -0
- package/src/schemas/git-history.ts +265 -0
- package/src/schemas/git.ts +430 -0
- package/src/schemas/history.ts +112 -0
- package/src/schemas/hosts.ts +37 -0
- package/src/schemas/intentic.ts +2 -0
- package/src/schemas/internal.ts +17 -0
- package/src/schemas/inventory.ts +68 -0
- package/src/schemas/issues.ts +279 -0
- package/src/schemas/logs.ts +96 -0
- package/src/schemas/loops.ts +401 -0
- package/src/schemas/maintenance.ts +471 -0
- package/src/schemas/marketplace.ts +23 -0
- package/src/schemas/panels.ts +99 -0
- package/src/schemas/personas.ts +281 -0
- package/src/schemas/plan-limits.ts +255 -0
- package/src/schemas/ports.ts +84 -0
- package/src/schemas/provider-oauth.ts +191 -0
- package/src/schemas/provider-subscriptions.ts +11 -0
- package/src/schemas/public.ts +52 -0
- package/src/schemas/push.ts +112 -0
- package/src/schemas/secrets.ts +68 -0
- package/src/schemas/sessions.ts +16 -0
- package/src/schemas/settings.ts +964 -0
- package/src/schemas/share.ts +71 -0
- package/src/schemas/shared.ts +32 -0
- package/src/schemas/system.ts +156 -0
- package/src/schemas/terminal.ts +288 -0
- package/src/schemas/usage.ts +303 -0
- package/src/{schemas.test.ts → schemas/version-seam.test.ts} +4 -2
- package/src/schemas/vpn.ts +215 -0
- package/src/schemas/webext.ts +108 -0
- package/src/schemas/workflows.ts +413 -0
- package/src/schemas/workspace-repos.ts +123 -0
- package/src/schemas/workspace-search.ts +141 -0
- package/src/schemas/workspace-setup.ts +43 -0
- package/src/schemas/workspace-tree.ts +234 -0
- package/src/title.test.ts +1 -1
- package/src/tunnel-ids.test.ts +3 -1
- package/src/webext-links.ts +90 -0
- package/src/webext-protocol.ts +27 -0
- package/src/workflow-faults.test.ts +1 -1
- package/src/workflow-faults.ts +1 -1
- package/src/workspace-state.test.ts +6 -4
- package/src/workspace-state.ts +35 -50
- package/dist/schemas.d.ts +0 -9909
- package/dist/schemas.d.ts.map +0 -1
- package/dist/schemas.js +0 -4288
- package/dist/schemas.js.map +0 -1
- package/src/schemas.ts +0 -10090
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AgentPlacementSchema } from "../runner-protocol.js";
|
|
3
|
+
import { entryId } from "./internal.js";
|
|
4
|
+
// The agent runtimes the daemon can serve, the vocabulary every surface that picks an agent shares (chat
|
|
5
|
+
// turns, automations). The NATIVE providers have dedicated adapters (and their ids are reserved); an
|
|
6
|
+
// `endpoint/<id>` value names an installed `endpoint`-kind capability (a model API the user pointed us at,
|
|
7
|
+
// see EndpointConfigSchema); any other value is the id of an installed `agent`-kind capability served over
|
|
8
|
+
// ACP (Agent Client Protocol).
|
|
9
|
+
// Kept as a bare string on the wire (not an enum) so an unknown id is a clean error frame from the agent
|
|
10
|
+
// route, the same bet RepoParamSchema makes, and adding an ACP agent needs no contract change.
|
|
11
|
+
export const NATIVE_PROVIDERS = ["claude", "codex", "grok", "kimi", "gemini", "cursor"] as const;
|
|
12
|
+
export type NativeProvider = (typeof NATIVE_PROVIDERS)[number];
|
|
13
|
+
export const AgentProviderSchema = z.string().min(1);
|
|
14
|
+
export type AgentProvider = z.infer<typeof AgentProviderSchema>;
|
|
15
|
+
// The provider naming a catalog in the one route every native provider shares (providers.contract.ts). An ENUM
|
|
16
|
+
// rather than the bare-string schema above, and deliberately so: the open vocabulary exists because an ACP agent
|
|
17
|
+
// or an endpoint can be added without a contract change, but neither has a daemon-held catalog, this route's
|
|
18
|
+
// subjects are exactly the five the daemon keeps one for. Closing it here is what makes an unknown id a 400 from
|
|
19
|
+
// the contract instead of a registry lookup that reads back `undefined` and serves an empty list.
|
|
20
|
+
export const NativeProviderParamSchema = z.object({ provider: z.enum(NATIVE_PROVIDERS) });
|
|
21
|
+
// The harness (agentic loop) a turn runs on, orthogonal to the provider. See AgentTurnSchema.harness.
|
|
22
|
+
export const AgentHarnessSchema = z.enum(["native", "claude-code"]);
|
|
23
|
+
export type AgentHarness = z.infer<typeof AgentHarnessSchema>;
|
|
24
|
+
// One repository at one immutable commit. Workflow runs use this both as the checkout instruction for every
|
|
25
|
+
// candidate and as the comparison base written into handoffs, so a multi-repo run has one provenance record
|
|
26
|
+
// rather than a hard-coded branch name that only happens to work in the root repository.
|
|
27
|
+
export const RepoBaseSchema = z.object({ repo: z.string(), base: z.string().min(1) });
|
|
28
|
+
export type RepoBase = z.infer<typeof RepoBaseSchema>;
|
|
29
|
+
// What the user is looking at in the editor, attached to a turn only when they explicitly opt in (the
|
|
30
|
+
// composer chip, off by default). The daemon folds it into the prompt as a context note, so deictic
|
|
31
|
+
// prompts ("fix this") resolve without an @-mention. Selection is bounded, it's context, not an upload.
|
|
32
|
+
export const EditorContextSchema = z.object({
|
|
33
|
+
// Workspace-relative path of the file open in the editor.
|
|
34
|
+
file: z.string().min(1).describe("The file open in the editor, as a workspace path."),
|
|
35
|
+
// 1-based line range of the selection; absent when the whole file is the context.
|
|
36
|
+
startLine: z
|
|
37
|
+
.number()
|
|
38
|
+
.int()
|
|
39
|
+
.min(1)
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("First line of the selection, counting from one. Leave both out when the whole file is the context."),
|
|
42
|
+
endLine: z.number().int().min(1).optional().describe("Last line of the selection, counting from one."),
|
|
43
|
+
// The selected text itself, truncated client-side to the cap.
|
|
44
|
+
selection: z
|
|
45
|
+
.string()
|
|
46
|
+
.max(20_000)
|
|
47
|
+
.optional()
|
|
48
|
+
.describe("The selected text itself. Cut it down before sending if it is long: this is context, not an upload."),
|
|
49
|
+
});
|
|
50
|
+
export type EditorContext = z.infer<typeof EditorContextSchema>;
|
|
51
|
+
// The client-minted stable conversation identity. Constrained because isolated conversations also use it in
|
|
52
|
+
// branch names (agent/<id>) and filesystem paths, the regex is the injection guard. Shared by turn + attach,
|
|
53
|
+
// and by the workspace scope (WorkspaceScopeSchema), which names a conversation to read a file tree AS.
|
|
54
|
+
export const ConversationIdSchema = z.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/);
|
|
55
|
+
// Where a conversation came from when nobody typed it into the browser: an automation wake carrying a message
|
|
56
|
+
// from OUTSIDE the sandbox (a Discord mention, a web-chat visitor, a webhook). Such a wake runs as an ordinary
|
|
57
|
+
// isolated conversation, registry entry, worktree, chat tab, land flow, and this is the only thing that
|
|
58
|
+
// distinguishes it on the surface: the card's provenance line and the reason its first prompt is not the
|
|
59
|
+
// user's. Set daemon-side by the dispatcher that received the message; the browser never sends one.
|
|
60
|
+
export const AgentOriginSchema = z.object({
|
|
61
|
+
// The automation whose configured prompt opened the conversation.
|
|
62
|
+
automationId: z.string(),
|
|
63
|
+
// The listener provider that received the message ("discord", "webchat", …) or "webhook" for an event
|
|
64
|
+
// trigger. An open string for the same reason Trigger.provider is: sources are extension-declared.
|
|
65
|
+
provider: z.string(),
|
|
66
|
+
// The external thread it arrived on, a Discord channel id, a widget conversation id. Absent for webhooks.
|
|
67
|
+
channelId: z.string().optional(),
|
|
68
|
+
// Who sent it, as the source names them.
|
|
69
|
+
author: z.string().optional(),
|
|
70
|
+
});
|
|
71
|
+
export type AgentOrigin = z.infer<typeof AgentOriginSchema>;
|
|
72
|
+
/* The class of thing asking to START a session, the admission policy's key space. Derived daemon-side from
|
|
73
|
+
* the automation's trigger (guard/actions.ts wakeSourceOf) or named by the door itself (the workflow release
|
|
74
|
+
* gate); never sent by a client. Chat and loops are absent deliberately: both begin with the owner's own
|
|
75
|
+
* click, and holding the owner's work in their own queue is a queue entry that says nothing (the same argument
|
|
76
|
+
* fireAutomation's `cleared` makes about a by-hand fire). */
|
|
77
|
+
export const WakeSourceSchema = z.enum(["schedule", "event", "listener", "webchat", "issues", "workspace", "workflow"]);
|
|
78
|
+
export type WakeSource = z.infer<typeof WakeSourceSchema>;
|
|
79
|
+
// One admission verdict the owner can configure: let it run, hold it for approval, or refuse it outright.
|
|
80
|
+
export const AdmissionRuleSchema = z.enum(["allow", "hold", "deny"]);
|
|
81
|
+
export type AdmissionRule = z.infer<typeof AdmissionRuleSchema>;
|
|
82
|
+
/* WHAT KIND OF THING A SHELL COMMAND IS, the command gate's key space, the second layer under the admission
|
|
83
|
+
* floor above. The floor decides whether a session may START; these decide whether one PARTICULAR command
|
|
84
|
+
* inside a running session may go ahead, which is the only question left once the agent is already working.
|
|
85
|
+
*
|
|
86
|
+
* Five, chosen for one property: everything in them is hard or impossible to take back, so a person seeing it
|
|
87
|
+
* once beats an audit trail read afterwards. Everything else an agent runs, builds, tests, greps, edits, is
|
|
88
|
+
* recoverable in a container that is itself disposable, and gating it would be friction bought with nothing. */
|
|
89
|
+
export const CommandClassSchema = z.enum([
|
|
90
|
+
// Rewrites or discards committed work: force-push, hard reset, force-delete a branch, clean -f, filter-branch.
|
|
91
|
+
"git.destructive",
|
|
92
|
+
// Recursive-force deletion (`rm -rf`), and its spelling in a script (`fs.rm(p, { recursive: true })`).
|
|
93
|
+
"files.destructive",
|
|
94
|
+
/* State nothing here brings back: a formatted or overwritten disk, a deleted Docker volume, a recursive
|
|
95
|
+
* delete aimed at a root rather than at something inside one. The only class the daemon holds where the
|
|
96
|
+
* owner wrote no rule, which is why it is separate from files.destructive rather than a shade of it:
|
|
97
|
+
* `rm -rf build` is ordinary work in a disposable container and `rm -rf /` is the end of the machine. */
|
|
98
|
+
"system.destructive",
|
|
99
|
+
/* READS credential material: a `{{secret:NAME}}` reference (which becomes the value on the way into the
|
|
100
|
+
* process), or a file that actually holds one — a dotenv, a private key, ~/.aws/credentials, an npmrc.
|
|
101
|
+
* "Actually" is load-bearing and is checked rather than assumed where the caller can open the file: an
|
|
102
|
+
* npmrc with no token in it, a dotenv of ports, a public key, a path that is not there, are none of them
|
|
103
|
+
* this class, however much they look like it from the command line. See command-classes.ts. */
|
|
104
|
+
"secrets.access",
|
|
105
|
+
// Publishes outward and irreversibly: npm/pnpm/yarn/cargo publish, gh release create, docker push.
|
|
106
|
+
"package.publish",
|
|
107
|
+
// curl/wget to a non-local address, the general exfiltration channel under the per-provider actionRules.
|
|
108
|
+
"network.outbound",
|
|
109
|
+
]);
|
|
110
|
+
export type CommandClass = z.infer<typeof CommandClassSchema>;
|
|
111
|
+
/* THE ADMISSION FLOOR, the workspace-wide rule per wake source, consulted by the session.start guard on every
|
|
112
|
+
* outside-driven wake. Per-automation `requireApproval` / `holdForSeconds` remain the per-object override; the
|
|
113
|
+
* floor composes with them most-restrictive-wins, so "hold every webchat session" needs no edit to each
|
|
114
|
+
* automation. `workflow` is allow|deny only: the release gate answers a CI runner holding a connection with a
|
|
115
|
+
* deadline, so a hold there is indistinguishable from a timeout, deny is the honest refusal. */
|
|
116
|
+
export const AdmissionPolicySchema = z.object({
|
|
117
|
+
schedule: AdmissionRuleSchema.default("allow"),
|
|
118
|
+
event: AdmissionRuleSchema.default("allow"),
|
|
119
|
+
listener: AdmissionRuleSchema.default("allow"),
|
|
120
|
+
webchat: AdmissionRuleSchema.default("allow"),
|
|
121
|
+
/* THE ONE SOURCE THAT HOLDS BY DEFAULT, and the exception is argued rather than assumed. A Front Desk wake
|
|
122
|
+
* runs the read-only Front Desk persona: a stranger drives the prompt and the toolbox is a shelf of two.
|
|
123
|
+
* A bug-report wake is the opposite on both counts, it is pointed at the repository with the powers to
|
|
124
|
+
* change it, and the brief is a stack trace and a sentence somebody else's browser wrote.
|
|
125
|
+
*
|
|
126
|
+
* Held is not blocked: the wake sits in the same approvals queue every other hold uses, with the issue's
|
|
127
|
+
* own title on the card, and one click runs it. An owner who wants their crashes fixed while they sleep
|
|
128
|
+
* sets this to `allow` deliberately, which is the direction that decision should have to be made in. */
|
|
129
|
+
issues: AdmissionRuleSchema.default("hold"),
|
|
130
|
+
workspace: AdmissionRuleSchema.default("allow"),
|
|
131
|
+
workflow: z.enum(["allow", "deny"]).default("allow"),
|
|
132
|
+
});
|
|
133
|
+
export type AdmissionPolicy = z.infer<typeof AdmissionPolicySchema>;
|
|
134
|
+
// How tool calls are gated, the Claude Agent SDK's PermissionMode, narrowed to the four the composer offers
|
|
135
|
+
// (the SDK also has 'dontAsk'/'auto', which have no UI here). The user picks one per turn AND the agent can
|
|
136
|
+
// move itself between them mid-turn, so this is both a turn input and the payload of the `mode` frame.
|
|
137
|
+
export const PermissionModeSchema = z.enum(["default", "acceptEdits", "plan", "bypassPermissions"]);
|
|
138
|
+
export type PermissionMode = z.infer<typeof PermissionModeSchema>;
|
|
139
|
+
/* WHERE A CONVERSATION WAS CUT FROM, the durable half of a fork, carried on the registry entry so both ends
|
|
140
|
+
* can find each other. `index` is the message the cut sat above in the SOURCE, which is what lets the source's
|
|
141
|
+
* transcript put the mark back in the right gap. */
|
|
142
|
+
export const ForkedFromSchema = z.object({
|
|
143
|
+
conversationId: ConversationIdSchema,
|
|
144
|
+
index: z.number().int().nonnegative(),
|
|
145
|
+
// Which files this fork opened on, the half of the choice that used to be silent, kept so the fork can
|
|
146
|
+
// still say it tomorrow rather than only in the seconds after the click.
|
|
147
|
+
files: z.enum(["then", "now"]),
|
|
148
|
+
});
|
|
149
|
+
export type ForkedFrom = z.infer<typeof ForkedFromSchema>;
|
|
150
|
+
export const AgentTurnSchema = z
|
|
151
|
+
.object({
|
|
152
|
+
prompt: z.string().describe("What to say to the agent. May be empty if you are only attaching files."),
|
|
153
|
+
// The client's display title for the conversation, seeds a FRESH registry entry (so a renamed draft's
|
|
154
|
+
// first turn keeps its user-chosen title); an existing entry's title always wins.
|
|
155
|
+
title: z
|
|
156
|
+
.string()
|
|
157
|
+
.max(80)
|
|
158
|
+
.optional()
|
|
159
|
+
.describe("A title for a conversation this turn is opening. Ignored for a conversation that already has one."),
|
|
160
|
+
// Workspace-relative paths of files the user attached, already uploaded via /workspace/upload
|
|
161
|
+
// (the browser puts them under .intentic/records/artifacts/attachments/<uuid>/<name>). The daemon hands them to the
|
|
162
|
+
// provider: Claude reads them from disk via its Read tool; Codex gets images as native inputs.
|
|
163
|
+
attachments: z
|
|
164
|
+
.array(z.string().min(1))
|
|
165
|
+
.max(20)
|
|
166
|
+
.optional()
|
|
167
|
+
.describe("Files to hand the agent along with the prompt, as workspace paths. Upload them first."),
|
|
168
|
+
// Which provider (model + account) serves the turn; absent = claude. A sessionId only resumes on the
|
|
169
|
+
// provider that minted it (Claude Code sessions vs Codex threads vs Grok/OpenCode sessions are separate
|
|
170
|
+
// stores), a mid-conversation provider/account/harness switch sends `history` instead of resuming.
|
|
171
|
+
agent: AgentProviderSchema.optional().describe("Which model provider serves this turn. Leave it out for Claude."),
|
|
172
|
+
// Which harness (agentic loop) runs the turn, orthogonal to the provider above. Absent = "native": each
|
|
173
|
+
// provider on its own runtime (Claude Code SDK / Codex CLI / opencode) with its subscription OAuth.
|
|
174
|
+
// "claude-code" forces the Claude Code Agent SDK loop for ANY provider, codex/grok then drive their model
|
|
175
|
+
// through the sandbox's bundled Anthropic↔OpenAI translator, which needs that provider's API key (its
|
|
176
|
+
// subscription OAuth can't reach a gateway). For the claude provider the two are identical.
|
|
177
|
+
harness: AgentHarnessSchema.optional().describe("Which agentic loop runs the turn. Leave it out to use each provider's own."),
|
|
178
|
+
// Which connected account of that provider serves the turn; absent = the provider's first account.
|
|
179
|
+
account: z.string().optional().describe("Which of that provider's connected accounts pays for the turn. Leave it out for the first one."),
|
|
180
|
+
/* WHICH PERSONA THE TURN SHOWS THE OUTSIDE WORLD, a PersonaSchema id, deliberately NOT the `account`
|
|
181
|
+
* directly above it. The two words are one letter apart in meaning and a world apart in consequence:
|
|
182
|
+
* `account` is which subscription PAYS for the turn, `actsAs` is whose name is on what the turn posts.
|
|
183
|
+
* Naming both "account" is how someone eventually pins a nightly job to the right billing and the wrong
|
|
184
|
+
* Reddit.
|
|
185
|
+
*
|
|
186
|
+
* Absent means opposite things either side of the "is anyone watching" line, which is the owner's chosen
|
|
187
|
+
* posture and the reason this is resolved in one place (turnPersona): an ordinary chat with no persona
|
|
188
|
+
* keeps every connected account, because a person is there to catch a mistake; an `unattended` turn with
|
|
189
|
+
* no persona gets NONE, because at 3am the prompt's wording is the only thing left and that is not
|
|
190
|
+
* enough to bet an unrepeatable post on. */
|
|
191
|
+
actsAs: entryId.optional().describe("Which persona the turn speaks as out in the world. Not the same as which account pays for it."),
|
|
192
|
+
sessionId: z.string().optional().describe("Resume this provider session instead of starting a fresh one."),
|
|
193
|
+
// The client-minted stable conversation identity (survives provider/account/harness switches, which
|
|
194
|
+
// retire sessions). Keys the fleet registry entry and turn run, plus the worktree when isolated.
|
|
195
|
+
conversationId: ConversationIdSchema.optional().describe(
|
|
196
|
+
"The conversation this turn belongs to. You choose it, it survives model switches, and it is how you address the conversation later. Naming one that does not exist opens it.",
|
|
197
|
+
),
|
|
198
|
+
// When true, the turn runs in the conversation's isolated git worktree (created lazily on first use)
|
|
199
|
+
// instead of the shared /work tree, the parallel-agents mode. Requires conversationId.
|
|
200
|
+
isolated: z
|
|
201
|
+
.boolean()
|
|
202
|
+
.optional()
|
|
203
|
+
.describe(
|
|
204
|
+
"Work in this conversation's own private copy of the repos rather than the shared tree, so several agents can work at once. Needs a conversation id.",
|
|
205
|
+
),
|
|
206
|
+
/* WHERE the conversation executes, decided like `isolated` directly above: the request's choice on the
|
|
207
|
+
* first turn, the registry entry's on every turn after. `runner` implies isolation (the branch is what
|
|
208
|
+
* moves between machines) and needs a conversation id for the same reason `isolated` does. Absent =
|
|
209
|
+
* local. Design: docs/remote-runners-plan.md; refused until runners ship. */
|
|
210
|
+
placement: AgentPlacementSchema.optional().describe(
|
|
211
|
+
"Where this conversation runs: this sandbox (leave it out), or a paired runner by id. Decided on the first turn; later turns follow the conversation.",
|
|
212
|
+
),
|
|
213
|
+
/* Pin a NEW isolated conversation's worktree composition to these repository commits. Daemon-owned:
|
|
214
|
+
* ordinary chats omit it and keep rebasing onto the current workspace; a workflow supplies the one
|
|
215
|
+
* snapshot all of its candidates must share. Repeated iterations carry it too, which suppresses the
|
|
216
|
+
* ordinary pre-turn rebase for the lifetime of that workflow step. */
|
|
217
|
+
worktreeBase: z
|
|
218
|
+
.array(RepoBaseSchema)
|
|
219
|
+
.min(1)
|
|
220
|
+
.max(50)
|
|
221
|
+
.optional()
|
|
222
|
+
.describe(
|
|
223
|
+
"Pin a new private copy to these exact commits instead of today's workspace. Used when several agents must start from identical files.",
|
|
224
|
+
),
|
|
225
|
+
// Override landing for this turn only. Workflow steps set false so candidate branches cannot leak into
|
|
226
|
+
// the workspace before the synthesis step has compared them; ordinary turns inherit agent/workspace
|
|
227
|
+
// posture exactly as before.
|
|
228
|
+
autoLand: z
|
|
229
|
+
.boolean()
|
|
230
|
+
.optional()
|
|
231
|
+
.describe(
|
|
232
|
+
"Whether this turn's work merges into the workspace when it finishes. Overrides the conversation's own setting for this turn only.",
|
|
233
|
+
),
|
|
234
|
+
// Set ONLY by the daemon's own automation dispatchers: this turn opens a conversation on behalf of an
|
|
235
|
+
// outside message rather than a user. Recorded on the registry entry so the fleet can say where the
|
|
236
|
+
// agent came from. Requires conversationId, there is nothing to record it on otherwise.
|
|
237
|
+
origin: AgentOriginSchema.optional().describe(
|
|
238
|
+
"Set by the sandbox alone: this turn opened a conversation on behalf of a message from outside rather than a person.",
|
|
239
|
+
),
|
|
240
|
+
// No `history` field: a turn that switched provider/account/harness carries no transcript up the wire.
|
|
241
|
+
// The daemon seeds the replacement session from its OWN record of the conversation, which is keyed by
|
|
242
|
+
// conversationId and outlives every session (sessions/turn-transcript.ts → handoffHistory).
|
|
243
|
+
/* WHERE A FORK WAS CUT FROM, on its first turn, the one case the daemon cannot work out for itself,
|
|
244
|
+
* because a fork is a NEW conversation whose record is empty and the cut is a gesture only the client
|
|
245
|
+
* saw. `keep` counts the source's RECORD rows to copy, not its bubbles (see the web transcript's
|
|
246
|
+
* recordedRows). The daemon copies that prefix into the new conversation's record before the turn runs,
|
|
247
|
+
* after which a fork is an ordinary conversation: it seeds like any other and reads back in full.
|
|
248
|
+
* Requires conversationId, the fork it describes IS that conversation.
|
|
249
|
+
*
|
|
250
|
+
* `files` is the half the user actually chooses between, and the half that used to be silent. "now"
|
|
251
|
+
* inherits the workspace as it stands (the fork is a fresh line of conversation over today's files);
|
|
252
|
+
* "then" puts the fork on the files as they were AT THE CUT, which it can only do in a checkout of its
|
|
253
|
+
* own, so it implies `isolated`, and the daemon resolves the cut's per-repo commits from the source's
|
|
254
|
+
* own turn anchors rather than trusting the client with shas. A "then" fork of a conversation that has
|
|
255
|
+
* no anchor at that index falls back to "now" and says so on the turn, because silently starting from
|
|
256
|
+
* the wrong files is the failure this whole field exists to prevent. */
|
|
257
|
+
forkOf: z
|
|
258
|
+
.object({
|
|
259
|
+
conversationId: ConversationIdSchema.describe("The conversation this one was cut from."),
|
|
260
|
+
keep: z.number().int().nonnegative().describe("How many of that conversation's messages to copy in before this turn runs."),
|
|
261
|
+
files: z
|
|
262
|
+
.enum(["then", "now"])
|
|
263
|
+
.describe(
|
|
264
|
+
'Which files the fork opens on: "now" is the workspace as it stands, "then" is the files as they were at the cut, which needs a private copy.',
|
|
265
|
+
),
|
|
266
|
+
})
|
|
267
|
+
.optional()
|
|
268
|
+
.describe("Where this conversation was cut from, on its first turn only. Only the client knows this, so only the client can say it."),
|
|
269
|
+
// The browser sends the chosen model per turn; the provider token is the sandbox's own stored credential.
|
|
270
|
+
model: z.string().optional().describe("Which model to use. Leave it out for the provider's default."),
|
|
271
|
+
/* NOBODY PICKED A MODEL FOR THIS TURN, a surface started it (Fix with agent, a Maintenance chore, a
|
|
272
|
+
* Documentation or Acceptance run, the fix a failed pre-push check proposes) rather than a person at a
|
|
273
|
+
* composer. That is the whole distinction the flag carries, and it is why it cannot be inferred: a chat
|
|
274
|
+
* turn ALSO arrives with no `model` whenever the live catalog hasn't loaded yet, and the two want
|
|
275
|
+
* opposite defaults, the chat wants the provider's own catalog default, an unattended run wants the
|
|
276
|
+
* tier its owner chose for work that spends money while they are not watching.
|
|
277
|
+
*
|
|
278
|
+
* The daemon fills `agent`/`model`/`effort` from agentRunModels/agentRunEffort for any turn that says
|
|
279
|
+
* this and names none of them (startConversationTurn), walking that list until one can actually be
|
|
280
|
+
* started. Naming one still wins: every surface-started run now carries a caret that overrides the list
|
|
281
|
+
* for that run alone, and Acceptance picks per run because it fans a session out per story. Either way
|
|
282
|
+
* the pick is the user's, made a second ago. */
|
|
283
|
+
unattended: z
|
|
284
|
+
.boolean()
|
|
285
|
+
.optional()
|
|
286
|
+
.describe(
|
|
287
|
+
"Nobody chose a model for this turn because a screen started it rather than a person. The sandbox then fills in the model its owner picked for unwatched work.",
|
|
288
|
+
),
|
|
289
|
+
/* OUTSIDE CONTENT CAUSED THIS TURN, and what to call the source, "discord", "webchat", whichever
|
|
290
|
+
* listener provider carried the message. Set by the dispatchers that wake an agent on somebody else's
|
|
291
|
+
* words; absent for a turn the owner started, a schedule, or a workspace event.
|
|
292
|
+
*
|
|
293
|
+
* It is the birth half of the turn's taint (guard/turn-taint.ts). The other half marks itself as the
|
|
294
|
+
* turn works, a fetched page, a foreign MCP server's answer, and together they are what the command
|
|
295
|
+
* gate reads before letting a command read credential material unasked. Distinct from `unattended`,
|
|
296
|
+
* which is about whether anyone is WATCHING: a Front Desk wake is both, an owner asking the agent to read
|
|
297
|
+
* a web page is neither, and each flag governs a different decision. */
|
|
298
|
+
outsideWake: z
|
|
299
|
+
.string()
|
|
300
|
+
.min(1)
|
|
301
|
+
.optional()
|
|
302
|
+
.describe(
|
|
303
|
+
"Content from outside caused this turn, and what to call the source. It is what makes the sandbox treat the turn as carrying somebody else's words.",
|
|
304
|
+
),
|
|
305
|
+
// How tool calls are gated for this turn (the SDK's permissionMode, verbatim). 'plan' runs the
|
|
306
|
+
// propose → approve → execute flow; 'default' prompts per tool on the permission side channel;
|
|
307
|
+
// 'acceptEdits' auto-accepts file edits; 'bypassPermissions' runs everything. The agent can move
|
|
308
|
+
// itself between modes mid-turn (EnterPlanMode/ExitPlanMode), which rides back as a `mode` frame.
|
|
309
|
+
permissionMode: PermissionModeSchema.optional().describe(
|
|
310
|
+
"How tool calls are gated: ask each time, accept file edits, propose a plan first, or run everything. The agent can move itself between these mid-turn.",
|
|
311
|
+
),
|
|
312
|
+
/* Narrows the turn to these tool names (the SDK option of the same name, not to be confused with the
|
|
313
|
+
* daemon's MCP `tools`, which are servers). Absent ⇒ every tool the runtime has, which is what an
|
|
314
|
+
* owner-driven chat wants. Set by the automation dispatchers from Automation.allowedTools: a wake driven
|
|
315
|
+
* by an OUTSIDE message runs bypassPermissions like any other automation turn, so for a public Front Desk
|
|
316
|
+
* this list is the actual boundary, prompt wording is advice, an empty toolbox is not. */
|
|
317
|
+
allowedTools: z
|
|
318
|
+
.array(z.string().min(1))
|
|
319
|
+
.optional()
|
|
320
|
+
.describe(
|
|
321
|
+
"Narrow the turn to these tools. Leave it out for everything the runtime has. For a turn driven by an outside message this list is the real boundary, because prompt wording is only advice.",
|
|
322
|
+
),
|
|
323
|
+
effort: z.string().optional().describe("How hard the model should think, where the provider offers a choice."),
|
|
324
|
+
thinking: z.boolean().optional().describe("Whether to show the model's reasoning as it works."),
|
|
325
|
+
/* Ask the harness to serve this turn at fast speed, the same tokens at a higher rate, for a higher
|
|
326
|
+
* per-token price. A REQUEST, never a promise: the harness answers it against the plan, the model and
|
|
327
|
+
* the endpoint, and reports what it actually did on the `fast_mode` frame. Absent/false ⇒ standard
|
|
328
|
+
* speed, which is also what a runtime that doesn't declare the capability gets (turn-plan drops it).
|
|
329
|
+
*
|
|
330
|
+
* Not a sandbox setting, for the same reason effort isn't: it changes what a turn COSTS, so it belongs
|
|
331
|
+
* to the turn that spends it rather than to the workspace it ran in. */
|
|
332
|
+
fast: z
|
|
333
|
+
.boolean()
|
|
334
|
+
.optional()
|
|
335
|
+
.describe(
|
|
336
|
+
"Ask for the same work at a higher rate for a higher price. A request rather than a promise: the answer says what actually happened.",
|
|
337
|
+
),
|
|
338
|
+
/* KEEP THIS TURN ON THE MODEL I PICKED: the user's veto over automatic tier selection, riding the turn
|
|
339
|
+
* like `fast` does because it changes what the turn costs and so belongs to the turn rather than to the
|
|
340
|
+
* workspace. The judge still runs and the verdict is still recorded — a deny is the strongest label the
|
|
341
|
+
* calibration ledger ever gets (UsageTurn.tierDenied) — but nothing is substituted. The composer sends
|
|
342
|
+
* its conversation-level toggle here every turn, and the registry persists it beside `fast`, so the
|
|
343
|
+
* choice survives reopening the tab. Absent ⇒ no opinion, routing follows settings.autoTier. */
|
|
344
|
+
tierHold: z
|
|
345
|
+
.boolean()
|
|
346
|
+
.optional()
|
|
347
|
+
.describe(
|
|
348
|
+
"Run exactly the model that was picked, even when the turn looks simple enough for a cheaper one. The judgement is still recorded; nothing is substituted.",
|
|
349
|
+
),
|
|
350
|
+
// The opt-in editor context chip: what the user is looking at, folded into the prompt daemon-side.
|
|
351
|
+
editorContext: EditorContextSchema.optional().describe(
|
|
352
|
+
'What the user has open in their editor, folded into the prompt so that pointing words like "this" resolve.',
|
|
353
|
+
),
|
|
354
|
+
})
|
|
355
|
+
// An attachment-only send (no text) is legal; an entirely empty turn is not.
|
|
356
|
+
.refine((turn) => turn.prompt.trim().length > 0 || (turn.attachments?.length ?? 0) > 0, {
|
|
357
|
+
message: "prompt or attachments required",
|
|
358
|
+
})
|
|
359
|
+
.refine((turn) => turn.isolated !== true || turn.conversationId !== undefined, {
|
|
360
|
+
message: "isolated requires conversationId",
|
|
361
|
+
})
|
|
362
|
+
.refine((turn) => turn.worktreeBase === undefined || (turn.isolated === true && turn.conversationId !== undefined), {
|
|
363
|
+
message: "worktreeBase requires an isolated conversationId",
|
|
364
|
+
})
|
|
365
|
+
.refine((turn) => turn.origin === undefined || turn.conversationId !== undefined, {
|
|
366
|
+
message: "origin requires conversationId",
|
|
367
|
+
})
|
|
368
|
+
.refine((turn) => turn.forkOf === undefined || turn.conversationId !== undefined, {
|
|
369
|
+
message: "forkOf requires conversationId",
|
|
370
|
+
})
|
|
371
|
+
// A fork that wants the files as they were needs a checkout of its own to put them in, the shared tree is
|
|
372
|
+
// everyone else's too, and rolling it back under them is what `files: "then"` must never mean.
|
|
373
|
+
.refine((turn) => turn.forkOf?.files !== "then" || turn.isolated === true, {
|
|
374
|
+
message: 'forkOf.files "then" requires isolated',
|
|
375
|
+
});
|
|
376
|
+
export type AgentTurn = z.infer<typeof AgentTurnSchema>;
|
|
377
|
+
/* A MODEL CHOSEN FOR ONE SURFACE-STARTED RUN, what the caret on the shared run button (<AgentRunButton>) sends
|
|
378
|
+
* along with the click that starts it.
|
|
379
|
+
*
|
|
380
|
+
* Shared rather than re-declared per route because every surface that starts an agent for the user now carries
|
|
381
|
+
* that caret, and they must all mean the same thing by it: the pair rides onto the turn as `agent`/`model`, and
|
|
382
|
+
* the daemon's own fill step then leaves it alone (turn-resume.ts fills only what is absent). ABSENT is the
|
|
383
|
+
* ordinary case and the one to keep cheap, nobody touched the caret, so `agentRunModels` answers.
|
|
384
|
+
*
|
|
385
|
+
* Both halves or neither, because a model id is only meaningful to the provider that vends it: half a pick
|
|
386
|
+
* would send a Codex model id to Claude. Routes that accept this pass it through verbatim; a model this build
|
|
387
|
+
* has never heard of is a supported pick, since the picker offers a custom-id escape hatch. */
|
|
388
|
+
export const AgentRunPickSchema = z
|
|
389
|
+
.object({
|
|
390
|
+
agent: z.string().min(1).describe("Which provider."),
|
|
391
|
+
model: z
|
|
392
|
+
.string()
|
|
393
|
+
.min(1)
|
|
394
|
+
.describe("Which of its models. Both or neither, because a model name only means anything to the provider that serves it."),
|
|
395
|
+
})
|
|
396
|
+
.optional();
|
|
397
|
+
export type AgentRunPick = z.infer<typeof AgentRunPickSchema>;
|
|
398
|
+
// POST /agent's ack: the daemon-minted id of the detached turn run it started. The turn executes daemon-side
|
|
399
|
+
// regardless of any client connection; every window, the initiator included, renders it via /agent/attach.
|
|
400
|
+
export const StartedTurnSchema = z.object({
|
|
401
|
+
run: z.string().describe("The id of the run that just started. Hand it back when you attach, so the stream resumes rather than replaying."),
|
|
402
|
+
});
|
|
403
|
+
export type StartedTurn = z.infer<typeof StartedTurnSchema>;
|
|
404
|
+
// Attach to a conversation's turn run (live, or finished within the retention window). `run`+`after` is the
|
|
405
|
+
// resume cursor of a client whose stream dropped: frames after `after` replay when `run` still names the
|
|
406
|
+
// current run; a mismatch (a newer turn started meanwhile) replays that run from its first frame instead.
|
|
407
|
+
export const AttachTurnSchema = z.object({
|
|
408
|
+
conversationId: ConversationIdSchema.describe("Which conversation to watch."),
|
|
409
|
+
run: z
|
|
410
|
+
.string()
|
|
411
|
+
.optional()
|
|
412
|
+
.describe("The run you were watching. If a newer turn has started since, the stream replays that one from its beginning instead."),
|
|
413
|
+
after: z
|
|
414
|
+
.number()
|
|
415
|
+
.int()
|
|
416
|
+
.min(0)
|
|
417
|
+
.optional()
|
|
418
|
+
.describe(
|
|
419
|
+
"The last frame you already have. Everything after it replays, then the stream goes live. Leave it out to start from the beginning.",
|
|
420
|
+
),
|
|
421
|
+
});
|
|
422
|
+
export type AttachTurn = z.infer<typeof AttachTurnSchema>;
|