@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
package/lib/core/hash.js
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
const typedArrayConstructors = new Set([
|
|
3
|
+
Int8Array,
|
|
4
|
+
Uint8Array,
|
|
5
|
+
Uint8ClampedArray,
|
|
6
|
+
Int16Array,
|
|
7
|
+
Uint16Array,
|
|
8
|
+
Int32Array,
|
|
9
|
+
Uint32Array,
|
|
10
|
+
Float32Array,
|
|
11
|
+
Float64Array,
|
|
12
|
+
BigInt64Array,
|
|
13
|
+
BigUint64Array,
|
|
14
|
+
Buffer,
|
|
15
|
+
]);
|
|
16
|
+
const ownStateKeys = (value, allowed) => Reflect.ownKeys(value).flatMap((key) => {
|
|
17
|
+
if (typeof key === "symbol") {
|
|
18
|
+
throw new TypeError("valueHash does not support symbol-keyed state");
|
|
19
|
+
}
|
|
20
|
+
return allowed.has(key) ? [] : [key];
|
|
21
|
+
});
|
|
22
|
+
const assertNoAttachedState = (value, allowed) => {
|
|
23
|
+
const keys = ownStateKeys(value, allowed);
|
|
24
|
+
if (keys.length > 0) {
|
|
25
|
+
throw new TypeError(`valueHash does not support attached state on ${value.constructor?.name ?? "value"}: ${keys.join(", ")}`);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const numberValue = (value) => {
|
|
29
|
+
if (Number.isNaN(value))
|
|
30
|
+
return "NaN";
|
|
31
|
+
if (value === Number.POSITIVE_INFINITY)
|
|
32
|
+
return "Infinity";
|
|
33
|
+
if (value === Number.NEGATIVE_INFINITY)
|
|
34
|
+
return "-Infinity";
|
|
35
|
+
if (Object.is(value, -0))
|
|
36
|
+
return "-0";
|
|
37
|
+
return value;
|
|
38
|
+
};
|
|
39
|
+
const arrayIndex = (key, length) => {
|
|
40
|
+
if (!/^(?:0|[1-9]\d*)$/.test(key))
|
|
41
|
+
return null;
|
|
42
|
+
const index = Number(key);
|
|
43
|
+
return Number.isSafeInteger(index) && index >= 0 && index < length ? index : null;
|
|
44
|
+
};
|
|
45
|
+
const canonicalizeObject = (value, traversal) => {
|
|
46
|
+
const reference = traversal.active.get(value);
|
|
47
|
+
if (reference !== undefined)
|
|
48
|
+
return ["reference", reference];
|
|
49
|
+
const id = traversal.nextId++;
|
|
50
|
+
traversal.active.set(value, id);
|
|
51
|
+
try {
|
|
52
|
+
if (Array.isArray(value)) {
|
|
53
|
+
if (Object.getPrototypeOf(value) !== Array.prototype) {
|
|
54
|
+
throw new TypeError("valueHash does not support Array subclasses");
|
|
55
|
+
}
|
|
56
|
+
const ownKeys = ownStateKeys(value, new Set(["length"]));
|
|
57
|
+
for (const key of ownKeys) {
|
|
58
|
+
if (arrayIndex(key, value.length) === null) {
|
|
59
|
+
throw new TypeError(`valueHash does not support array property '${key}'`);
|
|
60
|
+
}
|
|
61
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
62
|
+
if (descriptor && !("value" in descriptor)) {
|
|
63
|
+
throw new TypeError(`valueHash does not support accessor property '${key}'`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return [
|
|
67
|
+
"array",
|
|
68
|
+
Array.from({ length: value.length }, (_, index) => Object.hasOwn(value, index)
|
|
69
|
+
? canonicalize(value[index], traversal)
|
|
70
|
+
: ["array-hole"]),
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
if (value instanceof Date) {
|
|
74
|
+
if (Object.getPrototypeOf(value) !== Date.prototype) {
|
|
75
|
+
throw new TypeError("valueHash does not support Date subclasses");
|
|
76
|
+
}
|
|
77
|
+
assertNoAttachedState(value, new Set());
|
|
78
|
+
return ["date", numberValue(value.getTime())];
|
|
79
|
+
}
|
|
80
|
+
if (value instanceof RegExp) {
|
|
81
|
+
if (Object.getPrototypeOf(value) !== RegExp.prototype) {
|
|
82
|
+
throw new TypeError("valueHash does not support RegExp subclasses");
|
|
83
|
+
}
|
|
84
|
+
assertNoAttachedState(value, new Set(["lastIndex"]));
|
|
85
|
+
return ["regexp", value.source, value.flags, value.lastIndex];
|
|
86
|
+
}
|
|
87
|
+
if (value instanceof Map) {
|
|
88
|
+
if (Object.getPrototypeOf(value) !== Map.prototype) {
|
|
89
|
+
throw new TypeError("valueHash does not support Map subclasses");
|
|
90
|
+
}
|
|
91
|
+
assertNoAttachedState(value, new Set());
|
|
92
|
+
return [
|
|
93
|
+
"map",
|
|
94
|
+
Array.from(value.entries(), ([key, item]) => [
|
|
95
|
+
canonicalize(key, traversal),
|
|
96
|
+
canonicalize(item, traversal),
|
|
97
|
+
]),
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
if (value instanceof Set) {
|
|
101
|
+
if (Object.getPrototypeOf(value) !== Set.prototype) {
|
|
102
|
+
throw new TypeError("valueHash does not support Set subclasses");
|
|
103
|
+
}
|
|
104
|
+
assertNoAttachedState(value, new Set());
|
|
105
|
+
return ["set", Array.from(value, (item) => canonicalize(item, traversal))];
|
|
106
|
+
}
|
|
107
|
+
if (value instanceof ArrayBuffer) {
|
|
108
|
+
if (Object.getPrototypeOf(value) !== ArrayBuffer.prototype) {
|
|
109
|
+
throw new TypeError("valueHash does not support ArrayBuffer subclasses");
|
|
110
|
+
}
|
|
111
|
+
assertNoAttachedState(value, new Set());
|
|
112
|
+
return ["array-buffer", Buffer.from(value).toString("base64")];
|
|
113
|
+
}
|
|
114
|
+
if (ArrayBuffer.isView(value)) {
|
|
115
|
+
if (typeof SharedArrayBuffer !== "undefined" && value.buffer instanceof SharedArrayBuffer) {
|
|
116
|
+
throw new TypeError("valueHash does not support shared mutable buffers");
|
|
117
|
+
}
|
|
118
|
+
if (value instanceof DataView) {
|
|
119
|
+
if (Object.getPrototypeOf(value) !== DataView.prototype) {
|
|
120
|
+
throw new TypeError("valueHash does not support DataView subclasses");
|
|
121
|
+
}
|
|
122
|
+
assertNoAttachedState(value, new Set());
|
|
123
|
+
return [
|
|
124
|
+
"data-view",
|
|
125
|
+
Buffer.from(value.buffer, value.byteOffset, value.byteLength).toString("base64"),
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
const viewConstructor = Object.getPrototypeOf(value)?.constructor;
|
|
129
|
+
if (typeof viewConstructor !== "function" || !typedArrayConstructors.has(viewConstructor)) {
|
|
130
|
+
throw new TypeError("valueHash does not support custom typed-array classes");
|
|
131
|
+
}
|
|
132
|
+
const indexedKeys = new Set(Array.from({ length: value.length }, (_, index) => String(index)));
|
|
133
|
+
assertNoAttachedState(value, indexedKeys);
|
|
134
|
+
return [
|
|
135
|
+
"typed-array",
|
|
136
|
+
viewConstructor.name,
|
|
137
|
+
Array.from(value, (item) => canonicalize(item, traversal)),
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
const prototype = Object.getPrototypeOf(value);
|
|
141
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
142
|
+
throw new TypeError(`valueHash does not support class instance '${value.constructor?.name ?? "unknown"}'`);
|
|
143
|
+
}
|
|
144
|
+
const entries = ownStateKeys(value, new Set())
|
|
145
|
+
.sort((a, b) => a.localeCompare(b))
|
|
146
|
+
.map((key) => {
|
|
147
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
148
|
+
if (!descriptor?.enumerable) {
|
|
149
|
+
throw new TypeError(`valueHash does not support non-enumerable property '${key}'`);
|
|
150
|
+
}
|
|
151
|
+
if (!("value" in descriptor)) {
|
|
152
|
+
throw new TypeError(`valueHash does not support accessor property '${key}'`);
|
|
153
|
+
}
|
|
154
|
+
return [key, canonicalize(descriptor.value, traversal)];
|
|
155
|
+
});
|
|
156
|
+
return [prototype === null ? "null-object" : "object", entries];
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
traversal.active.delete(value);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
const canonicalize = (value, traversal) => {
|
|
163
|
+
if (value === null)
|
|
164
|
+
return ["null"];
|
|
165
|
+
if (value === undefined)
|
|
166
|
+
return ["undefined"];
|
|
167
|
+
if (typeof value === "string")
|
|
168
|
+
return ["string", value];
|
|
169
|
+
if (typeof value === "boolean")
|
|
170
|
+
return ["boolean", value];
|
|
171
|
+
if (typeof value === "number")
|
|
172
|
+
return ["number", numberValue(value)];
|
|
173
|
+
if (typeof value === "bigint")
|
|
174
|
+
return ["bigint", value.toString()];
|
|
175
|
+
if (typeof value === "symbol") {
|
|
176
|
+
throw new TypeError("valueHash does not support symbols");
|
|
177
|
+
}
|
|
178
|
+
if (typeof value === "function") {
|
|
179
|
+
const ownKeys = Reflect.ownKeys(value);
|
|
180
|
+
if (ownKeys.some((key) => typeof key === "symbol")) {
|
|
181
|
+
throw new TypeError("valueHash does not support symbol-keyed function state");
|
|
182
|
+
}
|
|
183
|
+
const standardKeys = new Set(["length", "name", "arguments", "caller", "prototype"]);
|
|
184
|
+
const attached = ownKeys.filter((key) => typeof key === "string" && !standardKeys.has(key));
|
|
185
|
+
if (attached.length > 0) {
|
|
186
|
+
throw new TypeError(`valueHash does not support attached function state: ${attached.join(", ")}`);
|
|
187
|
+
}
|
|
188
|
+
if (Object.hasOwn(value, "prototype")) {
|
|
189
|
+
const prototype = value.prototype;
|
|
190
|
+
if (!prototype ||
|
|
191
|
+
typeof prototype !== "object" ||
|
|
192
|
+
Reflect.ownKeys(prototype).some((key) => key !== "constructor") ||
|
|
193
|
+
Object.getOwnPropertyDescriptor(prototype, "constructor")?.value !== value) {
|
|
194
|
+
throw new TypeError("valueHash does not support modified function prototypes");
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const source = Function.prototype.toString.call(value);
|
|
198
|
+
if (source.includes("[native code]")) {
|
|
199
|
+
throw new TypeError("valueHash does not support native or bound functions");
|
|
200
|
+
}
|
|
201
|
+
// JavaScript exposes source text but not captured closure values. Evaluator
|
|
202
|
+
// state that affects behavior must therefore live in source or explicit config.
|
|
203
|
+
return ["function-source", source];
|
|
204
|
+
}
|
|
205
|
+
return canonicalizeObject(value, traversal);
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Tagged structural encoding for ledger identity. Functions encode observable
|
|
209
|
+
* source text only; JavaScript provides no access to captured closure values.
|
|
210
|
+
*/
|
|
211
|
+
export const stableJson = (value) => JSON.stringify(["lux-value", 2, canonicalize(value, { active: new Map(), nextId: 0 })]);
|
|
212
|
+
export const contentHash = (value) => createHash("sha256").update(value).digest("hex");
|
|
213
|
+
export const valueHash = (value) => contentHash(stableJson(value));
|
|
214
|
+
//# sourceMappingURL=hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/core/hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzC,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAU;IAC9C,SAAS;IACT,UAAU;IACV,iBAAiB;IACjB,UAAU;IACV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,SAAS,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAc,EAAU,EAAE,CACnD,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,YAAY,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE1F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAA0B,EAAU,EAAE,CAChE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAEnD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from "./annotation.js";
|
|
2
|
+
export * from "./answerer.js";
|
|
3
|
+
export * from "./artifact-evidence.js";
|
|
4
|
+
export * from "./artifact-snapshot.js";
|
|
5
|
+
export * from "./assertion.js";
|
|
6
|
+
export * from "./case.js";
|
|
7
|
+
export * from "./conversation-turn.js";
|
|
8
|
+
export * from "./driver.js";
|
|
9
|
+
export * from "./emitter.js";
|
|
10
|
+
export * from "./events.js";
|
|
11
|
+
export * from "./exec.js";
|
|
12
|
+
export * from "./experiment.js";
|
|
13
|
+
export * from "./glob.js";
|
|
14
|
+
export * from "./hash.js";
|
|
15
|
+
export * from "./lifecycle-fixtures.js";
|
|
16
|
+
export * from "./lifecycle-hooks.js";
|
|
17
|
+
export * from "./mcp-events.js";
|
|
18
|
+
export * from "./model-cli.js";
|
|
19
|
+
export * from "./observer.js";
|
|
20
|
+
export * from "./registry.js";
|
|
21
|
+
export * from "./rubric.js";
|
|
22
|
+
export * from "./run.js";
|
|
23
|
+
export * from "./statistics.js";
|
|
24
|
+
export * from "./subject.js";
|
|
25
|
+
export * from "./tool-events.js";
|
|
26
|
+
export * from "./usage.js";
|
|
27
|
+
export * from "./wire.js";
|
|
28
|
+
export * from "./zod.js";
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from "./annotation.js";
|
|
2
|
+
export * from "./answerer.js";
|
|
3
|
+
export * from "./artifact-evidence.js";
|
|
4
|
+
export * from "./artifact-snapshot.js";
|
|
5
|
+
export * from "./assertion.js";
|
|
6
|
+
export * from "./case.js";
|
|
7
|
+
export * from "./conversation-turn.js";
|
|
8
|
+
export * from "./driver.js";
|
|
9
|
+
export * from "./emitter.js";
|
|
10
|
+
export * from "./events.js";
|
|
11
|
+
export * from "./exec.js";
|
|
12
|
+
export * from "./experiment.js";
|
|
13
|
+
export * from "./glob.js";
|
|
14
|
+
export * from "./hash.js";
|
|
15
|
+
export * from "./lifecycle-fixtures.js";
|
|
16
|
+
export * from "./lifecycle-hooks.js";
|
|
17
|
+
export * from "./mcp-events.js";
|
|
18
|
+
export * from "./model-cli.js";
|
|
19
|
+
export * from "./observer.js";
|
|
20
|
+
export * from "./registry.js";
|
|
21
|
+
export * from "./rubric.js";
|
|
22
|
+
export * from "./run.js";
|
|
23
|
+
export * from "./statistics.js";
|
|
24
|
+
export * from "./subject.js";
|
|
25
|
+
export * from "./tool-events.js";
|
|
26
|
+
export * from "./usage.js";
|
|
27
|
+
export * from "./wire.js";
|
|
28
|
+
export * from "./zod.js";
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type CaseLifecycleHookContext, type LifecycleHooksPlugin, type SuiteLifecycleHookContext } from "./lifecycle-hooks.js";
|
|
2
|
+
export type LifecycleFixtureUse = () => PromiseLike<void>;
|
|
3
|
+
export type LifecycleFixture<Context extends SuiteLifecycleHookContext> = (context: Context, use: LifecycleFixtureUse) => void | Promise<void>;
|
|
4
|
+
export type LifecycleFixturesDefinition = {
|
|
5
|
+
name: string;
|
|
6
|
+
pluginVersion: string;
|
|
7
|
+
/**
|
|
8
|
+
* Public, non-secret values captured by the fixture callbacks and relevant
|
|
9
|
+
* to execution identity.
|
|
10
|
+
*/
|
|
11
|
+
identity?: unknown;
|
|
12
|
+
suite?: LifecycleFixture<SuiteLifecycleHookContext>;
|
|
13
|
+
case?: LifecycleFixture<CaseLifecycleHookContext>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Define suite and case lifetimes with Vitest-style `await use()` fixtures.
|
|
17
|
+
* Setup belongs before `use`; teardown belongs after it.
|
|
18
|
+
*/
|
|
19
|
+
export declare const defineFixtures: (definition: LifecycleFixturesDefinition) => LifecycleHooksPlugin;
|
|
20
|
+
//# sourceMappingURL=lifecycle-fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-fixtures.d.ts","sourceRoot":"","sources":["../../src/core/lifecycle-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,wBAAwB,EAG7B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,mBAAmB,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;AAE1D,MAAM,MAAM,gBAAgB,CAAC,OAAO,SAAS,yBAAyB,IAAI,CACxE,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,mBAAmB,KACrB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAC,yBAAyB,CAAC,CAAC;IACpD,IAAI,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;CACnD,CAAC;AAgFF;;;GAGG;AACH,eAAO,MAAM,cAAc,eAAgB,2BAA2B,KAAG,oBAkCxE,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { valueHash } from "./hash.js";
|
|
2
|
+
import { defineLifecycleHooks, } from "./lifecycle-hooks.js";
|
|
3
|
+
const errorMessage = (error) => error instanceof Error ? error.message : String(error);
|
|
4
|
+
const activateFixture = async (fixture, context, label) => {
|
|
5
|
+
let releaseUse;
|
|
6
|
+
const useLifetime = new Promise((resolve) => {
|
|
7
|
+
releaseUse = resolve;
|
|
8
|
+
});
|
|
9
|
+
let acceptSetup;
|
|
10
|
+
let rejectSetup;
|
|
11
|
+
const setup = new Promise((resolve, reject) => {
|
|
12
|
+
acceptSetup = resolve;
|
|
13
|
+
rejectSetup = reject;
|
|
14
|
+
});
|
|
15
|
+
let useCalls = 0;
|
|
16
|
+
let useObservations = 0;
|
|
17
|
+
let settled = false;
|
|
18
|
+
let completionError;
|
|
19
|
+
const completion = (async () => {
|
|
20
|
+
try {
|
|
21
|
+
await fixture(context, () => {
|
|
22
|
+
useCalls += 1;
|
|
23
|
+
if (useCalls > 1) {
|
|
24
|
+
throw new TypeError(`${label} called use() more than once`);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
// biome-ignore lint/suspicious/noThenProperty: a custom thenable lets us detect a discarded use() lifetime.
|
|
28
|
+
then: (onfulfilled, onrejected) => {
|
|
29
|
+
useObservations += 1;
|
|
30
|
+
if (useObservations > 1) {
|
|
31
|
+
return Promise.reject(new TypeError(`${label} awaited one use() more than once`)).then(onfulfilled, onrejected);
|
|
32
|
+
}
|
|
33
|
+
acceptSetup?.();
|
|
34
|
+
return useLifetime.then(onfulfilled, onrejected);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
if (useCalls === 0) {
|
|
39
|
+
throw new TypeError(`${label} must call and await use() exactly once`);
|
|
40
|
+
}
|
|
41
|
+
if (useObservations === 0) {
|
|
42
|
+
throw new TypeError(`${label} must await use()`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
completionError = error;
|
|
47
|
+
if (useObservations === 0)
|
|
48
|
+
rejectSetup?.(error);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
settled = true;
|
|
52
|
+
}
|
|
53
|
+
})();
|
|
54
|
+
await setup;
|
|
55
|
+
await Promise.resolve();
|
|
56
|
+
if (settled) {
|
|
57
|
+
throw new TypeError(completionError
|
|
58
|
+
? `${label} failed before its lifetime began: ${errorMessage(completionError)}`
|
|
59
|
+
: `${label} must await use()`, { cause: completionError });
|
|
60
|
+
}
|
|
61
|
+
let cleaned = false;
|
|
62
|
+
return async () => {
|
|
63
|
+
if (cleaned)
|
|
64
|
+
return;
|
|
65
|
+
cleaned = true;
|
|
66
|
+
releaseUse?.();
|
|
67
|
+
await completion;
|
|
68
|
+
if (completionError)
|
|
69
|
+
throw completionError;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Define suite and case lifetimes with Vitest-style `await use()` fixtures.
|
|
74
|
+
* Setup belongs before `use`; teardown belongs after it.
|
|
75
|
+
*/
|
|
76
|
+
export const defineFixtures = (definition) => {
|
|
77
|
+
if (!definition.suite && !definition.case) {
|
|
78
|
+
throw new TypeError("fixtures plugin must define suite or case");
|
|
79
|
+
}
|
|
80
|
+
if (definition.suite !== undefined && typeof definition.suite !== "function") {
|
|
81
|
+
throw new TypeError("fixtures plugin suite must be a function");
|
|
82
|
+
}
|
|
83
|
+
if (definition.case !== undefined && typeof definition.case !== "function") {
|
|
84
|
+
throw new TypeError("fixtures plugin case must be a function");
|
|
85
|
+
}
|
|
86
|
+
const suiteFixture = definition.suite;
|
|
87
|
+
const caseFixture = definition.case;
|
|
88
|
+
return defineLifecycleHooks({
|
|
89
|
+
name: definition.name,
|
|
90
|
+
pluginVersion: definition.pluginVersion,
|
|
91
|
+
...(definition.identity === undefined ? {} : { identity: definition.identity }),
|
|
92
|
+
implementationHash: valueHash({
|
|
93
|
+
identity: definition.identity,
|
|
94
|
+
suite: definition.suite,
|
|
95
|
+
case: definition.case,
|
|
96
|
+
}),
|
|
97
|
+
...(suiteFixture
|
|
98
|
+
? {
|
|
99
|
+
setupSuite: (context) => activateFixture(suiteFixture, context, `suite fixture '${definition.name}'`),
|
|
100
|
+
}
|
|
101
|
+
: {}),
|
|
102
|
+
...(caseFixture
|
|
103
|
+
? {
|
|
104
|
+
setupCase: (context) => activateFixture(caseFixture, context, `case fixture '${definition.name}'`),
|
|
105
|
+
}
|
|
106
|
+
: {}),
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=lifecycle-fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-fixtures.js","sourceRoot":"","sources":["../../src/core/lifecycle-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAEL,oBAAoB,GAIrB,MAAM,sBAAsB,CAAC;AAqB9B,MAAM,YAAY,GAAG,CAAC,KAAc,EAAU,EAAE,CAC9C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAA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OAAO,EAAE,iBAAiB,UAAU,CAAC,IAAI,GAAG,CAAC;aAC7E;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type LifecycleHookCleanup = () => void | Promise<void>;
|
|
2
|
+
export type LifecycleHookSetupResult = LifecycleHookCleanup | undefined;
|
|
3
|
+
export type SuiteLifecycleHookItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
caseId: string;
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
8
|
+
export type SuiteLifecycleHookContext = {
|
|
9
|
+
suiteId: string;
|
|
10
|
+
suiteDir: string;
|
|
11
|
+
runsRoot: string;
|
|
12
|
+
concurrency: number;
|
|
13
|
+
items: readonly SuiteLifecycleHookItem[];
|
|
14
|
+
abortSignal?: AbortSignal;
|
|
15
|
+
};
|
|
16
|
+
export type CaseLifecycleHookContext = SuiteLifecycleHookContext & {
|
|
17
|
+
index: number;
|
|
18
|
+
item: SuiteLifecycleHookItem;
|
|
19
|
+
};
|
|
20
|
+
export type LifecycleHooksPlugin = {
|
|
21
|
+
name: string;
|
|
22
|
+
/** Author-maintained identity for setup and teardown behavior. */
|
|
23
|
+
pluginVersion: string;
|
|
24
|
+
/**
|
|
25
|
+
* Public, non-secret values captured by hook closures and relevant to
|
|
26
|
+
* execution identity. Included in the implementation hash.
|
|
27
|
+
*/
|
|
28
|
+
identity?: unknown;
|
|
29
|
+
/**
|
|
30
|
+
* Hash of the authored callbacks when an adapter wraps them in closures.
|
|
31
|
+
* `defineLifecycleHooks` and `defineFixtures` populate this automatically.
|
|
32
|
+
*/
|
|
33
|
+
implementationHash?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Prepare resources shared by the selected suite. A returned cleanup runs
|
|
36
|
+
* exactly once after all cases settle, including abort and failure paths.
|
|
37
|
+
*/
|
|
38
|
+
setupSuite?(context: SuiteLifecycleHookContext): LifecycleHookSetupResult | Promise<LifecycleHookSetupResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Prepare resources private to one case attempt. A returned cleanup runs
|
|
41
|
+
* exactly once after that attempt settles. Concurrent cases may invoke this
|
|
42
|
+
* hook concurrently.
|
|
43
|
+
*/
|
|
44
|
+
setupCase?(context: CaseLifecycleHookContext): LifecycleHookSetupResult | Promise<LifecycleHookSetupResult>;
|
|
45
|
+
};
|
|
46
|
+
export declare const lifecycleHooksPluginIssue: (definition: Partial<LifecycleHooksPlugin>) => string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Define versioned suite/case resource hooks for registration in
|
|
49
|
+
* the `lifecycleFixtures` list in `lux.config.ts`.
|
|
50
|
+
*/
|
|
51
|
+
export declare const defineLifecycleHooks: (definition: LifecycleHooksPlugin) => LifecycleHooksPlugin;
|
|
52
|
+
//# sourceMappingURL=lifecycle-hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-hooks.d.ts","sourceRoot":"","sources":["../../src/core/lifecycle-hooks.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,oBAAoB,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9D,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,GAAG,SAAS,CAAC;AAExE,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACzC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,yBAAyB,GAAG;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,sBAAsB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,CACT,OAAO,EAAE,yBAAyB,GACjC,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAChE;;;;OAIG;IACH,SAAS,CAAC,CACR,OAAO,EAAE,wBAAwB,GAChC,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACjE,CAAC;AAEF,eAAO,MAAM,yBAAyB,eACxB,OAAO,CAAC,oBAAoB,CAAC,KACxC,MAAM,GAAG,SAuBX,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,eAAgB,oBAAoB,KAAG,oBAavE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { valueHash } from "./hash.js";
|
|
2
|
+
export const lifecycleHooksPluginIssue = (definition) => {
|
|
3
|
+
if (typeof definition.name !== "string" || !definition.name.trim()) {
|
|
4
|
+
return "lifecycle hooks plugin name must not be empty";
|
|
5
|
+
}
|
|
6
|
+
if (typeof definition.pluginVersion !== "string" || !definition.pluginVersion.trim()) {
|
|
7
|
+
return "lifecycle hooks plugin pluginVersion must not be empty";
|
|
8
|
+
}
|
|
9
|
+
if (definition.implementationHash !== undefined &&
|
|
10
|
+
!/^[0-9a-f]{64}$/.test(definition.implementationHash)) {
|
|
11
|
+
return "lifecycle hooks plugin implementationHash must be a SHA-256 hex digest";
|
|
12
|
+
}
|
|
13
|
+
if (definition.setupSuite !== undefined && typeof definition.setupSuite !== "function") {
|
|
14
|
+
return "lifecycle hooks plugin setupSuite must be a function";
|
|
15
|
+
}
|
|
16
|
+
if (definition.setupCase !== undefined && typeof definition.setupCase !== "function") {
|
|
17
|
+
return "lifecycle hooks plugin setupCase must be a function";
|
|
18
|
+
}
|
|
19
|
+
if (!definition.setupSuite && !definition.setupCase) {
|
|
20
|
+
return "lifecycle hooks plugin must define setupSuite or setupCase";
|
|
21
|
+
}
|
|
22
|
+
return undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Define versioned suite/case resource hooks for registration in
|
|
26
|
+
* the `lifecycleFixtures` list in `lux.config.ts`.
|
|
27
|
+
*/
|
|
28
|
+
export const defineLifecycleHooks = (definition) => {
|
|
29
|
+
const issue = lifecycleHooksPluginIssue(definition);
|
|
30
|
+
if (issue)
|
|
31
|
+
throw new TypeError(issue);
|
|
32
|
+
return {
|
|
33
|
+
...definition,
|
|
34
|
+
implementationHash: definition.implementationHash ??
|
|
35
|
+
valueHash({
|
|
36
|
+
identity: definition.identity,
|
|
37
|
+
setupSuite: definition.setupSuite,
|
|
38
|
+
setupCase: definition.setupCase,
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=lifecycle-hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-hooks.js","sourceRoot":"","sources":["../../src/core/lifecycle-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAwDtC,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,UAAyC,EACrB,EAAE;IACtB,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QACnE,OAAO,+CAA+C,CAAC;IACzD,CAAC;IACD,IAAI,OAAO,UAAU,CAAC,aAAa,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC;QACrF,OAAO,wDAAwD,CAAC;IAClE,CAAC;IACD,IACE,UAAU,CAAC,kBAAkB,KAAK,SAAS;QAC3C,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,EACrD,CAAC;QACD,OAAO,wEAAwE,CAAC;IAClF,CAAC;IACD,IAAI,UAAU,CAAC,UAAU,KAAK,SAAS,IAAI,OAAO,UAAU,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QACvF,OAAO,sDAAsD,CAAC;IAChE,CAAC;IACD,IAAI,UAAU,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;QACrF,OAAO,qDAAqD,CAAC;IAC/D,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QACpD,OAAO,4DAA4D,CAAC;IACtE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,UAAgC,EAAwB,EAAE;IAC7F,MAAM,KAAK,GAAG,yBAAyB,CAAC,UAAU,CAAC,CAAC;IACpD,IAAI,KAAK;QAAE,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO;QACL,GAAG,UAAU;QACb,kBAAkB,EAChB,UAAU,CAAC,kBAAkB;YAC7B,SAAS,CAAC;gBACR,QAAQ,EAAE,UAAU,CAAC,QAAQ;gBAC7B,UAAU,EAAE,UAAU,CAAC,UAAU;gBACjC,SAAS,EAAE,UAAU,CAAC,SAAS;aAChC,CAAC;KACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { RunEvent } from "./events.js";
|
|
2
|
+
/**
|
|
3
|
+
* MCP-specific `progress` event kinds. Generic tool calls and results live in
|
|
4
|
+
* `tool-events`; MCP discovery metadata rides the same open progress stream.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MCP_INIT_KIND: "mcp-init";
|
|
7
|
+
export declare const MCP_TOOLS_LIST_KIND: "mcp-tools-list";
|
|
8
|
+
/** A tool as reported by `tools/list`. */
|
|
9
|
+
export type ListedTool = {
|
|
10
|
+
name: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
inputSchema?: unknown;
|
|
14
|
+
outputSchema?: unknown;
|
|
15
|
+
annotations?: Record<string, unknown>;
|
|
16
|
+
execution?: Record<string, unknown>;
|
|
17
|
+
icons?: unknown[];
|
|
18
|
+
_meta?: Record<string, unknown>;
|
|
19
|
+
};
|
|
20
|
+
/** `initialize` result metadata, captured once when the server connects. */
|
|
21
|
+
export type McpInitPayload = {
|
|
22
|
+
serverInfo?: {
|
|
23
|
+
name?: string;
|
|
24
|
+
version?: string;
|
|
25
|
+
};
|
|
26
|
+
capabilities?: Record<string, unknown>;
|
|
27
|
+
instructions?: string;
|
|
28
|
+
};
|
|
29
|
+
export type McpToolsListPayload = {
|
|
30
|
+
tools: ListedTool[];
|
|
31
|
+
};
|
|
32
|
+
type ProgressEvent = Extract<RunEvent, {
|
|
33
|
+
type: "progress";
|
|
34
|
+
}>;
|
|
35
|
+
export declare const isMcpInitEvent: (e: RunEvent) => e is ProgressEvent;
|
|
36
|
+
export declare const isMcpToolsListEvent: (e: RunEvent) => e is ProgressEvent;
|
|
37
|
+
/** The `initialize` metadata (the last `mcp-init` event wins), or undefined. */
|
|
38
|
+
export declare const mcpInit: (events: RunEvent[]) => McpInitPayload | undefined;
|
|
39
|
+
/** Tools from the last `tools/list` capture in the run. */
|
|
40
|
+
export declare const listedTools: (events: RunEvent[]) => ListedTool[];
|
|
41
|
+
export declare const hasMcpInit: (events: RunEvent[]) => boolean;
|
|
42
|
+
export declare const hasMcpToolsList: (events: RunEvent[]) => boolean;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=mcp-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
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AC;AAEpG,eAAO,MAAM,mBAAmB,MAAO,QAAQ,KAAG,CAAC,IAAI,aACf,CAAC;AAEzC,gFAAgF;AAChF,eAAO,MAAM,OAAO,WAAY,QAAQ,EAAE,KAAG,cAAc,GAAG,SAG7D,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,WAAW,WAAY,QAAQ,EAAE,KAAG,UAAU,EAI1D,CAAC;AAEF,eAAO,MAAM,UAAU,WAAY,QAAQ,EAAE,KAAG,OAAsC,CAAC;AAEvF,eAAO,MAAM,eAAe,WAAY,QAAQ,EAAE,KAAG,OAA2C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP-specific `progress` event kinds. Generic tool calls and results live in
|
|
3
|
+
* `tool-events`; MCP discovery metadata rides the same open progress stream.
|
|
4
|
+
*/
|
|
5
|
+
export const MCP_INIT_KIND = "mcp-init";
|
|
6
|
+
export const MCP_TOOLS_LIST_KIND = "mcp-tools-list";
|
|
7
|
+
const isProgressKind = (e, kind) => e.type === "progress" && e.kind === kind;
|
|
8
|
+
export const isMcpInitEvent = (e) => isProgressKind(e, MCP_INIT_KIND);
|
|
9
|
+
export const isMcpToolsListEvent = (e) => isProgressKind(e, MCP_TOOLS_LIST_KIND);
|
|
10
|
+
/** The `initialize` metadata (the last `mcp-init` event wins), or undefined. */
|
|
11
|
+
export const mcpInit = (events) => {
|
|
12
|
+
const hit = events.filter(isMcpInitEvent).at(-1);
|
|
13
|
+
return hit ? hit.payload : undefined;
|
|
14
|
+
};
|
|
15
|
+
/** Tools from the last `tools/list` capture in the run. */
|
|
16
|
+
export const listedTools = (events) => {
|
|
17
|
+
const hit = events.filter(isMcpToolsListEvent).at(-1);
|
|
18
|
+
const payload = hit?.payload;
|
|
19
|
+
return Array.isArray(payload?.tools) ? payload.tools : [];
|
|
20
|
+
};
|
|
21
|
+
export const hasMcpInit = (events) => events.some(isMcpInitEvent);
|
|
22
|
+
export const hasMcpToolsList = (events) => events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