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
package/dist/agent/adapters.js
DELETED
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
// Registry of ACP adapters symphony knows how to launch end-to-end.
|
|
2
|
-
//
|
|
3
|
-
// Each profile encodes the executable inside the VM that speaks ACP, plus the
|
|
4
|
-
// optional model/effort injection channels (env vars, extra argv, staged files)
|
|
5
|
-
// the adapter natively understands. Credentials are NOT a per-adapter concern
|
|
6
|
-
// here: the guest holds only a token-shaped placeholder and the host substitutes
|
|
7
|
-
// the real upstream token (Anthropic OAuth for claude, an OpenAI API key or
|
|
8
|
-
// ChatGPT-OAuth access token for codex, a minted GitHub Copilot token for
|
|
9
|
-
// opencode) into the outbound request at Gondolin egress (TLS-MITM — see
|
|
10
|
-
// `src/agent/credential-secrets.ts`). The real refresh/durable token never
|
|
11
|
-
// enters the VM.
|
|
12
|
-
//
|
|
13
|
-
// To add a new adapter, populate the profile and add it to ADAPTERS. Unprofiled
|
|
14
|
-
// adapters are not supported at runtime.
|
|
15
|
-
import { lstat, mkdir, readFile, realpath, rm, writeFile } from 'node:fs/promises';
|
|
16
|
-
import { homedir } from 'node:os';
|
|
17
|
-
import path from 'node:path';
|
|
18
|
-
import { isKnownAdapter } from './adapter-names.js';
|
|
19
|
-
// Re-export the names registry so orchestrator-side callers can keep importing
|
|
20
|
-
// `isKnownAdapter` / `AcpAdapterId` from this module. The canonical home is
|
|
21
|
-
// adapter-names.ts; this is just a convenience re-export.
|
|
22
|
-
export { isKnownAdapter };
|
|
23
|
-
// VM-facing env var names the opencode custom provider reads (via `{env:VAR}`)
|
|
24
|
-
// for its base URL + bearer. The staged opencode.json (`buildOpencodeConfig`)
|
|
25
|
-
// references these exact names; the token var MUST equal `OPENCODE_SECRET_NAME`
|
|
26
|
-
// in `credential-secrets.ts` so the placeholder bearer Gondolin substitutes at
|
|
27
|
-
// egress is keyed under the name the in-VM provider reads — a drift would
|
|
28
|
-
// silently break the in-VM provider resolution.
|
|
29
|
-
const OPENCODE_PROXY_BASE_URL_VAR = 'OPENCODE_PROXY_BASE_URL';
|
|
30
|
-
const OPENCODE_PROXY_TOKEN_VAR = 'OPENCODE_PROXY_TOKEN';
|
|
31
|
-
export const ADAPTERS = {
|
|
32
|
-
claude: {
|
|
33
|
-
id: 'claude',
|
|
34
|
-
binary: ['claude-agent-acp'],
|
|
35
|
-
// Anthropic subscription OAuth lives only on the host; the guest holds a
|
|
36
|
-
// token-shaped placeholder and Gondolin substitutes the real access token at
|
|
37
|
-
// egress on every upstream request (see `credential-secrets.ts`).
|
|
38
|
-
// claude-agent-acp reads ANTHROPIC_MODEL on startup (see acp-agent.js getAvailableModels:
|
|
39
|
-
// ANTHROPIC_MODEL > settings.model > default). The adapter resolves aliases like
|
|
40
|
-
// "opus" or "claude-sonnet-4-5" against the SDK's model list, so anything the user
|
|
41
|
-
// would type into Claude Code works here.
|
|
42
|
-
modelInjection: (model) => ({ env: { ANTHROPIC_MODEL: model } }),
|
|
43
|
-
// claude-agent-acp reads `effortLevel` out of merged settings (the SDK's
|
|
44
|
-
// `resolveSettings` walks `$CLAUDE_CONFIG_DIR/settings.json`, `<cwd>/.claude/settings.json`,
|
|
45
|
-
// etc.) and applies it via `query.applyFlagSettings`. There is no ANTHROPIC_EFFORT env var
|
|
46
|
-
// and the wrapper does not expose a CLI flag, so the only reachable channel from symphony
|
|
47
|
-
// is a settings.json staged next to the identity file and copied to /root/.claude/settings.json
|
|
48
|
-
// before the in-VM agent execs the adapter. Valid values are `low|medium|high|xhigh|max`, gated
|
|
49
|
-
// per-model by claude-agent-acp's `supportedEffortLevels`; symphony lets the adapter reject
|
|
50
|
-
// invalid choices rather than mirroring the gate.
|
|
51
|
-
effortInjection: (effort) => ({
|
|
52
|
-
stagedFiles: [
|
|
53
|
-
{
|
|
54
|
-
stagedName: 'claude-settings.json',
|
|
55
|
-
content: JSON.stringify({ effortLevel: effort }),
|
|
56
|
-
guestPath: '/root/.claude/settings.json',
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
}),
|
|
60
|
-
},
|
|
61
|
-
codex: {
|
|
62
|
-
id: 'codex',
|
|
63
|
-
binary: ['codex-acp'],
|
|
64
|
-
// codex (ChatGPT-OAuth) runs in its NATIVE mode: the guest holds a JWT-shaped
|
|
65
|
-
// placeholder as `~/.codex/auth.json:tokens.access_token` and Gondolin
|
|
66
|
-
// substitutes the real ChatGPT/OpenAI token at egress. The host stages a
|
|
67
|
-
// COMPLETE fake auth.json (placeholder tokens + the non-secret
|
|
68
|
-
// `account_id`/`auth_mode`/`last_refresh` codex 0.135's completeness check
|
|
69
|
-
// needs — see `gondolin-creds-staging.ts` `buildCodexFiles`); no real token,
|
|
70
|
-
// and no refresh token, ever enters the VM.
|
|
71
|
-
// codex-acp takes config overrides via `-c key=value` where value is parsed as TOML
|
|
72
|
-
// (raw-string fallback on parse failure). We always emit a quoted TOML string so
|
|
73
|
-
// model names containing dots or hyphens don't surprise the TOML parser.
|
|
74
|
-
modelInjection: (model) => ({ extraArgs: ['-c', `model=${JSON.stringify(model)}`] }),
|
|
75
|
-
// KNOWN GO-LIVE BLOCKER (codex over Gondolin, native ChatGPT-OAuth): codex-acp
|
|
76
|
-
// 0.15 streams `/backend-api/codex/responses` over a WebSocket. Through the
|
|
77
|
-
// Gondolin substrate that stream disconnects (`ResponseStreamDisconnected`,
|
|
78
|
-
// http_status_code: None) — codex then misreads the drop as an auth failure and
|
|
79
|
-
// attempts a token refresh, which is egress-blocked (auth.openai.com not
|
|
80
|
-
// allowlisted) → 403 → the turn is REFUSED. The placeholder-JWT account-id fix
|
|
81
|
-
// (credential-secrets.ts) is necessary (it stops the *pre-emptive* refresh so
|
|
82
|
-
// codex reaches `/responses` at all) but NOT sufficient. Neither
|
|
83
|
-
// `allowWebSockets:true` (the WS still drops) nor a config override resolves it:
|
|
84
|
-
// codex 0.135 forbids overriding the reserved built-in `openai` provider
|
|
85
|
-
// (`supports_websockets=false` → "Built-in providers cannot be overridden"),
|
|
86
|
-
// and codex-acp has no user-facing knob to force the HTTP transport
|
|
87
|
-
// (`force_http_fallback` is an internal Rust symbol, not a TOML config key).
|
|
88
|
-
// `codex exec` (the CLI, HTTP SSE) works fine through Gondolin — so this is
|
|
89
|
-
// specific to codex-acp's WebSocket Responses transport vs Gondolin's WS-MITM.
|
|
90
|
-
// Resolving it needs a substrate-level or codex-acp-version change (escalate);
|
|
91
|
-
// claude is fully green on the same path.
|
|
92
|
-
},
|
|
93
|
-
opencode: {
|
|
94
|
-
id: 'opencode',
|
|
95
|
-
binary: ['opencode', 'acp'],
|
|
96
|
-
// opencode reaches GitHub Copilot via a staged opencode.json custom
|
|
97
|
-
// `@ai-sdk/openai-compatible` provider whose baseURL/apiKey read the
|
|
98
|
-
// OPENCODE_PROXY_* env vars through opencode's `{env:VAR}` interpolation. The
|
|
99
|
-
// guest sends only a `gho_`-shaped placeholder bearer; the host mints a
|
|
100
|
-
// short-lived GitHub Copilot token (exchanged host-side from the operator's
|
|
101
|
-
// `opencode auth login` GitHub OAuth token at
|
|
102
|
-
// api.github.com/copilot_internal/v2/token) and Gondolin substitutes it into
|
|
103
|
-
// the outbound request at egress, injecting the Copilot editor headers,
|
|
104
|
-
// against api.githubcopilot.com. The durable GitHub OAuth token never enters
|
|
105
|
-
// the VM. See `credential-secrets.ts` and
|
|
106
|
-
// docs/research/opencode-copilot-accept-matrix.md.
|
|
107
|
-
// opencode picks its model from the staged opencode.json `model` key
|
|
108
|
-
// ("<providerID>/<modelID>"); the ACP `session/new` carries no model. The
|
|
109
|
-
// provider block must exist even when no model is pinned, so the whole
|
|
110
|
-
// config (provider + model) is staged together via stageOpencodeConfig
|
|
111
|
-
// (see runner.stageAdapterExtras), not through this env/argv channel.
|
|
112
|
-
// Returning an empty injection keeps this path inert.
|
|
113
|
-
modelInjection: () => ({}),
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
/** Provider id of the opencode custom (credential-substituted) provider. */
|
|
117
|
-
export const OPENCODE_PROXY_PROVIDER_ID = 'symphony-copilot';
|
|
118
|
-
/**
|
|
119
|
-
* Default GitHub Copilot model opencode uses when the workflow pins no
|
|
120
|
-
* `acp.model`. DOC-DERIVED: `gpt-4o` is broadly available across Copilot
|
|
121
|
-
* subscription tiers. Operators override per-state via `acp.model` (any id
|
|
122
|
-
* their Copilot subscription exposes — GPT-5, Claude Sonnet, Gemini, …).
|
|
123
|
-
*/
|
|
124
|
-
export const OPENCODE_DEFAULT_COPILOT_MODEL = 'gpt-4o';
|
|
125
|
-
// A small pinned set of Copilot-backed model ids the custom provider advertises
|
|
126
|
-
// so opencode does not need to hit `<baseURL>/models` for discovery (the
|
|
127
|
-
// upstream serves /models too, but pinning avoids the round-trip and a discovery
|
|
128
|
-
// dependency). DOC-DERIVED — the exact id set a given Copilot subscription
|
|
129
|
-
// exposes is operator/tier-dependent; an operator's `acp.model` is always
|
|
130
|
-
// merged in (see buildOpencodeConfig) so a pinned model that isn't in this list
|
|
131
|
-
// still resolves.
|
|
132
|
-
const OPENCODE_PINNED_COPILOT_MODELS = [
|
|
133
|
-
'gpt-4o',
|
|
134
|
-
'gpt-4.1',
|
|
135
|
-
'o4-mini',
|
|
136
|
-
'claude-sonnet-4.5',
|
|
137
|
-
'claude-sonnet-4',
|
|
138
|
-
'gemini-2.5-pro',
|
|
139
|
-
];
|
|
140
|
-
/**
|
|
141
|
-
* Build the opencode.json staged into the VM (pure; exported for tests). It
|
|
142
|
-
* declares the `symphony-copilot` custom provider whose baseURL/apiKey read the
|
|
143
|
-
* OPENCODE_PROXY_* env vars via `{env:…}` interpolation, advertises a pinned
|
|
144
|
-
* Copilot model set (plus the operator's selected model), and pins the default
|
|
145
|
-
* model to `<providerID>/<model>`. Two-space-indented so it reads cleanly if an
|
|
146
|
-
* operator inspects the staged file.
|
|
147
|
-
*
|
|
148
|
-
* The `{env:VAR}` names are the shared OPENCODE_PROXY_* constants, so the in-VM
|
|
149
|
-
* opencode resolves the same base URL + placeholder bearer the host stages (the
|
|
150
|
-
* token var matches `OPENCODE_SECRET_NAME` in `credential-secrets.ts`).
|
|
151
|
-
*/
|
|
152
|
-
export function buildOpencodeConfig(model) {
|
|
153
|
-
const selected = model && model.length > 0 ? model : OPENCODE_DEFAULT_COPILOT_MODEL;
|
|
154
|
-
const ids = new Set([...OPENCODE_PINNED_COPILOT_MODELS, selected]);
|
|
155
|
-
const models = {};
|
|
156
|
-
for (const id of ids)
|
|
157
|
-
models[id] = {};
|
|
158
|
-
return JSON.stringify({
|
|
159
|
-
$schema: 'https://opencode.ai/config.json',
|
|
160
|
-
provider: {
|
|
161
|
-
[OPENCODE_PROXY_PROVIDER_ID]: {
|
|
162
|
-
npm: '@ai-sdk/openai-compatible',
|
|
163
|
-
name: 'Symphony Copilot proxy',
|
|
164
|
-
options: {
|
|
165
|
-
baseURL: `{env:${OPENCODE_PROXY_BASE_URL_VAR}}`,
|
|
166
|
-
apiKey: `{env:${OPENCODE_PROXY_TOKEN_VAR}}`,
|
|
167
|
-
},
|
|
168
|
-
models,
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
model: `${OPENCODE_PROXY_PROVIDER_ID}/${selected}`,
|
|
172
|
-
}, null, 2);
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Absolute guest path the staged opencode.json is copied to inside the VM.
|
|
176
|
-
* opencode reads its global config from `$XDG_CONFIG_HOME/opencode/opencode.json`
|
|
177
|
-
* (defaulting to `~/.config/opencode/opencode.json`); the VM runs as root, so
|
|
178
|
-
* `/root/.config/opencode/opencode.json`. DOC-DERIVED: that `opencode acp`
|
|
179
|
-
* honours the global config + custom provider + `{env:VAR}` interpolation is
|
|
180
|
-
* recorded in docs/research/opencode-copilot-accept-matrix.md.
|
|
181
|
-
*/
|
|
182
|
-
export const OPENCODE_CONFIG_GUEST_PATH = '/root/.config/opencode/opencode.json';
|
|
183
|
-
/**
|
|
184
|
-
* Stage the opencode.json (custom-provider + model) into the workspace runtime
|
|
185
|
-
* tree. Mirrors stageCodexPlaceholderAuth: synthetic content (no secret — the
|
|
186
|
-
* placeholder bearer arrives via env, never a real token), so it never fails on
|
|
187
|
-
* a missing host file.
|
|
188
|
-
*/
|
|
189
|
-
export async function stageOpencodeConfig(workspacePath, model) {
|
|
190
|
-
return stageRuntimeFile(workspacePath, 'opencode.json', buildOpencodeConfig(model));
|
|
191
|
-
}
|
|
192
|
-
export function profileFor(id) {
|
|
193
|
-
return ADAPTERS[id];
|
|
194
|
-
}
|
|
195
|
-
export async function stageRuntimeFile(workspacePath, stagedName, content) {
|
|
196
|
-
return stageNamedFileUnder(workspacePath, 'runtime', stagedName, content);
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Stage the host's claude identity into the workspace runtime tree. Reads
|
|
200
|
-
* `~/.claude.json`, extracts only the operator's `oauthAccount.accountUuid`
|
|
201
|
-
* and `oauthAccount.organizationUuid`, and writes a minimal JSON file at
|
|
202
|
-
* `<workspace>/.git/symphony-runtime/identity/claude.json` (or the
|
|
203
|
-
* `.symphony-runtime/` fallback when the workspace has no `.git/`). The
|
|
204
|
-
* in-VM claude-agent-acp reads these fields to compose a well-formed
|
|
205
|
-
* `metadata.user_id` on every upstream call so a future re-activation of
|
|
206
|
-
* Anthropic's server-side fingerprint check doesn't break dispatch.
|
|
207
|
-
*
|
|
208
|
-
* Defensive shape: NO token strings, NO `device_id`/`session_id` (those are
|
|
209
|
-
* per-process — the in-VM client mints fresh ones on first run), NO local
|
|
210
|
-
* config (prompt-history pointers, theme, recent paths). Identity only. See
|
|
211
|
-
* the `stageClaudeIdentity` test in tests/adapters.test.ts which greps the
|
|
212
|
-
* staged file for `accessToken`/`refreshToken` substrings.
|
|
213
|
-
*
|
|
214
|
-
* When `~/.claude.json` is missing or contains no `oauthAccount` we skip the
|
|
215
|
-
* staging (returning null) rather than fail the dispatch — the egress-substitution
|
|
216
|
-
* seam is defense in depth, not a hard gate on running.
|
|
217
|
-
*/
|
|
218
|
-
export async function stageClaudeIdentity(workspacePath) {
|
|
219
|
-
const src = path.join(homedir(), '.claude.json');
|
|
220
|
-
let raw;
|
|
221
|
-
try {
|
|
222
|
-
raw = await readFile(src, 'utf8');
|
|
223
|
-
}
|
|
224
|
-
catch (err) {
|
|
225
|
-
if (err.code === 'ENOENT')
|
|
226
|
-
return null;
|
|
227
|
-
throw err;
|
|
228
|
-
}
|
|
229
|
-
let parsed;
|
|
230
|
-
try {
|
|
231
|
-
parsed = JSON.parse(raw);
|
|
232
|
-
}
|
|
233
|
-
catch {
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
const account = extractOauthAccountIdentity(parsed);
|
|
237
|
-
if (!account)
|
|
238
|
-
return null;
|
|
239
|
-
const content = JSON.stringify({ oauthAccount: account });
|
|
240
|
-
return stageNamedFileUnder(workspacePath, 'identity', 'claude.json', content);
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Stage a FAKE placeholder `~/.codex/auth.json` into the workspace for the codex
|
|
244
|
-
* adapter. codex-acp's session-init credential check fails with "Authentication
|
|
245
|
-
* required" when no auth.json file exists, even though the placeholder bearer is
|
|
246
|
-
* supplied via the `OPENAI_API_KEY` env var (a live dispatch proved this — #116
|
|
247
|
-
* staged only the env). This file exists PURELY to satisfy that init check: it
|
|
248
|
-
* contains NO real credential — `OPENAI_API_KEY` is a token-shaped placeholder
|
|
249
|
-
* and there is no OAuth `tokens` block — so codex falls through to the env
|
|
250
|
-
* `OPENAI_API_KEY` (= the placeholder, which has precedence over the file) as its
|
|
251
|
-
* request bearer, and Gondolin substitutes the real OpenAI token at egress
|
|
252
|
-
* (TLS-MITM). No real token, and no refresh token, ever enters the VM.
|
|
253
|
-
*
|
|
254
|
-
* `auth_mode: 'apikey'` so codex takes the API-key path (the env placeholder),
|
|
255
|
-
* never an OAuth handshake. `last_refresh` is omitted (no OAuth tokens to age).
|
|
256
|
-
*/
|
|
257
|
-
export async function stageCodexPlaceholderAuth(workspacePath) {
|
|
258
|
-
const placeholder = JSON.stringify({
|
|
259
|
-
OPENAI_API_KEY: 'sk-symphony-placeholder',
|
|
260
|
-
auth_mode: 'apikey',
|
|
261
|
-
});
|
|
262
|
-
return stageNamedFileUnder(workspacePath, 'credential', 'auth.json', placeholder);
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Pull just the identity fields out of the parsed `~/.claude.json`. Anything
|
|
266
|
-
* outside `accountUuid`/`organizationUuid` is dropped — see
|
|
267
|
-
* `stageClaudeIdentity`'s contract.
|
|
268
|
-
*/
|
|
269
|
-
function extractOauthAccountIdentity(parsed) {
|
|
270
|
-
const acct = pickObjectField(parsed, 'oauthAccount');
|
|
271
|
-
if (!acct)
|
|
272
|
-
return null;
|
|
273
|
-
const accountUuid = pickStringField(acct, 'accountUuid');
|
|
274
|
-
const organizationUuid = pickStringField(acct, 'organizationUuid');
|
|
275
|
-
if (accountUuid === null || organizationUuid === null)
|
|
276
|
-
return null;
|
|
277
|
-
return { accountUuid, organizationUuid };
|
|
278
|
-
}
|
|
279
|
-
function pickObjectField(value, key) {
|
|
280
|
-
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
281
|
-
return null;
|
|
282
|
-
const v = value[key];
|
|
283
|
-
if (!v || typeof v !== 'object' || Array.isArray(v))
|
|
284
|
-
return null;
|
|
285
|
-
return v;
|
|
286
|
-
}
|
|
287
|
-
function pickStringField(obj, key) {
|
|
288
|
-
const v = obj[key];
|
|
289
|
-
if (typeof v !== 'string' || v.length === 0)
|
|
290
|
-
return null;
|
|
291
|
-
return v;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Shared implementation for the runtime/identity staging paths. Writes
|
|
295
|
-
* `content` into `<staging-root>/<subdir>/<stagedName>` (0600) with the same
|
|
296
|
-
* symlink/race defenses we previously used for the credential file: explicit
|
|
297
|
-
* cleanup of the leaf, exclusive create via `flag: 'wx'`, and a post-write
|
|
298
|
-
* `realpath` check to detect a symlink that raced into a parent between
|
|
299
|
-
* `ensureRealDir` and the write.
|
|
300
|
-
*/
|
|
301
|
-
async function stageNamedFileUnder(workspacePath, subdir, stagedName, content) {
|
|
302
|
-
if (!/^[A-Za-z0-9._-]+$/.test(stagedName)) {
|
|
303
|
-
throw new Error(`stageNamedFileUnder: stagedName ${JSON.stringify(stagedName)} contains characters outside ` +
|
|
304
|
-
`[A-Za-z0-9._-]; refuse to compose into the staging path.`);
|
|
305
|
-
}
|
|
306
|
-
const { stagingRootAbs, stagingRootRel } = await resolveStagingLocation(workspacePath);
|
|
307
|
-
const subDir = path.join(stagingRootAbs, subdir);
|
|
308
|
-
await ensureRealDir(stagingRootAbs);
|
|
309
|
-
await ensureRealDir(subDir);
|
|
310
|
-
const dst = path.join(subDir, stagedName);
|
|
311
|
-
await rm(dst, { force: true, recursive: false });
|
|
312
|
-
await writeFile(dst, content, { mode: 0o600, flag: 'wx' });
|
|
313
|
-
const expectedReal = path.join(await realpath(workspacePath), stagingRootRel, subdir, stagedName);
|
|
314
|
-
const actualReal = await realpath(dst);
|
|
315
|
-
if (actualReal !== expectedReal) {
|
|
316
|
-
await rm(dst, { force: true }).catch(() => undefined);
|
|
317
|
-
throw new Error(`staging path redirected: wrote to ${actualReal}, expected ${expectedReal}. ` +
|
|
318
|
-
`A symlink raced in during staging; manually inspect and remove any leaked ` +
|
|
319
|
-
`file at the actual path before retrying.`);
|
|
320
|
-
}
|
|
321
|
-
const relPath = path.posix.join(stagingRootRel, subdir, stagedName);
|
|
322
|
-
return { absPath: dst, relPath };
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Decide where to stage runtime files based on workspace shape. See
|
|
326
|
-
* StagedRuntimePaths for the policy. Returns absolute + relative (POSIX,
|
|
327
|
-
* relative to workspacePath) paths to the staging root directory; the caller
|
|
328
|
-
* composes `<subdir>/<name>` under it.
|
|
329
|
-
*/
|
|
330
|
-
async function resolveStagingLocation(workspacePath) {
|
|
331
|
-
const gitPath = path.join(workspacePath, '.git');
|
|
332
|
-
let gitSt;
|
|
333
|
-
try {
|
|
334
|
-
gitSt = await lstat(gitPath);
|
|
335
|
-
}
|
|
336
|
-
catch (err) {
|
|
337
|
-
if (err.code === 'ENOENT') {
|
|
338
|
-
// No `.git` in the workspace itself. The workspace-root fallback is only
|
|
339
|
-
// safe when the workspace is also NOT inside an ancestor git repo — git's
|
|
340
|
-
// repository discovery walks up the directory tree, so a workspace at e.g.
|
|
341
|
-
// `<parent>/.symphony/workspaces/X` with no own `.git` ends up inside
|
|
342
|
-
// `<parent>/.git`. A `git add -A` (from a host-side hook, or from any
|
|
343
|
-
// process with the host filesystem visible) would then stage the file in
|
|
344
|
-
// the parent's index. Detect that and refuse.
|
|
345
|
-
//
|
|
346
|
-
// Resolve symlinks first: git's discovery follows the resolved path, so
|
|
347
|
-
// walking the lexical `workspacePath` would miss an ancestor `.git` that
|
|
348
|
-
// sits above the symlink's real target (e.g. `/home/user/repo-link`
|
|
349
|
-
// pointing at `/srv/repo` where `/srv/.git` exists). A broken symlink at
|
|
350
|
-
// workspacePath itself is treated as a refusal: we cannot prove the
|
|
351
|
-
// workspace isn't inside someone's working tree, so don't stage.
|
|
352
|
-
let resolvedWorkspace;
|
|
353
|
-
try {
|
|
354
|
-
resolvedWorkspace = await realpath(workspacePath);
|
|
355
|
-
}
|
|
356
|
-
catch (resolveErr) {
|
|
357
|
-
throw new Error(`cannot auto-stage runtime files: workspace ${workspacePath} could not be resolved ` +
|
|
358
|
-
`(realpath failed: ${resolveErr.message}). Refusing to stage without a ` +
|
|
359
|
-
`canonical path; fix the workspace.`);
|
|
360
|
-
}
|
|
361
|
-
const ancestor = await findAncestorGit(resolvedWorkspace);
|
|
362
|
-
if (ancestor !== null) {
|
|
363
|
-
throw new Error(`cannot auto-stage runtime files: workspace ${workspacePath} has no .git of its own ` +
|
|
364
|
-
`but is inside an ancestor git repo at ${ancestor}. The canonical workspace setup ` +
|
|
365
|
-
`clones each issue into its own repo; ensure the workspace is a nested clone.`);
|
|
366
|
-
}
|
|
367
|
-
return {
|
|
368
|
-
stagingRootAbs: path.join(workspacePath, '.symphony-runtime'),
|
|
369
|
-
stagingRootRel: '.symphony-runtime',
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
throw err;
|
|
373
|
-
}
|
|
374
|
-
if (gitSt.isDirectory()) {
|
|
375
|
-
// Normal clone: stage inside `.git/`, which is outside the working tree.
|
|
376
|
-
// Git never recurses into `.git/` for `add`/`status`, so the file is
|
|
377
|
-
// structurally untrackable — no `info/exclude` games needed, and a tracked
|
|
378
|
-
// `.symphony-runtime/...` at workspace root cannot interfere.
|
|
379
|
-
return {
|
|
380
|
-
stagingRootAbs: path.join(workspacePath, '.git', 'symphony-runtime'),
|
|
381
|
-
stagingRootRel: path.posix.join('.git', 'symphony-runtime'),
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
if (gitSt.isFile()) {
|
|
385
|
-
// Linked worktree: .git is a pointer file at /<worktree>/.git -> per-worktree
|
|
386
|
-
// gitdir (typically /<main>/.git/worktrees/<name>/). The per-worktree gitdir
|
|
387
|
-
// lives outside the workspace mount, so symphony cannot place the file
|
|
388
|
-
// there and still have the in-VM agent reach it. Any worktree-internal path
|
|
389
|
-
// is inside the working tree, where `.gitignore` negation or a tracked file
|
|
390
|
-
// could still expose state to `git add -A`. Linked worktrees are
|
|
391
|
-
// currently unsupported — use a non-linked workspace clone (e.g.
|
|
392
|
-
// `git clone --local`) or fork scripts/vm-agent.mjs to stage runtime
|
|
393
|
-
// files in whatever shape your worktree layout needs.
|
|
394
|
-
throw new Error(`cannot auto-stage runtime files in a linked worktree (.git at ${gitPath} is a file). ` +
|
|
395
|
-
`Linked worktrees are unsupported under the ACP TCP bridge transport; use a ` +
|
|
396
|
-
`non-linked workspace clone or fork scripts/vm-agent.mjs.`);
|
|
397
|
-
}
|
|
398
|
-
throw new Error(`cannot auto-stage runtime files: ${gitPath} is neither a directory nor a file ` +
|
|
399
|
-
`(symlink, device, or other unexpected entry).`);
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Walk up from `workspacePath` looking for an ancestor `.git` entry (file or dir).
|
|
403
|
-
* Returns the absolute path of the first one found, or null when the walk reaches
|
|
404
|
-
* the filesystem root without hitting one. Used to detect workspaces that, despite
|
|
405
|
-
* having no `.git` of their own, are still inside the working tree of an ancestor
|
|
406
|
-
* git repo.
|
|
407
|
-
*
|
|
408
|
-
* The caller is expected to pass an already-canonical (realpath-resolved) path:
|
|
409
|
-
* git discovery follows the resolved path, so a lexical walk on a symlinked input
|
|
410
|
-
* would miss the real ancestor. Once the input is canonical, every `path.dirname`
|
|
411
|
-
* step stays canonical (a directory's parent is itself a directory component,
|
|
412
|
-
* never a symlink), so no per-level re-resolve is needed.
|
|
413
|
-
*/
|
|
414
|
-
async function findAncestorGit(workspacePath) {
|
|
415
|
-
const root = path.parse(workspacePath).root;
|
|
416
|
-
let current = path.dirname(workspacePath);
|
|
417
|
-
while (current && current !== root) {
|
|
418
|
-
const candidate = path.join(current, '.git');
|
|
419
|
-
try {
|
|
420
|
-
await lstat(candidate);
|
|
421
|
-
return candidate;
|
|
422
|
-
}
|
|
423
|
-
catch (err) {
|
|
424
|
-
if (err.code !== 'ENOENT')
|
|
425
|
-
throw err;
|
|
426
|
-
}
|
|
427
|
-
const next = path.dirname(current);
|
|
428
|
-
if (next === current)
|
|
429
|
-
break;
|
|
430
|
-
current = next;
|
|
431
|
-
}
|
|
432
|
-
// Final check at the root itself.
|
|
433
|
-
try {
|
|
434
|
-
await lstat(path.join(root, '.git'));
|
|
435
|
-
return path.join(root, '.git');
|
|
436
|
-
}
|
|
437
|
-
catch (err) {
|
|
438
|
-
if (err.code !== 'ENOENT')
|
|
439
|
-
throw err;
|
|
440
|
-
}
|
|
441
|
-
return null;
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Ensure `p` is a real directory we own. Creates it if missing; refuses if it exists
|
|
445
|
-
* as a symlink (defense against the staging-via-symlink attack) or as a non-directory.
|
|
446
|
-
*/
|
|
447
|
-
async function ensureRealDir(p) {
|
|
448
|
-
let st;
|
|
449
|
-
try {
|
|
450
|
-
st = await lstat(p);
|
|
451
|
-
}
|
|
452
|
-
catch (err) {
|
|
453
|
-
if (err.code === 'ENOENT') {
|
|
454
|
-
await mkdir(p, { recursive: false });
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
throw err;
|
|
458
|
-
}
|
|
459
|
-
if (st.isSymbolicLink()) {
|
|
460
|
-
throw new Error(`refusing to write symphony-runtime through a symlink at ${p}`);
|
|
461
|
-
}
|
|
462
|
-
if (!st.isDirectory()) {
|
|
463
|
-
throw new Error(`expected a directory at ${p}, found a non-directory`);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
* Build the bash command symphony will exec inside the VM. For each staged
|
|
468
|
-
* extra file: `mkdir -p` the destination directory, `cp` the file into place,
|
|
469
|
-
* `chmod 600`. Then exec the in-VM agent at `/opt/symphony/vm-agent.mjs`. It
|
|
470
|
-
* reads its config — SYMPHONY_ACP_URL, SYMPHONY_ACP_TOKEN,
|
|
471
|
-
* SYMPHONY_ADAPTER_BIN, SYMPHONY_ADAPTER_ARGS — from the environment that
|
|
472
|
-
* symphony sets on the in-VM exec invocation, dials the host's TCP ACP
|
|
473
|
-
* bridge, and spawns the adapter with kernel pipes.
|
|
474
|
-
*
|
|
475
|
-
* Why TCP through the in-VM agent: the in-VM exec stdin pump does not reliably
|
|
476
|
-
* wake the in-VM reader for kernel events unless host stdin keeps writing. Piping
|
|
477
|
-
* ACP frames through the in-VM exec stdio caused the adapter to hang after the
|
|
478
|
-
* first session/update. The TCP bridge (see src/acp-bridge.ts) bypasses that pump
|
|
479
|
-
* entirely and decouples symphony from any specific sandbox tech — any sandbox
|
|
480
|
-
* that can launch a process with env vars and reach the host loopback can run
|
|
481
|
-
* this stack unchanged.
|
|
482
|
-
*
|
|
483
|
-
* No real credential enters the VM: the guest holds only a token-shaped
|
|
484
|
-
* placeholder (staged as fake native creds + env), and Gondolin substitutes the
|
|
485
|
-
* real upstream token (Anthropic OAuth for claude, an OpenAI API key or
|
|
486
|
-
* ChatGPT-OAuth access token for codex, a minted GitHub Copilot token for
|
|
487
|
-
* opencode) into the outbound request at egress (TLS-MITM). See
|
|
488
|
-
* `credential-secrets.ts` / `gondolin-creds-staging.ts`.
|
|
489
|
-
*/
|
|
490
|
-
export function deriveAcpCommand(profile, extraFiles = []) {
|
|
491
|
-
if (profile.binary.length === 0) {
|
|
492
|
-
throw new Error(`adapter "${profile.id}" has an empty binary launch vector`);
|
|
493
|
-
}
|
|
494
|
-
const steps = [];
|
|
495
|
-
for (const f of extraFiles) {
|
|
496
|
-
const extraDir = path.posix.dirname(f.guestPath);
|
|
497
|
-
steps.push(`mkdir -p ${shQuote(extraDir)}`);
|
|
498
|
-
steps.push(`cp ${shQuote(f.stagedRelPath)} ${shQuote(f.guestPath)}`);
|
|
499
|
-
steps.push(`chmod 600 ${shQuote(f.guestPath)}`);
|
|
500
|
-
}
|
|
501
|
-
steps.push(`exec node /opt/symphony/vm-agent.mjs`);
|
|
502
|
-
return steps.join(' && ');
|
|
503
|
-
}
|
|
504
|
-
// Minimal POSIX-shell single-quoting. None of the paths we emit contain `'`, but be
|
|
505
|
-
// defensive in case a future binary name or path changes.
|
|
506
|
-
function shQuote(s) {
|
|
507
|
-
if (/^[A-Za-z0-9_\-./]+$/.test(s))
|
|
508
|
-
return s;
|
|
509
|
-
return `'${s.replace(/'/g, `'\\''`)}'`;
|
|
510
|
-
}
|
|
511
|
-
//# sourceMappingURL=adapters.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/agent/adapters.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AAC9E,iFAAiF;AACjF,4EAA4E;AAC5E,0EAA0E;AAC1E,yEAAyE;AACzE,2EAA2E;AAC3E,iBAAiB;AACjB,EAAE;AACF,gFAAgF;AAChF,yCAAyC;AAEzC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAC;AAEvE,+EAA+E;AAC/E,4EAA4E;AAC5E,0DAA0D;AAC1D,OAAO,EAAE,cAAc,EAAqB,CAAC;AA+D7C,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,+EAA+E;AAC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