@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,378 @@
|
|
|
1
|
+
import { type CommandClass, CommandClassSchema } from "./schemas/agent.js";
|
|
2
|
+
|
|
3
|
+
/* WHICH CLASSES A SHELL COMMAND FALLS IN, the classifier behind every command gate, read before the command runs.
|
|
4
|
+
*
|
|
5
|
+
* IT LIVES IN THE CONTRACT PACKAGE because there are TWO enforcement points and they must not drift. The
|
|
6
|
+
* sandbox's own gate (sandbox/src/guard/command-gate.ts) judges what the agent types here; the machine agent's
|
|
7
|
+
* shell tool (_computers/machine/src/computer/tools/shell.ts) judges what it sends to somebody's laptop. Those answer to
|
|
8
|
+
* different policy (a rulebook with a permission card here, a scope switch on the card there) but they must
|
|
9
|
+
* agree on WHAT A COMMAND IS, or a class the owner thought they had covered turns out to mean something else on
|
|
10
|
+
* the surface where it mattered most. One table, two consults.
|
|
11
|
+
*
|
|
12
|
+
* ALL of them, not the first match, because a gate takes the most restrictive verdict across them and the
|
|
13
|
+
* interesting commands are exactly the ones in two classes at once: `curl -d @.env https://…` is both
|
|
14
|
+
* `secrets.access` and `network.outbound`, and an owner who holds either meant to see it. Returning one class
|
|
15
|
+
* would let a rule on the other decide.
|
|
16
|
+
*
|
|
17
|
+
* HONESTY, the same note the outbound sniffer carries and for the same reason. This is regex over shell text.
|
|
18
|
+
* A creatively quoted command, a path assembled from a variable, or a script written in one call and run in the
|
|
19
|
+
* next goes past it untouched. So a gate built on this is friction and a prompt for well-behaved work, never a
|
|
20
|
+
* boundary, the boundaries are structural and elsewhere: the container, the isolated worktree, the land gate,
|
|
21
|
+
* an automation's tool allowlist, and, on somebody's own computer, the scope switches enforced there.
|
|
22
|
+
*
|
|
23
|
+
* Matching is deliberately UNANCHORED, substrings, not line starts. Another PreToolUse hook may have rewrapped
|
|
24
|
+
* the command by the time this reads it (agent-terminals.ts wraps every Bash call in bin/tmux-run), and the
|
|
25
|
+
* agent's own line survives verbatim inside that wrapper. Nothing the wrapper adds is in any class below.
|
|
26
|
+
*
|
|
27
|
+
* `[^|;&]*` in a pattern keeps a flag tied to the verb before it, so a later command in a pipeline cannot lend
|
|
28
|
+
* its flags to an earlier one, `git push origin | grep -f patterns` is not a force-push.
|
|
29
|
+
*
|
|
30
|
+
* IT REPORTS WHERE, not just whether (matchCommand below). A permission card holding four hundred characters of
|
|
31
|
+
* shell has to answer one question before anything else on it can be read: which part of this is the part that
|
|
32
|
+
* stopped it. That answer only exists here, at the moment a pattern fires, and re-deriving it in the browser
|
|
33
|
+
* would be a second classifier with all the ways to disagree with this one. So every table hands back offsets
|
|
34
|
+
* and the card marks them; `classifyCommand` is the same walk with the offsets dropped.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
// A half-open slice of the command text, in UTF-16 code units, the offsets a renderer slices with.
|
|
38
|
+
export interface CommandSpan {
|
|
39
|
+
readonly start: number;
|
|
40
|
+
readonly end: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// One class the command fell in, and the fragments that put it there. `spans` is never empty: a class with
|
|
44
|
+
// nothing to point at is a class this walk does not report.
|
|
45
|
+
export interface CommandMatch {
|
|
46
|
+
readonly commandClass: CommandClass;
|
|
47
|
+
readonly spans: readonly CommandSpan[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* The `g` twin of a table's patterns, built once. The tables are written WITHOUT `g` because a lastIndex that
|
|
51
|
+
* survives a call is the classic way a shared regex starts skipping every other match, and `test` is what the
|
|
52
|
+
* verdict path wants. `matchAll` demands one, so the twins live here instead of being flagged in place.
|
|
53
|
+
* (`matchAll` clones the regex it is given, so these stay stateless too.) */
|
|
54
|
+
const globally = (patterns: readonly RegExp[]): readonly RegExp[] => patterns.map((pattern) => new RegExp(pattern.source, `${pattern.flags}g`));
|
|
55
|
+
|
|
56
|
+
// Every occurrence of every pattern, as spans over `command`. The WHOLE match, not a capture group: a pattern
|
|
57
|
+
// here is written to span the consequence (`git push … --force`, `curl … https://`), and cutting it back to a
|
|
58
|
+
// group would point at the flag while leaving the verb it belongs to unmarked.
|
|
59
|
+
const spansOf = (patterns: readonly RegExp[], command: string): CommandSpan[] =>
|
|
60
|
+
patterns.flatMap((pattern) => [...command.matchAll(pattern)].map((match) => ({ start: match.index, end: match.index + match[0].length })));
|
|
61
|
+
|
|
62
|
+
/* Sorted, with overlaps folded together. Two patterns firing on one fragment is ordinary here (a script's
|
|
63
|
+
* recursive delete matches both the with-a-literal-path pattern and the any-path one), and handing a renderer
|
|
64
|
+
* overlapping ranges makes it either double-paint or reinvent this. Adjacency is NOT merged: touching spans
|
|
65
|
+
* from genuinely different fragments read correctly as two marks. */
|
|
66
|
+
const normalize = (spans: readonly CommandSpan[]): CommandSpan[] => {
|
|
67
|
+
const merged: CommandSpan[] = [];
|
|
68
|
+
for (const span of [...spans].sort((left, right) => left.start - right.start || left.end - right.end)) {
|
|
69
|
+
const last = merged.at(-1);
|
|
70
|
+
if (last !== undefined && span.start < last.end) {
|
|
71
|
+
merged[merged.length - 1] = { start: last.start, end: Math.max(last.end, span.end) };
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
merged.push(span);
|
|
75
|
+
}
|
|
76
|
+
return merged;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const GIT_DESTRUCTIVE = [
|
|
80
|
+
/\bgit\s+push\b[^|;&]*\s(?:-f\b|--force\b|--force-with-lease\b|--delete\b)/,
|
|
81
|
+
/\bgit\s+reset\b[^|;&]*\s--hard\b/,
|
|
82
|
+
// Any `clean` that forces: it deletes untracked files, which is work no history holds a copy of.
|
|
83
|
+
/\bgit\s+clean\b[^|;&]*\s-{1,2}[a-zA-Z]*f/,
|
|
84
|
+
/\bgit\s+branch\b[^|;&]*\s(?:-D\b|--delete\s+--force\b|--force\s+--delete\b)/,
|
|
85
|
+
/\bgit\s+filter-branch\b/,
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
const SECRETS_ACCESS = [
|
|
89
|
+
/* The reference exit, which is a credential READ by another name: `{{secret:NAME}}` in a command becomes
|
|
90
|
+
* the real value on the way into the process (agent/agent-secrets.ts), so a command carrying one belongs in
|
|
91
|
+
* this class whatever else it does. Without it the outside-content floor in guard/actions.ts is bypassed by
|
|
92
|
+
* writing a reference into a curl instead of reading a dotenv, which is the shorter route to the same
|
|
93
|
+
* place: `curl -d @.env` is held, `curl -d '{"t":"{{secret:X}}"}'` was not. The alphabet is REFERENCE's,
|
|
94
|
+
* from secrets/secret-registry.ts, respelled rather than imported to keep this table free of a dependency
|
|
95
|
+
* on the stores it describes. */
|
|
96
|
+
/\{\{secret:[A-Za-z0-9_./-]+\}\}/,
|
|
97
|
+
/* A dotenv file: `.env`, `.env.production`, `-d @.env`. NOT the checked-in templates that sit beside it in
|
|
98
|
+
* every repo, and not `process.env`, the lookbehind is what excludes the latter, which is otherwise the
|
|
99
|
+
* single most common string in this workspace's own commands and would hold every grep for it. */
|
|
100
|
+
/(?<![\w.])\.env(?!\.(?:example|sample|template))(?:\.[\w-]+)?\b/,
|
|
101
|
+
/\.ssh\//,
|
|
102
|
+
/\bid_(?:rsa|dsa|ecdsa|ed25519)\b/,
|
|
103
|
+
/\.aws\/credentials\b/,
|
|
104
|
+
/\.npmrc\b/,
|
|
105
|
+
/\.git-credentials\b/,
|
|
106
|
+
/\.credentials\.json\b/,
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
const PACKAGE_PUBLISH = [
|
|
110
|
+
/\b(?:npm|pnpm|yarn|bun)\s+publish\b/,
|
|
111
|
+
/\bcargo\s+publish\b/,
|
|
112
|
+
/\bgh\s+release\s+create\b/,
|
|
113
|
+
/\bdocker\s+push\b/,
|
|
114
|
+
/\btwine\s+upload\b/,
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
/* The loopback hosts, as a WHOLE HOST rather than a prefix. `localhost\b` reads as an exemption for
|
|
118
|
+
* `localhost.attacker.com`, because a `.` is a word boundary, and for `localhost@attacker.com`, where the
|
|
119
|
+
* loopback name is a URL's userinfo and curl connects to whatever follows the `@`. Either one is a host an
|
|
120
|
+
* attacker registers, so a prefix test hands it the exemption meant for this container talking to itself, and
|
|
121
|
+
* with it the outside-content envelope and the turn's taint bit: outsideSourceOf (guard/outside-results.ts) is
|
|
122
|
+
* built on this class, so a response judged loopback is never wrapped and never marks the turn. The trailing
|
|
123
|
+
* lookahead is what makes it a whole host, the port is optional, and a URL's authority can only end at one of
|
|
124
|
+
* `/?#`, whitespace, or a closing quote. */
|
|
125
|
+
const LOOPBACK = String.raw`(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])(?::\d+)?(?=[/?#\s'"\x60]|$)`;
|
|
126
|
+
|
|
127
|
+
// The sandbox talks to itself over loopback constantly, the host bridge, a dev server the agent just started,
|
|
128
|
+
// and none of that leaves the container, so the class is about reaching OUT rather than about curl.
|
|
129
|
+
const NETWORK_OUTBOUND = [
|
|
130
|
+
new RegExp(String.raw`\b(?:curl|wget)\b[^|;&]*\bhttps?://(?!${LOOPBACK})`),
|
|
131
|
+
/* The JS execution backend's curl: a literal non-loopback URL handed to `fetch(`. The classifier reads
|
|
132
|
+
* scripts with the same substring honesty it reads shell (the gate feeds it both, see command-gate's
|
|
133
|
+
* EXECUTION_SOURCES), so an owner's rule about reaching out covers both ways of doing it, and the
|
|
134
|
+
* outside-content seam wraps what a fetching script brings back exactly as it wraps a fetching curl's. A
|
|
135
|
+
* URL assembled at runtime walks past this, as the header already admits for shell variables. */
|
|
136
|
+
new RegExp(String.raw`\bfetch\(\s*['"\x60]https?://(?!${LOOPBACK})`),
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
/* --- rm, parsed once ------------------------------------------------------------------------------------
|
|
140
|
+
*
|
|
141
|
+
* ONE PARSE, TWO CLASSES. `rm -rf build` and `rm -rf /` are the same verb with the same flags and wildly
|
|
142
|
+
* different consequences, and the whole reason the second is a class of its own is that its default differs:
|
|
143
|
+
* deleting a build directory is ordinary work in a disposable container, and deleting the root it sits in is
|
|
144
|
+
* the thing nothing here undoes. Splitting them needs the OPERANDS, not just the flags, so the invocation is
|
|
145
|
+
* taken apart once and both classes read the same result rather than two regexes drifting apart.
|
|
146
|
+
*
|
|
147
|
+
* An invocation ends at a pipeline separator: everything after `|`, `;`, `&`, or a newline belongs to the next
|
|
148
|
+
* command and must not be read as this one's targets. */
|
|
149
|
+
const RM_INVOCATION = /\brm\s+([^|;&\n]*)/g;
|
|
150
|
+
|
|
151
|
+
interface RmInvocation {
|
|
152
|
+
readonly recursive: boolean;
|
|
153
|
+
readonly force: boolean;
|
|
154
|
+
readonly operands: readonly string[];
|
|
155
|
+
// Where this invocation sits in the command, so a card can point at `rm -rf /work` rather than at the whole
|
|
156
|
+
// line it was buried in. The invocation as matched, verb through last operand.
|
|
157
|
+
readonly span: CommandSpan;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// A shell word with its quoting removed, so `"/work"`, `'/work'` and `/work` are one operand and not three.
|
|
161
|
+
const unquote = (word: string): string => word.replace(/^['"`]|['"`]$/g, "");
|
|
162
|
+
|
|
163
|
+
const parseRm = (command: string): RmInvocation[] => {
|
|
164
|
+
const parsed: RmInvocation[] = [];
|
|
165
|
+
for (const invocation of command.matchAll(RM_INVOCATION)) {
|
|
166
|
+
let recursive = false;
|
|
167
|
+
let force = false;
|
|
168
|
+
const operands: string[] = [];
|
|
169
|
+
for (const word of (invocation[1] as string).trim().split(/\s+/)) {
|
|
170
|
+
if (word === "") {
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
// A long flag is one whole word; a short cluster is a bag of letters. `--force` must not be read as
|
|
174
|
+
// the letters f-o-r-c-e, or every `rm --force` would look recursive too.
|
|
175
|
+
if (word.startsWith("--")) {
|
|
176
|
+
recursive ||= word === "--recursive";
|
|
177
|
+
force ||= word === "--force";
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (word.startsWith("-")) {
|
|
181
|
+
recursive ||= /[rR]/.test(word);
|
|
182
|
+
force ||= word.includes("f");
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
operands.push(unquote(word));
|
|
186
|
+
}
|
|
187
|
+
parsed.push({ recursive, force, operands, span: { start: invocation.index, end: invocation.index + invocation[0].trimEnd().length } });
|
|
188
|
+
}
|
|
189
|
+
return parsed;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/* A TARGET THAT IS A ROOT RATHER THAN SOMETHING INSIDE ONE. This is the whole difference between the two
|
|
193
|
+
* deletion classes, so it is deliberately a short, closed list of whole names rather than a clever heuristic:
|
|
194
|
+
* the filesystem root and the top-level directories an OS keeps, the two trees this product keeps state in, a
|
|
195
|
+
* home directory however it is spelled, and a Windows drive.
|
|
196
|
+
*
|
|
197
|
+
* `/tmp` is deliberately absent. It is scratch by definition and emptying it is a chore, not an incident. */
|
|
198
|
+
const ROOT_DIRECTORIES = new Set([
|
|
199
|
+
// The empty string is what the filesystem root normalizes to, see trimTarget.
|
|
200
|
+
"",
|
|
201
|
+
"/work",
|
|
202
|
+
"/history",
|
|
203
|
+
"/home",
|
|
204
|
+
"/root",
|
|
205
|
+
"/etc",
|
|
206
|
+
"/usr",
|
|
207
|
+
"/var",
|
|
208
|
+
"/opt",
|
|
209
|
+
"/boot",
|
|
210
|
+
"/bin",
|
|
211
|
+
"/sbin",
|
|
212
|
+
"/lib",
|
|
213
|
+
"/lib64",
|
|
214
|
+
"/srv",
|
|
215
|
+
"/dev",
|
|
216
|
+
"/sys",
|
|
217
|
+
"/proc",
|
|
218
|
+
"/mnt",
|
|
219
|
+
"/media",
|
|
220
|
+
"/Users",
|
|
221
|
+
"/Applications",
|
|
222
|
+
"/System",
|
|
223
|
+
"/Library",
|
|
224
|
+
]);
|
|
225
|
+
|
|
226
|
+
const HOME_ALIAS = /^(?:~|\$HOME|\$\{HOME\}|%USERPROFILE%)$/;
|
|
227
|
+
const WINDOWS_DRIVE = /^[A-Za-z]:$/;
|
|
228
|
+
|
|
229
|
+
/* `/work`, `/work/` and `/work/*` are one target said three ways: a trailing separator or wildcard says
|
|
230
|
+
* "everything in it", which is what deleting the directory means anyway. A BARE `*` is left alone on purpose,
|
|
231
|
+
* it is relative to whatever the shell is standing in, and `rm -rf *` in a build directory is the ordinary
|
|
232
|
+
* case this class exists to stay out of the way of. */
|
|
233
|
+
const trimTarget = (operand: string): string => operand.replace(/[/\\]\*+$/, "").replace(/[/\\]+$/, "");
|
|
234
|
+
|
|
235
|
+
const isRootTarget = (operand: string): boolean => {
|
|
236
|
+
const target = trimTarget(operand);
|
|
237
|
+
if (HOME_ALIAS.test(target) || WINDOWS_DRIVE.test(target)) {
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
// Only an absolute path can name a root, and `""` is the root itself. A relative path is inside whatever
|
|
241
|
+
// the shell is standing in, which this cannot know and must not guess about.
|
|
242
|
+
return target === "" ? operand.startsWith("/") || operand.startsWith("\\") : ROOT_DIRECTORIES.has(target);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
/* --- the JS execution backend's own deletes -------------------------------------------------------------
|
|
246
|
+
*
|
|
247
|
+
* THE SAME CONSEQUENCE, SPELLED IN NODE. The gate feeds this classifier the `mcp__code__run` script as well as
|
|
248
|
+
* the shell line (command-gate's EXECUTION_SOURCES), so `execSync("rm -rf /work")` inside a script already
|
|
249
|
+
* lands in the shell patterns above by substring. `fs.rmSync("/work", { recursive: true, force: true })` did
|
|
250
|
+
* not, and it is the shorter way to write the same afternoon's worth of lost work: the rule an owner wrote
|
|
251
|
+
* about deleting recursively has to mean the same thing on both backends or it does not mean much.
|
|
252
|
+
*
|
|
253
|
+
* RECURSIVE ALONE IS ENOUGH HERE, where the shell form needs recursive AND force. That is not an inconsistency:
|
|
254
|
+
* `rm -r` without `-f` stops on the first prompt and a script has no terminal to answer one, so the shell's
|
|
255
|
+
* recoverable spelling really is recoverable. `fs.rm(p, { recursive: true })` prompts nobody and deletes the
|
|
256
|
+
* tree, so the recoverable spelling does not exist on this side.
|
|
257
|
+
*
|
|
258
|
+
* TWO PATTERNS PER SPELLING, and the split matters: whether the script deletes recursively AT ALL is a
|
|
259
|
+
* different question from WHICH PATH it deletes, and only the first can be answered when the path is a
|
|
260
|
+
* variable. `rm(target, { recursive: true })` is files.destructive with no literal to read, and demanding one
|
|
261
|
+
* (as the first draft did) let exactly the ordinary way of writing it through.
|
|
262
|
+
*
|
|
263
|
+
* The header's honesty note applies here too, and one limit is worth naming: `[^)]*` cannot cross a closing
|
|
264
|
+
* paren, so `fs.rmSync(join(a, b), { recursive: true })` walks past. Same class of gap as a shell path built
|
|
265
|
+
* from a variable, and the same answer: this is friction for well-behaved work, not a boundary. */
|
|
266
|
+
const NODE_RECURSIVE_RM = /\b(?:rm|rmSync|rmdir|rmdirSync)\s*\([^)]*?recursive\s*:\s*true/;
|
|
267
|
+
const NODE_RECURSIVE_RM_PATH = /\b(?:rm|rmSync|rmdir|rmdirSync)\s*\(\s*(['"`])([^'"`]*)\1[^)]*?recursive\s*:\s*true/g;
|
|
268
|
+
// rimraf's whole purpose is the recursive force delete, so the call itself is the match; no options to read.
|
|
269
|
+
const RIMRAF = /\brimraf(?:\.sync|Sync|\.native|\.rimraf)?\s*\(/;
|
|
270
|
+
const RIMRAF_PATH = /\brimraf(?:\.sync|Sync|\.native|\.rimraf)?\s*\(\s*(['"`])([^'"`]*)\1/g;
|
|
271
|
+
|
|
272
|
+
// Where a script deletes a tree, however the path reaches it. Empty ⇒ it does not.
|
|
273
|
+
const recursiveDeletes = (program: string): CommandSpan[] => spansOf(globally([NODE_RECURSIVE_RM, RIMRAF]), program);
|
|
274
|
+
|
|
275
|
+
/* The literal paths a script hands to a recursive delete, each with the call it sits in. Empty when every path
|
|
276
|
+
* it deletes is computed, which is the honest answer rather than a guess: the class above already holds, only
|
|
277
|
+
* the root question goes unasked.
|
|
278
|
+
*
|
|
279
|
+
* The two `_PATH` patterns are already global, so they are used directly; matchAll clones them either way. */
|
|
280
|
+
const nodeDeleteTargets = (program: string): { readonly target: string; readonly span: CommandSpan }[] =>
|
|
281
|
+
[...program.matchAll(NODE_RECURSIVE_RM_PATH), ...program.matchAll(RIMRAF_PATH)].map((match) => ({
|
|
282
|
+
target: match[2] as string,
|
|
283
|
+
span: { start: match.index, end: match.index + match[0].length },
|
|
284
|
+
}));
|
|
285
|
+
|
|
286
|
+
/* --- state nothing brings back -------------------------------------------------------------------------
|
|
287
|
+
*
|
|
288
|
+
* THE CLASS WITH A FLOOR UNDER IT (guard/actions.ts commandRun holds it even where the owner wrote no rule),
|
|
289
|
+
* so its membership is chosen against a hard question: does anything in this product bring the state back?
|
|
290
|
+
*
|
|
291
|
+
* A worktree is restored from git, a checkpoint restores the tree, a container is recreated from its image,
|
|
292
|
+
* an npm package is re-installed. None of that reaches a formatted disk, a deleted Docker volume, or a home
|
|
293
|
+
* directory that is no longer there. Those are the members. Deliberately NOT members: `docker rm` (recreate
|
|
294
|
+
* it), `docker image prune` (pull it again), `git reset --hard` (that is git.destructive, and the reflog has
|
|
295
|
+
* it), `rm -rf node_modules` (install it again). The point of a floor is that it is rare enough to be worth
|
|
296
|
+
* stopping for; a floor that fires on ordinary work is one people learn to click through. */
|
|
297
|
+
const SYSTEM_DESTRUCTIVE = [
|
|
298
|
+
// Format, wipe or overwrite a block device. `dd` only counts when it is pointed AT a device: reading one
|
|
299
|
+
// into a file is how an image is taken, and holding a backup would be exactly the wrong lesson.
|
|
300
|
+
/\bmkfs(?:\.\w+)?\b/,
|
|
301
|
+
/\bwipefs\b/,
|
|
302
|
+
/\bblkdiscard\b/,
|
|
303
|
+
/\bsgdisk\b[^|;&]*\s(?:--zap-all|-Z)\b/,
|
|
304
|
+
/\bdd\b[^|;&]*\bof=(?:\/dev\/|['"`]\/dev\/)/,
|
|
305
|
+
/\bshred\b[^|;&]*\s\/dev\//,
|
|
306
|
+
// A redirect straight onto a disk device, which is the same wipe without the ceremony.
|
|
307
|
+
/>\s*\/dev\/(?:[shv]d[a-z]|nvme\d|disk\d|mmcblk\d)/,
|
|
308
|
+
/* Docker state that is data rather than image. A named volume IS the database; `system prune` takes every
|
|
309
|
+
* unused one with it, and `compose down -v` is the spelling people reach for without reading the flag.
|
|
310
|
+
* In this sandbox these hit the nested engine (the host's socket is never mounted, see
|
|
311
|
+
* capabilities/handlers/docker.ts), so the blast radius is the dev databases the agent has been working
|
|
312
|
+
* against. Sent to somebody's own computer through the host agent, it is whatever they run on it. */
|
|
313
|
+
/\b(?:docker|podman)\s+volume\s+(?:rm|remove|prune)\b/,
|
|
314
|
+
/\b(?:docker|podman)\s+system\s+prune\b/,
|
|
315
|
+
/\b(?:docker(?:\s+compose|-compose)?|podman-compose)\s+down\b[^|;&]*\s(?:-v\b|--volumes\b)/,
|
|
316
|
+
];
|
|
317
|
+
|
|
318
|
+
const recursiveForceRms = (command: string): CommandSpan[] =>
|
|
319
|
+
parseRm(command)
|
|
320
|
+
.filter((invocation) => invocation.recursive && invocation.force)
|
|
321
|
+
.map((invocation) => invocation.span);
|
|
322
|
+
|
|
323
|
+
// A recursive delete aimed at a root, in either spelling the gate can be handed: the shell's `rm -rf /` and
|
|
324
|
+
// the script's `fs.rmSync("/", { recursive: true })`.
|
|
325
|
+
const rootDeletes = (program: string): CommandSpan[] => [
|
|
326
|
+
...parseRm(program)
|
|
327
|
+
.filter((invocation) => invocation.recursive && invocation.force && invocation.operands.some(isRootTarget))
|
|
328
|
+
.map((invocation) => invocation.span),
|
|
329
|
+
...nodeDeleteTargets(program)
|
|
330
|
+
.filter((delete_) => isRootTarget(delete_.target))
|
|
331
|
+
.map((delete_) => delete_.span),
|
|
332
|
+
];
|
|
333
|
+
|
|
334
|
+
// The `g` twins, built once at load rather than per call: a card is minted per held command and a classify runs
|
|
335
|
+
// per command the agent types, so recompiling six tables of patterns each time is work with no reader.
|
|
336
|
+
const GIT_DESTRUCTIVE_G = globally(GIT_DESTRUCTIVE);
|
|
337
|
+
const SECRETS_ACCESS_G = globally(SECRETS_ACCESS);
|
|
338
|
+
const PACKAGE_PUBLISH_G = globally(PACKAGE_PUBLISH);
|
|
339
|
+
const NETWORK_OUTBOUND_G = globally(NETWORK_OUTBOUND);
|
|
340
|
+
const SYSTEM_DESTRUCTIVE_G = globally(SYSTEM_DESTRUCTIVE);
|
|
341
|
+
|
|
342
|
+
// WHERE each class fires, one entry per class. Empty ⇒ the command is not in it, so membership and evidence are
|
|
343
|
+
// the same walk and cannot disagree: there is no way to be held for a class with nothing to show for it.
|
|
344
|
+
const MATCHES: Readonly<Record<CommandClass, (command: string) => CommandSpan[]>> = {
|
|
345
|
+
"git.destructive": (command) => spansOf(GIT_DESTRUCTIVE_G, command),
|
|
346
|
+
"files.destructive": (command) => [...recursiveForceRms(command), ...recursiveDeletes(command)],
|
|
347
|
+
"system.destructive": (command) => [...spansOf(SYSTEM_DESTRUCTIVE_G, command), ...rootDeletes(command)],
|
|
348
|
+
"secrets.access": (command) => spansOf(SECRETS_ACCESS_G, command),
|
|
349
|
+
"package.publish": (command) => spansOf(PACKAGE_PUBLISH_G, command),
|
|
350
|
+
"network.outbound": (command) => spansOf(NETWORK_OUTBOUND_G, command),
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
/* Every class the command falls in AND the fragments that put it there, in the catalog's own order so a card and
|
|
354
|
+
* a log name them the same way twice. The primitive; classifyCommand is this with the offsets dropped. */
|
|
355
|
+
export const matchCommand = (command: string): CommandMatch[] =>
|
|
356
|
+
CommandClassSchema.options.flatMap((commandClass) => {
|
|
357
|
+
const spans = normalize(MATCHES[commandClass](command));
|
|
358
|
+
return spans.length === 0 ? [] : [{ commandClass, spans }];
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
// Every class the command falls in, for the callers that only take a verdict from it (the gate's rulebook
|
|
362
|
+
// consult, the machine agent's scope switch).
|
|
363
|
+
export const classifyCommand = (command: string): CommandClass[] => matchCommand(command).map((match) => match.commandClass);
|
|
364
|
+
|
|
365
|
+
// What the card says the command would DO. The class name is a settings key, not a sentence to show a person.
|
|
366
|
+
export const COMMAND_CLASS_LABELS: Readonly<Record<CommandClass, string>> = {
|
|
367
|
+
"git.destructive": "rewrite or discard git history",
|
|
368
|
+
"files.destructive": "delete files recursively",
|
|
369
|
+
"system.destructive": "wipe a disk, a container volume, or a whole home or root directory",
|
|
370
|
+
"secrets.access": "read credential material",
|
|
371
|
+
"package.publish": "publish or release a package",
|
|
372
|
+
"network.outbound": "send a request out to the internet",
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
/* THE CLASSES THE DAEMON HOLDS WHERE THE OWNER WROTE NO RULE, and the machine agent refuses without its own
|
|
376
|
+
* switch. Named here rather than at either consult, so "which commands are dangerous enough to stop by
|
|
377
|
+
* default" has one answer that both enforcement points read. */
|
|
378
|
+
export const FLOOR_CLASSES: ReadonlySet<CommandClass> = new Set<CommandClass>(["system.destructive"]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
-
import { ActivityListSchema, ActivityQuerySchema, ActivityStatusSchema } from "../schemas.js";
|
|
2
|
+
import { ActivityListSchema, ActivityQuerySchema, ActivityStatusSchema } from "../schemas/activity.js";
|
|
3
3
|
|
|
4
4
|
// The activity audit feed (provider-agnostic; Discord is the first source). Read-only by design,
|
|
5
5
|
// events are appended daemon-side only, so the log stays a trustworthy record of what the agent did.
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { eventIterator, oc } from "@orpc/contract";
|
|
2
2
|
import { AgentCommandsQuerySchema, AgentCommandsSchema, AttachFrameSchema } from "../events.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
OkSchema,
|
|
8
|
-
ProviderRefusalsSchema,
|
|
9
|
-
ResumeTurnSchema,
|
|
10
|
-
RewindResultSchema,
|
|
11
|
-
RewindTurnSchema,
|
|
12
|
-
StartedTurnSchema,
|
|
13
|
-
SteerSchema,
|
|
14
|
-
StopTurnSchema,
|
|
15
|
-
} from "../schemas.js";
|
|
3
|
+
import { AgentTurnSchema, AttachTurnSchema, StartedTurnSchema } from "../schemas/agent.js";
|
|
4
|
+
import { RewindResultSchema, RewindTurnSchema } from "../schemas/history.js";
|
|
5
|
+
import { AgentReplySchema, ProviderRefusalsSchema, ResumeTurnSchema, SteerSchema, StopTurnSchema } from "../schemas/plan-limits.js";
|
|
6
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
16
7
|
|
|
17
8
|
// A turn EXECUTES as a detached daemon-side run: `run` starts it and acks with the run id; any number of
|
|
18
9
|
// clients render it via `attach` (replay from a seq cursor, then live), the initiating window holds no
|
|
@@ -3,7 +3,6 @@ import { AgentTranscriptSchema } from "../events.js";
|
|
|
3
3
|
import {
|
|
4
4
|
AgentArchiveSchema,
|
|
5
5
|
AgentAutoLandSchema,
|
|
6
|
-
AgentChangesSchema,
|
|
7
6
|
AgentFileDiffQuerySchema,
|
|
8
7
|
AgentIdSchema,
|
|
9
8
|
AgentIdsSchema,
|
|
@@ -11,17 +10,18 @@ import {
|
|
|
11
10
|
AgentPlaceSchema,
|
|
12
11
|
AgentRenameSchema,
|
|
13
12
|
AgentResumeAfterOutageSchema,
|
|
13
|
+
AgentsArchivedSchema,
|
|
14
14
|
AgentSearchQuerySchema,
|
|
15
15
|
AgentSearchResultSchema,
|
|
16
|
-
AgentsArchivedSchema,
|
|
17
|
-
AgentsListSchema,
|
|
18
16
|
AgentsMovedSchema,
|
|
19
17
|
AgentsRemovedSchema,
|
|
20
18
|
AgentSummarySchema,
|
|
21
|
-
FileDiffSchema,
|
|
22
19
|
LandResultSchema,
|
|
23
|
-
|
|
24
|
-
} from "../schemas.js";
|
|
20
|
+
} from "../schemas/agents.js";
|
|
21
|
+
import { AgentsListSchema } from "../schemas/automations.js";
|
|
22
|
+
import { AgentChangesSchema } from "../schemas/git.js";
|
|
23
|
+
import { FileDiffSchema } from "../schemas/history.js";
|
|
24
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
25
25
|
|
|
26
26
|
// The fleet: every registered conversation-agent (see AgentSummarySchema). Registry-level actions (read,
|
|
27
27
|
// rename, seen, archive) apply uniformly. For branch-backed conversations, `diff` is the worktree's CUMULATIVE
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
AutomationIdParamSchema,
|
|
8
8
|
AutomationSchema,
|
|
9
9
|
AutomationsListSchema,
|
|
10
|
-
|
|
11
|
-
} from "../schemas.js";
|
|
10
|
+
} from "../schemas/automations.js";
|
|
11
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
12
12
|
|
|
13
13
|
// The sandbox's automations manifest (scheduled agent wake-ups). `list` returns each automation with its recent
|
|
14
14
|
// runs + next fire time. `upsert` adds or edits by id (nothing to provision, the scheduler picks it up on its
|
|
@@ -12,10 +12,9 @@ import {
|
|
|
12
12
|
CapabilitySchema,
|
|
13
13
|
CapabilitySecretInputSchema,
|
|
14
14
|
CapabilityStatusSchema,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} from "../schemas.js";
|
|
15
|
+
} from "../schemas/capabilities.js";
|
|
16
|
+
import { MarketplaceRequestSchema, MarketplaceSchema } from "../schemas/marketplace.js";
|
|
17
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
19
18
|
|
|
20
19
|
/* The sandbox's unified capability manifest. `list` returns each active capability with its live status, the
|
|
21
20
|
* non-secret echo of its config, and the NAMES of the credentials it holds. `add` upserts a capability and
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
-
import { ChoreLedgerWriteSchema, ChoreProbeRequestSchema, ChoresReportSchema
|
|
2
|
+
import { ChoreLedgerWriteSchema, ChoreProbeRequestSchema, ChoresReportSchema } from "../schemas/maintenance.js";
|
|
3
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
3
4
|
|
|
4
5
|
/* Maintenance evidence: what every repo under /work currently measures, and what has already been done about it.
|
|
5
6
|
* Three routes, because there are exactly three things the surface does, read the evidence, ask for a
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
CiRunParamSchema,
|
|
7
7
|
CiRunsResponseSchema,
|
|
8
8
|
CiSeenResponseSchema,
|
|
9
|
-
|
|
10
|
-
} from "../schemas.js";
|
|
9
|
+
} from "../schemas/ci.js";
|
|
10
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
11
11
|
|
|
12
12
|
// Pipelines on the workspace repos' github/gitlab remotes. `runs` serves the Pipelines rail view (cache +
|
|
13
13
|
// on-demand backfill; per-repo webhook warnings ride along); `rerun`/`cancel` proxy to the vendor; `fix`
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
OauthAccountListSchema,
|
|
8
8
|
OauthAccountSchema,
|
|
9
9
|
OauthExchangeSchema,
|
|
10
|
-
|
|
11
|
-
} from "../schemas.js";
|
|
10
|
+
} from "../schemas/provider-oauth.js";
|
|
11
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
12
12
|
|
|
13
13
|
// Claude subscription OAuth, the sandbox owns the credential. `start` hands the browser the authorize URL +
|
|
14
14
|
// PKCE material; `exchange` stores the resulting tokens as a new account and returns it; `accounts` lists the
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
CursorLoginStartSchema,
|
|
8
8
|
OauthAccountListSchema,
|
|
9
9
|
OauthAccountSchema,
|
|
10
|
-
|
|
11
|
-
} from "../schemas.js";
|
|
10
|
+
} from "../schemas/provider-oauth.js";
|
|
11
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
12
12
|
|
|
13
13
|
/* Cursor subscription sign-in, the sandbox owns the credential and the platform never sees it, the same bargain
|
|
14
14
|
* claude.contract.ts strikes. What differs is who finishes the handshake.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
-
import { DraftIdParamSchema, DraftsListSchema, DraftSummarySchema
|
|
2
|
+
import { DraftIdParamSchema, DraftsListSchema, DraftSummarySchema } from "../schemas/drafts.js";
|
|
3
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
3
4
|
|
|
4
5
|
// The sandbox's post-drafts queue (agent-proposed posts awaiting approval). The agent creates draft files
|
|
5
6
|
// directly, these routes are the OWNER's side: `list` is the approval inbox, `upsert` covers approve / edit /
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { CapabilityIdParamSchema
|
|
3
|
+
import { CapabilityIdParamSchema } from "../schemas/capabilities.js";
|
|
4
|
+
import { ModelsSchema } from "../schemas/provider-oauth.js";
|
|
4
5
|
|
|
5
6
|
// An `endpoint` capability's picker catalog, the models the configured server itself publishes, read from its
|
|
6
7
|
// own /v1/models. Every other provider's catalog is one fixed route because there is one of each; endpoints are
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { eventIterator, oc } from "@orpc/contract";
|
|
2
2
|
import { IntenticLineSchema } from "../events.js";
|
|
3
|
-
import { ExitCountriesSchema, ExitIdParamSchema, ExitListSchema, ExitObservationSchema, ExitUseInputSchema
|
|
3
|
+
import { ExitCountriesSchema, ExitIdParamSchema, ExitListSchema, ExitObservationSchema, ExitUseInputSchema } from "../schemas/exit.js";
|
|
4
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
4
5
|
|
|
5
6
|
// The live GEO EXIT surface. An exit is ADDED as an `exit` capability (which provider, a resting country,
|
|
6
7
|
// whether it comes up on boot); it is STARTED, MOVED and ROTATED here. Same split as the vpn contract and for
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import { CapabilityIdParamSchema } from "../schemas/capabilities.js";
|
|
2
3
|
import {
|
|
3
|
-
CapabilityIdParamSchema,
|
|
4
4
|
ExtensionEnabledInputSchema,
|
|
5
5
|
ExtensionProcessParamSchema,
|
|
6
6
|
ExtensionProcessStatusSchema,
|
|
7
7
|
ExtensionSettingsInputSchema,
|
|
8
8
|
ExtensionSettingsSchema,
|
|
9
|
-
|
|
9
|
+
ExtensionsListSchema,
|
|
10
10
|
ExtensionUpdateActionSchema,
|
|
11
11
|
ExtensionUpdateAppliedSchema,
|
|
12
12
|
ExtensionUpdatePolicyInputSchema,
|
|
13
13
|
ExtensionUpdatePreviewSchema,
|
|
14
14
|
ExtensionUpdatesCheckedSchema,
|
|
15
15
|
ExtensionUsageInputSchema,
|
|
16
|
-
ExtensionsListSchema,
|
|
17
|
-
OkSchema,
|
|
18
16
|
WorkspaceExtensionCreatedSchema,
|
|
19
17
|
WorkspaceExtensionCreateSchema,
|
|
20
|
-
} from "../schemas.js";
|
|
18
|
+
} from "../schemas/extension-updates.js";
|
|
19
|
+
import { ExtensionReadinessSchema } from "../schemas/maintenance.js";
|
|
20
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
21
21
|
|
|
22
22
|
// Installed extensions resolved to their approved manifests, what the web extension host boots from. The
|
|
23
23
|
// bundle itself is a plain Hono route (GET /extensions/{id}/bundle): raw ESM bytes are not an oRPC payload.
|
|
@@ -3,48 +3,49 @@ import {
|
|
|
3
3
|
CommitResultSchema,
|
|
4
4
|
CommitSchema,
|
|
5
5
|
DiscardSchema,
|
|
6
|
-
FileDiffSchema,
|
|
7
|
-
GitActionResultSchema,
|
|
8
6
|
GitBranchCreateAtSchema,
|
|
9
|
-
GitBranchCreateSchema,
|
|
10
7
|
GitBranchDeleteSchema,
|
|
11
8
|
GitBranchesSchema,
|
|
12
9
|
GitChangesSchema,
|
|
13
|
-
GitCheckoutSchema,
|
|
14
|
-
GitCommitActionSchema,
|
|
15
|
-
GitCommitDiffQuerySchema,
|
|
16
|
-
GitCommitDiffSchema,
|
|
17
|
-
GitCommitFileDiffQuerySchema,
|
|
18
10
|
GitFileDiffQuerySchema,
|
|
19
11
|
GitFileQuerySchema,
|
|
20
12
|
GitFileSchema,
|
|
21
13
|
GitFilesSchema,
|
|
22
14
|
GitFileWriteSchema,
|
|
15
|
+
GitOperationStateSchema,
|
|
16
|
+
GitRemoteStateSchema,
|
|
17
|
+
GitStageSchema,
|
|
18
|
+
GitStatusSchema,
|
|
19
|
+
PushSchema,
|
|
20
|
+
} from "../schemas/git.js";
|
|
21
|
+
import {
|
|
22
|
+
GitActionResultSchema,
|
|
23
|
+
GitBranchCreateSchema,
|
|
24
|
+
GitCheckoutSchema,
|
|
25
|
+
GitCommitActionSchema,
|
|
26
|
+
GitCommitDiffQuerySchema,
|
|
27
|
+
GitCommitDiffSchema,
|
|
28
|
+
GitCommitFileDiffQuerySchema,
|
|
23
29
|
GitLogQuerySchema,
|
|
24
30
|
GitLogSchema,
|
|
25
|
-
GitOperationStateSchema,
|
|
26
31
|
GitPublishFileResultSchema,
|
|
27
32
|
GitPublishFileSchema,
|
|
28
|
-
GitUndoSchema,
|
|
29
|
-
GitUndoStateSchema,
|
|
30
33
|
GitRemoteReposSchema,
|
|
31
|
-
GitRemoteStateSchema,
|
|
32
34
|
GitReposSchema,
|
|
33
35
|
GitResetSchema,
|
|
34
|
-
GitStageSchema,
|
|
35
|
-
GitStatusSchema,
|
|
36
36
|
GitTagCreateSchema,
|
|
37
37
|
GitTagDeleteSchema,
|
|
38
38
|
GitTagPushSchema,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
RepoParamSchema,
|
|
39
|
+
GitUndoSchema,
|
|
40
|
+
GitUndoStateSchema,
|
|
42
41
|
StashApplySchema,
|
|
43
42
|
StashDiffQuerySchema,
|
|
44
43
|
StashListSchema,
|
|
45
44
|
StashPushSchema,
|
|
46
45
|
StashRefParamSchema,
|
|
47
|
-
} from "../schemas.js";
|
|
46
|
+
} from "../schemas/git-history.js";
|
|
47
|
+
import { FileDiffSchema } from "../schemas/history.js";
|
|
48
|
+
import { OkSchema, RepoParamSchema } from "../schemas/shared.js";
|
|
48
49
|
|
|
49
50
|
// Per-repo git ops over the workspace repos: "root" (the /work repo) plus every discovered repo under /work
|
|
50
51
|
// ({repo} is the repo's root-relative dir, URL-encoded). An unknown {repo} is a handler-thrown
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
-
import { AccountIdSchema, DeviceStartSchema, OauthAccountListSchema
|
|
2
|
+
import { AccountIdSchema, DeviceStartSchema, OauthAccountListSchema } from "../schemas/provider-oauth.js";
|
|
3
|
+
import { OkSchema } from "../schemas/shared.js";
|
|
3
4
|
|
|
4
5
|
// xAI Grok (via OpenCode) uses subscription OAuth, the sandbox owns the credential (OpenCode persists the
|
|
5
6
|
// tokens and refreshes them). `start` authorizes xAI's headless device-code method and returns the verification
|