@loompad/cli 0.1.0 → 1.1.2
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/ARCHITECTURE.md +96 -11
- package/CHANGELOG.md +1054 -0
- package/README.md +1473 -44
- package/THIRD_PARTY_NOTICES.md +275 -0
- package/dist/adapters/antigravity-cli.d.ts +62 -0
- package/dist/adapters/antigravity-cli.js +258 -0
- package/dist/adapters/antigravity-cli.js.map +1 -0
- package/dist/adapters/base.d.ts +61 -9
- package/dist/adapters/base.js +266 -15
- package/dist/adapters/base.js.map +1 -1
- package/dist/adapters/bridges/antigravity.d.ts +9 -12
- package/dist/adapters/bridges/antigravity.js +9 -12
- package/dist/adapters/bridges/antigravity.js.map +1 -1
- package/dist/adapters/echo.d.ts +1 -0
- package/dist/adapters/echo.js +59 -3
- package/dist/adapters/echo.js.map +1 -1
- package/dist/adapters/grok.d.ts +7 -0
- package/dist/adapters/grok.js +20 -10
- package/dist/adapters/grok.js.map +1 -1
- package/dist/adapters/index.d.ts +5 -1
- package/dist/adapters/index.js +53 -7
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/model.d.ts +137 -0
- package/dist/adapters/model.js +527 -0
- package/dist/adapters/model.js.map +1 -0
- package/dist/adapters/opencode.d.ts +101 -1
- package/dist/adapters/opencode.js +874 -98
- package/dist/adapters/opencode.js.map +1 -1
- package/dist/cli/doctor.d.ts +32 -0
- package/dist/cli/doctor.js +89 -4
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.js +2651 -87
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tui-model.js +3 -1
- package/dist/cli/tui-model.js.map +1 -1
- package/dist/cli/tui.js +44 -1
- package/dist/cli/tui.js.map +1 -1
- package/dist/cli/ui.d.ts +2 -0
- package/dist/cli/ui.js +13 -0
- package/dist/cli/ui.js.map +1 -1
- package/dist/core/ades.d.ts +32 -16
- package/dist/core/ades.js +57 -20
- package/dist/core/ades.js.map +1 -1
- package/dist/core/agent-state.d.ts +14 -0
- package/dist/core/agent-state.js +32 -0
- package/dist/core/agent-state.js.map +1 -0
- package/dist/core/approvals.d.ts +33 -0
- package/dist/core/approvals.js +29 -0
- package/dist/core/approvals.js.map +1 -0
- package/dist/core/backup.d.ts +19 -0
- package/dist/core/backup.js +86 -0
- package/dist/core/backup.js.map +1 -0
- package/dist/core/baton.d.ts +2 -2
- package/dist/core/baton.js.map +1 -1
- package/dist/core/brain-extract.d.ts +17 -0
- package/dist/core/brain-extract.js +28 -2
- package/dist/core/brain-extract.js.map +1 -1
- package/dist/core/brain-index.d.ts +71 -0
- package/dist/core/brain-index.js +204 -5
- package/dist/core/brain-index.js.map +1 -1
- package/dist/core/brain.d.ts +58 -2
- package/dist/core/brain.js +79 -1
- package/dist/core/brain.js.map +1 -1
- package/dist/core/chat-import.d.ts +71 -0
- package/dist/core/chat-import.js +419 -0
- package/dist/core/chat-import.js.map +1 -0
- package/dist/core/checkpoint.d.ts +107 -0
- package/dist/core/checkpoint.js +259 -0
- package/dist/core/checkpoint.js.map +1 -0
- package/dist/core/claude-cli.js +1 -1
- package/dist/core/claude-cli.js.map +1 -1
- package/dist/core/continuity/artifacts.d.ts +14 -0
- package/dist/core/continuity/artifacts.js +118 -0
- package/dist/core/continuity/artifacts.js.map +1 -0
- package/dist/core/continuity/capabilities.d.ts +65 -0
- package/dist/core/continuity/capabilities.js +129 -0
- package/dist/core/continuity/capabilities.js.map +1 -0
- package/dist/core/continuity/contracts.d.ts +352 -0
- package/dist/core/continuity/contracts.js +117 -0
- package/dist/core/continuity/contracts.js.map +1 -0
- package/dist/core/continuity/engine.d.ts +55 -0
- package/dist/core/continuity/engine.js +504 -0
- package/dist/core/continuity/engine.js.map +1 -0
- package/dist/core/continuity/store.d.ts +73 -0
- package/dist/core/continuity/store.js +438 -0
- package/dist/core/continuity/store.js.map +1 -0
- package/dist/core/conversations.d.ts +19 -0
- package/dist/core/conversations.js +87 -0
- package/dist/core/conversations.js.map +1 -0
- package/dist/core/crew-coordination.d.ts +6 -0
- package/dist/core/crew-coordination.js +24 -0
- package/dist/core/crew-coordination.js.map +1 -0
- package/dist/core/crew-policy.d.ts +18 -0
- package/dist/core/crew-policy.js +40 -0
- package/dist/core/crew-policy.js.map +1 -0
- package/dist/core/crew-protocol.d.ts +64 -0
- package/dist/core/crew-protocol.js +146 -0
- package/dist/core/crew-protocol.js.map +1 -0
- package/dist/core/crew-requests.d.ts +14 -0
- package/dist/core/crew-requests.js +22 -0
- package/dist/core/crew-requests.js.map +1 -0
- package/dist/core/crew.d.ts +395 -0
- package/dist/core/crew.js +1857 -0
- package/dist/core/crew.js.map +1 -0
- package/dist/core/digest.d.ts +40 -0
- package/dist/core/digest.js +94 -0
- package/dist/core/digest.js.map +1 -0
- package/dist/core/distill.js +3 -5
- package/dist/core/distill.js.map +1 -1
- package/dist/core/eventlog.d.ts +27 -25
- package/dist/core/eventlog.js +97 -150
- package/dist/core/eventlog.js.map +1 -1
- package/dist/core/events/contracts.d.ts +51 -0
- package/dist/core/events/contracts.js +2 -0
- package/dist/core/events/contracts.js.map +1 -0
- package/dist/core/events/jsonl-store.d.ts +23 -0
- package/dist/core/events/jsonl-store.js +90 -0
- package/dist/core/events/jsonl-store.js.map +1 -0
- package/dist/core/events/sqlite-store.d.ts +37 -0
- package/dist/core/events/sqlite-store.js +215 -0
- package/dist/core/events/sqlite-store.js.map +1 -0
- package/dist/core/forecast.d.ts +44 -0
- package/dist/core/forecast.js +46 -0
- package/dist/core/forecast.js.map +1 -0
- package/dist/core/free-pool.d.ts +65 -0
- package/dist/core/free-pool.js +171 -0
- package/dist/core/free-pool.js.map +1 -0
- package/dist/core/git.d.ts +30 -0
- package/dist/core/git.js +50 -2
- package/dist/core/git.js.map +1 -1
- package/dist/core/github-events.d.ts +53 -0
- package/dist/core/github-events.js +227 -0
- package/dist/core/github-events.js.map +1 -0
- package/dist/core/goal-lanes.d.ts +53 -0
- package/dist/core/goal-lanes.js +99 -0
- package/dist/core/goal-lanes.js.map +1 -0
- package/dist/core/hosted.d.ts +27 -0
- package/dist/core/hosted.js +50 -0
- package/dist/core/hosted.js.map +1 -0
- package/dist/core/http-server.d.ts +5 -0
- package/dist/core/http-server.js +8 -0
- package/dist/core/http-server.js.map +1 -0
- package/dist/core/invite-link.d.ts +31 -0
- package/dist/core/invite-link.js +45 -0
- package/dist/core/invite-link.js.map +1 -0
- package/dist/core/loops.d.ts +37 -0
- package/dist/core/loops.js +81 -0
- package/dist/core/loops.js.map +1 -0
- package/dist/core/mcp-catalog.d.ts +182 -0
- package/dist/core/mcp-catalog.js +431 -0
- package/dist/core/mcp-catalog.js.map +1 -0
- package/dist/core/mcp.d.ts +87 -0
- package/dist/core/mcp.js +181 -0
- package/dist/core/mcp.js.map +1 -0
- package/dist/core/memory.d.ts +1 -0
- package/dist/core/memory.js +5 -2
- package/dist/core/memory.js.map +1 -1
- package/dist/core/model-tools.d.ts +97 -0
- package/dist/core/model-tools.js +388 -0
- package/dist/core/model-tools.js.map +1 -0
- package/dist/core/notify.js +19 -1
- package/dist/core/notify.js.map +1 -1
- package/dist/core/orchestra.d.ts +635 -0
- package/dist/core/orchestra.js +2120 -0
- package/dist/core/orchestra.js.map +1 -0
- package/dist/core/permissions.d.ts +56 -0
- package/dist/core/permissions.js +122 -0
- package/dist/core/permissions.js.map +1 -0
- package/dist/core/preview-proxy.d.ts +70 -0
- package/dist/core/preview-proxy.js +563 -0
- package/dist/core/preview-proxy.js.map +1 -0
- package/dist/core/preview-shot.d.ts +46 -0
- package/dist/core/preview-shot.js +109 -0
- package/dist/core/preview-shot.js.map +1 -0
- package/dist/core/process.d.ts +36 -0
- package/dist/core/process.js +168 -0
- package/dist/core/process.js.map +1 -0
- package/dist/core/prompt-queue.d.ts +136 -0
- package/dist/core/prompt-queue.js +269 -0
- package/dist/core/prompt-queue.js.map +1 -0
- package/dist/core/prompts.d.ts +53 -0
- package/dist/core/prompts.js +127 -0
- package/dist/core/prompts.js.map +1 -0
- package/dist/core/proof.d.ts +82 -0
- package/dist/core/proof.js +216 -0
- package/dist/core/proof.js.map +1 -0
- package/dist/core/provider-text.d.ts +23 -0
- package/dist/core/provider-text.js +66 -0
- package/dist/core/provider-text.js.map +1 -0
- package/dist/core/providers.d.ts +152 -0
- package/dist/core/providers.js +343 -0
- package/dist/core/providers.js.map +1 -0
- package/dist/core/quota.d.ts +33 -0
- package/dist/core/quota.js +74 -0
- package/dist/core/quota.js.map +1 -0
- package/dist/core/recipes.d.ts +50 -0
- package/dist/core/recipes.js +99 -0
- package/dist/core/recipes.js.map +1 -0
- package/dist/core/registry.d.ts +54 -0
- package/dist/core/registry.js +62 -5
- package/dist/core/registry.js.map +1 -1
- package/dist/core/relay-client.d.ts +67 -0
- package/dist/core/relay-client.js +184 -0
- package/dist/core/relay-client.js.map +1 -0
- package/dist/core/relay-protocol.d.ts +140 -0
- package/dist/core/relay-protocol.js +189 -0
- package/dist/core/relay-protocol.js.map +1 -0
- package/dist/core/replay.d.ts +18 -0
- package/dist/core/replay.js +191 -0
- package/dist/core/replay.js.map +1 -0
- package/dist/core/review-triage.d.ts +41 -0
- package/dist/core/review-triage.js +124 -0
- package/dist/core/review-triage.js.map +1 -0
- package/dist/core/router.js +2 -2
- package/dist/core/router.js.map +1 -1
- package/dist/core/routes.d.ts +39 -3
- package/dist/core/routes.js +137 -4
- package/dist/core/routes.js.map +1 -1
- package/dist/core/run-command.d.ts +14 -0
- package/dist/core/run-command.js +45 -0
- package/dist/core/run-command.js.map +1 -0
- package/dist/core/runner-setup.d.ts +36 -0
- package/dist/core/runner-setup.js +114 -0
- package/dist/core/runner-setup.js.map +1 -0
- package/dist/core/search.js +0 -0
- package/dist/core/search.js.map +1 -1
- package/dist/core/semantic.d.ts +92 -0
- package/dist/core/semantic.js +227 -0
- package/dist/core/semantic.js.map +1 -0
- package/dist/core/servers.d.ts +115 -0
- package/dist/core/servers.js +305 -0
- package/dist/core/servers.js.map +1 -0
- package/dist/core/setup.js +64 -6
- package/dist/core/setup.js.map +1 -1
- package/dist/core/shield.d.ts +17 -0
- package/dist/core/shield.js +81 -0
- package/dist/core/shield.js.map +1 -0
- package/dist/core/shift.d.ts +69 -0
- package/dist/core/shift.js +120 -0
- package/dist/core/shift.js.map +1 -0
- package/dist/core/skill-install.d.ts +125 -0
- package/dist/core/skill-install.js +328 -0
- package/dist/core/skill-install.js.map +1 -0
- package/dist/core/skills.d.ts +116 -0
- package/dist/core/skills.js +223 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/step-conditions.d.ts +65 -0
- package/dist/core/step-conditions.js +102 -0
- package/dist/core/step-conditions.js.map +1 -0
- package/dist/core/subagents.d.ts +45 -0
- package/dist/core/subagents.js +90 -0
- package/dist/core/subagents.js.map +1 -0
- package/dist/core/team-canon.d.ts +42 -0
- package/dist/core/team-canon.js +121 -0
- package/dist/core/team-canon.js.map +1 -0
- package/dist/core/team-crypto.d.ts +97 -0
- package/dist/core/team-crypto.js +175 -0
- package/dist/core/team-crypto.js.map +1 -0
- package/dist/core/team-hub.d.ts +514 -0
- package/dist/core/team-hub.js +964 -0
- package/dist/core/team-hub.js.map +1 -0
- package/dist/core/team-landing.d.ts +239 -0
- package/dist/core/team-landing.js +504 -0
- package/dist/core/team-landing.js.map +1 -0
- package/dist/core/team-leases.d.ts +44 -0
- package/dist/core/team-leases.js +145 -0
- package/dist/core/team-leases.js.map +1 -0
- package/dist/core/team-memory.d.ts +42 -0
- package/dist/core/team-memory.js +84 -0
- package/dist/core/team-memory.js.map +1 -0
- package/dist/core/team-policy.d.ts +85 -0
- package/dist/core/team-policy.js +191 -0
- package/dist/core/team-policy.js.map +1 -0
- package/dist/core/thread-md.d.ts +6 -0
- package/dist/core/thread-md.js +42 -0
- package/dist/core/thread-md.js.map +1 -0
- package/dist/core/turn-stats.d.ts +61 -0
- package/dist/core/turn-stats.js +124 -0
- package/dist/core/turn-stats.js.map +1 -0
- package/dist/core/updater.d.ts +73 -0
- package/dist/core/updater.js +153 -0
- package/dist/core/updater.js.map +1 -0
- package/dist/core/usage.d.ts +75 -0
- package/dist/core/usage.js +163 -0
- package/dist/core/usage.js.map +1 -0
- package/dist/core/windows-jobs.d.ts +15 -0
- package/dist/core/windows-jobs.js +170 -0
- package/dist/core/windows-jobs.js.map +1 -0
- package/dist/core/worktree-merge.d.ts +57 -0
- package/dist/core/worktree-merge.js +123 -0
- package/dist/core/worktree-merge.js.map +1 -0
- package/dist/core/worktree.d.ts +5 -0
- package/dist/core/worktree.js +45 -5
- package/dist/core/worktree.js.map +1 -1
- package/dist/core/worktrees.d.ts +6 -0
- package/dist/core/worktrees.js +21 -0
- package/dist/core/worktrees.js.map +1 -0
- package/dist/daemon/app-page.d.ts +0 -17
- package/dist/daemon/app-page.js +10 -6346
- package/dist/daemon/app-page.js.map +1 -1
- package/dist/daemon/auth.d.ts +24 -3
- package/dist/daemon/auth.js +66 -7
- package/dist/daemon/auth.js.map +1 -1
- package/dist/daemon/board.d.ts +7 -0
- package/dist/daemon/board.js +12 -1
- package/dist/daemon/board.js.map +1 -1
- package/dist/daemon/brand-icons.d.ts +6 -1
- package/dist/daemon/brand-icons.js +11 -3
- package/dist/daemon/brand-icons.js.map +1 -1
- package/dist/daemon/client.d.ts +665 -1
- package/dist/daemon/client.js +381 -3
- package/dist/daemon/client.js.map +1 -1
- package/dist/daemon/delivery.d.ts +34 -0
- package/dist/daemon/delivery.js +63 -0
- package/dist/daemon/delivery.js.map +1 -0
- package/dist/daemon/deploys.d.ts +62 -0
- package/dist/daemon/deploys.js +159 -0
- package/dist/daemon/deploys.js.map +1 -0
- package/dist/daemon/landing.d.ts +192 -0
- package/dist/daemon/landing.js +992 -0
- package/dist/daemon/landing.js.map +1 -0
- package/dist/daemon/onboard.d.ts +150 -0
- package/dist/daemon/onboard.js +390 -0
- package/dist/daemon/onboard.js.map +1 -0
- package/dist/daemon/proof.d.ts +70 -0
- package/dist/daemon/proof.js +172 -0
- package/dist/daemon/proof.js.map +1 -0
- package/dist/daemon/push.d.ts +19 -1
- package/dist/daemon/push.js +90 -3
- package/dist/daemon/push.js.map +1 -1
- package/dist/daemon/relay.d.ts +82 -0
- package/dist/daemon/relay.js +351 -0
- package/dist/daemon/relay.js.map +1 -0
- package/dist/daemon/routes/agent-discovery.d.ts +4 -0
- package/dist/daemon/routes/agent-discovery.js +29 -0
- package/dist/daemon/routes/agent-discovery.js.map +1 -0
- package/dist/daemon/routes/agent-settings.d.ts +4 -0
- package/dist/daemon/routes/agent-settings.js +94 -0
- package/dist/daemon/routes/agent-settings.js.map +1 -0
- package/dist/daemon/routes/agents.d.ts +4 -0
- package/dist/daemon/routes/agents.js +105 -0
- package/dist/daemon/routes/agents.js.map +1 -0
- package/dist/daemon/routes/alerts.d.ts +4 -0
- package/dist/daemon/routes/alerts.js +137 -0
- package/dist/daemon/routes/alerts.js.map +1 -0
- package/dist/daemon/routes/approvals.d.ts +4 -0
- package/dist/daemon/routes/approvals.js +40 -0
- package/dist/daemon/routes/approvals.js.map +1 -0
- package/dist/daemon/routes/assets.d.ts +3 -0
- package/dist/daemon/routes/assets.js +64 -0
- package/dist/daemon/routes/assets.js.map +1 -0
- package/dist/daemon/routes/board.d.ts +4 -0
- package/dist/daemon/routes/board.js +147 -0
- package/dist/daemon/routes/board.js.map +1 -0
- package/dist/daemon/routes/brain.d.ts +4 -0
- package/dist/daemon/routes/brain.js +270 -0
- package/dist/daemon/routes/brain.js.map +1 -0
- package/dist/daemon/routes/chats.d.ts +4 -0
- package/dist/daemon/routes/chats.js +249 -0
- package/dist/daemon/routes/chats.js.map +1 -0
- package/dist/daemon/routes/clients.d.ts +4 -0
- package/dist/daemon/routes/clients.js +49 -0
- package/dist/daemon/routes/clients.js.map +1 -0
- package/dist/daemon/routes/cloud.d.ts +4 -0
- package/dist/daemon/routes/cloud.js +46 -0
- package/dist/daemon/routes/cloud.js.map +1 -0
- package/dist/daemon/routes/config.d.ts +4 -0
- package/dist/daemon/routes/config.js +35 -0
- package/dist/daemon/routes/config.js.map +1 -0
- package/dist/daemon/routes/context.d.ts +51 -0
- package/dist/daemon/routes/context.js +2 -0
- package/dist/daemon/routes/context.js.map +1 -0
- package/dist/daemon/routes/crews.d.ts +4 -0
- package/dist/daemon/routes/crews.js +149 -0
- package/dist/daemon/routes/crews.js.map +1 -0
- package/dist/daemon/routes/files.d.ts +3 -0
- package/dist/daemon/routes/files.js +253 -0
- package/dist/daemon/routes/files.js.map +1 -0
- package/dist/daemon/routes/git.d.ts +4 -0
- package/dist/daemon/routes/git.js +96 -0
- package/dist/daemon/routes/git.js.map +1 -0
- package/dist/daemon/routes/history.d.ts +4 -0
- package/dist/daemon/routes/history.js +101 -0
- package/dist/daemon/routes/history.js.map +1 -0
- package/dist/daemon/routes/integrations-project.d.ts +3 -0
- package/dist/daemon/routes/integrations-project.js +103 -0
- package/dist/daemon/routes/integrations-project.js.map +1 -0
- package/dist/daemon/routes/integrations.d.ts +3 -0
- package/dist/daemon/routes/integrations.js +111 -0
- package/dist/daemon/routes/integrations.js.map +1 -0
- package/dist/daemon/routes/logs.d.ts +3 -0
- package/dist/daemon/routes/logs.js +40 -0
- package/dist/daemon/routes/logs.js.map +1 -0
- package/dist/daemon/routes/messages.d.ts +4 -0
- package/dist/daemon/routes/messages.js +60 -0
- package/dist/daemon/routes/messages.js.map +1 -0
- package/dist/daemon/routes/observability.d.ts +4 -0
- package/dist/daemon/routes/observability.js +247 -0
- package/dist/daemon/routes/observability.js.map +1 -0
- package/dist/daemon/routes/onboard.d.ts +12 -0
- package/dist/daemon/routes/onboard.js +67 -0
- package/dist/daemon/routes/onboard.js.map +1 -0
- package/dist/daemon/routes/orchestra.d.ts +4 -0
- package/dist/daemon/routes/orchestra.js +110 -0
- package/dist/daemon/routes/orchestra.js.map +1 -0
- package/dist/daemon/routes/pairing.d.ts +4 -0
- package/dist/daemon/routes/pairing.js +155 -0
- package/dist/daemon/routes/pairing.js.map +1 -0
- package/dist/daemon/routes/preview.d.ts +24 -0
- package/dist/daemon/routes/preview.js +122 -0
- package/dist/daemon/routes/preview.js.map +1 -0
- package/dist/daemon/routes/project-actions.d.ts +4 -0
- package/dist/daemon/routes/project-actions.js +53 -0
- package/dist/daemon/routes/project-actions.js.map +1 -0
- package/dist/daemon/routes/project-team.d.ts +4 -0
- package/dist/daemon/routes/project-team.js +201 -0
- package/dist/daemon/routes/project-team.js.map +1 -0
- package/dist/daemon/routes/projects.d.ts +14 -0
- package/dist/daemon/routes/projects.js +138 -0
- package/dist/daemon/routes/projects.js.map +1 -0
- package/dist/daemon/routes/prompts.d.ts +4 -0
- package/dist/daemon/routes/prompts.js +44 -0
- package/dist/daemon/routes/prompts.js.map +1 -0
- package/dist/daemon/routes/proof.d.ts +4 -0
- package/dist/daemon/routes/proof.js +22 -0
- package/dist/daemon/routes/proof.js.map +1 -0
- package/dist/daemon/routes/providers.d.ts +3 -0
- package/dist/daemon/routes/providers.js +60 -0
- package/dist/daemon/routes/providers.js.map +1 -0
- package/dist/daemon/routes/public.d.ts +4 -0
- package/dist/daemon/routes/public.js +64 -0
- package/dist/daemon/routes/public.js.map +1 -0
- package/dist/daemon/routes/queue.d.ts +4 -0
- package/dist/daemon/routes/queue.js +140 -0
- package/dist/daemon/routes/queue.js.map +1 -0
- package/dist/daemon/routes/routing.d.ts +4 -0
- package/dist/daemon/routes/routing.js +61 -0
- package/dist/daemon/routes/routing.js.map +1 -0
- package/dist/daemon/routes/runtime-handler.d.ts +2 -0
- package/dist/daemon/routes/runtime-handler.js +63 -0
- package/dist/daemon/routes/runtime-handler.js.map +1 -0
- package/dist/daemon/routes/search.d.ts +4 -0
- package/dist/daemon/routes/search.js +17 -0
- package/dist/daemon/routes/search.js.map +1 -0
- package/dist/daemon/routes/servers.d.ts +4 -0
- package/dist/daemon/routes/servers.js +133 -0
- package/dist/daemon/routes/servers.js.map +1 -0
- package/dist/daemon/routes/setup.d.ts +3 -0
- package/dist/daemon/routes/setup.js +50 -0
- package/dist/daemon/routes/setup.js.map +1 -0
- package/dist/daemon/routes/shift.d.ts +4 -0
- package/dist/daemon/routes/shift.js +30 -0
- package/dist/daemon/routes/shift.js.map +1 -0
- package/dist/daemon/routes/specs.d.ts +4 -0
- package/dist/daemon/routes/specs.js +57 -0
- package/dist/daemon/routes/specs.js.map +1 -0
- package/dist/daemon/routes/task-delivery.d.ts +4 -0
- package/dist/daemon/routes/task-delivery.js +38 -0
- package/dist/daemon/routes/task-delivery.js.map +1 -0
- package/dist/daemon/routes/team.d.ts +4 -0
- package/dist/daemon/routes/team.js +193 -0
- package/dist/daemon/routes/team.js.map +1 -0
- package/dist/daemon/routes/terminals.d.ts +4 -0
- package/dist/daemon/routes/terminals.js +87 -0
- package/dist/daemon/routes/terminals.js.map +1 -0
- package/dist/daemon/routes/tools.d.ts +4 -0
- package/dist/daemon/routes/tools.js +180 -0
- package/dist/daemon/routes/tools.js.map +1 -0
- package/dist/daemon/routes/updates.d.ts +4 -0
- package/dist/daemon/routes/updates.js +89 -0
- package/dist/daemon/routes/updates.js.map +1 -0
- package/dist/daemon/routes/voice.d.ts +4 -0
- package/dist/daemon/routes/voice.js +53 -0
- package/dist/daemon/routes/voice.js.map +1 -0
- package/dist/daemon/runner.d.ts +186 -0
- package/dist/daemon/runner.js +612 -0
- package/dist/daemon/runner.js.map +1 -0
- package/dist/daemon/runtime/accounting.d.ts +130 -0
- package/dist/daemon/runtime/accounting.js +303 -0
- package/dist/daemon/runtime/accounting.js.map +1 -0
- package/dist/daemon/runtime/agents.d.ts +16 -0
- package/dist/daemon/runtime/agents.js +71 -0
- package/dist/daemon/runtime/agents.js.map +1 -0
- package/dist/daemon/runtime/briefings.d.ts +134 -0
- package/dist/daemon/runtime/briefings.js +329 -0
- package/dist/daemon/runtime/briefings.js.map +1 -0
- package/dist/daemon/runtime/native-usage.d.ts +21 -0
- package/dist/daemon/runtime/native-usage.js +71 -0
- package/dist/daemon/runtime/native-usage.js.map +1 -0
- package/dist/daemon/runtime/queue.d.ts +94 -0
- package/dist/daemon/runtime/queue.js +222 -0
- package/dist/daemon/runtime/queue.js.map +1 -0
- package/dist/daemon/runtime/relay.d.ts +93 -0
- package/dist/daemon/runtime/relay.js +240 -0
- package/dist/daemon/runtime/relay.js.map +1 -0
- package/dist/daemon/runtime/turns.d.ts +202 -0
- package/dist/daemon/runtime/turns.js +663 -0
- package/dist/daemon/runtime/turns.js.map +1 -0
- package/dist/daemon/runtime-support.d.ts +76 -0
- package/dist/daemon/runtime-support.js +134 -0
- package/dist/daemon/runtime-support.js.map +1 -0
- package/dist/daemon/runtime.d.ts +739 -70
- package/dist/daemon/runtime.js +2751 -470
- package/dist/daemon/runtime.js.map +1 -1
- package/dist/daemon/server.d.ts +82 -55
- package/dist/daemon/server.js +674 -1435
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/shift.d.ts +70 -0
- package/dist/daemon/shift.js +170 -0
- package/dist/daemon/shift.js.map +1 -0
- package/dist/daemon/specs.d.ts +92 -0
- package/dist/daemon/specs.js +285 -0
- package/dist/daemon/specs.js.map +1 -0
- package/dist/daemon/system.d.ts +208 -0
- package/dist/daemon/system.js +557 -0
- package/dist/daemon/system.js.map +1 -0
- package/dist/daemon/tasks.js +1 -1
- package/dist/daemon/team-brain.d.ts +136 -0
- package/dist/daemon/team-brain.js +659 -0
- package/dist/daemon/team-brain.js.map +1 -0
- package/dist/daemon/team-coordinator.d.ts +78 -0
- package/dist/daemon/team-coordinator.js +408 -0
- package/dist/daemon/team-coordinator.js.map +1 -0
- package/dist/daemon/team.d.ts +339 -0
- package/dist/daemon/team.js +1433 -0
- package/dist/daemon/team.js.map +1 -0
- package/dist/daemon/terminals.d.ts +22 -3
- package/dist/daemon/terminals.js +236 -16
- package/dist/daemon/terminals.js.map +1 -1
- package/dist/hub/client.d.ts +120 -0
- package/dist/hub/client.js +228 -0
- package/dist/hub/client.js.map +1 -0
- package/dist/hub/server.d.ts +32 -0
- package/dist/hub/server.js +180 -0
- package/dist/hub/server.js.map +1 -0
- package/dist/hub/supabase-client.d.ts +220 -0
- package/dist/hub/supabase-client.js +843 -0
- package/dist/hub/supabase-client.js.map +1 -0
- package/dist/observability/ask.d.ts +91 -0
- package/dist/observability/ask.js +179 -0
- package/dist/observability/ask.js.map +1 -0
- package/dist/observability/clickhouse.d.ts +33 -0
- package/dist/observability/clickhouse.js +48 -0
- package/dist/observability/clickhouse.js.map +1 -0
- package/dist/observability/decisions.d.ts +176 -0
- package/dist/observability/decisions.js +377 -0
- package/dist/observability/decisions.js.map +1 -0
- package/dist/observability/index.d.ts +89 -0
- package/dist/observability/index.js +348 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/insights.d.ts +151 -0
- package/dist/observability/insights.js +319 -0
- package/dist/observability/insights.js.map +1 -0
- package/dist/observability/logs-query.d.ts +82 -0
- package/dist/observability/logs-query.js +102 -0
- package/dist/observability/logs-query.js.map +1 -0
- package/dist/observability/logs.d.ts +72 -0
- package/dist/observability/logs.js +295 -0
- package/dist/observability/logs.js.map +1 -0
- package/dist/observability/metrics.d.ts +86 -0
- package/dist/observability/metrics.js +303 -0
- package/dist/observability/metrics.js.map +1 -0
- package/dist/observability/otlp.d.ts +127 -0
- package/dist/observability/otlp.js +242 -0
- package/dist/observability/otlp.js.map +1 -0
- package/dist/observability/snapshots.d.ts +43 -0
- package/dist/observability/snapshots.js +129 -0
- package/dist/observability/snapshots.js.map +1 -0
- package/dist/observability/triage.d.ts +49 -0
- package/dist/observability/triage.js +284 -0
- package/dist/observability/triage.js.map +1 -0
- package/dist/providers/adapter.d.ts +50 -0
- package/dist/providers/adapter.js +38 -0
- package/dist/providers/adapter.js.map +1 -0
- package/dist/providers/agent.d.ts +110 -0
- package/dist/providers/agent.js +487 -0
- package/dist/providers/agent.js.map +1 -0
- package/dist/providers/approvals.d.ts +24 -0
- package/dist/providers/approvals.js +78 -0
- package/dist/providers/approvals.js.map +1 -0
- package/dist/providers/attachments.d.ts +20 -0
- package/dist/providers/attachments.js +51 -0
- package/dist/providers/attachments.js.map +1 -0
- package/dist/providers/claude/adapter.d.ts +99 -0
- package/dist/providers/claude/adapter.js +790 -0
- package/dist/providers/claude/adapter.js.map +1 -0
- package/dist/providers/codex/adapter.d.ts +113 -0
- package/dist/providers/codex/adapter.js +881 -0
- package/dist/providers/codex/adapter.js.map +1 -0
- package/dist/providers/codex/instructions.d.ts +11 -0
- package/dist/providers/codex/instructions.js +154 -0
- package/dist/providers/codex/instructions.js.map +1 -0
- package/dist/providers/codex/rpc.d.ts +36 -0
- package/dist/providers/codex/rpc.js +104 -0
- package/dist/providers/codex/rpc.js.map +1 -0
- package/dist/providers/contracts.d.ts +339 -0
- package/dist/providers/contracts.js +19 -0
- package/dist/providers/contracts.js.map +1 -0
- package/dist/providers/directory.d.ts +70 -0
- package/dist/providers/directory.js +95 -0
- package/dist/providers/directory.js.map +1 -0
- package/dist/providers/errors.d.ts +47 -0
- package/dist/providers/errors.js +24 -0
- package/dist/providers/errors.js.map +1 -0
- package/dist/providers/index.d.ts +18 -0
- package/dist/providers/index.js +19 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/ingestion.d.ts +80 -0
- package/dist/providers/ingestion.js +330 -0
- package/dist/providers/ingestion.js.map +1 -0
- package/dist/providers/live.d.ts +22 -0
- package/dist/providers/live.js +56 -0
- package/dist/providers/live.js.map +1 -0
- package/dist/providers/process.d.ts +29 -0
- package/dist/providers/process.js +71 -0
- package/dist/providers/process.js.map +1 -0
- package/dist/providers/reaper.d.ts +33 -0
- package/dist/providers/reaper.js +65 -0
- package/dist/providers/reaper.js.map +1 -0
- package/dist/providers/service.d.ts +87 -0
- package/dist/providers/service.js +256 -0
- package/dist/providers/service.js.map +1 -0
- package/dist/sdk.d.ts +1 -1
- package/dist/sdk.js +1 -1
- package/dist/sdk.js.map +1 -1
- package/dist/types.d.ts +385 -6
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/dist/version.d.ts +7 -0
- package/dist/version.js +16 -0
- package/dist/version.js.map +1 -0
- package/dist/web/app.css +4646 -0
- package/dist/web/app.js +22640 -0
- package/dist/web/app.js.map +7 -0
- package/dist/web/shell.html +39 -0
- package/docs/README.md +21 -0
- package/docs/SETUP.md +10 -0
- package/docs/adapters.md +21 -8
- package/docs/brain-continuity.md +186 -0
- package/docs/cloud.md +108 -0
- package/docs/crews.md +62 -0
- package/docs/design-system.md +31 -2
- package/docs/integration-notes.md +128 -20
- package/docs/loompad.md +105 -0
- package/docs/observability.md +220 -0
- package/docs/play-store.md +123 -0
- package/docs/proposals/agent-teams.md +249 -0
- package/docs/proposals/brain-continuity-implementation.md +468 -0
- package/docs/proposals/brain-session-continuity.md +623 -0
- package/docs/proposals/t3code-port.md +81 -0
- package/docs/proposals/t3code-reference.md +95 -0
- package/docs/refactoring/AGENT-TEAMS-PROGRESS.md +88 -0
- package/docs/refactoring/BOUNDARIES.md +120 -0
- package/docs/refactoring/BRAIN-AUDIT.md +176 -0
- package/docs/refactoring/BRAIN-NOTES.md +390 -0
- package/docs/refactoring/BRAIN-TODO.md +214 -0
- package/docs/refactoring/NOTES.md +129 -0
- package/docs/refactoring/T3-PORT-NOTES.md +165 -0
- package/docs/refactoring/T3-PORT-TODO.md +123 -0
- package/docs/refactoring/TODO.md +46 -0
- package/docs/refactoring/brain-benchmark-2026-09-28.json +48 -0
- package/docs/refactoring/brain-benchmark-audit-2026-09-28.json +48 -0
- package/docs/release-notes/v0.2.0.md +35 -0
- package/docs/release-notes/v0.2.1.md +59 -0
- package/docs/release-notes/v0.2.3.md +77 -0
- package/docs/release-notes/v0.2.4.md +128 -0
- package/docs/release-notes/v0.2.5.md +153 -0
- package/docs/release-notes/v0.2.6.md +62 -0
- package/docs/release-notes/v1.0.0.md +120 -0
- package/docs/release-notes/v1.0.1.md +77 -0
- package/docs/release-notes/v1.1.0.md +71 -0
- package/docs/release-notes/v1.1.1.md +38 -0
- package/docs/release-notes/v1.1.2.md +21 -0
- package/docs/teams-architecture.md +697 -0
- package/docs/teams.md +171 -0
- package/docs/windows.md +85 -0
- package/package.json +22 -9
- package/dist/adapters/claude-code.d.ts +0 -26
- package/dist/adapters/claude-code.js +0 -209
- package/dist/adapters/claude-code.js.map +0 -1
- package/dist/adapters/codex.d.ts +0 -51
- package/dist/adapters/codex.js +0 -291
- package/dist/adapters/codex.js.map +0 -1
- package/docs/img/board-linear.png +0 -0
- package/docs/img/board-projects.png +0 -0
- package/docs/img/brain.png +0 -0
- package/docs/img/settings.png +0 -0
- package/docs/img/workspace.png +0 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
# Brain continuity implementation plan
|
|
2
|
+
|
|
3
|
+
Status: **approved; deterministic native mode implemented behind an opt-in flag**.
|
|
4
|
+
Current implementation: [native continuity](../brain-continuity.md). Remaining
|
|
5
|
+
release milestones are explicit in [BRAIN-TODO](../refactoring/BRAIN-TODO.md);
|
|
6
|
+
this proposal is not a claim that every gate is complete.
|
|
7
|
+
Updated: 2026-09-28. Base: `dev/Harsha` at
|
|
8
|
+
`584a3b6a86bfa9af2a0a8ecbeac57e6aa4578e7a`.
|
|
9
|
+
|
|
10
|
+
This is the actionable plan for the next phase. The earlier
|
|
11
|
+
[continuity proposal](brain-session-continuity.md) supplies broader rationale;
|
|
12
|
+
this document takes precedence for implementation scope. Research and unresolved
|
|
13
|
+
capability questions are in [research notes](../refactoring/BRAIN-NOTES.md).
|
|
14
|
+
Execution progress belongs in [BRAIN-TODO.md](../refactoring/BRAIN-TODO.md).
|
|
15
|
+
No Brain runtime implementation or dependency installation is authorized yet.
|
|
16
|
+
|
|
17
|
+
## 1. Milestone and limits
|
|
18
|
+
|
|
19
|
+
Prove **Claude → Codex → Claude in one app conversation**, including a restart,
|
|
20
|
+
a correction, and a native compaction/unknown-retention case. Add OpenCode only
|
|
21
|
+
after its supported protocol passes the same contract fixtures.
|
|
22
|
+
|
|
23
|
+
The app owns history, instructions, decisions, discussion state and context
|
|
24
|
+
assembly. The native harness owns execution, authentication and tools. Use its
|
|
25
|
+
supported CLI/server interfaces. No replacement coding-agent loop, private
|
|
26
|
+
transcript surgery, API proxy or required hosted API key.
|
|
27
|
+
|
|
28
|
+
The initial implementation has **no embedding model, vector store or model
|
|
29
|
+
runtime download**. Use SQLite, exact entity matching and lexical retrieval.
|
|
30
|
+
Optional cheap harness helpers follow the deterministic flow; they cannot be a
|
|
31
|
+
prerequisite for switching. Do not redesign Electron or add parallel coding here.
|
|
32
|
+
|
|
33
|
+
Stored, submitted, provider-acknowledged and understood are different claims.
|
|
34
|
+
We can verify the first three to varying degrees; we cannot guarantee that a
|
|
35
|
+
model understands every supplied point or retains it after native compaction.
|
|
36
|
+
Arbitrary history cannot fit a fixed small context budget without information
|
|
37
|
+
loss. Never hide that loss by pretending a reference or summary is exact replay.
|
|
38
|
+
|
|
39
|
+
## 2. Owners and interfaces
|
|
40
|
+
|
|
41
|
+
| Module | Responsibility | Excluded responsibility |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| BrainStore | Canonical evidence, state revisions, transactions, artifacts and migrations | Starting native processes or sending UI frames |
|
|
44
|
+
| ConversationState | User intent, accepted decisions, corrections, topic ledger and task observations | Treating helper guesses as user authority |
|
|
45
|
+
| ContextAssembler | Frozen snapshots, source coverage, budgets and deterministic rendering | Sending packets or claiming acceptance |
|
|
46
|
+
| SessionSync | Session bindings, run serialization, submission and recovery | Choosing a provider using its display/model name alone |
|
|
47
|
+
| Retrieval | Scoped FTS/entity search and paginated source reads | Deciding which active instructions to omit |
|
|
48
|
+
| ContextHelper | Optional isolated structured summary/metadata jobs | Repository edits, foreground resume IDs or recursive extraction |
|
|
49
|
+
| Harness adapters | Supported native session/turn operations and factual event translation | Owning app conversations |
|
|
50
|
+
| Client delivery | Versioned UI commands/results and status updates | Mutating canonical history |
|
|
51
|
+
|
|
52
|
+
Build on the [completed ownership separation](../refactoring/BOUNDARIES.md).
|
|
53
|
+
Keep the public EventLog/adapter entrypoints compatible while adding internal
|
|
54
|
+
interfaces. One native session belongs to one app conversation/workspace binding;
|
|
55
|
+
a configured agent ID remains an instance configuration, not a session ID.
|
|
56
|
+
Legacy instance-level cursors must not be reused across unrelated chats.
|
|
57
|
+
|
|
58
|
+
## 3. Capability checks precede implementation
|
|
59
|
+
|
|
60
|
+
Record a profile keyed by harness kind, installed version, executable/endpoint
|
|
61
|
+
identity and relevant configuration fingerprint. Recheck after an upgrade or
|
|
62
|
+
configuration change. Unknown behavior is unsupported until tested.
|
|
63
|
+
|
|
64
|
+
Verify explicit resume IDs, fresh-session creation, model changes, dynamic
|
|
65
|
+
context injection, message/tool IDs, completion versus interruption, usage
|
|
66
|
+
fields, context limits, compaction visibility, and read/search access. Fixtures
|
|
67
|
+
use fake CLIs/local servers; paid live smoke tests need separate authorization.
|
|
68
|
+
|
|
69
|
+
- **Codex:** documentation describes explicit exec resume IDs, JSON events and
|
|
70
|
+
schema-constrained output. Resume by our bound ID, never `--last`. Ephemeral
|
|
71
|
+
runs are helper-only. Choose CLI vs app-server after recording the minimum
|
|
72
|
+
supported version; do not migrate transports merely for consistency.
|
|
73
|
+
[Official CLI reference](https://developers.openai.com/codex/cli/reference/).
|
|
74
|
+
- **Claude:** current CLI documentation describes recorded system prompts on
|
|
75
|
+
resume. A changed append-system prompt may not update the active context until
|
|
76
|
+
compaction. Test dynamic delivery; prefer verified per-turn user content for
|
|
77
|
+
changing handoffs. Use snapshot controls only on versions that support them.
|
|
78
|
+
[Official CLI reference](https://code.claude.com/docs/en/cli-reference#system-prompt-flags-in-resumed-conversations).
|
|
79
|
+
- **OpenCode:** current SDK documents context-only `noReply` prompts, abort and
|
|
80
|
+
summarize operations. Loom currently speaks an older API shape; verify or
|
|
81
|
+
update the adapter before enabling those capabilities. Context-only submission
|
|
82
|
+
still contributes to later input context; it is not a quota bypass.
|
|
83
|
+
[Official SDK](https://opencode.ai/docs/sdk/).
|
|
84
|
+
|
|
85
|
+
Do not assume API features or SDK examples are implemented by every CLI version.
|
|
86
|
+
Native stop acknowledgement must be distinguished from verified process/run
|
|
87
|
+
quiescence. A stopped UI spinner does not authorize a second writer.
|
|
88
|
+
|
|
89
|
+
## 4. Three separate contracts, defined with Zod
|
|
90
|
+
|
|
91
|
+
Add Zod to the backend/shared contracts when implementation is approved. Infer
|
|
92
|
+
TypeScript types from the schemas. Validate unknown inputs at persistence,
|
|
93
|
+
IPC/HTTP, import, adapter and helper boundaries; trusted internal values need not
|
|
94
|
+
be reparsed at every function call. Keep validation out of token-delta hot paths.
|
|
95
|
+
|
|
96
|
+
Use strict, explicitly versioned objects; reject unknown versions without writing
|
|
97
|
+
state. Bound strings, arrays, bytes, nesting and numeric values before expensive
|
|
98
|
+
parsing. Schemas are module-owned and dependency-free apart from Zod.
|
|
99
|
+
|
|
100
|
+
| Contract | Contains | Stored / supplied |
|
|
101
|
+
| --- | --- | --- |
|
|
102
|
+
| ContextPacketV1 | Target binding, snapshot revisions, request reference, protected state, discussion/task context, evidence, source coverage and budget | Immutable database record; only selected contents are rendered |
|
|
103
|
+
| RenderedBriefingV1 | Exact rendered text, renderer version, channel and content hash | Store the exact bytes supplied to the harness |
|
|
104
|
+
| DeliveryReceiptV1 | Packet/attempt/run IDs, state transitions, native IDs where observed, timestamps and evidence | Database bookkeeping; never prompt overhead |
|
|
105
|
+
|
|
106
|
+
Supporting schemas: SourceRefV1, WorkspaceRefV1, InstructionV1, DecisionV1,
|
|
107
|
+
TopicV1, WorkObservationV1, CoverageEntryV1, SessionBindingV1, RunV1 and
|
|
108
|
+
HelperResultV1. Helpers return candidate summaries/topics/claims with source
|
|
109
|
+
references; they do not generate sessions, receipt states or authority grants.
|
|
110
|
+
|
|
111
|
+
Proposed packet shape (design notation, not committed runtime code):
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
type ContextPacketV1 = {
|
|
115
|
+
version: 1;
|
|
116
|
+
id: string;
|
|
117
|
+
conversationId: string;
|
|
118
|
+
requestId: string;
|
|
119
|
+
target: {
|
|
120
|
+
bindingId: string;
|
|
121
|
+
agentInstanceId: string;
|
|
122
|
+
harnessKind: string;
|
|
123
|
+
nativeSessionId: string | null;
|
|
124
|
+
sessionEpoch: number;
|
|
125
|
+
compatibilityFingerprint: string;
|
|
126
|
+
};
|
|
127
|
+
snapshot: {
|
|
128
|
+
throughEventId: number;
|
|
129
|
+
conversationRevision: number;
|
|
130
|
+
protectedStateRevision: number;
|
|
131
|
+
workspace: WorkspaceRefV1;
|
|
132
|
+
instructionFilesFingerprint: string;
|
|
133
|
+
};
|
|
134
|
+
mode: "reconstruction" | "delta";
|
|
135
|
+
currentRequest: SourceRefV1;
|
|
136
|
+
goal: ContextItemV1 | null;
|
|
137
|
+
instructions: ContextItemV1[];
|
|
138
|
+
decisions: ContextItemV1[];
|
|
139
|
+
corrections: ContextItemV1[];
|
|
140
|
+
topics: TopicV1[];
|
|
141
|
+
completedWork: WorkObservationV1[];
|
|
142
|
+
pendingWork: ContextItemV1[];
|
|
143
|
+
recentMessages: ExactMessageV1[];
|
|
144
|
+
evidence: EvidenceReferenceV1[];
|
|
145
|
+
coverage: CoverageEntryV1[];
|
|
146
|
+
budget: {
|
|
147
|
+
estimatedAddedTokens: number;
|
|
148
|
+
estimation: "tokenizer" | "heuristic";
|
|
149
|
+
targetAddedTokens: number;
|
|
150
|
+
overflow: "none" | "soft" | "mandatory";
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
A ContextItem has an ID/revision, text, nonempty source references, scope, source
|
|
156
|
+
origin (`user`, `agent`, `derived`, `external`) and lifecycle status. Source origin
|
|
157
|
+
is not an automatic execution privilege. A decision is exploratory/tentative/
|
|
158
|
+
accepted/rejected/deferred/superseded; accepted user decisions require supporting
|
|
159
|
+
user evidence. Corrections refer to the exact superseded item/revision.
|
|
160
|
+
|
|
161
|
+
SourceRef identifies the project, event ID, source-content hash and optional
|
|
162
|
+
UTF-8 byte span. Event IDs alone are not globally unique. Validate span bounds,
|
|
163
|
+
UTF-8 boundaries, scope and hashes against immutable captured text. Attachments
|
|
164
|
+
use artifact hash/media type/size and access capability, not filesystem paths
|
|
165
|
+
chosen by a helper. WorkspaceRef has a stable local workspace ID, repository
|
|
166
|
+
identity, checkout/worktree identity, observed HEAD/dirty state and revision;
|
|
167
|
+
unknown observations stay unknown rather than becoming an invented clean state.
|
|
168
|
+
|
|
169
|
+
Zod shape checks are only the first layer. Semantic validators enforce reference
|
|
170
|
+
existence/visibility, origin, supersession, mandatory coverage, target epochs,
|
|
171
|
+
workspace compatibility and receipt transitions. No coercion of booleans or IDs,
|
|
172
|
+
no defaults that silently turn uncertain claims into accepted ones.
|
|
173
|
+
|
|
174
|
+
A matching quote proves that text exists, not that a summary faithfully captures
|
|
175
|
+
its meaning. Preserve original sources, test semantic fidelity on the evaluation
|
|
176
|
+
corpus, and retain uncertainty when an interpretation is disputed. Client retry
|
|
177
|
+
IDs are bound to a payload hash; reusing an ID with different text/target is a
|
|
178
|
+
conflict, not a new prompt silently discarded as a duplicate.
|
|
179
|
+
|
|
180
|
+
Generate helper JSON Schema from simple JSON-compatible Zod schemas. Refinements
|
|
181
|
+
and transforms may not be representable; run semantic checks locally after the
|
|
182
|
+
response. Pin and test the harness-supported JSON Schema dialect/subset rather
|
|
183
|
+
than assume generated schemas work everywhere. [Zod API](https://zod.dev/api),
|
|
184
|
+
[JSON Schema conversion](https://zod.dev/json-schema).
|
|
185
|
+
|
|
186
|
+
Structured output can still fail or exhaust retry limits; keep the raw eligible
|
|
187
|
+
source and deterministic path rather than considering a partial JSON object a
|
|
188
|
+
valid checkpoint. [Claude structured output errors](https://code.claude.com/docs/en/agent-sdk/structured-outputs#error-handling).
|
|
189
|
+
|
|
190
|
+
## 5. Capture and protect conversation meaning
|
|
191
|
+
|
|
192
|
+
Persist each user submission exactly once with an idempotent client request ID,
|
|
193
|
+
original eligible text, attachment references, timestamp and destination captured
|
|
194
|
+
at submission. Editing a sent message appends a revision/correction; it cannot
|
|
195
|
+
rewrite evidence already delivered. Main's pre-chat events remain Main's.
|
|
196
|
+
|
|
197
|
+
Separate captured observations from normalized projections. Streaming deltas
|
|
198
|
+
update a reconstructable message draft; final output closes it. An interrupted
|
|
199
|
+
assistant message stays partial. Tool records distinguish requested, running,
|
|
200
|
+
succeeded, failed, cancelled and outcome-unknown. Preserve final status, exit
|
|
201
|
+
code and relevant stdout AND stderr. A success claim requires evidence; an agent
|
|
202
|
+
saying tests passed remains a reported claim until a matching tool outcome exists.
|
|
203
|
+
|
|
204
|
+
Protect current user instructions, accepted decisions, unresolved corrections,
|
|
205
|
+
current request and unfinished work independently of retrieval ranking. Preserve
|
|
206
|
+
small preferences and user discussion, including rejected alternatives and open
|
|
207
|
+
questions, in a topic ledger with source links. Discussion is not automatically
|
|
208
|
+
a command. Contradictions remain explicit until a clear correction resolves them.
|
|
209
|
+
Do not use recency alone to supersede an unrelated scoped instruction.
|
|
210
|
+
|
|
211
|
+
Every eligible user message gets a source disposition: exact, source-backed
|
|
212
|
+
summary, deferred/unprocessed, or explicitly excluded with a reason. Do not call
|
|
213
|
+
unprocessed text summarized. Deferred user intent remains exact in the mandatory
|
|
214
|
+
context path until covered. Helper extraction may propose interpretations; it
|
|
215
|
+
cannot certify semantic completeness or grant itself authority.
|
|
216
|
+
|
|
217
|
+
Summaries retain originals and source hashes. They may replace verbose assistant
|
|
218
|
+
and tool detail in the packet, but do not silently replace critical user wording.
|
|
219
|
+
Without helpers, use exact spans and deterministic task/topic records; uncertain
|
|
220
|
+
user intent cannot be safely compressed just because the budget is small.
|
|
221
|
+
|
|
222
|
+
## 6. Packet assembly and actual harness input
|
|
223
|
+
|
|
224
|
+
Assemble from one frozen database snapshot, after obtaining the execution lease:
|
|
225
|
+
|
|
226
|
+
1. Resolve the target binding and resume compatibility. Missing/incompatible
|
|
227
|
+
sessions or uncertain retained context select reconstruction.
|
|
228
|
+
2. Select mandatory active user state, the exact new request and unresolved user
|
|
229
|
+
source dispositions. Then add open topics/tasks and relevant work observations.
|
|
230
|
+
3. Prefer exact eligible history if it fits. Otherwise select a recent exact tail
|
|
231
|
+
and cached source-backed checkpoints; retrieve task-specific evidence only
|
|
232
|
+
after mandatory context has been reserved.
|
|
233
|
+
4. A delta includes changes not previously submitted, explicit supersession,
|
|
234
|
+
fresh workspace observations and the active protected state. It is not simply
|
|
235
|
+
`events since lastId`: referenced/summarized sources have different coverage.
|
|
236
|
+
5. Deduplicate overlapping evidence and the current request. Do not count the
|
|
237
|
+
same prompt as both recent history and new input. New observations after the
|
|
238
|
+
snapshot go to the next delta; new governing corrections invalidate an unsent
|
|
239
|
+
packet and force reassembly.
|
|
240
|
+
6. Render fixed sections: goal; active user instructions; accepted decisions and
|
|
241
|
+
corrections; work completed with evidence; unfinished work/open questions;
|
|
242
|
+
relevant exact discussion/evidence; exact current request. Label historical
|
|
243
|
+
assistant/tool/external content as evidence, not executable instructions.
|
|
244
|
+
7. Store packet and rendered hash atomically. Recheck permissions, session epoch,
|
|
245
|
+
protected revision and workspace identity immediately before submission.
|
|
246
|
+
|
|
247
|
+
Transmit the briefing alongside the new request in **one normal foreground
|
|
248
|
+
turn**, using the tested native channel. Avoid a separate paid "acknowledge this
|
|
249
|
+
context" turn. OpenCode context-only injection is optional when verified; if used,
|
|
250
|
+
its submission and the subsequent action are separate recorded attempts.
|
|
251
|
+
|
|
252
|
+
A file/MCP reference is not the referenced text. Every source access route must
|
|
253
|
+
be usable by the target harness. Offer small paginated read/search tools with
|
|
254
|
+
scope checks; a local read-only export is fallback where MCP is unavailable.
|
|
255
|
+
Supply critical intent inline even when retrieval exists. If neither retrieval
|
|
256
|
+
nor file reading works, include necessary evidence inline or report the limitation.
|
|
257
|
+
|
|
258
|
+
No recorded tool invocation is re-executed during reconstruction. Native hidden
|
|
259
|
+
state, credentials and private reasoning are not imported to imitate another
|
|
260
|
+
harness. Do not elevate all imported memories to system-level authority, as the
|
|
261
|
+
legacy generic briefing wrapper currently does.
|
|
262
|
+
|
|
263
|
+
## 7. Budgets, retrieval and compaction
|
|
264
|
+
|
|
265
|
+
Initial configurable **soft targets**, not performance promises: 3–6k added
|
|
266
|
+
context tokens for reconstruction; 1–3k for a return delta. Also respect verified
|
|
267
|
+
native context capacity, output reserve and harness/tool overhead. Treat remaining
|
|
268
|
+
capacity as unknown when the harness does not report it. Character count alone
|
|
269
|
+
is not a tokenizer, especially for code, CJK, emoji and large attachments.
|
|
270
|
+
|
|
271
|
+
Order budget reductions: deduplicate, remove irrelevant evidence, shorten verbose
|
|
272
|
+
assistant/tool summaries, reduce optional history, use cached validated checkpoints.
|
|
273
|
+
Never truncate the current request or drop active user requirements silently.
|
|
274
|
+
Mandatory overflow returns a visible, resumable result: expand context within
|
|
275
|
+
verified capacity or explicitly narrow/archive scope. The default must not quietly
|
|
276
|
+
send less than required or repeatedly spawn helper retries to try fitting it.
|
|
277
|
+
|
|
278
|
+
Search uses chat/workspace/scope filtering, exact paths/symbols and FTS5 BM25.
|
|
279
|
+
Parameterized SQL is required; separately escape/limit FTS query syntax. Topic
|
|
280
|
+
aliases and optional helper query expansion address wording differences. Lexical
|
|
281
|
+
search is not semantic recall; label uncertainty and provide a broader paginated
|
|
282
|
+
source search. Test FTS availability and rebuild consistency; fallback to bounded
|
|
283
|
+
exact/entity search if unavailable. [SQLite FTS5](https://sqlite.org/fts5.html).
|
|
284
|
+
|
|
285
|
+
Coverage records exact/summarized/referenced/omitted for individual sources or
|
|
286
|
+
validated contiguous ranges. Never advance a full-coverage cursor over holes.
|
|
287
|
+
Track submitted coverage and retained-context confidence separately. Receipt
|
|
288
|
+
acceptance does not establish comprehension. Native compaction invalidates any
|
|
289
|
+
assumption of exact retention; refresh protected state and relevant checkpoints.
|
|
290
|
+
Unknown compaction visibility is recorded as unknown and uses conservative,
|
|
291
|
+
configurable reconstruction triggers without resetting every native session.
|
|
292
|
+
|
|
293
|
+
Optional helpers run in isolated sessions, receive bounded source snapshots and
|
|
294
|
+
return strict source-backed output. Resolve available models; Luna/Haiku are
|
|
295
|
+
preferences, not universal IDs. Never substitute a more expensive model silently.
|
|
296
|
+
Disable tools/MCP/hooks/skills where supported and verified; a read-only sandbox
|
|
297
|
+
alone is insufficient. No helper can mutate the workspace or main session.
|
|
298
|
+
|
|
299
|
+
Start with one helper job per project, deduped by sources/hash/prompt/model/policy.
|
|
300
|
+
Set global concurrency, input/output, timeout and usage caps. Foreground work
|
|
301
|
+
wins; no recursive helper triggers or summarizing summaries without original
|
|
302
|
+
sources. Invalid/late/deleted-source outputs are discarded, originals remain,
|
|
303
|
+
and repeated failure opens a cooldown instead of an infinite repair loop.
|
|
304
|
+
|
|
305
|
+
Measure added context, retrieval output and helper usage separately from native
|
|
306
|
+
reported input/output/cached tokens and quota errors. Missing usage is unknown,
|
|
307
|
+
not zero. Stable rendering avoids unnecessary prompt churn, but caches are
|
|
308
|
+
provider-local and subscription cost cannot be inferred from API prices.
|
|
309
|
+
[Claude cost guidance](https://code.claude.com/docs/en/costs).
|
|
310
|
+
|
|
311
|
+
## 8. Runs, switching, receipts and recovery
|
|
312
|
+
|
|
313
|
+
One foreground run per chat and one mutating foreground owner per workspace.
|
|
314
|
+
The workspace rule applies to pinned chats, routes and other participating
|
|
315
|
+
workflows, not only the new switch button. Existing orchestra worktrees retain
|
|
316
|
+
separate ownership. Read-only concurrent work is a later explicit capability;
|
|
317
|
+
a "pinned thread" alone is not proof its adapter cannot edit.
|
|
318
|
+
|
|
319
|
+
Persist a run with request ID, target binding/epoch, source snapshot and writer
|
|
320
|
+
lease before invoking the harness. Events carry instance, native session, epoch,
|
|
321
|
+
run ID and provider event identity where supplied. A terminal event is recorded
|
|
322
|
+
before the next queued turn is released. Late old-run events stay attached to
|
|
323
|
+
that run and cannot change the selected target or current work projections.
|
|
324
|
+
|
|
325
|
+
Idle picker changes are free local selection. Submitted/queued requests keep
|
|
326
|
+
their captured destination. During a run offer finish-then-switch (default) or
|
|
327
|
+
interrupt-then-switch. Interrupt requests move to stopping; keep the writer lease
|
|
328
|
+
until verified quiescence. Approval prompts and child processes may prevent it.
|
|
329
|
+
Fail visibly if stop cannot be verified; do not launch another writer anyway.
|
|
330
|
+
|
|
331
|
+
Receipt states and meaning:
|
|
332
|
+
|
|
333
|
+
```text
|
|
334
|
+
prepared -> submitting -> accepted
|
|
335
|
+
-> failed
|
|
336
|
+
-> outcome_unknown
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
`prepared` has not invoked the native interface. Persist `submitting` before the
|
|
340
|
+
external call. `accepted` requires documented evidence, such as a correlated
|
|
341
|
+
native user-message/turn event; process spawn alone is not acceptance. A provider
|
|
342
|
+
response may prove acceptance even if the completed run failed. `failed` means
|
|
343
|
+
known rejection/non-submission, not every timeout. A lost response after a possible
|
|
344
|
+
submission is `outcome_unknown`. Cancellation does not retract delivered text.
|
|
345
|
+
|
|
346
|
+
Use a separate attempt record for retries. On restart, inspect the session/run
|
|
347
|
+
and workspace for correlated evidence. Recover accepted or safely failed states
|
|
348
|
+
where possible; otherwise keep unknown and require explicit recovery selection.
|
|
349
|
+
Never blindly replay an action prompt: harnesses without idempotency cannot
|
|
350
|
+
provide exactly-once external execution. Brain's own writes/request ingestion
|
|
351
|
+
are idempotent; that does not make the native side idempotent.
|
|
352
|
+
|
|
353
|
+
A replacement native session gets a new epoch and reconstructed context. Update
|
|
354
|
+
UI success only when startup/binding is verified; failed switches preserve pending
|
|
355
|
+
intent. App restart must not orphan a still-writing CLI and then start another.
|
|
356
|
+
Multiple app/daemon processes use validated project ownership/fencing; a stale
|
|
357
|
+
heartbeat or PID number alone is insufficient to authorize takeover.
|
|
358
|
+
|
|
359
|
+
## 9. SQLite, artifacts and migration
|
|
360
|
+
|
|
361
|
+
Extend `.loom/log.db`; preserve all existing event IDs and original payloads.
|
|
362
|
+
Use an ordered migration table and transactions. Core logical records: events,
|
|
363
|
+
requests/runs, session_bindings, context_items/topics/work_observations,
|
|
364
|
+
context_packets/rendered_briefings/delivery_attempts/source_coverage,
|
|
365
|
+
checkpoints/helper_jobs, chunks/chunks_fts, artifacts and import manifests.
|
|
366
|
+
Final DDL is a phase deliverable, with foreign keys, unique idempotency keys and
|
|
367
|
+
indexes designed from query paths. Do not implement every optional table upfront.
|
|
368
|
+
|
|
369
|
+
One database owner per project, outside UI execution. Use the existing daemon
|
|
370
|
+
backend for the first flow, with indexed, paginated and bounded queries. The
|
|
371
|
+
current EventLog interface is synchronous: it cannot be transparently moved to a
|
|
372
|
+
worker without blocking waits or changing its contract. Do neither silently.
|
|
373
|
+
During P0 define an asynchronous internal command/read interface for any future
|
|
374
|
+
worker boundary; keep the existing synchronous facade in its owning execution
|
|
375
|
+
context. Never acknowledge a memory-only append before durable commit.
|
|
376
|
+
|
|
377
|
+
Measure daemon event-loop responsiveness in P3. If bounded operations still exceed
|
|
378
|
+
the agreed threshold, worker/process isolation becomes a release prerequisite
|
|
379
|
+
and must route legacy and new writers through the same owner. Its queue must be
|
|
380
|
+
bounded/ordered, with crash recovery and backpressure. Do not add a worker merely
|
|
381
|
+
to appear optimized, or create a second canonical database to avoid migration.
|
|
382
|
+
|
|
383
|
+
WAL requires a supported local filesystem; foreign keys, busy handling and
|
|
384
|
+
checkpoint/backpressure policies must be tested. Do not use a live copy of only
|
|
385
|
+
`log.db` as backup. Use the supported backup API or coordinated clean shutdown;
|
|
386
|
+
probe Node compatibility rather than assume the newest API exists on the current
|
|
387
|
+
minimum Node version. [SQLite WAL](https://sqlite.org/wal.html),
|
|
388
|
+
[backup API](https://sqlite.org/backup.html), [Node SQLite](https://nodejs.org/api/sqlite.html).
|
|
389
|
+
|
|
390
|
+
Artifacts are written to same-filesystem temporary paths, hashed, flushed and
|
|
391
|
+
atomically finalized before committing a database reference. Test crash windows;
|
|
392
|
+
clean unreferenced files only after a grace period and reference checks. Hashes
|
|
393
|
+
provide identity/integrity, not authorization. Bound decompression and media
|
|
394
|
+
parsing; safe relative paths cannot escape artifact storage via symlinks.
|
|
395
|
+
|
|
396
|
+
JSONL is export/import, not a dual live writer for the new continuity feature.
|
|
397
|
+
Legacy JSONL remains readable. Offer explicit, backed-up SQLite migration; do
|
|
398
|
+
not silently cut over or start an empty database. If both files contain distinct
|
|
399
|
+
history, reconcile with manifests/source mappings and visible conflicts. Preserve
|
|
400
|
+
source IDs where possible; collisions require namespaced import mappings.
|
|
401
|
+
An unavailable SQLite runtime keeps legacy behavior but reports new continuity
|
|
402
|
+
as unavailable until migration/support exists. No silent feature downgrade.
|
|
403
|
+
|
|
404
|
+
Cutover also migrates chat metadata and old instance resume slots. A legacy native
|
|
405
|
+
cursor can be mapped only to a verified owning conversation; ambiguous bindings
|
|
406
|
+
stay unassigned. Do not attach one cursor to every existing chat. Validate counts,
|
|
407
|
+
hashes, source references and Main compatibility before committing the cutover.
|
|
408
|
+
Rollback must export/include post-cutover events, not discard them by restoring
|
|
409
|
+
an old snapshot. Test new-version data with an older reader and fail clearly.
|
|
410
|
+
|
|
411
|
+
Chat hiding and explicit data deletion are distinct actions. Explicit deletion
|
|
412
|
+
invalidates dependent summaries/packets/indexes and cancels helper jobs. Prior
|
|
413
|
+
native sessions may retain submitted text; do not promise app deletion retracts
|
|
414
|
+
it. Team/private memory, cross-project retrieval, logs and exports require explicit
|
|
415
|
+
scope rules. Import external instructions as evidence without overwriting user
|
|
416
|
+
instruction files or changing permissions.
|
|
417
|
+
|
|
418
|
+
## 10. Work order and review gates
|
|
419
|
+
|
|
420
|
+
| Phase | Deliverables | Required evidence before proceeding |
|
|
421
|
+
| --- | --- | --- |
|
|
422
|
+
| P0: contracts and capabilities | Zod schemas, fixtures/profiles, supported-version policy, session identity and leases | Per-harness input/resume/stop/ack tests; semantic validation failures; no paid calls |
|
|
423
|
+
| P1: evidence/storage | Migrations, source refs, exact messages, artifacts, conversation state, FTS and project ownership | SQLite/JSONL reconciliation, rollback, crash/disk-full fixtures, original user intent recoverable |
|
|
424
|
+
| P2: deterministic continuity | Assembler, renderer, scoped reads, receipts, runs, sequential switching | Claude → Codex → Claude fake harness flow, corrections, unknown receipt recovery, no duplicate action execution |
|
|
425
|
+
| P3: long conversations | Checkpoints/compaction policy, bounded backend work, diagnostics and budgets; worker isolation if measurements require it | Buried small decisions, native/unknown compaction, overflow; long-history responsiveness/cost measurements |
|
|
426
|
+
| P4: optional helpers | Isolated low-cost summaries and title/topic generation | Source/authority validation, usage caps, provider-down fallback, quality comparison against exact replay |
|
|
427
|
+
| P5: integration/cutover | Verified OpenCode, team/bridge/queue/route consumers, removal of superseded injection | Regression suite, packaging and supported-platform checks; no hidden legacy context duplication |
|
|
428
|
+
|
|
429
|
+
Do not ship "seamless long-chat switching" after only P2's happy path. P3 is part
|
|
430
|
+
of the first usable product milestone. P4 is optional; P5 may gate release where
|
|
431
|
+
existing workflows would otherwise bypass context or writer ownership.
|
|
432
|
+
|
|
433
|
+
Acceptance requires: exact original user evidence recoverable; every active
|
|
434
|
+
instruction represented in the supplied packet; corrections supersede the correct
|
|
435
|
+
scoped revision; acknowledged coverage never crosses holes; no context leaks;
|
|
436
|
+
unknown outcomes never automatically replay edits; no required local model;
|
|
437
|
+
helper/provider outages preserve deterministic operation or explicit overflow.
|
|
438
|
+
|
|
439
|
+
Use recorded fixtures and deterministic assertions for structure, ordering,
|
|
440
|
+
coverage and recovery. Later authorized live evaluations test whether models
|
|
441
|
+
actually continue correctly; passing a schema test cannot prove model behavior.
|
|
442
|
+
Compare exact replay, current Loom and the new assembler on the same histories.
|
|
443
|
+
Measure p50/p95 assembly/switch latency, event-loop delay, memory, stored bytes,
|
|
444
|
+
added/retrieved/helper/native tokens and continuation outcomes. Freeze reference
|
|
445
|
+
hardware and proposed thresholds after baseline; do not invent achieved numbers.
|
|
446
|
+
|
|
447
|
+
## 11. Review choices
|
|
448
|
+
|
|
449
|
+
Recommended defaults for approval: Zod contracts; SQLite canonical storage;
|
|
450
|
+
no embeddings; deterministic first; one workspace writer; soft context budgets
|
|
451
|
+
above; helper jobs disabled until isolation/account-capability checks pass;
|
|
452
|
+
finish-then-switch; no automatic replay of unknown action submissions.
|
|
453
|
+
|
|
454
|
+
Decide during P0: minimum harness versions, CLI/app-server transport, a usable
|
|
455
|
+
read-only retrieval route per harness and legacy-session adoption rules. Decide
|
|
456
|
+
before release: reference hardware/performance thresholds, retention/export
|
|
457
|
+
controls, and the UI action for mandatory overflow. These are explicit gates,
|
|
458
|
+
not gaps to fill with guessed behavior during implementation.
|
|
459
|
+
|
|
460
|
+
This plan is ready for user review. Follow the companion TODO only after the user
|
|
461
|
+
authorizes implementation; current work changes documentation only.
|
|
462
|
+
|
|
463
|
+
## Implementation audit — 2026-09-28
|
|
464
|
+
|
|
465
|
+
The current code was audited against this plan and all E01–E64 requirements.
|
|
466
|
+
[BRAIN-AUDIT](../refactoring/BRAIN-AUDIT.md) records separate standards/spec reviews,
|
|
467
|
+
fixes, verification and remaining partial/gated work. This plan remains broader
|
|
468
|
+
than the supported opt-in milestone; unchecked release gates are not complete.
|