@hoknie/aip 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +13 -0
- package/README.md +74 -2
- package/dist/app/agents.js +18 -0
- package/dist/app/agents.js.map +1 -0
- package/dist/app/application.js +173 -0
- package/dist/app/application.js.map +1 -0
- package/dist/app/daemon.js +71 -0
- package/dist/app/daemon.js.map +1 -0
- package/dist/app/index.js +5 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/lifecycle.js +30 -0
- package/dist/app/lifecycle.js.map +1 -0
- package/dist/app/maintenance.js +27 -0
- package/dist/app/maintenance.js.map +1 -0
- package/dist/app/timings.js +23 -0
- package/dist/app/timings.js.map +1 -0
- package/dist/app/wiring.js +57 -0
- package/dist/app/wiring.js.map +1 -0
- package/dist/cli/clean.js +71 -0
- package/dist/cli/clean.js.map +1 -0
- package/dist/cli/commands.js +963 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/config-check.js +173 -0
- package/dist/cli/config-check.js.map +1 -0
- package/dist/cli/daemon.js +199 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/help.js +50 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/init.js +43 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/io.js +13 -0
- package/dist/cli/io.js.map +1 -0
- package/dist/cli/main.js +31 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/probe.js +12 -0
- package/dist/cli/probe.js.map +1 -0
- package/dist/cli/program.js +48 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/cli/setup.js +406 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/version.js +6 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/cli/watch.js +24 -0
- package/dist/cli/watch.js.map +1 -0
- package/dist/cli/web/daemon-panel.js +185 -0
- package/dist/cli/web/daemon-panel.js.map +1 -0
- package/dist/cli/web/default-repository.js +12 -0
- package/dist/cli/web/default-repository.js.map +1 -0
- package/dist/cli/web/errors.js +60 -0
- package/dist/cli/web/errors.js.map +1 -0
- package/dist/cli/web/open.js +12 -0
- package/dist/cli/web/open.js.map +1 -0
- package/dist/cli/web/page.js +465 -0
- package/dist/cli/web/page.js.map +1 -0
- package/dist/cli/web/server.js +1191 -0
- package/dist/cli/web/server.js.map +1 -0
- package/dist/cli/web/standby.js +119 -0
- package/dist/cli/web/standby.js.map +1 -0
- package/dist/cli/web/state.js +69 -0
- package/dist/cli/web/state.js.map +1 -0
- package/dist/cli/web/system.js +66 -0
- package/dist/cli/web/system.js.map +1 -0
- package/dist/cli/web-control.js +173 -0
- package/dist/cli/web-control.js.map +1 -0
- package/dist/config/discover.js +25 -0
- package/dist/config/discover.js.map +1 -0
- package/dist/config/duration.js +17 -0
- package/dist/config/duration.js.map +1 -0
- package/dist/config/edit.js +966 -0
- package/dist/config/edit.js.map +1 -0
- package/dist/config/errors.js +29 -0
- package/dist/config/errors.js.map +1 -0
- package/dist/config/index.js +14 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/load.js +412 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/merge.js +45 -0
- package/dist/config/merge.js.map +1 -0
- package/dist/config/model.js +171 -0
- package/dist/config/model.js.map +1 -0
- package/dist/config/paths.js +31 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/prompt.js +33 -0
- package/dist/config/prompt.js.map +1 -0
- package/dist/config/shared-pipelines.js +71 -0
- package/dist/config/shared-pipelines.js.map +1 -0
- package/dist/config/shared-specialists.js +68 -0
- package/dist/config/shared-specialists.js.map +1 -0
- package/dist/config/shared-workflows.js +71 -0
- package/dist/config/shared-workflows.js.map +1 -0
- package/dist/config/specialist-tags.js +214 -0
- package/dist/config/specialist-tags.js.map +1 -0
- package/dist/config/tag-names.js +43 -0
- package/dist/config/tag-names.js.map +1 -0
- package/dist/config/validate.js +872 -0
- package/dist/config/validate.js.map +1 -0
- package/dist/core/artifacts.js +37 -0
- package/dist/core/artifacts.js.map +1 -0
- package/dist/core/create.js +75 -0
- package/dist/core/create.js.map +1 -0
- package/dist/core/delivery.js +366 -0
- package/dist/core/delivery.js.map +1 -0
- package/dist/core/errors.js +7 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/ids.js +99 -0
- package/dist/core/ids.js.map +1 -0
- package/dist/core/index.js +21 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/input.js +45 -0
- package/dist/core/input.js.map +1 -0
- package/dist/core/machine.js +1021 -0
- package/dist/core/machine.js.map +1 -0
- package/dist/core/model.js +460 -0
- package/dist/core/model.js.map +1 -0
- package/dist/core/observer.js +193 -0
- package/dist/core/observer.js.map +1 -0
- package/dist/core/occupancy.js +63 -0
- package/dist/core/occupancy.js.map +1 -0
- package/dist/core/permissions.js +222 -0
- package/dist/core/permissions.js.map +1 -0
- package/dist/core/plan.js +99 -0
- package/dist/core/plan.js.map +1 -0
- package/dist/core/progress.js +43 -0
- package/dist/core/progress.js.map +1 -0
- package/dist/core/questions.js +19 -0
- package/dist/core/questions.js.map +1 -0
- package/dist/core/queue.js +859 -0
- package/dist/core/queue.js.map +1 -0
- package/dist/core/retryable.js +8 -0
- package/dist/core/retryable.js.map +1 -0
- package/dist/core/scheduler.js +160 -0
- package/dist/core/scheduler.js.map +1 -0
- package/dist/core/skip.js +109 -0
- package/dist/core/skip.js.map +1 -0
- package/dist/core/stages.js +304 -0
- package/dist/core/stages.js.map +1 -0
- package/dist/core/summary.js +35 -0
- package/dist/core/summary.js.map +1 -0
- package/dist/core/tags.js +184 -0
- package/dist/core/tags.js.map +1 -0
- package/dist/core/topology.js +162 -0
- package/dist/core/topology.js.map +1 -0
- package/dist/daemon/artifacts.js +84 -0
- package/dist/daemon/artifacts.js.map +1 -0
- package/dist/daemon/daemon.js +1442 -0
- package/dist/daemon/daemon.js.map +1 -0
- package/dist/daemon/executor.js +749 -0
- package/dist/daemon/executor.js.map +1 -0
- package/dist/daemon/helpers.js +38 -0
- package/dist/daemon/helpers.js.map +1 -0
- package/dist/daemon/index.js +4 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/logs.js +69 -0
- package/dist/daemon/logs.js.map +1 -0
- package/dist/daemon/observers.js +93 -0
- package/dist/daemon/observers.js.map +1 -0
- package/dist/daemon/patches.js +76 -0
- package/dist/daemon/patches.js.map +1 -0
- package/dist/daemon/ports.js +2 -0
- package/dist/daemon/ports.js.map +1 -0
- package/dist/daemon/processes.js +98 -0
- package/dist/daemon/processes.js.map +1 -0
- package/dist/daemon/repositories.js +2 -0
- package/dist/daemon/repositories.js.map +1 -0
- package/dist/daemon/server.js +164 -0
- package/dist/daemon/server.js.map +1 -0
- package/dist/daemon/supervisor.js +140 -0
- package/dist/daemon/supervisor.js.map +1 -0
- package/dist/daemon/timings.js +23 -0
- package/dist/daemon/timings.js.map +1 -0
- package/dist/feature/agents/clients/agy/events.js +36 -0
- package/dist/feature/agents/clients/agy/events.js.map +1 -0
- package/dist/feature/agents/clients/agy/guard-commands.js +29 -0
- package/dist/feature/agents/clients/agy/guard-commands.js.map +1 -0
- package/dist/feature/agents/clients/agy/guard-paths.js +36 -0
- package/dist/feature/agents/clients/agy/guard-paths.js.map +1 -0
- package/dist/feature/agents/clients/agy/guard.js +77 -0
- package/dist/feature/agents/clients/agy/guard.js.map +1 -0
- package/dist/feature/agents/clients/agy/hooks.js +46 -0
- package/dist/feature/agents/clients/agy/hooks.js.map +1 -0
- package/dist/feature/agents/clients/agy/index.js +5 -0
- package/dist/feature/agents/clients/agy/index.js.map +1 -0
- package/dist/feature/agents/clients/agy/parser.js +63 -0
- package/dist/feature/agents/clients/agy/parser.js.map +1 -0
- package/dist/feature/agents/clients/agy/permissions.js +40 -0
- package/dist/feature/agents/clients/agy/permissions.js.map +1 -0
- package/dist/feature/agents/clients/agy/runtime.js +114 -0
- package/dist/feature/agents/clients/agy/runtime.js.map +1 -0
- package/dist/feature/agents/clients/agy/transcript.js +65 -0
- package/dist/feature/agents/clients/agy/transcript.js.map +1 -0
- package/dist/feature/agents/clients/claude/index.js +5 -0
- package/dist/feature/agents/clients/claude/index.js.map +1 -0
- package/dist/feature/agents/clients/claude/parser.js +221 -0
- package/dist/feature/agents/clients/claude/parser.js.map +1 -0
- package/dist/feature/agents/clients/claude/permissions.js +70 -0
- package/dist/feature/agents/clients/claude/permissions.js.map +1 -0
- package/dist/feature/agents/clients/claude/runtime.js +116 -0
- package/dist/feature/agents/clients/claude/runtime.js.map +1 -0
- package/dist/feature/agents/clients/claude/transcript.js +105 -0
- package/dist/feature/agents/clients/claude/transcript.js.map +1 -0
- package/dist/feature/agents/clients/naming/index.js +2 -0
- package/dist/feature/agents/clients/naming/index.js.map +1 -0
- package/dist/feature/agents/clients/naming/naming.js +15 -0
- package/dist/feature/agents/clients/naming/naming.js.map +1 -0
- package/dist/feature/agents/clients/opencode/index.js +4 -0
- package/dist/feature/agents/clients/opencode/index.js.map +1 -0
- package/dist/feature/agents/clients/opencode/parser.js +84 -0
- package/dist/feature/agents/clients/opencode/parser.js.map +1 -0
- package/dist/feature/agents/clients/opencode/runtime.js +129 -0
- package/dist/feature/agents/clients/opencode/runtime.js.map +1 -0
- package/dist/feature/agents/clients/opencode/transcript.js +77 -0
- package/dist/feature/agents/clients/opencode/transcript.js.map +1 -0
- package/dist/feature/agents/ports/index.js +2 -0
- package/dist/feature/agents/ports/index.js.map +1 -0
- package/dist/feature/agents/ports/naming.js +2 -0
- package/dist/feature/agents/ports/naming.js.map +1 -0
- package/dist/feature/agents/ports/runtime-factory.js +2 -0
- package/dist/feature/agents/ports/runtime-factory.js.map +1 -0
- package/dist/feature/agents/services/agents.js +38 -0
- package/dist/feature/agents/services/agents.js.map +1 -0
- package/dist/feature/agents/services/catalog.js +117 -0
- package/dist/feature/agents/services/catalog.js.map +1 -0
- package/dist/feature/agents/services/create.js +5 -0
- package/dist/feature/agents/services/create.js.map +1 -0
- package/dist/feature/agents/services/index.js +7 -0
- package/dist/feature/agents/services/index.js.map +1 -0
- package/dist/feature/agents/services/logs.js +69 -0
- package/dist/feature/agents/services/logs.js.map +1 -0
- package/dist/feature/agents/services/skills.js +17 -0
- package/dist/feature/agents/services/skills.js.map +1 -0
- package/dist/feature/agents/services/supervisor.js +160 -0
- package/dist/feature/agents/services/supervisor.js.map +1 -0
- package/dist/feature/agents/types/catalog.js +2 -0
- package/dist/feature/agents/types/catalog.js.map +1 -0
- package/dist/feature/agents/types/index.js +12 -0
- package/dist/feature/agents/types/index.js.map +1 -0
- package/dist/feature/agents/types/message.js +48 -0
- package/dist/feature/agents/types/message.js.map +1 -0
- package/dist/feature/agents/types/naming.js +4 -0
- package/dist/feature/agents/types/naming.js.map +1 -0
- package/dist/feature/agents/types/permissions.js +235 -0
- package/dist/feature/agents/types/permissions.js.map +1 -0
- package/dist/feature/agents/types/run-naming.js +66 -0
- package/dist/feature/agents/types/run-naming.js.map +1 -0
- package/dist/feature/agents/types/runtime.js +18 -0
- package/dist/feature/agents/types/runtime.js.map +1 -0
- package/dist/feature/agents/types/step-input.js +2 -0
- package/dist/feature/agents/types/step-input.js.map +1 -0
- package/dist/feature/agents/types/transcript-parts.js +62 -0
- package/dist/feature/agents/types/transcript-parts.js.map +1 -0
- package/dist/feature/agents/types/transcript.js +8 -0
- package/dist/feature/agents/types/transcript.js.map +1 -0
- package/dist/feature/agents/types/usage.js +14 -0
- package/dist/feature/agents/types/usage.js.map +1 -0
- package/dist/feature/agents/types/worker-tools.js +20 -0
- package/dist/feature/agents/types/worker-tools.js.map +1 -0
- package/dist/feature/artifacts/ports/index.js +2 -0
- package/dist/feature/artifacts/ports/index.js.map +1 -0
- package/dist/feature/artifacts/ports/publish.js +2 -0
- package/dist/feature/artifacts/ports/publish.js.map +1 -0
- package/dist/feature/artifacts/repositories/artifact-storage.js +84 -0
- package/dist/feature/artifacts/repositories/artifact-storage.js.map +1 -0
- package/dist/feature/artifacts/repositories/artifacts.js +85 -0
- package/dist/feature/artifacts/repositories/artifacts.js.map +1 -0
- package/dist/feature/artifacts/repositories/index.js +3 -0
- package/dist/feature/artifacts/repositories/index.js.map +1 -0
- package/dist/feature/artifacts/services/artifacts.js +105 -0
- package/dist/feature/artifacts/services/artifacts.js.map +1 -0
- package/dist/feature/artifacts/services/create.js +14 -0
- package/dist/feature/artifacts/services/create.js.map +1 -0
- package/dist/feature/artifacts/services/files.js +42 -0
- package/dist/feature/artifacts/services/files.js.map +1 -0
- package/dist/feature/artifacts/services/index.js +3 -0
- package/dist/feature/artifacts/services/index.js.map +1 -0
- package/dist/feature/artifacts/types/artifacts.js +36 -0
- package/dist/feature/artifacts/types/artifacts.js.map +1 -0
- package/dist/feature/artifacts/types/index.js +2 -0
- package/dist/feature/artifacts/types/index.js.map +1 -0
- package/dist/feature/artifacts/types/views.js +2 -0
- package/dist/feature/artifacts/types/views.js.map +1 -0
- package/dist/feature/compose/services/create.js +11 -0
- package/dist/feature/compose/services/create.js.map +1 -0
- package/dist/feature/compose/services/index.js +5 -0
- package/dist/feature/compose/services/index.js.map +1 -0
- package/dist/feature/compose/services/repository-edit.js +20 -0
- package/dist/feature/compose/services/repository-edit.js.map +1 -0
- package/dist/feature/compose/services/repository-move.js +35 -0
- package/dist/feature/compose/services/repository-move.js.map +1 -0
- package/dist/feature/compose/services/repository-removal.js +38 -0
- package/dist/feature/compose/services/repository-removal.js.map +1 -0
- package/dist/feature/delivery/ports/index.js +2 -0
- package/dist/feature/delivery/ports/index.js.map +1 -0
- package/dist/feature/delivery/ports/publish.js +2 -0
- package/dist/feature/delivery/ports/publish.js.map +1 -0
- package/dist/feature/delivery/repositories/index.js +3 -0
- package/dist/feature/delivery/repositories/index.js.map +1 -0
- package/dist/feature/delivery/repositories/patch-storage.js +76 -0
- package/dist/feature/delivery/repositories/patch-storage.js.map +1 -0
- package/dist/feature/delivery/repositories/patches.js +28 -0
- package/dist/feature/delivery/repositories/patches.js.map +1 -0
- package/dist/feature/delivery/services/create.js +21 -0
- package/dist/feature/delivery/services/create.js.map +1 -0
- package/dist/feature/delivery/services/deliver.js +67 -0
- package/dist/feature/delivery/services/deliver.js.map +1 -0
- package/dist/feature/delivery/services/diffs.js +153 -0
- package/dist/feature/delivery/services/diffs.js.map +1 -0
- package/dist/feature/delivery/services/index.js +5 -0
- package/dist/feature/delivery/services/index.js.map +1 -0
- package/dist/feature/delivery/services/patches.js +96 -0
- package/dist/feature/delivery/services/patches.js.map +1 -0
- package/dist/feature/delivery/types/index.js +3 -0
- package/dist/feature/delivery/types/index.js.map +1 -0
- package/dist/feature/delivery/types/outcomes.js +2 -0
- package/dist/feature/delivery/types/outcomes.js.map +1 -0
- package/dist/feature/delivery/types/spec-change.js +18 -0
- package/dist/feature/delivery/types/spec-change.js.map +1 -0
- package/dist/feature/observers/ports/index.js +2 -0
- package/dist/feature/observers/ports/index.js.map +1 -0
- package/dist/feature/observers/ports/publish.js +2 -0
- package/dist/feature/observers/ports/publish.js.map +1 -0
- package/dist/feature/observers/repositories/index.js +2 -0
- package/dist/feature/observers/repositories/index.js.map +1 -0
- package/dist/feature/observers/repositories/observers.js +28 -0
- package/dist/feature/observers/repositories/observers.js.map +1 -0
- package/dist/feature/observers/services/create.js +11 -0
- package/dist/feature/observers/services/create.js.map +1 -0
- package/dist/feature/observers/services/history.js +76 -0
- package/dist/feature/observers/services/history.js.map +1 -0
- package/dist/feature/observers/services/index.js +5 -0
- package/dist/feature/observers/services/index.js.map +1 -0
- package/dist/feature/observers/services/observers.js +178 -0
- package/dist/feature/observers/services/observers.js.map +1 -0
- package/dist/feature/observers/services/settings-check.js +93 -0
- package/dist/feature/observers/services/settings-check.js.map +1 -0
- package/dist/feature/observers/types/actions.js +2 -0
- package/dist/feature/observers/types/actions.js.map +1 -0
- package/dist/feature/observers/types/index.js +4 -0
- package/dist/feature/observers/types/index.js.map +1 -0
- package/dist/feature/observers/types/plan-repairs.js +109 -0
- package/dist/feature/observers/types/plan-repairs.js.map +1 -0
- package/dist/feature/observers/types/settings.js +13 -0
- package/dist/feature/observers/types/settings.js.map +1 -0
- package/dist/feature/processes/ports/index.js +2 -0
- package/dist/feature/processes/ports/index.js.map +1 -0
- package/dist/feature/processes/ports/publish.js +2 -0
- package/dist/feature/processes/ports/publish.js.map +1 -0
- package/dist/feature/processes/services/create.js +5 -0
- package/dist/feature/processes/services/create.js.map +1 -0
- package/dist/feature/processes/services/index.js +4 -0
- package/dist/feature/processes/services/index.js.map +1 -0
- package/dist/feature/processes/services/processes.js +131 -0
- package/dist/feature/processes/services/processes.js.map +1 -0
- package/dist/feature/processes/services/tree.js +98 -0
- package/dist/feature/processes/services/tree.js.map +1 -0
- package/dist/feature/processes/types/background.js +2 -0
- package/dist/feature/processes/types/background.js.map +1 -0
- package/dist/feature/processes/types/index.js +2 -0
- package/dist/feature/processes/types/index.js.map +1 -0
- package/dist/feature/queue/ports/index.js +2 -0
- package/dist/feature/queue/ports/index.js.map +1 -0
- package/dist/feature/queue/ports/observe.js +2 -0
- package/dist/feature/queue/ports/observe.js.map +1 -0
- package/dist/feature/queue/ports/publish.js +2 -0
- package/dist/feature/queue/ports/publish.js.map +1 -0
- package/dist/feature/queue/ports/repair-policy.js +2 -0
- package/dist/feature/queue/ports/repair-policy.js.map +1 -0
- package/dist/feature/queue/repositories/index.js +2 -0
- package/dist/feature/queue/repositories/index.js.map +1 -0
- package/dist/feature/queue/repositories/queues.js +100 -0
- package/dist/feature/queue/repositories/queues.js.map +1 -0
- package/dist/feature/queue/services/advance.js +214 -0
- package/dist/feature/queue/services/advance.js.map +1 -0
- package/dist/feature/queue/services/control.js +153 -0
- package/dist/feature/queue/services/control.js.map +1 -0
- package/dist/feature/queue/services/create.js +26 -0
- package/dist/feature/queue/services/create.js.map +1 -0
- package/dist/feature/queue/services/edit.js +126 -0
- package/dist/feature/queue/services/edit.js.map +1 -0
- package/dist/feature/queue/services/index.js +8 -0
- package/dist/feature/queue/services/index.js.map +1 -0
- package/dist/feature/queue/services/items.js +173 -0
- package/dist/feature/queue/services/items.js.map +1 -0
- package/dist/feature/queue/services/store.js +61 -0
- package/dist/feature/queue/services/store.js.map +1 -0
- package/dist/feature/queue/services/task-tags.js +103 -0
- package/dist/feature/queue/services/task-tags.js.map +1 -0
- package/dist/feature/queue/types/advance.js +183 -0
- package/dist/feature/queue/types/advance.js.map +1 -0
- package/dist/feature/queue/types/dependencies.js +98 -0
- package/dist/feature/queue/types/dependencies.js.map +1 -0
- package/dist/feature/queue/types/edit.js +180 -0
- package/dist/feature/queue/types/edit.js.map +1 -0
- package/dist/feature/queue/types/ids.js +7 -0
- package/dist/feature/queue/types/ids.js.map +1 -0
- package/dist/feature/queue/types/index.js +10 -0
- package/dist/feature/queue/types/index.js.map +1 -0
- package/dist/feature/queue/types/items.js +46 -0
- package/dist/feature/queue/types/items.js.map +1 -0
- package/dist/feature/queue/types/limit-hits.js +50 -0
- package/dist/feature/queue/types/limit-hits.js.map +1 -0
- package/dist/feature/queue/types/requests.js +2 -0
- package/dist/feature/queue/types/requests.js.map +1 -0
- package/dist/feature/queue/types/returns.js +182 -0
- package/dist/feature/queue/types/returns.js.map +1 -0
- package/dist/feature/queue/types/settings.js +117 -0
- package/dist/feature/queue/types/settings.js.map +1 -0
- package/dist/feature/repos/ports/index.js +2 -0
- package/dist/feature/repos/ports/index.js.map +1 -0
- package/dist/feature/repos/ports/publish.js +2 -0
- package/dist/feature/repos/ports/publish.js.map +1 -0
- package/dist/feature/repos/repositories/index.js +2 -0
- package/dist/feature/repos/repositories/index.js.map +1 -0
- package/dist/feature/repos/repositories/known.js +41 -0
- package/dist/feature/repos/repositories/known.js.map +1 -0
- package/dist/feature/repos/services/create.js +13 -0
- package/dist/feature/repos/services/create.js.map +1 -0
- package/dist/feature/repos/services/index.js +4 -0
- package/dist/feature/repos/services/index.js.map +1 -0
- package/dist/feature/repos/services/projects.js +50 -0
- package/dist/feature/repos/services/projects.js.map +1 -0
- package/dist/feature/repos/services/registry.js +138 -0
- package/dist/feature/repos/services/registry.js.map +1 -0
- package/dist/feature/repos/types/index.js +2 -0
- package/dist/feature/repos/types/index.js.map +1 -0
- package/dist/feature/repos/types/project.js +80 -0
- package/dist/feature/repos/types/project.js.map +1 -0
- package/dist/feature/repos/types/registry.js +2 -0
- package/dist/feature/repos/types/registry.js.map +1 -0
- package/dist/feature/runs/machine/answers.js +112 -0
- package/dist/feature/runs/machine/answers.js.map +1 -0
- package/dist/feature/runs/machine/delivery-checks.js +91 -0
- package/dist/feature/runs/machine/delivery-checks.js.map +1 -0
- package/dist/feature/runs/machine/delivery-flow.js +211 -0
- package/dist/feature/runs/machine/delivery-flow.js.map +1 -0
- package/dist/feature/runs/machine/events.js +2 -0
- package/dist/feature/runs/machine/events.js.map +1 -0
- package/dist/feature/runs/machine/exits.js +207 -0
- package/dist/feature/runs/machine/exits.js.map +1 -0
- package/dist/feature/runs/machine/index.js +7 -0
- package/dist/feature/runs/machine/index.js.map +1 -0
- package/dist/feature/runs/machine/plan.js +111 -0
- package/dist/feature/runs/machine/plan.js.map +1 -0
- package/dist/feature/runs/machine/repair.js +155 -0
- package/dist/feature/runs/machine/repair.js.map +1 -0
- package/dist/feature/runs/machine/run-control.js +276 -0
- package/dist/feature/runs/machine/run-control.js.map +1 -0
- package/dist/feature/runs/machine/scheduler.js +119 -0
- package/dist/feature/runs/machine/scheduler.js.map +1 -0
- package/dist/feature/runs/machine/steps.js +275 -0
- package/dist/feature/runs/machine/steps.js.map +1 -0
- package/dist/feature/runs/machine/texts.js +69 -0
- package/dist/feature/runs/machine/texts.js.map +1 -0
- package/dist/feature/runs/machine/transition.js +113 -0
- package/dist/feature/runs/machine/transition.js.map +1 -0
- package/dist/feature/runs/ports/agent-exit.js +2 -0
- package/dist/feature/runs/ports/agent-exit.js.map +1 -0
- package/dist/feature/runs/ports/diff.js +2 -0
- package/dist/feature/runs/ports/diff.js.map +1 -0
- package/dist/feature/runs/ports/index.js +2 -0
- package/dist/feature/runs/ports/index.js.map +1 -0
- package/dist/feature/runs/ports/observe.js +2 -0
- package/dist/feature/runs/ports/observe.js.map +1 -0
- package/dist/feature/runs/ports/publish.js +2 -0
- package/dist/feature/runs/ports/publish.js.map +1 -0
- package/dist/feature/runs/ports/queue-advance.js +2 -0
- package/dist/feature/runs/ports/queue-advance.js.map +1 -0
- package/dist/feature/runs/repositories/attempt-history.js +116 -0
- package/dist/feature/runs/repositories/attempt-history.js.map +1 -0
- package/dist/feature/runs/repositories/finished-runs.js +42 -0
- package/dist/feature/runs/repositories/finished-runs.js.map +1 -0
- package/dist/feature/runs/repositories/index.js +4 -0
- package/dist/feature/runs/repositories/index.js.map +1 -0
- package/dist/feature/runs/repositories/rows.js +110 -0
- package/dist/feature/runs/repositories/rows.js.map +1 -0
- package/dist/feature/runs/repositories/runs.js +76 -0
- package/dist/feature/runs/repositories/runs.js.map +1 -0
- package/dist/feature/runs/repositories/write.js +31 -0
- package/dist/feature/runs/repositories/write.js.map +1 -0
- package/dist/feature/runs/services/archive.js +17 -0
- package/dist/feature/runs/services/archive.js.map +1 -0
- package/dist/feature/runs/services/attempt-history.js +11 -0
- package/dist/feature/runs/services/attempt-history.js.map +1 -0
- package/dist/feature/runs/services/create.js +43 -0
- package/dist/feature/runs/services/create.js.map +1 -0
- package/dist/feature/runs/services/effects/actions.js +150 -0
- package/dist/feature/runs/services/effects/actions.js.map +1 -0
- package/dist/feature/runs/services/effects/attempts.js +179 -0
- package/dist/feature/runs/services/effects/attempts.js.map +1 -0
- package/dist/feature/runs/services/effects/context.js +7 -0
- package/dist/feature/runs/services/effects/context.js.map +1 -0
- package/dist/feature/runs/services/effects/effects.js +82 -0
- package/dist/feature/runs/services/effects/effects.js.map +1 -0
- package/dist/feature/runs/services/effects/git.js +168 -0
- package/dist/feature/runs/services/effects/git.js.map +1 -0
- package/dist/feature/runs/services/effects/naming.js +62 -0
- package/dist/feature/runs/services/effects/naming.js.map +1 -0
- package/dist/feature/runs/services/effects/outside.js +83 -0
- package/dist/feature/runs/services/effects/outside.js.map +1 -0
- package/dist/feature/runs/services/effects/running.js +76 -0
- package/dist/feature/runs/services/effects/running.js.map +1 -0
- package/dist/feature/runs/services/effects/usage.js +61 -0
- package/dist/feature/runs/services/effects/usage.js.map +1 -0
- package/dist/feature/runs/services/effects/worktrees.js +49 -0
- package/dist/feature/runs/services/effects/worktrees.js.map +1 -0
- package/dist/feature/runs/services/engine.js +163 -0
- package/dist/feature/runs/services/engine.js.map +1 -0
- package/dist/feature/runs/services/index.js +15 -0
- package/dist/feature/runs/services/index.js.map +1 -0
- package/dist/feature/runs/services/occupancy.js +62 -0
- package/dist/feature/runs/services/occupancy.js.map +1 -0
- package/dist/feature/runs/services/progress.js +42 -0
- package/dist/feature/runs/services/progress.js.map +1 -0
- package/dist/feature/runs/services/reads.js +54 -0
- package/dist/feature/runs/services/reads.js.map +1 -0
- package/dist/feature/runs/services/recovery.js +17 -0
- package/dist/feature/runs/services/recovery.js.map +1 -0
- package/dist/feature/runs/services/refresh.js +29 -0
- package/dist/feature/runs/services/refresh.js.map +1 -0
- package/dist/feature/runs/services/requests.js +88 -0
- package/dist/feature/runs/services/requests.js.map +1 -0
- package/dist/feature/runs/services/states.js +112 -0
- package/dist/feature/runs/services/states.js.map +1 -0
- package/dist/feature/runs/services/summary.js +38 -0
- package/dist/feature/runs/services/summary.js.map +1 -0
- package/dist/feature/runs/types/attempt.js +102 -0
- package/dist/feature/runs/types/attempt.js.map +1 -0
- package/dist/feature/runs/types/constants.js +45 -0
- package/dist/feature/runs/types/constants.js.map +1 -0
- package/dist/feature/runs/types/create.js +177 -0
- package/dist/feature/runs/types/create.js.map +1 -0
- package/dist/feature/runs/types/group.js +152 -0
- package/dist/feature/runs/types/group.js.map +1 -0
- package/dist/feature/runs/types/history/attempt-history.js +16 -0
- package/dist/feature/runs/types/history/attempt-history.js.map +1 -0
- package/dist/feature/runs/types/index.js +15 -0
- package/dist/feature/runs/types/index.js.map +1 -0
- package/dist/feature/runs/types/input.js +57 -0
- package/dist/feature/runs/types/input.js.map +1 -0
- package/dist/feature/runs/types/limits.js +151 -0
- package/dist/feature/runs/types/limits.js.map +1 -0
- package/dist/feature/runs/types/problems.js +74 -0
- package/dist/feature/runs/types/problems.js.map +1 -0
- package/dist/feature/runs/types/run.js +162 -0
- package/dist/feature/runs/types/run.js.map +1 -0
- package/dist/feature/runs/types/skip.js +110 -0
- package/dist/feature/runs/types/skip.js.map +1 -0
- package/dist/feature/runs/types/stage-status.js +156 -0
- package/dist/feature/runs/types/stage-status.js.map +1 -0
- package/dist/feature/runs/types/stages.js +158 -0
- package/dist/feature/runs/types/stages.js.map +1 -0
- package/dist/feature/runs/types/topology.js +165 -0
- package/dist/feature/runs/types/topology.js.map +1 -0
- package/dist/feature/swarm-config/repositories/config-files.js +141 -0
- package/dist/feature/swarm-config/repositories/config-files.js.map +1 -0
- package/dist/feature/swarm-config/services/assemble.js +212 -0
- package/dist/feature/swarm-config/services/assemble.js.map +1 -0
- package/dist/feature/swarm-config/services/create.js +5 -0
- package/dist/feature/swarm-config/services/create.js.map +1 -0
- package/dist/feature/swarm-config/services/discover.js +19 -0
- package/dist/feature/swarm-config/services/discover.js.map +1 -0
- package/dist/feature/swarm-config/services/index.js +9 -0
- package/dist/feature/swarm-config/services/index.js.map +1 -0
- package/dist/feature/swarm-config/services/load.js +86 -0
- package/dist/feature/swarm-config/services/load.js.map +1 -0
- package/dist/feature/swarm-config/services/settings.js +50 -0
- package/dist/feature/swarm-config/services/settings.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-actions.js +117 -0
- package/dist/feature/swarm-config/services/validate-actions.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-context.js +91 -0
- package/dist/feature/swarm-config/services/validate-context.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-pipelines.js +170 -0
- package/dist/feature/swarm-config/services/validate-pipelines.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-runtimes.js +212 -0
- package/dist/feature/swarm-config/services/validate-runtimes.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-settings.js +177 -0
- package/dist/feature/swarm-config/services/validate-settings.js.map +1 -0
- package/dist/feature/swarm-config/services/validate-specialists.js +152 -0
- package/dist/feature/swarm-config/services/validate-specialists.js.map +1 -0
- package/dist/feature/swarm-config/services/validate.js +174 -0
- package/dist/feature/swarm-config/services/validate.js.map +1 -0
- package/dist/feature/swarm-config/types/action.js +11 -0
- package/dist/feature/swarm-config/types/action.js.map +1 -0
- package/dist/feature/swarm-config/types/chain.js +2 -0
- package/dist/feature/swarm-config/types/chain.js.map +1 -0
- package/dist/feature/swarm-config/types/duration.js +17 -0
- package/dist/feature/swarm-config/types/duration.js.map +1 -0
- package/dist/feature/swarm-config/types/errors.js +57 -0
- package/dist/feature/swarm-config/types/errors.js.map +1 -0
- package/dist/feature/swarm-config/types/index.js +13 -0
- package/dist/feature/swarm-config/types/index.js.map +1 -0
- package/dist/feature/swarm-config/types/levels.js +16 -0
- package/dist/feature/swarm-config/types/levels.js.map +1 -0
- package/dist/feature/swarm-config/types/lookups.js +53 -0
- package/dist/feature/swarm-config/types/lookups.js.map +1 -0
- package/dist/feature/swarm-config/types/merge.js +46 -0
- package/dist/feature/swarm-config/types/merge.js.map +1 -0
- package/dist/feature/swarm-config/types/pipeline.js +5 -0
- package/dist/feature/swarm-config/types/pipeline.js.map +1 -0
- package/dist/feature/swarm-config/types/prompt.js +33 -0
- package/dist/feature/swarm-config/types/prompt.js.map +1 -0
- package/dist/feature/swarm-config/types/settings.js +116 -0
- package/dist/feature/swarm-config/types/settings.js.map +1 -0
- package/dist/feature/swarm-config/types/specialist.js +38 -0
- package/dist/feature/swarm-config/types/specialist.js.map +1 -0
- package/dist/feature/swarm-config/types/tag-names.js +43 -0
- package/dist/feature/swarm-config/types/tag-names.js.map +1 -0
- package/dist/feature/swarm-edit/ports/config-changed.js +2 -0
- package/dist/feature/swarm-edit/ports/config-changed.js.map +1 -0
- package/dist/feature/swarm-edit/ports/index.js +2 -0
- package/dist/feature/swarm-edit/ports/index.js.map +1 -0
- package/dist/feature/swarm-edit/repositories/documents.js +144 -0
- package/dist/feature/swarm-edit/repositories/documents.js.map +1 -0
- package/dist/feature/swarm-edit/services/config-edits.js +116 -0
- package/dist/feature/swarm-edit/services/config-edits.js.map +1 -0
- package/dist/feature/swarm-edit/services/create.js +7 -0
- package/dist/feature/swarm-edit/services/create.js.map +1 -0
- package/dist/feature/swarm-edit/services/editor-settings.js +143 -0
- package/dist/feature/swarm-edit/services/editor-settings.js.map +1 -0
- package/dist/feature/swarm-edit/services/editor-view.js +144 -0
- package/dist/feature/swarm-edit/services/editor-view.js.map +1 -0
- package/dist/feature/swarm-edit/services/index.js +12 -0
- package/dist/feature/swarm-edit/services/index.js.map +1 -0
- package/dist/feature/swarm-edit/services/levels.js +30 -0
- package/dist/feature/swarm-edit/services/levels.js.map +1 -0
- package/dist/feature/swarm-edit/services/plan-edit.js +217 -0
- package/dist/feature/swarm-edit/services/plan-edit.js.map +1 -0
- package/dist/feature/swarm-edit/services/plan-settings.js +198 -0
- package/dist/feature/swarm-edit/services/plan-settings.js.map +1 -0
- package/dist/feature/swarm-edit/services/references.js +85 -0
- package/dist/feature/swarm-edit/services/references.js.map +1 -0
- package/dist/feature/swarm-edit/services/shared-config.js +128 -0
- package/dist/feature/swarm-edit/services/shared-config.js.map +1 -0
- package/dist/feature/swarm-edit/services/shared-pipelines.js +72 -0
- package/dist/feature/swarm-edit/services/shared-pipelines.js.map +1 -0
- package/dist/feature/swarm-edit/services/shared-specialists.js +70 -0
- package/dist/feature/swarm-edit/services/shared-specialists.js.map +1 -0
- package/dist/feature/swarm-edit/services/specialist-tags.js +215 -0
- package/dist/feature/swarm-edit/services/specialist-tags.js.map +1 -0
- package/dist/feature/swarm-edit/types/editor.js +27 -0
- package/dist/feature/swarm-edit/types/editor.js.map +1 -0
- package/dist/feature/swarm-edit/types/index.js +7 -0
- package/dist/feature/swarm-edit/types/index.js.map +1 -0
- package/dist/feature/swarm-edit/types/setting-fields.js +64 -0
- package/dist/feature/swarm-edit/types/setting-fields.js.map +1 -0
- package/dist/feature/swarm-edit/types/shared.js +2 -0
- package/dist/feature/swarm-edit/types/shared.js.map +1 -0
- package/dist/feature/swarm-edit/types/stages.js +69 -0
- package/dist/feature/swarm-edit/types/stages.js.map +1 -0
- package/dist/feature/swarm-edit/types/tag-folders.js +2 -0
- package/dist/feature/swarm-edit/types/tag-folders.js.map +1 -0
- package/dist/feature/swarm-edit/types/views.js +2 -0
- package/dist/feature/swarm-edit/types/views.js.map +1 -0
- package/dist/feature/tags/ports/index.js +2 -0
- package/dist/feature/tags/ports/index.js.map +1 -0
- package/dist/feature/tags/ports/publish.js +2 -0
- package/dist/feature/tags/ports/publish.js.map +1 -0
- package/dist/feature/tags/repositories/index.js +2 -0
- package/dist/feature/tags/repositories/index.js.map +1 -0
- package/dist/feature/tags/repositories/tags.js +36 -0
- package/dist/feature/tags/repositories/tags.js.map +1 -0
- package/dist/feature/tags/services/catalog.js +73 -0
- package/dist/feature/tags/services/catalog.js.map +1 -0
- package/dist/feature/tags/services/create.js +7 -0
- package/dist/feature/tags/services/create.js.map +1 -0
- package/dist/feature/tags/services/index.js +3 -0
- package/dist/feature/tags/services/index.js.map +1 -0
- package/dist/feature/tags/types/ids.js +7 -0
- package/dist/feature/tags/types/ids.js.map +1 -0
- package/dist/feature/tags/types/index.js +3 -0
- package/dist/feature/tags/types/index.js.map +1 -0
- package/dist/feature/tags/types/tags.js +184 -0
- package/dist/feature/tags/types/tags.js.map +1 -0
- package/dist/git/delivery.js +284 -0
- package/dist/git/delivery.js.map +1 -0
- package/dist/git/index.js +4 -0
- package/dist/git/index.js.map +1 -0
- package/dist/git/runner.js +60 -0
- package/dist/git/runner.js.map +1 -0
- package/dist/git/workspace.js +366 -0
- package/dist/git/workspace.js.map +1 -0
- package/dist/mcp/host.js +401 -0
- package/dist/mcp/host.js.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/tools.js +19 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/version.js +5 -0
- package/dist/mcp/version.js.map +1 -0
- package/dist/mcp/worker.js +230 -0
- package/dist/mcp/worker.js.map +1 -0
- package/dist/platform/build/fingerprint.js +36 -0
- package/dist/platform/build/fingerprint.js.map +1 -0
- package/dist/platform/build/index.js +3 -0
- package/dist/platform/build/index.js.map +1 -0
- package/dist/platform/build/locations.js +16 -0
- package/dist/platform/build/locations.js.map +1 -0
- package/dist/platform/errors/app-error.js +39 -0
- package/dist/platform/errors/app-error.js.map +1 -0
- package/dist/platform/errors/index.js +2 -0
- package/dist/platform/errors/index.js.map +1 -0
- package/dist/platform/git/delivery.js +284 -0
- package/dist/platform/git/delivery.js.map +1 -0
- package/dist/platform/git/index.js +4 -0
- package/dist/platform/git/index.js.map +1 -0
- package/dist/platform/git/runner.js +65 -0
- package/dist/platform/git/runner.js.map +1 -0
- package/dist/platform/git/workspace.js +366 -0
- package/dist/platform/git/workspace.js.map +1 -0
- package/dist/platform/paths/index.js +2 -0
- package/dist/platform/paths/index.js.map +1 -0
- package/dist/platform/paths/paths.js +39 -0
- package/dist/platform/paths/paths.js.map +1 -0
- package/dist/platform/process/index.js +3 -0
- package/dist/platform/process/index.js.map +1 -0
- package/dist/platform/process/ps.js +42 -0
- package/dist/platform/process/ps.js.map +1 -0
- package/dist/platform/process/which.js +21 -0
- package/dist/platform/process/which.js.map +1 -0
- package/dist/platform/sqlite/database.js +36 -0
- package/dist/platform/sqlite/database.js.map +1 -0
- package/dist/platform/sqlite/index.js +4 -0
- package/dist/platform/sqlite/index.js.map +1 -0
- package/dist/platform/sqlite/migrations.js +297 -0
- package/dist/platform/sqlite/migrations.js.map +1 -0
- package/dist/platform/sqlite/rows.js +13 -0
- package/dist/platform/sqlite/rows.js.map +1 -0
- package/dist/presentation/cli/commands/daemon.js +216 -0
- package/dist/presentation/cli/commands/daemon.js.map +1 -0
- package/dist/presentation/cli/commands/group.js +88 -0
- package/dist/presentation/cli/commands/group.js.map +1 -0
- package/dist/presentation/cli/commands/mcp.js +44 -0
- package/dist/presentation/cli/commands/mcp.js.map +1 -0
- package/dist/presentation/cli/commands/queue-edit.js +155 -0
- package/dist/presentation/cli/commands/queue-edit.js.map +1 -0
- package/dist/presentation/cli/commands/queue.js +222 -0
- package/dist/presentation/cli/commands/queue.js.map +1 -0
- package/dist/presentation/cli/commands/repositories.js +129 -0
- package/dist/presentation/cli/commands/repositories.js.map +1 -0
- package/dist/presentation/cli/commands/run-delivery.js +116 -0
- package/dist/presentation/cli/commands/run-delivery.js.map +1 -0
- package/dist/presentation/cli/commands/run.js +156 -0
- package/dist/presentation/cli/commands/run.js.map +1 -0
- package/dist/presentation/cli/commands/setup.js +97 -0
- package/dist/presentation/cli/commands/setup.js.map +1 -0
- package/dist/presentation/cli/commands/tag.js +92 -0
- package/dist/presentation/cli/commands/tag.js.map +1 -0
- package/dist/presentation/cli/commands/web.js +100 -0
- package/dist/presentation/cli/commands/web.js.map +1 -0
- package/dist/presentation/cli/context.js +49 -0
- package/dist/presentation/cli/context.js.map +1 -0
- package/dist/presentation/cli/help.js +49 -0
- package/dist/presentation/cli/help.js.map +1 -0
- package/dist/presentation/cli/io.js +13 -0
- package/dist/presentation/cli/io.js.map +1 -0
- package/dist/presentation/cli/local/clean.js +72 -0
- package/dist/presentation/cli/local/clean.js.map +1 -0
- package/dist/presentation/cli/local/config-check.js +207 -0
- package/dist/presentation/cli/local/config-check.js.map +1 -0
- package/dist/presentation/cli/local/init.js +44 -0
- package/dist/presentation/cli/local/init.js.map +1 -0
- package/dist/presentation/cli/options.js +34 -0
- package/dist/presentation/cli/options.js.map +1 -0
- package/dist/presentation/cli/probe.js +12 -0
- package/dist/presentation/cli/probe.js.map +1 -0
- package/dist/presentation/cli/program.js +76 -0
- package/dist/presentation/cli/program.js.map +1 -0
- package/dist/presentation/cli/setup/actions.js +206 -0
- package/dist/presentation/cli/setup/actions.js.map +1 -0
- package/dist/presentation/cli/setup/command.js +80 -0
- package/dist/presentation/cli/setup/command.js.map +1 -0
- package/dist/presentation/cli/setup/host.js +20 -0
- package/dist/presentation/cli/setup/host.js.map +1 -0
- package/dist/presentation/cli/setup/index.js +5 -0
- package/dist/presentation/cli/setup/index.js.map +1 -0
- package/dist/presentation/cli/setup/run.js +63 -0
- package/dist/presentation/cli/setup/run.js.map +1 -0
- package/dist/presentation/cli/setup/system.js +53 -0
- package/dist/presentation/cli/setup/system.js.map +1 -0
- package/dist/presentation/cli/setup/types.js +3 -0
- package/dist/presentation/cli/setup/types.js.map +1 -0
- package/dist/presentation/cli/watch.js +24 -0
- package/dist/presentation/cli/watch.js.map +1 -0
- package/dist/presentation/cli/web-control.js +172 -0
- package/dist/presentation/cli/web-control.js.map +1 -0
- package/dist/presentation/format/groups.js +99 -0
- package/dist/presentation/format/groups.js.map +1 -0
- package/dist/presentation/format/index.js +7 -0
- package/dist/presentation/format/index.js.map +1 -0
- package/dist/presentation/format/queue.js +109 -0
- package/dist/presentation/format/queue.js.map +1 -0
- package/dist/presentation/format/runs.js +202 -0
- package/dist/presentation/format/runs.js.map +1 -0
- package/dist/presentation/format/style.js +81 -0
- package/dist/presentation/format/style.js.map +1 -0
- package/dist/presentation/format/table.js +62 -0
- package/dist/presentation/format/table.js.map +1 -0
- package/dist/presentation/format/tags.js +26 -0
- package/dist/presentation/format/tags.js.map +1 -0
- package/dist/presentation/ipc/client/autostart.js +171 -0
- package/dist/presentation/ipc/client/autostart.js.map +1 -0
- package/dist/presentation/ipc/client/client.js +83 -0
- package/dist/presentation/ipc/client/client.js.map +1 -0
- package/dist/presentation/ipc/client/index.js +4 -0
- package/dist/presentation/ipc/client/index.js.map +1 -0
- package/dist/presentation/ipc/client/repository-argument.js +13 -0
- package/dist/presentation/ipc/client/repository-argument.js.map +1 -0
- package/dist/presentation/ipc/contract/agents.js +79 -0
- package/dist/presentation/ipc/contract/agents.js.map +1 -0
- package/dist/presentation/ipc/contract/artifacts.js +27 -0
- package/dist/presentation/ipc/contract/artifacts.js.map +1 -0
- package/dist/presentation/ipc/contract/config.js +141 -0
- package/dist/presentation/ipc/contract/config.js.map +1 -0
- package/dist/presentation/ipc/contract/envelope.js +97 -0
- package/dist/presentation/ipc/contract/envelope.js.map +1 -0
- package/dist/presentation/ipc/contract/groups.js +48 -0
- package/dist/presentation/ipc/contract/groups.js.map +1 -0
- package/dist/presentation/ipc/contract/index.js +14 -0
- package/dist/presentation/ipc/contract/index.js.map +1 -0
- package/dist/presentation/ipc/contract/observers/history.js +26 -0
- package/dist/presentation/ipc/contract/observers/history.js.map +1 -0
- package/dist/presentation/ipc/contract/observers.js +16 -0
- package/dist/presentation/ipc/contract/observers.js.map +1 -0
- package/dist/presentation/ipc/contract/panel.js +53 -0
- package/dist/presentation/ipc/contract/panel.js.map +1 -0
- package/dist/presentation/ipc/contract/processes.js +9 -0
- package/dist/presentation/ipc/contract/processes.js.map +1 -0
- package/dist/presentation/ipc/contract/queue.js +115 -0
- package/dist/presentation/ipc/contract/queue.js.map +1 -0
- package/dist/presentation/ipc/contract/repositories.js +33 -0
- package/dist/presentation/ipc/contract/repositories.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/artifacts.js +2 -0
- package/dist/presentation/ipc/contract/responses/artifacts.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/config.js +2 -0
- package/dist/presentation/ipc/contract/responses/config.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/groups.js +2 -0
- package/dist/presentation/ipc/contract/responses/groups.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/index.js +11 -0
- package/dist/presentation/ipc/contract/responses/index.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/observer-history.js +2 -0
- package/dist/presentation/ipc/contract/responses/observer-history.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/observers.js +2 -0
- package/dist/presentation/ipc/contract/responses/observers.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/processes.js +2 -0
- package/dist/presentation/ipc/contract/responses/processes.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/queue.js +2 -0
- package/dist/presentation/ipc/contract/responses/queue.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/repositories.js +2 -0
- package/dist/presentation/ipc/contract/responses/repositories.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/runs.js +2 -0
- package/dist/presentation/ipc/contract/responses/runs.js.map +1 -0
- package/dist/presentation/ipc/contract/responses/tags.js +2 -0
- package/dist/presentation/ipc/contract/responses/tags.js.map +1 -0
- package/dist/presentation/ipc/contract/runs.js +112 -0
- package/dist/presentation/ipc/contract/runs.js.map +1 -0
- package/dist/presentation/ipc/contract/tags.js +40 -0
- package/dist/presentation/ipc/contract/tags.js.map +1 -0
- package/dist/presentation/ipc/handlers/config.js +38 -0
- package/dist/presentation/ipc/handlers/config.js.map +1 -0
- package/dist/presentation/ipc/handlers/groups.js +14 -0
- package/dist/presentation/ipc/handlers/groups.js.map +1 -0
- package/dist/presentation/ipc/handlers/index.js +2 -0
- package/dist/presentation/ipc/handlers/index.js.map +1 -0
- package/dist/presentation/ipc/handlers/observers.js +14 -0
- package/dist/presentation/ipc/handlers/observers.js.map +1 -0
- package/dist/presentation/ipc/handlers/queue.js +36 -0
- package/dist/presentation/ipc/handlers/queue.js.map +1 -0
- package/dist/presentation/ipc/handlers/repositories.js +26 -0
- package/dist/presentation/ipc/handlers/repositories.js.map +1 -0
- package/dist/presentation/ipc/handlers/runs.js +55 -0
- package/dist/presentation/ipc/handlers/runs.js.map +1 -0
- package/dist/presentation/ipc/handlers/system.js +38 -0
- package/dist/presentation/ipc/handlers/system.js.map +1 -0
- package/dist/presentation/ipc/handlers/table.js +23 -0
- package/dist/presentation/ipc/handlers/table.js.map +1 -0
- package/dist/presentation/ipc/handlers/types.js +2 -0
- package/dist/presentation/ipc/handlers/types.js.map +1 -0
- package/dist/presentation/ipc/publisher.js +175 -0
- package/dist/presentation/ipc/publisher.js.map +1 -0
- package/dist/presentation/ipc/server.js +164 -0
- package/dist/presentation/ipc/server.js.map +1 -0
- package/dist/presentation/ipc/services.js +2 -0
- package/dist/presentation/ipc/services.js.map +1 -0
- package/dist/presentation/ipc/snapshots.js +60 -0
- package/dist/presentation/ipc/snapshots.js.map +1 -0
- package/dist/presentation/ipc/views/catalog.js +9 -0
- package/dist/presentation/ipc/views/catalog.js.map +1 -0
- package/dist/presentation/ipc/views/groups.js +112 -0
- package/dist/presentation/ipc/views/groups.js.map +1 -0
- package/dist/presentation/ipc/views/index.js +10 -0
- package/dist/presentation/ipc/views/index.js.map +1 -0
- package/dist/presentation/ipc/views/observer-history.js +26 -0
- package/dist/presentation/ipc/views/observer-history.js.map +1 -0
- package/dist/presentation/ipc/views/observers.js +16 -0
- package/dist/presentation/ipc/views/observers.js.map +1 -0
- package/dist/presentation/ipc/views/queue.js +151 -0
- package/dist/presentation/ipc/views/queue.js.map +1 -0
- package/dist/presentation/ipc/views/repositories.js +34 -0
- package/dist/presentation/ipc/views/repositories.js.map +1 -0
- package/dist/presentation/ipc/views/rows.js +117 -0
- package/dist/presentation/ipc/views/rows.js.map +1 -0
- package/dist/presentation/ipc/views/run-stages.js +66 -0
- package/dist/presentation/ipc/views/run-stages.js.map +1 -0
- package/dist/presentation/ipc/views/runs.js +201 -0
- package/dist/presentation/ipc/views/runs.js.map +1 -0
- package/dist/presentation/ipc/views/tags.js +19 -0
- package/dist/presentation/ipc/views/tags.js.map +1 -0
- package/dist/presentation/mcp/host-kit.js +67 -0
- package/dist/presentation/mcp/host-kit.js.map +1 -0
- package/dist/presentation/mcp/host-queue-control.js +135 -0
- package/dist/presentation/mcp/host-queue-control.js.map +1 -0
- package/dist/presentation/mcp/host-queue.js +124 -0
- package/dist/presentation/mcp/host-queue.js.map +1 -0
- package/dist/presentation/mcp/host-runs.js +173 -0
- package/dist/presentation/mcp/host-runs.js.map +1 -0
- package/dist/presentation/mcp/host.js +34 -0
- package/dist/presentation/mcp/host.js.map +1 -0
- package/dist/presentation/mcp/index.js +3 -0
- package/dist/presentation/mcp/index.js.map +1 -0
- package/dist/presentation/mcp/tools.js +19 -0
- package/dist/presentation/mcp/tools.js.map +1 -0
- package/dist/presentation/mcp/worker-extra.js +144 -0
- package/dist/presentation/mcp/worker-extra.js.map +1 -0
- package/dist/presentation/mcp/worker-tools.js +107 -0
- package/dist/presentation/mcp/worker-tools.js.map +1 -0
- package/dist/presentation/mcp/worker.js +12 -0
- package/dist/presentation/mcp/worker.js.map +1 -0
- package/dist/presentation/web/errors.js +60 -0
- package/dist/presentation/web/errors.js.map +1 -0
- package/dist/presentation/web/http.js +130 -0
- package/dist/presentation/web/http.js.map +1 -0
- package/dist/presentation/web/hub.js +164 -0
- package/dist/presentation/web/hub.js.map +1 -0
- package/dist/presentation/web/index.js +7 -0
- package/dist/presentation/web/index.js.map +1 -0
- package/dist/presentation/web/options.js +7 -0
- package/dist/presentation/web/options.js.map +1 -0
- package/dist/presentation/web/pages.js +44 -0
- package/dist/presentation/web/pages.js.map +1 -0
- package/dist/presentation/web/panel/daemon-panel.js +207 -0
- package/dist/presentation/web/panel/daemon-panel.js.map +1 -0
- package/dist/presentation/web/panel/default-repository.js +14 -0
- package/dist/presentation/web/panel/default-repository.js.map +1 -0
- package/dist/presentation/web/panel/directories.js +48 -0
- package/dist/presentation/web/panel/directories.js.map +1 -0
- package/dist/presentation/web/panel/open.js +12 -0
- package/dist/presentation/web/panel/open.js.map +1 -0
- package/dist/presentation/web/panel/standby.js +119 -0
- package/dist/presentation/web/panel/standby.js.map +1 -0
- package/dist/presentation/web/panel/state.js +69 -0
- package/dist/presentation/web/panel/state.js.map +1 -0
- package/dist/presentation/web/panel/system.js +66 -0
- package/dist/presentation/web/panel/system.js.map +1 -0
- package/dist/presentation/web/request.js +123 -0
- package/dist/presentation/web/request.js.map +1 -0
- package/dist/presentation/web/routes/config.js +166 -0
- package/dist/presentation/web/routes/config.js.map +1 -0
- package/dist/presentation/web/routes/directories.js +60 -0
- package/dist/presentation/web/routes/directories.js.map +1 -0
- package/dist/presentation/web/routes/downloads.js +65 -0
- package/dist/presentation/web/routes/downloads.js.map +1 -0
- package/dist/presentation/web/routes/groups.js +85 -0
- package/dist/presentation/web/routes/groups.js.map +1 -0
- package/dist/presentation/web/routes/observers/history.js +19 -0
- package/dist/presentation/web/routes/observers/history.js.map +1 -0
- package/dist/presentation/web/routes/processes.js +21 -0
- package/dist/presentation/web/routes/processes.js.map +1 -0
- package/dist/presentation/web/routes/queue.js +80 -0
- package/dist/presentation/web/routes/queue.js.map +1 -0
- package/dist/presentation/web/routes/repositories.js +66 -0
- package/dist/presentation/web/routes/repositories.js.map +1 -0
- package/dist/presentation/web/routes/runs.js +76 -0
- package/dist/presentation/web/routes/runs.js.map +1 -0
- package/dist/presentation/web/routes/settings.js +74 -0
- package/dist/presentation/web/routes/settings.js.map +1 -0
- package/dist/presentation/web/routes/specialists.js +74 -0
- package/dist/presentation/web/routes/specialists.js.map +1 -0
- package/dist/presentation/web/routes/system.js +96 -0
- package/dist/presentation/web/routes/system.js.map +1 -0
- package/dist/presentation/web/routes/tags.js +46 -0
- package/dist/presentation/web/routes/tags.js.map +1 -0
- package/dist/presentation/web/routes/types.js +2 -0
- package/dist/presentation/web/routes/types.js.map +1 -0
- package/dist/presentation/web/server.js +185 -0
- package/dist/presentation/web/server.js.map +1 -0
- package/dist/protocol/autostart.js +171 -0
- package/dist/protocol/autostart.js.map +1 -0
- package/dist/protocol/build.js +38 -0
- package/dist/protocol/build.js.map +1 -0
- package/dist/protocol/catalog.js +18 -0
- package/dist/protocol/catalog.js.map +1 -0
- package/dist/protocol/client.js +83 -0
- package/dist/protocol/client.js.map +1 -0
- package/dist/protocol/format.js +477 -0
- package/dist/protocol/format.js.map +1 -0
- package/dist/protocol/index.js +11 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/messages.js +598 -0
- package/dist/protocol/messages.js.map +1 -0
- package/dist/protocol/style.js +81 -0
- package/dist/protocol/style.js.map +1 -0
- package/dist/protocol/transcript.js +49 -0
- package/dist/protocol/transcript.js.map +1 -0
- package/dist/protocol/views.js +696 -0
- package/dist/protocol/views.js.map +1 -0
- package/dist/runtime/catalog.js +117 -0
- package/dist/runtime/catalog.js.map +1 -0
- package/dist/runtime/claude.js +399 -0
- package/dist/runtime/claude.js.map +1 -0
- package/dist/runtime/index.js +34 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/message.js +48 -0
- package/dist/runtime/message.js.map +1 -0
- package/dist/runtime/naming.js +69 -0
- package/dist/runtime/naming.js.map +1 -0
- package/dist/runtime/opencode.js +189 -0
- package/dist/runtime/opencode.js.map +1 -0
- package/dist/runtime/skills.js +17 -0
- package/dist/runtime/skills.js.map +1 -0
- package/dist/runtime/transcript.js +227 -0
- package/dist/runtime/transcript.js.map +1 -0
- package/dist/runtime/types.js +12 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/runtime/which.js +21 -0
- package/dist/runtime/which.js.map +1 -0
- package/dist/store/index.js +3 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/schema.js +286 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/store.js +491 -0
- package/dist/store/store.js.map +1 -0
- package/dist/web/assets/EntryList-CnfGgjEY.js +1 -0
- package/dist/web/assets/FilePath-C0X8-keS.js +1 -0
- package/dist/web/assets/SettingsForm-BcyBWJbn.js +1 -0
- package/dist/web/assets/SharedPipelinesGroup-a368-IQ0.js +1 -0
- package/dist/web/assets/card-DkikoTxR.js +1 -0
- package/dist/web/assets/deliveryModes-funlvXVC.js +1 -0
- package/dist/web/assets/index-B-oJ93zH.js +22 -0
- package/dist/web/assets/index-BZE36gYR.css +2 -0
- package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/web/assets/locales-DtRrxYzg.js +1 -0
- package/dist/web/assets/pipelines-D48ggDNe.js +1 -0
- package/dist/web/assets/queue-D8_RY4IY.js +16 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/select-J4oIrmYh.js +1 -0
- package/dist/web/assets/settings-B0-0Vaia.js +2 -0
- package/dist/web/assets/skeleton-CCKCQF5n.js +1 -0
- package/dist/web/assets/specialists-DH8tyluO.js +1 -0
- package/dist/web/assets/switch-CWFAgxG1.js +41 -0
- package/dist/web/assets/topology-CNQ28AB2.js +7 -0
- package/dist/web/assets/topology-DLioOiRN.css +1 -0
- package/dist/web/assets/vendor-markdown-DwXfjc7L.js +32 -0
- package/dist/web/assets/vendor-react-C1iE8mnY.js +9 -0
- package/dist/web/index.html +21 -0
- package/integrations/claude-code/.claude-plugin/plugin.json +19 -0
- package/integrations/claude-code/commands/apply.md +6 -0
- package/integrations/claude-code/commands/panel.md +6 -0
- package/integrations/claude-code/commands/run.md +6 -0
- package/integrations/claude-code/commands/status.md +6 -0
- package/integrations/claude-code/commands/web.md +6 -0
- package/integrations/claude-code/hooks/aip.ts +365 -0
- package/integrations/claude-code/hooks/feed.ts +923 -0
- package/integrations/claude-code/hooks/hooks.json +1 -0
- package/integrations/claude-code/hooks/pane.ts +396 -0
- package/integrations/claude-code/hooks/register.tsx +156 -0
- package/integrations/claude-code/hooks/theme.ts +59 -0
- package/integrations/claude-code/hooks/transcript.tsx +44 -0
- package/integrations/claude-code/hooks/view.tsx +378 -0
- package/integrations/claude-code/hooks/web.ts +162 -0
- package/integrations/claude-code/tsconfig.json +18 -0
- package/integrations/claude-code/types/index.d.ts +89 -0
- package/package.json +70 -4
- package/templates/aip/pipelines/feature.yaml +4 -0
- package/templates/aip/settings.yaml +10 -0
- package/templates/aip/specialists/coder.yaml +4 -0
- package/templates/aip/specialists/reviewer.yaml +5 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defaultRuntimes, } from '../feature/swarm-config/types/index.js';
|
|
2
|
+
import { createClaudeRuntime } from './claude.js';
|
|
3
|
+
import { mcpServers, skillCatalog, sortEntries } from './catalog.js';
|
|
4
|
+
import { createOpencodeRuntime } from './opencode.js';
|
|
5
|
+
export { claudeAllowedTools, claudePermissionArgs, claudeTools, createClaudeRuntime, } from './claude.js';
|
|
6
|
+
export { systemPrompt, userMessage } from './message.js';
|
|
7
|
+
export { createOpencodeRuntime, opencodeAgentName, opencodePermission } from './opencode.js';
|
|
8
|
+
export { missingSkills, skillCandidates } from './skills.js';
|
|
9
|
+
export { claudeTranscript, opencodeTranscript, toolSummary } from './transcript.js';
|
|
10
|
+
export { answerText, namingPrompt, parseNaming } from './naming.js';
|
|
11
|
+
export * from './types.js';
|
|
12
|
+
export function runtimeFor(name, environment, settings = defaultRuntimes()) {
|
|
13
|
+
const { command, args, env } = settings[name];
|
|
14
|
+
return name === 'claude'
|
|
15
|
+
? createClaudeRuntime(environment.AIP_CLAUDE_BIN || command, { args, env })
|
|
16
|
+
: createOpencodeRuntime(environment.AIP_OPENCODE_BIN || command, { args, env });
|
|
17
|
+
}
|
|
18
|
+
export { mcpServers, skillCatalog } from './catalog.js';
|
|
19
|
+
/** Tools and skills a specialist of each runtime can name, read from disk on every call. */
|
|
20
|
+
export function runtimeCatalog(repository, home, environment) {
|
|
21
|
+
const build = (name) => {
|
|
22
|
+
const runtime = runtimeFor(name, environment);
|
|
23
|
+
const servers = name === 'claude' ? mcpServers(repository, home) : [];
|
|
24
|
+
return {
|
|
25
|
+
tools: sortEntries([
|
|
26
|
+
...runtime.builtinTools.map((tool) => ({ name: tool, source: 'builtin' })),
|
|
27
|
+
...servers,
|
|
28
|
+
]),
|
|
29
|
+
skills: skillCatalog(runtime.skillDirectories(repository, home), repository, home),
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
return { claude: build('claude'), opencode: build('openc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AAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;AACpF,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAExD,4FAA4F;AAC5F,MAAM,UAAU,cAAc,CAC5B,UAAkB,EAClB,IAAY,EACZ,WAA8B;IAE9B,MAAM,KAAK,GAAG,CAAC,IAAiB,EAAE,EAAE;QAClC,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,OAAO;YACL,KAAK,EAAE,WAAW,CAAC;gBACjB,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAkB,EAAE,CAAC,CAAC;gBACnF,GAAG,OAAO;aACX,CAAC;YACF,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC;SACnF,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { describePermissions } from './types.js';
|
|
2
|
+
export function systemPrompt(specialist, input) {
|
|
3
|
+
const lines = [
|
|
4
|
+
`You are "${specialist.name}", a specialist in an aip swarm. Group: "${input.groupTitle}". Step: "${input.stepId}".`,
|
|
5
|
+
'You work in an isolated git worktree: the current directory. Change files only inside it. Never run git push, git checkout or git switch, and never touch other directories.',
|
|
6
|
+
describePermissions(specialist.permissions),
|
|
7
|
+
'If a tool call is refused for lack of permission, look for another way to do it within your permissions. Report "needs_human" only when the step cannot be done without the refused action, and name the refused command in the question.',
|
|
8
|
+
'When you are finished you MUST call the tool `swarm_report` exactly as the last action:',
|
|
9
|
+
'- verdict "done" when the step is complete;',
|
|
10
|
+
'- verdict "rejected" when the work you received must be redone; put concrete remarks into feedback;',
|
|
11
|
+
'- verdict "needs_human" when you cannot continue without a decision from a person; put the question into feedback. When you have several independent questions, ask them all in one report through `questions` (each with a `recommendation`, and `options` when the answer is a clear choice) instead of feedback. Add `human_only: true` when only a person may answer, for example when you ask them to look personally at what you wrote.',
|
|
12
|
+
'Always pass a short summary of what you did. Without swarm_report the step counts as failed.',
|
|
13
|
+
];
|
|
14
|
+
if (specialist.skills.length > 0) {
|
|
15
|
+
lines.push(`Use these skills for this step: ${specialist.skills.join(', ')}.`);
|
|
16
|
+
}
|
|
17
|
+
if (input.humanReview) {
|
|
18
|
+
lines.push('After you report "done" a person reviews this step before the work goes on. In the summary list what to check: architecture decisions, risky places, assumptions you made.');
|
|
19
|
+
}
|
|
20
|
+
return lines.join('\n');
|
|
21
|
+
}
|
|
22
|
+
export function userMessage(input) {
|
|
23
|
+
const sections = [input.prompt];
|
|
24
|
+
if (input.previous.length > 0) {
|
|
25
|
+
sections.push([
|
|
26
|
+
'## Previous steps',
|
|
27
|
+
...input.previous.map((previous) => `- ${previous.stepId} (${previous.specialist}, ${previous.verdict}): ${previous.summary}`),
|
|
28
|
+
].join('\n'));
|
|
29
|
+
}
|
|
30
|
+
if (input.decisions.length > 0) {
|
|
31
|
+
sections.push([
|
|
32
|
+
'## Accepted answers to questions in this group (do not ask them again)',
|
|
33
|
+
...input.decisions.map((decision) => `- ${decision.stepId}: Q: ${decision.question} A: ${decision.answer} (by ${decision.by})`),
|
|
34
|
+
].join('\n'));
|
|
35
|
+
}
|
|
36
|
+
if (input.feedback)
|
|
37
|
+
sections.push(`## Feedback to address\n${input.feedback}`);
|
|
38
|
+
if (input.humanAnswer) {
|
|
39
|
+
sections.push(input.reviewed
|
|
40
|
+
? `## Answer of the person who reviewed this step\n${input.humanAnswer}\n\nAddress the remarks, and report "done" at once if there is nothing to change.`
|
|
41
|
+
: `## Latest accepted answer\n${input.humanAnswer}`);
|
|
42
|
+
}
|
|
43
|
+
if (input.message) {
|
|
44
|
+
sections.push(`## Message from the person (sent ${new Date(input.message.at).toISOString()})\n${input.message.text}`);
|
|
45
|
+
}
|
|
46
|
+
return sections.join('\n\n');
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/runtime/message.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,UAAU,YAAY,CAAC,UAAsB,EAAE,KAAgB;IACnE,MAAM,KAAK,GAAG;QACZ,YAAY,UAAU,CAAC,IAAI,4CAA4C,KAAK,CAAC,UAAU,aAAa,KAAK,CAAC,MAAM,IAAI;QACpH,8KAA8K;QAC9K,mBAAmB,CAAC,UAAU,CAAC,WAAW,CAAC;QAC3C,2OAA2O;QAC3O,yFAAyF;QACzF,6CAA6C;QAC7C,qGAAqG;QACrG,+aAA+a;QAC/a,8FAA8F;KAC/F,CAAC;IACF,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,mCAAmC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjF,CAAC;IACD,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CACR,4KAA4K,CAC7K,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAgB;IAC1C,MAAM,QAAQ,GAAG,CAAC,KAAK,C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AM,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CACvG,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { RUN_NAME_LIMIT, RUN_NAME_PATTERN, RUN_TITLE_LIMIT, } from '../feature/agents/types/index.js';
|
|
3
|
+
const namingSchema = z.object({ title: z.string(), name: z.string() });
|
|
4
|
+
/** Cuts a title to the limit at a word boundary, with an ellipsis. */
|
|
5
|
+
function fitTitle(title) {
|
|
6
|
+
const text = title
|
|
7
|
+
.replace(/\s+/g, ' ')
|
|
8
|
+
.trim()
|
|
9
|
+
.replace(/[.。]+$/, '');
|
|
10
|
+
if (text.length <= RUN_TITLE_LIMIT)
|
|
11
|
+
return text;
|
|
12
|
+
const cut = text.slice(0, RUN_TITLE_LIMIT - 1);
|
|
13
|
+
const space = cut.lastIndexOf(' ');
|
|
14
|
+
return `${(space > RUN_TITLE_LIMIT / 2 ? cut.slice(0, space) : cut).replace(/[\s,.:;—-]+$/, '')}…`;
|
|
15
|
+
}
|
|
16
|
+
/** Lowercase kebab-case within the limit, cut at a hyphen. */
|
|
17
|
+
function fitName(name) {
|
|
18
|
+
let text = name
|
|
19
|
+
.toLowerCase()
|
|
20
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
21
|
+
.replace(/^-+|-+$/g, '');
|
|
22
|
+
if (text.length > RUN_NAME_LIMIT) {
|
|
23
|
+
const cut = text.slice(0, RUN_NAME_LIMIT + 1);
|
|
24
|
+
const hyphen = cut.lastIndexOf('-');
|
|
25
|
+
text = (hyphen > 0 ? cut.slice(0, hyphen) : cut.slice(0, RUN_NAME_LIMIT)).replace(/-+$/, '');
|
|
26
|
+
}
|
|
27
|
+
return text;
|
|
28
|
+
}
|
|
29
|
+
const TASK_LIMIT = 4000;
|
|
30
|
+
export function namingPrompt(task) {
|
|
31
|
+
return [
|
|
32
|
+
'Name a task for a list of tasks. Answer with one JSON object and nothing else:',
|
|
33
|
+
`{"title": "...", "name": "..."}`,
|
|
34
|
+
`- title: the gist of the task in the language of the task, strictly at most ${RUN_TITLE_LIMIT} characters (shorter is better), no trailing period;`,
|
|
35
|
+
`- name: an English kebab-case name of at most ${RUN_NAME_LIMIT} characters (lowercase latin letters, digits and hyphens), like the name of a change: add-version-json-flag, fix-login-redirect.`,
|
|
36
|
+
'Task:',
|
|
37
|
+
task.length > TASK_LIMIT ? `${task.slice(0, TASK_LIMIT)}…` : task,
|
|
38
|
+
].join('\n');
|
|
39
|
+
}
|
|
40
|
+
/** The answer text of a one-shot call: its result, or the text it printed. */
|
|
41
|
+
export function answerText(entries) {
|
|
42
|
+
const result = entries.findLast((entry) => entry.kind === 'result');
|
|
43
|
+
if (result?.kind === 'result' && result.text)
|
|
44
|
+
return result.text;
|
|
45
|
+
return entries.flatMap((entry) => (entry.kind === 'text' ? [entry.text] : [])).join('\n');
|
|
46
|
+
}
|
|
47
|
+
/** Title and name from the first JSON object in the answer, or null when it does not fit. */
|
|
48
|
+
export function parseNaming(answer) {
|
|
49
|
+
const start = answer.indexOf('{');
|
|
50
|
+
const end = answer.lastIndexOf('}');
|
|
51
|
+
if (start === -1 || end <= start)
|
|
52
|
+
return null;
|
|
53
|
+
let value;
|
|
54
|
+
try {
|
|
55
|
+
value = JSON.parse(answer.slice(start, end + 1));
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const parsed = namingSchema.safeParse(value);
|
|
61
|
+
if (!parsed.success)
|
|
62
|
+
return null;
|
|
63
|
+
const title = fitTitle(parsed.data.title);
|
|
64
|
+
const name = fitName(parsed.data.name);
|
|
65
|
+
if (title === '' || !RUN_NAME_PATTERN.test(name))
|
|
66
|
+
return null;
|
|
67
|
+
return { title, name };
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=naming.js.map
|
|
@@ -0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CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5F,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,GAAG,IAAI,KAAK;QAAE,OAAO,IAAI,CAAC;IAC9C,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { systemPrompt, userMessage } from './message.js';
|
|
3
|
+
import { PROTECTED_GIT_COMMANDS, } from './types.js';
|
|
4
|
+
import { opencodeErrorText, opencodeTranscript } from './transcript.js';
|
|
5
|
+
export function opencodePermission(context) {
|
|
6
|
+
const { permissions, allowCommands } = context.specialist;
|
|
7
|
+
const protectedRules = Object.fromEntries(PROTECTED_GIT_COMMANDS.map((command) => [`${command}*`, 'deny']));
|
|
8
|
+
if (permissions === 'read')
|
|
9
|
+
return { edit: 'deny', bash: 'deny', webfetch: 'allow' };
|
|
10
|
+
if (permissions === 'edit') {
|
|
11
|
+
return {
|
|
12
|
+
edit: 'allow',
|
|
13
|
+
bash: {
|
|
14
|
+
'*': 'deny',
|
|
15
|
+
...Object.fromEntries(allowCommands.map((pattern) => [pattern, 'allow'])),
|
|
16
|
+
...protectedRules,
|
|
17
|
+
},
|
|
18
|
+
webfetch: 'allow',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return { edit: 'allow', bash: { '*': 'allow', 'git push*': 'deny' }, webfetch: 'allow' };
|
|
22
|
+
}
|
|
23
|
+
export function opencodeAgentName(slug) {
|
|
24
|
+
return `aip-${slug}`;
|
|
25
|
+
}
|
|
26
|
+
function numberAt(value, ...path) {
|
|
27
|
+
let current = value;
|
|
28
|
+
for (const key of path) {
|
|
29
|
+
if (typeof current !== 'object' || current === null)
|
|
30
|
+
return null;
|
|
31
|
+
current = current[key];
|
|
32
|
+
}
|
|
33
|
+
return typeof current === 'number' ? current : null;
|
|
34
|
+
}
|
|
35
|
+
function findSession(value) {
|
|
36
|
+
if (typeof value !== 'object' || value === null)
|
|
37
|
+
return null;
|
|
38
|
+
const record = value;
|
|
39
|
+
for (const key of ['sessionID', 'sessionId', 'session_id']) {
|
|
40
|
+
if (typeof record[key] === 'string')
|
|
41
|
+
return record[key];
|
|
42
|
+
}
|
|
43
|
+
for (const nested of Object.values(record)) {
|
|
44
|
+
const found = findSession(nested);
|
|
45
|
+
if (found)
|
|
46
|
+
return found;
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
function findStepFinish(value) {
|
|
51
|
+
if (typeof value !== 'object' || value === null)
|
|
52
|
+
return null;
|
|
53
|
+
const record = value;
|
|
54
|
+
if ((record.type === 'step-finish' || record.type === 'step_finish') && 'tokens' in record)
|
|
55
|
+
return record;
|
|
56
|
+
for (const nested of Object.values(record)) {
|
|
57
|
+
const found = findStepFinish(nested);
|
|
58
|
+
if (found)
|
|
59
|
+
return found;
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
export function createOpencodeRuntime(executable = 'opencode', extra = { args: [], env: {} }) {
|
|
64
|
+
return {
|
|
65
|
+
name: 'opencode',
|
|
66
|
+
executable,
|
|
67
|
+
builtinTools: [],
|
|
68
|
+
buildOneShot(request) {
|
|
69
|
+
const configPath = join(request.directory, 'opencode.json');
|
|
70
|
+
const agent = 'aip-oneshot';
|
|
71
|
+
const config = {
|
|
72
|
+
$schema: 'https://opencode.ai/config.json',
|
|
73
|
+
agent: {
|
|
74
|
+
[agent]: {
|
|
75
|
+
description: 'aip one-shot question without tools',
|
|
76
|
+
mode: 'primary',
|
|
77
|
+
permission: { edit: 'deny', bash: 'deny', webfetch: 'deny' },
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
command: executable,
|
|
83
|
+
args: [
|
|
84
|
+
...extra.args,
|
|
85
|
+
'run',
|
|
86
|
+
'--format',
|
|
87
|
+
'json',
|
|
88
|
+
'--agent',
|
|
89
|
+
agent,
|
|
90
|
+
'-m',
|
|
91
|
+
request.model,
|
|
92
|
+
request.prompt,
|
|
93
|
+
],
|
|
94
|
+
env: { ...extra.env, OPENCODE_CONFIG: configPath },
|
|
95
|
+
files: [{ path: configPath, content: JSON.stringify(config, null, 2) }],
|
|
96
|
+
sessionId: null,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
buildLaunch(context) {
|
|
100
|
+
const configPath = join(context.attemptDirectory, 'opencode.json');
|
|
101
|
+
const agent = opencodeAgentName(context.specialist.slug);
|
|
102
|
+
const config = {
|
|
103
|
+
$schema: 'https://opencode.ai/config.json',
|
|
104
|
+
mcp: { aip: { type: 'local', command: context.workerCommand, enabled: true } },
|
|
105
|
+
agent: {
|
|
106
|
+
[agent]: {
|
|
107
|
+
description: `aip specialist ${context.specialist.name}`,
|
|
108
|
+
mode: 'primary',
|
|
109
|
+
prompt: systemPrompt(context.specialist, context.input),
|
|
110
|
+
permission: opencodePermission(context),
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
return {
|
|
115
|
+
command: executable,
|
|
116
|
+
args: [
|
|
117
|
+
...extra.args,
|
|
118
|
+
'run',
|
|
119
|
+
'--format',
|
|
120
|
+
'json',
|
|
121
|
+
'--dir',
|
|
122
|
+
context.worktree,
|
|
123
|
+
'--agent',
|
|
124
|
+
agent,
|
|
125
|
+
...(context.specialist.model ? ['-m', context.specialist.model] : []),
|
|
126
|
+
...(context.resumeSession ? ['-s', context.resumeSession] : []),
|
|
127
|
+
...(context.specialist.permissions === 'full' ? ['--auto'] : []),
|
|
128
|
+
userMessage(context.input),
|
|
129
|
+
],
|
|
130
|
+
env: { ...extra.env, OPENCODE_CONFIG: configPath },
|
|
131
|
+
files: [{ path: configPath, content: JSON.stringify(config, null, 2) }],
|
|
132
|
+
sessionId: context.resumeSession,
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
transcript: opencodeTranscript,
|
|
136
|
+
createParser() {
|
|
137
|
+
let sessionId = null;
|
|
138
|
+
let usage = null;
|
|
139
|
+
let error = null;
|
|
140
|
+
return {
|
|
141
|
+
push(line) {
|
|
142
|
+
let value;
|
|
143
|
+
try {
|
|
144
|
+
value = JSON.parse(line);
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
sessionId ??= findSession(value);
|
|
150
|
+
const step = findStepFinish(value);
|
|
151
|
+
if (step) {
|
|
152
|
+
const input = (numberAt(step, 'tokens', 'input') ?? 0) +
|
|
153
|
+
(numberAt(step, 'tokens', 'cache', 'read') ?? 0) +
|
|
154
|
+
(numberAt(step, 'tokens', 'cache', 'write') ?? 0);
|
|
155
|
+
const output = numberAt(step, 'tokens', 'output') ?? 0;
|
|
156
|
+
const cost = numberAt(step, 'cost');
|
|
157
|
+
usage = {
|
|
158
|
+
inputTokens: (usage?.inputTokens ?? 0) + input,
|
|
159
|
+
outputTokens: (usage?.outputTokens ?? 0) + output,
|
|
160
|
+
costUsd: cost === null && usage?.costUsd == null
|
|
161
|
+
? null
|
|
162
|
+
: (usage?.costUsd ?? 0) + (cost ?? 0),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
if (typeof value === 'object' &&
|
|
166
|
+
value !== null &&
|
|
167
|
+
value.type === 'error') {
|
|
168
|
+
error = opencodeErrorText(value.error ?? value).slice(0, 500);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
usage() {
|
|
172
|
+
return usage === null ? null : { ...usage };
|
|
173
|
+
},
|
|
174
|
+
outcome() {
|
|
175
|
+
return { sessionId, usage: usage === null ? null : { ...usage }, error, denials: [] };
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
skillDirectories(worktree, home) {
|
|
180
|
+
return [
|
|
181
|
+
join(home, '.config', 'opencode', 'skills'),
|
|
182
|
+
join(worktree, '.opencode', 'skills'),
|
|
183
|
+
join(home, '.config', 'opencode', 'command'),
|
|
184
|
+
join(worktree, '.opencode', 'command'),
|
|
185
|
+
];
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=opencode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/runtime/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EACL,sBAAsB,GAOvB,MAAM,YAAY,CAAC;AACpB,OAAO,E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AS,CAAC;aACvC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
export function skillCandidates(name, directories) {
|
|
4
|
+
const parts = name.split(':');
|
|
5
|
+
const leaf = parts.at(-1) ?? name;
|
|
6
|
+
const nested = parts.join('/');
|
|
7
|
+
return directories.flatMap((directory) => [
|
|
8
|
+
join(directory, name, 'SKILL.md'),
|
|
9
|
+
join(directory, leaf, 'SKILL.md'),
|
|
10
|
+
join(directory, `${name}.md`),
|
|
11
|
+
join(directory, `${nested}.md`),
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
14
|
+
export function missingSkills(skills, directories) {
|
|
15
|
+
return skills.filter((skill) => !skillCandidates(skill, directories).some((path) => existsSync(path)));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/runtime/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,WAAqB;IACjE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC;QACxC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC;QACjC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC;QACjC,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,KAAK,CAAC;QAC7B,IAAI,CAAC,SAAS,EAAE,GAAG,MAAM,KAAK,CAAC;KAChC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAgB,EAAE,WAAqB;IACnE,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CACjF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { clip } from '../feature/agents/types/index.js';
|
|
2
|
+
function isObject(value) {
|
|
3
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
function parse(line) {
|
|
6
|
+
try {
|
|
7
|
+
return JSON.parse(line);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function text(value) {
|
|
14
|
+
if (typeof value === 'string')
|
|
15
|
+
return value;
|
|
16
|
+
if (Array.isArray(value)) {
|
|
17
|
+
return value
|
|
18
|
+
.map((part) => (isObject(part) && typeof part.text === 'string' ? part.text : ''))
|
|
19
|
+
.filter(Boolean)
|
|
20
|
+
.join('\n');
|
|
21
|
+
}
|
|
22
|
+
return value === undefined || value === null ? '' : JSON.stringify(value);
|
|
23
|
+
}
|
|
24
|
+
function relative(path, cwd) {
|
|
25
|
+
if (cwd && path.startsWith(`${cwd}/`))
|
|
26
|
+
return path.slice(cwd.length + 1);
|
|
27
|
+
return path;
|
|
28
|
+
}
|
|
29
|
+
const PATH_TOOLS = new Set(['read', 'edit', 'write', 'multiedit', 'notebookedit']);
|
|
30
|
+
/** A short description of a tool call: the path, the command or the start of the input. */
|
|
31
|
+
export function toolSummary(name, input, cwd = null) {
|
|
32
|
+
const record = isObject(input) ? input : {};
|
|
33
|
+
const lower = name.toLowerCase();
|
|
34
|
+
const path = record.file_path ?? record.filePath ?? record.notebook_path ?? record.path;
|
|
35
|
+
if (PATH_TOOLS.has(lower) && typeof path === 'string')
|
|
36
|
+
return relative(path, cwd);
|
|
37
|
+
if (lower === 'bash' && typeof record.command === 'string')
|
|
38
|
+
return record.command;
|
|
39
|
+
if ((lower === 'grep' || lower === 'glob') && typeof record.pattern === 'string') {
|
|
40
|
+
return typeof record.path === 'string'
|
|
41
|
+
? `${record.pattern} in ${relative(record.path, cwd)}`
|
|
42
|
+
: record.pattern;
|
|
43
|
+
}
|
|
44
|
+
if (name.endsWith('swarm_report') && typeof record.verdict === 'string')
|
|
45
|
+
return record.verdict;
|
|
46
|
+
const json = JSON.stringify(input ?? {});
|
|
47
|
+
return json.length > 120 ? `${json.slice(0, 119)}…` : json;
|
|
48
|
+
}
|
|
49
|
+
function toolCall(id, name, input, cwd, at) {
|
|
50
|
+
return {
|
|
51
|
+
kind: 'tool_call',
|
|
52
|
+
id: typeof id === 'string' ? id : null,
|
|
53
|
+
name,
|
|
54
|
+
summary: toolSummary(name, input, cwd),
|
|
55
|
+
input: clip(JSON.stringify(input ?? {}, null, 2)),
|
|
56
|
+
at,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const CLAUDE_QUIET = new Set(['system', 'rate_limit_event', 'stream_event']);
|
|
60
|
+
/** Transcript of the `--output-format stream-json` log of Claude Code. */
|
|
61
|
+
export function claudeTranscript(lines, times) {
|
|
62
|
+
const entries = [];
|
|
63
|
+
let cwd = null;
|
|
64
|
+
// A refused call is reported twice: as a permission_denied event and as an error result.
|
|
65
|
+
const denied = new Map();
|
|
66
|
+
for (const [index, line] of lines.entries()) {
|
|
67
|
+
const at = times?.[index] ?? null;
|
|
68
|
+
if (line.trim() === '')
|
|
69
|
+
continue;
|
|
70
|
+
const event = parse(line);
|
|
71
|
+
if (!isObject(event) || typeof event.type !== 'string') {
|
|
72
|
+
entries.push({ kind: 'raw', text: clip(line), at });
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (event.type === 'system') {
|
|
76
|
+
if (event.subtype === 'init' && typeof event.cwd === 'string')
|
|
77
|
+
cwd = event.cwd;
|
|
78
|
+
if (event.subtype === 'permission_denied') {
|
|
79
|
+
if (typeof event.tool_use_id === 'string')
|
|
80
|
+
denied.set(event.tool_use_id, entries.length);
|
|
81
|
+
entries.push({
|
|
82
|
+
kind: 'tool_result',
|
|
83
|
+
id: typeof event.tool_use_id === 'string' ? event.tool_use_id : null,
|
|
84
|
+
text: `permission denied: ${text(event.message ?? event.decision_reason)}`,
|
|
85
|
+
error: true,
|
|
86
|
+
at,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (CLAUDE_QUIET.has(event.type))
|
|
92
|
+
continue;
|
|
93
|
+
if ((event.type === 'assistant' || event.type === 'user') && isObject(event.message)) {
|
|
94
|
+
const content = event.message.content;
|
|
95
|
+
const blocks = Array.isArray(content) ? content : [{ type: 'text', text: text(content) }];
|
|
96
|
+
for (const block of blocks) {
|
|
97
|
+
if (!isObject(block))
|
|
98
|
+
continue;
|
|
99
|
+
if (block.type === 'text' && event.type === 'assistant' && text(block.text).trim()) {
|
|
100
|
+
entries.push({ kind: 'text', text: clip(text(block.text)), at });
|
|
101
|
+
}
|
|
102
|
+
else if (block.type === 'tool_use') {
|
|
103
|
+
entries.push(toolCall(block.id, String(block.name ?? 'tool'), block.input, cwd, at));
|
|
104
|
+
}
|
|
105
|
+
else if (block.type === 'tool_result') {
|
|
106
|
+
const id = typeof block.tool_use_id === 'string' ? block.tool_use_id : null;
|
|
107
|
+
const earlier = id !== null ? denied.get(id) : undefined;
|
|
108
|
+
if (earlier !== undefined && block.is_error === true) {
|
|
109
|
+
entries[earlier] = {
|
|
110
|
+
kind: 'tool_result',
|
|
111
|
+
id,
|
|
112
|
+
text: clip(`permission denied: ${text(block.content)}`),
|
|
113
|
+
error: true,
|
|
114
|
+
at,
|
|
115
|
+
};
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
entries.push({
|
|
119
|
+
kind: 'tool_result',
|
|
120
|
+
id: typeof block.tool_use_id === 'string' ? block.tool_use_id : null,
|
|
121
|
+
text: clip(text(block.content)),
|
|
122
|
+
error: block.is_error === true,
|
|
123
|
+
at,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (event.type === 'result') {
|
|
130
|
+
const usage = isObject(event.usage) ? event.usage : {};
|
|
131
|
+
const input = ['input_tokens', 'cache_creation_input_tokens', 'cache_read_input_tokens']
|
|
132
|
+
.map((key) => (typeof usage[key] === 'number' ? usage[key] : 0))
|
|
133
|
+
.reduce((sum, value) => sum + value, 0);
|
|
134
|
+
entries.push({
|
|
135
|
+
kind: 'result',
|
|
136
|
+
text: typeof event.result === 'string' ? clip(event.result) : null,
|
|
137
|
+
error: event.is_error === true,
|
|
138
|
+
verdict: null,
|
|
139
|
+
inputTokens: isObject(event.usage) ? input : null,
|
|
140
|
+
outputTokens: typeof usage.output_tokens === 'number' ? usage.output_tokens : null,
|
|
141
|
+
costUsd: typeof event.total_cost_usd === 'number' ? event.total_cost_usd : null,
|
|
142
|
+
at,
|
|
143
|
+
});
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
entries.push({ kind: 'raw', text: clip(line), at });
|
|
147
|
+
}
|
|
148
|
+
return entries;
|
|
149
|
+
}
|
|
150
|
+
/** Readable text of an `error` event of OpenCode: the message, not the response headers. */
|
|
151
|
+
export function opencodeErrorText(error) {
|
|
152
|
+
if (isObject(error)) {
|
|
153
|
+
const data = isObject(error.data) ? error.data : {};
|
|
154
|
+
for (const candidate of [data.message, error.message, error.name]) {
|
|
155
|
+
if (typeof candidate === 'string' && candidate !== '')
|
|
156
|
+
return candidate;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return typeof error === 'string' ? error : JSON.stringify(error);
|
|
160
|
+
}
|
|
161
|
+
const OPENCODE_QUIET = new Set(['step_start', 'step-start']);
|
|
162
|
+
/** Transcript of the `run --format json` log of OpenCode. */
|
|
163
|
+
export function opencodeTranscript(lines, times) {
|
|
164
|
+
const entries = [];
|
|
165
|
+
for (const [index, line] of lines.entries()) {
|
|
166
|
+
const at = times?.[index] ?? null;
|
|
167
|
+
if (line.trim() === '')
|
|
168
|
+
continue;
|
|
169
|
+
const event = parse(line);
|
|
170
|
+
if (!isObject(event)) {
|
|
171
|
+
entries.push({ kind: 'raw', text: clip(line), at });
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
const part = isObject(event.part) ? event.part : event;
|
|
175
|
+
const type = String(part.type ?? event.type ?? '');
|
|
176
|
+
if (OPENCODE_QUIET.has(type))
|
|
177
|
+
continue;
|
|
178
|
+
if (type === 'text' && typeof part.text === 'string') {
|
|
179
|
+
if (part.text.trim())
|
|
180
|
+
entries.push({ kind: 'text', text: clip(part.text), at });
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (type === 'tool' || type === 'tool_use') {
|
|
184
|
+
const name = String(part.tool ?? part.name ?? 'tool');
|
|
185
|
+
const state = isObject(part.state) ? part.state : {};
|
|
186
|
+
const id = part.callID ?? part.id ?? null;
|
|
187
|
+
entries.push(toolCall(id, name, state.input ?? part.input, null, at));
|
|
188
|
+
if (state.output !== undefined || state.error !== undefined) {
|
|
189
|
+
entries.push({
|
|
190
|
+
kind: 'tool_result',
|
|
191
|
+
id: typeof id === 'string' ? id : null,
|
|
192
|
+
text: clip(text(state.error ?? state.output)),
|
|
193
|
+
error: state.status === 'error' || state.error !== undefined,
|
|
194
|
+
at,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (type === 'step_finish' || type === 'step-finish') {
|
|
200
|
+
const tokens = isObject(part.tokens) ? part.tokens : {};
|
|
201
|
+
entries.push({
|
|
202
|
+
kind: 'result',
|
|
203
|
+
text: null,
|
|
204
|
+
error: false,
|
|
205
|
+
verdict: null,
|
|
206
|
+
inputTokens: typeof tokens.input === 'number' ? tokens.input : null,
|
|
207
|
+
outputTokens: typeof tokens.output === 'number' ? tokens.output : null,
|
|
208
|
+
costUsd: typeof part.cost === 'number' ? part.cost : null,
|
|
209
|
+
at,
|
|
210
|
+
});
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
if (type === 'error' || event.type === 'error') {
|
|
214
|
+
entries.push({
|
|
215
|
+
kind: 'tool_result',
|
|
216
|
+
id: null,
|
|
217
|
+
text: clip(opencodeErrorText(event.error ?? part)),
|
|
218
|
+
error: true,
|
|
219
|
+
at,
|
|
220
|
+
});
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
entries.push({ kind: 'raw', text: clip(line), at });
|
|
224
|
+
}
|
|
225
|
+
return entries;
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=transcript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript.js","sourceRoot":"","sources":["../../src/runtime/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAwB,MAAM,kCAAkC,CAAC;AAI9E,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,KAAK,CAAC,IAAY;IACzB,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,IAAI,CAAC,KAAc;IAC1B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK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