@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,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playwright specs: find them, run one, stream what happened.
|
|
3
|
+
*
|
|
4
|
+
* Agents write browser tests constantly and Loom had nowhere to watch them run —
|
|
5
|
+
* you alt-tabbed to a terminal, ran the file blind, and read a stack trace. The
|
|
6
|
+
* Browser tab closes that loop: list the project's specs, run one with a click,
|
|
7
|
+
* watch the reporter line by line, and hand a failure straight back to an agent.
|
|
8
|
+
*
|
|
9
|
+
* Playwright is deliberately the PROJECT's dependency, not Loom's. We run
|
|
10
|
+
* `npx playwright test` in the project's own directory; a project without
|
|
11
|
+
* Playwright gets told that plainly instead of Loom shipping a browser runner
|
|
12
|
+
* the project didn't ask for.
|
|
13
|
+
*/
|
|
14
|
+
import { spawnContained, fileCommand, stopWindowsTree } from "../core/process.js";
|
|
15
|
+
import fs from "node:fs";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
/** Directories never worth walking. Deep, huge, and never contain user specs. */
|
|
18
|
+
const SKIP_DIRS = new Set([
|
|
19
|
+
"node_modules",
|
|
20
|
+
".git",
|
|
21
|
+
"dist",
|
|
22
|
+
"build",
|
|
23
|
+
"out",
|
|
24
|
+
".next",
|
|
25
|
+
".loom",
|
|
26
|
+
"coverage",
|
|
27
|
+
"playwright-report",
|
|
28
|
+
"test-results",
|
|
29
|
+
]);
|
|
30
|
+
const SPEC_RE = /\.(spec|e2e)\.(ts|tsx|js|mjs|cjs)$/;
|
|
31
|
+
/** Inside a Playwright testDir, Playwright's own default testMatch applies too. */
|
|
32
|
+
const TESTDIR_RE = /\.(spec|test|e2e)\.[cm]?[jt]sx?$/;
|
|
33
|
+
const CONFIG_NAMES = ["ts", "js", "mjs", "cjs", "mts", "cts"].map((e) => `playwright.config.${e}`);
|
|
34
|
+
/**
|
|
35
|
+
* Does this project use Playwright, and where does it keep its tests?
|
|
36
|
+
*
|
|
37
|
+
* A `*.spec.ts` alone isn't evidence — Jest and Vitest name theirs the same
|
|
38
|
+
* way, and offering to run those through Playwright is a button that can only
|
|
39
|
+
* fail. A config file or the dependency is. The testDir is read off the
|
|
40
|
+
* config by pattern, not by running it: the common shapes are a string or
|
|
41
|
+
* `path.join(__dirname, "…")`, and anything cleverer falls back to the name
|
|
42
|
+
* match across the project.
|
|
43
|
+
*/
|
|
44
|
+
export function playwrightSetup(projectDir) {
|
|
45
|
+
const config = CONFIG_NAMES.find((n) => fs.existsSync(path.join(projectDir, n))) ?? null;
|
|
46
|
+
let testDir = null;
|
|
47
|
+
if (config) {
|
|
48
|
+
try {
|
|
49
|
+
const src = fs.readFileSync(path.join(projectDir, config), "utf8").slice(0, 64_000);
|
|
50
|
+
const m = /\btestDir\s*:\s*(['"`])([^'"`$]+)\1/.exec(src) ??
|
|
51
|
+
/\btestDir\s*:\s*path\.(?:join|resolve)\(\s*__dirname\s*,\s*(['"`])([^'"`$]+)\1\s*\)/.exec(src);
|
|
52
|
+
if (m?.[2]) {
|
|
53
|
+
const abs = path.resolve(projectDir, m[2]);
|
|
54
|
+
const rel = path.relative(projectDir, abs);
|
|
55
|
+
// a testDir outside the project is not ours to walk
|
|
56
|
+
if (rel && !rel.startsWith("..") && !path.isAbsolute(rel))
|
|
57
|
+
testDir = rel.split(path.sep).join("/");
|
|
58
|
+
else if (!rel)
|
|
59
|
+
testDir = null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
/* unreadable config — the name match still applies */
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
let dependency = false;
|
|
67
|
+
try {
|
|
68
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(projectDir, "package.json"), "utf8"));
|
|
69
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies, ...pkg.optionalDependencies };
|
|
70
|
+
dependency = "@playwright/test" in deps || "playwright" in deps;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
/* no package.json, or not JSON */
|
|
74
|
+
}
|
|
75
|
+
return { config, testDir, dependency };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Every Playwright spec in the project.
|
|
79
|
+
*
|
|
80
|
+
* Only in a project that has Playwright (playwrightSetup). Inside a testDir
|
|
81
|
+
* the config names, every spec- or test-named file is Playwright's; without
|
|
82
|
+
* one, it's by name — `*.spec.*` and `*.e2e.*` is the convention Playwright
|
|
83
|
+
* scaffolds and the one agents follow when asked to "write a test". Parsing
|
|
84
|
+
* imports to be cleverer would drag a TS parser in to answer a question the
|
|
85
|
+
* filename already answers.
|
|
86
|
+
*/
|
|
87
|
+
export function findSpecs(projectDir, maxDepth = 6) {
|
|
88
|
+
const setup = playwrightSetup(projectDir);
|
|
89
|
+
if (!setup.config && !setup.dependency)
|
|
90
|
+
return [];
|
|
91
|
+
const found = [];
|
|
92
|
+
const match = setup.testDir ? TESTDIR_RE : SPEC_RE;
|
|
93
|
+
const walk = (dir, depth) => {
|
|
94
|
+
if (depth > maxDepth || found.length >= 200)
|
|
95
|
+
return;
|
|
96
|
+
let entries;
|
|
97
|
+
try {
|
|
98
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return; // unreadable directory — not this feature's problem
|
|
102
|
+
}
|
|
103
|
+
for (const e of entries) {
|
|
104
|
+
if (e.isDirectory()) {
|
|
105
|
+
if (!SKIP_DIRS.has(e.name) && !e.name.startsWith(".")) {
|
|
106
|
+
walk(path.join(dir, e.name), depth + 1);
|
|
107
|
+
}
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (!match.test(e.name))
|
|
111
|
+
continue;
|
|
112
|
+
const abs = path.join(dir, e.name);
|
|
113
|
+
try {
|
|
114
|
+
const st = fs.statSync(abs);
|
|
115
|
+
found.push({
|
|
116
|
+
path: path.relative(projectDir, abs).split(path.sep).join("/"),
|
|
117
|
+
bytes: st.size,
|
|
118
|
+
mtimeMs: st.mtimeMs,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
/* raced a delete — skip */
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
walk(setup.testDir ? path.join(projectDir, setup.testDir) : projectDir, 0);
|
|
127
|
+
return found.sort((a, b) => a.path.localeCompare(b.path));
|
|
128
|
+
}
|
|
129
|
+
const MAX_LINES = 800;
|
|
130
|
+
/** A spec run that's still going after this has hung, not "taking a while". */
|
|
131
|
+
export const SPEC_TIMEOUT_MS = 10 * 60_000;
|
|
132
|
+
/**
|
|
133
|
+
* One spec run per project at a time.
|
|
134
|
+
*
|
|
135
|
+
* Not a queue — a refusal. Two Playwright runs in one project fight over ports,
|
|
136
|
+
* dev servers and trace directories, and the second's output interleaved into
|
|
137
|
+
* the first's is worse than either alone. The UI disables Run while one is
|
|
138
|
+
* live, and the API says "already running" to anyone else.
|
|
139
|
+
*/
|
|
140
|
+
export class SpecRunner {
|
|
141
|
+
timeoutMs;
|
|
142
|
+
live = new Map();
|
|
143
|
+
/** How long one run may take (LOOM_SPEC_TIMEOUT_MS overrides, for tests). */
|
|
144
|
+
constructor(timeoutMs = Number(process.env.LOOM_SPEC_TIMEOUT_MS) || SPEC_TIMEOUT_MS) {
|
|
145
|
+
this.timeoutMs = timeoutMs;
|
|
146
|
+
}
|
|
147
|
+
running(projectId) {
|
|
148
|
+
return this.live.get(projectId)?.run ?? null;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Start `npx playwright test <file>` in the project directory.
|
|
152
|
+
*
|
|
153
|
+
* The command is overridable via LOOM_SPEC_CMD so tests can exercise the
|
|
154
|
+
* whole streaming path with a shell one-liner instead of installing
|
|
155
|
+
* Playwright into a fixture project.
|
|
156
|
+
*/
|
|
157
|
+
start(projectId, projectDir, file, events) {
|
|
158
|
+
if (this.live.has(projectId)) {
|
|
159
|
+
throw new Error("a spec run is already in progress in this project");
|
|
160
|
+
}
|
|
161
|
+
// The file must be one discovery would offer. This is the same "the rail
|
|
162
|
+
// only offers ADES" rule: accepting any path lets a caller run arbitrary
|
|
163
|
+
// files through npx with the daemon's hands.
|
|
164
|
+
const known = findSpecs(projectDir).some((s) => s.path === file);
|
|
165
|
+
if (!known)
|
|
166
|
+
throw new Error(`"${file}" is not a spec in this project`);
|
|
167
|
+
const run = {
|
|
168
|
+
id: Math.random().toString(36).slice(2, 10),
|
|
169
|
+
file,
|
|
170
|
+
startedAt: Date.now(),
|
|
171
|
+
lines: [],
|
|
172
|
+
};
|
|
173
|
+
const custom = process.env.LOOM_SPEC_CMD;
|
|
174
|
+
const launch = custom ? fileCommand(custom, file) : { command: "npx", args: ["--no-install", "playwright", "test", file, "--reporter=line"], env: process.env, windowsVerbatimArguments: false };
|
|
175
|
+
// Its own process group, so Stop reaches what npx started (the test
|
|
176
|
+
// runner, its workers, the browsers) and not only npx itself.
|
|
177
|
+
const group = process.platform !== "win32";
|
|
178
|
+
const child = spawnContained(launch.command, launch.args, {
|
|
179
|
+
cwd: projectDir,
|
|
180
|
+
env: { ...launch.env, CI: "1", FORCE_COLOR: "0" },
|
|
181
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
182
|
+
detached: group,
|
|
183
|
+
windowsVerbatimArguments: launch.windowsVerbatimArguments,
|
|
184
|
+
});
|
|
185
|
+
let containmentError = false;
|
|
186
|
+
const unproven = (error) => {
|
|
187
|
+
if (containmentError)
|
|
188
|
+
return;
|
|
189
|
+
containmentError = true;
|
|
190
|
+
const line = `could not verify spec process shutdown: ${error instanceof Error ? error.message : String(error)}`;
|
|
191
|
+
run.lines.push(line);
|
|
192
|
+
events.onLine(run, line);
|
|
193
|
+
// Keep the run live: another test writer must not start without proof.
|
|
194
|
+
};
|
|
195
|
+
const signal = (sig) => {
|
|
196
|
+
try {
|
|
197
|
+
if (group && child.pid)
|
|
198
|
+
process.kill(-child.pid, sig);
|
|
199
|
+
else
|
|
200
|
+
void stopWindowsTree(child).catch(unproven);
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
try {
|
|
204
|
+
child.kill(sig);
|
|
205
|
+
}
|
|
206
|
+
catch { /* already gone */ }
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
let hard = null;
|
|
210
|
+
const kill = (why) => {
|
|
211
|
+
if (run.exitCode !== undefined)
|
|
212
|
+
return;
|
|
213
|
+
run.stopped ??= why;
|
|
214
|
+
signal("SIGTERM");
|
|
215
|
+
// a runner that ignores SIGTERM still has to end
|
|
216
|
+
hard ??= setTimeout(() => signal("SIGKILL"), 5_000);
|
|
217
|
+
hard.unref?.();
|
|
218
|
+
};
|
|
219
|
+
const timer = setTimeout(() => {
|
|
220
|
+
const line = `timed out after ${Math.round(this.timeoutMs / 1000)}s — stopping it`;
|
|
221
|
+
run.lines.push(line);
|
|
222
|
+
events.onLine(run, line);
|
|
223
|
+
kill("timeout");
|
|
224
|
+
}, this.timeoutMs);
|
|
225
|
+
timer.unref?.();
|
|
226
|
+
const settle = () => {
|
|
227
|
+
clearTimeout(timer);
|
|
228
|
+
if (hard)
|
|
229
|
+
clearTimeout(hard);
|
|
230
|
+
};
|
|
231
|
+
const push = (chunk) => {
|
|
232
|
+
for (const raw of chunk.toString().split("\n")) {
|
|
233
|
+
const line = raw.trimEnd();
|
|
234
|
+
if (!line)
|
|
235
|
+
continue;
|
|
236
|
+
run.lines.push(line);
|
|
237
|
+
if (run.lines.length > MAX_LINES)
|
|
238
|
+
run.lines.shift();
|
|
239
|
+
events.onLine(run, line);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
child.stdout.on("data", push);
|
|
243
|
+
child.stderr.on("data", push);
|
|
244
|
+
child.on("error", (err) => {
|
|
245
|
+
// npx missing, spawn refused — the run "ended" without starting.
|
|
246
|
+
run.lines.push(`could not start: ${err.message}`);
|
|
247
|
+
events.onLine(run, run.lines[run.lines.length - 1]);
|
|
248
|
+
run.exitCode = 127;
|
|
249
|
+
settle();
|
|
250
|
+
this.live.delete(projectId);
|
|
251
|
+
events.onDone(run);
|
|
252
|
+
});
|
|
253
|
+
const finished = (code) => {
|
|
254
|
+
if (run.exitCode !== undefined)
|
|
255
|
+
return; // error path already settled it
|
|
256
|
+
// killed by a signal: no code, and not a pass
|
|
257
|
+
run.exitCode = code ?? (run.stopped ? 130 : 1);
|
|
258
|
+
settle();
|
|
259
|
+
this.live.delete(projectId);
|
|
260
|
+
events.onDone(run);
|
|
261
|
+
};
|
|
262
|
+
child.on("close", code => {
|
|
263
|
+
if (process.platform === "win32")
|
|
264
|
+
void stopWindowsTree(child).then(() => finished(code), unproven);
|
|
265
|
+
else
|
|
266
|
+
finished(code);
|
|
267
|
+
});
|
|
268
|
+
this.live.set(projectId, { run, kill: () => kill("stop") });
|
|
269
|
+
return run;
|
|
270
|
+
}
|
|
271
|
+
stop(projectId) {
|
|
272
|
+
const entry = this.live.get(projectId);
|
|
273
|
+
if (!entry)
|
|
274
|
+
return false;
|
|
275
|
+
entry.kill();
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
/** Kill everything — daemon shutdown. */
|
|
279
|
+
closeAll() {
|
|
280
|
+
for (const { kill } of this.live.values())
|
|
281
|
+
kill();
|
|
282
|
+
this.live.clear();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=specs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specs.js","sourceRoot":"","sources":["../../src/daemon/specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;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QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;;gBAC9F,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC5D,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAI,CAAC,SAAiB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QACzB,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,yCAAyC;IACzC,QAAQ;QACN,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAAE,IAAI,EAAE,CAAC;QAClD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { type ServerConfig } from "../core/servers.js";
|
|
2
|
+
import { ProjectRuntime } from "./runtime.js";
|
|
3
|
+
export declare const DEFAULT_PORT = 7420;
|
|
4
|
+
/**
|
|
5
|
+
* Fingerprint every built file the daemon can load, as one hash.
|
|
6
|
+
*
|
|
7
|
+
* The walk is what makes it honest. This used to hash exactly two files —
|
|
8
|
+
* server.js and app-page.js — which meant a change anywhere else (an adapter,
|
|
9
|
+
* the router, core/registry.ts) left the rev identical. `loom up` said "daemon
|
|
10
|
+
* already running", the shell agreed it was current, and a daemon kept serving
|
|
11
|
+
* the old code from memory. A correct fix looked like it did nothing, which
|
|
12
|
+
* sends you debugging code that is already right.
|
|
13
|
+
*
|
|
14
|
+
* Content-based on purpose: mtimes are unreliable across runtimes on some
|
|
15
|
+
* filesystems (exFAT drives skew them by the local timezone offset). Names are
|
|
16
|
+
* hashed alongside contents so a rename or a deletion moves the rev too.
|
|
17
|
+
*
|
|
18
|
+
* Read the runtime JS, CSS and HTML once at import; exclude source maps and
|
|
19
|
+
* declarations because they do not change the running app.
|
|
20
|
+
*
|
|
21
|
+
* The desktop shell has a twin of this in desktop/loom-app.js — it can't import
|
|
22
|
+
* this module without pulling express into Electron's main process. They must
|
|
23
|
+
* agree byte for byte; test/desktop-app.test.ts compares them against the real
|
|
24
|
+
* built output so a drift fails there rather than in the field.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fingerprintBuild(root: string): string | null;
|
|
27
|
+
/**
|
|
28
|
+
* This build's rev. Source runs retain the "dev" marker; hashing only their
|
|
29
|
+
* browser JS would misleadingly ignore changes to the TypeScript daemon.
|
|
30
|
+
*/
|
|
31
|
+
export declare const BUILD_REV: string;
|
|
32
|
+
/**
|
|
33
|
+
* Loom's own install root — the directory to ask "am I behind my remote?".
|
|
34
|
+
*
|
|
35
|
+
* Walks up from this module looking for a .git directory (a source checkout or
|
|
36
|
+
* a cloned install). null when Loom was installed some other way (a package),
|
|
37
|
+
* in which case "check for updates" honestly says there's no git tree to check.
|
|
38
|
+
*/
|
|
39
|
+
export declare function loomRoot(): string | null;
|
|
40
|
+
export declare const TERM_MARK = "\u0001__LOOM_END__";
|
|
41
|
+
/**
|
|
42
|
+
* Just enough to give a pasted attachment a sensible extension.
|
|
43
|
+
*/
|
|
44
|
+
export declare const MIME_EXT: Record<string, string>;
|
|
45
|
+
/**
|
|
46
|
+
* Paths from an HTTP body, as strings and nothing else.
|
|
47
|
+
*
|
|
48
|
+
* These reach `git checkout --` and `git clean -fd`, which delete things. A
|
|
49
|
+
* body is whatever the caller felt like sending, so anything that isn't a
|
|
50
|
+
* string is dropped here rather than stringified into a path somewhere deeper.
|
|
51
|
+
* This is the shape check; core/git.ts does the safety check, resolving every
|
|
52
|
+
* one of them against the project root.
|
|
53
|
+
*/
|
|
54
|
+
export declare function asPaths(v: unknown): string[];
|
|
55
|
+
/** KAIRO-style dense fleet metrics for the Observatory Metrics tab. */
|
|
56
|
+
export declare function kairoMetrics(rt: ProjectRuntime): Record<string, unknown>;
|
|
57
|
+
/** A server entry from the wire, checked — a command is a thing we will run. */
|
|
58
|
+
export declare function parseServerConfig(raw: unknown): ServerConfig;
|
|
59
|
+
/** Resolve this machine's Tailscale IPv4 — the tailnet is the trust boundary. */
|
|
60
|
+
export declare function tailscaleIp(): Promise<string>;
|
|
61
|
+
/**
|
|
62
|
+
* One `tailscale status --json`, folded into the three facts the connect-a-phone
|
|
63
|
+
* flow needs: is the CLI installed, is it signed in, and the tailnet IPv4. Lets
|
|
64
|
+
* the UI tell "install Tailscale" apart from "sign in" — and offer to do the
|
|
65
|
+
* latter from inside the app. Never rejects; a missing binary is `installed:false`.
|
|
66
|
+
*/
|
|
67
|
+
export declare function tailscaleState(): Promise<{
|
|
68
|
+
installed: boolean;
|
|
69
|
+
loggedIn: boolean;
|
|
70
|
+
ip: string | null;
|
|
71
|
+
dnsName: string | null;
|
|
72
|
+
state: string | null;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Expose a local port to the public internet over Tailscale Funnel — how the
|
|
76
|
+
* physical LoomPad reaches the voice backend from anywhere (a bare ESP32 can't
|
|
77
|
+
* route to a 100.x tailnet address, but it can reach a Funnel's HTTPS URL).
|
|
78
|
+
* `--bg` returns as soon as it's serving and prints the public URL.
|
|
79
|
+
*/
|
|
80
|
+
export declare function tailscaleFunnel(port: number): Promise<{
|
|
81
|
+
url: string;
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* Fallback ids for a codex too old to have `codex debug models`.
|
|
85
|
+
*
|
|
86
|
+
* Not the shipped set — a *previous* shipped set, which is exactly what a codex
|
|
87
|
+
* without the subcommand would be running. The current one is asked of the CLI;
|
|
88
|
+
* see codexModelCatalog. Anything served from here is reported as
|
|
89
|
+
* `source: "builtin"`.
|
|
90
|
+
*/
|
|
91
|
+
export declare const CODEX_MODELS: string[];
|
|
92
|
+
/**
|
|
93
|
+
* Claude Code's model aliases. The only builtin list left, and it is builtin
|
|
94
|
+
* because the CLI genuinely cannot answer the question.
|
|
95
|
+
*
|
|
96
|
+
* `claude --help` has no `models` subcommand and lists none: what it documents
|
|
97
|
+
* is the shape of the argument — "Provide an alias for the latest model (e.g.
|
|
98
|
+
* 'fable', 'opus', or 'sonnet') or a model's full name (e.g. 'claude-fable-5')".
|
|
99
|
+
* And `claude models` is not an error, which is the trap: `models` is taken as a
|
|
100
|
+
* *prompt*, so the "enumeration" is a billed turn of an LLM writing prose about
|
|
101
|
+
* models, with whatever ids it believes today. A model list that costs money and
|
|
102
|
+
* can hallucinate is not a model list.
|
|
103
|
+
*
|
|
104
|
+
* So: aliases only. They are what the CLI's own help names, they resolve to the
|
|
105
|
+
* latest snapshot by definition, and they can't go stale the way a pinned
|
|
106
|
+
* "claude-sonnet-5" did — an id that used to sit in this array and has never
|
|
107
|
+
* been a model. Full ids belong in the picker's custom field, where they're your
|
|
108
|
+
* claim rather than ours.
|
|
109
|
+
*/
|
|
110
|
+
export declare const CLAUDE_MODELS: string[];
|
|
111
|
+
/** Where a model list came from, so a caller can say which. */
|
|
112
|
+
export type ModelSource = "cli" | "builtin" | "api" | "none";
|
|
113
|
+
export type ModelList = {
|
|
114
|
+
models: string[];
|
|
115
|
+
source: ModelSource;
|
|
116
|
+
};
|
|
117
|
+
export declare const MODEL_LIST_CACHE: Map<string, {
|
|
118
|
+
list: ModelList;
|
|
119
|
+
ts: number;
|
|
120
|
+
}>;
|
|
121
|
+
/**
|
|
122
|
+
* Whatever a CLI prints on stdout, or "" if it can't be run. Never throws.
|
|
123
|
+
*
|
|
124
|
+
* This is `spawn` and not `execFile` for a reason that cost an afternoon:
|
|
125
|
+
* `execFile` calls back when the child's *streams* close, and `agy models`
|
|
126
|
+
* leaves a language-server process holding stdout open after it exits, so
|
|
127
|
+
* execFile waits out its whole timeout and hands back an empty string — the
|
|
128
|
+
* Antigravity picker looked exactly like a CLI that reports no models, on a
|
|
129
|
+
* machine where `agy models` prints eleven. Measured, repeatedly, one fresh
|
|
130
|
+
* process per attempt: execFile 25s/0 lines, spawn 5.3s/11 lines.
|
|
131
|
+
*
|
|
132
|
+
* So: resolve on `exit`, with a short grace period for data still in the pipe,
|
|
133
|
+
* and take `close` when it comes first (it does for every other CLI here).
|
|
134
|
+
* stderr is drained and dropped — unread, a chatty CLI can fill its pipe and
|
|
135
|
+
* block on the write.
|
|
136
|
+
*/
|
|
137
|
+
export declare function runCapture(cmd: string, args: string[], timeoutMs?: number): Promise<string>;
|
|
138
|
+
/** Model ids a CLI prints (one per line), ANSI stripped. Never throws. */
|
|
139
|
+
export declare function runModelList(cmd: string, args: string[]): Promise<string[]>;
|
|
140
|
+
/**
|
|
141
|
+
* codex's own model catalog, which it will print as JSON: `codex debug models`.
|
|
142
|
+
*
|
|
143
|
+
* Not a documented list command — it's under `debug` — but it is the CLI
|
|
144
|
+
* answering about itself rather than us remembering, and it's the same catalog
|
|
145
|
+
* the picker in codex's own TUI is built from. Each entry carries a `slug` (the
|
|
146
|
+
* value `-m` takes) and a `visibility`; `hide` means internal (codex-auto-review
|
|
147
|
+
* is one), and offering an agent a model its own UI won't is offering a
|
|
148
|
+
* failure. ~65ms and 184KB on this machine — the base instructions for every
|
|
149
|
+
* model ride along in that JSON, hence the buffer.
|
|
150
|
+
*
|
|
151
|
+
* Empty on any older codex that has no `debug models`, which is the caller's cue
|
|
152
|
+
* to fall back and say so.
|
|
153
|
+
*/
|
|
154
|
+
export declare function codexModelCatalog(bin: string): Promise<string[]>;
|
|
155
|
+
/**
|
|
156
|
+
* The models an agent kind can run, and whether Loom asked or remembered.
|
|
157
|
+
*
|
|
158
|
+
* Four of the five adapters can be asked, each in its own dialect: `opencode
|
|
159
|
+
* models` (~500 lines across every provider it has), `grok models`, `agy models`
|
|
160
|
+
* (the Antigravity CLI — this branch was missing entirely, so its picker offered
|
|
161
|
+
* "Default" and "Custom…" and nothing else), and `codex debug models`, which
|
|
162
|
+
* prints a JSON catalog rather than lines. Claude Code cannot be asked at all —
|
|
163
|
+
* see CLAUDE_MODELS.
|
|
164
|
+
*
|
|
165
|
+
* `source` is the point of the return shape. "cli" means the tool answered;
|
|
166
|
+
* "builtin" means it couldn't and this is Loom's remembered list, which the UI
|
|
167
|
+
* must be able to say out loud instead of implying a lookup that never
|
|
168
|
+
* happened. An uninstalled CLI answers with nothing, and an empty answer from a
|
|
169
|
+
* CLI is still "cli" — an empty picker for a tool you don't have is the honest
|
|
170
|
+
* result, not a reason to serve it a remembered list behind its back. codex is
|
|
171
|
+
* the one exception: an empty answer there can equally mean a codex too old to
|
|
172
|
+
* have `debug models`, so it falls back — and "builtin" is the true label for
|
|
173
|
+
* whichever of the two it was.
|
|
174
|
+
*
|
|
175
|
+
* Cached 60s per kind: the pickers reopen constantly and none of these change
|
|
176
|
+
* between two clicks.
|
|
177
|
+
*/
|
|
178
|
+
export declare function listModelsForKind(kind: string): Promise<ModelList>;
|
|
179
|
+
/**
|
|
180
|
+
* Bring Tailscale up from inside the app. Runs `tailscale up`; if the machine
|
|
181
|
+
* needs to sign in, that prints a one-time login URL and then blocks until the
|
|
182
|
+
* user authorizes — so we resolve with the URL as soon as we see it and leave
|
|
183
|
+
* the process running (unref'd) to finish the handshake in the background. If it
|
|
184
|
+
* was already signed in, `up` returns fast and we resolve with the tailnet IP.
|
|
185
|
+
*/
|
|
186
|
+
export declare function tailscaleUp(): Promise<{
|
|
187
|
+
loginUrl?: string;
|
|
188
|
+
ip?: string;
|
|
189
|
+
}>;
|
|
190
|
+
/**
|
|
191
|
+
* This machine's LAN IPv4 — the address a phone on the same Wi-Fi uses. We skip
|
|
192
|
+
* loopback, link-local (169.254), and Tailscale's own 100.64/10 CGNAT range so
|
|
193
|
+
* "local network" and "tailnet" stay distinct choices. Returns null when the
|
|
194
|
+
* only addresses are loopback (e.g. no network) — the caller says so honestly
|
|
195
|
+
* rather than minting an unreachable QR.
|
|
196
|
+
*/
|
|
197
|
+
export declare function lanIp(): string | null;
|
|
198
|
+
/** Is this connection from the same machine? (127.0.0.1, ::1, or v4-mapped v6.) */
|
|
199
|
+
export declare function isLoopback(remoteAddress: string | undefined): boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Is the request's `Host` header a loopback literal? The anti-DNS-rebinding
|
|
202
|
+
* check: a rebinding attacker loads a page from their own domain, so the browser
|
|
203
|
+
* sends `Host: attacker.example` even after the name rebinds to 127.0.0.1 — while
|
|
204
|
+
* the genuine local console is always reached at `127.0.0.1`/`localhost`. Pairing
|
|
205
|
+
* the socket check with this closes the "any website → localhost token oracle"
|
|
206
|
+
* path. The port is ignored; only the host is checked.
|
|
207
|
+
*/
|
|
208
|
+
export declare function isLoopbackHost(hostHeader: string | undefined): boolean;
|