@hoknie/aip 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +13 -0
- package/README.md +74 -2
- package/dist/app/agents.js +20 -0
- package/dist/app/agents.js.map +1 -0
- package/dist/app/application.js +205 -0
- package/dist/app/application.js.map +1 -0
- package/dist/app/daemon.js +71 -0
- package/dist/app/daemon.js.map +1 -0
- package/dist/app/index.js +5 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/lifecycle.js +34 -0
- package/dist/app/lifecycle.js.map +1 -0
- package/dist/app/maintenance.js +27 -0
- package/dist/app/maintenance.js.map +1 -0
- package/dist/app/timings.js +24 -0
- package/dist/app/timings.js.map +1 -0
- package/dist/app/wiring.js +58 -0
- package/dist/app/wiring.js.map +1 -0
- package/dist/cli/main.js +31 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/feature/agents/clients/agy/events.js +36 -0
- package/dist/feature/agents/clients/agy/events.js.map +1 -0
- package/dist/feature/agents/clients/agy/guard-commands.js +29 -0
- package/dist/feature/agents/clients/agy/guard-commands.js.map +1 -0
- package/dist/feature/agents/clients/agy/guard-paths.js +36 -0
- package/dist/feature/agents/clients/agy/guard-paths.js.map +1 -0
- package/dist/feature/agents/clients/agy/guard.js +77 -0
- package/dist/feature/agents/clients/agy/guard.js.map +1 -0
- package/dist/feature/agents/clients/agy/hooks.js +46 -0
- package/dist/feature/agents/clients/agy/hooks.js.map +1 -0
- package/dist/feature/agents/clients/agy/index.js +5 -0
- package/dist/feature/agents/clients/agy/index.js.map +1 -0
- package/dist/feature/agents/clients/agy/parser.js +63 -0
- package/dist/feature/agents/clients/agy/parser.js.map +1 -0
- package/dist/feature/agents/clients/agy/permissions.js +40 -0
- package/dist/feature/agents/clients/agy/permissions.js.map +1 -0
- package/dist/feature/agents/clients/agy/runtime.js +115 -0
- package/dist/feature/agents/clients/agy/runtime.js.map +1 -0
- package/dist/feature/agents/clients/agy/transcript.js +65 -0
- package/dist/feature/agents/clients/agy/transcript.js.map +1 -0
- package/dist/feature/agents/clients/claude/index.js +6 -0
- package/dist/feature/agents/clients/claude/index.js.map +1 -0
- package/dist/feature/agents/clients/claude/models.js +8 -0
- package/dist/feature/agents/clients/claude/models.js.map +1 -0
- package/dist/feature/agents/clients/claude/parser.js +229 -0
- package/dist/feature/agents/clients/claude/parser.js.map +1 -0
- package/dist/feature/agents/clients/claude/permissions.js +70 -0
- package/dist/feature/agents/clients/claude/permissions.js.map +1 -0
- package/dist/feature/agents/clients/claude/runtime.js +118 -0
- package/dist/feature/agents/clients/claude/runtime.js.map +1 -0
- package/dist/feature/agents/clients/claude/transcript.js +105 -0
- package/dist/feature/agents/clients/claude/transcript.js.map +1 -0
- package/dist/feature/agents/clients/naming/index.js +2 -0
- package/dist/feature/agents/clients/naming/index.js.map +1 -0
- package/dist/feature/agents/clients/naming/naming.js +15 -0
- package/dist/feature/agents/clients/naming/naming.js.map +1 -0
- package/dist/feature/agents/clients/opencode/index.js +5 -0
- package/dist/feature/agents/clients/opencode/index.js.map +1 -0
- package/dist/feature/agents/clients/opencode/models.js +38 -0
- package/dist/feature/agents/clients/opencode/models.js.map +1 -0
- package/dist/feature/agents/clients/opencode/parser.js +84 -0
- package/dist/feature/agents/clients/opencode/parser.js.map +1 -0
- package/dist/feature/agents/clients/opencode/runtime.js +131 -0
- package/dist/feature/agents/clients/opencode/runtime.js.map +1 -0
- package/dist/feature/agents/clients/opencode/transcript.js +77 -0
- package/dist/feature/agents/clients/opencode/transcript.js.map +1 -0
- package/dist/feature/agents/ports/command.js +2 -0
- package/dist/feature/agents/ports/command.js.map +1 -0
- package/dist/feature/agents/ports/index.js +2 -0
- package/dist/feature/agents/ports/index.js.map +1 -0
- package/dist/feature/agents/ports/naming.js +2 -0
- package/dist/feature/agents/ports/naming.js.map +1 -0
- package/dist/feature/agents/ports/runtime-factory.js +2 -0
- package/dist/feature/agents/ports/runtime-factory.js.map +1 -0
- package/dist/feature/agents/services/agents.js +79 -0
- package/dist/feature/agents/services/agents.js.map +1 -0
- package/dist/feature/agents/services/catalog.js +117 -0
- package/dist/feature/agents/services/catalog.js.map +1 -0
- package/dist/feature/agents/services/create.js +5 -0
- package/dist/feature/agents/services/create.js.map +1 -0
- package/dist/feature/agents/services/index.js +7 -0
- package/dist/feature/agents/services/index.js.map +1 -0
- package/dist/feature/agents/services/logs.js +69 -0
- package/dist/feature/agents/services/logs.js.map +1 -0
- package/dist/feature/agents/services/skills.js +17 -0
- package/dist/feature/agents/services/skills.js.map +1 -0
- package/dist/feature/agents/services/supervisor.js +160 -0
- package/dist/feature/agents/services/supervisor.js.map +1 -0
- package/dist/feature/agents/types/catalog.js +2 -0
- package/dist/feature/agents/types/catalog.js.map +1 -0
- package/dist/feature/agents/types/index.js +13 -0
- package/dist/feature/agents/types/index.js.map +1 -0
- package/dist/feature/agents/types/message.js +49 -0
- package/dist/feature/agents/types/message.js.map +1 -0
- package/dist/feature/agents/types/models.js +2 -0
- package/dist/feature/agents/types/models.js.map +1 -0
- package/dist/feature/agents/types/naming.js +4 -0
- package/dist/feature/agents/types/naming.js.map +1 -0
- package/dist/feature/agents/types/permissions.js +235 -0
- package/dist/feature/agents/types/permissions.js.map +1 -0
- package/dist/feature/agents/types/run-naming.js +66 -0
- package/dist/feature/agents/types/run-naming.js.map +1 -0
- package/dist/feature/agents/types/runtime.js +18 -0
- package/dist/feature/agents/types/runtime.js.map +1 -0
- package/dist/feature/agents/types/step-input.js +2 -0
- package/dist/feature/agents/types/step-input.js.map +1 -0
- package/dist/feature/agents/types/transcript-parts.js +62 -0
- package/dist/feature/agents/types/transcript-parts.js.map +1 -0
- package/dist/feature/agents/types/transcript.js +8 -0
- package/dist/feature/agents/types/transcript.js.map +1 -0
- package/dist/feature/agents/types/usage.js +14 -0
- package/dist/feature/agents/types/usage.js.map +1 -0
- package/dist/feature/agents/types/worker-tools.js +22 -0
- package/dist/feature/agents/types/worker-tools.js.map +1 -0
- package/dist/feature/artifacts/ports/index.js +2 -0
- package/dist/feature/artifacts/ports/index.js.map +1 -0
- package/dist/feature/artifacts/ports/publish.js +2 -0
- package/dist/feature/artifacts/ports/publish.js.map +1 -0
- package/dist/feature/artifacts/repositories/artifact-storage.js +84 -0
- package/dist/feature/artifacts/repositories/artifact-storage.js.map +1 -0
- package/dist/feature/artifacts/repositories/artifacts.js +85 -0
- package/dist/feature/artifacts/repositories/artifacts.js.map +1 -0
- package/dist/feature/artifacts/repositories/index.js +3 -0
- package/dist/feature/artifacts/repositories/index.js.map +1 -0
- package/dist/feature/artifacts/services/artifacts.js +105 -0
- package/dist/feature/artifacts/services/artifacts.js.map +1 -0
- package/dist/feature/artifacts/services/create.js +14 -0
- package/dist/feature/artifacts/services/create.js.map +1 -0
- package/dist/feature/artifacts/services/files.js +42 -0
- package/dist/feature/artifacts/services/files.js.map +1 -0
- package/dist/feature/artifacts/services/index.js +3 -0
- package/dist/feature/artifacts/services/index.js.map +1 -0
- package/dist/feature/artifacts/types/artifacts.js +36 -0
- package/dist/feature/artifacts/types/artifacts.js.map +1 -0
- package/dist/feature/artifacts/types/index.js +2 -0
- package/dist/feature/artifacts/types/index.js.map +1 -0
- package/dist/feature/artifacts/types/views.js +2 -0
- package/dist/feature/artifacts/types/views.js.map +1 -0
- package/dist/feature/compose/services/create.js +11 -0
- package/dist/feature/compose/services/create.js.map +1 -0
- package/dist/feature/compose/services/index.js +5 -0
- package/dist/feature/compose/services/index.js.map +1 -0
- package/dist/feature/compose/services/repository-edit.js +20 -0
- package/dist/feature/compose/services/repository-edit.js.map +1 -0
- package/dist/feature/compose/services/repository-move.js +35 -0
- package/dist/feature/compose/services/repository-move.js.map +1 -0
- package/dist/feature/compose/services/repository-removal.js +38 -0
- package/dist/feature/compose/services/repository-removal.js.map +1 -0
- package/dist/feature/delivery/ports/index.js +2 -0
- package/dist/feature/delivery/ports/index.js.map +1 -0
- package/dist/feature/delivery/ports/publish.js +2 -0
- package/dist/feature/delivery/ports/publish.js.map +1 -0
- package/dist/feature/delivery/repositories/index.js +3 -0
- package/dist/feature/delivery/repositories/index.js.map +1 -0
- package/dist/feature/delivery/repositories/patch-storage.js +76 -0
- package/dist/feature/delivery/repositories/patch-storage.js.map +1 -0
- package/dist/feature/delivery/repositories/patches.js +28 -0
- package/dist/feature/delivery/repositories/patches.js.map +1 -0
- package/dist/feature/delivery/services/create.js +21 -0
- package/dist/feature/delivery/services/create.js.map +1 -0
- package/dist/feature/delivery/services/deliver.js +67 -0
- package/dist/feature/delivery/services/deliver.js.map +1 -0
- package/dist/feature/delivery/services/diffs.js +153 -0
- package/dist/feature/delivery/services/diffs.js.map +1 -0
- package/dist/feature/delivery/services/index.js +5 -0
- package/dist/feature/delivery/services/index.js.map +1 -0
- package/dist/feature/delivery/services/patches.js +96 -0
- package/dist/feature/delivery/services/patches.js.map +1 -0
- package/dist/feature/delivery/types/index.js +3 -0
- package/dist/feature/delivery/types/index.js.map +1 -0
- package/dist/feature/delivery/types/outcomes.js +2 -0
- package/dist/feature/delivery/types/outcomes.js.map +1 -0
- package/dist/feature/delivery/types/spec-change.js +18 -0
- package/dist/feature/delivery/types/spec-change.js.map +1 -0
- package/dist/feature/network/ports/changed.js +2 -0
- package/dist/feature/network/ports/changed.js.map +1 -0
- package/dist/feature/network/ports/index.js +2 -0
- package/dist/feature/network/ports/index.js.map +1 -0
- package/dist/feature/network/services/create.js +5 -0
- package/dist/feature/network/services/create.js.map +1 -0
- package/dist/feature/network/services/index.js +3 -0
- package/dist/feature/network/services/index.js.map +1 -0
- package/dist/feature/network/services/monitor.js +140 -0
- package/dist/feature/network/services/monitor.js.map +1 -0
- package/dist/feature/network/types/index.js +4 -0
- package/dist/feature/network/types/index.js.map +1 -0
- package/dist/feature/network/types/network.js +8 -0
- package/dist/feature/network/types/network.js.map +1 -0
- package/dist/feature/network/types/proxy.js +95 -0
- package/dist/feature/network/types/proxy.js.map +1 -0
- package/dist/feature/network/types/state.js +36 -0
- package/dist/feature/network/types/state.js.map +1 -0
- package/dist/feature/observers/ports/index.js +2 -0
- package/dist/feature/observers/ports/index.js.map +1 -0
- package/dist/feature/observers/ports/publish.js +2 -0
- package/dist/feature/observers/ports/publish.js.map +1 -0
- package/dist/feature/observers/repositories/index.js +2 -0
- package/dist/feature/observers/repositories/index.js.map +1 -0
- package/dist/feature/observers/repositories/observers.js +34 -0
- package/dist/feature/observers/repositories/observers.js.map +1 -0
- package/dist/feature/observers/services/create.js +11 -0
- package/dist/feature/observers/services/create.js.map +1 -0
- package/dist/feature/observers/services/history.js +76 -0
- package/dist/feature/observers/services/history.js.map +1 -0
- package/dist/feature/observers/services/index.js +5 -0
- package/dist/feature/observers/services/index.js.map +1 -0
- package/dist/feature/observers/services/observers.js +188 -0
- package/dist/feature/observers/services/observers.js.map +1 -0
- package/dist/feature/observers/services/settings-check.js +87 -0
- package/dist/feature/observers/services/settings-check.js.map +1 -0
- package/dist/feature/observers/types/actions.js +2 -0
- package/dist/feature/observers/types/actions.js.map +1 -0
- package/dist/feature/observers/types/index.js +4 -0
- package/dist/feature/observers/types/index.js.map +1 -0
- package/dist/feature/observers/types/plan-repairs.js +116 -0
- package/dist/feature/observers/types/plan-repairs.js.map +1 -0
- package/dist/feature/observers/types/settings.js +12 -0
- package/dist/feature/observers/types/settings.js.map +1 -0
- package/dist/feature/processes/ports/index.js +2 -0
- package/dist/feature/processes/ports/index.js.map +1 -0
- package/dist/feature/processes/ports/publish.js +2 -0
- package/dist/feature/processes/ports/publish.js.map +1 -0
- package/dist/feature/processes/services/create.js +5 -0
- package/dist/feature/processes/services/create.js.map +1 -0
- package/dist/feature/processes/services/index.js +4 -0
- package/dist/feature/processes/services/index.js.map +1 -0
- package/dist/feature/processes/services/processes.js +131 -0
- package/dist/feature/processes/services/processes.js.map +1 -0
- package/dist/feature/processes/services/tree.js +98 -0
- package/dist/feature/processes/services/tree.js.map +1 -0
- package/dist/feature/processes/types/background.js +2 -0
- package/dist/feature/processes/types/background.js.map +1 -0
- package/dist/feature/processes/types/index.js +2 -0
- package/dist/feature/processes/types/index.js.map +1 -0
- package/dist/feature/queue/ports/index.js +2 -0
- package/dist/feature/queue/ports/index.js.map +1 -0
- package/dist/feature/queue/ports/observe.js +2 -0
- package/dist/feature/queue/ports/observe.js.map +1 -0
- package/dist/feature/queue/ports/publish.js +2 -0
- package/dist/feature/queue/ports/publish.js.map +1 -0
- package/dist/feature/queue/ports/repair-policy.js +2 -0
- package/dist/feature/queue/ports/repair-policy.js.map +1 -0
- package/dist/feature/queue/repositories/index.js +2 -0
- package/dist/feature/queue/repositories/index.js.map +1 -0
- package/dist/feature/queue/repositories/queues.js +100 -0
- package/dist/feature/queue/repositories/queues.js.map +1 -0
- package/dist/feature/queue/services/advance.js +214 -0
- package/dist/feature/queue/services/advance.js.map +1 -0
- package/dist/feature/queue/services/control.js +169 -0
- package/dist/feature/queue/services/control.js.map +1 -0
- package/dist/feature/queue/services/create.js +26 -0
- package/dist/feature/queue/services/create.js.map +1 -0
- package/dist/feature/queue/services/edit.js +126 -0
- package/dist/feature/queue/services/edit.js.map +1 -0
- package/dist/feature/queue/services/index.js +8 -0
- package/dist/feature/queue/services/index.js.map +1 -0
- package/dist/feature/queue/services/items.js +173 -0
- package/dist/feature/queue/services/items.js.map +1 -0
- package/dist/feature/queue/services/store.js +61 -0
- package/dist/feature/queue/services/store.js.map +1 -0
- package/dist/feature/queue/services/task-tags.js +103 -0
- package/dist/feature/queue/services/task-tags.js.map +1 -0
- package/dist/feature/queue/types/advance.js +198 -0
- package/dist/feature/queue/types/advance.js.map +1 -0
- package/dist/feature/queue/types/dependencies.js +98 -0
- package/dist/feature/queue/types/dependencies.js.map +1 -0
- package/dist/feature/queue/types/edit.js +180 -0
- package/dist/feature/queue/types/edit.js.map +1 -0
- package/dist/feature/queue/types/ids.js +7 -0
- package/dist/feature/queue/types/ids.js.map +1 -0
- package/dist/feature/queue/types/index.js +10 -0
- package/dist/feature/queue/types/index.js.map +1 -0
- package/dist/feature/queue/types/items.js +46 -0
- package/dist/feature/queue/types/items.js.map +1 -0
- package/dist/feature/queue/types/limit-hits.js +50 -0
- package/dist/feature/queue/types/limit-hits.js.map +1 -0
- package/dist/feature/queue/types/requests.js +2 -0
- package/dist/feature/queue/types/requests.js.map +1 -0
- package/dist/feature/queue/types/returns.js +197 -0
- package/dist/feature/queue/types/returns.js.map +1 -0
- package/dist/feature/queue/types/settings.js +117 -0
- package/dist/feature/queue/types/settings.js.map +1 -0
- package/dist/feature/repos/ports/index.js +2 -0
- package/dist/feature/repos/ports/index.js.map +1 -0
- package/dist/feature/repos/ports/publish.js +2 -0
- package/dist/feature/repos/ports/publish.js.map +1 -0
- package/dist/feature/repos/repositories/index.js +2 -0
- package/dist/feature/repos/repositories/index.js.map +1 -0
- package/dist/feature/repos/repositories/known.js +41 -0
- package/dist/feature/repos/repositories/known.js.map +1 -0
- package/dist/feature/repos/services/create.js +13 -0
- package/dist/feature/repos/services/create.js.map +1 -0
- package/dist/feature/repos/services/index.js +4 -0
- package/dist/feature/repos/services/index.js.map +1 -0
- package/dist/feature/repos/services/projects.js +50 -0
- package/dist/feature/repos/services/projects.js.map +1 -0
- package/dist/feature/repos/services/registry.js +138 -0
- package/dist/feature/repos/services/registry.js.map +1 -0
- package/dist/feature/repos/types/index.js +2 -0
- package/dist/feature/repos/types/index.js.map +1 -0
- package/dist/feature/repos/types/project.js +80 -0
- package/dist/feature/repos/types/project.js.map +1 -0
- package/dist/feature/repos/types/registry.js +2 -0
- package/dist/feature/repos/types/registry.js.map +1 -0
- package/dist/feature/runs/machine/answers.js +112 -0
- package/dist/feature/runs/machine/answers.js.map +1 -0
- package/dist/feature/runs/machine/delivery-checks.js +91 -0
- package/dist/feature/runs/machine/delivery-checks.js.map +1 -0
- package/dist/feature/runs/machine/delivery-flow.js +211 -0
- package/dist/feature/runs/machine/delivery-flow.js.map +1 -0
- package/dist/feature/runs/machine/events.js +2 -0
- package/dist/feature/runs/machine/events.js.map +1 -0
- package/dist/feature/runs/machine/exits.js +229 -0
- package/dist/feature/runs/machine/exits.js.map +1 -0
- package/dist/feature/runs/machine/index.js +7 -0
- package/dist/feature/runs/machine/index.js.map +1 -0
- package/dist/feature/runs/machine/plan.js +133 -0
- package/dist/feature/runs/machine/plan.js.map +1 -0
- package/dist/feature/runs/machine/repair.js +158 -0
- package/dist/feature/runs/machine/repair.js.map +1 -0
- package/dist/feature/runs/machine/run-control.js +276 -0
- package/dist/feature/runs/machine/run-control.js.map +1 -0
- package/dist/feature/runs/machine/scheduler.js +126 -0
- package/dist/feature/runs/machine/scheduler.js.map +1 -0
- package/dist/feature/runs/machine/steps.js +275 -0
- package/dist/feature/runs/machine/steps.js.map +1 -0
- package/dist/feature/runs/machine/texts.js +69 -0
- package/dist/feature/runs/machine/texts.js.map +1 -0
- package/dist/feature/runs/machine/transition.js +117 -0
- package/dist/feature/runs/machine/transition.js.map +1 -0
- package/dist/feature/runs/ports/agent-exit.js +2 -0
- package/dist/feature/runs/ports/agent-exit.js.map +1 -0
- package/dist/feature/runs/ports/diff.js +2 -0
- package/dist/feature/runs/ports/diff.js.map +1 -0
- package/dist/feature/runs/ports/index.js +2 -0
- package/dist/feature/runs/ports/index.js.map +1 -0
- package/dist/feature/runs/ports/observe.js +2 -0
- package/dist/feature/runs/ports/observe.js.map +1 -0
- package/dist/feature/runs/ports/publish.js +2 -0
- package/dist/feature/runs/ports/publish.js.map +1 -0
- package/dist/feature/runs/ports/queue-advance.js +2 -0
- package/dist/feature/runs/ports/queue-advance.js.map +1 -0
- package/dist/feature/runs/repositories/attempt-history.js +116 -0
- package/dist/feature/runs/repositories/attempt-history.js.map +1 -0
- package/dist/feature/runs/repositories/finished-runs.js +46 -0
- package/dist/feature/runs/repositories/finished-runs.js.map +1 -0
- package/dist/feature/runs/repositories/index.js +4 -0
- package/dist/feature/runs/repositories/index.js.map +1 -0
- package/dist/feature/runs/repositories/rows.js +110 -0
- package/dist/feature/runs/repositories/rows.js.map +1 -0
- package/dist/feature/runs/repositories/runs.js +76 -0
- package/dist/feature/runs/repositories/runs.js.map +1 -0
- package/dist/feature/runs/repositories/write.js +31 -0
- package/dist/feature/runs/repositories/write.js.map +1 -0
- package/dist/feature/runs/services/archive.js +17 -0
- package/dist/feature/runs/services/archive.js.map +1 -0
- package/dist/feature/runs/services/attempt-history.js +11 -0
- package/dist/feature/runs/services/attempt-history.js.map +1 -0
- package/dist/feature/runs/services/create.js +44 -0
- package/dist/feature/runs/services/create.js.map +1 -0
- package/dist/feature/runs/services/effects/actions.js +151 -0
- package/dist/feature/runs/services/effects/actions.js.map +1 -0
- package/dist/feature/runs/services/effects/attempts.js +219 -0
- package/dist/feature/runs/services/effects/attempts.js.map +1 -0
- package/dist/feature/runs/services/effects/context.js +7 -0
- package/dist/feature/runs/services/effects/context.js.map +1 -0
- package/dist/feature/runs/services/effects/effects.js +82 -0
- package/dist/feature/runs/services/effects/effects.js.map +1 -0
- package/dist/feature/runs/services/effects/git.js +168 -0
- package/dist/feature/runs/services/effects/git.js.map +1 -0
- package/dist/feature/runs/services/effects/naming.js +65 -0
- package/dist/feature/runs/services/effects/naming.js.map +1 -0
- package/dist/feature/runs/services/effects/outside.js +83 -0
- package/dist/feature/runs/services/effects/outside.js.map +1 -0
- package/dist/feature/runs/services/effects/proxy.js +5 -0
- package/dist/feature/runs/services/effects/proxy.js.map +1 -0
- package/dist/feature/runs/services/effects/running.js +76 -0
- package/dist/feature/runs/services/effects/running.js.map +1 -0
- package/dist/feature/runs/services/effects/usage.js +61 -0
- package/dist/feature/runs/services/effects/usage.js.map +1 -0
- package/dist/feature/runs/services/effects/worktrees.js +49 -0
- package/dist/feature/runs/services/effects/worktrees.js.map +1 -0
- package/dist/feature/runs/services/engine.js +172 -0
- package/dist/feature/runs/services/engine.js.map +1 -0
- package/dist/feature/runs/services/index.js +15 -0
- package/dist/feature/runs/services/index.js.map +1 -0
- package/dist/feature/runs/services/occupancy.js +62 -0
- package/dist/feature/runs/services/occupancy.js.map +1 -0
- package/dist/feature/runs/services/progress.js +42 -0
- package/dist/feature/runs/services/progress.js.map +1 -0
- package/dist/feature/runs/services/reads.js +93 -0
- package/dist/feature/runs/services/reads.js.map +1 -0
- package/dist/feature/runs/services/recovery.js +17 -0
- package/dist/feature/runs/services/recovery.js.map +1 -0
- package/dist/feature/runs/services/refresh.js +29 -0
- package/dist/feature/runs/services/refresh.js.map +1 -0
- package/dist/feature/runs/services/requests.js +88 -0
- package/dist/feature/runs/services/requests.js.map +1 -0
- package/dist/feature/runs/services/states.js +112 -0
- package/dist/feature/runs/services/states.js.map +1 -0
- package/dist/feature/runs/services/summary.js +38 -0
- package/dist/feature/runs/services/summary.js.map +1 -0
- package/dist/feature/runs/types/attempt.js +106 -0
- package/dist/feature/runs/types/attempt.js.map +1 -0
- package/dist/feature/runs/types/constants.js +45 -0
- package/dist/feature/runs/types/constants.js.map +1 -0
- package/dist/feature/runs/types/create.js +177 -0
- package/dist/feature/runs/types/create.js.map +1 -0
- package/dist/feature/runs/types/group.js +152 -0
- package/dist/feature/runs/types/group.js.map +1 -0
- package/dist/feature/runs/types/history/attempt-history.js +16 -0
- package/dist/feature/runs/types/history/attempt-history.js.map +1 -0
- package/dist/feature/runs/types/index.js +15 -0
- package/dist/feature/runs/types/index.js.map +1 -0
- package/dist/feature/runs/types/input.js +90 -0
- package/dist/feature/runs/types/input.js.map +1 -0
- package/dist/feature/runs/types/limits.js +163 -0
- package/dist/feature/runs/types/limits.js.map +1 -0
- package/dist/feature/runs/types/problems.js +74 -0
- package/dist/feature/runs/types/problems.js.map +1 -0
- package/dist/feature/runs/types/run.js +162 -0
- package/dist/feature/runs/types/run.js.map +1 -0
- package/dist/feature/runs/types/skip.js +110 -0
- package/dist/feature/runs/types/skip.js.map +1 -0
- package/dist/feature/runs/types/stage-status.js +156 -0
- package/dist/feature/runs/types/stage-status.js.map +1 -0
- package/dist/feature/runs/types/stages.js +158 -0
- package/dist/feature/runs/types/stages.js.map +1 -0
- package/dist/feature/runs/types/topology.js +165 -0
- package/dist/feature/runs/types/topology.js.map +1 -0
- package/dist/feature/stats/repositories/index.js +4 -0
- package/dist/feature/stats/repositories/index.js.map +1 -0
- package/dist/feature/stats/repositories/meta.js +19 -0
- package/dist/feature/stats/repositories/meta.js.map +1 -0
- package/dist/feature/stats/repositories/records.js +46 -0
- package/dist/feature/stats/repositories/records.js.map +1 -0
- package/dist/feature/stats/repositories/report.js +105 -0
- package/dist/feature/stats/repositories/report.js.map +1 -0
- package/dist/feature/stats/services/create.js +44 -0
- package/dist/feature/stats/services/create.js.map +1 -0
- package/dist/feature/stats/services/index.js +4 -0
- package/dist/feature/stats/services/index.js.map +1 -0
- package/dist/feature/stats/services/ledger.js +137 -0
- package/dist/feature/stats/services/ledger.js.map +1 -0
- package/dist/feature/stats/services/report.js +56 -0
- package/dist/feature/stats/services/report.js.map +1 -0
- package/dist/feature/stats/types/aggregate.js +179 -0
- package/dist/feature/stats/types/aggregate.js.map +1 -0
- package/dist/feature/stats/types/capture.js +79 -0
- package/dist/feature/stats/types/capture.js.map +1 -0
- package/dist/feature/stats/types/index.js +6 -0
- package/dist/feature/stats/types/index.js.map +1 -0
- package/dist/feature/stats/types/records.js +5 -0
- package/dist/feature/stats/types/records.js.map +1 -0
- package/dist/feature/stats/types/report.js +25 -0
- package/dist/feature/stats/types/report.js.map +1 -0
- package/dist/feature/stats/types/settings.js +2 -0
- package/dist/feature/stats/types/settings.js.map +1 -0
- package/dist/feature/swarm-config/repositories/config-files.js +141 -0
- package/dist/feature/swarm-config/repositories/config-files.js.map +1 -0
- package/dist/feature/swarm-config/services/assemble.js +212 -0
- package/dist/feature/swarm-config/services/assemble.js.map +1 -0
- package/dist/feature/swarm-config/services/create.js +5 -0
- package/dist/feature/swarm-config/services/create.js.map +1 -0
- package/dist/feature/swarm-config/services/discover.js +19 -0
- package/dist/feature/swarm-config/services/discover.js.map +1 -0
- package/dist/feature/swarm-config/services/index.js +10 -0
- package/dist/feature/swarm-config/services/index.js.map +1 -0
- package/dist/feature/swarm-config/services/load.js +101 -0
- package/dist/feature/swarm-config/services/load.js.map +1 -0
- package/dist/feature/swarm-config/services/sections/stats.js +28 -0
- package/dist/feature/swarm-config/services/sections/stats.js.map +1 -0
- package/dist/feature/swarm-config/services/settings.js +72 -0
- package/dist/feature/swarm-config/services/settings.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-actions.js +125 -0
- package/dist/feature/swarm-config/services/validate-actions.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-context.js +91 -0
- package/dist/feature/swarm-config/services/validate-context.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-pipelines.js +170 -0
- package/dist/feature/swarm-config/services/validate-pipelines.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-runtimes.js +214 -0
- package/dist/feature/swarm-config/services/validate-runtimes.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-settings.js +242 -0
- package/dist/feature/swarm-config/services/validate-settings.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-specialists.js +152 -0
- package/dist/feature/swarm-config/services/validate-specialists.js.map +1 -0
- package/dist/feature/swarm-config/services/validate.js +189 -0
- package/dist/feature/swarm-config/services/validate.js.map +1 -0
- package/dist/feature/swarm-config/types/action.js +20 -0
- package/dist/feature/swarm-config/types/action.js.map +1 -0
- package/dist/feature/swarm-config/types/chain.js +2 -0
- package/dist/feature/swarm-config/types/chain.js.map +1 -0
- package/dist/feature/swarm-config/types/duration.js +17 -0
- package/dist/feature/swarm-config/types/duration.js.map +1 -0
- package/dist/feature/swarm-config/types/errors.js +57 -0
- package/dist/feature/swarm-config/types/errors.js.map +1 -0
- package/dist/feature/swarm-config/types/index.js +13 -0
- package/dist/feature/swarm-config/types/index.js.map +1 -0
- package/dist/feature/swarm-config/types/levels.js +16 -0
- package/dist/feature/swarm-config/types/levels.js.map +1 -0
- package/dist/feature/swarm-config/types/lookups.js +53 -0
- package/dist/feature/swarm-config/types/lookups.js.map +1 -0
- package/dist/feature/swarm-config/types/merge.js +46 -0
- package/dist/feature/swarm-config/types/merge.js.map +1 -0
- package/dist/feature/swarm-config/types/pipeline.js +5 -0
- package/dist/feature/swarm-config/types/pipeline.js.map +1 -0
- package/dist/feature/swarm-config/types/prompt.js +33 -0
- package/dist/feature/swarm-config/types/prompt.js.map +1 -0
- package/dist/feature/swarm-config/types/settings.js +146 -0
- package/dist/feature/swarm-config/types/settings.js.map +1 -0
- package/dist/feature/swarm-config/types/specialist.js +38 -0
- package/dist/feature/swarm-config/types/specialist.js.map +1 -0
- package/dist/feature/swarm-config/types/tag-names.js +43 -0
- package/dist/feature/swarm-config/types/tag-names.js.map +1 -0
- package/dist/feature/swarm-edit/ports/config-changed.js +2 -0
- package/dist/feature/swarm-edit/ports/config-changed.js.map +1 -0
- package/dist/feature/swarm-edit/ports/index.js +2 -0
- package/dist/feature/swarm-edit/ports/index.js.map +1 -0
- package/dist/feature/swarm-edit/repositories/documents.js +144 -0
- package/dist/feature/swarm-edit/repositories/documents.js.map +1 -0
- package/dist/feature/swarm-edit/services/config-edits.js +129 -0
- package/dist/feature/swarm-edit/services/config-edits.js.map +1 -0
- package/dist/feature/swarm-edit/services/create.js +7 -0
- package/dist/feature/swarm-edit/services/create.js.map +1 -0
- package/dist/feature/swarm-edit/services/editor-settings.js +172 -0
- package/dist/feature/swarm-edit/services/editor-settings.js.map +1 -0
- package/dist/feature/swarm-edit/services/editor-view.js +144 -0
- package/dist/feature/swarm-edit/services/editor-view.js.map +1 -0
- package/dist/feature/swarm-edit/services/index.js +12 -0
- package/dist/feature/swarm-edit/services/index.js.map +1 -0
- package/dist/feature/swarm-edit/services/levels.js +30 -0
- package/dist/feature/swarm-edit/services/levels.js.map +1 -0
- package/dist/feature/swarm-edit/services/plan-edit.js +217 -0
- package/dist/feature/swarm-edit/services/plan-edit.js.map +1 -0
- package/dist/feature/swarm-edit/services/plan-settings.js +200 -0
- package/dist/feature/swarm-edit/services/plan-settings.js.map +1 -0
- package/dist/feature/swarm-edit/services/references.js +85 -0
- package/dist/feature/swarm-edit/services/references.js.map +1 -0
- package/dist/feature/swarm-edit/services/shared-config.js +128 -0
- package/dist/feature/swarm-edit/services/shared-config.js.map +1 -0
- package/dist/feature/swarm-edit/services/shared-pipelines.js +72 -0
- package/dist/feature/swarm-edit/services/shared-pipelines.js.map +1 -0
- package/dist/feature/swarm-edit/services/shared-specialists.js +70 -0
- package/dist/feature/swarm-edit/services/shared-specialists.js.map +1 -0
- package/dist/feature/swarm-edit/services/specialist-tags.js +215 -0
- package/dist/feature/swarm-edit/services/specialist-tags.js.map +1 -0
- package/dist/feature/swarm-edit/types/editor.js +27 -0
- package/dist/feature/swarm-edit/types/editor.js.map +1 -0
- package/dist/feature/swarm-edit/types/index.js +7 -0
- package/dist/feature/swarm-edit/types/index.js.map +1 -0
- package/dist/feature/swarm-edit/types/setting-fields.js +76 -0
- package/dist/feature/swarm-edit/types/setting-fields.js.map +1 -0
- package/dist/feature/swarm-edit/types/shared.js +2 -0
- package/dist/feature/swarm-edit/types/shared.js.map +1 -0
- package/dist/feature/swarm-edit/types/stages.js +69 -0
- package/dist/feature/swarm-edit/types/stages.js.map +1 -0
- package/dist/feature/swarm-edit/types/tag-folders.js +2 -0
- package/dist/feature/swarm-edit/types/tag-folders.js.map +1 -0
- package/dist/feature/swarm-edit/types/views.js +2 -0
- package/dist/feature/swarm-edit/types/views.js.map +1 -0
- package/dist/feature/tags/ports/index.js +2 -0
- package/dist/feature/tags/ports/index.js.map +1 -0
- package/dist/feature/tags/ports/publish.js +2 -0
- package/dist/feature/tags/ports/publish.js.map +1 -0
- package/dist/feature/tags/repositories/index.js +2 -0
- package/dist/feature/tags/repositories/index.js.map +1 -0
- package/dist/feature/tags/repositories/tags.js +36 -0
- package/dist/feature/tags/repositories/tags.js.map +1 -0
- package/dist/feature/tags/services/catalog.js +73 -0
- package/dist/feature/tags/services/catalog.js.map +1 -0
- package/dist/feature/tags/services/create.js +7 -0
- package/dist/feature/tags/services/create.js.map +1 -0
- package/dist/feature/tags/services/index.js +3 -0
- package/dist/feature/tags/services/index.js.map +1 -0
- package/dist/feature/tags/types/ids.js +7 -0
- package/dist/feature/tags/types/ids.js.map +1 -0
- package/dist/feature/tags/types/index.js +3 -0
- package/dist/feature/tags/types/index.js.map +1 -0
- package/dist/feature/tags/types/tags.js +184 -0
- package/dist/feature/tags/types/tags.js.map +1 -0
- package/dist/platform/build/fingerprint.js +36 -0
- package/dist/platform/build/fingerprint.js.map +1 -0
- package/dist/platform/build/index.js +3 -0
- package/dist/platform/build/index.js.map +1 -0
- package/dist/platform/build/locations.js +16 -0
- package/dist/platform/build/locations.js.map +1 -0
- package/dist/platform/errors/app-error.js +39 -0
- package/dist/platform/errors/app-error.js.map +1 -0
- package/dist/platform/errors/index.js +2 -0
- package/dist/platform/errors/index.js.map +1 -0
- package/dist/platform/git/delivery.js +284 -0
- package/dist/platform/git/delivery.js.map +1 -0
- package/dist/platform/git/index.js +4 -0
- package/dist/platform/git/index.js.map +1 -0
- package/dist/platform/git/runner.js +65 -0
- package/dist/platform/git/runner.js.map +1 -0
- package/dist/platform/git/workspace.js +366 -0
- package/dist/platform/git/workspace.js.map +1 -0
- package/dist/platform/network/index.js +4 -0
- package/dist/platform/network/index.js.map +1 -0
- package/dist/platform/network/interfaces.js +7 -0
- package/dist/platform/network/interfaces.js.map +1 -0
- package/dist/platform/network/probe.js +128 -0
- package/dist/platform/network/probe.js.map +1 -0
- package/dist/platform/network/tunnel.js +87 -0
- package/dist/platform/network/tunnel.js.map +1 -0
- package/dist/platform/paths/index.js +2 -0
- package/dist/platform/paths/index.js.map +1 -0
- package/dist/platform/paths/paths.js +39 -0
- package/dist/platform/paths/paths.js.map +1 -0
- package/dist/platform/process/command.js +23 -0
- package/dist/platform/process/command.js.map +1 -0
- package/dist/platform/process/index.js +4 -0
- package/dist/platform/process/index.js.map +1 -0
- package/dist/platform/process/ps.js +42 -0
- package/dist/platform/process/ps.js.map +1 -0
- package/dist/platform/process/which.js +21 -0
- package/dist/platform/process/which.js.map +1 -0
- package/dist/platform/sqlite/database.js +36 -0
- package/dist/platform/sqlite/database.js.map +1 -0
- package/dist/platform/sqlite/index.js +4 -0
- package/dist/platform/sqlite/index.js.map +1 -0
- package/dist/platform/sqlite/migrations.js +299 -0
- package/dist/platform/sqlite/migrations.js.map +1 -0
- package/dist/platform/sqlite/rows.js +13 -0
- package/dist/platform/sqlite/rows.js.map +1 -0
- package/dist/platform/sqlite/stats-migration.js +42 -0
- package/dist/platform/sqlite/stats-migration.js.map +1 -0
- package/dist/presentation/cli/commands/daemon.js +216 -0
- package/dist/presentation/cli/commands/daemon.js.map +1 -0
- package/dist/presentation/cli/commands/group.js +88 -0
- package/dist/presentation/cli/commands/group.js.map +1 -0
- package/dist/presentation/cli/commands/mcp.js +44 -0
- package/dist/presentation/cli/commands/mcp.js.map +1 -0
- package/dist/presentation/cli/commands/queue-edit.js +155 -0
- package/dist/presentation/cli/commands/queue-edit.js.map +1 -0
- package/dist/presentation/cli/commands/queue.js +222 -0
- package/dist/presentation/cli/commands/queue.js.map +1 -0
- package/dist/presentation/cli/commands/repositories.js +129 -0
- package/dist/presentation/cli/commands/repositories.js.map +1 -0
- package/dist/presentation/cli/commands/run-delivery.js +116 -0
- package/dist/presentation/cli/commands/run-delivery.js.map +1 -0
- package/dist/presentation/cli/commands/run.js +156 -0
- package/dist/presentation/cli/commands/run.js.map +1 -0
- package/dist/presentation/cli/commands/setup.js +97 -0
- package/dist/presentation/cli/commands/setup.js.map +1 -0
- package/dist/presentation/cli/commands/stats.js +41 -0
- package/dist/presentation/cli/commands/stats.js.map +1 -0
- package/dist/presentation/cli/commands/tag.js +92 -0
- package/dist/presentation/cli/commands/tag.js.map +1 -0
- package/dist/presentation/cli/commands/web.js +100 -0
- package/dist/presentation/cli/commands/web.js.map +1 -0
- package/dist/presentation/cli/context.js +49 -0
- package/dist/presentation/cli/context.js.map +1 -0
- package/dist/presentation/cli/help.js +49 -0
- package/dist/presentation/cli/help.js.map +1 -0
- package/dist/presentation/cli/io.js +13 -0
- package/dist/presentation/cli/io.js.map +1 -0
- package/dist/presentation/cli/local/clean.js +72 -0
- package/dist/presentation/cli/local/clean.js.map +1 -0
- package/dist/presentation/cli/local/config-check.js +225 -0
- package/dist/presentation/cli/local/config-check.js.map +1 -0
- package/dist/presentation/cli/local/init.js +44 -0
- package/dist/presentation/cli/local/init.js.map +1 -0
- package/dist/presentation/cli/options.js +34 -0
- package/dist/presentation/cli/options.js.map +1 -0
- package/dist/presentation/cli/probe.js +12 -0
- package/dist/presentation/cli/probe.js.map +1 -0
- package/dist/presentation/cli/program.js +78 -0
- package/dist/presentation/cli/program.js.map +1 -0
- package/dist/presentation/cli/setup/actions.js +206 -0
- package/dist/presentation/cli/setup/actions.js.map +1 -0
- package/dist/presentation/cli/setup/command.js +80 -0
- package/dist/presentation/cli/setup/command.js.map +1 -0
- package/dist/presentation/cli/setup/host.js +20 -0
- package/dist/presentation/cli/setup/host.js.map +1 -0
- package/dist/presentation/cli/setup/index.js +5 -0
- package/dist/presentation/cli/setup/index.js.map +1 -0
- package/dist/presentation/cli/setup/run.js +63 -0
- package/dist/presentation/cli/setup/run.js.map +1 -0
- package/dist/presentation/cli/setup/system.js +53 -0
- package/dist/presentation/cli/setup/system.js.map +1 -0
- package/dist/presentation/cli/setup/types.js +3 -0
- package/dist/presentation/cli/setup/types.js.map +1 -0
- package/dist/presentation/cli/watch.js +24 -0
- package/dist/presentation/cli/watch.js.map +1 -0
- package/dist/presentation/cli/web-control.js +172 -0
- package/dist/presentation/cli/web-control.js.map +1 -0
- package/dist/presentation/format/groups.js +99 -0
- package/dist/presentation/format/groups.js.map +1 -0
- package/dist/presentation/format/index.js +8 -0
- package/dist/presentation/format/index.js.map +1 -0
- package/dist/presentation/format/queue.js +109 -0
- package/dist/presentation/format/queue.js.map +1 -0
- package/dist/presentation/format/runs.js +209 -0
- package/dist/presentation/format/runs.js.map +1 -0
- package/dist/presentation/format/stats.js +79 -0
- package/dist/presentation/format/stats.js.map +1 -0
- package/dist/presentation/format/style.js +81 -0
- package/dist/presentation/format/style.js.map +1 -0
- package/dist/presentation/format/table.js +62 -0
- package/dist/presentation/format/table.js.map +1 -0
- package/dist/presentation/format/tags.js +26 -0
- package/dist/presentation/format/tags.js.map +1 -0
- package/dist/presentation/ipc/client/autostart.js +171 -0
- package/dist/presentation/ipc/client/autostart.js.map +1 -0
- package/dist/presentation/ipc/client/client.js +83 -0
- package/dist/presentation/ipc/client/client.js.map +1 -0
- package/dist/presentation/ipc/client/index.js +4 -0
- package/dist/presentation/ipc/client/index.js.map +1 -0
- package/dist/presentation/ipc/client/repository-argument.js +13 -0
- package/dist/presentation/ipc/client/repository-argument.js.map +1 -0
- package/dist/presentation/ipc/contract/agents.js +97 -0
- package/dist/presentation/ipc/contract/agents.js.map +1 -0
- package/dist/presentation/ipc/contract/artifacts.js +27 -0
- package/dist/presentation/ipc/contract/artifacts.js.map +1 -0
- package/dist/presentation/ipc/contract/config.js +145 -0
- package/dist/presentation/ipc/contract/config.js.map +1 -0
- package/dist/presentation/ipc/contract/envelope.js +100 -0
- package/dist/presentation/ipc/contract/envelope.js.map +1 -0
- package/dist/presentation/ipc/contract/groups.js +57 -0
- package/dist/presentation/ipc/contract/groups.js.map +1 -0
- package/dist/presentation/ipc/contract/index.js +15 -0
- package/dist/presentation/ipc/contract/index.js.map +1 -0
- package/dist/presentation/ipc/contract/observers/history.js +26 -0
- package/dist/presentation/ipc/contract/observers/history.js.map +1 -0
- package/dist/presentation/ipc/contract/observers.js +16 -0
- package/dist/presentation/ipc/contract/observers.js.map +1 -0
- package/dist/presentation/ipc/contract/panel.js +64 -0
- package/dist/presentation/ipc/contract/panel.js.map +1 -0
- package/dist/presentation/ipc/contract/processes.js +9 -0
- package/dist/presentation/ipc/contract/processes.js.map +1 -0
- package/dist/presentation/ipc/contract/queue.js +115 -0
- package/dist/presentation/ipc/contract/queue.js.map +1 -0
- package/dist/presentation/ipc/contract/repositories.js +33 -0
- package/dist/presentation/ipc/contract/repositories.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/artifacts.js +2 -0
- package/dist/presentation/ipc/contract/responses/artifacts.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/config.js +2 -0
- package/dist/presentation/ipc/contract/responses/config.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/groups.js +2 -0
- package/dist/presentation/ipc/contract/responses/groups.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/index.js +12 -0
- package/dist/presentation/ipc/contract/responses/index.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/observer-history.js +2 -0
- package/dist/presentation/ipc/contract/responses/observer-history.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/observers.js +2 -0
- package/dist/presentation/ipc/contract/responses/observers.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/processes.js +2 -0
- package/dist/presentation/ipc/contract/responses/processes.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/queue.js +2 -0
- package/dist/presentation/ipc/contract/responses/queue.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/repositories.js +2 -0
- package/dist/presentation/ipc/contract/responses/repositories.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/runs.js +2 -0
- package/dist/presentation/ipc/contract/responses/runs.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/stats.js +67 -0
- package/dist/presentation/ipc/contract/responses/stats.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/tags.js +2 -0
- package/dist/presentation/ipc/contract/responses/tags.js.map +1 -0
- package/dist/presentation/ipc/contract/runs.js +118 -0
- package/dist/presentation/ipc/contract/runs.js.map +1 -0
- package/dist/presentation/ipc/contract/stats/stats.js +20 -0
- package/dist/presentation/ipc/contract/stats/stats.js.map +1 -0
- package/dist/presentation/ipc/contract/tags.js +40 -0
- package/dist/presentation/ipc/contract/tags.js.map +1 -0
- package/dist/presentation/ipc/handlers/config.js +39 -0
- package/dist/presentation/ipc/handlers/config.js.map +1 -0
- package/dist/presentation/ipc/handlers/groups.js +22 -0
- package/dist/presentation/ipc/handlers/groups.js.map +1 -0
- package/dist/presentation/ipc/handlers/index.js +2 -0
- package/dist/presentation/ipc/handlers/index.js.map +1 -0
- package/dist/presentation/ipc/handlers/observers.js +14 -0
- package/dist/presentation/ipc/handlers/observers.js.map +1 -0
- package/dist/presentation/ipc/handlers/queue.js +36 -0
- package/dist/presentation/ipc/handlers/queue.js.map +1 -0
- package/dist/presentation/ipc/handlers/repositories.js +26 -0
- package/dist/presentation/ipc/handlers/repositories.js.map +1 -0
- package/dist/presentation/ipc/handlers/runs.js +55 -0
- package/dist/presentation/ipc/handlers/runs.js.map +1 -0
- package/dist/presentation/ipc/handlers/stats.js +17 -0
- package/dist/presentation/ipc/handlers/stats.js.map +1 -0
- package/dist/presentation/ipc/handlers/system.js +40 -0
- package/dist/presentation/ipc/handlers/system.js.map +1 -0
- package/dist/presentation/ipc/handlers/table.js +25 -0
- package/dist/presentation/ipc/handlers/table.js.map +1 -0
- package/dist/presentation/ipc/handlers/types.js +2 -0
- package/dist/presentation/ipc/handlers/types.js.map +1 -0
- package/dist/presentation/ipc/publisher.js +176 -0
- package/dist/presentation/ipc/publisher.js.map +1 -0
- package/dist/presentation/ipc/server.js +164 -0
- package/dist/presentation/ipc/server.js.map +1 -0
- package/dist/presentation/ipc/services.js +2 -0
- package/dist/presentation/ipc/services.js.map +1 -0
- package/dist/presentation/ipc/snapshots.js +60 -0
- package/dist/presentation/ipc/snapshots.js.map +1 -0
- package/dist/presentation/ipc/views/catalog.js +9 -0
- package/dist/presentation/ipc/views/catalog.js.map +1 -0
- package/dist/presentation/ipc/views/groups.js +112 -0
- package/dist/presentation/ipc/views/groups.js.map +1 -0
- package/dist/presentation/ipc/views/index.js +11 -0
- package/dist/presentation/ipc/views/index.js.map +1 -0
- package/dist/presentation/ipc/views/observer-history.js +26 -0
- package/dist/presentation/ipc/views/observer-history.js.map +1 -0
- package/dist/presentation/ipc/views/observers.js +16 -0
- package/dist/presentation/ipc/views/observers.js.map +1 -0
- package/dist/presentation/ipc/views/queue.js +155 -0
- package/dist/presentation/ipc/views/queue.js.map +1 -0
- package/dist/presentation/ipc/views/repositories.js +34 -0
- package/dist/presentation/ipc/views/repositories.js.map +1 -0
- package/dist/presentation/ipc/views/rows.js +117 -0
- package/dist/presentation/ipc/views/rows.js.map +1 -0
- package/dist/presentation/ipc/views/run-stages.js +66 -0
- package/dist/presentation/ipc/views/run-stages.js.map +1 -0
- package/dist/presentation/ipc/views/runs.js +201 -0
- package/dist/presentation/ipc/views/runs.js.map +1 -0
- package/dist/presentation/ipc/views/stats.js +5 -0
- package/dist/presentation/ipc/views/stats.js.map +1 -0
- package/dist/presentation/ipc/views/tags.js +19 -0
- package/dist/presentation/ipc/views/tags.js.map +1 -0
- package/dist/presentation/mcp/host-kit.js +67 -0
- package/dist/presentation/mcp/host-kit.js.map +1 -0
- package/dist/presentation/mcp/host-queue-control.js +135 -0
- package/dist/presentation/mcp/host-queue-control.js.map +1 -0
- package/dist/presentation/mcp/host-queue.js +124 -0
- package/dist/presentation/mcp/host-queue.js.map +1 -0
- package/dist/presentation/mcp/host-runs.js +173 -0
- package/dist/presentation/mcp/host-runs.js.map +1 -0
- package/dist/presentation/mcp/host.js +34 -0
- package/dist/presentation/mcp/host.js.map +1 -0
- package/dist/presentation/mcp/index.js +3 -0
- package/dist/presentation/mcp/index.js.map +1 -0
- package/dist/presentation/mcp/tools.js +19 -0
- package/dist/presentation/mcp/tools.js.map +1 -0
- package/dist/presentation/mcp/worker-extra.js +144 -0
- package/dist/presentation/mcp/worker-extra.js.map +1 -0
- package/dist/presentation/mcp/worker-read.js +45 -0
- package/dist/presentation/mcp/worker-read.js.map +1 -0
- package/dist/presentation/mcp/worker-tools.js +107 -0
- package/dist/presentation/mcp/worker-tools.js.map +1 -0
- package/dist/presentation/mcp/worker.js +14 -0
- package/dist/presentation/mcp/worker.js.map +1 -0
- package/dist/presentation/web/errors.js +60 -0
- package/dist/presentation/web/errors.js.map +1 -0
- package/dist/presentation/web/http.js +130 -0
- package/dist/presentation/web/http.js.map +1 -0
- package/dist/presentation/web/hub.js +168 -0
- package/dist/presentation/web/hub.js.map +1 -0
- package/dist/presentation/web/index.js +7 -0
- package/dist/presentation/web/index.js.map +1 -0
- package/dist/presentation/web/options.js +7 -0
- package/dist/presentation/web/options.js.map +1 -0
- package/dist/presentation/web/pages.js +44 -0
- package/dist/presentation/web/pages.js.map +1 -0
- package/dist/presentation/web/panel/daemon-panel.js +207 -0
- package/dist/presentation/web/panel/daemon-panel.js.map +1 -0
- package/dist/presentation/web/panel/default-repository.js +14 -0
- package/dist/presentation/web/panel/default-repository.js.map +1 -0
- package/dist/presentation/web/panel/directories.js +48 -0
- package/dist/presentation/web/panel/directories.js.map +1 -0
- package/dist/presentation/web/panel/open.js +12 -0
- package/dist/presentation/web/panel/open.js.map +1 -0
- package/dist/presentation/web/panel/standby.js +119 -0
- package/dist/presentation/web/panel/standby.js.map +1 -0
- package/dist/presentation/web/panel/state.js +69 -0
- package/dist/presentation/web/panel/state.js.map +1 -0
- package/dist/presentation/web/panel/system.js +67 -0
- package/dist/presentation/web/panel/system.js.map +1 -0
- package/dist/presentation/web/request.js +150 -0
- package/dist/presentation/web/request.js.map +1 -0
- package/dist/presentation/web/routes/config.js +171 -0
- package/dist/presentation/web/routes/config.js.map +1 -0
- package/dist/presentation/web/routes/downloads.js +65 -0
- package/dist/presentation/web/routes/downloads.js.map +1 -0
- package/dist/presentation/web/routes/groups.js +85 -0
- package/dist/presentation/web/routes/groups.js.map +1 -0
- package/dist/presentation/web/routes/observers/history.js +19 -0
- package/dist/presentation/web/routes/observers/history.js.map +1 -0
- package/dist/presentation/web/routes/processes.js +21 -0
- package/dist/presentation/web/routes/processes.js.map +1 -0
- package/dist/presentation/web/routes/queue.js +80 -0
- package/dist/presentation/web/routes/queue.js.map +1 -0
- package/dist/presentation/web/routes/repositories.js +66 -0
- package/dist/presentation/web/routes/repositories.js.map +1 -0
- package/dist/presentation/web/routes/runs.js +76 -0
- package/dist/presentation/web/routes/runs.js.map +1 -0
- package/dist/presentation/web/routes/settings.js +74 -0
- package/dist/presentation/web/routes/settings.js.map +1 -0
- package/dist/presentation/web/routes/specialists.js +74 -0
- package/dist/presentation/web/routes/specialists.js.map +1 -0
- package/dist/presentation/web/routes/stats/stats.js +22 -0
- package/dist/presentation/web/routes/stats/stats.js.map +1 -0
- package/dist/presentation/web/routes/system.js +96 -0
- package/dist/presentation/web/routes/system.js.map +1 -0
- package/dist/presentation/web/routes/tags.js +46 -0
- package/dist/presentation/web/routes/tags.js.map +1 -0
- package/dist/presentation/web/routes/types.js +2 -0
- package/dist/presentation/web/routes/types.js.map +1 -0
- package/dist/presentation/web/server.js +187 -0
- package/dist/presentation/web/server.js.map +1 -0
- package/dist/web/assets/FilterColumn-BCMp-JO4.js +1 -0
- package/dist/web/assets/SharedPipelinesGroup-DJRGFtzx.js +1 -0
- package/dist/web/assets/badge-C_7kALlW.js +1 -0
- package/dist/web/assets/card-C9eXOVuF.js +1 -0
- package/dist/web/assets/deliveryModes-funlvXVC.js +1 -0
- package/dist/web/assets/empty-ACC2KkXk.js +41 -0
- package/dist/web/assets/index-CsVQUXJH.js +21 -0
- package/dist/web/assets/index-Ds1nt_qm.css +2 -0
- package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/web/assets/locales-fB1w2oER.js +1 -0
- package/dist/web/assets/pipelines-DLioOiRN.css +1 -0
- package/dist/web/assets/pipelines-DQglwIkL.js +10 -0
- package/dist/web/assets/queue-CAuAo--6.js +16 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/select-BSqaxwh1.js +1 -0
- package/dist/web/assets/settingFields-DVg9TQK2.js +1 -0
- package/dist/web/assets/settings-6eHKYbS7.js +2 -0
- package/dist/web/assets/skeleton-CfLYGtNX.js +1 -0
- package/dist/web/assets/specialists-Durm0DgK.js +1 -0
- package/dist/web/assets/stats-67akPa3A.js +1 -0
- package/dist/web/assets/topology-DQu3su19.js +1 -0
- package/dist/web/assets/trash-ChYI9ms1.js +1 -0
- package/dist/web/assets/useListDrag-0GPS1X83.js +1 -0
- package/dist/web/assets/vendor-markdown-DwXfjc7L.js +32 -0
- package/dist/web/assets/vendor-react-C1iE8mnY.js +9 -0
- package/dist/web/index.html +22 -0
- package/integrations/claude-code/.claude-plugin/plugin.json +19 -0
- package/integrations/claude-code/commands/apply.md +6 -0
- package/integrations/claude-code/commands/panel.md +6 -0
- package/integrations/claude-code/commands/run.md +6 -0
- package/integrations/claude-code/commands/status.md +6 -0
- package/integrations/claude-code/commands/web.md +6 -0
- package/integrations/claude-code/hooks/aip.ts +365 -0
- package/integrations/claude-code/hooks/feed.ts +923 -0
- package/integrations/claude-code/hooks/hooks.json +1 -0
- package/integrations/claude-code/hooks/pane.ts +396 -0
- package/integrations/claude-code/hooks/register.tsx +156 -0
- package/integrations/claude-code/hooks/theme.ts +59 -0
- package/integrations/claude-code/hooks/transcript.tsx +44 -0
- package/integrations/claude-code/hooks/view.tsx +378 -0
- package/integrations/claude-code/hooks/web.ts +162 -0
- package/integrations/claude-code/tsconfig.json +18 -0
- package/integrations/claude-code/types/index.d.ts +89 -0
- package/package.json +70 -4
- package/templates/aip/pipelines/feature.yaml +4 -0
- package/templates/aip/settings.yaml +10 -0
- package/templates/aip/specialists/coder.yaml +4 -0
- package/templates/aip/specialists/reviewer.yaml +5 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { DELIVERY_MODES } from '../../../feature/swarm-config/types/index.js';
|
|
2
|
+
import { filterByTags, formatRun, formatRunList, formatRunQueued, formatTagLabels, } from '../../format/index.js';
|
|
3
|
+
import { repositoryArgument } from '../../ipc/client/index.js';
|
|
4
|
+
import { bind, call } from '../context.js';
|
|
5
|
+
import { usage } from '../io.js';
|
|
6
|
+
import { collect, parseDeliveryMode, readGroups } from '../options.js';
|
|
7
|
+
import { watch } from '../watch.js';
|
|
8
|
+
import { addApply, addClean, addMarkDelivered, addPause, addSkip } from './run-delivery.js';
|
|
9
|
+
function runKit(program, io, style) {
|
|
10
|
+
const { print, output, examples, context, activeStyle } = bind(io, style);
|
|
11
|
+
const run = program
|
|
12
|
+
.command('run')
|
|
13
|
+
.description('Start, follow, deliver and clean up runs of a pipeline');
|
|
14
|
+
const showTags = (view, json) => {
|
|
15
|
+
const labels = formatTagLabels(view.tags, activeStyle);
|
|
16
|
+
output(json, `Tags of run ${view.id}: ${labels || 'none'}`, view);
|
|
17
|
+
};
|
|
18
|
+
return { print, output, examples, context, activeStyle, io, run, showTags };
|
|
19
|
+
}
|
|
20
|
+
/** The fields of the `run` request the flags of `aip run start` set. */
|
|
21
|
+
function startParams(pipeline, options) {
|
|
22
|
+
if ((options.task === undefined) === (options.groups === undefined)) {
|
|
23
|
+
throw usage('pass exactly one of --task and --groups');
|
|
24
|
+
}
|
|
25
|
+
const groups = options.groups ? readGroups(options.groups) : undefined;
|
|
26
|
+
const deliveryMode = parseDeliveryMode(options.deliveryMode);
|
|
27
|
+
return {
|
|
28
|
+
repository: repositoryArgument(options.repo),
|
|
29
|
+
pipeline,
|
|
30
|
+
...(options.task !== undefined ? { task: options.task } : {}),
|
|
31
|
+
...(groups ? { groups } : {}),
|
|
32
|
+
...(options.title !== undefined ? { title: options.title } : {}),
|
|
33
|
+
...(options.autoDeliver !== undefined ? { autoDeliver: options.autoDeliver } : {}),
|
|
34
|
+
...(deliveryMode !== undefined ? { deliveryMode } : {}),
|
|
35
|
+
...(options.tag !== undefined ? { tags: options.tag } : {}),
|
|
36
|
+
...(options.parent !== undefined ? { parent: options.parent } : {}),
|
|
37
|
+
...(options.skip !== undefined ? { skip: options.skip } : {}),
|
|
38
|
+
...(options.after !== undefined ? { after: options.after } : {}),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function addStart(kit) {
|
|
42
|
+
const { print, output, examples, context, activeStyle, run } = kit;
|
|
43
|
+
run
|
|
44
|
+
.command('start')
|
|
45
|
+
.description('Queue a pipeline task of the aip/ configuration: it goes to the end of the repository queue, a stopped queue is started')
|
|
46
|
+
.argument('<pipeline>', 'pipeline id from the aip/ configuration')
|
|
47
|
+
.option('-t, --task <text>', 'one task; the pipeline may split it into groups')
|
|
48
|
+
.option('-g, --groups <file>', 'YAML or JSON file with a list of { title, task }')
|
|
49
|
+
.option('-r, --repo <path>', 'repository path or project slug', '.')
|
|
50
|
+
.option('--title <text>', 'title of the run (at most 60 characters); otherwise a model names it')
|
|
51
|
+
.option('--auto-deliver', 'deliver the merged groups automatically, whatever delivery.auto says')
|
|
52
|
+
.option('--no-auto-deliver', 'leave the merged groups for `aip apply`')
|
|
53
|
+
.option('--delivery-mode <mode>', `how the merged result is delivered: ${DELIVERY_MODES.join(', ')}; whatever delivery.mode says`)
|
|
54
|
+
.option('--tag <name>', 'tag of the task; repeat for several', collect)
|
|
55
|
+
.option('--parent <run>', 'run id or task number (161 or #161) whose linked task tag the task gets')
|
|
56
|
+
.option('--skip <step>', 'step of the pipeline to skip; repeat for several', collect)
|
|
57
|
+
.option('--after <id>', 'queue item or run that must be done first; repeat for several', collect)
|
|
58
|
+
.option('--json', 'print JSON')
|
|
59
|
+
.addHelpText('after', examples([
|
|
60
|
+
'aip run start feature --no-auto-deliver --task "Add a login form"',
|
|
61
|
+
'aip run start feature --task "Add a login form"',
|
|
62
|
+
'aip run start feature --title "Login form" --task "Add a login form with OAuth"',
|
|
63
|
+
'aip run start feature --groups groups.yaml --repo ~/projects/app',
|
|
64
|
+
'aip run start feature --task "Add the API" --after q1',
|
|
65
|
+
'aip run start feature --task "Follow-up" --parent 115',
|
|
66
|
+
]))
|
|
67
|
+
.action(async (pipeline, options) => {
|
|
68
|
+
const queued = (await call(context(), 'run', startParams(pipeline, options)));
|
|
69
|
+
output(options.json, formatRunQueued(queued, activeStyle), queued);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function addList(kit) {
|
|
73
|
+
const { print, output, examples, context, activeStyle, run } = kit;
|
|
74
|
+
run
|
|
75
|
+
.command('list')
|
|
76
|
+
.description('Show active and recent runs')
|
|
77
|
+
.option('--tag <name>', 'only runs with this tag; repeat for any of several', collect)
|
|
78
|
+
.option('--json', 'print JSON')
|
|
79
|
+
.addHelpText('after', examples(['aip run list', 'aip run list --json', 'aip run list --tag auth --tag v2']))
|
|
80
|
+
.action(async (options) => {
|
|
81
|
+
const all = (await call(context(), 'status', {}));
|
|
82
|
+
const runs = options.tag === undefined ? all : filterByTags(all, options.tag);
|
|
83
|
+
const empty = options.tag !== undefined && runs.length === 0;
|
|
84
|
+
output(options.json, empty ? 'No runs with these tags.' : formatRunList(runs, activeStyle), runs);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function addTag(kit) {
|
|
88
|
+
const { print, examples, context, run, showTags } = kit;
|
|
89
|
+
run
|
|
90
|
+
.command('tag')
|
|
91
|
+
.description('Add tags to a run in any state (create a tag with `aip tag add`)')
|
|
92
|
+
.argument('<run-id>', 'run id')
|
|
93
|
+
.argument('<name...>', 'tag names')
|
|
94
|
+
.option('--json', 'print JSON')
|
|
95
|
+
.addHelpText('after', examples(['aip run tag 0mh3k2ab1x9z auth v2']))
|
|
96
|
+
.action(async (runId, names, options) => {
|
|
97
|
+
showTags((await call(context(), 'run_tags', { runId, add: names })), options.json);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function addUntag(kit) {
|
|
101
|
+
const { print, examples, context, run, showTags } = kit;
|
|
102
|
+
run
|
|
103
|
+
.command('untag')
|
|
104
|
+
.description('Remove tags from a run in any state')
|
|
105
|
+
.argument('<run-id>', 'run id')
|
|
106
|
+
.argument('<name...>', 'tag names')
|
|
107
|
+
.option('--json', 'print JSON')
|
|
108
|
+
.addHelpText('after', examples(['aip run untag 0mh3k2ab1x9z v2']))
|
|
109
|
+
.action(async (runId, names, options) => {
|
|
110
|
+
showTags((await call(context(), 'run_tags', { runId, remove: names })), options.json);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function addShow(kit) {
|
|
114
|
+
const { print, output, examples, context, activeStyle, run } = kit;
|
|
115
|
+
run
|
|
116
|
+
.command('show')
|
|
117
|
+
.description('Show the groups of one run')
|
|
118
|
+
.argument('<run-id>', 'run id')
|
|
119
|
+
.option('--json', 'print JSON')
|
|
120
|
+
.addHelpText('after', examples(['aip run show 0mh3k2ab1x9z']))
|
|
121
|
+
.action(async (runId, options) => {
|
|
122
|
+
const view = (await call(context(), 'status', { runId }));
|
|
123
|
+
output(options.json, formatRun(view, Date.now(), activeStyle), view);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function addWatch(kit) {
|
|
127
|
+
const { examples, context, io, run } = kit;
|
|
128
|
+
run
|
|
129
|
+
.command('watch')
|
|
130
|
+
.description('Follow a run until it finishes')
|
|
131
|
+
.argument('[run-id]', 'run id; defaults to the latest active run')
|
|
132
|
+
.addHelpText('after', examples(['aip run watch', 'aip run watch 0mh3k2ab1x9z']))
|
|
133
|
+
.action(async (runId) => {
|
|
134
|
+
await watch(context(), runId, io.watchIntervalMs);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function addCancel(kit) {
|
|
138
|
+
const { print, examples, context, activeStyle, run } = kit;
|
|
139
|
+
run
|
|
140
|
+
.command('cancel')
|
|
141
|
+
.description('Cancel a whole run')
|
|
142
|
+
.argument('<run-id>', 'run id')
|
|
143
|
+
.addHelpText('after', examples(['aip run cancel 0mh3k2ab1x9z']))
|
|
144
|
+
.action(async (runId) => {
|
|
145
|
+
const view = (await call(context(), 'cancel', { runId }));
|
|
146
|
+
print(formatRun(view, Date.now(), activeStyle));
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
export function registerRun(program, io, style) {
|
|
150
|
+
const kit = runKit(program, io, style);
|
|
151
|
+
for (const add of [addStart, addList, addTag, addUntag, addShow, addWatch, addCancel])
|
|
152
|
+
add(kit);
|
|
153
|
+
for (const add of [addPause, addApply, addMarkDelivered, addSkip, addClean])
|
|
154
|
+
add(kit);
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../src/presentation/cli/commands/run.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EACL,YAAY,EACZ,SAAS,EACT,aAAa,EACb,eAAe,EACf,eAAe,GAEhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAc,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5F,SAAS,MAAM,CAAC,OAAgB,EAAE,EAAS,EAAE,KAAY;IACvD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1E,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,KAAK,CAAC;SACd,WAA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AA6B,CAAC,CAAC,CAAC;SAC/D,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAY,CAAC;QACrE,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAgB,EAAE,EAAS,EAAE,KAAY;IACnE,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvC,KAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC;QAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAChG,KAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,CAAC;QAAE,GAAG,CAAC,GAAG,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { relative, resolve } from 'node:path';
|
|
2
|
+
import { packageVersion } from '../../../platform/build/index.js';
|
|
3
|
+
import { bind, call } from '../context.js';
|
|
4
|
+
import { failLine } from '../io.js';
|
|
5
|
+
function addSetup(program, io, style) {
|
|
6
|
+
const { print, examples, activeStyle } = bind(io, style);
|
|
7
|
+
program
|
|
8
|
+
.command('setup')
|
|
9
|
+
.description('Connect aip to Claude Code and OpenCode on this machine')
|
|
10
|
+
.option('-y, --yes', 'do not ask questions')
|
|
11
|
+
.option('--dry-run', 'print what would be done and change nothing')
|
|
12
|
+
.option('--force', 'replace an existing aip setting that differs')
|
|
13
|
+
.option('--no-claude', 'skip Claude Code')
|
|
14
|
+
.option('--no-opencode', 'skip OpenCode')
|
|
15
|
+
.option('--no-plugin', 'do not install the Claude Code plugin')
|
|
16
|
+
.addHelpText('after', examples(['aip setup', 'aip setup --dry-run', 'aip setup --yes --no-opencode']))
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
const { setupCommand, systemDeps } = await import('../setup/index.js');
|
|
19
|
+
io.setExitCode(await setupCommand({
|
|
20
|
+
yes: options.yes ?? false,
|
|
21
|
+
dryRun: options.dryRun ?? false,
|
|
22
|
+
force: options.force ?? false,
|
|
23
|
+
claude: options.claude,
|
|
24
|
+
opencode: options.opencode,
|
|
25
|
+
plugin: options.plugin,
|
|
26
|
+
}, activeStyle, systemDeps(io.env), print, io.ask));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function addInit(program, io, style) {
|
|
30
|
+
const { print, examples, context, activeStyle } = bind(io, style);
|
|
31
|
+
program
|
|
32
|
+
.command('init')
|
|
33
|
+
.description('Create a starter aip/ configuration in the current repository')
|
|
34
|
+
.option('--shared', 'write to the shared configuration (~/.config/aip) instead')
|
|
35
|
+
.addHelpText('after', examples(['aip init', 'aip init --shared']))
|
|
36
|
+
.action(async (options) => {
|
|
37
|
+
try {
|
|
38
|
+
const { initConfig } = await import('../local/init.js');
|
|
39
|
+
const result = await initConfig({
|
|
40
|
+
cwd: io.cwd,
|
|
41
|
+
shared: options.shared ?? false,
|
|
42
|
+
env: io.env,
|
|
43
|
+
});
|
|
44
|
+
const show = (file) => relative(io.cwd, file) || file;
|
|
45
|
+
if (result.repository !== null) {
|
|
46
|
+
// The web panel lists the daemon's registry only, so the initialized repository joins it.
|
|
47
|
+
try {
|
|
48
|
+
await call(context(), 'repository_add', { path: result.repository });
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
io.stderr(`aip: warning: could not add the repository to the list: ${error.message}\n`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
for (const file of result.created)
|
|
55
|
+
print(`${activeStyle.success('created')} ${show(file)}`);
|
|
56
|
+
for (const file of result.kept)
|
|
57
|
+
print(`${activeStyle.muted('kept ')} ${show(file)} (already exists)`);
|
|
58
|
+
print(`\nNext: ${activeStyle.command('aip config check')}, then ${activeStyle.command('aip run start feature --task "Describe the task"')}`);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
failLine(io, 'aip init', error.message);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function addConfig(program, io, style) {
|
|
66
|
+
const { examples } = bind(io, style);
|
|
67
|
+
const config = program.command('config').description('Inspect the aip/ configuration');
|
|
68
|
+
config
|
|
69
|
+
.command('check')
|
|
70
|
+
.description('Validate the aip/ configuration and print the merged configuration and agent CLI versions')
|
|
71
|
+
.option('-r, --repo <path>', 'repository path', '.')
|
|
72
|
+
.addHelpText('after', examples(['aip config check', 'aip config check --repo ~/projects/app']))
|
|
73
|
+
.action(async (options) => {
|
|
74
|
+
const { checkConfig } = await import('../local/config-check.js');
|
|
75
|
+
io.setExitCode(await checkConfig(resolve(io.cwd, options.repo), io));
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function addVersion(program, io, style) {
|
|
79
|
+
const { print, examples } = bind(io, style);
|
|
80
|
+
program
|
|
81
|
+
.command('version')
|
|
82
|
+
.description('Print the aip version (same as --version)')
|
|
83
|
+
.option('--json', 'print JSON on one line')
|
|
84
|
+
.addHelpText('after', examples(['aip version', 'aip version --json']))
|
|
85
|
+
.action((options) => {
|
|
86
|
+
const version = packageVersion();
|
|
87
|
+
print(options.json ? JSON.stringify({ version }) : version);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/** `setup`, `init`, `config` and `version`: the commands that need no daemon for their own work. */
|
|
91
|
+
export function registerSetup(program, io, style) {
|
|
92
|
+
addSetup(program, io, style);
|
|
93
|
+
addInit(program, io, style);
|
|
94
|
+
addConfig(program, io, style);
|
|
95
|
+
addVersion(program, io, style);
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../../src/presentation/cli/commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAI9C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAc,MAAM,UAAU,CAAC;AAEhD,SAAS,QAAQ,CAAC,OAAgB,EAAE,EAAS,EAAE,KAAY;IACzD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACzD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,yDAAyD,CAAC;SACtE,MAAM,CAAC,WAAW,EAAE,sBAAsB,CAAC;SAC3C,MAAM,CAAC,WAAW,EAAE,6CAA6C,CAAC;SAClE,MAAM,CAAC,SAAS,EAAE,8CAA8C,CAAC;SACjE,MAAM,CAAC,aAAa,EAAE,kBAAkB,CAAC;SACzC,MAAM,CAAC,eAAe,EAAE,eAAe,CAAC;SACxC,MAAM,CAAC,aAAa,EAAE,uCAAuC,CAAC;SAC9D,WAAW,CACV,OAAO,EACP,QAAQ,CAAC,CAAC,WAAW,EAAE,qBAAqB,EAAE,+BAA+B,CAAC,CAAC,CAChF;SACA,MAAM,CACL,KAAK,EAAE,OAON,EAAE,EAAE;QACH,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACvE,EAAE,CAAC,WAAW,CACZ,MAAM,YAAY,CAChB;YACE,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,KAAK;YACzB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,K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KAAK,CAAC,CAAC;IAC9B,UAAU,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { parseStatsPeriod } from '../../../feature/stats/types/index.js';
|
|
2
|
+
import { formatStats } from '../../format/index.js';
|
|
3
|
+
import { repositoryArgument } from '../../ipc/client/index.js';
|
|
4
|
+
import { bind, call } from '../context.js';
|
|
5
|
+
import { usage } from '../io.js';
|
|
6
|
+
const DEFAULT_PERIOD = '30d';
|
|
7
|
+
export function registerStats(program, io, style) {
|
|
8
|
+
const { print, output, examples, context, activeStyle } = bind(io, style);
|
|
9
|
+
program
|
|
10
|
+
.command('stats')
|
|
11
|
+
.description('Usage statistics: tokens, cost and time of the agents, per task and per project')
|
|
12
|
+
.argument('[action]', 'clear: delete the collected statistics of --project; its runs stay')
|
|
13
|
+
.option('-p, --project <path>', 'project path or slug (default: every project)')
|
|
14
|
+
.option('--since <period>', 'period: <n>h, <n>d, <n>w or all', DEFAULT_PERIOD)
|
|
15
|
+
.option('--json', 'print JSON')
|
|
16
|
+
.addHelpText('after', examples(['aip stats', 'aip stats --since 7d --json', 'aip stats clear --project .']))
|
|
17
|
+
.action(async (action, options) => {
|
|
18
|
+
if (action === 'clear') {
|
|
19
|
+
if (options.project === undefined)
|
|
20
|
+
throw usage('pass --project to clear');
|
|
21
|
+
const result = (await call(context(), 'stats_clear', {
|
|
22
|
+
repository: repositoryArgument(options.project, io.cwd),
|
|
23
|
+
}));
|
|
24
|
+
print(`Removed ${result.removed} records`);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (action !== undefined)
|
|
28
|
+
throw usage(`unknown action "${action}": use clear`);
|
|
29
|
+
const period = parseStatsPeriod(options.since, Date.now());
|
|
30
|
+
if (!period.ok)
|
|
31
|
+
throw usage(period.error);
|
|
32
|
+
const report = (await call(context(), 'stats_report', {
|
|
33
|
+
...(period.since === null ? {} : { since: period.since }),
|
|
34
|
+
...(options.project === undefined
|
|
35
|
+
? {}
|
|
36
|
+
: { repository: repositoryArgument(options.project, io.cwd) }),
|
|
37
|
+
}));
|
|
38
|
+
output(options.json, formatStats(report, activeStyle), report);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/presentation/cli/commands/stats.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAc,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAc,MAAM,UAAU,CAAC;AAE7C,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,MAAM,UAAU,aAAa,CAAC,OAAgB,EAAE,EAAS,EAAE,KAAY;IACrE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1E,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,iFAAiF,CAAC;SAC9F,QAAQ,CAAC,UAAU,EAAE,oEAAoE,CAAC;SAC1F,MAAM,CAAC,sBAAsB,EAAE,+CAA+C,CAAC;SAC/E,MAAM,CAAC,kBAAkB,EAAE,iCAAiC,EAAE,cAAc,CAAC;SAC7E,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC;SAC9B,WAAW,CACV,OAAO,EACP,QAAQ,CAAC,CAAC,WAAW,EAAE,6BAA6B,EAAE,6BAA6B,CAAC,CAAC,CACtF;SACA,MAAM,CACL,KAAK,EACH,MAA0B,EAC1B,OAA4D,EAC5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,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { TAG_COLORS } from '../../../feature/tags/types/index.js';
|
|
2
|
+
import { formatTagList } from '../../format/index.js';
|
|
3
|
+
import { repositoryArgument } from '../../ipc/client/index.js';
|
|
4
|
+
import { bind, call } from '../context.js';
|
|
5
|
+
import { usage } from '../io.js';
|
|
6
|
+
function tagKit(program, io, style) {
|
|
7
|
+
const { print, output, examples, context, activeStyle } = bind(io, style);
|
|
8
|
+
const tag = program
|
|
9
|
+
.command('tag')
|
|
10
|
+
.description(`Tags of tasks and runs; every repository has its own catalog. Colors: ${TAG_COLORS.join(', ')}`);
|
|
11
|
+
const show = (json, tags) => {
|
|
12
|
+
output(json, formatTagList(tags, activeStyle), tags);
|
|
13
|
+
};
|
|
14
|
+
return { print, output, examples, context, activeStyle, io, tag, show };
|
|
15
|
+
}
|
|
16
|
+
function addList(kit) {
|
|
17
|
+
const { print, examples, context, tag, show } = kit;
|
|
18
|
+
tag
|
|
19
|
+
.command('list')
|
|
20
|
+
.description('Show the tags of the repository')
|
|
21
|
+
.option('-r, --repo <path>', 'repository path or project slug', '.')
|
|
22
|
+
.option('--json', 'print JSON')
|
|
23
|
+
.addHelpText('after', examples(['aip tag list']))
|
|
24
|
+
.action(async (options) => {
|
|
25
|
+
show(options.json, (await call(context(), 'tags', {
|
|
26
|
+
repository: repositoryArgument(options.repo),
|
|
27
|
+
})));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function addAdd(kit) {
|
|
31
|
+
const { print, examples, context, tag, show } = kit;
|
|
32
|
+
tag
|
|
33
|
+
.command('add')
|
|
34
|
+
.description('Create a tag (name up to 30 characters, unique ignoring case)')
|
|
35
|
+
.argument('<name>', 'tag name')
|
|
36
|
+
.option('--color <color>', `one of: ${TAG_COLORS.join(', ')}`)
|
|
37
|
+
.option('-r, --repo <path>', 'repository path or project slug', '.')
|
|
38
|
+
.option('--json', 'print JSON')
|
|
39
|
+
.addHelpText('after', examples(['aip tag add auth --color blue']))
|
|
40
|
+
.action(async (name, options) => {
|
|
41
|
+
show(options.json, (await call(context(), 'tag_add', {
|
|
42
|
+
repository: repositoryArgument(options.repo),
|
|
43
|
+
name,
|
|
44
|
+
...(options.color !== undefined ? { color: options.color } : {}),
|
|
45
|
+
})));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function addEdit(kit) {
|
|
49
|
+
const { print, examples, context, tag, show } = kit;
|
|
50
|
+
tag
|
|
51
|
+
.command('edit')
|
|
52
|
+
.description('Rename a tag or change its color; tasks and runs keep the tag')
|
|
53
|
+
.argument('<name>', 'tag name')
|
|
54
|
+
.option('--name <new>', 'new name')
|
|
55
|
+
.option('--color <color>', `one of: ${TAG_COLORS.join(', ')}`)
|
|
56
|
+
.option('-r, --repo <path>', 'repository path or project slug', '.')
|
|
57
|
+
.option('--json', 'print JSON')
|
|
58
|
+
.addHelpText('after', examples(['aip tag edit auth --name login --color teal']))
|
|
59
|
+
.action(async (name, options) => {
|
|
60
|
+
if (options.name === undefined && options.color === undefined) {
|
|
61
|
+
throw usage('pass --name or --color');
|
|
62
|
+
}
|
|
63
|
+
show(options.json, (await call(context(), 'tag_edit', {
|
|
64
|
+
repository: repositoryArgument(options.repo),
|
|
65
|
+
tag: name,
|
|
66
|
+
...(options.name !== undefined ? { name: options.name } : {}),
|
|
67
|
+
...(options.color !== undefined ? { color: options.color } : {}),
|
|
68
|
+
})));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function addRemove(kit) {
|
|
72
|
+
const { print, examples, context, tag, show } = kit;
|
|
73
|
+
tag
|
|
74
|
+
.command('remove')
|
|
75
|
+
.description('Delete a tag and take it off every task and run of the repository')
|
|
76
|
+
.argument('<name>', 'tag name')
|
|
77
|
+
.option('-r, --repo <path>', 'repository path or project slug', '.')
|
|
78
|
+
.option('--json', 'print JSON')
|
|
79
|
+
.addHelpText('after', examples(['aip tag remove auth']))
|
|
80
|
+
.action(async (name, options) => {
|
|
81
|
+
show(options.json, (await call(context(), 'tag_remove', {
|
|
82
|
+
repository: repositoryArgument(options.repo),
|
|
83
|
+
tag: name,
|
|
84
|
+
})));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
export function registerTag(program, io, style) {
|
|
88
|
+
const kit = tagKit(program, io, style);
|
|
89
|
+
for (const add of [addList, addAdd, addEdit, addRemove])
|
|
90
|
+
add(kit);
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../../../src/presentation/cli/commands/tag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAc,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAc,MAAM,UAAU,CAAC;AAE7C,SAAS,MAAM,CAAC,OAAgB,EAAE,EAAS,EAAE,KAAY;IACvD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1E,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CACV,yEAAyE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACjG,CAAC;IACJ,MAAM,IAAI,GAAG,CAAC,IAAyB,EAAE,IAAe,EAAQ,EAAE;QAChE,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OA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,CAAC,OAAgB,EAAE,EAAS,EAAE,KAAY;IACnE,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACvC,KAAK,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC;QAAE,GAAG,CAAC,GAAG,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { configPaths, loadWebSettings } from '../../../feature/swarm-config/services/index.js';
|
|
2
|
+
import { request } from '../../ipc/client/index.js';
|
|
3
|
+
import { assertLoopbackHost, latestRepository, openBrowser, readPanelState, startWebServer, webTokenFromEnv, } from '../../web/index.js';
|
|
4
|
+
import { bind, daemon } from '../context.js';
|
|
5
|
+
import { usage } from '../io.js';
|
|
6
|
+
import { registerWebControl } from '../web-control.js';
|
|
7
|
+
/** The address and the token the panel is served with; flags beat the settings. */
|
|
8
|
+
function target(options, settings, io) {
|
|
9
|
+
const host = options.host ?? settings.host;
|
|
10
|
+
const port = options.port === undefined ? settings.port : Number(options.port);
|
|
11
|
+
if (!Number.isInteger(port) || port < 0 || port > 65535)
|
|
12
|
+
throw usage('--port must be an integer from 0 to 65535');
|
|
13
|
+
assertLoopbackHost(host);
|
|
14
|
+
if (settings.auth === 'none') {
|
|
15
|
+
if (io.env.AIP_WEB_TOKEN)
|
|
16
|
+
io.stderr('aip web: AIP_WEB_TOKEN is ignored: web.auth is none\n');
|
|
17
|
+
return { host, port, token: undefined };
|
|
18
|
+
}
|
|
19
|
+
return { host, port, token: webTokenFromEnv(io.env) };
|
|
20
|
+
}
|
|
21
|
+
/** The link of the panel the daemon serves on that address, once it is up; undefined otherwise. */
|
|
22
|
+
async function daemonPanel(ctx, io, settings, at) {
|
|
23
|
+
const autostart = settings.autostart && io.env.AIP_WEB_AUTOSTART !== '0' && io.env.AIP_WEB_AUTOSTART !== 'false';
|
|
24
|
+
if (!autostart || at.host !== settings.host || at.port !== settings.port)
|
|
25
|
+
return undefined;
|
|
26
|
+
// A panel stopped by `aip web stop` is not coming back: do not wait for it.
|
|
27
|
+
const stopped = await request(ctx.socket, 'web_status', {}).then((result) => result.stopped === true, () => false);
|
|
28
|
+
const deadline = Date.now() + (stopped ? 0 : (io.panelWaitMs ?? 5000));
|
|
29
|
+
for (;;) {
|
|
30
|
+
const state = readPanelState(ctx.stateDirectory);
|
|
31
|
+
// A stand-in panel hands the port to the daemon started above: wait for the daemon's.
|
|
32
|
+
if (state !== null && !state.standby && state.host === at.host && state.port === at.port) {
|
|
33
|
+
io.stdout(`aip web: ${state.url}\n`);
|
|
34
|
+
io.stdout(`aip web: served by the aip daemon (pid ${state.pid})\n`);
|
|
35
|
+
return state.url;
|
|
36
|
+
}
|
|
37
|
+
if (Date.now() >= deadline)
|
|
38
|
+
return undefined;
|
|
39
|
+
await new Promise((done) => setTimeout(done, io.panelPollMs ?? 100));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function startOwnServer(ctx, settings, at) {
|
|
43
|
+
try {
|
|
44
|
+
return await startWebServer({
|
|
45
|
+
socket: ctx.socket,
|
|
46
|
+
ensureDaemon: () => daemon(ctx, 'aip web'),
|
|
47
|
+
host: at.host,
|
|
48
|
+
port: at.port,
|
|
49
|
+
auth: settings.auth,
|
|
50
|
+
...(at.token === undefined ? {} : { token: at.token }),
|
|
51
|
+
// The panel works with the daemon's registry only, never with the launch directory.
|
|
52
|
+
defaultRepository: () => latestRepository(ctx.socket),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
if (error.code === 'EADDRINUSE')
|
|
57
|
+
throw usage(`port ${at.host}:${at.port} is already in use, maybe by another aip web: open that panel and choose the repository there, or pass --port <n>`);
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async function runWeb(options, io, style) {
|
|
62
|
+
const { print, context } = bind(io, style);
|
|
63
|
+
const settings = loadWebSettings(configPaths(io.cwd, io.env.XDG_CONFIG_HOME, io.env.HOME));
|
|
64
|
+
const at = target(options, settings, io);
|
|
65
|
+
const ctx = context();
|
|
66
|
+
await daemon(ctx, 'aip web');
|
|
67
|
+
const url = await daemonPanel(ctx, io, settings, at);
|
|
68
|
+
if (url !== undefined) {
|
|
69
|
+
if (options.open)
|
|
70
|
+
openBrowser(url, io.stderr);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const web = await startOwnServer(ctx, settings, at);
|
|
74
|
+
// Before the link: whoever reads it may stop this process at once.
|
|
75
|
+
const stopped = new Promise((resolve) => {
|
|
76
|
+
io.onSignal('SIGINT', resolve);
|
|
77
|
+
io.onSignal('SIGTERM', resolve);
|
|
78
|
+
});
|
|
79
|
+
print(`aip web: ${web.url}`);
|
|
80
|
+
print('Press Ctrl+C to stop.');
|
|
81
|
+
if (options.open)
|
|
82
|
+
openBrowser(web.url, io.stderr);
|
|
83
|
+
await stopped;
|
|
84
|
+
await web.close();
|
|
85
|
+
}
|
|
86
|
+
export function registerWeb(program, io, style) {
|
|
87
|
+
const { examples, activeStyle } = bind(io, style);
|
|
88
|
+
const web = program
|
|
89
|
+
.command('web')
|
|
90
|
+
.description('Serve a local web dashboard for runs (bound to 127.0.0.1, protected by a token unless web.auth is none)')
|
|
91
|
+
.option('-p, --port <port>', 'port to listen on (default: web.port, 7341)')
|
|
92
|
+
.option('--host <host>', 'loopback address: 127.0.0.1, localhost or ::1 (default: web.host)')
|
|
93
|
+
.option('--open', 'open the dashboard in the default browser')
|
|
94
|
+
.addHelpText('after', '\nThe daemon serves the dashboard itself (web.autostart); then `aip web` prints its link and exits. ' +
|
|
95
|
+
'`aip web start|stop|restart|status` control that panel without stopping the daemon.')
|
|
96
|
+
.addHelpText('after', examples(['aip web', 'aip web --port 8080 --open', 'aip web start', 'aip web status']))
|
|
97
|
+
.action((options) => runWeb(options, io, style));
|
|
98
|
+
registerWebControl(web, activeStyle, io);
|
|
99
|
+
}
|
|
100
|
+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,EAAE,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAgB,EAAE,EAAS,EAAE,KAAY;IACnE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CACV,yGAAyG,CAC1G;SACA,MAAM,CAAC,mBAAmB,EAAE,6CAA6C,CAAC;SAC1E,MAAM,CAAC,eAAe,EAAE,mEAAmE,CAAC;SAC5F,MAAM,CAAC,QAAQ,EAAE,2CAA2C,CAAC;SAC7D,WAAW,CACV,OAAO,EACP,sGAAsG;QACpG,qFAAqF,CACxF;SACA,WAAW,CACV,OAAO,EACP,QAAQ,CAAC,CAAC,SAAS,EAAE,4BAA4B,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC,CACvF;SACA,MAAM,CAAC,CAAC,OAAmB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAC/D,kBAAkB,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { lockPath, socketPath, stateDirectoryFromEnvironment } from '../../platform/paths/index.js';
|
|
3
|
+
import { daemonMismatchMessage, ensureDaemon, request } from '../ipc/client/index.js';
|
|
4
|
+
import { examples as renderExamples } from './help.js';
|
|
5
|
+
import { writeLine } from './io.js';
|
|
6
|
+
export function context(io, style) {
|
|
7
|
+
const directory = stateDirectoryFromEnvironment(io.env);
|
|
8
|
+
return {
|
|
9
|
+
stateDirectory: directory,
|
|
10
|
+
socket: socketPath(directory),
|
|
11
|
+
entry: io.entry,
|
|
12
|
+
style,
|
|
13
|
+
io,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const warned = new Set();
|
|
17
|
+
/**
|
|
18
|
+
* Starts the daemon when none runs and replaces an older idle one; a daemon of another build
|
|
19
|
+
* that keeps running is reported on stderr, once per process.
|
|
20
|
+
*/
|
|
21
|
+
export async function daemon(ctx, client = 'aip') {
|
|
22
|
+
const check = await ensureDaemon(ctx.socket, ctx.entry, {
|
|
23
|
+
logPath: join(ctx.stateDirectory, 'daemon.log'),
|
|
24
|
+
environment: ctx.io.env,
|
|
25
|
+
lockPath: lockPath(ctx.stateDirectory),
|
|
26
|
+
});
|
|
27
|
+
const message = daemonMismatchMessage(check, client);
|
|
28
|
+
if (message && !warned.has(message)) {
|
|
29
|
+
warned.add(message);
|
|
30
|
+
ctx.io.stderr(`aip: warning: ${message}\n`);
|
|
31
|
+
}
|
|
32
|
+
return check;
|
|
33
|
+
}
|
|
34
|
+
export async function call(ctx, method, params) {
|
|
35
|
+
await daemon(ctx);
|
|
36
|
+
return request(ctx.socket, method, params);
|
|
37
|
+
}
|
|
38
|
+
/** The helpers of the commands, bound to the streams and the style of one call. */
|
|
39
|
+
export function bind(io, style) {
|
|
40
|
+
const print = (value) => writeLine(io, value);
|
|
41
|
+
return {
|
|
42
|
+
print,
|
|
43
|
+
output: (json, text, data) => print(json ? JSON.stringify(data, null, 2) : text),
|
|
44
|
+
examples: (lines) => renderExamples(lines, style),
|
|
45
|
+
context: () => context(io, style),
|
|
46
|
+
activeStyle: style,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/presentation/cli/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,C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