@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,966 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync, } from 'node:fs';
|
|
3
|
+
import { basename, dirname, join, relative, resolve } from 'node:path';
|
|
4
|
+
import { Document, Scalar, isMap, isScalar, parseDocument, visit } from 'yaml';
|
|
5
|
+
import { ACTIONS_DIR, SETTINGS_NAME, SPECIALISTS_DIR, PIPELINES_DIR, LEGACY_PIPELINES_DIR, } from './discover.js';
|
|
6
|
+
import { formatDuration, parseDuration } from './duration.js';
|
|
7
|
+
import { ConfigLoadError } from './errors.js';
|
|
8
|
+
import { assembleLevel, mergeOrigins, levelIsEmpty, parseYaml, canonicalPipeline, readLevel, resolveLevels, loadRuntimeSettings, loadWebSettings, } from './load.js';
|
|
9
|
+
import { isMapping, mergeConfigs } from './merge.js';
|
|
10
|
+
import { CLAUDE_EDIT_MODES, CLAUDE_MCP_MODES, CLAUDE_SETTINGS_SOURCES, DELIVERY_MODES, MAX_RANGE, MAX_ROUNDS_RANGE, OUTSIDE_CHANGES, PERMISSIONS, RUNTIMES, WEB_AUTH_MODES, WEB_HOSTS, WORKSPACE_BASES, SLUG_PATTERN_TEXT, isValidSlug, defaultRuntimes, defaultWeb, } from './model.js';
|
|
11
|
+
import { tagsOf } from './tag-names.js';
|
|
12
|
+
import { validateConfig, validateRuntimesSection, validateWebSection } from './validate.js';
|
|
13
|
+
const KIND_DIRECTORY = {
|
|
14
|
+
specialist: SPECIALISTS_DIR,
|
|
15
|
+
pipeline: PIPELINES_DIR,
|
|
16
|
+
action: ACTIONS_DIR,
|
|
17
|
+
};
|
|
18
|
+
/** Key of the section of the configuration tree (`swarm.<section>.<id>`) that holds the kind. */
|
|
19
|
+
const KIND_SECTION = {
|
|
20
|
+
specialist: 'specialists',
|
|
21
|
+
pipeline: 'pipelines',
|
|
22
|
+
action: 'actions',
|
|
23
|
+
};
|
|
24
|
+
/** Thrown for a request that is wrong by itself, before any file is looked at. */
|
|
25
|
+
export class ConfigEditError extends Error {
|
|
26
|
+
}
|
|
27
|
+
/** sha256 of the content of a file; null for a file that does not exist. */
|
|
28
|
+
export function revisionOf(text) {
|
|
29
|
+
return text === undefined ? null : createHash('sha256').update(text).digest('hex');
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The file of an entry on a level: `specialists/<id>.yaml` (`pipelines/<id>.yaml`) in the directory of the level, or the
|
|
33
|
+
* `.yml` file when that one exists. The id must be a slug, so the path cannot leave the directory of the kind.
|
|
34
|
+
*/
|
|
35
|
+
export function entryFile(paths, kind, id, level = 'project') {
|
|
36
|
+
if (!isValidSlug(id))
|
|
37
|
+
throw new ConfigEditError(`id must match ${SLUG_PATTERN_TEXT}`);
|
|
38
|
+
let directory = resolve(paths[level].directory, KIND_DIRECTORY[kind]);
|
|
39
|
+
const yaml = join(directory, `${id}.yaml`);
|
|
40
|
+
const yml = join(directory, `${id}.yml`);
|
|
41
|
+
let file = !existsSync(yaml) && existsSync(yml) ? yml : yaml;
|
|
42
|
+
if (kind === 'pipeline' && !existsSync(yaml) && !existsSync(yml)) {
|
|
43
|
+
const legacyDirectory = resolve(paths[level].directory, LEGACY_PIPELINES_DIR);
|
|
44
|
+
const legacyYaml = join(legacyDirectory, `${id}.yaml`);
|
|
45
|
+
const legacyYml = join(legacyDirectory, `${id}.yml`);
|
|
46
|
+
if (existsSync(legacyYaml) || existsSync(legacyYml)) {
|
|
47
|
+
directory = legacyDirectory;
|
|
48
|
+
file = existsSync(legacyYaml) ? legacyYaml : legacyYml;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const inside = relative(directory, resolve(file));
|
|
52
|
+
if (inside.startsWith('..') || inside !== basename(file)) {
|
|
53
|
+
throw new ConfigEditError('the file must be inside the directory of its kind');
|
|
54
|
+
}
|
|
55
|
+
return file;
|
|
56
|
+
}
|
|
57
|
+
/** Deep equality of parsed YAML values; the order of keys of a mapping does not matter. */
|
|
58
|
+
function sameValue(left, right) {
|
|
59
|
+
if (Array.isArray(left) || Array.isArray(right)) {
|
|
60
|
+
return (Array.isArray(left) &&
|
|
61
|
+
Array.isArray(right) &&
|
|
62
|
+
left.length === right.length &&
|
|
63
|
+
left.every((item, index) => sameValue(item, right[index])));
|
|
64
|
+
}
|
|
65
|
+
if (isMapping(left) && isMapping(right)) {
|
|
66
|
+
const keys = Object.keys(left);
|
|
67
|
+
return (keys.length === Object.keys(right).length &&
|
|
68
|
+
keys.every((key) => key in right && sameValue(left[key], right[key])));
|
|
69
|
+
}
|
|
70
|
+
return left === right;
|
|
71
|
+
}
|
|
72
|
+
function literalMultiline(node) {
|
|
73
|
+
visit(node, {
|
|
74
|
+
Scalar(_, scalar) {
|
|
75
|
+
if (typeof scalar.value === 'string' && scalar.value.includes('\n')) {
|
|
76
|
+
scalar.type = Scalar.BLOCK_LITERAL;
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Text of a file with `value` as its content. Only the changed keys are touched, so comments, key
|
|
83
|
+
* order and the formatting of the other keys survive; keys missing from `value` are removed.
|
|
84
|
+
*/
|
|
85
|
+
export function editDocument(text, value) {
|
|
86
|
+
if (text === undefined || text.trim() === '') {
|
|
87
|
+
const fresh = new Document(value);
|
|
88
|
+
literalMultiline(fresh);
|
|
89
|
+
const body = fresh.toString({ lineWidth: 0 });
|
|
90
|
+
return Object.keys(value).length === 0 ? '{}\n' : `${text ?? ''}${body}`;
|
|
91
|
+
}
|
|
92
|
+
const document = parseDocument(text, { merge: true, uniqueKeys: true });
|
|
93
|
+
if (document.errors.length > 0) {
|
|
94
|
+
throw new ConfigEditError(`the file has a syntax error: ${document.errors[0]?.message ?? ''}`);
|
|
95
|
+
}
|
|
96
|
+
if (!isMap(document.contents))
|
|
97
|
+
document.contents = document.createNode({});
|
|
98
|
+
const current = (document.toJS({ maxAliasCount: 100 }) ?? {});
|
|
99
|
+
const map = document.contents;
|
|
100
|
+
if (!isMap(map))
|
|
101
|
+
throw new ConfigEditError('the file must contain a mapping');
|
|
102
|
+
for (const key of Object.keys(current)) {
|
|
103
|
+
if (!(key in value) && document.has(key))
|
|
104
|
+
document.delete(key);
|
|
105
|
+
}
|
|
106
|
+
for (const [key, next] of Object.entries(value)) {
|
|
107
|
+
const oldSplit = key === 'split' && isMapping(current[key]) && 'workflow' in current[key];
|
|
108
|
+
if (!oldSplit && sameValue(current[key], next))
|
|
109
|
+
continue;
|
|
110
|
+
const existing = document.get(key, true);
|
|
111
|
+
if (isScalar(existing) && (typeof next === 'string' || typeof next === 'number')) {
|
|
112
|
+
existing.value = next;
|
|
113
|
+
existing.type =
|
|
114
|
+
typeof next === 'string' && next.includes('\n') ? Scalar.BLOCK_LITERAL : undefined;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const node = document.createNode(next);
|
|
118
|
+
literalMultiline(node);
|
|
119
|
+
document.set(key, node);
|
|
120
|
+
}
|
|
121
|
+
return document.toString({ lineWidth: 0 });
|
|
122
|
+
}
|
|
123
|
+
/** Everything in a merged `{ swarm }` tree that names the specialist. */
|
|
124
|
+
export function specialistReferences(tree, slug) {
|
|
125
|
+
const swarm = isMapping(tree) && isMapping(tree.swarm) ? tree.swarm : {};
|
|
126
|
+
const references = [];
|
|
127
|
+
const pipelines = isMapping(swarm.pipelines) ? swarm.pipelines : {};
|
|
128
|
+
for (const [id, pipeline] of Object.entries(pipelines)) {
|
|
129
|
+
if (!isMapping(pipeline))
|
|
130
|
+
continue;
|
|
131
|
+
if (isMapping(pipeline.split) && pipeline.split.specialist === slug) {
|
|
132
|
+
references.push({ pipeline: id, split: true });
|
|
133
|
+
}
|
|
134
|
+
const steps = Array.isArray(pipeline.steps) ? pipeline.steps : [];
|
|
135
|
+
for (const [index, step] of steps.entries()) {
|
|
136
|
+
if (isMapping(step) && step.specialist === slug) {
|
|
137
|
+
references.push({
|
|
138
|
+
pipeline: id,
|
|
139
|
+
step: typeof step.id === 'string' ? step.id : String(index),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const actions = isMapping(swarm.actions) ? swarm.actions : {};
|
|
145
|
+
for (const [id, action] of Object.entries(actions)) {
|
|
146
|
+
if (isMapping(action) && action.specialist === slug)
|
|
147
|
+
references.push({ action: id });
|
|
148
|
+
}
|
|
149
|
+
const delivery = isMapping(swarm.delivery) ? swarm.delivery : {};
|
|
150
|
+
for (const field of ['resolver', 'message_specialist']) {
|
|
151
|
+
if (delivery[field] === slug)
|
|
152
|
+
references.push({ field: `delivery.${field}` });
|
|
153
|
+
}
|
|
154
|
+
return references;
|
|
155
|
+
}
|
|
156
|
+
/** Everything in a merged `{ swarm }` tree that delegates to the pipeline through `split.pipeline`. */
|
|
157
|
+
export function pipelineReferences(tree, id) {
|
|
158
|
+
const swarm = isMapping(tree) && isMapping(tree.swarm) ? tree.swarm : {};
|
|
159
|
+
const pipelines = isMapping(swarm.pipelines) ? swarm.pipelines : {};
|
|
160
|
+
const references = [];
|
|
161
|
+
for (const [name, pipeline] of Object.entries(pipelines)) {
|
|
162
|
+
if (isMapping(pipeline) && isMapping(pipeline.split) && pipeline.split.pipeline === id) {
|
|
163
|
+
references.push({ pipeline: name, split: true });
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return references;
|
|
167
|
+
}
|
|
168
|
+
/** Everything in a merged `{ swarm }` tree that names the action in a pipeline point. */
|
|
169
|
+
export function actionReferences(tree, id) {
|
|
170
|
+
const swarm = isMapping(tree) && isMapping(tree.swarm) ? tree.swarm : {};
|
|
171
|
+
const references = [];
|
|
172
|
+
const scan = (stages, owner) => {
|
|
173
|
+
if (!isMapping(stages))
|
|
174
|
+
return;
|
|
175
|
+
for (const [point, ids] of Object.entries(stages)) {
|
|
176
|
+
if (Array.isArray(ids) && ids.includes(id))
|
|
177
|
+
references.push({ ...owner, point });
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
scan(swarm.stages, {});
|
|
181
|
+
const pipelines = isMapping(swarm.pipelines) ? swarm.pipelines : {};
|
|
182
|
+
for (const [name, pipeline] of Object.entries(pipelines)) {
|
|
183
|
+
if (isMapping(pipeline))
|
|
184
|
+
scan(pipeline.stages, { pipeline: name });
|
|
185
|
+
}
|
|
186
|
+
return references;
|
|
187
|
+
}
|
|
188
|
+
function resolution(global, project) {
|
|
189
|
+
try {
|
|
190
|
+
return { config: resolveLevels(global, project).config, errors: [] };
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
if (error instanceof ConfigLoadError && error.detail.kind === 'invalid') {
|
|
194
|
+
return { config: null, errors: error.detail.errors };
|
|
195
|
+
}
|
|
196
|
+
throw error;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
export function readText(file) {
|
|
200
|
+
try {
|
|
201
|
+
return readFileSync(file, 'utf8');
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
if (error.code === 'ENOENT')
|
|
205
|
+
return undefined;
|
|
206
|
+
throw error;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function sourcesOf(files, kind) {
|
|
210
|
+
return files[KIND_SECTION[kind]];
|
|
211
|
+
}
|
|
212
|
+
export function stemOf(path) {
|
|
213
|
+
return basename(path).replace(/\.ya?ml$/, '');
|
|
214
|
+
}
|
|
215
|
+
function withEntry(files, kind, id, file, text) {
|
|
216
|
+
const others = sourcesOf(files, kind).filter((source) => stemOf(source.path) !== id);
|
|
217
|
+
const parsed = text === null ? null : parseYaml(text, file);
|
|
218
|
+
const value = kind === 'pipeline' ? canonicalPipeline(parsed) : parsed;
|
|
219
|
+
const list = text === null ? others : [...others, { path: file, value, text }];
|
|
220
|
+
list.sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0));
|
|
221
|
+
return { ...files, [KIND_SECTION[kind]]: list };
|
|
222
|
+
}
|
|
223
|
+
/** Both levels read with broken files reported as problems, so one bad file hides nothing. */
|
|
224
|
+
function readLevels(paths) {
|
|
225
|
+
return {
|
|
226
|
+
global: readLevel(paths.global, { tolerant: true }),
|
|
227
|
+
project: readLevel(paths.project, { tolerant: true }),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function key(error) {
|
|
231
|
+
return `${error.path}\u0000${error.message}`;
|
|
232
|
+
}
|
|
233
|
+
/** The configuration with the edit applied in memory; nothing is read twice or written. */
|
|
234
|
+
function buildDraft(paths, edit, current) {
|
|
235
|
+
const level = edit.level ?? 'project';
|
|
236
|
+
const file = entryFile(paths, edit.kind, edit.id, level);
|
|
237
|
+
const text = edit.value === null ? null : editDocument(current, edit.value);
|
|
238
|
+
const files = readLevels(paths);
|
|
239
|
+
const drafted = withEntry(files[level], edit.kind, edit.id, file, text);
|
|
240
|
+
const draftFiles = { ...files, [level]: drafted };
|
|
241
|
+
const before = resolution(assembleLevel(files.global), assembleLevel(files.project));
|
|
242
|
+
const after = resolution(assembleLevel(draftFiles.global), assembleLevel(draftFiles.project));
|
|
243
|
+
if (level === 'global') {
|
|
244
|
+
// The global level has to work in any repository, so it is also checked on its own.
|
|
245
|
+
const alone = (global) => levelIsEmpty(global)
|
|
246
|
+
? { config: null, errors: [] }
|
|
247
|
+
: resolution(assembleLevel(global), emptyLevel());
|
|
248
|
+
const aloneBefore = alone(files.global);
|
|
249
|
+
const aloneAfter = alone(drafted);
|
|
250
|
+
const known = new Set(aloneBefore.errors.map(key));
|
|
251
|
+
const extra = aloneAfter.errors.filter((error) => !known.has(key(error)));
|
|
252
|
+
const seen = new Set(after.errors.map(key));
|
|
253
|
+
const merged = [...after.errors, ...extra.filter((error) => !seen.has(key(error)))];
|
|
254
|
+
return {
|
|
255
|
+
file,
|
|
256
|
+
text,
|
|
257
|
+
before: {
|
|
258
|
+
config: before.config,
|
|
259
|
+
errors: [
|
|
260
|
+
...before.errors,
|
|
261
|
+
...aloneBefore.errors.filter((error) => !before.errors.some((e) => key(e) === key(error))),
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
after: { config: after.config, errors: merged },
|
|
265
|
+
files,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
return { file, text, before, after, files };
|
|
269
|
+
}
|
|
270
|
+
function emptyLevel() {
|
|
271
|
+
return assembleLevel({ specialists: [], pipelines: [], actions: [], problems: [] });
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* The configuration as it would be with the edit, without the revision check and without
|
|
275
|
+
* writing: the resolved configuration (null when it has errors) and all of its errors.
|
|
276
|
+
*/
|
|
277
|
+
export function draftConfig(paths, edit) {
|
|
278
|
+
const level = edit.level ?? 'project';
|
|
279
|
+
const file = entryFile(paths, edit.kind, edit.id, level);
|
|
280
|
+
try {
|
|
281
|
+
const draft = buildDraft(paths, { ...edit, revision: null }, readText(file));
|
|
282
|
+
if (level === 'global' && edit.value !== null) {
|
|
283
|
+
// The graph of a global draft is built from the global level alone, so a project file
|
|
284
|
+
// with the same id cannot hide the draft.
|
|
285
|
+
const files = readLevels(paths);
|
|
286
|
+
const drafted = withEntry(files.global, edit.kind, edit.id, file, draft.text);
|
|
287
|
+
const alone = resolution(assembleLevel(drafted), emptyLevel());
|
|
288
|
+
const seen = new Set(draft.after.errors.map(key));
|
|
289
|
+
return {
|
|
290
|
+
config: alone.config ?? draft.after.config,
|
|
291
|
+
errors: [...draft.after.errors, ...alone.errors.filter((error) => !seen.has(key(error)))],
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
return draft.after;
|
|
295
|
+
}
|
|
296
|
+
catch (error) {
|
|
297
|
+
if (!(error instanceof ConfigEditError))
|
|
298
|
+
throw error;
|
|
299
|
+
return {
|
|
300
|
+
config: null,
|
|
301
|
+
errors: [
|
|
302
|
+
{ file, path: `swarm.${KIND_SECTION[edit.kind]}.${edit.id}`, message: error.message },
|
|
303
|
+
],
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* New errors of the configuration when several files of the project level are added or replaced
|
|
309
|
+
* at once, without writing: the errors the current configuration does not have.
|
|
310
|
+
*/
|
|
311
|
+
export function draftProjectFiles(paths, entries) {
|
|
312
|
+
const files = readLevels(paths);
|
|
313
|
+
let drafted = files.project;
|
|
314
|
+
try {
|
|
315
|
+
for (const entry of entries) {
|
|
316
|
+
drafted = withEntry(drafted, entry.kind, entry.id, entry.file, entry.text);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
if (!(error instanceof ConfigLoadError))
|
|
321
|
+
throw error;
|
|
322
|
+
const first = entries.find((entry) => error.message.includes(entry.file)) ?? entries[0];
|
|
323
|
+
return [
|
|
324
|
+
{
|
|
325
|
+
file: first?.file ?? '',
|
|
326
|
+
path: `swarm.${KIND_SECTION[first?.kind ?? 'specialist']}.${first?.id ?? ''}`,
|
|
327
|
+
message: error.message,
|
|
328
|
+
},
|
|
329
|
+
];
|
|
330
|
+
}
|
|
331
|
+
const before = resolution(assembleLevel(files.global), assembleLevel(files.project));
|
|
332
|
+
const after = resolution(assembleLevel(files.global), assembleLevel(drafted));
|
|
333
|
+
const known = new Set(before.errors.map(key));
|
|
334
|
+
return after.errors.filter((error) => !known.has(key(error)));
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Checks an edit without writing: the revision, then the whole configuration with the file
|
|
338
|
+
* replaced in memory. Only errors the current configuration does not have reject the edit.
|
|
339
|
+
*/
|
|
340
|
+
export function planEdit(paths, request) {
|
|
341
|
+
const level = request.level ?? 'project';
|
|
342
|
+
const file = entryFile(paths, request.kind, request.id, level);
|
|
343
|
+
const current = readText(file);
|
|
344
|
+
let edit = request;
|
|
345
|
+
if (edit.kind === 'specialist' && level === 'global' && edit.value !== null) {
|
|
346
|
+
// Shared tags are changed only in the file: a write of the entry keeps them as the file has them.
|
|
347
|
+
let stored;
|
|
348
|
+
try {
|
|
349
|
+
const parsed = current === undefined ? undefined : parseYaml(current, file);
|
|
350
|
+
stored = isMapping(parsed) ? parsed.tags : undefined;
|
|
351
|
+
}
|
|
352
|
+
catch {
|
|
353
|
+
stored = undefined;
|
|
354
|
+
}
|
|
355
|
+
const { tags, ...rest } = edit.value;
|
|
356
|
+
if ('tags' in edit.value && !sameValue(tags, stored)) {
|
|
357
|
+
return {
|
|
358
|
+
ok: false,
|
|
359
|
+
reason: 'invalid',
|
|
360
|
+
errors: [
|
|
361
|
+
{
|
|
362
|
+
file,
|
|
363
|
+
path: `swarm.specialists.${edit.id}.tags`,
|
|
364
|
+
message: 'shared tags are changed only in the file',
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
edit = { ...edit, value: stored === undefined ? rest : { ...rest, tags: stored } };
|
|
370
|
+
}
|
|
371
|
+
if (revisionOf(current) !== edit.revision) {
|
|
372
|
+
return {
|
|
373
|
+
ok: false,
|
|
374
|
+
reason: 'conflict',
|
|
375
|
+
message: current === undefined
|
|
376
|
+
? `${file} does not exist any more`
|
|
377
|
+
: edit.revision === null
|
|
378
|
+
? `${file} already exists`
|
|
379
|
+
: `${file} was changed after it was read`,
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
let draft;
|
|
383
|
+
try {
|
|
384
|
+
draft = buildDraft(paths, edit, current);
|
|
385
|
+
}
|
|
386
|
+
catch (error) {
|
|
387
|
+
if (!(error instanceof ConfigEditError))
|
|
388
|
+
throw error;
|
|
389
|
+
return {
|
|
390
|
+
ok: false,
|
|
391
|
+
reason: 'invalid',
|
|
392
|
+
errors: [
|
|
393
|
+
{ file, path: `swarm.${KIND_SECTION[edit.kind]}.${edit.id}`, message: error.message },
|
|
394
|
+
],
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
if (edit.value === null && (edit.kind === 'specialist' || edit.kind === 'action')) {
|
|
398
|
+
const kind = edit.kind;
|
|
399
|
+
const referencesTo = kind === 'specialist' ? specialistReferences : actionReferences;
|
|
400
|
+
const inGlobal = sourcesOf(draft.files.global, kind).some((source) => stemOf(source.path) === edit.id);
|
|
401
|
+
const inProject = sourcesOf(draft.files.project, kind).some((source) => stemOf(source.path) === edit.id);
|
|
402
|
+
const globalTree = assembleLevel(draft.files.global).tree;
|
|
403
|
+
const projectTree = assembleLevel(draft.files.project).tree;
|
|
404
|
+
const references = [];
|
|
405
|
+
const add = (found) => {
|
|
406
|
+
for (const reference of found) {
|
|
407
|
+
if (!references.some((known) => JSON.stringify(known) === JSON.stringify(reference))) {
|
|
408
|
+
references.push(reference);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
if (level === 'global') {
|
|
413
|
+
add(referencesTo(globalTree, edit.id));
|
|
414
|
+
if (!inProject)
|
|
415
|
+
add(referencesTo(mergeConfigs(globalTree, projectTree), edit.id));
|
|
416
|
+
}
|
|
417
|
+
else if (!inGlobal) {
|
|
418
|
+
add(referencesTo(mergeConfigs(globalTree, projectTree), edit.id));
|
|
419
|
+
}
|
|
420
|
+
if (references.length > 0)
|
|
421
|
+
return { ok: false, reason: 'invalid', errors: [], references };
|
|
422
|
+
}
|
|
423
|
+
const known = new Set(draft.before.errors.map(key));
|
|
424
|
+
const added = draft.after.errors.filter((error) => !known.has(key(error)));
|
|
425
|
+
if (added.length > 0)
|
|
426
|
+
return { ok: false, reason: 'invalid', errors: added };
|
|
427
|
+
return { ok: true, file, text: draft.text, revision: revisionOf(draft.text ?? undefined) };
|
|
428
|
+
}
|
|
429
|
+
const WEB_PORT_RANGE = [1, 65535];
|
|
430
|
+
const RESOLVER_ROUNDS_RANGE = MAX_ROUNDS_RANGE;
|
|
431
|
+
const ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
432
|
+
function field(path, kind, extra = {}) {
|
|
433
|
+
return { path, kind, ...extra, globalOnly: extra.globalOnly ?? false };
|
|
434
|
+
}
|
|
435
|
+
/** Every field of settings.yaml the editor writes, in the order the editor shows them. */
|
|
436
|
+
export const SETTING_FIELDS = [
|
|
437
|
+
field('max', 'integer', { range: MAX_RANGE }),
|
|
438
|
+
field('workspace_dir', 'string'),
|
|
439
|
+
field('outside_changes', 'choice', { options: OUTSIDE_CHANGES }),
|
|
440
|
+
field('defaults.runtime', 'choice', { options: RUNTIMES }),
|
|
441
|
+
field('defaults.permissions', 'choice', { options: PERMISSIONS }),
|
|
442
|
+
field('defaults.timeout', 'duration'),
|
|
443
|
+
field('defaults.allow_commands', 'strings'),
|
|
444
|
+
field('defaults.tools', 'strings'),
|
|
445
|
+
field('claude.edit_mode', 'choice', { options: CLAUDE_EDIT_MODES }),
|
|
446
|
+
field('claude.mcp', 'choice', { options: CLAUDE_MCP_MODES }),
|
|
447
|
+
field('claude.settings', 'choice', { options: CLAUDE_SETTINGS_SOURCES }),
|
|
448
|
+
field('delivery.mode', 'choice', { options: DELIVERY_MODES }),
|
|
449
|
+
field('delivery.auto', 'boolean'),
|
|
450
|
+
field('delivery.keep', 'boolean'),
|
|
451
|
+
field('delivery.commit_message', 'string'),
|
|
452
|
+
field('delivery.message_specialist', 'specialist'),
|
|
453
|
+
field('delivery.resolver', 'specialist'),
|
|
454
|
+
field('delivery.resolver_rounds', 'integer', { range: RESOLVER_ROUNDS_RANGE }),
|
|
455
|
+
field('delivery.message_prompt', 'string'),
|
|
456
|
+
field('delivery.resolver_prompt', 'string'),
|
|
457
|
+
field('workspace.base', 'choice', { options: WORKSPACE_BASES }),
|
|
458
|
+
field('workspace.include', 'strings'),
|
|
459
|
+
field('naming.enabled', 'boolean'),
|
|
460
|
+
field('naming.runtime', 'choice', { options: RUNTIMES }),
|
|
461
|
+
field('naming.model', 'string'),
|
|
462
|
+
field('web.autostart', 'boolean', { globalOnly: true }),
|
|
463
|
+
field('web.auth', 'choice', { options: WEB_AUTH_MODES, globalOnly: true }),
|
|
464
|
+
field('web.host', 'choice', { options: WEB_HOSTS, globalOnly: true }),
|
|
465
|
+
field('web.port', 'integer', { range: WEB_PORT_RANGE, globalOnly: true }),
|
|
466
|
+
...RUNTIMES.flatMap((runtime) => [
|
|
467
|
+
field(`runtimes.${runtime}.command`, 'string', { globalOnly: true }),
|
|
468
|
+
field(`runtimes.${runtime}.args`, 'strings', { globalOnly: true }),
|
|
469
|
+
field(`runtimes.${runtime}.env`, 'env', { globalOnly: true }),
|
|
470
|
+
]),
|
|
471
|
+
];
|
|
472
|
+
const ENV_VARIABLE_PATH = /^runtimes\.([a-z]+)\.env\.(.+)$/;
|
|
473
|
+
/** The field for a path, also a single variable `runtimes.<runtime>.env.<NAME>`; undefined for any other path. */
|
|
474
|
+
export function settingFieldOf(path) {
|
|
475
|
+
const known = SETTING_FIELDS.find((candidate) => candidate.path === path);
|
|
476
|
+
if (known)
|
|
477
|
+
return known;
|
|
478
|
+
const match = ENV_VARIABLE_PATH.exec(path);
|
|
479
|
+
if (match &&
|
|
480
|
+
RUNTIMES.includes(match[1]) &&
|
|
481
|
+
ENV_NAME.test(match[2])) {
|
|
482
|
+
return field(path, 'env', { globalOnly: true });
|
|
483
|
+
}
|
|
484
|
+
return undefined;
|
|
485
|
+
}
|
|
486
|
+
/** A variable of `runtimes.<runtime>.env` (a string), as opposed to the whole `env` section. */
|
|
487
|
+
function isEnvVariable(path) {
|
|
488
|
+
return ENV_VARIABLE_PATH.test(path);
|
|
489
|
+
}
|
|
490
|
+
/** `settings.yaml` of the level, or `settings.yml` when only that one exists. */
|
|
491
|
+
export function settingsFile(paths, level = 'global') {
|
|
492
|
+
const directory = resolve(paths[level].directory);
|
|
493
|
+
const yaml = join(directory, `${SETTINGS_NAME}.yaml`);
|
|
494
|
+
const yml = join(directory, `${SETTINGS_NAME}.yml`);
|
|
495
|
+
return !existsSync(yaml) && existsSync(yml) ? yml : yaml;
|
|
496
|
+
}
|
|
497
|
+
/** Text of settings.yaml with one field set (or removed); comments and other keys survive. */
|
|
498
|
+
export function editSetting(text, path, value) {
|
|
499
|
+
const keys = path.split('.');
|
|
500
|
+
if (text === undefined || text.trim() === '') {
|
|
501
|
+
if (value === null)
|
|
502
|
+
return text ?? '';
|
|
503
|
+
const fresh = new Document({});
|
|
504
|
+
fresh.setIn(keys, value);
|
|
505
|
+
return `${text ?? ''}${fresh.toString({ lineWidth: 0 })}`;
|
|
506
|
+
}
|
|
507
|
+
const document = parseDocument(text, { merge: true, uniqueKeys: true });
|
|
508
|
+
if (document.errors.length > 0) {
|
|
509
|
+
throw new ConfigEditError(`the file has a syntax error: ${document.errors[0]?.message ?? ''}`);
|
|
510
|
+
}
|
|
511
|
+
if (!isMap(document.contents)) {
|
|
512
|
+
if (document.contents !== null &&
|
|
513
|
+
!(isScalar(document.contents) && document.contents.value === null)) {
|
|
514
|
+
throw new ConfigEditError('the file must contain a mapping');
|
|
515
|
+
}
|
|
516
|
+
document.contents = document.createNode({});
|
|
517
|
+
}
|
|
518
|
+
if (value === null) {
|
|
519
|
+
document.deleteIn(keys);
|
|
520
|
+
const parent = document.getIn(keys.slice(0, -1), true);
|
|
521
|
+
if (keys.length > 1 && isMap(parent) && parent.items.length === 0) {
|
|
522
|
+
document.deleteIn(keys.slice(0, -1));
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
else {
|
|
526
|
+
document.setIn(keys, value);
|
|
527
|
+
}
|
|
528
|
+
return document.toString({ lineWidth: 0 });
|
|
529
|
+
}
|
|
530
|
+
function textError(value) {
|
|
531
|
+
if (typeof value !== 'string')
|
|
532
|
+
return 'must be a string';
|
|
533
|
+
return value.trim() === '' ? 'must not be empty' : null;
|
|
534
|
+
}
|
|
535
|
+
/** Why the value does not fit the field: the message and the path suffix (`[1]` for a list item), or null. */
|
|
536
|
+
function settingTypeError(setting, value) {
|
|
537
|
+
if (value === null)
|
|
538
|
+
return null;
|
|
539
|
+
const fail = (message, suffix = '') => ({ message, suffix });
|
|
540
|
+
switch (setting.kind) {
|
|
541
|
+
case 'boolean':
|
|
542
|
+
return typeof value === 'boolean' ? null : fail('must be true or false');
|
|
543
|
+
case 'choice': {
|
|
544
|
+
const options = setting.options ?? [];
|
|
545
|
+
const message = textError(value);
|
|
546
|
+
if (message !== null)
|
|
547
|
+
return fail(message);
|
|
548
|
+
return options.includes(value)
|
|
549
|
+
? null
|
|
550
|
+
: fail(`must be one of ${options.join(', ')}`);
|
|
551
|
+
}
|
|
552
|
+
case 'integer': {
|
|
553
|
+
const [low, high] = setting.range ?? [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER];
|
|
554
|
+
return typeof value === 'number' && Number.isInteger(value) && value >= low && value <= high
|
|
555
|
+
? null
|
|
556
|
+
: fail(`must be an integer from ${low} to ${high}`);
|
|
557
|
+
}
|
|
558
|
+
case 'duration': {
|
|
559
|
+
const message = textError(value);
|
|
560
|
+
if (message !== null)
|
|
561
|
+
return fail(message);
|
|
562
|
+
return parseDuration(value) === null
|
|
563
|
+
? fail('must be a positive duration such as 90s, 30m or 2h')
|
|
564
|
+
: null;
|
|
565
|
+
}
|
|
566
|
+
case 'strings': {
|
|
567
|
+
if (!Array.isArray(value))
|
|
568
|
+
return fail('must be a list of strings');
|
|
569
|
+
for (const [index, item] of value.entries()) {
|
|
570
|
+
const message = textError(item);
|
|
571
|
+
if (message !== null)
|
|
572
|
+
return fail(message, `[${index}]`);
|
|
573
|
+
}
|
|
574
|
+
return null;
|
|
575
|
+
}
|
|
576
|
+
case 'env':
|
|
577
|
+
if (!isEnvVariable(setting.path))
|
|
578
|
+
return fail('cannot be written as a whole');
|
|
579
|
+
return typeof value === 'string' ? null : fail('must be a string');
|
|
580
|
+
case 'string':
|
|
581
|
+
case 'specialist': {
|
|
582
|
+
const message = textError(value);
|
|
583
|
+
return message === null ? null : fail(message);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Checks a write of several settings without writing: the types of all values, the revision, then
|
|
589
|
+
* the whole configuration with all of the edits applied to one text.
|
|
590
|
+
*/
|
|
591
|
+
export function planSettings(paths, request) {
|
|
592
|
+
const level = request.level ?? 'global';
|
|
593
|
+
const entries = Object.entries(request.values);
|
|
594
|
+
if (entries.length === 0)
|
|
595
|
+
throw new ConfigEditError('there is nothing to write');
|
|
596
|
+
const unknown = entries.filter(([path]) => settingFieldOf(path) === undefined).map(([p]) => p);
|
|
597
|
+
if (unknown.length > 0) {
|
|
598
|
+
throw new ConfigEditError(`${unknown.map((path) => `\`${path}\``).join(', ')} cannot be written; allowed: ${SETTING_FIELDS.map((setting) => setting.path).join(', ')}`);
|
|
599
|
+
}
|
|
600
|
+
const file = settingsFile(paths, level);
|
|
601
|
+
const typeErrors = [];
|
|
602
|
+
for (const [path, value] of entries) {
|
|
603
|
+
const setting = settingFieldOf(path);
|
|
604
|
+
if (setting.globalOnly && level === 'project') {
|
|
605
|
+
typeErrors.push({
|
|
606
|
+
file,
|
|
607
|
+
path: `swarm.${path}`,
|
|
608
|
+
message: 'is read only from the shared settings.yaml',
|
|
609
|
+
});
|
|
610
|
+
continue;
|
|
611
|
+
}
|
|
612
|
+
const problem = settingTypeError(setting, value);
|
|
613
|
+
if (problem !== null) {
|
|
614
|
+
typeErrors.push({ file, path: `swarm.${path}${problem.suffix}`, message: problem.message });
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
if (typeErrors.length > 0)
|
|
618
|
+
return { ok: false, reason: 'invalid', errors: typeErrors };
|
|
619
|
+
const current = readText(file);
|
|
620
|
+
if (revisionOf(current) !== request.revision) {
|
|
621
|
+
return {
|
|
622
|
+
ok: false,
|
|
623
|
+
reason: 'conflict',
|
|
624
|
+
message: current === undefined
|
|
625
|
+
? `${file} does not exist any more`
|
|
626
|
+
: request.revision === null
|
|
627
|
+
? `${file} already exists`
|
|
628
|
+
: `${file} was changed after it was read`,
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
let text = current;
|
|
632
|
+
try {
|
|
633
|
+
for (const [path, value] of entries)
|
|
634
|
+
text = editSetting(text, path, value);
|
|
635
|
+
}
|
|
636
|
+
catch (error) {
|
|
637
|
+
if (!(error instanceof ConfigEditError))
|
|
638
|
+
throw error;
|
|
639
|
+
return {
|
|
640
|
+
ok: false,
|
|
641
|
+
reason: 'invalid',
|
|
642
|
+
errors: [{ file, path: `swarm.${entries[0]?.[0] ?? ''}`, message: error.message }],
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
const written = text ?? '';
|
|
646
|
+
const files = readLevels(paths);
|
|
647
|
+
const before = resolution(assembleLevel(files.global), assembleLevel(files.project));
|
|
648
|
+
const settings = { path: file, value: parseYaml(written, file), text: written };
|
|
649
|
+
const drafted = { ...files, [level]: { ...files[level], settings } };
|
|
650
|
+
const after = resolution(assembleLevel(drafted.global), assembleLevel(drafted.project));
|
|
651
|
+
const known = new Set(before.errors.map(key));
|
|
652
|
+
const added = after.errors.filter((error) => !known.has(key(error)));
|
|
653
|
+
if (level === 'global' &&
|
|
654
|
+
entries.some(([path]) => settingFieldOf(path).globalOnly)) {
|
|
655
|
+
const sectionErrors = (source) => {
|
|
656
|
+
const root = isMapping(source?.value) ? source.value : {};
|
|
657
|
+
return [
|
|
658
|
+
...validateWebSection(root.web).errors,
|
|
659
|
+
...validateRuntimesSection(root.runtimes).errors,
|
|
660
|
+
];
|
|
661
|
+
};
|
|
662
|
+
const sectionKnown = new Set(sectionErrors(files.global.settings).map(key));
|
|
663
|
+
const seen = new Set([...known, ...added.map(key)]);
|
|
664
|
+
for (const error of sectionErrors(settings)) {
|
|
665
|
+
if (sectionKnown.has(key(error)) || seen.has(key(error)))
|
|
666
|
+
continue;
|
|
667
|
+
added.push({ ...error, file });
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
if (added.length > 0)
|
|
671
|
+
return { ok: false, reason: 'invalid', errors: added };
|
|
672
|
+
return { ok: true, file, text: written, revision: revisionOf(written) };
|
|
673
|
+
}
|
|
674
|
+
/** Checks a write of one setting without writing: the revision, then the whole configuration. */
|
|
675
|
+
export function planSetting(paths, request) {
|
|
676
|
+
return planSettings(paths, {
|
|
677
|
+
values: { [request.path]: request.value },
|
|
678
|
+
revision: request.revision,
|
|
679
|
+
...(request.level ? { level: request.level } : {}),
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
/** Writes a plan: a temporary file next to the target, then a rename; deletion is an unlink. */
|
|
683
|
+
export function commitEdit(plan) {
|
|
684
|
+
if (plan.text === null) {
|
|
685
|
+
unlinkSync(plan.file);
|
|
686
|
+
return { file: plan.file, revision: null };
|
|
687
|
+
}
|
|
688
|
+
mkdirSync(dirname(plan.file), { recursive: true });
|
|
689
|
+
const temporary = join(dirname(plan.file), `.${basename(plan.file)}.tmp-${process.pid}`);
|
|
690
|
+
try {
|
|
691
|
+
writeFileSync(temporary, plan.text);
|
|
692
|
+
renameSync(temporary, plan.file);
|
|
693
|
+
}
|
|
694
|
+
catch (error) {
|
|
695
|
+
try {
|
|
696
|
+
unlinkSync(temporary);
|
|
697
|
+
}
|
|
698
|
+
catch {
|
|
699
|
+
// nothing was written
|
|
700
|
+
}
|
|
701
|
+
throw error;
|
|
702
|
+
}
|
|
703
|
+
return { file: plan.file, revision: plan.revision };
|
|
704
|
+
}
|
|
705
|
+
function sourceOf(source) {
|
|
706
|
+
if (!source)
|
|
707
|
+
return undefined;
|
|
708
|
+
return {
|
|
709
|
+
file: source.path,
|
|
710
|
+
revision: revisionOf(source.text) ?? '',
|
|
711
|
+
raw: rawOf(source),
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
function sourcesFor(project, global) {
|
|
715
|
+
const result = {};
|
|
716
|
+
const p = sourceOf(project);
|
|
717
|
+
const g = sourceOf(global);
|
|
718
|
+
if (p)
|
|
719
|
+
result.project = p;
|
|
720
|
+
if (g)
|
|
721
|
+
result.global = g;
|
|
722
|
+
return result;
|
|
723
|
+
}
|
|
724
|
+
function valuesOf(specialist) {
|
|
725
|
+
return {
|
|
726
|
+
name: specialist.name,
|
|
727
|
+
runtime: specialist.runtime,
|
|
728
|
+
model: specialist.model,
|
|
729
|
+
permissions: specialist.permissions,
|
|
730
|
+
timeout: formatDuration(specialist.timeoutSeconds),
|
|
731
|
+
allow_commands: specialist.allowCommands,
|
|
732
|
+
tools: specialist.tools,
|
|
733
|
+
skills: specialist.skills,
|
|
734
|
+
prompt: specialist.prompt,
|
|
735
|
+
max: specialist.max,
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
function settingsOf(config) {
|
|
739
|
+
return [
|
|
740
|
+
['max', config.max],
|
|
741
|
+
['workspace_dir', config.workspaceDir],
|
|
742
|
+
['outside_changes', config.outsideChanges],
|
|
743
|
+
['defaults.runtime', config.defaults.runtime],
|
|
744
|
+
['defaults.permissions', config.defaults.permissions],
|
|
745
|
+
['defaults.timeout', formatDuration(config.defaults.timeoutSeconds)],
|
|
746
|
+
['defaults.allow_commands', config.defaults.allowCommands],
|
|
747
|
+
['defaults.tools', config.defaults.tools],
|
|
748
|
+
['claude.edit_mode', config.claude.editMode],
|
|
749
|
+
['claude.mcp', config.claude.mcp],
|
|
750
|
+
['claude.settings', config.claude.settings],
|
|
751
|
+
['delivery.mode', config.delivery.mode],
|
|
752
|
+
['delivery.auto', config.delivery.auto],
|
|
753
|
+
['delivery.keep', config.delivery.keep],
|
|
754
|
+
['delivery.commit_message', config.delivery.commitMessage],
|
|
755
|
+
['delivery.message_specialist', config.delivery.messageSpecialist],
|
|
756
|
+
['delivery.resolver', config.delivery.resolver],
|
|
757
|
+
['delivery.resolver_rounds', config.delivery.resolverRounds],
|
|
758
|
+
['delivery.message_prompt', config.delivery.messagePrompt ?? null],
|
|
759
|
+
['delivery.resolver_prompt', config.delivery.resolverPrompt ?? null],
|
|
760
|
+
['workspace.base', config.workspace.base],
|
|
761
|
+
['workspace.include', config.workspace.include],
|
|
762
|
+
['naming.enabled', config.naming.enabled],
|
|
763
|
+
['naming.runtime', config.naming.runtime],
|
|
764
|
+
['naming.model', config.naming.model],
|
|
765
|
+
];
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* `web.*` and `runtimes.*` as the daemon reads them: from the global settings.yaml only. The value
|
|
769
|
+
* of `env` never leaves the config layer: only the sorted names of the variables do.
|
|
770
|
+
*/
|
|
771
|
+
function globalSectionSettings(paths, global) {
|
|
772
|
+
const file = global.settings?.path ?? null;
|
|
773
|
+
const root = isMapping(global.settings?.value) ? global.settings.value : {};
|
|
774
|
+
const has = (section, ...keys) => {
|
|
775
|
+
let node = root[section];
|
|
776
|
+
for (const key of keys) {
|
|
777
|
+
if (!isMapping(node) || !(key in node))
|
|
778
|
+
return false;
|
|
779
|
+
node = node[key];
|
|
780
|
+
}
|
|
781
|
+
return true;
|
|
782
|
+
};
|
|
783
|
+
const originOf = (section, ...keys) => (has(section, ...keys) ? file : null);
|
|
784
|
+
const safe = (read, fallback) => {
|
|
785
|
+
try {
|
|
786
|
+
return read();
|
|
787
|
+
}
|
|
788
|
+
catch (error) {
|
|
789
|
+
if (error instanceof ConfigLoadError)
|
|
790
|
+
return fallback();
|
|
791
|
+
throw error;
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
const web = safe(() => loadWebSettings(paths), defaultWeb);
|
|
795
|
+
const runtimes = safe(() => loadRuntimeSettings(paths), defaultRuntimes);
|
|
796
|
+
return sectionValues(web, runtimes).map(([path, value]) => ({
|
|
797
|
+
path,
|
|
798
|
+
value,
|
|
799
|
+
file: originOf(...path.split('.')),
|
|
800
|
+
}));
|
|
801
|
+
}
|
|
802
|
+
/** `web.*` and `runtimes.*` values as pairs; the value of `env` is reduced to the sorted names. */
|
|
803
|
+
function sectionValues(web, runtimes) {
|
|
804
|
+
const result = [
|
|
805
|
+
['web.autostart', web.autostart],
|
|
806
|
+
['web.auth', web.auth],
|
|
807
|
+
['web.host', web.host],
|
|
808
|
+
['web.port', web.port],
|
|
809
|
+
];
|
|
810
|
+
for (const runtime of RUNTIMES) {
|
|
811
|
+
const command = runtimes[runtime];
|
|
812
|
+
result.push([`runtimes.${runtime}.command`, command.command], [`runtimes.${runtime}.args`, command.args], [`runtimes.${runtime}.env`, Object.keys(command.env).sort()]);
|
|
813
|
+
}
|
|
814
|
+
return result;
|
|
815
|
+
}
|
|
816
|
+
/** Settings that are not valid are shown with the defaults, the errors say what is wrong. */
|
|
817
|
+
function configOrDefaults(config) {
|
|
818
|
+
if (config)
|
|
819
|
+
return config;
|
|
820
|
+
const result = validateConfig({ swarm: {} });
|
|
821
|
+
if (!result.ok)
|
|
822
|
+
throw new Error('the empty configuration must be valid');
|
|
823
|
+
return result.config;
|
|
824
|
+
}
|
|
825
|
+
function rawOf(source) {
|
|
826
|
+
return isMapping(source?.value) ? source.value : {};
|
|
827
|
+
}
|
|
828
|
+
/** Everything the specialists tab shows, also when the configuration does not pass validation. */
|
|
829
|
+
export function editorView(paths) {
|
|
830
|
+
const files = readLevels(paths);
|
|
831
|
+
const global = assembleLevel(files.global);
|
|
832
|
+
const project = assembleLevel(files.project);
|
|
833
|
+
const { config, errors } = resolution(global, project);
|
|
834
|
+
const byStem = (sources) => new Map(sources.map((source) => [stemOf(source.path), source]));
|
|
835
|
+
const globalSpecialists = byStem(files.global.specialists);
|
|
836
|
+
const projectSpecialists = byStem(files.project.specialists);
|
|
837
|
+
const merged = mergeConfigs(global.tree, project.tree);
|
|
838
|
+
const swarm = isMapping(merged) && isMapping(merged.swarm) ? merged.swarm : {};
|
|
839
|
+
const defaults = isMapping(swarm.defaults) ? swarm.defaults : {};
|
|
840
|
+
const slugs = [...new Set([...globalSpecialists.keys(), ...projectSpecialists.keys()])].sort();
|
|
841
|
+
const specialists = slugs.map((slug) => {
|
|
842
|
+
const inProject = projectSpecialists.get(slug);
|
|
843
|
+
const inGlobal = globalSpecialists.get(slug);
|
|
844
|
+
const source = (inProject ?? inGlobal);
|
|
845
|
+
const level = inProject ? (inGlobal ? 'project_over_global' : 'project') : 'global';
|
|
846
|
+
let effective = null;
|
|
847
|
+
const resolved = config?.specialists.find((candidate) => candidate.slug === slug);
|
|
848
|
+
if (resolved)
|
|
849
|
+
effective = valuesOf(resolved);
|
|
850
|
+
else {
|
|
851
|
+
const alone = validateConfig({
|
|
852
|
+
swarm: { defaults, specialists: { [slug]: source.value ?? null } },
|
|
853
|
+
});
|
|
854
|
+
const found = alone.ok ? alone.config.specialists[0] : undefined;
|
|
855
|
+
if (found)
|
|
856
|
+
effective = valuesOf(found);
|
|
857
|
+
}
|
|
858
|
+
return {
|
|
859
|
+
slug,
|
|
860
|
+
level,
|
|
861
|
+
file: source.path,
|
|
862
|
+
revision: inProject ? revisionOf(inProject.text) : null,
|
|
863
|
+
raw: rawOf(source),
|
|
864
|
+
sources: sourcesFor(inProject, inGlobal),
|
|
865
|
+
effective,
|
|
866
|
+
shared_tags: tagsOf(rawOf(inGlobal)),
|
|
867
|
+
own_tags: tagsOf(rawOf(inProject)),
|
|
868
|
+
};
|
|
869
|
+
});
|
|
870
|
+
const globalPipelines = byStem(files.global.pipelines);
|
|
871
|
+
const projectPipelines = byStem(files.project.pipelines);
|
|
872
|
+
const pipelines = [...new Set([...globalPipelines.keys(), ...projectPipelines.keys()])]
|
|
873
|
+
.sort()
|
|
874
|
+
.map((id) => {
|
|
875
|
+
const inProject = projectPipelines.get(id);
|
|
876
|
+
const inGlobal = globalPipelines.get(id);
|
|
877
|
+
const source = (inProject ?? inGlobal);
|
|
878
|
+
return {
|
|
879
|
+
id,
|
|
880
|
+
level: inProject ? (inGlobal ? 'project_over_global' : 'project') : 'global',
|
|
881
|
+
file: source.path,
|
|
882
|
+
revision: inProject ? revisionOf(inProject.text) : null,
|
|
883
|
+
raw: rawOf(source),
|
|
884
|
+
sources: sourcesFor(inProject, inGlobal),
|
|
885
|
+
shared_tags: tagsOf(rawOf(inGlobal)),
|
|
886
|
+
own_tags: tagsOf(rawOf(inProject)),
|
|
887
|
+
};
|
|
888
|
+
});
|
|
889
|
+
const globalActions = byStem(files.global.actions);
|
|
890
|
+
const projectActions = byStem(files.project.actions);
|
|
891
|
+
const actions = [...new Set([...globalActions.keys(), ...projectActions.keys()])]
|
|
892
|
+
.sort()
|
|
893
|
+
.map((id) => {
|
|
894
|
+
const inProject = projectActions.get(id);
|
|
895
|
+
const inGlobal = globalActions.get(id);
|
|
896
|
+
const source = (inProject ?? inGlobal);
|
|
897
|
+
return {
|
|
898
|
+
id,
|
|
899
|
+
level: inProject ? (inGlobal ? 'project_over_global' : 'project') : 'global',
|
|
900
|
+
file: source.path,
|
|
901
|
+
revision: inProject ? revisionOf(inProject.text) : null,
|
|
902
|
+
raw: rawOf(source),
|
|
903
|
+
sources: sourcesFor(inProject, inGlobal),
|
|
904
|
+
};
|
|
905
|
+
});
|
|
906
|
+
const origins = mergeOrigins(global, project);
|
|
907
|
+
const base = [
|
|
908
|
+
...settingsOf(configOrDefaults(config)).map(([path, value]) => ({
|
|
909
|
+
path,
|
|
910
|
+
value,
|
|
911
|
+
file: origins.get(`swarm.${path}`) ?? null,
|
|
912
|
+
})),
|
|
913
|
+
...globalSectionSettings(paths, files.global),
|
|
914
|
+
];
|
|
915
|
+
const defaultValues = new Map([
|
|
916
|
+
...settingsOf(configOrDefaults(null)),
|
|
917
|
+
...sectionValues(defaultWeb(), defaultRuntimes()),
|
|
918
|
+
]);
|
|
919
|
+
const aloneConfig = resolution(global, emptyLevel()).config;
|
|
920
|
+
const globalValues = new Map(settingsOf(configOrDefaults(aloneConfig)));
|
|
921
|
+
const writtenOf = (source, path, kind) => {
|
|
922
|
+
let node = source?.value;
|
|
923
|
+
for (const part of path.split('.')) {
|
|
924
|
+
if (!isMapping(node) || !(part in node))
|
|
925
|
+
return undefined;
|
|
926
|
+
node = node[part];
|
|
927
|
+
}
|
|
928
|
+
return kind === 'env' && isMapping(node) ? Object.keys(node).sort() : node;
|
|
929
|
+
};
|
|
930
|
+
const settings = base.map((entry) => {
|
|
931
|
+
const setting = settingFieldOf(entry.path);
|
|
932
|
+
const written = {};
|
|
933
|
+
const inGlobal = writtenOf(files.global.settings, entry.path, setting.kind);
|
|
934
|
+
const inProject = setting.globalOnly
|
|
935
|
+
? undefined
|
|
936
|
+
: writtenOf(files.project.settings, entry.path, setting.kind);
|
|
937
|
+
if (inGlobal !== undefined)
|
|
938
|
+
written.global = inGlobal;
|
|
939
|
+
if (inProject !== undefined)
|
|
940
|
+
written.project = inProject;
|
|
941
|
+
return {
|
|
942
|
+
...entry,
|
|
943
|
+
kind: setting.kind,
|
|
944
|
+
...(setting.options ? { options: setting.options } : {}),
|
|
945
|
+
...(setting.range ? { range: setting.range } : {}),
|
|
946
|
+
globalOnly: setting.globalOnly,
|
|
947
|
+
defaultValue: defaultValues.get(entry.path),
|
|
948
|
+
globalValue: setting.globalOnly ? entry.value : globalValues.get(entry.path),
|
|
949
|
+
written,
|
|
950
|
+
};
|
|
951
|
+
});
|
|
952
|
+
const settingsView = (level) => ({
|
|
953
|
+
file: settingsFile(paths, level),
|
|
954
|
+
revision: revisionOf(files[level].settings?.text),
|
|
955
|
+
});
|
|
956
|
+
return {
|
|
957
|
+
directories: { global: paths.global.directory, project: paths.project.directory },
|
|
958
|
+
settingsFiles: { global: settingsView('global'), project: settingsView('project') },
|
|
959
|
+
specialists,
|
|
960
|
+
pipelines,
|
|
961
|
+
actions,
|
|
962
|
+
settings,
|
|
963
|
+
errors,
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
//# sourceMappingURL=edit.js.map
|