niceeval 0.13.2 → 0.13.3
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/dist/agents/bub.cjs +4 -4
- package/dist/agents/bub.cjs.map +1 -1
- package/dist/agents/bub.d.cts +2 -2
- package/dist/agents/bub.d.mts +2 -2
- package/dist/agents/bub.d.ts +2 -2
- package/dist/agents/claude-code-native.cjs +213 -0
- package/dist/agents/claude-code-native.cjs.map +1 -0
- package/dist/agents/claude-code-native.d.cts +5 -0
- package/dist/agents/claude-code-native.d.mts +5 -0
- package/dist/agents/claude-code-native.d.ts +5 -0
- package/dist/agents/claude-code-native.js +6 -0
- package/dist/agents/claude-code-native.js.map +1 -0
- package/dist/agents/claude-code.cjs +26 -80
- package/dist/agents/claude-code.cjs.map +1 -1
- package/dist/agents/codex-app-server.cjs +314 -0
- package/dist/agents/codex-app-server.cjs.map +1 -0
- package/dist/agents/codex-app-server.d.cts +9 -0
- package/dist/agents/codex-app-server.d.mts +9 -0
- package/dist/agents/codex-app-server.d.ts +9 -0
- package/dist/agents/codex-app-server.js +6 -0
- package/dist/agents/codex-app-server.js.map +1 -0
- package/dist/agents/codex.cjs +19 -68
- package/dist/agents/codex.cjs.map +1 -1
- package/dist/agents/codex.d.cts +3 -3
- package/dist/agents/codex.d.mts +3 -3
- package/dist/agents/codex.d.ts +3 -3
- package/dist/agents/index.cjs +3 -1
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +1 -0
- package/dist/agents/index.d.mts +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.js +84 -82
- package/dist/agents/index.mjs +84 -82
- package/dist/agents/managed-jsonl.cjs +207 -0
- package/dist/agents/managed-jsonl.cjs.map +1 -0
- package/dist/agents/managed-jsonl.d.cts +39 -0
- package/dist/agents/managed-jsonl.d.mts +39 -0
- package/dist/agents/managed-jsonl.d.ts +39 -0
- package/dist/agents/managed-jsonl.js +6 -0
- package/dist/agents/managed-jsonl.js.map +1 -0
- package/dist/agents/managed-process.cjs +31 -0
- package/dist/agents/managed-process.cjs.map +1 -0
- package/dist/agents/managed-process.d.cts +3 -0
- package/dist/agents/managed-process.d.mts +3 -0
- package/dist/agents/managed-process.d.ts +3 -0
- package/dist/agents/managed-process.js +6 -0
- package/dist/agents/managed-process.js.map +1 -0
- package/dist/agents/omp.cjs +18 -1
- package/dist/agents/omp.cjs.map +1 -1
- package/dist/agents/sdk-streams.cjs +11 -4
- package/dist/agents/sdk-streams.cjs.map +1 -1
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.d.cts +8 -0
- package/dist/agents/types.d.mts +8 -0
- package/dist/agents/types.d.ts +8 -0
- package/dist/analysis/bindings.cjs +74 -19
- package/dist/analysis/bindings.cjs.map +1 -1
- package/dist/analysis/bindings.d.cts +534 -156
- package/dist/analysis/bindings.d.mts +534 -156
- package/dist/analysis/bindings.d.ts +534 -156
- package/dist/analysis/domain-view.cjs.map +1 -1
- package/dist/analysis/domain-view.d.cts +137 -8
- package/dist/analysis/domain-view.d.mts +137 -8
- package/dist/analysis/domain-view.d.ts +137 -8
- package/dist/analysis/index.cjs.map +1 -1
- package/dist/analysis/index.d.cts +1 -1
- package/dist/analysis/index.d.mts +1 -1
- package/dist/analysis/index.d.ts +1 -1
- package/dist/assertions/api.cjs.map +1 -1
- package/dist/assertions/api.d.cts +62 -0
- package/dist/assertions/api.d.mts +62 -0
- package/dist/assertions/api.d.ts +62 -0
- package/dist/assertions/judge.cjs +56 -5
- package/dist/assertions/judge.cjs.map +1 -1
- package/dist/assertions/match.cjs +66 -42
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +13 -0
- package/dist/assertions/match.d.mts +13 -0
- package/dist/assertions/match.d.ts +13 -0
- package/dist/assertions/record/attachment.cjs +104 -33
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/attachment.d.cts +294 -57
- package/dist/assertions/record/attachment.d.mts +294 -57
- package/dist/assertions/record/attachment.d.ts +294 -57
- package/dist/assertions/record/codec.cjs +91 -17
- package/dist/assertions/record/codec.cjs.map +1 -1
- package/dist/assertions/record/codec.d.cts +280 -52
- package/dist/assertions/record/codec.d.mts +280 -52
- package/dist/assertions/record/codec.d.ts +280 -52
- package/dist/assertions/record/index.js +2 -0
- package/dist/assertions/record/model.cjs +16 -0
- package/dist/assertions/record/model.cjs.map +1 -1
- package/dist/assertions/record/model.d.cts +120 -13
- package/dist/assertions/record/model.d.mts +120 -13
- package/dist/assertions/record/model.d.ts +120 -13
- package/dist/assertions/record/model.js +2 -0
- package/dist/assertions/record/producer.cjs +70 -50
- package/dist/assertions/record/producer.cjs.map +1 -1
- package/dist/assertions/record/producer.d.cts +8 -7
- package/dist/assertions/record/producer.d.mts +8 -7
- package/dist/assertions/record/producer.d.ts +8 -7
- package/dist/assertions/runtime.cjs +49 -7
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/cli/application.cjs +40 -0
- package/dist/cli/application.cjs.map +1 -0
- package/dist/cli/application.d.cts +129 -0
- package/dist/cli/application.d.mts +129 -0
- package/dist/cli/application.d.ts +129 -0
- package/dist/cli/application.js +24 -0
- package/dist/cli/application.js.map +1 -0
- package/dist/cli/bootstrap.cjs +10 -4
- package/dist/cli/bootstrap.cjs.map +1 -1
- package/dist/cli/node-application.cjs +123 -0
- package/dist/cli/node-application.cjs.map +1 -0
- package/dist/cli/node-application.d.cts +14 -0
- package/dist/cli/node-application.d.mts +14 -0
- package/dist/cli/node-application.d.ts +14 -0
- package/dist/cli/node-application.js +26 -0
- package/dist/cli/node-application.js.map +1 -0
- package/dist/cli/program.cjs +2807 -0
- package/dist/cli/program.cjs.map +1 -0
- package/dist/cli/program.d.cts +352 -0
- package/dist/cli/program.d.mts +352 -0
- package/dist/cli/program.d.ts +352 -0
- package/dist/cli/program.js +36 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/cli/project-configuration.cjs +134 -0
- package/dist/cli/project-configuration.cjs.map +1 -0
- package/dist/cli/project-configuration.d.cts +64 -0
- package/dist/cli/project-configuration.d.mts +64 -0
- package/dist/cli/project-configuration.d.ts +64 -0
- package/dist/cli/project-configuration.js +22 -0
- package/dist/cli/project-configuration.js.map +1 -0
- package/dist/cli/record.cjs +20 -4
- package/dist/cli/record.cjs.map +1 -1
- package/dist/cli/record.d.cts +3 -3
- package/dist/cli/record.d.mts +3 -3
- package/dist/cli/record.d.ts +3 -3
- package/dist/cli.cjs +19 -3130
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +2 -148
- package/dist/cli.d.mts +2 -148
- package/dist/cli.d.ts +2 -148
- package/dist/cli.js +22 -30
- package/dist/context/assert-first.cjs +21 -15
- package/dist/context/assert-first.cjs.map +1 -1
- package/dist/context/assert-first.d.cts +1 -0
- package/dist/context/assert-first.d.mts +1 -0
- package/dist/context/assert-first.d.ts +1 -0
- package/dist/context/attempt-resources.cjs +13 -0
- package/dist/context/attempt-resources.cjs.map +1 -0
- package/dist/context/attempt-resources.d.cts +3 -0
- package/dist/context/attempt-resources.d.mts +3 -0
- package/dist/context/attempt-resources.d.ts +3 -0
- package/dist/context/attempt-resources.js +8 -0
- package/dist/context/attempt-resources.js.map +1 -0
- package/dist/context/session.cjs +4 -3
- package/dist/context/session.cjs.map +1 -1
- package/dist/context/session.d.cts +1 -0
- package/dist/context/session.d.mts +1 -0
- package/dist/context/session.d.ts +1 -0
- package/dist/eval/record/verdict.cjs +3 -2
- package/dist/eval/record/verdict.cjs.map +1 -1
- package/dist/experiment/host/index.cjs +1 -6
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/experiment/host/index.d.cts +1 -0
- package/dist/experiment/host/index.d.mts +1 -0
- package/dist/experiment/host/index.d.ts +1 -0
- package/dist/load-config.cjs +13 -4
- package/dist/load-config.cjs.map +1 -1
- package/dist/load-config.d.cts +4 -3
- package/dist/load-config.d.mts +4 -3
- package/dist/load-config.d.ts +4 -3
- package/dist/load-config.js +4 -2
- package/dist/o11y/parsers/codex.cjs +29 -7
- package/dist/o11y/parsers/codex.cjs.map +1 -1
- package/dist/record/codec/core.d.cts +0 -2
- package/dist/record/codec/core.d.mts +0 -2
- package/dist/record/codec/core.d.ts +0 -2
- package/dist/record/codec/identifiers.cjs +2 -3
- package/dist/record/codec/identifiers.cjs.map +1 -1
- package/dist/record/codec/identifiers.d.cts +1 -2
- package/dist/record/codec/identifiers.d.mts +1 -2
- package/dist/record/codec/identifiers.d.ts +1 -2
- package/dist/record/codec/identifiers.js +10 -12
- package/dist/record/codec/index.js +42 -44
- package/dist/record/definition/attachment.cjs +1 -0
- package/dist/record/definition/attachment.cjs.map +1 -1
- package/dist/record/definition/attachment.d.cts +14 -0
- package/dist/record/definition/attachment.d.mts +14 -0
- package/dist/record/definition/attachment.d.ts +14 -0
- package/dist/record/family/assertions-v1.cjs +104 -0
- package/dist/record/family/assertions-v1.cjs.map +1 -0
- package/dist/record/family/assertions-v1.d.cts +2 -0
- package/dist/record/family/assertions-v1.d.mts +2 -0
- package/dist/record/family/assertions-v1.d.ts +2 -0
- package/dist/record/family/assertions-v1.js +6 -0
- package/dist/record/family/assertions-v1.js.map +1 -0
- package/dist/record/family/assertions.cjs +16 -5
- package/dist/record/family/assertions.cjs.map +1 -1
- package/dist/record/family/assertions.d.cts +510 -56
- package/dist/record/family/assertions.d.mts +510 -56
- package/dist/record/family/assertions.d.ts +510 -56
- package/dist/record/family/assertions.js +14 -10
- package/dist/record/family/catalog.cjs +17 -1
- package/dist/record/family/catalog.cjs.map +1 -1
- package/dist/record/family/catalog.d.cts +1292 -104
- package/dist/record/family/catalog.d.mts +1292 -104
- package/dist/record/family/catalog.d.ts +1292 -104
- package/dist/record/family/catalog.js +22 -20
- package/dist/record/family/index.js +144 -138
- package/dist/record/family/observability-v1.cjs +5 -0
- package/dist/record/family/observability-v1.cjs.map +1 -1
- package/dist/record/family/observability.cjs +1 -1
- package/dist/record/family/observability.cjs.map +1 -1
- package/dist/record/host/runtime.cjs +323 -173
- package/dist/record/host/runtime.cjs.map +1 -1
- package/dist/record/host/types.cjs.map +1 -1
- package/dist/record/host/types.d.cts +9 -7
- package/dist/record/host/types.d.mts +9 -7
- package/dist/record/host/types.d.ts +9 -7
- package/dist/record/model/core.cjs.map +1 -1
- package/dist/record/model/core.d.cts +1 -2
- package/dist/record/model/core.d.mts +1 -2
- package/dist/record/model/core.d.ts +1 -2
- package/dist/record/model/definition.cjs +1 -2
- package/dist/record/model/definition.cjs.map +1 -1
- package/dist/record/model/definition.d.cts +1 -7
- package/dist/record/model/definition.d.mts +1 -7
- package/dist/record/model/definition.d.ts +1 -7
- package/dist/record/model/identifiers.cjs +2 -3
- package/dist/record/model/identifiers.cjs.map +1 -1
- package/dist/record/model/identifiers.d.cts +1 -3
- package/dist/record/model/identifiers.d.mts +1 -3
- package/dist/record/model/identifiers.d.ts +1 -3
- package/dist/record/model/identifiers.js +36 -38
- package/dist/record/model/index.js +60 -62
- package/dist/record/platform/node.cjs +17 -7
- package/dist/record/platform/node.cjs.map +1 -1
- package/dist/record/platform/services.cjs.map +1 -1
- package/dist/record/platform/services.d.cts +8 -3
- package/dist/record/platform/services.d.mts +8 -3
- package/dist/record/platform/services.d.ts +8 -3
- package/dist/record/reader/format.cjs +16 -65
- package/dist/record/reader/format.cjs.map +1 -1
- package/dist/record/reader/format.d.cts +5 -9
- package/dist/record/reader/format.d.mts +5 -9
- package/dist/record/reader/format.d.ts +5 -9
- package/dist/record/reader/index.js +10 -8
- package/dist/record/reader/runtime.cjs +63 -32
- package/dist/record/reader/runtime.cjs.map +1 -1
- package/dist/record/reader/runtime.d.cts +40 -4
- package/dist/record/reader/runtime.d.mts +40 -4
- package/dist/record/reader/runtime.d.ts +40 -4
- package/dist/record/reader/runtime.js +6 -4
- package/dist/report/assets/enhance.js +5 -5
- package/dist/report/assets/styles.css +190 -24
- package/dist/report/built-in/result-components.cjs +8 -5
- package/dist/report/built-in/result-components.cjs.map +1 -1
- package/dist/report/built-in/standard.cjs +3 -0
- package/dist/report/built-in/standard.cjs.map +1 -1
- package/dist/report/built-in/standard.d.cts +2 -0
- package/dist/report/built-in/standard.d.mts +2 -0
- package/dist/report/built-in/standard.d.ts +2 -0
- package/dist/report/client-dist/app.js +53 -0
- package/dist/report/components/attempt-detail/compute.cjs +108 -231
- package/dist/report/components/attempt-detail/compute.cjs.map +1 -1
- package/dist/report/components/attempt-detail/compute.d.cts +11 -45
- package/dist/report/components/attempt-detail/compute.d.mts +11 -45
- package/dist/report/components/attempt-detail/compute.d.ts +11 -45
- package/dist/report/components/attempt-detail/compute.js +2 -4
- package/dist/report/components/attempt-detail/content.cjs +4 -4
- package/dist/report/components/attempt-detail/content.cjs.map +1 -1
- package/dist/report/components/attempt-detail/validate.cjs +47 -4
- package/dist/report/components/attempt-detail/validate.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.cjs +9 -15
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/content.cjs +53 -40
- package/dist/report/components/entity-lists/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.cjs +1 -3
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/experiment-detail/compute.cjs +4 -6
- package/dist/report/components/experiment-detail/compute.cjs.map +1 -1
- package/dist/report/components/summaries/index.cjs +5 -1
- package/dist/report/components/summaries/index.cjs.map +1 -1
- package/dist/report/definition/cell.cjs +14 -7
- package/dist/report/definition/cell.cjs.map +1 -1
- package/dist/report/definition/cell.d.cts +4 -0
- package/dist/report/definition/cell.d.mts +4 -0
- package/dist/report/definition/cell.d.ts +4 -0
- package/dist/report/definition/primitives/assertion-evidence.cjs +96 -0
- package/dist/report/definition/primitives/assertion-evidence.cjs.map +1 -0
- package/dist/report/definition/primitives/assertion-evidence.d.cts +11 -0
- package/dist/report/definition/primitives/assertion-evidence.d.mts +11 -0
- package/dist/report/definition/primitives/assertion-evidence.d.ts +11 -0
- package/dist/report/definition/primitives/assertion-evidence.js +6 -0
- package/dist/report/definition/primitives/assertion-evidence.js.map +1 -0
- package/dist/report/definition/primitives/conversation.cjs +7 -0
- package/dist/report/definition/primitives/conversation.cjs.map +1 -1
- package/dist/report/definition/primitives/conversation.d.cts +2 -0
- package/dist/report/definition/primitives/conversation.d.mts +2 -0
- package/dist/report/definition/primitives/conversation.d.ts +2 -0
- package/dist/report/definition/primitives/turn-trace.cjs +53 -3
- package/dist/report/definition/primitives/turn-trace.cjs.map +1 -1
- package/dist/report/definition/primitives.cjs +14 -1
- package/dist/report/definition/primitives.cjs.map +1 -1
- package/dist/report/definition/report.cjs +16 -8
- package/dist/report/definition/report.cjs.map +1 -1
- package/dist/report/definition/report.d.cts +6 -0
- package/dist/report/definition/report.d.mts +6 -0
- package/dist/report/definition/report.d.ts +6 -0
- package/dist/report/definition/table-text.cjs +12 -3
- package/dist/report/definition/table-text.cjs.map +1 -1
- package/dist/report/definition/table-text.d.cts +6 -1
- package/dist/report/definition/table-text.d.mts +6 -1
- package/dist/report/definition/table-text.d.ts +6 -1
- package/dist/report/execution/model.cjs +6 -14
- package/dist/report/execution/model.cjs.map +1 -1
- package/dist/report/execution/model.d.cts +5 -10
- package/dist/report/execution/model.d.mts +5 -10
- package/dist/report/execution/model.d.ts +5 -10
- package/dist/report/execution/model.js +6 -6
- package/dist/report/execution/paths.cjs +0 -11
- package/dist/report/execution/paths.cjs.map +1 -1
- package/dist/report/execution/paths.d.cts +0 -1
- package/dist/report/execution/paths.d.mts +0 -1
- package/dist/report/execution/paths.d.ts +0 -1
- package/dist/report/execution/paths.js +6 -8
- package/dist/report/host/execute.cjs +13 -22
- package/dist/report/host/execute.cjs.map +1 -1
- package/dist/report/host/execute.d.cts +1 -4
- package/dist/report/host/execute.d.mts +1 -4
- package/dist/report/host/execute.d.ts +1 -4
- package/dist/report/host/from-record.cjs +3 -0
- package/dist/report/host/from-record.cjs.map +1 -1
- package/dist/report/host/from-record.d.cts +4 -1
- package/dist/report/host/from-record.d.mts +4 -1
- package/dist/report/host/from-record.d.ts +4 -1
- package/dist/report/host/site-assets.cjs +1 -2
- package/dist/report/host/site-assets.cjs.map +1 -1
- package/dist/report/host/site-assets.d.cts +0 -1
- package/dist/report/host/site-assets.d.mts +0 -1
- package/dist/report/host/site-assets.d.ts +0 -1
- package/dist/report/host/site-assets.js +2 -4
- package/dist/report/host/static.cjs +71 -346
- package/dist/report/host/static.cjs.map +1 -1
- package/dist/report/host/static.d.cts +1 -3
- package/dist/report/host/static.d.mts +1 -3
- package/dist/report/host/static.d.ts +1 -3
- package/dist/report/host/static.js +2 -2
- package/dist/report/host/view-session.cjs.map +1 -1
- package/dist/report/host/view-session.d.cts +1 -1
- package/dist/report/host/view-session.d.mts +1 -1
- package/dist/report/host/view-session.d.ts +1 -1
- package/dist/report/model/locale.cjs +1 -1
- package/dist/report/model/locale.cjs.map +1 -1
- package/dist/report/model/locale.d.cts +1 -1
- package/dist/report/model/locale.d.mts +1 -1
- package/dist/report/model/locale.d.ts +1 -1
- package/dist/report/model/pricing.cjs +2 -2
- package/dist/report/model/pricing.cjs.map +1 -1
- package/dist/report/react/enhance.js +5 -5
- package/dist/report/react/styles.css +190 -24
- package/dist/runner/adoption.cjs +4 -7
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/attempt-resources.cjs +60 -0
- package/dist/runner/attempt-resources.cjs.map +1 -0
- package/dist/runner/attempt-resources.d.cts +13 -0
- package/dist/runner/attempt-resources.d.mts +13 -0
- package/dist/runner/attempt-resources.d.ts +13 -0
- package/dist/runner/attempt-resources.js +6 -0
- package/dist/runner/attempt-resources.js.map +1 -0
- package/dist/runner/attempt.cjs +37 -3
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/runner/feedback/failure.cjs +77 -2
- package/dist/runner/feedback/failure.cjs.map +1 -1
- package/dist/runner/feedback/failure.d.cts +2 -1
- package/dist/runner/feedback/failure.d.mts +2 -1
- package/dist/runner/feedback/failure.d.ts +2 -1
- package/dist/runner/project-current.cjs +2 -13
- package/dist/runner/project-current.cjs.map +1 -1
- package/dist/runner/project-current.d.cts +4 -2
- package/dist/runner/project-current.d.mts +4 -2
- package/dist/runner/project-current.d.ts +4 -2
- package/dist/runner/reporters/braintrust.cjs +7 -7
- package/dist/runner/reporters/braintrust.cjs.map +1 -1
- package/dist/runner/reuse-readback.cjs +3 -4
- package/dist/runner/reuse-readback.cjs.map +1 -1
- package/dist/runner/run.cjs +5 -2
- package/dist/runner/run.cjs.map +1 -1
- package/dist/sandbox/backend.cjs +32 -2
- package/dist/sandbox/backend.cjs.map +1 -1
- package/dist/sandbox/backend.d.cts +12 -1
- package/dist/sandbox/backend.d.mts +12 -1
- package/dist/sandbox/backend.d.ts +12 -1
- package/dist/sandbox/backend.js +28 -22
- package/dist/sandbox/docker.cjs +140 -0
- package/dist/sandbox/docker.cjs.map +1 -1
- package/dist/sandbox/docker.d.cts +3 -1
- package/dist/sandbox/docker.d.mts +3 -1
- package/dist/sandbox/docker.d.ts +3 -1
- package/dist/sandbox/e2b.cjs +42 -0
- package/dist/sandbox/e2b.cjs.map +1 -1
- package/dist/sandbox/e2b.d.cts +2 -0
- package/dist/sandbox/e2b.d.mts +2 -0
- package/dist/sandbox/e2b.d.ts +2 -0
- package/dist/sandbox/local.cjs +64 -0
- package/dist/sandbox/local.cjs.map +1 -1
- package/dist/sandbox/local.d.cts +3 -1
- package/dist/sandbox/local.d.mts +3 -1
- package/dist/sandbox/local.d.ts +3 -1
- package/dist/sandbox/managed-process.cjs +49 -0
- package/dist/sandbox/managed-process.cjs.map +1 -0
- package/dist/sandbox/managed-process.d.cts +11 -0
- package/dist/sandbox/managed-process.d.mts +11 -0
- package/dist/sandbox/managed-process.d.ts +11 -0
- package/dist/sandbox/managed-process.js +6 -0
- package/dist/sandbox/managed-process.js.map +1 -0
- package/dist/sandbox/types.cjs.map +1 -1
- package/dist/sandbox/types.d.cts +24 -0
- package/dist/sandbox/types.d.mts +24 -0
- package/dist/sandbox/types.d.ts +24 -0
- package/dist/sandbox/vercel.cjs +1 -0
- package/dist/sandbox/vercel.cjs.map +1 -1
- package/dist/sandbox/vercel.d.cts +1 -0
- package/dist/sandbox/vercel.d.mts +1 -0
- package/dist/sandbox/vercel.d.ts +1 -0
- package/dist/view/server.cjs +2 -37
- package/dist/view/server.cjs.map +1 -1
- package/dist/view/server.d.cts +0 -3
- package/dist/view/server.d.mts +0 -3
- package/dist/view/server.d.ts +0 -3
- package/docs-site/zh/reference/builtin-agents.mdx +7 -7
- package/docs-site/zh/reference/official-adapters.mdx +4 -4
- package/docs-site/zh/reference/report-components.mdx +2 -2
- package/docs-site/zh/tutorials/configuration.mdx +2 -2
- package/docs-site/zh/tutorials/deploy-report-site.mdx +24 -2
- package/docs-site/zh/tutorials/publish-report.mdx +4 -4
- package/docs-site/zh/tutorials/sandbox-agent.mdx +5 -5
- package/docs-site/zh/tutorials/theming.mdx +2 -2
- package/package.json +4 -6
- package/dist/record/migration/index.cjs +0 -5
- package/dist/record/migration/index.cjs.map +0 -1
- package/dist/record/migration/index.d.cts +0 -11
- package/dist/record/migration/index.d.mts +0 -11
- package/dist/record/migration/index.d.ts +0 -11
- package/dist/record/migration/index.js +0 -6
- package/dist/record/migration/index.js.map +0 -1
- package/dist/report/host/site-runtime.cjs +0 -92
- package/dist/report/host/site-runtime.cjs.map +0 -1
- package/dist/report/host/site-runtime.d.cts +0 -9
- package/dist/report/host/site-runtime.d.mts +0 -9
- package/dist/report/host/site-runtime.d.ts +0 -9
- package/dist/report/host/site-runtime.js +0 -10
- package/dist/report/host/site-runtime.js.map +0 -1
- package/dist/view/client-dist/app.css +0 -2
- package/dist/view/client-dist/app.js +0 -49
- package/dist/view/data.cjs +0 -3
- package/dist/view/data.cjs.map +0 -1
- package/dist/view/data.d.cts +0 -9
- package/dist/view/data.d.mts +0 -9
- package/dist/view/data.d.ts +0 -9
- package/dist/view/data.js +0 -4
- package/dist/view/data.js.map +0 -1
- package/dist/view/index.cjs +0 -24
- package/dist/view/index.cjs.map +0 -1
- package/dist/view/index.d.cts +0 -9
- package/dist/view/index.d.mts +0 -9
- package/dist/view/index.d.ts +0 -9
- package/dist/view/index.js +0 -28
- package/dist/view/index.js.map +0 -1
- package/dist/view/report-view-cache.cjs +0 -200
- package/dist/view/report-view-cache.cjs.map +0 -1
- package/dist/view/report-view-cache.d.cts +0 -67
- package/dist/view/report-view-cache.d.mts +0 -67
- package/dist/view/report-view-cache.d.ts +0 -67
- package/dist/view/report-view-cache.js +0 -8
- package/dist/view/report-view-cache.js.map +0 -1
- package/dist/view/shared/types.cjs +0 -3
- package/dist/view/shared/types.cjs.map +0 -1
- package/dist/view/shared/types.d.cts +0 -51
- package/dist/view/shared/types.d.mts +0 -51
- package/dist/view/shared/types.d.ts +0 -51
- package/dist/view/shared/types.js +0 -4
- package/dist/view/shared/types.js.map +0 -1
- package/dist/view/site.cjs +0 -32
- package/dist/view/site.cjs.map +0 -1
- package/dist/view/site.d.cts +0 -24
- package/dist/view/site.d.mts +0 -24
- package/dist/view/site.d.ts +0 -24
- package/dist/view/site.js +0 -8
- package/dist/view/site.js.map +0 -1
- package/dist/view/styles.css +0 -170
- package/dist/view/template.html +0 -17
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { Cause, Effect } from "effect";
|
|
2
|
+
import { BrowserLauncher, CliArguments, CliInvocationFacts, CliOutput, CliPath, CliReportPlatform, CliTerminal, PackageMetadata, ProjectInitializer } from "./application.js";
|
|
3
|
+
import { ProjectConfiguration } from "./project-configuration.js";
|
|
4
|
+
import type { ExperimentRenamePlan, ExperimentRenameRejected, RenamedExperiment } from "../runner/rename-experiment.js";
|
|
5
|
+
import { ExperimentRenameError } from "../runner/rename-experiment.js";
|
|
6
|
+
import type { InvocationSummary } from "../types.js";
|
|
7
|
+
declare const CliUsageError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
8
|
+
readonly _tag: "CliUsageError";
|
|
9
|
+
} & Readonly<A>;
|
|
10
|
+
/** A recoverable command-line usage error. Defects deliberately do not enter this channel. */
|
|
11
|
+
export declare class CliUsageError extends CliUsageError_base<{
|
|
12
|
+
readonly message: string;
|
|
13
|
+
readonly exitCode: number;
|
|
14
|
+
}> {
|
|
15
|
+
}
|
|
16
|
+
declare const CliOperationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
17
|
+
readonly _tag: "CliOperationError";
|
|
18
|
+
} & Readonly<A>;
|
|
19
|
+
/** A recoverable failure from a concrete CLI-owned boundary (file, process, or dynamic module). */
|
|
20
|
+
export declare class CliOperationError extends CliOperationError_base<{
|
|
21
|
+
readonly operation: string;
|
|
22
|
+
readonly cause: unknown;
|
|
23
|
+
readonly exitCode: number;
|
|
24
|
+
}> {
|
|
25
|
+
}
|
|
26
|
+
export type CliFailure = CliUsageError | CliOperationError;
|
|
27
|
+
/**
|
|
28
|
+
* Bootstrap owns process signals until an Eval has reached actual dispatch.
|
|
29
|
+
* The CLI claims the Invocation signal synchronously immediately before
|
|
30
|
+
* Experiment Host dispatch; it never infers this from argv outside the command
|
|
31
|
+
* dispatcher.
|
|
32
|
+
*/
|
|
33
|
+
export interface CliInterruptionOwnership {
|
|
34
|
+
readonly invocationSignal: AbortSignal;
|
|
35
|
+
/** False means bootstrap already accepted a root-owned first signal. */
|
|
36
|
+
readonly enterGracefulDispatch: () => boolean;
|
|
37
|
+
readonly requestInterrupt: () => void;
|
|
38
|
+
}
|
|
39
|
+
/** Bootstrap owns presentation of typed failures; defects and interruption stay in Cause. */
|
|
40
|
+
export declare function renderCliFailure(failure: CliFailure): string;
|
|
41
|
+
export interface Flags {
|
|
42
|
+
agent?: string;
|
|
43
|
+
model?: string;
|
|
44
|
+
attempts?: number;
|
|
45
|
+
maxConcurrency?: number;
|
|
46
|
+
maxBuildConcurrency?: number;
|
|
47
|
+
timeout?: number;
|
|
48
|
+
earlyExit?: boolean;
|
|
49
|
+
dry: boolean;
|
|
50
|
+
force: boolean;
|
|
51
|
+
rerun?: "failed" | "all";
|
|
52
|
+
budget?: number;
|
|
53
|
+
tag?: string;
|
|
54
|
+
junit?: string;
|
|
55
|
+
/** `exp` 命令专用:机器面(NDJSON 事件流)。省略即人读文本(见 `resolveOutputForm`)。 */
|
|
56
|
+
json: boolean;
|
|
57
|
+
/** `docker profile doctor` 专用:运行一次真实嵌套 Docker 冒烟。 */
|
|
58
|
+
smoke: boolean;
|
|
59
|
+
open?: boolean;
|
|
60
|
+
out?: string;
|
|
61
|
+
port?: number;
|
|
62
|
+
host?: string;
|
|
63
|
+
help: boolean;
|
|
64
|
+
version: boolean;
|
|
65
|
+
/** `clean` / `migrate` 专用:确认删除未完成 Run 或在 clean Git restore point 下执行 migration。 */
|
|
66
|
+
yes: boolean;
|
|
67
|
+
source?: true | string;
|
|
68
|
+
execution: boolean;
|
|
69
|
+
diff: boolean;
|
|
70
|
+
/** --diff=<路径>(必须 = 连写;空格形式会把路径当 eval id 前缀,按文档如此)。 */
|
|
71
|
+
diffPath?: string;
|
|
72
|
+
/** `show @<AttemptId> --execution` 专用:JS 正则,只显示命中的 transcript / tool / command evidence。 */
|
|
73
|
+
grep?: string;
|
|
74
|
+
timing?: "summary" | "full";
|
|
75
|
+
keepSandbox?: "failed" | "all";
|
|
76
|
+
all: boolean;
|
|
77
|
+
window?: string;
|
|
78
|
+
sandboxPath?: string;
|
|
79
|
+
leaveRunning: boolean;
|
|
80
|
+
history: boolean;
|
|
81
|
+
usage: boolean;
|
|
82
|
+
stats: boolean;
|
|
83
|
+
/** `show` / `view` 命令专用:默认读取当前项目结果时,按完整 ExperimentId 收窄目标。 */
|
|
84
|
+
experiment?: string[];
|
|
85
|
+
/** `show` / `view` / `accept` / `sandbox enter|list|stop` 共用:记录根目录(`.niceeval` 之外的另一个根,如 `publish` 产出的发布根)。 */
|
|
86
|
+
record?: string;
|
|
87
|
+
/** `show` / `view` 命令专用:`--run` 可重复;按完整 RunId 去重。 */
|
|
88
|
+
run?: string[];
|
|
89
|
+
report?: string;
|
|
90
|
+
page?: string;
|
|
91
|
+
theme?: string;
|
|
92
|
+
/** `sandbox list` 专用:核对强杀路径留下的无主实例。 */
|
|
93
|
+
orphans: boolean;
|
|
94
|
+
/** `exp` 命令专用:只对选中实验各执行一次实验级 teardown,不派发 attempt、不跑 setup。 */
|
|
95
|
+
teardown: boolean;
|
|
96
|
+
/** `exp --teardown` 专用:请求显式恢复的 sharedState key。 */
|
|
97
|
+
recoverSharedState?: string;
|
|
98
|
+
/** `exp --teardown --recover-shared-state` 专用:不可变 lease owner token。 */
|
|
99
|
+
ownerToken?: string;
|
|
100
|
+
/** 明确确认记录的 owner 已终止;没有它恢复拒绝执行。 */
|
|
101
|
+
confirmOwnerTerminated: boolean;
|
|
102
|
+
/** 明确确认远端外部状态已静止;没有它恢复拒绝执行。 */
|
|
103
|
+
confirmRemoteQuiesced: boolean;
|
|
104
|
+
}
|
|
105
|
+
export declare const FLAG_OPTIONS: {
|
|
106
|
+
/** experiment 运行不支持该 flag。要换 agent,请在 `experiments/` 下新增或复制一个配置文件。 */
|
|
107
|
+
readonly agent: {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
};
|
|
110
|
+
/** experiment 运行不支持该 flag。要换模型,请新增或复制一个 experiment 文件并修改 `model`。 */
|
|
111
|
+
readonly model: {
|
|
112
|
+
readonly type: "string";
|
|
113
|
+
};
|
|
114
|
+
/** 每个 eval 运行多少次,常用于 pass@N。 */
|
|
115
|
+
readonly attempts: {
|
|
116
|
+
readonly type: "string";
|
|
117
|
+
};
|
|
118
|
+
/** 设置同时运行的 eval 数量。 */
|
|
119
|
+
readonly "max-concurrency": {
|
|
120
|
+
readonly type: "string";
|
|
121
|
+
};
|
|
122
|
+
/** 设置同时进行的 Sandbox 镜像 lookup/build 数量;与 eval 并发独立,默认 2。 */
|
|
123
|
+
readonly "max-build-concurrency": {
|
|
124
|
+
readonly type: "string";
|
|
125
|
+
};
|
|
126
|
+
/** 单个 attempt 的超时时间,单位毫秒。解析链:`--timeout` > experiment > eval(`defineEval({ timeoutMs })`)> `niceeval.config.ts`,默认无上限(四层都没声明就不设 deadline);config 是缺省底而不是覆盖层,写了 config 不会让 eval 自己声明的上限失效。 */
|
|
127
|
+
readonly timeout: {
|
|
128
|
+
readonly type: "string";
|
|
129
|
+
};
|
|
130
|
+
/** 整次运行的预算上限(美元)。 */
|
|
131
|
+
readonly budget: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
};
|
|
134
|
+
/** `exp` 命令专用:跑完留下 failed/errored attempt 的 Sandbox 现场(= `--keep-sandbox=failed`);`--keep-sandbox=all` 连 passed 也留。事后用 `niceeval sandbox list/enter/stop` 查看与销毁。 */
|
|
135
|
+
readonly "keep-sandbox": {
|
|
136
|
+
readonly type: "boolean";
|
|
137
|
+
};
|
|
138
|
+
/** `sandbox stop` 专用:销毁全部留存 Sandbox。 */
|
|
139
|
+
readonly all: {
|
|
140
|
+
readonly type: "boolean";
|
|
141
|
+
};
|
|
142
|
+
/** `sandbox diff` 专用:只看某个 send 窗口(如 `--window turn2` 或 `--window session2/turn1`);省略输出全部窗口的串联视图。 */
|
|
143
|
+
readonly window: {
|
|
144
|
+
readonly type: "string";
|
|
145
|
+
};
|
|
146
|
+
/** `sandbox diff` 专用:只看某个文件的 patch;省略输出该窗口的全部文件。 */
|
|
147
|
+
readonly path: {
|
|
148
|
+
readonly type: "string";
|
|
149
|
+
};
|
|
150
|
+
/** `sandbox enter` 专用:shell 退出后让现场保持运行,不送回休眠。 */
|
|
151
|
+
readonly "leave-running": {
|
|
152
|
+
readonly type: "boolean";
|
|
153
|
+
};
|
|
154
|
+
/** `sandbox list` 专用:核对强杀(`SIGKILL` / 断电)路径留下的无主沙箱实例(docker + e2b;vercel 无按元数据检索实例的通道,不参与)。只读,不清理;销毁走 `niceeval sandbox prune`。 */
|
|
155
|
+
readonly orphans: {
|
|
156
|
+
readonly type: "boolean";
|
|
157
|
+
};
|
|
158
|
+
/** 只运行带有该 tag 的 eval(见 `defineEval` 的 `tags`)。 */
|
|
159
|
+
readonly tag: {
|
|
160
|
+
readonly type: "string";
|
|
161
|
+
};
|
|
162
|
+
/** 额外写一份 JUnit XML 报告到指定路径,供 CI 消费。 */
|
|
163
|
+
readonly junit: {
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
};
|
|
166
|
+
/** `exp` 运行在 stdout 输出单一有序的 NDJSON 事件流;`exp --dry` 与 `debug` 输出各自的单个 JSON 计划文档。`show` 输出 Host 拥有的内建或自定义单目标机器文档,不形成完整站点或打开第二条取数路径。 */
|
|
167
|
+
readonly json: {
|
|
168
|
+
readonly type: "boolean";
|
|
169
|
+
};
|
|
170
|
+
/** `docker profile doctor` 专用:启动受限 DinD 容器并运行内层容器。 */
|
|
171
|
+
readonly smoke: {
|
|
172
|
+
readonly type: "boolean";
|
|
173
|
+
};
|
|
174
|
+
/** `view` 命令专用:把结果查看器静态导出到指定目录。 */
|
|
175
|
+
readonly out: {
|
|
176
|
+
readonly type: "string";
|
|
177
|
+
};
|
|
178
|
+
/** `view` 命令专用:指定本地服务器监听端口。 */
|
|
179
|
+
readonly port: {
|
|
180
|
+
readonly type: "string";
|
|
181
|
+
};
|
|
182
|
+
/** `view` 命令专用:指定监听地址;省略时为 127.0.0.1,只写 `--host` 时为 0.0.0.0。非 loopback 监听无认证或 TLS,会向所有可达客户端暴露报告数据。 */
|
|
183
|
+
readonly host: {
|
|
184
|
+
readonly type: "string";
|
|
185
|
+
};
|
|
186
|
+
/** `show` 专用:按一个 exact Attempt locator 展示已记录的 source snapshot。 */
|
|
187
|
+
readonly source: {
|
|
188
|
+
readonly type: "boolean";
|
|
189
|
+
};
|
|
190
|
+
/** `show @<AttemptLocator> --execution`:从公开 Record projection 呈现该 Attempt 的 transcript、tool 与 command evidence。 */
|
|
191
|
+
readonly execution: {
|
|
192
|
+
readonly type: "boolean";
|
|
193
|
+
};
|
|
194
|
+
/** `show @<AttemptLocator> --timing[=summary|full]` 专用:从内建 timing Report 读取该 Attempt 的 runner 阶段树。 */
|
|
195
|
+
readonly timing: {
|
|
196
|
+
readonly type: "boolean";
|
|
197
|
+
};
|
|
198
|
+
/** `show @<AttemptId> --execution` 专用:JS 正则过滤 retained transcript、tool 与 command evidence。 */
|
|
199
|
+
readonly grep: {
|
|
200
|
+
readonly type: "string";
|
|
201
|
+
};
|
|
202
|
+
/** 实现收敛占位;目标公开 CLI 通过 Report page 读取 diff 通道。 */
|
|
203
|
+
readonly diff: {
|
|
204
|
+
readonly type: "boolean";
|
|
205
|
+
};
|
|
206
|
+
/** 实现收敛占位;目标公开 CLI 不提供跨 Run history。 */
|
|
207
|
+
readonly history: {
|
|
208
|
+
readonly type: "boolean";
|
|
209
|
+
};
|
|
210
|
+
/** 实现收敛占位;目标公开 CLI 通过 Report Calculation 呈现用量。 */
|
|
211
|
+
readonly usage: {
|
|
212
|
+
readonly type: "boolean";
|
|
213
|
+
};
|
|
214
|
+
/** 实现收敛占位;目标公开 CLI 不提供隐式跨 Run 统计。 */
|
|
215
|
+
readonly stats: {
|
|
216
|
+
readonly type: "boolean";
|
|
217
|
+
};
|
|
218
|
+
/** `show` / `view` 命令专用:按完整 ExperimentId 收窄当前项目结果;可重复,不接受前缀或逗号列表。 */
|
|
219
|
+
readonly experiment: {
|
|
220
|
+
readonly type: "string";
|
|
221
|
+
readonly multiple: true;
|
|
222
|
+
};
|
|
223
|
+
/** `show` / `view` / `accept` / `sandbox enter|list|stop` 共用:指定实际 Record root;CLI 不补接 `.niceeval/record` 或其它后缀。 */
|
|
224
|
+
readonly record: {
|
|
225
|
+
readonly type: "string";
|
|
226
|
+
};
|
|
227
|
+
/** `show` / `view` 可重复传入 `--run`;每次按完整 RunId 增加一个显式 Run,重复 identity 去重。 */
|
|
228
|
+
readonly run: {
|
|
229
|
+
readonly type: "string";
|
|
230
|
+
readonly multiple: true;
|
|
231
|
+
};
|
|
232
|
+
/** `show` / `view` 命令专用:内建 `standard` 或受信任的 Report module 路径。 */
|
|
233
|
+
readonly report: {
|
|
234
|
+
readonly type: "string";
|
|
235
|
+
};
|
|
236
|
+
/** `show` / `view` 命令专用:内建 Theme 或受信任的闭合 Theme module 路径。 */
|
|
237
|
+
readonly theme: {
|
|
238
|
+
readonly type: "string";
|
|
239
|
+
};
|
|
240
|
+
/** `show` / `view` 命令专用:选择报告的初始页;`show` 渲染该页并在尾部附其余页索引,`view` 以它作初始路由。未命中的页 id 按用法错误退出并列出可用页 id。 */
|
|
241
|
+
readonly page: {
|
|
242
|
+
readonly type: "string";
|
|
243
|
+
};
|
|
244
|
+
/** `exp` 命令专用:补齐被强杀打断的实验级 teardown——只对选中的实验各执行一次 teardown(新进程语义),不派发 attempt、不跑 setup;没有遗留登记也照常执行。与 eval 前缀位置参数组合是用法错误。 */
|
|
245
|
+
readonly teardown: {
|
|
246
|
+
readonly type: "boolean";
|
|
247
|
+
};
|
|
248
|
+
/** `exp --teardown` 专用:显式恢复一个永不自动接管的 sharedState lease;必须同时提供 --owner-token、--confirm-owner-terminated 和 --confirm-remote-quiesced。 */
|
|
249
|
+
readonly "recover-shared-state": {
|
|
250
|
+
readonly type: "string";
|
|
251
|
+
};
|
|
252
|
+
/** `--recover-shared-state` 专用:要恢复的不可变 owner token;错误或过期 token 不会修改 lease。 */
|
|
253
|
+
readonly "owner-token": {
|
|
254
|
+
readonly type: "string";
|
|
255
|
+
};
|
|
256
|
+
/** `--recover-shared-state` 专用:确认原 owner 已终止。 */
|
|
257
|
+
readonly "confirm-owner-terminated": {
|
|
258
|
+
readonly type: "boolean";
|
|
259
|
+
};
|
|
260
|
+
/** `--recover-shared-state` 专用:确认远端外部状态已静止。 */
|
|
261
|
+
readonly "confirm-remote-quiesced": {
|
|
262
|
+
readonly type: "boolean";
|
|
263
|
+
};
|
|
264
|
+
/** 只打印本次会匹配到的 eval × 运行配置,不实际执行(人读文本或 `--json` 单文档,见「机器怎么读:--json」)。 */
|
|
265
|
+
readonly dry: {
|
|
266
|
+
readonly type: "boolean";
|
|
267
|
+
};
|
|
268
|
+
/** `sandbox prune` 专用:除 orphan 外也销毁 unverified 实例;`exp` 明确拒绝此 flag,重跑失败项或全部项请用 `--rerun` / `--rerun all`。 */
|
|
269
|
+
readonly force: {
|
|
270
|
+
readonly type: "boolean";
|
|
271
|
+
};
|
|
272
|
+
/** `exp` 命令专用:重新运行失败项(裸写/failed)或全部项(all),不改变长期指纹。 */
|
|
273
|
+
readonly rerun: {
|
|
274
|
+
readonly type: "boolean";
|
|
275
|
+
};
|
|
276
|
+
/** 某个 eval 的一次 attempt 通过后,停止该 eval 剩余的 attempts;省略默认关(`attempts` 默认跑满、测完整通过率)。 */
|
|
277
|
+
readonly "early-exit": {
|
|
278
|
+
readonly type: "boolean";
|
|
279
|
+
};
|
|
280
|
+
/** 强制关闭首过即停,即使实验文件里写了 `earlyExit: true`。 */
|
|
281
|
+
readonly "no-early-exit": {
|
|
282
|
+
readonly type: "boolean";
|
|
283
|
+
};
|
|
284
|
+
/** `view` 命令专用:启动后自动打开浏览器(默认行为)。 */
|
|
285
|
+
readonly open: {
|
|
286
|
+
readonly type: "boolean";
|
|
287
|
+
};
|
|
288
|
+
readonly "no-open": {
|
|
289
|
+
readonly type: "boolean";
|
|
290
|
+
};
|
|
291
|
+
/** `clean` / `migrate` 专用:确认不可逆 maintenance 动作或在 clean Git restore point 下执行 migration。 */
|
|
292
|
+
readonly yes: {
|
|
293
|
+
readonly type: "boolean";
|
|
294
|
+
};
|
|
295
|
+
/** 打印用法说明并退出。 */
|
|
296
|
+
readonly help: {
|
|
297
|
+
readonly type: "boolean";
|
|
298
|
+
readonly short: "h";
|
|
299
|
+
};
|
|
300
|
+
/** 打印 niceeval 的版本号并退出。 */
|
|
301
|
+
readonly version: {
|
|
302
|
+
readonly type: "boolean";
|
|
303
|
+
readonly short: "v";
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* Fold the invocation's real fresh results and current Record readbacks at the
|
|
308
|
+
* same eval identity. This intentionally projects only identity + terminal
|
|
309
|
+
* verdict; a reused readback is never recreated as an EvalResult.
|
|
310
|
+
*/
|
|
311
|
+
export declare function foldInvocationEvalStats(summary: Pick<InvocationSummary, "results" | "reusedAttempts">): import("../shared/verdict.js").EvalLevelStats;
|
|
312
|
+
export declare const EXPERIMENT_RENAME_FORMAT: "niceeval.experimentRename";
|
|
313
|
+
export declare const EXPERIMENT_RENAME_SCHEMA_VERSION: 1;
|
|
314
|
+
/**
|
|
315
|
+
* exp rename 的机器文档:单份 JSON,按 status 判别。
|
|
316
|
+
* - `plan`(核心计划,可含 `blocked` 阻断原因);
|
|
317
|
+
* - `rejected`(核心 `renameExperiment` 抛 `ExperimentRenameError` 时的整批拒绝);
|
|
318
|
+
* - `done`(核心 `RenamedExperiment` = 成功文档)。
|
|
319
|
+
*/
|
|
320
|
+
export type ExperimentRenameJsonDocument = ExperimentRenamePlan | ExperimentRenameRejected | RenamedExperiment;
|
|
321
|
+
/**
|
|
322
|
+
* 解析 exp rename 的位置参数:必须恰好两个(一个旧 id、一个新 id)。
|
|
323
|
+
* 纯函数,CLI 与测试共用。
|
|
324
|
+
*/
|
|
325
|
+
export declare function parseExperimentRenamePositionals(args: readonly string[]): {
|
|
326
|
+
ok: true;
|
|
327
|
+
oldId: string;
|
|
328
|
+
newId: string;
|
|
329
|
+
} | {
|
|
330
|
+
ok: false;
|
|
331
|
+
kind: "usage";
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* exp rename 只允许 --dry / --json;返回第一个被误用的 flag,没有误用返回 undefined。
|
|
335
|
+
* 与 accept 同一套纪律:node:util parseArgs 已经报未知 flag,这里拒绝那些全局已知、
|
|
336
|
+
* 但会改变运行/查看语义的 flag。
|
|
337
|
+
*/
|
|
338
|
+
export declare function firstExperimentRenameUnsupportedFlag(flags: Flags): string | undefined;
|
|
339
|
+
/** 人读面:核心计划 → 预览文本。逐条列出迁移与排除;有 `blocked` 时点名阻断原因。 */
|
|
340
|
+
export declare function renderExperimentRenamePlanHuman(plan: ExperimentRenamePlan): string;
|
|
341
|
+
/** 拒绝的人读面:先给 reason 专属文案(点名旧 id、新 id、受影响 eval 与下一步),再补冲突清单。 */
|
|
342
|
+
export declare function renderExperimentRenameRejectedHuman(rejected: ExperimentRenameRejected): string;
|
|
343
|
+
/** 成功的人读面:新 snapshot 路径 + 逐条新 locator。 */
|
|
344
|
+
export declare function renderExperimentRenameDoneHuman(done: RenamedExperiment): string;
|
|
345
|
+
/** 机器面:单份 JSON 文档,不混入人读文本(见 rename.md「命令」)。 */
|
|
346
|
+
export declare function renderExperimentRenameJson(document: ExperimentRenameJsonDocument): string;
|
|
347
|
+
/** 把 renameExperiment 抛出的资格错误投影成 rejected 文档(JSON 与拒绝人读共用)。 */
|
|
348
|
+
export declare function experimentRenameRejectedFromError(error: ExperimentRenameError): ExperimentRenameRejected;
|
|
349
|
+
/** 退出码:可迁移预览与成功执行为 0;blocked 预览 / rejected 整批零写入按失败退出。 */
|
|
350
|
+
export declare function experimentRenameExitCode(document: ExperimentRenameJsonDocument): number;
|
|
351
|
+
export declare const cliProgram: (interruption?: CliInterruptionOwnership) => Effect.Effect<number, CliFailure, import("effect/Scope").Scope | import("../record/platform/services.js").RecordEntropy | import("../record/platform/services.js").RecordGit | ProjectConfiguration | CliArguments | CliInvocationFacts | CliOutput | ProjectInitializer | PackageMetadata | BrowserLauncher | CliPath | CliTerminal | CliReportPlatform | import("../report/host/static.js").ReportFileSystem | import("../report/host/from-record.js").ExecuteReportFromRecordRequirements>;
|
|
352
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createRequire as __niceevalCreateRequire } from "node:module";
|
|
2
|
+
const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
|
|
3
|
+
const __niceevalCanonical = __niceevalRequire("./program.cjs");
|
|
4
|
+
const __niceevalExport0 = __niceevalCanonical["CliOperationError"];
|
|
5
|
+
export { __niceevalExport0 as CliOperationError };
|
|
6
|
+
const __niceevalExport1 = __niceevalCanonical["CliUsageError"];
|
|
7
|
+
export { __niceevalExport1 as CliUsageError };
|
|
8
|
+
const __niceevalExport2 = __niceevalCanonical["EXPERIMENT_RENAME_FORMAT"];
|
|
9
|
+
export { __niceevalExport2 as EXPERIMENT_RENAME_FORMAT };
|
|
10
|
+
const __niceevalExport3 = __niceevalCanonical["EXPERIMENT_RENAME_SCHEMA_VERSION"];
|
|
11
|
+
export { __niceevalExport3 as EXPERIMENT_RENAME_SCHEMA_VERSION };
|
|
12
|
+
const __niceevalExport4 = __niceevalCanonical["FLAG_OPTIONS"];
|
|
13
|
+
export { __niceevalExport4 as FLAG_OPTIONS };
|
|
14
|
+
const __niceevalExport5 = __niceevalCanonical["cliProgram"];
|
|
15
|
+
export { __niceevalExport5 as cliProgram };
|
|
16
|
+
const __niceevalExport6 = __niceevalCanonical["experimentRenameExitCode"];
|
|
17
|
+
export { __niceevalExport6 as experimentRenameExitCode };
|
|
18
|
+
const __niceevalExport7 = __niceevalCanonical["experimentRenameRejectedFromError"];
|
|
19
|
+
export { __niceevalExport7 as experimentRenameRejectedFromError };
|
|
20
|
+
const __niceevalExport8 = __niceevalCanonical["firstExperimentRenameUnsupportedFlag"];
|
|
21
|
+
export { __niceevalExport8 as firstExperimentRenameUnsupportedFlag };
|
|
22
|
+
const __niceevalExport9 = __niceevalCanonical["foldInvocationEvalStats"];
|
|
23
|
+
export { __niceevalExport9 as foldInvocationEvalStats };
|
|
24
|
+
const __niceevalExport10 = __niceevalCanonical["parseExperimentRenamePositionals"];
|
|
25
|
+
export { __niceevalExport10 as parseExperimentRenamePositionals };
|
|
26
|
+
const __niceevalExport11 = __niceevalCanonical["renderCliFailure"];
|
|
27
|
+
export { __niceevalExport11 as renderCliFailure };
|
|
28
|
+
const __niceevalExport12 = __niceevalCanonical["renderExperimentRenameDoneHuman"];
|
|
29
|
+
export { __niceevalExport12 as renderExperimentRenameDoneHuman };
|
|
30
|
+
const __niceevalExport13 = __niceevalCanonical["renderExperimentRenameJson"];
|
|
31
|
+
export { __niceevalExport13 as renderExperimentRenameJson };
|
|
32
|
+
const __niceevalExport14 = __niceevalCanonical["renderExperimentRenamePlanHuman"];
|
|
33
|
+
export { __niceevalExport14 as renderExperimentRenamePlanHuman };
|
|
34
|
+
const __niceevalExport15 = __niceevalCanonical["renderExperimentRenameRejectedHuman"];
|
|
35
|
+
export { __niceevalExport15 as renderExperimentRenameRejectedHuman };
|
|
36
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.js","sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectConfigurationLayer = exports.ProjectConfiguration = exports.ConfigModuleLoaderLive = exports.ConfigModuleLoader = exports.ConfigModuleLoadError = exports.ProjectCredentialsLive = exports.ProjectCredentials = exports.ProjectCredentialsConflict = exports.ProjectCredentialsError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Node capabilities used by an application host while observing a project.
|
|
6
|
+
* They intentionally do not model a general filesystem: credentials delivery
|
|
7
|
+
* and trusted config-module loading are the two distinct capabilities here.
|
|
8
|
+
*/
|
|
9
|
+
const effect_1 = require("effect");
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const promises_1 = require("node:fs/promises");
|
|
12
|
+
const node_path_1 = require("node:path");
|
|
13
|
+
const load_config_ts_1 = require("../load-config.cjs");
|
|
14
|
+
class ProjectCredentialsError extends effect_1.Data.TaggedError("ProjectCredentialsError") {
|
|
15
|
+
}
|
|
16
|
+
exports.ProjectCredentialsError = ProjectCredentialsError;
|
|
17
|
+
class ProjectCredentialsConflict extends effect_1.Data.TaggedError("ProjectCredentialsConflict") {
|
|
18
|
+
}
|
|
19
|
+
exports.ProjectCredentialsConflict = ProjectCredentialsConflict;
|
|
20
|
+
class ProjectCredentials extends effect_1.Context.Tag("niceeval/cli/ProjectCredentials")() {
|
|
21
|
+
}
|
|
22
|
+
exports.ProjectCredentials = ProjectCredentials;
|
|
23
|
+
function normalizedCwd(cwd) {
|
|
24
|
+
return (0, node_path_1.resolve)(cwd);
|
|
25
|
+
}
|
|
26
|
+
function applyMissingEnvironment(raw) {
|
|
27
|
+
for (const line of raw.split("\n")) {
|
|
28
|
+
const entry = line.trim();
|
|
29
|
+
if (entry.length === 0 || entry.startsWith("#"))
|
|
30
|
+
continue;
|
|
31
|
+
const equals = entry.indexOf("=");
|
|
32
|
+
if (equals < 0)
|
|
33
|
+
continue;
|
|
34
|
+
const key = entry.slice(0, equals).trim();
|
|
35
|
+
if (key.length === 0 || process.env[key] !== undefined)
|
|
36
|
+
continue;
|
|
37
|
+
let value = entry.slice(equals + 1).trim();
|
|
38
|
+
if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
|
|
39
|
+
value = value.slice(1, -1);
|
|
40
|
+
}
|
|
41
|
+
process.env[key] = value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** One Layer-owned state machine; failed preparation deliberately returns to idle. */
|
|
45
|
+
exports.ProjectCredentialsLive = effect_1.Layer.effect(ProjectCredentials, effect_1.Effect.gen(function* () {
|
|
46
|
+
let state = { _tag: "idle" };
|
|
47
|
+
const mutex = yield* effect_1.Effect.makeSemaphore(1);
|
|
48
|
+
const prepare = (inputCwd) => effect_1.Effect.suspend(() => {
|
|
49
|
+
const cwd = normalizedCwd(inputCwd);
|
|
50
|
+
return effect_1.Effect.gen(function* () {
|
|
51
|
+
const fresh = yield* effect_1.Deferred.make();
|
|
52
|
+
// This is the complete atomic decision. No waiting or Node I/O occurs
|
|
53
|
+
// while the semaphore is held, so completion can always re-enter it.
|
|
54
|
+
const decision = yield* mutex.withPermits(1)(effect_1.Effect.sync(() => {
|
|
55
|
+
if (state._tag === "prepared") {
|
|
56
|
+
return state.cwd === cwd
|
|
57
|
+
? { _tag: "ready" }
|
|
58
|
+
: { _tag: "conflict", preparedCwd: state.cwd };
|
|
59
|
+
}
|
|
60
|
+
if (state._tag === "preparing") {
|
|
61
|
+
return state.cwd === cwd
|
|
62
|
+
? { _tag: "await", done: state.done }
|
|
63
|
+
: { _tag: "conflict", preparedCwd: state.cwd };
|
|
64
|
+
}
|
|
65
|
+
state = { _tag: "preparing", cwd, done: fresh };
|
|
66
|
+
return { _tag: "start", done: fresh };
|
|
67
|
+
}));
|
|
68
|
+
if (decision._tag === "ready")
|
|
69
|
+
return;
|
|
70
|
+
if (decision._tag === "conflict") {
|
|
71
|
+
return yield* effect_1.Effect.fail(new ProjectCredentialsConflict({
|
|
72
|
+
preparedCwd: decision.preparedCwd,
|
|
73
|
+
requestedCwd: cwd,
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
if (decision._tag === "start") {
|
|
77
|
+
// Daemon ownership makes an interrupted initiating caller harmless:
|
|
78
|
+
// it still settles the shared Deferred and restores idle on failure.
|
|
79
|
+
yield* effect_1.Effect.forkDaemon(effect_1.Effect.tryPromise({
|
|
80
|
+
try: async () => {
|
|
81
|
+
const path = (0, node_path_1.join)(cwd, ".env");
|
|
82
|
+
if ((0, node_fs_1.existsSync)(path))
|
|
83
|
+
applyMissingEnvironment(await (0, promises_1.readFile)(path, "utf8"));
|
|
84
|
+
},
|
|
85
|
+
catch: (cause) => new ProjectCredentialsError({ cwd, operation: "read-dotenv", cause }),
|
|
86
|
+
}).pipe(effect_1.Effect.exit, effect_1.Effect.flatMap((exit) => mutex.withPermits(1)(effect_1.Effect.gen(function* () {
|
|
87
|
+
if (state._tag === "preparing" && state.done === decision.done) {
|
|
88
|
+
state = exit._tag === "Success" ? { _tag: "prepared", cwd } : { _tag: "idle" };
|
|
89
|
+
}
|
|
90
|
+
yield* effect_1.Deferred.done(decision.done, exit);
|
|
91
|
+
})))));
|
|
92
|
+
}
|
|
93
|
+
return yield* effect_1.Deferred.await(decision.done);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
return { prepare };
|
|
97
|
+
}));
|
|
98
|
+
class ConfigModuleLoadError extends effect_1.Data.TaggedError("ConfigModuleLoadError") {
|
|
99
|
+
}
|
|
100
|
+
exports.ConfigModuleLoadError = ConfigModuleLoadError;
|
|
101
|
+
class ConfigModuleLoader extends effect_1.Context.Tag("niceeval/cli/ConfigModuleLoader")() {
|
|
102
|
+
}
|
|
103
|
+
exports.ConfigModuleLoader = ConfigModuleLoader;
|
|
104
|
+
/** Serial module loader. A failed rebuild never hands out a previous Config. */
|
|
105
|
+
exports.ConfigModuleLoaderLive = effect_1.Layer.effect(ConfigModuleLoader, effect_1.Effect.gen(function* () {
|
|
106
|
+
let canonical;
|
|
107
|
+
const mutex = yield* effect_1.Effect.makeSemaphore(1);
|
|
108
|
+
const load = (operation, inputCwd) => mutex.withPermits(1)(effect_1.Effect.tryPromise({
|
|
109
|
+
try: async () => {
|
|
110
|
+
const cwd = normalizedCwd(inputCwd);
|
|
111
|
+
if (operation === "loadOnce" && canonical?.cwd === cwd)
|
|
112
|
+
return canonical.config;
|
|
113
|
+
const config = await (operation === "rebuild" ? (0, load_config_ts_1.rebuildConfigModule)(cwd) : (0, load_config_ts_1.loadConfigModuleOnce)(cwd));
|
|
114
|
+
canonical = { cwd, config };
|
|
115
|
+
return config;
|
|
116
|
+
},
|
|
117
|
+
catch: (cause) => new ConfigModuleLoadError({ cwd: normalizedCwd(inputCwd), operation, cause }),
|
|
118
|
+
}));
|
|
119
|
+
return { loadOnce: (cwd) => load("loadOnce", cwd), rebuild: (cwd) => load("rebuild", cwd) };
|
|
120
|
+
}));
|
|
121
|
+
class ProjectConfiguration extends effect_1.Context.Tag("niceeval/cli/ProjectConfiguration")() {
|
|
122
|
+
}
|
|
123
|
+
exports.ProjectConfiguration = ProjectConfiguration;
|
|
124
|
+
/** Application composition only: callers must provide concrete capabilities. */
|
|
125
|
+
exports.ProjectConfigurationLayer = effect_1.Layer.effect(ProjectConfiguration, effect_1.Effect.gen(function* () {
|
|
126
|
+
const credentials = yield* ProjectCredentials;
|
|
127
|
+
const loader = yield* ConfigModuleLoader;
|
|
128
|
+
return {
|
|
129
|
+
prepare: credentials.prepare,
|
|
130
|
+
load: (cwd) => credentials.prepare(cwd).pipe(effect_1.Effect.zipRight(loader.loadOnce(cwd))),
|
|
131
|
+
rebuild: (cwd) => credentials.prepare(cwd).pipe(effect_1.Effect.zipRight(loader.rebuild(cwd))),
|
|
132
|
+
};
|
|
133
|
+
}));
|
|
134
|
+
//# sourceMappingURL=project-configuration.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-configuration.js","sourceRoot":"","sources":["project-configuration.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mCAAgE;AAChE,qCAAqC;AACrC,+CAA4C;AAC5C,yCAA0C;AAC1C,sDAA8E;AAE9E,MAAa,uBAAwB,SAAQ,aAAI,CAAC,WAAW,CAAC,yBAAyB,CAIrF;CACD;AALD,0DAKC;AACD,MAAa,0BAA2B,SAAQ,aAAI,CAAC,WAAW,CAAC,4BAA4B,CAG3F;CACD;AAJD,gEAIC;AAMD,MAAa,kBAAmB,SAAQ,gBAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,EAAiD;CACtI;AADD,gDACC;AAWD,SAAS,aAAa,CAAC,GAAW;IAC9B,OAAO,IAAA,mBAAO,EAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AACD,SAAS,uBAAuB,CAAC,GAAW;IACxC,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC1B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;YAC3C,SAAS;QACb,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QA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AAS,EAAE,KAAK,EAAE,CAAC;KAClG,CAAC,CAAC,CAAC;IACJ,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,EAAsC,CAAC;AACpI,CAAC,CAAC,CAAC,CAAC;AAOJ,MAAa,oBAAqB,SAAQ,gBAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,EAAqD;CAC9I;AADD,oDACC;AACD,gFAAgF;AACnE,QAAA,yBAAyB,GAAG,cAAK,CAAC,MAAM,CAAC,oBAAoB,EAAE,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC5F,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,kBAAkB,CAAC;IAC9C,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,kBAAkB,CAAC;IACzC,OAAO;QACH,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QACnF,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;KAClD,CAAC;AAC5C,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Node capabilities used by an application host while observing a project.\n * They intentionally do not model a general filesystem: credentials delivery\n * and trusted config-module loading are the two distinct capabilities here.\n */\nimport { Context, Data, Deferred, Effect, Layer } from \"effect\";\nimport { existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { loadConfigModuleOnce, rebuildConfigModule } from \"../load-config.ts\";\nimport type { Config } from \"../runner/types.ts\";\nexport class ProjectCredentialsError extends Data.TaggedError(\"ProjectCredentialsError\")<{\n readonly cwd: string;\n readonly operation: \"read-dotenv\";\n readonly cause: unknown;\n}> {\n}\nexport class ProjectCredentialsConflict extends Data.TaggedError(\"ProjectCredentialsConflict\")<{\n readonly preparedCwd: string;\n readonly requestedCwd: string;\n}> {\n}\nexport type ProjectCredentialsFailure = ProjectCredentialsError | ProjectCredentialsConflict;\nexport interface ProjectCredentialsService {\n /** Deliver missing credential variables from this project's .env exactly once. */\n readonly prepare: (cwd: string) => Effect.Effect<void, ProjectCredentialsFailure>;\n}\nexport class ProjectCredentials extends Context.Tag(\"niceeval/cli/ProjectCredentials\")<ProjectCredentials, ProjectCredentialsService>() {\n}\ntype CredentialState = {\n readonly _tag: \"idle\";\n} | {\n readonly _tag: \"preparing\";\n readonly cwd: string;\n readonly done: Deferred.Deferred<void, ProjectCredentialsError>;\n} | {\n readonly _tag: \"prepared\";\n readonly cwd: string;\n};\nfunction normalizedCwd(cwd: string): string {\n return resolve(cwd);\n}\nfunction applyMissingEnvironment(raw: string): void {\n for (const line of raw.split(\"\\n\")) {\n const entry = line.trim();\n if (entry.length === 0 || entry.startsWith(\"#\"))\n continue;\n const equals = entry.indexOf(\"=\");\n if (equals < 0)\n continue;\n const key = entry.slice(0, equals).trim();\n if (key.length === 0 || process.env[key] !== undefined)\n continue;\n let value = entry.slice(equals + 1).trim();\n if ((value.startsWith('\"') && value.endsWith('\"')) || (value.startsWith(\"'\") && value.endsWith(\"'\"))) {\n value = value.slice(1, -1);\n }\n process.env[key] = value;\n }\n}\n/** One Layer-owned state machine; failed preparation deliberately returns to idle. */\nexport const ProjectCredentialsLive = Layer.effect(ProjectCredentials, Effect.gen(function* () {\n let state: CredentialState = { _tag: \"idle\" };\n const mutex = yield* Effect.makeSemaphore(1);\n const prepare = (inputCwd: string): Effect.Effect<void, ProjectCredentialsFailure> => Effect.suspend(() => {\n const cwd = normalizedCwd(inputCwd);\n return Effect.gen(function* () {\n const fresh = yield* Deferred.make<void, ProjectCredentialsError>();\n // This is the complete atomic decision. No waiting or Node I/O occurs\n // while the semaphore is held, so completion can always re-enter it.\n const decision = yield* mutex.withPermits(1)(Effect.sync(() => {\n if (state._tag === \"prepared\") {\n return state.cwd === cwd\n ? { _tag: \"ready\" as const }\n : { _tag: \"conflict\" as const, preparedCwd: state.cwd };\n }\n if (state._tag === \"preparing\") {\n return state.cwd === cwd\n ? { _tag: \"await\" as const, done: state.done }\n : { _tag: \"conflict\" as const, preparedCwd: state.cwd };\n }\n state = { _tag: \"preparing\", cwd, done: fresh };\n return { _tag: \"start\" as const, done: fresh };\n }));\n if (decision._tag === \"ready\")\n return;\n if (decision._tag === \"conflict\") {\n return yield* Effect.fail(new ProjectCredentialsConflict({\n preparedCwd: decision.preparedCwd,\n requestedCwd: cwd,\n }));\n }\n if (decision._tag === \"start\") {\n // Daemon ownership makes an interrupted initiating caller harmless:\n // it still settles the shared Deferred and restores idle on failure.\n yield* Effect.forkDaemon(Effect.tryPromise({\n try: async () => {\n const path = join(cwd, \".env\");\n if (existsSync(path))\n applyMissingEnvironment(await readFile(path, \"utf8\"));\n },\n catch: (cause) => new ProjectCredentialsError({ cwd, operation: \"read-dotenv\", cause }),\n }).pipe(Effect.exit, Effect.flatMap((exit) => mutex.withPermits(1)(Effect.gen(function* () {\n if (state._tag === \"preparing\" && state.done === decision.done) {\n state = exit._tag === \"Success\" ? { _tag: \"prepared\", cwd } : { _tag: \"idle\" };\n }\n yield* Deferred.done(decision.done, exit);\n })))));\n }\n return yield* Deferred.await(decision.done);\n });\n });\n return { prepare } satisfies ProjectCredentialsService;\n}));\nexport class ConfigModuleLoadError extends Data.TaggedError(\"ConfigModuleLoadError\")<{\n readonly cwd: string;\n readonly operation: \"loadOnce\" | \"rebuild\";\n readonly cause: unknown;\n}> {\n}\nexport interface ConfigModuleLoaderService {\n readonly loadOnce: (cwd: string) => Effect.Effect<Config, ConfigModuleLoadError>;\n readonly rebuild: (cwd: string) => Effect.Effect<Config, ConfigModuleLoadError>;\n}\nexport class ConfigModuleLoader extends Context.Tag(\"niceeval/cli/ConfigModuleLoader\")<ConfigModuleLoader, ConfigModuleLoaderService>() {\n}\n/** Serial module loader. A failed rebuild never hands out a previous Config. */\nexport const ConfigModuleLoaderLive = Layer.effect(ConfigModuleLoader, Effect.gen(function* () {\n let canonical: {\n cwd: string;\n config: Config;\n } | undefined;\n const mutex = yield* Effect.makeSemaphore(1);\n const load = (operation: \"loadOnce\" | \"rebuild\", inputCwd: string) => mutex.withPermits(1)(Effect.tryPromise({\n try: async () => {\n const cwd = normalizedCwd(inputCwd);\n if (operation === \"loadOnce\" && canonical?.cwd === cwd)\n return canonical.config;\n const config = await (operation === \"rebuild\" ? rebuildConfigModule(cwd) : loadConfigModuleOnce(cwd));\n canonical = { cwd, config };\n return config;\n },\n catch: (cause) => new ConfigModuleLoadError({ cwd: normalizedCwd(inputCwd), operation, cause }),\n }));\n return { loadOnce: (cwd) => load(\"loadOnce\", cwd), rebuild: (cwd) => load(\"rebuild\", cwd) } satisfies ConfigModuleLoaderService;\n}));\n/** The sole CLI application facade fixes the required credentials → config order. */\nexport interface ProjectConfigurationService {\n readonly prepare: (cwd: string) => Effect.Effect<void, ProjectCredentialsFailure>;\n readonly load: (cwd: string) => Effect.Effect<Config, ProjectCredentialsFailure | ConfigModuleLoadError>;\n readonly rebuild: (cwd: string) => Effect.Effect<Config, ProjectCredentialsFailure | ConfigModuleLoadError>;\n}\nexport class ProjectConfiguration extends Context.Tag(\"niceeval/cli/ProjectConfiguration\")<ProjectConfiguration, ProjectConfigurationService>() {\n}\n/** Application composition only: callers must provide concrete capabilities. */\nexport const ProjectConfigurationLayer = Layer.effect(ProjectConfiguration, Effect.gen(function* () {\n const credentials = yield* ProjectCredentials;\n const loader = yield* ConfigModuleLoader;\n return {\n prepare: credentials.prepare,\n load: (cwd) => credentials.prepare(cwd).pipe(Effect.zipRight(loader.loadOnce(cwd))),\n rebuild: (cwd) => credentials.prepare(cwd).pipe(Effect.zipRight(loader.rebuild(cwd))),\n } satisfies ProjectConfigurationService;\n}));\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node capabilities used by an application host while observing a project.
|
|
3
|
+
* They intentionally do not model a general filesystem: credentials delivery
|
|
4
|
+
* and trusted config-module loading are the two distinct capabilities here.
|
|
5
|
+
*/
|
|
6
|
+
import { Context, Effect, Layer } from "effect";
|
|
7
|
+
import type { Config } from "../runner/types.cjs";
|
|
8
|
+
declare const ProjectCredentialsError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
9
|
+
readonly _tag: "ProjectCredentialsError";
|
|
10
|
+
} & Readonly<A>;
|
|
11
|
+
export declare class ProjectCredentialsError extends ProjectCredentialsError_base<{
|
|
12
|
+
readonly cwd: string;
|
|
13
|
+
readonly operation: "read-dotenv";
|
|
14
|
+
readonly cause: unknown;
|
|
15
|
+
}> {
|
|
16
|
+
}
|
|
17
|
+
declare const ProjectCredentialsConflict_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
18
|
+
readonly _tag: "ProjectCredentialsConflict";
|
|
19
|
+
} & Readonly<A>;
|
|
20
|
+
export declare class ProjectCredentialsConflict extends ProjectCredentialsConflict_base<{
|
|
21
|
+
readonly preparedCwd: string;
|
|
22
|
+
readonly requestedCwd: string;
|
|
23
|
+
}> {
|
|
24
|
+
}
|
|
25
|
+
export type ProjectCredentialsFailure = ProjectCredentialsError | ProjectCredentialsConflict;
|
|
26
|
+
export interface ProjectCredentialsService {
|
|
27
|
+
/** Deliver missing credential variables from this project's .env exactly once. */
|
|
28
|
+
readonly prepare: (cwd: string) => Effect.Effect<void, ProjectCredentialsFailure>;
|
|
29
|
+
}
|
|
30
|
+
declare const ProjectCredentials_base: Context.TagClass<ProjectCredentials, "niceeval/cli/ProjectCredentials", ProjectCredentialsService>;
|
|
31
|
+
export declare class ProjectCredentials extends ProjectCredentials_base {
|
|
32
|
+
}
|
|
33
|
+
/** One Layer-owned state machine; failed preparation deliberately returns to idle. */
|
|
34
|
+
export declare const ProjectCredentialsLive: Layer.Layer<ProjectCredentials, never, never>;
|
|
35
|
+
declare const ConfigModuleLoadError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
36
|
+
readonly _tag: "ConfigModuleLoadError";
|
|
37
|
+
} & Readonly<A>;
|
|
38
|
+
export declare class ConfigModuleLoadError extends ConfigModuleLoadError_base<{
|
|
39
|
+
readonly cwd: string;
|
|
40
|
+
readonly operation: "loadOnce" | "rebuild";
|
|
41
|
+
readonly cause: unknown;
|
|
42
|
+
}> {
|
|
43
|
+
}
|
|
44
|
+
export interface ConfigModuleLoaderService {
|
|
45
|
+
readonly loadOnce: (cwd: string) => Effect.Effect<Config, ConfigModuleLoadError>;
|
|
46
|
+
readonly rebuild: (cwd: string) => Effect.Effect<Config, ConfigModuleLoadError>;
|
|
47
|
+
}
|
|
48
|
+
declare const ConfigModuleLoader_base: Context.TagClass<ConfigModuleLoader, "niceeval/cli/ConfigModuleLoader", ConfigModuleLoaderService>;
|
|
49
|
+
export declare class ConfigModuleLoader extends ConfigModuleLoader_base {
|
|
50
|
+
}
|
|
51
|
+
/** Serial module loader. A failed rebuild never hands out a previous Config. */
|
|
52
|
+
export declare const ConfigModuleLoaderLive: Layer.Layer<ConfigModuleLoader, never, never>;
|
|
53
|
+
/** The sole CLI application facade fixes the required credentials → config order. */
|
|
54
|
+
export interface ProjectConfigurationService {
|
|
55
|
+
readonly prepare: (cwd: string) => Effect.Effect<void, ProjectCredentialsFailure>;
|
|
56
|
+
readonly load: (cwd: string) => Effect.Effect<Config, ProjectCredentialsFailure | ConfigModuleLoadError>;
|
|
57
|
+
readonly rebuild: (cwd: string) => Effect.Effect<Config, ProjectCredentialsFailure | ConfigModuleLoadError>;
|
|
58
|
+
}
|
|
59
|
+
declare const ProjectConfiguration_base: Context.TagClass<ProjectConfiguration, "niceeval/cli/ProjectConfiguration", ProjectConfigurationService>;
|
|
60
|
+
export declare class ProjectConfiguration extends ProjectConfiguration_base {
|
|
61
|
+
}
|
|
62
|
+
/** Application composition only: callers must provide concrete capabilities. */
|
|
63
|
+
export declare const ProjectConfigurationLayer: Layer.Layer<ProjectConfiguration, never, ProjectCredentials | ConfigModuleLoader>;
|
|
64
|
+
export {};
|