@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,152 @@
|
|
|
1
|
+
import { addUsage, } from '../../agents/types/index.js';
|
|
2
|
+
import { ACTION_POINTS, findAction, groupPipeline, } from '../../swarm-config/types/index.js';
|
|
3
|
+
import { ACTION_GROUP_PREFIX, MESSAGE_GROUP, MESSAGE_STEP, REPAIR_GROUP, REPAIR_SPECIALIST, REPAIR_STEP, RESOLVE_GROUP, RESOLVE_STEP, SPLIT_GROUP, SPLIT_STEP, } from './constants.js';
|
|
4
|
+
import { runPipeline } from './run.js';
|
|
5
|
+
export function freshPending(stepIndex) {
|
|
6
|
+
return { stepIndex, feedback: null, humanAnswer: null, resume: false };
|
|
7
|
+
}
|
|
8
|
+
export function pendingDelivery() {
|
|
9
|
+
return {
|
|
10
|
+
state: 'pending',
|
|
11
|
+
reason: null,
|
|
12
|
+
files: [],
|
|
13
|
+
conflicts: [],
|
|
14
|
+
userEdits: [],
|
|
15
|
+
manual: false,
|
|
16
|
+
finishedAt: null,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function newGroup(slug, title, task, position) {
|
|
20
|
+
return {
|
|
21
|
+
slug,
|
|
22
|
+
title,
|
|
23
|
+
task,
|
|
24
|
+
position,
|
|
25
|
+
status: 'queued',
|
|
26
|
+
pending: freshPending(0),
|
|
27
|
+
rejections: {},
|
|
28
|
+
attempts: [],
|
|
29
|
+
question: null,
|
|
30
|
+
questions: null,
|
|
31
|
+
humanOnly: null,
|
|
32
|
+
reason: null,
|
|
33
|
+
warnings: [],
|
|
34
|
+
decisions: [],
|
|
35
|
+
conflictFiles: [],
|
|
36
|
+
mergeSeq: null,
|
|
37
|
+
mergeInFlight: false,
|
|
38
|
+
updateOnConflict: false,
|
|
39
|
+
mergeCommit: null,
|
|
40
|
+
delivery: pendingDelivery(),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function groupUsage(group) {
|
|
44
|
+
return group.attempts.reduce((total, attempt) => addUsage(total, attempt.usage), null);
|
|
45
|
+
}
|
|
46
|
+
export function actionSlug(point, id) {
|
|
47
|
+
return `${ACTION_GROUP_PREFIX}${point.replaceAll('_', '-')}-${id}`;
|
|
48
|
+
}
|
|
49
|
+
/** The point and the action id of an action group slug; null for any other slug. */
|
|
50
|
+
export function parseActionSlug(slug) {
|
|
51
|
+
if (!slug.startsWith(ACTION_GROUP_PREFIX))
|
|
52
|
+
return null;
|
|
53
|
+
const rest = slug.slice(ACTION_GROUP_PREFIX.length);
|
|
54
|
+
for (const point of ACTION_POINTS) {
|
|
55
|
+
const prefix = `${point.replaceAll('_', '-')}-`;
|
|
56
|
+
if (rest.startsWith(prefix) && rest.length > prefix.length) {
|
|
57
|
+
return { point, id: rest.slice(prefix.length) };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
export function isActionGroup(group) {
|
|
63
|
+
return parseActionSlug(group.slug) !== null;
|
|
64
|
+
}
|
|
65
|
+
/** The point of an action group; undefined for any other group. */
|
|
66
|
+
export function actionPointOf(group) {
|
|
67
|
+
return parseActionSlug(group.slug)?.point;
|
|
68
|
+
}
|
|
69
|
+
/** The action a group runs, from the snapshot of the run. */
|
|
70
|
+
export function actionOf(run, group) {
|
|
71
|
+
const ref = parseActionSlug(group.slug);
|
|
72
|
+
return ref ? findAction(run.config, ref.id) : undefined;
|
|
73
|
+
}
|
|
74
|
+
export function isSplitGroup(group) {
|
|
75
|
+
return group.slug === SPLIT_GROUP;
|
|
76
|
+
}
|
|
77
|
+
export function isMessageGroup(group) {
|
|
78
|
+
return group.slug === MESSAGE_GROUP;
|
|
79
|
+
}
|
|
80
|
+
export function isResolveGroup(group) {
|
|
81
|
+
return group.slug === RESOLVE_GROUP;
|
|
82
|
+
}
|
|
83
|
+
export function isRepairGroup(group) {
|
|
84
|
+
return group.slug === REPAIR_GROUP;
|
|
85
|
+
}
|
|
86
|
+
export function isServiceGroup(group) {
|
|
87
|
+
return (isSplitGroup(group) ||
|
|
88
|
+
isMessageGroup(group) ||
|
|
89
|
+
isResolveGroup(group) ||
|
|
90
|
+
isRepairGroup(group) ||
|
|
91
|
+
isActionGroup(group));
|
|
92
|
+
}
|
|
93
|
+
export function stepsOf(run, group) {
|
|
94
|
+
const pipeline = runPipeline(run);
|
|
95
|
+
if (isActionGroup(group)) {
|
|
96
|
+
const action = actionOf(run, group);
|
|
97
|
+
const ref = parseActionSlug(group.slug);
|
|
98
|
+
if (!action || !ref)
|
|
99
|
+
throw new Error(`group ${group.slug} has no action in the configuration`);
|
|
100
|
+
return [
|
|
101
|
+
{
|
|
102
|
+
id: ref.id,
|
|
103
|
+
specialist: action.specialist ?? action.id,
|
|
104
|
+
onReject: null,
|
|
105
|
+
additionalPrompt: action.additionalPrompt,
|
|
106
|
+
humanReview: false,
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
if (isMessageGroup(group)) {
|
|
111
|
+
const specialist = run.config.delivery.messageSpecialist;
|
|
112
|
+
if (!specialist)
|
|
113
|
+
throw new Error('no delivery.message_specialist is configured');
|
|
114
|
+
return [
|
|
115
|
+
{ id: MESSAGE_STEP, specialist, onReject: null, additionalPrompt: null, humanReview: false },
|
|
116
|
+
];
|
|
117
|
+
}
|
|
118
|
+
if (isResolveGroup(group)) {
|
|
119
|
+
const specialist = run.config.delivery.resolver;
|
|
120
|
+
if (!specialist)
|
|
121
|
+
throw new Error('no delivery.resolver is configured');
|
|
122
|
+
return [
|
|
123
|
+
{ id: RESOLVE_STEP, specialist, onReject: null, additionalPrompt: null, humanReview: false },
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
if (isRepairGroup(group)) {
|
|
127
|
+
return [
|
|
128
|
+
{
|
|
129
|
+
id: REPAIR_STEP,
|
|
130
|
+
specialist: REPAIR_SPECIALIST,
|
|
131
|
+
onReject: null,
|
|
132
|
+
additionalPrompt: null,
|
|
133
|
+
humanReview: false,
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
}
|
|
137
|
+
if (!isSplitGroup(group))
|
|
138
|
+
return groupPipeline(run.config, pipeline).steps;
|
|
139
|
+
if (!pipeline.split)
|
|
140
|
+
throw new Error(`pipeline ${pipeline.id} has no split`);
|
|
141
|
+
return [
|
|
142
|
+
{
|
|
143
|
+
id: SPLIT_STEP,
|
|
144
|
+
specialist: pipeline.split.specialist,
|
|
145
|
+
onReject: null,
|
|
146
|
+
// Runs saved before the field existed have no value.
|
|
147
|
+
additionalPrompt: pipeline.split.additionalPrompt ?? null,
|
|
148
|
+
humanReview: false,
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../../src/feature/runs/types/group.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,GACT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAIL,aAAa,EACb,UAAU,EACV,aAAa,GACd,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAGL,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAY,WAAW,EAAE,MAAM,UAAU,CAAC;AAejD,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACzE,CAAC;AAiBD,MAAM,UAAU,eAAe;IAC7B,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,EAAE;QACb,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,IAAI;KACjB,CAAC;AACJ,CAAC;AA4BD,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAAa,EAAE,IAAY,EAAE,QAAgB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CAAC,QAAQ,CAAC,QAAQ,CAAC;QAChD,IAAI,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACvE,OAAO;YACL,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE;SAC7F,CAAC;IACJ,CAAC;IACD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO;YACL;gBACE,EAAE,EAAE,WAAW;gBACf,UAAU,EAAE,iBAAiB;gBAC7B,QAAQ,EAAE,IAAI;gBACd,gBAAgB,EAAE,IAAI;gBACtB,WAAW,EAAE,KAAK;aACnB;SACF,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;QAAE,OAAO,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC;IAC3E,IAAI,CAAC,QAAQ,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,QAAQ,CAAC,EAAE,eAAe,CAAC,CAAC;IAC7E,OAAO;QACL;YACE,EAAE,EAAE,UAAU;YACd,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;YACrC,QAAQ,EAAE,IAAI;YACd,qDAAqD;YACrD,gBAAgB,EAAE,QAAQ,CAAC,KAAK,CAAC,gBAAgB,IAAI,IAAI;YACzD,WAAW,EAAE,KAAK;SACnB;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function attemptHistoryResult(status, verdict) {
|
|
2
|
+
if (status === 'running')
|
|
3
|
+
return 'running';
|
|
4
|
+
if (status === 'failed')
|
|
5
|
+
return 'failed';
|
|
6
|
+
if (status === 'cancelled')
|
|
7
|
+
return 'cancelled';
|
|
8
|
+
return verdict ?? 'unknown';
|
|
9
|
+
}
|
|
10
|
+
export function attemptHistoryId(runId, seq) {
|
|
11
|
+
return `${runId}:_repair:${seq}`;
|
|
12
|
+
}
|
|
13
|
+
export function attemptHistoryTitle(title, name, id) {
|
|
14
|
+
return title || name || id;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=attempt-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attempt-history.js","sourceRoot":"","sources":["../../../../../src/feature/runs/types/history/attempt-history.ts"],"names":[],"mappings":"AA+CA,MAAM,UAAU,oBAAoB,CAClC,MAAqB,EACrB,OAAuB;IAEvB,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3C,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IACzC,IAAI,MAAM,KAAK,WAAW;QAAE,OAAO,WAAW,CAAC;IAC/C,OAAO,OAAO,IAAI,SAAS,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,GAAW;IACzD,OAAO,GAAG,KAAK,YAAY,GAAG,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAoB,EAAE,IAAmB,EAAE,EAAU;IACvF,OAAO,KAAK,IAAI,IAAI,IAAI,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './attempt.js';
|
|
2
|
+
export * from './constants.js';
|
|
3
|
+
export * from './create.js';
|
|
4
|
+
export * from './group.js';
|
|
5
|
+
export * from './history/attempt-history.js';
|
|
6
|
+
export * from './input.js';
|
|
7
|
+
export * from './limits.js';
|
|
8
|
+
export * from './problems.js';
|
|
9
|
+
export * from './run.js';
|
|
10
|
+
export * from './skip.js';
|
|
11
|
+
export * from './stage-status.js';
|
|
12
|
+
export * from './stages.js';
|
|
13
|
+
export * from './topology.js';
|
|
14
|
+
export { RUN_TITLE_LIMIT, RUN_NAME_LIMIT, RUN_NAME_PATTERN } from '../../agents/types/index.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/feature/runs/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { buildPrompt } from '../../swarm-config/types/index.js';
|
|
2
|
+
import { isSplitGroup, stepsOf } from './group.js';
|
|
3
|
+
import { runPipeline, specialistOfStep } from './run.js';
|
|
4
|
+
export function buildInput(run, group, pending) {
|
|
5
|
+
const step = stepsOf(run, group)[pending.stepIndex];
|
|
6
|
+
if (!step)
|
|
7
|
+
throw new Error(`step ${pending.stepIndex} does not exist`);
|
|
8
|
+
const specialist = specialistOfStep(run, group, step.specialist);
|
|
9
|
+
if (!specialist)
|
|
10
|
+
throw new Error(`specialist ${step.specialist} does not exist`);
|
|
11
|
+
const previous = group.attempts.flatMap((attempt) => attempt.status === 'finished' && attempt.report
|
|
12
|
+
? [
|
|
13
|
+
{
|
|
14
|
+
stepId: attempt.stepId,
|
|
15
|
+
specialist: attempt.specialist,
|
|
16
|
+
verdict: attempt.report.verdict,
|
|
17
|
+
summary: attempt.report.summary,
|
|
18
|
+
},
|
|
19
|
+
]
|
|
20
|
+
: []);
|
|
21
|
+
return {
|
|
22
|
+
prompt: buildPrompt(specialist.prompt, group.task, step.additionalPrompt ?? null) +
|
|
23
|
+
splitInstruction(run, group),
|
|
24
|
+
groupTitle: group.title,
|
|
25
|
+
stepId: step.id,
|
|
26
|
+
specialistName: specialist.name,
|
|
27
|
+
skills: [...specialist.skills],
|
|
28
|
+
previous,
|
|
29
|
+
feedback: pending.feedback,
|
|
30
|
+
humanAnswer: pending.humanAnswer,
|
|
31
|
+
...(pending.message ? { message: { ...pending.message } } : {}),
|
|
32
|
+
decisions: group.decisions.map((decision) => ({ ...decision })),
|
|
33
|
+
...(step.humanReview ? { humanReview: true } : {}),
|
|
34
|
+
...(pending.reviewed ? { reviewed: true } : {}),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function splitInstruction(run, group) {
|
|
38
|
+
if (!isSplitGroup(group))
|
|
39
|
+
return '';
|
|
40
|
+
return `\n\n${splitInstructionText(runPipeline(run).split?.maxGroups ?? 1)}`;
|
|
41
|
+
}
|
|
42
|
+
/** The instruction the split step adds to the prompt of its specialist. */
|
|
43
|
+
export function splitInstructionText(maxGroups) {
|
|
44
|
+
return `Split this task into independent groups of work that can be done in parallel without touching the same files where possible. Call the tool \`swarm_split\` with 1 to ${maxGroups} groups, each with a short title and a self-contained task, then call \`swarm_report\` with verdict "done".`;
|
|
45
|
+
}
|
|
46
|
+
/** The fixed part of the task of the commit message author; the run adds its own sections. */
|
|
47
|
+
export const MESSAGE_INSTRUCTIONS = (run) => [
|
|
48
|
+
`Write a git commit message for the changes of run ${run}. The first line is a short subject; then a blank line and a body.`,
|
|
49
|
+
`Report the full message as the summary of swarm_report with verdict "done". Do not change any files.`,
|
|
50
|
+
];
|
|
51
|
+
/** The fixed part of the task of the resolver; the run adds its own sections. */
|
|
52
|
+
export const RESOLVE_INSTRUCTIONS = (run) => [
|
|
53
|
+
`Your working directory holds the user's current working tree with the changes of run ${run} applied on top. The files below contain git conflict markers (<<<<<<<, =======, >>>>>>>) where the changes of the run and the user's own edits collide.`,
|
|
54
|
+
'Resolve every conflict so that both the edits of the user and the intent of the run are kept. Remove every conflict marker, run the checks of the project if you can, and report done. Report rejected if the conflicts cannot be resolved safely.',
|
|
55
|
+
'Run the checks in the foreground and wait for their result in the same shell command, with a timeout long enough for the whole check (up to 10 minutes). Never start them in the background and never wait for them with `pgrep`, `pkill` or `sleep` loops: the name of the check command also appears in the command lines of other agents and of your own shell, so such a wait never ends.',
|
|
56
|
+
];
|
|
57
|
+
const RUN_ID = /^[a-z0-9]+$/;
|
|
58
|
+
const PANEL_LINK = /#runs\/([^/?#\s]+)(?:\/([^/?#\s]+))?/;
|
|
59
|
+
function decode(part) {
|
|
60
|
+
try {
|
|
61
|
+
return decodeURIComponent(part);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Reads a run reference: a panel link with `#runs/<run>[/<group>…]` (host and port do not matter),
|
|
69
|
+
* a task number `333` or `#333`, or a run id. Anything else gives null.
|
|
70
|
+
*/
|
|
71
|
+
export function parseRunReference(text) {
|
|
72
|
+
const value = text.trim();
|
|
73
|
+
const link = PANEL_LINK.exec(value);
|
|
74
|
+
if (link) {
|
|
75
|
+
const id = decode(link[1] ?? '');
|
|
76
|
+
if (id === null || !RUN_ID.test(id))
|
|
77
|
+
return null;
|
|
78
|
+
const group = link[2] === undefined ? null : decode(link[2]);
|
|
79
|
+
if (link[2] !== undefined && (group === null || group === ''))
|
|
80
|
+
return null;
|
|
81
|
+
return { kind: 'id', id, group };
|
|
82
|
+
}
|
|
83
|
+
const number = /^#?(\d+)$/.exec(value);
|
|
84
|
+
if (number)
|
|
85
|
+
return { kind: 'number', number: Number(number[1]) };
|
|
86
|
+
if (RUN_ID.test(value))
|
|
87
|
+
return { kind: 'id', id: value, group: null };
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","sour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,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACtE,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { COMMAND_RUNTIME, USAGE_LIMIT_FALLBACK_MS } from './constants.js';
|
|
2
|
+
import { NETWORK_RETRY_MS } from '../../network/types/index.js';
|
|
3
|
+
import { isRepairGroup } from './group.js';
|
|
4
|
+
import { allGroups } from './run.js';
|
|
5
|
+
/** When the usage limit of an attempt that ran out of it resets; null for other attempts. */
|
|
6
|
+
export function limitResetsAt(attempt) {
|
|
7
|
+
if (attempt.reason?.kind !== 'usage_limit')
|
|
8
|
+
return null;
|
|
9
|
+
return (attempt.reason.resetsAt ?? (attempt.finishedAt ?? attempt.startedAt) + USAGE_LIMIT_FALLBACK_MS);
|
|
10
|
+
}
|
|
11
|
+
/** When the group may retry after a network failure of its last attempt; null otherwise. */
|
|
12
|
+
export function networkRetryAt(group) {
|
|
13
|
+
const last = group.attempts.at(-1);
|
|
14
|
+
if (last?.reason?.kind !== 'network' || last.status !== 'failed')
|
|
15
|
+
return null;
|
|
16
|
+
return (last.finishedAt ?? last.startedAt) + NETWORK_RETRY_MS;
|
|
17
|
+
}
|
|
18
|
+
/** Runtimes held by a usage limit that has not reset at `now`, with the moment it resets. */
|
|
19
|
+
export function limitHolds(states, now) {
|
|
20
|
+
const holds = new Map();
|
|
21
|
+
for (const state of states) {
|
|
22
|
+
for (const group of allGroups(state)) {
|
|
23
|
+
for (const attempt of group.attempts) {
|
|
24
|
+
const until = limitResetsAt(attempt);
|
|
25
|
+
if (until === null || until <= now)
|
|
26
|
+
continue;
|
|
27
|
+
holds.set(attempt.runtime, Math.max(holds.get(attempt.runtime) ?? 0, until));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return holds;
|
|
32
|
+
}
|
|
33
|
+
/** Running attempts of each repository. */
|
|
34
|
+
export function runningByRepository(states) {
|
|
35
|
+
const counts = new Map();
|
|
36
|
+
for (const state of states) {
|
|
37
|
+
const running = allGroups(state).reduce((count, group) => count +
|
|
38
|
+
(isRepairGroup(group) ? [] : group.attempts).filter((attempt) => attempt.status === 'running' && attempt.runtime !== COMMAND_RUNTIME).length, 0);
|
|
39
|
+
const repository = state.run.repository;
|
|
40
|
+
counts.set(repository, (counts.get(repository) ?? 0) + running);
|
|
41
|
+
}
|
|
42
|
+
return counts;
|
|
43
|
+
}
|
|
44
|
+
/** `swarm.max` of each repository: the value of its most recently created run. */
|
|
45
|
+
export function repositoryLimits(states) {
|
|
46
|
+
const latest = new Map();
|
|
47
|
+
for (const state of states) {
|
|
48
|
+
const current = latest.get(state.run.repository);
|
|
49
|
+
if (!current ||
|
|
50
|
+
state.run.createdAt > current.run.createdAt ||
|
|
51
|
+
(state.run.createdAt === current.run.createdAt && state.run.id > current.run.id))
|
|
52
|
+
latest.set(state.run.repository, state);
|
|
53
|
+
}
|
|
54
|
+
return new Map([...latest].map(([repository, state]) => [repository, state.run.config.max]));
|
|
55
|
+
}
|
|
56
|
+
export function runningBySpecialist(states) {
|
|
57
|
+
const counts = new Map();
|
|
58
|
+
for (const state of states) {
|
|
59
|
+
for (const group of allGroups(state)) {
|
|
60
|
+
if (isRepairGroup(group))
|
|
61
|
+
continue;
|
|
62
|
+
for (const attempt of group.attempts) {
|
|
63
|
+
if (attempt.status !== 'running' || attempt.runtime === COMMAND_RUNTIME)
|
|
64
|
+
continue;
|
|
65
|
+
counts.set(attempt.specialist, (counts.get(attempt.specialist) ?? 0) + 1);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return counts;
|
|
70
|
+
}
|
|
71
|
+
export function selectAttemptRuntime(options) {
|
|
72
|
+
const { specialist, chains, defaults, limitHolds, attempts, stepIndex, resume, seed } = options;
|
|
73
|
+
const keepRuntime = options.keepRuntime ?? false;
|
|
74
|
+
if (!specialist.runtimeChain) {
|
|
75
|
+
return {
|
|
76
|
+
runtime: specialist.runtime,
|
|
77
|
+
model: specialist.model,
|
|
78
|
+
...(specialist.variant !== undefined ? { variant: specialist.variant } : {}),
|
|
79
|
+
...(specialist.reasoningEffort !== undefined
|
|
80
|
+
? { reasoningEffort: specialist.reasoningEffort }
|
|
81
|
+
: {}),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const chain = chains.find((c) => c.slug === specialist.runtimeChain);
|
|
85
|
+
if (!chain || !chain.enabled) {
|
|
86
|
+
return { runtime: defaults.runtime, model: null };
|
|
87
|
+
}
|
|
88
|
+
const enabledItems = chain.runtimes
|
|
89
|
+
.map((item, index) => ({ item, index }))
|
|
90
|
+
.filter(({ item }) => item.enabled);
|
|
91
|
+
if (enabledItems.length === 0) {
|
|
92
|
+
return { runtime: defaults.runtime, model: null };
|
|
93
|
+
}
|
|
94
|
+
if (resume || keepRuntime) {
|
|
95
|
+
const prev = [...attempts].reverse().find((a) => a.stepIndex === stepIndex);
|
|
96
|
+
if (prev) {
|
|
97
|
+
return {
|
|
98
|
+
runtime: prev.runtime,
|
|
99
|
+
model: prev.model,
|
|
100
|
+
...(prev.variant !== undefined ? { variant: prev.variant } : {}),
|
|
101
|
+
...(prev.reasoningEffort !== undefined ? { reasoningEffort: prev.reasoningEffort } : {}),
|
|
102
|
+
...(prev.chainIndex !== undefined && prev.chainIndex !== null
|
|
103
|
+
? { chainIndex: prev.chainIndex }
|
|
104
|
+
: {}),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return pickChainItem(chain.mode, enabledItems, limitHolds, attempts, specialist.slug, stepIndex, seed);
|
|
109
|
+
}
|
|
110
|
+
function currentStepFailedIndices(attempts, stepIndex) {
|
|
111
|
+
const failed = new Set();
|
|
112
|
+
for (let i = attempts.length - 1; i >= 0; i--) {
|
|
113
|
+
const a = attempts[i];
|
|
114
|
+
if (a.stepIndex !== stepIndex || a.status !== 'failed')
|
|
115
|
+
break;
|
|
116
|
+
// The network, not the runtime, failed: the item stays a candidate.
|
|
117
|
+
if (a.reason?.kind === 'network')
|
|
118
|
+
continue;
|
|
119
|
+
if (a.chainIndex !== undefined && a.chainIndex !== null) {
|
|
120
|
+
failed.add(a.chainIndex);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return failed;
|
|
124
|
+
}
|
|
125
|
+
function pickChainItem(mode, enabledItems, limitHolds, attempts, specialistSlug, stepIndex, seed) {
|
|
126
|
+
if (mode === 'on_error') {
|
|
127
|
+
const failedIndices = currentStepFailedIndices(attempts, stepIndex);
|
|
128
|
+
const candidate = enabledItems.find(({ item, index }) => !failedIndices.has(index) && !limitHolds.has(item.runtime));
|
|
129
|
+
const choice = candidate ?? enabledItems.find(({ index }) => !failedIndices.has(index)) ?? enabledItems[0];
|
|
130
|
+
return formatSelected(choice);
|
|
131
|
+
}
|
|
132
|
+
const available = enabledItems.filter(({ item }) => !limitHolds.has(item.runtime));
|
|
133
|
+
const pool = available.length > 0 ? available : enabledItems;
|
|
134
|
+
if (mode === 'round_robin') {
|
|
135
|
+
const count = attempts.filter((a) => a.specialist === specialistSlug && a.chainIndex !== null && a.chainIndex !== undefined).length;
|
|
136
|
+
const choice = pool[count % pool.length];
|
|
137
|
+
return formatSelected(choice);
|
|
138
|
+
}
|
|
139
|
+
const pick = seed !== undefined ? Math.abs(seed) % pool.length : 0;
|
|
140
|
+
const choice = pool[pick];
|
|
141
|
+
return formatSelected(choice);
|
|
142
|
+
}
|
|
143
|
+
function formatSelected(entry) {
|
|
144
|
+
return {
|
|
145
|
+
runtime: entry.item.runtime,
|
|
146
|
+
model: entry.item.model ?? null,
|
|
147
|
+
...(entry.item.variant !== undefined ? { variant: entry.item.variant } : {}),
|
|
148
|
+
...(entry.item.reasoningEffort !== undefined
|
|
149
|
+
? { reasoningEffort: entry.item.reasoningEffort }
|
|
150
|
+
: {}),
|
|
151
|
+
chainIndex: entry.index,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export function hasNextChainItem(chain, attempts, stepIndex, limitHolds) {
|
|
155
|
+
if (!chain || !chain.enabled || chain.mode !== 'on_error')
|
|
156
|
+
return false;
|
|
157
|
+
const enabledItems = chain.runtimes
|
|
158
|
+
.map((item, index) => ({ item, index }))
|
|
159
|
+
.filter(({ item }) => item.enabled);
|
|
160
|
+
const failedIndices = currentStepFailedIndices(attempts, stepIndex);
|
|
161
|
+
return enabledItems.some(({ item, index }) => !failedIndices.has(index) && !limitHolds.has(item.runtime));
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../../src/feature/runs/types/limits.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAuB,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAc,aAAa,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAiB,SAAS,EAAE,MAAM,UAAU,CAAC;AAEpD,6FAA6F;AAC7F,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,IAAI,OAAO,CAAC,MAAM,EAAE,IAAI,KAAK,aAAa;QAAE,OAAO,IAAI,CAAC;IACxD,OAAO,CACL,OAAO,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC,GAAG,uBAAuB,CAC/F,CAAC;AACJ,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,cAAc,CA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,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,wBAAwB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACpE,OAAO,YAAY,CAAC,IAAI,CACtB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAChF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { isRepairGroup } from './group.js';
|
|
2
|
+
import { actionClosed, allGroups, isRunFinished, stoppedActions } from './run.js';
|
|
3
|
+
/**
|
|
4
|
+
* For a finished run: `cancelled` when the split or any work group was cancelled; otherwise
|
|
5
|
+
* `failed` when the split or a work group failed, or a merged group's delivery is `apply_failed`;
|
|
6
|
+
* otherwise `finished`. Delivery groups (message, resolve) do not count.
|
|
7
|
+
*/
|
|
8
|
+
export function runPhase(state) {
|
|
9
|
+
if (!isRunFinished(state)) {
|
|
10
|
+
return allGroups(state).some((group) => group.status === 'needs_human')
|
|
11
|
+
? 'needs_human'
|
|
12
|
+
: 'active';
|
|
13
|
+
}
|
|
14
|
+
const cancelled = state.split?.status === 'cancelled' ||
|
|
15
|
+
state.groups.some((group) => group.status === 'cancelled') ||
|
|
16
|
+
stoppedActions(state, 'cancelled').length > 0;
|
|
17
|
+
if (cancelled)
|
|
18
|
+
return 'cancelled';
|
|
19
|
+
const failed = state.split?.status === 'failed' ||
|
|
20
|
+
state.groups.some((group) => group.status === 'failed' ||
|
|
21
|
+
(group.status === 'merged' && group.delivery.state === 'apply_failed')) ||
|
|
22
|
+
stoppedActions(state, 'failed').length > 0;
|
|
23
|
+
return failed ? 'failed' : 'finished';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Problems of a run. The key includes the number of attempts, so a problem that
|
|
27
|
+
* comes back after a retry is a new one even if nobody saw the state between.
|
|
28
|
+
*/
|
|
29
|
+
export function runProblems(state) {
|
|
30
|
+
const id = state.run.id;
|
|
31
|
+
const problems = [];
|
|
32
|
+
const work = [
|
|
33
|
+
...(state.split ? [state.split, ...state.groups] : state.groups),
|
|
34
|
+
// A failure that the pipeline goes on after is not a problem.
|
|
35
|
+
...state.actions.filter((group) => group.status === 'needs_human' || !actionClosed(state.run, group)),
|
|
36
|
+
];
|
|
37
|
+
for (const group of work) {
|
|
38
|
+
const attempts = group.attempts.length;
|
|
39
|
+
if (group.status === 'needs_human' ||
|
|
40
|
+
group.status === 'failed' ||
|
|
41
|
+
group.status === 'conflict') {
|
|
42
|
+
const reason = group.status === 'failed' && group.attempts.at(-1)?.reason?.kind === 'usage_limit'
|
|
43
|
+
? 'usage_limit'
|
|
44
|
+
: group.status;
|
|
45
|
+
problems.push({
|
|
46
|
+
key: `${id}/${group.slug}/${reason}/${attempts}`,
|
|
47
|
+
run: id,
|
|
48
|
+
group: group.slug,
|
|
49
|
+
reason,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (group.status === 'merged' && group.delivery.state === 'apply_failed') {
|
|
53
|
+
problems.push({
|
|
54
|
+
key: `${id}/${group.slug}/apply_failed/${attempts}`,
|
|
55
|
+
run: id,
|
|
56
|
+
group: group.slug,
|
|
57
|
+
reason: 'apply_failed',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (runPhase(state) === 'cancelled') {
|
|
62
|
+
const total = allGroups(state)
|
|
63
|
+
.filter((group) => !isRepairGroup(group))
|
|
64
|
+
.reduce((sum, group) => sum + group.attempts.length, 0);
|
|
65
|
+
problems.push({
|
|
66
|
+
key: `${id}/run/cancelled/${total}`,
|
|
67
|
+
run: id,
|
|
68
|
+
group: null,
|
|
69
|
+
reason: 'cancelled',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return problems;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=problems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problems.js","sourceRoot":"","sources":["../../../../src/feature/runs/types/problems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAiB,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAIjG;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAe;IACtC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,aAAa,CAAC;YACrE,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,QAAQ,CAAC;IACf,CAAC;IACD,MAAM,SAAS,GACb,KAAK,CAAC,KAAK,EAAE,MAAM,KAAK,WAAW;QACnC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,WAAW,CAAC;QAC1D,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAChD,IAAI,SAAS;QAAE,OAAO,WAAW,CAAC;IAClC,MAAM,MAAM,GACV,KAAK,CAAC,KAAK,EAAE,MAAM,KAAK,QAAQ;QAChC,KAAK,CAAC,MAAM,CAAC,IAAI,CACf,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,CAAC,MAAM,KAAK,QAAQ;YACzB,CAAC,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,KAAK,cAAc,CAAC,CACzE;QACD,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ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