@hoknie/aip 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +13 -0
- package/README.md +74 -2
- package/dist/app/agents.js +20 -0
- package/dist/app/agents.js.map +1 -0
- package/dist/app/application.js +205 -0
- package/dist/app/application.js.map +1 -0
- package/dist/app/daemon.js +71 -0
- package/dist/app/daemon.js.map +1 -0
- package/dist/app/index.js +5 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/lifecycle.js +34 -0
- package/dist/app/lifecycle.js.map +1 -0
- package/dist/app/maintenance.js +27 -0
- package/dist/app/maintenance.js.map +1 -0
- package/dist/app/timings.js +24 -0
- package/dist/app/timings.js.map +1 -0
- package/dist/app/wiring.js +58 -0
- package/dist/app/wiring.js.map +1 -0
- package/dist/cli/main.js +31 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/feature/agents/clients/agy/events.js +36 -0
- package/dist/feature/agents/clients/agy/events.js.map +1 -0
- package/dist/feature/agents/clients/agy/guard-commands.js +29 -0
- package/dist/feature/agents/clients/agy/guard-commands.js.map +1 -0
- package/dist/feature/agents/clients/agy/guard-paths.js +36 -0
- package/dist/feature/agents/clients/agy/guard-paths.js.map +1 -0
- package/dist/feature/agents/clients/agy/guard.js +77 -0
- package/dist/feature/agents/clients/agy/guard.js.map +1 -0
- package/dist/feature/agents/clients/agy/hooks.js +46 -0
- package/dist/feature/agents/clients/agy/hooks.js.map +1 -0
- package/dist/feature/agents/clients/agy/index.js +5 -0
- package/dist/feature/agents/clients/agy/index.js.map +1 -0
- package/dist/feature/agents/clients/agy/parser.js +63 -0
- package/dist/feature/agents/clients/agy/parser.js.map +1 -0
- package/dist/feature/agents/clients/agy/permissions.js +40 -0
- package/dist/feature/agents/clients/agy/permissions.js.map +1 -0
- package/dist/feature/agents/clients/agy/runtime.js +115 -0
- package/dist/feature/agents/clients/agy/runtime.js.map +1 -0
- package/dist/feature/agents/clients/agy/transcript.js +65 -0
- package/dist/feature/agents/clients/agy/transcript.js.map +1 -0
- package/dist/feature/agents/clients/claude/index.js +6 -0
- package/dist/feature/agents/clients/claude/index.js.map +1 -0
- package/dist/feature/agents/clients/claude/models.js +8 -0
- package/dist/feature/agents/clients/claude/models.js.map +1 -0
- package/dist/feature/agents/clients/claude/parser.js +229 -0
- package/dist/feature/agents/clients/claude/parser.js.map +1 -0
- package/dist/feature/agents/clients/claude/permissions.js +70 -0
- package/dist/feature/agents/clients/claude/permissions.js.map +1 -0
- package/dist/feature/agents/clients/claude/runtime.js +118 -0
- package/dist/feature/agents/clients/claude/runtime.js.map +1 -0
- package/dist/feature/agents/clients/claude/transcript.js +105 -0
- package/dist/feature/agents/clients/claude/transcript.js.map +1 -0
- package/dist/feature/agents/clients/naming/index.js +2 -0
- package/dist/feature/agents/clients/naming/index.js.map +1 -0
- package/dist/feature/agents/clients/naming/naming.js +15 -0
- package/dist/feature/agents/clients/naming/naming.js.map +1 -0
- package/dist/feature/agents/clients/opencode/index.js +5 -0
- package/dist/feature/agents/clients/opencode/index.js.map +1 -0
- package/dist/feature/agents/clients/opencode/models.js +38 -0
- package/dist/feature/agents/clients/opencode/models.js.map +1 -0
- package/dist/feature/agents/clients/opencode/parser.js +84 -0
- package/dist/feature/agents/clients/opencode/parser.js.map +1 -0
- package/dist/feature/agents/clients/opencode/runtime.js +131 -0
- package/dist/feature/agents/clients/opencode/runtime.js.map +1 -0
- package/dist/feature/agents/clients/opencode/transcript.js +77 -0
- package/dist/feature/agents/clients/opencode/transcript.js.map +1 -0
- package/dist/feature/agents/ports/command.js +2 -0
- package/dist/feature/agents/ports/command.js.map +1 -0
- package/dist/feature/agents/ports/index.js +2 -0
- package/dist/feature/agents/ports/index.js.map +1 -0
- package/dist/feature/agents/ports/naming.js +2 -0
- package/dist/feature/agents/ports/naming.js.map +1 -0
- package/dist/feature/agents/ports/runtime-factory.js +2 -0
- package/dist/feature/agents/ports/runtime-factory.js.map +1 -0
- package/dist/feature/agents/services/agents.js +79 -0
- package/dist/feature/agents/services/agents.js.map +1 -0
- package/dist/feature/agents/services/catalog.js +117 -0
- package/dist/feature/agents/services/catalog.js.map +1 -0
- package/dist/feature/agents/services/create.js +5 -0
- package/dist/feature/agents/services/create.js.map +1 -0
- package/dist/feature/agents/services/index.js +7 -0
- package/dist/feature/agents/services/index.js.map +1 -0
- package/dist/feature/agents/services/logs.js +69 -0
- package/dist/feature/agents/services/logs.js.map +1 -0
- package/dist/feature/agents/services/skills.js +17 -0
- package/dist/feature/agents/services/skills.js.map +1 -0
- package/dist/feature/agents/services/supervisor.js +160 -0
- package/dist/feature/agents/services/supervisor.js.map +1 -0
- package/dist/feature/agents/types/catalog.js +2 -0
- package/dist/feature/agents/types/catalog.js.map +1 -0
- package/dist/feature/agents/types/index.js +13 -0
- package/dist/feature/agents/types/index.js.map +1 -0
- package/dist/feature/agents/types/message.js +49 -0
- package/dist/feature/agents/types/message.js.map +1 -0
- package/dist/feature/agents/types/models.js +2 -0
- package/dist/feature/agents/types/models.js.map +1 -0
- package/dist/feature/agents/types/naming.js +4 -0
- package/dist/feature/agents/types/naming.js.map +1 -0
- package/dist/feature/agents/types/permissions.js +235 -0
- package/dist/feature/agents/types/permissions.js.map +1 -0
- package/dist/feature/agents/types/run-naming.js +66 -0
- package/dist/feature/agents/types/run-naming.js.map +1 -0
- package/dist/feature/agents/types/runtime.js +18 -0
- package/dist/feature/agents/types/runtime.js.map +1 -0
- package/dist/feature/agents/types/step-input.js +2 -0
- package/dist/feature/agents/types/step-input.js.map +1 -0
- package/dist/feature/agents/types/transcript-parts.js +62 -0
- package/dist/feature/agents/types/transcript-parts.js.map +1 -0
- package/dist/feature/agents/types/transcript.js +8 -0
- package/dist/feature/agents/types/transcript.js.map +1 -0
- package/dist/feature/agents/types/usage.js +14 -0
- package/dist/feature/agents/types/usage.js.map +1 -0
- package/dist/feature/agents/types/worker-tools.js +22 -0
- package/dist/feature/agents/types/worker-tools.js.map +1 -0
- package/dist/feature/artifacts/ports/index.js +2 -0
- package/dist/feature/artifacts/ports/index.js.map +1 -0
- package/dist/feature/artifacts/ports/publish.js +2 -0
- package/dist/feature/artifacts/ports/publish.js.map +1 -0
- package/dist/feature/artifacts/repositories/artifact-storage.js +84 -0
- package/dist/feature/artifacts/repositories/artifact-storage.js.map +1 -0
- package/dist/feature/artifacts/repositories/artifacts.js +85 -0
- package/dist/feature/artifacts/repositories/artifacts.js.map +1 -0
- package/dist/feature/artifacts/repositories/index.js +3 -0
- package/dist/feature/artifacts/repositories/index.js.map +1 -0
- package/dist/feature/artifacts/services/artifacts.js +105 -0
- package/dist/feature/artifacts/services/artifacts.js.map +1 -0
- package/dist/feature/artifacts/services/create.js +14 -0
- package/dist/feature/artifacts/services/create.js.map +1 -0
- package/dist/feature/artifacts/services/files.js +42 -0
- package/dist/feature/artifacts/services/files.js.map +1 -0
- package/dist/feature/artifacts/services/index.js +3 -0
- package/dist/feature/artifacts/services/index.js.map +1 -0
- package/dist/feature/artifacts/types/artifacts.js +36 -0
- package/dist/feature/artifacts/types/artifacts.js.map +1 -0
- package/dist/feature/artifacts/types/index.js +2 -0
- package/dist/feature/artifacts/types/index.js.map +1 -0
- package/dist/feature/artifacts/types/views.js +2 -0
- package/dist/feature/artifacts/types/views.js.map +1 -0
- package/dist/feature/compose/services/create.js +11 -0
- package/dist/feature/compose/services/create.js.map +1 -0
- package/dist/feature/compose/services/index.js +5 -0
- package/dist/feature/compose/services/index.js.map +1 -0
- package/dist/feature/compose/services/repository-edit.js +20 -0
- package/dist/feature/compose/services/repository-edit.js.map +1 -0
- package/dist/feature/compose/services/repository-move.js +35 -0
- package/dist/feature/compose/services/repository-move.js.map +1 -0
- package/dist/feature/compose/services/repository-removal.js +38 -0
- package/dist/feature/compose/services/repository-removal.js.map +1 -0
- package/dist/feature/delivery/ports/index.js +2 -0
- package/dist/feature/delivery/ports/index.js.map +1 -0
- package/dist/feature/delivery/ports/publish.js +2 -0
- package/dist/feature/delivery/ports/publish.js.map +1 -0
- package/dist/feature/delivery/repositories/index.js +3 -0
- package/dist/feature/delivery/repositories/index.js.map +1 -0
- package/dist/feature/delivery/repositories/patch-storage.js +76 -0
- package/dist/feature/delivery/repositories/patch-storage.js.map +1 -0
- package/dist/feature/delivery/repositories/patches.js +28 -0
- package/dist/feature/delivery/repositories/patches.js.map +1 -0
- package/dist/feature/delivery/services/create.js +21 -0
- package/dist/feature/delivery/services/create.js.map +1 -0
- package/dist/feature/delivery/services/deliver.js +67 -0
- package/dist/feature/delivery/services/deliver.js.map +1 -0
- package/dist/feature/delivery/services/diffs.js +153 -0
- package/dist/feature/delivery/services/diffs.js.map +1 -0
- package/dist/feature/delivery/services/index.js +5 -0
- package/dist/feature/delivery/services/index.js.map +1 -0
- package/dist/feature/delivery/services/patches.js +96 -0
- package/dist/feature/delivery/services/patches.js.map +1 -0
- package/dist/feature/delivery/types/index.js +3 -0
- package/dist/feature/delivery/types/index.js.map +1 -0
- package/dist/feature/delivery/types/outcomes.js +2 -0
- package/dist/feature/delivery/types/outcomes.js.map +1 -0
- package/dist/feature/delivery/types/spec-change.js +18 -0
- package/dist/feature/delivery/types/spec-change.js.map +1 -0
- package/dist/feature/network/ports/changed.js +2 -0
- package/dist/feature/network/ports/changed.js.map +1 -0
- package/dist/feature/network/ports/index.js +2 -0
- package/dist/feature/network/ports/index.js.map +1 -0
- package/dist/feature/network/services/create.js +5 -0
- package/dist/feature/network/services/create.js.map +1 -0
- package/dist/feature/network/services/index.js +3 -0
- package/dist/feature/network/services/index.js.map +1 -0
- package/dist/feature/network/services/monitor.js +140 -0
- package/dist/feature/network/services/monitor.js.map +1 -0
- package/dist/feature/network/types/index.js +4 -0
- package/dist/feature/network/types/index.js.map +1 -0
- package/dist/feature/network/types/network.js +8 -0
- package/dist/feature/network/types/network.js.map +1 -0
- package/dist/feature/network/types/proxy.js +95 -0
- package/dist/feature/network/types/proxy.js.map +1 -0
- package/dist/feature/network/types/state.js +36 -0
- package/dist/feature/network/types/state.js.map +1 -0
- package/dist/feature/observers/ports/index.js +2 -0
- package/dist/feature/observers/ports/index.js.map +1 -0
- package/dist/feature/observers/ports/publish.js +2 -0
- package/dist/feature/observers/ports/publish.js.map +1 -0
- package/dist/feature/observers/repositories/index.js +2 -0
- package/dist/feature/observers/repositories/index.js.map +1 -0
- package/dist/feature/observers/repositories/observers.js +34 -0
- package/dist/feature/observers/repositories/observers.js.map +1 -0
- package/dist/feature/observers/services/create.js +11 -0
- package/dist/feature/observers/services/create.js.map +1 -0
- package/dist/feature/observers/services/history.js +76 -0
- package/dist/feature/observers/services/history.js.map +1 -0
- package/dist/feature/observers/services/index.js +5 -0
- package/dist/feature/observers/services/index.js.map +1 -0
- package/dist/feature/observers/services/observers.js +188 -0
- package/dist/feature/observers/services/observers.js.map +1 -0
- package/dist/feature/observers/services/settings-check.js +87 -0
- package/dist/feature/observers/services/settings-check.js.map +1 -0
- package/dist/feature/observers/types/actions.js +2 -0
- package/dist/feature/observers/types/actions.js.map +1 -0
- package/dist/feature/observers/types/index.js +4 -0
- package/dist/feature/observers/types/index.js.map +1 -0
- package/dist/feature/observers/types/plan-repairs.js +116 -0
- package/dist/feature/observers/types/plan-repairs.js.map +1 -0
- package/dist/feature/observers/types/settings.js +12 -0
- package/dist/feature/observers/types/settings.js.map +1 -0
- package/dist/feature/processes/ports/index.js +2 -0
- package/dist/feature/processes/ports/index.js.map +1 -0
- package/dist/feature/processes/ports/publish.js +2 -0
- package/dist/feature/processes/ports/publish.js.map +1 -0
- package/dist/feature/processes/services/create.js +5 -0
- package/dist/feature/processes/services/create.js.map +1 -0
- package/dist/feature/processes/services/index.js +4 -0
- package/dist/feature/processes/services/index.js.map +1 -0
- package/dist/feature/processes/services/processes.js +131 -0
- package/dist/feature/processes/services/processes.js.map +1 -0
- package/dist/feature/processes/services/tree.js +98 -0
- package/dist/feature/processes/services/tree.js.map +1 -0
- package/dist/feature/processes/types/background.js +2 -0
- package/dist/feature/processes/types/background.js.map +1 -0
- package/dist/feature/processes/types/index.js +2 -0
- package/dist/feature/processes/types/index.js.map +1 -0
- package/dist/feature/queue/ports/index.js +2 -0
- package/dist/feature/queue/ports/index.js.map +1 -0
- package/dist/feature/queue/ports/observe.js +2 -0
- package/dist/feature/queue/ports/observe.js.map +1 -0
- package/dist/feature/queue/ports/publish.js +2 -0
- package/dist/feature/queue/ports/publish.js.map +1 -0
- package/dist/feature/queue/ports/repair-policy.js +2 -0
- package/dist/feature/queue/ports/repair-policy.js.map +1 -0
- package/dist/feature/queue/repositories/index.js +2 -0
- package/dist/feature/queue/repositories/index.js.map +1 -0
- package/dist/feature/queue/repositories/queues.js +100 -0
- package/dist/feature/queue/repositories/queues.js.map +1 -0
- package/dist/feature/queue/services/advance.js +214 -0
- package/dist/feature/queue/services/advance.js.map +1 -0
- package/dist/feature/queue/services/control.js +169 -0
- package/dist/feature/queue/services/control.js.map +1 -0
- package/dist/feature/queue/services/create.js +26 -0
- package/dist/feature/queue/services/create.js.map +1 -0
- package/dist/feature/queue/services/edit.js +126 -0
- package/dist/feature/queue/services/edit.js.map +1 -0
- package/dist/feature/queue/services/index.js +8 -0
- package/dist/feature/queue/services/index.js.map +1 -0
- package/dist/feature/queue/services/items.js +173 -0
- package/dist/feature/queue/services/items.js.map +1 -0
- package/dist/feature/queue/services/store.js +61 -0
- package/dist/feature/queue/services/store.js.map +1 -0
- package/dist/feature/queue/services/task-tags.js +103 -0
- package/dist/feature/queue/services/task-tags.js.map +1 -0
- package/dist/feature/queue/types/advance.js +198 -0
- package/dist/feature/queue/types/advance.js.map +1 -0
- package/dist/feature/queue/types/dependencies.js +98 -0
- package/dist/feature/queue/types/dependencies.js.map +1 -0
- package/dist/feature/queue/types/edit.js +180 -0
- package/dist/feature/queue/types/edit.js.map +1 -0
- package/dist/feature/queue/types/ids.js +7 -0
- package/dist/feature/queue/types/ids.js.map +1 -0
- package/dist/feature/queue/types/index.js +10 -0
- package/dist/feature/queue/types/index.js.map +1 -0
- package/dist/feature/queue/types/items.js +46 -0
- package/dist/feature/queue/types/items.js.map +1 -0
- package/dist/feature/queue/types/limit-hits.js +50 -0
- package/dist/feature/queue/types/limit-hits.js.map +1 -0
- package/dist/feature/queue/types/requests.js +2 -0
- package/dist/feature/queue/types/requests.js.map +1 -0
- package/dist/feature/queue/types/returns.js +197 -0
- package/dist/feature/queue/types/returns.js.map +1 -0
- package/dist/feature/queue/types/settings.js +117 -0
- package/dist/feature/queue/types/settings.js.map +1 -0
- package/dist/feature/repos/ports/index.js +2 -0
- package/dist/feature/repos/ports/index.js.map +1 -0
- package/dist/feature/repos/ports/publish.js +2 -0
- package/dist/feature/repos/ports/publish.js.map +1 -0
- package/dist/feature/repos/repositories/index.js +2 -0
- package/dist/feature/repos/repositories/index.js.map +1 -0
- package/dist/feature/repos/repositories/known.js +41 -0
- package/dist/feature/repos/repositories/known.js.map +1 -0
- package/dist/feature/repos/services/create.js +13 -0
- package/dist/feature/repos/services/create.js.map +1 -0
- package/dist/feature/repos/services/index.js +4 -0
- package/dist/feature/repos/services/index.js.map +1 -0
- package/dist/feature/repos/services/projects.js +50 -0
- package/dist/feature/repos/services/projects.js.map +1 -0
- package/dist/feature/repos/services/registry.js +138 -0
- package/dist/feature/repos/services/registry.js.map +1 -0
- package/dist/feature/repos/types/index.js +2 -0
- package/dist/feature/repos/types/index.js.map +1 -0
- package/dist/feature/repos/types/project.js +80 -0
- package/dist/feature/repos/types/project.js.map +1 -0
- package/dist/feature/repos/types/registry.js +2 -0
- package/dist/feature/repos/types/registry.js.map +1 -0
- package/dist/feature/runs/machine/answers.js +112 -0
- package/dist/feature/runs/machine/answers.js.map +1 -0
- package/dist/feature/runs/machine/delivery-checks.js +91 -0
- package/dist/feature/runs/machine/delivery-checks.js.map +1 -0
- package/dist/feature/runs/machine/delivery-flow.js +211 -0
- package/dist/feature/runs/machine/delivery-flow.js.map +1 -0
- package/dist/feature/runs/machine/events.js +2 -0
- package/dist/feature/runs/machine/events.js.map +1 -0
- package/dist/feature/runs/machine/exits.js +229 -0
- package/dist/feature/runs/machine/exits.js.map +1 -0
- package/dist/feature/runs/machine/index.js +7 -0
- package/dist/feature/runs/machine/index.js.map +1 -0
- package/dist/feature/runs/machine/plan.js +133 -0
- package/dist/feature/runs/machine/plan.js.map +1 -0
- package/dist/feature/runs/machine/repair.js +158 -0
- package/dist/feature/runs/machine/repair.js.map +1 -0
- package/dist/feature/runs/machine/run-control.js +276 -0
- package/dist/feature/runs/machine/run-control.js.map +1 -0
- package/dist/feature/runs/machine/scheduler.js +126 -0
- package/dist/feature/runs/machine/scheduler.js.map +1 -0
- package/dist/feature/runs/machine/steps.js +275 -0
- package/dist/feature/runs/machine/steps.js.map +1 -0
- package/dist/feature/runs/machine/texts.js +69 -0
- package/dist/feature/runs/machine/texts.js.map +1 -0
- package/dist/feature/runs/machine/transition.js +117 -0
- package/dist/feature/runs/machine/transition.js.map +1 -0
- package/dist/feature/runs/ports/agent-exit.js +2 -0
- package/dist/feature/runs/ports/agent-exit.js.map +1 -0
- package/dist/feature/runs/ports/diff.js +2 -0
- package/dist/feature/runs/ports/diff.js.map +1 -0
- package/dist/feature/runs/ports/index.js +2 -0
- package/dist/feature/runs/ports/index.js.map +1 -0
- package/dist/feature/runs/ports/observe.js +2 -0
- package/dist/feature/runs/ports/observe.js.map +1 -0
- package/dist/feature/runs/ports/publish.js +2 -0
- package/dist/feature/runs/ports/publish.js.map +1 -0
- package/dist/feature/runs/ports/queue-advance.js +2 -0
- package/dist/feature/runs/ports/queue-advance.js.map +1 -0
- package/dist/feature/runs/repositories/attempt-history.js +116 -0
- package/dist/feature/runs/repositories/attempt-history.js.map +1 -0
- package/dist/feature/runs/repositories/finished-runs.js +46 -0
- package/dist/feature/runs/repositories/finished-runs.js.map +1 -0
- package/dist/feature/runs/repositories/index.js +4 -0
- package/dist/feature/runs/repositories/index.js.map +1 -0
- package/dist/feature/runs/repositories/rows.js +110 -0
- package/dist/feature/runs/repositories/rows.js.map +1 -0
- package/dist/feature/runs/repositories/runs.js +76 -0
- package/dist/feature/runs/repositories/runs.js.map +1 -0
- package/dist/feature/runs/repositories/write.js +31 -0
- package/dist/feature/runs/repositories/write.js.map +1 -0
- package/dist/feature/runs/services/archive.js +17 -0
- package/dist/feature/runs/services/archive.js.map +1 -0
- package/dist/feature/runs/services/attempt-history.js +11 -0
- package/dist/feature/runs/services/attempt-history.js.map +1 -0
- package/dist/feature/runs/services/create.js +44 -0
- package/dist/feature/runs/services/create.js.map +1 -0
- package/dist/feature/runs/services/effects/actions.js +151 -0
- package/dist/feature/runs/services/effects/actions.js.map +1 -0
- package/dist/feature/runs/services/effects/attempts.js +219 -0
- package/dist/feature/runs/services/effects/attempts.js.map +1 -0
- package/dist/feature/runs/services/effects/context.js +7 -0
- package/dist/feature/runs/services/effects/context.js.map +1 -0
- package/dist/feature/runs/services/effects/effects.js +82 -0
- package/dist/feature/runs/services/effects/effects.js.map +1 -0
- package/dist/feature/runs/services/effects/git.js +168 -0
- package/dist/feature/runs/services/effects/git.js.map +1 -0
- package/dist/feature/runs/services/effects/naming.js +65 -0
- package/dist/feature/runs/services/effects/naming.js.map +1 -0
- package/dist/feature/runs/services/effects/outside.js +83 -0
- package/dist/feature/runs/services/effects/outside.js.map +1 -0
- package/dist/feature/runs/services/effects/proxy.js +5 -0
- package/dist/feature/runs/services/effects/proxy.js.map +1 -0
- package/dist/feature/runs/services/effects/running.js +76 -0
- package/dist/feature/runs/services/effects/running.js.map +1 -0
- package/dist/feature/runs/services/effects/usage.js +61 -0
- package/dist/feature/runs/services/effects/usage.js.map +1 -0
- package/dist/feature/runs/services/effects/worktrees.js +49 -0
- package/dist/feature/runs/services/effects/worktrees.js.map +1 -0
- package/dist/feature/runs/services/engine.js +172 -0
- package/dist/feature/runs/services/engine.js.map +1 -0
- package/dist/feature/runs/services/index.js +15 -0
- package/dist/feature/runs/services/index.js.map +1 -0
- package/dist/feature/runs/services/occupancy.js +62 -0
- package/dist/feature/runs/services/occupancy.js.map +1 -0
- package/dist/feature/runs/services/progress.js +42 -0
- package/dist/feature/runs/services/progress.js.map +1 -0
- package/dist/feature/runs/services/reads.js +93 -0
- package/dist/feature/runs/services/reads.js.map +1 -0
- package/dist/feature/runs/services/recovery.js +17 -0
- package/dist/feature/runs/services/recovery.js.map +1 -0
- package/dist/feature/runs/services/refresh.js +29 -0
- package/dist/feature/runs/services/refresh.js.map +1 -0
- package/dist/feature/runs/services/requests.js +88 -0
- package/dist/feature/runs/services/requests.js.map +1 -0
- package/dist/feature/runs/services/states.js +112 -0
- package/dist/feature/runs/services/states.js.map +1 -0
- package/dist/feature/runs/services/summary.js +38 -0
- package/dist/feature/runs/services/summary.js.map +1 -0
- package/dist/feature/runs/types/attempt.js +106 -0
- package/dist/feature/runs/types/attempt.js.map +1 -0
- package/dist/feature/runs/types/constants.js +45 -0
- package/dist/feature/runs/types/constants.js.map +1 -0
- package/dist/feature/runs/types/create.js +177 -0
- package/dist/feature/runs/types/create.js.map +1 -0
- package/dist/feature/runs/types/group.js +152 -0
- package/dist/feature/runs/types/group.js.map +1 -0
- package/dist/feature/runs/types/history/attempt-history.js +16 -0
- package/dist/feature/runs/types/history/attempt-history.js.map +1 -0
- package/dist/feature/runs/types/index.js +15 -0
- package/dist/feature/runs/types/index.js.map +1 -0
- package/dist/feature/runs/types/input.js +90 -0
- package/dist/feature/runs/types/input.js.map +1 -0
- package/dist/feature/runs/types/limits.js +163 -0
- package/dist/feature/runs/types/limits.js.map +1 -0
- package/dist/feature/runs/types/problems.js +74 -0
- package/dist/feature/runs/types/problems.js.map +1 -0
- package/dist/feature/runs/types/run.js +162 -0
- package/dist/feature/runs/types/run.js.map +1 -0
- package/dist/feature/runs/types/skip.js +110 -0
- package/dist/feature/runs/types/skip.js.map +1 -0
- package/dist/feature/runs/types/stage-status.js +156 -0
- package/dist/feature/runs/types/stage-status.js.map +1 -0
- package/dist/feature/runs/types/stages.js +158 -0
- package/dist/feature/runs/types/stages.js.map +1 -0
- package/dist/feature/runs/types/topology.js +165 -0
- package/dist/feature/runs/types/topology.js.map +1 -0
- package/dist/feature/stats/repositories/index.js +4 -0
- package/dist/feature/stats/repositories/index.js.map +1 -0
- package/dist/feature/stats/repositories/meta.js +19 -0
- package/dist/feature/stats/repositories/meta.js.map +1 -0
- package/dist/feature/stats/repositories/records.js +46 -0
- package/dist/feature/stats/repositories/records.js.map +1 -0
- package/dist/feature/stats/repositories/report.js +105 -0
- package/dist/feature/stats/repositories/report.js.map +1 -0
- package/dist/feature/stats/services/create.js +44 -0
- package/dist/feature/stats/services/create.js.map +1 -0
- package/dist/feature/stats/services/index.js +4 -0
- package/dist/feature/stats/services/index.js.map +1 -0
- package/dist/feature/stats/services/ledger.js +137 -0
- package/dist/feature/stats/services/ledger.js.map +1 -0
- package/dist/feature/stats/services/report.js +56 -0
- package/dist/feature/stats/services/report.js.map +1 -0
- package/dist/feature/stats/types/aggregate.js +179 -0
- package/dist/feature/stats/types/aggregate.js.map +1 -0
- package/dist/feature/stats/types/capture.js +79 -0
- package/dist/feature/stats/types/capture.js.map +1 -0
- package/dist/feature/stats/types/index.js +6 -0
- package/dist/feature/stats/types/index.js.map +1 -0
- package/dist/feature/stats/types/records.js +5 -0
- package/dist/feature/stats/types/records.js.map +1 -0
- package/dist/feature/stats/types/report.js +25 -0
- package/dist/feature/stats/types/report.js.map +1 -0
- package/dist/feature/stats/types/settings.js +2 -0
- package/dist/feature/stats/types/settings.js.map +1 -0
- package/dist/feature/swarm-config/repositories/config-files.js +141 -0
- package/dist/feature/swarm-config/repositories/config-files.js.map +1 -0
- package/dist/feature/swarm-config/services/assemble.js +212 -0
- package/dist/feature/swarm-config/services/assemble.js.map +1 -0
- package/dist/feature/swarm-config/services/create.js +5 -0
- package/dist/feature/swarm-config/services/create.js.map +1 -0
- package/dist/feature/swarm-config/services/discover.js +19 -0
- package/dist/feature/swarm-config/services/discover.js.map +1 -0
- package/dist/feature/swarm-config/services/index.js +10 -0
- package/dist/feature/swarm-config/services/index.js.map +1 -0
- package/dist/feature/swarm-config/services/load.js +101 -0
- package/dist/feature/swarm-config/services/load.js.map +1 -0
- package/dist/feature/swarm-config/services/sections/stats.js +28 -0
- package/dist/feature/swarm-config/services/sections/stats.js.map +1 -0
- package/dist/feature/swarm-config/services/settings.js +72 -0
- package/dist/feature/swarm-config/services/settings.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-actions.js +125 -0
- package/dist/feature/swarm-config/services/validate-actions.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-context.js +91 -0
- package/dist/feature/swarm-config/services/validate-context.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-pipelines.js +170 -0
- package/dist/feature/swarm-config/services/validate-pipelines.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-runtimes.js +214 -0
- package/dist/feature/swarm-config/services/validate-runtimes.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-settings.js +242 -0
- package/dist/feature/swarm-config/services/validate-settings.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-specialists.js +152 -0
- package/dist/feature/swarm-config/services/validate-specialists.js.map +1 -0
- package/dist/feature/swarm-config/services/validate.js +189 -0
- package/dist/feature/swarm-config/services/validate.js.map +1 -0
- package/dist/feature/swarm-config/types/action.js +20 -0
- package/dist/feature/swarm-config/types/action.js.map +1 -0
- package/dist/feature/swarm-config/types/chain.js +2 -0
- package/dist/feature/swarm-config/types/chain.js.map +1 -0
- package/dist/feature/swarm-config/types/duration.js +17 -0
- package/dist/feature/swarm-config/types/duration.js.map +1 -0
- package/dist/feature/swarm-config/types/errors.js +57 -0
- package/dist/feature/swarm-config/types/errors.js.map +1 -0
- package/dist/feature/swarm-config/types/index.js +13 -0
- package/dist/feature/swarm-config/types/index.js.map +1 -0
- package/dist/feature/swarm-config/types/levels.js +16 -0
- package/dist/feature/swarm-config/types/levels.js.map +1 -0
- package/dist/feature/swarm-config/types/lookups.js +53 -0
- package/dist/feature/swarm-config/types/lookups.js.map +1 -0
- package/dist/feature/swarm-config/types/merge.js +46 -0
- package/dist/feature/swarm-config/types/merge.js.map +1 -0
- package/dist/feature/swarm-config/types/pipeline.js +5 -0
- package/dist/feature/swarm-config/types/pipeline.js.map +1 -0
- package/dist/feature/swarm-config/types/prompt.js +33 -0
- package/dist/feature/swarm-config/types/prompt.js.map +1 -0
- package/dist/feature/swarm-config/types/settings.js +146 -0
- package/dist/feature/swarm-config/types/settings.js.map +1 -0
- package/dist/feature/swarm-config/types/specialist.js +38 -0
- package/dist/feature/swarm-config/types/specialist.js.map +1 -0
- package/dist/feature/swarm-config/types/tag-names.js +43 -0
- package/dist/feature/swarm-config/types/tag-names.js.map +1 -0
- package/dist/feature/swarm-edit/ports/config-changed.js +2 -0
- package/dist/feature/swarm-edit/ports/config-changed.js.map +1 -0
- package/dist/feature/swarm-edit/ports/index.js +2 -0
- package/dist/feature/swarm-edit/ports/index.js.map +1 -0
- package/dist/feature/swarm-edit/repositories/documents.js +144 -0
- package/dist/feature/swarm-edit/repositories/documents.js.map +1 -0
- package/dist/feature/swarm-edit/services/config-edits.js +129 -0
- package/dist/feature/swarm-edit/services/config-edits.js.map +1 -0
- package/dist/feature/swarm-edit/services/create.js +7 -0
- package/dist/feature/swarm-edit/services/create.js.map +1 -0
- package/dist/feature/swarm-edit/services/editor-settings.js +172 -0
- package/dist/feature/swarm-edit/services/editor-settings.js.map +1 -0
- package/dist/feature/swarm-edit/services/editor-view.js +144 -0
- package/dist/feature/swarm-edit/services/editor-view.js.map +1 -0
- package/dist/feature/swarm-edit/services/index.js +12 -0
- package/dist/feature/swarm-edit/services/index.js.map +1 -0
- package/dist/feature/swarm-edit/services/levels.js +30 -0
- package/dist/feature/swarm-edit/services/levels.js.map +1 -0
- package/dist/feature/swarm-edit/services/plan-edit.js +217 -0
- package/dist/feature/swarm-edit/services/plan-edit.js.map +1 -0
- package/dist/feature/swarm-edit/services/plan-settings.js +200 -0
- package/dist/feature/swarm-edit/services/plan-settings.js.map +1 -0
- package/dist/feature/swarm-edit/services/references.js +85 -0
- package/dist/feature/swarm-edit/services/references.js.map +1 -0
- package/dist/feature/swarm-edit/services/shared-config.js +128 -0
- package/dist/feature/swarm-edit/services/shared-config.js.map +1 -0
- package/dist/feature/swarm-edit/services/shared-pipelines.js +72 -0
- package/dist/feature/swarm-edit/services/shared-pipelines.js.map +1 -0
- package/dist/feature/swarm-edit/services/shared-specialists.js +70 -0
- package/dist/feature/swarm-edit/services/shared-specialists.js.map +1 -0
- package/dist/feature/swarm-edit/services/specialist-tags.js +215 -0
- package/dist/feature/swarm-edit/services/specialist-tags.js.map +1 -0
- package/dist/feature/swarm-edit/types/editor.js +27 -0
- package/dist/feature/swarm-edit/types/editor.js.map +1 -0
- package/dist/feature/swarm-edit/types/index.js +7 -0
- package/dist/feature/swarm-edit/types/index.js.map +1 -0
- package/dist/feature/swarm-edit/types/setting-fields.js +76 -0
- package/dist/feature/swarm-edit/types/setting-fields.js.map +1 -0
- package/dist/feature/swarm-edit/types/shared.js +2 -0
- package/dist/feature/swarm-edit/types/shared.js.map +1 -0
- package/dist/feature/swarm-edit/types/stages.js +69 -0
- package/dist/feature/swarm-edit/types/stages.js.map +1 -0
- package/dist/feature/swarm-edit/types/tag-folders.js +2 -0
- package/dist/feature/swarm-edit/types/tag-folders.js.map +1 -0
- package/dist/feature/swarm-edit/types/views.js +2 -0
- package/dist/feature/swarm-edit/types/views.js.map +1 -0
- package/dist/feature/tags/ports/index.js +2 -0
- package/dist/feature/tags/ports/index.js.map +1 -0
- package/dist/feature/tags/ports/publish.js +2 -0
- package/dist/feature/tags/ports/publish.js.map +1 -0
- package/dist/feature/tags/repositories/index.js +2 -0
- package/dist/feature/tags/repositories/index.js.map +1 -0
- package/dist/feature/tags/repositories/tags.js +36 -0
- package/dist/feature/tags/repositories/tags.js.map +1 -0
- package/dist/feature/tags/services/catalog.js +73 -0
- package/dist/feature/tags/services/catalog.js.map +1 -0
- package/dist/feature/tags/services/create.js +7 -0
- package/dist/feature/tags/services/create.js.map +1 -0
- package/dist/feature/tags/services/index.js +3 -0
- package/dist/feature/tags/services/index.js.map +1 -0
- package/dist/feature/tags/types/ids.js +7 -0
- package/dist/feature/tags/types/ids.js.map +1 -0
- package/dist/feature/tags/types/index.js +3 -0
- package/dist/feature/tags/types/index.js.map +1 -0
- package/dist/feature/tags/types/tags.js +184 -0
- package/dist/feature/tags/types/tags.js.map +1 -0
- package/dist/platform/build/fingerprint.js +36 -0
- package/dist/platform/build/fingerprint.js.map +1 -0
- package/dist/platform/build/index.js +3 -0
- package/dist/platform/build/index.js.map +1 -0
- package/dist/platform/build/locations.js +16 -0
- package/dist/platform/build/locations.js.map +1 -0
- package/dist/platform/errors/app-error.js +39 -0
- package/dist/platform/errors/app-error.js.map +1 -0
- package/dist/platform/errors/index.js +2 -0
- package/dist/platform/errors/index.js.map +1 -0
- package/dist/platform/git/delivery.js +284 -0
- package/dist/platform/git/delivery.js.map +1 -0
- package/dist/platform/git/index.js +4 -0
- package/dist/platform/git/index.js.map +1 -0
- package/dist/platform/git/runner.js +65 -0
- package/dist/platform/git/runner.js.map +1 -0
- package/dist/platform/git/workspace.js +366 -0
- package/dist/platform/git/workspace.js.map +1 -0
- package/dist/platform/network/index.js +4 -0
- package/dist/platform/network/index.js.map +1 -0
- package/dist/platform/network/interfaces.js +7 -0
- package/dist/platform/network/interfaces.js.map +1 -0
- package/dist/platform/network/probe.js +128 -0
- package/dist/platform/network/probe.js.map +1 -0
- package/dist/platform/network/tunnel.js +87 -0
- package/dist/platform/network/tunnel.js.map +1 -0
- package/dist/platform/paths/index.js +2 -0
- package/dist/platform/paths/index.js.map +1 -0
- package/dist/platform/paths/paths.js +39 -0
- package/dist/platform/paths/paths.js.map +1 -0
- package/dist/platform/process/command.js +23 -0
- package/dist/platform/process/command.js.map +1 -0
- package/dist/platform/process/index.js +4 -0
- package/dist/platform/process/index.js.map +1 -0
- package/dist/platform/process/ps.js +42 -0
- package/dist/platform/process/ps.js.map +1 -0
- package/dist/platform/process/which.js +21 -0
- package/dist/platform/process/which.js.map +1 -0
- package/dist/platform/sqlite/database.js +36 -0
- package/dist/platform/sqlite/database.js.map +1 -0
- package/dist/platform/sqlite/index.js +4 -0
- package/dist/platform/sqlite/index.js.map +1 -0
- package/dist/platform/sqlite/migrations.js +299 -0
- package/dist/platform/sqlite/migrations.js.map +1 -0
- package/dist/platform/sqlite/rows.js +13 -0
- package/dist/platform/sqlite/rows.js.map +1 -0
- package/dist/platform/sqlite/stats-migration.js +42 -0
- package/dist/platform/sqlite/stats-migration.js.map +1 -0
- package/dist/presentation/cli/commands/daemon.js +216 -0
- package/dist/presentation/cli/commands/daemon.js.map +1 -0
- package/dist/presentation/cli/commands/group.js +88 -0
- package/dist/presentation/cli/commands/group.js.map +1 -0
- package/dist/presentation/cli/commands/mcp.js +44 -0
- package/dist/presentation/cli/commands/mcp.js.map +1 -0
- package/dist/presentation/cli/commands/queue-edit.js +155 -0
- package/dist/presentation/cli/commands/queue-edit.js.map +1 -0
- package/dist/presentation/cli/commands/queue.js +222 -0
- package/dist/presentation/cli/commands/queue.js.map +1 -0
- package/dist/presentation/cli/commands/repositories.js +129 -0
- package/dist/presentation/cli/commands/repositories.js.map +1 -0
- package/dist/presentation/cli/commands/run-delivery.js +116 -0
- package/dist/presentation/cli/commands/run-delivery.js.map +1 -0
- package/dist/presentation/cli/commands/run.js +156 -0
- package/dist/presentation/cli/commands/run.js.map +1 -0
- package/dist/presentation/cli/commands/setup.js +97 -0
- package/dist/presentation/cli/commands/setup.js.map +1 -0
- package/dist/presentation/cli/commands/stats.js +41 -0
- package/dist/presentation/cli/commands/stats.js.map +1 -0
- package/dist/presentation/cli/commands/tag.js +92 -0
- package/dist/presentation/cli/commands/tag.js.map +1 -0
- package/dist/presentation/cli/commands/web.js +100 -0
- package/dist/presentation/cli/commands/web.js.map +1 -0
- package/dist/presentation/cli/context.js +49 -0
- package/dist/presentation/cli/context.js.map +1 -0
- package/dist/presentation/cli/help.js +49 -0
- package/dist/presentation/cli/help.js.map +1 -0
- package/dist/presentation/cli/io.js +13 -0
- package/dist/presentation/cli/io.js.map +1 -0
- package/dist/presentation/cli/local/clean.js +72 -0
- package/dist/presentation/cli/local/clean.js.map +1 -0
- package/dist/presentation/cli/local/config-check.js +225 -0
- package/dist/presentation/cli/local/config-check.js.map +1 -0
- package/dist/presentation/cli/local/init.js +44 -0
- package/dist/presentation/cli/local/init.js.map +1 -0
- package/dist/presentation/cli/options.js +34 -0
- package/dist/presentation/cli/options.js.map +1 -0
- package/dist/presentation/cli/probe.js +12 -0
- package/dist/presentation/cli/probe.js.map +1 -0
- package/dist/presentation/cli/program.js +78 -0
- package/dist/presentation/cli/program.js.map +1 -0
- package/dist/presentation/cli/setup/actions.js +206 -0
- package/dist/presentation/cli/setup/actions.js.map +1 -0
- package/dist/presentation/cli/setup/command.js +80 -0
- package/dist/presentation/cli/setup/command.js.map +1 -0
- package/dist/presentation/cli/setup/host.js +20 -0
- package/dist/presentation/cli/setup/host.js.map +1 -0
- package/dist/presentation/cli/setup/index.js +5 -0
- package/dist/presentation/cli/setup/index.js.map +1 -0
- package/dist/presentation/cli/setup/run.js +63 -0
- package/dist/presentation/cli/setup/run.js.map +1 -0
- package/dist/presentation/cli/setup/system.js +53 -0
- package/dist/presentation/cli/setup/system.js.map +1 -0
- package/dist/presentation/cli/setup/types.js +3 -0
- package/dist/presentation/cli/setup/types.js.map +1 -0
- package/dist/presentation/cli/watch.js +24 -0
- package/dist/presentation/cli/watch.js.map +1 -0
- package/dist/presentation/cli/web-control.js +172 -0
- package/dist/presentation/cli/web-control.js.map +1 -0
- package/dist/presentation/format/groups.js +99 -0
- package/dist/presentation/format/groups.js.map +1 -0
- package/dist/presentation/format/index.js +8 -0
- package/dist/presentation/format/index.js.map +1 -0
- package/dist/presentation/format/queue.js +109 -0
- package/dist/presentation/format/queue.js.map +1 -0
- package/dist/presentation/format/runs.js +209 -0
- package/dist/presentation/format/runs.js.map +1 -0
- package/dist/presentation/format/stats.js +79 -0
- package/dist/presentation/format/stats.js.map +1 -0
- package/dist/presentation/format/style.js +81 -0
- package/dist/presentation/format/style.js.map +1 -0
- package/dist/presentation/format/table.js +62 -0
- package/dist/presentation/format/table.js.map +1 -0
- package/dist/presentation/format/tags.js +26 -0
- package/dist/presentation/format/tags.js.map +1 -0
- package/dist/presentation/ipc/client/autostart.js +171 -0
- package/dist/presentation/ipc/client/autostart.js.map +1 -0
- package/dist/presentation/ipc/client/client.js +83 -0
- package/dist/presentation/ipc/client/client.js.map +1 -0
- package/dist/presentation/ipc/client/index.js +4 -0
- package/dist/presentation/ipc/client/index.js.map +1 -0
- package/dist/presentation/ipc/client/repository-argument.js +13 -0
- package/dist/presentation/ipc/client/repository-argument.js.map +1 -0
- package/dist/presentation/ipc/contract/agents.js +97 -0
- package/dist/presentation/ipc/contract/agents.js.map +1 -0
- package/dist/presentation/ipc/contract/artifacts.js +27 -0
- package/dist/presentation/ipc/contract/artifacts.js.map +1 -0
- package/dist/presentation/ipc/contract/config.js +145 -0
- package/dist/presentation/ipc/contract/config.js.map +1 -0
- package/dist/presentation/ipc/contract/envelope.js +100 -0
- package/dist/presentation/ipc/contract/envelope.js.map +1 -0
- package/dist/presentation/ipc/contract/groups.js +57 -0
- package/dist/presentation/ipc/contract/groups.js.map +1 -0
- package/dist/presentation/ipc/contract/index.js +15 -0
- package/dist/presentation/ipc/contract/index.js.map +1 -0
- package/dist/presentation/ipc/contract/observers/history.js +26 -0
- package/dist/presentation/ipc/contract/observers/history.js.map +1 -0
- package/dist/presentation/ipc/contract/observers.js +16 -0
- package/dist/presentation/ipc/contract/observers.js.map +1 -0
- package/dist/presentation/ipc/contract/panel.js +64 -0
- package/dist/presentation/ipc/contract/panel.js.map +1 -0
- package/dist/presentation/ipc/contract/processes.js +9 -0
- package/dist/presentation/ipc/contract/processes.js.map +1 -0
- package/dist/presentation/ipc/contract/queue.js +115 -0
- package/dist/presentation/ipc/contract/queue.js.map +1 -0
- package/dist/presentation/ipc/contract/repositories.js +33 -0
- package/dist/presentation/ipc/contract/repositories.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/artifacts.js +2 -0
- package/dist/presentation/ipc/contract/responses/artifacts.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/config.js +2 -0
- package/dist/presentation/ipc/contract/responses/config.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/groups.js +2 -0
- package/dist/presentation/ipc/contract/responses/groups.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/index.js +12 -0
- package/dist/presentation/ipc/contract/responses/index.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/observer-history.js +2 -0
- package/dist/presentation/ipc/contract/responses/observer-history.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/observers.js +2 -0
- package/dist/presentation/ipc/contract/responses/observers.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/processes.js +2 -0
- package/dist/presentation/ipc/contract/responses/processes.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/queue.js +2 -0
- package/dist/presentation/ipc/contract/responses/queue.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/repositories.js +2 -0
- package/dist/presentation/ipc/contract/responses/repositories.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/runs.js +2 -0
- package/dist/presentation/ipc/contract/responses/runs.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/stats.js +67 -0
- package/dist/presentation/ipc/contract/responses/stats.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/tags.js +2 -0
- package/dist/presentation/ipc/contract/responses/tags.js.map +1 -0
- package/dist/presentation/ipc/contract/runs.js +118 -0
- package/dist/presentation/ipc/contract/runs.js.map +1 -0
- package/dist/presentation/ipc/contract/stats/stats.js +20 -0
- package/dist/presentation/ipc/contract/stats/stats.js.map +1 -0
- package/dist/presentation/ipc/contract/tags.js +40 -0
- package/dist/presentation/ipc/contract/tags.js.map +1 -0
- package/dist/presentation/ipc/handlers/config.js +39 -0
- package/dist/presentation/ipc/handlers/config.js.map +1 -0
- package/dist/presentation/ipc/handlers/groups.js +22 -0
- package/dist/presentation/ipc/handlers/groups.js.map +1 -0
- package/dist/presentation/ipc/handlers/index.js +2 -0
- package/dist/presentation/ipc/handlers/index.js.map +1 -0
- package/dist/presentation/ipc/handlers/observers.js +14 -0
- package/dist/presentation/ipc/handlers/observers.js.map +1 -0
- package/dist/presentation/ipc/handlers/queue.js +36 -0
- package/dist/presentation/ipc/handlers/queue.js.map +1 -0
- package/dist/presentation/ipc/handlers/repositories.js +26 -0
- package/dist/presentation/ipc/handlers/repositories.js.map +1 -0
- package/dist/presentation/ipc/handlers/runs.js +55 -0
- package/dist/presentation/ipc/handlers/runs.js.map +1 -0
- package/dist/presentation/ipc/handlers/stats.js +17 -0
- package/dist/presentation/ipc/handlers/stats.js.map +1 -0
- package/dist/presentation/ipc/handlers/system.js +40 -0
- package/dist/presentation/ipc/handlers/system.js.map +1 -0
- package/dist/presentation/ipc/handlers/table.js +25 -0
- package/dist/presentation/ipc/handlers/table.js.map +1 -0
- package/dist/presentation/ipc/handlers/types.js +2 -0
- package/dist/presentation/ipc/handlers/types.js.map +1 -0
- package/dist/presentation/ipc/publisher.js +176 -0
- package/dist/presentation/ipc/publisher.js.map +1 -0
- package/dist/presentation/ipc/server.js +164 -0
- package/dist/presentation/ipc/server.js.map +1 -0
- package/dist/presentation/ipc/services.js +2 -0
- package/dist/presentation/ipc/services.js.map +1 -0
- package/dist/presentation/ipc/snapshots.js +60 -0
- package/dist/presentation/ipc/snapshots.js.map +1 -0
- package/dist/presentation/ipc/views/catalog.js +9 -0
- package/dist/presentation/ipc/views/catalog.js.map +1 -0
- package/dist/presentation/ipc/views/groups.js +112 -0
- package/dist/presentation/ipc/views/groups.js.map +1 -0
- package/dist/presentation/ipc/views/index.js +11 -0
- package/dist/presentation/ipc/views/index.js.map +1 -0
- package/dist/presentation/ipc/views/observer-history.js +26 -0
- package/dist/presentation/ipc/views/observer-history.js.map +1 -0
- package/dist/presentation/ipc/views/observers.js +16 -0
- package/dist/presentation/ipc/views/observers.js.map +1 -0
- package/dist/presentation/ipc/views/queue.js +155 -0
- package/dist/presentation/ipc/views/queue.js.map +1 -0
- package/dist/presentation/ipc/views/repositories.js +34 -0
- package/dist/presentation/ipc/views/repositories.js.map +1 -0
- package/dist/presentation/ipc/views/rows.js +117 -0
- package/dist/presentation/ipc/views/rows.js.map +1 -0
- package/dist/presentation/ipc/views/run-stages.js +66 -0
- package/dist/presentation/ipc/views/run-stages.js.map +1 -0
- package/dist/presentation/ipc/views/runs.js +201 -0
- package/dist/presentation/ipc/views/runs.js.map +1 -0
- package/dist/presentation/ipc/views/stats.js +5 -0
- package/dist/presentation/ipc/views/stats.js.map +1 -0
- package/dist/presentation/ipc/views/tags.js +19 -0
- package/dist/presentation/ipc/views/tags.js.map +1 -0
- package/dist/presentation/mcp/host-kit.js +67 -0
- package/dist/presentation/mcp/host-kit.js.map +1 -0
- package/dist/presentation/mcp/host-queue-control.js +135 -0
- package/dist/presentation/mcp/host-queue-control.js.map +1 -0
- package/dist/presentation/mcp/host-queue.js +124 -0
- package/dist/presentation/mcp/host-queue.js.map +1 -0
- package/dist/presentation/mcp/host-runs.js +173 -0
- package/dist/presentation/mcp/host-runs.js.map +1 -0
- package/dist/presentation/mcp/host.js +34 -0
- package/dist/presentation/mcp/host.js.map +1 -0
- package/dist/presentation/mcp/index.js +3 -0
- package/dist/presentation/mcp/index.js.map +1 -0
- package/dist/presentation/mcp/tools.js +19 -0
- package/dist/presentation/mcp/tools.js.map +1 -0
- package/dist/presentation/mcp/worker-extra.js +144 -0
- package/dist/presentation/mcp/worker-extra.js.map +1 -0
- package/dist/presentation/mcp/worker-read.js +45 -0
- package/dist/presentation/mcp/worker-read.js.map +1 -0
- package/dist/presentation/mcp/worker-tools.js +107 -0
- package/dist/presentation/mcp/worker-tools.js.map +1 -0
- package/dist/presentation/mcp/worker.js +14 -0
- package/dist/presentation/mcp/worker.js.map +1 -0
- package/dist/presentation/web/errors.js +60 -0
- package/dist/presentation/web/errors.js.map +1 -0
- package/dist/presentation/web/http.js +130 -0
- package/dist/presentation/web/http.js.map +1 -0
- package/dist/presentation/web/hub.js +168 -0
- package/dist/presentation/web/hub.js.map +1 -0
- package/dist/presentation/web/index.js +7 -0
- package/dist/presentation/web/index.js.map +1 -0
- package/dist/presentation/web/options.js +7 -0
- package/dist/presentation/web/options.js.map +1 -0
- package/dist/presentation/web/pages.js +44 -0
- package/dist/presentation/web/pages.js.map +1 -0
- package/dist/presentation/web/panel/daemon-panel.js +207 -0
- package/dist/presentation/web/panel/daemon-panel.js.map +1 -0
- package/dist/presentation/web/panel/default-repository.js +14 -0
- package/dist/presentation/web/panel/default-repository.js.map +1 -0
- package/dist/presentation/web/panel/directories.js +48 -0
- package/dist/presentation/web/panel/directories.js.map +1 -0
- package/dist/presentation/web/panel/open.js +12 -0
- package/dist/presentation/web/panel/open.js.map +1 -0
- package/dist/presentation/web/panel/standby.js +119 -0
- package/dist/presentation/web/panel/standby.js.map +1 -0
- package/dist/presentation/web/panel/state.js +69 -0
- package/dist/presentation/web/panel/state.js.map +1 -0
- package/dist/presentation/web/panel/system.js +67 -0
- package/dist/presentation/web/panel/system.js.map +1 -0
- package/dist/presentation/web/request.js +150 -0
- package/dist/presentation/web/request.js.map +1 -0
- package/dist/presentation/web/routes/config.js +171 -0
- package/dist/presentation/web/routes/config.js.map +1 -0
- package/dist/presentation/web/routes/downloads.js +65 -0
- package/dist/presentation/web/routes/downloads.js.map +1 -0
- package/dist/presentation/web/routes/groups.js +85 -0
- package/dist/presentation/web/routes/groups.js.map +1 -0
- package/dist/presentation/web/routes/observers/history.js +19 -0
- package/dist/presentation/web/routes/observers/history.js.map +1 -0
- package/dist/presentation/web/routes/processes.js +21 -0
- package/dist/presentation/web/routes/processes.js.map +1 -0
- package/dist/presentation/web/routes/queue.js +80 -0
- package/dist/presentation/web/routes/queue.js.map +1 -0
- package/dist/presentation/web/routes/repositories.js +66 -0
- package/dist/presentation/web/routes/repositories.js.map +1 -0
- package/dist/presentation/web/routes/runs.js +76 -0
- package/dist/presentation/web/routes/runs.js.map +1 -0
- package/dist/presentation/web/routes/settings.js +74 -0
- package/dist/presentation/web/routes/settings.js.map +1 -0
- package/dist/presentation/web/routes/specialists.js +74 -0
- package/dist/presentation/web/routes/specialists.js.map +1 -0
- package/dist/presentation/web/routes/stats/stats.js +22 -0
- package/dist/presentation/web/routes/stats/stats.js.map +1 -0
- package/dist/presentation/web/routes/system.js +96 -0
- package/dist/presentation/web/routes/system.js.map +1 -0
- package/dist/presentation/web/routes/tags.js +46 -0
- package/dist/presentation/web/routes/tags.js.map +1 -0
- package/dist/presentation/web/routes/types.js +2 -0
- package/dist/presentation/web/routes/types.js.map +1 -0
- package/dist/presentation/web/server.js +187 -0
- package/dist/presentation/web/server.js.map +1 -0
- package/dist/web/assets/FilterColumn-BCMp-JO4.js +1 -0
- package/dist/web/assets/SharedPipelinesGroup-DJRGFtzx.js +1 -0
- package/dist/web/assets/badge-C_7kALlW.js +1 -0
- package/dist/web/assets/card-C9eXOVuF.js +1 -0
- package/dist/web/assets/deliveryModes-funlvXVC.js +1 -0
- package/dist/web/assets/empty-ACC2KkXk.js +41 -0
- package/dist/web/assets/index-CsVQUXJH.js +21 -0
- package/dist/web/assets/index-Ds1nt_qm.css +2 -0
- package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/web/assets/locales-fB1w2oER.js +1 -0
- package/dist/web/assets/pipelines-DLioOiRN.css +1 -0
- package/dist/web/assets/pipelines-DQglwIkL.js +10 -0
- package/dist/web/assets/queue-CAuAo--6.js +16 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/select-BSqaxwh1.js +1 -0
- package/dist/web/assets/settingFields-DVg9TQK2.js +1 -0
- package/dist/web/assets/settings-6eHKYbS7.js +2 -0
- package/dist/web/assets/skeleton-CfLYGtNX.js +1 -0
- package/dist/web/assets/specialists-Durm0DgK.js +1 -0
- package/dist/web/assets/stats-67akPa3A.js +1 -0
- package/dist/web/assets/topology-DQu3su19.js +1 -0
- package/dist/web/assets/trash-ChYI9ms1.js +1 -0
- package/dist/web/assets/useListDrag-0GPS1X83.js +1 -0
- package/dist/web/assets/vendor-markdown-DwXfjc7L.js +32 -0
- package/dist/web/assets/vendor-react-C1iE8mnY.js +9 -0
- package/dist/web/index.html +22 -0
- package/integrations/claude-code/.claude-plugin/plugin.json +19 -0
- package/integrations/claude-code/commands/apply.md +6 -0
- package/integrations/claude-code/commands/panel.md +6 -0
- package/integrations/claude-code/commands/run.md +6 -0
- package/integrations/claude-code/commands/status.md +6 -0
- package/integrations/claude-code/commands/web.md +6 -0
- package/integrations/claude-code/hooks/aip.ts +365 -0
- package/integrations/claude-code/hooks/feed.ts +923 -0
- package/integrations/claude-code/hooks/hooks.json +1 -0
- package/integrations/claude-code/hooks/pane.ts +396 -0
- package/integrations/claude-code/hooks/register.tsx +156 -0
- package/integrations/claude-code/hooks/theme.ts +59 -0
- package/integrations/claude-code/hooks/transcript.tsx +44 -0
- package/integrations/claude-code/hooks/view.tsx +378 -0
- package/integrations/claude-code/hooks/web.ts +162 -0
- package/integrations/claude-code/tsconfig.json +18 -0
- package/integrations/claude-code/types/index.d.ts +89 -0
- package/package.json +70 -4
- package/templates/aip/pipelines/feature.yaml +4 -0
- package/templates/aip/settings.yaml +10 -0
- package/templates/aip/specialists/coder.yaml +4 -0
- package/templates/aip/specialists/reviewer.yaml +5 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { isAbsolute } from 'node:path';
|
|
2
|
+
import { isProjectSlug } from '../../feature/repos/types/index.js';
|
|
3
|
+
import { panel } from './errors.js';
|
|
4
|
+
import { readJson } from './http.js';
|
|
5
|
+
function transcriptQuery(search) {
|
|
6
|
+
const query = {};
|
|
7
|
+
for (const [key, low] of [
|
|
8
|
+
['seq', 1],
|
|
9
|
+
['after', 0],
|
|
10
|
+
]) {
|
|
11
|
+
const value = search.get(key);
|
|
12
|
+
if (value === null)
|
|
13
|
+
continue;
|
|
14
|
+
const number = Number(value);
|
|
15
|
+
if (!Number.isInteger(number) || number < low)
|
|
16
|
+
throw panel('invalid', `${key} must be an integer from ${low}`);
|
|
17
|
+
query[key] = number;
|
|
18
|
+
}
|
|
19
|
+
return query;
|
|
20
|
+
}
|
|
21
|
+
function historyQuery(search) {
|
|
22
|
+
const result = {};
|
|
23
|
+
for (const key of ['repository', 'runtime', 'model', 'result', 'cursor']) {
|
|
24
|
+
const value = search.get(key);
|
|
25
|
+
if (value !== null)
|
|
26
|
+
result[key] = value;
|
|
27
|
+
}
|
|
28
|
+
for (const key of ['from', 'to', 'limit']) {
|
|
29
|
+
const value = search.get(key);
|
|
30
|
+
if (value === null)
|
|
31
|
+
continue;
|
|
32
|
+
if (!/^(0|[1-9]\d*)$/.test(value))
|
|
33
|
+
throw panel('invalid', `${key} must be a non-negative integer`);
|
|
34
|
+
const number = Number(value);
|
|
35
|
+
if (!Number.isSafeInteger(number))
|
|
36
|
+
throw panel('invalid', `${key} must be a safe integer`);
|
|
37
|
+
result[key] = number;
|
|
38
|
+
}
|
|
39
|
+
if (result.limit !== undefined &&
|
|
40
|
+
result.limit !== 20 &&
|
|
41
|
+
result.limit !== 50 &&
|
|
42
|
+
result.limit !== 100)
|
|
43
|
+
throw panel('invalid', 'limit must be 20, 50 or 100');
|
|
44
|
+
const from = result.from;
|
|
45
|
+
const to = result.to;
|
|
46
|
+
if (from !== undefined && to !== undefined && from >= to)
|
|
47
|
+
throw panel('invalid', 'from must be less than to');
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
/** `since`, `until` and `repository` of `/api/stats`; the moments are whole milliseconds. */
|
|
51
|
+
function statsQuery(search) {
|
|
52
|
+
const result = {};
|
|
53
|
+
for (const key of ['since', 'until']) {
|
|
54
|
+
const value = search.get(key);
|
|
55
|
+
if (value === null)
|
|
56
|
+
continue;
|
|
57
|
+
if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
58
|
+
throw panel('invalid', `${key} must be a non-negative integer (ms)`);
|
|
59
|
+
result[key] = Number(value);
|
|
60
|
+
}
|
|
61
|
+
if (result.since !== undefined && result.until !== undefined && result.since >= result.until)
|
|
62
|
+
throw panel('invalid', 'since must be less than until');
|
|
63
|
+
const repository = search.get('repository');
|
|
64
|
+
if (repository !== null && repository !== '') {
|
|
65
|
+
if (!isAbsolute(repository) && !isProjectSlug(repository))
|
|
66
|
+
throw panel('invalid', 'repository must be an absolute path or a project slug');
|
|
67
|
+
result.repository = repository;
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
function deleteQuery(search) {
|
|
72
|
+
const revision = search.get('revision');
|
|
73
|
+
const level = search.get('level');
|
|
74
|
+
if (level !== null && level !== 'project' && level !== 'global') {
|
|
75
|
+
throw panel('invalid', 'level must be project or global');
|
|
76
|
+
}
|
|
77
|
+
return { ...(revision ? { revision } : {}), ...(level ? { level } : {}) };
|
|
78
|
+
}
|
|
79
|
+
function boundedInteger(search, name, fallback, max) {
|
|
80
|
+
const value = Number(search.get(name) ?? fallback);
|
|
81
|
+
if (!Number.isInteger(value) || value < 1 || value > max)
|
|
82
|
+
throw panel('invalid', `${name} must be an integer from 1 to ${max}`);
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
/** The body a handler gets: the JSON body of a write, the validated query of a read. */
|
|
86
|
+
export async function requestBody(incoming, url) {
|
|
87
|
+
const verb = incoming.method ?? 'GET';
|
|
88
|
+
const { pathname, searchParams } = url;
|
|
89
|
+
if (verb === 'POST' || verb === 'PUT')
|
|
90
|
+
return readJson(incoming);
|
|
91
|
+
if (pathname === '/api/stats' && (verb === 'GET' || verb === 'DELETE'))
|
|
92
|
+
return statsQuery(searchParams);
|
|
93
|
+
if (verb === 'DELETE')
|
|
94
|
+
return deleteQuery(searchParams);
|
|
95
|
+
if (/\/groups\/[^/]+$/.test(pathname))
|
|
96
|
+
return { tail: boundedInteger(searchParams, 'tail', 40, 500) };
|
|
97
|
+
if (pathname === '/api/finished-runs') {
|
|
98
|
+
const limit = boundedInteger(searchParams, 'limit', 15, 100);
|
|
99
|
+
const before = searchParams.get('before');
|
|
100
|
+
const repository = searchParams.get('repository');
|
|
101
|
+
if (repository && !isAbsolute(repository))
|
|
102
|
+
throw panel('invalid', 'repository must be an absolute path');
|
|
103
|
+
return { limit, ...(before ? { before } : {}), ...(repository ? { repository } : {}) };
|
|
104
|
+
}
|
|
105
|
+
if (pathname === '/api/observers/history')
|
|
106
|
+
return historyQuery(searchParams);
|
|
107
|
+
if (pathname.endsWith('/transcript'))
|
|
108
|
+
return transcriptQuery(searchParams);
|
|
109
|
+
if (pathname.endsWith('/diff')) {
|
|
110
|
+
const path = searchParams.get('path');
|
|
111
|
+
if (path === null || path === '')
|
|
112
|
+
throw panel('invalid', 'path is required');
|
|
113
|
+
return { path };
|
|
114
|
+
}
|
|
115
|
+
return {};
|
|
116
|
+
}
|
|
117
|
+
/** Runs and processes belong to the daemon, not to a repository: they work without one. */
|
|
118
|
+
function repositoryFree(pathname, search) {
|
|
119
|
+
// A returned run belongs to its own repository unless the request names one.
|
|
120
|
+
const own = (pathname === '/api/queue/return' || pathname === '/api/queue/dismiss') &&
|
|
121
|
+
!search.get('repository');
|
|
122
|
+
return (pathname.startsWith('/api/runs') ||
|
|
123
|
+
pathname === '/api/finished-runs' ||
|
|
124
|
+
pathname.startsWith('/api/processes') ||
|
|
125
|
+
pathname.startsWith('/api/specialist-tags') ||
|
|
126
|
+
pathname === '/api/observers' ||
|
|
127
|
+
pathname === '/api/observers/history' ||
|
|
128
|
+
pathname === '/api/stats' ||
|
|
129
|
+
own);
|
|
130
|
+
}
|
|
131
|
+
/** The repository of a request: `?repository=` (absolute path) or the one of the panel. */
|
|
132
|
+
export async function requestRepository(url, options) {
|
|
133
|
+
if (repositoryFree(url.pathname, url.searchParams))
|
|
134
|
+
return '';
|
|
135
|
+
const chosen = url.searchParams.get('repository');
|
|
136
|
+
if (chosen === null || chosen === '') {
|
|
137
|
+
if (options.repository !== undefined)
|
|
138
|
+
return options.repository;
|
|
139
|
+
const found = (await options.defaultRepository?.()) ?? null;
|
|
140
|
+
if (found === null) {
|
|
141
|
+
throw panel('conflict', 'no repository yet: add or enable one in the panel');
|
|
142
|
+
}
|
|
143
|
+
return found;
|
|
144
|
+
}
|
|
145
|
+
if (!isAbsolute(chosen) && !isProjectSlug(chosen)) {
|
|
146
|
+
throw panel('invalid', 'repository must be an absolute path or a project slug');
|
|
147
|
+
}
|
|
148
|
+
return chosen;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/presentation/web/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,SAAS,eAAe,CAAC,MAAuB;IAC9C,MAAM,KAAK,GAAqC,EAAE,CAAC;IACnD,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI;QACvB,CAAC,KAAK,EAAE,CAAC,CAAC;QACV,CAAC,OAAO,EAAE,CAAC,CAAC;KACJ,EAAE,CAAC;QACX,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAA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CAAC,YAAY,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9D,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAClD,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;QACrC,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;YAAE,OAAO,OAAO,CAAC,UAAU,CAAC;QAChE,MAAM,KAAK,GAAG,CAAC,MAAM,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC;QAC5D,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,MAAM,KAAK,CAAC,UAAU,EAAE,mDAAmD,CAAC,CAAC;QAC/E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,KAAK,CAAC,SAAS,EAAE,uDAAuD,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { isAbsolute } from 'node:path';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import {} from '../../ipc/contract/index.js';
|
|
4
|
+
import { panel } from '../errors.js';
|
|
5
|
+
import { Reply, editReply, entryId, parseBody, levelParam } from '../http.js';
|
|
6
|
+
import { segment } from './types.js';
|
|
7
|
+
const previewBody = z.object({
|
|
8
|
+
value: z.record(z.string(), z.unknown()),
|
|
9
|
+
level: levelParam.optional(),
|
|
10
|
+
});
|
|
11
|
+
const writeBody = z.object({
|
|
12
|
+
value: z.record(z.string(), z.unknown()),
|
|
13
|
+
revision: z.string().min(1).nullable(),
|
|
14
|
+
level: levelParam.optional(),
|
|
15
|
+
});
|
|
16
|
+
const pipelineImportBody = z.object({
|
|
17
|
+
source: z.string().refine((value) => isAbsolute(value), {
|
|
18
|
+
message: 'source must be an absolute path',
|
|
19
|
+
}),
|
|
20
|
+
ids: z.array(z.string().min(1)).min(1),
|
|
21
|
+
});
|
|
22
|
+
function configReadRoutes({ call }) {
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
method: 'GET',
|
|
26
|
+
pattern: /^\/api\/pipelines$/,
|
|
27
|
+
handle: (_match, _body, repository) => call('pipelines', { repository }),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
method: 'GET',
|
|
31
|
+
pattern: /^\/api\/system-stages$/,
|
|
32
|
+
handle: (_match, _body, repository) => call('system_stages', { repository }),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
method: 'GET',
|
|
36
|
+
pattern: /^\/api\/config$/,
|
|
37
|
+
handle: (_match, _body, repository) => call('config', { repository }),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
method: 'GET',
|
|
41
|
+
pattern: /^\/api\/config\/catalog$/,
|
|
42
|
+
handle: (_match, _body, repository) => call('config_catalog', { repository }),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
method: 'GET',
|
|
46
|
+
pattern: /^\/api\/config\/models$/,
|
|
47
|
+
handle: (_match, _body, repository, query) => call('config_models', { repository, refresh: query.get('refresh') === '1' }),
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
function configWriteRoutes({ call }) {
|
|
52
|
+
return [
|
|
53
|
+
{
|
|
54
|
+
method: 'PUT',
|
|
55
|
+
pattern: new RegExp(`^/api/config/specialists/${segment}$`),
|
|
56
|
+
handle: async ([id], body, repository) => {
|
|
57
|
+
const { value, revision, level } = parseBody(writeBody, body);
|
|
58
|
+
return editReply((await call('config_write', {
|
|
59
|
+
repository,
|
|
60
|
+
kind: 'specialist',
|
|
61
|
+
id: entryId(id),
|
|
62
|
+
value,
|
|
63
|
+
revision,
|
|
64
|
+
level,
|
|
65
|
+
})));
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
method: 'POST',
|
|
70
|
+
pattern: /^\/api\/config\/pipelines\/import$/,
|
|
71
|
+
handle: async (_match, body, repository) => {
|
|
72
|
+
const result = (await call('pipelines_import', {
|
|
73
|
+
repository,
|
|
74
|
+
...parseBody(pipelineImportBody, body),
|
|
75
|
+
}));
|
|
76
|
+
if (result.ok)
|
|
77
|
+
return new Reply(200, result);
|
|
78
|
+
if (result.reason === 'conflict') {
|
|
79
|
+
return new Reply(409, { error: result.message, ids: result.ids ?? [] });
|
|
80
|
+
}
|
|
81
|
+
return new Reply(422, { errors: result.errors, references: [] });
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
method: 'DELETE',
|
|
86
|
+
pattern: new RegExp(`^/api/config/(specialists|pipelines|actions|chains)/${segment}$`),
|
|
87
|
+
handle: async ([section, id], body, repository) => {
|
|
88
|
+
const { revision, level } = body;
|
|
89
|
+
if (!revision)
|
|
90
|
+
throw panel('invalid', 'revision is required');
|
|
91
|
+
return editReply((await call('config_delete', {
|
|
92
|
+
repository,
|
|
93
|
+
kind: section === 'pipelines'
|
|
94
|
+
? 'pipeline'
|
|
95
|
+
: section === 'actions'
|
|
96
|
+
? 'action'
|
|
97
|
+
: section === 'chains'
|
|
98
|
+
? 'chain'
|
|
99
|
+
: 'specialist',
|
|
100
|
+
id: entryId(id),
|
|
101
|
+
revision,
|
|
102
|
+
level,
|
|
103
|
+
})));
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
}
|
|
108
|
+
function configImportRoutes({ call }) {
|
|
109
|
+
return [
|
|
110
|
+
{
|
|
111
|
+
method: 'PUT',
|
|
112
|
+
pattern: new RegExp(`^/api/config/pipelines/${segment}$`),
|
|
113
|
+
handle: async ([id], body, repository) => {
|
|
114
|
+
const { value, revision, level } = parseBody(writeBody, body);
|
|
115
|
+
return editReply((await call('config_write', {
|
|
116
|
+
repository,
|
|
117
|
+
kind: 'pipeline',
|
|
118
|
+
id: entryId(id),
|
|
119
|
+
value,
|
|
120
|
+
revision,
|
|
121
|
+
level,
|
|
122
|
+
})));
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
method: 'PUT',
|
|
127
|
+
pattern: new RegExp(`^/api/config/actions/${segment}$`),
|
|
128
|
+
handle: async ([id], body, repository) => {
|
|
129
|
+
const { value, revision, level } = parseBody(writeBody, body);
|
|
130
|
+
return editReply((await call('config_write', {
|
|
131
|
+
repository,
|
|
132
|
+
kind: 'action',
|
|
133
|
+
id: entryId(id),
|
|
134
|
+
value,
|
|
135
|
+
revision,
|
|
136
|
+
level,
|
|
137
|
+
})));
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
method: 'PUT',
|
|
142
|
+
pattern: new RegExp(`^/api/config/chains/${segment}$`),
|
|
143
|
+
handle: async ([id], body, repository) => {
|
|
144
|
+
const { value, revision, level } = parseBody(writeBody, body);
|
|
145
|
+
return editReply((await call('config_write', {
|
|
146
|
+
repository,
|
|
147
|
+
kind: 'chain',
|
|
148
|
+
id: entryId(id),
|
|
149
|
+
value,
|
|
150
|
+
revision,
|
|
151
|
+
level,
|
|
152
|
+
})));
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
method: 'POST',
|
|
157
|
+
pattern: new RegExp(`^/api/config/pipelines/${segment}/preview$`),
|
|
158
|
+
handle: async ([id], body, repository) => call('config_preview', {
|
|
159
|
+
repository,
|
|
160
|
+
kind: 'pipeline',
|
|
161
|
+
id: entryId(id),
|
|
162
|
+
value: parseBody(previewBody, body).value,
|
|
163
|
+
level: parseBody(previewBody, body).level,
|
|
164
|
+
}),
|
|
165
|
+
},
|
|
166
|
+
];
|
|
167
|
+
}
|
|
168
|
+
export function configRoutes(kit) {
|
|
169
|
+
return [...configReadRoutes(kit), ...configWriteRoutes(kit), ...configImportRoutes(kit)];
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=config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AE,IAAI,EAAE,UAAU,EAAE,EAAE,CACvC,IAAI,CAAC,gBAAgB,EAAE;gBACrB,UAAU;gBACV,IAAI,EAAE,UAAU;gBAChB,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;gBACf,KAAK,EAAE,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,KAAK;gBACzC,KAAK,EAAE,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,KAAK;aAC1C,CAAC;SACL;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAa;IACxC,OAAO,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,EAAE,GAAG,iBAAiB,CAAC,GAAG,CAAC,EAAE,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { artifactPreview } from '../../../feature/artifacts/types/index.js';
|
|
2
|
+
import { panel } from '../errors.js';
|
|
3
|
+
import { decodeParts } from '../http.js';
|
|
4
|
+
import { segment } from './types.js';
|
|
5
|
+
/** `GET /api/runs/<run>/patch`: the patch of the merged groups as a file. */
|
|
6
|
+
export function patchRoute({ call }) {
|
|
7
|
+
return {
|
|
8
|
+
pattern: new RegExp(`^/api/runs/${segment}/patch$`),
|
|
9
|
+
async handle({ response, match, verb }) {
|
|
10
|
+
if (verb !== 'GET')
|
|
11
|
+
throw panel('method_not_allowed', 'method not allowed');
|
|
12
|
+
const [runId = ''] = decodeParts(match.slice(1));
|
|
13
|
+
const patch = (await call('run_patch', { runId }));
|
|
14
|
+
const bytes = Buffer.from(patch.base64, 'base64');
|
|
15
|
+
response.writeHead(200, {
|
|
16
|
+
'Content-Type': 'text/x-diff; charset=binary',
|
|
17
|
+
'Content-Disposition': `attachment; filename="${patch.fileName.replace(/[^A-Za-z0-9._-]/g, '_')}"`,
|
|
18
|
+
'Content-Length': bytes.length,
|
|
19
|
+
'Cache-Control': 'no-store',
|
|
20
|
+
});
|
|
21
|
+
response.end(bytes);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function attachmentHeaders(fileName, preview) {
|
|
26
|
+
const type = preview === 'markdown'
|
|
27
|
+
? 'text/markdown; charset=utf-8'
|
|
28
|
+
: preview === 'log'
|
|
29
|
+
? 'text/plain; charset=utf-8'
|
|
30
|
+
: 'application/octet-stream';
|
|
31
|
+
const ascii = fileName.replace(/[^A-Za-z0-9._-]/g, '_');
|
|
32
|
+
const encoded = encodeURIComponent(fileName).replace(/['()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
33
|
+
return {
|
|
34
|
+
'Content-Type': type,
|
|
35
|
+
'Content-Disposition': `attachment; filename="${ascii}"; filename*=UTF-8''${encoded}`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** `GET /api/runs/<run>/groups/<group>/artifacts/<id>`: the file, or its text with `?inline=1`. */
|
|
39
|
+
export function artifactRoute({ call }) {
|
|
40
|
+
return {
|
|
41
|
+
pattern: new RegExp(`^/api/runs/${segment}/groups/${segment}/artifacts/${segment}$`),
|
|
42
|
+
async handle({ response, url, match, verb }) {
|
|
43
|
+
if (verb !== 'GET')
|
|
44
|
+
throw panel('method_not_allowed', 'method not allowed');
|
|
45
|
+
const [runId = '', group = '', id = ''] = decodeParts(match.slice(1));
|
|
46
|
+
const inline = url.searchParams.get('inline') === '1';
|
|
47
|
+
const artifact = (await call('artifact', { runId, group, id }));
|
|
48
|
+
const preview = artifactPreview(artifact.fileName);
|
|
49
|
+
if (inline && preview === null) {
|
|
50
|
+
throw panel('invalid', 'only .md and .log artifacts can be shown inline');
|
|
51
|
+
}
|
|
52
|
+
const bytes = Buffer.from(artifact.base64, 'base64');
|
|
53
|
+
response.writeHead(200, {
|
|
54
|
+
'Content-Length': bytes.length,
|
|
55
|
+
'X-Content-Type-Options': 'nosniff',
|
|
56
|
+
'Cache-Control': 'no-store',
|
|
57
|
+
...(inline
|
|
58
|
+
? { 'Content-Type': 'text/plain; charset=utf-8' }
|
|
59
|
+
: attachmentHeaders(artifact.fileName, preview)),
|
|
60
|
+
});
|
|
61
|
+
response.end(bytes);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=downloads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloads.js","sourceRoot":"","sources":["../../../../src/presentation/web/routes/downloads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAE5E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,OAAO,EAAgC,MAAM,YAAY,CAAC;AAEnE,6EAA6E;AAC7E,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,EAAY;IAC3C,OAAO;QACL,OAAO,EAAE,IAAI,MAAM,CAAC,cAAc,OAAO,SAAS,CAAC;QACnD,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE;YACpC,IAAI,IAAI,KAAK,KAAK;gBAAE,MAAM,KAAK,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;YAC5E,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,CAAiB,CAAC;YACnE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YAClD,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE;gBACtB,cAAc,EAAE,6BAA6B;gBAC7C,qBAAqB,EAAE,yBAAyB,KAAK,CAAC,QAAQ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,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACtE,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC;YACtD,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAwB,CAAC;YACvF,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACnD,IAAI,MAAM,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBAC/B,MAAM,KAAK,CAAC,SAAS,EAAE,iDAAiD,CAAC,CAAC;YAC5E,CAAC;YACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACrD,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE;gBACtB,gBAAgB,EAAE,KAAK,CAAC,MAAM;gBAC9B,wBAAwB,EAAE,SAAS;gBACnC,eAAe,EAAE,UAAU;gBAC3B,GAAG,CAAC,MAAM;oBACR,CAAC,CAAC,EAAE,cAAc,EAAE,2BAA2B,EAAE;oBACjD,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;aACnD,CAAC,CAAC;YACH,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MESSAGE_TEXT_LIMIT } from '../../ipc/contract/index.js';
|
|
3
|
+
import { parseBody } from '../http.js';
|
|
4
|
+
import { segment } from './types.js';
|
|
5
|
+
const answerBody = z.object({ answer: z.string().trim().min(1) });
|
|
6
|
+
const messageBody = z.object({
|
|
7
|
+
seq: z.number().int().positive(),
|
|
8
|
+
text: z.string().trim().min(1).max(MESSAGE_TEXT_LIMIT),
|
|
9
|
+
});
|
|
10
|
+
const retryBody = z.object({ refreshConfig: z.boolean().optional() });
|
|
11
|
+
export function groupsRoutes({ call }) {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
method: 'GET',
|
|
15
|
+
pattern: new RegExp(`^/api/runs/${segment}/groups/${segment}$`),
|
|
16
|
+
handle: ([runId, group], body) => call('group', {
|
|
17
|
+
runId: runId ?? '',
|
|
18
|
+
group: group ?? '',
|
|
19
|
+
tailLines: body.tail,
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
method: 'GET',
|
|
24
|
+
pattern: new RegExp(`^/api/runs/${segment}/groups/${segment}/spec$`),
|
|
25
|
+
handle: ([runId, group]) => call('group_spec', { runId: runId ?? '', group: group ?? '' }),
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
method: 'GET',
|
|
29
|
+
pattern: new RegExp(`^/api/runs/${segment}/groups/${segment}/artifacts$`),
|
|
30
|
+
handle: async ([runId, group]) => ({
|
|
31
|
+
artifacts: await call('group_artifacts', { runId: runId ?? '', group: group ?? '' }),
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
method: 'GET',
|
|
36
|
+
pattern: new RegExp(`^/api/runs/${segment}/groups/${segment}/transcript$`),
|
|
37
|
+
handle: ([runId, group], body) => call('transcript', {
|
|
38
|
+
runId: runId ?? '',
|
|
39
|
+
group: group ?? '',
|
|
40
|
+
...body,
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
method: 'GET',
|
|
45
|
+
pattern: new RegExp(`^/api/runs/${segment}/groups/${segment}/diff$`),
|
|
46
|
+
handle: ([runId, group], body) => call('group_file_diff', {
|
|
47
|
+
runId: runId ?? '',
|
|
48
|
+
group: group ?? '',
|
|
49
|
+
path: body.path,
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
method: 'POST',
|
|
54
|
+
pattern: new RegExp(`^/api/runs/${segment}/groups/${segment}/(cancel|retry)$`),
|
|
55
|
+
handle: ([runId, group, action], body) => {
|
|
56
|
+
if (action !== 'retry')
|
|
57
|
+
return call('cancel', { runId: runId ?? '', group: group ?? '' });
|
|
58
|
+
const { refreshConfig } = parseBody(retryBody, body);
|
|
59
|
+
return call('retry', {
|
|
60
|
+
runId: runId ?? '',
|
|
61
|
+
group: group ?? '',
|
|
62
|
+
...(refreshConfig ? { refreshConfig: true } : {}),
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
method: 'POST',
|
|
68
|
+
pattern: new RegExp(`^/api/runs/${segment}/groups/${segment}/answer$`),
|
|
69
|
+
handle: async ([runId, group], body) => call('answer', {
|
|
70
|
+
runId: runId ?? '',
|
|
71
|
+
group: group ?? '',
|
|
72
|
+
answer: parseBody(answerBody, body).answer,
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
method: 'POST',
|
|
77
|
+
pattern: new RegExp(`^/api/runs/${segment}/groups/${segment}/message$`),
|
|
78
|
+
handle: async ([runId, group], body) => {
|
|
79
|
+
const { seq, text } = parseBody(messageBody, body);
|
|
80
|
+
return call('message', { runId: runId ?? '', group: group ?? '', seq, text });
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=groups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groups.js","sourceRoot":"","sources":["../../../../src/presentation/web/routes/groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,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E,KAAK,EAAE,KAAK,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;YAChF,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { panel } from '../../errors.js';
|
|
2
|
+
export function observerHistoryRoutes({ call }) {
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
method: 'GET',
|
|
6
|
+
pattern: /^\/api\/observers\/history$/,
|
|
7
|
+
handle: async (_match, body) => {
|
|
8
|
+
const params = body;
|
|
9
|
+
try {
|
|
10
|
+
return await call('observers_history', params);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
throw panel('invalid', error instanceof Error ? error.message : 'invalid history query');
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../../../src/presentation/web/routes/observers/history.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGxC,MAAM,UAAU,qBAAqB,CAAC,EAAE,IAAI,EAAY;IACtD,OAAO;QACL;YACE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,6BAA6B;YACtC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;gBAC7B,MAAM,MAAM,GAAG,IAAqC,CAAC;gBACrD,IAAI,CAAC;oBACH,OAAO,MAAM,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;gBACjD,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,KAAK,CAAC,SAAS,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC;gBAC3F,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { panel } from '../errors.js';
|
|
2
|
+
import {} from './types.js';
|
|
3
|
+
export function processesRoutes({ call }) {
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
method: 'GET',
|
|
7
|
+
pattern: /^\/api\/processes$/,
|
|
8
|
+
handle: () => call('processes', {}),
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
method: 'POST',
|
|
12
|
+
pattern: /^\/api\/processes\/([^/]+)\/kill$/,
|
|
13
|
+
handle: ([pid]) => {
|
|
14
|
+
if (!/^\d+$/.test(pid ?? ''))
|
|
15
|
+
throw panel('invalid', 'pid must be a positive integer');
|
|
16
|
+
return call('process_kill', { pid: Number(pid) });
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=processes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processes.js","sourceRoot":"","sources":["../../../../src/presentation/web/routes/processes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAA6B,MAAM,YAAY,CAAC;AAEvD,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAY;IAChD,OAAO;QACL;YACE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,oBAAoB;YAC7B,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;SACpC;QACD;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,mCAAmC;YAC5C,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE;gBAChB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;oBAAE,MAAM,KAAK,CAAC,SAAS,EAAE,gCAAgC,CAAC,CAAC;gBACvF,OAAO,IAAI,CAAC,cAAc,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACpD,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {} from '../../ipc/contract/index.js';
|
|
3
|
+
import { parseBody } from '../http.js';
|
|
4
|
+
import { segment } from './types.js';
|
|
5
|
+
/** Fields of a queue request body; the repository comes from the query string, never the body. */
|
|
6
|
+
const queueBody = (body) => parseBody(z.record(z.string(), z.unknown()), body);
|
|
7
|
+
export function queueRoutes({ call }) {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
method: 'GET',
|
|
11
|
+
pattern: /^\/api\/queue$/,
|
|
12
|
+
handle: (_match, _body, repository) => call('queue', { repository }),
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
method: 'POST',
|
|
16
|
+
pattern: /^\/api\/queue\/items$/,
|
|
17
|
+
handle: async (_, body, repository) => call('queue_add', {
|
|
18
|
+
...queueBody(body),
|
|
19
|
+
repository,
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
method: 'POST',
|
|
24
|
+
pattern: new RegExp(`^/api/queue/items/${segment}$`),
|
|
25
|
+
handle: async ([item], body, repository) => call('queue_edit', {
|
|
26
|
+
...queueBody(body),
|
|
27
|
+
item: item ?? '',
|
|
28
|
+
repository,
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
method: 'POST',
|
|
33
|
+
pattern: new RegExp(`^/api/queue/items/${segment}/remove$`),
|
|
34
|
+
handle: ([item], _body, repository) => call('queue_remove', { item: item ?? '', repository }),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
method: 'POST',
|
|
38
|
+
pattern: new RegExp(`^/api/queue/items/${segment}/run$`),
|
|
39
|
+
handle: ([item], _body, repository) => call('queue_run_now', { item: item ?? '', repository }),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
method: 'POST',
|
|
43
|
+
pattern: /^\/api\/queue\/start$/,
|
|
44
|
+
handle: async (_, body, repository) => call('queue_start', {
|
|
45
|
+
...queueBody(body),
|
|
46
|
+
repository,
|
|
47
|
+
}),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
method: 'POST',
|
|
51
|
+
pattern: /^\/api\/queue\/pause$/,
|
|
52
|
+
handle: (_match, _body, repository) => call('queue_pause', { repository }),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
method: 'POST',
|
|
56
|
+
pattern: /^\/api\/queue\/return$/,
|
|
57
|
+
handle: async (_, body, repository) => {
|
|
58
|
+
const { run } = parseBody(z.object({ run: z.string().min(1) }), body);
|
|
59
|
+
return call('queue_return', { runId: run, ...(repository ? { repository } : {}) });
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
method: 'POST',
|
|
64
|
+
pattern: /^\/api\/queue\/dismiss$/,
|
|
65
|
+
handle: async (_, body, repository) => {
|
|
66
|
+
const { run } = parseBody(z.object({ run: z.string().min(1) }), body);
|
|
67
|
+
return call('queue_dismiss', { runId: run, ...(repository ? { repository } : {}) });
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
method: 'POST',
|
|
72
|
+
pattern: /^\/api\/queue\/settings$/,
|
|
73
|
+
handle: async (_, body, repository) => call('queue_settings', {
|
|
74
|
+
...queueBody(body),
|
|
75
|
+
repository,
|
|
76
|
+
}),
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=queue.js.map
|