@hoknie/aip 0.0.0-stage → 0.1.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 +18 -0
- package/dist/app/agents.js.map +1 -0
- package/dist/app/application.js +173 -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 +30 -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 +23 -0
- package/dist/app/timings.js.map +1 -0
- package/dist/app/wiring.js +57 -0
- package/dist/app/wiring.js.map +1 -0
- package/dist/cli/clean.js +71 -0
- package/dist/cli/clean.js.map +1 -0
- package/dist/cli/commands.js +963 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/config-check.js +173 -0
- package/dist/cli/config-check.js.map +1 -0
- package/dist/cli/daemon.js +199 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/help.js +50 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/init.js +43 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/io.js +13 -0
- package/dist/cli/io.js.map +1 -0
- package/dist/cli/main.js +31 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/probe.js +12 -0
- package/dist/cli/probe.js.map +1 -0
- package/dist/cli/program.js +48 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/cli/setup.js +406 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/version.js +6 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/cli/watch.js +24 -0
- package/dist/cli/watch.js.map +1 -0
- package/dist/cli/web/daemon-panel.js +185 -0
- package/dist/cli/web/daemon-panel.js.map +1 -0
- package/dist/cli/web/default-repository.js +12 -0
- package/dist/cli/web/default-repository.js.map +1 -0
- package/dist/cli/web/errors.js +60 -0
- package/dist/cli/web/errors.js.map +1 -0
- package/dist/cli/web/open.js +12 -0
- package/dist/cli/web/open.js.map +1 -0
- package/dist/cli/web/page.js +465 -0
- package/dist/cli/web/page.js.map +1 -0
- package/dist/cli/web/server.js +1191 -0
- package/dist/cli/web/server.js.map +1 -0
- package/dist/cli/web/standby.js +119 -0
- package/dist/cli/web/standby.js.map +1 -0
- package/dist/cli/web/state.js +69 -0
- package/dist/cli/web/state.js.map +1 -0
- package/dist/cli/web/system.js +66 -0
- package/dist/cli/web/system.js.map +1 -0
- package/dist/cli/web-control.js +173 -0
- package/dist/cli/web-control.js.map +1 -0
- package/dist/config/discover.js +25 -0
- package/dist/config/discover.js.map +1 -0
- package/dist/config/duration.js +17 -0
- package/dist/config/duration.js.map +1 -0
- package/dist/config/edit.js +966 -0
- package/dist/config/edit.js.map +1 -0
- package/dist/config/errors.js +29 -0
- package/dist/config/errors.js.map +1 -0
- package/dist/config/index.js +14 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/load.js +412 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/merge.js +45 -0
- package/dist/config/merge.js.map +1 -0
- package/dist/config/model.js +171 -0
- package/dist/config/model.js.map +1 -0
- package/dist/config/paths.js +31 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/prompt.js +33 -0
- package/dist/config/prompt.js.map +1 -0
- package/dist/config/shared-pipelines.js +71 -0
- package/dist/config/shared-pipelines.js.map +1 -0
- package/dist/config/shared-specialists.js +68 -0
- package/dist/config/shared-specialists.js.map +1 -0
- package/dist/config/shared-workflows.js +71 -0
- package/dist/config/shared-workflows.js.map +1 -0
- package/dist/config/specialist-tags.js +214 -0
- package/dist/config/specialist-tags.js.map +1 -0
- package/dist/config/tag-names.js +43 -0
- package/dist/config/tag-names.js.map +1 -0
- package/dist/config/validate.js +872 -0
- package/dist/config/validate.js.map +1 -0
- package/dist/core/artifacts.js +37 -0
- package/dist/core/artifacts.js.map +1 -0
- package/dist/core/create.js +75 -0
- package/dist/core/create.js.map +1 -0
- package/dist/core/delivery.js +366 -0
- package/dist/core/delivery.js.map +1 -0
- package/dist/core/errors.js +7 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/ids.js +99 -0
- package/dist/core/ids.js.map +1 -0
- package/dist/core/index.js +21 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/input.js +45 -0
- package/dist/core/input.js.map +1 -0
- package/dist/core/machine.js +1021 -0
- package/dist/core/machine.js.map +1 -0
- package/dist/core/model.js +460 -0
- package/dist/core/model.js.map +1 -0
- package/dist/core/observer.js +193 -0
- package/dist/core/observer.js.map +1 -0
- package/dist/core/occupancy.js +63 -0
- package/dist/core/occupancy.js.map +1 -0
- package/dist/core/permissions.js +222 -0
- package/dist/core/permissions.js.map +1 -0
- package/dist/core/plan.js +99 -0
- package/dist/core/plan.js.map +1 -0
- package/dist/core/progress.js +43 -0
- package/dist/core/progress.js.map +1 -0
- package/dist/core/questions.js +19 -0
- package/dist/core/questions.js.map +1 -0
- package/dist/core/queue.js +859 -0
- package/dist/core/queue.js.map +1 -0
- package/dist/core/retryable.js +8 -0
- package/dist/core/retryable.js.map +1 -0
- package/dist/core/scheduler.js +160 -0
- package/dist/core/scheduler.js.map +1 -0
- package/dist/core/skip.js +109 -0
- package/dist/core/skip.js.map +1 -0
- package/dist/core/stages.js +304 -0
- package/dist/core/stages.js.map +1 -0
- package/dist/core/summary.js +35 -0
- package/dist/core/summary.js.map +1 -0
- package/dist/core/tags.js +184 -0
- package/dist/core/tags.js.map +1 -0
- package/dist/core/topology.js +162 -0
- package/dist/core/topology.js.map +1 -0
- package/dist/daemon/artifacts.js +84 -0
- package/dist/daemon/artifacts.js.map +1 -0
- package/dist/daemon/daemon.js +1442 -0
- package/dist/daemon/daemon.js.map +1 -0
- package/dist/daemon/executor.js +749 -0
- package/dist/daemon/executor.js.map +1 -0
- package/dist/daemon/helpers.js +38 -0
- package/dist/daemon/helpers.js.map +1 -0
- package/dist/daemon/index.js +4 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/logs.js +69 -0
- package/dist/daemon/logs.js.map +1 -0
- package/dist/daemon/observers.js +93 -0
- package/dist/daemon/observers.js.map +1 -0
- package/dist/daemon/patches.js +76 -0
- package/dist/daemon/patches.js.map +1 -0
- package/dist/daemon/ports.js +2 -0
- package/dist/daemon/ports.js.map +1 -0
- package/dist/daemon/processes.js +98 -0
- package/dist/daemon/processes.js.map +1 -0
- package/dist/daemon/repositories.js +2 -0
- package/dist/daemon/repositories.js.map +1 -0
- package/dist/daemon/server.js +164 -0
- package/dist/daemon/server.js.map +1 -0
- package/dist/daemon/supervisor.js +140 -0
- package/dist/daemon/supervisor.js.map +1 -0
- package/dist/daemon/timings.js +23 -0
- package/dist/daemon/timings.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 +114 -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 +5 -0
- package/dist/feature/agents/clients/claude/index.js.map +1 -0
- package/dist/feature/agents/clients/claude/parser.js +221 -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 +116 -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 +4 -0
- package/dist/feature/agents/clients/opencode/index.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 +129 -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/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 +38 -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 +12 -0
- package/dist/feature/agents/types/index.js.map +1 -0
- package/dist/feature/agents/types/message.js +48 -0
- package/dist/feature/agents/types/message.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 +20 -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/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 +28 -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 +178 -0
- package/dist/feature/observers/services/observers.js.map +1 -0
- package/dist/feature/observers/services/settings-check.js +93 -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 +109 -0
- package/dist/feature/observers/types/plan-repairs.js.map +1 -0
- package/dist/feature/observers/types/settings.js +13 -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 +153 -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 +183 -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 +182 -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 +207 -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 +111 -0
- package/dist/feature/runs/machine/plan.js.map +1 -0
- package/dist/feature/runs/machine/repair.js +155 -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 +119 -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 +113 -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 +42 -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 +43 -0
- package/dist/feature/runs/services/create.js.map +1 -0
- package/dist/feature/runs/services/effects/actions.js +150 -0
- package/dist/feature/runs/services/effects/actions.js.map +1 -0
- package/dist/feature/runs/services/effects/attempts.js +179 -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 +62 -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/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 +163 -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 +54 -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 +102 -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 +57 -0
- package/dist/feature/runs/types/input.js.map +1 -0
- package/dist/feature/runs/types/limits.js +151 -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/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 +9 -0
- package/dist/feature/swarm-config/services/index.js.map +1 -0
- package/dist/feature/swarm-config/services/load.js +86 -0
- package/dist/feature/swarm-config/services/load.js.map +1 -0
- package/dist/feature/swarm-config/services/settings.js +50 -0
- package/dist/feature/swarm-config/services/settings.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-actions.js +117 -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 +212 -0
- package/dist/feature/swarm-config/services/validate-runtimes.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-settings.js +177 -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 +174 -0
- package/dist/feature/swarm-config/services/validate.js.map +1 -0
- package/dist/feature/swarm-config/types/action.js +11 -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 +116 -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 +116 -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 +143 -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 +198 -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 +64 -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/git/delivery.js +284 -0
- package/dist/git/delivery.js.map +1 -0
- package/dist/git/index.js +4 -0
- package/dist/git/index.js.map +1 -0
- package/dist/git/runner.js +60 -0
- package/dist/git/runner.js.map +1 -0
- package/dist/git/workspace.js +366 -0
- package/dist/git/workspace.js.map +1 -0
- package/dist/mcp/host.js +401 -0
- package/dist/mcp/host.js.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/tools.js +19 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/version.js +5 -0
- package/dist/mcp/version.js.map +1 -0
- package/dist/mcp/worker.js +230 -0
- package/dist/mcp/worker.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/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/index.js +3 -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 +297 -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/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/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 +207 -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 +76 -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 +7 -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 +202 -0
- package/dist/presentation/format/runs.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 +79 -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 +141 -0
- package/dist/presentation/ipc/contract/config.js.map +1 -0
- package/dist/presentation/ipc/contract/envelope.js +97 -0
- package/dist/presentation/ipc/contract/envelope.js.map +1 -0
- package/dist/presentation/ipc/contract/groups.js +48 -0
- package/dist/presentation/ipc/contract/groups.js.map +1 -0
- package/dist/presentation/ipc/contract/index.js +14 -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 +53 -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 +11 -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/tags.js +2 -0
- package/dist/presentation/ipc/contract/responses/tags.js.map +1 -0
- package/dist/presentation/ipc/contract/runs.js +112 -0
- package/dist/presentation/ipc/contract/runs.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 +38 -0
- package/dist/presentation/ipc/handlers/config.js.map +1 -0
- package/dist/presentation/ipc/handlers/groups.js +14 -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/system.js +38 -0
- package/dist/presentation/ipc/handlers/system.js.map +1 -0
- package/dist/presentation/ipc/handlers/table.js +23 -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 +175 -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 +10 -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 +151 -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/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-tools.js +107 -0
- package/dist/presentation/mcp/worker-tools.js.map +1 -0
- package/dist/presentation/mcp/worker.js +12 -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 +164 -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 +66 -0
- package/dist/presentation/web/panel/system.js.map +1 -0
- package/dist/presentation/web/request.js +123 -0
- package/dist/presentation/web/request.js.map +1 -0
- package/dist/presentation/web/routes/config.js +166 -0
- package/dist/presentation/web/routes/config.js.map +1 -0
- package/dist/presentation/web/routes/directories.js +60 -0
- package/dist/presentation/web/routes/directories.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/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 +185 -0
- package/dist/presentation/web/server.js.map +1 -0
- package/dist/protocol/autostart.js +171 -0
- package/dist/protocol/autostart.js.map +1 -0
- package/dist/protocol/build.js +38 -0
- package/dist/protocol/build.js.map +1 -0
- package/dist/protocol/catalog.js +18 -0
- package/dist/protocol/catalog.js.map +1 -0
- package/dist/protocol/client.js +83 -0
- package/dist/protocol/client.js.map +1 -0
- package/dist/protocol/format.js +477 -0
- package/dist/protocol/format.js.map +1 -0
- package/dist/protocol/index.js +11 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/messages.js +598 -0
- package/dist/protocol/messages.js.map +1 -0
- package/dist/protocol/style.js +81 -0
- package/dist/protocol/style.js.map +1 -0
- package/dist/protocol/transcript.js +49 -0
- package/dist/protocol/transcript.js.map +1 -0
- package/dist/protocol/views.js +696 -0
- package/dist/protocol/views.js.map +1 -0
- package/dist/runtime/catalog.js +117 -0
- package/dist/runtime/catalog.js.map +1 -0
- package/dist/runtime/claude.js +399 -0
- package/dist/runtime/claude.js.map +1 -0
- package/dist/runtime/index.js +34 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/message.js +48 -0
- package/dist/runtime/message.js.map +1 -0
- package/dist/runtime/naming.js +69 -0
- package/dist/runtime/naming.js.map +1 -0
- package/dist/runtime/opencode.js +189 -0
- package/dist/runtime/opencode.js.map +1 -0
- package/dist/runtime/skills.js +17 -0
- package/dist/runtime/skills.js.map +1 -0
- package/dist/runtime/transcript.js +227 -0
- package/dist/runtime/transcript.js.map +1 -0
- package/dist/runtime/types.js +12 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/runtime/which.js +21 -0
- package/dist/runtime/which.js.map +1 -0
- package/dist/store/index.js +3 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/schema.js +286 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/store.js +491 -0
- package/dist/store/store.js.map +1 -0
- package/dist/web/assets/EntryList-CnfGgjEY.js +1 -0
- package/dist/web/assets/FilePath-C0X8-keS.js +1 -0
- package/dist/web/assets/SettingsForm-BcyBWJbn.js +1 -0
- package/dist/web/assets/SharedPipelinesGroup-a368-IQ0.js +1 -0
- package/dist/web/assets/card-DkikoTxR.js +1 -0
- package/dist/web/assets/deliveryModes-funlvXVC.js +1 -0
- package/dist/web/assets/index-B-oJ93zH.js +22 -0
- package/dist/web/assets/index-BZE36gYR.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-DtRrxYzg.js +1 -0
- package/dist/web/assets/pipelines-D48ggDNe.js +1 -0
- package/dist/web/assets/queue-D8_RY4IY.js +16 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/select-J4oIrmYh.js +1 -0
- package/dist/web/assets/settings-B0-0Vaia.js +2 -0
- package/dist/web/assets/skeleton-CCKCQF5n.js +1 -0
- package/dist/web/assets/specialists-DH8tyluO.js +1 -0
- package/dist/web/assets/switch-CWFAgxG1.js +41 -0
- package/dist/web/assets/topology-CNQ28AB2.js +7 -0
- package/dist/web/assets/topology-DLioOiRN.css +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 +21 -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,749 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { appendFileSync, mkdirSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { isAbsolute, join, relative, sep } from 'node:path';
|
|
5
|
+
import { ConfigLoadError } from '../feature/swarm-config/types/index.js';
|
|
6
|
+
import { configPaths, loadRuntimeSettings } from '../feature/swarm-config/services/index.js';
|
|
7
|
+
import { REPAIR_GROUP, RESOLVE_GROUP, SPLIT_GROUP, findGroup, isRepairGroup, isResolveGroup, specialistOfStep, groupRef, runRef, isServiceGroup, actionGroupsOf, actionOf, actionPointOf, deliveryBranch, parseActionSlug, } from '../feature/runs/types/index.js';
|
|
8
|
+
import { RUN_WORKTREE, attemptDirectory, changedFiles, changedPaths, hashFiles, under, cleanRun, commitAll, commitResolve, deliver, filesWithMarkers, git, prepareResolve, commitMessage, ensureWorktree, mergeBranch, runWorktreeRoot, snapshotWorkingCopy, updateFromBranch, workspaceRoot, } from '../platform/git/index.js';
|
|
9
|
+
import { answerText, missingSkills, namingPrompt, parseNaming, runtimeFor, } from '../runtime/index.js';
|
|
10
|
+
import { findExecutable } from '../platform/process/index.js';
|
|
11
|
+
import { timesPath } from './logs.js';
|
|
12
|
+
import { launchProcess } from './supervisor.js';
|
|
13
|
+
export const NAMING_TIMEOUT_MS = 60_000;
|
|
14
|
+
/** The live usage of a run reaches its state at most once per interval. */
|
|
15
|
+
export const USAGE_INTERVAL_MS = 1_000;
|
|
16
|
+
function deliveredPaths(result) {
|
|
17
|
+
return result.kind === 'applied' ? [...new Set([...result.files, ...result.conflicts])] : [];
|
|
18
|
+
}
|
|
19
|
+
function keyOf(key) {
|
|
20
|
+
return `${key.run}/${key.group}/${key.seq}`;
|
|
21
|
+
}
|
|
22
|
+
export class Executor {
|
|
23
|
+
host;
|
|
24
|
+
entry;
|
|
25
|
+
graceMs;
|
|
26
|
+
timings;
|
|
27
|
+
tokens = new Map();
|
|
28
|
+
running = new Map();
|
|
29
|
+
keys = new Map();
|
|
30
|
+
naming = new Map();
|
|
31
|
+
/** Working copy of the repository as it was when each running attempt started. */
|
|
32
|
+
baselines = new Map();
|
|
33
|
+
/** Live usage of running attempts waiting for the next flush, by run. */
|
|
34
|
+
usageBuffers = new Map();
|
|
35
|
+
constructor(options) {
|
|
36
|
+
this.host = options.host;
|
|
37
|
+
this.entry = options.entry;
|
|
38
|
+
this.graceMs = options.graceMs;
|
|
39
|
+
this.timings = options.timings;
|
|
40
|
+
}
|
|
41
|
+
/** Agents that run now: running attempts and the naming of runs. */
|
|
42
|
+
agentRoots() {
|
|
43
|
+
const roots = [];
|
|
44
|
+
for (const [id, running] of this.running) {
|
|
45
|
+
const pid = running.process.pid;
|
|
46
|
+
if (pid === undefined)
|
|
47
|
+
continue;
|
|
48
|
+
const key = this.keys.get(id);
|
|
49
|
+
if (key)
|
|
50
|
+
roots.push({ pid, run: key.run, group: key.group, seq: key.seq });
|
|
51
|
+
}
|
|
52
|
+
for (const [process, run] of this.naming) {
|
|
53
|
+
if (process.pid !== undefined)
|
|
54
|
+
roots.push({ pid: process.pid, run, group: null, seq: null });
|
|
55
|
+
}
|
|
56
|
+
return roots;
|
|
57
|
+
}
|
|
58
|
+
attemptFor(token) {
|
|
59
|
+
return this.tokens.get(token);
|
|
60
|
+
}
|
|
61
|
+
workspace(state) {
|
|
62
|
+
return workspaceRoot(state.run.repository, state.run.config.workspaceDir);
|
|
63
|
+
}
|
|
64
|
+
worktreePath(state, group) {
|
|
65
|
+
// The repair group is checked first: it is a service group, but it never works in the run tree.
|
|
66
|
+
if (isRepairGroup(group) && state.run.pendingDelivery?.repair) {
|
|
67
|
+
return this.resolveWorktree(state);
|
|
68
|
+
}
|
|
69
|
+
const name = isRepairGroup(group)
|
|
70
|
+
? REPAIR_GROUP
|
|
71
|
+
: isResolveGroup(group)
|
|
72
|
+
? RESOLVE_GROUP
|
|
73
|
+
: isServiceGroup(group)
|
|
74
|
+
? RUN_WORKTREE
|
|
75
|
+
: group.slug;
|
|
76
|
+
return join(runWorktreeRoot(this.workspace(state), state.run.id), name);
|
|
77
|
+
}
|
|
78
|
+
logPath(state, group, seq) {
|
|
79
|
+
return join(attemptDirectory(this.workspace(state), state.run.id, group, seq), 'output.log');
|
|
80
|
+
}
|
|
81
|
+
/** A specialist or the naming of a run is running. */
|
|
82
|
+
busy() {
|
|
83
|
+
return this.running.size > 0 || this.naming.size > 0;
|
|
84
|
+
}
|
|
85
|
+
reportUsage(state, key, usage) {
|
|
86
|
+
if (this.host.stopping)
|
|
87
|
+
return;
|
|
88
|
+
let buffer = this.usageBuffers.get(key.run);
|
|
89
|
+
if (!buffer) {
|
|
90
|
+
buffer = { state, pending: new Map(), timer: null };
|
|
91
|
+
this.usageBuffers.set(key.run, buffer);
|
|
92
|
+
}
|
|
93
|
+
buffer.pending.set(keyOf(key), { group: key.group, seq: key.seq, usage });
|
|
94
|
+
// Leading edge: with no timer running the value goes at once; the timer holds back the rest.
|
|
95
|
+
if (buffer.timer === null)
|
|
96
|
+
this.flushUsage(key.run);
|
|
97
|
+
}
|
|
98
|
+
flushUsage(run) {
|
|
99
|
+
const buffer = this.usageBuffers.get(run);
|
|
100
|
+
if (!buffer)
|
|
101
|
+
return;
|
|
102
|
+
if (buffer.timer !== null) {
|
|
103
|
+
clearTimeout(buffer.timer);
|
|
104
|
+
buffer.timer = null;
|
|
105
|
+
}
|
|
106
|
+
if (buffer.pending.size === 0) {
|
|
107
|
+
this.usageBuffers.delete(run);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const updates = [...buffer.pending.values()];
|
|
111
|
+
buffer.pending.clear();
|
|
112
|
+
buffer.timer = setTimeout(() => this.flushUsage(run), this.timings.usageIntervalMs);
|
|
113
|
+
buffer.timer.unref();
|
|
114
|
+
void this.host
|
|
115
|
+
.serial(() => {
|
|
116
|
+
if (this.host.stopping)
|
|
117
|
+
return Promise.resolve();
|
|
118
|
+
return this.host.apply(buffer.state, { kind: 'attempt_usage', updates });
|
|
119
|
+
})
|
|
120
|
+
.catch(() => undefined);
|
|
121
|
+
}
|
|
122
|
+
dropUsage(key) {
|
|
123
|
+
const buffer = this.usageBuffers.get(key.run);
|
|
124
|
+
buffer?.pending.delete(keyOf(key));
|
|
125
|
+
}
|
|
126
|
+
async stopAll() {
|
|
127
|
+
for (const buffer of this.usageBuffers.values()) {
|
|
128
|
+
if (buffer.timer !== null)
|
|
129
|
+
clearTimeout(buffer.timer);
|
|
130
|
+
}
|
|
131
|
+
this.usageBuffers.clear();
|
|
132
|
+
const exits = [...this.running.values()].map((running) => {
|
|
133
|
+
clearTimeout(running.timer);
|
|
134
|
+
running.process.stop();
|
|
135
|
+
return running.process.exited;
|
|
136
|
+
});
|
|
137
|
+
for (const process of this.naming.keys()) {
|
|
138
|
+
process.stop();
|
|
139
|
+
exits.push(process.exited);
|
|
140
|
+
}
|
|
141
|
+
await Promise.allSettled(exits);
|
|
142
|
+
}
|
|
143
|
+
async perform(state, effects) {
|
|
144
|
+
for (const effect of effects) {
|
|
145
|
+
switch (effect.kind) {
|
|
146
|
+
case 'start_attempt':
|
|
147
|
+
await this.start(state, effect.group, effect.seq);
|
|
148
|
+
break;
|
|
149
|
+
case 'stop_attempt': {
|
|
150
|
+
const running = this.running.get(keyOf({ run: effect.run, group: effect.group, seq: effect.seq }));
|
|
151
|
+
if (running) {
|
|
152
|
+
clearTimeout(running.timer);
|
|
153
|
+
running.process.stop();
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
case 'run_action':
|
|
158
|
+
await this.runAction(state, effect.group, effect.seq);
|
|
159
|
+
break;
|
|
160
|
+
case 'commit':
|
|
161
|
+
await this.commit(state, effect.group, effect.stepId, effect.summary);
|
|
162
|
+
break;
|
|
163
|
+
case 'merge':
|
|
164
|
+
await this.merge(state, effect.group, effect.updateOnConflict);
|
|
165
|
+
break;
|
|
166
|
+
case 'deliver':
|
|
167
|
+
await this.deliver(state, effect.groups, effect.force, effect.message);
|
|
168
|
+
break;
|
|
169
|
+
case 'cleanup':
|
|
170
|
+
await this.cleanup(state);
|
|
171
|
+
break;
|
|
172
|
+
case 'prepare_resolve':
|
|
173
|
+
await this.prepareResolve(state, effect.groups);
|
|
174
|
+
break;
|
|
175
|
+
case 'finish_resolve':
|
|
176
|
+
await this.finishResolve(state, effect.message, effect.conflicts);
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/** The environment of a command action. */
|
|
182
|
+
actionEnvironment(state, group) {
|
|
183
|
+
const ref = parseActionSlug(group.slug);
|
|
184
|
+
const { run } = state;
|
|
185
|
+
const environment = {
|
|
186
|
+
AIP_RUN_ID: run.id,
|
|
187
|
+
AIP_RUN_TITLE: run.title ?? '',
|
|
188
|
+
AIP_PIPELINE: run.pipeline,
|
|
189
|
+
// The name before the term was unified; scripts in user repositories still read it.
|
|
190
|
+
AIP_WORKFLOW: run.pipeline,
|
|
191
|
+
AIP_STAGE: ref?.point ?? '',
|
|
192
|
+
AIP_ACTION: ref?.id ?? '',
|
|
193
|
+
AIP_REPOSITORY: run.repository,
|
|
194
|
+
};
|
|
195
|
+
if (ref?.point === 'after_delivery') {
|
|
196
|
+
const delivered = state.groups.filter((candidate) => candidate.status === 'merged' && candidate.delivery.state === 'applied');
|
|
197
|
+
const last = [...delivered]
|
|
198
|
+
.filter((candidate) => candidate.delivery.message)
|
|
199
|
+
.sort((left, right) => (right.delivery.finishedAt ?? 0) - (left.delivery.finishedAt ?? 0))[0];
|
|
200
|
+
environment.AIP_DELIVERY_MODE = run.config.delivery.mode;
|
|
201
|
+
environment.AIP_COMMIT_MESSAGE = last?.delivery.message ?? '';
|
|
202
|
+
environment.AIP_CHANGED_FILES = [
|
|
203
|
+
...new Set(delivered.flatMap((candidate) => candidate.delivery.files)),
|
|
204
|
+
].join('\n');
|
|
205
|
+
}
|
|
206
|
+
return environment;
|
|
207
|
+
}
|
|
208
|
+
/** Where a command action runs: the tree of the run, or the repository of the user after delivery. */
|
|
209
|
+
async actionDirectory(state, group) {
|
|
210
|
+
if (actionPointOf(group) === 'after_delivery')
|
|
211
|
+
return state.run.repository;
|
|
212
|
+
return this.ensureGroupWorktree(state, group);
|
|
213
|
+
}
|
|
214
|
+
/** The command of an action before delivery must not change the result: drop what it wrote. */
|
|
215
|
+
async discardChanges(state, group) {
|
|
216
|
+
// A repair works on a copy of the ref of the run: what it leaves there is dropped. The tree of
|
|
217
|
+
// a delivery repair is the resolver's and is kept for the delivery.
|
|
218
|
+
const repairCopy = isRepairGroup(group) && !state.run.pendingDelivery?.repair;
|
|
219
|
+
if (actionPointOf(group) !== 'before_delivery' && !repairCopy)
|
|
220
|
+
return;
|
|
221
|
+
try {
|
|
222
|
+
await this.resetRunTree(state, await this.ensureGroupWorktree(state, group));
|
|
223
|
+
}
|
|
224
|
+
catch {
|
|
225
|
+
// The tree may be gone with a cleaned run; there is nothing to drop then.
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/** The tree sits on a detached HEAD: a commit of an action moves it, so reset to the ref of the run. */
|
|
229
|
+
async resetRunTree(state, tree) {
|
|
230
|
+
await git(tree, 'reset', '--hard', runRef(state.run));
|
|
231
|
+
await git(tree, 'clean', '-fd');
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* A merge goes on the ref of the run, never on what a check left in the tree: a stopped check
|
|
235
|
+
* may still be working there, and one cut off by a restart never dropped its changes.
|
|
236
|
+
*/
|
|
237
|
+
async settleChecks(state, tree) {
|
|
238
|
+
const checks = actionGroupsOf(state, 'before_delivery');
|
|
239
|
+
if (checks.length === 0)
|
|
240
|
+
return;
|
|
241
|
+
const keys = checks.flatMap((group) => group.attempts.map((attempt) => keyOf({ run: state.run.id, group: group.slug, seq: attempt.seq })));
|
|
242
|
+
// The process itself: its exit handler waits in the same queue as this merge.
|
|
243
|
+
await Promise.allSettled(keys.map((key) => this.running.get(key)?.process.exited));
|
|
244
|
+
await this.resetRunTree(state, tree);
|
|
245
|
+
}
|
|
246
|
+
async runAction(state, slug, seq) {
|
|
247
|
+
const group = findGroup(state, slug);
|
|
248
|
+
const attempt = group?.attempts.find((candidate) => candidate.seq === seq);
|
|
249
|
+
const action = group ? actionOf(state.run, group) : undefined;
|
|
250
|
+
if (!group || !attempt || !action || action.run === null)
|
|
251
|
+
return;
|
|
252
|
+
const key = { run: state.run.id, group: slug, seq };
|
|
253
|
+
const finish = async (outcome) => {
|
|
254
|
+
await this.discardChanges(state, group);
|
|
255
|
+
await this.host.apply(state, { kind: 'action_finished', group: slug, seq, outcome });
|
|
256
|
+
};
|
|
257
|
+
let directory;
|
|
258
|
+
try {
|
|
259
|
+
// Leftovers of an interrupted check must not reach this one.
|
|
260
|
+
await this.discardChanges(state, group);
|
|
261
|
+
directory = await this.actionDirectory(state, group);
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
await finish({ kind: 'spawn', message: error.message });
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const logPath = this.logPath(state, slug, seq);
|
|
268
|
+
mkdirSync(attemptDirectory(this.workspace(state), state.run.id, slug, seq), {
|
|
269
|
+
recursive: true,
|
|
270
|
+
});
|
|
271
|
+
appendFileSync(logPath, `[aip] $ ${action.run}\n`);
|
|
272
|
+
const quiet = {
|
|
273
|
+
push() { },
|
|
274
|
+
usage: () => null,
|
|
275
|
+
outcome: () => ({ sessionId: null, usage: null, error: null, denials: [] }),
|
|
276
|
+
};
|
|
277
|
+
const process = launchProcess({
|
|
278
|
+
command: '/bin/sh',
|
|
279
|
+
args: ['-c', action.run],
|
|
280
|
+
env: this.actionEnvironment(state, group),
|
|
281
|
+
files: [],
|
|
282
|
+
sessionId: null,
|
|
283
|
+
}, {
|
|
284
|
+
cwd: directory,
|
|
285
|
+
logPath,
|
|
286
|
+
parser: quiet,
|
|
287
|
+
environment: this.host.environment,
|
|
288
|
+
graceMs: this.graceMs,
|
|
289
|
+
drainMs: this.timings.drainMs,
|
|
290
|
+
timesPath: timesPath(logPath),
|
|
291
|
+
});
|
|
292
|
+
let timedOut = false;
|
|
293
|
+
const timer = setTimeout(() => {
|
|
294
|
+
timedOut = true;
|
|
295
|
+
process.stop();
|
|
296
|
+
}, action.timeoutSeconds * this.timings.timeoutUnitMs);
|
|
297
|
+
this.running.set(keyOf(key), { process, timer });
|
|
298
|
+
this.keys.set(keyOf(key), key);
|
|
299
|
+
void process.exited.then((exit) => {
|
|
300
|
+
clearTimeout(timer);
|
|
301
|
+
this.running.delete(keyOf(key));
|
|
302
|
+
this.keys.delete(keyOf(key));
|
|
303
|
+
if (process.pid !== undefined) {
|
|
304
|
+
this.host.agentGone({ pid: process.pid, run: key.run, group: key.group, seq: key.seq });
|
|
305
|
+
}
|
|
306
|
+
// A stopping daemon leaves the attempt running: the next start marks it interrupted.
|
|
307
|
+
if (this.host.stopping)
|
|
308
|
+
return undefined;
|
|
309
|
+
const outcome = exit.spawnError
|
|
310
|
+
? { kind: 'spawn', message: exit.spawnError }
|
|
311
|
+
: timedOut
|
|
312
|
+
? { kind: 'timeout' }
|
|
313
|
+
: { kind: 'exit', code: exit.code ?? 1 };
|
|
314
|
+
return this.host.serial(() => finish(outcome));
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
/** Asks a cheap model for the title and the name of a run, in the background. */
|
|
318
|
+
async nameRun(state) {
|
|
319
|
+
const { naming } = state.run.config;
|
|
320
|
+
const settings = this.runtimeSettings(state);
|
|
321
|
+
if (typeof settings === 'string')
|
|
322
|
+
return;
|
|
323
|
+
const runtime = runtimeFor(naming.runtime, this.host.environment, settings);
|
|
324
|
+
if (!findExecutable(runtime.executable, this.host.environment.PATH))
|
|
325
|
+
return;
|
|
326
|
+
const directory = join(this.workspace(state), 'logs', state.run.id, '_naming');
|
|
327
|
+
const logPath = join(directory, 'output.log');
|
|
328
|
+
const task = state.split?.task ?? state.groups.map((group) => group.task).join('\n\n');
|
|
329
|
+
const launch = runtime.buildOneShot({
|
|
330
|
+
prompt: namingPrompt(task),
|
|
331
|
+
model: naming.model,
|
|
332
|
+
directory,
|
|
333
|
+
});
|
|
334
|
+
mkdirSync(directory, { recursive: true });
|
|
335
|
+
const process = launchProcess(launch, {
|
|
336
|
+
cwd: directory,
|
|
337
|
+
logPath,
|
|
338
|
+
parser: runtime.createParser(),
|
|
339
|
+
environment: this.host.environment,
|
|
340
|
+
graceMs: this.graceMs,
|
|
341
|
+
drainMs: this.timings.drainMs,
|
|
342
|
+
});
|
|
343
|
+
this.naming.set(process, state.run.id);
|
|
344
|
+
const timer = setTimeout(() => process.stop(), this.timings.namingTimeoutMs);
|
|
345
|
+
const exit = await process.exited;
|
|
346
|
+
clearTimeout(timer);
|
|
347
|
+
this.naming.delete(process);
|
|
348
|
+
if (process.pid !== undefined) {
|
|
349
|
+
this.host.agentGone({ pid: process.pid, run: state.run.id, group: null, seq: null });
|
|
350
|
+
}
|
|
351
|
+
if (this.host.stopping)
|
|
352
|
+
return;
|
|
353
|
+
let lines = [];
|
|
354
|
+
try {
|
|
355
|
+
lines = readFileSync(logPath, 'utf8').split('\n');
|
|
356
|
+
}
|
|
357
|
+
catch {
|
|
358
|
+
// no output
|
|
359
|
+
}
|
|
360
|
+
const named = exit.code === 0 ? parseNaming(answerText(runtime.transcript(lines))) : null;
|
|
361
|
+
await this.host.serial(() => this.host.apply(state, {
|
|
362
|
+
kind: 'run_named',
|
|
363
|
+
title: named?.title ?? null,
|
|
364
|
+
name: named?.name ?? null,
|
|
365
|
+
usage: exit.outcome.usage,
|
|
366
|
+
}));
|
|
367
|
+
}
|
|
368
|
+
async ensureGroupWorktree(state, group) {
|
|
369
|
+
const { repository } = state.run;
|
|
370
|
+
const branch = runRef(state.run);
|
|
371
|
+
const runTree = await ensureWorktree(repository, join(runWorktreeRoot(this.workspace(state), state.run.id), RUN_WORKTREE), branch, null);
|
|
372
|
+
if (isRepairGroup(group)) {
|
|
373
|
+
if (state.run.pendingDelivery?.repair)
|
|
374
|
+
return this.worktreePath(state, group);
|
|
375
|
+
return ensureWorktree(repository, this.worktreePath(state, group), branch, null);
|
|
376
|
+
}
|
|
377
|
+
if (isResolveGroup(group))
|
|
378
|
+
return this.worktreePath(state, group);
|
|
379
|
+
if (isServiceGroup(group))
|
|
380
|
+
return runTree;
|
|
381
|
+
return ensureWorktree(repository, this.worktreePath(state, group), groupRef(state.run, group.slug), branch);
|
|
382
|
+
}
|
|
383
|
+
/** Current `runtimes` of the shared settings.yaml, or the text of the error in it. */
|
|
384
|
+
runtimeSettings(state) {
|
|
385
|
+
const { XDG_CONFIG_HOME, HOME } = this.host.environment;
|
|
386
|
+
try {
|
|
387
|
+
return loadRuntimeSettings(configPaths(state.run.repository, XDG_CONFIG_HOME, HOME));
|
|
388
|
+
}
|
|
389
|
+
catch (error) {
|
|
390
|
+
if (!(error instanceof ConfigLoadError))
|
|
391
|
+
throw error;
|
|
392
|
+
return `invalid swarm.runtimes: ${error.message}`;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
async start(state, slug, seq) {
|
|
396
|
+
const group = findGroup(state, slug);
|
|
397
|
+
const attempt = group?.attempts.find((candidate) => candidate.seq === seq);
|
|
398
|
+
if (!group || !attempt || attempt.runtime === 'command')
|
|
399
|
+
return;
|
|
400
|
+
const key = { run: state.run.id, group: slug, seq };
|
|
401
|
+
const settings = this.runtimeSettings(state);
|
|
402
|
+
if (typeof settings === 'string') {
|
|
403
|
+
await this.exit(state, key, { kind: 'spawn', message: settings });
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
const runtime = runtimeFor(attempt.runtime, this.host.environment, settings);
|
|
407
|
+
if (!findExecutable(runtime.executable, this.host.environment.PATH)) {
|
|
408
|
+
await this.exit(state, key, { kind: 'runtime_not_found', runtime: attempt.runtime });
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
let worktree;
|
|
412
|
+
try {
|
|
413
|
+
worktree = await this.ensureGroupWorktree(state, group);
|
|
414
|
+
}
|
|
415
|
+
catch (error) {
|
|
416
|
+
await this.exit(state, key, { kind: 'git', message: error.message });
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
// Leftovers of an interrupted check must not reach this one.
|
|
420
|
+
await this.discardChanges(state, group);
|
|
421
|
+
// The observer works from the snapshot of its profile, which is not in the configuration.
|
|
422
|
+
const specialist = specialistOfStep(state.run, group, attempt.specialist);
|
|
423
|
+
if (!specialist) {
|
|
424
|
+
if (isRepairGroup(group)) {
|
|
425
|
+
await this.exit(state, key, { kind: 'spawn', message: 'the observer has no profile' });
|
|
426
|
+
}
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
const directory = attemptDirectory(this.workspace(state), state.run.id, slug, seq);
|
|
430
|
+
const logPath = this.logPath(state, slug, seq);
|
|
431
|
+
mkdirSync(directory, { recursive: true });
|
|
432
|
+
for (const skill of missingSkills(specialist.skills, runtime.skillDirectories(worktree, homedir()))) {
|
|
433
|
+
appendFileSync(logPath, `[aip] warning: skill not found: ${skill}\n`);
|
|
434
|
+
}
|
|
435
|
+
const token = randomUUID();
|
|
436
|
+
this.tokens.set(token, key);
|
|
437
|
+
const exclude = this.excluded(state);
|
|
438
|
+
const before = await this.snapshot(state, exclude);
|
|
439
|
+
if (before) {
|
|
440
|
+
this.baselines.set(keyOf(key), {
|
|
441
|
+
repository: state.run.repository,
|
|
442
|
+
exclude,
|
|
443
|
+
snapshot: before,
|
|
444
|
+
overrides: new Map(),
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
const launch = runtime.buildLaunch({
|
|
448
|
+
specialist,
|
|
449
|
+
input: attempt.input,
|
|
450
|
+
worktree,
|
|
451
|
+
attemptDirectory: directory,
|
|
452
|
+
workerCommand: [
|
|
453
|
+
...this.entry,
|
|
454
|
+
'mcp',
|
|
455
|
+
'--worker',
|
|
456
|
+
token,
|
|
457
|
+
'--socket',
|
|
458
|
+
this.host.socket,
|
|
459
|
+
...(slug === SPLIT_GROUP ? ['--split'] : []),
|
|
460
|
+
...(specialist.queue === true ? ['--queue'] : []),
|
|
461
|
+
...(isRepairGroup(group) ? ['--repair'] : []),
|
|
462
|
+
],
|
|
463
|
+
sessionId: randomUUID(),
|
|
464
|
+
resumeSession: attempt.resumeSession,
|
|
465
|
+
claudeEditMode: state.run.config.claude.editMode,
|
|
466
|
+
claudeMcp: state.run.config.claude.mcp,
|
|
467
|
+
claudeSettings: state.run.config.claude.settings,
|
|
468
|
+
});
|
|
469
|
+
if (launch.sessionId)
|
|
470
|
+
attempt.sessionId = launch.sessionId;
|
|
471
|
+
this.host.save(state);
|
|
472
|
+
const process = launchProcess(launch, {
|
|
473
|
+
cwd: worktree,
|
|
474
|
+
logPath,
|
|
475
|
+
parser: runtime.createParser(),
|
|
476
|
+
environment: this.host.environment,
|
|
477
|
+
graceMs: this.graceMs,
|
|
478
|
+
drainMs: this.timings.drainMs,
|
|
479
|
+
timesPath: timesPath(logPath),
|
|
480
|
+
onUsage: (usage) => this.reportUsage(state, key, usage),
|
|
481
|
+
});
|
|
482
|
+
const timer = setTimeout(() => {
|
|
483
|
+
if (this.host.stopping)
|
|
484
|
+
return;
|
|
485
|
+
void this.host.serial(() => this.host.apply(state, { kind: 'timed_out', group: slug, seq }));
|
|
486
|
+
}, specialist.timeoutSeconds * this.timings.timeoutUnitMs);
|
|
487
|
+
this.running.set(keyOf(key), { process, timer });
|
|
488
|
+
this.keys.set(keyOf(key), key);
|
|
489
|
+
void process.exited.then((exit) => {
|
|
490
|
+
clearTimeout(timer);
|
|
491
|
+
this.dropUsage(key);
|
|
492
|
+
this.running.delete(keyOf(key));
|
|
493
|
+
this.keys.delete(keyOf(key));
|
|
494
|
+
if (process.pid !== undefined) {
|
|
495
|
+
this.host.agentGone({ pid: process.pid, run: key.run, group: key.group, seq: key.seq });
|
|
496
|
+
}
|
|
497
|
+
this.tokens.delete(token);
|
|
498
|
+
if (this.host.stopping)
|
|
499
|
+
return undefined;
|
|
500
|
+
return this.host.serial(async () => {
|
|
501
|
+
await this.discardChanges(state, group);
|
|
502
|
+
const baseline = this.baselines.get(keyOf(key));
|
|
503
|
+
this.baselines.delete(keyOf(key));
|
|
504
|
+
const after = baseline ? await this.snapshot(state, baseline.exclude) : null;
|
|
505
|
+
let outsideChanges = [];
|
|
506
|
+
if (baseline && after) {
|
|
507
|
+
try {
|
|
508
|
+
outsideChanges = await changedPaths(baseline.repository, baseline.snapshot, after, baseline.overrides);
|
|
509
|
+
}
|
|
510
|
+
catch {
|
|
511
|
+
outsideChanges = [];
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
await this.host.apply(state, {
|
|
515
|
+
kind: 'attempt_exited',
|
|
516
|
+
group: slug,
|
|
517
|
+
seq,
|
|
518
|
+
exit: {
|
|
519
|
+
sessionId: exit.outcome.sessionId,
|
|
520
|
+
usage: exit.outcome.usage,
|
|
521
|
+
failure: exit.spawnError
|
|
522
|
+
? { kind: 'spawn', message: exit.spawnError }
|
|
523
|
+
: exit.outcome.usageLimit
|
|
524
|
+
? { kind: 'usage_limit', resetsAt: exit.outcome.usageLimit.resetsAt }
|
|
525
|
+
: null,
|
|
526
|
+
outsideChanges,
|
|
527
|
+
denials: exit.outcome.denials,
|
|
528
|
+
onLimit: this.host.onLimitOf(state.run.repository),
|
|
529
|
+
},
|
|
530
|
+
});
|
|
531
|
+
});
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
/** The directory of the working copies, when it lies inside the repository. */
|
|
535
|
+
excluded(state) {
|
|
536
|
+
const path = relative(state.run.repository, this.workspace(state));
|
|
537
|
+
if (path === '' || path.startsWith('..') || isAbsolute(path))
|
|
538
|
+
return [];
|
|
539
|
+
return [path.split(sep).join('/')];
|
|
540
|
+
}
|
|
541
|
+
async snapshot(state, exclude) {
|
|
542
|
+
if (state.run.config.outsideChanges === 'off')
|
|
543
|
+
return null;
|
|
544
|
+
try {
|
|
545
|
+
return await snapshotWorkingCopy(state.run.repository, { exclude });
|
|
546
|
+
}
|
|
547
|
+
catch {
|
|
548
|
+
return null;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
/** Accepts what a delivery wrote into the working copy: it is not a change from outside. */
|
|
552
|
+
async rebaseOutside(state, result) {
|
|
553
|
+
// The branch mode does not touch the working copy: nothing was written there.
|
|
554
|
+
if (state.run.config.delivery.mode === 'branch')
|
|
555
|
+
return;
|
|
556
|
+
const repository = state.run.repository;
|
|
557
|
+
const paths = deliveredPaths(result);
|
|
558
|
+
const baselines = [...this.baselines.values()].filter((baseline) => baseline.repository === repository);
|
|
559
|
+
if (baselines.length === 0 || paths.length === 0)
|
|
560
|
+
return;
|
|
561
|
+
try {
|
|
562
|
+
const current = await hashFiles(repository, paths);
|
|
563
|
+
for (const baseline of baselines) {
|
|
564
|
+
for (const [path, hash] of current) {
|
|
565
|
+
if (!under(path, baseline.exclude))
|
|
566
|
+
baseline.overrides.set(path, hash);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
catch {
|
|
571
|
+
// Without the content the paths stay as they are: at worst a warning is shown.
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
async exit(state, key, failure) {
|
|
575
|
+
this.baselines.delete(keyOf(key));
|
|
576
|
+
await this.host.apply(state, {
|
|
577
|
+
kind: 'attempt_exited',
|
|
578
|
+
group: key.group,
|
|
579
|
+
seq: key.seq,
|
|
580
|
+
exit: { sessionId: null, usage: null, failure, outsideChanges: [] },
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
async commit(state, slug, stepId, summary) {
|
|
584
|
+
const group = findGroup(state, slug);
|
|
585
|
+
if (!group)
|
|
586
|
+
return;
|
|
587
|
+
try {
|
|
588
|
+
// The actions around the split change the tree of the run itself, which the groups start from.
|
|
589
|
+
const actionPoint = actionPointOf(group);
|
|
590
|
+
await commitAll(this.worktreePath(state, group), commitMessage(slug, stepId, summary), actionPoint === undefined ? groupRef(state.run, slug) : runRef(state.run), state.run.config.workspace.include);
|
|
591
|
+
if (actionPoint === undefined)
|
|
592
|
+
void this.host.refreshDiff(state, slug);
|
|
593
|
+
}
|
|
594
|
+
catch (error) {
|
|
595
|
+
await this.host.apply(state, {
|
|
596
|
+
kind: 'commit_failed',
|
|
597
|
+
group: slug,
|
|
598
|
+
message: error.message,
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
async merge(state, slug, updateOnConflict) {
|
|
603
|
+
const group = findGroup(state, slug);
|
|
604
|
+
if (!group)
|
|
605
|
+
return;
|
|
606
|
+
let outcome;
|
|
607
|
+
try {
|
|
608
|
+
const runTree = await this.ensureGroupWorktree(state, { ...group, slug: SPLIT_GROUP });
|
|
609
|
+
await this.settleChecks(state, runTree);
|
|
610
|
+
const source = groupRef(state.run, slug);
|
|
611
|
+
const target = runRef(state.run);
|
|
612
|
+
const message = `aip: merge ${slug}`;
|
|
613
|
+
const first = await mergeBranch(runTree, source, message, target);
|
|
614
|
+
if (first.kind === 'merged')
|
|
615
|
+
outcome = first;
|
|
616
|
+
else if (!updateOnConflict)
|
|
617
|
+
outcome = first;
|
|
618
|
+
else {
|
|
619
|
+
const updated = await updateFromBranch(this.worktreePath(state, group), target, source);
|
|
620
|
+
if (updated.kind === 'conflict')
|
|
621
|
+
outcome = { kind: 'conflict_updated', files: updated.files };
|
|
622
|
+
else
|
|
623
|
+
outcome = await mergeBranch(runTree, source, message, target);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
catch (error) {
|
|
627
|
+
outcome = { kind: 'failed', message: error.message };
|
|
628
|
+
}
|
|
629
|
+
await this.host.apply(state, { kind: 'merge_finished', group: slug, outcome });
|
|
630
|
+
void this.host.refreshDiff(state, slug);
|
|
631
|
+
if (outcome.kind === 'merged')
|
|
632
|
+
void this.host.savePatch(state);
|
|
633
|
+
}
|
|
634
|
+
async changedFiles(state, slugs) {
|
|
635
|
+
const groups = state.groups.filter((group) => group.mergeCommit !== null &&
|
|
636
|
+
group.status === 'merged' &&
|
|
637
|
+
(slugs === null || slugs.length === 0
|
|
638
|
+
? group.delivery.state !== 'applied'
|
|
639
|
+
: slugs.includes(group.slug)));
|
|
640
|
+
const files = await Promise.all(groups.map((group) => changedFiles(state.run.repository, `${group.mergeCommit}^1`, group.mergeCommit)));
|
|
641
|
+
return [...new Set(files.flat())].sort();
|
|
642
|
+
}
|
|
643
|
+
groupChanges(state, slugs) {
|
|
644
|
+
return state.groups
|
|
645
|
+
.filter((group) => slugs.includes(group.slug) && group.mergeCommit !== null)
|
|
646
|
+
.sort((left, right) => (left.mergeSeq ?? 0) - (right.mergeSeq ?? 0))
|
|
647
|
+
.map((group) => ({
|
|
648
|
+
group: group.slug,
|
|
649
|
+
from: `${group.mergeCommit}^1`,
|
|
650
|
+
to: group.mergeCommit,
|
|
651
|
+
}));
|
|
652
|
+
}
|
|
653
|
+
resolveBaseRef(state) {
|
|
654
|
+
return `refs/aip/${state.run.id}/resolve-base`;
|
|
655
|
+
}
|
|
656
|
+
resolveWorktree(state) {
|
|
657
|
+
return join(runWorktreeRoot(this.workspace(state), state.run.id), RESOLVE_GROUP);
|
|
658
|
+
}
|
|
659
|
+
async prepareResolve(state, slugs) {
|
|
660
|
+
try {
|
|
661
|
+
const prepared = await prepareResolve({
|
|
662
|
+
repository: state.run.repository,
|
|
663
|
+
worktree: this.resolveWorktree(state),
|
|
664
|
+
changes: this.groupChanges(state, slugs),
|
|
665
|
+
include: state.run.config.workspace.include,
|
|
666
|
+
baseRef: this.resolveBaseRef(state),
|
|
667
|
+
});
|
|
668
|
+
await this.host.apply(state, { kind: 'resolve_prepared', conflicts: prepared.conflicts });
|
|
669
|
+
}
|
|
670
|
+
catch (error) {
|
|
671
|
+
const message = `could not prepare the resolver: ${error.message}`;
|
|
672
|
+
await this.host.apply(state, {
|
|
673
|
+
kind: 'delivery_finished',
|
|
674
|
+
result: { kind: 'failed', message },
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
async finishResolve(state, message, conflicts) {
|
|
679
|
+
let result;
|
|
680
|
+
try {
|
|
681
|
+
const worktree = this.resolveWorktree(state);
|
|
682
|
+
const left = filesWithMarkers(worktree, conflicts);
|
|
683
|
+
if (left.length > 0) {
|
|
684
|
+
result = { kind: 'failed', message: `conflict markers remain in: ${left.join(', ')}` };
|
|
685
|
+
}
|
|
686
|
+
else {
|
|
687
|
+
const { repository } = state.run;
|
|
688
|
+
const { include } = state.run.config.workspace;
|
|
689
|
+
const base = await git(repository, 'rev-parse', this.resolveBaseRef(state));
|
|
690
|
+
const resolved = await commitResolve(worktree, base, include);
|
|
691
|
+
result = await deliver({
|
|
692
|
+
repository,
|
|
693
|
+
changes: [{ group: RESOLVE_GROUP, from: base, to: resolved }],
|
|
694
|
+
mode: state.run.config.delivery.mode,
|
|
695
|
+
force: false,
|
|
696
|
+
message,
|
|
697
|
+
branch: deliveryBranch(state.run),
|
|
698
|
+
runRef: runRef(state.run),
|
|
699
|
+
include,
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
catch (error) {
|
|
704
|
+
result = { kind: 'failed', message: error.message };
|
|
705
|
+
}
|
|
706
|
+
await this.rebaseOutside(state, result);
|
|
707
|
+
await this.host.apply(state, { kind: 'delivery_finished', result });
|
|
708
|
+
}
|
|
709
|
+
async deliver(state, slugs, force, message) {
|
|
710
|
+
let result;
|
|
711
|
+
try {
|
|
712
|
+
const changes = this.groupChanges(state, slugs);
|
|
713
|
+
result = await deliver({
|
|
714
|
+
repository: state.run.repository,
|
|
715
|
+
changes,
|
|
716
|
+
mode: state.run.config.delivery.mode,
|
|
717
|
+
force,
|
|
718
|
+
message,
|
|
719
|
+
branch: deliveryBranch(state.run),
|
|
720
|
+
runRef: runRef(state.run),
|
|
721
|
+
include: state.run.config.workspace.include,
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
catch (error) {
|
|
725
|
+
result = { kind: 'failed', message: error.message };
|
|
726
|
+
}
|
|
727
|
+
await this.rebaseOutside(state, result);
|
|
728
|
+
await this.host.apply(state, { kind: 'delivery_finished', result });
|
|
729
|
+
}
|
|
730
|
+
async cleanup(state) {
|
|
731
|
+
// The refs the patch is built from go away with the cleanup.
|
|
732
|
+
await this.host.savePatch(state);
|
|
733
|
+
try {
|
|
734
|
+
await cleanRun({
|
|
735
|
+
repository: state.run.repository,
|
|
736
|
+
root: runWorktreeRoot(this.workspace(state), state.run.id),
|
|
737
|
+
runBranch: deliveryBranch(state.run),
|
|
738
|
+
groupBranches: [],
|
|
739
|
+
refPrefix: `refs/aip/${state.run.id}/`,
|
|
740
|
+
all: false,
|
|
741
|
+
active: false,
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
catch {
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
//# sourceMappingURL=executor.js.map
|