@intentic/sandbox-contract 1.248.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 +12 -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 +1 -0
- package/dist/contracts/personas.contract.d.ts.map +1 -1
- package/dist/contracts/personas.contract.js +1 -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 +97 -171
- 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 +8 -18
- 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 +423 -450
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -46
- 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} +1 -1
- package/dist/models/model-pins.d.ts.map +1 -0
- package/dist/models/model-pins.js.map +1 -0
- package/dist/{model-roles.d.ts → models/model-roles.d.ts} +0 -33
- package/dist/models/model-roles.d.ts.map +1 -0
- package/dist/{model-roles.js → models/model-roles.js} +0 -35
- 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 +16 -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 +2 -1
- package/dist/schemas/personas.d.ts.map +1 -1
- package/dist/schemas/personas.js +6 -2
- 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 +6 -9
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +16 -5
- 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 -0
- package/dist/state/workspace-state.d.ts.map +1 -0
- package/dist/{workspace-state.js → state/workspace-state.js} +25 -0
- 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 +10 -35
- 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 -87
- 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/{model-pins.test.ts → models/model-pins.test.ts} +12 -46
- 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 +142 -250
- 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 +50 -200
- 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 +175 -600
- 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 -172
- 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.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/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.ts +0 -132
- package/src/model-roles.test.ts +0 -52
- package/src/model-roles.ts +0 -320
- 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/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 -1090
- /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/{model-pins.js → models/model-pins.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/definition.ts
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { NeedsActionSchema } from "./needs-action.js";
|
|
3
|
-
import { CapabilitySchema } from "./schemas/capabilities.js";
|
|
4
|
-
import { SandboxSettingsSchema } from "./schemas/settings.js";
|
|
5
|
-
|
|
6
|
-
/* THE SANDBOX DEFINITION: the declarable SHAPE of a sandbox, split off from its state.
|
|
7
|
-
*
|
|
8
|
-
* A bundle (BundleSchema, schemas/maintenance.ts) moves everything a sandbox holds; this is the half of it that
|
|
9
|
-
* is a REFERENCE to a source of truth rather than bytes only this sandbox has: which repos (as remotes a
|
|
10
|
-
* target can clone), which connections (as shapes a target re-authenticates), which overlay steps (as source
|
|
11
|
-
* a target's owner approves), which secrets (as NAMES a target asks for), which agent settings. Everything
|
|
12
|
-
* here can be reproduced against the world; everything a bundle carries beyond it (transcripts, checkpoint
|
|
13
|
-
* timelines, unpushed branches, ledgers) cannot, which is the line between the two formats.
|
|
14
|
-
*
|
|
15
|
-
* ON THE WIRE AND ON DISK IT IS TOML (`sandbox.toml`), hand-writable and diffable; these schemas are what the
|
|
16
|
-
* parsed document must satisfy. The choice of a definition never relaxes the consent model: applying one
|
|
17
|
-
* writes the overlay as a PROPOSAL for the owner's approval gate, lands capabilities unauthenticated, and
|
|
18
|
-
* never carries a credential value, so a definition is safe to publish in a way a bundle never is.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
// One repository, by reference: the id it lands under in the workspace, where a target clones it from, and
|
|
22
|
-
// (optionally) the branch to check out. A repo with NO remote cannot appear here, the exporter reports it as
|
|
23
|
-
// omitted instead of inventing a source for bytes only the source sandbox holds.
|
|
24
|
-
export const DefinitionRepositorySchema = z.strictObject({
|
|
25
|
-
// Workspace-relative repo id ("intentic", "clients/foo"), the same id the wire {repo} routes use.
|
|
26
|
-
id: z.string().min(1),
|
|
27
|
-
// The clone URL, verbatim from the source repo's own remote.
|
|
28
|
-
remote: z.string().min(1),
|
|
29
|
-
// The branch to check out; absent means the remote's default.
|
|
30
|
-
ref: z.string().optional(),
|
|
31
|
-
});
|
|
32
|
-
export type DefinitionRepository = z.infer<typeof DefinitionRepositorySchema>;
|
|
33
|
-
|
|
34
|
-
/* THE WORKSPACE ITSELF, by reference. `/work` is a git repo of its own (the daemon's `root` scope, git dir on
|
|
35
|
-
* /history), tracking every workspace file that is not a nested repo, the reference shelf, or daemon-internal
|
|
36
|
-
* state — which by the versioned-state allowlist means the owner's AUTHORED content: notes, skills, personas,
|
|
37
|
-
* automations, workflow and loop designs, approvals, workspace extensions. None of that has a source anywhere else,
|
|
38
|
-
* so before this section a definition could only shrug at it and a bundle was the sole way to move it.
|
|
39
|
-
*
|
|
40
|
-
* With a remote it becomes referenceable like any other repo, which is the whole point: `[workspace]` plus
|
|
41
|
-
* `[[repositories]]` is a sandbox's code AND its way of working, and what remains bundle-only is exactly what
|
|
42
|
-
* cannot be pushed anywhere — secrets, identity, /history, the built image.
|
|
43
|
-
*
|
|
44
|
-
* A workspace with no remote cannot appear here; the exporter says so in `omitted` rather than inventing one. */
|
|
45
|
-
export const DefinitionWorkspaceSchema = z.strictObject({
|
|
46
|
-
// The clone URL, verbatim from the workspace repo's own remote.
|
|
47
|
-
remote: z.string().min(1),
|
|
48
|
-
// The branch to check out; absent means the remote's default.
|
|
49
|
-
ref: z.string().optional(),
|
|
50
|
-
});
|
|
51
|
-
export type DefinitionWorkspace = z.infer<typeof DefinitionWorkspaceSchema>;
|
|
52
|
-
|
|
53
|
-
export const DefinitionEnvironmentSchema = z.strictObject({
|
|
54
|
-
// The image the overlay extends, informational: the target composes against ITS OWN base (see
|
|
55
|
-
// composeEnvironment's baseImageOf), this records what the source was on.
|
|
56
|
-
baseImage: z.string().optional(),
|
|
57
|
-
/* The owner-approved CUSTOM overlay section, as source. Deliberately not the composed file and
|
|
58
|
-
* deliberately without the approval hash: consent does not travel, so an applied definition parks this at
|
|
59
|
-
* the target owner's approval gate rather than executing it. */
|
|
60
|
-
dockerfile: z.string().optional(),
|
|
61
|
-
});
|
|
62
|
-
export type DefinitionEnvironment = z.infer<typeof DefinitionEnvironmentSchema>;
|
|
63
|
-
|
|
64
|
-
/* The settings section: every SandboxSettings field, optional, WITHOUT its default. `.partial()` alone keeps
|
|
65
|
-
* each field's `.default()`, so a document naming two flags would parse into the whole surface at today's
|
|
66
|
-
* defaults — the opposite of "state only decisions", and it would freeze those defaults into every future
|
|
67
|
-
* apply. Unwrapping first is what makes an absent key STAY absent, so applying merges over the target's own
|
|
68
|
-
* settings and a definition round-trips through parse byte-identically. */
|
|
69
|
-
// Both wrapper classes, in a loop: a field can be a default inside a prefault, and either one left on would
|
|
70
|
-
// re-materialize its value for an absent key.
|
|
71
|
-
const bareField = (field: z.ZodType): z.ZodType => {
|
|
72
|
-
let inner = field;
|
|
73
|
-
while (inner instanceof z.ZodDefault || inner instanceof z.ZodPrefault) {
|
|
74
|
-
inner = inner.unwrap() as z.ZodType;
|
|
75
|
-
}
|
|
76
|
-
return inner;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const definitionSettings = (): z.ZodType<Partial<z.infer<typeof SandboxSettingsSchema>>> => {
|
|
80
|
-
const shape = Object.fromEntries(Object.entries(SandboxSettingsSchema.shape).map(([key, field]) => [key, bareField(field).optional()]));
|
|
81
|
-
return z.strictObject(shape).prefault({}) as unknown as z.ZodType<Partial<z.infer<typeof SandboxSettingsSchema>>>;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export const SandboxDefinitionSchema = z.strictObject({
|
|
85
|
-
// Bumped when the layout changes in a way an older daemon would misread. Refused rather than guessed at,
|
|
86
|
-
// the bundle manifest's own rule.
|
|
87
|
-
schemaVersion: z.literal(1),
|
|
88
|
-
// What the source sandbox was called, for the reader; never used to authorize anything.
|
|
89
|
-
name: z.string().optional(),
|
|
90
|
-
environment: DefinitionEnvironmentSchema.prefault({}),
|
|
91
|
-
// The workspace repo itself, when it has a remote to be named by. Absent is the ordinary state of a
|
|
92
|
-
// workspace nobody has published, not an error.
|
|
93
|
-
workspace: DefinitionWorkspaceSchema.optional(),
|
|
94
|
-
repositories: z.array(DefinitionRepositorySchema).prefault([]),
|
|
95
|
-
/* Each connection IN FULL (id, kind, config), not merely named: the manifest they come from carries the
|
|
96
|
-
* SHAPE of a connection and never its credential (workspace-state.ts argues the split on the
|
|
97
|
-
* capabilities.json entry, and the exporter sweeps before reading), so what lands on a target is the card,
|
|
98
|
-
* visibly unauthenticated, waiting for one credential apiece. */
|
|
99
|
-
capabilities: z.array(CapabilitySchema).prefault([]),
|
|
100
|
-
// Secret NAMES only, what the target should ask its owner for. Values never enter a definition.
|
|
101
|
-
secrets: z.array(z.string()).prefault([]),
|
|
102
|
-
// The agent settings that differ from their defaults. Partial on purpose: a definition states decisions,
|
|
103
|
-
// not the whole flag surface, so a flag it does not mention keeps the target's own default.
|
|
104
|
-
settings: definitionSettings(),
|
|
105
|
-
});
|
|
106
|
-
export type SandboxDefinition = z.infer<typeof SandboxDefinitionSchema>;
|
|
107
|
-
|
|
108
|
-
// One "do this by hand" line, the honesty unit the arrival surface carries too: a subject the UI bolds and a
|
|
109
|
-
// detail written as an instruction to the owner. Defined in its own leaf module (needs-action.ts says why)
|
|
110
|
-
// and re-exported here, where every consumer of the definition surface finds it.
|
|
111
|
-
export { NeedsActionSchema, type NeedsAction } from "./needs-action.js";
|
|
112
|
-
|
|
113
|
-
// What GET /definition answers: the emitted TOML, plus what the derivation could not express (a repo with no
|
|
114
|
-
// remote), listed rather than silent, the export's own `excluded` discipline.
|
|
115
|
-
export const DefinitionExportSchema = z.object({
|
|
116
|
-
toml: z.string(),
|
|
117
|
-
omitted: z.array(NeedsActionSchema),
|
|
118
|
-
});
|
|
119
|
-
export type DefinitionExport = z.infer<typeof DefinitionExportSchema>;
|
|
120
|
-
|
|
121
|
-
/* APPLYING one is not here. A definition is one of four things that can ARRIVE in a sandbox, and it lands
|
|
122
|
-
* through the shared pipeline in arrival.ts (ArrivalPlan → ArrivalApply → ArrivalReport) rather than through
|
|
123
|
-
* a plan/apply/report trio of its own. What stays on this file is the outbound half and the read: deriving
|
|
124
|
-
* the document, and where this sandbox stands relative to one. */
|
|
125
|
-
|
|
126
|
-
// Where this sandbox stands relative to a definition: one line per difference, empty when they agree. The
|
|
127
|
-
// drift answer, computable because the emitter is deterministic.
|
|
128
|
-
export const DefinitionDiffSchema = z.object({
|
|
129
|
-
differences: z.array(NeedsActionSchema),
|
|
130
|
-
});
|
|
131
|
-
export type DefinitionDiff = z.infer<typeof DefinitionDiffSchema>;
|
|
132
|
-
|
|
133
|
-
/* ---- publishing the workspace repo, the one step a definition cannot take for itself ----
|
|
134
|
-
*
|
|
135
|
-
* `[workspace]` names a remote; nothing can name one that does not exist. So the owner-facing half of the
|
|
136
|
-
* feature is this: create a PRIVATE repo on a connected git host and push /work to it, or adopt a URL the
|
|
137
|
-
* owner made themselves. Deliberately its own route rather than a side effect of the export, publishing a
|
|
138
|
-
* workspace is an outward act with its own confirmation, and deriving a document must stay read-only.
|
|
139
|
-
*/
|
|
140
|
-
export const WorkspacePublishSchema = z.object({
|
|
141
|
-
/* An existing repo's clone URL. Given, nothing is created: the remote is wired up and pushed to, which is
|
|
142
|
-
* the path for an owner who made the repo themselves or is moving hosts. */
|
|
143
|
-
remote: z.string().min(1).optional(),
|
|
144
|
-
// The repo to create when `remote` is absent. Owner-side default is the sandbox's own name.
|
|
145
|
-
name: z.string().min(1).optional(),
|
|
146
|
-
/* The account or organization to create it under; absent means the authenticated user. Ignored when
|
|
147
|
-
* `remote` is given. */
|
|
148
|
-
owner: z.string().min(1).optional(),
|
|
149
|
-
});
|
|
150
|
-
export type WorkspacePublish = z.infer<typeof WorkspacePublishSchema>;
|
|
151
|
-
|
|
152
|
-
// Where the workspace now lives, and what a definition will name. `created` distinguishes "made you a repo"
|
|
153
|
-
// from "wired up the one you gave me", which is the difference the card reports back.
|
|
154
|
-
export const WorkspacePublishResultSchema = z.object({
|
|
155
|
-
remote: z.string(),
|
|
156
|
-
branch: z.string(),
|
|
157
|
-
created: z.boolean(),
|
|
158
|
-
});
|
|
159
|
-
export type WorkspacePublishResult = z.infer<typeof WorkspacePublishResultSchema>;
|
|
160
|
-
|
|
161
|
-
// What the card renders before anything is published: whether /work has a remote, and which connected git
|
|
162
|
-
// hosts could make one. Read-only, so the button can say "Publish to github.com" rather than opening a form
|
|
163
|
-
// into a void.
|
|
164
|
-
export const WorkspaceRemoteSchema = z.object({
|
|
165
|
-
remote: z.string().optional(),
|
|
166
|
-
branch: z.string().optional(),
|
|
167
|
-
// Hostnames of connected github/gitlab accounts, in the order they would be tried. Empty means the owner
|
|
168
|
-
// must connect one (or paste a URL).
|
|
169
|
-
hosts: z.array(z.string()),
|
|
170
|
-
});
|
|
171
|
-
export type WorkspaceRemote = z.infer<typeof WorkspaceRemoteSchema>;
|
|
172
|
-
|
|
173
|
-
/* ---- the bundle manifest, restated on the definition ----
|
|
174
|
-
*
|
|
175
|
-
* A bundle is DEFINITION + STATE: its manifest embeds the same definition `GET /definition` emits, and the
|
|
176
|
-
* tar entries behind it carry what no definition can reference (git dirs, transcripts, ledgers). One schema,
|
|
177
|
-
* two doors, which is what keeps the two formats from drifting into different answers about what an
|
|
178
|
-
* environment IS. A manifest whose version this daemon does not know is refused rather than guessed at.
|
|
179
|
-
*
|
|
180
|
-
* Version 3 added `repos`, and it is the field that made a bundle previewable. Taking one in is now a plan
|
|
181
|
-
* the owner ticks (arrival.ts), and a plan has to say what is in the tar BEFORE the tar is read: which
|
|
182
|
-
* repositories a bundle carries could previously only be learned by walking every entry, because
|
|
183
|
-
* `definition.repositories` lists only the ones that HAVE a remote to be named by. A bundle that cannot
|
|
184
|
-
* describe its own contents can only be offered whole, which is exactly the all-or-nothing this replaced.
|
|
185
|
-
*/
|
|
186
|
-
export const BundleManifestSchema = z.object({
|
|
187
|
-
// Bumped when the layout changes in a way an older daemon would misread. Refused rather than guessed at.
|
|
188
|
-
version: z.literal(3),
|
|
189
|
-
// Where it came from, for the report's first line. Never used to authorize anything.
|
|
190
|
-
sandbox: z.object({ name: z.string() }).optional(),
|
|
191
|
-
createdAt: z.number(),
|
|
192
|
-
// The owner's export-time choice; the restorer re-derives every decision from the manifests rather than
|
|
193
|
-
// trusting this, and uses it only to explain what is missing.
|
|
194
|
-
secrets: z.boolean(),
|
|
195
|
-
/* Every repository whose real git dir rides in this bundle, by workspace id — INCLUDING the ones no
|
|
196
|
-
* definition can name, which is the point: a repo with no remote is invisible to `definition.repositories`
|
|
197
|
-
* and is precisely the one an owner most wants carried by bytes. "root" is not listed; the workspace repo
|
|
198
|
-
* itself is not a nested repository and travels with the workspace files. */
|
|
199
|
-
repos: z.array(z.string()),
|
|
200
|
-
// The declarable shape, exactly what a definition export emits, so the restore report reasons over the
|
|
201
|
-
// same facts either door delivers.
|
|
202
|
-
definition: SandboxDefinitionSchema,
|
|
203
|
-
// Every path class the bundle deliberately left out, with the manifest's own note where it has one. This is
|
|
204
|
-
// what turns "the export skipped things" from a silence into a list the owner can act on.
|
|
205
|
-
excluded: z.array(z.object({ path: z.string(), portability: z.string(), note: z.string().optional() })),
|
|
206
|
-
});
|
|
207
|
-
export type BundleManifest = z.infer<typeof BundleManifestSchema>;
|
package/src/documents.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { CardDocument, ToolCallContent } from "./events.js";
|
|
2
|
-
import { planParts } from "./title.js";
|
|
3
|
-
import { PLAN_DOCUMENTS_DIR } from "./workspace-state.js";
|
|
4
|
-
|
|
5
|
-
/* A DOCUMENT A TURN WROTE FOR A PERSON TO READ, told apart from the files it changed for the machine.
|
|
6
|
-
*
|
|
7
|
-
* A transcript renders ACTS: a file was written, a command ran, a page was fetched. That is the right shape for
|
|
8
|
-
* nearly everything an agent does, and the wrong shape for the one thing it produces that is addressed to the
|
|
9
|
-
* reader. An analysis, a findings write-up, a plan: the card for those said `Write · +135 −0` and folded, so the
|
|
10
|
-
* document the next question was ABOUT was the one thing the chat would not show. Worse, the model reaches for a
|
|
11
|
-
* file precisely BECAUSE prose in the answer is expensive, so the better it behaves the less the reader sees.
|
|
12
|
-
*
|
|
13
|
-
* The rules live here, in the contract, because both sides run them and they must not drift: the daemon reads
|
|
14
|
-
* them to decide what a parked card is about (agent.ts), the browser to decide how a tool card draws
|
|
15
|
-
* (toolPresentation.ts). Two copies would let a card render a document the question card had never heard of.
|
|
16
|
-
*
|
|
17
|
-
* ONLY A WHOLE-FILE WRITE COUNTS. An Edit's `newText` is the replacement fragment, not the document: rendered as
|
|
18
|
-
* prose it is a mid-sentence slice with no heading, and the DIFF is what a reader wants from an edit anyway. So
|
|
19
|
-
* a Write of a markdown file is a document, and an edit to one stays a diff. */
|
|
20
|
-
|
|
21
|
-
// Prose, by extension. Deliberately short: a document is something the chat can RENDER, and markdown is what
|
|
22
|
-
// the chat's prose pipeline speaks. A `.txt` report would render as an unstyled wall and reads better as the
|
|
23
|
-
// plain text box it already gets.
|
|
24
|
-
const DOCUMENT_EXTENSIONS = [".md", ".markdown"];
|
|
25
|
-
|
|
26
|
-
export const isDocumentPath = (path: string): boolean => {
|
|
27
|
-
const lower = path.toLowerCase();
|
|
28
|
-
return DOCUMENT_EXTENSIONS.some((extension) => lower.endsWith(extension));
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/* Whether a path is one of the CLI's plan files, which is what earns a document the plan treatment here rather
|
|
32
|
-
* than the general markdown rule above: the harness owns that address, so there is no guessing whether prose is
|
|
33
|
-
* a plan and no threshold on length. Matched on the DIRECTORY rather than on the name, which is a mint-fresh
|
|
34
|
-
* three-word phrase (`map-of-this-wiggly-spring.md`) carrying no signal at all.
|
|
35
|
-
*
|
|
36
|
-
* The directory itself is declared in workspace-state.ts, beside the lock it is the one exception to. */
|
|
37
|
-
export const isPlanDocumentPath = (path: string): boolean => path.startsWith(`${PLAN_DOCUMENTS_DIR}/`);
|
|
38
|
-
|
|
39
|
-
/* What a document is CALLED. Its opening heading when it has one, which is the line the author wrote to name
|
|
40
|
-
* the whole thing (planParts, the same split the plan card titles from), and its file name when it does not.
|
|
41
|
-
*
|
|
42
|
-
* Never the path: a card that says `.intentic/records/sessions/claude/plans/map-of-this-wiggly-spring.md`
|
|
43
|
-
* has told the reader nothing about what is in it, and that string is the CLI's mint, not anybody's title. */
|
|
44
|
-
export const documentTitle = (markdown: string, path: string): string => planParts(markdown).title ?? path.split("/").pop() ?? path;
|
|
45
|
-
|
|
46
|
-
/* The document a tool call produced, or undefined when it produced none, the ONE test both sides ask.
|
|
47
|
-
*
|
|
48
|
-
* Reads the call's structured diff rather than its result text, because the content is already there: a Write's
|
|
49
|
-
* whole file rides the tool_call frame as `newText` (capped at the wire limit, which `truncated` reports), so
|
|
50
|
-
* nothing has to be re-read from disk to draw it, and a published transcript with no workspace behind it draws
|
|
51
|
-
* exactly the same document. */
|
|
52
|
-
export const documentOf = (name: string, content: readonly ToolCallContent[] | undefined): CardDocument | undefined => {
|
|
53
|
-
if (name.toLowerCase() !== "write") {
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
const diff = content?.find((entry) => entry.type === "diff" && isDocumentPath(entry.path));
|
|
57
|
-
if (diff === undefined || diff.type !== "diff") {
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
path: diff.path,
|
|
62
|
-
title: documentTitle(diff.newText, diff.path),
|
|
63
|
-
markdown: diff.newText,
|
|
64
|
-
...(diff.truncated === true ? { truncated: true } : {}),
|
|
65
|
-
...(isPlanDocumentPath(diff.path) ? { plan: true } : {}),
|
|
66
|
-
};
|
|
67
|
-
};
|
package/src/embed.ts
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
/* THE ZOD-FREE HALF OF AN EMBED'S WIRE: what every script a customer drops on their own page does before it
|
|
2
|
-
* does anything of its own. Two embeds exist, the Front Desk chat bubble (_sandbox/webchat-widget) and the bug
|
|
3
|
-
* reporter (_sandbox/issue-widget), and each used to carry its own copy of this: the same three requests
|
|
4
|
-
* against a public door, the same proof-of-work solver, the same localStorage-backed id, the same
|
|
5
|
-
* read-my-own-script-tag boot. The daemon's side of the same doors is one module too (automations/public-door.ts).
|
|
6
|
-
*
|
|
7
|
-
* THE RULE FOR WHAT MAY LIVE HERE: no imports, ever. This module is bundled INTO a page that belongs to someone
|
|
8
|
-
* else, so it must cost that page nothing it did not ask for; the contract's barrel would bring zod with it
|
|
9
|
-
* (webext-links.ts measured that at 1.1 MB for two strings). Types are declared here for the same reason. */
|
|
10
|
-
|
|
11
|
-
// Where an embed talks to: the daemon it came from, and the automation it is the public face of.
|
|
12
|
-
export interface EmbedEndpoint {
|
|
13
|
-
readonly base: string;
|
|
14
|
-
readonly automationId: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// What the server said when it refused. The daemon answers every refusal as {"error": "..."}, and that sentence
|
|
18
|
-
// is shown verbatim where a person can see it: "origin not allowed" tells a site owner exactly what to fix and
|
|
19
|
-
// anything invented here would not.
|
|
20
|
-
export class EmbedError extends Error {
|
|
21
|
-
constructor(
|
|
22
|
-
message: string,
|
|
23
|
-
readonly status: number,
|
|
24
|
-
) {
|
|
25
|
-
super(message);
|
|
26
|
-
this.name = "EmbedError";
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const embedFailure = async (response: Response): Promise<EmbedError> => {
|
|
31
|
-
const body = (await response.json().catch(() => undefined)) as { error?: unknown } | undefined;
|
|
32
|
-
return new EmbedError(typeof body?.error === "string" ? body.error : `request failed (${response.status})`, response.status);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// One route of a public door: `<base>/<slug>/<automation>/<path>`, the daemon's own spelling.
|
|
36
|
-
export const embedUrl = ({ base, automationId }: EmbedEndpoint, slug: string, path: string): string =>
|
|
37
|
-
`${base}/${slug}/${encodeURIComponent(automationId)}/${path}`;
|
|
38
|
-
|
|
39
|
-
// One GET against a public door, answered as JSON or refused with the server's own sentence.
|
|
40
|
-
export const fetchEmbedJson = async <T>(url: string): Promise<T> => {
|
|
41
|
-
const response = await fetch(url);
|
|
42
|
-
if (!response.ok) {
|
|
43
|
-
throw await embedFailure(response);
|
|
44
|
-
}
|
|
45
|
-
return (await response.json()) as T;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/* ---- proof of work ----
|
|
49
|
-
*
|
|
50
|
-
* The daemon issues a challenge: find a nonce whose SHA-256 of `${salt}:${nonce}` begins with `difficulty` zero
|
|
51
|
-
* BITS. It costs the person a second or so and costs a script the same per identity it wants to burn, with no
|
|
52
|
-
* third-party account anywhere. The challenge is minted FOR one caller (the daemon signs the caller's own id
|
|
53
|
-
* into the salt), so a solution cannot be carried to another thread or another reporter; hence the id in the
|
|
54
|
-
* challenge request rather than a bare GET.
|
|
55
|
-
*
|
|
56
|
-
* Solved on the main thread in yielding batches rather than in a Worker: a Worker would have to come from a
|
|
57
|
-
* blob: URL, which a host page's Content-Security-Policy is entitled to forbid, and being unable to chat or send
|
|
58
|
-
* feedback because of the SITE's CSP is a worse failure than a busy second. */
|
|
59
|
-
export interface PowChallenge {
|
|
60
|
-
readonly salt: string;
|
|
61
|
-
readonly difficulty: number;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export const fetchEmbedChallenge = (endpoint: EmbedEndpoint, slug: string, param: string, id: string): Promise<PowChallenge> =>
|
|
65
|
-
fetchEmbedJson<PowChallenge>(`${embedUrl(endpoint, slug, "challenge")}?${param}=${encodeURIComponent(id)}`);
|
|
66
|
-
|
|
67
|
-
const BATCH = 512;
|
|
68
|
-
|
|
69
|
-
// Leading zero bits of a digest, up to `wanted`. Stops at the first non-zero byte, so a miss costs one byte.
|
|
70
|
-
const leadingZeroBits = (digest: Uint8Array, wanted: number): number => {
|
|
71
|
-
let bits = 0;
|
|
72
|
-
for (const byte of digest) {
|
|
73
|
-
if (byte !== 0) {
|
|
74
|
-
// Math.clz32 counts 32-bit leading zeros; the byte sits in the low 8, so 24 of them are structural.
|
|
75
|
-
return bits + Math.clz32(byte) - 24;
|
|
76
|
-
}
|
|
77
|
-
bits += 8;
|
|
78
|
-
if (bits >= wanted) {
|
|
79
|
-
return bits;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return bits;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/* Resolves to the ANSWER the daemon expects, `<salt>:<nonce>`, carrying back the salt it signed so it can
|
|
86
|
-
* re-derive the challenge it issued without having stored one. `insecure` is what to say on an http:// page:
|
|
87
|
-
* `crypto.subtle` is only available in a secure context, and the fix is the site's TLS, not anything the
|
|
88
|
-
* person can do, so the sentence names the thing they were trying to do. */
|
|
89
|
-
export const solveProofOfWork = async (challenge: PowChallenge, insecure: string, onProgress?: (attempts: number) => void): Promise<string> => {
|
|
90
|
-
if (crypto.subtle === undefined) {
|
|
91
|
-
throw new Error(insecure);
|
|
92
|
-
}
|
|
93
|
-
const encoder = new TextEncoder();
|
|
94
|
-
for (let nonce = 0; ; nonce += 1) {
|
|
95
|
-
const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", encoder.encode(`${challenge.salt}:${nonce}`)));
|
|
96
|
-
if (leadingZeroBits(digest, challenge.difficulty) >= challenge.difficulty) {
|
|
97
|
-
return `${challenge.salt}:${nonce}`;
|
|
98
|
-
}
|
|
99
|
-
if (nonce % BATCH === BATCH - 1) {
|
|
100
|
-
onProgress?.(nonce + 1);
|
|
101
|
-
// Hand the main thread back so the page (and the embed's own "checking…" line) keeps painting.
|
|
102
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
/* ---- what an embed keeps in the visitor's browser ----
|
|
108
|
-
*
|
|
109
|
-
* localStorage throws in Safari's private mode and anywhere the site blocks storage. An embed with no storage
|
|
110
|
-
* still works; it just mints a fresh id per page load, which costs only a slightly less useful thread or
|
|
111
|
-
* rate-limit key. Silence here is deliberate: an embed must never be the thing that puts an error in the
|
|
112
|
-
* console. */
|
|
113
|
-
export const readStored = (name: string): string | undefined => {
|
|
114
|
-
try {
|
|
115
|
-
return window.localStorage.getItem(name) ?? undefined;
|
|
116
|
-
} catch {
|
|
117
|
-
return undefined;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export const writeStored = (name: string, value: string): void => {
|
|
122
|
-
try {
|
|
123
|
-
window.localStorage.setItem(name, value);
|
|
124
|
-
} catch {
|
|
125
|
-
/* no storage: this page load keeps the value in memory and the next one mints another */
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
/* A per-browser id under `name`, minted once and kept. NOT identity and NOT a secret: anyone can mint one, and
|
|
130
|
-
* the daemon treats it as exactly what it is, the key that threads a visitor's messages into one conversation,
|
|
131
|
-
* or that a rate window counts against so one runaway tab cannot spend the whole day's budget. */
|
|
132
|
-
export const storedId = (name: string): string => {
|
|
133
|
-
const existing = readStored(name);
|
|
134
|
-
if (existing !== undefined && existing !== "") {
|
|
135
|
-
return existing;
|
|
136
|
-
}
|
|
137
|
-
const minted = crypto.randomUUID();
|
|
138
|
-
writeStored(name, minted);
|
|
139
|
-
return minted;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
/* ---- the <script> tag an embed boots from ----
|
|
143
|
-
*
|
|
144
|
-
* <script src="https://sandbox-<id>.<zone>/<slug>/…js" data-automation="support" defer></script>
|
|
145
|
-
*
|
|
146
|
-
* Everything else is derived: the daemon to talk to is the ORIGIN THIS SCRIPT CAME FROM, which is the one thing
|
|
147
|
-
* a copy-pasted snippet can't get wrong. `data-base` overrides it for a site fronting the sandbox behind its
|
|
148
|
-
* own proxy, the only case where the two legitimately differ.
|
|
149
|
-
*
|
|
150
|
-
* `document.currentScript` is only valid while the script body is executing, so it is read at module scope by
|
|
151
|
-
* the caller rather than inside an async boot. The querySelector is the fallback for a bundler or tag manager
|
|
152
|
-
* that re-executes the entry in a context where currentScript is null. */
|
|
153
|
-
export const embedScript = (srcMatch: string): HTMLScriptElement | null =>
|
|
154
|
-
(document.currentScript as HTMLScriptElement | null) ?? document.querySelector<HTMLScriptElement>(`script[src*="${srcMatch}"]`);
|
|
155
|
-
|
|
156
|
-
// The endpoint a script tag names, or undefined when it carries no automation id, the one mistake worth a
|
|
157
|
-
// console line: without it the embed is silently absent and the site owner has nothing to go on.
|
|
158
|
-
export const embedEndpointOf = (script: HTMLScriptElement): EmbedEndpoint | undefined => {
|
|
159
|
-
const automationId = script.dataset["automation"];
|
|
160
|
-
if (automationId === undefined || automationId === "") {
|
|
161
|
-
return undefined;
|
|
162
|
-
}
|
|
163
|
-
return { automationId, base: (script.dataset["base"] ?? new URL(script.src, window.location.href).origin).replace(/\/$/, "") };
|
|
164
|
-
};
|