@intentic/sandbox-contract 1.232.0 → 1.233.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 +7 -2
- package/dist/agent-catalog.d.ts +2 -1
- package/dist/agent-catalog.d.ts.map +1 -1
- package/dist/agent-catalog.js +1 -1
- 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/probes.d.ts +1 -1
- package/dist/chores/probes.d.ts.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 +14 -0
- package/dist/command-classes.d.ts.map +1 -0
- package/dist/command-classes.js +168 -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.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.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 +42 -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/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 +45 -2
- 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 +20 -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/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 +124 -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 +1 -0
- package/dist/history-state.js.map +1 -1
- package/dist/index.d.ts +355 -103
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -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/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 +189 -0
- package/dist/schemas/agent.d.ts.map +1 -0
- package/dist/schemas/agent.js +170 -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 +736 -0
- package/dist/schemas/automations.d.ts.map +1 -0
- package/dist/schemas/automations.js +218 -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 +1014 -0
- package/dist/schemas/extension-updates.d.ts.map +1 -0
- package/dist/schemas/extension-updates.js +197 -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/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 +557 -0
- package/dist/schemas/maintenance.d.ts.map +1 -0
- package/dist/schemas/maintenance.js +201 -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 +548 -0
- package/dist/schemas/settings.d.ts.map +1 -0
- package/dist/schemas/settings.js +259 -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 +98 -0
- package/dist/schemas/webext.d.ts.map +1 -0
- package/dist/schemas/webext.js +36 -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 +13 -0
- package/dist/webext-links.d.ts.map +1 -0
- package/dist/webext-links.js +24 -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 +2 -2
- package/dist/workspace-state.d.ts.map +1 -1
- package/dist/workspace-state.js +2 -2
- package/dist/workspace-state.js.map +1 -1
- package/package.json +15 -4
- package/src/agent-catalog.test.ts +1 -1
- package/src/agent-catalog.ts +4 -11
- package/src/chores/chores.ts +1 -1
- package/src/chores/probes.ts +1 -1
- package/src/chores/stack.test.ts +19 -0
- package/src/chores/stack.ts +19 -3
- package/src/chores/verdict.test.ts +11 -1
- package/src/chores/verdict.ts +1 -1
- package/src/command-classes.test.ts +378 -0
- package/src/command-classes.ts +378 -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 +5 -5
- 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/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/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 +5 -0
- package/src/host-protocol.ts +1 -1
- package/src/hostnames.test.ts +2 -2
- package/src/index.ts +60 -1
- package/src/listener-protocol.ts +1 -1
- package/src/quick-model.ts +1 -1
- package/src/runner-protocol.ts +35 -5
- package/src/schemas/activity.ts +123 -0
- package/src/schemas/agent.ts +409 -0
- package/src/schemas/agents.ts +802 -0
- package/src/schemas/automations.ts +510 -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 +322 -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/logs.ts +96 -0
- package/src/schemas/loops.ts +401 -0
- package/src/schemas/maintenance.ts +421 -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 +932 -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 +286 -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 +79 -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/webext-links.ts +80 -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 +3 -3
- package/src/workspace-state.ts +8 -13
- 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
package/dist/schemas.js
DELETED
|
@@ -1,4288 +0,0 @@
|
|
|
1
|
-
import { STATE_DIR } from "@intentic/constants";
|
|
2
|
-
import { ExtensionManifestSchema } from "@intentic/extension-manifest";
|
|
3
|
-
import { RegistryEntrySchema } from "@intentic/registry";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import { OutputFieldsSchema } from "./output-fields.js";
|
|
6
|
-
import { AgentPlacementSchema } from "./runner-protocol.js";
|
|
7
|
-
export const OkSchema = z.object({
|
|
8
|
-
ok: z
|
|
9
|
-
.literal(true)
|
|
10
|
-
.describe("Always true. A route that answers this either did the thing or refused with a status; there is no third outcome to report."),
|
|
11
|
-
});
|
|
12
|
-
export const MemberRoleSchema = z.enum(["viewer", "collaborator", "maintainer", "owner"]);
|
|
13
|
-
export const GrantedRoleSchema = z.enum(["viewer", "collaborator", "maintainer"]);
|
|
14
|
-
const MEMBER_ROLE_RANK = { viewer: 0, collaborator: 1, maintainer: 2, owner: 3 };
|
|
15
|
-
export const roleAtLeast = (role, floor) => MEMBER_ROLE_RANK[role] >= MEMBER_ROLE_RANK[floor];
|
|
16
|
-
export const RepoParamSchema = z.object({
|
|
17
|
-
repo: z
|
|
18
|
-
.string()
|
|
19
|
-
.describe('Which repository. "root" is the workspace itself; anything else is a repository\'s folder relative to the workspace root, URL-encoded.'),
|
|
20
|
-
});
|
|
21
|
-
export const NATIVE_PROVIDERS = ["claude", "codex", "grok", "kimi", "gemini", "cursor"];
|
|
22
|
-
export const AgentProviderSchema = z.string().min(1);
|
|
23
|
-
export const NativeProviderParamSchema = z.object({ provider: z.enum(NATIVE_PROVIDERS) });
|
|
24
|
-
export const AgentHarnessSchema = z.enum(["native", "claude-code"]);
|
|
25
|
-
export const RepoBaseSchema = z.object({ repo: z.string(), base: z.string().min(1) });
|
|
26
|
-
export const EditorContextSchema = z.object({
|
|
27
|
-
file: z.string().min(1).describe("The file open in the editor, as a workspace path."),
|
|
28
|
-
startLine: z
|
|
29
|
-
.number()
|
|
30
|
-
.int()
|
|
31
|
-
.min(1)
|
|
32
|
-
.optional()
|
|
33
|
-
.describe("First line of the selection, counting from one. Leave both out when the whole file is the context."),
|
|
34
|
-
endLine: z.number().int().min(1).optional().describe("Last line of the selection, counting from one."),
|
|
35
|
-
selection: z
|
|
36
|
-
.string()
|
|
37
|
-
.max(20_000)
|
|
38
|
-
.optional()
|
|
39
|
-
.describe("The selected text itself. Cut it down before sending if it is long: this is context, not an upload."),
|
|
40
|
-
});
|
|
41
|
-
export const ConversationIdSchema = z.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/);
|
|
42
|
-
const entryId = z
|
|
43
|
-
.string()
|
|
44
|
-
.min(1)
|
|
45
|
-
.max(60)
|
|
46
|
-
.regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/);
|
|
47
|
-
export const AgentOriginSchema = z.object({
|
|
48
|
-
automationId: z.string(),
|
|
49
|
-
provider: z.string(),
|
|
50
|
-
channelId: z.string().optional(),
|
|
51
|
-
author: z.string().optional(),
|
|
52
|
-
});
|
|
53
|
-
export const WakeSourceSchema = z.enum(["schedule", "event", "listener", "webchat", "workspace", "workflow"]);
|
|
54
|
-
export const AdmissionRuleSchema = z.enum(["allow", "hold", "deny"]);
|
|
55
|
-
export const CommandClassSchema = z.enum([
|
|
56
|
-
"git.destructive",
|
|
57
|
-
"files.destructive",
|
|
58
|
-
"secrets.access",
|
|
59
|
-
"package.publish",
|
|
60
|
-
"network.outbound",
|
|
61
|
-
]);
|
|
62
|
-
export const AdmissionPolicySchema = z.object({
|
|
63
|
-
schedule: AdmissionRuleSchema.default("allow"),
|
|
64
|
-
event: AdmissionRuleSchema.default("allow"),
|
|
65
|
-
listener: AdmissionRuleSchema.default("allow"),
|
|
66
|
-
webchat: AdmissionRuleSchema.default("allow"),
|
|
67
|
-
workspace: AdmissionRuleSchema.default("allow"),
|
|
68
|
-
workflow: z.enum(["allow", "deny"]).default("allow"),
|
|
69
|
-
});
|
|
70
|
-
export const PermissionModeSchema = z.enum(["default", "acceptEdits", "plan", "bypassPermissions"]);
|
|
71
|
-
export const ForkedFromSchema = z.object({
|
|
72
|
-
conversationId: ConversationIdSchema,
|
|
73
|
-
index: z.number().int().nonnegative(),
|
|
74
|
-
files: z.enum(["then", "now"]),
|
|
75
|
-
});
|
|
76
|
-
export const AgentTurnSchema = z
|
|
77
|
-
.object({
|
|
78
|
-
prompt: z.string().describe("What to say to the agent. May be empty if you are only attaching files."),
|
|
79
|
-
title: z
|
|
80
|
-
.string()
|
|
81
|
-
.max(80)
|
|
82
|
-
.optional()
|
|
83
|
-
.describe("A title for a conversation this turn is opening. Ignored for a conversation that already has one."),
|
|
84
|
-
attachments: z
|
|
85
|
-
.array(z.string().min(1))
|
|
86
|
-
.max(20)
|
|
87
|
-
.optional()
|
|
88
|
-
.describe("Files to hand the agent along with the prompt, as workspace paths. Upload them first."),
|
|
89
|
-
agent: AgentProviderSchema.optional().describe("Which model provider serves this turn. Leave it out for Claude."),
|
|
90
|
-
harness: AgentHarnessSchema.optional().describe("Which agentic loop runs the turn. Leave it out to use each provider's own."),
|
|
91
|
-
account: z.string().optional().describe("Which of that provider's connected accounts pays for the turn. Leave it out for the first one."),
|
|
92
|
-
actsAs: entryId.optional().describe("Which persona the turn speaks as out in the world. Not the same as which account pays for it."),
|
|
93
|
-
sessionId: z.string().optional().describe("Resume this provider session instead of starting a fresh one."),
|
|
94
|
-
conversationId: ConversationIdSchema.optional().describe("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."),
|
|
95
|
-
isolated: z
|
|
96
|
-
.boolean()
|
|
97
|
-
.optional()
|
|
98
|
-
.describe("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."),
|
|
99
|
-
placement: AgentPlacementSchema.optional().describe("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."),
|
|
100
|
-
worktreeBase: z
|
|
101
|
-
.array(RepoBaseSchema)
|
|
102
|
-
.min(1)
|
|
103
|
-
.max(50)
|
|
104
|
-
.optional()
|
|
105
|
-
.describe("Pin a new private copy to these exact commits instead of today's workspace. Used when several agents must start from identical files."),
|
|
106
|
-
autoLand: z
|
|
107
|
-
.boolean()
|
|
108
|
-
.optional()
|
|
109
|
-
.describe("Whether this turn's work merges into the workspace when it finishes. Overrides the conversation's own setting for this turn only."),
|
|
110
|
-
origin: AgentOriginSchema.optional().describe("Set by the sandbox alone: this turn opened a conversation on behalf of a message from outside rather than a person."),
|
|
111
|
-
forkOf: z
|
|
112
|
-
.object({
|
|
113
|
-
conversationId: ConversationIdSchema.describe("The conversation this one was cut from."),
|
|
114
|
-
keep: z.number().int().nonnegative().describe("How many of that conversation's messages to copy in before this turn runs."),
|
|
115
|
-
files: z
|
|
116
|
-
.enum(["then", "now"])
|
|
117
|
-
.describe('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.'),
|
|
118
|
-
})
|
|
119
|
-
.optional()
|
|
120
|
-
.describe("Where this conversation was cut from, on its first turn only. Only the client knows this, so only the client can say it."),
|
|
121
|
-
model: z.string().optional().describe("Which model to use. Leave it out for the provider's default."),
|
|
122
|
-
unattended: z
|
|
123
|
-
.boolean()
|
|
124
|
-
.optional()
|
|
125
|
-
.describe("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."),
|
|
126
|
-
outsideWake: z
|
|
127
|
-
.string()
|
|
128
|
-
.min(1)
|
|
129
|
-
.optional()
|
|
130
|
-
.describe("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."),
|
|
131
|
-
permissionMode: PermissionModeSchema.optional().describe("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."),
|
|
132
|
-
allowedTools: z
|
|
133
|
-
.array(z.string().min(1))
|
|
134
|
-
.optional()
|
|
135
|
-
.describe("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."),
|
|
136
|
-
effort: z.string().optional().describe("How hard the model should think, where the provider offers a choice."),
|
|
137
|
-
thinking: z.boolean().optional().describe("Whether to show the model's reasoning as it works."),
|
|
138
|
-
fast: z
|
|
139
|
-
.boolean()
|
|
140
|
-
.optional()
|
|
141
|
-
.describe("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."),
|
|
142
|
-
tierHold: z
|
|
143
|
-
.boolean()
|
|
144
|
-
.optional()
|
|
145
|
-
.describe("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."),
|
|
146
|
-
editorContext: EditorContextSchema.optional().describe('What the user has open in their editor, folded into the prompt so that pointing words like "this" resolve.'),
|
|
147
|
-
})
|
|
148
|
-
.refine((turn) => turn.prompt.trim().length > 0 || (turn.attachments?.length ?? 0) > 0, {
|
|
149
|
-
message: "prompt or attachments required",
|
|
150
|
-
})
|
|
151
|
-
.refine((turn) => turn.isolated !== true || turn.conversationId !== undefined, {
|
|
152
|
-
message: "isolated requires conversationId",
|
|
153
|
-
})
|
|
154
|
-
.refine((turn) => turn.worktreeBase === undefined || (turn.isolated === true && turn.conversationId !== undefined), {
|
|
155
|
-
message: "worktreeBase requires an isolated conversationId",
|
|
156
|
-
})
|
|
157
|
-
.refine((turn) => turn.origin === undefined || turn.conversationId !== undefined, {
|
|
158
|
-
message: "origin requires conversationId",
|
|
159
|
-
})
|
|
160
|
-
.refine((turn) => turn.forkOf === undefined || turn.conversationId !== undefined, {
|
|
161
|
-
message: "forkOf requires conversationId",
|
|
162
|
-
})
|
|
163
|
-
.refine((turn) => turn.forkOf?.files !== "then" || turn.isolated === true, {
|
|
164
|
-
message: 'forkOf.files "then" requires isolated',
|
|
165
|
-
});
|
|
166
|
-
export const AgentRunPickSchema = z
|
|
167
|
-
.object({
|
|
168
|
-
agent: z.string().min(1).describe("Which provider."),
|
|
169
|
-
model: z
|
|
170
|
-
.string()
|
|
171
|
-
.min(1)
|
|
172
|
-
.describe("Which of its models. Both or neither, because a model name only means anything to the provider that serves it."),
|
|
173
|
-
})
|
|
174
|
-
.optional();
|
|
175
|
-
export const StartedTurnSchema = z.object({
|
|
176
|
-
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."),
|
|
177
|
-
});
|
|
178
|
-
export const AttachTurnSchema = z.object({
|
|
179
|
-
conversationId: ConversationIdSchema.describe("Which conversation to watch."),
|
|
180
|
-
run: z
|
|
181
|
-
.string()
|
|
182
|
-
.optional()
|
|
183
|
-
.describe("The run you were watching. If a newer turn has started since, the stream replays that one from its beginning instead."),
|
|
184
|
-
after: z
|
|
185
|
-
.number()
|
|
186
|
-
.int()
|
|
187
|
-
.min(0)
|
|
188
|
-
.optional()
|
|
189
|
-
.describe("The last frame you already have. Everything after it replays, then the stream goes live. Leave it out to start from the beginning."),
|
|
190
|
-
});
|
|
191
|
-
export const LoopContextSchema = z.enum(["fresh", "continue"]);
|
|
192
|
-
export const LoopOutputSchema = z.discriminatedUnion("kind", [
|
|
193
|
-
z.object({
|
|
194
|
-
kind: z
|
|
195
|
-
.literal("none")
|
|
196
|
-
.describe("It produces nothing but its work. The classic make the suite pass: what it leaves behind is a passing suite, and asking it to also file a report is asking it to spend a round on paperwork."),
|
|
197
|
-
}),
|
|
198
|
-
z.object({
|
|
199
|
-
kind: z
|
|
200
|
-
.literal("claim")
|
|
201
|
-
.describe("Each round says whether it is done and why. Structured prose: done is a value read rather than a sentence interpreted. Self-assessment, so advisory by construction; it exists because plenty of goals have no command that could check them."),
|
|
202
|
-
}),
|
|
203
|
-
z.object({
|
|
204
|
-
kind: z
|
|
205
|
-
.literal("json")
|
|
206
|
-
.describe("Each round writes a real answer in a shape you declared. This is the one that makes a step's output usable as the next step's input: a paragraph mentioning three files cannot be fed to anything, a list of three files can."),
|
|
207
|
-
fields: OutputFieldsSchema.describe("The shape that answer has to match."),
|
|
208
|
-
}),
|
|
209
|
-
]);
|
|
210
|
-
export const LoopCheckSchema = z.discriminatedUnion("kind", [
|
|
211
|
-
z.object({
|
|
212
|
-
kind: z
|
|
213
|
-
.literal("command")
|
|
214
|
-
.describe("Run something and see if it passes. Deterministic, free, and the only signal here whose answer does not come from a model. A passing test suite beats any amount of self-report."),
|
|
215
|
-
command: z.string().min(1).describe("The command to run in the conversation's own tree. Exiting cleanly means satisfied."),
|
|
216
|
-
}),
|
|
217
|
-
z.object({
|
|
218
|
-
kind: z
|
|
219
|
-
.literal("judge")
|
|
220
|
-
.describe("Put the question to a separate model with no tools, which reads the round's own report and rules on it, having done none of the work and nothing invested in its being finished."),
|
|
221
|
-
rubric: z.string().min(1).describe("What that judge is asked."),
|
|
222
|
-
model: z.string().optional().describe("Which model judges. Leave it out for the cheap one the other small jobs use."),
|
|
223
|
-
}),
|
|
224
|
-
]);
|
|
225
|
-
export const LoopDocumentSchema = z.object({
|
|
226
|
-
done: z.boolean().describe("Whether the goal is met. Reading this is the whole point of the file."),
|
|
227
|
-
reason: z.string().describe("Why, in one line. The most-read sentence in the feature: the next round reads it first and the history shows it."),
|
|
228
|
-
evidence: z
|
|
229
|
-
.string()
|
|
230
|
-
.optional()
|
|
231
|
-
.describe("What was checked to know that. Optional, so a round with nothing to point at says so by leaving it out rather than by inventing a sentence."),
|
|
232
|
-
data: z
|
|
233
|
-
.record(z.string(), z.unknown())
|
|
234
|
-
.optional()
|
|
235
|
-
.describe("The declared answer, for a loop that asked for one, checked against the shape it declared."),
|
|
236
|
-
});
|
|
237
|
-
const LOOP_ITERATIONS_MAX = 50;
|
|
238
|
-
export const LoopSchema = z.object({
|
|
239
|
-
conversationId: ConversationIdSchema.describe("The conversation to loop. It need not exist yet: naming a fresh one opens it, which is what lets run this until it passes be the first thing you ever say."),
|
|
240
|
-
goal: z
|
|
241
|
-
.string()
|
|
242
|
-
.min(1)
|
|
243
|
-
.describe("What done means, in your words. It goes into every round's instructions and into the judge's question, so the model is told the bar rather than left to infer it."),
|
|
244
|
-
prompt: z
|
|
245
|
-
.string()
|
|
246
|
-
.min(1)
|
|
247
|
-
.describe("What each round is asked to do. The suite passes is the goal; run the tests, take the top failure, fix it is the instruction."),
|
|
248
|
-
context: LoopContextSchema.describe("How each round meets the last. Starting fresh makes the files the memory rather than the conversation, so the twentieth round reads the tree as clearly as the first, and costs a re-read each time. Carrying on is cheaper and keeps the reasoning, which suits a short polish-this loop and degrades on long ones: a session that has spent eleven rounds arguing for its own approach is the worst available judge of whether that approach is finished."),
|
|
249
|
-
output: LoopOutputSchema,
|
|
250
|
-
checks: z
|
|
251
|
-
.array(LoopCheckSchema)
|
|
252
|
-
.describe("What else has to be true, all of them together. A list because the suite passes and the report is written is a real bar, and running it as two loops would do the work twice."),
|
|
253
|
-
maxIterations: z
|
|
254
|
-
.number()
|
|
255
|
-
.int()
|
|
256
|
-
.min(1)
|
|
257
|
-
.max(LOOP_ITERATIONS_MAX)
|
|
258
|
-
.describe("How many rounds before it gives up. A loop that has not got there in fifty is not one round short of it."),
|
|
259
|
-
maxSpendUsd: z
|
|
260
|
-
.number()
|
|
261
|
-
.positive()
|
|
262
|
-
.optional()
|
|
263
|
-
.describe("A ceiling on what the whole loop may spend, in dollars. Optional for a short loop somebody is watching, and strongly wanted otherwise: this is the first thing here that can keep spending with nobody pressing anything between rounds."),
|
|
264
|
-
stallLimit: z
|
|
265
|
-
.number()
|
|
266
|
-
.int()
|
|
267
|
-
.min(1)
|
|
268
|
-
.describe("Stop after this many rounds in a row that changed nothing on disk. The guard that matters most: a loop's failure is not runaway success, it is an agent re-reading the same three files, restating the same plan and declaring more work remains, eleven times. Every one of those rounds succeeds, so only the tree not moving catches it."),
|
|
269
|
-
isolated: z
|
|
270
|
-
.boolean()
|
|
271
|
-
.describe("Whether it works in the conversation's own private copy or in the shared tree. It also decides where a check runs: testing the shared tree would be testing code this loop has not merged yet."),
|
|
272
|
-
agent: AgentProviderSchema.optional().describe("Which provider the rounds run on. Absent falls back to the conversation's own last choice."),
|
|
273
|
-
harness: AgentHarnessSchema.optional().describe("Which agentic loop they run on."),
|
|
274
|
-
account: z.string().optional().describe("Which account pays."),
|
|
275
|
-
model: z.string().optional().describe("Which model."),
|
|
276
|
-
actsAs: entryId
|
|
277
|
-
.optional()
|
|
278
|
-
.describe("Which persona the rounds act as. It matters here: every round is unwatched, and an unwatched turn naming no persona reaches no signed-in account at all, so pinning one is how a loop gets hands."),
|
|
279
|
-
worktreeBase: z
|
|
280
|
-
.array(RepoBaseSchema)
|
|
281
|
-
.min(1)
|
|
282
|
-
.max(50)
|
|
283
|
-
.optional()
|
|
284
|
-
.describe("Pin the private copy to these exact commits, so a restart cannot quietly change what the loop is working on."),
|
|
285
|
-
autoLand: z.boolean().optional().describe("Whether the work merges as it goes."),
|
|
286
|
-
});
|
|
287
|
-
export const loopCanConverge = (loop) => loop.output.kind !== "none" || loop.checks.length > 0;
|
|
288
|
-
export const LOOP_DIR = `${STATE_DIR}/records/artifacts/loops`;
|
|
289
|
-
export const LoopIterationSchema = z.object({
|
|
290
|
-
n: z.number().int().min(1).describe("Which round this was."),
|
|
291
|
-
at: z.number().describe("When it ran, in milliseconds."),
|
|
292
|
-
outcome: z
|
|
293
|
-
.enum(["continue", "done", "error"])
|
|
294
|
-
.describe("How the round ended, which is not the same question as how the loop did. A round that errored does not end the loop by itself: a failing turn is often exactly what the next round is meant to fix."),
|
|
295
|
-
detail: z
|
|
296
|
-
.string()
|
|
297
|
-
.optional()
|
|
298
|
-
.describe("What the check said, in its own words. What a run history is actually read for: why it kept going, and why it stopped."),
|
|
299
|
-
costUsd: z.number().optional().describe("What the round cost, in dollars."),
|
|
300
|
-
changed: z.boolean().describe("Whether anything on disk moved. Three unchanged rounds in a row is the shape of a loop that is not working."),
|
|
301
|
-
sessionId: z.string().optional().describe("The session it ran on, and the way from a history row to a readable record."),
|
|
302
|
-
});
|
|
303
|
-
export const LoopStateSchema = z.enum(["running", "done", "exhausted", "stalled", "overspent", "stopped", "error"]);
|
|
304
|
-
export const LoopRecordSchema = LoopSchema.extend({
|
|
305
|
-
state: LoopStateSchema.describe("How it ended, and each of these is a different thing to be told. Out of rounds says give it more room; stalled says it is not making progress and more room will not help. Overspent, stopped by a person, and the loop itself failing are all their own answers."),
|
|
306
|
-
startedAt: z.number().describe("When it began, in milliseconds."),
|
|
307
|
-
endedAt: z.number().optional().describe("When it ended, in milliseconds."),
|
|
308
|
-
resumed: z
|
|
309
|
-
.number()
|
|
310
|
-
.int()
|
|
311
|
-
.min(0)
|
|
312
|
-
.describe("How many times the sandbox restarted under it and picked it back up. Counted rather than flagged, so a loop whose round reliably kills the sandbox is not resurrected on every boot for ever."),
|
|
313
|
-
detail: z.string().optional().describe("Why it ended, for the endings whose reason is not in their name."),
|
|
314
|
-
iterations: z
|
|
315
|
-
.array(LoopIterationSchema)
|
|
316
|
-
.describe("Every round, in order. Why it stopped at the fourth is the question a loop gets read for, and this is the answer."),
|
|
317
|
-
});
|
|
318
|
-
export const LoopsListSchema = z.object({
|
|
319
|
-
loops: z.array(LoopRecordSchema).describe("Every loop this workspace has run, newest first, kept after they end."),
|
|
320
|
-
});
|
|
321
|
-
export const LoopIdParamSchema = z.object({ conversationId: ConversationIdSchema.describe("Which conversation's loop.") });
|
|
322
|
-
export const LoopDesignSchema = z.object({
|
|
323
|
-
id: entryId.describe("The design's id."),
|
|
324
|
-
name: z.string().min(1).max(60).describe("What to call it. Short, because it has to be readable on a small badge."),
|
|
325
|
-
description: z.string().max(280).optional().describe("What it is for, in one line. Optional, because a well-named loop has already said it."),
|
|
326
|
-
prompt: z
|
|
327
|
-
.string()
|
|
328
|
-
.optional()
|
|
329
|
-
.describe("What each round is asked to do, when that is worth saying separately from the goal. Absent means each round works towards the goal however it sees fit."),
|
|
330
|
-
context: LoopContextSchema.describe("How each round meets the last: starting clean, or carrying on."),
|
|
331
|
-
output: LoopOutputSchema.describe("What it has to produce."),
|
|
332
|
-
checks: z.array(LoopCheckSchema).describe("What else has to be true."),
|
|
333
|
-
maxIterations: z.number().int().min(1).max(LOOP_ITERATIONS_MAX).describe("How many rounds before it gives up."),
|
|
334
|
-
maxSpendUsd: z.number().positive().optional().describe("A ceiling on what it may spend, in dollars."),
|
|
335
|
-
stallLimit: z.number().int().min(1).describe("Stop after this many rounds in a row that changed nothing."),
|
|
336
|
-
});
|
|
337
|
-
export const LoopDesignsListSchema = z.object({
|
|
338
|
-
designs: z
|
|
339
|
-
.array(LoopDesignSchema)
|
|
340
|
-
.describe("Saved loops: the machinery with the goal left out, so one design can be pointed at a different job every time."),
|
|
341
|
-
});
|
|
342
|
-
export const LoopDesignSaveSchema = z.object({
|
|
343
|
-
design: LoopDesignSchema.describe("The design to write."),
|
|
344
|
-
create: z
|
|
345
|
-
.boolean()
|
|
346
|
-
.describe("Whether you mean to make a new one or replace an existing one, so an id that happens to collide cannot silently overwrite the one you had."),
|
|
347
|
-
});
|
|
348
|
-
export const LoopDesignIdParamSchema = z.object({ id: entryId.describe("Which saved loop.") });
|
|
349
|
-
export const loopFromDesign = (design, aim) => ({
|
|
350
|
-
conversationId: aim.conversationId,
|
|
351
|
-
goal: aim.goal,
|
|
352
|
-
prompt: design.prompt ?? "Work towards the goal above. Do the next most useful thing.",
|
|
353
|
-
context: design.context,
|
|
354
|
-
output: design.output,
|
|
355
|
-
checks: design.checks,
|
|
356
|
-
maxIterations: design.maxIterations,
|
|
357
|
-
...(design.maxSpendUsd === undefined ? {} : { maxSpendUsd: design.maxSpendUsd }),
|
|
358
|
-
stallLimit: design.stallLimit,
|
|
359
|
-
isolated: aim.isolated,
|
|
360
|
-
});
|
|
361
|
-
export const loopDesignLine = (design) => {
|
|
362
|
-
const command = design.checks.find((check) => check.kind === "command");
|
|
363
|
-
const ends = command !== undefined
|
|
364
|
-
? command.command
|
|
365
|
-
: design.checks.some((check) => check.kind === "judge")
|
|
366
|
-
? "a reviewer agrees"
|
|
367
|
-
: design.output.kind === "none"
|
|
368
|
-
? "nothing checks it"
|
|
369
|
-
: "the agent says so";
|
|
370
|
-
const ceilings = [`${design.maxIterations} rounds`, design.maxSpendUsd === undefined ? `` : `$${design.maxSpendUsd}`].filter((part) => part !== ``);
|
|
371
|
-
return [ends, ...ceilings].join(" · ");
|
|
372
|
-
};
|
|
373
|
-
export const AgentStatusSchema = z.enum([
|
|
374
|
-
"idle",
|
|
375
|
-
"running",
|
|
376
|
-
"awaiting",
|
|
377
|
-
"stopping",
|
|
378
|
-
"stopped",
|
|
379
|
-
"resuming",
|
|
380
|
-
"ready",
|
|
381
|
-
"landed",
|
|
382
|
-
"conflict",
|
|
383
|
-
"error",
|
|
384
|
-
"interrupted",
|
|
385
|
-
]);
|
|
386
|
-
export const AgentActivitySchema = z.object({
|
|
387
|
-
tool: z.string().optional().describe("The last tool it reached for."),
|
|
388
|
-
target: z.string().optional().describe("What it reached for that tool with: a file, a command, a URL."),
|
|
389
|
-
todo: z.string().optional().describe("The item on its own list that it is working through."),
|
|
390
|
-
});
|
|
391
|
-
export const AgentAttentionSchema = z.object({
|
|
392
|
-
plan: z.boolean().describe("It has proposed a plan and is waiting for a yes."),
|
|
393
|
-
question: z.boolean().describe("It has asked you something."),
|
|
394
|
-
permission: z.boolean().describe("It wants to use a tool it needs permission for."),
|
|
395
|
-
service: z
|
|
396
|
-
.boolean()
|
|
397
|
-
.describe("It wants to spend money on a paid service and is waiting for approval. The one pause where waiting costs it the whole call."),
|
|
398
|
-
capability: z.boolean().describe("It needs something connected that is not connected yet."),
|
|
399
|
-
conflict: z.boolean().describe("Its work cannot be merged without somebody resolving a clash."),
|
|
400
|
-
});
|
|
401
|
-
export const LandedMessageSchema = z.object({
|
|
402
|
-
subject: z
|
|
403
|
-
.string()
|
|
404
|
-
.describe("One line saying what the merged work did, read off the code rather than off the opening request. A conversation that asks for an audit and then spends four turns fixing what it found needs a subject about the fixes."),
|
|
405
|
-
note: z
|
|
406
|
-
.string()
|
|
407
|
-
.optional()
|
|
408
|
-
.describe("The same change said to somebody who uses the product, for a repository that keeps a changelog. Usually absent, because most changes are not ones a user would notice."),
|
|
409
|
-
breaking: z
|
|
410
|
-
.string()
|
|
411
|
-
.optional()
|
|
412
|
-
.describe("What this change takes away, for anything already relying on it. Nearly always absent: it is for removals, not for additions."),
|
|
413
|
-
});
|
|
414
|
-
export const LandedMessageStepSchema = z.object({
|
|
415
|
-
provider: z.string().min(1).describe("Which provider was asked."),
|
|
416
|
-
model: z.string().min(1).describe("Which of its models."),
|
|
417
|
-
status: z
|
|
418
|
-
.enum(["asking", "answered", "refused", "skipped"])
|
|
419
|
-
.describe("How this one went. Skipped means it was not asked at all, because it refused a few minutes ago and the walk stepped over it."),
|
|
420
|
-
at: z.number().optional().describe("When it started being asked, in milliseconds. Absent for one that was skipped, which cost no time."),
|
|
421
|
-
ms: z.number().optional().describe("How long it took. Absent while it is still being asked."),
|
|
422
|
-
reason: z.string().optional().describe("Why it refused, in its own words."),
|
|
423
|
-
});
|
|
424
|
-
export const LandedMessageDraftSchema = z.object({
|
|
425
|
-
startedAt: z.number().describe("When the drafting began, in milliseconds."),
|
|
426
|
-
steps: z
|
|
427
|
-
.array(LandedMessageStepSchema)
|
|
428
|
-
.describe("Each model that was asked, in the order they were spent, so the list is the timeline. Empty with no outcome means the diff is still being read."),
|
|
429
|
-
outcome: z.enum(["written", "failed"]).optional().describe("How it ended. Absent means it is still going."),
|
|
430
|
-
reason: z
|
|
431
|
-
.string()
|
|
432
|
-
.optional()
|
|
433
|
-
.describe("The one-line account of a failure, for a screen with one line to spend. The steps carry each model's own words."),
|
|
434
|
-
finishedAt: z.number().optional().describe("When it ended, in milliseconds."),
|
|
435
|
-
});
|
|
436
|
-
export const AgentSummarySchema = z.object({
|
|
437
|
-
id: z.string().describe("The conversation id, which is how every other call addresses it."),
|
|
438
|
-
sessionId: z.string().optional().describe("The provider session behind the last turn. It is retired whenever the model or account changes."),
|
|
439
|
-
title: z.string().optional().describe("What to call it: the first prompt cut to one line, unless somebody renamed it."),
|
|
440
|
-
status: AgentStatusSchema.describe("What it is doing. Stopping and stopped are the two halves of somebody pressing stop, because a cancel is not instant; resuming means the sandbox is already putting right whatever killed the turn."),
|
|
441
|
-
failure: z
|
|
442
|
-
.string()
|
|
443
|
-
.optional()
|
|
444
|
-
.describe("Why the last turn failed, in the words it died on. Absent unless it did, and cleared the moment it runs again. Carried here because the word error on its own is not an answer, least of all for a run nobody was watching."),
|
|
445
|
-
provider: AgentProviderSchema.describe("Which model provider it runs on."),
|
|
446
|
-
harness: AgentHarnessSchema.describe("Which agentic loop it runs on."),
|
|
447
|
-
model: z
|
|
448
|
-
.string()
|
|
449
|
-
.optional()
|
|
450
|
-
.describe("What its last turn ran with. Kept per conversation so opening it restores the choices made in it, rather than whatever some other tab last picked."),
|
|
451
|
-
effort: z.string().optional().describe("How hard that turn was told to think."),
|
|
452
|
-
thinking: z.boolean().optional().describe("Whether that turn showed its reasoning."),
|
|
453
|
-
fast: z.boolean().optional().describe("Whether that turn asked for higher speed. What was asked for, not what was served."),
|
|
454
|
-
tier: z
|
|
455
|
-
.enum(["fast", "standard"])
|
|
456
|
-
.optional()
|
|
457
|
-
.describe("How hard its last turn looked to the complexity judge. What the next turn's preview needs, not what actually ran."),
|
|
458
|
-
tierHold: z
|
|
459
|
-
.boolean()
|
|
460
|
-
.optional()
|
|
461
|
-
.describe("Whether this conversation is pinned to the picked model, so a turn that looks simple is never moved to a cheaper one."),
|
|
462
|
-
account: z.string().optional().describe("Which connected account paid for it."),
|
|
463
|
-
branch: z.string().optional().describe("The branch its private copy works on. Absent for a conversation that works directly in the shared tree."),
|
|
464
|
-
autoLand: z
|
|
465
|
-
.boolean()
|
|
466
|
-
.optional()
|
|
467
|
-
.describe("This conversation's own answer to whether its work merges automatically. Absent means it follows the sandbox-wide setting, which is the common case."),
|
|
468
|
-
resumeAfterOutage: z.boolean().optional(),
|
|
469
|
-
landRequested: z
|
|
470
|
-
.object({
|
|
471
|
-
email: z.string().describe("Who asked."),
|
|
472
|
-
name: z.string().optional().describe("Their display name."),
|
|
473
|
-
at: z.number().describe("When they asked, in milliseconds."),
|
|
474
|
-
})
|
|
475
|
-
.optional()
|
|
476
|
-
.describe("A collaborator has asked a maintainer to merge this work. Cleared by whichever merge or discard answers it. Absent means nobody is waiting."),
|
|
477
|
-
origin: AgentOriginSchema.optional().describe("Where the conversation came from when nobody typed it: a chat mention, a visitor's message, a webhook. Absent means a person started it."),
|
|
478
|
-
forkedFrom: ForkedFromSchema.optional().describe("The conversation this one was cut from. Recorded once and never cleared: it is the relationship, not a pending state."),
|
|
479
|
-
base: z.string().optional().describe("The commit its private copy started from, shortened."),
|
|
480
|
-
costUsd: z.number().optional().describe("What it has cost so far, in dollars. A helper agent's spend is its own and is not folded in here."),
|
|
481
|
-
inputTokens: z.number().optional().describe("Tokens sent."),
|
|
482
|
-
outputTokens: z.number().optional().describe("Tokens received."),
|
|
483
|
-
contextTokens: z.number().optional().describe("How much of the window the conversation currently fills."),
|
|
484
|
-
contextWindow: z.number().optional().describe("How large that window is."),
|
|
485
|
-
activity: AgentActivitySchema.optional().describe("What it is doing at this moment."),
|
|
486
|
-
landedMessageDraft: LandedMessageDraftSchema.optional().describe("The whole story of this merge's commit message being written: which models were asked, how long each took, what refused and in what words. Forgotten on restart, which is right, because a restart also killed the drafting it describes."),
|
|
487
|
-
landedMessage: LandedMessageSchema.optional().describe("What this conversation's merged work is called, once the drafting above has finished. It arrives on the same push that ends the draft, so the promise and the answer travel together."),
|
|
488
|
-
startedAt: z.number().optional().describe("When the running turn started, in milliseconds. Absent when none is running."),
|
|
489
|
-
updatedAt: z.number().describe("When it last did something, in milliseconds. Reading it does not count."),
|
|
490
|
-
seenAt: z
|
|
491
|
-
.number()
|
|
492
|
-
.optional()
|
|
493
|
-
.describe("When somebody last opened it, in milliseconds. Newer activity than this is what makes it unread. Kept by the sandbox rather than by a browser, so clearing site data or picking up a phone does not resurrect every badge."),
|
|
494
|
-
attention: AgentAttentionSchema.describe("Which kinds of waiting-for-you it is doing."),
|
|
495
|
-
turns: z.number().optional().describe("Turns it has finished."),
|
|
496
|
-
toolUses: z.number().optional().describe("Tools it has used, over its whole life."),
|
|
497
|
-
subagents: z
|
|
498
|
-
.object({
|
|
499
|
-
running: z.number().describe("Helpers working right now."),
|
|
500
|
-
total: z.number().describe("Helpers it has started over its whole life."),
|
|
501
|
-
})
|
|
502
|
-
.optional()
|
|
503
|
-
.describe("Helper agents this one delegated to. Absent means it never has, which is most conversations. Their spend is their own and is not folded into this conversation's cost."),
|
|
504
|
-
diff: z
|
|
505
|
-
.object({
|
|
506
|
-
files: z.number().describe("Files touched."),
|
|
507
|
-
insertions: z.number().describe("Lines added."),
|
|
508
|
-
deletions: z.number().describe("Lines removed."),
|
|
509
|
-
})
|
|
510
|
-
.optional()
|
|
511
|
-
.describe("Everything it has written, measured from where it started. Independent of how much has been merged."),
|
|
512
|
-
landedPresence: z
|
|
513
|
-
.object({
|
|
514
|
-
landed: z.number().describe("Paths this conversation merged in."),
|
|
515
|
-
present: z.number().describe("How many of them are still there, either pending or committed."),
|
|
516
|
-
})
|
|
517
|
-
.optional()
|
|
518
|
-
.describe("Present only when some of what it merged has since been thrown away. Absent is the steady state: its presence is the signal, so an ordinary card spends no line on it."),
|
|
519
|
-
loop: z
|
|
520
|
-
.object({
|
|
521
|
-
state: LoopStateSchema.describe("How the loop is going."),
|
|
522
|
-
iteration: z.number().int().min(0).describe("Which round it is on."),
|
|
523
|
-
maxIterations: z.number().int().min(1).describe("How many rounds it will attempt before giving up."),
|
|
524
|
-
goal: z.string().describe("What it is looping towards."),
|
|
525
|
-
})
|
|
526
|
-
.optional()
|
|
527
|
-
.describe("The loop driving this conversation, if one is. Absent for an ordinary conversation, which is nearly all of them."),
|
|
528
|
-
workflow: z
|
|
529
|
-
.object({
|
|
530
|
-
runId: z.string().describe("The run this belongs to, which is how a board groups its steps together."),
|
|
531
|
-
name: z.string().describe("The workflow's name."),
|
|
532
|
-
step: z.string().describe("Which step this conversation is on now. It moves when steps are chained."),
|
|
533
|
-
index: z.number().int().min(1).describe("This step's place in the workflow, counting from one."),
|
|
534
|
-
total: z.number().int().min(1).describe("How many steps the workflow has."),
|
|
535
|
-
})
|
|
536
|
-
.optional()
|
|
537
|
-
.describe("The workflow run this conversation is a step of. Without it, a four-step run reads as four unrelated conversations that happen to have started together."),
|
|
538
|
-
watches: z
|
|
539
|
-
.array(z.object({
|
|
540
|
-
id: z.string().describe("The daemon's handle for this watch, the same one the agent was given when it armed it."),
|
|
541
|
-
note: z.string().describe("The agent's own line on what it is waiting for."),
|
|
542
|
-
intervalSeconds: z.number().int().min(1).describe("How often the check runs."),
|
|
543
|
-
deadlineAt: z.number().describe("When it gives up and wakes the conversation anyway, in milliseconds. Every watch has one."),
|
|
544
|
-
}))
|
|
545
|
-
.optional()
|
|
546
|
-
.describe("Outside conditions this conversation is parked on, each of which will wake it. Absent means none, which is nearly every conversation: an armed watch is why a finished-looking agent starts working by itself, and why a hosted machine will not go idle."),
|
|
547
|
-
archivedAt: z
|
|
548
|
-
.number()
|
|
549
|
-
.optional()
|
|
550
|
-
.describe("When it was put away, in milliseconds. Nothing was lost: its branch, its record and every counter stayed, and bringing it back gives it a fresh working copy. Absent means it is live on the board."),
|
|
551
|
-
});
|
|
552
|
-
export const AgentIdSchema = z.object({ id: z.string().min(1).describe("Which conversation.") });
|
|
553
|
-
export const AgentArchiveSchema = z.object({
|
|
554
|
-
ids: z
|
|
555
|
-
.array(z.string().min(1))
|
|
556
|
-
.max(500)
|
|
557
|
-
.optional()
|
|
558
|
-
.describe("Which conversations to put away. Leave it out for every finished one that can be archived right now."),
|
|
559
|
-
});
|
|
560
|
-
export const AgentIdsSchema = z.object({ ids: z.array(z.string().min(1)).min(1).max(500).describe("Which conversations.") });
|
|
561
|
-
export const AgentsMovedSchema = z.object({
|
|
562
|
-
moved: z
|
|
563
|
-
.array(AgentSummarySchema)
|
|
564
|
-
.describe("What actually moved, whole, rather than the fleet afterwards. Two archives finishing at once would each carry a snapshot from a different instant, and swapping one in wholesale would let the slower answer resurrect what the faster one just filed away."),
|
|
565
|
-
rev: z
|
|
566
|
-
.number()
|
|
567
|
-
.describe("The version of the fleet that includes this move, so a caller can hold its own optimistic change until it sees a list at least that new."),
|
|
568
|
-
});
|
|
569
|
-
export const AgentsArchivedSchema = AgentsMovedSchema.extend({
|
|
570
|
-
failed: z
|
|
571
|
-
.array(z.object({
|
|
572
|
-
id: z.string().describe("Which conversation stayed on the board."),
|
|
573
|
-
reason: z.string().describe("Why its working copy could not be released, in the words the failure came with."),
|
|
574
|
-
}))
|
|
575
|
-
.describe("The conversations this press could not put away, each with the reason, so the board can say it instead of reporting silence."),
|
|
576
|
-
});
|
|
577
|
-
export const AgentsRemovedSchema = z.object({
|
|
578
|
-
removed: z
|
|
579
|
-
.array(z.string())
|
|
580
|
-
.describe("Which conversations were deleted, as ids. Ids rather than whole cards, because these no longer exist anywhere: there is nothing left to show and nothing to put back."),
|
|
581
|
-
});
|
|
582
|
-
export const AgentSearchQuerySchema = z.object({
|
|
583
|
-
query: z
|
|
584
|
-
.string()
|
|
585
|
-
.trim()
|
|
586
|
-
.min(2)
|
|
587
|
-
.describe("What to look for. Searched against what was said, both sides of the conversation, and nothing else: not the thinking, not the tool output, which between them name nearly every identifier in the workspace and would return most of the board."),
|
|
588
|
-
caseSensitive: z.stringbool().optional().describe("Whether capitals matter."),
|
|
589
|
-
});
|
|
590
|
-
export const SpeakerSchema = z.enum(["user", "agent"]);
|
|
591
|
-
export const MatchSnippetSchema = z.object({
|
|
592
|
-
text: z.string().describe("The matching line, with a little either side of it."),
|
|
593
|
-
speaker: SpeakerSchema.describe("Who said it. Carried with the words rather than beside them, because a line of the agent's prose under a card reads as something you typed until the row says otherwise."),
|
|
594
|
-
});
|
|
595
|
-
export const AgentMatchSchema = z.object({
|
|
596
|
-
id: z.string().describe("Which conversation matched."),
|
|
597
|
-
snippet: MatchSnippetSchema.optional().describe("Why, in its own words. Absent when the title was the match, which the card already shows: repeating it underneath is noise where evidence was wanted."),
|
|
598
|
-
});
|
|
599
|
-
export const AgentSearchResultSchema = z.object({
|
|
600
|
-
matches: z.array(AgentMatchSchema).describe("What matched, from the live fleet and the archive together."),
|
|
601
|
-
scanned: z
|
|
602
|
-
.number()
|
|
603
|
-
.describe("How many conversations were actually read, so a screen can say when a search saw less than everything rather than implying it saw all of it."),
|
|
604
|
-
indexing: z
|
|
605
|
-
.boolean()
|
|
606
|
-
.describe("Whether what was said is still being read in the background. True means this answer can still grow, so a screen must say it is incomplete rather than presenting it as the whole list."),
|
|
607
|
-
});
|
|
608
|
-
export const AgentRenameSchema = z.object({
|
|
609
|
-
id: z.string().min(1).describe("Which conversation."),
|
|
610
|
-
title: z.string().trim().min(1).max(80).describe("What to call it from now on."),
|
|
611
|
-
});
|
|
612
|
-
export const AgentPlaceSchema = z.object({
|
|
613
|
-
id: z.string().min(1).describe("Which conversation."),
|
|
614
|
-
text: z
|
|
615
|
-
.string()
|
|
616
|
-
.trim()
|
|
617
|
-
.min(1)
|
|
618
|
-
.max(8_000)
|
|
619
|
-
.describe("The words to put in the agent's mouth. Bounded just above what the next turn can carry whole, because a line too long to be handed over intact would reach the agent truncated and quietly break the very thing this is for."),
|
|
620
|
-
});
|
|
621
|
-
export const AgentAutoLandSchema = z.object({
|
|
622
|
-
id: z.string().min(1).describe("Which conversation."),
|
|
623
|
-
autoLand: z
|
|
624
|
-
.boolean()
|
|
625
|
-
.nullable()
|
|
626
|
-
.describe("Whether its work merges automatically when a turn finishes. Null clears the override and goes back to following the sandbox-wide setting, so a conversation does not sit holding a frozen copy of a default it has quietly stopped following."),
|
|
627
|
-
});
|
|
628
|
-
export const AgentResumeAfterOutageSchema = z.object({
|
|
629
|
-
id: z.string().min(1).describe("Which conversation."),
|
|
630
|
-
resumeAfterOutage: z
|
|
631
|
-
.boolean()
|
|
632
|
-
.nullable()
|
|
633
|
-
.describe("Whether it retries by itself when the model provider was what failed. Null clears the override back to the sandbox-wide setting."),
|
|
634
|
-
});
|
|
635
|
-
export const AgentFileDiffQuerySchema = z.object({
|
|
636
|
-
id: z.string().min(1).describe("Which conversation."),
|
|
637
|
-
repo: z.string().min(1).describe("Which repository."),
|
|
638
|
-
path: z.string().min(1).describe("Which file, relative to that repository."),
|
|
639
|
-
});
|
|
640
|
-
export const LandConflictReasonSchema = z.enum(["workspace", "diverged", "binary"]);
|
|
641
|
-
export const LandConflictPathSchema = z.object({
|
|
642
|
-
path: z.string().describe("Which file."),
|
|
643
|
-
reason: LandConflictReasonSchema.describe("Why it would not merge, and the three have nothing in common but the symptom. Your own uncommitted edits on that path, where yours is the copy at risk. The shared tree having moved under the conversation since it started, where nothing of yours is at risk. Or a file git cannot merge at all, where no automatic answer exists."),
|
|
644
|
-
});
|
|
645
|
-
export const LandConflictSchema = z.object({
|
|
646
|
-
repo: z.string().describe("Which repository."),
|
|
647
|
-
paths: z
|
|
648
|
-
.array(LandConflictPathSchema)
|
|
649
|
-
.describe("The files that genuinely would not apply. Not the whole change: reporting everything whenever the cause could not be pinned down turned four real conflicts into a wall of fourteen."),
|
|
650
|
-
clean: z
|
|
651
|
-
.number()
|
|
652
|
-
.describe("How many files would apply regardless, so a screen can say how much is being held back by how little and offer to take it. Zero alongside an empty list means the repository could not be reached at all."),
|
|
653
|
-
mainBranch: z
|
|
654
|
-
.string()
|
|
655
|
-
.optional()
|
|
656
|
-
.describe("The branch your own checkout is on, which is what the conversation has to rebase onto. Carried because only the sandbox can see it. Absent where there is no name to give."),
|
|
657
|
-
});
|
|
658
|
-
export const LandResultSchema = z.object({
|
|
659
|
-
landed: z.boolean().describe("Whether anything was applied."),
|
|
660
|
-
conflicts: z.array(LandConflictSchema).optional().describe("What stopped it, per repository."),
|
|
661
|
-
resolving: z
|
|
662
|
-
.array(z.object({
|
|
663
|
-
repo: z.string().describe("Which repository."),
|
|
664
|
-
paths: z.array(z.string()).describe("Which files now hold conflict markers to sort out by hand."),
|
|
665
|
-
}))
|
|
666
|
-
.optional()
|
|
667
|
-
.describe("Files left half-merged, when you asked for the mode that lands what it can and leaves the rest marked up."),
|
|
668
|
-
held: z
|
|
669
|
-
.boolean()
|
|
670
|
-
.optional()
|
|
671
|
-
.describe("Nothing was applied and nothing failed: there is work waiting on the branch for a deliberate merge. Not merged on its own cannot say that, because on its own it means refused."),
|
|
672
|
-
});
|
|
673
|
-
export const LandModeSchema = z.enum(["check", "merge", "measure"]);
|
|
674
|
-
export const AgentSpanSchema = z.enum(["cumulative", "outstanding"]);
|
|
675
|
-
export const AgentLandSchema = z.object({
|
|
676
|
-
id: z.string().min(1).describe("Which conversation's work to merge."),
|
|
677
|
-
mode: LandModeSchema.optional().describe("How to apply it. The default applies all of it or none, so a refusal leaves the workspace exactly as it was. The other lands every clean file and leaves the rest with conflict markers to resolve by hand."),
|
|
678
|
-
span: AgentSpanSchema.optional().describe("How much of the work to take. Leave it out for everything not yet merged."),
|
|
679
|
-
force: z.boolean().optional().describe("Go ahead despite a check that would otherwise refuse."),
|
|
680
|
-
});
|
|
681
|
-
export const KeyedProviderSchema = z.enum(["codex", "grok", "kimi", "gemini"]);
|
|
682
|
-
export const UsageWindowSchema = z.object({
|
|
683
|
-
kind: z.string(),
|
|
684
|
-
label: z.string().optional(),
|
|
685
|
-
utilization: z.number(),
|
|
686
|
-
resetsAt: z.number().optional(),
|
|
687
|
-
});
|
|
688
|
-
export const AccountUsageSchema = z.object({
|
|
689
|
-
windows: z.array(UsageWindowSchema),
|
|
690
|
-
measuredAt: z.number(),
|
|
691
|
-
});
|
|
692
|
-
export const ProviderRefusalSchema = z.object({
|
|
693
|
-
at: z.number().describe("When it refused, in milliseconds."),
|
|
694
|
-
kind: z
|
|
695
|
-
.enum(["limit", "auth", "entitlement"])
|
|
696
|
-
.describe("Three different noes, kept apart because what fixes each is different. A spent allowance is answered by waiting; a refused credential by signing in again; and an entitlement refusal, where somebody has switched this off for your seat, by neither of those. That last one authenticates fine and reports healthy limits the whole time it refuses everything."),
|
|
697
|
-
message: z.string().describe("The provider's own words, verbatim. The only part that says which limit or which credential."),
|
|
698
|
-
account: z.string().optional().describe("Which account was serving, where that is known."),
|
|
699
|
-
});
|
|
700
|
-
export const ProviderRefusalsSchema = z.object({
|
|
701
|
-
refusals: z
|
|
702
|
-
.record(z.string(), ProviderRefusalSchema)
|
|
703
|
-
.describe("The most recent refusal per provider. Read alongside an account's usage: that says how full it was when last checked, this says whether it has since started saying no."),
|
|
704
|
-
});
|
|
705
|
-
export const TranslatorAccountSchema = z.object({
|
|
706
|
-
name: z.string(),
|
|
707
|
-
label: z.string(),
|
|
708
|
-
usage: AccountUsageSchema.optional(),
|
|
709
|
-
});
|
|
710
|
-
export const TranslatorAccountsSchema = z.object({
|
|
711
|
-
codex: z.array(TranslatorAccountSchema),
|
|
712
|
-
grok: z.array(TranslatorAccountSchema),
|
|
713
|
-
kimi: z.array(TranslatorAccountSchema),
|
|
714
|
-
gemini: z.array(TranslatorAccountSchema),
|
|
715
|
-
});
|
|
716
|
-
export const AgentReplySchema = z.discriminatedUnion("kind", [
|
|
717
|
-
z.object({
|
|
718
|
-
kind: z.literal("plan").describe("Answering a plan the agent proposed."),
|
|
719
|
-
requestId: z.string().min(1).describe("Which card you are answering, from the frame that raised it."),
|
|
720
|
-
approve: z
|
|
721
|
-
.boolean()
|
|
722
|
-
.describe("Whether to go ahead. Approving means the plan then runs without asking again per tool, because being asked whether a plan you just approved may run its first command is not a question worth having."),
|
|
723
|
-
feedback: z.string().optional().describe("Why not, which goes back to the model as the reason."),
|
|
724
|
-
}),
|
|
725
|
-
z.object({
|
|
726
|
-
kind: z.literal("question").describe("Answering a question the agent asked."),
|
|
727
|
-
requestId: z.string().min(1).describe("Which card you are answering."),
|
|
728
|
-
answers: z
|
|
729
|
-
.record(z.string(), z.array(z.string()))
|
|
730
|
-
.optional()
|
|
731
|
-
.describe("What you chose, keyed by the question, with the chosen labels or your own words."),
|
|
732
|
-
cancelled: z
|
|
733
|
-
.boolean()
|
|
734
|
-
.optional()
|
|
735
|
-
.describe("Dismissing it instead, which tells the agent to carry on using sensible defaults rather than leaving it waiting."),
|
|
736
|
-
}),
|
|
737
|
-
z.object({
|
|
738
|
-
kind: z.literal("permission").describe("Answering a request to use a tool."),
|
|
739
|
-
requestId: z.string().min(1).describe("Which card you are answering."),
|
|
740
|
-
decision: z
|
|
741
|
-
.enum(["once", "always", "deny"])
|
|
742
|
-
.describe("Once allows this call alone; always allows that whole tool for the rest of the conversation; no blocks it."),
|
|
743
|
-
feedback: z.string().optional().describe("Why not, which goes back to the model as the reason."),
|
|
744
|
-
}),
|
|
745
|
-
z.object({
|
|
746
|
-
kind: z
|
|
747
|
-
.literal("browser_help")
|
|
748
|
-
.describe("Answering a request for help in the agent's browser: a captcha, a password it does not hold, a check on your phone."),
|
|
749
|
-
requestId: z.string().min(1).describe("Which card you are answering."),
|
|
750
|
-
helped: z
|
|
751
|
-
.boolean()
|
|
752
|
-
.describe("Whether you cleared it. Yes means the turn carries on from the page as you left it; no tells the agent so, and it moves on rather than waiting for ever."),
|
|
753
|
-
note: z.string().optional().describe("Anything the agent should know, which goes back to it either way."),
|
|
754
|
-
}),
|
|
755
|
-
z.object({
|
|
756
|
-
kind: z
|
|
757
|
-
.literal("terminal_help")
|
|
758
|
-
.describe("Answering a request for help at a terminal: a code to type, a confirmation only a person can give."),
|
|
759
|
-
requestId: z.string().min(1).describe("Which card you are answering."),
|
|
760
|
-
helped: z
|
|
761
|
-
.boolean()
|
|
762
|
-
.describe("Whether you did it. Yes also hands the agent what the terminal now says, because a person answering a prompt is exactly the moment the agent cannot see."),
|
|
763
|
-
note: z.string().optional().describe("Anything the agent should know, which goes back to it either way."),
|
|
764
|
-
}),
|
|
765
|
-
z.object({
|
|
766
|
-
kind: z.literal("service_offer").describe("Answering a request to spend on a paid service."),
|
|
767
|
-
requestId: z.string().min(1).describe("Which card you are answering."),
|
|
768
|
-
approve: z
|
|
769
|
-
.boolean()
|
|
770
|
-
.describe("Yes releases exactly one run. Anything else charges nothing. This click is the only way the spend can happen."),
|
|
771
|
-
}),
|
|
772
|
-
z.object({
|
|
773
|
-
kind: z.literal("capability_offer").describe("Answering a request to connect something the agent needs."),
|
|
774
|
-
requestId: z.string().min(1).describe("Which card you are answering."),
|
|
775
|
-
connect: z
|
|
776
|
-
.boolean()
|
|
777
|
-
.describe("Yes keeps the agent waiting while you set it up, and it carries on the moment the connection comes alive. No tells it to continue without. The reply itself connects nothing: setting it up is still your own doing."),
|
|
778
|
-
}),
|
|
779
|
-
z.object({
|
|
780
|
-
kind: z.literal("payment_offer").describe("Answering a request to pay for something."),
|
|
781
|
-
requestId: z.string().min(1).describe("Which card you are answering."),
|
|
782
|
-
approve: z
|
|
783
|
-
.boolean()
|
|
784
|
-
.describe("Yes releases exactly one payment. Anything else spends nothing. This click is the only way the money can move."),
|
|
785
|
-
}),
|
|
786
|
-
]);
|
|
787
|
-
export const SteerSchema = z
|
|
788
|
-
.object({
|
|
789
|
-
conversationId: z.string().min(1).describe("Which running conversation to interrupt."),
|
|
790
|
-
text: z.string().max(20_000).describe("What to say to it. It arrives mid-turn without stopping the turn."),
|
|
791
|
-
attachments: z
|
|
792
|
-
.array(z.string().min(1))
|
|
793
|
-
.max(20)
|
|
794
|
-
.optional()
|
|
795
|
-
.describe("Files to send with it, as workspace paths. A screenshot dropped in mid-turn with no words is a legitimate thing to send."),
|
|
796
|
-
editorContext: EditorContextSchema.optional().describe("What you have open, folded in so that pointing words resolve."),
|
|
797
|
-
})
|
|
798
|
-
.refine((steer) => steer.text.trim().length > 0 || (steer.attachments?.length ?? 0) > 0, {
|
|
799
|
-
message: "text or attachments required",
|
|
800
|
-
});
|
|
801
|
-
export const StopTurnSchema = z.object({ conversationId: z.string().min(1).describe("Which conversation's running turn to cancel.") });
|
|
802
|
-
export const ResumeTurnSchema = z.object({
|
|
803
|
-
conversationId: z.string().min(1).describe("Which conversation's held turn to run again."),
|
|
804
|
-
});
|
|
805
|
-
export const RateLimitInfoSchema = z.object({
|
|
806
|
-
status: z.enum(["allowed", "allowed_warning", "rejected"]),
|
|
807
|
-
resetsAt: z.number().optional(),
|
|
808
|
-
rateLimitType: z.string().optional(),
|
|
809
|
-
utilization: z.number().optional(),
|
|
810
|
-
});
|
|
811
|
-
export const FastModeStateSchema = z.enum(["off", "cooldown", "on"]);
|
|
812
|
-
export const OauthAccountSchema = z.object({
|
|
813
|
-
id: z.string().describe("The account's id, which is what a turn names to spend on it and what disconnecting takes."),
|
|
814
|
-
label: z.string().describe("What it is called here, which somebody can change."),
|
|
815
|
-
email: z
|
|
816
|
-
.string()
|
|
817
|
-
.optional()
|
|
818
|
-
.describe("Who it signs in as, in the provider's own words. Kept beside the label rather than folded into it, so a renamed account can still say whose it is. Absent when the provider says nothing, which is exactly when renaming is the only answer."),
|
|
819
|
-
organization: z.string().optional().describe("Which organisation it belongs to, where the provider says."),
|
|
820
|
-
scope: z.string().optional().describe("What the credential is permitted to do, in the provider's terms."),
|
|
821
|
-
connectedAt: z.number().describe("When it was connected, in milliseconds."),
|
|
822
|
-
needsReauth: z
|
|
823
|
-
.boolean()
|
|
824
|
-
.optional()
|
|
825
|
-
.describe("Its stored credential can no longer be renewed and somebody has to sign in again. Absent means healthy, or not checked yet."),
|
|
826
|
-
detail: z.string().optional().describe("Why, in words a person can act on."),
|
|
827
|
-
usage: AccountUsageSchema.optional().describe("How full its plan limits were when last measured, so a picker can show what is left before committing work to it. Absent until a reading exists, which reads as unknown rather than as nothing left."),
|
|
828
|
-
});
|
|
829
|
-
export const OauthAccountListSchema = z.object({
|
|
830
|
-
accounts: z
|
|
831
|
-
.array(OauthAccountSchema)
|
|
832
|
-
.describe("The connected accounts. Tokens never travel in this shape: being in this list is what connected means."),
|
|
833
|
-
});
|
|
834
|
-
export const AccountListQuerySchema = z.object({
|
|
835
|
-
force: z
|
|
836
|
-
.stringbool()
|
|
837
|
-
.default(false)
|
|
838
|
-
.describe("Measure the plan limits again before answering, rather than serving a recent reading. Slower, and the right thing when somebody has just changed a plan and is asking whether what they can see is still true."),
|
|
839
|
-
});
|
|
840
|
-
export const AccountIdSchema = z.object({ id: z.string().min(1).describe("Which account.") });
|
|
841
|
-
export const AccountRenameSchema = z.object({
|
|
842
|
-
id: z.string().min(1).describe("Which account."),
|
|
843
|
-
label: z.string().max(80).describe("The new name. Blank restores the one derived from the sign-in, rather than leaving a nameless row."),
|
|
844
|
-
});
|
|
845
|
-
export const OauthExchangeSchema = z.object({
|
|
846
|
-
code: z.string().min(1).describe("The code the sign-in handed back."),
|
|
847
|
-
verifier: z.string().min(1).describe("The proof from the start of the handshake, which is what stops somebody else's code being redeemed here."),
|
|
848
|
-
state: z.string().min(1).describe("The handshake this belongs to. A mismatch is refused."),
|
|
849
|
-
label: z.string().optional().describe("What to call the account. Blank derives one from the sign-in."),
|
|
850
|
-
});
|
|
851
|
-
export const AuthorizeChallengeSchema = z.object({
|
|
852
|
-
authorizeUrl: z.string().describe("Where to send somebody to sign in."),
|
|
853
|
-
verifier: z.string().describe("Keep this and send it back when finishing. It is what proves the code that comes back belongs to this handshake."),
|
|
854
|
-
state: z.string().describe("The handshake's own id, sent back with it."),
|
|
855
|
-
});
|
|
856
|
-
export const CursorLoginStartSchema = z.object({
|
|
857
|
-
url: z.string().describe("The page to open and sign in on. It is already addressed to this attempt, so there is no code to type."),
|
|
858
|
-
handshake: z
|
|
859
|
-
.string()
|
|
860
|
-
.describe("This attempt's id, for abandoning it. Not a credential and not redeemable: the proof that finishes the sign-in never leaves the sandbox."),
|
|
861
|
-
expiresAt: z.number().describe("When this attempt stops being answerable, in milliseconds, so a card can stop waiting instead of spinning."),
|
|
862
|
-
});
|
|
863
|
-
export const CursorLoginCancelSchema = z.object({ handshake: z.string().min(1).describe("Which attempt to stop waiting on.") });
|
|
864
|
-
export const DeviceStartSchema = z.object({
|
|
865
|
-
url: z.string().describe("The page to open, which already has the code in it."),
|
|
866
|
-
code: z
|
|
867
|
-
.string()
|
|
868
|
-
.describe("The one-time code, shown as well so the page and the card say the same thing. Nothing is pasted back: the sandbox waits for the sign-in to complete on its own."),
|
|
869
|
-
});
|
|
870
|
-
export const TranslatorStartSchema = z.object({
|
|
871
|
-
url: z.string().describe("The page to open."),
|
|
872
|
-
code: z.string().describe("The one-time code, where the provider uses one."),
|
|
873
|
-
state: z.string().describe("The handshake's id, which the finishing call sends back."),
|
|
874
|
-
flow: z
|
|
875
|
-
.enum(["device", "redirect"])
|
|
876
|
-
.describe("Which shape this is. A device sign-in finishes by itself and you poll the account list; a redirect needs the address it landed on handed back. Said outright rather than guessed at from whether a code happens to exist."),
|
|
877
|
-
});
|
|
878
|
-
export const TranslatorCompleteSchema = z.object({
|
|
879
|
-
provider: KeyedProviderSchema.describe("Which provider."),
|
|
880
|
-
redirectUrl: z.string().min(1).describe("The address the browser was sent to, whole. The grant is inside it."),
|
|
881
|
-
state: z.string().min(1).describe("The handshake this belongs to. A mismatch is refused."),
|
|
882
|
-
});
|
|
883
|
-
export const ModelBadgeSchema = z.enum(["reasoning", "fast"]);
|
|
884
|
-
export const ModelSchema = z.object({
|
|
885
|
-
id: z.string().describe("What to name when asking for this model."),
|
|
886
|
-
label: z.string().describe("What to call it on screen."),
|
|
887
|
-
efforts: z.array(z.string()).optional().describe("The thinking levels it accepts, where the provider says. Empty means use your own defaults."),
|
|
888
|
-
description: z
|
|
889
|
-
.string()
|
|
890
|
-
.optional()
|
|
891
|
-
.describe("What it is good for, in the provider's own words. Absent where the provider publishes only ids, which is the honest answer rather than something to paper over with a hand-written table."),
|
|
892
|
-
badges: z.array(ModelBadgeSchema).optional().describe("What it is known for, where the provider says so."),
|
|
893
|
-
contextWindow: z.number().optional().describe("How many tokens this model will accept in one request, where the server publishes it."),
|
|
894
|
-
});
|
|
895
|
-
export const ModelsSchema = z.object({
|
|
896
|
-
models: z.array(ModelSchema).describe("What this provider serves, in its own preference order, which is not rearranged here. Never empty."),
|
|
897
|
-
default: z.string().describe("Which one a fresh conversation starts on. Always present."),
|
|
898
|
-
});
|
|
899
|
-
export const SessionIdParamSchema = z.object({ id: z.string().describe("Which past conversation.") });
|
|
900
|
-
export const SessionSummarySchema = z.object({
|
|
901
|
-
id: z.string().describe("Its id."),
|
|
902
|
-
title: z.string().describe("What it is called."),
|
|
903
|
-
updatedAt: z.number().describe("When it last moved, in milliseconds."),
|
|
904
|
-
snippet: MatchSnippetSchema.optional().describe("Why a search matched: the line it hit, with a little around it, and who said it. Absent on an unfiltered list, and on a match the title already shows, where repeating it would be noise rather than evidence."),
|
|
905
|
-
});
|
|
906
|
-
export const SessionsListSchema = z.object({ sessions: z.array(SessionSummarySchema).describe("Past conversations, newest first.") });
|
|
907
|
-
export const SystemPromptModeSchema = z.enum(["intentic", "claude", "custom"]);
|
|
908
|
-
export const BuiltinPromptSchema = z.object({ base: z.enum(["intentic", "claude"]) });
|
|
909
|
-
export const RuleMomentSchema = z.enum([
|
|
910
|
-
"turn.ending",
|
|
911
|
-
"push.starting",
|
|
912
|
-
"agent.finished",
|
|
913
|
-
]);
|
|
914
|
-
export const RuleBuiltinSchema = z.enum(["verify-edits"]);
|
|
915
|
-
export const RuleActionSchema = z.discriminatedUnion("kind", [
|
|
916
|
-
z.object({
|
|
917
|
-
kind: z.literal("command"),
|
|
918
|
-
command: z.string().max(500),
|
|
919
|
-
timeoutMs: z.number().min(60_000).max(3_600_000).default(900_000),
|
|
920
|
-
}),
|
|
921
|
-
z.object({ kind: z.literal("instruct"), text: z.string().min(1).max(4000) }),
|
|
922
|
-
z.object({ kind: z.literal("verdict"), verdict: z.enum(["allow", "hold"]) }),
|
|
923
|
-
z.object({ kind: z.literal("builtin"), name: RuleBuiltinSchema }),
|
|
924
|
-
]);
|
|
925
|
-
export const RuleConditionSchema = z.object({
|
|
926
|
-
repo: z.string().min(1).optional(),
|
|
927
|
-
paths: z.array(z.string().min(1)).max(20).optional(),
|
|
928
|
-
outcome: z.array(z.enum(["clean", "error", "conflict"])).optional(),
|
|
929
|
-
});
|
|
930
|
-
const MOMENT_ACTIONS = {
|
|
931
|
-
"turn.ending": ["builtin", "instruct", "command"],
|
|
932
|
-
"push.starting": ["command"],
|
|
933
|
-
"agent.finished": ["verdict"],
|
|
934
|
-
};
|
|
935
|
-
export const RuleSchema = z
|
|
936
|
-
.object({
|
|
937
|
-
id: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
938
|
-
label: z.string().min(1).max(80),
|
|
939
|
-
moment: RuleMomentSchema,
|
|
940
|
-
when: RuleConditionSchema.optional(),
|
|
941
|
-
action: RuleActionSchema,
|
|
942
|
-
enabled: z.boolean().default(true),
|
|
943
|
-
})
|
|
944
|
-
.refine((rule) => MOMENT_ACTIONS[rule.moment].includes(rule.action.kind), {
|
|
945
|
-
message: "that action cannot stand at that moment",
|
|
946
|
-
path: ["action"],
|
|
947
|
-
});
|
|
948
|
-
export const RuleFiringsSchema = z.record(z.string(), z.number());
|
|
949
|
-
export const SkillOriginSchema = z.enum(["builtin", "own", "capability", "extension", "plugin", "persona", "dropped"]);
|
|
950
|
-
export const SkillNameSchema = z.string().regex(/^[a-z0-9][a-z0-9-]*$/, "a skill name is lowercase letters, digits and dashes");
|
|
951
|
-
export const SkillSummarySchema = z.object({
|
|
952
|
-
id: z
|
|
953
|
-
.string()
|
|
954
|
-
.describe("Its handle, which reading and deleting take. A skill of your own is simply its name; one belonging to something else is qualified, because two packages may each ship a review."),
|
|
955
|
-
name: z.string().describe("Its name."),
|
|
956
|
-
description: z
|
|
957
|
-
.string()
|
|
958
|
-
.describe("What it is for, which is the line the agent reads to decide whether to reach for it. Empty when the skill declares none, which is worth showing as the blank it is: a skill with no description is rarely picked."),
|
|
959
|
-
origin: SkillOriginSchema.describe("Where it came from."),
|
|
960
|
-
owner: z.string().optional().describe("Who ships it, as the row would name them."),
|
|
961
|
-
enabled: z.boolean().describe("Whether the agent can reach it."),
|
|
962
|
-
switchable: z
|
|
963
|
-
.boolean()
|
|
964
|
-
.describe("Whether this surface can switch it. Everything else is on because its extension or its plugin is, and a switch here that silently did nothing would be worse than none, so the row names its owner instead."),
|
|
965
|
-
editable: z
|
|
966
|
-
.boolean()
|
|
967
|
-
.describe("Whether it can be rewritten here. Your own only: editing somebody else's in place would be undone the next time the thing that ships it catches up."),
|
|
968
|
-
removable: z.boolean(),
|
|
969
|
-
});
|
|
970
|
-
export const SkillsListSchema = z.array(SkillSummarySchema);
|
|
971
|
-
export const SkillBodySchema = z.object({
|
|
972
|
-
id: z.string().describe("The skill's id, which can carry the owner it came from."),
|
|
973
|
-
name: z.string().describe("Its name."),
|
|
974
|
-
body: z.string().describe("The instructions themselves, as written."),
|
|
975
|
-
});
|
|
976
|
-
export const SkillIdSchema = z.object({
|
|
977
|
-
id: z
|
|
978
|
-
.string()
|
|
979
|
-
.min(1)
|
|
980
|
-
.describe("Which skill. It travels in the query rather than the address, because an id can name the owner it came from and that will not fit in a path."),
|
|
981
|
-
});
|
|
982
|
-
export const SkillDraftSchema = z.object({
|
|
983
|
-
name: SkillNameSchema.describe("What to call it. Saving over an existing name rewrites it, which is also how one is renamed."),
|
|
984
|
-
description: z.string().min(1).max(1024).describe("What it is for, which is what the agent reads to decide whether to reach for it."),
|
|
985
|
-
body: z.string().min(1).describe("The skill itself."),
|
|
986
|
-
});
|
|
987
|
-
export const SkillRemoveSchema = z.object({
|
|
988
|
-
name: SkillNameSchema.describe("Which skill to delete. The text and the enabled list are both updated, so nothing is left half done."),
|
|
989
|
-
});
|
|
990
|
-
export const SandboxSettingsSchema = z.object({
|
|
991
|
-
stableSystemPrompt: z
|
|
992
|
-
.boolean()
|
|
993
|
-
.default(false)
|
|
994
|
-
.describe("Keep the instructions identical between turns so the provider can cache them, moving anything that varies into the message instead. Cheaper, at the cost of some flexibility."),
|
|
995
|
-
skills: z.array(z.string()).default(["lsp"]).describe("Which skills are switched on."),
|
|
996
|
-
hashlineEdits: z
|
|
997
|
-
.boolean()
|
|
998
|
-
.default(false)
|
|
999
|
-
.describe("Have the agent edit files by line number rather than by quoting the text it wants replaced. Cheaper on large files, and less forgiving of a stale read."),
|
|
1000
|
-
terseOutput: z.boolean().default(false).describe("Ask the agent to say less. It changes how much it narrates, not how much it does."),
|
|
1001
|
-
terseHoldout: z
|
|
1002
|
-
.number()
|
|
1003
|
-
.min(0)
|
|
1004
|
-
.max(1)
|
|
1005
|
-
.default(0)
|
|
1006
|
-
.describe("What share of turns to run without that instruction, so the two can be compared honestly. It has to be measured this way, because a turn cannot be re-run to see what it would have said. Zero means no measurement, which is the default, since the comparison costs the very tokens it is measuring."),
|
|
1007
|
-
systemPromptMode: SystemPromptModeSchema.default("intentic").describe("Which instructions the agent starts from: intentic's own, the ones the installed Claude Code carries, or your own. The first two both get this product's own guidance added on top; your own gets nothing added, which is the point of it."),
|
|
1008
|
-
systemPrompt: z
|
|
1009
|
-
.string()
|
|
1010
|
-
.max(20000)
|
|
1011
|
-
.default("")
|
|
1012
|
-
.describe("Your own instructions, used only when the mode above says custom. Then it is the whole of them: both built-in bases go, and so does everything this product would otherwise add, including the guidance the chat's own cards are driven by. That is the price of total control."),
|
|
1013
|
-
iqSearch: z
|
|
1014
|
-
.boolean()
|
|
1015
|
-
.default(false)
|
|
1016
|
-
.describe("Teach the agent how to use this workspace's own search tool, rather than leaving it to grep around."),
|
|
1017
|
-
iqSearchHoldout: z
|
|
1018
|
-
.number()
|
|
1019
|
-
.min(0)
|
|
1020
|
-
.max(1)
|
|
1021
|
-
.default(0)
|
|
1022
|
-
.describe("What share of conversations to run without that teaching, so the two can be compared. Whole conversations rather than individual turns, because once the teaching is in a session, withholding it from the next request does not make the model forget it."),
|
|
1023
|
-
workspaceMap: z
|
|
1024
|
-
.boolean()
|
|
1025
|
-
.default(false)
|
|
1026
|
-
.describe("Open every conversation with a map of the project it starts in: what is in it, what each part is for, and where the agent is standing. Worked out fresh each time rather than written down anywhere, because a written layout is wrong within a fortnight. Off by default, since it spends tokens on the first message of every conversation."),
|
|
1027
|
-
outputCleaners: z
|
|
1028
|
-
.string()
|
|
1029
|
-
.default("")
|
|
1030
|
-
.describe("Which command outputs to trim before the agent reads them, cutting the noise a build tool prints without cutting what it said."),
|
|
1031
|
-
outputHoldout: z
|
|
1032
|
-
.number()
|
|
1033
|
-
.min(0)
|
|
1034
|
-
.max(1)
|
|
1035
|
-
.default(0)
|
|
1036
|
-
.describe("What share of commands to leave untrimmed, so the saving can be measured against a real comparison rather than estimated."),
|
|
1037
|
-
quickModel: z
|
|
1038
|
-
.array(z.string())
|
|
1039
|
-
.max(10)
|
|
1040
|
-
.default([])
|
|
1041
|
-
.describe("Which models do the small automatic jobs that are not a conversation, such as writing a commit message. A list rather than one pick, tried in order, because the interesting failure is a model that is connected and simply will not answer today. Empty means work it out from whatever is connected, which improves by itself as accounts are added."),
|
|
1042
|
-
changelogRepos: z
|
|
1043
|
-
.array(z.string())
|
|
1044
|
-
.max(50)
|
|
1045
|
-
.default([])
|
|
1046
|
-
.describe("Which repositories keep a changelog, and so get a user-facing note written alongside each merge. A list rather than a switch, and empty by default, because the commit writer's standing rule is to copy the house style rather than impose one, and a repository that has never written such a note gives it nothing to copy."),
|
|
1047
|
-
agentRunModels: z
|
|
1048
|
-
.array(z.string())
|
|
1049
|
-
.max(10)
|
|
1050
|
-
.default([])
|
|
1051
|
-
.describe("Which models run the work a screen starts rather than a person: fixing a red pipeline, a maintenance chore, an acceptance run. Tried in order, so one spent account does not take every such run down. Empty falls back to whatever the chat would have used, which is the honest floor because it is the model you already chose to work with."),
|
|
1052
|
-
agentRunEffort: z.string().default("").describe("How hard those runs should think."),
|
|
1053
|
-
autoTier: z
|
|
1054
|
-
.enum(["off", "shadow", "on"])
|
|
1055
|
-
.default("shadow")
|
|
1056
|
-
.describe("Whether an easy-looking turn may run on a cheaper model from the same provider. Three states rather than a switch, because the middle one is the only honest road to the third: it scores every turn and routes nothing, so the guess can become a measurement before it changes anything. It can only ever route down, so the worst case is one turn's quality rather than a bill nobody asked for."),
|
|
1057
|
-
autoTierEagerness: z
|
|
1058
|
-
.enum(["cautious", "balanced", "eager"])
|
|
1059
|
-
.default("balanced")
|
|
1060
|
-
.describe("How readily a turn counts as simple enough for the cheaper model. It moves only the cutoff: at every setting a turn still has to say something positively easy, so nothing here can downgrade a short vague request."),
|
|
1061
|
-
autoFastModels: z
|
|
1062
|
-
.array(z.string())
|
|
1063
|
-
.max(10)
|
|
1064
|
-
.default([])
|
|
1065
|
-
.describe("Which cheaper model a downgraded turn lands on. A list so a sandbox spanning providers can name a rung on each, but not a fallback ladder: an entry naming a different provider than the turn is on is skipped rather than tried, because switching provider retires the conversation and starting over to save a fraction of a penny is not a saving. Empty picks the cheapest the turn's own provider publishes."),
|
|
1066
|
-
agentRetentionDays: z
|
|
1067
|
-
.number()
|
|
1068
|
-
.min(0)
|
|
1069
|
-
.max(365)
|
|
1070
|
-
.default(3)
|
|
1071
|
-
.describe("How many days a finished conversation stays on the board before being put away. Zero means never. The one setting here that defaults on, because each card left behind is a real working copy on disk, not just a row."),
|
|
1072
|
-
resumeAfterOutage: z
|
|
1073
|
-
.boolean()
|
|
1074
|
-
.default(false)
|
|
1075
|
-
.describe("Whether a turn killed by the model provider failing is re-run automatically, backing off between attempts. The sandbox-wide default; any one conversation can say otherwise. Off to begin with, because a retry spends your allowance on a turn you sent once and only you can say whether it was worth paying for twice. Worth turning on for a sandbox whose work mostly happens with nobody in the room."),
|
|
1076
|
-
autoResumeOnRestart: z
|
|
1077
|
-
.boolean()
|
|
1078
|
-
.default(false)
|
|
1079
|
-
.describe("Whether a turn killed by the sandbox restarting is re-run once it comes back. Off to begin with, for the same reason: it would spend your allowance on work you are not watching and edit files while you are still waiting for the sandbox to return. Either way the interruption is recorded rather than silently lost."),
|
|
1080
|
-
rules: z
|
|
1081
|
-
.array(RuleSchema)
|
|
1082
|
-
.max(50)
|
|
1083
|
-
.default([])
|
|
1084
|
-
.describe("Standing instructions you give the sandbox about its own work: ask for proof before a turn ends, run something before a push, hold or release finished work. Empty is the default and is exactly the behaviour of a fresh sandbox, because each of those defaults is what no rule matched means at its own moment."),
|
|
1085
|
-
automationFailureLimit: z
|
|
1086
|
-
.number()
|
|
1087
|
-
.min(0)
|
|
1088
|
-
.max(20)
|
|
1089
|
-
.default(0)
|
|
1090
|
-
.describe("How many failures in a row before an automation switches itself off. Zero means never, which is the default, because the failure is not always the automation's fault and a job disabled at three in the morning is one nobody re-enables. Only real errors count: a guard deciding there was nothing to do, or the sandbox dying mid-run, say nothing about the automation."),
|
|
1091
|
-
admission: AdmissionPolicySchema.prefault({}).describe("Whether work started from outside may run, per kind of trigger: let it, hold it for approval, or refuse it. Composes with each automation's own setting, and the stricter of the two wins, so holding every visitor's message needs no edit to each automation."),
|
|
1092
|
-
actionRules: z
|
|
1093
|
-
.record(z.string(), AdmissionRuleSchema)
|
|
1094
|
-
.default({})
|
|
1095
|
-
.describe("What an agent may do out in the world, per kind of action: go ahead, ask first, or never."),
|
|
1096
|
-
commandRules: z
|
|
1097
|
-
.partialRecord(CommandClassSchema, AdmissionRuleSchema)
|
|
1098
|
-
.default({})
|
|
1099
|
-
.describe("What an agent may run inside the sandbox, for the five kinds of command that are hard to take back: rewriting git history, deleting recursively, reading credential files, publishing a package, reaching out to the network. Everything else is recoverable in a container that is itself disposable, and gating it would be friction bought with nothing."),
|
|
1100
|
-
subagentsAtOnce: z.number().min(1).max(200).default(20).describe("How many helper agents may work at the same time."),
|
|
1101
|
-
subagentsPerTurn: z.number().min(1).max(2000).default(200).describe("How many a single turn may start in total."),
|
|
1102
|
-
subagentDepth: z
|
|
1103
|
-
.number()
|
|
1104
|
-
.min(1)
|
|
1105
|
-
.max(10)
|
|
1106
|
-
.default(3)
|
|
1107
|
-
.describe("How many levels deep the delegation may go, since a helper can start helpers of its own."),
|
|
1108
|
-
});
|
|
1109
|
-
export const BuiltinPromptTextSchema = z.object({ text: z.string(), version: z.string() });
|
|
1110
|
-
export const SavingsStageSchema = z.object({ id: z.string(), commands: z.number(), savedTokens: z.number() });
|
|
1111
|
-
export const InputSavingsSchema = z.object({
|
|
1112
|
-
updatedAt: z.number().optional(),
|
|
1113
|
-
commands: z.number(),
|
|
1114
|
-
rawTokens: z.number(),
|
|
1115
|
-
emittedTokens: z.number(),
|
|
1116
|
-
savedPct: z.number(),
|
|
1117
|
-
perCleaner: z.array(SavingsStageSchema),
|
|
1118
|
-
holdout: z.object({ cleaned: z.number(), heldOut: z.number(), measuredSavedPct: z.number().optional() }),
|
|
1119
|
-
gaps: z.array(z.object({ command: z.string(), commands: z.number(), tokens: z.number() })),
|
|
1120
|
-
});
|
|
1121
|
-
export const SavingsArmSchema = z.object({ turns: z.number(), mean: z.number() });
|
|
1122
|
-
export const TurnMetricReadingSchema = z.object({
|
|
1123
|
-
metric: z.enum(["proseChars", "searchCalls", "openingSearches"]),
|
|
1124
|
-
on: SavingsArmSchema,
|
|
1125
|
-
off: SavingsArmSchema,
|
|
1126
|
-
controlTurnsNeeded: z.number().optional(),
|
|
1127
|
-
marginPct: z.number().optional(),
|
|
1128
|
-
deltaPct: z.number().optional(),
|
|
1129
|
-
saved: z.number().optional(),
|
|
1130
|
-
});
|
|
1131
|
-
export const TurnExperimentSchema = z.object({
|
|
1132
|
-
metrics: z.tuple([TurnMetricReadingSchema], TurnMetricReadingSchema),
|
|
1133
|
-
minTurns: z.number(),
|
|
1134
|
-
sampleUnit: z.enum(["turns", "conversations"]).optional(),
|
|
1135
|
-
cohort: z.string().optional(),
|
|
1136
|
-
});
|
|
1137
|
-
export const TierReportSchema = z.object({
|
|
1138
|
-
judged: z.number(),
|
|
1139
|
-
fast: z.number(),
|
|
1140
|
-
atStakeUsd: z.number(),
|
|
1141
|
-
routed: z.number(),
|
|
1142
|
-
routedUsd: z.number(),
|
|
1143
|
-
escalated: z.number(),
|
|
1144
|
-
denied: z.number(),
|
|
1145
|
-
});
|
|
1146
|
-
export const SavingsReportSchema = z.object({
|
|
1147
|
-
input: InputSavingsSchema,
|
|
1148
|
-
output: TurnExperimentSchema.optional(),
|
|
1149
|
-
search: TurnExperimentSchema.optional(),
|
|
1150
|
-
tier: TierReportSchema.optional(),
|
|
1151
|
-
});
|
|
1152
|
-
export const IntenticRunSchema = z.object({ args: z.array(z.string()) });
|
|
1153
|
-
export const CommitSchema = RepoParamSchema.extend({
|
|
1154
|
-
message: z.string().min(1).describe("The commit message."),
|
|
1155
|
-
all: z
|
|
1156
|
-
.boolean()
|
|
1157
|
-
.optional()
|
|
1158
|
-
.describe("Stage every change in the repository first, then commit. An alternative to naming paths, not a companion to it."),
|
|
1159
|
-
paths: z
|
|
1160
|
-
.array(z.string().min(1))
|
|
1161
|
-
.max(500)
|
|
1162
|
-
.optional()
|
|
1163
|
-
.describe("Stage exactly these paths, then commit everything staged. Leave this and `all` out to commit whatever is already staged."),
|
|
1164
|
-
});
|
|
1165
|
-
export const DiscardSchema = RepoParamSchema.extend({
|
|
1166
|
-
paths: z
|
|
1167
|
-
.array(z.string().min(1))
|
|
1168
|
-
.max(500)
|
|
1169
|
-
.optional()
|
|
1170
|
-
.describe("Which paths to throw away. Leave it out to discard every uncommitted change in the repository."),
|
|
1171
|
-
});
|
|
1172
|
-
export const GitStageSchema = RepoParamSchema.extend({
|
|
1173
|
-
paths: z.array(z.string().min(1)).max(500).describe("The paths to move. Nothing on disk changes, so this is always safe and always reversible."),
|
|
1174
|
-
});
|
|
1175
|
-
export const PushSchema = RepoParamSchema.extend({
|
|
1176
|
-
branch: z
|
|
1177
|
-
.string()
|
|
1178
|
-
.min(1)
|
|
1179
|
-
.optional()
|
|
1180
|
-
.describe("Which branch to push. Leave it out for the checked-out one. A branch with no upstream yet gets one set on this push."),
|
|
1181
|
-
});
|
|
1182
|
-
export const GitFileQuerySchema = RepoParamSchema.extend({ path: z.string().min(1).describe("The file to read, relative to the repository root.") });
|
|
1183
|
-
export const GitFileWriteSchema = RepoParamSchema.extend({
|
|
1184
|
-
path: z.string().min(1).describe("Where to write, relative to the repository root. Missing folders are created."),
|
|
1185
|
-
content: z.string().describe("The file's whole new contents."),
|
|
1186
|
-
});
|
|
1187
|
-
export const GitDiffSideSchema = z.enum(["staged", "unstaged", "conflicted"]);
|
|
1188
|
-
export const GitFileDiffQuerySchema = RepoParamSchema.extend({
|
|
1189
|
-
path: z.string().min(1).describe("The file, relative to the repository root."),
|
|
1190
|
-
side: GitDiffSideSchema.describe("Which comparison you want. A file that is staged and then edited again has genuinely different answers for each, which is why this is required rather than assumed."),
|
|
1191
|
-
});
|
|
1192
|
-
export const GitStatusSchema = z.object({
|
|
1193
|
-
branch: z.string().describe("The checked-out branch."),
|
|
1194
|
-
dirty: z.boolean().describe("Whether anything is uncommitted."),
|
|
1195
|
-
files: z.array(z.string()).describe("Every path with something pending, staged or not."),
|
|
1196
|
-
});
|
|
1197
|
-
export const GitFilesSchema = z.object({
|
|
1198
|
-
files: z.array(z.string()).describe("Every path git tracks, relative to the repository root. Ignored and untracked files are not here."),
|
|
1199
|
-
});
|
|
1200
|
-
export const GitFileSchema = z.object({
|
|
1201
|
-
path: z.string().describe("The path, as asked for."),
|
|
1202
|
-
content: z.string().describe("The file's contents as they stand on disk."),
|
|
1203
|
-
});
|
|
1204
|
-
export const RepoPathsSchema = z.object({
|
|
1205
|
-
repo: z.string().min(1).describe("Which repository."),
|
|
1206
|
-
paths: z.array(z.string().min(1)).max(500).optional().describe("Which of its paths. Leave it out for the whole repository."),
|
|
1207
|
-
});
|
|
1208
|
-
export const GitChangeSchema = z.object({
|
|
1209
|
-
path: z.string().describe("The path, relative to the repository root. For a rename this is the new one."),
|
|
1210
|
-
status: z
|
|
1211
|
-
.enum(["added", "modified", "deleted", "renamed", "type-changed", "conflicted"])
|
|
1212
|
-
.describe("What happened to it. Conflicted is not a kind of edit: nothing can be committed anywhere in the repository while one exists."),
|
|
1213
|
-
from: z.string().optional().describe("Where a renamed file came from."),
|
|
1214
|
-
additions: z
|
|
1215
|
-
.number()
|
|
1216
|
-
.optional()
|
|
1217
|
-
.describe("Lines added. Absent for a binary file, and for an untracked one, which has nothing to compare against."),
|
|
1218
|
-
deletions: z.number().optional().describe("Lines removed. Absent for the same reasons additions is."),
|
|
1219
|
-
});
|
|
1220
|
-
export const GitRemoteStateSchema = z.object({
|
|
1221
|
-
remote: z
|
|
1222
|
-
.string()
|
|
1223
|
-
.optional()
|
|
1224
|
-
.describe("The remote this branch pushes to. Absent means none is configured. In a fork with two remotes, pushing to the wrong one succeeds and leaves the count stuck, which is why this says which."),
|
|
1225
|
-
branch: z.string().optional().describe("The checked-out branch. Absent when the repository is on a bare commit, or has no commits yet."),
|
|
1226
|
-
upstream: z.string().optional().describe("The branch on the remote this one follows. Absent means the next push will publish it."),
|
|
1227
|
-
ahead: z.number().describe("Commits you have that the remote does not."),
|
|
1228
|
-
behind: z.number().describe("Commits the remote has that you do not, as of the last fetch. Fetch before trusting it."),
|
|
1229
|
-
});
|
|
1230
|
-
const RefNameSchema = z
|
|
1231
|
-
.string()
|
|
1232
|
-
.regex(/^[A-Za-z0-9][A-Za-z0-9._/-]*$/)
|
|
1233
|
-
.max(200);
|
|
1234
|
-
export const GitBranchSchema = z.object({
|
|
1235
|
-
name: z.string().describe("The branch name."),
|
|
1236
|
-
current: z.boolean().describe("Whether this is the one checked out."),
|
|
1237
|
-
upstream: z.string().optional().describe("The branch on the remote it follows, if any."),
|
|
1238
|
-
ahead: z.number().describe("Commits this branch has that its remote counterpart does not."),
|
|
1239
|
-
behind: z.number().describe("Commits its remote counterpart has that it does not."),
|
|
1240
|
-
gone: z
|
|
1241
|
-
.boolean()
|
|
1242
|
-
.optional()
|
|
1243
|
-
.describe("The branch it followed no longer exists on the remote, usually because a merged pull request deleted it. The signal that this one is safe to delete."),
|
|
1244
|
-
at: z.number().describe("When its tip was committed, in milliseconds. Lists are newest first."),
|
|
1245
|
-
});
|
|
1246
|
-
export const GitRemoteBranchSchema = z.object({
|
|
1247
|
-
name: z.string().describe("The full name, such as origin/main."),
|
|
1248
|
-
remote: z.string().describe("Just the remote part, so a picker can group by it without re-parsing."),
|
|
1249
|
-
branch: z.string().describe("Just the branch part."),
|
|
1250
|
-
at: z.number().describe("When its tip was committed, in milliseconds, as this repository last saw it."),
|
|
1251
|
-
});
|
|
1252
|
-
export const GitBranchesSchema = z.object({
|
|
1253
|
-
branches: z.array(GitBranchSchema).describe("Branches in this repository."),
|
|
1254
|
-
remotes: z
|
|
1255
|
-
.array(GitRemoteBranchSchema)
|
|
1256
|
-
.describe("Branches on its remotes, as last seen. Sent together with the locals so a switcher never draws a half-filled list."),
|
|
1257
|
-
});
|
|
1258
|
-
export const GitBranchCreateAtSchema = RepoParamSchema.extend({
|
|
1259
|
-
name: RefNameSchema.describe("The new branch's name."),
|
|
1260
|
-
start: z.string().min(1).optional().describe("Where to start it: a commit or another branch. Leave it out to start from where you are."),
|
|
1261
|
-
checkout: z.boolean().optional().describe("Switch to it as well as creating it."),
|
|
1262
|
-
});
|
|
1263
|
-
export const GitBranchDeleteSchema = RepoParamSchema.extend({
|
|
1264
|
-
name: RefNameSchema.describe("The branch to delete."),
|
|
1265
|
-
force: z
|
|
1266
|
-
.boolean()
|
|
1267
|
-
.optional()
|
|
1268
|
-
.describe("Delete it even though it holds work that was never merged. The deliberate retry after the first attempt refuses."),
|
|
1269
|
-
});
|
|
1270
|
-
export const GitOperationSchema = z.enum(["merge", "rebase", "cherry-pick", "revert"]);
|
|
1271
|
-
export const GitOperationStateSchema = z.object({
|
|
1272
|
-
repo: z.string().describe("The repository asked about."),
|
|
1273
|
-
operation: GitOperationSchema.optional().describe("Which operation the working tree is stuck inside. Absent means it is not stuck at all, which is almost always. While one is present git refuses nearly everything else, and abandoning it is the only way out."),
|
|
1274
|
-
});
|
|
1275
|
-
export const RepoChangesSchema = z.object({
|
|
1276
|
-
repo: z.string(),
|
|
1277
|
-
branch: z.string().optional().describe("The checked-out branch. Absent in a repository that has no commits yet."),
|
|
1278
|
-
conflicted: z
|
|
1279
|
-
.array(GitChangeSchema)
|
|
1280
|
-
.describe("Paths a merge or rebase could not finish. First, because nothing anywhere in this repository can be committed until they are resolved. Held apart from the two lists below, because staged or not is not a question one of these has an answer to."),
|
|
1281
|
-
operation: GitOperationSchema.optional().describe("What halted, when something did. This is the sentence that explains the conflicts above and names the way out of them."),
|
|
1282
|
-
staged: z.array(GitChangeSchema).describe("What a plain commit would record right now."),
|
|
1283
|
-
unstaged: z
|
|
1284
|
-
.array(GitChangeSchema)
|
|
1285
|
-
.describe("Edits on disk that are not staged, plus untracked files. A path can be in both lists at once with different line counts, which is why they are separate."),
|
|
1286
|
-
truncated: z
|
|
1287
|
-
.number()
|
|
1288
|
-
.optional()
|
|
1289
|
-
.describe("How many changes were cut from the two lists above. A freshly cloned monorepo or a mass delete runs to six figures, which no screen can draw, so past a budget the lists arrive short and this says by how much. Absent means they are complete."),
|
|
1290
|
-
remote: GitRemoteStateSchema.optional().describe("Where this repository stands against its remote."),
|
|
1291
|
-
origins: z
|
|
1292
|
-
.record(z.string(), z.array(z.string()))
|
|
1293
|
-
.optional()
|
|
1294
|
-
.describe("Which conversation put each path here, newest first, keyed by path. Only work that went through a merge can appear: edits made in the shared tree, in a terminal, or by a person are simply absent rather than guessed at."),
|
|
1295
|
-
error: z
|
|
1296
|
-
.string()
|
|
1297
|
-
.optional()
|
|
1298
|
-
.describe("Why the repository could not be read at all, in git's own words. A repository left broken by a failed import arrives with empty lists and this set, rather than vanishing from the answer with nothing to act on."),
|
|
1299
|
-
});
|
|
1300
|
-
export const OriginAgentSchema = z.object({
|
|
1301
|
-
title: z.string().optional().describe("The conversation's title. Absent for one that never got as far as having a title."),
|
|
1302
|
-
provider: AgentProviderSchema.describe("Which model provider it ran on."),
|
|
1303
|
-
landedMessage: LandedMessageSchema.optional().describe("What the merged work did, drafted by the conversation itself. Carried here as well as on its card, because merged lines outlive the card: archiving a finished conversation does not uncommit its work."),
|
|
1304
|
-
});
|
|
1305
|
-
export const GitChangesSchema = z.object({
|
|
1306
|
-
repos: z
|
|
1307
|
-
.array(RepoChangesSchema)
|
|
1308
|
-
.describe("One entry per repository that has something pending, is out of step with its remote, or could not be read. A clean repository is simply absent."),
|
|
1309
|
-
originAgents: z
|
|
1310
|
-
.record(z.string(), OriginAgentSchema)
|
|
1311
|
-
.optional()
|
|
1312
|
-
.describe("Who each conversation named above is, keyed by id, so a caller need not look them up. Absent when nothing in the review can be attributed."),
|
|
1313
|
-
committing: z
|
|
1314
|
-
.array(z.string())
|
|
1315
|
-
.optional()
|
|
1316
|
-
.describe("Repositories with a commit running right now. The sandbox's answer rather than any one tab's, so a reload, a second window and another device all know. Absent means nothing is committing."),
|
|
1317
|
-
});
|
|
1318
|
-
export const CommitResultSchema = z.object({
|
|
1319
|
-
committed: z.boolean().describe("Whether a commit was actually recorded."),
|
|
1320
|
-
changes: RepoChangesSchema.optional().describe("What this repository looks like now, read in the same breath as the commit so a caller can redraw from here instead of asking for a fresh scan. Absent means there is nothing left to show."),
|
|
1321
|
-
originAgents: z
|
|
1322
|
-
.record(z.string(), OriginAgentSchema)
|
|
1323
|
-
.optional()
|
|
1324
|
-
.describe("Who the conversations named in those changes are. Merge it over what you already hold rather than replacing: other repositories still name their own."),
|
|
1325
|
-
});
|
|
1326
|
-
export const WorkspaceModuleSchema = z.object({
|
|
1327
|
-
dir: z.string().describe("Where the package lives, relative to its repository. Empty when the repository is itself one package."),
|
|
1328
|
-
name: z.string().describe("The name the package declares for itself."),
|
|
1329
|
-
});
|
|
1330
|
-
export const RepoModulesSchema = z.object({
|
|
1331
|
-
repo: z.string().describe("Which repository."),
|
|
1332
|
-
modules: z.array(WorkspaceModuleSchema).describe("Its packages."),
|
|
1333
|
-
});
|
|
1334
|
-
export const WorkspaceModulesSchema = z.object({ repos: z.array(RepoModulesSchema).describe("Every repository with the packages inside it.") });
|
|
1335
|
-
export const AgentChangeSchema = GitChangeSchema.extend({
|
|
1336
|
-
landed: z
|
|
1337
|
-
.boolean()
|
|
1338
|
-
.describe("Whether this change is already in the shared tree. The list is everything the conversation wrote, not just what is left over, because a clean turn merges in milliseconds and a list of leftovers would show an empty panel for work nobody had looked at yet."),
|
|
1339
|
-
});
|
|
1340
|
-
export const AgentRepoChangesSchema = z.object({
|
|
1341
|
-
repo: z.string().describe("Which repository."),
|
|
1342
|
-
branch: z.string().optional().describe("The branch this conversation's work sits on."),
|
|
1343
|
-
changes: z.array(AgentChangeSchema).describe("What it changed there."),
|
|
1344
|
-
modules: z
|
|
1345
|
-
.array(WorkspaceModuleSchema)
|
|
1346
|
-
.describe("The packages of the tree these changes came from, so a review can group by package. Carried with the changes rather than looked up separately, because a package the conversation has just created exists only in its own copy and the shared tree has never heard of it."),
|
|
1347
|
-
});
|
|
1348
|
-
export const AgentChangesSchema = z.object({
|
|
1349
|
-
repos: z.array(AgentRepoChangesSchema).describe("One entry per repository the conversation touched."),
|
|
1350
|
-
conflicts: z
|
|
1351
|
-
.array(LandConflictSchema)
|
|
1352
|
-
.optional()
|
|
1353
|
-
.describe("Why the last merge refused, when one did. Carried here as well as in the merge's own answer, because a conflict is found the moment a turn ends and dealt with hours later on this surface, which would otherwise open with nothing to explain what it promised to resolve."),
|
|
1354
|
-
});
|
|
1355
|
-
const ShaSchema = z.string().regex(/^[0-9a-f]{4,64}$/);
|
|
1356
|
-
export const GitCommitSchema = z.object({
|
|
1357
|
-
sha: z.string().describe("The commit, in full."),
|
|
1358
|
-
short: z.string().describe("The abbreviated form, for showing."),
|
|
1359
|
-
parents: z
|
|
1360
|
-
.array(z.string())
|
|
1361
|
-
.describe("What it came from. None means the first commit, one is ordinary, two or more is a merge, which is what a graph draws its lanes from."),
|
|
1362
|
-
subject: z.string().describe("Its first line."),
|
|
1363
|
-
body: z.string().describe("Everything after that."),
|
|
1364
|
-
author: z.string().describe("Who wrote it."),
|
|
1365
|
-
email: z.string().describe("Their address."),
|
|
1366
|
-
at: z.number().describe("When they wrote it, in milliseconds."),
|
|
1367
|
-
refs: z.array(z.string()).describe("Branches and tags sitting on it."),
|
|
1368
|
-
head: z.boolean().describe("Whether this is where the repository currently stands."),
|
|
1369
|
-
});
|
|
1370
|
-
export const GitLogSchema = z.object({
|
|
1371
|
-
repo: z.string().describe("Which repository."),
|
|
1372
|
-
branch: z.string().optional().describe("Which branch these are from."),
|
|
1373
|
-
commits: z.array(GitCommitSchema).describe("The commits, newest first."),
|
|
1374
|
-
hasMore: z
|
|
1375
|
-
.boolean()
|
|
1376
|
-
.describe("There are older ones behind this page. It is also what stops the last row being drawn as the beginning of history, which is how a truncated log used to claim it started where the page happened to stop."),
|
|
1377
|
-
});
|
|
1378
|
-
export const GitLogQuerySchema = RepoParamSchema.extend({
|
|
1379
|
-
limit: z.coerce.number().int().positive().max(2000).optional().describe("How many commits to return."),
|
|
1380
|
-
skip: z.coerce
|
|
1381
|
-
.number()
|
|
1382
|
-
.int()
|
|
1383
|
-
.nonnegative()
|
|
1384
|
-
.max(1_000_000)
|
|
1385
|
-
.optional()
|
|
1386
|
-
.describe("How many newer commits to step over, which is how you page further back. Paged rather than read whole, because a large repository's history is tens of thousands of rows."),
|
|
1387
|
-
});
|
|
1388
|
-
export const GitReposSchema = z.object({
|
|
1389
|
-
repos: z.array(z.string()).describe('Every repository\'s id. The workspace itself is always present as "root".'),
|
|
1390
|
-
});
|
|
1391
|
-
export const GitRemoteRepoSchema = z.object({
|
|
1392
|
-
repo: z.string().describe("The workspace repository."),
|
|
1393
|
-
host: z.string().describe("Which forge its remote points at."),
|
|
1394
|
-
project: z.string().describe("Which project there, as owner and name."),
|
|
1395
|
-
});
|
|
1396
|
-
export const GitRemoteReposSchema = z.object({
|
|
1397
|
-
repos: z.array(GitRemoteRepoSchema).describe("Each repository matched to the project its remote points at."),
|
|
1398
|
-
});
|
|
1399
|
-
export const GitPublishFileSchema = RepoParamSchema.extend({
|
|
1400
|
-
path: z.string().min(1).describe("Which file, relative to the repository."),
|
|
1401
|
-
content: z.string().describe("Its whole new contents."),
|
|
1402
|
-
message: z.string().min(1).describe("The commit message."),
|
|
1403
|
-
});
|
|
1404
|
-
export const GitPublishFileResultSchema = z.object({
|
|
1405
|
-
ok: z.boolean().describe("Whether the whole thing went through."),
|
|
1406
|
-
wrote: z.boolean().describe("The file was written."),
|
|
1407
|
-
committed: z.boolean().describe("The commit was recorded."),
|
|
1408
|
-
pushed: z.boolean().describe("It reached the remote."),
|
|
1409
|
-
branch: z.string().optional().describe("Which branch it happened on."),
|
|
1410
|
-
defaultBranch: z.string().optional().describe("Which branch the repository considers its main one, so a caller can see it was on a side branch."),
|
|
1411
|
-
reason: z
|
|
1412
|
-
.string()
|
|
1413
|
-
.optional()
|
|
1414
|
-
.describe("Why it stopped where it did. Being on a side branch, having no remote and having no credentials are all reported here rather than raised."),
|
|
1415
|
-
});
|
|
1416
|
-
export const GitCommitDiffQuerySchema = RepoParamSchema.extend({ sha: ShaSchema.describe("Which commit.") });
|
|
1417
|
-
export const GitCommitDiffSchema = z.object({
|
|
1418
|
-
files: z
|
|
1419
|
-
.array(GitChangeSchema)
|
|
1420
|
-
.describe("Which files it touched, with counts but not contents. Fetch any one file's contents separately, so a commit with a thousand files stays one cheap answer."),
|
|
1421
|
-
});
|
|
1422
|
-
export const GitCommitFileDiffQuerySchema = RepoParamSchema.extend({
|
|
1423
|
-
sha: ShaSchema.describe("Which commit."),
|
|
1424
|
-
path: z.string().min(1).describe("Which file in it."),
|
|
1425
|
-
});
|
|
1426
|
-
export const GitBranchCreateSchema = RepoParamSchema.extend({
|
|
1427
|
-
sha: ShaSchema.describe("Which commit to start it at."),
|
|
1428
|
-
name: RefNameSchema.describe("The new branch's name."),
|
|
1429
|
-
});
|
|
1430
|
-
export const GitTagCreateSchema = RepoParamSchema.extend({
|
|
1431
|
-
sha: ShaSchema.describe("Which commit to tag."),
|
|
1432
|
-
name: RefNameSchema.describe("The tag's name."),
|
|
1433
|
-
});
|
|
1434
|
-
export const GitCheckoutSchema = RepoParamSchema.extend({ ref: RefNameSchema.describe("Where to switch to: a branch, a tag, or a commit.") });
|
|
1435
|
-
export const GitTagDeleteSchema = RepoParamSchema.extend({
|
|
1436
|
-
name: RefNameSchema.describe("Which tag."),
|
|
1437
|
-
remote: RefNameSchema.optional().describe("Also delete it there. Leave it out to remove it locally only."),
|
|
1438
|
-
});
|
|
1439
|
-
export const GitTagPushSchema = RepoParamSchema.extend({
|
|
1440
|
-
name: RefNameSchema.describe("Which tag."),
|
|
1441
|
-
remote: RefNameSchema.describe("Which remote to send it to."),
|
|
1442
|
-
});
|
|
1443
|
-
export const GitResetSchema = RepoParamSchema.extend({
|
|
1444
|
-
sha: ShaSchema.describe("Which commit to move the branch to."),
|
|
1445
|
-
mode: z
|
|
1446
|
-
.enum(["soft", "mixed", "hard"])
|
|
1447
|
-
.describe("How much to take with it: move the branch alone, also unstage, or also throw away what is on disk. The last one takes a checkpoint first."),
|
|
1448
|
-
});
|
|
1449
|
-
export const GitCommitActionSchema = RepoParamSchema.extend({ sha: ShaSchema.describe("Which commit to act on.") });
|
|
1450
|
-
export const GitActionResultSchema = z.object({
|
|
1451
|
-
ok: z.boolean().describe("Whether it worked."),
|
|
1452
|
-
reason: z
|
|
1453
|
-
.string()
|
|
1454
|
-
.optional()
|
|
1455
|
-
.describe("Why not, in git's own words. A conflict, a missing remote and missing credentials are all reported here rather than raised, because they are things a screen has to render rather than breakages."),
|
|
1456
|
-
});
|
|
1457
|
-
export const StashEntrySchema = z.object({
|
|
1458
|
-
ref: z.string().describe("How to address it, which applying and dropping take."),
|
|
1459
|
-
sha: z.string().describe("The commit behind it, because a stash entry is a commit."),
|
|
1460
|
-
short: z.string().describe("The abbreviated form, for showing."),
|
|
1461
|
-
subject: z.string().describe("What it was set aside as, with git's own scaffolding stripped off."),
|
|
1462
|
-
branch: z.string().optional().describe("Which branch it was set aside from."),
|
|
1463
|
-
at: z.number().describe("When, in milliseconds."),
|
|
1464
|
-
parents: z.array(z.string()).describe("What it sits on, so a graph can draw it like any other commit."),
|
|
1465
|
-
});
|
|
1466
|
-
export const StashListSchema = z.object({
|
|
1467
|
-
repo: z.string().describe("Which repository."),
|
|
1468
|
-
stashes: z.array(StashEntrySchema).describe("What is set aside, newest first."),
|
|
1469
|
-
});
|
|
1470
|
-
const StashRefSchema = z.string().regex(/^stash@\{\d{1,4}\}$/);
|
|
1471
|
-
export const StashPushSchema = RepoParamSchema.extend({
|
|
1472
|
-
message: z.string().max(500).optional().describe("What to call it, so you know what it was later."),
|
|
1473
|
-
includeUntracked: z.boolean().optional().describe("Also set aside files git is not yet tracking, which are otherwise left where they are."),
|
|
1474
|
-
});
|
|
1475
|
-
export const StashApplySchema = RepoParamSchema.extend({
|
|
1476
|
-
ref: StashRefSchema.describe("Which entry."),
|
|
1477
|
-
pop: z.boolean().optional().describe("Remove it from the stash once it has been applied cleanly."),
|
|
1478
|
-
});
|
|
1479
|
-
export const StashRefParamSchema = RepoParamSchema.extend({ ref: StashRefSchema.describe("Which entry.") });
|
|
1480
|
-
export const StashDiffQuerySchema = RepoParamSchema.extend({ ref: StashRefSchema.describe("Which entry.") });
|
|
1481
|
-
export const UndoKindSchema = z.enum(["commit", "amend", "merge", "rebase", "cherry-pick", "revert", "reset", "pull", "other"]);
|
|
1482
|
-
export const UndoableActionSchema = z.object({
|
|
1483
|
-
kind: UndoKindSchema.describe("What the last action was."),
|
|
1484
|
-
description: z.string().describe("What undoing it would do, in words."),
|
|
1485
|
-
branch: z.string().describe("Which branch would move."),
|
|
1486
|
-
sha: z.string().describe("Where it stands now."),
|
|
1487
|
-
previousSha: z
|
|
1488
|
-
.string()
|
|
1489
|
-
.describe("Where it would go back to. Send this with the undo as proof you looked, so one prepared against a view that has since moved is refused rather than landing somewhere unexamined."),
|
|
1490
|
-
changesWorkingTree: z
|
|
1491
|
-
.boolean()
|
|
1492
|
-
.describe("Undoing would rewrite files as well as moving the branch, so anything offering it should warn about losing work."),
|
|
1493
|
-
});
|
|
1494
|
-
export const GitUndoStateSchema = z.object({
|
|
1495
|
-
repo: z.string().describe("Which repository."),
|
|
1496
|
-
action: UndoableActionSchema.optional().describe("What undoing would reverse. Absent means there is nothing to go back from."),
|
|
1497
|
-
});
|
|
1498
|
-
export const GitUndoSchema = RepoParamSchema.extend({
|
|
1499
|
-
previousSha: ShaSchema.describe("Where to go back to, from the matching read. It is also proof you looked: one prepared against a stale view is refused."),
|
|
1500
|
-
discardChanges: z.boolean().optional().describe("Also rewrite the files, rather than only moving the branch."),
|
|
1501
|
-
});
|
|
1502
|
-
export const SnapshotTriggerSchema = z.enum(["turn", "interval", "pre-restore", "restore", "user"]);
|
|
1503
|
-
export const SnapshotSchema = z.object({
|
|
1504
|
-
id: z.string().describe("The saved point's id, which is what restoring and diffing take."),
|
|
1505
|
-
at: z.number().describe("When it was taken, in milliseconds."),
|
|
1506
|
-
trigger: SnapshotTriggerSchema.describe("What caused it. The automatic between-turn captures are a safety net and are not listed; they dissolve into the next visible point's differences."),
|
|
1507
|
-
label: z.string().optional().describe("What to call it. For one taken before a turn, that turn's prompt."),
|
|
1508
|
-
});
|
|
1509
|
-
export const SnapshotsListSchema = z.object({ snapshots: z.array(SnapshotSchema).describe("Every point you can go back to, newest first.") });
|
|
1510
|
-
export const RewindTurnSchema = z.object({
|
|
1511
|
-
conversationId: z.string().min(1).describe("Which conversation to rewind."),
|
|
1512
|
-
index: z
|
|
1513
|
-
.number()
|
|
1514
|
-
.int()
|
|
1515
|
-
.nonnegative()
|
|
1516
|
-
.describe("Which message to go back to, counting from the start. It is also how many messages survive: rewinding to the first keeps none of them and puts the files back to before it ran."),
|
|
1517
|
-
});
|
|
1518
|
-
export const RewindResultSchema = z.object({
|
|
1519
|
-
snapshot: z
|
|
1520
|
-
.string()
|
|
1521
|
-
.optional()
|
|
1522
|
-
.describe("The saved point the files were put back to. Absent for a conversation working in its own copy, whose rewind moved a branch rather than the shared timeline."),
|
|
1523
|
-
dropped: z.number().int().nonnegative().describe("How many messages were removed."),
|
|
1524
|
-
});
|
|
1525
|
-
export const SnapshotIdSchema = z.object({ id: z.string().min(1).describe("Which saved point.") });
|
|
1526
|
-
export const SnapshotChangeSchema = z.object({
|
|
1527
|
-
scope: z.string().describe("Which part of the workspace the path belongs to: the workspace root, or one of the repositories inside it."),
|
|
1528
|
-
path: z.string().describe("The path, relative to that scope."),
|
|
1529
|
-
status: z.enum(["added", "modified", "deleted", "type-changed"]).describe("What happened to it."),
|
|
1530
|
-
});
|
|
1531
|
-
export const SnapshotDiffSchema = z.object({
|
|
1532
|
-
changes: z.array(SnapshotChangeSchema).describe("Everything that differs between this saved point and the one before it."),
|
|
1533
|
-
});
|
|
1534
|
-
export const SnapshotFileDiffQuerySchema = z.object({
|
|
1535
|
-
id: z.string().min(1).describe("Which saved point."),
|
|
1536
|
-
scope: z.string().min(1).describe("Which part of the workspace the path belongs to."),
|
|
1537
|
-
path: z.string().min(1).describe("The file, relative to that scope."),
|
|
1538
|
-
});
|
|
1539
|
-
export const PartialFileDiffSchema = z.object({
|
|
1540
|
-
beforeBytes: z.number().int().nonnegative().optional().describe("How big the before side is, in bytes. Absent when the file did not exist yet."),
|
|
1541
|
-
afterBytes: z.number().int().nonnegative().optional().describe("How big the after side is, in bytes. Absent when the file was deleted."),
|
|
1542
|
-
patch: z
|
|
1543
|
-
.string()
|
|
1544
|
-
.optional()
|
|
1545
|
-
.describe("The changed regions as unified-diff hunks (`@@` sections only). Absent when the change was too large to render even as a patch."),
|
|
1546
|
-
more: z.boolean().optional().describe("There were more changed regions than fit; the patch stops at a region boundary."),
|
|
1547
|
-
});
|
|
1548
|
-
export const FileDiffSchema = z.object({
|
|
1549
|
-
before: z.string().optional().describe("The whole file as it was. Absent when it did not exist yet, or when `partial` is set."),
|
|
1550
|
-
after: z.string().optional().describe("The whole file as it is now. Absent when it was deleted, or when `partial` is set."),
|
|
1551
|
-
binary: z.boolean().optional().describe("The file is not text, so neither side is sent."),
|
|
1552
|
-
partial: PartialFileDiffSchema.optional().describe("Set when the file was too large to send whole: what is sent instead of the two sides."),
|
|
1553
|
-
});
|
|
1554
|
-
export const WorkspaceScopeSchema = z.object({
|
|
1555
|
-
agent: ConversationIdSchema.optional().describe("Read a conversation's own private copy of the workspace rather than the shared tree. Leave it out for the shared tree. A conversation that is not working privately resolves back to the shared tree rather than failing, so a link need not know which mode it runs in."),
|
|
1556
|
-
});
|
|
1557
|
-
export const WorkspaceLinkSchema = z.object({
|
|
1558
|
-
to: z
|
|
1559
|
-
.string()
|
|
1560
|
-
.describe("What the link says, verbatim, rather than where it ends up. That is what the person who made it wrote, and what they would edit."),
|
|
1561
|
-
state: z
|
|
1562
|
-
.enum(["broken", "outside"])
|
|
1563
|
-
.optional()
|
|
1564
|
-
.describe("Absent for an ordinary link. Broken means there is nothing at the other end, and it is listed anyway because a dangling link is worth seeing. Outside means it leads out of the workspace, so it is shown and refused."),
|
|
1565
|
-
});
|
|
1566
|
-
export const WorkspaceTreeEntrySchema = z.object({
|
|
1567
|
-
name: z.string().describe("Just this entry's own name."),
|
|
1568
|
-
path: z.string().describe("Its full path from the workspace root, which feeds straight back into the file routes."),
|
|
1569
|
-
type: z.enum(["file", "dir"]).describe("What it is. For a link, what it points at, so a link to a folder opens like a folder."),
|
|
1570
|
-
size: z.number().optional().describe("Size in bytes, for a file."),
|
|
1571
|
-
ignored: z
|
|
1572
|
-
.boolean()
|
|
1573
|
-
.optional()
|
|
1574
|
-
.describe("Tooling ignores it: installed packages, git internals, anything the ignore rules exclude. Usually drawn greyed out."),
|
|
1575
|
-
link: WorkspaceLinkSchema.optional().describe("Present when this entry is a link."),
|
|
1576
|
-
get children() {
|
|
1577
|
-
return z
|
|
1578
|
-
.array(WorkspaceTreeEntrySchema)
|
|
1579
|
-
.optional()
|
|
1580
|
-
.describe("What is inside a folder. Absent means it was not opened, either because it is ignored or because the walk ran out of budget above it, so ask for it separately. An empty list means it really is empty.");
|
|
1581
|
-
},
|
|
1582
|
-
});
|
|
1583
|
-
export const WorkspaceTreeSchema = z.object({
|
|
1584
|
-
root: z.string().describe("The path everything below is relative to."),
|
|
1585
|
-
tree: z.array(WorkspaceTreeEntrySchema).describe("The workspace, one entry per file and folder."),
|
|
1586
|
-
hidden: z.number().describe("How many entries at the top level were cut for size. Zero means the listing is complete."),
|
|
1587
|
-
});
|
|
1588
|
-
export const WorkspaceChildrenQuerySchema = WorkspaceScopeSchema.extend({
|
|
1589
|
-
path: z.string().min(1).describe("The folder to open, as a workspace path."),
|
|
1590
|
-
});
|
|
1591
|
-
export const WorkspaceChildrenSchema = z.object({
|
|
1592
|
-
entries: z
|
|
1593
|
-
.array(WorkspaceTreeEntrySchema)
|
|
1594
|
-
.describe("What is directly inside it. Folders in here carry no contents of their own, so they open the same way."),
|
|
1595
|
-
hidden: z.number().describe("How many entries were cut for size. Zero means the listing is complete."),
|
|
1596
|
-
});
|
|
1597
|
-
export const WorkspaceFileQuerySchema = z.object({ path: z.string().min(1).describe("The file or folder, as a workspace path.") });
|
|
1598
|
-
export const WorkspaceMediaTicketQuerySchema = WorkspaceScopeSchema.extend({
|
|
1599
|
-
path: z.string().min(1).describe("The media file the ticket should cover."),
|
|
1600
|
-
});
|
|
1601
|
-
export const WorkspaceMediaTicketSchema = z.object({
|
|
1602
|
-
ticket: z.string().describe("Hand this to the streaming route in the query string. It buys exactly the one file it was minted for."),
|
|
1603
|
-
expiresAt: z.number().describe("When it stops working, in milliseconds, so a player can tell a dead ticket from a dead file."),
|
|
1604
|
-
});
|
|
1605
|
-
export const WorkspaceFileReadQuerySchema = WorkspaceScopeSchema.extend({
|
|
1606
|
-
path: z.string().min(1).describe("The file to read, as a workspace path."),
|
|
1607
|
-
offset: z.coerce
|
|
1608
|
-
.number()
|
|
1609
|
-
.int()
|
|
1610
|
-
.optional()
|
|
1611
|
-
.describe("Which byte to start at. A negative number reads that many bytes from the end, which is how you follow a growing log without knowing its size first."),
|
|
1612
|
-
limit: z.coerce
|
|
1613
|
-
.number()
|
|
1614
|
-
.int()
|
|
1615
|
-
.min(1)
|
|
1616
|
-
.optional()
|
|
1617
|
-
.describe("How many bytes to read. Capped by the sandbox, so leaving it out or asking for too much gives you the cap rather than the whole file."),
|
|
1618
|
-
});
|
|
1619
|
-
export const WorkspaceFilePresentSchema = z.object({
|
|
1620
|
-
present: z.literal(true).describe("There is something at that path."),
|
|
1621
|
-
path: z.string().describe("The path, as asked for."),
|
|
1622
|
-
content: z.string().describe("The bytes of the window you asked for, as text."),
|
|
1623
|
-
size: z.number().describe("How large the whole file is. Compare it with the window below to know whether there is more."),
|
|
1624
|
-
offset: z.number().describe("Which byte the window starts at."),
|
|
1625
|
-
bytes: z.number().describe("How many bytes the window holds."),
|
|
1626
|
-
shared: z
|
|
1627
|
-
.boolean()
|
|
1628
|
-
.describe("Which tree answered. True when no conversation was named, and also when one was but its own copy has no such file, which is the case a reader has to be told about rather than left to assume."),
|
|
1629
|
-
});
|
|
1630
|
-
export const WorkspaceFileAbsentSchema = z.object({
|
|
1631
|
-
present: z
|
|
1632
|
-
.literal(false)
|
|
1633
|
-
.describe("Nothing there. An answer, not a failure: reading a file that may not exist yet is the ordinary case for half the reads in this product."),
|
|
1634
|
-
path: z.string().describe("The path, as asked for."),
|
|
1635
|
-
});
|
|
1636
|
-
export const WorkspaceFileSchema = z.discriminatedUnion("present", [WorkspaceFilePresentSchema, WorkspaceFileAbsentSchema]);
|
|
1637
|
-
export const WorkspaceResolveQuerySchema = WorkspaceScopeSchema.extend({
|
|
1638
|
-
path: z
|
|
1639
|
-
.string()
|
|
1640
|
-
.min(1)
|
|
1641
|
-
.max(512)
|
|
1642
|
-
.describe("The reference as somebody wrote it. Often only the tail of the real path, which is why this is matched against the tree rather than read as-is."),
|
|
1643
|
-
});
|
|
1644
|
-
export const WorkspaceResolveSchema = z.object({
|
|
1645
|
-
path: z.string().optional().describe("The real path it means. Absent when nothing in the workspace ends that way."),
|
|
1646
|
-
});
|
|
1647
|
-
export const WorkspaceDirSchema = z.object({ path: z.string().min(1).describe("The folder to create. Missing folders above it are created too.") });
|
|
1648
|
-
export const WorkspaceMoveSchema = z.object({
|
|
1649
|
-
from: z.string().min(1).describe("What to move or copy, as a workspace path."),
|
|
1650
|
-
to: z.string().min(1).describe("Where it should end up. Changing only the last part is how you rename something."),
|
|
1651
|
-
});
|
|
1652
|
-
export const WorkspaceBucketSchema = z.enum(["repositories", "documents", "media", "archives", "other"]);
|
|
1653
|
-
export const WorkspaceClassificationSchema = z.object({
|
|
1654
|
-
classifications: z
|
|
1655
|
-
.array(z.object({
|
|
1656
|
-
path: z.string().describe("What was looked at."),
|
|
1657
|
-
bucket: WorkspaceBucketSchema.describe("Which bucket it was sorted into."),
|
|
1658
|
-
reason: z.string().describe("The signal that decided it, so the proposal can be argued with rather than trusted."),
|
|
1659
|
-
}))
|
|
1660
|
-
.describe("One entry per repository folder and loose file at the top of the workspace. A read-only proposal: nothing moves until you apply it."),
|
|
1661
|
-
});
|
|
1662
|
-
export const WorkspaceSearchQuerySchema = z.object({
|
|
1663
|
-
query: z.string().min(2).max(512).describe("What to look for. Plain words, a pattern, a symbol name, or a question."),
|
|
1664
|
-
mode: z
|
|
1665
|
-
.enum(["q", "find", "files", "def", "refs", "sym", "ast"])
|
|
1666
|
-
.optional()
|
|
1667
|
-
.describe("Narrow the search to one kind: plain text, filenames, definitions, references, symbols, or code structure. Leave it out to blend them, which also answers a question asked in words."),
|
|
1668
|
-
includeIgnored: z.stringbool().optional().describe("Search inside installed packages and other ignored folders too."),
|
|
1669
|
-
literal: z.stringbool().optional().describe("Treat the query as fixed text rather than a pattern."),
|
|
1670
|
-
word: z.stringbool().optional().describe("Match whole words only."),
|
|
1671
|
-
caseSensitive: z.stringbool().optional().describe("Whether capitals matter. Off means they do not, rather than being guessed at from the query."),
|
|
1672
|
-
include: z
|
|
1673
|
-
.string()
|
|
1674
|
-
.max(512)
|
|
1675
|
-
.optional()
|
|
1676
|
-
.describe("Which files to ask, in the same grammar an editor's files-to-include box takes: comma-separated patterns, matched at any depth unless anchored, a leading exclamation mark excluding instead."),
|
|
1677
|
-
limit: z.coerce.number().int().positive().optional().describe("How many results to return."),
|
|
1678
|
-
after: z.string().optional().describe("Resume from the cursor a previous answer handed back."),
|
|
1679
|
-
});
|
|
1680
|
-
export const WorkspaceSearchTagSchema = z.object({
|
|
1681
|
-
kind: z
|
|
1682
|
-
.enum(["def", "text", "sem", "bm25", "rerank", "path", "import", "call", "type", "write", "fuzzy", "heuristic"])
|
|
1683
|
-
.describe("Why this line matched: the literal text, its meaning, the path, a definition, a call, and so on. Several kinds can agree on one line."),
|
|
1684
|
-
score: z.number().optional().describe("How strongly that reason applied."),
|
|
1685
|
-
});
|
|
1686
|
-
export const WorkspaceSearchSpanSchema = z.object({
|
|
1687
|
-
start: z.number().describe("First character of the match within the line."),
|
|
1688
|
-
end: z.number().describe("One past the last."),
|
|
1689
|
-
});
|
|
1690
|
-
export const WorkspaceSearchHitSchema = z.object({
|
|
1691
|
-
line: z.number().describe("Which line, counting from one."),
|
|
1692
|
-
text: z.string().describe("The line itself."),
|
|
1693
|
-
spans: z
|
|
1694
|
-
.array(WorkspaceSearchSpanSchema)
|
|
1695
|
-
.describe("Where in the line the matches are, so you can highlight without searching again. Empty when the whole line is the match rather than part of it."),
|
|
1696
|
-
tags: z.array(WorkspaceSearchTagSchema).describe("Why it matched."),
|
|
1697
|
-
context: z
|
|
1698
|
-
.string()
|
|
1699
|
-
.optional()
|
|
1700
|
-
.describe("What it sits inside: the function, the class, the heading. Often enough that you need not open the file."),
|
|
1701
|
-
});
|
|
1702
|
-
export const WorkspaceSearchGroupSchema = z.object({
|
|
1703
|
-
path: z.string().describe("The file."),
|
|
1704
|
-
score: z.number().describe("How well it matched. Groups arrive best first, never in path order."),
|
|
1705
|
-
hits: z.array(WorkspaceSearchHitSchema).describe("The matching lines in it."),
|
|
1706
|
-
capped: z
|
|
1707
|
-
.boolean()
|
|
1708
|
-
.optional()
|
|
1709
|
-
.describe("This file had more matches than are kept per file, so the count is a floor. Say fifty-plus rather than fifty."),
|
|
1710
|
-
});
|
|
1711
|
-
export const WorkspaceSearchFreshnessSchema = z.object({
|
|
1712
|
-
state: z.enum(["fresh", "building", "stale"]).describe("Whether the index matches what is on disk, is still filling, or has fallen behind."),
|
|
1713
|
-
ageMs: z.number().optional().describe("How long since it last matched the disk, in milliseconds."),
|
|
1714
|
-
progress: z.number().optional().describe("How far through building it is, from zero to one."),
|
|
1715
|
-
behind: z
|
|
1716
|
-
.number()
|
|
1717
|
-
.optional()
|
|
1718
|
-
.describe("How many files it has not caught up with. Worth showing, because the word stale on its own reads as a warning about the answer, which it almost never is."),
|
|
1719
|
-
});
|
|
1720
|
-
export const WorkspaceSearchResultSchema = z.object({
|
|
1721
|
-
mode: z.string().describe("Which kind of search actually ran, which matters when you let it choose."),
|
|
1722
|
-
total: z.number().describe("Matching lines across the whole workspace, not just this page."),
|
|
1723
|
-
files: z.number().describe("Files the query matched in total."),
|
|
1724
|
-
shown: z.number().describe("How many of those lines are on this page."),
|
|
1725
|
-
groups: z.array(WorkspaceSearchGroupSchema).describe("The results, grouped by file, best first."),
|
|
1726
|
-
freshness: WorkspaceSearchFreshnessSchema.describe("Whether the index behind the answer is up to date."),
|
|
1727
|
-
truncated: z.boolean().describe("This page is not all of it. Use the cursor."),
|
|
1728
|
-
partial: z
|
|
1729
|
-
.boolean()
|
|
1730
|
-
.optional()
|
|
1731
|
-
.describe("At least one file had more matches than are kept per file, so the total is a floor. Different from the page being truncated: a complete page can still count partially."),
|
|
1732
|
-
cursor: z.string().optional().describe("Pass this back as `after` to get the next page."),
|
|
1733
|
-
hint: z.string().optional().describe("A suggestion for getting a better answer out of this query."),
|
|
1734
|
-
note: z
|
|
1735
|
-
.string()
|
|
1736
|
-
.optional()
|
|
1737
|
-
.describe("What the engine did that you did not ask for: a pattern rerun as plain text because it was not valid, escapes rewritten, a language filter that matched nothing."),
|
|
1738
|
-
related: z.array(z.string()).optional().describe("Places next door to the best results: where each is defined, and whatever calls it most."),
|
|
1739
|
-
candidates: z
|
|
1740
|
-
.array(z.string())
|
|
1741
|
-
.optional()
|
|
1742
|
-
.describe("Ranked places that scored but did not make the page, best first. The answer often sits at rank five to thirteen, so this saves paging through to find out."),
|
|
1743
|
-
features: z.array(z.string()).optional().describe("Which stages of the search were switched off for this run. Absent means all of them ran."),
|
|
1744
|
-
});
|
|
1745
|
-
export const HEALTH_LIMIT = 20;
|
|
1746
|
-
export const WorkspaceHealthQuerySchema = z.object({
|
|
1747
|
-
repo: z.string().min(1).describe("Which repository, using the same ids the git routes take."),
|
|
1748
|
-
since: z
|
|
1749
|
-
.string()
|
|
1750
|
-
.max(16)
|
|
1751
|
-
.optional()
|
|
1752
|
-
.describe("How far back to count changes, written as a span such as 2d, 12h, 1w or 3m. Leave it out for all of history."),
|
|
1753
|
-
limit: z.coerce
|
|
1754
|
-
.number()
|
|
1755
|
-
.int()
|
|
1756
|
-
.positive()
|
|
1757
|
-
.max(200)
|
|
1758
|
-
.optional()
|
|
1759
|
-
.describe("How many files and modules to rank. A leaderboard rather than an inventory: past a screenful the ranking stops being the point."),
|
|
1760
|
-
});
|
|
1761
|
-
export const WorkspaceHotspotSchema = z.object({
|
|
1762
|
-
path: z.string(),
|
|
1763
|
-
commits: z.number(),
|
|
1764
|
-
adds: z.number(),
|
|
1765
|
-
dels: z.number(),
|
|
1766
|
-
complexity: z.number(),
|
|
1767
|
-
score: z.number(),
|
|
1768
|
-
latestMs: z.number(),
|
|
1769
|
-
});
|
|
1770
|
-
export const WorkspaceKeyModuleSchema = z.object({ path: z.string(), exports: z.number() });
|
|
1771
|
-
export const WorkspaceHealthSchema = z.object({
|
|
1772
|
-
repo: z.string().describe("Which repository this describes."),
|
|
1773
|
-
totals: z
|
|
1774
|
-
.object({
|
|
1775
|
-
files: z.number().describe("Files counted."),
|
|
1776
|
-
symbols: z.number().describe("Named things they export."),
|
|
1777
|
-
complexity: z.number().describe("Branch points across all of them added up."),
|
|
1778
|
-
hotspots: z.number().describe("How many files qualify as hotspots at all. The list below is capped; this is not."),
|
|
1779
|
-
})
|
|
1780
|
-
.describe("Counts anybody could recount in the files themselves. Deliberately no single maintainability grade: those cannot be checked and are not comparable between projects."),
|
|
1781
|
-
hotspots: z.array(WorkspaceHotspotSchema).describe("Files that change often and are complicated at the same time, worst first."),
|
|
1782
|
-
modules: z.array(WorkspaceKeyModuleSchema).describe("The parts of the codebase the rest of it leans on most."),
|
|
1783
|
-
freshness: WorkspaceSearchFreshnessSchema.describe("Whether the index these numbers were read from is up to date."),
|
|
1784
|
-
});
|
|
1785
|
-
export const ProjectSetupSchema = z.object({
|
|
1786
|
-
dir: z.string().describe("Where the project is, relative to the workspace root. Empty means the root itself."),
|
|
1787
|
-
ecosystem: z.enum(["node", "python"]).describe("Which language's tooling it uses."),
|
|
1788
|
-
manager: z.string().describe("The tool that would do the installing."),
|
|
1789
|
-
command: z.string().describe("The exact command that would run."),
|
|
1790
|
-
evidence: z.string().describe("The file that decided all of the above, so the answer can be checked rather than trusted."),
|
|
1791
|
-
state: z
|
|
1792
|
-
.enum(["ready", "installing", "needs-setup", "unsupported", "stale"])
|
|
1793
|
-
.describe("Ready means its dependencies are really there. Stale means it was installed once and has since outgrown that, which is what an agent leaves behind when it adds a dependency without installing it. Unsupported means this sandbox has no such tool."),
|
|
1794
|
-
missing: z.number().optional().describe("How many declared dependencies cannot be found on disk. What separates never-installed from outgrown."),
|
|
1795
|
-
});
|
|
1796
|
-
export const WorkspaceSetupSchema = z.object({
|
|
1797
|
-
projects: z.array(ProjectSetupSchema).describe("Every project the sandbox found, and whether each is usable."),
|
|
1798
|
-
});
|
|
1799
|
-
export const WorkspaceInstallSchema = z.object({
|
|
1800
|
-
dirs: z
|
|
1801
|
-
.array(z.string().max(500))
|
|
1802
|
-
.min(1)
|
|
1803
|
-
.max(50)
|
|
1804
|
-
.describe("Which projects to install, by folder. Ones already ready, already installing, or with no tool to install them are skipped rather than refused."),
|
|
1805
|
-
});
|
|
1806
|
-
export const WorkspaceInstallResultSchema = z.object({
|
|
1807
|
-
queued: z.array(z.string()).describe("Which of them actually started, which is not necessarily what you asked for."),
|
|
1808
|
-
});
|
|
1809
|
-
export const ReposListSchema = z.object({
|
|
1810
|
-
repos: z
|
|
1811
|
-
.array(z.string())
|
|
1812
|
-
.describe('Every repository\'s id, sorted. An id is its folder relative to the workspace root, and "root" is the workspace itself.'),
|
|
1813
|
-
});
|
|
1814
|
-
export const CloneRepoSchema = z.object({
|
|
1815
|
-
name: z.string().min(1).describe("What to call it in the workspace."),
|
|
1816
|
-
cloneUrl: z.string().min(1).describe("Where to clone it from."),
|
|
1817
|
-
branch: z.string().optional().describe("Which branch to check out. Leave it out for the repository's default."),
|
|
1818
|
-
});
|
|
1819
|
-
export const CloneResultSchema = z.object({
|
|
1820
|
-
name: z.string().describe("What it ended up called."),
|
|
1821
|
-
path: z.string().describe("Where it landed."),
|
|
1822
|
-
});
|
|
1823
|
-
export const RepoSyncSchema = z.object({
|
|
1824
|
-
repo: z.string().describe("Which repository."),
|
|
1825
|
-
status: z
|
|
1826
|
-
.enum(["updated", "current", "dirty", "diverged", "no-remote", "skipped", "error"])
|
|
1827
|
-
.describe("What happened to it. Dirty and diverged are why a repository was left alone: it had uncommitted work, or it had moved in a way that cannot be fast-forwarded."),
|
|
1828
|
-
behind: z.number().optional().describe("How many commits it was behind."),
|
|
1829
|
-
ahead: z.number().optional().describe("How many commits it was ahead."),
|
|
1830
|
-
head: z.string().optional().describe("The commit it ended up on."),
|
|
1831
|
-
message: z.string().optional().describe("What went wrong, when something did."),
|
|
1832
|
-
});
|
|
1833
|
-
export const WorkspaceSyncSchema = z.object({ repos: z.array(RepoSyncSchema).describe("One entry per repository, saying what happened to it.") });
|
|
1834
|
-
export const AppInstanceInputSchema = z.object({
|
|
1835
|
-
template: z.string().min(1).describe("Which kind of app to scaffold, by its key in the template list."),
|
|
1836
|
-
name: z
|
|
1837
|
-
.string()
|
|
1838
|
-
.min(1)
|
|
1839
|
-
.regex(/^[a-z][a-z0-9-]*$/)
|
|
1840
|
-
.describe("What to call this one."),
|
|
1841
|
-
});
|
|
1842
|
-
export const AddAppsSchema = z.object({
|
|
1843
|
-
repo: z.string().describe("Which repository to scaffold into."),
|
|
1844
|
-
apps: z.array(AppInstanceInputSchema).min(1).describe("The apps to add."),
|
|
1845
|
-
});
|
|
1846
|
-
export const RunTestsSchema = z.object({
|
|
1847
|
-
repo: z.string().describe("Which repository."),
|
|
1848
|
-
session: z.string().describe("What to call the terminal this runs in, so you can find it again."),
|
|
1849
|
-
dirs: z.array(z.string()).min(1).describe("Which projects to test, as folders relative to the repository. Empty targets the repository root."),
|
|
1850
|
-
});
|
|
1851
|
-
export const TemplateSummarySchema = z.object({
|
|
1852
|
-
key: z.string().describe("The id to name when scaffolding one."),
|
|
1853
|
-
label: z.string().describe("What to call it on screen."),
|
|
1854
|
-
description: z.string().describe("What you get."),
|
|
1855
|
-
});
|
|
1856
|
-
export const TemplatesListSchema = z.object({
|
|
1857
|
-
templates: z.array(TemplateSummarySchema).describe("The kinds of app the configured source repository knows how to scaffold."),
|
|
1858
|
-
});
|
|
1859
|
-
export const RepoAppSchema = z.object({
|
|
1860
|
-
app: z.string().describe("The app's name, which is also its folder."),
|
|
1861
|
-
kind: z
|
|
1862
|
-
.string()
|
|
1863
|
-
.optional()
|
|
1864
|
-
.describe("What sort of app it is: the template it came from, or the framework worked out from its dependencies. Absent when it was found purely by having a dev script."),
|
|
1865
|
-
previewUrl: z.string().optional().describe("Where to open it. Absent when this sandbox has no outside address."),
|
|
1866
|
-
running: z.boolean().describe("Whether its dev server is up."),
|
|
1867
|
-
healthy: z.boolean().describe("Whether it is actually answering."),
|
|
1868
|
-
});
|
|
1869
|
-
export const AppsListSchema = z.object({ apps: z.array(RepoAppSchema).describe("The apps in this repository.") });
|
|
1870
|
-
export const WorkspacePackageSchema = z.object({
|
|
1871
|
-
name: z.string().describe("The name the package declares."),
|
|
1872
|
-
dir: z.string().describe("Where it lives, relative to the repository."),
|
|
1873
|
-
group: z.string().describe("The top-level folder it sits under, which is what a diagram colours by."),
|
|
1874
|
-
});
|
|
1875
|
-
export const WorkspaceDepTypeSchema = z.enum(["prod", "dev", "peer"]);
|
|
1876
|
-
export const WorkspaceDepEdgeSchema = z.object({
|
|
1877
|
-
from: z.string().describe("The package that depends."),
|
|
1878
|
-
to: z.string().describe("The package it depends on."),
|
|
1879
|
-
type: WorkspaceDepTypeSchema.describe("Which kind of dependency declared it."),
|
|
1880
|
-
});
|
|
1881
|
-
export const WorkspaceGraphSchema = z.object({
|
|
1882
|
-
packages: z.array(WorkspacePackageSchema).describe("Every package in the repository."),
|
|
1883
|
-
edges: z.array(WorkspaceDepEdgeSchema).describe("Which of them use which. Pure data: how to lay it out is yours to decide."),
|
|
1884
|
-
});
|
|
1885
|
-
export const RepoAppsParamSchema = z.object({ repo: z.string().describe("Which repository.") });
|
|
1886
|
-
export const AppParamSchema = z.object({
|
|
1887
|
-
repo: z.string().describe("Which repository."),
|
|
1888
|
-
app: z
|
|
1889
|
-
.string()
|
|
1890
|
-
.min(1)
|
|
1891
|
-
.regex(/^[a-z][a-z0-9-]*$/)
|
|
1892
|
-
.describe("Which app inside it."),
|
|
1893
|
-
});
|
|
1894
|
-
export const InventoryProviderSchema = z.enum(["host", "cloudflare", "github", "gitlab", "stripe"]);
|
|
1895
|
-
export const ServiceKindSchema = z.enum(["signoz", "outline", "paperless", "openproject", "invoiceninja", "infisical"]);
|
|
1896
|
-
export const InventoryValuesSchema = z.record(z.string(), z.union([z.string(), z.number()]));
|
|
1897
|
-
const inventoryName = z
|
|
1898
|
-
.string()
|
|
1899
|
-
.min(1)
|
|
1900
|
-
.max(60)
|
|
1901
|
-
.regex(/^[a-zA-Z_][a-zA-Z0-9_]*$/);
|
|
1902
|
-
export const BackendEntrySchema = z.object({
|
|
1903
|
-
kind: z.literal("backend").describe("Something you already have: a machine, an account with a hosting provider."),
|
|
1904
|
-
provider: InventoryProviderSchema.describe("Which provider it is with."),
|
|
1905
|
-
name: z.string().describe("What to call it, which is also how everything else refers to it."),
|
|
1906
|
-
values: InventoryValuesSchema.describe("Its settings. Anything secret is stored separately and referred to here, never written in."),
|
|
1907
|
-
});
|
|
1908
|
-
export const ServiceEntrySchema = z.object({
|
|
1909
|
-
kind: z.literal("service").describe("Something you want provisioned."),
|
|
1910
|
-
service: ServiceKindSchema.describe("Which service."),
|
|
1911
|
-
name: z.string().describe("What to call it."),
|
|
1912
|
-
values: InventoryValuesSchema.describe("Its settings."),
|
|
1913
|
-
on: z.string().describe("Which of your machines to put it on."),
|
|
1914
|
-
expose: z.string().describe("How it should be reachable."),
|
|
1915
|
-
});
|
|
1916
|
-
export const AppEntrySchema = z.object({
|
|
1917
|
-
kind: z.literal("app").describe("An app of your own, built from source and deployed."),
|
|
1918
|
-
name: z.string().describe("What to call it."),
|
|
1919
|
-
values: InventoryValuesSchema.describe("Its settings, including the address it should answer on."),
|
|
1920
|
-
on: z.string().describe("Which of your machines to put it on."),
|
|
1921
|
-
expose: z.string().describe("How it should be reachable."),
|
|
1922
|
-
});
|
|
1923
|
-
export const InventoryEntrySchema = z.discriminatedUnion("kind", [BackendEntrySchema, ServiceEntrySchema, AppEntrySchema]);
|
|
1924
|
-
export const AddInventoryInputSchema = z.discriminatedUnion("kind", [
|
|
1925
|
-
BackendEntrySchema.extend({ name: inventoryName }),
|
|
1926
|
-
ServiceEntrySchema.extend({ name: inventoryName }),
|
|
1927
|
-
AppEntrySchema.extend({ name: inventoryName }),
|
|
1928
|
-
]);
|
|
1929
|
-
export const InventoryNameParamSchema = z.object({ name: z.string().describe("Which entry, by name.") });
|
|
1930
|
-
export const InventoryListSchema = z.object({
|
|
1931
|
-
entries: z.array(InventoryEntrySchema).describe("Everything declared: what you have, and what you want provisioned."),
|
|
1932
|
-
});
|
|
1933
|
-
export const EnrollHostInputSchema = z.object({
|
|
1934
|
-
name: inventoryName,
|
|
1935
|
-
user: z.string().min(1),
|
|
1936
|
-
address: z.string().min(1),
|
|
1937
|
-
port: z.coerce.number().default(22),
|
|
1938
|
-
via: z.enum(["direct", "cloudflared"]).default("cloudflared"),
|
|
1939
|
-
sshKey: z.string().min(1),
|
|
1940
|
-
cfToken: z.string().optional(),
|
|
1941
|
-
cfZone: z.string().optional(),
|
|
1942
|
-
});
|
|
1943
|
-
export const CapabilityKindSchema = z.enum([
|
|
1944
|
-
"devops",
|
|
1945
|
-
"monorepo",
|
|
1946
|
-
"mcp",
|
|
1947
|
-
"service",
|
|
1948
|
-
"integration",
|
|
1949
|
-
"cli",
|
|
1950
|
-
"plugin",
|
|
1951
|
-
"extension",
|
|
1952
|
-
"ssh",
|
|
1953
|
-
"vpn",
|
|
1954
|
-
"exit",
|
|
1955
|
-
"docker",
|
|
1956
|
-
"browser",
|
|
1957
|
-
"identity",
|
|
1958
|
-
"host",
|
|
1959
|
-
"agent",
|
|
1960
|
-
"endpoint",
|
|
1961
|
-
"localmodel",
|
|
1962
|
-
"wallet",
|
|
1963
|
-
]);
|
|
1964
|
-
export const CapabilityStateSchema = z.enum(["active", "pending", "error", "inactive"]);
|
|
1965
|
-
export const McpConfigSchema = z.object({
|
|
1966
|
-
url: z.url().describe("Where the tool server answers."),
|
|
1967
|
-
token: z.string().optional().describe("The credential it needs, if any. Stored, never echoed back."),
|
|
1968
|
-
});
|
|
1969
|
-
export const ServiceConfigSchema = z.object({
|
|
1970
|
-
service: ServiceKindSchema.describe("Which service to provision."),
|
|
1971
|
-
domain: z.string().min(1).describe("The address it should answer on."),
|
|
1972
|
-
on: z.string().min(1).describe("Which machine to put it on."),
|
|
1973
|
-
expose: z.string().min(1).describe("How it should be reachable."),
|
|
1974
|
-
});
|
|
1975
|
-
export const IntegrationConfigSchema = z.object({
|
|
1976
|
-
provider: z.literal("stripe").describe("Which outside service's credential to make available to deployed apps."),
|
|
1977
|
-
});
|
|
1978
|
-
export const CliConfigSchema = z
|
|
1979
|
-
.object({
|
|
1980
|
-
provider: z
|
|
1981
|
-
.string()
|
|
1982
|
-
.min(1)
|
|
1983
|
-
.describe("Which tool to give the agent. The rest of the fields are whatever that tool's own card declares it needs, and are checked against it when you connect."),
|
|
1984
|
-
})
|
|
1985
|
-
.catchall(z.string());
|
|
1986
|
-
export const PluginConfigSchema = z.object({
|
|
1987
|
-
url: z.url().describe("The repository to take the plugin from."),
|
|
1988
|
-
ref: z.string().min(1).optional().describe("A branch, tag or commit to pin to. Leave it out to follow the default branch."),
|
|
1989
|
-
path: z
|
|
1990
|
-
.string()
|
|
1991
|
-
.min(1)
|
|
1992
|
-
.refine((value) => !value.split("/").includes(".."), { message: "path must stay inside the checkout" })
|
|
1993
|
-
.optional()
|
|
1994
|
-
.describe("Where inside the repository the plugin lives, for one that sits in a larger checkout."),
|
|
1995
|
-
token: z.string().min(1).optional().describe("A credential for a private repository. Stored, never echoed back."),
|
|
1996
|
-
});
|
|
1997
|
-
export const ExtensionConfigSchema = z.object({
|
|
1998
|
-
url: z.url().describe("The repository to take the extension from."),
|
|
1999
|
-
ref: z
|
|
2000
|
-
.string()
|
|
2001
|
-
.regex(/^[0-9a-f]{40}$/, "ref must be a full 40-character commit sha")
|
|
2002
|
-
.describe("The exact commit to install, in full. Required rather than optional because extension code runs with your browser's trust: the owner approves precisely the code that runs, and an update is a deliberate re-install at a new commit."),
|
|
2003
|
-
path: z
|
|
2004
|
-
.string()
|
|
2005
|
-
.min(1)
|
|
2006
|
-
.refine((value) => !value.split("/").includes(".."), { message: "path must stay inside the checkout" })
|
|
2007
|
-
.optional()
|
|
2008
|
-
.describe("Where inside the repository the extension lives, for one that sits in a larger checkout."),
|
|
2009
|
-
token: z.string().min(1).optional().describe("A credential for a private repository. Stored, never echoed back."),
|
|
2010
|
-
tier: z
|
|
2011
|
-
.enum(["free", "premium"])
|
|
2012
|
-
.optional()
|
|
2013
|
-
.describe("Whether installing this donates credits to its publisher. Absent means free, which donates nothing and asks for nothing. Taken from the listing rather than checked against it, which is the honesty an open-source posture accepts."),
|
|
2014
|
-
registry: z
|
|
2015
|
-
.url()
|
|
2016
|
-
.optional()
|
|
2017
|
-
.describe("Which registry this install came from, which is what update checks and security advisories are read against. Absent falls back to the official one."),
|
|
2018
|
-
});
|
|
2019
|
-
export const SshConfigSchema = z.discriminatedUnion("auth", [
|
|
2020
|
-
z.object({
|
|
2021
|
-
auth: z.literal("key").describe("Sign in with a key."),
|
|
2022
|
-
host: z.string().min(1).describe("The machine's address."),
|
|
2023
|
-
port: z.coerce.number().default(22).describe("Which port it listens on."),
|
|
2024
|
-
user: z.string().min(1).describe("Which user to connect as."),
|
|
2025
|
-
privateKey: z.string().min(1).describe("The private key, whole. Stored with tight permissions and never echoed back."),
|
|
2026
|
-
}),
|
|
2027
|
-
z.object({
|
|
2028
|
-
auth: z.literal("password").describe("Sign in with a password."),
|
|
2029
|
-
host: z.string().min(1).describe("The machine's address."),
|
|
2030
|
-
port: z.coerce.number().default(22).describe("Which port it listens on."),
|
|
2031
|
-
user: z.string().min(1).describe("Which user to connect as."),
|
|
2032
|
-
password: z.string().min(1).describe("The password. Stored, never echoed back."),
|
|
2033
|
-
}),
|
|
2034
|
-
]);
|
|
2035
|
-
export const VpnProviderSchema = z.enum(["wireguard", "fortinet", "ipsec"]);
|
|
2036
|
-
const autoConnect = z.enum(["on", "off"]).default("on");
|
|
2037
|
-
export const isForticlientCiphertext = (value) => /^Enc[X]?\s+[0-9A-Fa-f]{8,}$/.test(value.trim());
|
|
2038
|
-
const notForticlientCiphertext = (field, label) => field.refine((value) => !isForticlientCiphertext(value), {
|
|
2039
|
-
message: `That looks like a value copied straight out of a FortiClient config, FortiClient encrypts it with a key tied to the machine that exported it, so it can't be used here. Enter the actual ${label} (ask whoever administers the gateway).`,
|
|
2040
|
-
});
|
|
2041
|
-
export const WireguardVpnConfigSchema = z.object({
|
|
2042
|
-
provider: z.literal("wireguard"),
|
|
2043
|
-
config: z.string().min(1),
|
|
2044
|
-
autoConnect,
|
|
2045
|
-
});
|
|
2046
|
-
export const FortinetVpnConfigSchema = z.object({
|
|
2047
|
-
provider: z.literal("fortinet"),
|
|
2048
|
-
server: z.string().min(1),
|
|
2049
|
-
port: z.coerce.number().int().min(1).max(65535).default(443),
|
|
2050
|
-
username: z.string().min(1),
|
|
2051
|
-
password: notForticlientCiphertext(z.string().min(1), "password"),
|
|
2052
|
-
trustedCert: z.string().min(1).optional(),
|
|
2053
|
-
realm: z.string().min(1).optional(),
|
|
2054
|
-
autoConnect,
|
|
2055
|
-
});
|
|
2056
|
-
export const IpsecVpnConfigSchema = z.object({
|
|
2057
|
-
provider: z.literal("ipsec"),
|
|
2058
|
-
server: z.string().min(1),
|
|
2059
|
-
presharedKey: notForticlientCiphertext(z.string().min(1), "pre-shared key"),
|
|
2060
|
-
localId: z.string().min(1).optional(),
|
|
2061
|
-
remoteId: z.string().min(1).optional(),
|
|
2062
|
-
username: z.string().min(1).optional(),
|
|
2063
|
-
password: notForticlientCiphertext(z.string().min(1), "XAuth password").optional(),
|
|
2064
|
-
ikeVersion: z.enum(["1", "2"]).default("1"),
|
|
2065
|
-
pfs: z.enum(["on", "off"]).default("on"),
|
|
2066
|
-
dhGroup: z.enum(["2", "5", "14", "15", "16", "19", "20"]).default("14"),
|
|
2067
|
-
aggressive: z.enum(["on", "off"]).default("on"),
|
|
2068
|
-
routedNetworks: z
|
|
2069
|
-
.string()
|
|
2070
|
-
.default("0.0.0.0/0")
|
|
2071
|
-
.refine((value) => value
|
|
2072
|
-
.split(",")
|
|
2073
|
-
.map((entry) => entry.trim())
|
|
2074
|
-
.every((entry) => z.cidrv4().safeParse(entry).success || z.cidrv6().safeParse(entry).success), {
|
|
2075
|
-
message: "Routed networks is a comma-separated list of CIDRs, like 10.0.0.0/8,192.168.0.0/16. A single host needs its prefix too (192.168.0.168/32). Leave it at 0.0.0.0/0 to send everything through the gateway.",
|
|
2076
|
-
}),
|
|
2077
|
-
autoConnect,
|
|
2078
|
-
});
|
|
2079
|
-
export const VpnConfigSchema = z.discriminatedUnion("provider", [WireguardVpnConfigSchema, FortinetVpnConfigSchema, IpsecVpnConfigSchema]);
|
|
2080
|
-
export const ExitProviderSchema = z.enum(["tor", "vpngate", "wireguard"]);
|
|
2081
|
-
export const CountryCodeSchema = z
|
|
2082
|
-
.string()
|
|
2083
|
-
.regex(/^[A-Za-z]{2}$/, "A country is its two-letter code, like DE, US or JP.")
|
|
2084
|
-
.transform((value) => value.toUpperCase());
|
|
2085
|
-
const autoStart = z.enum(["on", "off"]).default("off");
|
|
2086
|
-
export const TorExitConfigSchema = z.object({
|
|
2087
|
-
provider: z.literal("tor"),
|
|
2088
|
-
country: CountryCodeSchema.optional(),
|
|
2089
|
-
autoStart,
|
|
2090
|
-
});
|
|
2091
|
-
export const VpngateExitConfigSchema = z.object({
|
|
2092
|
-
provider: z.literal("vpngate"),
|
|
2093
|
-
country: CountryCodeSchema.optional(),
|
|
2094
|
-
autoStart,
|
|
2095
|
-
});
|
|
2096
|
-
export const WireguardExitConfigSchema = z.object({
|
|
2097
|
-
provider: z.literal("wireguard"),
|
|
2098
|
-
config: z.string().min(1),
|
|
2099
|
-
country: CountryCodeSchema.optional(),
|
|
2100
|
-
autoStart,
|
|
2101
|
-
});
|
|
2102
|
-
export const ExitConfigSchema = z.discriminatedUnion("provider", [TorExitConfigSchema, VpngateExitConfigSchema, WireguardExitConfigSchema]);
|
|
2103
|
-
export const DockerConfigSchema = z.object({
|
|
2104
|
-
gpu: z.enum(["on", "off"]).default("off"),
|
|
2105
|
-
registryMirror: z.url().optional(),
|
|
2106
|
-
insecureRegistries: z.string().optional(),
|
|
2107
|
-
addressPool: z.string().optional(),
|
|
2108
|
-
});
|
|
2109
|
-
export const BrowserConfigSchema = z
|
|
2110
|
-
.object({
|
|
2111
|
-
platform: z.string().min(1),
|
|
2112
|
-
username: z.string().optional(),
|
|
2113
|
-
password: z.string().optional(),
|
|
2114
|
-
identity: z.string().optional(),
|
|
2115
|
-
purpose: z.string().optional(),
|
|
2116
|
-
openedAt: z.string().optional(),
|
|
2117
|
-
exit: z.string().optional(),
|
|
2118
|
-
})
|
|
2119
|
-
.catchall(z.string());
|
|
2120
|
-
export const IdentityConfigSchema = z.object({
|
|
2121
|
-
email: z.string().min(3),
|
|
2122
|
-
password: z.string().optional(),
|
|
2123
|
-
mailbox: z.string().optional(),
|
|
2124
|
-
loginUrl: z.url().optional(),
|
|
2125
|
-
openAccounts: z.enum(["on", "off"]).default("off"),
|
|
2126
|
-
exit: z.string().optional(),
|
|
2127
|
-
});
|
|
2128
|
-
const hostScope = z.enum(["on", "off"]);
|
|
2129
|
-
export const HostScopesSchema = z.object({
|
|
2130
|
-
shell: hostScope.default("on"),
|
|
2131
|
-
write: hostScope.default("off"),
|
|
2132
|
-
screen: hostScope.default("on"),
|
|
2133
|
-
control: hostScope.default("off"),
|
|
2134
|
-
sandboxes: hostScope.default("off"),
|
|
2135
|
-
sandboxRemove: hostScope.default("off"),
|
|
2136
|
-
roots: z.string().optional(),
|
|
2137
|
-
});
|
|
2138
|
-
export const HostConfigSchema = HostScopesSchema.extend({ platform: z.string().min(1) });
|
|
2139
|
-
export const AcpAgentConfigSchema = z.object({
|
|
2140
|
-
command: z.string().min(1),
|
|
2141
|
-
name: z.string().min(1).optional(),
|
|
2142
|
-
env: z.string().optional(),
|
|
2143
|
-
loginCommand: z.string().min(1).optional(),
|
|
2144
|
-
});
|
|
2145
|
-
export const EndpointProtocolSchema = z.enum(["openai", "anthropic"]);
|
|
2146
|
-
export const EndpointConfigSchema = z.object({
|
|
2147
|
-
baseUrl: z.url(),
|
|
2148
|
-
protocol: EndpointProtocolSchema.default("openai"),
|
|
2149
|
-
apiKey: z.string().optional(),
|
|
2150
|
-
headers: z.string().optional(),
|
|
2151
|
-
});
|
|
2152
|
-
export const LOCAL_MODEL_WINDOWS = ["16384", "32768", "65536", "131072"];
|
|
2153
|
-
export const LOCAL_MODEL_WINDOW_DEFAULT = "65536";
|
|
2154
|
-
export const LOCAL_MODEL_WINDOW_MIN = 2048;
|
|
2155
|
-
export const LOCAL_MODEL_WINDOW_MAX = 1_048_576;
|
|
2156
|
-
export const LocalModelConfigSchema = z.object({
|
|
2157
|
-
model: z.string().min(1),
|
|
2158
|
-
gpu: z.enum(["on", "off"]).default("off"),
|
|
2159
|
-
url: z.url().optional(),
|
|
2160
|
-
context: z.union([z.enum(LOCAL_MODEL_WINDOWS), z.literal("custom")]).default(LOCAL_MODEL_WINDOW_DEFAULT),
|
|
2161
|
-
contextTokens: z.coerce.number().int().min(LOCAL_MODEL_WINDOW_MIN).max(LOCAL_MODEL_WINDOW_MAX).optional(),
|
|
2162
|
-
});
|
|
2163
|
-
const usdAmount = z.string().regex(/^\d+(\.\d{1,6})?$/, "a USD amount like 0.50 (up to six decimals: USDC's own precision)");
|
|
2164
|
-
export const WalletNetworkSchema = z.enum(["eip155:8453", "eip155:84532"]);
|
|
2165
|
-
export const WalletConfigSchema = z.object({
|
|
2166
|
-
network: WalletNetworkSchema.default("eip155:8453"),
|
|
2167
|
-
address: z.string().optional(),
|
|
2168
|
-
perPaymentMaxUsd: usdAmount.default("1.00"),
|
|
2169
|
-
autoApproveUnderUsd: usdAmount.default("0"),
|
|
2170
|
-
dailyCapUsd: usdAmount.default("5.00"),
|
|
2171
|
-
allow: z.string().optional(),
|
|
2172
|
-
deny: z.string().optional(),
|
|
2173
|
-
});
|
|
2174
|
-
export const CapabilitySchema = z.discriminatedUnion("kind", [
|
|
2175
|
-
z.object({ id: entryId, kind: z.literal("devops"), config: z.object({}) }),
|
|
2176
|
-
z.object({ id: entryId, kind: z.literal("monorepo"), config: z.object({}) }),
|
|
2177
|
-
z.object({ id: entryId, kind: z.literal("mcp"), config: McpConfigSchema }),
|
|
2178
|
-
z.object({ id: entryId, kind: z.literal("service"), config: ServiceConfigSchema }),
|
|
2179
|
-
z.object({ id: entryId, kind: z.literal("integration"), config: IntegrationConfigSchema }),
|
|
2180
|
-
z.object({ id: entryId, kind: z.literal("cli"), config: CliConfigSchema }),
|
|
2181
|
-
z.object({ id: entryId, kind: z.literal("plugin"), config: PluginConfigSchema }),
|
|
2182
|
-
z.object({ id: entryId, kind: z.literal("extension"), config: ExtensionConfigSchema }),
|
|
2183
|
-
z.object({ id: entryId, kind: z.literal("ssh"), config: SshConfigSchema }),
|
|
2184
|
-
z.object({ id: entryId, kind: z.literal("vpn"), config: VpnConfigSchema }),
|
|
2185
|
-
z.object({ id: entryId, kind: z.literal("exit"), config: ExitConfigSchema }),
|
|
2186
|
-
z.object({ id: entryId, kind: z.literal("docker"), config: DockerConfigSchema }),
|
|
2187
|
-
z.object({ id: entryId, kind: z.literal("browser"), config: BrowserConfigSchema }),
|
|
2188
|
-
z.object({ id: entryId, kind: z.literal("identity"), config: IdentityConfigSchema }),
|
|
2189
|
-
z.object({ id: entryId, kind: z.literal("host"), config: HostConfigSchema }),
|
|
2190
|
-
z.object({ id: entryId, kind: z.literal("agent"), config: AcpAgentConfigSchema }),
|
|
2191
|
-
z.object({ id: entryId, kind: z.literal("endpoint"), config: EndpointConfigSchema }),
|
|
2192
|
-
z.object({ id: entryId, kind: z.literal("localmodel"), config: LocalModelConfigSchema }),
|
|
2193
|
-
z.object({ id: entryId, kind: z.literal("wallet"), config: WalletConfigSchema }),
|
|
2194
|
-
]);
|
|
2195
|
-
export const PersonaPowersSchema = z.object({
|
|
2196
|
-
files: z
|
|
2197
|
-
.enum(["none", "read", "write"])
|
|
2198
|
-
.default("write")
|
|
2199
|
-
.describe("What it may do with files: nothing, look and search, or also create and change."),
|
|
2200
|
-
shell: z
|
|
2201
|
-
.boolean()
|
|
2202
|
-
.default(true)
|
|
2203
|
-
.describe("Whether it may run commands, and with them the terminals, the test runs and every tool on the image. The switch the strength of the others depends on."),
|
|
2204
|
-
code: z
|
|
2205
|
-
.boolean()
|
|
2206
|
-
.default(true)
|
|
2207
|
-
.describe("Whether it may write and run a script rather than a command line. Its fence is real where the shell's is not: reads and writes follow the files answer, and it can start no other program unless commands are allowed too. The one stated gap is that the fence cannot cut the network."),
|
|
2208
|
-
web: z.boolean().default(true).describe("Whether it may fetch a page or run a search."),
|
|
2209
|
-
browser: z.boolean().default(true),
|
|
2210
|
-
delegate: z.boolean().default(true),
|
|
2211
|
-
sandbox: z.boolean().default(true),
|
|
2212
|
-
connectors: z.array(entryId).max(100).optional(),
|
|
2213
|
-
computers: z.array(entryId).max(50).optional(),
|
|
2214
|
-
mcp: z.array(entryId).max(50).optional(),
|
|
2215
|
-
});
|
|
2216
|
-
export const PersonaWorkspaceSchema = z.object({
|
|
2217
|
-
startIn: z.string().max(200).optional().describe("Which folder a conversation opens in."),
|
|
2218
|
-
folders: z.array(z.string().min(1)).max(50).optional().describe("Which folders it may touch at all. Absent means the whole workspace."),
|
|
2219
|
-
});
|
|
2220
|
-
export const PersonaSchema = z.object({
|
|
2221
|
-
id: entryId.describe("The persona's id."),
|
|
2222
|
-
label: z.string().max(60).optional().describe("What to call it on screen. Absent falls back to the id, which somebody chose anyway."),
|
|
2223
|
-
capabilities: z
|
|
2224
|
-
.array(entryId)
|
|
2225
|
-
.max(50)
|
|
2226
|
-
.describe("Which connected accounts are its hands. Named individually rather than by site, because two accounts on one site is the whole problem this solves. Naming one that is not connected yet is not an error: it is a card describing an account this sandbox has still to sign into."),
|
|
2227
|
-
repos: z
|
|
2228
|
-
.array(z.string().min(1))
|
|
2229
|
-
.max(50)
|
|
2230
|
-
.optional()
|
|
2231
|
-
.describe("Which repositories prefer this persona, so a conversation opened on one starts with the right choice already made. A preference rather than a fence."),
|
|
2232
|
-
powers: PersonaPowersSchema.optional().describe("What a conversation wearing it may do. Absent means the full toolbox, so a card written before this existed behaves exactly as it did."),
|
|
2233
|
-
workspace: PersonaWorkspaceSchema.optional().describe("Where it works. Absent means the whole workspace."),
|
|
2234
|
-
systemPromptMode: SystemPromptModeSchema.optional(),
|
|
2235
|
-
});
|
|
2236
|
-
export const FRONT_DESK_PERSONA = "front-desk";
|
|
2237
|
-
export const personaBounds = (persona) => {
|
|
2238
|
-
const powers = persona.powers;
|
|
2239
|
-
if (powers === undefined) {
|
|
2240
|
-
return "Full powers";
|
|
2241
|
-
}
|
|
2242
|
-
const resolved = PersonaPowersSchema.parse(powers);
|
|
2243
|
-
if (resolved.files === "read" && !resolved.shell) {
|
|
2244
|
-
return "Read-only";
|
|
2245
|
-
}
|
|
2246
|
-
if (!resolved.shell) {
|
|
2247
|
-
return "No shell";
|
|
2248
|
-
}
|
|
2249
|
-
const limits = [
|
|
2250
|
-
resolved.files === "none",
|
|
2251
|
-
!resolved.code,
|
|
2252
|
-
!resolved.web,
|
|
2253
|
-
!resolved.browser,
|
|
2254
|
-
!resolved.delegate,
|
|
2255
|
-
!resolved.sandbox,
|
|
2256
|
-
resolved.connectors !== undefined,
|
|
2257
|
-
resolved.computers !== undefined,
|
|
2258
|
-
resolved.mcp !== undefined,
|
|
2259
|
-
].filter(Boolean).length;
|
|
2260
|
-
return limits === 0 ? "Full powers" : `${limits} limit${limits === 1 ? "" : "s"}`;
|
|
2261
|
-
};
|
|
2262
|
-
export const PersonaIdParamSchema = z.object({ id: entryId.describe("Which persona.") });
|
|
2263
|
-
export const PersonasListSchema = z.object({
|
|
2264
|
-
personas: z.array(PersonaSchema).describe("The characters an agent can wear."),
|
|
2265
|
-
connected: z
|
|
2266
|
-
.array(z.string())
|
|
2267
|
-
.describe("Which accounts are actually connected right now, so a persona naming one that has since been disconnected can be shown as broken rather than as working."),
|
|
2268
|
-
});
|
|
2269
|
-
export const PersonaKitSchema = z.object({
|
|
2270
|
-
prompt: z
|
|
2271
|
-
.string()
|
|
2272
|
-
.describe("What this persona is told, on top of everything else. Empty means it simply follows the sandbox's own instructions."),
|
|
2273
|
-
skills: z
|
|
2274
|
-
.array(z.object({
|
|
2275
|
-
name: z.string().describe("The skill's name."),
|
|
2276
|
-
description: z.string().describe("What it is for."),
|
|
2277
|
-
}))
|
|
2278
|
-
.describe("Skills only this persona's conversations can reach. A different question from what the agent knows generally, with a different answer."),
|
|
2279
|
-
});
|
|
2280
|
-
export const PersonaPromptSchema = PersonaIdParamSchema.extend({
|
|
2281
|
-
prompt: z
|
|
2282
|
-
.string()
|
|
2283
|
-
.max(20000)
|
|
2284
|
-
.describe("What to tell this persona. Sending an empty one removes it entirely rather than storing a blank, so the persona falls back to the sandbox's own instructions."),
|
|
2285
|
-
});
|
|
2286
|
-
export const PersonaSkillSchema = PersonaIdParamSchema.extend(SkillDraftSchema.shape);
|
|
2287
|
-
export const PersonaSkillNameSchema = PersonaIdParamSchema.extend({ name: SkillNameSchema.describe("Which skill.") });
|
|
2288
|
-
export const PersonaSkillBodySchema = z.object({
|
|
2289
|
-
name: z.string().describe("The skill's name."),
|
|
2290
|
-
description: z.string().describe("What it is for."),
|
|
2291
|
-
body: z.string().describe("The skill itself, in full."),
|
|
2292
|
-
});
|
|
2293
|
-
export const CapabilityStatusSchema = z.object({
|
|
2294
|
-
state: CapabilityStateSchema.describe("Whether it is live, still coming up, broken, or switched off."),
|
|
2295
|
-
detail: z.string().optional().describe("What is wrong, in words a person can act on."),
|
|
2296
|
-
code: z.string().optional().describe("A short marker for that reason, for anything deciding what to do about it."),
|
|
2297
|
-
});
|
|
2298
|
-
export const CapabilitySummarySchema = z.object({
|
|
2299
|
-
id: z.string().describe("The connection's id."),
|
|
2300
|
-
kind: CapabilityKindSchema.describe("What sort of thing it is."),
|
|
2301
|
-
status: CapabilityStatusSchema.describe("Whether it is working."),
|
|
2302
|
-
config: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).describe("Its settings, minus anything secret."),
|
|
2303
|
-
secrets: z
|
|
2304
|
-
.array(z.string())
|
|
2305
|
-
.default([])
|
|
2306
|
-
.describe("Which credentials it holds, by name. The values are on one route only, and it is not this one."),
|
|
2307
|
-
});
|
|
2308
|
-
export const CapabilityRecommendationSchema = z.object({
|
|
2309
|
-
card: z.string().describe("Which connection is being suggested."),
|
|
2310
|
-
evidence: z
|
|
2311
|
-
.string()
|
|
2312
|
-
.describe("What was seen that prompted it: a file, a remote, printed verbatim so the claim can be checked rather than believed."),
|
|
2313
|
-
reason: z.string().describe("The same claim in words, without repeating the evidence into it."),
|
|
2314
|
-
prefill: z
|
|
2315
|
-
.record(z.string(), z.string())
|
|
2316
|
-
.describe("Settings the scan could read, to fill the form so you supply only the credential. Never a secret, even when one is sitting in a checked-in file: the suggestion points at such a file, it does not absorb what is in it."),
|
|
2317
|
-
});
|
|
2318
|
-
export const CapabilitiesListSchema = z.object({
|
|
2319
|
-
capabilities: z.array(CapabilitySummarySchema).describe("What this sandbox is connected to."),
|
|
2320
|
-
recommendations: z
|
|
2321
|
-
.array(CapabilityRecommendationSchema)
|
|
2322
|
-
.default([])
|
|
2323
|
-
.describe("Things worth connecting, worked out from what is actually in the workspace rather than from anything you configured. Re-derived on every read, so one whose evidence has moved simply stops being suggested."),
|
|
2324
|
-
});
|
|
2325
|
-
export const CapabilityIdParamSchema = z.object({ id: z.string().describe("Which connection.") });
|
|
2326
|
-
export const CapabilityConnectionSchema = z.object({
|
|
2327
|
-
id: z.string().describe("The connection's id."),
|
|
2328
|
-
kind: z.string().describe("What sort of thing it is."),
|
|
2329
|
-
config: z
|
|
2330
|
-
.record(z.string(), z.string())
|
|
2331
|
-
.describe("Its settings exactly as stored, credentials included. The field names are its own kind's, which the caller already knows."),
|
|
2332
|
-
});
|
|
2333
|
-
export const CapabilityCardParamSchema = z.object({ card: z.string().describe("Which suggestion to stop making.") });
|
|
2334
|
-
export const CapabilitySecretInputSchema = z.object({
|
|
2335
|
-
id: z.string().describe("Which connection."),
|
|
2336
|
-
value: z.string().min(1).describe("The new credential. Its other settings are left alone."),
|
|
2337
|
-
});
|
|
2338
|
-
export const CapabilityRenameSchema = z.object({
|
|
2339
|
-
id: z.string(),
|
|
2340
|
-
to: z
|
|
2341
|
-
.string()
|
|
2342
|
-
.min(1)
|
|
2343
|
-
.max(60)
|
|
2344
|
-
.regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/),
|
|
2345
|
-
});
|
|
2346
|
-
export const CapabilityLoginSchema = z.object({ session: z.string().describe("The terminal the sign-in is happening in. Attach to it to type.") });
|
|
2347
|
-
export const CapabilityOtpSchema = z.object({
|
|
2348
|
-
code: z.string().describe("The code."),
|
|
2349
|
-
secondsRemaining: z
|
|
2350
|
-
.number()
|
|
2351
|
-
.describe("How long it lasts. Its expiring is what makes handing one to an agent safe, since the seed behind it is never revealed."),
|
|
2352
|
-
});
|
|
2353
|
-
export const CapabilityProbeSchema = z.object({
|
|
2354
|
-
checked: z.boolean().describe("Whether this connection can be tested from here at all. False is not a failure: it is 'no test exists'."),
|
|
2355
|
-
ok: z.boolean().describe("Whether the service answered as itself."),
|
|
2356
|
-
message: z
|
|
2357
|
-
.string()
|
|
2358
|
-
.describe("What happened, in the words a person standing in front of the form needs: the service's own answer, or its refusal."),
|
|
2359
|
-
});
|
|
2360
|
-
export const HostFactsSchema = z.object({
|
|
2361
|
-
os: z.string(),
|
|
2362
|
-
arch: z.string(),
|
|
2363
|
-
shell: z.string(),
|
|
2364
|
-
home: z.string(),
|
|
2365
|
-
roots: z.array(z.string()),
|
|
2366
|
-
});
|
|
2367
|
-
export const HostSummarySchema = z.object({
|
|
2368
|
-
id: z.string(),
|
|
2369
|
-
platform: z.string().min(1),
|
|
2370
|
-
online: z.boolean(),
|
|
2371
|
-
version: z.string().optional(),
|
|
2372
|
-
lastSeen: z.number().optional(),
|
|
2373
|
-
facts: HostFactsSchema.optional(),
|
|
2374
|
-
});
|
|
2375
|
-
export const HostsListSchema = z.object({ hosts: z.array(HostSummarySchema) });
|
|
2376
|
-
export const VpnStateSchema = z.enum([
|
|
2377
|
-
"connected",
|
|
2378
|
-
"connecting",
|
|
2379
|
-
"disconnected",
|
|
2380
|
-
"unavailable",
|
|
2381
|
-
"failed",
|
|
2382
|
-
]);
|
|
2383
|
-
export const VpnLinkSchema = z.object({
|
|
2384
|
-
id: z.string().describe("Which tunnel."),
|
|
2385
|
-
provider: VpnProviderSchema.describe("What kind of tunnel it is."),
|
|
2386
|
-
state: VpnStateSchema.describe("Whether it is up, dialling, resting, failed, or not installable yet because its client needs a rebuild to arrive."),
|
|
2387
|
-
gateway: z.string().optional().describe("What it dials. For display only, and never a credential."),
|
|
2388
|
-
interface: z.string().optional().describe("The network interface carrying it, once one exists."),
|
|
2389
|
-
address: z
|
|
2390
|
-
.string()
|
|
2391
|
-
.optional()
|
|
2392
|
-
.describe("The address the far end gave this sandbox, which is the single most useful answer to whether you are on the VPN."),
|
|
2393
|
-
routes: z
|
|
2394
|
-
.array(z.string())
|
|
2395
|
-
.default([])
|
|
2396
|
-
.describe("What goes through it. Everything, when the range covers the whole internet. Empty until it is up."),
|
|
2397
|
-
dns: z.array(z.string()).default([]).describe("Name servers it pushed, when it pushed any."),
|
|
2398
|
-
since: z.number().optional().describe("When it came up, in milliseconds. Absent unless it is."),
|
|
2399
|
-
autoConnect: z.boolean().describe("Whether it dials itself when the sandbox starts."),
|
|
2400
|
-
detail: z.string().optional().describe("Why it failed, or a note about a healthy one. Never a credential."),
|
|
2401
|
-
});
|
|
2402
|
-
export const VpnListSchema = z.object({
|
|
2403
|
-
links: z
|
|
2404
|
-
.array(VpnLinkSchema)
|
|
2405
|
-
.describe("Every configured tunnel with its live state, read back from the operating system each time rather than remembered."),
|
|
2406
|
-
});
|
|
2407
|
-
export const VpnConnectInputSchema = z.object({
|
|
2408
|
-
id: z.string().describe("Which tunnel to dial."),
|
|
2409
|
-
otp: z
|
|
2410
|
-
.string()
|
|
2411
|
-
.min(1)
|
|
2412
|
-
.optional()
|
|
2413
|
-
.describe("A one-time code, where the gateway wants one. Supplied per dial and never stored; without it such a gateway refuses and says so."),
|
|
2414
|
-
});
|
|
2415
|
-
export const VpnIdParamSchema = z.object({ id: z.string().describe("Which tunnel.") });
|
|
2416
|
-
export const ForticlientImportInputSchema = z.object({
|
|
2417
|
-
xml: z.string().min(1).describe("The exported configuration file, whole. Nothing is stored: it is read and thrown away."),
|
|
2418
|
-
});
|
|
2419
|
-
export const ForticlientConnectionSchema = z.object({
|
|
2420
|
-
id: z.string().describe("The id it would be added under."),
|
|
2421
|
-
label: z.string().describe("Its name as the file has it, so somebody recognises the connection they are picking."),
|
|
2422
|
-
provider: VpnProviderSchema.describe("What kind of tunnel it is."),
|
|
2423
|
-
server: z.string().describe("Where it dials."),
|
|
2424
|
-
port: z.number().describe("On which port."),
|
|
2425
|
-
username: z
|
|
2426
|
-
.string()
|
|
2427
|
-
.optional()
|
|
2428
|
-
.describe("The username, but only when the file stored it in the clear. An encrypted one is dropped rather than guessed at."),
|
|
2429
|
-
description: z.string().optional().describe("Whatever the file said about it."),
|
|
2430
|
-
localId: z.string().optional().describe("An identity some tunnel types need, when the file stored it readably."),
|
|
2431
|
-
aggressive: z.boolean().optional().describe("Which negotiation mode it used."),
|
|
2432
|
-
pfs: z.boolean().optional().describe("Whether it asked for forward secrecy."),
|
|
2433
|
-
dhGroup: z
|
|
2434
|
-
.string()
|
|
2435
|
-
.optional()
|
|
2436
|
-
.describe("Which key-exchange group it used. Together with the setting above, this is what decides whether the connection can complete at all."),
|
|
2437
|
-
needs: z
|
|
2438
|
-
.array(z.string())
|
|
2439
|
-
.describe("What you still have to type in before it can dial. Always at least the password, because the export wraps credentials in encryption that cannot be undone here."),
|
|
2440
|
-
});
|
|
2441
|
-
export const ForticlientImportSchema = z.object({
|
|
2442
|
-
connections: z.array(ForticlientConnectionSchema).describe("The connections found in the file, ready to be added one at a time."),
|
|
2443
|
-
});
|
|
2444
|
-
export const ExitStateSchema = z.enum([
|
|
2445
|
-
"up",
|
|
2446
|
-
"starting",
|
|
2447
|
-
"down",
|
|
2448
|
-
"unavailable",
|
|
2449
|
-
"failed",
|
|
2450
|
-
]);
|
|
2451
|
-
export const ExitObservationSchema = z.object({
|
|
2452
|
-
ip: z.string().describe("The address the world sees, looked up through the exit's own proxy rather than assumed."),
|
|
2453
|
-
country: z
|
|
2454
|
-
.string()
|
|
2455
|
-
.optional()
|
|
2456
|
-
.describe("Which country that address is in. Absent when the lookup gave an address and no country, in which case a switch is judged on the address having changed instead."),
|
|
2457
|
-
countryName: z.string().optional().describe("That country's name, spelled out."),
|
|
2458
|
-
});
|
|
2459
|
-
export const ExitPointSchema = z.object({
|
|
2460
|
-
country: z.string().describe("The country's code."),
|
|
2461
|
-
countryName: z.string().describe("Its name, spelled out."),
|
|
2462
|
-
servers: z.number().describe("How many servers this provider has there."),
|
|
2463
|
-
share: z
|
|
2464
|
-
.number()
|
|
2465
|
-
.optional()
|
|
2466
|
-
.describe("How much of the provider's actual capacity is there, from zero to one. This is what a list should be sorted by: a third of the countries on offer are one overloaded machine behind a flag, and a count of servers would rank them first."),
|
|
2467
|
-
});
|
|
2468
|
-
export const ExitCountriesSchema = z.object({
|
|
2469
|
-
countries: z.array(ExitPointSchema).describe("Where this exit can put you, best-supplied first."),
|
|
2470
|
-
live: z
|
|
2471
|
-
.boolean()
|
|
2472
|
-
.describe("Whether the provider answered, or this came from a built-in list. Said out loud rather than presenting an old list as current."),
|
|
2473
|
-
});
|
|
2474
|
-
export const ExitLinkSchema = z.object({
|
|
2475
|
-
id: z.string().describe("Which exit."),
|
|
2476
|
-
provider: ExitProviderSchema.describe("What it runs on."),
|
|
2477
|
-
state: ExitStateSchema.describe("Whether it is carrying traffic, coming up, resting, failed, or not installable yet because its client needs a rebuild to arrive."),
|
|
2478
|
-
proxy: z
|
|
2479
|
-
.string()
|
|
2480
|
-
.describe("Where to point traffic that should go through it. Fixed per exit and unchanged by a country switch, which is what lets a long job move country halfway through without reconfiguring anything."),
|
|
2481
|
-
country: z.string().optional().describe("Where it was asked to come out. Absent means the provider chose."),
|
|
2482
|
-
observedCountry: z
|
|
2483
|
-
.string()
|
|
2484
|
-
.optional()
|
|
2485
|
-
.describe("Where it actually comes out, as last checked. Kept separate from what was asked for, because those two disagreeing is the most useful fault signal this whole feature has."),
|
|
2486
|
-
ip: z.string().optional().describe("The address behind that observation."),
|
|
2487
|
-
checkedAt: z.number().optional().describe("When that was checked, in milliseconds, so an old reading can be shown as old."),
|
|
2488
|
-
interface: z.string().optional().describe("The network interface, for the kinds that have one."),
|
|
2489
|
-
since: z.number().optional().describe("When it came up, in milliseconds."),
|
|
2490
|
-
autoStart: z.boolean().describe("Whether it starts itself when the sandbox does."),
|
|
2491
|
-
detail: z.string().optional().describe("Why it failed, or a note about a healthy one."),
|
|
2492
|
-
});
|
|
2493
|
-
export const ExitListSchema = z.object({
|
|
2494
|
-
links: z.array(ExitLinkSchema).describe("Every configured exit, with where it was asked to come out and where it actually does."),
|
|
2495
|
-
});
|
|
2496
|
-
export const TOR_EXIT_COUNTRIES = [
|
|
2497
|
-
{ country: "NL", countryName: "Netherlands", servers: 607, share: 0.304 },
|
|
2498
|
-
{ country: "DE", countryName: "Germany", servers: 415, share: 0.242 },
|
|
2499
|
-
{ country: "SE", countryName: "Sweden", servers: 344, share: 0.14 },
|
|
2500
|
-
{ country: "US", countryName: "United States", servers: 1171, share: 0.097 },
|
|
2501
|
-
{ country: "AT", countryName: "Austria", servers: 123, share: 0.054 },
|
|
2502
|
-
{ country: "LU", countryName: "Luxembourg", servers: 92, share: 0.033 },
|
|
2503
|
-
{ country: "FR", countryName: "France", servers: 63, share: 0.032 },
|
|
2504
|
-
{ country: "NO", countryName: "Norway", servers: 54, share: 0.026 },
|
|
2505
|
-
{ country: "RO", countryName: "Romania", servers: 71, share: 0.011 },
|
|
2506
|
-
{ country: "DK", countryName: "Denmark", servers: 15, share: 0.007 },
|
|
2507
|
-
{ country: "HU", countryName: "Hungary", servers: 20, share: 0.006 },
|
|
2508
|
-
{ country: "IT", countryName: "Italy", servers: 15, share: 0.006 },
|
|
2509
|
-
{ country: "UA", countryName: "Ukraine", servers: 23, share: 0.006 },
|
|
2510
|
-
{ country: "CH", countryName: "Switzerland", servers: 23, share: 0.006 },
|
|
2511
|
-
{ country: "IS", countryName: "Iceland", servers: 23, share: 0.003 },
|
|
2512
|
-
{ country: "PL", countryName: "Poland", servers: 8, share: 0.002 },
|
|
2513
|
-
{ country: "BG", countryName: "Bulgaria", servers: 17, share: 0.002 },
|
|
2514
|
-
{ country: "GB", countryName: "United Kingdom", servers: 8, share: 0.002 },
|
|
2515
|
-
{ country: "FI", countryName: "Finland", servers: 13, share: 0.002 },
|
|
2516
|
-
];
|
|
2517
|
-
export const VPNGATE_EXIT_COUNTRIES = [
|
|
2518
|
-
{ country: "JP", countryName: "Japan", servers: 46, share: 0.48 },
|
|
2519
|
-
{ country: "KR", countryName: "Korea, South", servers: 37, share: 0.39 },
|
|
2520
|
-
{ country: "VN", countryName: "Vietnam", servers: 3, share: 0.03 },
|
|
2521
|
-
{ country: "TH", countryName: "Thailand", servers: 2, share: 0.02 },
|
|
2522
|
-
{ country: "RU", countryName: "Russia", servers: 2, share: 0.02 },
|
|
2523
|
-
{ country: "RO", countryName: "Romania", servers: 1, share: 0.01 },
|
|
2524
|
-
{ country: "MX", countryName: "Mexico", servers: 1, share: 0.01 },
|
|
2525
|
-
{ country: "IN", countryName: "India", servers: 1, share: 0.01 },
|
|
2526
|
-
{ country: "CN", countryName: "China", servers: 1, share: 0.01 },
|
|
2527
|
-
{ country: "BY", countryName: "Belarus", servers: 1, share: 0.01 },
|
|
2528
|
-
];
|
|
2529
|
-
export const ExitIdParamSchema = z.object({ id: z.string().describe("Which exit.") });
|
|
2530
|
-
export const ExitUseInputSchema = z.object({
|
|
2531
|
-
id: z.string().describe("Which exit."),
|
|
2532
|
-
country: CountryCodeSchema.optional().describe("Where to come out. Leaving it out means letting the provider choose, so clearing a country is something you can actually say rather than only setting one."),
|
|
2533
|
-
});
|
|
2534
|
-
export const MarketplaceRequestSchema = z.object({
|
|
2535
|
-
url: z.url().describe("The registry to read."),
|
|
2536
|
-
token: z
|
|
2537
|
-
.string()
|
|
2538
|
-
.min(1)
|
|
2539
|
-
.optional()
|
|
2540
|
-
.describe("A credential for a private one. Sent as a body rather than in the address, so it never lands in a log."),
|
|
2541
|
-
});
|
|
2542
|
-
export const MarketplaceSchema = z.object({
|
|
2543
|
-
name: z.string().describe("What the registry calls itself."),
|
|
2544
|
-
plugins: z
|
|
2545
|
-
.array(RegistryEntrySchema)
|
|
2546
|
-
.describe("What it lists, each with the curated decision, the resolved pointer and what a scan found upstream."),
|
|
2547
|
-
});
|
|
2548
|
-
const extensionId = z
|
|
2549
|
-
.string()
|
|
2550
|
-
.min(1)
|
|
2551
|
-
.max(121)
|
|
2552
|
-
.regex(/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/);
|
|
2553
|
-
export const ExtensionUpdatePolicySchema = z.object({
|
|
2554
|
-
updates: z.enum(["notify", "agent", "auto"]),
|
|
2555
|
-
advisories: z.enum(["auto-disable", "notify"]),
|
|
2556
|
-
});
|
|
2557
|
-
export const ExtensionUpdateSchema = z.object({
|
|
2558
|
-
ref: z.string().describe("The commit being offered."),
|
|
2559
|
-
version: z.string().optional().describe("What it calls itself."),
|
|
2560
|
-
url: z.string().describe("Where it comes from."),
|
|
2561
|
-
path: z.string().optional().describe("Where inside that repository it lives."),
|
|
2562
|
-
trust: z.enum(["verified", "listed"]).describe("Whether anybody vouched for it, or it is merely listed."),
|
|
2563
|
-
securityFix: z
|
|
2564
|
-
.boolean()
|
|
2565
|
-
.optional()
|
|
2566
|
-
.describe("This release fixes a security problem in earlier ones, so here the old version is the dangerous one."),
|
|
2567
|
-
registry: z.string().describe("Which registry said so."),
|
|
2568
|
-
at: z.string().describe("When it was published."),
|
|
2569
|
-
needsReview: z
|
|
2570
|
-
.string()
|
|
2571
|
-
.optional()
|
|
2572
|
-
.describe("Why this one was not taken automatically and is asking for a person instead: it wants more than it used to, or nobody has vouched for it."),
|
|
2573
|
-
review: z
|
|
2574
|
-
.object({
|
|
2575
|
-
conversationId: z.string().describe("Where to read what it found."),
|
|
2576
|
-
at: z.string().describe("When it looked."),
|
|
2577
|
-
})
|
|
2578
|
-
.optional()
|
|
2579
|
-
.describe("An agent has already read the difference between what is installed and this, so the card can link to what it found rather than offer to start looking."),
|
|
2580
|
-
});
|
|
2581
|
-
export const ExtensionAdvisorySchema = z.object({
|
|
2582
|
-
reason: z
|
|
2583
|
-
.string()
|
|
2584
|
-
.describe("Why the registry pulled the listing, in its own words. Delisting protects people browsing; this record is for the person already running it."),
|
|
2585
|
-
registry: z.string().describe("Which registry said so."),
|
|
2586
|
-
at: z.string().describe("When."),
|
|
2587
|
-
autoDisabled: z.boolean().describe("Whether the sandbox has already switched it off."),
|
|
2588
|
-
});
|
|
2589
|
-
export const ExtensionHealthSchema = z.object({
|
|
2590
|
-
state: z
|
|
2591
|
-
.enum(["watching", "healthy", "unhealthy"])
|
|
2592
|
-
.describe("How it has behaved since the last update. Checks catch broken, not wrong, so for a while after a swap it is simply watched."),
|
|
2593
|
-
detail: z.string().optional().describe("What is going wrong, when something is."),
|
|
2594
|
-
fromRef: z.string().optional().describe("Which version it was updated from, which is what going back would return to."),
|
|
2595
|
-
at: z.string().describe("When the watching started."),
|
|
2596
|
-
autoReverted: z
|
|
2597
|
-
.boolean()
|
|
2598
|
-
.optional()
|
|
2599
|
-
.describe("The update was already rolled back without anybody asking. The record stays rather than pretending the attempt never happened."),
|
|
2600
|
-
});
|
|
2601
|
-
export const PowersDiffSchema = z.object({
|
|
2602
|
-
added: z.array(z.string()).describe("What the new version asks for that the running one does not. The whole point of the comparison."),
|
|
2603
|
-
removed: z.array(z.string()).describe("What it no longer asks for."),
|
|
2604
|
-
unchanged: z.array(z.string()).describe("What stays the same."),
|
|
2605
|
-
});
|
|
2606
|
-
export const ExtensionUpdateActionSchema = z.object({
|
|
2607
|
-
id: extensionId.describe("Which extension."),
|
|
2608
|
-
ref: z
|
|
2609
|
-
.string()
|
|
2610
|
-
.regex(/^[0-9a-f]{40}$/)
|
|
2611
|
-
.optional()
|
|
2612
|
-
.describe("Which commit, in full. Leave it out for whatever the last check found, which is what most callers mean."),
|
|
2613
|
-
});
|
|
2614
|
-
export const ExtensionUpdatePreviewSchema = z.object({
|
|
2615
|
-
ref: z.string().describe("The commit this would install."),
|
|
2616
|
-
version: z.string().describe("What that version calls itself."),
|
|
2617
|
-
installedVersion: z.string().describe("What is running now."),
|
|
2618
|
-
engines: z.string().describe("Which sandbox versions the new one says it needs."),
|
|
2619
|
-
compatible: z.boolean().describe("Whether this sandbox is one of them."),
|
|
2620
|
-
powers: PowersDiffSchema.describe("Exactly what the new code asks for that the running one does not. This is what approving an update is approving."),
|
|
2621
|
-
});
|
|
2622
|
-
export const ExtensionUpdateAppliedSchema = z.object({
|
|
2623
|
-
ok: z.literal(true).describe("It went through."),
|
|
2624
|
-
ref: z.string().describe("Which commit is now running."),
|
|
2625
|
-
rebuildNeeded: z
|
|
2626
|
-
.boolean()
|
|
2627
|
-
.optional()
|
|
2628
|
-
.describe("The new version changes what the sandbox image contains, so a one-time rebuild is still pending and the update is not wholly landed yet."),
|
|
2629
|
-
});
|
|
2630
|
-
export const ExtensionUpdatePolicyInputSchema = z.object({
|
|
2631
|
-
id: extensionId.describe("Which extension."),
|
|
2632
|
-
updates: z
|
|
2633
|
-
.enum(["notify", "agent", "auto"])
|
|
2634
|
-
.optional()
|
|
2635
|
-
.describe("What to do about a newer version: tell you, have an agent read the difference first, or just take it."),
|
|
2636
|
-
advisories: z.enum(["auto-disable", "notify"]).optional().describe("What to do about a security warning: switch it off at once, or tell you."),
|
|
2637
|
-
});
|
|
2638
|
-
export const ExtensionUpdatesCheckedSchema = z.object({
|
|
2639
|
-
ok: z.literal(true).describe("The check ran."),
|
|
2640
|
-
checkedAt: z.string().describe("When, so a screen can date the answer."),
|
|
2641
|
-
});
|
|
2642
|
-
export const ExtensionSummarySchema = z.object({
|
|
2643
|
-
id: extensionId.describe("The extension's id."),
|
|
2644
|
-
manifest: ExtensionManifestSchema.describe("What it declares about itself: what it contributes, what it needs, and what it may reach."),
|
|
2645
|
-
commit: z.string().describe("Exactly which commit is installed."),
|
|
2646
|
-
source: z
|
|
2647
|
-
.enum(["builtin", "installed", "workspace"])
|
|
2648
|
-
.describe("Where the code comes from: baked into the sandbox image and not removable, installed from a repository at a pinned commit, or written in this workspace and edited in place."),
|
|
2649
|
-
enabled: z
|
|
2650
|
-
.boolean()
|
|
2651
|
-
.describe("The owner's switch. A switched-off extension is still listed, which is what makes it switchable back on, but nothing it contributes is wired up."),
|
|
2652
|
-
essential: z
|
|
2653
|
-
.boolean()
|
|
2654
|
-
.optional()
|
|
2655
|
-
.describe("Its switch is fixed on, because it is the only way to see or stop an engine the sandbox runs regardless. Hiding that page would not stop the spending, only your ability to notice it. Declared by the core about its own surfaces, never by an extension about itself, which would be a pack making itself un-removable."),
|
|
2656
|
-
usage: z
|
|
2657
|
-
.record(z.string(), z.object({ calls: z.number().int().nonnegative().describe("How many times."), last: z.string().describe("When, most recently.") }))
|
|
2658
|
-
.optional()
|
|
2659
|
-
.describe("How much of the reach it asked for it has actually used, keyed by what it declared. Absent means never observed doing anything, which is a different claim from uses none of them, and the two have to stay tellable apart: reading either as these permissions are unnecessary turns evidence into a guess with a number on it."),
|
|
2660
|
-
backend: z
|
|
2661
|
-
.object({
|
|
2662
|
-
state: z
|
|
2663
|
-
.enum(["running", "error", "absent", "incompatible", "starting", "stopped"])
|
|
2664
|
-
.describe("How its server half is doing. Absent means the code is not in this image at all; incompatible means it needs a different sandbox version."),
|
|
2665
|
-
detail: z
|
|
2666
|
-
.string()
|
|
2667
|
-
.optional()
|
|
2668
|
-
.describe("What went wrong, so a backend that failed to start is a sentence rather than an address that answers nothing."),
|
|
2669
|
-
})
|
|
2670
|
-
.optional()
|
|
2671
|
-
.describe("Present only for an extension that ships a server half."),
|
|
2672
|
-
update: ExtensionUpdateSchema.optional().describe("A newer version waiting. All five of these exist only for one installed from a repository: a built-in updates with the image and one written here is edited live."),
|
|
2673
|
-
advisory: ExtensionAdvisorySchema.optional().describe("A security warning about the installed version."),
|
|
2674
|
-
health: ExtensionHealthSchema.optional().describe("How it has behaved since the last update, which is what decides whether that update sticks."),
|
|
2675
|
-
previous: z
|
|
2676
|
-
.object({
|
|
2677
|
-
ref: z.string().describe("The commit that was running before."),
|
|
2678
|
-
version: z.string().optional().describe("What it called itself."),
|
|
2679
|
-
})
|
|
2680
|
-
.optional()
|
|
2681
|
-
.describe("The version kept one step back, which is what going back means."),
|
|
2682
|
-
updatePolicy: ExtensionUpdatePolicySchema.optional().describe("The owner's standing answer for this one: tell me, have an agent look, or just do it."),
|
|
2683
|
-
});
|
|
2684
|
-
export const InvalidWorkspaceExtensionSchema = z.object({
|
|
2685
|
-
dir: z.string().describe("Which folder."),
|
|
2686
|
-
error: z.string().describe("Why it could not be read."),
|
|
2687
|
-
});
|
|
2688
|
-
export const ExtensionsListSchema = z.object({
|
|
2689
|
-
extensions: z.array(ExtensionSummarySchema).describe("What is installed."),
|
|
2690
|
-
invalid: z
|
|
2691
|
-
.array(InvalidWorkspaceExtensionSchema)
|
|
2692
|
-
.describe("Extensions written here that could not be read at all. Listed rather than dropped, because there is no install moment at which to reject a broken one, so this is its only way of saying anything."),
|
|
2693
|
-
updatesCheckedAt: z
|
|
2694
|
-
.string()
|
|
2695
|
-
.optional()
|
|
2696
|
-
.describe("When updates were last looked for. Absent until the first check has run. Sent so a screen can say checked an hour ago rather than presenting staleness as certainty."),
|
|
2697
|
-
});
|
|
2698
|
-
export const ExtensionSettingsSchema = z.object({
|
|
2699
|
-
settings: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).describe("The values, minus anything marked secret."),
|
|
2700
|
-
secretsSet: z
|
|
2701
|
-
.array(z.string())
|
|
2702
|
-
.describe("Which of its secret settings actually hold a value. Names only: the values themselves never come back."),
|
|
2703
|
-
});
|
|
2704
|
-
export const ExtensionSettingsInputSchema = z.object({
|
|
2705
|
-
id: z.string().describe("Which extension."),
|
|
2706
|
-
settings: z
|
|
2707
|
-
.record(z.string(), z.union([z.string(), z.number(), z.boolean()]))
|
|
2708
|
-
.describe("The values to write. A key the extension never declared is refused rather than quietly stored."),
|
|
2709
|
-
});
|
|
2710
|
-
export const ExtensionEnabledInputSchema = z.object({
|
|
2711
|
-
id: z.string().describe("Which extension."),
|
|
2712
|
-
enabled: z.boolean().describe("On or off."),
|
|
2713
|
-
});
|
|
2714
|
-
export const WorkspaceExtensionCreateSchema = z.object({
|
|
2715
|
-
publisher: z
|
|
2716
|
-
.string()
|
|
2717
|
-
.regex(/^[a-z0-9][a-z0-9-]*$/)
|
|
2718
|
-
.describe("Who it is by, which together with the name makes its id."),
|
|
2719
|
-
name: z
|
|
2720
|
-
.string()
|
|
2721
|
-
.regex(/^[a-z0-9][a-z0-9-]*$/)
|
|
2722
|
-
.describe("What it is called."),
|
|
2723
|
-
});
|
|
2724
|
-
export const WorkspaceExtensionCreatedSchema = z.object({
|
|
2725
|
-
id: z.string().describe("The id it was given."),
|
|
2726
|
-
dir: z.string().describe("Where its files are, so you can open them."),
|
|
2727
|
-
});
|
|
2728
|
-
export const ExtensionUsageInputSchema = z.object({
|
|
2729
|
-
id: z.string().describe("Which extension."),
|
|
2730
|
-
used: z.record(z.string(), z.number().int().positive()).describe("Which of its declared powers it exercised, and how many times."),
|
|
2731
|
-
});
|
|
2732
|
-
export const ExtensionProcessParamSchema = z.object({
|
|
2733
|
-
id: z.string().describe("Which extension."),
|
|
2734
|
-
name: z.string().describe("Which of its declared processes."),
|
|
2735
|
-
});
|
|
2736
|
-
export const ExtensionProcessStatusSchema = z.object({
|
|
2737
|
-
name: z.string().describe("Which process."),
|
|
2738
|
-
running: z.boolean().describe("Whether it is up."),
|
|
2739
|
-
port: z.number().optional().describe("The port it was given."),
|
|
2740
|
-
previewUrl: z.string().optional().describe("Where to open it, when it has an address."),
|
|
2741
|
-
});
|
|
2742
|
-
export const WorkspaceEventKindSchema = z.enum(["turn.settled", "agent.landed", "deps.broken", "deps.fixed"]);
|
|
2743
|
-
export const WorkspaceEventSchema = z.object({
|
|
2744
|
-
event: WorkspaceEventKindSchema,
|
|
2745
|
-
agentId: z.string(),
|
|
2746
|
-
title: z.string().optional(),
|
|
2747
|
-
branch: z.string(),
|
|
2748
|
-
outcome: z.enum(["landed", "conflict", "ready", "idle", "error"]),
|
|
2749
|
-
repos: z.array(z.object({ repo: z.string(), from: z.string(), dir: z.string() })),
|
|
2750
|
-
deps: z
|
|
2751
|
-
.object({
|
|
2752
|
-
project: z.string(),
|
|
2753
|
-
command: z.string(),
|
|
2754
|
-
exitCode: z.number(),
|
|
2755
|
-
attempt: z.number(),
|
|
2756
|
-
logTail: z.string(),
|
|
2757
|
-
})
|
|
2758
|
-
.optional(),
|
|
2759
|
-
});
|
|
2760
|
-
export const TriggerSchema = z.discriminatedUnion("kind", [
|
|
2761
|
-
z.object({
|
|
2762
|
-
kind: z.literal("schedule").describe("On a clock."),
|
|
2763
|
-
cron: z.string().min(1).describe("When, in cron notation."),
|
|
2764
|
-
}),
|
|
2765
|
-
z.object({
|
|
2766
|
-
kind: z.literal("event").describe("When something calls its webhook."),
|
|
2767
|
-
token: z
|
|
2768
|
-
.string()
|
|
2769
|
-
.min(1)
|
|
2770
|
-
.optional()
|
|
2771
|
-
.describe("The credential a caller presents. It is the only one in the exchange, because an outside sender has no identity here."),
|
|
2772
|
-
}),
|
|
2773
|
-
z.object({
|
|
2774
|
-
kind: z.literal("listener").describe("When a message arrives from somewhere outside."),
|
|
2775
|
-
provider: z.string().min(1).describe("Which service to listen to."),
|
|
2776
|
-
channelId: z.string().min(1).optional().describe("Narrow it to one channel or thread."),
|
|
2777
|
-
eventType: z.string().min(1).optional().describe("Narrow it to one kind of event."),
|
|
2778
|
-
mentioned: z.boolean().optional().describe("Only when the agent is actually addressed, rather than on everything said in earshot."),
|
|
2779
|
-
branch: z
|
|
2780
|
-
.string()
|
|
2781
|
-
.min(1)
|
|
2782
|
-
.optional()
|
|
2783
|
-
.describe("Narrow it to one branch, for the sources that have branches. Absent means every branch of the repositories it matches."),
|
|
2784
|
-
allowedOrigins: z.array(z.string()).optional().describe("Which websites may reach the chat widget. Absent or empty admits nobody."),
|
|
2785
|
-
}),
|
|
2786
|
-
z.object({
|
|
2787
|
-
kind: z.literal("workspace").describe("When something happens to the files or the repositories."),
|
|
2788
|
-
event: WorkspaceEventKindSchema.describe("Which happening."),
|
|
2789
|
-
repo: z.string().min(1).optional().describe("Narrow it to one repository. Absent means any of them."),
|
|
2790
|
-
}),
|
|
2791
|
-
]);
|
|
2792
|
-
export const WebchatConfigSchema = z.object({
|
|
2793
|
-
access: z
|
|
2794
|
-
.enum(["public", "google"])
|
|
2795
|
-
.optional()
|
|
2796
|
-
.describe("Who may write to it. Absent means anyone, which is the anonymous support box it looks like."),
|
|
2797
|
-
requireName: z
|
|
2798
|
-
.boolean()
|
|
2799
|
-
.optional()
|
|
2800
|
-
.describe("Ask a visitor for a name first. Cosmetic: the name is typed, so it reaches the model as something a stranger said, never as identity."),
|
|
2801
|
-
antiBot: z
|
|
2802
|
-
.enum(["turnstile", "pow"])
|
|
2803
|
-
.optional()
|
|
2804
|
-
.describe("How to keep bots out: a third-party check that needs the site's own keys, or a puzzle the sandbox sets and the widget solves, so a site with no such account still has something. Absent leaves the site allowlist and the rate limit as the whole boundary."),
|
|
2805
|
-
turnstileSiteKey: z.string().optional().describe("The public half of those keys, which ships to the visitor's browser."),
|
|
2806
|
-
turnstileSecret: z.string().optional().describe("The private half, which the sandbox keeps and the widget never sees."),
|
|
2807
|
-
googleClientId: z
|
|
2808
|
-
.string()
|
|
2809
|
-
.optional()
|
|
2810
|
-
.describe("The site's own sign-in client id. It cannot be ours: a sign-in is only issued to an approved origin, and no single client can list every customer's domain."),
|
|
2811
|
-
title: z.string().max(80).optional(),
|
|
2812
|
-
greeting: z.string().max(500).optional(),
|
|
2813
|
-
accent: z
|
|
2814
|
-
.string()
|
|
2815
|
-
.regex(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, "accent must be a hex colour, e.g. #e47100")
|
|
2816
|
-
.optional(),
|
|
2817
|
-
position: z.enum(["top-right", "top-left", "bottom-right", "bottom-left"]).optional(),
|
|
2818
|
-
dailyMessageMax: z.number().int().positive().optional(),
|
|
2819
|
-
conversationMessageMax: z.number().int().positive().optional(),
|
|
2820
|
-
sessionTtlMinutes: z.number().int().positive().optional(),
|
|
2821
|
-
});
|
|
2822
|
-
export const WEBCHAT_DAILY_MAX_DEFAULT = 200;
|
|
2823
|
-
export const WebchatPublicConfigSchema = z.object({
|
|
2824
|
-
automationId: z.string(),
|
|
2825
|
-
title: z.string(),
|
|
2826
|
-
greeting: z.string(),
|
|
2827
|
-
accent: z.string(),
|
|
2828
|
-
position: z.enum(["top-right", "top-left", "bottom-right", "bottom-left"]),
|
|
2829
|
-
access: z.enum(["public", "google"]),
|
|
2830
|
-
requireName: z.boolean(),
|
|
2831
|
-
antiBot: z.enum(["turnstile", "pow", "off"]),
|
|
2832
|
-
turnstileSiteKey: z.string().optional(),
|
|
2833
|
-
googleClientId: z.string().optional(),
|
|
2834
|
-
});
|
|
2835
|
-
export const WebchatChallengeSchema = z.object({ salt: z.string(), difficulty: z.number().int().positive() });
|
|
2836
|
-
export const WebchatMessageSchema = z.object({
|
|
2837
|
-
conversationId: z.string().min(1).max(200),
|
|
2838
|
-
content: z.string().min(1),
|
|
2839
|
-
displayName: z.string().max(200).optional(),
|
|
2840
|
-
idToken: z.string().optional(),
|
|
2841
|
-
turnstileToken: z.string().optional(),
|
|
2842
|
-
powNonce: z.string().optional(),
|
|
2843
|
-
history: z
|
|
2844
|
-
.array(z.object({ author: z.string().optional(), content: z.string() }))
|
|
2845
|
-
.max(50)
|
|
2846
|
-
.optional(),
|
|
2847
|
-
});
|
|
2848
|
-
export const AutomationSchema = z.object({
|
|
2849
|
-
id: entryId.describe("The automation's id."),
|
|
2850
|
-
trigger: TriggerSchema.describe("What sets it off: a schedule, an event in the workspace, a message arriving from outside, or a webhook."),
|
|
2851
|
-
guard: z
|
|
2852
|
-
.string()
|
|
2853
|
-
.min(1)
|
|
2854
|
-
.optional()
|
|
2855
|
-
.describe("A command run before the wake that decides whether there is anything to do. Skipped by the guard is often the most useful thing an automation can report."),
|
|
2856
|
-
prompt: z.string().min(1).describe("What the woken agent is told."),
|
|
2857
|
-
webchat: WebchatConfigSchema.optional().describe("Settings for the public chat widget, for an automation that answers visitors."),
|
|
2858
|
-
allowedTools: z
|
|
2859
|
-
.array(z.string().min(1))
|
|
2860
|
-
.optional()
|
|
2861
|
-
.describe("Narrow the woken turn to these tools. For one driven by an outside message this list is the real boundary, because prompt wording is only advice and an empty toolbox is not."),
|
|
2862
|
-
agent: AgentProviderSchema.optional().describe("Which provider serves the wake."),
|
|
2863
|
-
account: z.string().optional().describe("Which account pays for it."),
|
|
2864
|
-
actsAs: entryId.optional().describe("Which persona it speaks as. An unwatched turn naming none reaches no signed-in account at all."),
|
|
2865
|
-
harness: AgentHarnessSchema.optional().describe("Which agentic loop runs it."),
|
|
2866
|
-
model: z.string().optional().describe("Which model runs it."),
|
|
2867
|
-
requireApproval: z.boolean().optional().describe("Hold every fire for a person instead of running it. Only a person can release one of those."),
|
|
2868
|
-
holdForSeconds: z.number().optional().describe("Hold each fire this long before running it anyway, which is a delay rather than a decision."),
|
|
2869
|
-
chore: z
|
|
2870
|
-
.boolean()
|
|
2871
|
-
.optional()
|
|
2872
|
-
.describe("This automation is a maintenance job, which is what files it under chores rather than among ordinary automations."),
|
|
2873
|
-
enabled: z.boolean().describe("Whether it fires at all."),
|
|
2874
|
-
});
|
|
2875
|
-
export const AutomationApprovalSchema = z.object({
|
|
2876
|
-
id: entryId.describe("This waiting item's own id, which approving and rejecting take."),
|
|
2877
|
-
automationId: z.string().describe("Which automation it came from."),
|
|
2878
|
-
payload: z
|
|
2879
|
-
.string()
|
|
2880
|
-
.optional()
|
|
2881
|
-
.describe("What set it off, kept whole so an approved wake carries the same thing it would have had. Absent for one on a schedule, which carries nothing."),
|
|
2882
|
-
origin: AgentOriginSchema.optional().describe("Where the message came from, kept alongside the payload so an approved wake appears on the board exactly as an automatic one would have."),
|
|
2883
|
-
title: z.string().optional().describe("What the conversation would be called."),
|
|
2884
|
-
conversationId: z
|
|
2885
|
-
.string()
|
|
2886
|
-
.optional()
|
|
2887
|
-
.describe("The thread this belongs to, when it has one, so approving continues that conversation rather than opening a new one. Without it, one visitor's chat becomes a card per approved message and an agent that meets them again every turn."),
|
|
2888
|
-
sessionId: z.string().optional().describe("The provider session that thread last ran on."),
|
|
2889
|
-
createdAt: z.number().describe("When it started waiting, in milliseconds."),
|
|
2890
|
-
autoRunAt: z
|
|
2891
|
-
.number()
|
|
2892
|
-
.optional()
|
|
2893
|
-
.describe("When it goes ahead on its own, in milliseconds, for a hold that is only a delay. Absent for one that genuinely waits on a person."),
|
|
2894
|
-
});
|
|
2895
|
-
export const AgentsListSchema = z.object({
|
|
2896
|
-
agents: z.array(AgentSummarySchema).describe("The conversations."),
|
|
2897
|
-
rev: z
|
|
2898
|
-
.number()
|
|
2899
|
-
.describe("Which version of the fleet this is. The fleet is published as whole snapshots, so without a version a list read before a change but delivered after it would silently undo that change. Drop any list older than the newest you have already applied."),
|
|
2900
|
-
held: z
|
|
2901
|
-
.array(AutomationApprovalSchema)
|
|
2902
|
-
.default([])
|
|
2903
|
-
.describe("Automations waiting at the door for a yes, put alongside the running conversations so needs-you sits beside working rather than on a page nobody opens."),
|
|
2904
|
-
});
|
|
2905
|
-
export const AutomationApprovalsListSchema = z.object({ approvals: z.array(AutomationApprovalSchema).describe("Everything waiting for a yes.") });
|
|
2906
|
-
export const AutomationApprovalIdParamSchema = z.object({ id: z.string().describe("Which waiting item.") });
|
|
2907
|
-
export const AutomationRunSchema = z.object({
|
|
2908
|
-
at: z.number(),
|
|
2909
|
-
outcome: z.enum(["completed", "skipped", "error", "interrupted"]),
|
|
2910
|
-
detail: z.string().optional(),
|
|
2911
|
-
conversationId: z.string().optional(),
|
|
2912
|
-
});
|
|
2913
|
-
export const AutomationSummarySchema = AutomationSchema.extend({
|
|
2914
|
-
runs: z.array(AutomationRunSchema),
|
|
2915
|
-
nextRun: z.number().optional(),
|
|
2916
|
-
});
|
|
2917
|
-
export const AutomationsListSchema = z.object({ automations: z.array(AutomationSummarySchema) });
|
|
2918
|
-
export const AutomationIdParamSchema = z.object({ id: z.string() });
|
|
2919
|
-
export const AutomationEnabledInputSchema = z.object({ id: z.string(), enabled: z.boolean() });
|
|
2920
|
-
const TriggerFieldSchema = z.object({ label: z.string().min(1), placeholder: z.string().min(1), hint: z.string().min(1).optional() });
|
|
2921
|
-
export const TriggerSourceSchema = z.object({
|
|
2922
|
-
provider: z.string().min(1),
|
|
2923
|
-
label: z.string().min(1),
|
|
2924
|
-
logo: z.string().min(1).optional(),
|
|
2925
|
-
icon: z.string().min(1).optional(),
|
|
2926
|
-
events: z.array(z.object({ value: z.string().min(1), label: z.string().min(1) })),
|
|
2927
|
-
channel: TriggerFieldSchema,
|
|
2928
|
-
branchField: TriggerFieldSchema.optional(),
|
|
2929
|
-
mentionLabel: z.string().min(1).optional(),
|
|
2930
|
-
starterPrompt: z.string().min(1).optional(),
|
|
2931
|
-
requires: z.array(z.string().min(1)).default([]),
|
|
2932
|
-
enabled: z.boolean(),
|
|
2933
|
-
});
|
|
2934
|
-
export const TemplateOfferSchema = z.enum(["create", "configure"]);
|
|
2935
|
-
export const AutomationTemplateSchema = z.object({
|
|
2936
|
-
id: z.string().min(1),
|
|
2937
|
-
title: z.string().min(1),
|
|
2938
|
-
logo: z.string().min(1).optional(),
|
|
2939
|
-
icon: z.string().min(1).optional(),
|
|
2940
|
-
requires: z.array(z.string().min(1)).default([]),
|
|
2941
|
-
trigger: TriggerSchema,
|
|
2942
|
-
guard: z.string().min(1).optional(),
|
|
2943
|
-
holdForSeconds: z.number().int().positive().optional(),
|
|
2944
|
-
prompt: z.string().min(1),
|
|
2945
|
-
note: z.string().min(1).optional(),
|
|
2946
|
-
setup: z.string().min(1).optional(),
|
|
2947
|
-
description: z.string().min(1).optional(),
|
|
2948
|
-
offer: TemplateOfferSchema.optional(),
|
|
2949
|
-
chore: z.boolean().optional(),
|
|
2950
|
-
});
|
|
2951
|
-
export const AutomationCatalogSchema = z.object({
|
|
2952
|
-
sources: z.array(TriggerSourceSchema),
|
|
2953
|
-
templates: z.array(AutomationTemplateSchema),
|
|
2954
|
-
});
|
|
2955
|
-
const StepIdSchema = z
|
|
2956
|
-
.string()
|
|
2957
|
-
.min(1)
|
|
2958
|
-
.max(24)
|
|
2959
|
-
.regex(/^[a-z0-9][a-z0-9-]*$/);
|
|
2960
|
-
export const WorkflowHandoffSchema = z.enum(["fresh", "continue"]);
|
|
2961
|
-
const WORKFLOW_STEPS_MAX = 24;
|
|
2962
|
-
export const WorkflowStepSchema = z.object({
|
|
2963
|
-
id: StepIdSchema.describe("This step's own name, which other steps use to say they wait on it."),
|
|
2964
|
-
title: z.string().min(1).max(60).describe("What to call it on screen. Short: the instruction below is where the detail goes."),
|
|
2965
|
-
goal: z
|
|
2966
|
-
.string()
|
|
2967
|
-
.min(1)
|
|
2968
|
-
.optional()
|
|
2969
|
-
.describe("What done means for this step, in your words. It is what the step is judged against, and a different sentence from what it is told to do."),
|
|
2970
|
-
prompt: z
|
|
2971
|
-
.string()
|
|
2972
|
-
.min(1)
|
|
2973
|
-
.optional()
|
|
2974
|
-
.describe("What the step is told to do. The goal is the suite is green; this is run the tests, take the top failure, fix it. Leaving it out hands over the run's own request untouched, which is right for a step whose whole job is do what was asked."),
|
|
2975
|
-
needs: z
|
|
2976
|
-
.array(StepIdSchema)
|
|
2977
|
-
.describe("Which steps must finish first. Empty means it starts when the run does. Naming a step that does not exist, or a loop between steps, is refused when the workflow is saved."),
|
|
2978
|
-
handoff: WorkflowHandoffSchema.describe("How it meets what came before: a fresh conversation handed the previous step's result, or the same conversation carried on."),
|
|
2979
|
-
output: LoopOutputSchema.describe("What it has to produce for the step to count."),
|
|
2980
|
-
checks: z.array(LoopCheckSchema).describe("What has to pass before it counts as done."),
|
|
2981
|
-
context: LoopContextSchema.describe("How the step's own repeats meet each other. A long-running step wants to start clean each round; a short polish-this step wants to carry on."),
|
|
2982
|
-
maxSpendUsd: z
|
|
2983
|
-
.number()
|
|
2984
|
-
.positive()
|
|
2985
|
-
.optional()
|
|
2986
|
-
.describe("A ceiling on what this step may spend. The one resource that cannot be recovered after an unattended fan-out, which is why it is here and iteration limits are not. Absent is uncapped."),
|
|
2987
|
-
agent: AgentProviderSchema.optional().describe("Which provider runs it."),
|
|
2988
|
-
harness: AgentHarnessSchema.optional().describe("Which agentic loop runs it."),
|
|
2989
|
-
account: z.string().optional().describe("Which account pays for it."),
|
|
2990
|
-
model: z.string().optional().describe("Which model runs it."),
|
|
2991
|
-
actsAs: entryId
|
|
2992
|
-
.optional()
|
|
2993
|
-
.describe("Which persona it acts as. Unpinned, a step gets the strict unwatched default: every tool, and no signed-in accounts at all. Pinning one is how a release check gets a voice, a folder to work in, or the single account it may post from."),
|
|
2994
|
-
});
|
|
2995
|
-
export const WorkflowGateSchema = z.object({
|
|
2996
|
-
step: StepIdSchema.describe("Which step's answer carries the decision. Usually a last step that weighs up the ones before it, though nothing requires that."),
|
|
2997
|
-
field: z
|
|
2998
|
-
.string()
|
|
2999
|
-
.min(1)
|
|
3000
|
-
.describe("Which of that step's declared answers to read. A declared field is the one part of a step's answer that was checked rather than fished out of prose, which is the whole rule here. Checked when the workflow is saved."),
|
|
3001
|
-
pass: z
|
|
3002
|
-
.array(z.string().min(1))
|
|
3003
|
-
.min(1)
|
|
3004
|
-
.describe("Which values mean ship it. Everything else fails. A list of what passes rather than what fails, because a step answering mostly-pass or pass-with-notes must not ship, and this gets that right without anybody having had to enumerate the ways a model can hedge."),
|
|
3005
|
-
token: z
|
|
3006
|
-
.string()
|
|
3007
|
-
.optional()
|
|
3008
|
-
.describe("The credential the calling pipeline presents. It is the only one in the exchange, because a build runner has no identity of its own here."),
|
|
3009
|
-
dailyMax: z
|
|
3010
|
-
.number()
|
|
3011
|
-
.int()
|
|
3012
|
-
.positive()
|
|
3013
|
-
.optional()
|
|
3014
|
-
.describe("How many runs a day, across every caller. A gate is a paid door with nobody in the loop: one wired into a push-triggered pipeline is a fan-out of conversations per commit. Absent is a small default rather than unlimited."),
|
|
3015
|
-
});
|
|
3016
|
-
export const GATE_DAILY_MAX_DEFAULT = 20;
|
|
3017
|
-
export const GateOutcomeSchema = z.enum(["pass", "fail", "blocked"]);
|
|
3018
|
-
export const GateVerdictSchema = z.object({
|
|
3019
|
-
outcome: GateOutcomeSchema.describe("Ship it, do not, or we could not tell. That third answer exists because could not reach a judgement is not the product is broken: a gate that reported its own outages as failures is one a team switches off, so it should be the honest answer far more often than the convenient one, and it means a neutral build rather than a red one."),
|
|
3020
|
-
reason: z.string().describe("Why, in one line. Realistically the only part of this a build log will ever show."),
|
|
3021
|
-
runId: z.string().describe("The run behind the verdict, so somebody can go and read it."),
|
|
3022
|
-
value: z
|
|
3023
|
-
.string()
|
|
3024
|
-
.optional()
|
|
3025
|
-
.describe("What the step actually answered. Absent when there was nothing to read, which is most of the could-not-tell cases."),
|
|
3026
|
-
});
|
|
3027
|
-
export const WorkflowSchema = z.object({
|
|
3028
|
-
id: entryId.describe("The workflow's id."),
|
|
3029
|
-
name: z.string().min(1).max(80).describe("What to call it."),
|
|
3030
|
-
description: z.string().max(400).optional().describe("What it is for."),
|
|
3031
|
-
steps: z
|
|
3032
|
-
.array(WorkflowStepSchema)
|
|
3033
|
-
.min(1)
|
|
3034
|
-
.max(WORKFLOW_STEPS_MAX)
|
|
3035
|
-
.describe("The steps, each with what it waits on. Every one runs in its own private copy of the repos, always, because parallel steps sharing a tree collide."),
|
|
3036
|
-
gate: WorkflowGateSchema.optional().describe("Present means a machine can run this design and get a ship-it answer back. Absent means an ordinary workflow, started by a person, with no outside door onto it at all."),
|
|
3037
|
-
maxParallel: z
|
|
3038
|
-
.number()
|
|
3039
|
-
.int()
|
|
3040
|
-
.min(1)
|
|
3041
|
-
.max(8)
|
|
3042
|
-
.describe("How many steps may run at once. Bounded, because a fan-out of twelve is twelve model sessions, twelve working copies and twelve times the burn rate, on one machine."),
|
|
3043
|
-
});
|
|
3044
|
-
export const WorkflowStepStateSchema = z.enum(["pending", "running", "done", "failed", "skipped", "stopped"]);
|
|
3045
|
-
export const WorkflowStepRunSchema = z.object({
|
|
3046
|
-
stepId: StepIdSchema.describe("Which step this is."),
|
|
3047
|
-
state: WorkflowStepStateSchema.describe("How it went. Skipped carries what the others cannot: it never ran, because something it was waiting on did not finish. That is why a failed run shows one red step and a trail of grey ones."),
|
|
3048
|
-
conversationId: z
|
|
3049
|
-
.string()
|
|
3050
|
-
.describe("The conversation it ran on, and the way from a node on the graph to a real record. Shared with the step before it when they were chained, which is what makes those two one card."),
|
|
3051
|
-
startedAt: z.number().optional().describe("When it began, in milliseconds."),
|
|
3052
|
-
endedAt: z.number().optional().describe("When it ended, in milliseconds."),
|
|
3053
|
-
iterations: z.number().int().min(0).describe("How many rounds it took."),
|
|
3054
|
-
costUsd: z.number().optional().describe("What it cost, in dollars."),
|
|
3055
|
-
loopState: LoopStateSchema.optional().describe("How its repeating ended. Out of rounds and stuck both come out as a failed step, and the difference between them is the difference between give it more room and more room will not help."),
|
|
3056
|
-
detail: z.string().optional().describe("What went wrong, when something did."),
|
|
3057
|
-
document: LoopDocumentSchema.optional().describe("What it produced, once it has produced something that passes its own declared shape. This is what the steps after it are handed."),
|
|
3058
|
-
report: z
|
|
3059
|
-
.string()
|
|
3060
|
-
.optional()
|
|
3061
|
-
.describe("The start of its closing words. Bounded, so a long answer is not silently cut down to its last few thousand characters and the record stays a sensible size."),
|
|
3062
|
-
reportPath: z
|
|
3063
|
-
.string()
|
|
3064
|
-
.optional()
|
|
3065
|
-
.describe("Where the whole answer is, as a workspace path. Every step can read it, so a long handoff need not be copied into anybody's prompt."),
|
|
3066
|
-
});
|
|
3067
|
-
export const WorkflowRunStateSchema = z.enum(["running", "done", "failed", "stopped", "overspent", "error"]);
|
|
3068
|
-
export const WorkflowRunSchema = z.object({
|
|
3069
|
-
runId: z.string().min(1).describe("This run's id."),
|
|
3070
|
-
workflow: WorkflowSchema.describe("The design as it stood when the run started, copied rather than looked up. The run has to keep showing the graph it actually ran, not the one edited twice since, and a run of a deleted workflow has to stay readable."),
|
|
3071
|
-
repos: z
|
|
3072
|
-
.array(RepoBaseSchema)
|
|
3073
|
-
.min(1)
|
|
3074
|
-
.max(50)
|
|
3075
|
-
.describe("The workspace as this run began, one exact commit per repository. Every step branches from these, even if the shared tree moves while a wide fan-out is still opening its copies, so the steps can be compared with each other afterwards."),
|
|
3076
|
-
request: z
|
|
3077
|
-
.string()
|
|
3078
|
-
.optional()
|
|
3079
|
-
.describe("What this run was asked to do, handed to every step on top of its own instructions. It is what makes one saved design worth keeping: two models, one task is a shape, and the task is different every time. Absent for a run started with nowhere to type one."),
|
|
3080
|
-
state: WorkflowRunStateSchema.describe("How the run is going. Finished means every step that ran got there; a run with skipped steps counts as failed, because a graph that never reached its end did not do what it was asked whatever the survivors managed."),
|
|
3081
|
-
startedAt: z.number().describe("When it began, in milliseconds."),
|
|
3082
|
-
endedAt: z.number().optional().describe("When it ended, in milliseconds."),
|
|
3083
|
-
resumed: z.number().int().min(0).describe("How many times the sandbox restarted under it and picked it back up."),
|
|
3084
|
-
detail: z.string().optional().describe("What went wrong, when something did."),
|
|
3085
|
-
steps: z
|
|
3086
|
-
.array(WorkflowStepRunSchema)
|
|
3087
|
-
.describe("One entry per step, in the design's own order. Every one is written down as waiting when the run starts, so the picture is complete from the first frame and a missing step never has to mean two things."),
|
|
3088
|
-
archivedAt: z
|
|
3089
|
-
.number()
|
|
3090
|
-
.optional()
|
|
3091
|
-
.describe("When it was put away, in milliseconds. The record stays readable and every step's branch, transcript and counters are untouched. Its conversations are put away with it, and brought back with it. Absent means live on the board."),
|
|
3092
|
-
});
|
|
3093
|
-
export const WorkflowSummarySchema = WorkflowSchema.extend({ runs: z.array(WorkflowRunSchema).describe("Its runs, newest first.") });
|
|
3094
|
-
export const WorkflowsListSchema = z.object({ workflows: z.array(WorkflowSummarySchema).describe("Every saved design with its own run history.") });
|
|
3095
|
-
export const WorkflowRunsListSchema = z.object({
|
|
3096
|
-
runs: z.array(WorkflowRunSchema).describe("Every run across every workflow, newest first, including runs of workflows since deleted."),
|
|
3097
|
-
});
|
|
3098
|
-
export const WorkflowIdParamSchema = z.object({ id: z.string().describe("Which workflow.") });
|
|
3099
|
-
export const WorkflowRunIdParamSchema = z.object({ runId: z.string().describe("Which run.") });
|
|
3100
|
-
export const WorkflowRunStartSchema = WorkflowIdParamSchema.extend({
|
|
3101
|
-
request: z
|
|
3102
|
-
.string()
|
|
3103
|
-
.min(1)
|
|
3104
|
-
.max(20_000)
|
|
3105
|
-
.optional()
|
|
3106
|
-
.describe("What to point it at. Optional, because a design whose steps already say what they want is complete on its own; only one written as a shape needs today's sentence."),
|
|
3107
|
-
});
|
|
3108
|
-
export const WorkflowSaveSchema = z.object({
|
|
3109
|
-
workflow: WorkflowSchema.describe("The design to write."),
|
|
3110
|
-
create: z
|
|
3111
|
-
.boolean()
|
|
3112
|
-
.describe("Whether you mean to make a new one or replace an existing one. Said outright rather than inferred, so an id that happens to collide is a refusal instead of one saved design quietly overwriting another."),
|
|
3113
|
-
});
|
|
3114
|
-
export const CiHostSchema = z.enum(["github", "gitlab"]);
|
|
3115
|
-
export const PipelineStatusSchema = z.enum(["running", "success", "failed", "canceled", "skipped"]);
|
|
3116
|
-
export const PipelineRunSchema = z.object({
|
|
3117
|
-
repo: z.string().describe("Which workspace repository it belongs to."),
|
|
3118
|
-
host: CiHostSchema.describe("Which forge is running it."),
|
|
3119
|
-
project: z.string().describe("The project there, as that forge names it."),
|
|
3120
|
-
runId: z.number().describe("The forge's own id for the run, which is what re-running and cancelling take."),
|
|
3121
|
-
title: z
|
|
3122
|
-
.string()
|
|
3123
|
-
.optional()
|
|
3124
|
-
.describe("The run's headline, usually the commit subject or the pull request's title. Absent means falling back to the branch and commit."),
|
|
3125
|
-
authorName: z.string().optional().describe("Who the forge credits for setting it off."),
|
|
3126
|
-
authorAvatarUrl: z.string().optional().describe("Their picture, hosted by the forge. Absent means drawing their initials instead."),
|
|
3127
|
-
trigger: z
|
|
3128
|
-
.string()
|
|
3129
|
-
.optional()
|
|
3130
|
-
.describe("What set it off, in the forge's own word rather than flattened into a shared vocabulary, because the forge's word is the precise one."),
|
|
3131
|
-
branch: z.string().describe("Which branch."),
|
|
3132
|
-
sha: z.string().describe("Which commit."),
|
|
3133
|
-
status: PipelineStatusSchema.describe("How it is going. Running covers everything still moving, since the only distinction that matters is that against the three ways it can stop."),
|
|
3134
|
-
url: z.string().describe("Its page on the forge."),
|
|
3135
|
-
createdAt: z.number().describe("When it started, in milliseconds."),
|
|
3136
|
-
durationSeconds: z.number().optional().describe("How long it took."),
|
|
3137
|
-
failedJobs: z
|
|
3138
|
-
.array(z.string())
|
|
3139
|
-
.optional()
|
|
3140
|
-
.describe("What broke, by name. Fetched only for failed runs, so that a notification or a screen can say what went wrong rather than just that something did."),
|
|
3141
|
-
});
|
|
3142
|
-
export const PipelineJobSchema = z.object({
|
|
3143
|
-
name: z.string().describe("The job's name."),
|
|
3144
|
-
status: PipelineStatusSchema.describe("How it went."),
|
|
3145
|
-
stage: z.string().optional().describe("Which stage it belongs to, where the pipeline groups its jobs that way."),
|
|
3146
|
-
needs: z
|
|
3147
|
-
.array(z.string())
|
|
3148
|
-
.optional()
|
|
3149
|
-
.describe("Which jobs in this run it declared it waits on: the real shape of the pipeline. Absent means nothing could be read, which is different from an empty list, which is the claim that it waits on nothing."),
|
|
3150
|
-
startedAt: z.number().optional().describe("When it began, in milliseconds. Absent while it is queued."),
|
|
3151
|
-
finishedAt: z.number().optional().describe("When it ended, in milliseconds."),
|
|
3152
|
-
durationSeconds: z.number().optional().describe("How long it took."),
|
|
3153
|
-
webUrl: z.string().optional().describe("Its page on the forge, which is the shortest path from this step failed to the log that says why."),
|
|
3154
|
-
});
|
|
3155
|
-
export const CiJobsResponseSchema = z.object({
|
|
3156
|
-
jobs: z.array(PipelineJobSchema).describe("The steps inside one run. Fetched separately from the run list, so that list stays cheap."),
|
|
3157
|
-
});
|
|
3158
|
-
export const CiRepoSchema = z.object({
|
|
3159
|
-
repo: z.string().describe("Which workspace repository."),
|
|
3160
|
-
host: CiHostSchema.describe("Which forge it lives on."),
|
|
3161
|
-
project: z.string().describe("The project there."),
|
|
3162
|
-
url: z.string().describe("Its page on the forge."),
|
|
3163
|
-
hookWarning: z
|
|
3164
|
-
.string()
|
|
3165
|
-
.optional()
|
|
3166
|
-
.describe("Present when the sandbox could not register for instant notifications, with what happened and what to paste in by hand. Without them the sandbox polls instead, so this costs a couple of minutes' delay rather than the feature."),
|
|
3167
|
-
});
|
|
3168
|
-
export const CI_POLL_INTERVAL_MS = 2 * 60_000;
|
|
3169
|
-
export const CiRunsResponseSchema = z.object({
|
|
3170
|
-
repos: z.array(CiRepoSchema).describe("Which workspace repositories are wired to a forge, and how each one's notifications are set up."),
|
|
3171
|
-
runs: z.array(PipelineRunSchema).describe("Runs across all of them, newest first."),
|
|
3172
|
-
seenAt: z
|
|
3173
|
-
.number()
|
|
3174
|
-
.optional()
|
|
3175
|
-
.describe("When this was last looked at, in milliseconds, so a badge can tell new breakages from ones already read without a second call. Absent means never, so everything counts as new."),
|
|
3176
|
-
});
|
|
3177
|
-
export const CiSeenResponseSchema = z.object({
|
|
3178
|
-
seenAt: z.number().describe("The timestamp that was written, handed back so a caller can update without asking again."),
|
|
3179
|
-
});
|
|
3180
|
-
export const CiRunParamSchema = z.object({
|
|
3181
|
-
repo: z
|
|
3182
|
-
.string()
|
|
3183
|
-
.describe("Which workspace repository. The project behind it is resolved fresh each call, so a stale screen cannot act on one the workspace no longer maps to."),
|
|
3184
|
-
runId: z.number().describe("Which run, by the forge's own id."),
|
|
3185
|
-
});
|
|
3186
|
-
export const CiFixParamSchema = CiRunParamSchema.extend({
|
|
3187
|
-
pick: AgentRunPickSchema.describe("Which model to open the conversation on, when somebody chose one. Leave it out for the sandbox's own choice, which is the ordinary path."),
|
|
3188
|
-
});
|
|
3189
|
-
export const CiFixResponseSchema = z.object({
|
|
3190
|
-
conversationId: z.string().describe("The conversation that was opened, already holding the failure. Open it to watch, or attach to its turn."),
|
|
3191
|
-
});
|
|
3192
|
-
export const PrepushStatusSchema = z.enum(["idle", "running", "passed", "failed", "error", "cancelled"]);
|
|
3193
|
-
export const PrepushRunSchema = z.object({
|
|
3194
|
-
status: PrepushStatusSchema.describe("Where the run is. Failed and error are deliberately different: failed means the code is wrong, error means the command could not be run at all, and calling the second one a test failure would send an agent hunting a bug that is not there."),
|
|
3195
|
-
command: z
|
|
3196
|
-
.string()
|
|
3197
|
-
.describe("What actually ran, echoed here rather than read back from the settings, so a result looked at after the setting changed still says what produced it."),
|
|
3198
|
-
startedAt: z.number().optional().describe("When it began, in milliseconds."),
|
|
3199
|
-
finishedAt: z.number().optional().describe("When it ended, in milliseconds."),
|
|
3200
|
-
exitCode: z.number().optional().describe("How the command exited."),
|
|
3201
|
-
timedOut: z.boolean().optional().describe("It was killed for taking too long rather than finishing."),
|
|
3202
|
-
session: z
|
|
3203
|
-
.string()
|
|
3204
|
-
.optional()
|
|
3205
|
-
.describe("The terminal it runs in, which is where to watch it. Absent where the sandbox has no terminals, in which case there is nothing to attach to."),
|
|
3206
|
-
output: z
|
|
3207
|
-
.string()
|
|
3208
|
-
.describe("The end of what it printed, as plain text with the colour codes and redrawn progress lines resolved away. The end rather than the beginning, because a suite's verdict is at the end. Empty while it runs, and for one that was killed."),
|
|
3209
|
-
});
|
|
3210
|
-
export const DraftStatusSchema = z.enum(["proposed", "approved", "posting", "posted", "failed"]);
|
|
3211
|
-
export const DraftSchema = z.object({
|
|
3212
|
-
platform: z
|
|
3213
|
-
.string()
|
|
3214
|
-
.min(1)
|
|
3215
|
-
.describe("Where it should go. A plain name, so a new site needs no change here; an unknown one simply fails when it tries to post."),
|
|
3216
|
-
actsAs: entryId
|
|
3217
|
-
.optional()
|
|
3218
|
-
.describe("Whose name it goes out under. Needed for anywhere that requires being logged in, because an unwatched turn naming nobody is allowed no account at all. Never guessed: one site can be connected five times over, and picking for you means picking wrong in public with no undo."),
|
|
3219
|
-
content: z.string().min(1).describe("The post itself."),
|
|
3220
|
-
title: z.string().optional().describe("A title, where the site wants one."),
|
|
3221
|
-
target: z
|
|
3222
|
-
.string()
|
|
3223
|
-
.optional()
|
|
3224
|
-
.describe("Where on the site: a community, a channel. Or the address of the thing this replies to, in which case it is a reply, and on some sites the difference between a thread's address and one comment's is the difference between talking to the room and answering the person."),
|
|
3225
|
-
media: z.array(z.string()).optional().describe("Anything to attach, as workspace paths."),
|
|
3226
|
-
scheduledAt: z
|
|
3227
|
-
.number()
|
|
3228
|
-
.optional()
|
|
3229
|
-
.describe("When it should go out, in milliseconds. An agent may propose without one and you set it when approving; an approved draft with no time goes as soon as it is picked up."),
|
|
3230
|
-
status: DraftStatusSchema.default("proposed").describe("Where it is: proposed by the agent, approved by you, being sent, sent, or failed. Rejecting is deleting it; retrying is approving a failed one again."),
|
|
3231
|
-
createdAt: z.number().optional().describe("When it was written, in milliseconds."),
|
|
3232
|
-
postingAt: z
|
|
3233
|
-
.number()
|
|
3234
|
-
.optional()
|
|
3235
|
-
.describe("When sending started, in milliseconds. Needed to tell a send that is under way from one whose run died mid-flight, which the scheduled time cannot: a post due last week is not a post that has been sending since last week."),
|
|
3236
|
-
postedAt: z.number().optional().describe("When it went out, in milliseconds."),
|
|
3237
|
-
postedUrl: z
|
|
3238
|
-
.string()
|
|
3239
|
-
.optional()
|
|
3240
|
-
.describe("Where it landed, when the site hands back an address. The one thing a sent draft can offer that reading it cannot: the post itself, to go and look at."),
|
|
3241
|
-
error: z.string().optional().describe("Why it failed, written as a sentence for a person to read rather than as a code."),
|
|
3242
|
-
});
|
|
3243
|
-
export const DraftSummarySchema = DraftSchema.extend({ id: entryId.describe("The draft's id.") });
|
|
3244
|
-
export const DraftsListSchema = z.object({
|
|
3245
|
-
drafts: z.array(DraftSummarySchema).describe("The queue."),
|
|
3246
|
-
invalid: z
|
|
3247
|
-
.array(z.string())
|
|
3248
|
-
.describe("Drafts that could not be read at all. Listed rather than skipped, because an agent writes these files directly and a malformed one would otherwise never post and never say why."),
|
|
3249
|
-
});
|
|
3250
|
-
export const DraftIdParamSchema = z.object({ id: entryId.describe("Which draft.") });
|
|
3251
|
-
export const PanelSummarySchema = z.object({
|
|
3252
|
-
repo: z.string().describe("Which repository."),
|
|
3253
|
-
hasPanel: z.boolean().describe("Whether it has anything runnable at all."),
|
|
3254
|
-
running: z.boolean().describe("Whether the sandbox has it running."),
|
|
3255
|
-
healthy: z
|
|
3256
|
-
.boolean()
|
|
3257
|
-
.describe("Whether anything it owns is actually answering. A different question: a server still installing is running and not yet healthy, and one somebody started by hand is healthy without the sandbox running it."),
|
|
3258
|
-
port: z
|
|
3259
|
-
.number()
|
|
3260
|
-
.optional()
|
|
3261
|
-
.describe("The port the sandbox told it to use. What it actually bound is below, and for a repository that pins its own ports those are different numbers."),
|
|
3262
|
-
servers: z
|
|
3263
|
-
.array(z.object({
|
|
3264
|
-
port: z.number().describe("The port it is listening on, which is what forwarding it takes."),
|
|
3265
|
-
url: z.string().describe("Where it answers, with the right scheme: a server on its own certificate is served over https."),
|
|
3266
|
-
dir: z
|
|
3267
|
-
.string()
|
|
3268
|
-
.optional()
|
|
3269
|
-
.describe("Which part of the repository it belongs to, which for a repository whose dev command fans out is the only thing telling them apart."),
|
|
3270
|
-
session: z
|
|
3271
|
-
.string()
|
|
3272
|
-
.optional()
|
|
3273
|
-
.describe("The terminal it runs in: the sandbox's when it started it, yours when you did, and absent when nothing here owns it, which is the case worth designing for."),
|
|
3274
|
-
}))
|
|
3275
|
-
.describe("Every server this repository is really serving, found by looking at what is listening. Empty when nothing answers."),
|
|
3276
|
-
previewUrl: z
|
|
3277
|
-
.string()
|
|
3278
|
-
.optional()
|
|
3279
|
-
.describe("Where to open it from outside, present only while that address really serves it. Absent on a sandbox with no outside address."),
|
|
3280
|
-
role: z
|
|
3281
|
-
.enum(["intent", "desired-state", "app"])
|
|
3282
|
-
.optional()
|
|
3283
|
-
.describe("Which of the workspace's three fixed roles this repository fills. Absent for one that was simply cloned in."),
|
|
3284
|
-
deployConfig: z.boolean().describe("It declares infrastructure."),
|
|
3285
|
-
desiredState: z.boolean().describe("That declaration has been resolved at least once."),
|
|
3286
|
-
directoryUi: z.boolean().describe("It carries a small interface of its own."),
|
|
3287
|
-
monorepo: z.boolean().describe("It holds several packages."),
|
|
3288
|
-
vitest: z.boolean().describe("It has tests that can be run."),
|
|
3289
|
-
userStories: z
|
|
3290
|
-
.boolean()
|
|
3291
|
-
.describe("It carries stories an agent could test the running app against. The one fact here that says nothing about the language."),
|
|
3292
|
-
docs: z.boolean().describe("It carries generated architecture documentation."),
|
|
3293
|
-
});
|
|
3294
|
-
export const PanelsListSchema = z.object({
|
|
3295
|
-
panels: z
|
|
3296
|
-
.array(PanelSummarySchema)
|
|
3297
|
-
.describe("One entry per repository, worked out in a single pass so nothing has to walk the workspace file by file."),
|
|
3298
|
-
});
|
|
3299
|
-
export const PanelRepoParamSchema = z.object({ repo: z.string().describe("Which repository.") });
|
|
3300
|
-
export const PortSummarySchema = z.object({
|
|
3301
|
-
port: z.number().describe("The port number."),
|
|
3302
|
-
host: z
|
|
3303
|
-
.enum(["127.0.0.1", "::1"])
|
|
3304
|
-
.describe("Which loopback address it actually answers on. Some tools bind only one of the two, and anything dialling it has to know which."),
|
|
3305
|
-
forwardable: z
|
|
3306
|
-
.boolean()
|
|
3307
|
-
.describe("Whether it can be exposed at all. Some listeners answer only at their own address and nowhere else; those are listed for honesty and refused for forwarding."),
|
|
3308
|
-
kind: z
|
|
3309
|
-
.enum(["workspace", "system"])
|
|
3310
|
-
.describe("Whether somebody's own work put it there, or the sandbox's own machinery did. Only the first kind is worth previewing."),
|
|
3311
|
-
title: z
|
|
3312
|
-
.string()
|
|
3313
|
-
.describe("What a person would call it. Always present: a listener nothing can explain is still named, because the button beside it publishes the port to the internet."),
|
|
3314
|
-
purpose: z.string().describe("One sentence about what it is for, including when the honest answer is that nothing could work it out."),
|
|
3315
|
-
origin: z
|
|
3316
|
-
.enum(["terminal", "agent", "panel", "extension", "container", "sandbox", "unknown"])
|
|
3317
|
-
.describe("Who put it there, which is the question somebody is really asking: mine, my agent's, or the box's own."),
|
|
3318
|
-
pid: z.number().optional().describe("The process holding it. Absent when nothing could be matched to the socket."),
|
|
3319
|
-
command: z.string().optional().describe("The command behind it, as it was run. Absent only when nothing could be attributed at all."),
|
|
3320
|
-
cwd: z.string().optional().describe("Where it is running from, which is how a port gets attributed to a repository."),
|
|
3321
|
-
session: z
|
|
3322
|
-
.string()
|
|
3323
|
-
.optional()
|
|
3324
|
-
.describe('The terminal it came from, to watch it in or stop it from. Absent when nothing in its ancestry is one, which is the honest "you cannot reach this from here".'),
|
|
3325
|
-
forwarded: z.boolean().describe("Whether it is currently reachable from outside."),
|
|
3326
|
-
previewUrl: z.string().optional().describe("Where to open it. Present only while forwarded, and only on a sandbox that has an outside address."),
|
|
3327
|
-
});
|
|
3328
|
-
export const PortsListSchema = z.object({
|
|
3329
|
-
ports: z
|
|
3330
|
-
.array(PortSummarySchema)
|
|
3331
|
-
.describe("Everything listening inside the sandbox right now, read fresh each time rather than from a register the sandbox keeps."),
|
|
3332
|
-
});
|
|
3333
|
-
export const PortParamSchema = z.object({ port: z.number().int().min(1).max(65535).describe("Which port.") });
|
|
3334
|
-
export const PortForwardResultSchema = z.object({
|
|
3335
|
-
previewUrl: z
|
|
3336
|
-
.string()
|
|
3337
|
-
.optional()
|
|
3338
|
-
.describe("Where it can now be reached. Absent on a sandbox with no outside address, where the mapping exists but has no public name."),
|
|
3339
|
-
});
|
|
3340
|
-
export const MachineSandboxSchema = z.object({
|
|
3341
|
-
slug: z.string(),
|
|
3342
|
-
container: z.string(),
|
|
3343
|
-
name: z.string().optional(),
|
|
3344
|
-
running: z.boolean(),
|
|
3345
|
-
image: z.string(),
|
|
3346
|
-
tunnelRunning: z.boolean().optional(),
|
|
3347
|
-
});
|
|
3348
|
-
export const MachineSandboxOpSchema = z.enum([
|
|
3349
|
-
"start",
|
|
3350
|
-
"stop",
|
|
3351
|
-
"restart",
|
|
3352
|
-
"prepare",
|
|
3353
|
-
"update",
|
|
3354
|
-
"rebuild",
|
|
3355
|
-
"rollback",
|
|
3356
|
-
"remove",
|
|
3357
|
-
"logs",
|
|
3358
|
-
"runner-up",
|
|
3359
|
-
"runner-remove",
|
|
3360
|
-
]);
|
|
3361
|
-
export const MachineSandboxFlowSchema = z.object({
|
|
3362
|
-
op: MachineSandboxOpSchema,
|
|
3363
|
-
slug: z.string().min(1),
|
|
3364
|
-
hash: z.string().optional(),
|
|
3365
|
-
parentUrl: z.string().optional(),
|
|
3366
|
-
pair: z.string().optional().meta({ secret: true }),
|
|
3367
|
-
});
|
|
3368
|
-
export const MachineSandboxFlowInputSchema = MachineSandboxFlowSchema.extend({ id: z.string().min(1) });
|
|
3369
|
-
export const MachineFlowLineSchema = z.discriminatedUnion("kind", [
|
|
3370
|
-
z.object({ kind: z.literal("line"), text: z.string() }),
|
|
3371
|
-
z.object({ kind: z.literal("result"), message: z.string() }),
|
|
3372
|
-
z.object({ kind: z.literal("error"), message: z.string() }),
|
|
3373
|
-
]);
|
|
3374
|
-
export const MachinePairingSchema = z.object({
|
|
3375
|
-
sandboxId: z.string(),
|
|
3376
|
-
mode: z.enum(["sync", "mirror"]),
|
|
3377
|
-
localDir: z.string().optional(),
|
|
3378
|
-
mutagenStatus: z.string().optional(),
|
|
3379
|
-
conflicts: z.number().int().nonnegative().optional(),
|
|
3380
|
-
paused: z.boolean().optional(),
|
|
3381
|
-
backupStatus: z.string().optional(),
|
|
3382
|
-
});
|
|
3383
|
-
export const MachinePortStateSchema = z.enum([
|
|
3384
|
-
"mirrored",
|
|
3385
|
-
"held-by-sandbox",
|
|
3386
|
-
"busy",
|
|
3387
|
-
]);
|
|
3388
|
-
export const MachinePortSchema = z.object({
|
|
3389
|
-
port: z.number().int().min(1).max(65535),
|
|
3390
|
-
host: z.enum(["127.0.0.1", "::1"]),
|
|
3391
|
-
sandboxId: z.string(),
|
|
3392
|
-
state: MachinePortStateSchema,
|
|
3393
|
-
heldBy: z.string().optional(),
|
|
3394
|
-
command: z.string().optional(),
|
|
3395
|
-
});
|
|
3396
|
-
export const MachineWatcherSchema = z.object({
|
|
3397
|
-
running: z.boolean(),
|
|
3398
|
-
pid: z.number().int().optional(),
|
|
3399
|
-
lastTickAt: z.number().optional(),
|
|
3400
|
-
});
|
|
3401
|
-
export const WATCHER_STALL_AFTER_MS = 60_000;
|
|
3402
|
-
export const watcherStalled = (watcher, now) => watcher.running && watcher.lastTickAt !== undefined && now - watcher.lastTickAt > WATCHER_STALL_AFTER_MS;
|
|
3403
|
-
export const MachineReportSchema = z.object({
|
|
3404
|
-
hostname: z.string(),
|
|
3405
|
-
os: z.string(),
|
|
3406
|
-
agents: z.object({ sync: z.string().optional(), host: z.string().optional() }),
|
|
3407
|
-
sandboxes: z.array(MachineSandboxSchema),
|
|
3408
|
-
pairings: z.array(MachinePairingSchema),
|
|
3409
|
-
ports: z.array(MachinePortSchema),
|
|
3410
|
-
watcher: MachineWatcherSchema,
|
|
3411
|
-
capturedAt: z.number(),
|
|
3412
|
-
});
|
|
3413
|
-
export const ComputerGapSchema = z.enum([
|
|
3414
|
-
"offline",
|
|
3415
|
-
"scope-off",
|
|
3416
|
-
"no-agent",
|
|
3417
|
-
"unreported",
|
|
3418
|
-
]);
|
|
3419
|
-
export const ComputerSchema = z.object({
|
|
3420
|
-
key: z.string(),
|
|
3421
|
-
label: z.string(),
|
|
3422
|
-
syncEnrolled: z.boolean(),
|
|
3423
|
-
hostId: z.string().optional(),
|
|
3424
|
-
online: z.boolean().optional(),
|
|
3425
|
-
platform: z.string().optional(),
|
|
3426
|
-
facts: HostFactsSchema.optional(),
|
|
3427
|
-
hostAgent: z.string().optional(),
|
|
3428
|
-
lastSeen: z.number().optional(),
|
|
3429
|
-
report: MachineReportSchema.optional(),
|
|
3430
|
-
gap: ComputerGapSchema.optional(),
|
|
3431
|
-
});
|
|
3432
|
-
export const ComputersListSchema = z.object({ computers: z.array(ComputerSchema) });
|
|
3433
|
-
export const SyncStatusSchema = z.object({
|
|
3434
|
-
enrolled: z.boolean(),
|
|
3435
|
-
available: z.boolean().optional(),
|
|
3436
|
-
syncingFrom: z.string().optional(),
|
|
3437
|
-
syncSeenAt: z.number().optional(),
|
|
3438
|
-
mirroredBy: z.array(z.string()).optional(),
|
|
3439
|
-
machines: z.array(MachineReportSchema).optional(),
|
|
3440
|
-
});
|
|
3441
|
-
export const PublicFileSchema = z.object({
|
|
3442
|
-
path: z.string().describe("Where it sits inside the outbox."),
|
|
3443
|
-
size: z.number().describe("Size in bytes."),
|
|
3444
|
-
modifiedAt: z.number().describe("When it last changed, in milliseconds."),
|
|
3445
|
-
url: z.string().optional().describe("Its public address. Absent when this sandbox has no outside address, or when the file is being refused."),
|
|
3446
|
-
blocked: z
|
|
3447
|
-
.string()
|
|
3448
|
-
.optional()
|
|
3449
|
-
.describe("Why a file sitting in the outbox is not being served: a hidden name, a credential-shaped name, contents that look like a token, or sheer size. Only the publisher sees this; a stranger asking for the same file gets the same nothing every other miss gets."),
|
|
3450
|
-
});
|
|
3451
|
-
export const PublicListSchema = z.object({
|
|
3452
|
-
url: z.string().optional().describe("Your public address, which every file's own hangs off. Absent on a sandbox with nowhere to publish to."),
|
|
3453
|
-
files: z.array(PublicFileSchema).describe("What the outbox holds."),
|
|
3454
|
-
});
|
|
3455
|
-
export const PublishSchema = z.object({
|
|
3456
|
-
path: z
|
|
3457
|
-
.string()
|
|
3458
|
-
.min(1)
|
|
3459
|
-
.describe("What to publish, as a workspace path. It is copied rather than moved, so a repository does not lose its build output because somebody shared it."),
|
|
3460
|
-
});
|
|
3461
|
-
export const UnpublishSchema = z.object({
|
|
3462
|
-
path: z.string().min(1).describe("What to withdraw, as a path inside the outbox rather than a workspace path."),
|
|
3463
|
-
});
|
|
3464
|
-
export const PublishResultSchema = z.object({
|
|
3465
|
-
path: z.string().describe("Where it landed inside the outbox."),
|
|
3466
|
-
url: z.string().optional().describe("Its public address. Absent on a sandbox with nowhere to publish to."),
|
|
3467
|
-
});
|
|
3468
|
-
export const ShareDetailSchema = z.enum(["messages", "everything"]);
|
|
3469
|
-
export const SharedConversationSchema = z.object({
|
|
3470
|
-
id: z
|
|
3471
|
-
.string()
|
|
3472
|
-
.describe("The share's own id, minted fresh each time, so sharing one conversation twice gives two links. Deliberately not the conversation's id, which is memorable by design and would make a page's address guessable."),
|
|
3473
|
-
conversationId: z.string().describe("Which conversation it was taken from."),
|
|
3474
|
-
title: z.string().describe("The title on the page, which is the sharer's choice rather than the conversation's own."),
|
|
3475
|
-
detail: ShareDetailSchema.describe("How much travels: the two speakers' words alone, or the whole record including the agent's work and thinking, which necessarily publishes the code and command output in it."),
|
|
3476
|
-
sharedAt: z
|
|
3477
|
-
.number()
|
|
3478
|
-
.describe("When the snapshot was taken, in milliseconds. A share is frozen, so this dates what a recipient can see rather than when the conversation happened."),
|
|
3479
|
-
messages: z.number().describe("How many messages are behind the link."),
|
|
3480
|
-
url: z.string().optional().describe("The page's address. Absent on a sandbox with nowhere to publish to."),
|
|
3481
|
-
});
|
|
3482
|
-
export const ShareListSchema = z.object({ shares: z.array(SharedConversationSchema).describe("Every conversation currently published as a page.") });
|
|
3483
|
-
export const ShareCreateSchema = z.object({
|
|
3484
|
-
conversationId: z.string().min(1).describe("Which conversation to publish."),
|
|
3485
|
-
title: z.string().min(1).max(80).describe("The title for the page. The conversation's own name is only what a dialog would open with."),
|
|
3486
|
-
detail: ShareDetailSchema.describe("How much to publish. Two levels rather than a set of switches, because every extra toggle is another thing to get wrong about a link that cannot be recalled."),
|
|
3487
|
-
});
|
|
3488
|
-
export const ShareUpdateSchema = z.object({
|
|
3489
|
-
id: z.string().min(1).describe("Which share to re-take. Its link stays the same, which matters because it has already been sent."),
|
|
3490
|
-
});
|
|
3491
|
-
export const ShareRemoveSchema = z.object({ id: z.string().min(1).describe("Which share to take down.") });
|
|
3492
|
-
export const TerminalSessionSchema = z.object({
|
|
3493
|
-
name: z.string().describe("Its id, and what the close route takes."),
|
|
3494
|
-
label: z.string().optional().describe("What to call it on screen."),
|
|
3495
|
-
kind: z
|
|
3496
|
-
.enum(["shell", "panel", "agent", "job", "process"])
|
|
3497
|
-
.describe("What sort of thing it is: a terminal somebody opened, a repository's dev server, where an agent's commands run, a job the sandbox started, or a background process that is watched rather than typed into."),
|
|
3498
|
-
running: z
|
|
3499
|
-
.boolean()
|
|
3500
|
-
.describe("Whether it is alive. A finished one-shot job leaves a dead shell behind, which reads as false and is how it gets swept up."),
|
|
3501
|
-
activityAt: z.number().describe("When it last produced output, in milliseconds. Zero means it did not say, which is unknown rather than 1970."),
|
|
3502
|
-
exitCode: z.number().optional().describe("How the last thing in it ended. Absent while that pane is still alive."),
|
|
3503
|
-
command: z
|
|
3504
|
-
.string()
|
|
3505
|
-
.optional()
|
|
3506
|
-
.describe("What is running in it right now. Absent when it is sitting at a prompt. Not a second spelling of whether it is alive: this says whether anything is happening, which is what a close button should ask about before it ends something."),
|
|
3507
|
-
extensionId: z.string().optional().describe("Which extension declared this process, when one did."),
|
|
3508
|
-
processName: z
|
|
3509
|
-
.string()
|
|
3510
|
-
.optional()
|
|
3511
|
-
.describe("Which of that extension's processes it is, which together with the id above addresses its start and stop routes."),
|
|
3512
|
-
help: z
|
|
3513
|
-
.object({
|
|
3514
|
-
requestId: z.string().describe("What to send back when you answer, through the agent reply route."),
|
|
3515
|
-
message: z.string().describe("What the agent needs, in its own words."),
|
|
3516
|
-
requestedAt: z.number().describe("When it asked, in milliseconds."),
|
|
3517
|
-
})
|
|
3518
|
-
.optional()
|
|
3519
|
-
.describe("The agent has stopped at something only a person can clear, and is waiting at this terminal. Present only while it is waiting."),
|
|
3520
|
-
});
|
|
3521
|
-
export const TerminalsListSchema = z.object({
|
|
3522
|
-
sessions: z
|
|
3523
|
-
.array(TerminalSessionSchema)
|
|
3524
|
-
.describe("Every live surface the sandbox is holding, in one list, because the question they all answer is the same one."),
|
|
3525
|
-
});
|
|
3526
|
-
export const TerminalNameParamSchema = z.object({ name: z.string().describe("Which terminal.") });
|
|
3527
|
-
export const TerminalScrollbackQuerySchema = z.object({
|
|
3528
|
-
name: z.string().describe("Which terminal."),
|
|
3529
|
-
lines: z.coerce.number().min(1).max(100_000).default(20_000).describe("How far back to ask for. Clamped to the history that actually exists."),
|
|
3530
|
-
});
|
|
3531
|
-
export const TerminalScrollbackSchema = z.object({
|
|
3532
|
-
name: z.string().describe("Which terminal this is from."),
|
|
3533
|
-
text: z.string().describe("The history, oldest line first, with wrapped lines rejoined so a copied address or path comes back whole."),
|
|
3534
|
-
lines: z.number().describe("How many lines you got."),
|
|
3535
|
-
truncated: z.boolean().describe("It stopped because you asked for that many, not because the history ran out."),
|
|
3536
|
-
});
|
|
3537
|
-
export const BrowserPageSchema = z.object({
|
|
3538
|
-
id: z
|
|
3539
|
-
.string()
|
|
3540
|
-
.describe("Stable for the life of the page, which is what lets a tab survive a refresh of this list. Its address changes as the agent navigates and its position changes when a sibling closes."),
|
|
3541
|
-
title: z.string().optional().describe("The page's title. Absent mid-navigation, which is exactly when a tab still has to be drawn."),
|
|
3542
|
-
url: z.string().describe("Where it is."),
|
|
3543
|
-
active: z.boolean().describe("The one the agent last touched, or for a finished session, the one it ended on. Exactly one page has this."),
|
|
3544
|
-
});
|
|
3545
|
-
export const BrowserSessionSchema = z.object({
|
|
3546
|
-
name: z.string().describe("Its id, and what the close route takes."),
|
|
3547
|
-
label: z.string().describe("What to call it on screen: the open page's title, or its site, or which browser this is."),
|
|
3548
|
-
server: z
|
|
3549
|
-
.string()
|
|
3550
|
-
.describe("Which browser drives it: the credential-free one, or a signed-in account's. The difference between a throwaway page and one logged in as you, which is worth saying out loud."),
|
|
3551
|
-
running: z
|
|
3552
|
-
.boolean()
|
|
3553
|
-
.describe("Whether it is still open. A closed one is listed for a while with the pages it had, as the record of where the agent went."),
|
|
3554
|
-
activityAt: z.number().describe("When it last did anything, in milliseconds."),
|
|
3555
|
-
finishedAt: z.number().optional().describe("When it closed, in milliseconds. Absent while it is open."),
|
|
3556
|
-
help: z
|
|
3557
|
-
.object({
|
|
3558
|
-
requestId: z.string().describe("What to send back when you answer, through the agent reply route."),
|
|
3559
|
-
message: z.string().describe("What the agent needs, in its own words."),
|
|
3560
|
-
requestedAt: z.number().describe("When it asked, in milliseconds."),
|
|
3561
|
-
})
|
|
3562
|
-
.optional()
|
|
3563
|
-
.describe("The agent has hit something only a person can clear: a captcha, a password it does not hold, a check on your phone. Present only while it is waiting."),
|
|
3564
|
-
pages: z
|
|
3565
|
-
.array(BrowserPageSchema)
|
|
3566
|
-
.describe("Every page it has open. A browser holds several at once, which is the reason it is listed apart from the terminals."),
|
|
3567
|
-
});
|
|
3568
|
-
export const BrowsersListSchema = z.object({
|
|
3569
|
-
sessions: z.array(BrowserSessionSchema).describe("Every browser the agents have running, open or recently closed."),
|
|
3570
|
-
});
|
|
3571
|
-
export const BrowserNameParamSchema = z.object({ name: z.string().describe("Which browser.") });
|
|
3572
|
-
export const SubagentKindSchema = z.enum(["subagent", "spawned"]);
|
|
3573
|
-
export const SubagentStatusSchema = z.enum(["pending", "running", "blocked", "completed", "failed", "killed", "paused"]);
|
|
3574
|
-
export const SubagentSessionSchema = z.object({
|
|
3575
|
-
id: z
|
|
3576
|
-
.string()
|
|
3577
|
-
.describe("The id of the tool call that started it (an SDK child) or the child's own conversation id (a spawned one); either way both sides already hold it, so a card links to its helper with the id it has and the helper points back the same way."),
|
|
3578
|
-
kind: SubagentKindSchema.describe("What sort of helper: one the runtime's own Task tool spawned in-process, or a full agent the daemon started for the turn. It changes only how you watch it."),
|
|
3579
|
-
conversationId: z.string().describe("The conversation whose turn started it, and the way back to the chat it belongs to."),
|
|
3580
|
-
agentType: z.string().optional().describe("What kind of helper it is."),
|
|
3581
|
-
description: z.string().optional().describe("What it was asked to do, in one line."),
|
|
3582
|
-
model: z.string().optional().describe("Which model it runs on."),
|
|
3583
|
-
provider: z.string().optional().describe("Which provider serves it, for a helper spawned across providers."),
|
|
3584
|
-
spawnDepth: z
|
|
3585
|
-
.number()
|
|
3586
|
-
.optional()
|
|
3587
|
-
.describe("How deep in the chain it sits, where one means the turn itself started it. A helper can start helpers, and a flat list that could not say so would read as though the turn started all of them."),
|
|
3588
|
-
background: z
|
|
3589
|
-
.boolean()
|
|
3590
|
-
.optional()
|
|
3591
|
-
.describe("The parent carried on working instead of waiting for it. This is the whole reason the list exists: such a helper used to be invisible until its result landed, sometimes minutes later."),
|
|
3592
|
-
status: SubagentStatusSchema.describe("How it is going. Blocked means it needs an answer, which a parent and an operator act on differently from it simply working."),
|
|
3593
|
-
startedAt: z.number().describe("When it started, in milliseconds."),
|
|
3594
|
-
endedAt: z.number().optional().describe("When it finished, in milliseconds. Absent while it works."),
|
|
3595
|
-
activityAt: z.number().describe("When it last did anything, in milliseconds."),
|
|
3596
|
-
tokens: z
|
|
3597
|
-
.number()
|
|
3598
|
-
.optional()
|
|
3599
|
-
.describe("What it has spent. Its own, so a parent's cost and the sum of its helpers' are two different true numbers."),
|
|
3600
|
-
toolUses: z.number().optional().describe("How many tools it has used."),
|
|
3601
|
-
lastTool: z.string().optional().describe("The last one it reached for."),
|
|
3602
|
-
summary: z
|
|
3603
|
-
.string()
|
|
3604
|
-
.optional()
|
|
3605
|
-
.describe("Its report: what it concluded, without opening its record. The question a finished helper gets read for."),
|
|
3606
|
-
error: z.string().optional().describe("Why it failed, when it did."),
|
|
3607
|
-
});
|
|
3608
|
-
export const SubagentsListSchema = z.object({
|
|
3609
|
-
sessions: z.array(SubagentSessionSchema).describe("Every helper this sandbox's conversations have started."),
|
|
3610
|
-
});
|
|
3611
|
-
export const SubagentIdParamSchema = z.object({ id: z.string() });
|
|
3612
|
-
const environmentFileSchema = z.object({ content: z.string(), hash: z.string() });
|
|
3613
|
-
export const EnvironmentDriftSchema = z.object({
|
|
3614
|
-
bornAt: z.number(),
|
|
3615
|
-
at: z.number(),
|
|
3616
|
-
apt: z.array(z.string()),
|
|
3617
|
-
paths: z.array(z.string()),
|
|
3618
|
-
});
|
|
3619
|
-
export const RuntimeInstallKindSchema = z.enum(["apt", "pip", "cargo", "npm", "rustup-target", "playwright", "gem", "pipx", "go", "other"]);
|
|
3620
|
-
export const RuntimeInstallSchema = z.object({
|
|
3621
|
-
tool: z.string(),
|
|
3622
|
-
kind: RuntimeInstallKindSchema,
|
|
3623
|
-
sessions: z.array(z.string()),
|
|
3624
|
-
commands: z.array(z.string()),
|
|
3625
|
-
firstAt: z.number(),
|
|
3626
|
-
lastAt: z.number(),
|
|
3627
|
-
count: z.number(),
|
|
3628
|
-
declinedAt: z.number().optional(),
|
|
3629
|
-
});
|
|
3630
|
-
export const RuntimeInstallsFileSchema = z.object({
|
|
3631
|
-
installs: z.array(RuntimeInstallSchema),
|
|
3632
|
-
drift: EnvironmentDriftSchema.optional(),
|
|
3633
|
-
});
|
|
3634
|
-
export const EnvironmentRecurringSchema = z.object({
|
|
3635
|
-
tool: z.string(),
|
|
3636
|
-
kind: RuntimeInstallKindSchema,
|
|
3637
|
-
sessions: z.number(),
|
|
3638
|
-
lastAt: z.number(),
|
|
3639
|
-
live: z.boolean(),
|
|
3640
|
-
drafted: z.boolean().optional(),
|
|
3641
|
-
declined: z.boolean().optional(),
|
|
3642
|
-
});
|
|
3643
|
-
export const EnvironmentSchema = z.object({
|
|
3644
|
-
proposal: environmentFileSchema.optional(),
|
|
3645
|
-
custom: environmentFileSchema.optional(),
|
|
3646
|
-
approved: environmentFileSchema.optional(),
|
|
3647
|
-
appliedHash: z.string().optional(),
|
|
3648
|
-
container: z.string().optional(),
|
|
3649
|
-
drift: EnvironmentDriftSchema.optional(),
|
|
3650
|
-
recurring: z.array(EnvironmentRecurringSchema).optional(),
|
|
3651
|
-
});
|
|
3652
|
-
export const EnvironmentApproveSchema = z.object({ hash: z.string().min(1) });
|
|
3653
|
-
const environmentToolSchema = z.object({
|
|
3654
|
-
name: z.string(),
|
|
3655
|
-
version: z.string().optional(),
|
|
3656
|
-
});
|
|
3657
|
-
export const EnvironmentItemSchema = z.object({
|
|
3658
|
-
id: z.string(),
|
|
3659
|
-
name: z.string(),
|
|
3660
|
-
origin: z.enum(["custom", "capability", "base"]),
|
|
3661
|
-
originLabel: z.string().optional(),
|
|
3662
|
-
state: z.enum(["active", "after-rebuild", "awaiting-approval"]),
|
|
3663
|
-
tools: z.array(environmentToolSchema),
|
|
3664
|
-
extras: z.number().optional(),
|
|
3665
|
-
purpose: z.string().optional(),
|
|
3666
|
-
detail: z.string().optional(),
|
|
3667
|
-
commands: z.string().optional(),
|
|
3668
|
-
});
|
|
3669
|
-
export const EnvironmentContentsSchema = z.object({ items: z.array(EnvironmentItemSchema) });
|
|
3670
|
-
export const ImportReportSchema = z.object({
|
|
3671
|
-
restored: z.object({ workspaceFiles: z.number(), historyFiles: z.number(), repos: z.array(z.string()), bytes: z.number() }),
|
|
3672
|
-
refused: z.array(z.string()),
|
|
3673
|
-
needsAction: z.array(z.object({ subject: z.string(), detail: z.string() })),
|
|
3674
|
-
});
|
|
3675
|
-
export const MigrationSourceSchema = z.enum(["hermes", "openclaw"]);
|
|
3676
|
-
export const MigrationTargetSchema = z.enum(["memory", "skill", "automation", "capability", "secret", "file"]);
|
|
3677
|
-
export const MigrationItemSchema = z.object({
|
|
3678
|
-
id: z.string(),
|
|
3679
|
-
target: MigrationTargetSchema,
|
|
3680
|
-
label: z.string(),
|
|
3681
|
-
detail: z.string().optional(),
|
|
3682
|
-
recommended: z.boolean(),
|
|
3683
|
-
secrets: z.array(z.string()),
|
|
3684
|
-
});
|
|
3685
|
-
export const MigrationNeedsActionSchema = z.object({ subject: z.string(), detail: z.string() });
|
|
3686
|
-
export const MigrationPlanSchema = z.object({
|
|
3687
|
-
source: MigrationSourceSchema,
|
|
3688
|
-
token: z.string(),
|
|
3689
|
-
items: z.array(MigrationItemSchema),
|
|
3690
|
-
refused: z.array(z.string()),
|
|
3691
|
-
needsAction: z.array(MigrationNeedsActionSchema),
|
|
3692
|
-
});
|
|
3693
|
-
export const MigrationHostSchema = z.object({
|
|
3694
|
-
id: z.string(),
|
|
3695
|
-
online: z.boolean(),
|
|
3696
|
-
found: MigrationSourceSchema.optional(),
|
|
3697
|
-
detail: z.string().optional(),
|
|
3698
|
-
});
|
|
3699
|
-
export const MigrationHostsSchema = z.object({ hosts: z.array(MigrationHostSchema) });
|
|
3700
|
-
export const MigrationScanSchema = z.object({ host: z.string().min(1) });
|
|
3701
|
-
export const MigrationApplySchema = z.object({
|
|
3702
|
-
token: z.string(),
|
|
3703
|
-
items: z.array(z.string()),
|
|
3704
|
-
includeSecrets: z.boolean(),
|
|
3705
|
-
});
|
|
3706
|
-
export const MigrationReportSchema = z.object({
|
|
3707
|
-
applied: z.array(z.object({ id: z.string(), target: MigrationTargetSchema, label: z.string() })),
|
|
3708
|
-
failed: z.array(z.object({ id: z.string(), label: z.string(), error: z.string() })),
|
|
3709
|
-
refused: z.array(z.string()),
|
|
3710
|
-
needsAction: z.array(MigrationNeedsActionSchema),
|
|
3711
|
-
});
|
|
3712
|
-
export const BundleExportSchema = z.object({
|
|
3713
|
-
name: z.string(),
|
|
3714
|
-
status: z.enum(["packing", "ready", "failed"]),
|
|
3715
|
-
bytes: z.number(),
|
|
3716
|
-
createdAt: z.number(),
|
|
3717
|
-
secrets: z.boolean(),
|
|
3718
|
-
error: z.string().optional(),
|
|
3719
|
-
});
|
|
3720
|
-
export const BundleExportsSchema = z.object({ exports: z.array(BundleExportSchema) });
|
|
3721
|
-
export const SecretSetSchema = z.object({
|
|
3722
|
-
key: z
|
|
3723
|
-
.string()
|
|
3724
|
-
.regex(/^[A-Za-z_][A-Za-z0-9_]*$/)
|
|
3725
|
-
.max(128)
|
|
3726
|
-
.describe("The name to store it under, which is the name a process will find it by."),
|
|
3727
|
-
value: z.string().min(1).describe("The value. It goes straight to your sandbox and never through the platform."),
|
|
3728
|
-
});
|
|
3729
|
-
export const SecretKeysSchema = z.object({
|
|
3730
|
-
keys: z.array(z.string()).describe("The names that exist here. Only the names: the values never leave the sandbox."),
|
|
3731
|
-
});
|
|
3732
|
-
export const SecretKeyParamSchema = z.object({ key: z.string().describe("Which secret, by name.") });
|
|
3733
|
-
export const SecretRevealSchema = z.object({ value: z.string().describe("The value itself. The only place in this API one is ever returned.") });
|
|
3734
|
-
export const SecretInventoryEntrySchema = z.object({
|
|
3735
|
-
key: z.string().describe("What identifies it. Unique across the whole inventory, so several accounts of one provider each get their own entry."),
|
|
3736
|
-
kind: z
|
|
3737
|
-
.enum(["env", "generated", "capability", "provider"])
|
|
3738
|
-
.describe("Where it came from: you set it, the sandbox generated it, a connection needs it, or it is a model account's credential."),
|
|
3739
|
-
label: z.string().optional().describe("A friendlier name, for entries that have one."),
|
|
3740
|
-
status: z.enum(["missing", "set", "connected"]).describe("Whether it exists and, for a connection, whether it is working."),
|
|
3741
|
-
requiredBy: z
|
|
3742
|
-
.array(z.object({ resourceId: z.string().describe("Which resource."), type: z.string().describe("What kind of resource it is.") }))
|
|
3743
|
-
.describe("What is waiting on it. Empty for a connection's or an account's own credential."),
|
|
3744
|
-
storedAt: z.string().describe("Where it actually lives, in words."),
|
|
3745
|
-
revealable: z.boolean().describe("Whether its value can be shown at all. Everything except a model account's credential can be."),
|
|
3746
|
-
ci: z
|
|
3747
|
-
.object({
|
|
3748
|
-
synced: z.boolean().describe("Whether the pipeline has it."),
|
|
3749
|
-
pushedAt: z.string().optional().describe("When it was last sent there."),
|
|
3750
|
-
})
|
|
3751
|
-
.optional()
|
|
3752
|
-
.describe("Whether a copy has been given to the build pipeline."),
|
|
3753
|
-
lastUse: z
|
|
3754
|
-
.object({
|
|
3755
|
-
at: z.number().describe("When, in milliseconds."),
|
|
3756
|
-
lane: z.enum(["shell", "code", "browser"]).describe("How it was used: a command, a script, or typed into a page."),
|
|
3757
|
-
detail: z
|
|
3758
|
-
.string()
|
|
3759
|
-
.optional()
|
|
3760
|
-
.describe("Where it went: the start of the command or script, or the site. Names and destinations only, never values."),
|
|
3761
|
-
})
|
|
3762
|
-
.optional()
|
|
3763
|
-
.describe("The last time an agent actually spent this secret. Absent while it never has been, which most never are."),
|
|
3764
|
-
});
|
|
3765
|
-
export const SecretInventorySchema = z.object({
|
|
3766
|
-
entries: z
|
|
3767
|
-
.array(SecretInventoryEntrySchema)
|
|
3768
|
-
.describe("One entry per secret this sandbox knows about, from every place they live. No values, ever."),
|
|
3769
|
-
});
|
|
3770
|
-
export const AdapterHealthSchema = z.object({
|
|
3771
|
-
state: z
|
|
3772
|
-
.enum(["ready", "unavailable", "unknown"])
|
|
3773
|
-
.describe("Whether this runtime can serve a turn. Unknown is a real answer rather than a soft no: a check that could not run must not grey out a provider you can in fact use."),
|
|
3774
|
-
detail: z.string().optional().describe("Why it cannot, and what to do about it. Absent when it can."),
|
|
3775
|
-
checkedAt: z.number().describe("When it was last checked, in milliseconds."),
|
|
3776
|
-
});
|
|
3777
|
-
export const StagedUpdateSchema = z.object({
|
|
3778
|
-
version: z.string().optional().describe("What the downloaded build says it is. Absent means ready but unnamed, never that nothing is ready."),
|
|
3779
|
-
channel: z
|
|
3780
|
-
.string()
|
|
3781
|
-
.describe("Which channel it was taken from. Not necessarily the one this sandbox follows: downloading a beta build is not the same as moving onto beta."),
|
|
3782
|
-
at: z.number().describe("When the download finished, in milliseconds, which answers whether this is still the update being offered."),
|
|
3783
|
-
});
|
|
3784
|
-
export const InfoSchema = z.object({
|
|
3785
|
-
name: z.string().optional().describe("What this sandbox is called."),
|
|
3786
|
-
image: z.string().optional().describe("The image it is running."),
|
|
3787
|
-
version: z.string().optional().describe("The version of that image."),
|
|
3788
|
-
latest: z.string().optional().describe("The newest published version on its channel."),
|
|
3789
|
-
updateAvailable: z.boolean().optional().describe("Whether those two differ."),
|
|
3790
|
-
runtimes: z
|
|
3791
|
-
.record(z.string(), AdapterHealthSchema)
|
|
3792
|
-
.optional()
|
|
3793
|
-
.describe("Which agent runtimes can serve a turn right now, keyed by runtime. Absent until the first check has run, which reads the same as every entry being unknown."),
|
|
3794
|
-
channel: z.string().optional().describe("Which release channel this sandbox follows."),
|
|
3795
|
-
previousImage: z
|
|
3796
|
-
.string()
|
|
3797
|
-
.optional()
|
|
3798
|
-
.describe("The image the last update replaced, which is what a rollback would return to. Absent means there is nothing to go back to."),
|
|
3799
|
-
updateNotes: z
|
|
3800
|
-
.array(z.string())
|
|
3801
|
-
.optional()
|
|
3802
|
-
.describe("What is in the update, in the words of the people it is for, newest first. Absent or empty whenever there is nothing worth saying, which reads on screen exactly as it did before there were notes at all."),
|
|
3803
|
-
moreUpdateNotes: z
|
|
3804
|
-
.number()
|
|
3805
|
-
.optional()
|
|
3806
|
-
.describe("How many further notes there are beyond the ones sent, for a sandbox left alone a long time. Absent or zero means you have all of them."),
|
|
3807
|
-
breakingNotes: z
|
|
3808
|
-
.array(z.string())
|
|
3809
|
-
.optional()
|
|
3810
|
-
.describe("What the update takes away, uncapped, because a warning that fell off a shortened list is a breaking update taken unwarned. Absent for the overwhelming majority, which break nothing."),
|
|
3811
|
-
staged: StagedUpdateSchema.optional().describe("An update already downloaded and built on the machine running this container, waiting only for the restart that applies it. That restart is seconds, where an unprepared update is minutes, which is a different decision entirely. Absent when nothing is waiting."),
|
|
3812
|
-
});
|
|
3813
|
-
export const ManifestProblemSchema = z.object({
|
|
3814
|
-
kind: z
|
|
3815
|
-
.enum(["unreadable", "unknownKey", "invalidEntry"])
|
|
3816
|
-
.describe("What to do about it. Unreadable means the whole file is being ignored and everything in it is at its default. An unknown key means only that key is ignored. An invalid entry means one item of a list was skipped and the rest is fine."),
|
|
3817
|
-
detail: z.string().describe("What exactly was wrong."),
|
|
3818
|
-
suggestion: z.string().optional().describe("The name it was probably meant to be, when one is close enough to guess honestly."),
|
|
3819
|
-
});
|
|
3820
|
-
export const ManifestProblemReportSchema = z.object({
|
|
3821
|
-
path: z.string().describe("The file, as a workspace path. The file is the unit somebody fixes, which is why problems are grouped by it."),
|
|
3822
|
-
problems: z
|
|
3823
|
-
.array(ManifestProblemSchema)
|
|
3824
|
-
.describe("Everything currently wrong with it. A file with nothing wrong is absent rather than present and empty."),
|
|
3825
|
-
});
|
|
3826
|
-
export const ManifestProblemsSchema = z.array(ManifestProblemReportSchema);
|
|
3827
|
-
export const DaemonSessionSchema = z.object({
|
|
3828
|
-
token: z.string().describe("The credential every other call carries. Present it as a bearer token."),
|
|
3829
|
-
expiresAt: z.number().describe("When it stops working, in milliseconds, so a caller can renew ahead of it without reading the token."),
|
|
3830
|
-
email: z.string().describe("Who the sandbox verified you as."),
|
|
3831
|
-
});
|
|
3832
|
-
export const ActivityEventSchema = z.object({
|
|
3833
|
-
id: z.string().describe("The entry's own id."),
|
|
3834
|
-
at: z.number().describe("When it happened, in milliseconds. Also what you page by."),
|
|
3835
|
-
provider: z.string().optional().describe("Which outside service, when one was involved. Absent for the sandbox's own events."),
|
|
3836
|
-
account: z
|
|
3837
|
-
.string()
|
|
3838
|
-
.optional()
|
|
3839
|
-
.describe("Which account handled it. Absent for the sandbox's own events and for work run on a provider's default."),
|
|
3840
|
-
direction: z.enum(["in", "out", "system"]).describe("Whether something arrived, something went out, or the sandbox did it to itself."),
|
|
3841
|
-
type: z
|
|
3842
|
-
.string()
|
|
3843
|
-
.describe("Exactly what happened: a message received or sent, a reaction, a turn starting or ending, a rule doing something. A rule that ran and passed says nothing here, because a feed of green ticks is one the eye learns to skip."),
|
|
3844
|
-
channelId: z.string().optional().describe("Which channel or thread it happened in."),
|
|
3845
|
-
author: z.string().optional().describe("Who sent it, for something that arrived."),
|
|
3846
|
-
content: z.string().optional().describe("The message, in full, whichever direction it went."),
|
|
3847
|
-
method: z.string().optional().describe("The verb of an outgoing call."),
|
|
3848
|
-
endpoint: z.string().optional().describe("The address of an outgoing call. Credentials travel in headers, so they are never here."),
|
|
3849
|
-
sessionId: z.string().optional().describe("The provider session behind it."),
|
|
3850
|
-
turnId: z
|
|
3851
|
-
.string()
|
|
3852
|
-
.optional()
|
|
3853
|
-
.describe("Ties one turn's entries together. A turn writes several, and read as separate rows they say one thing several times, so a feed groups on this."),
|
|
3854
|
-
conversationId: z
|
|
3855
|
-
.string()
|
|
3856
|
-
.optional()
|
|
3857
|
-
.describe("Which conversation. This, rather than the provider session, is what the same agent means across a feed, because a session is retired whenever the model changes."),
|
|
3858
|
-
title: z
|
|
3859
|
-
.string()
|
|
3860
|
-
.optional()
|
|
3861
|
-
.describe("What that conversation was called at the time. Copied in rather than looked up, because an audit entry must still read as words years later, after the conversation has been renamed or pruned."),
|
|
3862
|
-
origin: AgentOriginSchema.optional().describe("What woke the conversation from outside, when something did. It is how a turn gets filed under the chat service that caused it rather than under the model that served it."),
|
|
3863
|
-
automationIds: z.array(z.string()).optional().describe("Which automations were involved."),
|
|
3864
|
-
outcome: z.enum(["ok", "error"]).optional().describe("How it ended."),
|
|
3865
|
-
error: z.string().optional().describe("What went wrong, when something did."),
|
|
3866
|
-
extra: z
|
|
3867
|
-
.record(z.string(), z.unknown())
|
|
3868
|
-
.optional()
|
|
3869
|
-
.describe("Whatever else the source had to say: attachments, participants, a recording's path. Shape varies by source."),
|
|
3870
|
-
});
|
|
3871
|
-
export const ActivityQuerySchema = z.object({
|
|
3872
|
-
provider: z.string().optional().describe("Narrow it to one outside service."),
|
|
3873
|
-
limit: z.coerce.number().min(1).max(500).default(100).describe("How many entries to return."),
|
|
3874
|
-
before: z.coerce.number().optional().describe("Only entries older than this timestamp, so paging walks backwards through the feed."),
|
|
3875
|
-
});
|
|
3876
|
-
export const ActivityListSchema = z.object({ events: z.array(ActivityEventSchema).describe("The audit entries, newest first.") });
|
|
3877
|
-
export const ActivityConnectionSchema = z.object({
|
|
3878
|
-
capabilityId: z.string().describe("Which connection."),
|
|
3879
|
-
provider: z.string().describe("Which service it is."),
|
|
3880
|
-
gateway: z
|
|
3881
|
-
.enum(["ready", "connecting", "pairing", "disconnected", "idle"])
|
|
3882
|
-
.describe("Idle means it is up but has nothing to listen for, which is different from a connection that should be up and is not. Pairing means somebody started a sign-in and never finished it, which no amount of waiting will fix."),
|
|
3883
|
-
lastError: z.string().optional().describe("The most recent thing that went wrong on it."),
|
|
3884
|
-
});
|
|
3885
|
-
export const ActivityStatusSchema = z.object({
|
|
3886
|
-
connections: z
|
|
3887
|
-
.array(ActivityConnectionSchema)
|
|
3888
|
-
.describe("Each source feeding the record, and whether it is working. Probed now rather than remembered."),
|
|
3889
|
-
voice: z
|
|
3890
|
-
.object({
|
|
3891
|
-
channelId: z.string().describe("Which channel."),
|
|
3892
|
-
channelName: z.string().describe("What it is called."),
|
|
3893
|
-
startedAt: z.number().describe("When it joined, in milliseconds."),
|
|
3894
|
-
participants: z.array(z.string()).describe("Who else is in it."),
|
|
3895
|
-
})
|
|
3896
|
-
.optional()
|
|
3897
|
-
.describe("A voice call the sandbox is currently in, when it is in one."),
|
|
3898
|
-
});
|
|
3899
|
-
export const UsageTurnSchema = z.object({
|
|
3900
|
-
at: z.number().describe("When the turn ended, in milliseconds."),
|
|
3901
|
-
day: z.string().describe("The day it fell in, as YYYY-MM-DD in UTC, worked out once so nothing downstream has to do timezone arithmetic."),
|
|
3902
|
-
provider: z.string().describe("Which model provider served it."),
|
|
3903
|
-
account: z.string().optional().describe("Which account paid. Absent for a turn run on a plain key, which belongs to no account."),
|
|
3904
|
-
model: z
|
|
3905
|
-
.string()
|
|
3906
|
-
.optional()
|
|
3907
|
-
.describe("The model that actually ran, past whatever was asked for and every default. Absent only when the provider's own default served it without being named."),
|
|
3908
|
-
modelRequested: z
|
|
3909
|
-
.string()
|
|
3910
|
-
.optional()
|
|
3911
|
-
.describe("The model that was asked for, when one was named. Differs from `model` when something resolved it."),
|
|
3912
|
-
harness: z.string().describe("Which agentic loop it ran on."),
|
|
3913
|
-
outcome: z.enum(["ok", "error", "cancelled"]).optional().describe("How it ended: finished, failed, or was stopped by the user."),
|
|
3914
|
-
errorCode: z.string().optional().describe("The failure's code, when it had one."),
|
|
3915
|
-
errorMessage: z.string().optional().describe("What the failure said, trimmed."),
|
|
3916
|
-
conversationId: z
|
|
3917
|
-
.string()
|
|
3918
|
-
.optional()
|
|
3919
|
-
.describe("Which conversation it belonged to, so spending can be traced to a card. Absent only for an internal one-off with no conversation at all."),
|
|
3920
|
-
turns: z
|
|
3921
|
-
.number()
|
|
3922
|
-
.describe("The provider's own count for the request, since one exchange can be several under the hood. One when it reported none."),
|
|
3923
|
-
inputTokens: z.number().describe("Tokens sent."),
|
|
3924
|
-
outputTokens: z.number().describe("Tokens received."),
|
|
3925
|
-
cacheReadTokens: z.number().describe("Tokens served from cache, which cost less."),
|
|
3926
|
-
cacheCreationTokens: z.number().describe("Tokens written to cache, which cost more up front and less afterwards."),
|
|
3927
|
-
costUsd: z.number().describe("What it cost, in dollars."),
|
|
3928
|
-
durationMs: z.number().describe("How long it took, in milliseconds."),
|
|
3929
|
-
terse: z.boolean().optional(),
|
|
3930
|
-
iqSearchArm: z.boolean().optional(),
|
|
3931
|
-
iqSearchCohort: z.string().optional(),
|
|
3932
|
-
proseChars: z.number().optional(),
|
|
3933
|
-
searchCalls: z.number().optional(),
|
|
3934
|
-
openingSearches: z.number().optional(),
|
|
3935
|
-
tierScore: z.number().optional(),
|
|
3936
|
-
tierRules: z.array(z.string()).optional(),
|
|
3937
|
-
tierRouted: z.boolean().optional(),
|
|
3938
|
-
tierFast: z.boolean().optional(),
|
|
3939
|
-
tierCeiling: z.number().optional(),
|
|
3940
|
-
tierDenied: z.boolean().optional(),
|
|
3941
|
-
});
|
|
3942
|
-
export const UsageRollupRowSchema = z.object({
|
|
3943
|
-
day: z.string().describe("The day, as YYYY-MM-DD in UTC."),
|
|
3944
|
-
provider: z.string().describe("Which model provider."),
|
|
3945
|
-
account: z.string().optional().describe("Which account. Absent for work run on a plain key."),
|
|
3946
|
-
model: z.string().optional().describe("Which model."),
|
|
3947
|
-
harness: z.string().describe("Which agentic loop."),
|
|
3948
|
-
conversationId: z.string().optional().describe("Which conversation."),
|
|
3949
|
-
turns: z.number().describe("Turns in this group."),
|
|
3950
|
-
inputTokens: z.number().describe("Tokens sent."),
|
|
3951
|
-
outputTokens: z.number().describe("Tokens received."),
|
|
3952
|
-
cacheReadTokens: z.number().describe("Tokens served from cache."),
|
|
3953
|
-
cacheCreationTokens: z.number().describe("Tokens written to cache."),
|
|
3954
|
-
costUsd: z.number().describe("What the group cost, in dollars."),
|
|
3955
|
-
durationMs: z.number().describe("Time spent, in milliseconds."),
|
|
3956
|
-
});
|
|
3957
|
-
export const DayWindowQuerySchema = z.object({
|
|
3958
|
-
from: z.string().optional().describe("First day to include, as YYYY-MM-DD in UTC. Leave it out for everything up to the end day."),
|
|
3959
|
-
to: z
|
|
3960
|
-
.string()
|
|
3961
|
-
.optional()
|
|
3962
|
-
.describe("Last day to include, as YYYY-MM-DD in UTC, and it is included rather than excluded. Leave it out for everything from the start day onwards."),
|
|
3963
|
-
});
|
|
3964
|
-
export const UsageRollupSchema = z.object({
|
|
3965
|
-
rows: z
|
|
3966
|
-
.array(UsageRollupRowSchema)
|
|
3967
|
-
.describe("Spending grouped by day, provider, account, model and conversation. Everything a cost screen shows is a rearrangement of these rows, which is why there is no second call for any of it."),
|
|
3968
|
-
});
|
|
3969
|
-
export const UsageAccountSchema = z.object({
|
|
3970
|
-
provider: z.string(),
|
|
3971
|
-
account: z.string(),
|
|
3972
|
-
turns: z.number(),
|
|
3973
|
-
inputTokens: z.number(),
|
|
3974
|
-
outputTokens: z.number(),
|
|
3975
|
-
cacheReadTokens: z.number(),
|
|
3976
|
-
cacheCreationTokens: z.number(),
|
|
3977
|
-
costUsd: z.number(),
|
|
3978
|
-
});
|
|
3979
|
-
export const UsageSummarySchema = z.object({ accounts: z.array(UsageAccountSchema) });
|
|
3980
|
-
export const LogFileEntrySchema = z.object({
|
|
3981
|
-
name: z.string().describe("Its name, which is what the read route takes."),
|
|
3982
|
-
sizeBytes: z.number().describe("Size in bytes."),
|
|
3983
|
-
modifiedAt: z.number().describe("When it last changed, in milliseconds."),
|
|
3984
|
-
});
|
|
3985
|
-
export const LogsListSchema = z.object({
|
|
3986
|
-
files: z.array(LogFileEntrySchema).describe("Every log the sandbox keeps: captured terminal output, command runs, and its own log."),
|
|
3987
|
-
});
|
|
3988
|
-
export const LogReadQuerySchema = z.object({
|
|
3989
|
-
name: z.string().min(1).describe("Which log. It travels in the query rather than the address, because log names contain slashes."),
|
|
3990
|
-
bytes: z.coerce
|
|
3991
|
-
.number()
|
|
3992
|
-
.min(1)
|
|
3993
|
-
.max(1_048_576)
|
|
3994
|
-
.default(65_536)
|
|
3995
|
-
.describe("How much of the end to read. The newest bytes win when the file is larger."),
|
|
3996
|
-
});
|
|
3997
|
-
export const LogReadSchema = z.object({
|
|
3998
|
-
name: z.string().describe("Which log this is from."),
|
|
3999
|
-
sizeBytes: z.number().describe("How large the whole file is."),
|
|
4000
|
-
text: z.string().describe("The end of it, as text."),
|
|
4001
|
-
truncated: z.boolean().describe("There is more before what you got."),
|
|
4002
|
-
});
|
|
4003
|
-
export const ClientDiagnosticSchema = z.object({
|
|
4004
|
-
seenAt: z.number().describe("When the browser saw it, in milliseconds."),
|
|
4005
|
-
level: z.enum(["warn", "error"]).describe("How bad it was."),
|
|
4006
|
-
event: z.string().min(1).max(100).describe("What kind of thing it was, as a stable name."),
|
|
4007
|
-
message: z.string().max(2_000).describe("What it said."),
|
|
4008
|
-
route: z.string().max(300).optional().describe("Which page they were on."),
|
|
4009
|
-
requestId: z.string().max(100).optional().describe("Which daemon call it belonged to, when it belonged to one."),
|
|
4010
|
-
build: z.string().max(100).optional().describe("Which build of the app was running."),
|
|
4011
|
-
fields: z
|
|
4012
|
-
.record(z.string().max(60), z.union([z.string().max(4_000), z.number(), z.boolean()]))
|
|
4013
|
-
.optional()
|
|
4014
|
-
.describe("Whatever else was worth keeping."),
|
|
4015
|
-
});
|
|
4016
|
-
export const ClientDiagnosticsReportSchema = z.object({
|
|
4017
|
-
events: z.array(ClientDiagnosticSchema).min(1).max(50).describe("What the browser has to report, oldest first."),
|
|
4018
|
-
});
|
|
4019
|
-
export const ClientDiagnosticsAcceptedSchema = z.object({
|
|
4020
|
-
recorded: z.number().describe("How many were written down."),
|
|
4021
|
-
});
|
|
4022
|
-
export const PresenceReportSchema = z.object({
|
|
4023
|
-
clientId: z.string().describe("This connection's own id, the same one it gave the event stream."),
|
|
4024
|
-
idle: z.boolean().describe("Whether the person has stopped doing anything."),
|
|
4025
|
-
view: z.string().optional().describe("Which view they are on."),
|
|
4026
|
-
sessionId: z.string().optional().describe("Which conversation they have open."),
|
|
4027
|
-
path: z
|
|
4028
|
-
.string()
|
|
4029
|
-
.optional()
|
|
4030
|
-
.describe("Which file they are looking at. Sent whole rather than merged: leaving a field out clears it, so a tab that closes a file drops the path in the same report."),
|
|
4031
|
-
});
|
|
4032
|
-
export const WebPushChannelSchema = z.object({
|
|
4033
|
-
kind: z.literal("webpush").describe("A browser, which the sandbox can reach directly and encrypt end to end."),
|
|
4034
|
-
endpoint: z.url().describe("Where that browser's push service accepts sends. It also identifies the device everywhere else in this group."),
|
|
4035
|
-
keys: z
|
|
4036
|
-
.object({
|
|
4037
|
-
p256dh: z.string().min(1).describe("The browser's public key, for encrypting what is sent."),
|
|
4038
|
-
auth: z.string().min(1).describe("The browser's secret, for the same."),
|
|
4039
|
-
})
|
|
4040
|
-
.describe("What the browser handed you when it subscribed. Post it back exactly as it came; nothing reshapes it."),
|
|
4041
|
-
});
|
|
4042
|
-
export const RelayChannelSchema = z.object({
|
|
4043
|
-
kind: z
|
|
4044
|
-
.literal("relay")
|
|
4045
|
-
.describe("A native app, whose operating system only accepts sends from the app's publisher, so the sandbox posts through a relay instead. The message passes through that relay readable, which is the price of the publisher having to be in the loop."),
|
|
4046
|
-
url: z.url().describe("Where to post a send. Recorded rather than assumed, so the sandbox need not know any platform by name."),
|
|
4047
|
-
deviceId: z.string().min(1).describe("The device's id, which also identifies this registration everywhere else in this group."),
|
|
4048
|
-
secret: z.string().min(1).describe("Proof that this sandbox may notify this device. The relay never learns which sandbox is calling."),
|
|
4049
|
-
});
|
|
4050
|
-
export const PushChannelSchema = z.discriminatedUnion("kind", [WebPushChannelSchema, RelayChannelSchema]);
|
|
4051
|
-
export const channelId = (channel) => (channel.kind === "webpush" ? channel.endpoint : channel.deviceId);
|
|
4052
|
-
export const PushNotificationSchema = z.object({
|
|
4053
|
-
title: z.string().min(1).describe("The headline."),
|
|
4054
|
-
body: z
|
|
4055
|
-
.string()
|
|
4056
|
-
.describe("The line under it. Push services cap the whole payload at a few kilobytes, which is why nothing here carries a transcript or a diff: a notification is a pointer back, not a delivery."),
|
|
4057
|
-
url: z.string().optional().describe("Where tapping it goes. An existing tab is focused rather than a new one opened."),
|
|
4058
|
-
tag: z
|
|
4059
|
-
.string()
|
|
4060
|
-
.optional()
|
|
4061
|
-
.describe("Collapses repeats: a second notification with the same tag replaces the first instead of stacking beside it."),
|
|
4062
|
-
requireInteraction: z
|
|
4063
|
-
.boolean()
|
|
4064
|
-
.optional()
|
|
4065
|
-
.describe("Keep it on screen until it is dismissed. Used when the agent is waiting for you, where one that fades away is a question that went unanswered in silence."),
|
|
4066
|
-
});
|
|
4067
|
-
export const PushConfigSchema = z.object({
|
|
4068
|
-
publicKey: z.string().describe("The key a browser needs in order to subscribe. Native apps ignore it."),
|
|
4069
|
-
subscribed: z
|
|
4070
|
-
.boolean()
|
|
4071
|
-
.describe("Whether the asking device is already registered, so a toggle can show its real state instead of trusting the device's own permission, which can be granted with nothing behind it."),
|
|
4072
|
-
});
|
|
4073
|
-
export const PushChannelIdSchema = z.object({
|
|
4074
|
-
id: z.string().min(1).describe("Which device: a browser's push address, or a native install's device id."),
|
|
4075
|
-
});
|
|
4076
|
-
export const PushConfigQuerySchema = z.object({
|
|
4077
|
-
id: z
|
|
4078
|
-
.string()
|
|
4079
|
-
.min(1)
|
|
4080
|
-
.optional()
|
|
4081
|
-
.describe("Which device is asking. Without it the answer can only speak for the sandbox as a whole, which is rarely the question."),
|
|
4082
|
-
});
|
|
4083
|
-
export const PushTestSchema = z.object({
|
|
4084
|
-
delivered: z
|
|
4085
|
-
.number()
|
|
4086
|
-
.int()
|
|
4087
|
-
.nonnegative()
|
|
4088
|
-
.describe("How many devices actually accepted it. A count rather than a yes, because this button exists to prove a chain nobody can inspect, and the sandbox having accepted the request is not the question being asked."),
|
|
4089
|
-
});
|
|
4090
|
-
export const PROBE_IDS = ["outdated", "audit", "knip", "jscpd", "ui", "bundle"];
|
|
4091
|
-
export const ProbeIdSchema = z.enum(PROBE_IDS);
|
|
4092
|
-
export const OutdatedPackageSchema = z.object({
|
|
4093
|
-
name: z.string().describe("The dependency."),
|
|
4094
|
-
current: z.string().describe("What you are on."),
|
|
4095
|
-
latest: z.string().describe("What is published."),
|
|
4096
|
-
kind: z
|
|
4097
|
-
.enum(["major", "minor", "patch"])
|
|
4098
|
-
.describe("How far apart those are. This is not one number because forty patch releases behind is a morning's work and one major version is a project."),
|
|
4099
|
-
section: z
|
|
4100
|
-
.string()
|
|
4101
|
-
.describe("Which part of the manifest declares it. A major version behind on a build-time tool is a different risk from one that ships."),
|
|
4102
|
-
});
|
|
4103
|
-
export const AdvisorySchema = z.object({
|
|
4104
|
-
name: z.string().describe("The dependency it concerns."),
|
|
4105
|
-
severity: z.enum(["critical", "high", "moderate", "low", "info"]).describe("How bad it is said to be."),
|
|
4106
|
-
title: z
|
|
4107
|
-
.string()
|
|
4108
|
-
.describe("What it is, in one line. No scoring vector and no reference list: those are for reading on the advisory's own page, and carrying them would put a kilobyte of prose per finding on every poll."),
|
|
4109
|
-
patched: z
|
|
4110
|
-
.string()
|
|
4111
|
-
.optional()
|
|
4112
|
-
.describe("Which versions fix it. Absent means no fix has been published, which is exactly when nothing should offer to upgrade and something should say so instead."),
|
|
4113
|
-
dev: z.boolean().describe("Whether it only reaches build-time tooling, which is a different problem from one that reaches what you ship."),
|
|
4114
|
-
});
|
|
4115
|
-
export const DeadCodeSchema = z.object({
|
|
4116
|
-
files: z.number().int().nonnegative().describe("Files nothing reaches."),
|
|
4117
|
-
exports: z.number().int().nonnegative().describe("Exported things nothing uses."),
|
|
4118
|
-
types: z.number().int().nonnegative().describe("Types nothing uses."),
|
|
4119
|
-
dependencies: z.number().int().nonnegative().describe("Declared dependencies nothing imports."),
|
|
4120
|
-
devDependencies: z.number().int().nonnegative().describe("The same, for build-time ones."),
|
|
4121
|
-
sample: z
|
|
4122
|
-
.array(z.string())
|
|
4123
|
-
.describe("A handful of the files, so a reader need not take the count on faith. Counts and a sample rather than the whole list, because an agent re-measures against the live tree anyway."),
|
|
4124
|
-
});
|
|
4125
|
-
export const DuplicationSchema = z.object({
|
|
4126
|
-
percentage: z
|
|
4127
|
-
.number()
|
|
4128
|
-
.describe("How much of the scanned code is duplicated. A share rather than a count, because a count grows with the repository and would mean something different every quarter."),
|
|
4129
|
-
clones: z.number().int().nonnegative().describe("How many duplicated stretches were found."),
|
|
4130
|
-
top: z
|
|
4131
|
-
.array(z.object({
|
|
4132
|
-
lines: z.number().int().nonnegative().describe("How long the duplicated stretch is."),
|
|
4133
|
-
first: z.string().describe("One of the two places."),
|
|
4134
|
-
second: z.string().describe("The other."),
|
|
4135
|
-
}))
|
|
4136
|
-
.describe("The largest of them."),
|
|
4137
|
-
});
|
|
4138
|
-
export const UiScanSchema = z.object({
|
|
4139
|
-
components: z.array(z.string()).describe("The interface's own source files, with tests, stories and generated output left out."),
|
|
4140
|
-
bypasses: z
|
|
4141
|
-
.array(z.object({
|
|
4142
|
-
path: z.string().describe("The file."),
|
|
4143
|
-
count: z.number().int().positive().describe("How many times, in that file."),
|
|
4144
|
-
}))
|
|
4145
|
-
.describe("Where the design system was routed around and a value hard-coded instead. Counted per file, because a reader deciding what to open is served by a file and a number, not by eleven snippets."),
|
|
4146
|
-
idioms: z
|
|
4147
|
-
.array(z.object({
|
|
4148
|
-
id: z
|
|
4149
|
-
.string()
|
|
4150
|
-
.describe("Which outdated idiom. Looked up rather than listed here, so a sandbox one version behind can still report one this list has never heard of."),
|
|
4151
|
-
files: z.array(z.string()).describe("The files still on it."),
|
|
4152
|
-
}))
|
|
4153
|
-
.describe("Files still written the way their framework has since replaced."),
|
|
4154
|
-
});
|
|
4155
|
-
export const BundleSchema = z.object({
|
|
4156
|
-
dir: z
|
|
4157
|
-
.string()
|
|
4158
|
-
.describe("Which folder was measured. Read from build output already on disk rather than by building, so this is sometimes a commit behind and never leaves anything in your working tree."),
|
|
4159
|
-
totalBytes: z.number().int().nonnegative().describe("The whole thing, raw."),
|
|
4160
|
-
totalGzip: z
|
|
4161
|
-
.number()
|
|
4162
|
-
.int()
|
|
4163
|
-
.nonnegative()
|
|
4164
|
-
.describe("The whole thing, compressed. The ratio between the two is the difference between big and big-and-incompressible, which are different problems."),
|
|
4165
|
-
assets: z
|
|
4166
|
-
.array(z.object({
|
|
4167
|
-
path: z.string().describe("The file."),
|
|
4168
|
-
bytes: z.number().int().nonnegative().describe("Its raw size."),
|
|
4169
|
-
gzip: z.number().int().nonnegative().describe("Its compressed size."),
|
|
4170
|
-
}))
|
|
4171
|
-
.describe("What is in it, piece by piece."),
|
|
4172
|
-
});
|
|
4173
|
-
export const ProbeStateSchema = z.enum(["ok", "unavailable", "failed"]);
|
|
4174
|
-
export const ProbeFactsSchema = z.discriminatedUnion("id", [
|
|
4175
|
-
z.object({ id: z.literal("outdated"), packages: z.array(OutdatedPackageSchema) }),
|
|
4176
|
-
z.object({ id: z.literal("audit"), advisories: z.array(AdvisorySchema) }),
|
|
4177
|
-
z.object({ id: z.literal("knip"), deadCode: DeadCodeSchema }),
|
|
4178
|
-
z.object({ id: z.literal("jscpd"), duplication: DuplicationSchema }),
|
|
4179
|
-
z.object({ id: z.literal("ui"), scan: UiScanSchema }),
|
|
4180
|
-
z.object({ id: z.literal("bundle"), bundle: BundleSchema }),
|
|
4181
|
-
]);
|
|
4182
|
-
export const ProbeResultSchema = z.object({
|
|
4183
|
-
id: ProbeIdSchema.describe("Which measurement this is."),
|
|
4184
|
-
state: ProbeStateSchema.describe("Whether the tool ran and reported, is not part of this repository at all, or broke. The middle one is not evidence of health: the check simply cannot be made here."),
|
|
4185
|
-
ranAt: z.number().describe("When it last finished, in milliseconds, which is what its age is measured from."),
|
|
4186
|
-
tookMs: z.number().int().nonnegative().describe("How long it took. Worth knowing before asking for it again: some of these run for minutes."),
|
|
4187
|
-
facts: ProbeFactsSchema.optional().describe("What it found, including finding nothing, which is a real answer and the one that keeps a chore quiet."),
|
|
4188
|
-
reason: z
|
|
4189
|
-
.string()
|
|
4190
|
-
.optional()
|
|
4191
|
-
.describe("Why it broke, quoted from the tool rather than summarised, or, when it never ran, what is missing. Never a sentence built from the check's own name, which would have an unmeasured check claiming there is nothing to measure."),
|
|
4192
|
-
});
|
|
4193
|
-
export const ChorePackageSchema = z.object({
|
|
4194
|
-
dir: z.string().describe("Where the package lives."),
|
|
4195
|
-
name: z.string().describe("What it declares itself as."),
|
|
4196
|
-
engines: z.record(z.string(), z.string()).optional().describe("Which runtime versions it says it needs, verbatim."),
|
|
4197
|
-
dependencies: z.array(z.string()).describe("What it depends on."),
|
|
4198
|
-
devDependencies: z.array(z.string()).describe("What it needs only to build."),
|
|
4199
|
-
documented: z.boolean().describe("Whether it has a README, which in this workspace is what a package's own documentation is."),
|
|
4200
|
-
});
|
|
4201
|
-
export const ChoreShapeSchema = z.object({
|
|
4202
|
-
docs: z
|
|
4203
|
-
.array(z.string())
|
|
4204
|
-
.describe("The repository's own architecture documents, when it has any. Their existence is the question: a repository with none has never been through the documentation flow at all."),
|
|
4205
|
-
dockerfiles: z.array(z.string()).describe("Container definitions in it."),
|
|
4206
|
-
ci: z.array(z.string()).describe("Pipeline definitions in it."),
|
|
4207
|
-
lockfile: z.boolean().describe("Whether dependencies are pinned to exact versions, which is what makes a security audit mean anything."),
|
|
4208
|
-
packageManifest: z
|
|
4209
|
-
.boolean()
|
|
4210
|
-
.describe("Whether it is a JavaScript project at all. A Rust or Go repository has no majors to be behind on, and offering it those checks would be this surface guessing at what it is looking at."),
|
|
4211
|
-
deps: z
|
|
4212
|
-
.array(z.string())
|
|
4213
|
-
.describe("Every dependency name declared anywhere in the repository. Names rather than a verdict about which framework this is, because that judgement belongs to whatever reads this, not to a sandbox baked months ago."),
|
|
4214
|
-
});
|
|
4215
|
-
export const ChoreSignalsSchema = z.object({
|
|
4216
|
-
packages: z.array(ChorePackageSchema).describe("Each package in the repository, as its own manifest declares it."),
|
|
4217
|
-
shape: ChoreShapeSchema.describe("What the repository is made of, which decides whether a given chore is even a sensible question to ask of it."),
|
|
4218
|
-
hotspots: z
|
|
4219
|
-
.array(WorkspaceHotspotSchema)
|
|
4220
|
-
.describe("Files that change often and are complicated at once, capped tight: a chore only asks whether something has entered the top of the ranking."),
|
|
4221
|
-
keyModules: z.array(WorkspaceKeyModuleSchema).describe("The parts the rest of the code leans on most, capped the same way."),
|
|
4222
|
-
totals: z
|
|
4223
|
-
.object({
|
|
4224
|
-
files: z.number().describe("Files counted."),
|
|
4225
|
-
symbols: z.number().describe("Named things they export."),
|
|
4226
|
-
complexity: z.number().describe("Branch points added up."),
|
|
4227
|
-
hotspots: z.number().describe("How many files qualify as hotspots at all."),
|
|
4228
|
-
})
|
|
4229
|
-
.describe("The repository in numbers."),
|
|
4230
|
-
indexed: z.boolean().describe("Whether the index these rankings came from is finished. Nothing should act on a half-built one."),
|
|
4231
|
-
});
|
|
4232
|
-
export const ChoreOutcomeSchema = z.enum(["acted", "reported", "clean"]);
|
|
4233
|
-
export const ChoreLedgerEntrySchema = z.object({
|
|
4234
|
-
repo: z.string().describe("Which repository."),
|
|
4235
|
-
chore: z.string().describe("Which chore."),
|
|
4236
|
-
ranAt: z.number().describe("When it ran, in milliseconds."),
|
|
4237
|
-
runId: z.string().describe("The conversation that ran it, so its whole record can be opened."),
|
|
4238
|
-
outcome: ChoreOutcomeSchema.describe("What it concluded: it did something, it wrote something down, or it looked and found the finding to be false. That last one matters most, or the same turn starts again for ever."),
|
|
4239
|
-
digest: z
|
|
4240
|
-
.string()
|
|
4241
|
-
.describe("A fingerprint of the evidence standing at the time. A chore whose evidence has since changed is due again on its own merits; one whose evidence has not stays quiet."),
|
|
4242
|
-
snoozedUntil: z
|
|
4243
|
-
.number()
|
|
4244
|
-
.optional()
|
|
4245
|
-
.describe("Not until then, in milliseconds. The chore stays visible and stays out of the badge. Different from switching it off, which is a setting."),
|
|
4246
|
-
});
|
|
4247
|
-
export const RunningProbeSchema = z.object({
|
|
4248
|
-
repo: z.string().describe("Which repository."),
|
|
4249
|
-
id: ProbeIdSchema.describe("Which measurement."),
|
|
4250
|
-
askedAt: z.number().describe("When it was asked for, in milliseconds, so one still waiting can say how long it has waited."),
|
|
4251
|
-
startedAt: z
|
|
4252
|
-
.number()
|
|
4253
|
-
.optional()
|
|
4254
|
-
.describe("When it actually began. Absent while it is queued behind another, which is a real and common state: there is one lane for the whole sandbox."),
|
|
4255
|
-
});
|
|
4256
|
-
export const ChoresReportSchema = z.object({
|
|
4257
|
-
repos: z
|
|
4258
|
-
.array(z.object({
|
|
4259
|
-
repo: z.string().describe("Which repository."),
|
|
4260
|
-
probes: z
|
|
4261
|
-
.array(ProbeResultSchema)
|
|
4262
|
-
.describe("The expensive measurements, served from a cache with an age on each rather than run on demand."),
|
|
4263
|
-
signals: ChoreSignalsSchema.describe("The cheap facts, worked out fresh every time."),
|
|
4264
|
-
}))
|
|
4265
|
-
.describe("Every repository's standing evidence. One answer for all of them, because a badge polls this on a timer and one request per repository is the kind of poll that shows up in a battery graph."),
|
|
4266
|
-
ledger: z.array(ChoreLedgerEntrySchema).describe("What has already been done about all of it."),
|
|
4267
|
-
running: z
|
|
4268
|
-
.array(RunningProbeSchema)
|
|
4269
|
-
.describe("What is being measured right now and what is waiting behind it. Part of this read rather than a route of its own, because a screen that had to ask twice would show the two halves disagreeing."),
|
|
4270
|
-
node: z
|
|
4271
|
-
.string()
|
|
4272
|
-
.describe("The runtime version this sandbox is actually running, read off the process rather than off a manifest, because what is installed is the fact that matters and a declared range is a wish."),
|
|
4273
|
-
});
|
|
4274
|
-
export const ChoreProbeRequestSchema = z.object({
|
|
4275
|
-
repo: z.string().min(1).describe("Which repository."),
|
|
4276
|
-
id: ProbeIdSchema.describe("Which measurement to retake, ahead of its usual schedule."),
|
|
4277
|
-
});
|
|
4278
|
-
export const ChoreLedgerWriteSchema = ChoreLedgerEntrySchema;
|
|
4279
|
-
export const ReadinessCheckSchema = z.object({
|
|
4280
|
-
id: z.string().describe("Which check."),
|
|
4281
|
-
label: z.string().describe("What it is called."),
|
|
4282
|
-
status: z.enum(["pass", "warn", "fail"]).describe("How it went. A warning is a real third answer rather than a soft failure."),
|
|
4283
|
-
detail: z.string().describe("What it found."),
|
|
4284
|
-
});
|
|
4285
|
-
export const ExtensionReadinessSchema = z.object({
|
|
4286
|
-
checks: z.array(ReadinessCheckSchema).describe("Everything that can be checked from the extension's own files, for an author about to publish."),
|
|
4287
|
-
});
|
|
4288
|
-
//# sourceMappingURL=schemas.js.map
|