@prismatic-io/lux 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/lib/answerers/claude-code/index.d.ts +17 -0
- package/lib/answerers/claude-code/index.d.ts.map +1 -0
- package/lib/answerers/claude-code/index.js +280 -0
- package/lib/answerers/claude-code/index.js.map +1 -0
- package/lib/answerers/persona/index.d.ts +40 -0
- package/lib/answerers/persona/index.d.ts.map +1 -0
- package/lib/answerers/persona/index.js +265 -0
- package/lib/answerers/persona/index.js.map +1 -0
- package/lib/answerers/scripted/index.d.ts +8 -0
- package/lib/answerers/scripted/index.d.ts.map +1 -0
- package/lib/answerers/scripted/index.js +163 -0
- package/lib/answerers/scripted/index.js.map +1 -0
- package/lib/answerers/shared.d.ts +13 -0
- package/lib/answerers/shared.d.ts.map +1 -0
- package/lib/answerers/shared.js +17 -0
- package/lib/answerers/shared.js.map +1 -0
- package/lib/answerers/terminal/index.d.ts +9 -0
- package/lib/answerers/terminal/index.d.ts.map +1 -0
- package/lib/answerers/terminal/index.js +97 -0
- package/lib/answerers/terminal/index.js.map +1 -0
- package/lib/assertions/core/command-exits-zero.d.ts +21 -0
- package/lib/assertions/core/command-exits-zero.d.ts.map +1 -0
- package/lib/assertions/core/command-exits-zero.js +87 -0
- package/lib/assertions/core/command-exits-zero.js.map +1 -0
- package/lib/assertions/core/event-checks.d.ts +57 -0
- package/lib/assertions/core/event-checks.d.ts.map +1 -0
- package/lib/assertions/core/event-checks.js +123 -0
- package/lib/assertions/core/event-checks.js.map +1 -0
- package/lib/assertions/core/file-checks.d.ts +103 -0
- package/lib/assertions/core/file-checks.d.ts.map +1 -0
- package/lib/assertions/core/file-checks.js +288 -0
- package/lib/assertions/core/file-checks.js.map +1 -0
- package/lib/assertions/core/helpers.d.ts +66 -0
- package/lib/assertions/core/helpers.d.ts.map +1 -0
- package/lib/assertions/core/helpers.js +170 -0
- package/lib/assertions/core/helpers.js.map +1 -0
- package/lib/assertions/core/index.d.ts +15 -0
- package/lib/assertions/core/index.d.ts.map +1 -0
- package/lib/assertions/core/index.js +56 -0
- package/lib/assertions/core/index.js.map +1 -0
- package/lib/assertions/core/json-pointer-equals.d.ts +19 -0
- package/lib/assertions/core/json-pointer-equals.d.ts.map +1 -0
- package/lib/assertions/core/json-pointer-equals.js +71 -0
- package/lib/assertions/core/json-pointer-equals.js.map +1 -0
- package/lib/assertions/core/output-checks.d.ts +46 -0
- package/lib/assertions/core/output-checks.d.ts.map +1 -0
- package/lib/assertions/core/output-checks.js +121 -0
- package/lib/assertions/core/output-checks.js.map +1 -0
- package/lib/assertions/core/predicate.d.ts +14 -0
- package/lib/assertions/core/predicate.d.ts.map +1 -0
- package/lib/assertions/core/predicate.js +55 -0
- package/lib/assertions/core/predicate.js.map +1 -0
- package/lib/assertions/core/resource-checks.d.ts +71 -0
- package/lib/assertions/core/resource-checks.d.ts.map +1 -0
- package/lib/assertions/core/resource-checks.js +159 -0
- package/lib/assertions/core/resource-checks.js.map +1 -0
- package/lib/assertions/core/safe-regex.d.ts +23 -0
- package/lib/assertions/core/safe-regex.d.ts.map +1 -0
- package/lib/assertions/core/safe-regex.js +102 -0
- package/lib/assertions/core/safe-regex.js.map +1 -0
- package/lib/assertions/core/tool-called-with.d.ts +21 -0
- package/lib/assertions/core/tool-called-with.d.ts.map +1 -0
- package/lib/assertions/core/tool-called-with.js +69 -0
- package/lib/assertions/core/tool-called-with.js.map +1 -0
- package/lib/assertions/core/tool-calls.d.ts +22 -0
- package/lib/assertions/core/tool-calls.d.ts.map +1 -0
- package/lib/assertions/core/tool-calls.js +17 -0
- package/lib/assertions/core/tool-calls.js.map +1 -0
- package/lib/assertions/core/tool-invocation.d.ts +36 -0
- package/lib/assertions/core/tool-invocation.d.ts.map +1 -0
- package/lib/assertions/core/tool-invocation.js +170 -0
- package/lib/assertions/core/tool-invocation.js.map +1 -0
- package/lib/assertions/core/tool-result-checks.d.ts +59 -0
- package/lib/assertions/core/tool-result-checks.d.ts.map +1 -0
- package/lib/assertions/core/tool-result-checks.js +193 -0
- package/lib/assertions/core/tool-result-checks.js.map +1 -0
- package/lib/assertions/mcp/discovery-checks.d.ts +36 -0
- package/lib/assertions/mcp/discovery-checks.d.ts.map +1 -0
- package/lib/assertions/mcp/discovery-checks.js +122 -0
- package/lib/assertions/mcp/discovery-checks.js.map +1 -0
- package/lib/assertions/mcp/index.d.ts +10 -0
- package/lib/assertions/mcp/index.d.ts.map +1 -0
- package/lib/assertions/mcp/index.js +25 -0
- package/lib/assertions/mcp/index.js.map +1 -0
- package/lib/assertions/rubric/index.d.ts +104 -0
- package/lib/assertions/rubric/index.d.ts.map +1 -0
- package/lib/assertions/rubric/index.js +191 -0
- package/lib/assertions/rubric/index.js.map +1 -0
- package/lib/assertions/rubric/internal.d.ts +14 -0
- package/lib/assertions/rubric/internal.d.ts.map +1 -0
- package/lib/assertions/rubric/internal.js +335 -0
- package/lib/assertions/rubric/internal.js.map +1 -0
- package/lib/authoring.d.ts +3 -0
- package/lib/authoring.d.ts.map +1 -0
- package/lib/authoring.js +3 -0
- package/lib/authoring.js.map +1 -0
- package/lib/cli/bin.d.ts +3 -0
- package/lib/cli/bin.d.ts.map +1 -0
- package/lib/cli/bin.js +15 -0
- package/lib/cli/bin.js.map +1 -0
- package/lib/cli/command-runtime.d.ts +5 -0
- package/lib/cli/command-runtime.d.ts.map +1 -0
- package/lib/cli/command-runtime.js +30 -0
- package/lib/cli/command-runtime.js.map +1 -0
- package/lib/cli/init.d.ts +21 -0
- package/lib/cli/init.d.ts.map +1 -0
- package/lib/cli/init.js +340 -0
- package/lib/cli/init.js.map +1 -0
- package/lib/cli/program.d.ts +22 -0
- package/lib/cli/program.d.ts.map +1 -0
- package/lib/cli/program.js +757 -0
- package/lib/cli/program.js.map +1 -0
- package/lib/cli/render/format.d.ts +14 -0
- package/lib/cli/render/format.d.ts.map +1 -0
- package/lib/cli/render/format.js +71 -0
- package/lib/cli/render/format.js.map +1 -0
- package/lib/cli/render/reporter.d.ts +73 -0
- package/lib/cli/render/reporter.d.ts.map +1 -0
- package/lib/cli/render/reporter.js +519 -0
- package/lib/cli/render/reporter.js.map +1 -0
- package/lib/cli/render/tty.d.ts +77 -0
- package/lib/cli/render/tty.d.ts.map +1 -0
- package/lib/cli/render/tty.js +283 -0
- package/lib/cli/render/tty.js.map +1 -0
- package/lib/cli/run-options.d.ts +27 -0
- package/lib/cli/run-options.d.ts.map +1 -0
- package/lib/cli/run-options.js +58 -0
- package/lib/cli/run-options.js.map +1 -0
- package/lib/cli/skills.d.ts +38 -0
- package/lib/cli/skills.d.ts.map +1 -0
- package/lib/cli/skills.js +84 -0
- package/lib/cli/skills.js.map +1 -0
- package/lib/core/annotation.d.ts +56 -0
- package/lib/core/annotation.d.ts.map +1 -0
- package/lib/core/annotation.js +92 -0
- package/lib/core/annotation.js.map +1 -0
- package/lib/core/answerer.d.ts +68 -0
- package/lib/core/answerer.d.ts.map +1 -0
- package/lib/core/answerer.js +17 -0
- package/lib/core/answerer.js.map +1 -0
- package/lib/core/artifact-evidence.d.ts +50 -0
- package/lib/core/artifact-evidence.d.ts.map +1 -0
- package/lib/core/artifact-evidence.js +185 -0
- package/lib/core/artifact-evidence.js.map +1 -0
- package/lib/core/artifact-snapshot.d.ts +37 -0
- package/lib/core/artifact-snapshot.d.ts.map +1 -0
- package/lib/core/artifact-snapshot.js +339 -0
- package/lib/core/artifact-snapshot.js.map +1 -0
- package/lib/core/assertion.d.ts +129 -0
- package/lib/core/assertion.d.ts.map +1 -0
- package/lib/core/assertion.js +75 -0
- package/lib/core/assertion.js.map +1 -0
- package/lib/core/case.d.ts +79 -0
- package/lib/core/case.d.ts.map +1 -0
- package/lib/core/case.js +90 -0
- package/lib/core/case.js.map +1 -0
- package/lib/core/conversation-turn.d.ts +23 -0
- package/lib/core/conversation-turn.d.ts.map +1 -0
- package/lib/core/conversation-turn.js +31 -0
- package/lib/core/conversation-turn.js.map +1 -0
- package/lib/core/driver.d.ts +64 -0
- package/lib/core/driver.d.ts.map +1 -0
- package/lib/core/driver.js +18 -0
- package/lib/core/driver.js.map +1 -0
- package/lib/core/emitter.d.ts +20 -0
- package/lib/core/emitter.d.ts.map +1 -0
- package/lib/core/emitter.js +34 -0
- package/lib/core/emitter.js.map +1 -0
- package/lib/core/events.d.ts +202 -0
- package/lib/core/events.d.ts.map +1 -0
- package/lib/core/events.js +107 -0
- package/lib/core/events.js.map +1 -0
- package/lib/core/exec.d.ts +82 -0
- package/lib/core/exec.d.ts.map +1 -0
- package/lib/core/exec.js +168 -0
- package/lib/core/exec.js.map +1 -0
- package/lib/core/experiment.d.ts +285 -0
- package/lib/core/experiment.d.ts.map +1 -0
- package/lib/core/experiment.js +389 -0
- package/lib/core/experiment.js.map +1 -0
- package/lib/core/glob.d.ts +3 -0
- package/lib/core/glob.d.ts.map +1 -0
- package/lib/core/glob.js +32 -0
- package/lib/core/glob.js.map +1 -0
- package/lib/core/hash.d.ts +8 -0
- package/lib/core/hash.d.ts.map +1 -0
- package/lib/core/hash.js +214 -0
- package/lib/core/hash.js.map +1 -0
- package/lib/core/index.d.ts +29 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +29 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/lifecycle-fixtures.d.ts +20 -0
- package/lib/core/lifecycle-fixtures.d.ts.map +1 -0
- package/lib/core/lifecycle-fixtures.js +109 -0
- package/lib/core/lifecycle-fixtures.js.map +1 -0
- package/lib/core/lifecycle-hooks.d.ts +52 -0
- package/lib/core/lifecycle-hooks.d.ts.map +1 -0
- package/lib/core/lifecycle-hooks.js +42 -0
- package/lib/core/lifecycle-hooks.js.map +1 -0
- package/lib/core/mcp-events.d.ts +44 -0
- package/lib/core/mcp-events.d.ts.map +1 -0
- package/lib/core/mcp-events.js +23 -0
- package/lib/core/mcp-events.js.map +1 -0
- package/lib/core/model-cli.d.ts +57 -0
- package/lib/core/model-cli.d.ts.map +1 -0
- package/lib/core/model-cli.js +237 -0
- package/lib/core/model-cli.js.map +1 -0
- package/lib/core/observer.d.ts +31 -0
- package/lib/core/observer.d.ts.map +1 -0
- package/lib/core/observer.js +25 -0
- package/lib/core/observer.js.map +1 -0
- package/lib/core/platform-process.d.ts +33 -0
- package/lib/core/platform-process.d.ts.map +1 -0
- package/lib/core/platform-process.js +214 -0
- package/lib/core/platform-process.js.map +1 -0
- package/lib/core/registry.d.ts +22 -0
- package/lib/core/registry.d.ts.map +1 -0
- package/lib/core/registry.js +45 -0
- package/lib/core/registry.js.map +1 -0
- package/lib/core/rubric.d.ts +18 -0
- package/lib/core/rubric.d.ts.map +1 -0
- package/lib/core/rubric.js +49 -0
- package/lib/core/rubric.js.map +1 -0
- package/lib/core/run.d.ts +419 -0
- package/lib/core/run.d.ts.map +1 -0
- package/lib/core/run.js +126 -0
- package/lib/core/run.js.map +1 -0
- package/lib/core/statistics.d.ts +39 -0
- package/lib/core/statistics.d.ts.map +1 -0
- package/lib/core/statistics.js +163 -0
- package/lib/core/statistics.js.map +1 -0
- package/lib/core/subject.d.ts +4 -0
- package/lib/core/subject.d.ts.map +1 -0
- package/lib/core/subject.js +46 -0
- package/lib/core/subject.js.map +1 -0
- package/lib/core/tool-events.d.ts +69 -0
- package/lib/core/tool-events.d.ts.map +1 -0
- package/lib/core/tool-events.js +242 -0
- package/lib/core/tool-events.js.map +1 -0
- package/lib/core/usage.d.ts +78 -0
- package/lib/core/usage.d.ts.map +1 -0
- package/lib/core/usage.js +104 -0
- package/lib/core/usage.js.map +1 -0
- package/lib/core/wire.d.ts +83 -0
- package/lib/core/wire.d.ts.map +1 -0
- package/lib/core/wire.js +101 -0
- package/lib/core/wire.js.map +1 -0
- package/lib/core/zod.d.ts +10 -0
- package/lib/core/zod.d.ts.map +1 -0
- package/lib/core/zod.js +18 -0
- package/lib/core/zod.js.map +1 -0
- package/lib/drivers/claude-code/index.d.ts +55 -0
- package/lib/drivers/claude-code/index.d.ts.map +1 -0
- package/lib/drivers/claude-code/index.js +779 -0
- package/lib/drivers/claude-code/index.js.map +1 -0
- package/lib/drivers/claude-code/parse-events.d.ts +46 -0
- package/lib/drivers/claude-code/parse-events.d.ts.map +1 -0
- package/lib/drivers/claude-code/parse-events.js +387 -0
- package/lib/drivers/claude-code/parse-events.js.map +1 -0
- package/lib/drivers/codex/app-events.d.ts +16 -0
- package/lib/drivers/codex/app-events.d.ts.map +1 -0
- package/lib/drivers/codex/app-events.js +184 -0
- package/lib/drivers/codex/app-events.js.map +1 -0
- package/lib/drivers/codex/config.d.ts +55 -0
- package/lib/drivers/codex/config.d.ts.map +1 -0
- package/lib/drivers/codex/config.js +125 -0
- package/lib/drivers/codex/config.js.map +1 -0
- package/lib/drivers/codex/index.d.ts +8 -0
- package/lib/drivers/codex/index.d.ts.map +1 -0
- package/lib/drivers/codex/index.js +904 -0
- package/lib/drivers/codex/index.js.map +1 -0
- package/lib/drivers/mcp/index.d.ts +52 -0
- package/lib/drivers/mcp/index.d.ts.map +1 -0
- package/lib/drivers/mcp/index.js +282 -0
- package/lib/drivers/mcp/index.js.map +1 -0
- package/lib/drivers/mcp/transport.d.ts +50 -0
- package/lib/drivers/mcp/transport.d.ts.map +1 -0
- package/lib/drivers/mcp/transport.js +190 -0
- package/lib/drivers/mcp/transport.js.map +1 -0
- package/lib/drivers/shared/artifacts.d.ts +4 -0
- package/lib/drivers/shared/artifacts.d.ts.map +1 -0
- package/lib/drivers/shared/artifacts.js +81 -0
- package/lib/drivers/shared/artifacts.js.map +1 -0
- package/lib/drivers/shared/secure-copy.d.ts +2 -0
- package/lib/drivers/shared/secure-copy.d.ts.map +1 -0
- package/lib/drivers/shared/secure-copy.js +35 -0
- package/lib/drivers/shared/secure-copy.js.map +1 -0
- package/lib/drivers/subprocess/index.d.ts +24 -0
- package/lib/drivers/subprocess/index.d.ts.map +1 -0
- package/lib/drivers/subprocess/index.js +451 -0
- package/lib/drivers/subprocess/index.js.map +1 -0
- package/lib/index.d.ts +40 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +48 -0
- package/lib/index.js.map +1 -0
- package/lib/optimization/reflective.d.ts +27 -0
- package/lib/optimization/reflective.d.ts.map +1 -0
- package/lib/optimization/reflective.js +257 -0
- package/lib/optimization/reflective.js.map +1 -0
- package/lib/orchestrator/annotation-loader.d.ts +65 -0
- package/lib/orchestrator/annotation-loader.d.ts.map +1 -0
- package/lib/orchestrator/annotation-loader.js +73 -0
- package/lib/orchestrator/annotation-loader.js.map +1 -0
- package/lib/orchestrator/annotation-store.d.ts +3 -0
- package/lib/orchestrator/annotation-store.d.ts.map +1 -0
- package/lib/orchestrator/annotation-store.js +100 -0
- package/lib/orchestrator/annotation-store.js.map +1 -0
- package/lib/orchestrator/authored-dependencies.d.ts +3 -0
- package/lib/orchestrator/authored-dependencies.d.ts.map +1 -0
- package/lib/orchestrator/authored-dependencies.js +146 -0
- package/lib/orchestrator/authored-dependencies.js.map +1 -0
- package/lib/orchestrator/campaign-lifecycle.d.ts +105 -0
- package/lib/orchestrator/campaign-lifecycle.d.ts.map +1 -0
- package/lib/orchestrator/campaign-lifecycle.js +141 -0
- package/lib/orchestrator/campaign-lifecycle.js.map +1 -0
- package/lib/orchestrator/candidate-integrity.d.ts +4 -0
- package/lib/orchestrator/candidate-integrity.d.ts.map +1 -0
- package/lib/orchestrator/candidate-integrity.js +14 -0
- package/lib/orchestrator/candidate-integrity.js.map +1 -0
- package/lib/orchestrator/candidates.d.ts +13 -0
- package/lib/orchestrator/candidates.d.ts.map +1 -0
- package/lib/orchestrator/candidates.js +577 -0
- package/lib/orchestrator/candidates.js.map +1 -0
- package/lib/orchestrator/compare.d.ts +80 -0
- package/lib/orchestrator/compare.d.ts.map +1 -0
- package/lib/orchestrator/compare.js +270 -0
- package/lib/orchestrator/compare.js.map +1 -0
- package/lib/orchestrator/comparison-identity.d.ts +10 -0
- package/lib/orchestrator/comparison-identity.d.ts.map +1 -0
- package/lib/orchestrator/comparison-identity.js +39 -0
- package/lib/orchestrator/comparison-identity.js.map +1 -0
- package/lib/orchestrator/config.d.ts +121 -0
- package/lib/orchestrator/config.d.ts.map +1 -0
- package/lib/orchestrator/config.js +176 -0
- package/lib/orchestrator/config.js.map +1 -0
- package/lib/orchestrator/content-bound-json.d.ts +5 -0
- package/lib/orchestrator/content-bound-json.d.ts.map +1 -0
- package/lib/orchestrator/content-bound-json.js +59 -0
- package/lib/orchestrator/content-bound-json.js.map +1 -0
- package/lib/orchestrator/discover.d.ts +45 -0
- package/lib/orchestrator/discover.d.ts.map +1 -0
- package/lib/orchestrator/discover.js +98 -0
- package/lib/orchestrator/discover.js.map +1 -0
- package/lib/orchestrator/doctor.d.ts +141 -0
- package/lib/orchestrator/doctor.d.ts.map +1 -0
- package/lib/orchestrator/doctor.js +525 -0
- package/lib/orchestrator/doctor.js.map +1 -0
- package/lib/orchestrator/driver-session.d.ts +177 -0
- package/lib/orchestrator/driver-session.d.ts.map +1 -0
- package/lib/orchestrator/driver-session.js +396 -0
- package/lib/orchestrator/driver-session.js.map +1 -0
- package/lib/orchestrator/evaluator-identity.d.ts +7 -0
- package/lib/orchestrator/evaluator-identity.d.ts.map +1 -0
- package/lib/orchestrator/evaluator-identity.js +42 -0
- package/lib/orchestrator/evaluator-identity.js.map +1 -0
- package/lib/orchestrator/experiment-budget.d.ts +11 -0
- package/lib/orchestrator/experiment-budget.d.ts.map +1 -0
- package/lib/orchestrator/experiment-budget.js +51 -0
- package/lib/orchestrator/experiment-budget.js.map +1 -0
- package/lib/orchestrator/experiment-context.d.ts +43 -0
- package/lib/orchestrator/experiment-context.d.ts.map +1 -0
- package/lib/orchestrator/experiment-context.js +9 -0
- package/lib/orchestrator/experiment-context.js.map +1 -0
- package/lib/orchestrator/experiment-contracts.d.ts +290 -0
- package/lib/orchestrator/experiment-contracts.d.ts.map +1 -0
- package/lib/orchestrator/experiment-contracts.js +38 -0
- package/lib/orchestrator/experiment-contracts.js.map +1 -0
- package/lib/orchestrator/experiment-corpus.d.ts +21 -0
- package/lib/orchestrator/experiment-corpus.d.ts.map +1 -0
- package/lib/orchestrator/experiment-corpus.js +276 -0
- package/lib/orchestrator/experiment-corpus.js.map +1 -0
- package/lib/orchestrator/experiment-evaluation.d.ts +44 -0
- package/lib/orchestrator/experiment-evaluation.d.ts.map +1 -0
- package/lib/orchestrator/experiment-evaluation.js +542 -0
- package/lib/orchestrator/experiment-evaluation.js.map +1 -0
- package/lib/orchestrator/experiment-finish.d.ts +6 -0
- package/lib/orchestrator/experiment-finish.d.ts.map +1 -0
- package/lib/orchestrator/experiment-finish.js +19 -0
- package/lib/orchestrator/experiment-finish.js.map +1 -0
- package/lib/orchestrator/experiment-identity.d.ts +6 -0
- package/lib/orchestrator/experiment-identity.d.ts.map +1 -0
- package/lib/orchestrator/experiment-identity.js +257 -0
- package/lib/orchestrator/experiment-identity.js.map +1 -0
- package/lib/orchestrator/experiment-loader.d.ts +175 -0
- package/lib/orchestrator/experiment-loader.d.ts.map +1 -0
- package/lib/orchestrator/experiment-loader.js +77 -0
- package/lib/orchestrator/experiment-loader.js.map +1 -0
- package/lib/orchestrator/experiment-report.d.ts +450 -0
- package/lib/orchestrator/experiment-report.d.ts.map +1 -0
- package/lib/orchestrator/experiment-report.js +570 -0
- package/lib/orchestrator/experiment-report.js.map +1 -0
- package/lib/orchestrator/experiment-runs.d.ts +379 -0
- package/lib/orchestrator/experiment-runs.d.ts.map +1 -0
- package/lib/orchestrator/experiment-runs.js +796 -0
- package/lib/orchestrator/experiment-runs.js.map +1 -0
- package/lib/orchestrator/experiment-runtime-identity.d.ts +41 -0
- package/lib/orchestrator/experiment-runtime-identity.d.ts.map +1 -0
- package/lib/orchestrator/experiment-runtime-identity.js +411 -0
- package/lib/orchestrator/experiment-runtime-identity.js.map +1 -0
- package/lib/orchestrator/experiment-selection.d.ts +25 -0
- package/lib/orchestrator/experiment-selection.d.ts.map +1 -0
- package/lib/orchestrator/experiment-selection.js +286 -0
- package/lib/orchestrator/experiment-selection.js.map +1 -0
- package/lib/orchestrator/experiment.d.ts +11 -0
- package/lib/orchestrator/experiment.d.ts.map +1 -0
- package/lib/orchestrator/experiment.js +639 -0
- package/lib/orchestrator/experiment.js.map +1 -0
- package/lib/orchestrator/fixture-identity.d.ts +7 -0
- package/lib/orchestrator/fixture-identity.d.ts.map +1 -0
- package/lib/orchestrator/fixture-identity.js +55 -0
- package/lib/orchestrator/fixture-identity.js.map +1 -0
- package/lib/orchestrator/fs-read.d.ts +19 -0
- package/lib/orchestrator/fs-read.d.ts.map +1 -0
- package/lib/orchestrator/fs-read.js +113 -0
- package/lib/orchestrator/fs-read.js.map +1 -0
- package/lib/orchestrator/grader-experiment.d.ts +190 -0
- package/lib/orchestrator/grader-experiment.d.ts.map +1 -0
- package/lib/orchestrator/grader-experiment.js +579 -0
- package/lib/orchestrator/grader-experiment.js.map +1 -0
- package/lib/orchestrator/grading.d.ts +31 -0
- package/lib/orchestrator/grading.d.ts.map +1 -0
- package/lib/orchestrator/grading.js +186 -0
- package/lib/orchestrator/grading.js.map +1 -0
- package/lib/orchestrator/index.d.ts +22 -0
- package/lib/orchestrator/index.d.ts.map +1 -0
- package/lib/orchestrator/index.js +30 -0
- package/lib/orchestrator/index.js.map +1 -0
- package/lib/orchestrator/lifecycle-hook-execution.d.ts +4 -0
- package/lib/orchestrator/lifecycle-hook-execution.d.ts.map +1 -0
- package/lib/orchestrator/lifecycle-hook-execution.js +67 -0
- package/lib/orchestrator/lifecycle-hook-execution.js.map +1 -0
- package/lib/orchestrator/list-runs.d.ts +33 -0
- package/lib/orchestrator/list-runs.d.ts.map +1 -0
- package/lib/orchestrator/list-runs.js +308 -0
- package/lib/orchestrator/list-runs.js.map +1 -0
- package/lib/orchestrator/loader.d.ts +3 -0
- package/lib/orchestrator/loader.d.ts.map +1 -0
- package/lib/orchestrator/loader.js +17 -0
- package/lib/orchestrator/loader.js.map +1 -0
- package/lib/orchestrator/optimization-lifecycle.d.ts +12 -0
- package/lib/orchestrator/optimization-lifecycle.d.ts.map +1 -0
- package/lib/orchestrator/optimization-lifecycle.js +92 -0
- package/lib/orchestrator/optimization-lifecycle.js.map +1 -0
- package/lib/orchestrator/orchestrator.d.ts +144 -0
- package/lib/orchestrator/orchestrator.d.ts.map +1 -0
- package/lib/orchestrator/orchestrator.js +632 -0
- package/lib/orchestrator/orchestrator.js.map +1 -0
- package/lib/orchestrator/owned-lock.d.ts +17 -0
- package/lib/orchestrator/owned-lock.d.ts.map +1 -0
- package/lib/orchestrator/owned-lock.js +149 -0
- package/lib/orchestrator/owned-lock.js.map +1 -0
- package/lib/orchestrator/package-version.d.ts +2 -0
- package/lib/orchestrator/package-version.d.ts.map +1 -0
- package/lib/orchestrator/package-version.js +4 -0
- package/lib/orchestrator/package-version.js.map +1 -0
- package/lib/orchestrator/provenance.d.ts +5 -0
- package/lib/orchestrator/provenance.d.ts.map +1 -0
- package/lib/orchestrator/provenance.js +137 -0
- package/lib/orchestrator/provenance.js.map +1 -0
- package/lib/orchestrator/regrade.d.ts +80 -0
- package/lib/orchestrator/regrade.d.ts.map +1 -0
- package/lib/orchestrator/regrade.js +433 -0
- package/lib/orchestrator/regrade.js.map +1 -0
- package/lib/orchestrator/rubric-loader.d.ts +7 -0
- package/lib/orchestrator/rubric-loader.d.ts.map +1 -0
- package/lib/orchestrator/rubric-loader.js +65 -0
- package/lib/orchestrator/rubric-loader.js.map +1 -0
- package/lib/orchestrator/run-dir.d.ts +40 -0
- package/lib/orchestrator/run-dir.d.ts.map +1 -0
- package/lib/orchestrator/run-dir.js +161 -0
- package/lib/orchestrator/run-dir.js.map +1 -0
- package/lib/orchestrator/run-execution.d.ts +30 -0
- package/lib/orchestrator/run-execution.d.ts.map +1 -0
- package/lib/orchestrator/run-execution.js +531 -0
- package/lib/orchestrator/run-execution.js.map +1 -0
- package/lib/orchestrator/run-lifecycle.d.ts +115 -0
- package/lib/orchestrator/run-lifecycle.d.ts.map +1 -0
- package/lib/orchestrator/run-lifecycle.js +136 -0
- package/lib/orchestrator/run-lifecycle.js.map +1 -0
- package/lib/orchestrator/suite-compare.d.ts +76 -0
- package/lib/orchestrator/suite-compare.d.ts.map +1 -0
- package/lib/orchestrator/suite-compare.js +159 -0
- package/lib/orchestrator/suite-compare.js.map +1 -0
- package/lib/orchestrator/suite-lifecycle.d.ts +157 -0
- package/lib/orchestrator/suite-lifecycle.d.ts.map +1 -0
- package/lib/orchestrator/suite-lifecycle.js +253 -0
- package/lib/orchestrator/suite-lifecycle.js.map +1 -0
- package/lib/orchestrator/suite-runs.d.ts +91 -0
- package/lib/orchestrator/suite-runs.d.ts.map +1 -0
- package/lib/orchestrator/suite-runs.js +157 -0
- package/lib/orchestrator/suite-runs.js.map +1 -0
- package/lib/orchestrator/suite-summary.d.ts +109 -0
- package/lib/orchestrator/suite-summary.d.ts.map +1 -0
- package/lib/orchestrator/suite-summary.js +213 -0
- package/lib/orchestrator/suite-summary.js.map +1 -0
- package/lib/orchestrator/trace-limits.d.ts +20 -0
- package/lib/orchestrator/trace-limits.d.ts.map +1 -0
- package/lib/orchestrator/trace-limits.js +28 -0
- package/lib/orchestrator/trace-limits.js.map +1 -0
- package/lib/orchestrator/validate-plugin-config.d.ts +10 -0
- package/lib/orchestrator/validate-plugin-config.d.ts.map +1 -0
- package/lib/orchestrator/validate-plugin-config.js +26 -0
- package/lib/orchestrator/validate-plugin-config.js.map +1 -0
- package/package.json +84 -0
- package/skills/lux/SKILL.md +85 -0
- package/skills/lux/references/cli.md +102 -0
- package/skills/lux/references/eval-authoring.md +105 -0
- package/skills/lux-answerer/SKILL.md +169 -0
- package/src/answerers/claude-code/index.ts +342 -0
- package/src/answerers/persona/index.ts +327 -0
- package/src/answerers/scripted/index.ts +186 -0
- package/src/answerers/shared.ts +23 -0
- package/src/answerers/terminal/index.ts +117 -0
- package/src/assertions/core/command-exits-zero.ts +94 -0
- package/src/assertions/core/event-checks.ts +138 -0
- package/src/assertions/core/file-checks.ts +336 -0
- package/src/assertions/core/helpers.ts +203 -0
- package/src/assertions/core/index.ts +80 -0
- package/src/assertions/core/json-pointer-equals.ts +84 -0
- package/src/assertions/core/output-checks.ts +134 -0
- package/src/assertions/core/predicate.ts +67 -0
- package/src/assertions/core/resource-checks.ts +180 -0
- package/src/assertions/core/safe-regex.ts +196 -0
- package/src/assertions/core/tool-called-with.ts +68 -0
- package/src/assertions/core/tool-calls.ts +28 -0
- package/src/assertions/core/tool-invocation.ts +198 -0
- package/src/assertions/core/tool-result-checks.ts +211 -0
- package/src/assertions/mcp/discovery-checks.ts +139 -0
- package/src/assertions/mcp/index.ts +37 -0
- package/src/assertions/rubric/index.ts +258 -0
- package/src/assertions/rubric/internal.ts +367 -0
- package/src/authoring.ts +2 -0
- package/src/cli/bin.ts +14 -0
- package/src/cli/command-runtime.ts +34 -0
- package/src/cli/init.ts +410 -0
- package/src/cli/program.ts +992 -0
- package/src/cli/render/format.ts +69 -0
- package/src/cli/render/reporter.ts +643 -0
- package/src/cli/render/tty.ts +314 -0
- package/src/cli/run-options.ts +82 -0
- package/src/cli/skills.ts +129 -0
- package/src/core/annotation.ts +104 -0
- package/src/core/answerer.ts +75 -0
- package/src/core/artifact-evidence.ts +249 -0
- package/src/core/artifact-snapshot.ts +429 -0
- package/src/core/assertion.ts +156 -0
- package/src/core/case.ts +103 -0
- package/src/core/conversation-turn.ts +47 -0
- package/src/core/driver.ts +75 -0
- package/src/core/emitter.ts +38 -0
- package/src/core/events.ts +135 -0
- package/src/core/exec.ts +263 -0
- package/src/core/experiment.ts +467 -0
- package/src/core/glob.ts +31 -0
- package/src/core/hash.ts +237 -0
- package/src/core/index.ts +28 -0
- package/src/core/lifecycle-fixtures.ts +145 -0
- package/src/core/lifecycle-hooks.ts +101 -0
- package/src/core/mcp-events.ts +57 -0
- package/src/core/model-cli.ts +271 -0
- package/src/core/observer.ts +50 -0
- package/src/core/platform-process.ts +284 -0
- package/src/core/registry.ts +57 -0
- package/src/core/rubric.ts +52 -0
- package/src/core/run.ts +144 -0
- package/src/core/statistics.ts +194 -0
- package/src/core/subject.ts +50 -0
- package/src/core/tool-events.ts +292 -0
- package/src/core/usage.ts +123 -0
- package/src/core/wire.ts +135 -0
- package/src/core/zod.ts +20 -0
- package/src/drivers/claude-code/index.ts +866 -0
- package/src/drivers/claude-code/parse-events.ts +464 -0
- package/src/drivers/codex/app-events.ts +218 -0
- package/src/drivers/codex/config.ts +128 -0
- package/src/drivers/codex/index.ts +995 -0
- package/src/drivers/mcp/index.ts +351 -0
- package/src/drivers/mcp/transport.ts +222 -0
- package/src/drivers/shared/artifacts.ts +86 -0
- package/src/drivers/shared/secure-copy.ts +40 -0
- package/src/drivers/subprocess/index.ts +490 -0
- package/src/index.ts +594 -0
- package/src/optimization/reflective.ts +319 -0
- package/src/orchestrator/annotation-loader.ts +97 -0
- package/src/orchestrator/annotation-store.ts +112 -0
- package/src/orchestrator/authored-dependencies.ts +193 -0
- package/src/orchestrator/campaign-lifecycle.ts +181 -0
- package/src/orchestrator/candidate-integrity.ts +18 -0
- package/src/orchestrator/candidates.ts +683 -0
- package/src/orchestrator/compare.ts +358 -0
- package/src/orchestrator/comparison-identity.ts +45 -0
- package/src/orchestrator/config.ts +205 -0
- package/src/orchestrator/content-bound-json.ts +71 -0
- package/src/orchestrator/discover.ts +132 -0
- package/src/orchestrator/doctor.ts +781 -0
- package/src/orchestrator/driver-session.ts +507 -0
- package/src/orchestrator/evaluator-identity.ts +45 -0
- package/src/orchestrator/experiment-budget.ts +61 -0
- package/src/orchestrator/experiment-context.ts +41 -0
- package/src/orchestrator/experiment-contracts.ts +43 -0
- package/src/orchestrator/experiment-corpus.ts +416 -0
- package/src/orchestrator/experiment-evaluation.ts +749 -0
- package/src/orchestrator/experiment-finish.ts +33 -0
- package/src/orchestrator/experiment-identity.ts +356 -0
- package/src/orchestrator/experiment-loader.ts +105 -0
- package/src/orchestrator/experiment-report.ts +788 -0
- package/src/orchestrator/experiment-runs.ts +960 -0
- package/src/orchestrator/experiment-runtime-identity.ts +465 -0
- package/src/orchestrator/experiment-selection.ts +467 -0
- package/src/orchestrator/experiment.ts +991 -0
- package/src/orchestrator/fixture-identity.ts +67 -0
- package/src/orchestrator/fs-read.ts +126 -0
- package/src/orchestrator/grader-experiment.ts +856 -0
- package/src/orchestrator/grading.ts +260 -0
- package/src/orchestrator/index.ts +186 -0
- package/src/orchestrator/lifecycle-hook-execution.ts +90 -0
- package/src/orchestrator/list-runs.ts +384 -0
- package/src/orchestrator/loader.ts +19 -0
- package/src/orchestrator/optimization-lifecycle.ts +126 -0
- package/src/orchestrator/orchestrator.ts +919 -0
- package/src/orchestrator/owned-lock.ts +147 -0
- package/src/orchestrator/package-version.ts +5 -0
- package/src/orchestrator/provenance.ts +140 -0
- package/src/orchestrator/regrade.ts +580 -0
- package/src/orchestrator/rubric-loader.ts +74 -0
- package/src/orchestrator/run-dir.ts +209 -0
- package/src/orchestrator/run-execution.ts +694 -0
- package/src/orchestrator/run-lifecycle.ts +174 -0
- package/src/orchestrator/suite-compare.ts +195 -0
- package/src/orchestrator/suite-lifecycle.ts +335 -0
- package/src/orchestrator/suite-runs.ts +202 -0
- package/src/orchestrator/suite-summary.ts +276 -0
- package/src/orchestrator/trace-limits.ts +65 -0
- package/src/orchestrator/validate-plugin-config.ts +34 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { JSONRPCMessageSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { spawnManagedProcess } from "../../core/index.js";
|
|
3
|
+
const DEFAULT_MAX_PROTOCOL_LINE_BYTES = 10_000_000;
|
|
4
|
+
const DEFAULT_MAX_STDERR_TAIL_CHARS = 8_192;
|
|
5
|
+
const DEFAULT_KILL_GRACE_MS = 5_000;
|
|
6
|
+
/**
|
|
7
|
+
* MCP's stdio framing with Lux-owned process-group and memory boundaries.
|
|
8
|
+
* Protocol messages remain SDK-validated, but no SDK process lifecycle leaks
|
|
9
|
+
* through this transport.
|
|
10
|
+
*/
|
|
11
|
+
export class McpStdioClientTransport {
|
|
12
|
+
onclose;
|
|
13
|
+
onerror;
|
|
14
|
+
onmessage;
|
|
15
|
+
options;
|
|
16
|
+
maxProtocolLineBytes;
|
|
17
|
+
maxStderrTailChars;
|
|
18
|
+
process = null;
|
|
19
|
+
stdoutChunks = [];
|
|
20
|
+
stdoutBytes = 0;
|
|
21
|
+
stderrTail = "";
|
|
22
|
+
stderrTruncated = false;
|
|
23
|
+
closePromise = null;
|
|
24
|
+
closeNotified = false;
|
|
25
|
+
started = false;
|
|
26
|
+
closing = false;
|
|
27
|
+
transportError = null;
|
|
28
|
+
constructor(options) {
|
|
29
|
+
this.options = options;
|
|
30
|
+
this.maxProtocolLineBytes = options.maxProtocolLineBytes ?? DEFAULT_MAX_PROTOCOL_LINE_BYTES;
|
|
31
|
+
this.maxStderrTailChars = options.maxStderrTailChars ?? DEFAULT_MAX_STDERR_TAIL_CHARS;
|
|
32
|
+
}
|
|
33
|
+
get failure() {
|
|
34
|
+
return this.transportError;
|
|
35
|
+
}
|
|
36
|
+
get pid() {
|
|
37
|
+
return this.process?.child.pid ?? null;
|
|
38
|
+
}
|
|
39
|
+
async start() {
|
|
40
|
+
if (this.started)
|
|
41
|
+
throw new Error("MCP stdio transport already started");
|
|
42
|
+
this.started = true;
|
|
43
|
+
const managed = spawnManagedProcess(this.options.command, this.options.args ?? [], {
|
|
44
|
+
killGraceMs: this.options.killGraceMs ?? DEFAULT_KILL_GRACE_MS,
|
|
45
|
+
...(this.options.cwd === undefined ? {} : { cwd: this.options.cwd }),
|
|
46
|
+
...(this.options.env === undefined ? {} : { env: this.options.env }),
|
|
47
|
+
});
|
|
48
|
+
this.process = managed;
|
|
49
|
+
const { child } = managed;
|
|
50
|
+
child.stdout.on("data", (chunk) => this.readStdout(chunk));
|
|
51
|
+
child.stdout.on("end", () => {
|
|
52
|
+
if (!this.closing && this.stdoutBytes > 0) {
|
|
53
|
+
this.fail(new Error(`MCP server stdout ended with an unterminated ${this.stdoutBytes}-byte protocol line`));
|
|
54
|
+
}
|
|
55
|
+
this.clearStdout();
|
|
56
|
+
});
|
|
57
|
+
child.stdout.on("error", (err) => this.fail(new Error(`MCP server stdout: ${err.message}`)));
|
|
58
|
+
child.stderr.setEncoding("utf8");
|
|
59
|
+
child.stderr.on("data", (chunk) => this.readStderr(chunk));
|
|
60
|
+
child.stderr.on("end", () => this.flushStderr());
|
|
61
|
+
child.stderr.on("error", (err) => this.fail(new Error(`MCP server stderr: ${err.message}`)));
|
|
62
|
+
void managed.exited.then(() => {
|
|
63
|
+
this.flushStderr();
|
|
64
|
+
this.clearStdout();
|
|
65
|
+
this.process = null;
|
|
66
|
+
this.notifyClose();
|
|
67
|
+
});
|
|
68
|
+
try {
|
|
69
|
+
await managed.spawned;
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
73
|
+
this.transportError ??= error;
|
|
74
|
+
await managed.terminate();
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async send(message) {
|
|
79
|
+
const stdin = this.process?.child.stdin;
|
|
80
|
+
if (!stdin || this.closing || stdin.destroyed)
|
|
81
|
+
throw new Error("MCP stdio transport is closed");
|
|
82
|
+
const serialized = `${JSON.stringify(message)}\n`;
|
|
83
|
+
await new Promise((resolve, reject) => {
|
|
84
|
+
stdin.write(serialized, (err) => {
|
|
85
|
+
if (err)
|
|
86
|
+
reject(new Error(`MCP server stdin: ${err.message}`, { cause: err }));
|
|
87
|
+
else
|
|
88
|
+
resolve();
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
close() {
|
|
93
|
+
if (this.closePromise)
|
|
94
|
+
return this.closePromise;
|
|
95
|
+
this.closing = true;
|
|
96
|
+
this.closePromise = (async () => {
|
|
97
|
+
const managed = this.process;
|
|
98
|
+
if (managed) {
|
|
99
|
+
managed.child.stdin.end();
|
|
100
|
+
await managed.terminate();
|
|
101
|
+
}
|
|
102
|
+
this.clearStdout();
|
|
103
|
+
this.flushStderr();
|
|
104
|
+
this.notifyClose();
|
|
105
|
+
})();
|
|
106
|
+
return this.closePromise;
|
|
107
|
+
}
|
|
108
|
+
readStdout(chunk) {
|
|
109
|
+
if (this.transportError || this.closing)
|
|
110
|
+
return;
|
|
111
|
+
let offset = 0;
|
|
112
|
+
while (offset < chunk.length) {
|
|
113
|
+
const newline = chunk.indexOf(0x0a, offset);
|
|
114
|
+
const end = newline === -1 ? chunk.length : newline;
|
|
115
|
+
const segment = chunk.subarray(offset, end);
|
|
116
|
+
const lineBytes = this.stdoutBytes + segment.length;
|
|
117
|
+
if (lineBytes > this.maxProtocolLineBytes) {
|
|
118
|
+
this.fail(new Error(`MCP server stdout protocol line exceeded ${this.maxProtocolLineBytes} bytes`));
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (segment.length > 0) {
|
|
122
|
+
this.stdoutChunks.push(segment);
|
|
123
|
+
this.stdoutBytes = lineBytes;
|
|
124
|
+
}
|
|
125
|
+
if (newline === -1)
|
|
126
|
+
return;
|
|
127
|
+
this.dispatchLine(Buffer.concat(this.stdoutChunks, this.stdoutBytes));
|
|
128
|
+
if (this.transportError)
|
|
129
|
+
return;
|
|
130
|
+
this.clearStdout();
|
|
131
|
+
offset = newline + 1;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
clearStdout() {
|
|
135
|
+
this.stdoutChunks = [];
|
|
136
|
+
this.stdoutBytes = 0;
|
|
137
|
+
}
|
|
138
|
+
dispatchLine(lineBuffer) {
|
|
139
|
+
const line = lineBuffer.toString("utf8").replace(/\r$/, "");
|
|
140
|
+
try {
|
|
141
|
+
const message = JSONRPCMessageSchema.parse(JSON.parse(line));
|
|
142
|
+
this.onmessage?.(message);
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
this.fail(new Error(`MCP server emitted an invalid JSON-RPC line: ${err instanceof Error ? err.message : String(err)}`, { cause: err }));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
readStderr(chunk) {
|
|
149
|
+
let offset = 0;
|
|
150
|
+
while (offset < chunk.length) {
|
|
151
|
+
const newline = chunk.indexOf("\n", offset);
|
|
152
|
+
const end = newline === -1 ? chunk.length : newline;
|
|
153
|
+
this.appendStderr(chunk.slice(offset, end));
|
|
154
|
+
if (newline === -1)
|
|
155
|
+
return;
|
|
156
|
+
this.flushStderr();
|
|
157
|
+
offset = newline + 1;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
appendStderr(text) {
|
|
161
|
+
if (text.length === 0)
|
|
162
|
+
return;
|
|
163
|
+
if (this.stderrTail.length + text.length > this.maxStderrTailChars) {
|
|
164
|
+
this.stderrTruncated = true;
|
|
165
|
+
}
|
|
166
|
+
this.stderrTail = `${this.stderrTail}${text}`.slice(-this.maxStderrTailChars);
|
|
167
|
+
}
|
|
168
|
+
flushStderr() {
|
|
169
|
+
if (!this.stderrTail && !this.stderrTruncated)
|
|
170
|
+
return;
|
|
171
|
+
const line = this.stderrTail.replace(/\r$/, "");
|
|
172
|
+
this.options.writeStderr?.(this.stderrTruncated ? `[truncated] …${line}` : line);
|
|
173
|
+
this.stderrTail = "";
|
|
174
|
+
this.stderrTruncated = false;
|
|
175
|
+
}
|
|
176
|
+
fail(error) {
|
|
177
|
+
if (this.transportError || this.closing)
|
|
178
|
+
return;
|
|
179
|
+
this.transportError = error;
|
|
180
|
+
this.onerror?.(error);
|
|
181
|
+
void this.close();
|
|
182
|
+
}
|
|
183
|
+
notifyClose() {
|
|
184
|
+
if (this.closeNotified)
|
|
185
|
+
return;
|
|
186
|
+
this.closeNotified = true;
|
|
187
|
+
this.onclose?.();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/drivers/mcp/transport.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAu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AC;QACD,IAAI,CAAC,UAAU,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAChF,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE,OAAO;QACtD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACjF,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;IAC/B,CAAC;IAEO,IAAI,CAAC,KAAY;QACvB,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QAChD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACtB,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;IAEO,WAAW;QACjB,IAAI,IAAI,CAAC,aAAa;YAAE,OAAO;QAC/B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Artifact } from "../../core/index.js";
|
|
2
|
+
/** Enumerate agent-authored files without following symlinks or build/dependency trees. */
|
|
3
|
+
export declare const walkArtifacts: (root: string, max?: number) => Promise<Artifact[]>;
|
|
4
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/drivers/shared/artifacts.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,QAAQ,EAEd,MAAM,qBAAqB,CAAC;AAI7B,2FAA2F;AAC3F,eAAO,MAAM,aAAa,SAAgB,MAAM,mBAAc,OAAO,CAAC,QAAQ,EAAE,CA0E/E,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { lstat, readdir, realpath } from "node:fs/promises";
|
|
2
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { ARTIFACT_SNAPSHOT_MANIFEST, readArtifactSnapshotManifest, } from "../../core/index.js";
|
|
4
|
+
const IGNORED_DIRS = new Set(["node_modules", "lib", "dist"]);
|
|
5
|
+
/** Enumerate agent-authored files without following symlinks or build/dependency trees. */
|
|
6
|
+
export const walkArtifacts = async (root, max = 500) => {
|
|
7
|
+
if (!Number.isSafeInteger(max) || max <= 0) {
|
|
8
|
+
throw new RangeError("artifact collection max must be a positive safe integer");
|
|
9
|
+
}
|
|
10
|
+
const requestedRoot = resolve(root);
|
|
11
|
+
const rootMetadata = await lstat(requestedRoot);
|
|
12
|
+
if (!rootMetadata.isDirectory() || rootMetadata.isSymbolicLink()) {
|
|
13
|
+
throw new Error(`artifact root must be a real directory: ${root}`);
|
|
14
|
+
}
|
|
15
|
+
const canonicalRoot = await realpath(requestedRoot);
|
|
16
|
+
const out = [];
|
|
17
|
+
const addArtifact = (path, size) => {
|
|
18
|
+
if (out.length >= max) {
|
|
19
|
+
throw new Error(`artifact collection exceeds ${max} files: ${root}`);
|
|
20
|
+
}
|
|
21
|
+
out.push({ path, size });
|
|
22
|
+
};
|
|
23
|
+
const collectSnapshot = async (dir) => {
|
|
24
|
+
const manifest = await readArtifactSnapshotManifest(dir);
|
|
25
|
+
if (!manifest)
|
|
26
|
+
return false;
|
|
27
|
+
if (manifest.name !== basename(dir)) {
|
|
28
|
+
throw new Error(`artifact snapshot manifest names ${manifest.name}, expected ${basename(dir)}`);
|
|
29
|
+
}
|
|
30
|
+
const canonicalSnapshotRoot = await realpath(dir);
|
|
31
|
+
for (const file of manifest.files) {
|
|
32
|
+
const full = resolve(dir, file.path);
|
|
33
|
+
const canonicalParent = await realpath(dirname(full));
|
|
34
|
+
if (canonicalParent !== canonicalSnapshotRoot &&
|
|
35
|
+
!canonicalParent.startsWith(`${canonicalSnapshotRoot}${sep}`)) {
|
|
36
|
+
throw new Error(`artifact snapshot path resolves outside its root: ${file.path}`);
|
|
37
|
+
}
|
|
38
|
+
const metadata = await lstat(full);
|
|
39
|
+
if (metadata.isSymbolicLink() || !metadata.isFile() || metadata.size !== file.bytes) {
|
|
40
|
+
throw new Error(`artifact snapshot file does not match its manifest: ${file.path}`);
|
|
41
|
+
}
|
|
42
|
+
addArtifact(relative(requestedRoot, full).split(sep).join("/"), metadata.size);
|
|
43
|
+
}
|
|
44
|
+
const manifestPath = join(dir, ARTIFACT_SNAPSHOT_MANIFEST);
|
|
45
|
+
const manifestStats = await lstat(manifestPath);
|
|
46
|
+
addArtifact(relative(requestedRoot, manifestPath).split(sep).join("/"), manifestStats.size);
|
|
47
|
+
return true;
|
|
48
|
+
};
|
|
49
|
+
const walk = async (dir) => {
|
|
50
|
+
const canonicalDirectory = await realpath(dir);
|
|
51
|
+
if (canonicalDirectory !== canonicalRoot &&
|
|
52
|
+
!canonicalDirectory.startsWith(`${canonicalRoot}${sep}`)) {
|
|
53
|
+
throw new Error(`artifact directory resolves outside its root: ${dir}`);
|
|
54
|
+
}
|
|
55
|
+
if (await collectSnapshot(dir))
|
|
56
|
+
return;
|
|
57
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
58
|
+
entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
59
|
+
for (const entry of entries) {
|
|
60
|
+
if (entry.isSymbolicLink())
|
|
61
|
+
continue;
|
|
62
|
+
const full = join(dir, entry.name);
|
|
63
|
+
if (entry.isDirectory()) {
|
|
64
|
+
if (await collectSnapshot(full))
|
|
65
|
+
continue;
|
|
66
|
+
if (entry.name.startsWith(".") || IGNORED_DIRS.has(entry.name))
|
|
67
|
+
continue;
|
|
68
|
+
await walk(full);
|
|
69
|
+
}
|
|
70
|
+
else if (entry.isFile()) {
|
|
71
|
+
const metadata = await lstat(full);
|
|
72
|
+
if (metadata.isFile()) {
|
|
73
|
+
addArtifact(relative(requestedRoot, full).split(sep).join("/"), metadata.size);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
await walk(requestedRoot);
|
|
79
|
+
return out;
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../src/drivers/shared/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EACL,0BAA0B,EAE1B,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9D,2FAA2F;AAC3F,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,IAAY,EAAE,GAAG,GAAG,GAAG,EAAuB,EAAE;IAClF,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,UAAU,CAAC,yDAAyD,CAAC,CAAC;IAClF,CAAC;IACD,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,aAAa,C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AAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-copy.d.ts","sourceRoot":"","sources":["../../../src/drivers/shared/secure-copy.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,uBAAuB,eACtB,MAAM,cACN,MAAM,cACN,MAAM,KACjB,OAAO,CAAC,IAAI,CA0Bd,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { constants, lstat, open, realpath, stat } from "node:fs/promises";
|
|
2
|
+
import { resolve, sep } from "node:path";
|
|
3
|
+
const isWithin = (parent, child) => {
|
|
4
|
+
const root = resolve(parent);
|
|
5
|
+
const path = resolve(child);
|
|
6
|
+
return path === root || path.startsWith(`${root}${sep}`);
|
|
7
|
+
};
|
|
8
|
+
export const copyRegularFileNoFollow = async (sourceRoot, sourcePath, targetPath) => {
|
|
9
|
+
if ((await lstat(sourcePath)).isSymbolicLink()) {
|
|
10
|
+
throw new Error(`artifact cannot be a symlink: ${sourcePath}`);
|
|
11
|
+
}
|
|
12
|
+
const source = await open(sourcePath, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0));
|
|
13
|
+
let target;
|
|
14
|
+
try {
|
|
15
|
+
const sourceStat = await source.stat();
|
|
16
|
+
if (!sourceStat.isFile())
|
|
17
|
+
throw new Error(`artifact is not a regular file: ${sourcePath}`);
|
|
18
|
+
const resolvedSource = await realpath(sourcePath);
|
|
19
|
+
if (!isWithin(sourceRoot, resolvedSource)) {
|
|
20
|
+
throw new Error(`artifact resolves outside the isolated workspace: ${sourcePath}`);
|
|
21
|
+
}
|
|
22
|
+
const resolvedStat = await stat(resolvedSource);
|
|
23
|
+
if (!resolvedStat.isFile() ||
|
|
24
|
+
resolvedStat.dev !== sourceStat.dev ||
|
|
25
|
+
resolvedStat.ino !== sourceStat.ino) {
|
|
26
|
+
throw new Error(`artifact changed while being collected: ${sourcePath}`);
|
|
27
|
+
}
|
|
28
|
+
target = await open(targetPath, "wx", sourceStat.mode & 0o777);
|
|
29
|
+
await target.writeFile(source.createReadStream({ autoClose: false }));
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
await Promise.allSettled([source.close(), ...(target ? [target.close()] : [])]);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=secure-copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-copy.js","sourceRoot":"","sources":["../../../src/drivers/shared/secure-copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,KAAa,EAAW,EAAE;IAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAC1C,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EACH,EAAE;IACjB,IAAI,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,iCAAiC,UAAU,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,QAAQ,GAAG,CAAC,SAAS,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC;IACxF,IAAI,MAAoD,CAAC;IACzD,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACvC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,UAAU,EAAE,CAAC,CAAC;QAC3F,MAAM,cAAc,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,qDAAqD,UAAU,EAAE,CAAC,CAAC;QACrF,CAAC;QACD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,CAAC;QAChD,IACE,CAAC,YAAY,CAAC,MAAM,EAAE;YACtB,YAAY,CAAC,GAAG,KAAK,UAAU,CAAC,GAAG;YACnC,YAAY,CAAC,GAAG,KAAK,UAAU,CAAC,GAAG,EACnC,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,2CAA2C,UAAU,EAAE,CAAC,CAAC;QAC3E,CAAC;QACD,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;QAC/D,MAAM,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type DriverPlugin, type FormatAnswerFn, type ParseEventFn } from "../../core/index.js";
|
|
3
|
+
export declare const SubprocessDriverConfigSchema: z.ZodObject<{
|
|
4
|
+
command: z.ZodString;
|
|
5
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
7
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8
|
+
inheritEnv: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
protocol: z.ZodDefault<z.ZodEnum<{
|
|
10
|
+
custom: "custom";
|
|
11
|
+
"lux-jsonl": "lux-jsonl";
|
|
12
|
+
}>>;
|
|
13
|
+
idleTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
maxInterrupts: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
maxArtifactFiles: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
maxLineBytes: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
parseEvent: z.ZodOptional<z.ZodCustom<ParseEventFn, ParseEventFn>>;
|
|
18
|
+
formatAnswer: z.ZodOptional<z.ZodCustom<FormatAnswerFn, FormatAnswerFn>>;
|
|
19
|
+
formatPrompt: z.ZodOptional<z.ZodCustom<(text: string) => string, (text: string) => string>>;
|
|
20
|
+
closeStdinAfterPrompt: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
export type SubprocessDriverConfig = z.infer<typeof SubprocessDriverConfigSchema>;
|
|
23
|
+
export declare const subprocessDriver: DriverPlugin<SubprocessDriverConfig>;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/drivers/subprocess/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAML,KAAK,YAAY,EAEjB,KAAK,cAAc,EAKnB,KAAK,YAAY,EAQlB,MAAM,qBAAqB,CAAC;AAG7B,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;mDAoCP,MAAM,KAAK,MAAM;;kBAY/C,CAAC;AAEL,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAuZlF,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,sBAAsB,CAIjE,CAAC"}
|