@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,92 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { formatZodIssues } from "./zod.js";
|
|
3
|
+
const ExpectedBooleanLabelSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
passed: z.boolean(),
|
|
6
|
+
score: z.number().min(0).max(1).optional(),
|
|
7
|
+
})
|
|
8
|
+
.strict();
|
|
9
|
+
export const GraderAnnotationSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
/** Stable label identity within the dataset. */
|
|
12
|
+
id: z.string().min(1),
|
|
13
|
+
/** Persisted Lux run containing the evidence to grade. */
|
|
14
|
+
runDir: z.string().min(1),
|
|
15
|
+
/** Candidate-relative declarative rubric whose assertions grade this run. */
|
|
16
|
+
rubricPath: z
|
|
17
|
+
.string()
|
|
18
|
+
.min(1)
|
|
19
|
+
.transform((path) => path.replaceAll("\\", "/")),
|
|
20
|
+
/** Optional selection labels used by experiment split selectors. */
|
|
21
|
+
tags: z.array(z.string()).default([]),
|
|
22
|
+
expected: z
|
|
23
|
+
.object({
|
|
24
|
+
casePassed: z.boolean().optional(),
|
|
25
|
+
caseScore: z.number().min(0).max(1).optional(),
|
|
26
|
+
assertions: z.record(z.string(), ExpectedBooleanLabelSchema).default({}),
|
|
27
|
+
})
|
|
28
|
+
.strict(),
|
|
29
|
+
/** Whether the label was independently authored or generated as test data. */
|
|
30
|
+
source: z.enum(["human", "synthetic"]),
|
|
31
|
+
annotator: z.string().min(1).optional(),
|
|
32
|
+
labeledAt: z.string().datetime().optional(),
|
|
33
|
+
reviewer: z.string().min(1).optional(),
|
|
34
|
+
/** Human rationale supplied to the rubric optimizer on mismatches. */
|
|
35
|
+
feedback: z.string().optional(),
|
|
36
|
+
meta: z.record(z.string(), z.unknown()).optional(),
|
|
37
|
+
})
|
|
38
|
+
.strict()
|
|
39
|
+
.superRefine((annotation, ctx) => {
|
|
40
|
+
if (annotation.expected.casePassed === undefined &&
|
|
41
|
+
annotation.expected.caseScore === undefined &&
|
|
42
|
+
Object.keys(annotation.expected.assertions).length === 0) {
|
|
43
|
+
ctx.addIssue({
|
|
44
|
+
code: "custom",
|
|
45
|
+
path: ["expected"],
|
|
46
|
+
message: "annotation requires a case pass/score label or at least one assertion label",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (annotation.rubricPath.startsWith("/") ||
|
|
50
|
+
annotation.rubricPath.split(/[\\/]/).includes("..")) {
|
|
51
|
+
ctx.addIssue({
|
|
52
|
+
code: "custom",
|
|
53
|
+
path: ["rubricPath"],
|
|
54
|
+
message: "rubricPath must stay within the experiment subject root",
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (!annotation.rubricPath.toLowerCase().endsWith(".json")) {
|
|
58
|
+
ctx.addIssue({
|
|
59
|
+
code: "custom",
|
|
60
|
+
path: ["rubricPath"],
|
|
61
|
+
message: "grader experiments require a declarative .json rubric",
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export const GraderAnnotationDatasetSchema = z
|
|
66
|
+
.object({
|
|
67
|
+
schemaVersion: z.literal(1),
|
|
68
|
+
annotations: z.array(GraderAnnotationSchema).min(1),
|
|
69
|
+
meta: z.record(z.string(), z.unknown()).optional(),
|
|
70
|
+
})
|
|
71
|
+
.strict()
|
|
72
|
+
.superRefine((dataset, ctx) => {
|
|
73
|
+
const ids = new Set();
|
|
74
|
+
for (const [index, annotation] of dataset.annotations.entries()) {
|
|
75
|
+
if (ids.has(annotation.id)) {
|
|
76
|
+
ctx.addIssue({
|
|
77
|
+
code: "custom",
|
|
78
|
+
path: ["annotations", index, "id"],
|
|
79
|
+
message: `duplicate annotation id '${annotation.id}'`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
ids.add(annotation.id);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
export const defineGraderAnnotations = (input) => {
|
|
86
|
+
const parsed = GraderAnnotationDatasetSchema.safeParse(input);
|
|
87
|
+
if (!parsed.success) {
|
|
88
|
+
throw new Error(`Invalid Lux grader annotations: ${formatZodIssues(parsed.error)}`);
|
|
89
|
+
}
|
|
90
|
+
return parsed.data;
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation.js","sourceRoot":"","sources":["../../src/core/annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,0BAA0B,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,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AK,CAAC,mCAAmC,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { Answer, Interrupt } from "./events.js";
|
|
3
|
+
import { type TokenUsage } from "./usage.js";
|
|
4
|
+
export type AnswerHistoryEntry = {
|
|
5
|
+
interrupt: Interrupt;
|
|
6
|
+
answer: Answer;
|
|
7
|
+
durationMs: number;
|
|
8
|
+
};
|
|
9
|
+
export type AnswererContext = {
|
|
10
|
+
persona: string | null;
|
|
11
|
+
prompt: string;
|
|
12
|
+
history: AnswerHistoryEntry[];
|
|
13
|
+
runDir: string;
|
|
14
|
+
/**
|
|
15
|
+
* Fires when the run is being torn down. Answerers that spawn subprocesses
|
|
16
|
+
* or block on external input must abandon the in-flight answer, or a
|
|
17
|
+
* Ctrl-C leaves billable agent calls running past the run's end.
|
|
18
|
+
*/
|
|
19
|
+
abortSignal?: AbortSignal;
|
|
20
|
+
/**
|
|
21
|
+
* Persists a model-attempt start before a model-backed answerer invokes its
|
|
22
|
+
* provider.
|
|
23
|
+
*/
|
|
24
|
+
recordModelAttemptStart?: (kind: "answerer") => Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Atomically settles one model-backed answer and re-checks campaign limits
|
|
27
|
+
* before another interrupt may invoke the provider.
|
|
28
|
+
*/
|
|
29
|
+
recordModelAttemptComplete?: (attemptId: string, accounting: AnswererModelCallAccounting) => Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
export declare const AnswererModelCallAccountingSchema: z.ZodObject<{
|
|
32
|
+
usage: z.ZodObject<{
|
|
33
|
+
input: z.ZodNumber;
|
|
34
|
+
output: z.ZodNumber;
|
|
35
|
+
cacheRead: z.ZodNumber;
|
|
36
|
+
cacheCreation: z.ZodNumber;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
unpricedModelCalls: z.ZodNumber;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
export type AnswererModelCallAccounting = z.infer<typeof AnswererModelCallAccountingSchema>;
|
|
42
|
+
export declare const AnswererModelAccountingSchema: z.ZodObject<{
|
|
43
|
+
calls: z.ZodNumber;
|
|
44
|
+
reportedCostUsd: z.ZodNumber;
|
|
45
|
+
unpricedModelCalls: z.ZodNumber;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
export type AnswererModelAccounting = z.infer<typeof AnswererModelAccountingSchema>;
|
|
48
|
+
export interface Answerer {
|
|
49
|
+
prepare(ctx: AnswererContext): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Must settle within a bounded time (every bundled answerer enforces its
|
|
52
|
+
* own wait budget). Drivers pause their idle clock while a question is
|
|
53
|
+
* outstanding — the user's thinking time is not the agent's — so an
|
|
54
|
+
* answer() that never settles hangs the run until its abort signal fires.
|
|
55
|
+
*/
|
|
56
|
+
answer(interrupt: Interrupt, ctx: AnswererContext): Promise<Answer>;
|
|
57
|
+
close(): Promise<void>;
|
|
58
|
+
/** Tokens spent playing the user, accumulated across every answer. */
|
|
59
|
+
usage?(): TokenUsage;
|
|
60
|
+
/** Model calls made by the answerer, kept separate from the subject driver. */
|
|
61
|
+
modelAccounting?(): AnswererModelAccounting;
|
|
62
|
+
}
|
|
63
|
+
export type AnswererPlugin<Cfg = unknown> = {
|
|
64
|
+
name: string;
|
|
65
|
+
configSchema?: z.ZodTypeAny;
|
|
66
|
+
create: (config: Cfg) => Answerer | Promise<Answerer>;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=answerer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"answerer.d.ts","sourceRoot":"","sources":["../../src/core/answerer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACx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CAAC;IACvB,sEAAsE;IACtE,KAAK,CAAC,IAAI,UAAU,CAAC;IACrB,+EAA+E;IAC/E,eAAe,CAAC,IAAI,uBAAuB,CAAC;CAC7C;AAED,MAAM,MAAM,cAAc,CAAC,GAAG,GAAG,OAAO,IAAI;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC;IAC5B,MAAM,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TokenUsageSchema } from "./usage.js";
|
|
3
|
+
export const AnswererModelCallAccountingSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
usage: TokenUsageSchema,
|
|
6
|
+
costUsd: z.number().nonnegative().optional(),
|
|
7
|
+
unpricedModelCalls: z.number().int().nonnegative(),
|
|
8
|
+
})
|
|
9
|
+
.strict();
|
|
10
|
+
export const AnswererModelAccountingSchema = z
|
|
11
|
+
.object({
|
|
12
|
+
calls: z.number().int().nonnegative(),
|
|
13
|
+
reportedCostUsd: z.number().nonnegative(),
|
|
14
|
+
unpricedModelCalls: z.number().int().nonnegative(),
|
|
15
|
+
})
|
|
16
|
+
.strict();
|
|
17
|
+
//# sourceMappingURL=answerer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"answerer.js","sourceRoot":"","sources":["../../src/core/answerer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAmB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAkC/D,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,KAAK,EAAE,gBAAgB;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC5C,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CACnD,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC;KAC3C,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACrC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE;IACzC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CACnD,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Stats } from "node:fs";
|
|
2
|
+
import type { Artifact } from "./driver.js";
|
|
3
|
+
import type { Run } from "./run.js";
|
|
4
|
+
export type RunArtifactInspection = {
|
|
5
|
+
target: string;
|
|
6
|
+
root: string;
|
|
7
|
+
artifact?: Artifact;
|
|
8
|
+
stats?: Stats;
|
|
9
|
+
issue?: string;
|
|
10
|
+
};
|
|
11
|
+
type RunArtifactEvidence = {
|
|
12
|
+
runDir: Run["runDir"];
|
|
13
|
+
artifacts: readonly Artifact[];
|
|
14
|
+
};
|
|
15
|
+
type ArtifactEvidenceBoundary = {
|
|
16
|
+
root: string;
|
|
17
|
+
indexedOnly: boolean;
|
|
18
|
+
};
|
|
19
|
+
/** Internal: bind a frozen Run object to its isolated artifact snapshot. */
|
|
20
|
+
export declare const bindRunArtifactEvidence: (run: RunArtifactEvidence, boundary: ArtifactEvidenceBoundary) => void;
|
|
21
|
+
/** Internal: whether a Run is confined to an isolated evidence snapshot. */
|
|
22
|
+
export declare const hasRunArtifactEvidenceBoundary: (run: RunArtifactEvidence) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the common root captured by a driver. The default run artifacts
|
|
25
|
+
* directory remains the fallback for empty or genuinely multi-root evidence.
|
|
26
|
+
*/
|
|
27
|
+
export declare const runArtifactsRoot: (run: RunArtifactEvidence) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Inspect one captured artifact without following symlinks or allowing a path
|
|
30
|
+
* to escape the root recorded by its driver. An exact artifact-index entry
|
|
31
|
+
* wins; otherwise Lux uses the run's common captured-artifact root.
|
|
32
|
+
*/
|
|
33
|
+
export declare const inspectRunArtifact: (run: RunArtifactEvidence, authoredPath: string) => Promise<RunArtifactInspection>;
|
|
34
|
+
export type ReadRunArtifactTextOptions = {
|
|
35
|
+
/**
|
|
36
|
+
* Maximum bytes read before UTF-8 decoding. Defaults to 5 MiB and cannot
|
|
37
|
+
* exceed Lux's 10 MiB public artifact-read ceiling.
|
|
38
|
+
*/
|
|
39
|
+
maxBytes?: number;
|
|
40
|
+
};
|
|
41
|
+
export declare const readInspectedFileBytes: (target: string, expected: Stats, maxBytes: number, label: string) => Promise<Buffer>;
|
|
42
|
+
export declare const readRunArtifactBytes: (run: RunArtifactEvidence, authoredPath: string, options?: ReadRunArtifactTextOptions) => Promise<Buffer>;
|
|
43
|
+
/**
|
|
44
|
+
* Read UTF-8 artifact evidence through Lux's traversal, symlink, regular-file,
|
|
45
|
+
* and size checks. Throws a bounded, path-specific error when evidence is not
|
|
46
|
+
* safe to consume.
|
|
47
|
+
*/
|
|
48
|
+
export declare const readRunArtifactText: (run: RunArtifactEvidence, authoredPath: string, options?: ReadRunArtifactTextOptions) => Promise<string>;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=artifact-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-evidence.d.ts","sourceRoot":"","sources":["../../src/core/artifact-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,GAAG,EAAE,MA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C"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { constants, lstat, open } from "node:fs/promises";
|
|
2
|
+
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
3
|
+
const DEFAULT_ARTIFACT_READ_BYTES = 5 * 1024 * 1024;
|
|
4
|
+
const MAX_ARTIFACT_READ_BYTES = 10 * 1024 * 1024;
|
|
5
|
+
const artifactEvidenceBoundaries = new WeakMap();
|
|
6
|
+
/** Internal: bind a frozen Run object to its isolated artifact snapshot. */
|
|
7
|
+
export const bindRunArtifactEvidence = (run, boundary) => {
|
|
8
|
+
artifactEvidenceBoundaries.set(run, { ...boundary, root: resolve(boundary.root) });
|
|
9
|
+
};
|
|
10
|
+
/** Internal: whether a Run is confined to an isolated evidence snapshot. */
|
|
11
|
+
export const hasRunArtifactEvidenceBoundary = (run) => artifactEvidenceBoundaries.has(run);
|
|
12
|
+
const pathEscapesRoot = (root, target) => {
|
|
13
|
+
const path = relative(root, target);
|
|
14
|
+
return path === ".." || path.startsWith(`..${sep}`) || isAbsolute(path);
|
|
15
|
+
};
|
|
16
|
+
const defaultArtifactsRoot = (run) => artifactEvidenceBoundaries.get(run)?.root ?? resolve(run.runDir, "artifacts");
|
|
17
|
+
const rootsForArtifacts = (run, artifacts) => [
|
|
18
|
+
...new Set(artifacts.map((artifact) => artifact.root && isAbsolute(artifact.root)
|
|
19
|
+
? resolve(artifact.root)
|
|
20
|
+
: defaultArtifactsRoot(run))),
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the common root captured by a driver. The default run artifacts
|
|
24
|
+
* directory remains the fallback for empty or genuinely multi-root evidence.
|
|
25
|
+
*/
|
|
26
|
+
export const runArtifactsRoot = (run) => {
|
|
27
|
+
const boundary = artifactEvidenceBoundaries.get(run);
|
|
28
|
+
if (boundary)
|
|
29
|
+
return boundary.root;
|
|
30
|
+
const roots = rootsForArtifacts(run, run.artifacts);
|
|
31
|
+
return roots.length === 1 ? (roots[0] ?? defaultArtifactsRoot(run)) : defaultArtifactsRoot(run);
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Inspect one captured artifact without following symlinks or allowing a path
|
|
35
|
+
* to escape the root recorded by its driver. An exact artifact-index entry
|
|
36
|
+
* wins; otherwise Lux uses the run's common captured-artifact root.
|
|
37
|
+
*/
|
|
38
|
+
export const inspectRunArtifact = async (run, authoredPath) => {
|
|
39
|
+
if (authoredPath.includes("\0")) {
|
|
40
|
+
return {
|
|
41
|
+
target: authoredPath,
|
|
42
|
+
root: runArtifactsRoot(run),
|
|
43
|
+
issue: `${authoredPath} contains a null byte`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const matching = run.artifacts.filter((candidate) => candidate.path === authoredPath);
|
|
47
|
+
if (artifactEvidenceBoundaries.get(run)?.indexedOnly && matching.length === 0) {
|
|
48
|
+
const root = defaultArtifactsRoot(run);
|
|
49
|
+
return {
|
|
50
|
+
target: resolve(root, authoredPath),
|
|
51
|
+
root,
|
|
52
|
+
issue: `${authoredPath} was not captured in the frozen artifact index`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (matching.some((candidate) => candidate.root !== undefined && !isAbsolute(candidate.root))) {
|
|
56
|
+
return {
|
|
57
|
+
target: authoredPath,
|
|
58
|
+
root: defaultArtifactsRoot(run),
|
|
59
|
+
issue: `${authoredPath} declares a non-absolute artifact root`,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const artifact = matching[0];
|
|
63
|
+
const identified = artifact ? { artifact } : {};
|
|
64
|
+
const matchingRoots = rootsForArtifacts(run, matching);
|
|
65
|
+
if (matchingRoots.length > 1) {
|
|
66
|
+
return {
|
|
67
|
+
target: authoredPath,
|
|
68
|
+
root: defaultArtifactsRoot(run),
|
|
69
|
+
issue: `${authoredPath} is ambiguous across multiple artifact roots`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// A non-default root is trusted only for an exact artifact-index entry.
|
|
73
|
+
// Otherwise one captured path could turn its whole external root into
|
|
74
|
+
// assertion-readable evidence.
|
|
75
|
+
const root = matchingRoots[0] ?? defaultArtifactsRoot(run);
|
|
76
|
+
const target = resolve(root, authoredPath);
|
|
77
|
+
if (pathEscapesRoot(root, target)) {
|
|
78
|
+
return { target, root, issue: `${authoredPath} escapes the captured artifact root` };
|
|
79
|
+
}
|
|
80
|
+
const path = relative(root, target);
|
|
81
|
+
const components = [
|
|
82
|
+
root,
|
|
83
|
+
...path
|
|
84
|
+
.split(sep)
|
|
85
|
+
.filter(Boolean)
|
|
86
|
+
.map((_, index, parts) => join(root, ...parts.slice(0, index + 1))),
|
|
87
|
+
];
|
|
88
|
+
for (const [index, component] of components.entries()) {
|
|
89
|
+
let stats;
|
|
90
|
+
try {
|
|
91
|
+
stats = await lstat(component);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
const code = error.code;
|
|
95
|
+
if (code === "ENOENT" || code === "ENOTDIR") {
|
|
96
|
+
return { target, root, ...identified, issue: `${authoredPath} not found` };
|
|
97
|
+
}
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
if (stats.isSymbolicLink()) {
|
|
101
|
+
return {
|
|
102
|
+
target,
|
|
103
|
+
root,
|
|
104
|
+
...identified,
|
|
105
|
+
issue: `${authoredPath} resolves through a symlink`,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (index < components.length - 1 && !stats.isDirectory()) {
|
|
109
|
+
return { target, root, ...identified, issue: `${authoredPath} not found` };
|
|
110
|
+
}
|
|
111
|
+
if (index === components.length - 1) {
|
|
112
|
+
return { target, root, ...identified, stats };
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return { target, root, ...identified, issue: `${authoredPath} not found` };
|
|
116
|
+
};
|
|
117
|
+
export const readInspectedFileBytes = async (target, expected, maxBytes, label) => {
|
|
118
|
+
if (!Number.isSafeInteger(maxBytes) || maxBytes < 0 || maxBytes > MAX_ARTIFACT_READ_BYTES) {
|
|
119
|
+
throw new RangeError(`artifact maxBytes must be an integer from 0 to ${MAX_ARTIFACT_READ_BYTES}`);
|
|
120
|
+
}
|
|
121
|
+
if (!expected.isFile())
|
|
122
|
+
throw new Error(`${label} is not a file`);
|
|
123
|
+
if (expected.size > maxBytes) {
|
|
124
|
+
throw new Error(`${label} exceeds the ${maxBytes}-byte artifact read limit`);
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
const handle = await open(target, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
128
|
+
try {
|
|
129
|
+
const opened = await handle.stat();
|
|
130
|
+
if (!opened.isFile())
|
|
131
|
+
throw new Error(`${label} is not a file`);
|
|
132
|
+
if (opened.dev !== expected.dev || opened.ino !== expected.ino) {
|
|
133
|
+
throw new Error(`${label} changed while it was being inspected`);
|
|
134
|
+
}
|
|
135
|
+
if (opened.size !== expected.size) {
|
|
136
|
+
throw new Error(`${label} changed while it was being inspected`);
|
|
137
|
+
}
|
|
138
|
+
if (opened.size > maxBytes) {
|
|
139
|
+
throw new Error(`${label} exceeds the ${maxBytes}-byte artifact read limit`);
|
|
140
|
+
}
|
|
141
|
+
// Allocate for the inspected file, not the caller's ceiling. Reading one
|
|
142
|
+
// extra byte detects same-inode growth after fstat without making many
|
|
143
|
+
// tiny artifact reads reserve the maximum concurrently.
|
|
144
|
+
const bytes = Buffer.alloc(expected.size + 1);
|
|
145
|
+
let offset = 0;
|
|
146
|
+
while (offset < bytes.length) {
|
|
147
|
+
const read = await handle.read(bytes, offset, bytes.length - offset, offset);
|
|
148
|
+
if (read.bytesRead === 0)
|
|
149
|
+
break;
|
|
150
|
+
offset += read.bytesRead;
|
|
151
|
+
}
|
|
152
|
+
if (offset !== expected.size) {
|
|
153
|
+
throw new Error(`${label} changed while it was being inspected`);
|
|
154
|
+
}
|
|
155
|
+
return bytes.subarray(0, offset);
|
|
156
|
+
}
|
|
157
|
+
finally {
|
|
158
|
+
await handle.close();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
if (error.code === "ELOOP") {
|
|
163
|
+
throw new Error(`${label} resolves through a symlink`);
|
|
164
|
+
}
|
|
165
|
+
throw error;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
export const readRunArtifactBytes = async (run, authoredPath, options = {}) => {
|
|
169
|
+
const maxBytes = options.maxBytes ?? DEFAULT_ARTIFACT_READ_BYTES;
|
|
170
|
+
const inspected = await inspectRunArtifact(run, authoredPath);
|
|
171
|
+
if (!inspected.stats?.isFile()) {
|
|
172
|
+
throw new Error(inspected.issue ??
|
|
173
|
+
(inspected.stats ? `${authoredPath} is not a file` : `${authoredPath} not found`));
|
|
174
|
+
}
|
|
175
|
+
return await readInspectedFileBytes(inspected.target, inspected.stats, maxBytes, authoredPath);
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Read UTF-8 artifact evidence through Lux's traversal, symlink, regular-file,
|
|
179
|
+
* and size checks. Throws a bounded, path-specific error when evidence is not
|
|
180
|
+
* safe to consume.
|
|
181
|
+
*/
|
|
182
|
+
export const readRunArtifactText = async (run, authoredPath, options = {}) => {
|
|
183
|
+
return (await readRunArtifactBytes(run, authoredPath, options)).toString("utf8");
|
|
184
|
+
};
|
|
185
|
+
//# sourceMappingURL=artifact-evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-evidence.js","sourceRoot":"","sources":["../../src/core/artifact-evidence.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAIrE,MAAM,2BAA2B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACpD,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAoBjD,MAAM,0B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KAAK,EACvC,GAAwB,EACxB,YAAoB,EACpB,OAAO,GAA+B,EAAE,EACvB,EAAE;IACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,2BAA2B,CAAC;IACjE,MAAM,SAAS,GAAG,MAAM,kBAAkB,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC9D,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,SAAS,CAAC,KAAK;YACb,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,gBAAgB,CAAC,CAAC,CAAC,GAAG,YAAY,YAAY,CAAC,CACpF,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,sBAAsB,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjG,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,GAAwB,EACxB,YAAoB,EACpB,OAAO,GAA+B,EAAE,EACvB,EAAE;IACnB,OAAO,CAAC,MAAM,oBAAoB,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACnF,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ARTIFACT_SNAPSHOT_MANIFEST = ".lux-snapshot.json";
|
|
3
|
+
export declare const ArtifactSnapshotFileSchema: z.ZodObject<{
|
|
4
|
+
path: z.ZodString;
|
|
5
|
+
bytes: z.ZodNumber;
|
|
6
|
+
sha256: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type ArtifactSnapshotFile = z.infer<typeof ArtifactSnapshotFileSchema>;
|
|
9
|
+
export declare const ArtifactSnapshotManifestSchema: z.ZodObject<{
|
|
10
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
files: z.ZodArray<z.ZodObject<{
|
|
13
|
+
path: z.ZodString;
|
|
14
|
+
bytes: z.ZodNumber;
|
|
15
|
+
sha256: z.ZodString;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
fileCount: z.ZodNumber;
|
|
18
|
+
bytes: z.ZodNumber;
|
|
19
|
+
baseSnapshot: z.ZodOptional<z.ZodString>;
|
|
20
|
+
reusedFiles: z.ZodNumber;
|
|
21
|
+
reusedBytes: z.ZodNumber;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type ArtifactSnapshotManifest = z.infer<typeof ArtifactSnapshotManifestSchema>;
|
|
24
|
+
export type ArtifactSnapshotContent = string | Uint8Array;
|
|
25
|
+
export type ArtifactSnapshotFiles = Readonly<Record<string, ArtifactSnapshotContent>>;
|
|
26
|
+
export interface WriteArtifactSnapshotOptions {
|
|
27
|
+
artifactsDir: string;
|
|
28
|
+
name: string;
|
|
29
|
+
files: ArtifactSnapshotFiles;
|
|
30
|
+
baseSnapshot?: string;
|
|
31
|
+
maxFiles?: number;
|
|
32
|
+
maxBytes?: number;
|
|
33
|
+
writeConcurrency?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare const readArtifactSnapshotManifest: (snapshotRoot: string) => Promise<ArtifactSnapshotManifest | undefined>;
|
|
36
|
+
export declare const writeArtifactSnapshot: ({ artifactsDir, name, files, baseSnapshot, maxFiles: requestedMaxFiles, maxBytes: requestedMaxBytes, writeConcurrency: requestedWriteConcurrency, }: WriteArtifactSnapshotOptions) => Promise<ArtifactSnapshotManifest>;
|
|
37
|
+
//# sourceMappingURL=artifact-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-snapshot.d.ts","sourceRoot":"","sources":["../../src/core/artifact-snapshot.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAG/D,eAAO,MAAM,0BAA0B;;;;iBAarC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;iBAkCvC,CAAC;AACL,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,UAAU,CAAC;AAC1D,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC;AAEtF,MAAM,WAAW,4BAA4B;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,qBAAqB,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAkID,eAAO,MAAM,4BAA4B,iBACzB,MAAM,KACnB,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAmB9C,CAAC;AAuHF,eAAO,MAAM,qBAAqB,wJAQ/B,4BAA4B,KAAG,OAAO,CAAC,wBAAwB,CA4DjE,CAAC"}
|