@intentic/sandbox-contract 1.247.0 → 1.249.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -15
- package/dist/chores/chores.d.ts.map +1 -1
- package/dist/chores/chores.js.map +1 -1
- package/dist/chores/digest.d.ts.map +1 -1
- package/dist/chores/digest.js.map +1 -1
- package/dist/chores/extension-update.d.ts.map +1 -1
- package/dist/chores/extension-update.js.map +1 -1
- package/dist/chores/fix-deps.d.ts.map +1 -1
- package/dist/chores/fix-deps.js.map +1 -1
- package/dist/chores/index.d.ts +2 -2
- package/dist/chores/index.d.ts.map +1 -1
- package/dist/chores/index.js +1 -1
- package/dist/chores/index.js.map +1 -1
- package/dist/chores/probes.d.ts.map +1 -1
- package/dist/chores/probes.js.map +1 -1
- package/dist/chores/prompt.d.ts.map +1 -1
- package/dist/chores/prompt.js.map +1 -1
- package/dist/chores/stack.d.ts.map +1 -1
- package/dist/chores/stack.js.map +1 -1
- package/dist/chores/verdict.d.ts +7 -1
- package/dist/chores/verdict.d.ts.map +1 -1
- package/dist/chores/verdict.js +8 -0
- package/dist/chores/verdict.js.map +1 -1
- package/dist/contracts/accounts.contract.d.ts.map +1 -1
- package/dist/contracts/accounts.contract.js.map +1 -1
- package/dist/contracts/activity.contract.d.ts +1 -0
- package/dist/contracts/activity.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.d.ts +13 -205
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.js +2 -1
- package/dist/contracts/agent.contract.js.map +1 -1
- package/dist/contracts/agents.contract.d.ts +228 -54
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +11 -2
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/automations.contract.d.ts +35 -17
- package/dist/contracts/automations.contract.d.ts.map +1 -1
- package/dist/contracts/automations.contract.js +10 -1
- package/dist/contracts/automations.contract.js.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts +0 -12
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.js +1 -1
- package/dist/contracts/capabilities.contract.js.map +1 -1
- package/dist/contracts/chores.contract.d.ts.map +1 -1
- package/dist/contracts/chores.contract.js.map +1 -1
- package/dist/contracts/ci.contract.d.ts +9 -0
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/endpoints.contract.d.ts.map +1 -1
- package/dist/contracts/endpoints.contract.js.map +1 -1
- package/dist/contracts/exit.contract.d.ts.map +1 -1
- package/dist/contracts/exit.contract.js +1 -1
- package/dist/contracts/exit.contract.js.map +1 -1
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.js.map +1 -1
- package/dist/contracts/git.contract.d.ts +45 -6
- package/dist/contracts/git.contract.d.ts.map +1 -1
- package/dist/contracts/git.contract.js +9 -9
- package/dist/contracts/git.contract.js.map +1 -1
- package/dist/contracts/host.contract.d.ts +2 -0
- package/dist/contracts/host.contract.d.ts.map +1 -1
- package/dist/contracts/host.contract.js.map +1 -1
- package/dist/contracts/intentic.contract.js +1 -1
- package/dist/contracts/intentic.contract.js.map +1 -1
- package/dist/contracts/logs.contract.d.ts.map +1 -1
- package/dist/contracts/logs.contract.js.map +1 -1
- package/dist/contracts/loops.contract.d.ts.map +1 -1
- package/dist/contracts/loops.contract.js.map +1 -1
- package/dist/contracts/personas.contract.d.ts +39 -4
- package/dist/contracts/personas.contract.d.ts.map +1 -1
- package/dist/contracts/personas.contract.js +10 -1
- package/dist/contracts/personas.contract.js.map +1 -1
- package/dist/contracts/providers.contract.d.ts.map +1 -1
- package/dist/contracts/providers.contract.js.map +1 -1
- package/dist/contracts/runner.contract.d.ts +6 -80
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.js +2 -2
- package/dist/contracts/runner.contract.js.map +1 -1
- package/dist/contracts/safety.contract.d.ts.map +1 -1
- package/dist/contracts/safety.contract.js +1 -1
- package/dist/contracts/safety.contract.js.map +1 -1
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +2 -41
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/sessions.contract.js +1 -1
- package/dist/contracts/sessions.contract.js.map +1 -1
- package/dist/contracts/settings.contract.d.ts +10 -10
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.js.map +1 -1
- package/dist/contracts/share.contract.d.ts.map +1 -1
- package/dist/contracts/share.contract.js.map +1 -1
- package/dist/contracts/skills.contract.d.ts.map +1 -1
- package/dist/contracts/skills.contract.js.map +1 -1
- package/dist/contracts/system.contract.d.ts +49 -73
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +12 -2
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/contracts/usage.contract.d.ts.map +1 -1
- package/dist/contracts/usage.contract.js.map +1 -1
- package/dist/contracts/vpn.contract.d.ts.map +1 -1
- package/dist/contracts/vpn.contract.js +1 -1
- package/dist/contracts/vpn.contract.js.map +1 -1
- package/dist/contracts/webext.contract.d.ts.map +1 -1
- package/dist/contracts/webext.contract.js.map +1 -1
- package/dist/contracts/workflows.contract.d.ts +7 -6
- package/dist/contracts/workflows.contract.d.ts.map +1 -1
- package/dist/contracts/workflows.contract.js +12 -3
- package/dist/contracts/workflows.contract.js.map +1 -1
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/events/agent-events.d.ts +1237 -0
- package/dist/events/agent-events.d.ts.map +1 -0
- package/dist/events/agent-events.js +226 -0
- package/dist/events/agent-events.js.map +1 -0
- package/dist/events/cards.d.ts +404 -0
- package/dist/events/cards.d.ts.map +1 -0
- package/dist/events/cards.js +179 -0
- package/dist/events/cards.js.map +1 -0
- package/dist/events/resume.d.ts +23 -0
- package/dist/events/resume.d.ts.map +1 -0
- package/dist/events/resume.js +31 -0
- package/dist/events/resume.js.map +1 -0
- package/dist/events/system-events.d.ts +615 -0
- package/dist/events/system-events.d.ts.map +1 -0
- package/dist/events/system-events.js +64 -0
- package/dist/events/system-events.js.map +1 -0
- package/dist/events/transcript.d.ts +1755 -0
- package/dist/events/transcript.d.ts.map +1 -0
- package/dist/events/transcript.js +205 -0
- package/dist/events/transcript.js.map +1 -0
- package/dist/ids/conversation-ids.d.ts +8 -0
- package/dist/ids/conversation-ids.d.ts.map +1 -0
- package/dist/{conversation-ids.js → ids/conversation-ids.js} +13 -0
- package/dist/ids/conversation-ids.js.map +1 -0
- package/dist/ids/hostnames.d.ts.map +1 -0
- package/dist/ids/hostnames.js.map +1 -0
- package/dist/ids/session-names.d.ts.map +1 -0
- package/dist/ids/session-names.js.map +1 -0
- package/dist/ids/share-paths.d.ts.map +1 -0
- package/dist/ids/share-paths.js.map +1 -0
- package/dist/{tunnel-ids.d.ts → ids/tunnel-ids.d.ts} +1 -0
- package/dist/ids/tunnel-ids.d.ts.map +1 -0
- package/dist/{tunnel-ids.js → ids/tunnel-ids.js} +1 -0
- package/dist/ids/tunnel-ids.js.map +1 -0
- package/dist/index.d.ts +464 -447
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -47
- package/dist/index.js.map +1 -1
- package/dist/{agent-catalog.d.ts → models/agent-catalog.d.ts} +2 -2
- package/dist/models/agent-catalog.d.ts.map +1 -0
- package/dist/models/agent-catalog.js.map +1 -0
- package/dist/models/agent-runtimes.d.ts.map +1 -0
- package/dist/models/agent-runtimes.js.map +1 -0
- package/dist/{fast-tier.d.ts → models/fast-tier.d.ts} +1 -1
- package/dist/models/fast-tier.d.ts.map +1 -0
- package/dist/models/fast-tier.js.map +1 -0
- package/dist/models/model-order.d.ts.map +1 -0
- package/dist/models/model-order.js.map +1 -0
- package/dist/{model-pins.d.ts → models/model-pins.d.ts} +2 -4
- package/dist/models/model-pins.d.ts.map +1 -0
- package/dist/models/model-pins.js +22 -0
- package/dist/models/model-pins.js.map +1 -0
- package/dist/{model-roles.d.ts → models/model-roles.d.ts} +25 -30
- package/dist/models/model-roles.d.ts.map +1 -0
- package/dist/{model-roles.js → models/model-roles.js} +30 -27
- package/dist/models/model-roles.js.map +1 -0
- package/dist/{plan-pools.d.ts → models/plan-pools.d.ts} +1 -1
- package/dist/models/plan-pools.d.ts.map +1 -0
- package/dist/models/plan-pools.js.map +1 -0
- package/dist/models/prompt-complexity.d.ts.map +1 -0
- package/dist/models/prompt-complexity.js.map +1 -0
- package/dist/models/provider-specs.d.ts.map +1 -0
- package/dist/models/provider-specs.js.map +1 -0
- package/dist/policy/approvals-execution.d.ts.map +1 -0
- package/dist/policy/approvals-execution.js.map +1 -0
- package/dist/{batch-runs.d.ts → policy/batch-runs.d.ts} +5 -1
- package/dist/policy/batch-runs.d.ts.map +1 -0
- package/dist/{batch-runs.js → policy/batch-runs.js} +10 -7
- package/dist/policy/batch-runs.js.map +1 -0
- package/dist/policy/capability-env.d.ts.map +1 -0
- package/dist/policy/capability-env.js.map +1 -0
- package/dist/policy/capability-secrets.d.ts.map +1 -0
- package/dist/policy/capability-secrets.js.map +1 -0
- package/dist/{card-status.d.ts → policy/card-status.d.ts} +2 -2
- package/dist/policy/card-status.d.ts.map +1 -0
- package/dist/{card-status.js → policy/card-status.js} +1 -5
- package/dist/policy/card-status.js.map +1 -0
- package/dist/{command-classes.d.ts → policy/command-classes.d.ts} +6 -2
- package/dist/policy/command-classes.d.ts.map +1 -0
- package/dist/{command-classes.js → policy/command-classes.js} +48 -11
- package/dist/policy/command-classes.js.map +1 -0
- package/dist/{command-run.d.ts → policy/command-run.d.ts} +1 -1
- package/dist/policy/command-run.d.ts.map +1 -0
- package/dist/policy/command-run.js.map +1 -0
- package/dist/policy/control-scopes.d.ts +16 -0
- package/dist/policy/control-scopes.d.ts.map +1 -0
- package/dist/policy/control-scopes.js +26 -0
- package/dist/policy/control-scopes.js.map +1 -0
- package/dist/policy/credential-material.d.ts.map +1 -0
- package/dist/policy/credential-material.js.map +1 -0
- package/dist/policy/needs-action.d.ts.map +1 -0
- package/dist/policy/needs-action.js.map +1 -0
- package/dist/policy/output-fields.d.ts.map +1 -0
- package/dist/policy/output-fields.js.map +1 -0
- package/dist/policy/overlay-lint.d.ts.map +1 -0
- package/dist/policy/overlay-lint.js.map +1 -0
- package/dist/policy/owner-ticket.d.ts.map +1 -0
- package/dist/{owner-ticket.js → policy/owner-ticket.js} +1 -1
- package/dist/policy/owner-ticket.js.map +1 -0
- package/dist/{safety-policy.d.ts → policy/safety-policy.d.ts} +6 -5
- package/dist/policy/safety-policy.d.ts.map +1 -0
- package/dist/{safety-policy.js → policy/safety-policy.js} +12 -12
- package/dist/policy/safety-policy.js.map +1 -0
- package/dist/policy/search-globs.d.ts.map +1 -0
- package/dist/policy/search-globs.js.map +1 -0
- package/dist/protocol/container-requirements.d.ts +20 -0
- package/dist/protocol/container-requirements.d.ts.map +1 -0
- package/dist/protocol/container-requirements.js +23 -0
- package/dist/protocol/container-requirements.js.map +1 -0
- package/dist/{host-protocol.d.ts → protocol/host-protocol.d.ts} +1 -0
- package/dist/protocol/host-protocol.d.ts.map +1 -0
- package/dist/{host-protocol.js → protocol/host-protocol.js} +1 -0
- package/dist/protocol/host-protocol.js.map +1 -0
- package/dist/protocol/ingress-contract.d.ts.map +1 -0
- package/dist/{ingress-contract.js → protocol/ingress-contract.js} +1 -1
- package/dist/protocol/ingress-contract.js.map +1 -0
- package/dist/protocol/ingress-protocol.d.ts.map +1 -0
- package/dist/protocol/ingress-protocol.js.map +1 -0
- package/dist/protocol/listener-protocol.d.ts.map +1 -0
- package/dist/{listener-protocol.js → protocol/listener-protocol.js} +1 -1
- package/dist/protocol/listener-protocol.js.map +1 -0
- package/dist/{peer-dial.d.ts → protocol/peer-dial.d.ts} +4 -1
- package/dist/protocol/peer-dial.d.ts.map +1 -0
- package/dist/{peer-dial.js → protocol/peer-dial.js} +51 -10
- package/dist/protocol/peer-dial.js.map +1 -0
- package/dist/protocol/peer-mcp-server.d.ts.map +1 -0
- package/dist/protocol/peer-mcp-server.js.map +1 -0
- package/dist/protocol/request-id.d.ts.map +1 -0
- package/dist/protocol/request-id.js.map +1 -0
- package/dist/protocol/routes.d.ts.map +1 -0
- package/dist/protocol/routes.js.map +1 -0
- package/dist/{runner-protocol.d.ts → protocol/runner-protocol.d.ts} +1 -0
- package/dist/protocol/runner-protocol.d.ts.map +1 -0
- package/dist/{runner-protocol.js → protocol/runner-protocol.js} +2 -1
- package/dist/protocol/runner-protocol.js.map +1 -0
- package/dist/protocol/sse.d.ts.map +1 -0
- package/dist/protocol/sse.js.map +1 -0
- package/dist/{terminal-protocol.d.ts → protocol/terminal-protocol.d.ts} +1 -3
- package/dist/protocol/terminal-protocol.d.ts.map +1 -0
- package/dist/protocol/terminal-protocol.js.map +1 -0
- package/dist/protocol/webext-links.d.ts.map +1 -0
- package/dist/protocol/webext-links.js.map +1 -0
- package/dist/{webext-protocol.d.ts → protocol/webext-protocol.d.ts} +1 -0
- package/dist/protocol/webext-protocol.d.ts.map +1 -0
- package/dist/{webext-protocol.js → protocol/webext-protocol.js} +1 -0
- package/dist/protocol/webext-protocol.js.map +1 -0
- package/dist/schemas/activity.d.ts +2 -0
- package/dist/schemas/activity.d.ts.map +1 -1
- package/dist/schemas/activity.js +4 -0
- package/dist/schemas/activity.js.map +1 -1
- package/dist/schemas/agent.d.ts +17 -4
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +21 -4
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents.d.ts +17 -4
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +15 -4
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/approvals.d.ts.map +1 -1
- package/dist/schemas/approvals.js.map +1 -1
- package/dist/schemas/automations.d.ts +54 -28
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js +26 -8
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/capabilities.d.ts +0 -8
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +0 -4
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/ci.d.ts +10 -0
- package/dist/schemas/ci.d.ts.map +1 -1
- package/dist/schemas/ci.js +9 -1
- package/dist/schemas/ci.js.map +1 -1
- package/dist/schemas/codebase-health.d.ts.map +1 -1
- package/dist/schemas/codebase-health.js.map +1 -1
- package/dist/schemas/devices.d.ts +90 -0
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +10 -1
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/engines.d.ts.map +1 -1
- package/dist/schemas/engines.js.map +1 -1
- package/dist/schemas/environment.d.ts.map +1 -1
- package/dist/schemas/environment.js.map +1 -1
- package/dist/schemas/exit.d.ts.map +1 -1
- package/dist/schemas/exit.js.map +1 -1
- package/dist/schemas/extension-updates.d.ts.map +1 -1
- package/dist/schemas/extension-updates.js.map +1 -1
- package/dist/schemas/git-history.d.ts.map +1 -1
- package/dist/schemas/git-history.js.map +1 -1
- package/dist/schemas/git.d.ts +80 -16
- package/dist/schemas/git.d.ts.map +1 -1
- package/dist/schemas/git.js +37 -25
- package/dist/schemas/git.js.map +1 -1
- package/dist/schemas/history.d.ts.map +1 -1
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/inventory.d.ts.map +1 -1
- package/dist/schemas/inventory.js.map +1 -1
- package/dist/schemas/issues.d.ts +0 -1
- package/dist/schemas/issues.d.ts.map +1 -1
- package/dist/schemas/issues.js +0 -1
- package/dist/schemas/issues.js.map +1 -1
- package/dist/schemas/logs.d.ts.map +1 -1
- package/dist/schemas/logs.js.map +1 -1
- package/dist/schemas/loops.d.ts.map +1 -1
- package/dist/schemas/loops.js +1 -1
- package/dist/schemas/loops.js.map +1 -1
- package/dist/schemas/maintenance.d.ts.map +1 -1
- package/dist/schemas/maintenance.js.map +1 -1
- package/dist/schemas/marketplace.d.ts +0 -4
- package/dist/schemas/marketplace.d.ts.map +1 -1
- package/dist/schemas/panels.d.ts.map +1 -1
- package/dist/schemas/panels.js.map +1 -1
- package/dist/schemas/personas.d.ts +49 -4
- package/dist/schemas/personas.d.ts.map +1 -1
- package/dist/schemas/personas.js +32 -5
- package/dist/schemas/personas.js.map +1 -1
- package/dist/schemas/plan-limits.d.ts +2 -4
- package/dist/schemas/plan-limits.d.ts.map +1 -1
- package/dist/schemas/plan-limits.js +5 -8
- package/dist/schemas/plan-limits.js.map +1 -1
- package/dist/schemas/ports.d.ts.map +1 -1
- package/dist/schemas/ports.js.map +1 -1
- package/dist/schemas/provider-oauth.d.ts.map +1 -1
- package/dist/schemas/provider-oauth.js.map +1 -1
- package/dist/schemas/provider-subscriptions.d.ts +1 -1
- package/dist/schemas/provider-subscriptions.d.ts.map +1 -1
- package/dist/schemas/provider-subscriptions.js +1 -1
- package/dist/schemas/provider-subscriptions.js.map +1 -1
- package/dist/schemas/public.d.ts.map +1 -1
- package/dist/schemas/public.js.map +1 -1
- package/dist/schemas/push.d.ts.map +1 -1
- package/dist/schemas/push.js.map +1 -1
- package/dist/schemas/secrets.d.ts.map +1 -1
- package/dist/schemas/secrets.js.map +1 -1
- package/dist/schemas/settings.d.ts +7 -5
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +18 -8
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/share.d.ts.map +1 -1
- package/dist/schemas/share.js.map +1 -1
- package/dist/schemas/shared.d.ts +4 -0
- package/dist/schemas/shared.d.ts.map +1 -1
- package/dist/schemas/shared.js +3 -0
- package/dist/schemas/shared.js.map +1 -1
- package/dist/schemas/system.d.ts +6 -0
- package/dist/schemas/system.d.ts.map +1 -1
- package/dist/schemas/system.js +10 -0
- package/dist/schemas/system.js.map +1 -1
- package/dist/schemas/terminal.d.ts.map +1 -1
- package/dist/schemas/terminal.js.map +1 -1
- package/dist/schemas/usage.d.ts.map +1 -1
- package/dist/schemas/usage.js.map +1 -1
- package/dist/schemas/vpn.d.ts.map +1 -1
- package/dist/schemas/vpn.js.map +1 -1
- package/dist/schemas/webext.d.ts.map +1 -1
- package/dist/schemas/webext.js.map +1 -1
- package/dist/schemas/workflows.d.ts +66 -9
- package/dist/schemas/workflows.d.ts.map +1 -1
- package/dist/schemas/workflows.js +6 -5
- package/dist/schemas/workflows.js.map +1 -1
- package/dist/schemas/workspace-repos.d.ts.map +1 -1
- package/dist/schemas/workspace-repos.js.map +1 -1
- package/dist/schemas/workspace-search.d.ts.map +1 -1
- package/dist/schemas/workspace-search.js.map +1 -1
- package/dist/schemas/workspace-setup.d.ts.map +1 -1
- package/dist/schemas/workspace-setup.js.map +1 -1
- package/dist/schemas/workspace-tree.d.ts.map +1 -1
- package/dist/schemas/workspace-tree.js.map +1 -1
- package/dist/state/arrival.d.ts.map +1 -0
- package/dist/{arrival.js → state/arrival.js} +1 -1
- package/dist/state/arrival.js.map +1 -0
- package/dist/state/contract-lock.d.ts.map +1 -0
- package/dist/{contract-lock.js → state/contract-lock.js} +1 -1
- package/dist/state/contract-lock.js.map +1 -0
- package/dist/{definition.d.ts → state/definition.d.ts} +21 -17
- package/dist/state/definition.d.ts.map +1 -0
- package/dist/{definition.js → state/definition.js} +4 -4
- package/dist/state/definition.js.map +1 -0
- package/dist/state/history-state.d.ts.map +1 -0
- package/dist/{history-state.js → state/history-state.js} +1 -0
- package/dist/state/history-state.js.map +1 -0
- package/dist/state/runtime-state.d.ts.map +1 -0
- package/dist/state/runtime-state.js.map +1 -0
- package/dist/state/starter.d.ts.map +1 -0
- package/dist/state/starter.js.map +1 -0
- package/dist/state/state-portability.d.ts.map +1 -0
- package/dist/state/state-portability.js.map +1 -0
- package/dist/state/versions.d.ts.map +1 -0
- package/dist/state/versions.js.map +1 -0
- package/dist/{workspace-state.d.ts → state/workspace-state.d.ts} +8 -5
- package/dist/state/workspace-state.d.ts.map +1 -0
- package/dist/{workspace-state.js → state/workspace-state.js} +25 -1
- package/dist/state/workspace-state.js.map +1 -0
- package/dist/{documents.d.ts → text/documents.d.ts} +1 -1
- package/dist/text/documents.d.ts.map +1 -0
- package/dist/{documents.js → text/documents.js} +1 -1
- package/dist/text/documents.js.map +1 -0
- package/dist/text/embed.d.ts.map +1 -0
- package/dist/text/embed.js.map +1 -0
- package/dist/text/mentions.d.ts.map +1 -0
- package/dist/text/mentions.js.map +1 -0
- package/dist/text/model-answer.d.ts +3 -0
- package/dist/text/model-answer.d.ts.map +1 -0
- package/dist/text/model-answer.js +3 -0
- package/dist/text/model-answer.js.map +1 -0
- package/dist/text/path-refs.d.ts.map +1 -0
- package/dist/text/path-refs.js.map +1 -0
- package/dist/{shell-regions.d.ts → text/shell-regions.d.ts} +1 -1
- package/dist/text/shell-regions.d.ts.map +1 -0
- package/dist/text/shell-regions.js.map +1 -0
- package/dist/text/title.d.ts.map +1 -0
- package/dist/text/title.js.map +1 -0
- package/dist/{transcript-fold.d.ts → text/transcript-fold.d.ts} +2 -1
- package/dist/text/transcript-fold.d.ts.map +1 -0
- package/dist/{transcript-fold.js → text/transcript-fold.js} +2 -16
- package/dist/text/transcript-fold.js.map +1 -0
- package/dist/text/whisper.d.ts +3 -0
- package/dist/text/whisper.d.ts.map +1 -0
- package/dist/text/whisper.js +11 -0
- package/dist/text/whisper.js.map +1 -0
- package/dist/{workflow-faults.d.ts → text/workflow-faults.d.ts} +1 -1
- package/dist/text/workflow-faults.d.ts.map +1 -0
- package/dist/{workflow-faults.js → text/workflow-faults.js} +1 -1
- package/dist/text/workflow-faults.js.map +1 -0
- package/package.json +70 -70
- package/src/chores/chores.test.ts +4 -10
- package/src/chores/chores.ts +148 -392
- package/src/chores/digest.ts +8 -28
- package/src/chores/extension-update.ts +3 -8
- package/src/chores/fix-deps.ts +4 -18
- package/src/chores/index.ts +2 -2
- package/src/chores/probes.test.ts +7 -43
- package/src/chores/probes.ts +62 -167
- package/src/chores/prompt.ts +10 -34
- package/src/chores/stack.test.ts +6 -45
- package/src/chores/stack.ts +27 -118
- package/src/chores/verdict.test.ts +101 -80
- package/src/chores/verdict.ts +54 -99
- package/src/contracts/accounts.contract.ts +4 -19
- package/src/contracts/agent.contract.ts +7 -22
- package/src/contracts/agents.contract.ts +25 -71
- package/src/contracts/automations.contract.ts +14 -30
- package/src/contracts/capabilities.contract.ts +8 -35
- package/src/contracts/chores.contract.ts +4 -15
- package/src/contracts/endpoints.contract.ts +5 -22
- package/src/contracts/exit.contract.ts +7 -30
- package/src/contracts/extensions.contract.ts +8 -30
- package/src/contracts/git.contract.ts +25 -49
- package/src/contracts/host.contract.ts +9 -44
- package/src/contracts/intentic.contract.ts +1 -1
- package/src/contracts/logs.contract.ts +3 -13
- package/src/contracts/loops.contract.ts +9 -40
- package/src/contracts/personas.contract.ts +22 -30
- package/src/contracts/providers.contract.ts +4 -17
- package/src/contracts/runner.contract.ts +12 -39
- package/src/contracts/safety.contract.ts +5 -14
- package/src/contracts/secrets.contract.ts +4 -22
- package/src/contracts/sessions.contract.ts +1 -1
- package/src/contracts/settings.contract.ts +4 -10
- package/src/contracts/share.contract.ts +3 -9
- package/src/contracts/skills.contract.ts +4 -15
- package/src/contracts/system.contract.ts +26 -52
- package/src/contracts/usage.contract.ts +7 -21
- package/src/contracts/vpn.contract.ts +9 -16
- package/src/contracts/webext.contract.ts +9 -25
- package/src/contracts/workflows.contract.ts +34 -58
- package/src/contracts/workspace.contract.ts +19 -50
- package/src/events/agent-events.ts +345 -0
- package/src/events/cards.ts +286 -0
- package/src/{events.test.ts → events/resume.test.ts} +4 -19
- package/src/events/resume.ts +60 -0
- package/src/events/system-events.ts +139 -0
- package/src/events/transcript.ts +320 -0
- package/src/{conversation-ids.test.ts → ids/conversation-ids.test.ts} +25 -13
- package/src/ids/conversation-ids.ts +178 -0
- package/src/ids/hostnames.ts +129 -0
- package/src/ids/session-names.ts +29 -0
- package/src/ids/share-paths.ts +43 -0
- package/src/{tunnel-ids.test.ts → ids/tunnel-ids.test.ts} +1 -14
- package/src/ids/tunnel-ids.ts +29 -0
- package/src/index.ts +71 -88
- package/src/{agent-catalog.test.ts → models/agent-catalog.test.ts} +19 -93
- package/src/models/agent-catalog.ts +174 -0
- package/src/models/agent-runtimes.ts +201 -0
- package/src/models/capability-ledger.test.ts +84 -0
- package/src/{fast-tier.test.ts → models/fast-tier.test.ts} +7 -18
- package/src/models/fast-tier.ts +36 -0
- package/src/{model-order.test.ts → models/model-order.test.ts} +19 -40
- package/src/models/model-order.ts +163 -0
- package/src/models/model-pins.test.ts +87 -0
- package/src/models/model-pins.ts +57 -0
- package/src/models/model-roles.test.ts +38 -0
- package/src/models/model-roles.ts +180 -0
- package/src/{plan-pools.test.ts → models/plan-pools.test.ts} +6 -11
- package/src/models/plan-pools.ts +65 -0
- package/src/{prompt-complexity.test.ts → models/prompt-complexity.test.ts} +8 -60
- package/src/models/prompt-complexity.ts +215 -0
- package/src/{provider-specs.test.ts → models/provider-specs.test.ts} +18 -47
- package/src/models/provider-specs.ts +272 -0
- package/src/policy/approvals-execution.ts +58 -0
- package/src/{batch-runs.test.ts → policy/batch-runs.test.ts} +4 -20
- package/src/policy/batch-runs.ts +137 -0
- package/src/policy/capability-secrets.ts +5 -0
- package/src/{card-status.ts → policy/card-status.ts} +11 -26
- package/src/{command-classes.test.ts → policy/command-classes.test.ts} +11 -118
- package/src/policy/command-classes.ts +395 -0
- package/src/policy/command-run.ts +65 -0
- package/src/policy/control-scopes.ts +38 -0
- package/src/{credential-material.test.ts → policy/credential-material.test.ts} +4 -26
- package/src/policy/credential-material.ts +91 -0
- package/src/policy/needs-action.ts +5 -0
- package/src/policy/output-fields.ts +86 -0
- package/src/policy/overlay-lint.ts +100 -0
- package/src/{owner-ticket.test.ts → policy/owner-ticket.test.ts} +1 -1
- package/src/{owner-ticket.ts → policy/owner-ticket.ts} +9 -31
- package/src/policy/safety-policy.test.ts +84 -0
- package/src/policy/safety-policy.ts +142 -0
- package/src/policy/search-globs.ts +60 -0
- package/src/protocol/container-requirements.test.ts +72 -0
- package/src/protocol/container-requirements.ts +58 -0
- package/src/protocol/host-protocol.ts +29 -0
- package/src/protocol/ingress-contract.ts +103 -0
- package/src/{ingress-protocol.test.ts → protocol/ingress-protocol.test.ts} +25 -90
- package/src/protocol/ingress-protocol.ts +441 -0
- package/src/protocol/listener-protocol.ts +75 -0
- package/src/{peer-dial.test.ts → protocol/peer-dial.test.ts} +52 -1
- package/src/protocol/peer-dial.ts +207 -0
- package/src/{peer-mcp-server.ts → protocol/peer-mcp-server.ts} +16 -41
- package/src/protocol/request-id.ts +5 -0
- package/src/{routes.test.ts → protocol/routes.test.ts} +14 -22
- package/src/protocol/routes.ts +159 -0
- package/src/protocol/runner-protocol.ts +197 -0
- package/src/protocol/terminal-protocol.ts +13 -0
- package/src/protocol/webext-links.ts +50 -0
- package/src/protocol/webext-protocol.ts +24 -0
- package/src/schemas/activity.ts +22 -30
- package/src/schemas/agent.ts +130 -238
- package/src/schemas/agents.ts +165 -483
- package/src/schemas/approvals.ts +23 -71
- package/src/schemas/automations.ts +145 -249
- package/src/schemas/capabilities.ts +127 -414
- package/src/schemas/ci.ts +56 -108
- package/src/schemas/codebase-health.ts +7 -11
- package/src/schemas/devices.ts +98 -321
- package/src/schemas/engines.ts +16 -44
- package/src/schemas/environment.ts +41 -91
- package/src/schemas/exit.ts +24 -81
- package/src/schemas/extension-updates.ts +42 -87
- package/src/schemas/git-history.ts +30 -84
- package/src/schemas/git.ts +141 -256
- package/src/schemas/history.ts +14 -40
- package/src/schemas/hosts.ts +9 -15
- package/src/schemas/inventory.ts +8 -10
- package/src/schemas/issues.ts +66 -134
- package/src/schemas/logs.ts +15 -34
- package/src/schemas/loops.ts +46 -163
- package/src/schemas/maintenance.ts +47 -172
- package/src/schemas/panels.ts +20 -45
- package/src/schemas/personas.ts +85 -168
- package/src/schemas/plan-limits.ts +58 -197
- package/src/schemas/ports.ts +14 -32
- package/src/schemas/provider-oauth.ts +23 -76
- package/src/schemas/provider-subscriptions.ts +4 -13
- package/src/schemas/public.ts +4 -15
- package/src/schemas/push.ts +8 -36
- package/src/schemas/secrets.ts +20 -64
- package/src/schemas/settings.ts +177 -597
- package/src/schemas/share.ts +14 -32
- package/src/schemas/shared.ts +14 -13
- package/src/schemas/system.ts +46 -78
- package/src/schemas/terminal.ts +41 -120
- package/src/schemas/usage.ts +44 -233
- package/src/schemas/version-seam.test.ts +9 -26
- package/src/schemas/vpn.ts +27 -64
- package/src/schemas/webext.ts +22 -53
- package/src/schemas/workflows.ts +57 -183
- package/src/schemas/workspace-repos.ts +12 -24
- package/src/schemas/workspace-search.ts +17 -35
- package/src/schemas/workspace-setup.ts +4 -11
- package/src/schemas/workspace-tree.ts +32 -91
- package/src/state/arrival.ts +109 -0
- package/src/state/contract-lock.test.ts +17 -0
- package/src/state/contract-lock.ts +49 -0
- package/src/state/definition.ts +143 -0
- package/src/state/history-state.ts +103 -0
- package/src/{runtime-state.test.ts → state/runtime-state.test.ts} +3 -10
- package/src/state/runtime-state.ts +62 -0
- package/src/state/starter.ts +5 -0
- package/src/state/state-portability.ts +27 -0
- package/src/state/versions.ts +26 -0
- package/src/{workspace-state.test.ts → state/workspace-state.test.ts} +65 -173
- package/src/state/workspace-state.ts +669 -0
- package/src/{documents.test.ts → text/documents.test.ts} +1 -1
- package/src/text/documents.ts +42 -0
- package/src/text/embed.ts +132 -0
- package/src/text/mentions.ts +21 -0
- package/src/text/model-answer.ts +9 -0
- package/src/text/path-refs.ts +39 -0
- package/src/text/shell-regions.ts +224 -0
- package/src/{title.test.ts → text/title.test.ts} +13 -32
- package/src/text/title.ts +202 -0
- package/src/{transcript-fold.test.ts → text/transcript-fold.test.ts} +5 -83
- package/src/{transcript-fold.ts → text/transcript-fold.ts} +65 -170
- package/src/text/whisper.test.ts +19 -0
- package/src/text/whisper.ts +17 -0
- package/src/{workflow-faults.test.ts → text/workflow-faults.test.ts} +6 -24
- package/src/{workflow-faults.ts → text/workflow-faults.ts} +20 -60
- package/dist/agent-catalog.d.ts.map +0 -1
- package/dist/agent-catalog.js.map +0 -1
- package/dist/agent-runtimes.d.ts.map +0 -1
- package/dist/agent-runtimes.js.map +0 -1
- package/dist/approvals-execution.d.ts.map +0 -1
- package/dist/approvals-execution.js.map +0 -1
- package/dist/arrival.d.ts.map +0 -1
- package/dist/arrival.js.map +0 -1
- package/dist/batch-runs.d.ts.map +0 -1
- package/dist/batch-runs.js.map +0 -1
- package/dist/capability-env.d.ts.map +0 -1
- package/dist/capability-env.js.map +0 -1
- package/dist/capability-secrets.d.ts.map +0 -1
- package/dist/capability-secrets.js.map +0 -1
- package/dist/card-status.d.ts.map +0 -1
- package/dist/card-status.js.map +0 -1
- package/dist/command-classes.d.ts.map +0 -1
- package/dist/command-classes.js.map +0 -1
- package/dist/command-run.d.ts.map +0 -1
- package/dist/command-run.js.map +0 -1
- package/dist/contract-lock.d.ts.map +0 -1
- package/dist/contract-lock.js.map +0 -1
- package/dist/conversation-ids.d.ts +0 -4
- package/dist/conversation-ids.d.ts.map +0 -1
- package/dist/conversation-ids.js.map +0 -1
- package/dist/credential-material.d.ts.map +0 -1
- package/dist/credential-material.js.map +0 -1
- package/dist/definition.d.ts.map +0 -1
- package/dist/definition.js.map +0 -1
- package/dist/documents.d.ts.map +0 -1
- package/dist/documents.js.map +0 -1
- package/dist/embed.d.ts.map +0 -1
- package/dist/embed.js.map +0 -1
- package/dist/events.d.ts +0 -4336
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js +0 -725
- package/dist/events.js.map +0 -1
- package/dist/fast-tier.d.ts.map +0 -1
- package/dist/fast-tier.js.map +0 -1
- package/dist/history-state.d.ts.map +0 -1
- package/dist/history-state.js.map +0 -1
- package/dist/host-protocol.d.ts.map +0 -1
- package/dist/host-protocol.js.map +0 -1
- package/dist/hostnames.d.ts.map +0 -1
- package/dist/hostnames.js.map +0 -1
- package/dist/ingress-contract.d.ts.map +0 -1
- package/dist/ingress-contract.js.map +0 -1
- package/dist/ingress-protocol.d.ts.map +0 -1
- package/dist/ingress-protocol.js.map +0 -1
- package/dist/listener-protocol.d.ts.map +0 -1
- package/dist/listener-protocol.js.map +0 -1
- package/dist/mentions.d.ts.map +0 -1
- package/dist/mentions.js.map +0 -1
- package/dist/model-order.d.ts.map +0 -1
- package/dist/model-order.js.map +0 -1
- package/dist/model-pins.d.ts.map +0 -1
- package/dist/model-pins.js +0 -45
- package/dist/model-pins.js.map +0 -1
- package/dist/model-roles.d.ts.map +0 -1
- package/dist/model-roles.js.map +0 -1
- package/dist/needs-action.d.ts.map +0 -1
- package/dist/needs-action.js.map +0 -1
- package/dist/output-fields.d.ts.map +0 -1
- package/dist/output-fields.js.map +0 -1
- package/dist/overlay-lint.d.ts.map +0 -1
- package/dist/overlay-lint.js.map +0 -1
- package/dist/owner-ticket.d.ts.map +0 -1
- package/dist/owner-ticket.js.map +0 -1
- package/dist/path-refs.d.ts.map +0 -1
- package/dist/path-refs.js.map +0 -1
- package/dist/peer-dial.d.ts.map +0 -1
- package/dist/peer-dial.js.map +0 -1
- package/dist/peer-mcp-server.d.ts.map +0 -1
- package/dist/peer-mcp-server.js.map +0 -1
- package/dist/plan-pools.d.ts.map +0 -1
- package/dist/plan-pools.js.map +0 -1
- package/dist/prompt-complexity.d.ts.map +0 -1
- package/dist/prompt-complexity.js.map +0 -1
- package/dist/provider-specs.d.ts.map +0 -1
- package/dist/provider-specs.js.map +0 -1
- package/dist/request-id.d.ts.map +0 -1
- package/dist/request-id.js.map +0 -1
- package/dist/routes.d.ts.map +0 -1
- package/dist/routes.js.map +0 -1
- package/dist/runner-protocol.d.ts.map +0 -1
- package/dist/runner-protocol.js.map +0 -1
- package/dist/runtime-state.d.ts.map +0 -1
- package/dist/runtime-state.js.map +0 -1
- package/dist/safety-policy.d.ts.map +0 -1
- package/dist/safety-policy.js.map +0 -1
- package/dist/schemas/context.d.ts +0 -30
- package/dist/schemas/context.d.ts.map +0 -1
- package/dist/schemas/context.js +0 -34
- package/dist/schemas/context.js.map +0 -1
- package/dist/search-globs.d.ts.map +0 -1
- package/dist/search-globs.js.map +0 -1
- package/dist/session-names.d.ts.map +0 -1
- package/dist/session-names.js.map +0 -1
- package/dist/share-paths.d.ts.map +0 -1
- package/dist/share-paths.js.map +0 -1
- package/dist/shell-regions.d.ts.map +0 -1
- package/dist/shell-regions.js.map +0 -1
- package/dist/sse.d.ts.map +0 -1
- package/dist/sse.js.map +0 -1
- package/dist/starter.d.ts.map +0 -1
- package/dist/starter.js.map +0 -1
- package/dist/state-portability.d.ts.map +0 -1
- package/dist/state-portability.js.map +0 -1
- package/dist/terminal-protocol.d.ts.map +0 -1
- package/dist/terminal-protocol.js.map +0 -1
- package/dist/title.d.ts.map +0 -1
- package/dist/title.js.map +0 -1
- package/dist/transcript-fold.d.ts.map +0 -1
- package/dist/transcript-fold.js.map +0 -1
- package/dist/tunnel-ids.d.ts.map +0 -1
- package/dist/tunnel-ids.js.map +0 -1
- package/dist/versions.d.ts.map +0 -1
- package/dist/versions.js.map +0 -1
- package/dist/webext-links.d.ts.map +0 -1
- package/dist/webext-links.js.map +0 -1
- package/dist/webext-protocol.d.ts.map +0 -1
- package/dist/webext-protocol.js.map +0 -1
- package/dist/workflow-faults.d.ts.map +0 -1
- package/dist/workflow-faults.js.map +0 -1
- package/dist/workspace-state.d.ts.map +0 -1
- package/dist/workspace-state.js.map +0 -1
- package/src/agent-catalog.ts +0 -316
- package/src/agent-runtimes.ts +0 -419
- package/src/approvals-execution.ts +0 -96
- package/src/arrival.ts +0 -160
- package/src/batch-runs.ts +0 -188
- package/src/capability-ledger.test.ts +0 -140
- package/src/capability-secrets.ts +0 -20
- package/src/command-classes.ts +0 -617
- package/src/command-run.ts +0 -78
- package/src/contract-lock.test.ts +0 -23
- package/src/contract-lock.ts +0 -66
- package/src/conversation-ids.ts +0 -207
- package/src/credential-material.ts +0 -181
- package/src/definition.ts +0 -207
- package/src/documents.ts +0 -67
- package/src/embed.ts +0 -164
- package/src/events.ts +0 -1870
- package/src/fast-tier.ts +0 -72
- package/src/history-state.ts +0 -174
- package/src/host-protocol.ts +0 -36
- package/src/hostnames.ts +0 -180
- package/src/ingress-contract.ts +0 -157
- package/src/ingress-protocol.ts +0 -625
- package/src/listener-protocol.ts +0 -96
- package/src/mentions.ts +0 -25
- package/src/model-order.ts +0 -262
- package/src/model-pins.test.ts +0 -202
- package/src/model-pins.ts +0 -183
- package/src/model-roles.ts +0 -224
- package/src/needs-action.ts +0 -14
- package/src/output-fields.ts +0 -111
- package/src/overlay-lint.ts +0 -116
- package/src/path-refs.ts +0 -59
- package/src/peer-dial.ts +0 -163
- package/src/plan-pools.ts +0 -92
- package/src/prompt-complexity.ts +0 -334
- package/src/provider-specs.ts +0 -432
- package/src/request-id.ts +0 -41
- package/src/routes.ts +0 -219
- package/src/runner-protocol.ts +0 -239
- package/src/runtime-state.ts +0 -140
- package/src/safety-policy.test.ts +0 -88
- package/src/safety-policy.ts +0 -258
- package/src/schemas/context.ts +0 -87
- package/src/search-globs.ts +0 -76
- package/src/session-names.ts +0 -44
- package/src/share-paths.ts +0 -68
- package/src/shell-regions.ts +0 -289
- package/src/starter.ts +0 -13
- package/src/state-portability.ts +0 -56
- package/src/terminal-protocol.ts +0 -16
- package/src/title.ts +0 -267
- package/src/tunnel-ids.ts +0 -57
- package/src/versions.ts +0 -48
- package/src/webext-links.ts +0 -90
- package/src/webext-protocol.ts +0 -27
- package/src/workspace-state.ts +0 -1096
- /package/dist/{hostnames.d.ts → ids/hostnames.d.ts} +0 -0
- /package/dist/{hostnames.js → ids/hostnames.js} +0 -0
- /package/dist/{session-names.d.ts → ids/session-names.d.ts} +0 -0
- /package/dist/{session-names.js → ids/session-names.js} +0 -0
- /package/dist/{share-paths.d.ts → ids/share-paths.d.ts} +0 -0
- /package/dist/{share-paths.js → ids/share-paths.js} +0 -0
- /package/dist/{agent-catalog.js → models/agent-catalog.js} +0 -0
- /package/dist/{agent-runtimes.d.ts → models/agent-runtimes.d.ts} +0 -0
- /package/dist/{agent-runtimes.js → models/agent-runtimes.js} +0 -0
- /package/dist/{fast-tier.js → models/fast-tier.js} +0 -0
- /package/dist/{model-order.d.ts → models/model-order.d.ts} +0 -0
- /package/dist/{model-order.js → models/model-order.js} +0 -0
- /package/dist/{plan-pools.js → models/plan-pools.js} +0 -0
- /package/dist/{prompt-complexity.d.ts → models/prompt-complexity.d.ts} +0 -0
- /package/dist/{prompt-complexity.js → models/prompt-complexity.js} +0 -0
- /package/dist/{provider-specs.d.ts → models/provider-specs.d.ts} +0 -0
- /package/dist/{provider-specs.js → models/provider-specs.js} +0 -0
- /package/dist/{approvals-execution.d.ts → policy/approvals-execution.d.ts} +0 -0
- /package/dist/{approvals-execution.js → policy/approvals-execution.js} +0 -0
- /package/dist/{capability-env.d.ts → policy/capability-env.d.ts} +0 -0
- /package/dist/{capability-env.js → policy/capability-env.js} +0 -0
- /package/dist/{capability-secrets.d.ts → policy/capability-secrets.d.ts} +0 -0
- /package/dist/{capability-secrets.js → policy/capability-secrets.js} +0 -0
- /package/dist/{command-run.js → policy/command-run.js} +0 -0
- /package/dist/{credential-material.d.ts → policy/credential-material.d.ts} +0 -0
- /package/dist/{credential-material.js → policy/credential-material.js} +0 -0
- /package/dist/{needs-action.d.ts → policy/needs-action.d.ts} +0 -0
- /package/dist/{needs-action.js → policy/needs-action.js} +0 -0
- /package/dist/{output-fields.d.ts → policy/output-fields.d.ts} +0 -0
- /package/dist/{output-fields.js → policy/output-fields.js} +0 -0
- /package/dist/{overlay-lint.d.ts → policy/overlay-lint.d.ts} +0 -0
- /package/dist/{overlay-lint.js → policy/overlay-lint.js} +0 -0
- /package/dist/{owner-ticket.d.ts → policy/owner-ticket.d.ts} +0 -0
- /package/dist/{search-globs.d.ts → policy/search-globs.d.ts} +0 -0
- /package/dist/{search-globs.js → policy/search-globs.js} +0 -0
- /package/dist/{ingress-contract.d.ts → protocol/ingress-contract.d.ts} +0 -0
- /package/dist/{ingress-protocol.d.ts → protocol/ingress-protocol.d.ts} +0 -0
- /package/dist/{ingress-protocol.js → protocol/ingress-protocol.js} +0 -0
- /package/dist/{listener-protocol.d.ts → protocol/listener-protocol.d.ts} +0 -0
- /package/dist/{peer-mcp-server.d.ts → protocol/peer-mcp-server.d.ts} +0 -0
- /package/dist/{peer-mcp-server.js → protocol/peer-mcp-server.js} +0 -0
- /package/dist/{request-id.d.ts → protocol/request-id.d.ts} +0 -0
- /package/dist/{request-id.js → protocol/request-id.js} +0 -0
- /package/dist/{routes.d.ts → protocol/routes.d.ts} +0 -0
- /package/dist/{routes.js → protocol/routes.js} +0 -0
- /package/dist/{sse.d.ts → protocol/sse.d.ts} +0 -0
- /package/dist/{sse.js → protocol/sse.js} +0 -0
- /package/dist/{terminal-protocol.js → protocol/terminal-protocol.js} +0 -0
- /package/dist/{webext-links.d.ts → protocol/webext-links.d.ts} +0 -0
- /package/dist/{webext-links.js → protocol/webext-links.js} +0 -0
- /package/dist/{arrival.d.ts → state/arrival.d.ts} +0 -0
- /package/dist/{contract-lock.d.ts → state/contract-lock.d.ts} +0 -0
- /package/dist/{history-state.d.ts → state/history-state.d.ts} +0 -0
- /package/dist/{runtime-state.d.ts → state/runtime-state.d.ts} +0 -0
- /package/dist/{runtime-state.js → state/runtime-state.js} +0 -0
- /package/dist/{starter.d.ts → state/starter.d.ts} +0 -0
- /package/dist/{starter.js → state/starter.js} +0 -0
- /package/dist/{state-portability.d.ts → state/state-portability.d.ts} +0 -0
- /package/dist/{state-portability.js → state/state-portability.js} +0 -0
- /package/dist/{versions.d.ts → state/versions.d.ts} +0 -0
- /package/dist/{versions.js → state/versions.js} +0 -0
- /package/dist/{embed.d.ts → text/embed.d.ts} +0 -0
- /package/dist/{embed.js → text/embed.js} +0 -0
- /package/dist/{mentions.d.ts → text/mentions.d.ts} +0 -0
- /package/dist/{mentions.js → text/mentions.js} +0 -0
- /package/dist/{path-refs.d.ts → text/path-refs.d.ts} +0 -0
- /package/dist/{path-refs.js → text/path-refs.js} +0 -0
- /package/dist/{shell-regions.js → text/shell-regions.js} +0 -0
- /package/dist/{title.d.ts → text/title.d.ts} +0 -0
- /package/dist/{title.js → text/title.js} +0 -0
- /package/src/{hostnames.test.ts → ids/hostnames.test.ts} +0 -0
- /package/src/{share-paths.test.ts → ids/share-paths.test.ts} +0 -0
- /package/src/{capability-env.ts → policy/capability-env.ts} +0 -0
- /package/src/{overlay-lint.test.ts → policy/overlay-lint.test.ts} +0 -0
- /package/src/{search-globs.test.ts → policy/search-globs.test.ts} +0 -0
- /package/src/{ingress-contract.test.ts → protocol/ingress-contract.test.ts} +0 -0
- /package/src/{peer-mcp-server.test.ts → protocol/peer-mcp-server.test.ts} +0 -0
- /package/src/{sse.ts → protocol/sse.ts} +0 -0
- /package/src/{versions.test.ts → state/versions.test.ts} +0 -0
- /package/src/{embed.test.ts → text/embed.test.ts} +0 -0
- /package/src/{mentions.test.ts → text/mentions.test.ts} +0 -0
- /package/src/{path-refs.test.ts → text/path-refs.test.ts} +0 -0
package/src/routes.ts
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
/* The daemon's route surface, named. A sandbox daemon is baked into an image, so the browser talking to it is
|
|
4
|
-
* routinely NEWER than the daemon: a released app plane serves every user's sandbox, whatever image they last
|
|
5
|
-
* pulled, and in local development the web app is always ahead of the last `pnpm build:sandbox`. Both are
|
|
6
|
-
* normal and neither should force an update.
|
|
7
|
-
*
|
|
8
|
-
* What must not happen is the failure being SILENT. A route the daemon predates answers 404, which the browser
|
|
9
|
-
* has no way to tell apart from "you asked for a file that isn't there", so a missing feature reads as a
|
|
10
|
-
* broken one, and diagnosing it costs an hour of "did the image rebuild?".
|
|
11
|
-
*
|
|
12
|
-
* So the daemon ADVERTISES the routes it implements (the /events hello frame) and the browser compares that
|
|
13
|
-
* against the contract it was itself built with. Everything present on both sides works exactly as before;
|
|
14
|
-
* anything the daemon lacks is a KNOWN, NAMED gap the UI can gate a feature on or explain in an error, instead
|
|
15
|
-
* of a mystery 404. Old daemon + new browser stays fully supported, it just stops being confusing.
|
|
16
|
-
*
|
|
17
|
-
* Route names are `<group>.<route>` (`vpn.list`, `kimi.models`), derived from the contract object both sides
|
|
18
|
-
* import. Nothing is generated and nothing is hand-maintained: adding a route to the contract adds it here.
|
|
19
|
-
*
|
|
20
|
-
* Everything here is a pure function of a contract passed in, index.ts binds them to `sandboxContract` once it
|
|
21
|
-
* is assembled, which is what keeps this module out of an import cycle with it. */
|
|
22
|
-
|
|
23
|
-
// The shape we read off an oRPC contract procedure. `~orpc.route` is the contract metadata oRPC attaches to
|
|
24
|
-
// every `oc.route(...)` procedure; we only need the wire method + path, so this is deliberately structural
|
|
25
|
-
// rather than an import of oRPC's internal types (which are not part of its public surface).
|
|
26
|
-
interface ContractProcedureLike {
|
|
27
|
-
readonly "~orpc": { readonly route?: { readonly method?: string; readonly path?: string } };
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const procedureRoute = (value: unknown): { method: string; path: string } | undefined => {
|
|
31
|
-
if (typeof value !== "object" || value === null || !("~orpc" in value)) {
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
const { route } = (value as ContractProcedureLike)["~orpc"];
|
|
35
|
-
if (route?.method === undefined || route.path === undefined) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
return { method: route.method, path: route.path };
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// One advertised route: its contract name plus the wire shape, so a concrete request path can be matched back
|
|
42
|
-
// to the name it came from (see routeNameForRequest).
|
|
43
|
-
export interface ContractRoute {
|
|
44
|
-
readonly name: string;
|
|
45
|
-
readonly method: string;
|
|
46
|
-
// The oRPC path template, with `{param}` placeholders, e.g. `/system/terminals/{name}`.
|
|
47
|
-
readonly path: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Walk a contract object (two levels: group → procedure) into its flat route list, sorted by name so the
|
|
51
|
-
// advertised array is stable and diffable.
|
|
52
|
-
export const contractRoutes = (contract: Record<string, unknown>): ContractRoute[] => {
|
|
53
|
-
const routes: ContractRoute[] = [];
|
|
54
|
-
for (const [group, procedures] of Object.entries(contract)) {
|
|
55
|
-
if (typeof procedures !== "object" || procedures === null) {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
for (const [name, procedure] of Object.entries(procedures as Record<string, unknown>)) {
|
|
59
|
-
const route = procedureRoute(procedure);
|
|
60
|
-
if (route !== undefined) {
|
|
61
|
-
routes.push({ name: `${group}.${name}`, method: route.method, path: route.path });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return routes.toSorted((a, b) => a.name.localeCompare(b.name));
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/* ---- the SHAPE of a route, not just its name ----
|
|
69
|
-
*
|
|
70
|
-
* The route list above answers "does this daemon have it". It cannot answer the other half: a route that
|
|
71
|
-
* exists on BOTH sides but whose payload changed between the two builds. Names match, so the call goes out,
|
|
72
|
-
* and a field the browser expects is simply missing from the answer, no 404, no message, nothing to attribute
|
|
73
|
-
* it to. That is the one skew failure the named-gap mechanism still leaves silent.
|
|
74
|
-
*
|
|
75
|
-
* So each route also advertises a fingerprint of its wire shape: input and output schema together, reduced to
|
|
76
|
-
* one short string. Same string ⇒ the two builds agree, which is the overwhelmingly common case and costs a
|
|
77
|
-
* comparison. Different ⇒ a NAMED route whose payload moved, which the UI can explain in exactly the words it
|
|
78
|
-
* already uses for a missing one.
|
|
79
|
-
*
|
|
80
|
-
* NOTHING IS HAND-MAINTAINED, which is the whole reason this is a fingerprint and not a version number. The
|
|
81
|
-
* codebase already rejected the hand-bumped alternative once (see the web app's buildEpoch.ts: a SCHEMA_VERSION
|
|
82
|
-
* "hangs on someone remembering"). Changing a field in a contract schema changes that route's fingerprint by
|
|
83
|
-
* itself, on both sides, with nobody to remember anything. */
|
|
84
|
-
|
|
85
|
-
// The schemas oRPC hangs off a contract procedure, read structurally for the same reason as `route` above,
|
|
86
|
-
// they are internal metadata, not part of its public surface.
|
|
87
|
-
interface ContractSchemasLike {
|
|
88
|
-
readonly "~orpc": { readonly inputSchema?: unknown; readonly outputSchema?: unknown };
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/* The JSON Schema keywords whose array value is a SET, order carries no meaning, so two schemas that differ
|
|
92
|
-
* only in it are the same wire shape. `required` is the one that matters in practice: JSON Schema spells an
|
|
93
|
-
* object's fields twice, once as `properties` (an object, so key-sorting settles it) and once as `required`
|
|
94
|
-
* (an array, in declaration order), so without this, moving a field up a `z.object` for readability reads as
|
|
95
|
-
* drift on every route that carries it. The union keywords are here for the same reason a step lower down. */
|
|
96
|
-
const UNORDERED = new Set(["required", "enum", "anyOf", "oneOf", "allOf"]);
|
|
97
|
-
|
|
98
|
-
/* Canonical JSON: object keys sorted, set-valued arrays sorted, everything else left in the order it was
|
|
99
|
-
* written. So the fingerprint depends on what the schema SAYS rather than how zod happened to emit it, which
|
|
100
|
-
* is what keeps a purely cosmetic edit from being reported to a user as a payload that moved.
|
|
101
|
-
*
|
|
102
|
-
* Ordered arrays stay ordered: a tuple's `prefixItems` is positional, and sorting it would call two genuinely
|
|
103
|
-
* different shapes identical, the failure that actually costs something here. */
|
|
104
|
-
const canonical = (value: unknown, key?: string): unknown => {
|
|
105
|
-
if (Array.isArray(value)) {
|
|
106
|
-
const items = value.map((item) => canonical(item));
|
|
107
|
-
return key !== undefined && UNORDERED.has(key) ? items.toSorted((a, b) => JSON.stringify(a).localeCompare(JSON.stringify(b))) : items;
|
|
108
|
-
}
|
|
109
|
-
if (typeof value !== "object" || value === null) {
|
|
110
|
-
return value;
|
|
111
|
-
}
|
|
112
|
-
const entries = Object.entries(value as Record<string, unknown>).toSorted(([a], [b]) => a.localeCompare(b));
|
|
113
|
-
return entries.map(([name, nested]) => [name, canonical(nested, name)]);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
/* FNV-1a over the canonical JSON, base36. Deliberately not a cryptographic hash: this is a drift SIGNAL, and
|
|
117
|
-
* the cost of a collision is one warning that never appears, never a wrong action, never a blocked call. A
|
|
118
|
-
* crypto digest would mean a subtle-crypto round trip in the browser (async, and unavailable on insecure
|
|
119
|
-
* origins) to buy nothing this use has any need of. */
|
|
120
|
-
const fingerprint = (value: unknown): string => {
|
|
121
|
-
const text = JSON.stringify(canonical(value));
|
|
122
|
-
let hash = 0x811c9dc5;
|
|
123
|
-
for (let i = 0; i < text.length; i++) {
|
|
124
|
-
hash ^= text.charCodeAt(i);
|
|
125
|
-
hash = Math.imul(hash, 0x01000193) >>> 0;
|
|
126
|
-
}
|
|
127
|
-
return hash.toString(36);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
/* One route's wire shape, or undefined when it cannot be expressed.
|
|
131
|
-
*
|
|
132
|
-
* `io` matters and is not cosmetic: a field with `.default()` is OPTIONAL on the way in and REQUIRED on the
|
|
133
|
-
* way out, so reading both sides in the same direction would call two genuinely different shapes identical.
|
|
134
|
-
*
|
|
135
|
-
* A schema that will not convert yields undefined rather than throwing the walk away. Every such route in the
|
|
136
|
-
* contract today is a streaming one, oRPC wraps an event iterator's output in an opaque type with no schema
|
|
137
|
-
* underneath it, and their absence lands them in exactly the right place: a route with no advertised shape is
|
|
138
|
-
* assumed compatible, which is the same "positive evidence only" rule the missing-route check already runs on. */
|
|
139
|
-
const procedureShape = (value: unknown): string | undefined => {
|
|
140
|
-
if (typeof value !== "object" || value === null || !("~orpc" in value)) {
|
|
141
|
-
return undefined;
|
|
142
|
-
}
|
|
143
|
-
const { inputSchema, outputSchema } = (value as ContractSchemasLike)["~orpc"];
|
|
144
|
-
try {
|
|
145
|
-
return fingerprint({
|
|
146
|
-
in: inputSchema === undefined ? undefined : z.toJSONSchema(inputSchema as z.ZodType, { io: "input" }),
|
|
147
|
-
out: outputSchema === undefined ? undefined : z.toJSONSchema(outputSchema as z.ZodType, { io: "output" }),
|
|
148
|
-
});
|
|
149
|
-
} catch {
|
|
150
|
-
return undefined;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
// Every route whose shape THIS build can express, as name → fingerprint. Same walk as contractRoutes, and
|
|
155
|
-
// deliberately a separate map rather than a field on ContractRoute: the two are advertised independently
|
|
156
|
-
// (existence covers every route, shape covers the ones that can be expressed) and read by different checks.
|
|
157
|
-
export const routeShapes = (contract: Record<string, unknown>): Record<string, string> => {
|
|
158
|
-
const shapes: Record<string, string> = {};
|
|
159
|
-
for (const [group, procedures] of Object.entries(contract)) {
|
|
160
|
-
if (typeof procedures !== "object" || procedures === null) {
|
|
161
|
-
continue;
|
|
162
|
-
}
|
|
163
|
-
for (const [name, procedure] of Object.entries(procedures as Record<string, unknown>)) {
|
|
164
|
-
if (procedureRoute(procedure) === undefined) {
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
const shape = procedureShape(procedure);
|
|
168
|
-
if (shape !== undefined) {
|
|
169
|
-
shapes[`${group}.${name}`] = shape;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return shapes;
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
// Does a concrete request path match this route's template? Segment-wise, with `{param}` matching exactly one
|
|
177
|
-
// segment, the same shape oRPC mounts, so a template can never match a longer or shorter path.
|
|
178
|
-
const pathMatches = (template: string, path: string): boolean => {
|
|
179
|
-
const wanted = template.split("/");
|
|
180
|
-
const actual = path.split("/");
|
|
181
|
-
if (wanted.length !== actual.length) {
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
return wanted.every((segment, index) => (segment.startsWith("{") && segment.endsWith("}") ? actual[index] !== "" : segment === actual[index]));
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
// The contract route a concrete request belongs to, or undefined when the path is not a contract route at all
|
|
188
|
-
// (the daemon also serves hand-written Hono routes like /health and /workspace/raw, those are never gated).
|
|
189
|
-
// The query string is stripped first; callers pass whatever they handed to fetch.
|
|
190
|
-
export const routeNameForRequest = (routes: readonly ContractRoute[], method: string, pathWithQuery: string): string | undefined => {
|
|
191
|
-
const path = pathWithQuery.split("?")[0] ?? pathWithQuery;
|
|
192
|
-
const upper = method.toUpperCase();
|
|
193
|
-
return routes.find((route) => route.method.toUpperCase() === upper && pathMatches(route.path, path))?.name;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
// The route a typed client call belongs to. oRPC addresses a procedure by its position in the contract,
|
|
197
|
-
// `['git','stashApply']`, which is the contract's own name for it, so this is a lookup rather than a match.
|
|
198
|
-
export const routeForProcedure = (routes: readonly ContractRoute[], procedure: readonly string[]): ContractRoute | undefined =>
|
|
199
|
-
routes.find((route) => route.name === procedure.join("."));
|
|
200
|
-
|
|
201
|
-
// THE CONCRETE PATH A TYPED CALL WILL CARRY, the route template with every `{param}` replaced by the input
|
|
202
|
-
// field of the same name, which is how the OpenAPI link fills them.
|
|
203
|
-
//
|
|
204
|
-
// This exists so a permission gate can check the string the daemon will actually route on rather than the
|
|
205
|
-
// template it came from. Checking the template would quietly widen every grant: a wildcard glob matches the
|
|
206
|
-
// literal `{repo}` braces just as happily as it matches a repo name, so a manifest that narrowed the grant to
|
|
207
|
-
// one repo would still admit calls for every other, the gate would be comparing two patterns instead of
|
|
208
|
-
// testing a value against one.
|
|
209
|
-
//
|
|
210
|
-
// A param with no matching input field keeps its placeholder. That cannot be reached through the typed client
|
|
211
|
-
// (the contract's input schema requires the field), and leaving the braces in is the safe failure: a glob
|
|
212
|
-
// segment still matches it, a literal segment does not.
|
|
213
|
-
export const requestPathFor = (route: ContractRoute, input: unknown): string => {
|
|
214
|
-
const fields = typeof input === "object" && input !== null ? (input as Record<string, unknown>) : {};
|
|
215
|
-
return route.path.replace(/\{([^}]+)\}/g, (placeholder, name: string) => {
|
|
216
|
-
const value = fields[name];
|
|
217
|
-
return value === undefined ? placeholder : encodeURIComponent(String(value));
|
|
218
|
-
});
|
|
219
|
-
};
|
package/src/runner-protocol.ts
DELETED
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { NeedsActionSchema } from "./needs-action.js";
|
|
3
|
-
|
|
4
|
-
/* THE RUNNER LINK'S EDGES: the handshake on /system/runners/connect, the env a runner boots with, and the
|
|
5
|
-
* placement value a turn request carries. The procedures spoken over the link once it exists live in
|
|
6
|
-
* contracts/runner.contract.ts; the design is docs/remote-runners-plan.md (workspace root).
|
|
7
|
-
*
|
|
8
|
-
* A runner is the sandbox image booted in runner mode: no browser owner, no tunnel, no public name. It dials
|
|
9
|
-
* its PARENT sandbox and executes turns the parent dispatches; the parent keeps owning the conversation. The
|
|
10
|
-
* host link (host-protocol.ts) is the pattern for everything here, one outbound socket that authenticates in
|
|
11
|
-
* its first frame, because a runner sits behind the same NATs and private networks a laptop does. */
|
|
12
|
-
|
|
13
|
-
// The env the runner container boots with: who to dial, and the single-use pairing that gets it enrolled.
|
|
14
|
-
// Named here so `ic runner up`, the Fly provisioner and the daemon's boot detection spell them identically.
|
|
15
|
-
export const RUNNER_PARENT_URL_ENV = "RUNNER_PARENT_URL";
|
|
16
|
-
export const RUNNER_PAIR_TOKEN_ENV = "RUNNER_PAIR_TOKEN";
|
|
17
|
-
|
|
18
|
-
/* The first frame on /system/runners/connect, plain JSON, never oRPC, for host-protocol.ts's reason: a socket
|
|
19
|
-
* must prove whose it is before a typed link attaches, and the proof cannot be a call on a link that does not
|
|
20
|
-
* exist yet. The token rides the FRAME, never the URL (edge logs). */
|
|
21
|
-
export const RunnerHelloSchema = z.object({
|
|
22
|
-
type: z.literal("runner-hello"),
|
|
23
|
-
// The runner's durable token, redeemed once from the pairing over /system/runners/enroll.
|
|
24
|
-
token: z.string(),
|
|
25
|
-
// The daemon build the runner runs, surfaced per runner so an old image is visible rather than
|
|
26
|
-
// mysteriously wrong.
|
|
27
|
-
version: z.string(),
|
|
28
|
-
/* Parity, reported rather than enforced: the parent knows what IT runs (image, channel, overlay hash) and
|
|
29
|
-
* shows a runner that drifted as "outdated" with a rebuild action. An outdated runner still runs turns, a
|
|
30
|
-
* stale toolchain is a fact the user can weigh, where a refusal would strand work. */
|
|
31
|
-
image: z.string(),
|
|
32
|
-
channel: z.string().optional(),
|
|
33
|
-
overlayHash: z.string().optional(),
|
|
34
|
-
/* The runner's DECLARED SHAPE, as the definition format spells it (definition.ts): a sandbox.toml whose
|
|
35
|
-
* only populated section is settings, because that is all a runner declares — capabilities and secrets
|
|
36
|
-
* never travel to one, and its repos are a mirror of the parent's git rather than clones with remotes.
|
|
37
|
-
* The parent diffs this against its own settings to itemize drift (a stale toolchain is a rebuild; a
|
|
38
|
-
* drifted setting is one applyDefinition call over this same socket), so parity stops being a bare
|
|
39
|
-
* "outdated" and becomes lines naming what differs. Absent on an image too old to derive one. */
|
|
40
|
-
definitionToml: z.string().optional(),
|
|
41
|
-
});
|
|
42
|
-
export type RunnerHello = z.infer<typeof RunnerHelloSchema>;
|
|
43
|
-
|
|
44
|
-
// The URL a runner dials, given its parent's public URL. One builder, so `ic`, the Fly provisioner and the
|
|
45
|
-
// daemon route cannot disagree about where the door is (hostConnectUrl's rule).
|
|
46
|
-
export const runnerConnectUrl = (parentUrl: string): string => `${parentUrl.replace(/^http/, "ws").replace(/\/$/, "")}/system/runners/connect`;
|
|
47
|
-
|
|
48
|
-
// Where a runner redeems its pairing for the durable token, once, over plain HTTPS.
|
|
49
|
-
export const runnerEnrollUrl = (parentUrl: string): string => `${parentUrl.replace(/\/$/, "")}/system/runners/enroll`;
|
|
50
|
-
|
|
51
|
-
/* The parent's git door for ONE repository: stock `git fetch`/`git push` against the smart-HTTP pair the
|
|
52
|
-
* parent serves from its real git dirs (<historyRoot>/gits/<encoded id>), authenticated by the runner's own
|
|
53
|
-
* token as a bearer. One builder because three parties spell it: the parent's route, the runner's sync, and
|
|
54
|
-
* anyone debugging with a hand-typed clone. */
|
|
55
|
-
export const runnerGitUrl = (parentUrl: string, repo: string): string =>
|
|
56
|
-
`${parentUrl.replace(/\/$/, "")}/system/runners/git/${encodeURIComponent(repo)}`;
|
|
57
|
-
|
|
58
|
-
/* Where a runner's push LANDS in the parent's git dirs. Never refs/heads/agent/<id> directly: that branch is
|
|
59
|
-
* checked out in the parent's mirror worktree, and git itself refuses updating a checked-out ref, which is a
|
|
60
|
-
* safety property worth keeping rather than configuring away. The parent moves the branch by hard-resetting
|
|
61
|
-
* the mirror worktree to this ref, which advances the checked-out branch through the door git sanctions. */
|
|
62
|
-
export const runnerIncomingRef = (conversationId: string): string => `refs/runner-incoming/${conversationId}`;
|
|
63
|
-
|
|
64
|
-
/* THE CONTAINER A RUNNER'S NAME MEANS on the machine holding it, which is how the update and rebuild flows
|
|
65
|
-
* address it. The prefix is `ic`'s own (runner.rs SLUG_PREFIX) and the two must stay identical: a mismatch
|
|
66
|
-
* does not fail loudly, it sends an update at a container that does not exist and reports "no such sandbox"
|
|
67
|
-
* about a runner sitting right there in the list. */
|
|
68
|
-
export const runnerSlug = (name: string): string => `runner-${name}`;
|
|
69
|
-
|
|
70
|
-
/* THE CREDENTIAL DOORS: a runner's turns spend the ORIGIN sandbox's model providers, never accounts of their
|
|
71
|
-
* own. The shape is a service, not a sync: the parent resolves each turn's credential with the same code its
|
|
72
|
-
* local turns use and answers with the least that travels — an access token minted for the turn, or a route.
|
|
73
|
-
* Refresh tokens never leave the parent, which is what closes the rotation race two daemons refreshing one
|
|
74
|
-
* account would otherwise run. Design: docs/remote-runners-plan.md §8 (workspace root). */
|
|
75
|
-
export const runnerCredentialsUrl = (parentUrl: string): string => `${parentUrl.replace(/\/$/, "")}/system/runners/credentials`;
|
|
76
|
-
export const runnerCredentialRefreshUrl = (parentUrl: string): string => `${parentUrl.replace(/\/$/, "")}/system/runners/credentials/refresh`;
|
|
77
|
-
|
|
78
|
-
/* The parent's model translator, re-served to runners: subscription-routed turns (codex/grok/kimi under the
|
|
79
|
-
* Claude Code harness, OpenAI-protocol endpoints, the trial) authenticate against a translator whose auth
|
|
80
|
-
* files live on the PARENT's /history. Rather than syncing those (the same rotation race), the runner's
|
|
81
|
-
* harness dials this authenticated proxy and the parent forwards to its loopback translator. The bearer is
|
|
82
|
-
* the runner's own token. */
|
|
83
|
-
export const runnerTranslatorPath = "/system/runners/translator";
|
|
84
|
-
export const runnerTranslatorUrl = (parentUrl: string): string => `${parentUrl.replace(/\/$/, "")}${runnerTranslatorPath}`;
|
|
85
|
-
|
|
86
|
-
export const RunnerCredentialRequestSchema = z.object({
|
|
87
|
-
// The provider as the turn names it (absent = claude), an open vocabulary: endpoint/<id> included.
|
|
88
|
-
agent: z.string().optional(),
|
|
89
|
-
account: z.string().optional(),
|
|
90
|
-
model: z.string().optional(),
|
|
91
|
-
});
|
|
92
|
-
export type RunnerCredentialRequest = z.infer<typeof RunnerCredentialRequestSchema>;
|
|
93
|
-
|
|
94
|
-
/* What travels back, by kind:
|
|
95
|
-
* oauth — a native-Claude access token minted for this turn; `account` present when it is a
|
|
96
|
-
* stored account (then the refresh door re-mints mid-turn), absent for the parent's
|
|
97
|
-
* container-env fallback, which has nothing to rotate.
|
|
98
|
-
* parent-translator — run against the parent's translator through the proxy above; the runner supplies its
|
|
99
|
-
* own token as the bearer (the parent never echoes a credential it only holds hashed).
|
|
100
|
-
* endpoint — a foreign endpoint the runner can dial directly (an anthropic-protocol Endpoint
|
|
101
|
-
* capability), with the bearer that endpoint wants.
|
|
102
|
-
* A refusal is a value with the same codes local resolution uses, so the composer's connect gates read a
|
|
103
|
-
* remote refusal exactly as a local one. */
|
|
104
|
-
export const RunnerCredentialSchema = z.union([
|
|
105
|
-
z.object({ ok: z.literal(true), kind: z.literal("oauth"), accessToken: z.string(), account: z.string().optional() }),
|
|
106
|
-
z.object({ ok: z.literal(true), kind: z.literal("parent-translator"), model: z.string(), trial: z.boolean().optional() }),
|
|
107
|
-
z.object({
|
|
108
|
-
ok: z.literal(true),
|
|
109
|
-
kind: z.literal("endpoint"),
|
|
110
|
-
baseUrl: z.string(),
|
|
111
|
-
authToken: z.string(),
|
|
112
|
-
model: z.string(),
|
|
113
|
-
trial: z.boolean().optional(),
|
|
114
|
-
}),
|
|
115
|
-
z.object({
|
|
116
|
-
ok: z.literal(false),
|
|
117
|
-
code: z.enum(["subscription-required", "claude-reauth", "trial-unavailable"]).optional(),
|
|
118
|
-
message: z.string(),
|
|
119
|
-
}),
|
|
120
|
-
]);
|
|
121
|
-
export type RunnerCredential = z.infer<typeof RunnerCredentialSchema>;
|
|
122
|
-
|
|
123
|
-
export const RunnerCredentialRefreshRequestSchema = z.object({
|
|
124
|
-
account: z.string().min(1),
|
|
125
|
-
// The token the harness was refused with, so the parent's rotation supersedes exactly that one and a
|
|
126
|
-
// token another turn already rotated is adopted, never re-refreshed (claude-credentials' own rule).
|
|
127
|
-
rejected: z.string().min(1),
|
|
128
|
-
});
|
|
129
|
-
export type RunnerCredentialRefreshRequest = z.infer<typeof RunnerCredentialRefreshRequestSchema>;
|
|
130
|
-
|
|
131
|
-
// `accessToken` absent ⇒ the parent could not re-mint (a revoked account); the harness gives up exactly as a
|
|
132
|
-
// local turn whose refresh returned nothing does.
|
|
133
|
-
export const RunnerCredentialRefreshSchema = z.object({ accessToken: z.string().optional() });
|
|
134
|
-
export type RunnerCredentialRefresh = z.infer<typeof RunnerCredentialRefreshSchema>;
|
|
135
|
-
|
|
136
|
-
// What a runner is, hardware-wise: what the placement picker shows and what a future scheduler weighs.
|
|
137
|
-
export const RunnerFactsSchema = z.object({
|
|
138
|
-
cpus: z.number().int().positive(),
|
|
139
|
-
memoryMb: z.number().int().positive(),
|
|
140
|
-
freeDiskMb: z.number().int().nonnegative(),
|
|
141
|
-
// 0..1 of the last minute, the coarse "is it busy" a picker needs, not a metrics feed.
|
|
142
|
-
load: z.number().nonnegative(),
|
|
143
|
-
});
|
|
144
|
-
export type RunnerFacts = z.infer<typeof RunnerFactsSchema>;
|
|
145
|
-
|
|
146
|
-
/* WHETHER IT IS RUNNING WHAT THIS SANDBOX IS RUNNING (§7 of the design): `current` matches on image, channel
|
|
147
|
-
* and approved overlay; `outdated` differs on one of them and gets the update button; `unknown` is a runner
|
|
148
|
-
* that has never connected, or a parent that cannot name its own image (a dev daemon), where a warning would
|
|
149
|
-
* be one nobody can act on. Reported, never enforced: an outdated runner still runs turns. */
|
|
150
|
-
export const RunnerParitySchema = z.enum(["current", "outdated", "unknown"]);
|
|
151
|
-
export type RunnerParity = z.infer<typeof RunnerParitySchema>;
|
|
152
|
-
|
|
153
|
-
// One runner as the owner's views list it: enrolled state plus whatever the hub knows right now, the
|
|
154
|
-
// HostSummary shape retold for a runner (no platform/scopes, parity instead).
|
|
155
|
-
export const RunnerSummarySchema = z.object({
|
|
156
|
-
id: z.string(),
|
|
157
|
-
// The connected device holding it, when this sandbox is what asked for it (the Devices view's create
|
|
158
|
-
// flow). Absent for one started by hand on a machine, which this sandbox can dispatch to but not manage.
|
|
159
|
-
host: z.string().optional(),
|
|
160
|
-
online: z.boolean(),
|
|
161
|
-
version: z.string().optional(),
|
|
162
|
-
image: z.string().optional(),
|
|
163
|
-
channel: z.string().optional(),
|
|
164
|
-
overlayHash: z.string().optional(),
|
|
165
|
-
facts: RunnerFactsSchema.optional(),
|
|
166
|
-
lastSeen: z.number().optional(),
|
|
167
|
-
// Computed by the daemon (runners/runner-parity.ts) rather than by each surface, so the badge on a row and
|
|
168
|
-
// the note in the placement picker cannot disagree about the same runner.
|
|
169
|
-
parity: RunnerParitySchema,
|
|
170
|
-
/* Where the runner's environment stands against this sandbox's, one line per difference (the definition
|
|
171
|
-
* surface's drift unit, computed parent-side from the hello's definitionToml plus the overlay hashes).
|
|
172
|
-
* Absent when the runner never said, empty when they agree. Lines whose subject is a Setting are fixable
|
|
173
|
-
* over the live link (the sync door); an overlay line takes a rebuild. */
|
|
174
|
-
drift: z.array(NeedsActionSchema).optional(),
|
|
175
|
-
});
|
|
176
|
-
export type RunnerSummary = z.infer<typeof RunnerSummarySchema>;
|
|
177
|
-
|
|
178
|
-
/* A workspace sync, narrated as it happens: a first contact clones whole repositories, and a person may be
|
|
179
|
-
* watching the "preparing runner" state, so the lines travel while they are produced (runSandboxFlow's
|
|
180
|
-
* argument). `op` says which direction: `pull` brings the runner's checkout of the conversation's branch (and
|
|
181
|
-
* each repo's main line) up to date before a turn, `push` returns the branch after one.
|
|
182
|
-
*
|
|
183
|
-
* `repos` is the conversation's composition as the parent recorded it, because only the parent can know it:
|
|
184
|
-
* the runner's own discovery would see whatever its mirror held from LAST time, and a repo added to the
|
|
185
|
-
* workspace since would silently fall out of the conversation. Each entry names the repo id (the git-door
|
|
186
|
-
* address), the workspace-relative dir the checkout lives at, and the repo's own main branch name. */
|
|
187
|
-
export const RunnerSyncSchema = z.object({
|
|
188
|
-
op: z.enum(["pull", "push"]),
|
|
189
|
-
conversationId: z.string().min(1),
|
|
190
|
-
branch: z.string().min(1),
|
|
191
|
-
repos: z.array(
|
|
192
|
-
z.object({
|
|
193
|
-
repo: z.string().min(1),
|
|
194
|
-
// "" for the workspace root itself; every other repo sits at its root-relative dir.
|
|
195
|
-
dir: z.string(),
|
|
196
|
-
mainBranch: z.string().min(1),
|
|
197
|
-
}),
|
|
198
|
-
),
|
|
199
|
-
});
|
|
200
|
-
export type RunnerSync = z.infer<typeof RunnerSyncSchema>;
|
|
201
|
-
|
|
202
|
-
export const RunnerSyncLineSchema = z.union([
|
|
203
|
-
z.object({ kind: z.literal("line"), text: z.string() }),
|
|
204
|
-
z.object({ kind: z.literal("done"), ok: z.boolean(), detail: z.string().optional() }),
|
|
205
|
-
]);
|
|
206
|
-
export type RunnerSyncLine = z.infer<typeof RunnerSyncLineSchema>;
|
|
207
|
-
|
|
208
|
-
/* One turn, as dispatched. Deliberately NOT AgentTurnSchema: that schema is the browser's request to the
|
|
209
|
-
* parent, full of fields the parent resolves before anything executes (persona, account, title, forks). What
|
|
210
|
-
* crosses the link is the residue after resolution, what the runner's harness spawn actually needs, plus the
|
|
211
|
-
* attachments inline, because the runner has no route onto the parent's attachment store. */
|
|
212
|
-
export const RunnerTurnSchema = z.object({
|
|
213
|
-
conversationId: z.string().min(1),
|
|
214
|
-
branch: z.string().min(1),
|
|
215
|
-
prompt: z.string(),
|
|
216
|
-
provider: z.string(),
|
|
217
|
-
harness: z.string(),
|
|
218
|
-
model: z.string().optional(),
|
|
219
|
-
effort: z.string().optional(),
|
|
220
|
-
thinking: z.boolean().optional(),
|
|
221
|
-
fast: z.boolean().optional(),
|
|
222
|
-
// Which of the ORIGIN sandbox's connected accounts pays for the turn: the runner resolves credentials
|
|
223
|
-
// against the parent (the credential doors below), so this names an account THERE.
|
|
224
|
-
account: z.string().optional(),
|
|
225
|
-
sessionId: z.string().optional(),
|
|
226
|
-
// Base64 because frames are JSON: small by policy (the request schema already caps attachment count), and
|
|
227
|
-
// a turn's attachments are the one payload with no git road to travel. `path` is the workspace-relative
|
|
228
|
-
// path the prompt already names; the runner writes the bytes there so the words and the file agree.
|
|
229
|
-
attachments: z.array(z.object({ path: z.string().min(1), bytesBase64: z.string() })).optional(),
|
|
230
|
-
});
|
|
231
|
-
export type RunnerTurn = z.infer<typeof RunnerTurnSchema>;
|
|
232
|
-
|
|
233
|
-
/* WHERE A CONVERSATION RUNS, decided on its first turn and owned by the conversation from then on, exactly as
|
|
234
|
-
* `isolated` placement already works (agent.routes.ts): later turns follow the registry entry, not whichever
|
|
235
|
-
* client sends them. `runner` implies isolation, a remote conversation is always branch-anchored, because its
|
|
236
|
-
* branch is the unit that moves between machines. Absent means local, which is why this is optional
|
|
237
|
-
* everywhere: the default costs nothing to anyone who never uses it. */
|
|
238
|
-
export const AgentPlacementSchema = z.union([z.object({ kind: z.literal("local") }), z.object({ kind: z.literal("runner"), id: z.string().min(1) })]);
|
|
239
|
-
export type AgentPlacement = z.infer<typeof AgentPlacementSchema>;
|
package/src/runtime-state.ts
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/* WHICH RUNNING THING BACKS WHICH VIEW, the twin of workspace-state.ts, for state that never touches a file.
|
|
2
|
-
*
|
|
3
|
-
* That table answers "the agent wrote a file, so which view is stale". This one answers the same question for
|
|
4
|
-
* the half of the sandbox that has no file to watch: the tmux sessions, the dev-server panels, the listening
|
|
5
|
-
* sockets, the agent's Chromiums, the children its turns spawn. None of them are on disk, so no
|
|
6
|
-
* `workspaceChanged` batch can ever mention them, and for want of a push, every one of those views polled.
|
|
7
|
-
*
|
|
8
|
-
* The polls were the tell. Six always-on timers (a 10s terminals relist behind THREE mounted surfaces, a 15s
|
|
9
|
-
* port scan behind the shell rail, a 4s panel relist for as long as any dev server ran) that each asked a
|
|
10
|
-
* question whose answer is almost always "nothing changed", forever, in every open tab. The daemon knew the real
|
|
11
|
-
* answer the whole time: it is the process that starts the panel, mints the browser, and opens the session.
|
|
12
|
-
*
|
|
13
|
-
* So the daemon says so, on the stream that already carries every other change, and the browser asks only when
|
|
14
|
-
* told to. The declaration lives HERE for the reason its twin does: the daemon publishes a DOMAIN and the
|
|
15
|
-
* browser turns it into query keys, and those two facts drift the moment they are written down in two packages.
|
|
16
|
-
*
|
|
17
|
-
* A key belongs to whoever queries it, the extension views that render ports and panels ask under the SAME key
|
|
18
|
-
* as core (api.sandbox.key("ports") is sandboxKey("ports")), so one entry here refreshes both surfaces and an
|
|
19
|
-
* extension needs no declaration of its own. */
|
|
20
|
-
|
|
21
|
-
/* One query key as the browser files it, a segment per level, so a binding can name a NESTED key and not only
|
|
22
|
-
* a top-level one. Most domains here are a single segment and read as they always did; the review is not. Its
|
|
23
|
-
* key is `["git", "changes"]` (the browser appends the sandbox id, and every open file diff hangs beneath it),
|
|
24
|
-
* and a domain that could only say `"git"` would drop the commit log along with it, a second read of the graph
|
|
25
|
-
* to deliver a sentence that has nothing to do with it. */
|
|
26
|
-
export type QueryKeyPath = readonly string[];
|
|
27
|
-
|
|
28
|
-
export interface RuntimeDomainBinding {
|
|
29
|
-
// What moved, in the daemon's words. Wire data: it rides the runtimeChanged frame.
|
|
30
|
-
readonly domain: string;
|
|
31
|
-
/* The browser query keys this domain's state feeds. Invalidation reaches only queries something is
|
|
32
|
-
* OBSERVING, so a domain nobody has on screen costs a frame and no request, which is what lets a domain be
|
|
33
|
-
* pushed eagerly without billing every tab for a view it isn't showing. */
|
|
34
|
-
readonly invalidates: readonly QueryKeyPath[];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* Declared `as const` so the domain names survive as literal types (see RuntimeDomain below), then published
|
|
38
|
-
* under the interface, the same two-binding shape, for the same reason, as WORKSPACE_STATE_FILES. */
|
|
39
|
-
const RUNTIME_DOMAINS = [
|
|
40
|
-
/* Every attachable tmux session: the terminal panel's tab strip, the rail's activity badge, and the work
|
|
41
|
-
* popover's background-process rows all read this one list. Sampled rather than announced, a pane dies
|
|
42
|
-
* when its command exits and tmux tells nobody, but sampled ONCE in the daemon, on a connection the
|
|
43
|
-
* browsers already hold, instead of once per browser per 10s over the tunnel. */
|
|
44
|
-
{ domain: "terminals", invalidates: [["terminals"]] },
|
|
45
|
-
|
|
46
|
-
/* A repo's dev server: running, healthy, and the preview URL it answers on. Two independent things move it,
|
|
47
|
-
* and it needs both, the process manager starting or reaping a session (announced), and the server
|
|
48
|
-
* actually binding its port some seconds later, which is what flips "starting" to "healthy" (seen by the
|
|
49
|
-
* port sampler, since panel health is read off the listening sockets, see panels.ts listenersByRepo).
|
|
50
|
-
*
|
|
51
|
-
* `apps` rides it because a monorepo's per-app previews ARE managed processes under the same manager
|
|
52
|
-
* (workspace.routes appsList reads processes.portOf), just listed per repo instead of per repo-root. One
|
|
53
|
-
* domain, because there is one fact: a dev server the daemon runs started, settled, or died. */
|
|
54
|
-
{ domain: "panels", invalidates: [["panels"], ["apps"]] },
|
|
55
|
-
|
|
56
|
-
/* Every listening TCP socket in the sandbox, and which of them are forwarded to a public preview hostname.
|
|
57
|
-
* The daemon runs no port poller for the ANSWER, attributing a socket to its process walks every /proc fd
|
|
58
|
-
* table, far too much to do on a timer, so what is sampled is only the LISTEN set out of /proc/net/tcp:
|
|
59
|
-
* two file reads, enough to know that the answer changed and worth nobody's while to compute until a view
|
|
60
|
-
* asks. Change detection and payload are deliberately different sizes here. */
|
|
61
|
-
{ domain: "ports", invalidates: [["ports"]] },
|
|
62
|
-
|
|
63
|
-
// The agent's Chromiums and the pages each holds open, daemon-held records, minted from the hooks that see
|
|
64
|
-
// the agent's own browser tool calls, so every change to this roster passes through this process.
|
|
65
|
-
{ domain: "browsers", invalidates: [["browsers"]] },
|
|
66
|
-
|
|
67
|
-
// The agents this sandbox's agents started. Daemon-held like the browsers, and the one roster here that
|
|
68
|
-
// changes while nothing starts or stops: a working child reports tool uses and tokens continuously, which
|
|
69
|
-
// is why the daemon rate-limits this domain rather than pushing every mutation (see runtime-watch.ts).
|
|
70
|
-
{ domain: "subagents", invalidates: [["subagents"]] },
|
|
71
|
-
|
|
72
|
-
/* THE MACHINES ON THE OTHER END OF A SOCKET, three domains that are one story: the user's devices, the
|
|
73
|
-
* browsers holding the extension, and this sandbox's runners.
|
|
74
|
-
*
|
|
75
|
-
* Announced, and about as announced as a fact can be. "Online" here is not sampled, inferred or timed out
|
|
76
|
-
* of, it IS a socket in this process: the hub accepts one, replaces one, drops one on a failed heartbeat, or
|
|
77
|
-
* cuts one on a revoke, and those four moments are the entire set of ways the answer changes. Nothing on
|
|
78
|
-
* disk moves, no pane appears, and no other feed could carry it.
|
|
79
|
-
*
|
|
80
|
-
* They land on `capabilities` because a host or webext card's state is LITERALLY the hub's answer
|
|
81
|
-
* (handlers/host.ts: `hub.online(id) ? active : pending`), which is what a person watches while they paste a
|
|
82
|
-
* pairing command into a laptop. That wait is the whole reason these are here: it was three seconds of
|
|
83
|
-
* polling per card, running only because nobody had told the browser that the daemon already knew. */
|
|
84
|
-
{ domain: "hosts", invalidates: [["capabilities"], ["devices"]] },
|
|
85
|
-
{ domain: "webext", invalidates: [["capabilities"]] },
|
|
86
|
-
{ domain: "runners", invalidates: [["runners"]] },
|
|
87
|
-
|
|
88
|
-
/* The approvals queue, when the DAEMON moves it rather than the owner. Approving is the owner's own mutation
|
|
89
|
-
* and refetches itself, but everything after that happens while nobody is touching the page: a held item
|
|
90
|
-
* coming due, a Discord send landing, an executing turn writing back what happened. Those are the moments
|
|
91
|
-
* the row on screen stops being true, and this queue is watched precisely because its rows act in public,
|
|
92
|
-
* so it is the last place to leave someone reading a stale one. */
|
|
93
|
-
{ domain: "approvals", invalidates: [["approvals"]] },
|
|
94
|
-
|
|
95
|
-
/* WHAT A LANDED AGENT'S WORK IS CALLED, the commit message drafted from the diff the moment that work
|
|
96
|
-
* reaches the main tree (agents/landed-subject.ts), which the review's "From" chip files into the commit box.
|
|
97
|
-
*
|
|
98
|
-
* It needs a push of its own because it arrives LATE, and alone. The review refreshes when a turn ends; the
|
|
99
|
-
* sentence is a model call that STARTS there and answers seconds later, so the refresh the landing itself
|
|
100
|
-
* causes is always too early to carry it. Nothing followed. The message then sat in the daemon, correct and
|
|
101
|
-
* unread, until some unrelated write happened to refresh the panel again, and a chip clicked in that window
|
|
102
|
-
* filed nothing at all, which is indistinguishable from the feature having been removed.
|
|
103
|
-
*
|
|
104
|
-
* Neither a file nor a ref, so this is the only feed that could carry it: the entry holding it lives on
|
|
105
|
-
* /history, outside the watched tree, and no ref moves when a sentence is written.
|
|
106
|
-
*
|
|
107
|
-
* Being in this table also puts the review on the reconnect re-ask (runtimeBoundQueryKeys), and that is the
|
|
108
|
-
* half of the fix nothing else covers: a publish with no browser connected is dropped, so a landing drafted
|
|
109
|
-
* while the app was closed or the tunnel was down would otherwise stay invisible for as long as the panel's
|
|
110
|
-
* snapshot survived, which, at staleTime Infinity, is until something unrelated moved. It costs one review
|
|
111
|
-
* read per (re)connect, against a chip that files nothing for the rest of the session. */
|
|
112
|
-
{ domain: "landings", invalidates: [["git", "changes"]] },
|
|
113
|
-
] as const satisfies readonly RuntimeDomainBinding[];
|
|
114
|
-
|
|
115
|
-
export const RUNTIME_DOMAIN_BINDINGS: readonly RuntimeDomainBinding[] = RUNTIME_DOMAINS;
|
|
116
|
-
|
|
117
|
-
/* Every domain this table declares, as a type, so a publish site names one of THESE and nothing else, and a
|
|
118
|
-
* renamed domain is a compile error in the daemon rather than a frame the browser silently routes nowhere. */
|
|
119
|
-
export type RuntimeDomain = (typeof RUNTIME_DOMAINS)[number]["domain"];
|
|
120
|
-
|
|
121
|
-
/* Distinct key paths, in table order, two domains in one frame routinely feed the same view, and a Set cannot
|
|
122
|
-
* see that because each path is its own array. Compared by their segments joined, which is exact: a segment is
|
|
123
|
-
* one identifier from this file, never a caller's string, so there is no separator to collide on. */
|
|
124
|
-
const dedupe = (keys: readonly QueryKeyPath[]): readonly QueryKeyPath[] => [...new Map(keys.map((key) => [key.join(`/`), key])).values()];
|
|
125
|
-
|
|
126
|
-
/* The query keys a pushed set of domains makes stale, deduped and stable, the browser's `/events` handler
|
|
127
|
-
* calls this, exactly as it calls staleQueryKeys for a path batch. Kept here rather than in the web so the rule
|
|
128
|
-
* is unit-testable without a query client, and so the daemon can assert against the same table.
|
|
129
|
-
*
|
|
130
|
-
* An unknown domain contributes nothing rather than throwing: a daemon newer than the browser may name a domain
|
|
131
|
-
* this build has never heard of, and the honest response to that is to refresh what we do understand. */
|
|
132
|
-
export const staleRuntimeQueryKeys = (domains: readonly string[]): readonly QueryKeyPath[] =>
|
|
133
|
-
dedupe(RUNTIME_DOMAIN_BINDINGS.filter((binding) => domains.includes(binding.domain)).flatMap((binding) => binding.invalidates));
|
|
134
|
-
|
|
135
|
-
/* Every query key any runtime domain feeds, what a NEW /events connection re-asks wholesale, for precisely the
|
|
136
|
-
* reason fileBoundQueryKeys exists: this push is these views' ONLY live feed, and a frame produced while the
|
|
137
|
-
* stream was down is a frame nobody will resend. A panel that finished starting, a session that exited, a port
|
|
138
|
-
* that closed while the browser was away would otherwise sit wrong until the next unrelated change. Re-asking
|
|
139
|
-
* on connect bounds that at one cheap read per key, which is what lets these views go entirely unpolled. */
|
|
140
|
-
export const runtimeBoundQueryKeys = (): readonly QueryKeyPath[] => dedupe(RUNTIME_DOMAIN_BINDINGS.flatMap((binding) => binding.invalidates));
|