@intentic/sandbox-contract 1.311.0 → 1.313.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 +32 -4
- package/dist/chores/chores.js +6 -6
- package/dist/chores/chores.js.map +1 -1
- package/dist/chores/index.d.ts +0 -1
- package/dist/chores/index.d.ts.map +1 -1
- package/dist/chores/index.js +0 -1
- package/dist/chores/index.js.map +1 -1
- package/dist/chores/prompt.d.ts.map +1 -1
- package/dist/chores/prompt.js +3 -2
- package/dist/chores/prompt.js.map +1 -1
- package/dist/contracts/accounts.contract.d.ts +69 -0
- package/dist/contracts/accounts.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.d.ts +436 -0
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.js +11 -1
- package/dist/contracts/agent.contract.js.map +1 -1
- package/dist/contracts/agents.contract.d.ts +718 -90
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +30 -2
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/capabilities.contract.js +1 -1
- package/dist/contracts/capabilities.contract.js.map +1 -1
- package/dist/contracts/device.contract.d.ts +20 -4
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/device.contract.js +1 -1
- package/dist/contracts/device.contract.js.map +1 -1
- package/dist/contracts/extensions.contract.d.ts +13 -0
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/git.contract.d.ts +2 -0
- package/dist/contracts/git.contract.d.ts.map +1 -1
- package/dist/contracts/offload.contract.d.ts +107 -0
- package/dist/contracts/offload.contract.d.ts.map +1 -0
- package/dist/contracts/offload.contract.js +53 -0
- package/dist/contracts/offload.contract.js.map +1 -0
- package/dist/contracts/personas.contract.d.ts +2 -0
- package/dist/contracts/personas.contract.d.ts.map +1 -1
- package/dist/contracts/ports.contract.d.ts +5 -0
- package/dist/contracts/ports.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +204 -0
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.js +3 -1
- package/dist/contracts/runner.contract.js.map +1 -1
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js +1 -0
- package/dist/contracts/secrets.contract.js.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +59 -0
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +20 -8
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.js +2 -2
- package/dist/contracts/settings.contract.js.map +1 -1
- package/dist/contracts/system.contract.d.ts +230 -15
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/translator.contract.d.ts +88 -0
- package/dist/contracts/translator.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.d.ts +217 -0
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js +40 -3
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/documents/conversions.d.ts +81 -0
- package/dist/documents/conversions.d.ts.map +1 -0
- package/dist/documents/conversions.js +213 -0
- package/dist/documents/conversions.js.map +1 -0
- package/dist/documents/index.d.ts +4 -0
- package/dist/documents/index.d.ts.map +1 -0
- package/dist/documents/index.js +4 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/documents/passthrough.d.ts +13 -0
- package/dist/documents/passthrough.d.ts.map +1 -0
- package/dist/documents/passthrough.js +101 -0
- package/dist/documents/passthrough.js.map +1 -0
- package/dist/documents/read.d.ts +24 -0
- package/dist/documents/read.d.ts.map +1 -0
- package/dist/documents/read.js +81 -0
- package/dist/documents/read.js.map +1 -0
- package/dist/events/agent-events.d.ts +235 -0
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-events.js +3 -0
- package/dist/events/agent-events.js.map +1 -1
- package/dist/events/child-run.d.ts +9 -0
- package/dist/events/child-run.d.ts.map +1 -0
- package/dist/events/child-run.js +41 -0
- package/dist/events/child-run.js.map +1 -0
- package/dist/events/errands.d.ts +5 -0
- package/dist/events/errands.d.ts.map +1 -0
- package/dist/events/errands.js +19 -0
- package/dist/events/errands.js.map +1 -0
- package/dist/events/land-breakage.d.ts +3 -0
- package/dist/events/land-breakage.d.ts.map +1 -1
- package/dist/events/land-breakage.js +3 -0
- package/dist/events/land-breakage.js.map +1 -1
- package/dist/events/land-conflict.d.ts +3 -0
- package/dist/events/land-conflict.d.ts.map +1 -0
- package/dist/events/land-conflict.js +4 -0
- package/dist/events/land-conflict.js.map +1 -0
- package/dist/events/requests.d.ts +152 -0
- package/dist/events/requests.d.ts.map +1 -1
- package/dist/events/requests.js +26 -1
- package/dist/events/requests.js.map +1 -1
- package/dist/events/system-events.d.ts +74 -12
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/system-events.js +3 -1
- package/dist/events/system-events.js.map +1 -1
- package/dist/events/transcript.d.ts +387 -0
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/events/transcript.js +3 -0
- package/dist/events/transcript.js.map +1 -1
- package/dist/events/verify-nudge.d.ts.map +1 -1
- package/dist/events/verify-nudge.js.map +1 -1
- package/dist/front/browser-wire.d.ts +6 -0
- package/dist/front/browser-wire.d.ts.map +1 -0
- package/dist/front/browser-wire.js +4 -0
- package/dist/front/browser-wire.js.map +1 -0
- package/dist/front/front-wire.d.ts +6 -0
- package/dist/front/front-wire.d.ts.map +1 -0
- package/dist/front/front-wire.js +5 -0
- package/dist/front/front-wire.js.map +1 -0
- package/dist/front/generated/browser-wire.d.ts +19 -0
- package/dist/front/generated/browser-wire.d.ts.map +1 -0
- package/dist/front/generated/browser-wire.js +2 -0
- package/dist/front/generated/browser-wire.js.map +1 -0
- package/dist/front/generated/wire.d.ts +70 -1
- package/dist/front/generated/wire.d.ts.map +1 -1
- package/dist/ids/conversation-ids.d.ts +3 -0
- package/dist/ids/conversation-ids.d.ts.map +1 -1
- package/dist/ids/conversation-ids.js +4 -2
- package/dist/ids/conversation-ids.js.map +1 -1
- package/dist/ids/session-names.d.ts +3 -0
- package/dist/ids/session-names.d.ts.map +1 -1
- package/dist/ids/session-names.js +3 -0
- package/dist/ids/session-names.js.map +1 -1
- package/dist/index.d.ts +2052 -190
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/models/agent-catalog.d.ts.map +1 -1
- package/dist/models/agent-catalog.js +4 -6
- package/dist/models/agent-catalog.js.map +1 -1
- package/dist/models/agent-runtimes.d.ts +2 -1
- package/dist/models/agent-runtimes.d.ts.map +1 -1
- package/dist/models/agent-runtimes.js +7 -1
- package/dist/models/agent-runtimes.js.map +1 -1
- package/dist/models/plan-pools.d.ts +22 -1
- package/dist/models/plan-pools.d.ts.map +1 -1
- package/dist/models/plan-pools.js +86 -0
- package/dist/models/plan-pools.js.map +1 -1
- package/dist/policy/request-status.d.ts +1 -1
- package/dist/policy/request-status.d.ts.map +1 -1
- package/dist/policy/request-status.js +4 -11
- package/dist/policy/request-status.js.map +1 -1
- package/dist/policy/reserved-servers.d.ts.map +1 -1
- package/dist/policy/reserved-servers.js +2 -1
- package/dist/policy/reserved-servers.js.map +1 -1
- package/dist/policy/turned-away.d.ts.map +1 -1
- package/dist/policy/turned-away.js +1 -0
- package/dist/policy/turned-away.js.map +1 -1
- package/dist/protocol/container-requirements.d.ts +0 -1
- package/dist/protocol/container-requirements.d.ts.map +1 -1
- package/dist/protocol/container-requirements.js +1 -2
- package/dist/protocol/container-requirements.js.map +1 -1
- package/dist/protocol/edge-verdict.d.ts +2 -1
- package/dist/protocol/edge-verdict.d.ts.map +1 -1
- package/dist/protocol/edge-verdict.js +1 -1
- package/dist/protocol/edge-verdict.js.map +1 -1
- package/dist/protocol/ingress-contract.d.ts +1 -12
- package/dist/protocol/ingress-contract.d.ts.map +1 -1
- package/dist/protocol/ingress-contract.js +1 -1
- package/dist/protocol/ingress-contract.js.map +1 -1
- package/dist/protocol/raw-routes.d.ts +36 -26
- package/dist/protocol/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw-routes.js +17 -23
- package/dist/protocol/raw-routes.js.map +1 -1
- package/dist/protocol/route-meta.d.ts +22 -0
- package/dist/protocol/route-meta.d.ts.map +1 -1
- package/dist/protocol/route-meta.js +16 -0
- package/dist/protocol/route-meta.js.map +1 -1
- package/dist/protocol/runner-protocol.d.ts +34 -0
- package/dist/protocol/runner-protocol.d.ts.map +1 -1
- package/dist/protocol/runner-protocol.js +33 -0
- package/dist/protocol/runner-protocol.js.map +1 -1
- package/dist/protocol/tunnel-bulk.d.ts +2 -0
- package/dist/protocol/tunnel-bulk.d.ts.map +1 -0
- package/dist/protocol/tunnel-bulk.js +3 -0
- package/dist/protocol/tunnel-bulk.js.map +1 -0
- package/dist/protocol/x402.d.ts +17 -0
- package/dist/protocol/x402.d.ts.map +1 -0
- package/dist/protocol/x402.js +37 -0
- package/dist/protocol/x402.js.map +1 -0
- package/dist/schemas/activity.d.ts.map +1 -1
- package/dist/schemas/activity.js.map +1 -1
- package/dist/schemas/agent.d.ts +25 -0
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +14 -2
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents.d.ts +90 -18
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +49 -5
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/automations.d.ts +23 -6
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/devices.d.ts +134 -7
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +43 -18
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/extension-updates.d.ts +26 -0
- package/dist/schemas/extension-updates.d.ts.map +1 -1
- package/dist/schemas/extension-updates.js +4 -0
- package/dist/schemas/extension-updates.js.map +1 -1
- package/dist/schemas/git/git.d.ts +19 -0
- package/dist/schemas/git/git.d.ts.map +1 -1
- package/dist/schemas/git/git.js +1 -0
- package/dist/schemas/git/git.js.map +1 -1
- package/dist/schemas/hosts.d.ts +35 -3
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +22 -6
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/keep-warm.d.ts +2 -12
- package/dist/schemas/keep-warm.d.ts.map +1 -1
- package/dist/schemas/keep-warm.js +8 -10
- package/dist/schemas/keep-warm.js.map +1 -1
- package/dist/schemas/metrics.d.ts +29 -0
- package/dist/schemas/metrics.d.ts.map +1 -1
- package/dist/schemas/metrics.js +19 -3
- package/dist/schemas/metrics.js.map +1 -1
- package/dist/schemas/offload.d.ts +62 -0
- package/dist/schemas/offload.d.ts.map +1 -0
- package/dist/schemas/offload.js +23 -0
- package/dist/schemas/offload.js.map +1 -0
- package/dist/schemas/personas.d.ts +3 -0
- package/dist/schemas/personas.d.ts.map +1 -1
- package/dist/schemas/personas.js +12 -3
- package/dist/schemas/personas.js.map +1 -1
- package/dist/schemas/ports.d.ts +10 -0
- package/dist/schemas/ports.d.ts.map +1 -1
- package/dist/schemas/ports.js +8 -0
- package/dist/schemas/ports.js.map +1 -1
- package/dist/schemas/providers/plan-limits.d.ts +169 -0
- package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
- package/dist/schemas/providers/plan-limits.js +54 -1
- package/dist/schemas/providers/plan-limits.js.map +1 -1
- package/dist/schemas/providers/provider-oauth.d.ts +69 -0
- package/dist/schemas/providers/provider-oauth.d.ts.map +1 -1
- package/dist/schemas/providers/provider-oauth.js +6 -1
- package/dist/schemas/providers/provider-oauth.js.map +1 -1
- package/dist/schemas/settings-history.d.ts +55 -0
- package/dist/schemas/settings-history.d.ts.map +1 -0
- package/dist/schemas/settings-history.js +73 -0
- package/dist/schemas/settings-history.js.map +1 -0
- package/dist/schemas/settings.d.ts +188 -4
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +41 -26
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/speaker.d.ts +36 -0
- package/dist/schemas/speaker.d.ts.map +1 -0
- package/dist/schemas/speaker.js +62 -0
- package/dist/schemas/speaker.js.map +1 -0
- package/dist/schemas/state-plan.d.ts +46 -0
- package/dist/schemas/state-plan.d.ts.map +1 -0
- package/dist/schemas/state-plan.js +31 -0
- package/dist/schemas/state-plan.js.map +1 -0
- package/dist/schemas/system.d.ts +64 -0
- package/dist/schemas/system.d.ts.map +1 -1
- package/dist/schemas/system.js +12 -1
- package/dist/schemas/system.js.map +1 -1
- package/dist/schemas/workspace/mainline.d.ts +513 -0
- package/dist/schemas/workspace/mainline.d.ts.map +1 -0
- package/dist/schemas/workspace/mainline.js +182 -0
- package/dist/schemas/workspace/mainline.js.map +1 -0
- package/dist/schemas/workspace/workspace-tree.d.ts +23 -0
- package/dist/schemas/workspace/workspace-tree.d.ts.map +1 -1
- package/dist/schemas/workspace/workspace-tree.js +34 -0
- package/dist/schemas/workspace/workspace-tree.js.map +1 -1
- package/dist/state/contract-lock.d.ts +1 -0
- package/dist/state/contract-lock.d.ts.map +1 -1
- package/dist/state/contract-lock.js +47 -1
- package/dist/state/contract-lock.js.map +1 -1
- package/dist/state/definition.d.ts +44 -20
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/definition.js.map +1 -1
- package/dist/state/fix-stance.d.ts +1 -1
- package/dist/state/fix-stance.d.ts.map +1 -1
- package/dist/state/fix-stance.js +2 -1
- package/dist/state/fix-stance.js.map +1 -1
- package/dist/state/history-state.d.ts.map +1 -1
- package/dist/state/history-state.js +7 -0
- package/dist/state/history-state.js.map +1 -1
- package/dist/state/landed-commit.d.ts +1 -0
- package/dist/state/landed-commit.d.ts.map +1 -1
- package/dist/state/landed-commit.js +2 -0
- package/dist/state/landed-commit.js.map +1 -1
- package/dist/state/red-streak.d.ts +7 -0
- package/dist/state/red-streak.d.ts.map +1 -0
- package/dist/state/red-streak.js +11 -0
- package/dist/state/red-streak.js.map +1 -0
- package/dist/state/runtime-state.d.ts +3 -0
- package/dist/state/runtime-state.d.ts.map +1 -1
- package/dist/state/runtime-state.js +1 -0
- package/dist/state/runtime-state.js.map +1 -1
- package/dist/state/workspace-state.d.ts +23 -1
- package/dist/state/workspace-state.d.ts.map +1 -1
- package/dist/state/workspace-state.js +33 -3
- package/dist/state/workspace-state.js.map +1 -1
- package/dist/text/shell-regions.d.ts +1 -0
- package/dist/text/shell-regions.d.ts.map +1 -1
- package/dist/text/shell-regions.js +1 -1
- package/dist/text/shell-regions.js.map +1 -1
- package/dist/text/transcript-fold.d.ts +1 -0
- package/dist/text/transcript-fold.d.ts.map +1 -1
- package/dist/text/transcript-fold.js +24 -8
- package/dist/text/transcript-fold.js.map +1 -1
- package/package.json +42 -42
- package/src/chores/chores.ts +6 -6
- package/src/chores/index.ts +0 -1
- package/src/chores/prompt.ts +3 -2
- package/src/contracts/agent.contract.ts +14 -0
- package/src/contracts/agents.contract.ts +36 -1
- package/src/contracts/capabilities.contract.ts +2 -2
- package/src/contracts/device.contract.ts +5 -3
- package/src/contracts/offload.contract.ts +60 -0
- package/src/contracts/runner.contract.ts +7 -1
- package/src/contracts/secrets.contract.ts +2 -0
- package/src/contracts/settings.contract.ts +2 -1
- package/src/contracts/workspace.contract.ts +54 -2
- package/src/documents/conversions.ts +402 -0
- package/src/documents/index.ts +7 -0
- package/src/documents/passthrough.ts +139 -0
- package/src/documents/read.ts +114 -0
- package/src/events/agent-events.ts +5 -0
- package/src/events/child-run.test.ts +81 -0
- package/src/events/child-run.ts +73 -0
- package/src/events/errands.test.ts +22 -0
- package/src/events/errands.ts +27 -0
- package/src/events/land-breakage.ts +12 -0
- package/src/events/land-conflict.ts +12 -0
- package/src/events/requests.ts +40 -1
- package/src/events/system-events.ts +9 -3
- package/src/events/transcript.ts +8 -0
- package/src/events/verify-nudge.ts +4 -3
- package/src/front/browser-wire.ts +20 -0
- package/src/front/front-wire.ts +15 -0
- package/src/front/generated/browser-wire.json +138 -0
- package/src/front/generated/browser-wire.ts +16 -0
- package/src/front/generated/front-wire.json +793 -0
- package/src/front/generated/tunnel.json +38 -0
- package/src/front/generated/wire.ts +37 -9
- package/src/front/wire-manifests.test.ts +61 -0
- package/src/ids/conversation-ids.ts +13 -5
- package/src/ids/session-names.ts +7 -0
- package/src/index.ts +15 -2
- package/src/models/agent-catalog.test.ts +6 -4
- package/src/models/agent-catalog.ts +4 -6
- package/src/models/agent-runtimes.ts +22 -7
- package/src/models/capability-ledger.test.ts +2 -0
- package/src/models/plan-pools.test.ts +121 -2
- package/src/models/plan-pools.ts +152 -2
- package/src/policy/request-status.ts +4 -12
- package/src/policy/reserved-servers.test.ts +6 -0
- package/src/policy/reserved-servers.ts +13 -10
- package/src/policy/turned-away.ts +3 -0
- package/src/protocol/container-requirements.test.ts +2 -3
- package/src/protocol/container-requirements.ts +1 -7
- package/src/protocol/edge-verdict.ts +13 -11
- package/src/protocol/ingress-contract.fixture.json +90 -0
- package/src/protocol/ingress-contract.test.ts +18 -26
- package/src/protocol/ingress-contract.ts +10 -25
- package/src/protocol/raw-routes.ts +22 -26
- package/src/protocol/route-meta.ts +39 -0
- package/src/protocol/runner-protocol.ts +53 -0
- package/src/protocol/tunnel-bulk.test.ts +37 -0
- package/src/protocol/tunnel-bulk.ts +7 -0
- package/src/protocol/x402.test.ts +29 -0
- package/src/protocol/x402.ts +61 -0
- package/src/schemas/activity.ts +3 -1
- package/src/schemas/agent.ts +28 -3
- package/src/schemas/agents.ts +83 -8
- package/src/schemas/automations.ts +4 -2
- package/src/schemas/devices.ts +106 -39
- package/src/schemas/extension-updates.ts +6 -0
- package/src/schemas/git/git.ts +5 -0
- package/src/schemas/hosts.ts +64 -13
- package/src/schemas/ic-shape-args.test.ts +64 -0
- package/src/schemas/keep-warm.test.ts +6 -13
- package/src/schemas/keep-warm.ts +15 -20
- package/src/schemas/metrics.ts +28 -3
- package/src/schemas/offload.ts +44 -0
- package/src/schemas/personas.ts +18 -3
- package/src/schemas/ports.ts +10 -0
- package/src/schemas/providers/plan-limits.ts +84 -1
- package/src/schemas/providers/provider-oauth.ts +10 -1
- package/src/schemas/settings-history.ts +108 -0
- package/src/schemas/settings.test.ts +54 -1
- package/src/schemas/settings.ts +88 -49
- package/src/schemas/speaker.ts +89 -0
- package/src/schemas/state-plan.test.ts +69 -0
- package/src/schemas/state-plan.ts +47 -0
- package/src/schemas/system.ts +24 -3
- package/src/schemas/workspace/mainline.test.ts +28 -0
- package/src/schemas/workspace/mainline.ts +268 -0
- package/src/schemas/workspace/workspace-tree.ts +47 -0
- package/src/state/contract-lock.test.ts +65 -4
- package/src/state/contract-lock.ts +70 -2
- package/src/state/definition.ts +3 -2
- package/src/state/fix-stance.test.ts +8 -0
- package/src/state/fix-stance.ts +3 -3
- package/src/state/history-state.ts +19 -0
- package/src/state/landed-commit.test.ts +12 -1
- package/src/state/landed-commit.ts +5 -0
- package/src/state/red-streak.test.ts +28 -0
- package/src/state/red-streak.ts +28 -0
- package/src/state/runtime-state.ts +4 -0
- package/src/state/workspace-state.test.ts +7 -1
- package/src/state/workspace-state.ts +45 -3
- package/src/text/shell-regions.test.ts +38 -0
- package/src/text/shell-regions.ts +3 -3
- package/src/text/transcript-fold.test.ts +46 -0
- package/src/text/transcript-fold.ts +31 -9
- package/dist/chores/fix-deps.d.ts +0 -10
- package/dist/chores/fix-deps.d.ts.map +0 -1
- package/dist/chores/fix-deps.js +0 -18
- package/dist/chores/fix-deps.js.map +0 -1
- package/dist/protocol/ingress-protocol.d.ts +0 -30
- package/dist/protocol/ingress-protocol.d.ts.map +0 -1
- package/dist/protocol/ingress-protocol.js +0 -300
- package/dist/protocol/ingress-protocol.js.map +0 -1
- package/dist/protocol/terminal-protocol.d.ts +0 -18
- package/dist/protocol/terminal-protocol.d.ts.map +0 -1
- package/dist/protocol/terminal-protocol.js +0 -2
- package/dist/protocol/terminal-protocol.js.map +0 -1
- package/dist/protocol/tunnel-heartbeat.d.ts +0 -19
- package/dist/protocol/tunnel-heartbeat.d.ts.map +0 -1
- package/dist/protocol/tunnel-heartbeat.js +0 -41
- package/dist/protocol/tunnel-heartbeat.js.map +0 -1
- package/dist/protocol/upgrade-relay.d.ts +0 -4
- package/dist/protocol/upgrade-relay.d.ts.map +0 -1
- package/dist/protocol/upgrade-relay.js +0 -25
- package/dist/protocol/upgrade-relay.js.map +0 -1
- package/src/chores/fix-deps.ts +0 -22
- package/src/protocol/ingress-protocol.test.ts +0 -579
- package/src/protocol/ingress-protocol.ts +0 -469
- package/src/protocol/terminal-protocol.ts +0 -13
- package/src/protocol/tunnel-heartbeat.test.ts +0 -75
- package/src/protocol/tunnel-heartbeat.ts +0 -67
- package/src/protocol/upgrade-relay.ts +0 -28
package/src/state/fix-stance.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { turnedAwayCode } from "../policy/turned-away.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type AgentSummary, awaitsWake } from "../schemas/agents.js";
|
|
3
3
|
|
|
4
4
|
/* WHAT BECAME OF THE AGENT A SURFACE SENT AFTER A FAILURE — a red pipeline row, a refused push. */
|
|
5
5
|
|
|
@@ -130,8 +130,8 @@ const RULES: readonly ((agent: AgentSummary) => FixStance | undefined)[] = [
|
|
|
130
130
|
? needsYou("Needs you", "The fix agent has stopped and is waiting on you.")
|
|
131
131
|
: undefined,
|
|
132
132
|
(agent) => (IN_FLIGHT.has(agent.status) ? WORKING : undefined),
|
|
133
|
-
//
|
|
134
|
-
(agent) => ((agent
|
|
133
|
+
// It runs again by itself (a watch, a waiting wake), so neither what it holds nor holding nothing is its last word yet.
|
|
134
|
+
(agent) => (awaitsWake(agent) ? WORKING : undefined),
|
|
135
135
|
(agent) => (holdingWork(agent) ? READY : undefined),
|
|
136
136
|
(agent) => (agent.status === "landed" ? LANDED : undefined),
|
|
137
137
|
];
|
|
@@ -22,6 +22,9 @@ export const HISTORY_STATE_FILES: readonly StateFile[] = [
|
|
|
22
22
|
// conversation's own runtime session store (what `.intentic/records/sessions/claude/` holds for every other).
|
|
23
23
|
// Carried whole, like the conversation it is.
|
|
24
24
|
{ path: "conversations/", portability: "carry" },
|
|
25
|
+
// The long tool outputs those transcripts name rather than hold, stored once by content for every record naming
|
|
26
|
+
// them; a transcript without them keeps only each output's start.
|
|
27
|
+
{ path: "blobs/", portability: "carry" },
|
|
25
28
|
// Index of published-page conversations; the pages travel with /work anyway, this makes one withdrawable.
|
|
26
29
|
{ path: "shares.json", portability: "carry" },
|
|
27
30
|
{ path: "activity.jsonl", portability: "carry" },
|
|
@@ -67,8 +70,14 @@ export const HISTORY_STATE_FILES: readonly StateFile[] = [
|
|
|
67
70
|
{ path: ".isolation-probe", portability: "derived" },
|
|
68
71
|
// Finished bundles, excluded so an export doesn't pack every prior export in; kept off /work, unwatched.
|
|
69
72
|
{ path: "exports/", portability: "derived" },
|
|
73
|
+
// Each transcript as it was before this format converted it, zstd-compressed: a local way back, never read here.
|
|
74
|
+
{ path: "backups/", portability: "derived" },
|
|
70
75
|
// Bundles being taken in, mid-review; excluded as someone else's. Deleted on apply/abandon, swept after a crash.
|
|
71
76
|
{ path: "arrivals/", portability: "derived" },
|
|
77
|
+
// The agent engines this sandbox installed beside the image's own, each with its pointer file; reinstalled on demand.
|
|
78
|
+
{ path: "engines/", portability: "derived" },
|
|
79
|
+
// An update the host downloaded and built for this sandbox (`ic sandbox prepare`); about this machine only.
|
|
80
|
+
{ path: "update-staged.json", portability: "derived" },
|
|
72
81
|
|
|
73
82
|
/* ---- credentials ---- */
|
|
74
83
|
|
|
@@ -120,4 +129,14 @@ export const HISTORY_STATE_FILES: readonly StateFile[] = [
|
|
|
120
129
|
// The owner's yes to each workspace extension's declared powers, decided again by the target's owner.
|
|
121
130
|
{ path: "extension-approvals.json", portability: "identity", note: "Approve the extensions written in this workspace again from Extensions." },
|
|
122
131
|
{ path: "local-cert/", portability: "identity" },
|
|
132
|
+
|
|
133
|
+
/* ---- the state engine's own bookkeeping (the daemon's store/evolution/state-journal.ts) ---- */
|
|
134
|
+
|
|
135
|
+
// Pre-images of the history files an update's conversions changed; `secret` since identity files are among them.
|
|
136
|
+
{ path: "converting/", portability: "secret", note: "An update's undo record stays with the sandbox it happened on." },
|
|
137
|
+
// Which conversion episodes are open or recently committed, and earlier addresses awaiting removal.
|
|
138
|
+
{ path: "state-journal.json", portability: "derived" },
|
|
139
|
+
// Every conversation the import of the pre-1.308 layout settled (the daemon's conversations/registry/pre-1308-import.ts),
|
|
140
|
+
// so one deleted after its import is not brought back from the old files still on disk. About this volume only.
|
|
141
|
+
{ path: "pre-1308-import.json", portability: "derived" },
|
|
123
142
|
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { declaredTestNote, landedCommitMessage } from "./landed-commit.js";
|
|
1
|
+
import { declaredAllows, declaredTestNote, landedCommitMessage } from "./landed-commit.js";
|
|
2
2
|
|
|
3
3
|
// The push gate reads a weakening's declaration off the commit (assertion-ratchet.mjs), so the trailer must survive
|
|
4
4
|
// the trip from the conversation's last word into the message a land commits under.
|
|
@@ -15,3 +15,14 @@ test("a Test-Note is read only from a line that starts with one and says somethi
|
|
|
15
15
|
expect(declaredTestNote("I kept a Test-Note: nowhere near the start")).toBeUndefined();
|
|
16
16
|
expect(declaredTestNote("Test-Note: \n")).toBeUndefined();
|
|
17
17
|
});
|
|
18
|
+
|
|
19
|
+
// An exception a conversation declared rides its land's commit, one trailer per line, for the checks that read them.
|
|
20
|
+
test("an Allow line is read from each line that starts with one, and each commits as its own trailer", () => {
|
|
21
|
+
const said = "Done.\n\nAllow: layout — the fixtures folder is one suite's data\nAllow: paths — the test spells a root on purpose\nI would Allow: nothing here";
|
|
22
|
+
const allows = declaredAllows(said);
|
|
23
|
+
expect(allows).toEqual(["layout — the fixtures folder is one suite's data", "paths — the test spells a root on purpose"]);
|
|
24
|
+
expect(declaredAllows("Allow: \n")).toEqual([]);
|
|
25
|
+
expect(landedCommitMessage({ subject: "fix: tabs", testNote: "Rows became a table.", allows })).toBe(
|
|
26
|
+
"fix: tabs\n\nTest-Note: Rows became a table.\nAllow: layout — the fixtures folder is one suite's data\nAllow: paths — the test spells a root on purpose",
|
|
27
|
+
);
|
|
28
|
+
});
|
|
@@ -7,6 +7,7 @@ export const landedCommitMessage = (landed: LandedMessage): string => {
|
|
|
7
7
|
landed.note === undefined ? "" : `Release-Note: ${landed.note}`,
|
|
8
8
|
landed.breaking === undefined ? "" : `Breaking-Note: ${landed.breaking}`,
|
|
9
9
|
landed.testNote === undefined ? "" : `Test-Note: ${landed.testNote}`,
|
|
10
|
+
...(landed.allows ?? []).map((allow) => `Allow: ${allow}`),
|
|
10
11
|
]
|
|
11
12
|
.filter((line) => line !== "")
|
|
12
13
|
.join("\n");
|
|
@@ -15,3 +16,7 @@ export const landedCommitMessage = (landed: LandedMessage): string => {
|
|
|
15
16
|
|
|
16
17
|
// The `Test-Note:` line a conversation ended its last message with, when it declared a weakened test on purpose.
|
|
17
18
|
export const declaredTestNote = (said: string): string | undefined => /^Test-Note:[ \t]*(\S.*)$/m.exec(said)?.[1]?.trim();
|
|
19
|
+
|
|
20
|
+
// The `Allow: <check> — <reason>` lines a conversation ended its last message with, each an exception it declared for
|
|
21
|
+
// its change on purpose; the check after the land and the push read them off the landed commit.
|
|
22
|
+
export const declaredAllows = (said: string): string[] => [...said.matchAll(/^Allow:[ \t]*(\S.*)$/gm)].map((match) => match[1]!.trim());
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { headStreak, nextStreak } from "./red-streak.js";
|
|
2
|
+
|
|
3
|
+
// The five places that asked "is this still the same red" asked it five ways; these are the two answers they share.
|
|
4
|
+
|
|
5
|
+
describe(`a streak followed one observation at a time`, () => {
|
|
6
|
+
test(`begins at the first red, keeps that start through every red after it, and ends at anything else`, () => {
|
|
7
|
+
const first = nextStreak(undefined, true, 10);
|
|
8
|
+
expect(first).toEqual({ since: 10, count: 1 });
|
|
9
|
+
const second = nextStreak(first, true, 20);
|
|
10
|
+
expect(second).toEqual({ since: 10, count: 2 });
|
|
11
|
+
expect(nextStreak(second, false, 30)).toBeUndefined();
|
|
12
|
+
expect(nextStreak(undefined, false, 30)).toBeUndefined();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test(`begins again when the red is a different failure`, () => {
|
|
16
|
+
expect(nextStreak({ since: 10, count: 3 }, true, 40, false)).toEqual({ since: 40, count: 1 });
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe(`a streak read off a history`, () => {
|
|
21
|
+
test(`is the unbroken run of red at the head, newest first`, () => {
|
|
22
|
+
const history = [`red-3`, `red-2`, `green-1`, `red-0`];
|
|
23
|
+
expect(headStreak(history, (item) => item.startsWith(`red`))).toEqual([`red-3`, `red-2`]);
|
|
24
|
+
expect(headStreak([`green`, `red`], (item) => item === `red`)).toEqual([]);
|
|
25
|
+
expect(headStreak([`red`, `red`], (item) => item === `red`)).toEqual([`red`, `red`]);
|
|
26
|
+
expect(headStreak([], () => true)).toEqual([]);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// ONE DEFINITION OF A RED STREAK, for every source that goes red: a land check's project (verify-store.ts), main's CI
|
|
2
|
+
// (repair-gate.ts), a pipeline branch on the board (the pipelines extension's ciStreaks.ts) and the Main line's older
|
|
3
|
+
// daemons (the editor's mainlineView.ts). A streak is the unbroken run of red at the head: a red extends it, anything
|
|
4
|
+
// else ends it, and `since` is where it began, which is what names one failure across every red that continues it.
|
|
5
|
+
|
|
6
|
+
export interface Streak {
|
|
7
|
+
// When (or at which run) the streak began: the first red of the unbroken run.
|
|
8
|
+
readonly since: number;
|
|
9
|
+
// How many reds in a row it holds.
|
|
10
|
+
readonly count: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* One observation's effect on the streak before it. A red continues it, unless `continues` says this red is a different
|
|
15
|
+
* failure (CI: no failed job repeats), which begins one of its own; anything else ends it.
|
|
16
|
+
*/
|
|
17
|
+
export const nextStreak = (previous: Streak | undefined, red: boolean, at: number, continues = true): Streak | undefined => {
|
|
18
|
+
if (!red) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return previous !== undefined && continues ? { since: previous.since, count: previous.count + 1 } : { since: at, count: 1 };
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** The streak a newest-first history stands on: its unbroken run of red at the head, newest first; empty when the head is not red. */
|
|
25
|
+
export const headStreak = <T>(newestFirst: readonly T[], isRed: (item: T) => boolean): T[] => {
|
|
26
|
+
const end = newestFirst.findIndex((item) => !isRed(item));
|
|
27
|
+
return end === -1 ? [...newestFirst] : newestFirst.slice(0, end);
|
|
28
|
+
};
|
|
@@ -58,6 +58,10 @@ const RUNTIME_DOMAINS = [
|
|
|
58
58
|
|
|
59
59
|
// The audit log grew or a gateway's status moved or aged out; the log lives outside /work, so no file push carries it.
|
|
60
60
|
{ domain: "activity", invalidates: [["activity"], ["activity-status"]] },
|
|
61
|
+
|
|
62
|
+
// The main tree's own check after a land: queued, started, settled, or its red handed to somebody. Held in the
|
|
63
|
+
// daemon's memory as much as in a file, so a push is the only way a watcher hears it move.
|
|
64
|
+
{ domain: "mainline", invalidates: [["mainline"]] },
|
|
61
65
|
] as const satisfies readonly RuntimeDomainBinding[];
|
|
62
66
|
|
|
63
67
|
export const RUNTIME_DOMAIN_BINDINGS: readonly RuntimeDomainBinding[] = RUNTIME_DOMAINS;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { STATE_DIR } from "@intentic/constants";
|
|
1
|
+
import { HISTORY_ROOT, STATE_DIR } from "@intentic/constants";
|
|
2
2
|
import type { FileContribution } from "@intentic/extension-manifest";
|
|
3
3
|
import {
|
|
4
4
|
BACKED_UP_STATE_PATHS,
|
|
@@ -129,6 +129,12 @@ describe(`isReportedManifest`, () => {
|
|
|
129
129
|
// What `relative` gives the daemon for a manifest kept under /history.
|
|
130
130
|
expect(isReportedManifest(`../../history/settings.json`)).toBe(false);
|
|
131
131
|
});
|
|
132
|
+
|
|
133
|
+
it(`reports the conversation registry on the daemon's volume by its absolute path, and nothing else there`, () => {
|
|
134
|
+
expect(isReportedManifest(`${HISTORY_ROOT}/conversations.db`)).toBe(true);
|
|
135
|
+
expect(isReportedManifest(`${HISTORY_ROOT}/state-journal.json`)).toBe(false);
|
|
136
|
+
expect(isReportedManifest(`../history/conversations.db`)).toBe(false);
|
|
137
|
+
});
|
|
132
138
|
});
|
|
133
139
|
|
|
134
140
|
describe(`WORKSPACE_STATE_FILES`, () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { STATE_DIR } from "@intentic/constants";
|
|
1
|
+
import { HISTORY_ROOT, STATE_DIR } from "@intentic/constants";
|
|
2
2
|
import type { FileContribution } from "@intentic/extension-manifest";
|
|
3
3
|
import type { StateFile } from "./state-portability.js";
|
|
4
4
|
|
|
@@ -267,6 +267,14 @@ const STATE_FILES = [
|
|
|
267
267
|
// Per-extension update/advisory/health findings, written by the periodic check and by update/revert. Pushed live
|
|
268
268
|
// so an auto-disabling advisory doesn't wait for a reload.
|
|
269
269
|
{ path: ".intentic/records/extension-updates.json", invalidates: ["extensions"], portability: "carry" },
|
|
270
|
+
// Every conversion an update ran over this workspace's files, newest last and capped (the daemon's
|
|
271
|
+
// state-convergence.ts). `carry`: what happened to the owner's files is their history, wherever it goes next.
|
|
272
|
+
{
|
|
273
|
+
path: ".intentic/records/conversions.json",
|
|
274
|
+
invalidates: [],
|
|
275
|
+
why: "Written once per update that converted something, at boot before any browser is connected; the update card reads the plan from the new image instead.",
|
|
276
|
+
portability: "carry",
|
|
277
|
+
},
|
|
270
278
|
// Owner's per-extension update posture (notify/agent/auto, advisory opt-out). `carry`: a decision about the
|
|
271
279
|
// extension, not the machine.
|
|
272
280
|
{ path: ".intentic/config/extension-update-policy.json", invalidates: ["extensions"], portability: "carry", versioned: true },
|
|
@@ -348,6 +356,14 @@ const STATE_FILES = [
|
|
|
348
356
|
why: "Scratch that agents and tools leave behind (build logs, demo checkouts); nothing reads it after the turn that wrote it. The state janitor empties it at boot.",
|
|
349
357
|
portability: "derived",
|
|
350
358
|
},
|
|
359
|
+
// What the file view deleted, one folder per delete, kept so Undo can put it back. A day is longer than any undo
|
|
360
|
+
// stack lives in a browser tab; the hourly janitor sweep drops what's older.
|
|
361
|
+
{
|
|
362
|
+
path: ".intentic/local/trash/",
|
|
363
|
+
invalidates: [],
|
|
364
|
+
why: "Entries deleted from the file view, held for a day so Undo can restore them; nothing renders it, and the janitor expires it.",
|
|
365
|
+
portability: "derived",
|
|
366
|
+
},
|
|
351
367
|
// Account for the pnpm store even though pnpm creates it, not the daemon.
|
|
352
368
|
{
|
|
353
369
|
path: ".intentic/local/.pnpm-store/",
|
|
@@ -366,7 +382,13 @@ const STATE_FILES = [
|
|
|
366
382
|
{
|
|
367
383
|
path: ".intentic/records/verify.json",
|
|
368
384
|
invalidates: [],
|
|
369
|
-
why: "The
|
|
385
|
+
why: "The main-line check's memory: each project's last verdict and red streak, and the latest runs with what became of each red one. Read through GET /workspace/mainline, which the daemon pushes itself (the `mainline` runtime domain), so no file watch is needed.",
|
|
386
|
+
portability: "carry",
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
path: ".intentic/records/push-checks.json",
|
|
390
|
+
invalidates: [],
|
|
391
|
+
why: "What each push check found and let through, per project, and what became of every finding: still open, measured gone, or dismissed. Filed from the report the pre-push hook leaves in the repository's git dir; read through GET /workspace/mainline, which the daemon pushes itself (the `mainline` runtime domain).",
|
|
370
392
|
portability: "carry",
|
|
371
393
|
},
|
|
372
394
|
{
|
|
@@ -375,6 +397,16 @@ const STATE_FILES = [
|
|
|
375
397
|
why: "A running check's wrapper artifacts (log + exit status), read once by the daemon when the panel finishes.",
|
|
376
398
|
portability: "derived",
|
|
377
399
|
},
|
|
400
|
+
// What an update converted before it booted all the way (the sandbox daemon's state-journal.ts): a copy of every
|
|
401
|
+
// file the new version changed, kept until it commits and for a grace window after. `secret` whatever the source
|
|
402
|
+
// was, since a vault's copy is a vault; locked below for the same reason.
|
|
403
|
+
{
|
|
404
|
+
path: ".intentic/secrets/converting/",
|
|
405
|
+
invalidates: [],
|
|
406
|
+
why: "Pre-images of the files an update's conversions changed; only the boot step reads them, to put a rolled-back version's files back.",
|
|
407
|
+
portability: "secret",
|
|
408
|
+
note: "An export does not carry an update's undo record; the target converts its own files.",
|
|
409
|
+
},
|
|
378
410
|
{
|
|
379
411
|
path: ".intentic/secrets/ci.json",
|
|
380
412
|
invalidates: [],
|
|
@@ -569,9 +601,17 @@ export const REPORTED_MANIFEST_PATHS: readonly string[] = WORKSPACE_STATE_FILES.
|
|
|
569
601
|
(file) => file.path,
|
|
570
602
|
);
|
|
571
603
|
|
|
604
|
+
// Files on the daemon's own volume whose unreadable records are reported too, named by their absolute path there: the
|
|
605
|
+
// conversation registry's rows, one of which this build could not read costs that conversation until a build that can
|
|
606
|
+
// runs. Reported, never repaired from the card (no route edits them), and refreshed whenever the card is fetched.
|
|
607
|
+
export const REPORTED_VOLUME_FILES: readonly string[] = [`${HISTORY_ROOT}/conversations.db`];
|
|
608
|
+
|
|
572
609
|
// Accepts either separator; the daemon holds these as platform paths and normalizing at every call site is what
|
|
573
610
|
// eventually gets forgotten.
|
|
574
|
-
export const isReportedManifest = (relPath: string): boolean =>
|
|
611
|
+
export const isReportedManifest = (relPath: string): boolean => {
|
|
612
|
+
const path = relPath.replaceAll("\\", "/");
|
|
613
|
+
return REPORTED_MANIFEST_PATHS.includes(path) || REPORTED_VOLUME_FILES.includes(path);
|
|
614
|
+
};
|
|
575
615
|
|
|
576
616
|
// Entries directly under `.intentic/` the file API refuses to read, write, move or delete for anyone, owner
|
|
577
617
|
// included (workspace/workspace-files.ts enforces it). Declared here so the browser can draw the same rule instead
|
|
@@ -588,6 +628,8 @@ export const LOCKED_STATE_ENTRIES: ReadonlySet<string> = new Set([
|
|
|
588
628
|
"secrets/ci.json",
|
|
589
629
|
"secrets/doors.json",
|
|
590
630
|
"secrets/auth",
|
|
631
|
+
// An update's pre-images: copies of whatever it converted, vaults included.
|
|
632
|
+
"secrets/converting",
|
|
591
633
|
"records/sessions",
|
|
592
634
|
"local/browser",
|
|
593
635
|
// The provider CLI's own home, undeclared in the table above and so without a group; stays at the state dir root.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { heredocBodies } from "./shell-regions.js";
|
|
2
|
+
|
|
3
|
+
// The one heredoc scan the policy classifier and the daemon's command readers share, pinned by exact offset.
|
|
4
|
+
|
|
5
|
+
const bodiesOf = (command: string): string[] => heredocBodies(command).map(({ start, end }) => command.slice(start, end));
|
|
6
|
+
|
|
7
|
+
test("a body starts on the line after its opener, not at the newline, and ends where its terminator's line starts", () => {
|
|
8
|
+
expect(heredocBodies("cat <<EOF\nx\nEOF")).toEqual([{ start: 10, end: 12 }]);
|
|
9
|
+
const command = "cat > f <<'EOF'\nline one\nline two\nEOF\nls";
|
|
10
|
+
expect(heredocBodies(command)).toEqual([{ start: command.indexOf("line one"), end: command.indexOf("EOF\nls") }]);
|
|
11
|
+
expect(bodiesOf(command)).toEqual(["line one\nline two\n"]);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test("`<<` ends only at a terminator in the first column: an indented one is body, as bash reads it", () => {
|
|
15
|
+
const command = "cat <<EOF\n x\n EOF\n\tEOF\nrm -rf /";
|
|
16
|
+
expect(heredocBodies(command)).toEqual([{ start: 10, end: command.length }]);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("`<<-` ends at a tab-indented terminator", () => {
|
|
20
|
+
const command = "cat <<-EOF\n\tx\n\tEOF\nls";
|
|
21
|
+
expect(heredocBodies(command)).toEqual([{ start: 11, end: 14 }]);
|
|
22
|
+
expect(bodiesOf(command)).toEqual(["\tx\n"]);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("the terminator is the whole word on its line, quoted delimiters included", () => {
|
|
26
|
+
expect(bodiesOf("cat <<EOF\nEOFX\nxEOF\nEOF\nls")).toEqual(["EOFX\nxEOF\n"]);
|
|
27
|
+
expect(bodiesOf(`cat <<'END'\n$HOME\nEND`)).toEqual(["$HOME\n"]);
|
|
28
|
+
expect(bodiesOf(`cat <<"END"\n$HOME\nEND`)).toEqual(["$HOME\n"]);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test("an unterminated body runs to the end of the command, and an opener with no line after it has none", () => {
|
|
32
|
+
expect(heredocBodies("cat <<'EOF'\nrm -rf /")).toEqual([{ start: 12, end: 20 }]);
|
|
33
|
+
expect(heredocBodies("cat <<EOF")).toEqual([]);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test("every heredoc in the command is found, in order", () => {
|
|
37
|
+
expect(bodiesOf("cat <<A >a\n1\nA\ncat <<-B >b\n\t2\n\tB\nls")).toEqual(["1\n", "\t2\n"]);
|
|
38
|
+
});
|
|
@@ -30,9 +30,8 @@ const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/;
|
|
|
30
30
|
// `<<EOF`, `<<-EOF`, quoted or not; the delimiter's quoting only affects expansion, not classification here.
|
|
31
31
|
const HEREDOC_OPEN = /<<-?\s*(['"]?)([A-Za-z_][A-Za-z0-9_]*)\1/g;
|
|
32
32
|
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
const heredocBodies = (command: string): CommandSpan[] => {
|
|
33
|
+
// Heredoc bodies in order, each from the line after its opener to its terminator's line; as in bash, only `<<-` indents that.
|
|
34
|
+
export const heredocBodies = (command: string): CommandSpan[] => {
|
|
36
35
|
const bodies: CommandSpan[] = [];
|
|
37
36
|
for (const open of command.matchAll(HEREDOC_OPEN)) {
|
|
38
37
|
const indented = command.slice(open.index, open.index + 3).startsWith("<<-");
|
|
@@ -158,6 +157,7 @@ const scanWords = (command: string, skip: readonly CommandSpan[]): ShellWord[] =
|
|
|
158
157
|
// Unsorted and possibly overlapping; callers only ask containment of them. Computed once per command by the classifier
|
|
159
158
|
// and shared across every table.
|
|
160
159
|
export const inertRegions = (command: string): CommandSpan[] => {
|
|
160
|
+
// First, in a pass of their own: a body can hold anything, and an odd quote count in it would desync the word scanner.
|
|
161
161
|
const bodies = heredocBodies(command);
|
|
162
162
|
const regions: CommandSpan[] = [...bodies];
|
|
163
163
|
const words = scanWords(command, bodies);
|
|
@@ -2,6 +2,8 @@ import { STATE_DIR } from "@intentic/constants";
|
|
|
2
2
|
import type { AgentEvent } from "../events/agent-events.js";
|
|
3
3
|
import type { TranscriptPatch, TranscriptRow } from "../events/transcript.js";
|
|
4
4
|
import { watchWakePrompt } from "../events/watch-wake.js";
|
|
5
|
+
import { LAND_CONFLICT_OPENING } from "../events/land-conflict.js";
|
|
6
|
+
import { RESUME_NOTES } from "../events/resume.js";
|
|
5
7
|
import { childReportPrompt, peerMessagePrompt } from "../events/agent-words.js";
|
|
6
8
|
import { applyTranscriptPatch, foldTurn, TranscriptFold, userRow } from "./transcript-fold.js";
|
|
7
9
|
|
|
@@ -41,6 +43,19 @@ describe("foldTurn", () => {
|
|
|
41
43
|
]);
|
|
42
44
|
});
|
|
43
45
|
|
|
46
|
+
// The sandbox's composed words (a land's breakage sent back into the live turn) are not the owner's: the row says who
|
|
47
|
+
// spoke them and what for, and a person's steer carries neither.
|
|
48
|
+
it("writes the sandbox's steer down with its speaker and errand, and a person's with neither", () => {
|
|
49
|
+
const events: AgentEvent[] = [
|
|
50
|
+
{ kind: "steer", text: "the land broke main", sentAt: SENT_AT + 1, voice: "sandbox", errand: "land-breakage" },
|
|
51
|
+
{ kind: "steer", text: "and the docs", sentAt: SENT_AT + 2 },
|
|
52
|
+
];
|
|
53
|
+
expect(foldOf("ship it", events).slice(1)).toEqual([
|
|
54
|
+
{ role: "user", text: "the land broke main", sentAt: SENT_AT + 1, speaker: { kind: "sandbox" }, errand: "land-breakage" },
|
|
55
|
+
{ role: "user", text: "and the docs", sentAt: SENT_AT + 2 },
|
|
56
|
+
]);
|
|
57
|
+
});
|
|
58
|
+
|
|
44
59
|
it("does not retire a bubble that has written no prose", () => {
|
|
45
60
|
const events: AgentEvent[] = [
|
|
46
61
|
{ kind: "tool_call", id: "t1", name: "Read", category: "read", status: "completed" },
|
|
@@ -249,6 +264,25 @@ describe("foldTurn", () => {
|
|
|
249
264
|
);
|
|
250
265
|
});
|
|
251
266
|
|
|
267
|
+
// A resolve turn exists because the branch couldn't rebase; its own opening rebase failing the same way is that
|
|
268
|
+
// errand said twice, one row under itself. Any other turn still hears it, and a resolve turn still hears what moved.
|
|
269
|
+
it("leaves the blocked rebase out of a land-conflict turn's notice, and only that", () => {
|
|
270
|
+
const blocked: AgentEvent = { kind: "worktree", branch: "agent/x", base: "abc1234", sync: { commits: 0, blocked: ["intentic"] } };
|
|
271
|
+
const resolve = `${LAND_CONFLICT_OPENING}\n\n1. \`git add -A && git commit\``;
|
|
272
|
+
expect(foldOf(resolve, [blocked])).toEqual(openingOf(resolve));
|
|
273
|
+
expect(foldOf(`${RESUME_NOTES.restart}\n\n${resolve}`, [blocked]).slice(1)).toEqual([]);
|
|
274
|
+
expect(foldOf("go", [blocked]).slice(1)).toEqual([
|
|
275
|
+
{
|
|
276
|
+
role: "notice",
|
|
277
|
+
text: "Couldn't rebase onto your workspace in intentic: the turn is running from the older base, so its land may need a resolve.",
|
|
278
|
+
},
|
|
279
|
+
]);
|
|
280
|
+
const mixed: AgentEvent = { kind: "worktree", branch: "agent/x", base: "abc1234", sync: { commits: 3, blocked: ["intentic"] } };
|
|
281
|
+
expect(foldOf(resolve, [mixed]).slice(1)).toEqual([
|
|
282
|
+
{ role: "notice", text: "Your workspace moved on while this agent waited, its branch was rebased onto your latest 3 commits." },
|
|
283
|
+
]);
|
|
284
|
+
});
|
|
285
|
+
|
|
252
286
|
it("stamps the checkpoint and the preamble's notes on the turn's user row", () => {
|
|
253
287
|
const events: AgentEvent[] = [
|
|
254
288
|
{ kind: "checkpoint", id: "snap-1", index: 4 },
|
|
@@ -451,6 +485,18 @@ describe("patches", () => {
|
|
|
451
485
|
]);
|
|
452
486
|
});
|
|
453
487
|
|
|
488
|
+
// A subagent thinks a token at a time; sending the spawning card whole each time would resend every child it holds.
|
|
489
|
+
it("sends a subagent's reasoning as its words alone, onto the card that spawned it", () => {
|
|
490
|
+
const fold = new TranscriptFold(openingOf("go"));
|
|
491
|
+
fold.apply({ kind: "tool_call", id: "task-1", name: "Agent", category: "other", status: "in_progress" });
|
|
492
|
+
fold.apply({ kind: "tool_call", id: "t2", name: "Read", category: "read", status: "completed", parentToolUseId: "task-1" });
|
|
493
|
+
expect(fold.apply({ kind: "thinking", text: "the handler", parentToolUseId: "task-1" })).toEqual([
|
|
494
|
+
{ op: "toolThinking", index: 1, id: "task-1", text: "the handler" },
|
|
495
|
+
]);
|
|
496
|
+
expect(fold.apply({ kind: "thinking", text: "", parentToolUseId: "task-1" })).toEqual([]);
|
|
497
|
+
expect(fold.rows[1]?.tools?.[0]?.thinking).toBe("the handler");
|
|
498
|
+
});
|
|
499
|
+
|
|
454
500
|
it("send a delegation's card without its subtree or thinking, and a client keeps the ones it has", () => {
|
|
455
501
|
const events: AgentEvent[] = [
|
|
456
502
|
{ kind: "tool_call", id: "task-1", name: "Agent", category: "other", status: "in_progress" },
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from "../events/transcript.js";
|
|
13
13
|
import { contextTrimLine } from "../schemas/context-trim.js";
|
|
14
14
|
import { keptWarmLine } from "../schemas/keep-warm.js";
|
|
15
|
+
import { isLandConflict } from "../events/land-conflict.js";
|
|
15
16
|
import { turnedAwayCode } from "../policy/turned-away.js";
|
|
16
17
|
import { mentionedPathTokens } from "./mentions.js";
|
|
17
18
|
import { unspokenPromptRow } from "../events/agent-words.js";
|
|
@@ -128,7 +129,7 @@ const undelivered = (unattended: boolean): string =>
|
|
|
128
129
|
const memoryPress = (event: Extract<AgentEvent, { kind: "error" }>): "sendAnyway" | "sandboxMemory" =>
|
|
129
130
|
event.memory === undefined ? "sendAnyway" : "sandboxMemory";
|
|
130
131
|
|
|
131
|
-
// A memory hold is asked once and never again that spell (
|
|
132
|
+
// A memory hold is asked once and never again that spell (resource-budget.ts), so the next send always runs. A turn the
|
|
132
133
|
// sandbox started itself (a fix press, a peer's message, a re-run) was never in a composer: its message stays above, and
|
|
133
134
|
// the press asks the sandbox to run the turn it kept rather than sending a queue that holds nothing.
|
|
134
135
|
const heldRow = (event: Extract<AgentEvent, { kind: "error" }>): TranscriptRow => {
|
|
@@ -344,7 +345,7 @@ export class TranscriptFold {
|
|
|
344
345
|
// and the fold beside the message only ever lists notes that actually rode.
|
|
345
346
|
return this.pushRow({ role: "notice", text: contextTrimLine(event) });
|
|
346
347
|
case "worktree":
|
|
347
|
-
return event.sync === undefined ? [] : this.
|
|
348
|
+
return event.sync === undefined ? [] : this.synced(event.sync);
|
|
348
349
|
case "landed":
|
|
349
350
|
return this.pushRow(landedRow(event));
|
|
350
351
|
case "compact":
|
|
@@ -454,13 +455,22 @@ export class TranscriptFold {
|
|
|
454
455
|
return this.pushRow(unspoken);
|
|
455
456
|
}
|
|
456
457
|
// A steer also closes the bubble, or the next answer would print over it mid-call.
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
458
|
+
const row: TranscriptRow = { role: "user", text: event.text, sentAt: event.sentAt };
|
|
459
|
+
if (event.attachments !== undefined) {
|
|
460
|
+
row.attachments = [...event.attachments];
|
|
461
|
+
}
|
|
462
|
+
if (event.messageId !== undefined) {
|
|
463
|
+
row.messageId = event.messageId;
|
|
464
|
+
}
|
|
465
|
+
// The sandbox's own words say so on the row, so a reader never shows them as the owner's; an agent's words
|
|
466
|
+
// come as their own card (agentWords), which names the agent.
|
|
467
|
+
if (event.voice === "sandbox") {
|
|
468
|
+
row.speaker = { kind: "sandbox" };
|
|
469
|
+
}
|
|
470
|
+
if (event.errand !== undefined) {
|
|
471
|
+
row.errand = event.errand;
|
|
472
|
+
}
|
|
473
|
+
const patches = this.pushRow(row);
|
|
464
474
|
// Anchors pair by position with the checkpoints only a person's steer reserves.
|
|
465
475
|
if (event.voice === undefined) {
|
|
466
476
|
this.steerRows.push(this.rows.length - 1);
|
|
@@ -539,7 +549,11 @@ export class TranscriptFold {
|
|
|
539
549
|
if (place === undefined || parent === undefined) {
|
|
540
550
|
return [];
|
|
541
551
|
}
|
|
552
|
+
// Only the new words travel: the card whole, children and all, would go out again for every token.
|
|
542
553
|
if (event.kind === "thinking") {
|
|
554
|
+
if (event.text.length === 0) {
|
|
555
|
+
return [];
|
|
556
|
+
}
|
|
543
557
|
place.tool.thinking = `${place.tool.thinking ?? ""}${event.text}`;
|
|
544
558
|
return [{ op: "toolThinking", index: place.row, id: parent, text: event.text }];
|
|
545
559
|
}
|
|
@@ -613,6 +627,14 @@ export class TranscriptFold {
|
|
|
613
627
|
return [{ op: "tool", index: place.row, tool: structuredClone(ownFields(place.tool)), ...(place.parent === undefined ? {} : { parent: place.parent }) }];
|
|
614
628
|
}
|
|
615
629
|
|
|
630
|
+
// The rebase notice, less what a resolve turn was sent to fix: that turn opens because the branch couldn't rebase, so
|
|
631
|
+
// saying so again one row under its own errand only repeats it. What did move is still told.
|
|
632
|
+
private synced(sync: { commits: number; blocked: readonly string[] }): TranscriptPatch[] {
|
|
633
|
+
const opener = this.opener === undefined ? undefined : this.rows[this.opener];
|
|
634
|
+
const text = syncLine(opener !== undefined && isLandConflict(opener.text) ? { ...sync, blocked: [] } : sync);
|
|
635
|
+
return text === "" ? [] : this.pushRow({ role: "notice", text });
|
|
636
|
+
}
|
|
637
|
+
|
|
616
638
|
private stampOpener(mutate: (row: TranscriptRow) => void): TranscriptPatch[] {
|
|
617
639
|
if (this.opener === undefined) {
|
|
618
640
|
return [];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const FIX_DEPS_AUTOMATION: {
|
|
2
|
-
readonly id: "fix-dependency-breakage";
|
|
3
|
-
readonly title: "Fix what a dependency change broke";
|
|
4
|
-
readonly event: "deps.broken";
|
|
5
|
-
readonly holdForSeconds: 60;
|
|
6
|
-
readonly guard: `test "$(printf '%s' "$AUTOMATION_PAYLOAD" | jq -r '.deps.attempt // 1')" -le 2`;
|
|
7
|
-
readonly guardNote: "stops after 2 attempts";
|
|
8
|
-
readonly prompt: string;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=fix-deps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fix-deps.d.ts","sourceRoot":"","sources":["../../src/chores/fix-deps.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;aAC5B,EAAE,EAAE,yBAAyB;aAC7B,KAAK,EAAE,oCAAoC;aAC3C,KAAK,EAAE,aAAa;aACpB,cAAc,EAAE,EAAE;aAClB,KAAK,EAAE,gFAAgF;aACvF,SAAS,EAAE,wBAAwB;aACnC,MAAM;CAUA,CAAC"}
|
package/dist/chores/fix-deps.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export const FIX_DEPS_AUTOMATION = {
|
|
2
|
-
id: "fix-dependency-breakage",
|
|
3
|
-
title: "Fix what a dependency change broke",
|
|
4
|
-
event: "deps.broken",
|
|
5
|
-
holdForSeconds: 60,
|
|
6
|
-
guard: `test "$(printf '%s' "$AUTOMATION_PAYLOAD" | jq -r '.deps.attempt // 1')" -le 2`,
|
|
7
|
-
guardNote: "stops after 2 attempts",
|
|
8
|
-
prompt: "A landed change drifted this workspace's dependencies; the daemon reinstalled them and ran the project's own checks, " +
|
|
9
|
-
"and they failed. The payload names the project (`deps.project`), the check command (`deps.command`), how it exited " +
|
|
10
|
-
"(`deps.exitCode`) and the tail of its output (`deps.logTail`); the full log is in the project's `--verify` terminal.\n\n" +
|
|
11
|
-
"Re-run the check yourself to see the failure first-hand, then fix the ROOT CAUSE. That usually means updating call " +
|
|
12
|
-
"sites, types or tests to match what actually changed: never loosening or deleting the checks, pinning or downgrading " +
|
|
13
|
-
"dependencies just to silence them, or editing generated files. If the breakage needs a decision only the owner can " +
|
|
14
|
-
"make (an intentional breaking upgrade, a license change, a dependency that should be dropped), stop and say exactly " +
|
|
15
|
-
"that instead of guessing.\n\n" +
|
|
16
|
-
"Finish by running the same check command and reporting what was broken, what you changed, and whether it is green now.",
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=fix-deps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fix-deps.js","sourceRoot":"","sources":["../../src/chores/fix-deps.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,EAAE,EAAE,yBAAyB;IAC7B,KAAK,EAAE,oCAAoC;IAC3C,KAAK,EAAE,aAAa;IACpB,cAAc,EAAE,EAAE;IAClB,KAAK,EAAE,gFAAgF;IACvF,SAAS,EAAE,wBAAwB;IACnC,MAAM,EACF,uHAAuH;QACvH,qHAAqH;QACrH,0HAA0H;QAC1H,qHAAqH;QACrH,uHAAuH;QACvH,qHAAqH;QACrH,sHAAsH;QACtH,+BAA+B;QAC/B,wHAAwH;CACtH,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type IncomingMessage, type ServerResponse } from "node:http";
|
|
2
|
-
import { Duplex } from "node:stream";
|
|
3
|
-
export declare const INITIAL_WINDOW_SIZE: number;
|
|
4
|
-
export declare const CONNECTION_WINDOW_SIZE: number;
|
|
5
|
-
export interface IngressSession {
|
|
6
|
-
readonly forwardRequest: (request: IncomingMessage, response: ServerResponse) => Promise<void>;
|
|
7
|
-
readonly forwardUpgrade: (request: IncomingMessage, socket: Duplex, head: Buffer) => Promise<void>;
|
|
8
|
-
readonly close: () => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const openIngressSession: (duplex: Duplex) => Promise<IngressSession>;
|
|
11
|
-
export interface ServeIngressSessionOptions {
|
|
12
|
-
readonly targetPort: number;
|
|
13
|
-
}
|
|
14
|
-
export interface IngressSessionServer {
|
|
15
|
-
readonly close: () => void;
|
|
16
|
-
}
|
|
17
|
-
export declare const serveIngressSession: (duplex: Duplex, options: ServeIngressSessionOptions) => Promise<IngressSessionServer>;
|
|
18
|
-
export interface TunnelWebSocket {
|
|
19
|
-
readonly send: (data: Buffer, options: {
|
|
20
|
-
binary: boolean;
|
|
21
|
-
}, callback: (error?: Error) => void) => void;
|
|
22
|
-
readonly close: () => void;
|
|
23
|
-
readonly on: {
|
|
24
|
-
(event: `message`, listener: (data: unknown) => void): unknown;
|
|
25
|
-
(event: `close`, listener: () => void): unknown;
|
|
26
|
-
(event: `error`, listener: (error: Error) => void): unknown;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export declare const webSocketDuplex: (socket: TunnelWebSocket) => Duplex;
|
|
30
|
-
//# sourceMappingURL=ingress-protocol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ingress-protocol.d.ts","sourceRoot":"","sources":["../../src/protocol/ingress-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,eAAe,EAA4B,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAU7H,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuGrC,eAAO,MAAM,mBAAmB,QAAc,CAAC;AAK/C,eAAO,MAAM,sBAAsB,QAA0B,CAAC;AAyE9D,MAAM,WAAW,cAAc;IAI3B,QAAQ,CAAC,cAAc,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAG/F,QAAQ,CAAC,cAAc,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnG,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;CAC9B;AAID,eAAO,MAAM,kBAAkB,WAAkB,MAAM,KAAG,OAAO,CAAC,cAAc,CAuG/E,CAAC;AAIF,MAAM,WAAW,0BAA0B;IAEvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IAGjC,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;CAC9B;AAID,eAAO,MAAM,mBAAmB,WAAkB,MAAM,WAAW,0BAA0B,KAAG,OAAO,CAAC,oBAAoB,CA4G3H,CAAC;AAKF,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,KAAK,IAAI,CAAC;IACvG,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE;QACT,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC;QAC/D,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;QAChD,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC;KAC/D,CAAC;CACL;AAED,eAAO,MAAM,eAAe,WAAY,eAAe,KAAG,MAoBzD,CAAC"}
|