@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
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
// workflows: a designed graph of sessions
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { AgentHarnessSchema, AgentProviderSchema, RepoBaseSchema } from "./agent.js";
|
|
4
|
+
import { entryId } from "./internal.js";
|
|
5
|
+
import { LoopCheckSchema, LoopContextSchema, LoopDocumentSchema, LoopOutputSchema, LoopStateSchema } from "./loops.js";
|
|
6
|
+
/* THE THIRD DRIVER. An automation answers "run this at 3am", a loop answers "run this until it is done", and a
|
|
7
|
+
* workflow answers "run these, in this order, each handing its result to the next".
|
|
8
|
+
*
|
|
9
|
+
* IT IS A GRAPH OF LOOPS, and that is the whole implementation. A step is not a new kind of execution, it is
|
|
10
|
+
* a Loop with a declared output and a place in a dependency graph, driven on a conversation of its own. So
|
|
11
|
+
* every step gets the fleet card, the worktree, the transcript, the cost ledger, the Stop button, the stall
|
|
12
|
+
* detector and the spend ceiling without a line of new code, and this file's job is only to say what the steps
|
|
13
|
+
* are and what depends on what.
|
|
14
|
+
*
|
|
15
|
+
* WHY IT IS NOT "AN AUTOMATION WITH SEVERAL PROMPTS". Because the value is in the SEAM between steps: the
|
|
16
|
+
* output of one is validated before the next is allowed to start, the reviewing step is a different session
|
|
17
|
+
* from the implementing one, and a step that cannot converge stops the branch below it rather than feeding
|
|
18
|
+
* garbage forward. None of that exists in a prompt that says "then do X".
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// A step id: short and slug-shaped because it is spliced into the derived conversation id (`wf-<run>-<step>`),
|
|
22
|
+
// which is itself a branch name and a directory name. The regex is the injection guard, the length cap is what
|
|
23
|
+
// keeps the derived id inside ConversationIdSchema's 64.
|
|
24
|
+
const StepIdSchema = z
|
|
25
|
+
.string()
|
|
26
|
+
.min(1)
|
|
27
|
+
.max(24)
|
|
28
|
+
.regex(/^[a-z0-9][a-z0-9-]*$/);
|
|
29
|
+
/* HOW A STEP MEETS ITS PREDECESSOR, the fork the whole feature turns on, and the one the user has to choose
|
|
30
|
+
* because neither answer is right twice in a row.
|
|
31
|
+
*
|
|
32
|
+
* `fresh` opens a NEW conversation: its own fleet card, its own session, its own worktree when the run is
|
|
33
|
+
* isolated. What it knows about the step before it is exactly what that step declared as output. This is the
|
|
34
|
+
* only honest way to run a review, an audit or a second opinion, a session that spent nine turns arguing for
|
|
35
|
+
* an approach is the worst available judge of whether that approach worked, and the fix is not a better prompt,
|
|
36
|
+
* it is a different session.
|
|
37
|
+
*
|
|
38
|
+
* `continue` sends the next prompt into the SAME conversation. The model keeps everything it learned, the
|
|
39
|
+
* prefix stays cached, and, when the run is isolated, the work stays in one worktree on one branch, which is
|
|
40
|
+
* the only way a chain like implement → test → document can build on itself at all. Requires exactly one
|
|
41
|
+
* predecessor: two upstream sessions cannot both be continued into one.
|
|
42
|
+
*/
|
|
43
|
+
export const WorkflowHandoffSchema = z.enum(["fresh", "continue"]);
|
|
44
|
+
export type WorkflowHandoff = z.infer<typeof WorkflowHandoffSchema>;
|
|
45
|
+
// Enough steps for a real pipeline, few enough that a workflow stays legible as one picture. A design past
|
|
46
|
+
// this is two workflows, and reading it as one graph was never going to work.
|
|
47
|
+
const WORKFLOW_STEPS_MAX = 24;
|
|
48
|
+
export const WorkflowStepSchema = z.object({
|
|
49
|
+
id: StepIdSchema.describe("This step's own name, which other steps use to say they wait on it."),
|
|
50
|
+
// What the node says on the graph. Short, the prompt is where the detail goes.
|
|
51
|
+
title: z.string().min(1).max(60).describe("What to call it on screen. Short: the instruction below is where the detail goes."),
|
|
52
|
+
/* What "done" means for this step, in the user's words. Put to the judge, and restated to the model unless
|
|
53
|
+
* its instruction already carries it (loop-brief); it is the sentence the step is measured against.
|
|
54
|
+
*
|
|
55
|
+
* ABSENT ⇒ THE RUN'S OWN REQUEST IS THE GOAL, which is the ordinary case and not the exotic one. A saved
|
|
56
|
+
* workflow is a SHAPE, "two models on one task", and for most of its steps the thing being asked for is
|
|
57
|
+
* whatever the person typed this time. Writing a goal here as well means saying the same thing twice and
|
|
58
|
+
* keeping the two in agreement forever; leaving it out means the step is measured against the request,
|
|
59
|
+
* which is what anyone would have written anyway. Declare one only where the step's bar is genuinely its
|
|
60
|
+
* own ("the suite is green") rather than the run's.
|
|
61
|
+
*/
|
|
62
|
+
goal: z
|
|
63
|
+
.string()
|
|
64
|
+
.min(1)
|
|
65
|
+
.optional()
|
|
66
|
+
.describe(
|
|
67
|
+
"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.",
|
|
68
|
+
),
|
|
69
|
+
/* What the step is told to DO. A different sentence from the goal: "the suite is green" is the goal,
|
|
70
|
+
* "run the tests, take the top failure, fix it" is the instruction.
|
|
71
|
+
*
|
|
72
|
+
* ABSENT ⇒ THE REQUEST IS HANDED OVER VERBATIM, with none of the workflow's own framing around it (see
|
|
73
|
+
* briefForStep). That is the default because the framing is not free: every heading between the reader's
|
|
74
|
+
* sentence and the model is a chance for the model to answer the frame instead of the question, and a step
|
|
75
|
+
* whose whole job is "do what was asked" has nothing to add to it. A step that DOES declare a prompt is
|
|
76
|
+
* saying it has a job of its own, review this, merge those, and gets the full brief, request included.
|
|
77
|
+
*/
|
|
78
|
+
prompt: z
|
|
79
|
+
.string()
|
|
80
|
+
.min(1)
|
|
81
|
+
.optional()
|
|
82
|
+
.describe(
|
|
83
|
+
"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.",
|
|
84
|
+
),
|
|
85
|
+
// The steps that must finish before this one starts. Empty ⇒ a root, started when the run starts. The
|
|
86
|
+
// graph must be acyclic and every id must exist; both are checked when the workflow is saved.
|
|
87
|
+
needs: z
|
|
88
|
+
.array(StepIdSchema)
|
|
89
|
+
.describe(
|
|
90
|
+
"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.",
|
|
91
|
+
),
|
|
92
|
+
handoff: WorkflowHandoffSchema.describe(
|
|
93
|
+
"How it meets what came before: a fresh conversation handed the previous step's result, or the same conversation carried on.",
|
|
94
|
+
),
|
|
95
|
+
output: LoopOutputSchema.describe("What it has to produce for the step to count."),
|
|
96
|
+
checks: z.array(LoopCheckSchema).describe("What has to pass before it counts as done."),
|
|
97
|
+
// How the step's own ITERATIONS meet each other, the Ralph question, one level down from `handoff`. A
|
|
98
|
+
// long-running step wants `fresh` (no context rot); a short refine-this step wants `continue`.
|
|
99
|
+
context: LoopContextSchema.describe(
|
|
100
|
+
"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.",
|
|
101
|
+
),
|
|
102
|
+
/* Iteration/stall limits remain scheduler backstops rather than form questions. Spend is different: it is
|
|
103
|
+
* the one resource the owner cannot recover after an unattended fan-out, and the underlying loop already
|
|
104
|
+
* enforces it exactly. Absent remains uncapped for short, person-started work. */
|
|
105
|
+
maxSpendUsd: z
|
|
106
|
+
.number()
|
|
107
|
+
.positive()
|
|
108
|
+
.optional()
|
|
109
|
+
.describe(
|
|
110
|
+
"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.",
|
|
111
|
+
),
|
|
112
|
+
agent: AgentProviderSchema.optional().describe("Which provider runs it."),
|
|
113
|
+
harness: AgentHarnessSchema.optional().describe("Which agentic loop runs it."),
|
|
114
|
+
account: z.string().optional().describe("Which account pays for it."),
|
|
115
|
+
model: z.string().optional().describe("Which model runs it."),
|
|
116
|
+
/* Which persona the step acts as, the same field a chat turn and an automation carry (AgentTurnSchema.
|
|
117
|
+
* actsAs), because a step IS an unattended turn under the loop machinery. Unpinned, a step keeps the
|
|
118
|
+
* strict unattended default: full tools, no logged-in accounts. Pinning a card is how a gated release
|
|
119
|
+
* check gets a voice, a folder scope, or the one Reddit it is allowed to post from, a decision the owner
|
|
120
|
+
* already wrote down once, on the card. */
|
|
121
|
+
actsAs: entryId
|
|
122
|
+
.optional()
|
|
123
|
+
.describe(
|
|
124
|
+
"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.",
|
|
125
|
+
),
|
|
126
|
+
});
|
|
127
|
+
export type WorkflowStep = z.infer<typeof WorkflowStepSchema>;
|
|
128
|
+
/* THE GATE, how a finished run becomes a release decision, and how a machine with no identity asks for one.
|
|
129
|
+
*
|
|
130
|
+
* A workflow is a DESIGN; a gate is a PROMISE ABOUT ITS RESULT, and keeping the two separable is the whole
|
|
131
|
+
* point. What a run does, how many sessions, whether they drive a browser, which repos they touch, stays the
|
|
132
|
+
* graph's business, because the value of running a release check this way is that the check is a workflow like
|
|
133
|
+
* any other: an acceptance sweep today, a security review or a performance budget next month, with nothing
|
|
134
|
+
* here ever learning what any of them are.
|
|
135
|
+
*
|
|
136
|
+
* So a gate reads exactly one thing: a named FIELD off a named STEP's declared output (output-fields.ts). That
|
|
137
|
+
* field already exists for precisely the reason this needs it, a declared field is the one part of a session's
|
|
138
|
+
* answer that was VALIDATED rather than parsed back out of the prose the model was talking to a person in,
|
|
139
|
+
* and pointing at one is the entire rule.
|
|
140
|
+
*/
|
|
141
|
+
export const WorkflowGateSchema = z.object({
|
|
142
|
+
// Which step's declared output carries the decision. Ordinarily a leaf that weighs up the steps before it;
|
|
143
|
+
// nothing requires that, and a one-step workflow naming its only step is the common small case.
|
|
144
|
+
step: StepIdSchema.describe(
|
|
145
|
+
"Which step's answer carries the decision. Usually a last step that weighs up the ones before it, though nothing requires that.",
|
|
146
|
+
),
|
|
147
|
+
// Which of that step's declared fields is read. Checked against what the step actually declares when the
|
|
148
|
+
// workflow is saved, a gate pointed at a field nobody writes answers `blocked` on every run, forever.
|
|
149
|
+
field: z
|
|
150
|
+
.string()
|
|
151
|
+
.min(1)
|
|
152
|
+
.describe(
|
|
153
|
+
"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.",
|
|
154
|
+
),
|
|
155
|
+
/* The values of that field that mean SHIP IT. Everything else fails the gate.
|
|
156
|
+
*
|
|
157
|
+
* An allowlist rather than a blocklist, because the two are not symmetric under a model's vocabulary. A
|
|
158
|
+
* step that answers "mostly-pass", "pass-with-notes" or "pass (2 minor defects)" must not ship, and the
|
|
159
|
+
* allowlist gets that right without anyone having had to enumerate the ways a model can hedge.
|
|
160
|
+
*/
|
|
161
|
+
pass: z
|
|
162
|
+
.array(z.string().min(1))
|
|
163
|
+
.min(1)
|
|
164
|
+
.describe(
|
|
165
|
+
"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.",
|
|
166
|
+
),
|
|
167
|
+
// The webhook's own auth, minted on save exactly as an event automation's is. The caller is a pipeline
|
|
168
|
+
// runner with no Google identity, so this is the only credential in the exchange.
|
|
169
|
+
token: z
|
|
170
|
+
.string()
|
|
171
|
+
.optional()
|
|
172
|
+
.describe(
|
|
173
|
+
"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.",
|
|
174
|
+
),
|
|
175
|
+
/* Runs per UTC day, across every caller. A gate is a paid endpoint reachable with no person in the loop:
|
|
176
|
+
* one of these wired into a push-triggered pipeline is a fan-out of sessions per commit, and the
|
|
177
|
+
* per-request deadline bounds one call's WALL CLOCK without bounding the day's SPEND. Absent ⇒
|
|
178
|
+
* GATE_DAILY_MAX_DEFAULT, not uncapped, for the reason the Front Desk's ceiling is not optional either.
|
|
179
|
+
*/
|
|
180
|
+
dailyMax: z
|
|
181
|
+
.number()
|
|
182
|
+
.int()
|
|
183
|
+
.positive()
|
|
184
|
+
.optional()
|
|
185
|
+
.describe(
|
|
186
|
+
"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.",
|
|
187
|
+
),
|
|
188
|
+
});
|
|
189
|
+
export type WorkflowGate = z.infer<typeof WorkflowGateSchema>;
|
|
190
|
+
/* The gate's daily ceiling when its author sets none. Deliberately small next to the Front Desk's 200: a
|
|
191
|
+
* Front Desk message is one turn, a gate run is a whole graph of sessions, and the honest comparison is cost
|
|
192
|
+
* rather than count. Twenty is a busy day of merges and a script's first minute. */
|
|
193
|
+
export const GATE_DAILY_MAX_DEFAULT = 20;
|
|
194
|
+
/* What a gate answers a pipeline, and the three-way split matters.
|
|
195
|
+
*
|
|
196
|
+
* `blocked` exists for the same reason acceptance's verdict has one: "we could not reach a judgment" is not
|
|
197
|
+
* "the product is broken". A gate that reported them the same way would go red for its own outages, and a team
|
|
198
|
+
* that cannot tell the two apart turns the gate off, so `blocked` is meant to be the honest answer far more
|
|
199
|
+
* often than it is the convenient one. It maps to a NEUTRAL pipeline exit, never a failed build.
|
|
200
|
+
*/
|
|
201
|
+
export const GateOutcomeSchema = z.enum(["pass", "fail", "blocked"]);
|
|
202
|
+
export type GateOutcome = z.infer<typeof GateOutcomeSchema>;
|
|
203
|
+
// What the gate route answers with. `value` is the field as the step actually wrote it, absent when the gate
|
|
204
|
+
// never got one to read, which is every `blocked` that is not a disagreement about the value.
|
|
205
|
+
export const GateVerdictSchema = z.object({
|
|
206
|
+
outcome: GateOutcomeSchema.describe(
|
|
207
|
+
"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.",
|
|
208
|
+
),
|
|
209
|
+
// One line: why. Realistically the only part of this a pipeline log will ever show.
|
|
210
|
+
reason: z.string().describe("Why, in one line. Realistically the only part of this a build log will ever show."),
|
|
211
|
+
runId: z.string().describe("The run behind the verdict, so somebody can go and read it."),
|
|
212
|
+
value: z
|
|
213
|
+
.string()
|
|
214
|
+
.optional()
|
|
215
|
+
.describe("What the step actually answered. Absent when there was nothing to read, which is most of the could-not-tell cases."),
|
|
216
|
+
});
|
|
217
|
+
export type GateVerdict = z.infer<typeof GateVerdictSchema>;
|
|
218
|
+
export const WorkflowSchema = z.object({
|
|
219
|
+
id: entryId.describe("The workflow's id."),
|
|
220
|
+
name: z.string().min(1).max(80).describe("What to call it."),
|
|
221
|
+
description: z.string().max(400).optional().describe("What it is for."),
|
|
222
|
+
steps: z
|
|
223
|
+
.array(WorkflowStepSchema)
|
|
224
|
+
.min(1)
|
|
225
|
+
.max(WORKFLOW_STEPS_MAX)
|
|
226
|
+
.describe(
|
|
227
|
+
"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.",
|
|
228
|
+
),
|
|
229
|
+
// Present ⇒ this design can be run by a machine and answers a release decision. Absent ⇒ an ordinary
|
|
230
|
+
// workflow, started by a person from the workflows page, with no public door onto it at all.
|
|
231
|
+
gate: WorkflowGateSchema.optional().describe(
|
|
232
|
+
"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.",
|
|
233
|
+
),
|
|
234
|
+
/* EVERY STEP RUNS IN ITS OWN WORKTREE, always, with no toggle, the same thing an isolated agent session
|
|
235
|
+
* does, which is what every session in this product already is.
|
|
236
|
+
*
|
|
237
|
+
* It was a per-workflow choice between worktrees and the shared /work tree, and the shared side never
|
|
238
|
+
* earned its place: parallel steps on one tree collide, a `fresh` step there sees a half-finished
|
|
239
|
+
* predecessor's edits as if they were the workspace, and the pinned-base-to-branch comparisons that make
|
|
240
|
+
* a fan-in READABLE (see workflow-brief) only exist on the isolated side. A setting whose other value is a
|
|
241
|
+
* subtle trap is not a setting, it is a mistake waiting for somebody to make it.
|
|
242
|
+
*/
|
|
243
|
+
// How many steps may run at once. Bounded because a fan-out of twelve is twelve provider sessions, twelve
|
|
244
|
+
// worktrees and twelve times the burn rate, and because the machine this runs on is one machine.
|
|
245
|
+
maxParallel: z
|
|
246
|
+
.number()
|
|
247
|
+
.int()
|
|
248
|
+
.min(1)
|
|
249
|
+
.max(8)
|
|
250
|
+
.describe(
|
|
251
|
+
"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.",
|
|
252
|
+
),
|
|
253
|
+
});
|
|
254
|
+
export type Workflow = z.infer<typeof WorkflowSchema>;
|
|
255
|
+
// The rules a graph has to clear before it can be saved or run, the acyclic `needs`, the once-only
|
|
256
|
+
// continuation, are in workflow-faults.ts, because they are about the graph rather than about any field here.
|
|
257
|
+
|
|
258
|
+
/* How one step ended. `skipped` is the one that carries information the others cannot: it means the step never
|
|
259
|
+
* ran because something it waited for did not finish, which is why a failed workflow shows one red node and a
|
|
260
|
+
* trail of grey ones rather than a wall of failures that all say the same thing.
|
|
261
|
+
*/
|
|
262
|
+
export const WorkflowStepStateSchema = z.enum(["pending", "running", "done", "failed", "skipped", "stopped"]);
|
|
263
|
+
export type WorkflowStepState = z.infer<typeof WorkflowStepStateSchema>;
|
|
264
|
+
export const WorkflowStepRunSchema = z.object({
|
|
265
|
+
stepId: StepIdSchema.describe("Which step this is."),
|
|
266
|
+
state: WorkflowStepStateSchema.describe(
|
|
267
|
+
"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.",
|
|
268
|
+
),
|
|
269
|
+
// The conversation this step ran on, derived, and the door from a node on the graph to a real transcript.
|
|
270
|
+
// Shared with the predecessor when the handoff is `continue`, which is what makes those steps one card.
|
|
271
|
+
conversationId: z
|
|
272
|
+
.string()
|
|
273
|
+
.describe(
|
|
274
|
+
"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.",
|
|
275
|
+
),
|
|
276
|
+
startedAt: z.number().optional().describe("When it began, in milliseconds."),
|
|
277
|
+
endedAt: z.number().optional().describe("When it ended, in milliseconds."),
|
|
278
|
+
iterations: z.number().int().min(0).describe("How many rounds it took."),
|
|
279
|
+
costUsd: z.number().optional().describe("What it cost, in dollars."),
|
|
280
|
+
// How the step's LOOP ended, `exhausted` and `stalled` both land as a `failed` step, and the difference
|
|
281
|
+
// between them is the difference between "give it more room" and "more room will not help".
|
|
282
|
+
loopState: LoopStateSchema.optional().describe(
|
|
283
|
+
"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.",
|
|
284
|
+
),
|
|
285
|
+
detail: z.string().optional().describe("What went wrong, when something did."),
|
|
286
|
+
// What the step produced. Present once the step has written a valid document, which for a `json` output
|
|
287
|
+
// means it matched the declared fields. This is what the steps downstream are given.
|
|
288
|
+
document: LoopDocumentSchema.optional().describe(
|
|
289
|
+
"What it produced, once it has produced something that passes its own declared shape. This is what the steps after it are handed.",
|
|
290
|
+
),
|
|
291
|
+
/* A bounded preview of the step's closing words. The complete response lives at `reportPath`, so a long-form
|
|
292
|
+
* handoff is not silently reduced to its last few thousand characters and the ledger stays bounded. */
|
|
293
|
+
report: z
|
|
294
|
+
.string()
|
|
295
|
+
.optional()
|
|
296
|
+
.describe(
|
|
297
|
+
"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.",
|
|
298
|
+
),
|
|
299
|
+
// Workspace-relative shared-state artifact containing the complete response. Fresh worktrees and a resumed
|
|
300
|
+
// daemon see the same .intentic mount, so downstream steps can read it without copying it into their prompt.
|
|
301
|
+
reportPath: z
|
|
302
|
+
.string()
|
|
303
|
+
.optional()
|
|
304
|
+
.describe(
|
|
305
|
+
"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.",
|
|
306
|
+
),
|
|
307
|
+
});
|
|
308
|
+
export type WorkflowStepRun = z.infer<typeof WorkflowStepRunSchema>;
|
|
309
|
+
// `done` means every step that ran finished; a run with skipped steps is `failed`, because a graph that did not
|
|
310
|
+
// reach its leaves did not do what it was asked whatever the survivors managed.
|
|
311
|
+
export const WorkflowRunStateSchema = z.enum(["running", "done", "failed", "stopped", "overspent", "error"]);
|
|
312
|
+
export type WorkflowRunState = z.infer<typeof WorkflowRunStateSchema>;
|
|
313
|
+
export const WorkflowRunSchema = z.object({
|
|
314
|
+
runId: z.string().min(1).describe("This run's id."),
|
|
315
|
+
/* The workflow AS IT WAS WHEN THE RUN STARTED, snapshotted rather than referenced. Three things need this
|
|
316
|
+
* and none of them tolerate a live lookup: the run view draws the graph the run actually ran (not the one
|
|
317
|
+
* that has been edited twice since), the boot resume needs the step definitions of a workflow that may have
|
|
318
|
+
* been deleted, and a history row for a deleted workflow is otherwise an id and nothing else. */
|
|
319
|
+
workflow: WorkflowSchema.describe(
|
|
320
|
+
"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.",
|
|
321
|
+
),
|
|
322
|
+
/* The workspace as this run began, one immutable commit per repository. Every fresh step branches from
|
|
323
|
+
* these exact commits, even if main moves while a wide fan-out is still opening worktrees. Handoffs use the
|
|
324
|
+
* same bases in their diff commands, so provenance works in nested repositories as well as at root. */
|
|
325
|
+
repos: z
|
|
326
|
+
.array(RepoBaseSchema)
|
|
327
|
+
.min(1)
|
|
328
|
+
.max(50)
|
|
329
|
+
.describe(
|
|
330
|
+
"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.",
|
|
331
|
+
),
|
|
332
|
+
/* WHAT THIS RUN WAS ASKED TO DO, the sentence the user typed when they started it, handed to every step
|
|
333
|
+
* on top of its own prompt. Absent for a run started from the workflows page, which has no composer.
|
|
334
|
+
*
|
|
335
|
+
* It is what makes one saved design worth keeping: "two models, one task" is a SHAPE, and the task is
|
|
336
|
+
* different every time. Without this the only way to point a workflow at today's job is to open the
|
|
337
|
+
* designer and retype a step's prompt, which means the design and the request are the same document,
|
|
338
|
+
* and editing a graph to ask a question is not something anybody does twice.
|
|
339
|
+
*
|
|
340
|
+
* Snapshotted on the run beside the workflow, and for the same reason: the run has to stay readable, and
|
|
341
|
+
* "what was this one about" is the first thing anyone asks of a row in the history.
|
|
342
|
+
*/
|
|
343
|
+
request: z
|
|
344
|
+
.string()
|
|
345
|
+
.optional()
|
|
346
|
+
.describe(
|
|
347
|
+
"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.",
|
|
348
|
+
),
|
|
349
|
+
state: WorkflowRunStateSchema.describe(
|
|
350
|
+
"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.",
|
|
351
|
+
),
|
|
352
|
+
startedAt: z.number().describe("When it began, in milliseconds."),
|
|
353
|
+
endedAt: z.number().optional().describe("When it ended, in milliseconds."),
|
|
354
|
+
// How many daemon boots have picked this run back up, the same counter, and the same reason, as a loop's.
|
|
355
|
+
resumed: z.number().int().min(0).describe("How many times the sandbox restarted under it and picked it back up."),
|
|
356
|
+
detail: z.string().optional().describe("What went wrong, when something did."),
|
|
357
|
+
// One entry per step, in the workflow's own order. Written at start with every step `pending`, so the graph
|
|
358
|
+
// is complete from the first frame and a node's absence never has to mean two things.
|
|
359
|
+
steps: z
|
|
360
|
+
.array(WorkflowStepRunSchema)
|
|
361
|
+
.describe(
|
|
362
|
+
"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.",
|
|
363
|
+
),
|
|
364
|
+
/* When the run was ARCHIVED (ms epoch), off the board, exactly as an agent's `archivedAt` takes a card off
|
|
365
|
+
* it, and the same promise: the run record stays readable in the history and every step's branch,
|
|
366
|
+
* transcript and counters are untouched. Absent ⇒ live on the board.
|
|
367
|
+
*
|
|
368
|
+
* A RUN AND ITS STEPS ARCHIVE AS ONE, which is the whole reason this field exists rather than the record
|
|
369
|
+
* simply being dropped. A run's steps have no card of their own, the run's row is what stands for them,
|
|
370
|
+
* so deleting the record was releasing five loose conversations back onto the board at the moment the user
|
|
371
|
+
* said they were finished with the job. Archiving the run archives its sessions with it and unarchiving
|
|
372
|
+
* brings both back, so "done with this" means the same thing for a workflow as it does for an agent. */
|
|
373
|
+
archivedAt: z
|
|
374
|
+
.number()
|
|
375
|
+
.optional()
|
|
376
|
+
.describe(
|
|
377
|
+
"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.",
|
|
378
|
+
),
|
|
379
|
+
});
|
|
380
|
+
export type WorkflowRun = z.infer<typeof WorkflowRunSchema>;
|
|
381
|
+
// The list row: the stored workflow plus the runs it has had, newest first.
|
|
382
|
+
export const WorkflowSummarySchema = WorkflowSchema.extend({ runs: z.array(WorkflowRunSchema).describe("Its runs, newest first.") });
|
|
383
|
+
export type WorkflowSummary = z.infer<typeof WorkflowSummarySchema>;
|
|
384
|
+
export const WorkflowsListSchema = z.object({ workflows: z.array(WorkflowSummarySchema).describe("Every saved design with its own run history.") });
|
|
385
|
+
export const WorkflowRunsListSchema = z.object({
|
|
386
|
+
runs: z.array(WorkflowRunSchema).describe("Every run across every workflow, newest first, including runs of workflows since deleted."),
|
|
387
|
+
});
|
|
388
|
+
export const WorkflowIdParamSchema = z.object({ id: z.string().describe("Which workflow.") });
|
|
389
|
+
export const WorkflowRunIdParamSchema = z.object({ runId: z.string().describe("Which run.") });
|
|
390
|
+
/* Starting a run: which design, and what to point it at. The request is optional because the workflows page
|
|
391
|
+
* starts runs with no composer to read one from, a design whose steps already say what they want is complete
|
|
392
|
+
* on its own, and only a design written as a shape needs today's sentence. */
|
|
393
|
+
export const WorkflowRunStartSchema = WorkflowIdParamSchema.extend({
|
|
394
|
+
request: z
|
|
395
|
+
.string()
|
|
396
|
+
.min(1)
|
|
397
|
+
.max(20_000)
|
|
398
|
+
.optional()
|
|
399
|
+
.describe(
|
|
400
|
+
"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.",
|
|
401
|
+
),
|
|
402
|
+
});
|
|
403
|
+
// Creation and replacement are deliberately distinct. An id collision on create is a conflict; an update of
|
|
404
|
+
// a missing id is not an implicit create. That makes the daemon, rather than a browser naming convention, the
|
|
405
|
+
// authority that prevents one saved design from overwriting another.
|
|
406
|
+
export const WorkflowSaveSchema = z.object({
|
|
407
|
+
workflow: WorkflowSchema.describe("The design to write."),
|
|
408
|
+
create: z
|
|
409
|
+
.boolean()
|
|
410
|
+
.describe(
|
|
411
|
+
"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.",
|
|
412
|
+
),
|
|
413
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Every discovered repo's id (root-relative dir under /work), sorted, roles included.
|
|
3
|
+
export const ReposListSchema = z.object({
|
|
4
|
+
repos: z
|
|
5
|
+
.array(z.string())
|
|
6
|
+
.describe('Every repository\'s id, sorted. An id is its folder relative to the workspace root, and "root" is the workspace itself.'),
|
|
7
|
+
});
|
|
8
|
+
export const CloneRepoSchema = z.object({
|
|
9
|
+
name: z.string().min(1).describe("What to call it in the workspace."),
|
|
10
|
+
cloneUrl: z.string().min(1).describe("Where to clone it from."),
|
|
11
|
+
branch: z.string().optional().describe("Which branch to check out. Leave it out for the repository's default."),
|
|
12
|
+
});
|
|
13
|
+
export const CloneResultSchema = z.object({
|
|
14
|
+
name: z.string().describe("What it ended up called."),
|
|
15
|
+
path: z.string().describe("Where it landed."),
|
|
16
|
+
});
|
|
17
|
+
// Per-repo result of a workspace sync (fetch + guarded fast-forward). `status` mirrors GitSyncResult plus the
|
|
18
|
+
// turn-orchestration outcomes skipped/error; behind/ahead/head/message are present per status (see RepoSyncOutcome).
|
|
19
|
+
export const RepoSyncSchema = z.object({
|
|
20
|
+
repo: z.string().describe("Which repository."),
|
|
21
|
+
status: z
|
|
22
|
+
.enum(["updated", "current", "dirty", "diverged", "no-remote", "skipped", "error"])
|
|
23
|
+
.describe(
|
|
24
|
+
"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.",
|
|
25
|
+
),
|
|
26
|
+
behind: z.number().optional().describe("How many commits it was behind."),
|
|
27
|
+
ahead: z.number().optional().describe("How many commits it was ahead."),
|
|
28
|
+
head: z.string().optional().describe("The commit it ended up on."),
|
|
29
|
+
message: z.string().optional().describe("What went wrong, when something did."),
|
|
30
|
+
});
|
|
31
|
+
export const WorkspaceSyncSchema = z.object({ repos: z.array(RepoSyncSchema).describe("One entry per repository, saying what happened to it.") });
|
|
32
|
+
// Add one or more named app instances into an EXISTING monorepo. Each entry pairs a template key from the
|
|
33
|
+
// source repo's templates.json manifest (e.g. "api", "web", "landing") with a user-chosen instance name
|
|
34
|
+
// (e.g. "shop-api"); {repo} names the target monorepo.
|
|
35
|
+
export const AppInstanceInputSchema = z.object({
|
|
36
|
+
template: z.string().min(1).describe("Which kind of app to scaffold, by its key in the template list."),
|
|
37
|
+
name: z
|
|
38
|
+
.string()
|
|
39
|
+
.min(1)
|
|
40
|
+
.regex(/^[a-z][a-z0-9-]*$/)
|
|
41
|
+
.describe("What to call this one."),
|
|
42
|
+
});
|
|
43
|
+
export type AppInstanceInput = z.infer<typeof AppInstanceInputSchema>;
|
|
44
|
+
export const AddAppsSchema = z.object({
|
|
45
|
+
repo: z.string().describe("Which repository to scaffold into."),
|
|
46
|
+
apps: z.array(AppInstanceInputSchema).min(1).describe("The apps to add."),
|
|
47
|
+
});
|
|
48
|
+
// Run vitest for one or more repo-relative project dirs in a named one-shot tmux panel session
|
|
49
|
+
// (panel-<repo>--<session>), driven by the apps extension's Run-tests actions. `session` is a slug suffix
|
|
50
|
+
// (an app/package name as `<name>__test`, or `tests` for the library section); `dirs` are repo-relative
|
|
51
|
+
// package dirs, where "" targets the repo root.
|
|
52
|
+
export const RunTestsSchema = z.object({
|
|
53
|
+
repo: z.string().describe("Which repository."),
|
|
54
|
+
session: z.string().describe("What to call the terminal this runs in, so you can find it again."),
|
|
55
|
+
dirs: z.array(z.string()).min(1).describe("Which projects to test, as folders relative to the repository. Empty targets the repository root."),
|
|
56
|
+
});
|
|
57
|
+
// One addable app type the configured source repo offers (from its templates.json), listed for the operator
|
|
58
|
+
// panel's Add-app picker: the manifest key + its label/description.
|
|
59
|
+
export const TemplateSummarySchema = z.object({
|
|
60
|
+
key: z.string().describe("The id to name when scaffolding one."),
|
|
61
|
+
label: z.string().describe("What to call it on screen."),
|
|
62
|
+
description: z.string().describe("What you get."),
|
|
63
|
+
});
|
|
64
|
+
export type TemplateSummary = z.infer<typeof TemplateSummarySchema>;
|
|
65
|
+
export const TemplatesListSchema = z.object({
|
|
66
|
+
templates: z.array(TemplateSummarySchema).describe("The kinds of app the configured source repository knows how to scaffold."),
|
|
67
|
+
});
|
|
68
|
+
export type TemplatesList = z.infer<typeof TemplatesListSchema>;
|
|
69
|
+
// One app instance currently in a monorepo, with its own preview dev server + live status (started/stopped
|
|
70
|
+
// from the apps extension). `app` is the user-chosen instance name (the _apps/ dir); `kind` is what sort of
|
|
71
|
+
// app it is, the manifest key it was scaffolded from (api/web/landing), else the framework detected from its
|
|
72
|
+
// dependencies (astro/next/…), and absent when it was discovered purely by its `dev` script. previewUrl is
|
|
73
|
+
// https://preview-<repo>--<app>-<sandboxId>.<zone> (absent on loopback, no zone or no connect token).
|
|
74
|
+
export const RepoAppSchema = z.object({
|
|
75
|
+
app: z.string().describe("The app's name, which is also its folder."),
|
|
76
|
+
kind: z
|
|
77
|
+
.string()
|
|
78
|
+
.optional()
|
|
79
|
+
.describe(
|
|
80
|
+
"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.",
|
|
81
|
+
),
|
|
82
|
+
previewUrl: z.string().optional().describe("Where to open it. Absent when this sandbox has no outside address."),
|
|
83
|
+
running: z.boolean().describe("Whether its dev server is up."),
|
|
84
|
+
healthy: z.boolean().describe("Whether it is actually answering."),
|
|
85
|
+
});
|
|
86
|
+
export type RepoApp = z.infer<typeof RepoAppSchema>;
|
|
87
|
+
export const AppsListSchema = z.object({ apps: z.array(RepoAppSchema).describe("The apps in this repository.") });
|
|
88
|
+
export type AppsList = z.infer<typeof AppsListSchema>;
|
|
89
|
+
// One workspace package in a pnpm monorepo, discovered from pnpm-workspace.yaml's packages globs. `dir` is the
|
|
90
|
+
// repo-relative package dir (e.g. "_editor/web"); `group` is its top-level dir segment (e.g. "_editor"), the
|
|
91
|
+
// dependencies view's coloring axis.
|
|
92
|
+
export const WorkspacePackageSchema = z.object({
|
|
93
|
+
name: z.string().describe("The name the package declares."),
|
|
94
|
+
dir: z.string().describe("Where it lives, relative to the repository."),
|
|
95
|
+
group: z.string().describe("The top-level folder it sits under, which is what a diagram colours by."),
|
|
96
|
+
});
|
|
97
|
+
export type WorkspacePackage = z.infer<typeof WorkspacePackageSchema>;
|
|
98
|
+
export const WorkspaceDepTypeSchema = z.enum(["prod", "dev", "peer"]);
|
|
99
|
+
export type WorkspaceDepType = z.infer<typeof WorkspaceDepTypeSchema>;
|
|
100
|
+
// A workspace-internal dependency edge: `from` DEPENDS ON `to` (from's package.json lists to), typed by which
|
|
101
|
+
// dependency block declared it. Pure data, layout/direction is the client's concern.
|
|
102
|
+
export const WorkspaceDepEdgeSchema = z.object({
|
|
103
|
+
from: z.string().describe("The package that depends."),
|
|
104
|
+
to: z.string().describe("The package it depends on."),
|
|
105
|
+
type: WorkspaceDepTypeSchema.describe("Which kind of dependency declared it."),
|
|
106
|
+
});
|
|
107
|
+
export type WorkspaceDepEdge = z.infer<typeof WorkspaceDepEdgeSchema>;
|
|
108
|
+
export const WorkspaceGraphSchema = z.object({
|
|
109
|
+
packages: z.array(WorkspacePackageSchema).describe("Every package in the repository."),
|
|
110
|
+
edges: z.array(WorkspaceDepEdgeSchema).describe("Which of them use which. Pure data: how to lay it out is yours to decide."),
|
|
111
|
+
});
|
|
112
|
+
export type WorkspaceGraph = z.infer<typeof WorkspaceGraphSchema>;
|
|
113
|
+
// Path params for the per-repo apps routes: the monorepo name (validated in the handler like PanelRepoParam)
|
|
114
|
+
// and, for per-app preview control (start/stop), the app key (api/web/landing).
|
|
115
|
+
export const RepoAppsParamSchema = z.object({ repo: z.string().describe("Which repository.") });
|
|
116
|
+
export const AppParamSchema = z.object({
|
|
117
|
+
repo: z.string().describe("Which repository."),
|
|
118
|
+
app: z
|
|
119
|
+
.string()
|
|
120
|
+
.min(1)
|
|
121
|
+
.regex(/^[a-z][a-z0-9-]*$/)
|
|
122
|
+
.describe("Which app inside it."),
|
|
123
|
+
});
|