smol-symphony 0.2.0 → 0.3.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/AGENTS.md +41 -22
- package/DESIGN.md +494 -273
- package/README.md +109 -57
- package/SPEC.md +33 -24
- package/WORKFLOW.minimal.yaml +34 -0
- package/{WORKFLOW.template.md → WORKFLOW.template.yaml} +409 -256
- package/WORKFLOW.yaml +487 -0
- package/assets/skills/symphony-issues/SKILL.md +136 -0
- package/assets/symphony-mise.system.toml +68 -0
- package/dist/src/bin/symphony.js +30 -0
- package/dist/src/bin/symphony.js.map +1 -0
- package/dist/src/core/actions/context.js +109 -0
- package/dist/src/core/actions/context.js.map +1 -0
- package/dist/{actions/parsing.js → src/core/actions/parse.js} +33 -114
- package/dist/src/core/actions/parse.js.map +1 -0
- package/dist/src/core/actions/plan.js +197 -0
- package/dist/src/core/actions/plan.js.map +1 -0
- package/dist/src/core/actions/predicates.js +111 -0
- package/dist/src/core/actions/predicates.js.map +1 -0
- package/dist/src/core/actions/run-fold.js +248 -0
- package/dist/src/core/actions/run-fold.js.map +1 -0
- package/dist/src/core/actions/template.js +118 -0
- package/dist/src/core/actions/template.js.map +1 -0
- package/dist/src/core/cli/args.js +116 -0
- package/dist/src/core/cli/args.js.map +1 -0
- package/dist/src/core/coerce.js +75 -0
- package/dist/src/core/coerce.js.map +1 -0
- package/dist/src/core/credential/account-id.js +20 -0
- package/dist/src/core/credential/account-id.js.map +1 -0
- package/dist/src/core/credential/adapter-config.js +136 -0
- package/dist/src/core/credential/adapter-config.js.map +1 -0
- package/dist/src/core/credential/availability.js +98 -0
- package/dist/src/core/credential/availability.js.map +1 -0
- package/dist/src/core/credential/extract.js +228 -0
- package/dist/src/core/credential/extract.js.map +1 -0
- package/dist/src/core/credential/fake-creds.js +171 -0
- package/dist/src/core/credential/fake-creds.js.map +1 -0
- package/dist/src/core/credential/identity.js +125 -0
- package/dist/src/core/credential/identity.js.map +1 -0
- package/dist/src/core/credential/shape.js +230 -0
- package/dist/src/core/credential/shape.js.map +1 -0
- package/dist/src/core/credential/strings.js +15 -0
- package/dist/src/core/credential/strings.js.map +1 -0
- package/dist/src/core/doctor/checks.js +303 -0
- package/dist/src/core/doctor/checks.js.map +1 -0
- package/dist/src/core/git/result.js +107 -0
- package/dist/src/core/git/result.js.map +1 -0
- package/dist/src/core/http/decisions.js +225 -0
- package/dist/src/core/http/decisions.js.map +1 -0
- package/dist/{http.js → src/core/http/render.js} +472 -738
- package/dist/src/core/http/render.js.map +1 -0
- package/dist/{http-handlers.js → src/core/http/routes.js} +52 -87
- package/dist/src/core/http/routes.js.map +1 -0
- package/dist/src/core/http/views.js +181 -0
- package/dist/src/core/http/views.js.map +1 -0
- package/dist/src/core/image/managed-image.js +95 -0
- package/dist/src/core/image/managed-image.js.map +1 -0
- package/dist/src/core/issue/file.js +149 -0
- package/dist/src/core/issue/file.js.map +1 -0
- package/dist/src/core/issue/parse.js +210 -0
- package/dist/src/core/issue/parse.js.map +1 -0
- package/dist/src/core/mcp/dispatch.js +239 -0
- package/dist/src/core/mcp/dispatch.js.map +1 -0
- package/dist/src/core/mcp/post-move.js +92 -0
- package/dist/src/core/mcp/post-move.js.map +1 -0
- package/dist/src/core/mcp/protocol.js +293 -0
- package/dist/src/core/mcp/protocol.js.map +1 -0
- package/dist/src/core/mcp/url.js +162 -0
- package/dist/src/core/mcp/url.js.map +1 -0
- package/dist/src/core/path.js +63 -0
- package/dist/src/core/path.js.map +1 -0
- package/dist/src/core/reconcile/image-decide.js +48 -0
- package/dist/src/core/reconcile/image-decide.js.map +1 -0
- package/dist/src/core/reconcile/ledger.js +142 -0
- package/dist/src/core/reconcile/ledger.js.map +1 -0
- package/dist/src/core/reconcile/pr-classify.js +62 -0
- package/dist/src/core/reconcile/pr-classify.js.map +1 -0
- package/dist/{reconciler → src/core/reconcile}/pr-decide.js +25 -12
- package/dist/src/core/reconcile/pr-decide.js.map +1 -0
- package/dist/src/core/reconcile/pr-loop.js +161 -0
- package/dist/src/core/reconcile/pr-loop.js.map +1 -0
- package/dist/src/core/reconcile/pr-notes.js +35 -0
- package/dist/src/core/reconcile/pr-notes.js.map +1 -0
- package/dist/src/core/reconcile/vm-decide.js +70 -0
- package/dist/src/core/reconcile/vm-decide.js.map +1 -0
- package/dist/src/core/reconcile/vm-reap.js +207 -0
- package/dist/src/core/reconcile/vm-reap.js.map +1 -0
- package/dist/src/core/reconcile/workspace-decide.js +162 -0
- package/dist/src/core/reconcile/workspace-decide.js.map +1 -0
- package/dist/src/core/runlog/summary.js +231 -0
- package/dist/src/core/runlog/summary.js.map +1 -0
- package/dist/src/core/runner/dispatch-config.js +95 -0
- package/dist/src/core/runner/dispatch-config.js.map +1 -0
- package/dist/src/core/runner/injection.js +61 -0
- package/dist/src/core/runner/injection.js.map +1 -0
- package/dist/src/core/runner/mise.js +210 -0
- package/dist/src/core/runner/mise.js.map +1 -0
- package/dist/src/core/runner/prompt.js +720 -0
- package/dist/src/core/runner/prompt.js.map +1 -0
- package/dist/src/core/runner/turn.js +242 -0
- package/dist/src/core/runner/turn.js.map +1 -0
- package/dist/src/core/runner/vm-plan.js +390 -0
- package/dist/src/core/runner/vm-plan.js.map +1 -0
- package/dist/src/core/schedule/admission.js +123 -0
- package/dist/src/core/schedule/admission.js.map +1 -0
- package/dist/src/core/schedule/circuit-breaker.js +111 -0
- package/dist/src/core/schedule/circuit-breaker.js.map +1 -0
- package/dist/src/core/schedule/eligibility.js +83 -0
- package/dist/src/core/schedule/eligibility.js.map +1 -0
- package/dist/src/core/schedule/reconcile-issue.js +82 -0
- package/dist/src/core/schedule/reconcile-issue.js.map +1 -0
- package/dist/src/core/schedule/retry.js +96 -0
- package/dist/src/core/schedule/retry.js.map +1 -0
- package/dist/src/core/schedule/sleep-cycle.js +133 -0
- package/dist/src/core/schedule/sleep-cycle.js.map +1 -0
- package/dist/src/core/schedule/slots.js +124 -0
- package/dist/src/core/schedule/slots.js.map +1 -0
- package/dist/src/core/schedule/tick.js +553 -0
- package/dist/src/core/schedule/tick.js.map +1 -0
- package/dist/src/core/schedule/token-fold.js +181 -0
- package/dist/src/core/schedule/token-fold.js.map +1 -0
- package/dist/src/core/state-resolve.js +86 -0
- package/dist/src/core/state-resolve.js.map +1 -0
- package/dist/src/core/vm-guards.js +278 -0
- package/dist/src/core/vm-guards.js.map +1 -0
- package/dist/src/core/workflow/derive.js +107 -0
- package/dist/src/core/workflow/derive.js.map +1 -0
- package/dist/src/core/workflow/parse.js +687 -0
- package/dist/src/core/workflow/parse.js.map +1 -0
- package/dist/src/core/workflow/prompt-probe.js +78 -0
- package/dist/src/core/workflow/prompt-probe.js.map +1 -0
- package/dist/src/core/workflow/validate.js +189 -0
- package/dist/src/core/workflow/validate.js.map +1 -0
- package/dist/src/core/workspace-key.js +19 -0
- package/dist/src/core/workspace-key.js.map +1 -0
- package/dist/src/shell/actions-runner.js +356 -0
- package/dist/src/shell/actions-runner.js.map +1 -0
- package/dist/src/shell/adapter/adapter-registry.js +45 -0
- package/dist/src/shell/adapter/adapter-registry.js.map +1 -0
- package/dist/src/shell/adapter/clock-random.js +96 -0
- package/dist/src/shell/adapter/clock-random.js.map +1 -0
- package/dist/src/shell/adapter/gondolin-dispatch-helpers.js +158 -0
- package/dist/src/shell/adapter/gondolin-dispatch-helpers.js.map +1 -0
- package/dist/src/shell/adapter/gondolin-dispatch.js +385 -0
- package/dist/src/shell/adapter/gondolin-dispatch.js.map +1 -0
- package/dist/src/shell/adapter/gondolin-image-converter.js +233 -0
- package/dist/src/shell/adapter/gondolin-image-converter.js.map +1 -0
- package/dist/src/shell/adapter/gondolin-image-fetch.js +180 -0
- package/dist/src/shell/adapter/gondolin-image-fetch.js.map +1 -0
- package/dist/src/shell/adapter/launcher-asset.js +57 -0
- package/dist/src/shell/adapter/launcher-asset.js.map +1 -0
- package/dist/src/shell/adapter/mise-config-asset.js +65 -0
- package/dist/src/shell/adapter/mise-config-asset.js.map +1 -0
- package/dist/src/shell/adapter/workflow-loader.js +304 -0
- package/dist/src/shell/adapter/workflow-loader.js.map +1 -0
- package/dist/src/shell/cli/doctor.js +268 -0
- package/dist/src/shell/cli/doctor.js.map +1 -0
- package/dist/src/shell/effect-interpreter-families.js +314 -0
- package/dist/src/shell/effect-interpreter-families.js.map +1 -0
- package/dist/src/shell/effect-interpreter.js +29 -0
- package/dist/src/shell/effect-interpreter.js.map +1 -0
- package/dist/src/shell/interp/acp-frame.js +137 -0
- package/dist/src/shell/interp/acp-frame.js.map +1 -0
- package/dist/src/shell/interp/acp-ws-conn.js +320 -0
- package/dist/src/shell/interp/acp-ws-conn.js.map +1 -0
- package/dist/src/shell/interp/acp-ws-frames.js +159 -0
- package/dist/src/shell/interp/acp-ws-frames.js.map +1 -0
- package/dist/src/shell/interp/acp-ws.js +197 -0
- package/dist/src/shell/interp/acp-ws.js.map +1 -0
- package/dist/src/shell/interp/acp.js +319 -0
- package/dist/src/shell/interp/acp.js.map +1 -0
- package/dist/src/shell/interp/credential-defaults.js +128 -0
- package/dist/src/shell/interp/credential-defaults.js.map +1 -0
- package/dist/src/shell/interp/credential-hooks.js +149 -0
- package/dist/src/shell/interp/credential-hooks.js.map +1 -0
- package/dist/src/shell/interp/credential-registry.js +226 -0
- package/dist/src/shell/interp/credential-registry.js.map +1 -0
- package/dist/src/shell/interp/credential.js +103 -0
- package/dist/src/shell/interp/credential.js.map +1 -0
- package/dist/src/shell/interp/gh.js +163 -0
- package/dist/src/shell/interp/gh.js.map +1 -0
- package/dist/src/shell/interp/git.js +28 -0
- package/dist/src/shell/interp/git.js.map +1 -0
- package/dist/src/shell/interp/log.js +213 -0
- package/dist/src/shell/interp/log.js.map +1 -0
- package/dist/src/shell/interp/process.js +178 -0
- package/dist/src/shell/interp/process.js.map +1 -0
- package/dist/src/shell/interp/runlog.js +193 -0
- package/dist/src/shell/interp/runlog.js.map +1 -0
- package/dist/src/shell/interp/timer.js +64 -0
- package/dist/src/shell/interp/timer.js.map +1 -0
- package/dist/src/shell/interp/tracker-disk.js +99 -0
- package/dist/src/shell/interp/tracker-disk.js.map +1 -0
- package/dist/src/shell/interp/tracker-parse.js +71 -0
- package/dist/src/shell/interp/tracker-parse.js.map +1 -0
- package/dist/src/shell/interp/tracker-scan.js +238 -0
- package/dist/src/shell/interp/tracker-scan.js.map +1 -0
- package/dist/src/shell/interp/tracker-write.js +91 -0
- package/dist/src/shell/interp/tracker-write.js.map +1 -0
- package/dist/src/shell/interp/tracker.js +41 -0
- package/dist/src/shell/interp/tracker.js.map +1 -0
- package/dist/src/shell/interp/tty.js +48 -0
- package/dist/src/shell/interp/tty.js.map +1 -0
- package/dist/src/shell/interp/vm.js +199 -0
- package/dist/src/shell/interp/vm.js.map +1 -0
- package/dist/src/shell/interp/workspace.js +310 -0
- package/dist/src/shell/interp/workspace.js.map +1 -0
- package/dist/src/shell/main-acp.js +78 -0
- package/dist/src/shell/main-acp.js.map +1 -0
- package/dist/src/shell/main-adapters.js +222 -0
- package/dist/src/shell/main-adapters.js.map +1 -0
- package/dist/src/shell/main-credential.js +122 -0
- package/dist/src/shell/main-credential.js.map +1 -0
- package/dist/src/shell/main-doctor.js +22 -0
- package/dist/src/shell/main-doctor.js.map +1 -0
- package/dist/src/shell/main-entry.js +46 -0
- package/dist/src/shell/main-entry.js.map +1 -0
- package/dist/src/shell/main-http-csrf.js +45 -0
- package/dist/src/shell/main-http-csrf.js.map +1 -0
- package/dist/src/shell/main-http-handler.js +389 -0
- package/dist/src/shell/main-http-handler.js.map +1 -0
- package/dist/src/shell/main-http-mcp.js +122 -0
- package/dist/src/shell/main-http-mcp.js.map +1 -0
- package/dist/src/shell/main-http-views.js +253 -0
- package/dist/src/shell/main-http-views.js.map +1 -0
- package/dist/src/shell/main-http.js +76 -0
- package/dist/src/shell/main-http.js.map +1 -0
- package/dist/src/shell/main-loops.js +130 -0
- package/dist/src/shell/main-loops.js.map +1 -0
- package/dist/src/shell/main-mcp.js +129 -0
- package/dist/src/shell/main-mcp.js.map +1 -0
- package/dist/src/shell/main-orchestrator.js +120 -0
- package/dist/src/shell/main-orchestrator.js.map +1 -0
- package/dist/src/shell/main-preflight.js +43 -0
- package/dist/src/shell/main-preflight.js.map +1 -0
- package/dist/src/shell/main-reconcilers-helpers.js +244 -0
- package/dist/src/shell/main-reconcilers-helpers.js.map +1 -0
- package/dist/src/shell/main-reconcilers-pr.js +148 -0
- package/dist/src/shell/main-reconcilers-pr.js.map +1 -0
- package/dist/src/shell/main-reconcilers.js +225 -0
- package/dist/src/shell/main-reconcilers.js.map +1 -0
- package/dist/src/shell/main-runner.js +355 -0
- package/dist/src/shell/main-runner.js.map +1 -0
- package/dist/src/shell/main-scaffold.js +116 -0
- package/dist/src/shell/main-scaffold.js.map +1 -0
- package/dist/src/shell/main-shutdown.js +115 -0
- package/dist/src/shell/main-shutdown.js.map +1 -0
- package/dist/src/shell/main-startup.js +48 -0
- package/dist/src/shell/main-startup.js.map +1 -0
- package/dist/src/shell/main-substrates.js +43 -0
- package/dist/src/shell/main-substrates.js.map +1 -0
- package/dist/src/shell/main.js +385 -0
- package/dist/src/shell/main.js.map +1 -0
- package/dist/src/shell/orchestrator-feedback.js +69 -0
- package/dist/src/shell/orchestrator-feedback.js.map +1 -0
- package/dist/src/shell/orchestrator-image.js +167 -0
- package/dist/src/shell/orchestrator-image.js.map +1 -0
- package/dist/src/shell/orchestrator-loop.js +468 -0
- package/dist/src/shell/orchestrator-loop.js.map +1 -0
- package/dist/src/shell/orchestrator-reconcile.js +36 -0
- package/dist/src/shell/orchestrator-reconcile.js.map +1 -0
- package/dist/src/shell/reconciler-loop.js +228 -0
- package/dist/src/shell/reconciler-loop.js.map +1 -0
- package/dist/src/shell/runner-loop-turn.js +301 -0
- package/dist/src/shell/runner-loop-turn.js.map +1 -0
- package/dist/src/shell/runner-loop.js +338 -0
- package/dist/src/shell/runner-loop.js.map +1 -0
- package/dist/src/shell/server/http.js +208 -0
- package/dist/src/shell/server/http.js.map +1 -0
- package/dist/src/shell/server/mcp-runtime-effects.js +237 -0
- package/dist/src/shell/server/mcp-runtime-effects.js.map +1 -0
- package/dist/src/shell/server/mcp-runtime.js +99 -0
- package/dist/src/shell/server/mcp-runtime.js.map +1 -0
- package/dist/src/shell/workspace-key.js +14 -0
- package/dist/src/shell/workspace-key.js.map +1 -0
- package/dist/src/types/acp.js +8 -0
- package/dist/src/types/acp.js.map +1 -0
- package/dist/src/types/actions/plan.js +6 -0
- package/dist/src/types/actions/plan.js.map +1 -0
- package/dist/src/types/actions/predicates.js +6 -0
- package/dist/src/types/actions/predicates.js.map +1 -0
- package/dist/src/types/actions/run-fold.js +8 -0
- package/dist/src/types/actions/run-fold.js.map +1 -0
- package/dist/src/types/actions.js +7 -0
- package/dist/src/types/actions.js.map +1 -0
- package/dist/src/types/adapter/clock-random.js +4 -0
- package/dist/src/types/adapter/clock-random.js.map +1 -0
- package/dist/src/types/adapter/gondolin-image-converter.js +5 -0
- package/dist/src/types/adapter/gondolin-image-converter.js.map +1 -0
- package/dist/src/types/adapter/gondolin-image-fetch.js +5 -0
- package/dist/src/types/adapter/gondolin-image-fetch.js.map +1 -0
- package/dist/src/types/adapter/workflow-loader.js +4 -0
- package/dist/src/types/adapter/workflow-loader.js.map +1 -0
- package/dist/src/types/cli/args.js +8 -0
- package/dist/src/types/cli/args.js.map +1 -0
- package/dist/src/types/config.js +8 -0
- package/dist/src/types/config.js.map +1 -0
- package/dist/src/types/credential-interp.js +6 -0
- package/dist/src/types/credential-interp.js.map +1 -0
- package/dist/src/types/credentials.js +10 -0
- package/dist/src/types/credentials.js.map +1 -0
- package/dist/src/types/doctor.js +7 -0
- package/dist/src/types/doctor.js.map +1 -0
- package/dist/src/types/domain.js +7 -0
- package/dist/src/types/domain.js.map +1 -0
- package/dist/src/types/effect.js +15 -0
- package/dist/src/types/effect.js.map +1 -0
- package/dist/src/types/errors.js +39 -0
- package/dist/src/types/errors.js.map +1 -0
- package/dist/src/types/http/decisions.js +6 -0
- package/dist/src/types/http/decisions.js.map +1 -0
- package/dist/src/types/http/render.js +10 -0
- package/dist/src/types/http/render.js.map +1 -0
- package/dist/src/types/http/views.js +6 -0
- package/dist/src/types/http/views.js.map +1 -0
- package/dist/src/types/http.js +9 -0
- package/dist/src/types/http.js.map +1 -0
- package/dist/src/types/image/managed-image.js +7 -0
- package/dist/src/types/image/managed-image.js.map +1 -0
- package/dist/src/types/interp/effect-interpreter.js +8 -0
- package/dist/src/types/interp/effect-interpreter.js.map +1 -0
- package/dist/src/types/interp/tracker.js +7 -0
- package/dist/src/types/interp/tracker.js.map +1 -0
- package/dist/src/types/issue/file.js +6 -0
- package/dist/src/types/issue/file.js.map +1 -0
- package/dist/src/types/issue/parse.js +8 -0
- package/dist/src/types/issue/parse.js.map +1 -0
- package/dist/src/types/main-acp.js +13 -0
- package/dist/src/types/main-acp.js.map +1 -0
- package/dist/src/types/main-adapters.js +5 -0
- package/dist/src/types/main-adapters.js.map +1 -0
- package/dist/src/types/main-credential.js +21 -0
- package/dist/src/types/main-credential.js.map +1 -0
- package/dist/src/types/main-doctor.js +6 -0
- package/dist/src/types/main-doctor.js.map +1 -0
- package/dist/src/types/main-http-handler.js +12 -0
- package/dist/src/types/main-http-handler.js.map +1 -0
- package/dist/src/types/main-http.js +5 -0
- package/dist/src/types/main-http.js.map +1 -0
- package/dist/src/types/main-loops.js +5 -0
- package/dist/src/types/main-loops.js.map +1 -0
- package/dist/src/types/main-mcp.js +12 -0
- package/dist/src/types/main-mcp.js.map +1 -0
- package/dist/src/types/main-orchestrator.js +5 -0
- package/dist/src/types/main-orchestrator.js.map +1 -0
- package/dist/src/types/main-reconcilers.js +11 -0
- package/dist/src/types/main-reconcilers.js.map +1 -0
- package/dist/src/types/main-runner.js +13 -0
- package/dist/src/types/main-runner.js.map +1 -0
- package/dist/src/types/main-startup.js +5 -0
- package/dist/src/types/main-startup.js.map +1 -0
- package/dist/src/types/main-substrates.js +5 -0
- package/dist/src/types/main-substrates.js.map +1 -0
- package/dist/src/types/mcp/dispatch.js +4 -0
- package/dist/src/types/mcp/dispatch.js.map +1 -0
- package/dist/src/types/mcp/post-move.js +7 -0
- package/dist/src/types/mcp/post-move.js.map +1 -0
- package/dist/src/types/mcp.js +9 -0
- package/dist/src/types/mcp.js.map +1 -0
- package/dist/src/types/ports.js +12 -0
- package/dist/src/types/ports.js.map +1 -0
- package/dist/src/types/reconcile/image-decide.js +5 -0
- package/dist/src/types/reconcile/image-decide.js.map +1 -0
- package/dist/src/types/reconcile/ledger.js +7 -0
- package/dist/src/types/reconcile/ledger.js.map +1 -0
- package/dist/src/types/reconcile/pr-loop.js +8 -0
- package/dist/src/types/reconcile/pr-loop.js.map +1 -0
- package/dist/src/types/reconcile/vm-reap.js +8 -0
- package/dist/src/types/reconcile/vm-reap.js.map +1 -0
- package/dist/src/types/reconcile/workspace-decide.js +7 -0
- package/dist/src/types/reconcile/workspace-decide.js.map +1 -0
- package/dist/src/types/reconcile.js +9 -0
- package/dist/src/types/reconcile.js.map +1 -0
- package/dist/src/types/runlog.js +7 -0
- package/dist/src/types/runlog.js.map +1 -0
- package/dist/src/types/runner/actions-runner.js +12 -0
- package/dist/src/types/runner/actions-runner.js.map +1 -0
- package/dist/src/types/runner/gondolin-dispatch.js +5 -0
- package/dist/src/types/runner/gondolin-dispatch.js.map +1 -0
- package/dist/src/types/runner/injection.js +6 -0
- package/dist/src/types/runner/injection.js.map +1 -0
- package/dist/src/types/runner/runner-loop.js +5 -0
- package/dist/src/types/runner/runner-loop.js.map +1 -0
- package/dist/src/types/runner/turn.js +4 -0
- package/dist/src/types/runner/turn.js.map +1 -0
- package/dist/src/types/runner/vm-plan.js +4 -0
- package/dist/src/types/runner/vm-plan.js.map +1 -0
- package/dist/src/types/runtime.js +9 -0
- package/dist/src/types/runtime.js.map +1 -0
- package/dist/src/types/schedule/admission.js +7 -0
- package/dist/src/types/schedule/admission.js.map +1 -0
- package/dist/src/types/schedule/circuit-breaker.js +2 -0
- package/dist/src/types/schedule/circuit-breaker.js.map +1 -0
- package/dist/src/types/schedule/eligibility.js +9 -0
- package/dist/src/types/schedule/eligibility.js.map +1 -0
- package/dist/src/types/schedule/orchestrator-loop.js +10 -0
- package/dist/src/types/schedule/orchestrator-loop.js.map +1 -0
- package/dist/src/types/schedule/sleep-cycle.js +4 -0
- package/dist/src/types/schedule/sleep-cycle.js.map +1 -0
- package/dist/src/types/schedule/slots.js +8 -0
- package/dist/src/types/schedule/slots.js.map +1 -0
- package/dist/src/types/schedule/tick.js +9 -0
- package/dist/src/types/schedule/tick.js.map +1 -0
- package/dist/src/types/server/mcp-runtime.js +8 -0
- package/dist/src/types/server/mcp-runtime.js.map +1 -0
- package/dist/src/types/workflow/parse.js +4 -0
- package/dist/src/types/workflow/parse.js.map +1 -0
- package/dist/tests/core/account-id.test.js +35 -0
- package/dist/tests/core/account-id.test.js.map +1 -0
- package/dist/tests/core/actions-parse.test.js +176 -0
- package/dist/tests/core/actions-parse.test.js.map +1 -0
- package/dist/tests/core/adapter-config.test.js +133 -0
- package/dist/tests/core/adapter-config.test.js.map +1 -0
- package/dist/tests/core/admission.test.js +215 -0
- package/dist/tests/core/admission.test.js.map +1 -0
- package/dist/tests/core/args.test.js +132 -0
- package/dist/tests/core/args.test.js.map +1 -0
- package/dist/tests/core/availability.test.js +62 -0
- package/dist/tests/core/availability.test.js.map +1 -0
- package/dist/tests/core/checks.test.js +395 -0
- package/dist/tests/core/checks.test.js.map +1 -0
- package/dist/tests/core/circuit-breaker.test.js +172 -0
- package/dist/tests/core/circuit-breaker.test.js.map +1 -0
- package/dist/tests/core/coerce.test.js +87 -0
- package/dist/tests/core/coerce.test.js.map +1 -0
- package/dist/tests/core/context.test.js +228 -0
- package/dist/tests/core/context.test.js.map +1 -0
- package/dist/tests/core/decisions.test.js +310 -0
- package/dist/tests/core/decisions.test.js.map +1 -0
- package/dist/tests/core/derive.test.js +205 -0
- package/dist/tests/core/derive.test.js.map +1 -0
- package/dist/tests/core/dispatch-config.test.js +164 -0
- package/dist/tests/core/dispatch-config.test.js.map +1 -0
- package/dist/tests/core/dispatch.test.js +302 -0
- package/dist/tests/core/dispatch.test.js.map +1 -0
- package/dist/tests/core/eligibility.test.js +163 -0
- package/dist/tests/core/eligibility.test.js.map +1 -0
- package/dist/tests/core/extract.test.js +139 -0
- package/dist/tests/core/extract.test.js.map +1 -0
- package/dist/tests/core/fake-creds.test.js +134 -0
- package/dist/tests/core/fake-creds.test.js.map +1 -0
- package/dist/tests/core/file.test.js +197 -0
- package/dist/tests/core/file.test.js.map +1 -0
- package/dist/tests/core/git-result.test.js +113 -0
- package/dist/tests/core/git-result.test.js.map +1 -0
- package/dist/tests/core/identity.test.js +180 -0
- package/dist/tests/core/identity.test.js.map +1 -0
- package/dist/tests/core/image-decide.test.js +59 -0
- package/dist/tests/core/image-decide.test.js.map +1 -0
- package/dist/tests/core/injection.test.js +163 -0
- package/dist/tests/core/injection.test.js.map +1 -0
- package/dist/tests/core/ledger.test.js +218 -0
- package/dist/tests/core/ledger.test.js.map +1 -0
- package/dist/tests/core/managed-image.test.js +68 -0
- package/dist/tests/core/managed-image.test.js.map +1 -0
- package/dist/tests/core/mise.test.js +138 -0
- package/dist/tests/core/mise.test.js.map +1 -0
- package/dist/tests/core/parse.test.js +174 -0
- package/dist/tests/core/parse.test.js.map +1 -0
- package/dist/tests/core/path.test.js +50 -0
- package/dist/tests/core/path.test.js.map +1 -0
- package/dist/tests/core/plan.test.js +218 -0
- package/dist/tests/core/plan.test.js.map +1 -0
- package/dist/tests/core/post-move.test.js +162 -0
- package/dist/tests/core/post-move.test.js.map +1 -0
- package/dist/tests/core/pr-classify.test.js +117 -0
- package/dist/tests/core/pr-classify.test.js.map +1 -0
- package/dist/tests/core/pr-decide.test.js +298 -0
- package/dist/tests/core/pr-decide.test.js.map +1 -0
- package/dist/tests/core/pr-loop.test.js +301 -0
- package/dist/tests/core/pr-loop.test.js.map +1 -0
- package/dist/tests/core/pr-notes.test.js +165 -0
- package/dist/tests/core/pr-notes.test.js.map +1 -0
- package/dist/tests/core/predicates.test.js +154 -0
- package/dist/tests/core/predicates.test.js.map +1 -0
- package/dist/tests/core/prompt.test.js +189 -0
- package/dist/tests/core/prompt.test.js.map +1 -0
- package/dist/tests/core/protocol.test.js +195 -0
- package/dist/tests/core/protocol.test.js.map +1 -0
- package/dist/tests/core/reconcile-issue.test.js +116 -0
- package/dist/tests/core/reconcile-issue.test.js.map +1 -0
- package/dist/tests/core/render.test.js +549 -0
- package/dist/tests/core/render.test.js.map +1 -0
- package/dist/tests/core/retry.test.js +186 -0
- package/dist/tests/core/retry.test.js.map +1 -0
- package/dist/tests/core/routes.test.js +247 -0
- package/dist/tests/core/routes.test.js.map +1 -0
- package/dist/tests/core/run-fold.test.js +299 -0
- package/dist/tests/core/run-fold.test.js.map +1 -0
- package/dist/tests/core/shape.test.js +185 -0
- package/dist/tests/core/shape.test.js.map +1 -0
- package/dist/tests/core/sleep-cycle.test.js +150 -0
- package/dist/tests/core/sleep-cycle.test.js.map +1 -0
- package/dist/tests/core/slots.test.js +201 -0
- package/dist/tests/core/slots.test.js.map +1 -0
- package/dist/tests/core/state-resolve.test.js +80 -0
- package/dist/tests/core/state-resolve.test.js.map +1 -0
- package/dist/tests/core/summary.test.js +200 -0
- package/dist/tests/core/summary.test.js.map +1 -0
- package/dist/tests/core/template.test.js +116 -0
- package/dist/tests/core/template.test.js.map +1 -0
- package/dist/tests/core/tick.test.js +558 -0
- package/dist/tests/core/tick.test.js.map +1 -0
- package/dist/tests/core/token-fold.test.js +176 -0
- package/dist/tests/core/token-fold.test.js.map +1 -0
- package/dist/tests/core/turn.test.js +388 -0
- package/dist/tests/core/turn.test.js.map +1 -0
- package/dist/tests/core/url.test.js +118 -0
- package/dist/tests/core/url.test.js.map +1 -0
- package/dist/tests/core/validate.test.js +247 -0
- package/dist/tests/core/validate.test.js.map +1 -0
- package/dist/tests/core/views.test.js +252 -0
- package/dist/tests/core/views.test.js.map +1 -0
- package/dist/tests/core/vm-decide.test.js +110 -0
- package/dist/tests/core/vm-decide.test.js.map +1 -0
- package/dist/tests/core/vm-guards.test.js +153 -0
- package/dist/tests/core/vm-guards.test.js.map +1 -0
- package/dist/tests/core/vm-plan.test.js +332 -0
- package/dist/tests/core/vm-plan.test.js.map +1 -0
- package/dist/tests/core/vm-reap.test.js +196 -0
- package/dist/tests/core/vm-reap.test.js.map +1 -0
- package/dist/tests/core/workflow-parse.test.js +493 -0
- package/dist/tests/core/workflow-parse.test.js.map +1 -0
- package/dist/tests/core/workspace-decide.test.js +236 -0
- package/dist/tests/core/workspace-decide.test.js.map +1 -0
- package/dist/tests/helpers/fixtures.js +167 -0
- package/dist/tests/helpers/fixtures.js.map +1 -0
- package/dist/tests/shell/acp-substrate.test.js +101 -0
- package/dist/tests/shell/acp-substrate.test.js.map +1 -0
- package/dist/tests/shell/actions-runner-push.test.js +203 -0
- package/dist/tests/shell/actions-runner-push.test.js.map +1 -0
- package/dist/tests/shell/credential-hooks.test.js +36 -0
- package/dist/tests/shell/credential-hooks.test.js.map +1 -0
- package/dist/tests/shell/credential-registry.test.js +165 -0
- package/dist/tests/shell/credential-registry.test.js.map +1 -0
- package/dist/tests/shell/credential-substrate.test.js +179 -0
- package/dist/tests/shell/credential-substrate.test.js.map +1 -0
- package/dist/tests/shell/dockerfile-mise-pin.test.js +51 -0
- package/dist/tests/shell/dockerfile-mise-pin.test.js.map +1 -0
- package/dist/tests/shell/doctor.test.js +101 -0
- package/dist/tests/shell/doctor.test.js.map +1 -0
- package/dist/tests/shell/effect-vm-create.test.js +52 -0
- package/dist/tests/shell/effect-vm-create.test.js.map +1 -0
- package/dist/tests/shell/gh-port.test.js +63 -0
- package/dist/tests/shell/gh-port.test.js.map +1 -0
- package/dist/tests/shell/gondolin-dispatch-guard.test.js +144 -0
- package/dist/tests/shell/gondolin-dispatch-guard.test.js.map +1 -0
- package/dist/tests/shell/gondolin-dispatch-shquote.test.js +168 -0
- package/dist/tests/shell/gondolin-dispatch-shquote.test.js.map +1 -0
- package/dist/tests/shell/gondolin-image-converter.test.js +208 -0
- package/dist/tests/shell/gondolin-image-converter.test.js.map +1 -0
- package/dist/tests/shell/gondolin-image-fetch.test.js +93 -0
- package/dist/tests/shell/gondolin-image-fetch.test.js.map +1 -0
- package/dist/tests/shell/http-handler.test.js +608 -0
- package/dist/tests/shell/http-handler.test.js.map +1 -0
- package/dist/tests/shell/http-server.test.js +53 -0
- package/dist/tests/shell/http-server.test.js.map +1 -0
- package/dist/tests/shell/mcp-runtime.test.js +366 -0
- package/dist/tests/shell/mcp-runtime.test.js.map +1 -0
- package/dist/tests/shell/mise-config-asset.test.js +87 -0
- package/dist/tests/shell/mise-config-asset.test.js.map +1 -0
- package/dist/tests/shell/orchestrator-loop.test.js +583 -0
- package/dist/tests/shell/orchestrator-loop.test.js.map +1 -0
- package/dist/tests/shell/reconciler-passes.test.js +314 -0
- package/dist/tests/shell/reconciler-passes.test.js.map +1 -0
- package/dist/tests/shell/runner-loop-turn.test.js +97 -0
- package/dist/tests/shell/runner-loop-turn.test.js.map +1 -0
- package/dist/tests/shell/runner-slice.test.js +536 -0
- package/dist/tests/shell/runner-slice.test.js.map +1 -0
- package/dist/tests/shell/scaffold.test.js +65 -0
- package/dist/tests/shell/scaffold.test.js.map +1 -0
- package/dist/tests/shell/tick-config.test.js +83 -0
- package/dist/tests/shell/tick-config.test.js.map +1 -0
- package/dist/tests/shell/tracker-parse-dates.test.js +44 -0
- package/dist/tests/shell/tracker-parse-dates.test.js.map +1 -0
- package/dist/tests/shell/tracker-write-issue.test.js +154 -0
- package/dist/tests/shell/tracker-write-issue.test.js.map +1 -0
- package/dist/tests/shell/workflow-prompt-split.test.js +208 -0
- package/dist/tests/shell/workflow-prompt-split.test.js.map +1 -0
- package/dist/tests/shell/workspace-live-config.test.js +140 -0
- package/dist/tests/shell/workspace-live-config.test.js.map +1 -0
- package/package.json +21 -9
- package/patches/@earendil-works+gondolin+0.12.0.patch +173 -0
- package/prompts/Reflect.md +91 -0
- package/prompts/Review.md +97 -0
- package/prompts/Todo.md +96 -0
- package/prompts/_footer.md +41 -0
- package/prompts/_preamble.md +42 -0
- package/prompts-minimal/Todo.md +26 -0
- package/scripts/postinstall.mjs +63 -0
- package/scripts/vm-agent.mjs +312 -90
- package/WORKFLOW.md +0 -744
- package/dist/acp-bridge.js +0 -324
- package/dist/acp-bridge.js.map +0 -1
- package/dist/actions/cache.js +0 -191
- package/dist/actions/cache.js.map +0 -1
- package/dist/actions/effects.js +0 -41
- package/dist/actions/effects.js.map +0 -1
- package/dist/actions/executor.js +0 -570
- package/dist/actions/executor.js.map +0 -1
- package/dist/actions/index.js +0 -13
- package/dist/actions/index.js.map +0 -1
- package/dist/actions/parsing.js.map +0 -1
- package/dist/actions/predicate-env.js +0 -27
- package/dist/actions/predicate-env.js.map +0 -1
- package/dist/actions/predicates.js +0 -49
- package/dist/actions/predicates.js.map +0 -1
- package/dist/actions/templating.js +0 -66
- package/dist/actions/templating.js.map +0 -1
- package/dist/actions/types.js +0 -15
- package/dist/actions/types.js.map +0 -1
- package/dist/agent/acp.js +0 -473
- package/dist/agent/acp.js.map +0 -1
- package/dist/agent/adapter-names.js +0 -159
- package/dist/agent/adapter-names.js.map +0 -1
- package/dist/agent/adapters.js +0 -511
- package/dist/agent/adapters.js.map +0 -1
- package/dist/agent/credential-extractors.js +0 -342
- package/dist/agent/credential-extractors.js.map +0 -1
- package/dist/agent/credential-secrets.js +0 -628
- package/dist/agent/credential-secrets.js.map +0 -1
- package/dist/agent/credential-ticker.js +0 -57
- package/dist/agent/credential-ticker.js.map +0 -1
- package/dist/agent/gondolin-creds-staging.js +0 -356
- package/dist/agent/gondolin-creds-staging.js.map +0 -1
- package/dist/agent/gondolin-dispatch.js +0 -375
- package/dist/agent/gondolin-dispatch.js.map +0 -1
- package/dist/agent/gondolin.js +0 -124
- package/dist/agent/gondolin.js.map +0 -1
- package/dist/agent/runner-decisions.js +0 -134
- package/dist/agent/runner-decisions.js.map +0 -1
- package/dist/agent/runner.js +0 -1456
- package/dist/agent/runner.js.map +0 -1
- package/dist/agent/tool-call-summary.js +0 -102
- package/dist/agent/tool-call-summary.js.map +0 -1
- package/dist/agent/vm-acp-mapping.js +0 -73
- package/dist/agent/vm-acp-mapping.js.map +0 -1
- package/dist/agent/vm-guards.js +0 -262
- package/dist/agent/vm-guards.js.map +0 -1
- package/dist/agent/vm-port.js +0 -22
- package/dist/agent/vm-port.js.map +0 -1
- package/dist/agent/vm-process-registry.js +0 -79
- package/dist/agent/vm-process-registry.js.map +0 -1
- package/dist/bin/cli-args.js +0 -105
- package/dist/bin/cli-args.js.map +0 -1
- package/dist/bin/symphony.js +0 -794
- package/dist/bin/symphony.js.map +0 -1
- package/dist/errors.js +0 -15
- package/dist/errors.js.map +0 -1
- package/dist/http-disk.js +0 -135
- package/dist/http-disk.js.map +0 -1
- package/dist/http-handlers.js.map +0 -1
- package/dist/http.js.map +0 -1
- package/dist/issues.js +0 -178
- package/dist/issues.js.map +0 -1
- package/dist/logging.js +0 -203
- package/dist/logging.js.map +0 -1
- package/dist/mcp.js +0 -706
- package/dist/mcp.js.map +0 -1
- package/dist/memory.js +0 -85
- package/dist/memory.js.map +0 -1
- package/dist/orchestrator-decisions.js +0 -331
- package/dist/orchestrator-decisions.js.map +0 -1
- package/dist/orchestrator.js +0 -1569
- package/dist/orchestrator.js.map +0 -1
- package/dist/prompt.js +0 -65
- package/dist/prompt.js.map +0 -1
- package/dist/reconciler/cache.js +0 -65
- package/dist/reconciler/cache.js.map +0 -1
- package/dist/reconciler/index.js +0 -448
- package/dist/reconciler/index.js.map +0 -1
- package/dist/reconciler/ledger.js +0 -131
- package/dist/reconciler/ledger.js.map +0 -1
- package/dist/reconciler/pr-adapters.js +0 -174
- package/dist/reconciler/pr-adapters.js.map +0 -1
- package/dist/reconciler/pr-decide.js.map +0 -1
- package/dist/reconciler/pr.js +0 -422
- package/dist/reconciler/pr.js.map +0 -1
- package/dist/reconciler/types.js +0 -12
- package/dist/reconciler/types.js.map +0 -1
- package/dist/reconciler/vm.js +0 -243
- package/dist/reconciler/vm.js.map +0 -1
- package/dist/reconciler/workspace-defaults.js +0 -83
- package/dist/reconciler/workspace-defaults.js.map +0 -1
- package/dist/reconciler/workspace.js +0 -272
- package/dist/reconciler/workspace.js.map +0 -1
- package/dist/runlog.js +0 -403
- package/dist/runlog.js.map +0 -1
- package/dist/scaffold.js +0 -165
- package/dist/scaffold.js.map +0 -1
- package/dist/trackers/local.js +0 -445
- package/dist/trackers/local.js.map +0 -1
- package/dist/trackers/types.js +0 -10
- package/dist/trackers/types.js.map +0 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/util/clock.js +0 -12
- package/dist/util/clock.js.map +0 -1
- package/dist/util/crypto.js +0 -25
- package/dist/util/crypto.js.map +0 -1
- package/dist/util/frontmatter.js +0 -70
- package/dist/util/frontmatter.js.map +0 -1
- package/dist/util/fs-issues.js +0 -22
- package/dist/util/fs-issues.js.map +0 -1
- package/dist/util/process.js +0 -152
- package/dist/util/process.js.map +0 -1
- package/dist/util/workspace-key.js +0 -10
- package/dist/util/workspace-key.js.map +0 -1
- package/dist/workflow-loader.js +0 -147
- package/dist/workflow-loader.js.map +0 -1
- package/dist/workflow.js +0 -822
- package/dist/workflow.js.map +0 -1
- package/dist/workspace-types.js +0 -8
- package/dist/workspace-types.js.map +0 -1
- package/dist/workspace.js +0 -443
- package/dist/workspace.js.map +0 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// FCIS rewrite — WORKFLOW.yaml load + watch adapter (kind: adapter).
|
|
2
|
+
//
|
|
3
|
+
// The imperative shell around the PURE workflow parser (src/core/workflow/parse)
|
|
4
|
+
// and the PURE credential-availability classifiers (src/core/credential/availability).
|
|
5
|
+
// This file owns ONLY the IO those cores may not touch:
|
|
6
|
+
// • read WORKFLOW.yaml off disk + capture process.env for $VAR/~ expansion
|
|
7
|
+
// • chokidar-watch the file and re-parse on change/add/unlink
|
|
8
|
+
// • the fs probes the pure validator cannot do (tracker.root existence,
|
|
9
|
+
// per-state host-credential readability) — `validateDispatchIo`
|
|
10
|
+
// • fan onChange callbacks to orchestrator/runner/tracker/mcp listeners
|
|
11
|
+
//
|
|
12
|
+
// Fidelity anchor (read-only reference, NOT modified): src/workflow-loader.ts
|
|
13
|
+
// (`loadWorkflow` / `validateDispatchIo` / `probeAdapterCredential` / `watchWorkflow`).
|
|
14
|
+
//
|
|
15
|
+
// Shell rule: imports from src/types/** ONLY. It may NOT import src/core, so the
|
|
16
|
+
// pure parse closure and the credential-availability predicates are INJECTED by
|
|
17
|
+
// the composition root (src/shell/main.ts), which is the one file allowed to import
|
|
18
|
+
// core. The factory below mirrors the contract main.ts depends on
|
|
19
|
+
// (`watchWorkflowSource(path, parseWorkflowText, { watch })`).
|
|
20
|
+
import path from 'node:path';
|
|
21
|
+
import process from 'node:process';
|
|
22
|
+
import { readFile } from 'node:fs/promises';
|
|
23
|
+
import { accessSync, constants as fsConstants, existsSync, readFileSync, statSync } from 'node:fs';
|
|
24
|
+
import os from 'node:os';
|
|
25
|
+
import chokidar from 'chokidar';
|
|
26
|
+
import { WorkflowError } from '../../types/errors.js';
|
|
27
|
+
// ─── load (pure-parser caller) ────────────────────────────────────────────────
|
|
28
|
+
/**
|
|
29
|
+
* Read the workflow file and parse it via the injected pure closure, then assemble
|
|
30
|
+
* the per-state prompt templates from any `prompt_file` references. Read failures
|
|
31
|
+
* are re-thrown as the original `missing_workflow_file` WorkflowError so downstream
|
|
32
|
+
* error matching keeps working; a missing/unreadable PROMPT file throws a typed
|
|
33
|
+
* `missing_prompt_file` WorkflowError naming the state + path (so the failure points
|
|
34
|
+
* at the source file, not the assembled blob). `process.env` is captured here (not
|
|
35
|
+
* in core) so $VAR expansion + XDG defaults see the env the operator launched under.
|
|
36
|
+
*
|
|
37
|
+
* Exported so the doctor preflight (composition root) loads through the SAME path —
|
|
38
|
+
* a missing/renamed prompt file fails there, not at dispatch.
|
|
39
|
+
*/
|
|
40
|
+
export async function loadWorkflowSource(workflowPath, parse) {
|
|
41
|
+
const abs = path.resolve(workflowPath);
|
|
42
|
+
let text;
|
|
43
|
+
try {
|
|
44
|
+
text = await readFile(abs, 'utf8');
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
throw new WorkflowError('missing_workflow_file', `cannot read ${abs}: ${err.message}`);
|
|
48
|
+
}
|
|
49
|
+
const { config, definition } = parse(text, abs);
|
|
50
|
+
const built = buildPromptTemplates(config);
|
|
51
|
+
return {
|
|
52
|
+
definition: built
|
|
53
|
+
? { ...definition, prompt_templates: built.templates, prompt_template_sources: built.sources }
|
|
54
|
+
: definition,
|
|
55
|
+
config,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Load the workflow AND render-probe its assembled per-state prompt templates via
|
|
60
|
+
* the INJECTED pure probe (the loader may not import core's renderer). A *missing*
|
|
61
|
+
* prompt file already throws `missing_prompt_file` inside {@link loadWorkflowSource};
|
|
62
|
+
* an *unparseable* one (a Liquid syntax error / undefined variable in a prompt file)
|
|
63
|
+
* is caught here and re-thrown as `invalid_prompt_template`, so BOTH failure modes
|
|
64
|
+
* surface at load — and therefore at `symphony doctor` — instead of at first dispatch.
|
|
65
|
+
*
|
|
66
|
+
* The composition root injects `probePromptTemplates` (core) and loads the doctor's
|
|
67
|
+
* config through THIS, so an unparseable prompt_file fails doctor symmetrically with
|
|
68
|
+
* a missing one (the boot serve-path runs the same pure probe in validateBootConfig).
|
|
69
|
+
*/
|
|
70
|
+
export async function loadWorkflowProbed(workflowPath, parse, probePrompts) {
|
|
71
|
+
const loaded = await loadWorkflowSource(workflowPath, parse);
|
|
72
|
+
const promptError = probePrompts(loaded.definition);
|
|
73
|
+
if (promptError)
|
|
74
|
+
throw new WorkflowError('invalid_prompt_template', promptError);
|
|
75
|
+
return loaded;
|
|
76
|
+
}
|
|
77
|
+
// ─── per-state prompt assembly (per-state prompt split) ───────────────────────
|
|
78
|
+
// Assemble the shared header, the per-state body, and the shared footer with this
|
|
79
|
+
// exact blank-line spacing between them — the golden fixture
|
|
80
|
+
// (tests/fixtures/prompt-split/inline-body.md) pins what the assembled per-state
|
|
81
|
+
// template must render to. Each section is trimmed before joining so an editor's
|
|
82
|
+
// trailing newline in a prompt file can't shift the output.
|
|
83
|
+
const HEADER_GAP = '\n\n\n'; // shared header → state branch (two blank lines)
|
|
84
|
+
const FOOTER_GAP = '\n\n\n\n'; // state branch → shared footer (three blank lines)
|
|
85
|
+
/** Read one prompt file, re-throwing a missing/unreadable file with source context. */
|
|
86
|
+
function readPromptFile(absPath, label) {
|
|
87
|
+
try {
|
|
88
|
+
return readFileSync(absPath, 'utf8');
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
throw new WorkflowError('missing_prompt_file', `${label}: prompt file not found or unreadable: ${absPath}: ${err.message}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** Assemble preamble + state body + footer into one template (trim + gap join). */
|
|
95
|
+
function assemblePromptTemplate(preamble, body, footer) {
|
|
96
|
+
let out = preamble.trim();
|
|
97
|
+
const mid = body.trim();
|
|
98
|
+
const foot = footer.trim();
|
|
99
|
+
if (mid)
|
|
100
|
+
out = out ? out + HEADER_GAP + mid : mid;
|
|
101
|
+
if (foot)
|
|
102
|
+
out = out ? out + FOOTER_GAP + foot : foot;
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Build the per-state template map from `prompt_file` + the shared preamble/footer,
|
|
107
|
+
* plus the per-file source provenance (`sources`) the render-probe uses to name the
|
|
108
|
+
* offending FILE on a Liquid error. Returns undefined when no state declares a
|
|
109
|
+
* `prompt_file` (the runner then falls back to the generic FALLBACK_PROMPT). Reads
|
|
110
|
+
* happen here in the shell (the core parser does zero IO); a missing file throws
|
|
111
|
+
* with state context.
|
|
112
|
+
*/
|
|
113
|
+
function buildPromptTemplates(config) {
|
|
114
|
+
const withFile = Object.entries(config.states).filter(([, sc]) => sc.prompt_file);
|
|
115
|
+
if (withFile.length === 0)
|
|
116
|
+
return undefined;
|
|
117
|
+
const preamble = config.prompt.preamble_file
|
|
118
|
+
? { file: config.prompt.preamble_file, text: readPromptFile(config.prompt.preamble_file, 'prompt.preamble_file') }
|
|
119
|
+
: null;
|
|
120
|
+
const footer = config.prompt.footer_file
|
|
121
|
+
? { file: config.prompt.footer_file, text: readPromptFile(config.prompt.footer_file, 'prompt.footer_file') }
|
|
122
|
+
: null;
|
|
123
|
+
const templates = {};
|
|
124
|
+
const bodies = {};
|
|
125
|
+
for (const [name, sc] of withFile) {
|
|
126
|
+
const body = { file: sc.prompt_file, text: readPromptFile(sc.prompt_file, `state "${name}"`) };
|
|
127
|
+
templates[name] = assemblePromptTemplate(preamble?.text ?? '', body.text, footer?.text ?? '');
|
|
128
|
+
bodies[name] = body;
|
|
129
|
+
}
|
|
130
|
+
return { templates, sources: { preamble, footer, bodies } };
|
|
131
|
+
}
|
|
132
|
+
/** Absolute paths of every prompt file the config references (for the watcher). */
|
|
133
|
+
function collectPromptPaths(config) {
|
|
134
|
+
const paths = new Set();
|
|
135
|
+
if (config.prompt.preamble_file)
|
|
136
|
+
paths.add(config.prompt.preamble_file);
|
|
137
|
+
if (config.prompt.footer_file)
|
|
138
|
+
paths.add(config.prompt.footer_file);
|
|
139
|
+
for (const sc of Object.values(config.states)) {
|
|
140
|
+
if (sc.prompt_file)
|
|
141
|
+
paths.add(sc.prompt_file);
|
|
142
|
+
}
|
|
143
|
+
return [...paths];
|
|
144
|
+
}
|
|
145
|
+
// ─── IO-touching dispatch checks (the shell half of validateDispatch) ─────────
|
|
146
|
+
/**
|
|
147
|
+
* IO-touching dispatch checks. Run alongside the pure `validateDispatch`:
|
|
148
|
+
* tracker.root must be a real directory, and any per-state claude/codex adapter
|
|
149
|
+
* override must have a readable host credential. Returns null when every probe
|
|
150
|
+
* passes. `creds` injects the pure availability classifiers; `env` defaults to
|
|
151
|
+
* process.env.
|
|
152
|
+
*/
|
|
153
|
+
export function validateDispatchIo(cfg, creds, env = process.env) {
|
|
154
|
+
if (cfg.tracker.kind === 'local' && cfg.tracker.root) {
|
|
155
|
+
if (!existsSync(cfg.tracker.root) || !statSync(cfg.tracker.root).isDirectory()) {
|
|
156
|
+
return `tracker.root not found or not a directory: ${cfg.tracker.root}`;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
for (const [name, sc] of Object.entries(cfg.states)) {
|
|
160
|
+
const credError = probeStateCredential(name, sc.adapter, creds, env);
|
|
161
|
+
if (credError)
|
|
162
|
+
return credError;
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
// Per-state credential probe. claude/codex each have a fixed host file we can read
|
|
167
|
+
// at load time, so a missing credential fails here instead of as an opaque
|
|
168
|
+
// per-request egress failure mid-dispatch. Reuses {@link probeAdapterCredential}
|
|
169
|
+
// so the read-file + availability-check glue has a single copy.
|
|
170
|
+
function probeStateCredential(stateName, adapter, creds, env) {
|
|
171
|
+
if (adapter !== 'claude' && adapter !== 'codex')
|
|
172
|
+
return null;
|
|
173
|
+
const probe = probeAdapterCredential(adapter, env, creds);
|
|
174
|
+
return probe.readable ? null : `state "${stateName}": ${probe.detail}`;
|
|
175
|
+
}
|
|
176
|
+
function readCredentialFile(p) {
|
|
177
|
+
try {
|
|
178
|
+
return readFileSync(p, 'utf8');
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Probe one adapter's host credential the same way the host reads it at Gondolin
|
|
186
|
+
* egress: claude needs a readable `~/.claude/.credentials.json`; codex needs a
|
|
187
|
+
* `~/.codex/auth.json` token or `OPENAI_API_KEY`. The decision logic lives in the
|
|
188
|
+
* injected pure `creds` classifiers; this is the single read-file wrapper around
|
|
189
|
+
* them. `homeDir` comes from os.homedir().
|
|
190
|
+
*/
|
|
191
|
+
function probeAdapterCredential(adapter, env, creds) {
|
|
192
|
+
const homeDir = os.homedir();
|
|
193
|
+
if (adapter === 'claude')
|
|
194
|
+
return probeClaudeCredential(creds, homeDir);
|
|
195
|
+
return probeCodexCredential(creds, homeDir, env);
|
|
196
|
+
}
|
|
197
|
+
function probeClaudeCredential(creds, homeDir) {
|
|
198
|
+
const credPath = creds.hostClaudeCredentialPath(homeDir);
|
|
199
|
+
try {
|
|
200
|
+
accessSync(credPath, fsConstants.R_OK);
|
|
201
|
+
return { adapter: 'claude', readable: true, detail: `${credPath} (readable)`, fix: '' };
|
|
202
|
+
}
|
|
203
|
+
catch (err) {
|
|
204
|
+
return {
|
|
205
|
+
adapter: 'claude',
|
|
206
|
+
readable: false,
|
|
207
|
+
detail: `adapter "claude" requires a host credential at ${credPath}, but it is missing or unreadable: ${err.message}`,
|
|
208
|
+
fix: `log in with the claude CLI on the host so ${credPath} exists and is readable`,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function probeCodexCredential(creds, homeDir, env) {
|
|
213
|
+
const authText = readCredentialFile(creds.hostCodexCredentialPath(homeDir));
|
|
214
|
+
if (creds.codexCredentialAvailable(authText, env)) {
|
|
215
|
+
return {
|
|
216
|
+
adapter: 'codex',
|
|
217
|
+
readable: true,
|
|
218
|
+
detail: `token in ${creds.hostCodexCredentialPath(homeDir)} or OPENAI_API_KEY`,
|
|
219
|
+
fix: '',
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
adapter: 'codex',
|
|
224
|
+
readable: false,
|
|
225
|
+
detail: creds.codexMissingCredentialMessage(homeDir),
|
|
226
|
+
fix: 'run `codex login` on the host or export OPENAI_API_KEY',
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
// ─── build + watch (the WorkflowSource port) ──────────────────────────────────
|
|
230
|
+
/**
|
|
231
|
+
* Build a {@link WorkflowSource}. Throws on initial load failure. With
|
|
232
|
+
* `opts.watch`, a chokidar watcher re-parses on change/add/unlink; a reload
|
|
233
|
+
* failure is logged and the last-good config is preserved so the orchestrator
|
|
234
|
+
* keeps ticking on the previous shape (the new WorkflowSource port has no error
|
|
235
|
+
* channel — REF surfaced an `{ error }` callback; here we keep-last-good + warn).
|
|
236
|
+
* On every successful reload, listeners are invoked with `(config, definition)`.
|
|
237
|
+
*/
|
|
238
|
+
export async function watchWorkflowSource(workflowPath, parse, opts) {
|
|
239
|
+
const workflowAbs = path.resolve(workflowPath);
|
|
240
|
+
let current = await loadWorkflowSource(workflowAbs, parse);
|
|
241
|
+
const listeners = new Set();
|
|
242
|
+
const warn = (msg, fields) => opts.log?.emit('warn', msg, fields);
|
|
243
|
+
const info = (msg, fields) => opts.log?.emit('info', msg, fields);
|
|
244
|
+
if (!opts.watch) {
|
|
245
|
+
return {
|
|
246
|
+
current: () => current,
|
|
247
|
+
onChange: (cb) => {
|
|
248
|
+
listeners.add(cb);
|
|
249
|
+
},
|
|
250
|
+
stop: () => {
|
|
251
|
+
/* no watcher to close */
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
// Watch the workflow file AND every referenced prompt file, so editing
|
|
256
|
+
// prompts/<State>.md (or the shared preamble/footer) reloads too — not only an
|
|
257
|
+
// edit to WORKFLOW.yaml itself.
|
|
258
|
+
const watcher = chokidar.watch([workflowAbs, ...collectPromptPaths(current.config)], {
|
|
259
|
+
ignoreInitial: true,
|
|
260
|
+
persistent: true,
|
|
261
|
+
});
|
|
262
|
+
let reloadInFlight = null;
|
|
263
|
+
const reload = async () => {
|
|
264
|
+
if (reloadInFlight)
|
|
265
|
+
return reloadInFlight;
|
|
266
|
+
reloadInFlight = (async () => {
|
|
267
|
+
try {
|
|
268
|
+
const next = await loadWorkflowSource(workflowAbs, parse);
|
|
269
|
+
current = next;
|
|
270
|
+
// A reload may add/retarget prompt files; watch the current set (idempotent).
|
|
271
|
+
watcher.add(collectPromptPaths(next.config));
|
|
272
|
+
info('workflow reloaded', { path: workflowAbs });
|
|
273
|
+
for (const cb of listeners)
|
|
274
|
+
cb(next.config, next.definition);
|
|
275
|
+
}
|
|
276
|
+
catch (err) {
|
|
277
|
+
const e = err instanceof WorkflowError
|
|
278
|
+
? err
|
|
279
|
+
: new WorkflowError('workflow_parse_error', err.message);
|
|
280
|
+
// §4.5: a read error must block dispatch. The new WorkflowSource port has
|
|
281
|
+
// no error channel, so we keep the last-good config and surface the
|
|
282
|
+
// failure on the log; the orchestrator keeps ticking on the prior shape.
|
|
283
|
+
warn('workflow reload failed; keeping last good config', { error: e.message, code: e.code });
|
|
284
|
+
}
|
|
285
|
+
finally {
|
|
286
|
+
reloadInFlight = null;
|
|
287
|
+
}
|
|
288
|
+
})();
|
|
289
|
+
return reloadInFlight;
|
|
290
|
+
};
|
|
291
|
+
watcher.on('change', () => void reload());
|
|
292
|
+
watcher.on('add', () => void reload());
|
|
293
|
+
watcher.on('unlink', () => void reload());
|
|
294
|
+
return {
|
|
295
|
+
current: () => current,
|
|
296
|
+
onChange: (cb) => {
|
|
297
|
+
listeners.add(cb);
|
|
298
|
+
},
|
|
299
|
+
stop: () => {
|
|
300
|
+
void watcher.close();
|
|
301
|
+
},
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=workflow-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-loader.js","sourceRoot":"","sources":["../../../../src/shell/adapter/workflow-loader.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,iFAAiF;AACjF,uFAAuF;AACvF,wDAAwD;AACxD,6EAA6E;AAC7E,gEAAgE;AAChE,0EAA0E;AAC1E,oEAAoE;AACpE,0EAA0E;AAC1E,EAAE;AACF,8EAA8E;AAC9E,wFAAwF;AACxF,EAAE;AACF,iFAAiF;AACjF,gFAAgF;AAChF,oFAAoF;AACpF,kEAAkE;AAClE,+DAA+D;AAE/D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,M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T,KAAK,OAAO,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
// FCIS rewrite — `symphony doctor` IMPERATIVE SHELL (kind: cli).
|
|
2
|
+
//
|
|
3
|
+
// The orchestrator's startup path validates prerequisites FATALLY (`bailStartup`
|
|
4
|
+
// exits on the first failure), so a first-time adopter fixes one cliff, re-runs,
|
|
5
|
+
// hits the next, and so on. The doctor runs every probe NON-FATALLY and prints
|
|
6
|
+
// one PASS/FAIL line per check with a one-line fix, then exits 0 iff all passed.
|
|
7
|
+
//
|
|
8
|
+
// This is the SHELL: it performs the IO (read package.json `engines.node`, load
|
|
9
|
+
// + parse WORKFLOW.yaml, resolve `gondolin.image` through Gondolin's own resolver,
|
|
10
|
+
// stat/access the tracker root, read host credential files, bind-test the
|
|
11
|
+
// dashboard port) and turns each raw observation into the typed OBSERVATION
|
|
12
|
+
// shapes declared in src/types/doctor.ts. The PURE check builders + report
|
|
13
|
+
// renderer live in src/core/doctor/checks.ts; per FCIS, only the composition
|
|
14
|
+
// root (src/shell/main.ts) imports core, so it threads the core check/render
|
|
15
|
+
// functions into {@link runDoctorCli} as an injected `render` bundle — this file
|
|
16
|
+
// never imports core. Every probe is injected through {@link DoctorDeps} so the
|
|
17
|
+
// observation set is unit-testable with stubbed passing/failing probes.
|
|
18
|
+
//
|
|
19
|
+
// Ports REF src/bin/doctor.ts 1:1; the credential-availability + path logic the
|
|
20
|
+
// original shared via workflow-loader / adapter-names now lives in
|
|
21
|
+
// src/core/credential/availability.ts, so the shell reads the file text + env
|
|
22
|
+
// and the composition root (or a test) supplies the pure classifier.
|
|
23
|
+
import process from 'node:process';
|
|
24
|
+
import net from 'node:net';
|
|
25
|
+
import os from 'node:os';
|
|
26
|
+
import { accessSync, constants as fsConstants, readFileSync, statSync } from 'node:fs';
|
|
27
|
+
import { fileURLToPath } from 'node:url';
|
|
28
|
+
import { resolveImageSelector } from '@earendil-works/gondolin';
|
|
29
|
+
import { probeConvertedImage } from '../adapter/gondolin-image-converter.js';
|
|
30
|
+
/**
|
|
31
|
+
* Run every preflight probe non-fatally and assemble the typed observation set.
|
|
32
|
+
* `port` is the `--port` override (or null); it takes precedence over
|
|
33
|
+
* `server.port` for the dashboard-port bind test, mirroring the live listener.
|
|
34
|
+
* A WORKFLOW.yaml parse failure leaves the config-derived observations as their
|
|
35
|
+
* "blocked" shapes (the parse error rides on `workflow.parseError`) so the
|
|
36
|
+
* report still lists every check and the overall exit stays non-zero.
|
|
37
|
+
*/
|
|
38
|
+
export async function runDoctorProbes(opts, deps = defaultDoctorDeps()) {
|
|
39
|
+
let cfg = null;
|
|
40
|
+
let parseError = null;
|
|
41
|
+
try {
|
|
42
|
+
cfg = await deps.loadConfig(opts.workflowPath);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
parseError = err.message;
|
|
46
|
+
}
|
|
47
|
+
if (cfg === null) {
|
|
48
|
+
const blocked = 'skipped — WORKFLOW.yaml did not parse';
|
|
49
|
+
return {
|
|
50
|
+
nodeVersion: deps.nodeVersion,
|
|
51
|
+
nodeFloor: deps.nodeFloor,
|
|
52
|
+
workflow: { parseError: parseError ?? 'unknown parse error', hasActive: false, hasTerminal: false, hasHolding: false, stateNames: [] },
|
|
53
|
+
gondolinImage: { image: null, resolution: { resolved: false, source: null, detail: blocked }, oci: null },
|
|
54
|
+
trackerRoot: { root: null, exists: false, isDirectory: false, writable: false },
|
|
55
|
+
dashboardPort: { port: 0, bindable: false, reason: blocked },
|
|
56
|
+
adapterCredentials: [],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
nodeVersion: deps.nodeVersion,
|
|
61
|
+
nodeFloor: deps.nodeFloor,
|
|
62
|
+
workflow: workflowObservation(cfg),
|
|
63
|
+
gondolinImage: gondolinObservation(cfg, deps),
|
|
64
|
+
trackerRoot: trackerObservation(cfg, deps),
|
|
65
|
+
dashboardPort: await dashboardPortObservation(cfg, opts.port, deps),
|
|
66
|
+
adapterCredentials: deps.requiredAdapters(cfg).map((id) => ({ id, probe: deps.probeCredential(id, deps.env) })),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Full doctor CLI: probe, build the check rows via the injected core functions,
|
|
71
|
+
* print the aligned report, and return the process exit code (0 iff all passed).
|
|
72
|
+
* The adapter-credential rows are turned directly into DoctorCheck rows here (the
|
|
73
|
+
* probe already carries pass/detail/fix), then interleaved with the pure checks.
|
|
74
|
+
*/
|
|
75
|
+
export async function runDoctorCli(opts, render, deps = defaultDoctorDeps(), write = (s) => process.stdout.write(s)) {
|
|
76
|
+
const obs = await runDoctorProbes(opts, deps);
|
|
77
|
+
const adapterChecks = obs.adapterCredentials.length === 0
|
|
78
|
+
? [{ key: 'adapter', pass: true, detail: 'no known adapter configured', fix: '' }]
|
|
79
|
+
: obs.adapterCredentials.map(({ id, probe }) => ({ key: `adapter.${id}`, pass: probe.readable, detail: probe.detail, fix: probe.fix }));
|
|
80
|
+
const checks = [
|
|
81
|
+
render.checkNodeVersion(obs.nodeVersion, obs.nodeFloor),
|
|
82
|
+
render.checkWorkflow(obs.workflow),
|
|
83
|
+
render.checkGondolinImage(obs.gondolinImage),
|
|
84
|
+
render.checkTrackerRoot(obs.trackerRoot),
|
|
85
|
+
...adapterChecks,
|
|
86
|
+
render.checkDashboardPort(obs.dashboardPort),
|
|
87
|
+
];
|
|
88
|
+
write(render.formatDoctorReport(checks));
|
|
89
|
+
return render.doctorReportPassed(checks) ? 0 : 1;
|
|
90
|
+
}
|
|
91
|
+
// ─── observation builders (thin: shape raw IO into typed observations) ────────
|
|
92
|
+
function workflowObservation(cfg) {
|
|
93
|
+
const roles = Object.values(cfg.states).map((s) => s.role);
|
|
94
|
+
return {
|
|
95
|
+
parseError: null,
|
|
96
|
+
hasActive: roles.includes('active'),
|
|
97
|
+
hasTerminal: roles.includes('terminal'),
|
|
98
|
+
hasHolding: roles.includes('holding'),
|
|
99
|
+
stateNames: Object.keys(cfg.states),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function gondolinObservation(cfg, deps) {
|
|
103
|
+
const image = cfg.gondolin.image;
|
|
104
|
+
const oci = cfg.gondolin.oci_image && cfg.gondolin.oci_image.length > 0 ? deps.probeOci(cfg.gondolin) : null;
|
|
105
|
+
const resolution = image && image.length > 0 ? deps.resolveImage(image) : null;
|
|
106
|
+
const managed = deps.probeManaged(cfg.gondolin);
|
|
107
|
+
return { image, resolution, oci, managed };
|
|
108
|
+
}
|
|
109
|
+
function trackerObservation(cfg, deps) {
|
|
110
|
+
const root = cfg.tracker.root;
|
|
111
|
+
if (!root)
|
|
112
|
+
return { root: null, exists: false, isDirectory: false, writable: false };
|
|
113
|
+
const st = deps.statPath(root);
|
|
114
|
+
const exists = st !== null;
|
|
115
|
+
const isDirectory = st?.isDirectory ?? false;
|
|
116
|
+
return { root, exists, isDirectory, writable: isDirectory && deps.isWritable(root) };
|
|
117
|
+
}
|
|
118
|
+
async function dashboardPortObservation(cfg, cliPort, deps) {
|
|
119
|
+
const port = cliPort ?? cfg.server.port ?? 0;
|
|
120
|
+
if (port === 0)
|
|
121
|
+
return { port: 0, bindable: true, reason: '' };
|
|
122
|
+
const { bindable, reason } = await deps.probePortBindable(cfg.server.host, port);
|
|
123
|
+
return { port, bindable, reason };
|
|
124
|
+
}
|
|
125
|
+
// ─── production probe wiring (real fs/net/process/gondolin IO) ────────────────
|
|
126
|
+
/** Read the `engines.node` floor from this package's package.json (works from src/ + dist/). */
|
|
127
|
+
function readEnginesNodeFloor() {
|
|
128
|
+
try {
|
|
129
|
+
// ../../../package.json: src/shell/cli/doctor.ts → repo root.
|
|
130
|
+
const pkgPath = fileURLToPath(new URL('../../../package.json', import.meta.url));
|
|
131
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
132
|
+
const node = pkg.engines?.node;
|
|
133
|
+
return typeof node === 'string' && node.length > 0 ? node : null;
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/** Resolve `gondolin.image` exactly as VM bring-up does — through Gondolin's
|
|
140
|
+
* `resolveImageSelector` — so a pinned-but-unbuilt ref fails here, not at boot.
|
|
141
|
+
* Never throws: a resolution failure becomes `resolved: false` + the message. */
|
|
142
|
+
function resolveImageViaGondolin(image) {
|
|
143
|
+
try {
|
|
144
|
+
const r = resolveImageSelector(image);
|
|
145
|
+
return { resolved: true, source: r.source, detail: r.buildId ?? r.assetDir };
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
return { resolved: false, source: null, detail: err.message };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/** Read-only preflight of `gondolin.oci_image` (issue 206): is it already converted +
|
|
152
|
+
* locally resolvable? Delegates to the converter's probe, which NEVER pulls or builds. */
|
|
153
|
+
function probeOciViaConverter(gondolin) {
|
|
154
|
+
const ref = gondolin.oci_image ?? '';
|
|
155
|
+
const { converted, locallyResolvable } = probeConvertedImage(ref, { runtime: gondolin.oci_runtime });
|
|
156
|
+
return { ref, pullPolicy: gondolin.oci_pull_policy, converted, locallyResolvable };
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Read-only preflight of the managed prebuilt-image source (issue 224): null when the
|
|
160
|
+
* managed source is inactive (an explicit `image`/`oci_image` wins); `supported: false`
|
|
161
|
+
* when this host's arch has no published asset (`wiring === null`); else probe whether
|
|
162
|
+
* the asset is already imported (`resolveImageSelector`) — no download. `wiring` is the
|
|
163
|
+
* host's managed wiring, injected from the composition root (the only core importer).
|
|
164
|
+
*/
|
|
165
|
+
function probeManagedSource(gondolin, wiring) {
|
|
166
|
+
if (!gondolin.managed_image)
|
|
167
|
+
return null;
|
|
168
|
+
if (wiring === null)
|
|
169
|
+
return { supported: false, arch: null, ref: null, cached: false };
|
|
170
|
+
let cached = false;
|
|
171
|
+
try {
|
|
172
|
+
resolveImageSelector(wiring.ref);
|
|
173
|
+
cached = true;
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
cached = false;
|
|
177
|
+
}
|
|
178
|
+
return { supported: true, arch: wiring.arch, ref: wiring.ref, cached };
|
|
179
|
+
}
|
|
180
|
+
/** Bind-test a TCP listener and immediately close it. Resolves (never rejects). */
|
|
181
|
+
function probePortBindable(host, port) {
|
|
182
|
+
return new Promise((resolve) => {
|
|
183
|
+
const server = net.createServer();
|
|
184
|
+
server.once('error', (err) => resolve({ bindable: false, reason: err.code ?? err.message }));
|
|
185
|
+
server.once('listening', () => server.close(() => resolve({ bindable: true, reason: '' })));
|
|
186
|
+
server.listen(port, host);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function readCredentialFile(p) {
|
|
190
|
+
try {
|
|
191
|
+
return readFileSync(p, 'utf8');
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function pass(adapter, detail) {
|
|
198
|
+
return { adapter, readable: true, detail, fix: '' };
|
|
199
|
+
}
|
|
200
|
+
function fail(adapter, detail, fix) {
|
|
201
|
+
return { adapter, readable: false, detail, fix };
|
|
202
|
+
}
|
|
203
|
+
function defaultProbeCredential(core, adapter, env) {
|
|
204
|
+
const home = os.homedir();
|
|
205
|
+
if (adapter === 'claude') {
|
|
206
|
+
// claude needs a READABLE credential file (no decode); the path is the core
|
|
207
|
+
// builder so doctor + startup probe agree.
|
|
208
|
+
const credPath = core.hostClaudeCredentialPath(home);
|
|
209
|
+
try {
|
|
210
|
+
accessSync(credPath, fsConstants.R_OK);
|
|
211
|
+
return pass(adapter, `${credPath} (readable)`);
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
return fail(adapter, `adapter "claude" requires a host credential at ${credPath}, but it is missing or unreadable: ${err.message}`, `log in with the claude CLI on the host so ${credPath} exists and is readable`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const credPath = core.hostCodexCredentialPath(home);
|
|
218
|
+
return core.codexCredentialAvailable(readCredentialFile(credPath), env)
|
|
219
|
+
? pass(adapter, `token in ${credPath} or OPENAI_API_KEY`)
|
|
220
|
+
: fail(adapter, core.codexMissingCredentialMessage(home), 'run `codex login` on the host or export OPENAI_API_KEY');
|
|
221
|
+
}
|
|
222
|
+
/** The required adapter ids (acp default + per-state overrides), via core
|
|
223
|
+
* `requiredAdapterIds` + `isKnownAdapter` (injected). `isKnownAdapter` is an
|
|
224
|
+
* `is AcpAdapterId` narrowing predicate, so the core `Set<string>` is the known set. */
|
|
225
|
+
function defaultRequiredAdapters(core, cfg) {
|
|
226
|
+
return [...core.requiredAdapterIds(cfg, core.isKnownAdapter)];
|
|
227
|
+
}
|
|
228
|
+
/** Throws if a core-backed probe is invoked without the composition root having
|
|
229
|
+
* injected the core decisions — same contract as the `loadConfig` placeholder. */
|
|
230
|
+
function coreNotInjected() {
|
|
231
|
+
throw new Error('doctor: core credential/adapter decisions must be injected by the composition root');
|
|
232
|
+
}
|
|
233
|
+
/** Production probe wiring: real fs/net/process IO. The core decisions (parser,
|
|
234
|
+
* credential-availability classifiers, required-adapter union) are injected by the
|
|
235
|
+
* composition root (the shell can't import core); when `core` is omitted the
|
|
236
|
+
* core-backed probes throw, exactly like the `loadConfig` placeholder. */
|
|
237
|
+
export function defaultDoctorDeps(core, managedWiring) {
|
|
238
|
+
return {
|
|
239
|
+
nodeVersion: process.version,
|
|
240
|
+
nodeFloor: readEnginesNodeFloor(),
|
|
241
|
+
env: process.env,
|
|
242
|
+
loadConfig: () => Promise.reject(new Error('doctor: loadConfig must be injected by the composition root (core parser)')),
|
|
243
|
+
resolveImage: resolveImageViaGondolin,
|
|
244
|
+
probeOci: probeOciViaConverter,
|
|
245
|
+
probeManaged: (gondolin) => probeManagedSource(gondolin, managedWiring ?? null),
|
|
246
|
+
statPath: (p) => {
|
|
247
|
+
try {
|
|
248
|
+
return { isDirectory: statSync(p).isDirectory() };
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
isWritable: (p) => {
|
|
255
|
+
try {
|
|
256
|
+
accessSync(p, fsConstants.W_OK);
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
catch {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
requiredAdapters: (cfg) => (core ? defaultRequiredAdapters(core, cfg) : coreNotInjected()),
|
|
264
|
+
probeCredential: (adapter, env) => (core ? defaultProbeCredential(core, adapter, env) : coreNotInjected()),
|
|
265
|
+
probePortBindable,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../../src/shell/cli/doctor.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,+EAA+E;AAC/E,iFAAiF;AACjF,EAAE;AACF,gFAAgF;AAChF,mFAAmF;AACnF,0EAA0E;AAC1E,4EAA4E;AAC5E,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,iFAAiF;AACjF,gFAAgF;AAChF,wEAAwE;AACxE,EAAE;AACF,gFAAgF;AAChF,mEAAmE;AACnE,8EAA8E;AAC9E,qEAAqE;AAErE,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,SAAS,IAAI,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAahE,OAAO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