@hoknie/aip 0.1.0 → 0.2.1
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/dist/app/agents.js +2 -0
- package/dist/app/agents.js.map +1 -1
- package/dist/app/application.js +41 -3
- package/dist/app/application.js.map +1 -1
- package/dist/app/lifecycle.js +5 -1
- package/dist/app/lifecycle.js.map +1 -1
- package/dist/app/timings.js +1 -0
- package/dist/app/timings.js.map +1 -1
- package/dist/app/wiring.js +1 -0
- package/dist/app/wiring.js.map +1 -1
- package/dist/cli/main.js +0 -0
- package/dist/feature/agents/clients/agy/guard.js +26 -8
- package/dist/feature/agents/clients/agy/guard.js.map +1 -1
- package/dist/feature/agents/clients/agy/permissions.js +9 -1
- package/dist/feature/agents/clients/agy/permissions.js.map +1 -1
- package/dist/feature/agents/clients/agy/runtime.js +8 -1
- package/dist/feature/agents/clients/agy/runtime.js.map +1 -1
- package/dist/feature/agents/clients/claude/index.js +1 -0
- package/dist/feature/agents/clients/claude/index.js.map +1 -1
- 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 +8 -0
- package/dist/feature/agents/clients/claude/parser.js.map +1 -1
- package/dist/feature/agents/clients/claude/runtime.js +2 -0
- package/dist/feature/agents/clients/claude/runtime.js.map +1 -1
- package/dist/feature/agents/clients/opencode/index.js +1 -0
- package/dist/feature/agents/clients/opencode/index.js.map +1 -1
- 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/runtime.js +14 -1
- package/dist/feature/agents/clients/opencode/runtime.js.map +1 -1
- package/dist/feature/agents/ports/command.js +2 -0
- package/dist/feature/agents/ports/command.js.map +1 -0
- package/dist/feature/agents/services/agents.js +42 -1
- package/dist/feature/agents/services/agents.js.map +1 -1
- package/dist/feature/agents/services/catalog.js +1 -1
- package/dist/feature/agents/services/catalog.js.map +1 -1
- package/dist/feature/agents/types/index.js +2 -0
- package/dist/feature/agents/types/index.js.map +1 -1
- package/dist/feature/agents/types/mcp/env.js +54 -0
- package/dist/feature/agents/types/mcp/env.js.map +1 -0
- package/dist/feature/agents/types/message.js +1 -0
- package/dist/feature/agents/types/message.js.map +1 -1
- package/dist/feature/agents/types/models.js +2 -0
- package/dist/feature/agents/types/models.js.map +1 -0
- package/dist/feature/agents/types/runtime.js.map +1 -1
- package/dist/feature/agents/types/worker-tools.js +2 -0
- package/dist/feature/agents/types/worker-tools.js.map +1 -1
- 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/repositories/observers.js +7 -1
- package/dist/feature/observers/repositories/observers.js.map +1 -1
- package/dist/feature/observers/services/observers.js +33 -5
- package/dist/feature/observers/services/observers.js.map +1 -1
- package/dist/feature/observers/services/settings-check.js +1 -7
- package/dist/feature/observers/services/settings-check.js.map +1 -1
- package/dist/feature/observers/types/plan-repairs.js +48 -16
- package/dist/feature/observers/types/plan-repairs.js.map +1 -1
- package/dist/feature/observers/types/settings.js +0 -1
- package/dist/feature/observers/types/settings.js.map +1 -1
- package/dist/feature/queue/repositories/queues.js +28 -4
- package/dist/feature/queue/repositories/queues.js.map +1 -1
- package/dist/feature/queue/services/control.js +46 -8
- package/dist/feature/queue/services/control.js.map +1 -1
- package/dist/feature/queue/services/store.js +4 -0
- package/dist/feature/queue/services/store.js.map +1 -1
- package/dist/feature/queue/services/task-tags.js +4 -1
- package/dist/feature/queue/services/task-tags.js.map +1 -1
- package/dist/feature/queue/types/advance.js +29 -12
- package/dist/feature/queue/types/advance.js.map +1 -1
- package/dist/feature/queue/types/filter.js +36 -0
- package/dist/feature/queue/types/filter.js.map +1 -0
- package/dist/feature/queue/types/index.js +1 -0
- package/dist/feature/queue/types/index.js.map +1 -1
- package/dist/feature/queue/types/items.js +1 -0
- package/dist/feature/queue/types/items.js.map +1 -1
- package/dist/feature/queue/types/returns.js +18 -3
- package/dist/feature/queue/types/returns.js.map +1 -1
- package/dist/feature/queue/types/settings.js +14 -3
- package/dist/feature/queue/types/settings.js.map +1 -1
- package/dist/feature/runs/machine/exits.js +23 -1
- package/dist/feature/runs/machine/exits.js.map +1 -1
- package/dist/feature/runs/machine/plan.js +38 -16
- package/dist/feature/runs/machine/plan.js.map +1 -1
- package/dist/feature/runs/machine/repair.js +10 -3
- package/dist/feature/runs/machine/repair.js.map +1 -1
- package/dist/feature/runs/machine/scheduler.js +10 -3
- package/dist/feature/runs/machine/scheduler.js.map +1 -1
- package/dist/feature/runs/machine/steps.js +11 -11
- package/dist/feature/runs/machine/steps.js.map +1 -1
- package/dist/feature/runs/machine/transition.js +16 -2
- package/dist/feature/runs/machine/transition.js.map +1 -1
- package/dist/feature/runs/repositories/finished-runs.js +14 -10
- package/dist/feature/runs/repositories/finished-runs.js.map +1 -1
- package/dist/feature/runs/repositories/write.js +1 -1
- package/dist/feature/runs/repositories/write.js.map +1 -1
- package/dist/feature/runs/services/create.js +1 -0
- package/dist/feature/runs/services/create.js.map +1 -1
- package/dist/feature/runs/services/effects/actions.js +3 -2
- package/dist/feature/runs/services/effects/actions.js.map +1 -1
- package/dist/feature/runs/services/effects/attempts.js +61 -13
- package/dist/feature/runs/services/effects/attempts.js.map +1 -1
- package/dist/feature/runs/services/effects/context.js.map +1 -1
- package/dist/feature/runs/services/effects/effects.js +5 -0
- package/dist/feature/runs/services/effects/effects.js.map +1 -1
- package/dist/feature/runs/services/effects/naming.js +4 -1
- package/dist/feature/runs/services/effects/naming.js.map +1 -1
- 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/runtime-check.js +20 -0
- package/dist/feature/runs/services/effects/runtime-check.js.map +1 -0
- package/dist/feature/runs/services/engine.js +14 -5
- package/dist/feature/runs/services/engine.js.map +1 -1
- package/dist/feature/runs/services/index.js.map +1 -1
- package/dist/feature/runs/services/reads.js +40 -1
- package/dist/feature/runs/services/reads.js.map +1 -1
- package/dist/feature/runs/services/requests.js +7 -1
- package/dist/feature/runs/services/requests.js.map +1 -1
- package/dist/feature/runs/services/states.js +2 -2
- package/dist/feature/runs/services/states.js.map +1 -1
- package/dist/feature/runs/types/attempt.js +8 -0
- package/dist/feature/runs/types/attempt.js.map +1 -1
- package/dist/feature/runs/types/group.js.map +1 -1
- package/dist/feature/runs/types/input.js +33 -0
- package/dist/feature/runs/types/input.js.map +1 -1
- package/dist/feature/runs/types/limits.js +13 -1
- package/dist/feature/runs/types/limits.js.map +1 -1
- 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/services/assemble.js +1 -1
- package/dist/feature/swarm-config/services/assemble.js.map +1 -1
- package/dist/feature/swarm-config/services/index.js +4 -2
- package/dist/feature/swarm-config/services/index.js.map +1 -1
- package/dist/feature/swarm-config/services/load.js +17 -2
- package/dist/feature/swarm-config/services/load.js.map +1 -1
- package/dist/feature/swarm-config/services/sections/mcp-servers.js +128 -0
- package/dist/feature/swarm-config/services/sections/mcp-servers.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 +23 -1
- package/dist/feature/swarm-config/services/settings.js.map +1 -1
- package/dist/feature/swarm-config/services/validate-actions.js +9 -1
- package/dist/feature/swarm-config/services/validate-actions.js.map +1 -1
- package/dist/feature/swarm-config/services/validate-runtimes.js +3 -51
- package/dist/feature/swarm-config/services/validate-runtimes.js.map +1 -1
- package/dist/feature/swarm-config/services/validate-settings.js +65 -0
- package/dist/feature/swarm-config/services/validate-settings.js.map +1 -1
- package/dist/feature/swarm-config/services/validate-specialists.js +5 -4
- package/dist/feature/swarm-config/services/validate-specialists.js.map +1 -1
- package/dist/feature/swarm-config/services/validate.js +24 -8
- package/dist/feature/swarm-config/services/validate.js.map +1 -1
- package/dist/feature/swarm-config/types/action.js +9 -0
- package/dist/feature/swarm-config/types/action.js.map +1 -1
- package/dist/feature/swarm-config/types/index.js +1 -0
- package/dist/feature/swarm-config/types/index.js.map +1 -1
- package/dist/feature/swarm-config/types/mcp/reference.js +40 -0
- package/dist/feature/swarm-config/types/mcp/reference.js.map +1 -0
- package/dist/feature/swarm-config/types/merge.js +1 -0
- package/dist/feature/swarm-config/types/merge.js.map +1 -1
- package/dist/feature/swarm-config/types/settings.js +37 -5
- package/dist/feature/swarm-config/types/settings.js.map +1 -1
- package/dist/feature/swarm-config/types/specialist.js.map +1 -1
- package/dist/feature/swarm-edit/services/config-edits.js +26 -1
- package/dist/feature/swarm-edit/services/config-edits.js.map +1 -1
- package/dist/feature/swarm-edit/services/editor-settings.js +36 -7
- package/dist/feature/swarm-edit/services/editor-settings.js.map +1 -1
- package/dist/feature/swarm-edit/services/editor-view.js +2 -0
- package/dist/feature/swarm-edit/services/editor-view.js.map +1 -1
- package/dist/feature/swarm-edit/services/index.js +1 -0
- package/dist/feature/swarm-edit/services/index.js.map +1 -1
- package/dist/feature/swarm-edit/services/mcp/editor-mcp.js +51 -0
- package/dist/feature/swarm-edit/services/mcp/editor-mcp.js.map +1 -0
- package/dist/feature/swarm-edit/services/mcp/plan-mcp-server.js +93 -0
- package/dist/feature/swarm-edit/services/mcp/plan-mcp-server.js.map +1 -0
- package/dist/feature/swarm-edit/services/plan-settings.js +3 -1
- package/dist/feature/swarm-edit/services/plan-settings.js.map +1 -1
- package/dist/feature/swarm-edit/types/editor.js.map +1 -1
- package/dist/feature/swarm-edit/types/setting-fields.js +12 -0
- package/dist/feature/swarm-edit/types/setting-fields.js.map +1 -1
- package/dist/platform/git/delivery.js +1 -1
- package/dist/platform/git/delivery.js.map +1 -1
- 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/process/command.js +23 -0
- package/dist/platform/process/command.js.map +1 -0
- package/dist/platform/process/index.js +1 -0
- package/dist/platform/process/index.js.map +1 -1
- package/dist/platform/sqlite/migrations.js +3 -0
- package/dist/platform/sqlite/migrations.js.map +1 -1
- package/dist/platform/sqlite/stats-migration.js +42 -0
- package/dist/platform/sqlite/stats-migration.js.map +1 -0
- package/dist/presentation/cli/commands/queue-edit.js +23 -1
- package/dist/presentation/cli/commands/queue-edit.js.map +1 -1
- package/dist/presentation/cli/commands/stats.js +41 -0
- package/dist/presentation/cli/commands/stats.js.map +1 -0
- package/dist/presentation/cli/help.js +1 -1
- package/dist/presentation/cli/help.js.map +1 -1
- package/dist/presentation/cli/local/config-check.js +23 -5
- package/dist/presentation/cli/local/config-check.js.map +1 -1
- package/dist/presentation/cli/program.js +2 -0
- package/dist/presentation/cli/program.js.map +1 -1
- package/dist/presentation/format/index.js +1 -0
- package/dist/presentation/format/index.js.map +1 -1
- package/dist/presentation/format/queue.js +15 -2
- package/dist/presentation/format/queue.js.map +1 -1
- package/dist/presentation/format/runs.js +8 -1
- package/dist/presentation/format/runs.js.map +1 -1
- package/dist/presentation/format/stats.js +79 -0
- package/dist/presentation/format/stats.js.map +1 -0
- package/dist/presentation/ipc/contract/agents.js +18 -0
- package/dist/presentation/ipc/contract/agents.js.map +1 -1
- package/dist/presentation/ipc/contract/config.js +26 -0
- package/dist/presentation/ipc/contract/config.js.map +1 -1
- package/dist/presentation/ipc/contract/envelope.js +4 -1
- package/dist/presentation/ipc/contract/envelope.js.map +1 -1
- package/dist/presentation/ipc/contract/groups.js +9 -0
- package/dist/presentation/ipc/contract/groups.js.map +1 -1
- package/dist/presentation/ipc/contract/index.js +1 -0
- package/dist/presentation/ipc/contract/index.js.map +1 -1
- package/dist/presentation/ipc/contract/panel.js +11 -0
- package/dist/presentation/ipc/contract/panel.js.map +1 -1
- package/dist/presentation/ipc/contract/queue.js +11 -1
- package/dist/presentation/ipc/contract/queue.js.map +1 -1
- package/dist/presentation/ipc/contract/responses/index.js +1 -0
- package/dist/presentation/ipc/contract/responses/index.js.map +1 -1
- 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/runs.js +10 -0
- package/dist/presentation/ipc/contract/runs.js.map +1 -1
- 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/handlers/config.js +7 -0
- package/dist/presentation/ipc/handlers/config.js.map +1 -1
- package/dist/presentation/ipc/handlers/groups.js +8 -0
- package/dist/presentation/ipc/handlers/groups.js.map +1 -1
- package/dist/presentation/ipc/handlers/runs.js +2 -1
- package/dist/presentation/ipc/handlers/runs.js.map +1 -1
- 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 +2 -0
- package/dist/presentation/ipc/handlers/system.js.map +1 -1
- package/dist/presentation/ipc/handlers/table.js +2 -0
- package/dist/presentation/ipc/handlers/table.js.map +1 -1
- package/dist/presentation/ipc/publisher.js +1 -0
- package/dist/presentation/ipc/publisher.js.map +1 -1
- package/dist/presentation/ipc/snapshots.js +2 -2
- package/dist/presentation/ipc/snapshots.js.map +1 -1
- package/dist/presentation/ipc/views/catalog.js +3 -3
- package/dist/presentation/ipc/views/catalog.js.map +1 -1
- package/dist/presentation/ipc/views/index.js +1 -0
- package/dist/presentation/ipc/views/index.js.map +1 -1
- package/dist/presentation/ipc/views/observers.js +2 -2
- package/dist/presentation/ipc/views/observers.js.map +1 -1
- package/dist/presentation/ipc/views/queue.js +9 -2
- package/dist/presentation/ipc/views/queue.js.map +1 -1
- package/dist/presentation/ipc/views/runs.js +3 -4
- package/dist/presentation/ipc/views/runs.js.map +1 -1
- package/dist/presentation/ipc/views/stats.js +5 -0
- package/dist/presentation/ipc/views/stats.js.map +1 -0
- package/dist/presentation/mcp/host-queue-control.js +11 -2
- package/dist/presentation/mcp/host-queue-control.js.map +1 -1
- package/dist/presentation/mcp/worker-extra.js +2 -2
- package/dist/presentation/mcp/worker-extra.js.map +1 -1
- package/dist/presentation/mcp/worker-read.js +45 -0
- package/dist/presentation/mcp/worker-read.js.map +1 -0
- package/dist/presentation/mcp/worker.js +2 -0
- package/dist/presentation/mcp/worker.js.map +1 -1
- package/dist/presentation/web/hub.js +4 -0
- package/dist/presentation/web/hub.js.map +1 -1
- package/dist/presentation/web/panel/directories.js +1 -1
- package/dist/presentation/web/panel/directories.js.map +1 -1
- package/dist/presentation/web/panel/system.js +1 -0
- package/dist/presentation/web/panel/system.js.map +1 -1
- package/dist/presentation/web/request.js +28 -1
- package/dist/presentation/web/request.js.map +1 -1
- package/dist/presentation/web/routes/catalog/mcp-servers.js +50 -0
- package/dist/presentation/web/routes/catalog/mcp-servers.js.map +1 -0
- package/dist/presentation/web/routes/config.js +5 -0
- package/dist/presentation/web/routes/config.js.map +1 -1
- package/dist/presentation/web/routes/runs.js +5 -0
- package/dist/presentation/web/routes/runs.js.map +1 -1
- 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/server.js +5 -1
- package/dist/presentation/web/server.js.map +1 -1
- package/dist/web/assets/FilterColumn-BrQWIM5F.js +1 -0
- package/dist/web/assets/SharedPipelinesGroup-WFngQrqI.js +1 -0
- package/dist/web/assets/badge-B_khFsd6.js +1 -0
- package/dist/web/assets/{card-DkikoTxR.js → card-COXjnc-y.js} +1 -1
- package/dist/web/assets/empty-Eb-EZDPX.js +41 -0
- package/dist/web/assets/index-DEXoIe2a.js +21 -0
- package/dist/web/assets/index-DMlIe0VD.css +2 -0
- package/dist/web/assets/locales-BlBJo1PR.js +1 -0
- package/dist/web/assets/pipelines-B3cdeex_.js +10 -0
- package/dist/web/assets/queue-HMUImu0E.js +16 -0
- package/dist/web/assets/select-MHus_Unr.js +1 -0
- package/dist/web/assets/settingFields-DVg9TQK2.js +1 -0
- package/dist/web/assets/settings-CpeEsUXX.js +6 -0
- package/dist/web/assets/skeleton-CWY1nRvW.js +1 -0
- package/dist/web/assets/specialists-BkLXuqUd.js +1 -0
- package/dist/web/assets/stats-DRg_5vll.js +1 -0
- package/dist/web/assets/topology-DGTNdDHf.js +1 -0
- package/dist/web/assets/trash-CFJeuRuc.js +1 -0
- package/dist/web/assets/useListDrag-B7Wlt2u9.js +1 -0
- package/dist/web/index.html +7 -6
- package/integrations/claude-code/.claude-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/dist/cli/clean.js +0 -71
- package/dist/cli/clean.js.map +0 -1
- package/dist/cli/commands.js +0 -963
- package/dist/cli/commands.js.map +0 -1
- package/dist/cli/config-check.js +0 -173
- package/dist/cli/config-check.js.map +0 -1
- package/dist/cli/daemon.js +0 -199
- package/dist/cli/daemon.js.map +0 -1
- package/dist/cli/help.js +0 -50
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/init.js +0 -43
- package/dist/cli/init.js.map +0 -1
- package/dist/cli/io.js +0 -13
- package/dist/cli/io.js.map +0 -1
- package/dist/cli/probe.js +0 -12
- package/dist/cli/probe.js.map +0 -1
- package/dist/cli/program.js +0 -48
- package/dist/cli/program.js.map +0 -1
- package/dist/cli/setup.js +0 -406
- package/dist/cli/setup.js.map +0 -1
- package/dist/cli/version.js +0 -6
- package/dist/cli/version.js.map +0 -1
- package/dist/cli/watch.js +0 -24
- package/dist/cli/watch.js.map +0 -1
- package/dist/cli/web/daemon-panel.js +0 -185
- package/dist/cli/web/daemon-panel.js.map +0 -1
- package/dist/cli/web/default-repository.js +0 -12
- package/dist/cli/web/default-repository.js.map +0 -1
- package/dist/cli/web/errors.js +0 -60
- package/dist/cli/web/errors.js.map +0 -1
- package/dist/cli/web/open.js +0 -12
- package/dist/cli/web/open.js.map +0 -1
- package/dist/cli/web/page.js +0 -465
- package/dist/cli/web/page.js.map +0 -1
- package/dist/cli/web/server.js +0 -1191
- package/dist/cli/web/server.js.map +0 -1
- package/dist/cli/web/standby.js +0 -119
- package/dist/cli/web/standby.js.map +0 -1
- package/dist/cli/web/state.js +0 -69
- package/dist/cli/web/state.js.map +0 -1
- package/dist/cli/web/system.js +0 -66
- package/dist/cli/web/system.js.map +0 -1
- package/dist/cli/web-control.js +0 -173
- package/dist/cli/web-control.js.map +0 -1
- package/dist/config/discover.js +0 -25
- package/dist/config/discover.js.map +0 -1
- package/dist/config/duration.js +0 -17
- package/dist/config/duration.js.map +0 -1
- package/dist/config/edit.js +0 -966
- package/dist/config/edit.js.map +0 -1
- package/dist/config/errors.js +0 -29
- package/dist/config/errors.js.map +0 -1
- package/dist/config/index.js +0 -14
- package/dist/config/index.js.map +0 -1
- package/dist/config/load.js +0 -412
- package/dist/config/load.js.map +0 -1
- package/dist/config/merge.js +0 -45
- package/dist/config/merge.js.map +0 -1
- package/dist/config/model.js +0 -171
- package/dist/config/model.js.map +0 -1
- package/dist/config/paths.js +0 -31
- package/dist/config/paths.js.map +0 -1
- package/dist/config/prompt.js +0 -33
- package/dist/config/prompt.js.map +0 -1
- package/dist/config/shared-pipelines.js +0 -71
- package/dist/config/shared-pipelines.js.map +0 -1
- package/dist/config/shared-specialists.js +0 -68
- package/dist/config/shared-specialists.js.map +0 -1
- package/dist/config/shared-workflows.js +0 -71
- package/dist/config/shared-workflows.js.map +0 -1
- package/dist/config/specialist-tags.js +0 -214
- package/dist/config/specialist-tags.js.map +0 -1
- package/dist/config/tag-names.js +0 -43
- package/dist/config/tag-names.js.map +0 -1
- package/dist/config/validate.js +0 -872
- package/dist/config/validate.js.map +0 -1
- package/dist/core/artifacts.js +0 -37
- package/dist/core/artifacts.js.map +0 -1
- package/dist/core/create.js +0 -75
- package/dist/core/create.js.map +0 -1
- package/dist/core/delivery.js +0 -366
- package/dist/core/delivery.js.map +0 -1
- package/dist/core/errors.js +0 -7
- package/dist/core/errors.js.map +0 -1
- package/dist/core/ids.js +0 -99
- package/dist/core/ids.js.map +0 -1
- package/dist/core/index.js +0 -21
- package/dist/core/index.js.map +0 -1
- package/dist/core/input.js +0 -45
- package/dist/core/input.js.map +0 -1
- package/dist/core/machine.js +0 -1021
- package/dist/core/machine.js.map +0 -1
- package/dist/core/model.js +0 -460
- package/dist/core/model.js.map +0 -1
- package/dist/core/observer.js +0 -193
- package/dist/core/observer.js.map +0 -1
- package/dist/core/occupancy.js +0 -63
- package/dist/core/occupancy.js.map +0 -1
- package/dist/core/permissions.js +0 -222
- package/dist/core/permissions.js.map +0 -1
- package/dist/core/plan.js +0 -99
- package/dist/core/plan.js.map +0 -1
- package/dist/core/progress.js +0 -43
- package/dist/core/progress.js.map +0 -1
- package/dist/core/questions.js +0 -19
- package/dist/core/questions.js.map +0 -1
- package/dist/core/queue.js +0 -859
- package/dist/core/queue.js.map +0 -1
- package/dist/core/retryable.js +0 -8
- package/dist/core/retryable.js.map +0 -1
- package/dist/core/scheduler.js +0 -160
- package/dist/core/scheduler.js.map +0 -1
- package/dist/core/skip.js +0 -109
- package/dist/core/skip.js.map +0 -1
- package/dist/core/stages.js +0 -304
- package/dist/core/stages.js.map +0 -1
- package/dist/core/summary.js +0 -35
- package/dist/core/summary.js.map +0 -1
- package/dist/core/tags.js +0 -184
- package/dist/core/tags.js.map +0 -1
- package/dist/core/topology.js +0 -162
- package/dist/core/topology.js.map +0 -1
- package/dist/daemon/artifacts.js +0 -84
- package/dist/daemon/artifacts.js.map +0 -1
- package/dist/daemon/daemon.js +0 -1442
- package/dist/daemon/daemon.js.map +0 -1
- package/dist/daemon/executor.js +0 -749
- package/dist/daemon/executor.js.map +0 -1
- package/dist/daemon/helpers.js +0 -38
- package/dist/daemon/helpers.js.map +0 -1
- package/dist/daemon/index.js +0 -4
- package/dist/daemon/index.js.map +0 -1
- package/dist/daemon/logs.js +0 -69
- package/dist/daemon/logs.js.map +0 -1
- package/dist/daemon/observers.js +0 -93
- package/dist/daemon/observers.js.map +0 -1
- package/dist/daemon/patches.js +0 -76
- package/dist/daemon/patches.js.map +0 -1
- package/dist/daemon/ports.js +0 -2
- package/dist/daemon/ports.js.map +0 -1
- package/dist/daemon/processes.js +0 -98
- package/dist/daemon/processes.js.map +0 -1
- package/dist/daemon/repositories.js +0 -2
- package/dist/daemon/repositories.js.map +0 -1
- package/dist/daemon/server.js +0 -164
- package/dist/daemon/server.js.map +0 -1
- package/dist/daemon/supervisor.js +0 -140
- package/dist/daemon/supervisor.js.map +0 -1
- package/dist/daemon/timings.js +0 -23
- package/dist/daemon/timings.js.map +0 -1
- package/dist/git/delivery.js +0 -284
- package/dist/git/delivery.js.map +0 -1
- package/dist/git/index.js +0 -4
- package/dist/git/index.js.map +0 -1
- package/dist/git/runner.js +0 -60
- package/dist/git/runner.js.map +0 -1
- package/dist/git/workspace.js +0 -366
- package/dist/git/workspace.js.map +0 -1
- package/dist/mcp/host.js +0 -401
- package/dist/mcp/host.js.map +0 -1
- package/dist/mcp/index.js +0 -3
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/tools.js +0 -19
- package/dist/mcp/tools.js.map +0 -1
- package/dist/mcp/version.js +0 -5
- package/dist/mcp/version.js.map +0 -1
- package/dist/mcp/worker.js +0 -230
- package/dist/mcp/worker.js.map +0 -1
- package/dist/presentation/web/routes/directories.js +0 -60
- package/dist/presentation/web/routes/directories.js.map +0 -1
- package/dist/protocol/autostart.js +0 -171
- package/dist/protocol/autostart.js.map +0 -1
- package/dist/protocol/build.js +0 -38
- package/dist/protocol/build.js.map +0 -1
- package/dist/protocol/catalog.js +0 -18
- package/dist/protocol/catalog.js.map +0 -1
- package/dist/protocol/client.js +0 -83
- package/dist/protocol/client.js.map +0 -1
- package/dist/protocol/format.js +0 -477
- package/dist/protocol/format.js.map +0 -1
- package/dist/protocol/index.js +0 -11
- package/dist/protocol/index.js.map +0 -1
- package/dist/protocol/messages.js +0 -598
- package/dist/protocol/messages.js.map +0 -1
- package/dist/protocol/style.js +0 -81
- package/dist/protocol/style.js.map +0 -1
- package/dist/protocol/transcript.js +0 -49
- package/dist/protocol/transcript.js.map +0 -1
- package/dist/protocol/views.js +0 -696
- package/dist/protocol/views.js.map +0 -1
- package/dist/runtime/catalog.js +0 -117
- package/dist/runtime/catalog.js.map +0 -1
- package/dist/runtime/claude.js +0 -399
- package/dist/runtime/claude.js.map +0 -1
- package/dist/runtime/index.js +0 -34
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/message.js +0 -48
- package/dist/runtime/message.js.map +0 -1
- package/dist/runtime/naming.js +0 -69
- package/dist/runtime/naming.js.map +0 -1
- package/dist/runtime/opencode.js +0 -189
- package/dist/runtime/opencode.js.map +0 -1
- package/dist/runtime/skills.js +0 -17
- package/dist/runtime/skills.js.map +0 -1
- package/dist/runtime/transcript.js +0 -227
- package/dist/runtime/transcript.js.map +0 -1
- package/dist/runtime/types.js +0 -12
- package/dist/runtime/types.js.map +0 -1
- package/dist/runtime/which.js +0 -21
- package/dist/runtime/which.js.map +0 -1
- package/dist/store/index.js +0 -3
- package/dist/store/index.js.map +0 -1
- package/dist/store/schema.js +0 -286
- package/dist/store/schema.js.map +0 -1
- package/dist/store/store.js +0 -491
- package/dist/store/store.js.map +0 -1
- package/dist/web/assets/EntryList-CnfGgjEY.js +0 -1
- package/dist/web/assets/FilePath-C0X8-keS.js +0 -1
- package/dist/web/assets/SettingsForm-BcyBWJbn.js +0 -1
- package/dist/web/assets/SharedPipelinesGroup-a368-IQ0.js +0 -1
- package/dist/web/assets/index-B-oJ93zH.js +0 -22
- package/dist/web/assets/index-BZE36gYR.css +0 -2
- package/dist/web/assets/locales-DtRrxYzg.js +0 -1
- package/dist/web/assets/pipelines-D48ggDNe.js +0 -1
- package/dist/web/assets/queue-D8_RY4IY.js +0 -16
- package/dist/web/assets/select-J4oIrmYh.js +0 -1
- package/dist/web/assets/settings-B0-0Vaia.js +0 -2
- package/dist/web/assets/skeleton-CCKCQF5n.js +0 -1
- package/dist/web/assets/specialists-DH8tyluO.js +0 -1
- package/dist/web/assets/switch-CWFAgxG1.js +0 -41
- package/dist/web/assets/topology-CNQ28AB2.js +0 -7
- /package/dist/web/assets/{topology-DLioOiRN.css → pipelines-DLioOiRN.css} +0 -0
package/dist/protocol/views.js
DELETED
|
@@ -1,696 +0,0 @@
|
|
|
1
|
-
import { pipelineNameOf, } from '../feature/swarm-config/types/index.js';
|
|
2
|
-
import {} from '../feature/swarm-edit/types/index.js';
|
|
3
|
-
import { DEFAULT_AUTOPILOT_ANSWER, itemReadiness, dependencyState, freezeCandidate, occupiesSlot, canReturn, } from '../feature/queue/types/index.js';
|
|
4
|
-
import { defaultObserverSettings, repairAdmitted, repairIncidents, } from '../feature/observers/types/index.js';
|
|
5
|
-
import { actionGroupsOf, actionPointOf, allGroups, findGroup, parseActionSlug, attemptVerdict, describeFailReason, deliveryCounts, groupRef, groupUsage, isRunFinished, isServiceGroup, isSplitGroup, isTerminal, limitResetsAt, runPhase, runTitle, runProblems, stepsOf, topology, stepStates, stepLabel, attemptStepLabel, GROUP_STATUSES, } from '../feature/runs/types/index.js';
|
|
6
|
-
import { stepProgress, runStartedAt, summarize, specialistUse, } from '../feature/runs/services/index.js';
|
|
7
|
-
import { knownTags } from '../feature/tags/types/index.js';
|
|
8
|
-
import { suggestPatterns, } from '../feature/agents/types/index.js';
|
|
9
|
-
export function tagViews(catalog, ids) {
|
|
10
|
-
const byId = new Map(catalog.map((tag) => [tag.id, tag]));
|
|
11
|
-
return knownTags(catalog, ids).flatMap((id) => {
|
|
12
|
-
const tag = byId.get(id);
|
|
13
|
-
return tag
|
|
14
|
-
? [
|
|
15
|
-
{
|
|
16
|
-
id: tag.id,
|
|
17
|
-
repository: tag.repository,
|
|
18
|
-
name: tag.name,
|
|
19
|
-
color: tag.color,
|
|
20
|
-
task: tag.task,
|
|
21
|
-
},
|
|
22
|
-
]
|
|
23
|
-
: [];
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
/** The catalog sorted by repository, then by name ignoring case. */
|
|
27
|
-
export function catalogView(catalog) {
|
|
28
|
-
return [...catalog]
|
|
29
|
-
.sort((a, b) => a.repository.localeCompare(b.repository) ||
|
|
30
|
-
a.name.toLocaleLowerCase('und').localeCompare(b.name.toLocaleLowerCase('und')) ||
|
|
31
|
-
a.id.localeCompare(b.id))
|
|
32
|
-
.map(({ id, repository, name, color, task }) => ({ id, repository, name, color, task }));
|
|
33
|
-
}
|
|
34
|
-
const NO_DIFFS = () => null;
|
|
35
|
-
function totals(diff) {
|
|
36
|
-
return diff ? { files: diff.files.length, added: diff.added, removed: diff.removed } : null;
|
|
37
|
-
}
|
|
38
|
-
export { runTitle } from '../feature/runs/types/index.js';
|
|
39
|
-
const NO_WAITS = () => null;
|
|
40
|
-
const NO_ARTIFACTS = new Map();
|
|
41
|
-
export function displayStatus(status, wait, hold = null) {
|
|
42
|
-
if (status !== 'queued')
|
|
43
|
-
return status;
|
|
44
|
-
return hold ?? (wait !== null ? 'waiting' : status);
|
|
45
|
-
}
|
|
46
|
-
/** Hold that applies to a group: delivery steps (commit message, resolver) run despite it. */
|
|
47
|
-
function groupHold(state, group) {
|
|
48
|
-
const point = actionPointOf(group);
|
|
49
|
-
if (point === 'before_delivery' || point === 'after_delivery')
|
|
50
|
-
return null;
|
|
51
|
-
return group === state.message || group === state.resolve ? null : state.run.hold;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* When the clock of a held run stops: the end of its last attempt, once nothing runs, merges
|
|
55
|
-
* or delivers. Null while the run is not held, is finished, still works or has no attempt.
|
|
56
|
-
*/
|
|
57
|
-
export function clockStoppedAt(state) {
|
|
58
|
-
if (state.run.hold === null || state.run.finishedAt !== null)
|
|
59
|
-
return null;
|
|
60
|
-
if (state.run.pendingDelivery !== null)
|
|
61
|
-
return null;
|
|
62
|
-
const groups = allGroups(state);
|
|
63
|
-
if (groups.some((group) => group.status === 'merging'))
|
|
64
|
-
return null;
|
|
65
|
-
const attempts = groups.flatMap((group) => group.attempts);
|
|
66
|
-
if (attempts.length === 0 || attempts.some((attempt) => attempt.status === 'running')) {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
const ends = attempts
|
|
70
|
-
.map((attempt) => attempt.finishedAt)
|
|
71
|
-
.filter((time) => time !== null);
|
|
72
|
-
return ends.length > 0 ? Math.max(...ends) : null;
|
|
73
|
-
}
|
|
74
|
-
function duration(start, end, now) {
|
|
75
|
-
return Math.max(0, (end ?? now) - start);
|
|
76
|
-
}
|
|
77
|
-
function groupDuration(group, now) {
|
|
78
|
-
const first = group.attempts[0];
|
|
79
|
-
const last = group.attempts.at(-1);
|
|
80
|
-
if (!first || !last)
|
|
81
|
-
return 0;
|
|
82
|
-
return duration(first.startedAt, last.finishedAt, now);
|
|
83
|
-
}
|
|
84
|
-
const LEGACY_OUTSIDE = /^step (\S+) changed files outside its worktree: (.+)$/;
|
|
85
|
-
/**
|
|
86
|
-
* Runs recorded before attempts kept their files outside the worktree have them as warning text.
|
|
87
|
-
* Each such warning goes back to the latest attempt of its step whose list is still empty; later
|
|
88
|
-
* warnings take later attempts. A warning without such an attempt stays a warning.
|
|
89
|
-
*/
|
|
90
|
-
export function legacyOutsideChanges(group) {
|
|
91
|
-
const outside = new Map();
|
|
92
|
-
const kept = [];
|
|
93
|
-
for (const warning of [...group.warnings].reverse()) {
|
|
94
|
-
const match = LEGACY_OUTSIDE.exec(warning);
|
|
95
|
-
const target = match
|
|
96
|
-
? group.attempts.findLast((attempt) => attempt.stepId === match[1] &&
|
|
97
|
-
attempt.outsideChanges.length === 0 &&
|
|
98
|
-
!outside.has(attempt.seq))
|
|
99
|
-
: undefined;
|
|
100
|
-
if (match && target)
|
|
101
|
-
outside.set(target.seq, match[2].split(', '));
|
|
102
|
-
else
|
|
103
|
-
kept.unshift(warning);
|
|
104
|
-
}
|
|
105
|
-
return { warnings: kept, outside };
|
|
106
|
-
}
|
|
107
|
-
/** When a group waiting for a usage limit to reset may start again; null for other groups. */
|
|
108
|
-
export function groupLimitUntil(group) {
|
|
109
|
-
const last = group.attempts.at(-1);
|
|
110
|
-
return group.status === 'queued' && last ? limitResetsAt(last) : null;
|
|
111
|
-
}
|
|
112
|
-
function isHold(status) {
|
|
113
|
-
return status === 'frozen' || status === 'paused';
|
|
114
|
-
}
|
|
115
|
-
export function groupRow(state, group, now, diffs = NO_DIFFS, wait = null, artifacts = NO_ARTIFACTS) {
|
|
116
|
-
const legacy = legacyOutsideChanges(group);
|
|
117
|
-
const last = group.attempts.at(-1);
|
|
118
|
-
const hold = groupHold(state, group);
|
|
119
|
-
return {
|
|
120
|
-
slug: group.slug,
|
|
121
|
-
title: group.title,
|
|
122
|
-
status: displayStatus(group.status, wait, hold),
|
|
123
|
-
wait: group.status === 'queued' && hold === null ? wait : null,
|
|
124
|
-
hold,
|
|
125
|
-
step: last?.stepId ?? null,
|
|
126
|
-
stepName: last ? attemptStepLabel(state, group, last) : null,
|
|
127
|
-
round: last?.round ?? null,
|
|
128
|
-
durationMs: groupDuration(group, now),
|
|
129
|
-
question: group.question,
|
|
130
|
-
questions: group.questions,
|
|
131
|
-
humanOnly: group.humanOnly,
|
|
132
|
-
reason: group.reason,
|
|
133
|
-
warnings: legacy.warnings.length +
|
|
134
|
-
group.attempts.filter((attempt) => attempt.outsideChanges.length > 0 || legacy.outside.has(attempt.seq)).length,
|
|
135
|
-
delivery: group.delivery.state,
|
|
136
|
-
diff: totals(diffs(group.slug)),
|
|
137
|
-
diffRevision: diffs(group.slug)?.revision ?? null,
|
|
138
|
-
limitUntil: groupLimitUntil(group),
|
|
139
|
-
usage: groupUsage(group),
|
|
140
|
-
decisions: group.decisions.map((decision) => ({ ...decision })),
|
|
141
|
-
artifacts: artifacts.get(group.slug)?.count ?? 0,
|
|
142
|
-
artifactsRevision: artifacts.get(group.slug)?.revision ?? 0,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function serviceStatus(group) {
|
|
146
|
-
return group.status === 'merged' ? 'done' : group.status;
|
|
147
|
-
}
|
|
148
|
-
export function systemRow(state, group, kind, now, wait = null, artifacts = NO_ARTIFACTS) {
|
|
149
|
-
const ref = kind === 'action' ? parseActionSlug(group.slug) : null;
|
|
150
|
-
return {
|
|
151
|
-
...groupRow(state, group, now, NO_DIFFS, wait, artifacts),
|
|
152
|
-
kind,
|
|
153
|
-
status: displayStatus(serviceStatus(group), wait, groupHold(state, group)),
|
|
154
|
-
...(ref ? { point: ref.point, action: ref.id } : {}),
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
/** The service steps of a run in the order they run: actions around the split and the delivery. */
|
|
158
|
-
export function systemGroups(state) {
|
|
159
|
-
const actions = (point) => actionGroupsOf(state, point).map((group) => ({ kind: 'action', group }));
|
|
160
|
-
return [
|
|
161
|
-
...actions('before_split'),
|
|
162
|
-
...(state.split ? [{ kind: 'split', group: state.split }] : []),
|
|
163
|
-
...actions('after_split'),
|
|
164
|
-
...actions('before_delivery'),
|
|
165
|
-
...(state.message ? [{ kind: 'message', group: state.message }] : []),
|
|
166
|
-
...(state.resolve ? [{ kind: 'resolve', group: state.resolve }] : []),
|
|
167
|
-
...(state.repair ? [{ kind: 'repair', group: state.repair }] : []),
|
|
168
|
-
...actions('after_delivery'),
|
|
169
|
-
];
|
|
170
|
-
}
|
|
171
|
-
function lastDeliveryAt(state) {
|
|
172
|
-
const times = state.groups
|
|
173
|
-
.filter((group) => group.status === 'merged')
|
|
174
|
-
.map((group) => group.delivery.finishedAt)
|
|
175
|
-
.filter((time) => time !== null);
|
|
176
|
-
return times.length > 0 ? Math.max(...times) : null;
|
|
177
|
-
}
|
|
178
|
-
/** Delivery as a system stage, by the merged groups and the delivery in progress. */
|
|
179
|
-
export function deliveryStage(state) {
|
|
180
|
-
const counts = deliveryCounts(state);
|
|
181
|
-
if (state.run.pendingDelivery !== null)
|
|
182
|
-
return { status: 'delivering' };
|
|
183
|
-
if (counts.merged === 0)
|
|
184
|
-
return null;
|
|
185
|
-
const failed = state.groups.filter((group) => group.status === 'merged' && group.delivery.state === 'apply_failed');
|
|
186
|
-
if (failed.length > 0) {
|
|
187
|
-
return {
|
|
188
|
-
status: 'apply_failed',
|
|
189
|
-
reason: failed[0]?.delivery.reason ?? null,
|
|
190
|
-
groups: failed.map((group) => group.slug),
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
if (counts.applied !== counts.merged)
|
|
194
|
-
return { status: 'pending' };
|
|
195
|
-
return {
|
|
196
|
-
status: 'applied',
|
|
197
|
-
manual: state.groups.some((group) => group.status === 'merged' && group.delivery.manual),
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
/** Status counts with the groups held back by the scheduler moved from `queued` to `waiting`. */
|
|
201
|
-
function countsLine(state, waiting) {
|
|
202
|
-
const summary = summarize(state);
|
|
203
|
-
const counts = { ...summary.counts };
|
|
204
|
-
const hold = state.run.hold;
|
|
205
|
-
const held = hold === null
|
|
206
|
-
? 0
|
|
207
|
-
: allGroups(state).filter((group) => group.status === 'queued' && groupHold(state, group) !== null).length;
|
|
208
|
-
counts['queued'] = (counts['queued'] ?? 0) - waiting - held;
|
|
209
|
-
counts['waiting'] = waiting;
|
|
210
|
-
if (hold !== null)
|
|
211
|
-
counts[hold] = held;
|
|
212
|
-
const order = GROUP_STATUSES.flatMap((status) => status === 'queued' ? ['queued', 'waiting', 'frozen', 'paused'] : [status]);
|
|
213
|
-
return order
|
|
214
|
-
.filter((status) => (counts[status] ?? 0) > 0)
|
|
215
|
-
.map((status) => `${status} ${counts[status]}`)
|
|
216
|
-
.join(' · ');
|
|
217
|
-
}
|
|
218
|
-
function runDiff(state, diffs) {
|
|
219
|
-
const merged = state.groups
|
|
220
|
-
.filter((group) => group.status === 'merged')
|
|
221
|
-
.map((group) => diffs(group.slug));
|
|
222
|
-
if (merged.length === 0 || merged.some((diff) => diff === null))
|
|
223
|
-
return null;
|
|
224
|
-
const files = new Set(merged.flatMap((diff) => diff?.files.map((file) => file.path) ?? []));
|
|
225
|
-
return {
|
|
226
|
-
files: files.size,
|
|
227
|
-
added: merged.reduce((sum, diff) => sum + (diff?.added ?? 0), 0),
|
|
228
|
-
removed: merged.reduce((sum, diff) => sum + (diff?.removed ?? 0), 0),
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
function runLiveDiff(state, diffs) {
|
|
232
|
-
const stats = state.groups
|
|
233
|
-
.filter((group) => !isServiceGroup(group) && group.status !== 'cancelled')
|
|
234
|
-
.map((group) => diffs(group.slug))
|
|
235
|
-
.filter((diff) => diff !== null);
|
|
236
|
-
if (stats.length === 0)
|
|
237
|
-
return null;
|
|
238
|
-
const files = new Set(stats.flatMap((diff) => diff.files.map((file) => file.path)));
|
|
239
|
-
return {
|
|
240
|
-
files: files.size,
|
|
241
|
-
added: stats.reduce((sum, diff) => sum + diff.added, 0),
|
|
242
|
-
removed: stats.reduce((sum, diff) => sum + diff.removed, 0),
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
/** Marks the view with its return item; a finished run with one shows as `queued`. */
|
|
246
|
-
export function withQueue(view, item) {
|
|
247
|
-
if (item === null)
|
|
248
|
-
return view;
|
|
249
|
-
const state = view.hold !== null || view.state === 'repair'
|
|
250
|
-
? view.state
|
|
251
|
-
: view.finished
|
|
252
|
-
? 'queued'
|
|
253
|
-
: view.state;
|
|
254
|
-
return { ...view, queueItem: item, state };
|
|
255
|
-
}
|
|
256
|
-
function runProgress(state) {
|
|
257
|
-
const { done, total } = stepProgress(state);
|
|
258
|
-
return { done, total };
|
|
259
|
-
}
|
|
260
|
-
/** The incident being repaired, or a waiting one an observer may take; the run has no hold. */
|
|
261
|
-
function repairActive(state, observers) {
|
|
262
|
-
if (state.run.hold !== null)
|
|
263
|
-
return false;
|
|
264
|
-
return (state.run.repair.incident !== null ||
|
|
265
|
-
(repairAdmitted(state, observers) && repairIncidents(state, observers).length > 0));
|
|
266
|
-
}
|
|
267
|
-
function repairView(state, observers) {
|
|
268
|
-
const { repair } = state.run;
|
|
269
|
-
return {
|
|
270
|
-
allowed: repair.allowed,
|
|
271
|
-
active: repairActive(state, observers),
|
|
272
|
-
repairs: repair.repairs,
|
|
273
|
-
incident: repair.incident,
|
|
274
|
-
cancelReason: repair.cancelReason,
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
export function runView(state, now, diffs = NO_DIFFS, catalog = [], waits = NO_WAITS, artifacts = NO_ARTIFACTS, observers = defaultObserverSettings()) {
|
|
278
|
-
const summary = summarize(state);
|
|
279
|
-
const waitOf = (group) => group.status === 'queued' && groupHold(state, group) === null
|
|
280
|
-
? waits(state.run.id, group.slug)
|
|
281
|
-
: null;
|
|
282
|
-
const waitingGroups = state.groups.filter((group) => waitOf(group) !== null).length;
|
|
283
|
-
const stages = {
|
|
284
|
-
split: state.split
|
|
285
|
-
? displayStatus(serviceStatus(state.split), waitOf(state.split), groupHold(state, state.split))
|
|
286
|
-
: null,
|
|
287
|
-
resolve: state.resolve ? displayStatus(state.resolve.status, waitOf(state.resolve)) : null,
|
|
288
|
-
};
|
|
289
|
-
const waitingTopology = topology(state);
|
|
290
|
-
for (const step of waitingTopology.steps) {
|
|
291
|
-
for (const group of step.groups) {
|
|
292
|
-
const found = state.groups.find((candidate) => candidate.slug === group.slug);
|
|
293
|
-
if (!found || group.status !== 'queued')
|
|
294
|
-
continue;
|
|
295
|
-
const shown = displayStatus('queued', waitOf(found), groupHold(state, found));
|
|
296
|
-
if (shown !== 'queued')
|
|
297
|
-
group.status = shown;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
if (waitingTopology.split && (stages.split === 'waiting' || isHold(stages.split))) {
|
|
301
|
-
waitingTopology.split.status = stages.split;
|
|
302
|
-
}
|
|
303
|
-
if (waitingTopology.delivery.resolverStatus && stages.resolve === 'waiting') {
|
|
304
|
-
waitingTopology.delivery.resolverStatus = 'waiting';
|
|
305
|
-
}
|
|
306
|
-
for (const stage of waitingTopology.stages) {
|
|
307
|
-
const found = stage.group === null ? undefined : findGroup(state, stage.group);
|
|
308
|
-
if (!found || stage.status !== 'queued')
|
|
309
|
-
continue;
|
|
310
|
-
const shown = displayStatus('queued', waitOf(found), groupHold(state, found));
|
|
311
|
-
if (shown !== 'queued')
|
|
312
|
-
stage.status = shown;
|
|
313
|
-
}
|
|
314
|
-
return {
|
|
315
|
-
id: state.run.id,
|
|
316
|
-
number: state.run.number,
|
|
317
|
-
title: runTitle(state),
|
|
318
|
-
name: state.run.name ?? null,
|
|
319
|
-
repository: state.run.repository,
|
|
320
|
-
pipeline: state.run.pipeline,
|
|
321
|
-
pipelineName: pipelineNameOf(state.run.config, state.run.pipeline),
|
|
322
|
-
branch: state.run.branch,
|
|
323
|
-
createdAt: state.run.createdAt,
|
|
324
|
-
startedAt: runStartedAt(state),
|
|
325
|
-
finishedAt: state.run.finishedAt,
|
|
326
|
-
finished: summary.finished,
|
|
327
|
-
state: repairActive(state, observers)
|
|
328
|
-
? 'repair'
|
|
329
|
-
: state.run.hold !== null && summary.state !== 'needs_human'
|
|
330
|
-
? state.run.hold
|
|
331
|
-
: summary.state,
|
|
332
|
-
hold: state.run.hold,
|
|
333
|
-
clockStoppedAt: clockStoppedAt(state),
|
|
334
|
-
waiting: summary.waiting,
|
|
335
|
-
dirtyWarning: state.run.dirtyWarning,
|
|
336
|
-
autoDeliver: state.run.config.delivery.auto,
|
|
337
|
-
deliveryMode: state.run.config.delivery.mode,
|
|
338
|
-
fromQueue: state.run.fromQueue,
|
|
339
|
-
returnable: false,
|
|
340
|
-
// The queue is unknown here: the daemon fills it in with `withQueue`.
|
|
341
|
-
queueItem: null,
|
|
342
|
-
tags: tagViews(catalog, state.run.tags),
|
|
343
|
-
counts: countsLine(state, waitingGroups),
|
|
344
|
-
total: summary.total,
|
|
345
|
-
usage: summary.usage,
|
|
346
|
-
split: state.split
|
|
347
|
-
? {
|
|
348
|
-
status: stages.split ?? 'queued',
|
|
349
|
-
wait: groupHold(state, state.split) === null ? waitOf(state.split) : null,
|
|
350
|
-
question: state.split.question,
|
|
351
|
-
questions: state.split.questions,
|
|
352
|
-
humanOnly: state.split.humanOnly,
|
|
353
|
-
reason: state.split.reason,
|
|
354
|
-
}
|
|
355
|
-
: null,
|
|
356
|
-
delivery: {
|
|
357
|
-
...deliveryCounts(state),
|
|
358
|
-
inProgress: state.run.pendingDelivery !== null,
|
|
359
|
-
finishedAt: lastDeliveryAt(state),
|
|
360
|
-
},
|
|
361
|
-
resolver: state.resolve
|
|
362
|
-
? {
|
|
363
|
-
status: stages.resolve ?? state.resolve.status,
|
|
364
|
-
wait: waitOf(state.resolve),
|
|
365
|
-
round: state.run.pendingDelivery?.round ?? state.resolve.attempts.length,
|
|
366
|
-
rounds: state.run.config.delivery.resolverRounds,
|
|
367
|
-
conflicts: [...(state.run.pendingDelivery?.conflicts ?? [])],
|
|
368
|
-
reason: state.resolve.reason,
|
|
369
|
-
}
|
|
370
|
-
: null,
|
|
371
|
-
deliveryStage: deliveryStage(state),
|
|
372
|
-
diff: runDiff(state, diffs),
|
|
373
|
-
liveDiff: runLiveDiff(state, diffs),
|
|
374
|
-
progress: runProgress(state),
|
|
375
|
-
topology: waitingTopology,
|
|
376
|
-
steps: stepStates(state),
|
|
377
|
-
specialists: specialistUse(state),
|
|
378
|
-
groups: state.groups.map((group) => groupRow(state, group, now, diffs, waitOf(group), artifacts)),
|
|
379
|
-
system: systemGroups(state).map(({ kind, group }) => systemRow(state, group, kind, now, waitOf(group), artifacts)),
|
|
380
|
-
decisions: allGroups(state).flatMap((group) => group.decisions.map((decision) => ({ ...decision, group: group.slug }))),
|
|
381
|
-
repair: repairView(state, observers),
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
export function observersView(settings, states) {
|
|
385
|
-
const running = [];
|
|
386
|
-
let waiting = 0;
|
|
387
|
-
for (const state of states) {
|
|
388
|
-
const { incident } = state.run.repair;
|
|
389
|
-
if (incident !== null) {
|
|
390
|
-
running.push({ runId: state.run.id, repository: state.run.repository, incident });
|
|
391
|
-
}
|
|
392
|
-
else if (repairActive(state, settings)) {
|
|
393
|
-
waiting += 1;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
return { settings, workers: { running, waiting } };
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* The answer given to the question of an attempt: a decision that records the number of the
|
|
400
|
-
* asking attempt belongs to that attempt; decisions without a number (older runs) are matched
|
|
401
|
-
* by order — the N-th one of a step to the N-th needs_human attempt of that step not claimed
|
|
402
|
-
* by a numbered decision.
|
|
403
|
-
*/
|
|
404
|
-
function attemptDecision(group, attempt) {
|
|
405
|
-
const numbered = group.decisions.find((d) => d.attemptSeq === attempt.seq);
|
|
406
|
-
if (numbered) {
|
|
407
|
-
return { question: numbered.question, answer: numbered.answer, by: numbered.by };
|
|
408
|
-
}
|
|
409
|
-
if (attempt.status !== 'finished' || attempt.report?.verdict !== 'needs_human')
|
|
410
|
-
return null;
|
|
411
|
-
const claimed = new Set(group.decisions.map((d) => d.attemptSeq));
|
|
412
|
-
const asked = group.attempts.filter((candidate) => candidate.stepId === attempt.stepId &&
|
|
413
|
-
candidate.status === 'finished' &&
|
|
414
|
-
candidate.report?.verdict === 'needs_human' &&
|
|
415
|
-
!claimed.has(candidate.seq));
|
|
416
|
-
const decision = group.decisions.filter((d) => d.stepId === attempt.stepId && d.attemptSeq === undefined)[asked.indexOf(attempt)];
|
|
417
|
-
return decision
|
|
418
|
-
? { question: decision.question, answer: decision.answer, by: decision.by }
|
|
419
|
-
: null;
|
|
420
|
-
}
|
|
421
|
-
export function attemptView(state, group, attempt, now, allowCommands = []) {
|
|
422
|
-
return {
|
|
423
|
-
seq: attempt.seq,
|
|
424
|
-
stepId: attempt.stepId,
|
|
425
|
-
stepName: attemptStepLabel(state, group, attempt),
|
|
426
|
-
round: attempt.round,
|
|
427
|
-
specialist: attempt.specialist,
|
|
428
|
-
runtime: attempt.runtime,
|
|
429
|
-
model: attempt.model,
|
|
430
|
-
status: attempt.status,
|
|
431
|
-
verdict: attemptVerdict(attempt),
|
|
432
|
-
summary: attempt.report?.summary ?? null,
|
|
433
|
-
feedback: attempt.report?.feedback ?? null,
|
|
434
|
-
decision: attemptDecision(group, attempt),
|
|
435
|
-
reason: attempt.reason ? describeFailReason(attempt.reason) : null,
|
|
436
|
-
startedAt: attempt.startedAt,
|
|
437
|
-
durationMs: duration(attempt.startedAt, attempt.finishedAt, now),
|
|
438
|
-
usage: attempt.usage,
|
|
439
|
-
denials: attempt.denials.map((denial) => ({
|
|
440
|
-
tool: denial.tool,
|
|
441
|
-
command: denial.command,
|
|
442
|
-
suggestions: denial.command === null ? [] : suggestPatterns(denial.command, allowCommands),
|
|
443
|
-
})),
|
|
444
|
-
outsideChanges: [...attempt.outsideChanges],
|
|
445
|
-
message: attempt.input.message ? { ...attempt.input.message } : null,
|
|
446
|
-
interrupting: attempt.status === 'running' &&
|
|
447
|
-
(attempt.reason?.kind === 'message' || attempt.reason?.kind === 'paused'),
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
function allowCommandsOf(state, specialist) {
|
|
451
|
-
return (state.run.config.specialists.find((candidate) => candidate.slug === specialist)
|
|
452
|
-
?.allowCommands ?? []);
|
|
453
|
-
}
|
|
454
|
-
function permissionHints(attempts) {
|
|
455
|
-
const hints = new Set();
|
|
456
|
-
for (const attempt of attempts) {
|
|
457
|
-
for (const denial of attempt.denials) {
|
|
458
|
-
for (const suggestion of denial.suggestions) {
|
|
459
|
-
if (suggestion.pattern !== null)
|
|
460
|
-
hints.add(suggestion.pattern);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
return [...hints];
|
|
465
|
-
}
|
|
466
|
-
export function groupView(state, group, worktree, log, now, diff = null, waits = NO_WAITS) {
|
|
467
|
-
const wait = group.status === 'queued' ? waits(state.run.id, group.slug) : null;
|
|
468
|
-
const legacy = legacyOutsideChanges(group);
|
|
469
|
-
const attempts = group.attempts.map((attempt) => {
|
|
470
|
-
const view = attemptView(state, group, attempt, now, allowCommandsOf(state, attempt.specialist));
|
|
471
|
-
const restored = legacy.outside.get(attempt.seq);
|
|
472
|
-
return restored ? { ...view, outsideChanges: restored } : view;
|
|
473
|
-
});
|
|
474
|
-
return {
|
|
475
|
-
runId: state.run.id,
|
|
476
|
-
slug: group.slug,
|
|
477
|
-
title: group.title,
|
|
478
|
-
task: group.task,
|
|
479
|
-
status: displayStatus(isServiceGroup(group) ? serviceStatus(group) : group.status, wait, groupHold(state, group)),
|
|
480
|
-
wait: groupHold(state, group) === null ? wait : null,
|
|
481
|
-
branch: isSplitGroup(group) || actionPointOf(group) !== undefined
|
|
482
|
-
? state.run.branch
|
|
483
|
-
: groupRef(state.run, group.slug),
|
|
484
|
-
worktree,
|
|
485
|
-
question: group.question,
|
|
486
|
-
questions: group.questions,
|
|
487
|
-
humanOnly: group.humanOnly,
|
|
488
|
-
decisions: group.decisions.map((decision) => ({ ...decision })),
|
|
489
|
-
reason: group.reason,
|
|
490
|
-
limitUntil: groupLimitUntil(group),
|
|
491
|
-
warnings: legacy.warnings,
|
|
492
|
-
conflictFiles: [...group.conflictFiles],
|
|
493
|
-
delivery: {
|
|
494
|
-
...group.delivery,
|
|
495
|
-
files: [...group.delivery.files],
|
|
496
|
-
conflicts: [...group.delivery.conflicts],
|
|
497
|
-
userEdits: [...group.delivery.userEdits],
|
|
498
|
-
},
|
|
499
|
-
usage: groupUsage(group),
|
|
500
|
-
diff,
|
|
501
|
-
attempts,
|
|
502
|
-
permissionHints: permissionHints(attempts),
|
|
503
|
-
log,
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
/** Card of a run of the queue; `stopping`: the problem shown is the one that stops a queue. */
|
|
507
|
-
function queueRunView(queue, state, catalog, stopping, waits) {
|
|
508
|
-
const waitOf = (group) => group.status === 'queued' ? waits(state.run.id, group.slug) : null;
|
|
509
|
-
const problems = runProblems(state);
|
|
510
|
-
const problem = (stopping ? problems.find((p) => p.reason !== 'needs_human') : undefined) ?? problems[0];
|
|
511
|
-
return {
|
|
512
|
-
id: state.run.id,
|
|
513
|
-
returnable: canReturn(queue, state),
|
|
514
|
-
priority: queue.priority.includes(state.run.id),
|
|
515
|
-
number: state.run.number,
|
|
516
|
-
title: runTitle(state),
|
|
517
|
-
state: summarize(state).state,
|
|
518
|
-
pipeline: state.run.pipeline,
|
|
519
|
-
pipelineName: pipelineNameOf(state.run.config, state.run.pipeline),
|
|
520
|
-
tags: tagViews(catalog, state.run.tags),
|
|
521
|
-
createdAt: state.run.createdAt,
|
|
522
|
-
groups: {
|
|
523
|
-
done: state.groups.filter((group) => isTerminal(group.status)).length,
|
|
524
|
-
total: state.groups.length,
|
|
525
|
-
},
|
|
526
|
-
steps: stepProgress(state),
|
|
527
|
-
system: systemGroups(state).map(({ kind, group }) => ({
|
|
528
|
-
kind,
|
|
529
|
-
status: displayStatus(serviceStatus(group), waitOf(group), groupHold(state, group)),
|
|
530
|
-
...(kind === 'action' ? { title: group.title } : {}),
|
|
531
|
-
})),
|
|
532
|
-
delivery: deliveryStage(state)?.status ?? null,
|
|
533
|
-
waiting: allGroups(state).flatMap((group) => {
|
|
534
|
-
const wait = waitOf(group);
|
|
535
|
-
if (wait === null)
|
|
536
|
-
return [];
|
|
537
|
-
const index = group.pending?.stepIndex;
|
|
538
|
-
const steps = stepsOf(state.run, group);
|
|
539
|
-
const found = index === undefined ? undefined : steps[index];
|
|
540
|
-
return [
|
|
541
|
-
{
|
|
542
|
-
group: group.slug,
|
|
543
|
-
step: found?.id ?? null,
|
|
544
|
-
stepName: found ? stepLabel(state.run.config, steps, found) : null,
|
|
545
|
-
wait,
|
|
546
|
-
},
|
|
547
|
-
];
|
|
548
|
-
}),
|
|
549
|
-
active: allGroups(state)
|
|
550
|
-
.filter((group) => group.status === 'running' || group.status === 'merging')
|
|
551
|
-
.map((group) => {
|
|
552
|
-
const last = group.attempts.at(-1);
|
|
553
|
-
return {
|
|
554
|
-
group: group.slug,
|
|
555
|
-
step: last?.stepId ?? null,
|
|
556
|
-
stepName: last ? attemptStepLabel(state, group, last) : null,
|
|
557
|
-
};
|
|
558
|
-
}),
|
|
559
|
-
delivering: isRunFinished(state) && occupiesSlot(state),
|
|
560
|
-
usage: summarize(state).usage,
|
|
561
|
-
problem: problem ? { group: problem.group, reason: problem.reason } : null,
|
|
562
|
-
limitUntil: allGroups(state).reduce((latest, group) => {
|
|
563
|
-
const until = groupLimitUntil(group);
|
|
564
|
-
return until === null ? latest : Math.max(latest ?? 0, until);
|
|
565
|
-
}, null),
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
/** The task of an item; a returned run shows the task of the run. */
|
|
569
|
-
function itemBody(item, lookup) {
|
|
570
|
-
if (item.run === null)
|
|
571
|
-
return { task: item.task, groups: item.groups };
|
|
572
|
-
const state = lookup(item.run);
|
|
573
|
-
if (!state)
|
|
574
|
-
return { task: null, groups: null };
|
|
575
|
-
if (state.split)
|
|
576
|
-
return { task: state.split.task, groups: null };
|
|
577
|
-
if (state.groups.length === 1)
|
|
578
|
-
return { task: state.groups[0].task, groups: null };
|
|
579
|
-
return {
|
|
580
|
-
task: null,
|
|
581
|
-
groups: state.groups.map((group) => ({ title: group.title, task: group.task })),
|
|
582
|
-
};
|
|
583
|
-
}
|
|
584
|
-
export function queueView(queue, lookup, autoDeliver = null, catalog = [], deliveryMode = null, waits = NO_WAITS, names = (id) => id) {
|
|
585
|
-
const cards = (ids, stopping) => ids.flatMap((id) => {
|
|
586
|
-
const state = lookup(id);
|
|
587
|
-
return state ? [queueRunView(queue, state, catalog, stopping, waits)] : [];
|
|
588
|
-
});
|
|
589
|
-
const runs = cards(queue.runs, false);
|
|
590
|
-
const skipped = cards(queue.skipped, true);
|
|
591
|
-
return {
|
|
592
|
-
repository: queue.repository,
|
|
593
|
-
status: queue.status,
|
|
594
|
-
parallel: queue.parallel,
|
|
595
|
-
autopilot: queue.autopilot,
|
|
596
|
-
autoAnswer: queue.autoAnswer,
|
|
597
|
-
skipFailed: queue.skipFailed,
|
|
598
|
-
autoDeliver,
|
|
599
|
-
deliveryMode,
|
|
600
|
-
autopilotAnswer: queue.autopilotAnswer,
|
|
601
|
-
autopilotAnswerDefault: DEFAULT_AUTOPILOT_ANSWER,
|
|
602
|
-
onLimit: queue.onLimit,
|
|
603
|
-
stop: queue.stop,
|
|
604
|
-
freezeCandidate: queue.runs.length >= queue.parallel
|
|
605
|
-
? freezeCandidate(queue, queue.runs.flatMap((id) => lookup(id) ?? []), null)
|
|
606
|
-
: null,
|
|
607
|
-
items: queue.items.map((item, index) => ({
|
|
608
|
-
id: item.id,
|
|
609
|
-
number: item.number,
|
|
610
|
-
position: index + 1,
|
|
611
|
-
pipeline: item.pipeline,
|
|
612
|
-
pipelineName: names(item.pipeline),
|
|
613
|
-
...itemBody(item, lookup),
|
|
614
|
-
title: item.title,
|
|
615
|
-
autoDeliver: item.autoDeliver,
|
|
616
|
-
deliveryMode: item.deliveryMode,
|
|
617
|
-
tags: tagViews(catalog, item.tags),
|
|
618
|
-
skip: [...(item.run === null ? item.skip : (lookup(item.run)?.run.skippedSteps ?? []))],
|
|
619
|
-
readiness: itemReadiness(queue, item, lookup),
|
|
620
|
-
after: item.after.map((ref) => {
|
|
621
|
-
const other = queue.items.find((candidate) => candidate.id === ref);
|
|
622
|
-
const state = dependencyState(queue, ref, lookup);
|
|
623
|
-
if (other) {
|
|
624
|
-
const label = other.title ?? (other.task ? other.task.trim().split('\n')[0] : null);
|
|
625
|
-
return {
|
|
626
|
-
kind: 'item',
|
|
627
|
-
id: ref,
|
|
628
|
-
number: other.number,
|
|
629
|
-
title: label ?? other.pipeline,
|
|
630
|
-
state,
|
|
631
|
-
};
|
|
632
|
-
}
|
|
633
|
-
const run = lookup(ref);
|
|
634
|
-
return {
|
|
635
|
-
kind: 'run',
|
|
636
|
-
id: ref,
|
|
637
|
-
number: run ? run.run.number : null,
|
|
638
|
-
title: run ? runTitle(run) : ref,
|
|
639
|
-
state,
|
|
640
|
-
};
|
|
641
|
-
}),
|
|
642
|
-
postponed: item.postponed,
|
|
643
|
-
createdAt: item.createdAt,
|
|
644
|
-
error: item.error,
|
|
645
|
-
run: item.run,
|
|
646
|
-
hold: (item.run === null ? undefined : lookup(item.run)?.run.hold) ?? null,
|
|
647
|
-
})),
|
|
648
|
-
runs,
|
|
649
|
-
skipped,
|
|
650
|
-
updatedAt: queue.updatedAt,
|
|
651
|
-
};
|
|
652
|
-
}
|
|
653
|
-
/** The path with the home directory (itself or as a prefix before a separator) written as `~`. */
|
|
654
|
-
export function displayPath(path, home) {
|
|
655
|
-
if (home === null || home === '')
|
|
656
|
-
return path;
|
|
657
|
-
const base = home.length > 1 ? home.replace(/\/+$/, '') : home;
|
|
658
|
-
if (path === base)
|
|
659
|
-
return '~';
|
|
660
|
-
return path.startsWith(`${base}/`) ? `~${path.slice(base.length)}` : path;
|
|
661
|
-
}
|
|
662
|
-
/** Registry entries with their counters, sorted by path. */
|
|
663
|
-
export function repositoryViews(entries, runs, queues, home = null) {
|
|
664
|
-
return entries
|
|
665
|
-
.map((entry) => {
|
|
666
|
-
const own = runs.filter((state) => state.run.repository === entry.path);
|
|
667
|
-
const queue = queues.find((candidate) => candidate.repository === entry.path);
|
|
668
|
-
return {
|
|
669
|
-
path: entry.path,
|
|
670
|
-
displayPath: displayPath(entry.path, home),
|
|
671
|
-
addedAt: entry.addedAt,
|
|
672
|
-
unfinished: own.filter((state) => !isRunFinished(state)).length,
|
|
673
|
-
waiting: own.filter((state) => runPhase(state) === 'needs_human').length,
|
|
674
|
-
queued: queue?.items.length ?? 0,
|
|
675
|
-
};
|
|
676
|
-
})
|
|
677
|
-
.sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0));
|
|
678
|
-
}
|
|
679
|
-
const SPEC_PATH = /^openspec\/changes\/(archive\/[^/]+|[^/]+)\/(?:proposal|design|tasks)\.md$/;
|
|
680
|
-
/** The changes among `paths`, active before archived and then by name. */
|
|
681
|
-
export function pickSpecChange(paths) {
|
|
682
|
-
const found = new Map();
|
|
683
|
-
for (const path of paths) {
|
|
684
|
-
const directory = SPEC_PATH.exec(path)?.[1];
|
|
685
|
-
if (directory === undefined || found.has(directory))
|
|
686
|
-
continue;
|
|
687
|
-
found.set(directory, {
|
|
688
|
-
change: directory.slice(directory.lastIndexOf('/') + 1),
|
|
689
|
-
path: `openspec/changes/${directory}`,
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
const archived = (candidate) => candidate.path.includes('/changes/archive/');
|
|
693
|
-
return [...found.values()].sort((a, b) => Number(archived(a)) - Number(archived(b)) ||
|
|
694
|
-
(a.change < b.change ? -1 : a.change > b.change ? 1 : 0));
|
|
695
|
-
}
|
|
696
|
-
//# sourceMappingURL=views.js.map
|