@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,172 @@
|
|
|
1
|
+
import { dispatch, planDispatch, transition, waitKey, } from '../machine/index.js';
|
|
2
|
+
import { allGroups, limitHolds, networkRetryAt, } from '../types/index.js';
|
|
3
|
+
/** The longest delay `setTimeout` keeps. */
|
|
4
|
+
const MAX_TIMER_MS = 2 ** 31 - 1;
|
|
5
|
+
/**
|
|
6
|
+
* The one queue every change of the daemon's state goes through, and the application of
|
|
7
|
+
* `transition`: save, effects, the scheduler, the waits and the wake-up after a usage limit.
|
|
8
|
+
*/
|
|
9
|
+
export class RunEngine {
|
|
10
|
+
dependencies;
|
|
11
|
+
queue = Promise.resolve();
|
|
12
|
+
effects = null;
|
|
13
|
+
halted = false;
|
|
14
|
+
/** Queued groups the scheduler holds back, by `waitKey`; recomputed after each `schedule()`. */
|
|
15
|
+
waits = new Map();
|
|
16
|
+
/** Waits of each unfinished run as text, to tell subscribers when they change. */
|
|
17
|
+
waitSignature = new Map();
|
|
18
|
+
wakeTimer = null;
|
|
19
|
+
constructor(dependencies) {
|
|
20
|
+
this.dependencies = dependencies;
|
|
21
|
+
}
|
|
22
|
+
/** The runner of effects; set once, right after both are built. */
|
|
23
|
+
attach(effects) {
|
|
24
|
+
this.effects = effects;
|
|
25
|
+
}
|
|
26
|
+
/** The daemon is stopping: nothing new starts. */
|
|
27
|
+
get stopping() {
|
|
28
|
+
return this.halted;
|
|
29
|
+
}
|
|
30
|
+
/** Runs `work` after everything queued before it. */
|
|
31
|
+
serial(work) {
|
|
32
|
+
const next = this.queue.then(work, work);
|
|
33
|
+
this.queue = next.catch(() => undefined);
|
|
34
|
+
return next;
|
|
35
|
+
}
|
|
36
|
+
async apply(state, event) {
|
|
37
|
+
const effects = transition(state, event, this.dependencies.now());
|
|
38
|
+
this.save(state);
|
|
39
|
+
await this.runner().perform(state, effects);
|
|
40
|
+
await this.schedule();
|
|
41
|
+
}
|
|
42
|
+
/** Writes the run and tells the clients, the queue and the observers. */
|
|
43
|
+
save(state) {
|
|
44
|
+
const { states, publish, queue, observe } = this.dependencies;
|
|
45
|
+
states.write(state);
|
|
46
|
+
publish.runSaved(state);
|
|
47
|
+
queue.runChanged(state);
|
|
48
|
+
// Any run, queued or not: an incident of a run started directly is noticed as well.
|
|
49
|
+
observe.request();
|
|
50
|
+
}
|
|
51
|
+
async schedule() {
|
|
52
|
+
if (this.halted)
|
|
53
|
+
return;
|
|
54
|
+
const { states, now } = this.dependencies;
|
|
55
|
+
try {
|
|
56
|
+
const all = states.all();
|
|
57
|
+
const active = all.filter((state) => state.run.finishedAt === null);
|
|
58
|
+
// Finished runs too: a usage limit of a failed run still holds its runtime.
|
|
59
|
+
const effects = dispatch(all, now(), this.dependencies.network());
|
|
60
|
+
this.armWake();
|
|
61
|
+
if (effects.length === 0)
|
|
62
|
+
return;
|
|
63
|
+
for (const state of active)
|
|
64
|
+
this.save(state);
|
|
65
|
+
for (const effect of effects) {
|
|
66
|
+
const state = all.find((candidate) => candidate.run.id === effect.run);
|
|
67
|
+
if (state)
|
|
68
|
+
await this.runner().perform(state, [effect]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
finally {
|
|
72
|
+
this.refreshWaits();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** The wait of a queued group, or null when it may start. */
|
|
76
|
+
waitOf = (run, slug) => this.waits.get(waitKey(run, slug)) ?? null;
|
|
77
|
+
/**
|
|
78
|
+
* Sets the timer to the nearest moment a usage limit resets or a pause after a network failure ends: a held runtime may start its
|
|
79
|
+
* steps again, a queue stopped by the limit may start by itself.
|
|
80
|
+
*/
|
|
81
|
+
armWake() {
|
|
82
|
+
if (this.wakeTimer)
|
|
83
|
+
clearTimeout(this.wakeTimer);
|
|
84
|
+
this.wakeTimer = null;
|
|
85
|
+
if (this.halted)
|
|
86
|
+
return;
|
|
87
|
+
const { states, now, wakeMarginMs, queue } = this.dependencies;
|
|
88
|
+
const moment = now();
|
|
89
|
+
const retries = states
|
|
90
|
+
.all()
|
|
91
|
+
.filter((state) => state.run.finishedAt === null)
|
|
92
|
+
.flatMap((state) => allGroups(state).map((group) => networkRetryAt(group)))
|
|
93
|
+
.filter((at) => at !== null && at > moment);
|
|
94
|
+
const moments = [
|
|
95
|
+
...limitHolds(states.all(), moment).values(),
|
|
96
|
+
...retries,
|
|
97
|
+
...queue.wakeMoments(),
|
|
98
|
+
];
|
|
99
|
+
if (moments.length === 0)
|
|
100
|
+
return;
|
|
101
|
+
const delay = Math.min(Math.max(Math.min(...moments) - moment, 0) + wakeMarginMs, MAX_TIMER_MS);
|
|
102
|
+
this.wakeTimer = setTimeout(() => {
|
|
103
|
+
this.wakeTimer = null;
|
|
104
|
+
void this.serial(() => this.wake()).catch(() => undefined);
|
|
105
|
+
}, delay);
|
|
106
|
+
this.wakeTimer.unref();
|
|
107
|
+
}
|
|
108
|
+
/** Starts the steps whose usage limit reset and the queues that resume after it. */
|
|
109
|
+
async wake() {
|
|
110
|
+
if (this.halted)
|
|
111
|
+
return;
|
|
112
|
+
await this.schedule();
|
|
113
|
+
await this.dependencies.queue.wake();
|
|
114
|
+
this.dependencies.observe.request();
|
|
115
|
+
this.armWake();
|
|
116
|
+
}
|
|
117
|
+
/** An agent runs (a step or the naming of a run) or a group merges. */
|
|
118
|
+
busy() {
|
|
119
|
+
if (this.runner().busy())
|
|
120
|
+
return true;
|
|
121
|
+
return this.dependencies.states
|
|
122
|
+
.all()
|
|
123
|
+
.some((state) => state.run.finishedAt === null && allGroups(state).some((group) => group.mergeInFlight));
|
|
124
|
+
}
|
|
125
|
+
/** Nothing new starts from now on; the wake-up timer is dropped. */
|
|
126
|
+
halt() {
|
|
127
|
+
this.halted = true;
|
|
128
|
+
if (this.wakeTimer)
|
|
129
|
+
clearTimeout(this.wakeTimer);
|
|
130
|
+
this.wakeTimer = null;
|
|
131
|
+
}
|
|
132
|
+
/** Stops the agents and waits for the work already queued. */
|
|
133
|
+
async drain() {
|
|
134
|
+
await this.runner().stopAll();
|
|
135
|
+
await this.queue.catch(() => undefined);
|
|
136
|
+
}
|
|
137
|
+
/** Recomputes which queued groups wait, and tells subscribers about runs whose waits changed. */
|
|
138
|
+
refreshWaits() {
|
|
139
|
+
const states = this.dependencies.states.all();
|
|
140
|
+
this.waits = planDispatch(states, this.dependencies.now(), this.dependencies.network()).waits;
|
|
141
|
+
const changed = [];
|
|
142
|
+
const repositories = new Set();
|
|
143
|
+
for (const state of states) {
|
|
144
|
+
const id = state.run.id;
|
|
145
|
+
const prefix = `${id}/`;
|
|
146
|
+
const signature = state.run.finishedAt === null
|
|
147
|
+
? [...this.waits]
|
|
148
|
+
.filter(([key]) => key.startsWith(prefix))
|
|
149
|
+
.map(([key, wait]) => `${key}:${JSON.stringify(wait)}`)
|
|
150
|
+
.sort()
|
|
151
|
+
.join('|')
|
|
152
|
+
: '';
|
|
153
|
+
const known = this.waitSignature.get(id) ?? '';
|
|
154
|
+
if (signature === known)
|
|
155
|
+
continue;
|
|
156
|
+
if (signature === '')
|
|
157
|
+
this.waitSignature.delete(id);
|
|
158
|
+
else
|
|
159
|
+
this.waitSignature.set(id, signature);
|
|
160
|
+
changed.push(state);
|
|
161
|
+
repositories.add(state.run.repository);
|
|
162
|
+
}
|
|
163
|
+
if (changed.length > 0)
|
|
164
|
+
this.dependencies.publish.waitsChanged(changed, repositories);
|
|
165
|
+
}
|
|
166
|
+
runner() {
|
|
167
|
+
if (this.effects === null)
|
|
168
|
+
throw new Error('the runner of effects is not attached');
|
|
169
|
+
return this.effects;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../../../src/feature/runs/services/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,OAAO,GAGR,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,SAAS,EACT,UAAU,EACV,cAAc,GAGf,MAAM,mBAAmB,CAAC;AAI3B,4CAA4C;AAC5C,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE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AAC;qBACtD,IAAI,EAAE;qBACN,IAAI,CAAC,GAAG,CAAC;gBACd,CAAC,CAAC,EAAE,CAAC;YACT,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;YAC/C,IAAI,SAAS,KAAK,KAAK;gBAAE,SAAS;YAClC,IAAI,SAAS,KAAK,EAAE;gBAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;;gBAC/C,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;YAC3C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACxF,CAAC;IAEO,MAAM;QACZ,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { specialistUse } from './occupancy.js';
|
|
2
|
+
export { stepProgress } from './progress.js';
|
|
3
|
+
export { formatCounts, runStartedAt, summarize } from './summary.js';
|
|
4
|
+
export { recoverRuns } from './recovery.js';
|
|
5
|
+
export { NAMING_TIMEOUT_MS, USAGE_INTERVAL_MS, } from './effects/context.js';
|
|
6
|
+
export { RunEffects } from './effects/effects.js';
|
|
7
|
+
export { RunEngine } from './engine.js';
|
|
8
|
+
export { createRunArchive, createRunsServices, } from './create.js';
|
|
9
|
+
export { RunArchive } from './archive.js';
|
|
10
|
+
export { RunAttemptHistoryService } from './attempt-history.js';
|
|
11
|
+
export { RunStates } from './states.js';
|
|
12
|
+
export { RunReads } from './reads.js';
|
|
13
|
+
export { currentPermissions, currentSpecialists } from './refresh.js';
|
|
14
|
+
export { RunRequests } from './requests.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/feature/runs/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAmB,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,WAAW,EAAqB,MAAM,eAAe,CAAC;AAC/D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAGlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAqB,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,kBAAkB,GAGnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAqB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAyC,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { findSpecialist } from '../../swarm-config/types/index.js';
|
|
2
|
+
import { allGroups, attemptStepLabel, isRepairGroup, specialistName, stepLabel, stepsOf, } from '../types/index.js';
|
|
3
|
+
/** Specialists that run or are waited for in the run, sorted by slug. Empty for a finished run. */
|
|
4
|
+
export function specialistUse(state) {
|
|
5
|
+
if (state.run.finishedAt !== null)
|
|
6
|
+
return [];
|
|
7
|
+
const uses = new Map();
|
|
8
|
+
const entry = (slug, repair) => {
|
|
9
|
+
let use = uses.get(slug);
|
|
10
|
+
if (!use) {
|
|
11
|
+
// The repair group shows the profile the observer had when the repair started.
|
|
12
|
+
const found = repair
|
|
13
|
+
? (state.run.repair.specialist ?? undefined)
|
|
14
|
+
: findSpecialist(state.run.config, slug);
|
|
15
|
+
use = {
|
|
16
|
+
specialist: slug,
|
|
17
|
+
name: found?.name.trim() ? found.name : specialistName(state.run.config, slug),
|
|
18
|
+
level: found?.level ?? 'project',
|
|
19
|
+
max: repair ? null : (found?.max ?? null),
|
|
20
|
+
running: [],
|
|
21
|
+
waiting: [],
|
|
22
|
+
};
|
|
23
|
+
uses.set(slug, use);
|
|
24
|
+
}
|
|
25
|
+
return use;
|
|
26
|
+
};
|
|
27
|
+
for (const group of allGroups(state)) {
|
|
28
|
+
const repair = isRepairGroup(group);
|
|
29
|
+
for (const attempt of group.attempts) {
|
|
30
|
+
if (attempt.status !== 'running')
|
|
31
|
+
continue;
|
|
32
|
+
entry(attempt.specialist, repair).running.push({
|
|
33
|
+
slug: group.slug,
|
|
34
|
+
title: group.title,
|
|
35
|
+
step: attempt.stepId,
|
|
36
|
+
stepName: attemptStepLabel(state, group, attempt),
|
|
37
|
+
startedAt: attempt.startedAt,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (group.status === 'queued' && group.pending !== null) {
|
|
41
|
+
let step;
|
|
42
|
+
let steps = [];
|
|
43
|
+
try {
|
|
44
|
+
steps = stepsOf(state.run, group);
|
|
45
|
+
step = steps[group.pending.stepIndex];
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
step = undefined;
|
|
49
|
+
}
|
|
50
|
+
if (step) {
|
|
51
|
+
entry(step.specialist, repair).waiting.push({
|
|
52
|
+
slug: group.slug,
|
|
53
|
+
title: group.title,
|
|
54
|
+
step: step.id,
|
|
55
|
+
stepName: stepLabel(state.run.config, steps, step),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return [...uses.values()].sort((left, right) => left.specialist < right.specialist ? -1 : left.specialist > right.specialist ? 1 : 0);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=occupancy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"occupancy.js","sourceRoot":"","sources":["../../../../src/feature/runs/services/occupancy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAGL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,SAAS,EACT,OAAO,GACR,MAAM,mBAAmB,CAAC;AAE3B,mGAAmG;AACnG,MAAM,UAAU,aAAa,CAAC,KAAe;IAC3C,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAC7C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAyB,CAAC;IAC9C,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,MAAe,EAAiB,EAAE;QAC7D,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,+EAA+E;YAC/E,MAAM,KAAK,GAAG,MAAM;gBAClB,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,SAAS,CAAC;gBAC5C,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC3C,GAAG,GAAG;gBACJ,UAAU,EAAE,IAAI;gBAChB,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI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AAI,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YACxC,CAAC;YAAC,MAAM,CAAC;gBACP,IAAI,GAAG,SAAS,CAAC;YACnB,CAAC;YACD,IAAI,IAAI,EAAE,CAAC;gBACT,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;oBAC1C,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,IAAI,EAAE,IAAI,CAAC,EAAE;oBACb,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC;iBACnD,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC7C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACrF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { stepLabel, stepsOf, } from '../types/index.js';
|
|
2
|
+
const ALL_STEPS = new Set(['merged', 'merging', 'conflict']);
|
|
3
|
+
function position(group, count) {
|
|
4
|
+
if (ALL_STEPS.has(group.status))
|
|
5
|
+
return count;
|
|
6
|
+
if (group.status === 'queued')
|
|
7
|
+
return Math.min(group.pending?.stepIndex ?? 0, count);
|
|
8
|
+
return Math.min(group.attempts.at(-1)?.stepIndex ?? 0, count);
|
|
9
|
+
}
|
|
10
|
+
function reached(group, count) {
|
|
11
|
+
if (ALL_STEPS.has(group.status))
|
|
12
|
+
return count;
|
|
13
|
+
const furthest = Math.max(0, ...group.attempts.map((attempt) => attempt.stepIndex));
|
|
14
|
+
return Math.min(count, Math.max(position(group, count), furthest));
|
|
15
|
+
}
|
|
16
|
+
/** Step progress of a run: reached steps by the furthest step, the current step by position. */
|
|
17
|
+
export function stepProgress(state) {
|
|
18
|
+
let done = 0;
|
|
19
|
+
let total = 0;
|
|
20
|
+
let current = null;
|
|
21
|
+
try {
|
|
22
|
+
for (const group of state.groups) {
|
|
23
|
+
const steps = stepsOf(state.run, group);
|
|
24
|
+
const passed = position(group, steps.length);
|
|
25
|
+
done += reached(group, steps.length);
|
|
26
|
+
total += steps.length;
|
|
27
|
+
const step = steps[passed];
|
|
28
|
+
if (state.groups.length === 1 && step) {
|
|
29
|
+
current = {
|
|
30
|
+
step: step.id,
|
|
31
|
+
name: stepLabel(state.run.config, steps, step),
|
|
32
|
+
number: passed + 1,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return { done: 0, total: 0, current: null };
|
|
39
|
+
}
|
|
40
|
+
return { done, total, current };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../../src/feature/runs/services/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EACT,OAAO,GACR,MAAM,mBAAmB,CAAC;AAE3B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAE7D,SAAS,QAAQ,CAAC,KAAY,EAAE,KAAa;IAC3C,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,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,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;gBACtC,OAAO,GAAG;oBACR,IAAI,EAAE,IAAI,CAAC,EAAE;oBACb,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC;oBAC9C,MAAM,EAAE,MAAM,GAAG,CAAC;iBACnB,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { rejected } from '../../../platform/errors/index.js';
|
|
2
|
+
import { readLines, readTail, readTimes, timesPath } from '../../agents/services/index.js';
|
|
3
|
+
import { findGroup, parseRunReference } from '../types/index.js';
|
|
4
|
+
/** Reads of a run that need the files of its attempts. */
|
|
5
|
+
export class RunReads {
|
|
6
|
+
dependencies;
|
|
7
|
+
constructor(dependencies) {
|
|
8
|
+
this.dependencies = dependencies;
|
|
9
|
+
}
|
|
10
|
+
/** The group of the run; throws when there is none. */
|
|
11
|
+
groupOf(runId, slug) {
|
|
12
|
+
const state = this.dependencies.states.get(runId);
|
|
13
|
+
const group = findGroup(state, slug);
|
|
14
|
+
if (!group)
|
|
15
|
+
throw rejected(`unknown group \`${slug}\` in run ${runId}`);
|
|
16
|
+
return { state, group };
|
|
17
|
+
}
|
|
18
|
+
group(runId, slug, tailLines = 40) {
|
|
19
|
+
const { state, group } = this.groupOf(runId, slug);
|
|
20
|
+
const { effects } = this.dependencies;
|
|
21
|
+
const last = group.attempts.at(-1);
|
|
22
|
+
const log = last
|
|
23
|
+
? { seq: last.seq, lines: readTail(effects.logPath(state, group.slug, last.seq), tailLines) }
|
|
24
|
+
: null;
|
|
25
|
+
return { state, group, worktree: effects.worktreePath(state, group), log };
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* `worker_run_show`: a running attempt reads a run of its own repository, named by id, task
|
|
29
|
+
* number or panel link; `group` (or the group of the link) adds the details of that group.
|
|
30
|
+
*/
|
|
31
|
+
forWorker(params) {
|
|
32
|
+
const { states, effects } = this.dependencies;
|
|
33
|
+
const key = effects.attemptFor(params.token);
|
|
34
|
+
const own = key ? states.lookup(key.run) : undefined;
|
|
35
|
+
const attempt = key
|
|
36
|
+
? own && findGroup(own, key.group)?.attempts.find((candidate) => candidate.seq === key.seq)
|
|
37
|
+
: undefined;
|
|
38
|
+
if (!own || attempt?.status !== 'running')
|
|
39
|
+
throw rejected('unknown or expired report token');
|
|
40
|
+
const reference = parseRunReference(params.run);
|
|
41
|
+
if (!reference) {
|
|
42
|
+
throw rejected(`\`${params.run}\` is not a run id, a task number or a link to a run`);
|
|
43
|
+
}
|
|
44
|
+
const repository = own.run.repository;
|
|
45
|
+
let id;
|
|
46
|
+
if (reference.kind === 'number') {
|
|
47
|
+
const found = states.idByNumber(repository, reference.number);
|
|
48
|
+
if (found === null)
|
|
49
|
+
throw rejected(`unknown task #${reference.number} in this repository`);
|
|
50
|
+
id = found;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
id = reference.id;
|
|
54
|
+
}
|
|
55
|
+
const state = states.get(id);
|
|
56
|
+
if (state.run.repository !== repository) {
|
|
57
|
+
throw rejected(`run ${id} belongs to another repository`);
|
|
58
|
+
}
|
|
59
|
+
const slug = params.group ?? (reference.kind === 'id' ? reference.group : null);
|
|
60
|
+
return {
|
|
61
|
+
state,
|
|
62
|
+
tasks: state.groups.map(({ slug, title, task }) => ({ slug, title, task })),
|
|
63
|
+
group: slug === null ? null : this.group(id, slug, params.tailLines),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** The readable entries of an attempt log, from line `after` on. */
|
|
67
|
+
transcript(params) {
|
|
68
|
+
const { state, group } = this.groupOf(params.runId, params.group);
|
|
69
|
+
const attempt = params.seq === undefined
|
|
70
|
+
? group.attempts.at(-1)
|
|
71
|
+
: group.attempts.find((candidate) => candidate.seq === params.seq);
|
|
72
|
+
if (params.seq !== undefined && !attempt) {
|
|
73
|
+
throw rejected(`unknown attempt ${params.seq} of group \`${params.group}\``);
|
|
74
|
+
}
|
|
75
|
+
const base = { runId: state.run.id, group: group.slug };
|
|
76
|
+
if (!attempt)
|
|
77
|
+
return { ...base, seq: null, cursor: 0, running: false, entries: [] };
|
|
78
|
+
const logPath = this.dependencies.effects.logPath(state, group.slug, attempt.seq);
|
|
79
|
+
const after = params.after ?? 0;
|
|
80
|
+
const { lines, cursor } = readLines(logPath, after);
|
|
81
|
+
const moments = readTimes(timesPath(logPath));
|
|
82
|
+
const times = lines.map((_, index) => moments.get(after + index) ?? null);
|
|
83
|
+
const entries = attempt.runtime === 'command'
|
|
84
|
+
? lines.flatMap((text, index) => text === '' ? [] : [{ kind: 'raw', text, at: times[index] ?? null }])
|
|
85
|
+
: this.dependencies.agents.runtimeFor(attempt.runtime).transcript(lines, times);
|
|
86
|
+
const verdict = attempt.report?.verdict ?? null;
|
|
87
|
+
for (const entry of entries)
|
|
88
|
+
if (entry.kind === 'result')
|
|
89
|
+
entry.verdict = verdict;
|
|
90
|
+
return { ...base, seq: attempt.seq, cursor, running: attempt.status === 'running', entries };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=reads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reads.js","sourceRoot":"","sources":["../../../../src/feature/runs/services/reads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAG3F,OAAO,EAAE,SAAS,EAAE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,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CACrE;YACH,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACpF,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,IAAI,IAAI,CAAC;QAChD,KAAK,MAAM,KAAK,IAAI,OAAO;YAAE,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;gBAAE,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QAClF,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,OAAO,EAAE,CAAC;IAC/F,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { transition } from '../machine/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Marks what the old daemon left running as interrupted: active runs and finished runs whose
|
|
4
|
+
* delivery had not finished. The returned effects (a restarted delivery) are for the daemon.
|
|
5
|
+
* The whole scenario is one transaction opened here.
|
|
6
|
+
*/
|
|
7
|
+
export function recoverRuns(database, runs, now) {
|
|
8
|
+
return database.transaction(() => {
|
|
9
|
+
const states = [...runs.activeRuns(), ...runs.deliveringRuns()];
|
|
10
|
+
return states.map((state) => {
|
|
11
|
+
const effects = transition(state, { kind: 'interrupted' }, now);
|
|
12
|
+
runs.writeRun(state);
|
|
13
|
+
return { state, effects };
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=recovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery.js","sourceRoot":"","sources":["../../../../src/feature/runs/services/recovery.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAO9D;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,QAAkB,EAAE,IAAmB,EAAE,GAAW;IAC9E,OAAO,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE;QAC/B,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAChE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAC1B,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,GAAG,CAAC,CAAC;YAChE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { rejected } from '../../../platform/errors/index.js';
|
|
2
|
+
import { permissionsOf, specialistsOf, } from '../../agents/types/index.js';
|
|
3
|
+
import { ConfigLoadError, firstConfigError } from '../../swarm-config/types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Whole specialists of the current configuration of the run's repository; a configuration that
|
|
6
|
+
* does not load or pass validation refuses the request.
|
|
7
|
+
*/
|
|
8
|
+
export function currentSpecialists(config, state) {
|
|
9
|
+
try {
|
|
10
|
+
return specialistsOf(config.load(state.run.repository));
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
if (!(error instanceof ConfigLoadError))
|
|
14
|
+
throw rejected(error.message);
|
|
15
|
+
throw rejected(`configuration not loaded: ${firstConfigError(error)}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** Permissions of the specialists in the current configuration of the run's repository. */
|
|
19
|
+
export function currentPermissions(config, state) {
|
|
20
|
+
try {
|
|
21
|
+
return permissionsOf(config.load(state.run.repository));
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
if (!(error instanceof ConfigLoadError))
|
|
25
|
+
return { error: error.message };
|
|
26
|
+
return { error: firstConfigError(error) };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.js","sourceRoot":"","sources":["../../../../src/feature/runs/services/refresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,aAAa,GAGd,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGtF;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAqB,EAAE,KAAe;IACvE,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,eAAe,CAAC;YAAE,MAAM,QAAQ,CAAE,KAAe,CAAC,OAAO,CAAC,CAAC;QAClF,MAAM,QAAQ,CAAC,6BAA6B,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,kBAAkB,CAAC,MAAqB,EAAE,KAAe;IACvE,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,eAAe,CAAC;YAAE,OAAO,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAC;QACpF,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { randomInt } from 'node:crypto';
|
|
2
|
+
import { rejected } from '../../../platform/errors/index.js';
|
|
3
|
+
import { excludeWorkspace, prepareRunBranch, workspaceRoot } from '../../../platform/git/index.js';
|
|
4
|
+
import { findPipeline } from '../../swarm-config/types/index.js';
|
|
5
|
+
import { checkSkip, createRun, groupsFromTask, runCreated, runId, } from '../types/index.js';
|
|
6
|
+
/** The changes of runs the clients and the agents ask for. */
|
|
7
|
+
export class RunRequests {
|
|
8
|
+
dependencies;
|
|
9
|
+
constructor(dependencies) {
|
|
10
|
+
this.dependencies = dependencies;
|
|
11
|
+
}
|
|
12
|
+
/** Applies an event to the run in the queue of the daemon and returns the run. */
|
|
13
|
+
event(runId, event) {
|
|
14
|
+
const { engine, states } = this.dependencies;
|
|
15
|
+
return engine.serial(async () => {
|
|
16
|
+
const state = states.get(runId);
|
|
17
|
+
await engine.apply(state, typeof event === 'function' ? event(state) : event);
|
|
18
|
+
return state;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** An event reported by the worker MCP server of a running attempt. */
|
|
22
|
+
workerEvent(token, build) {
|
|
23
|
+
const { engine, states, effects } = this.dependencies;
|
|
24
|
+
return engine.serial(async () => {
|
|
25
|
+
const key = effects.attemptFor(token);
|
|
26
|
+
if (!key)
|
|
27
|
+
throw rejected('unknown or expired report token');
|
|
28
|
+
await engine.apply(states.get(key.run), build(key));
|
|
29
|
+
return { recorded: true };
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** `run_title`: the title the user gave. */
|
|
33
|
+
async setTitle(runId, title) {
|
|
34
|
+
const state = this.dependencies.states.get(runId);
|
|
35
|
+
await this.dependencies.engine.apply(state, { kind: 'title_set', title });
|
|
36
|
+
return state;
|
|
37
|
+
}
|
|
38
|
+
/** Creates the run of a queue item: the branch, the run itself, the naming in the background. */
|
|
39
|
+
async create(params, tagIds, queueItem) {
|
|
40
|
+
const { registry, config: configs, now } = this.dependencies;
|
|
41
|
+
const repository = await registry.rootOf(params.repository);
|
|
42
|
+
const config = configs.load(repository);
|
|
43
|
+
if (!findPipeline(config, params.pipeline)) {
|
|
44
|
+
const known = config.pipelines.map((pipeline) => pipeline.id).join(', ') || 'none';
|
|
45
|
+
throw rejected(`unknown pipeline \`${params.pipeline}\`; known: ${known}`);
|
|
46
|
+
}
|
|
47
|
+
const skipError = checkSkip(config, params.pipeline, params.skip ?? []);
|
|
48
|
+
if (skipError !== null)
|
|
49
|
+
throw rejected(skipError);
|
|
50
|
+
const id = runId(now(), randomInt(36 ** 4));
|
|
51
|
+
const prepared = await prepareRunBranch(repository, `refs/aip/${id}/run`, {
|
|
52
|
+
workingTree: config.workspace.base === 'working_tree',
|
|
53
|
+
include: config.workspace.include,
|
|
54
|
+
snapshotRef: `refs/aip/${id}/base`,
|
|
55
|
+
});
|
|
56
|
+
await excludeWorkspace(repository, workspaceRoot(repository, config.workspaceDir));
|
|
57
|
+
const state = createRun({
|
|
58
|
+
id,
|
|
59
|
+
repository,
|
|
60
|
+
pipeline: params.pipeline,
|
|
61
|
+
baseCommit: prepared.baseCommit,
|
|
62
|
+
config,
|
|
63
|
+
dirtyWarning: prepared.dirty,
|
|
64
|
+
groups: params.groups ?? groupsFromTask(params.task ?? ''),
|
|
65
|
+
split: params.task !== undefined,
|
|
66
|
+
fromQueue: true,
|
|
67
|
+
queueItem: queueItem.id,
|
|
68
|
+
number: queueItem.number,
|
|
69
|
+
autoDeliver: params.autoDeliver,
|
|
70
|
+
deliveryMode: params.deliveryMode,
|
|
71
|
+
skip: params.skip,
|
|
72
|
+
tags: tagIds,
|
|
73
|
+
now: now(),
|
|
74
|
+
...(params.title ? { title: params.title } : {}),
|
|
75
|
+
});
|
|
76
|
+
return this.started(state, config.naming.enabled, prepared.dirty);
|
|
77
|
+
}
|
|
78
|
+
async started(state, naming, dirty) {
|
|
79
|
+
const { states, engine, effects } = this.dependencies;
|
|
80
|
+
states.add(state);
|
|
81
|
+
engine.save(state);
|
|
82
|
+
await engine.schedule();
|
|
83
|
+
if (state.run.title === null && naming)
|
|
84
|
+
void effects.nameRun(state);
|
|
85
|
+
return runCreated(state, dirty ? ['the repository has uncommitted changes; they are not part of this run'] : []);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/feature/runs/services/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAGnG,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EACL,SAAS,EACT,SAAS,EACT,cAAc,EACd,UAAU,EACV,KAAK,GAIN,MAAM,mBAAmB,CAAC;AAgB3B,8DAA8D;AAC9D,MAAM,OAAO,WAAW;IACL,YAAY,CAA0B;IAEvD,YAAY,YAAqC;QAC/C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED,kFAAkF;IAClF,KAAK,CAAC,KAAa,EAAE,KAA2C;QAC9D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;QAC7C,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;YAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAChC,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CA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