niceeval 0.13.3 → 0.13.4-canary.39
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/INDEX.md +5 -5
- package/dist/agents/index.cjs +2 -2
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/project.json +6 -0
- package/dist/agents/streaming.cjs.map +1 -1
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.d.cts +1 -1
- package/dist/agents/types.d.mts +1 -1
- package/dist/agents/types.d.ts +1 -1
- package/dist/analysis/bindings.d.cts +8 -8
- package/dist/analysis/bindings.d.mts +8 -8
- package/dist/analysis/bindings.d.ts +8 -8
- package/dist/analysis/contracts.cjs.map +1 -1
- package/dist/analysis/contracts.d.cts +8 -19
- package/dist/analysis/contracts.d.mts +8 -19
- package/dist/analysis/contracts.d.ts +8 -19
- package/dist/analysis/experiment-groups.cjs +7 -14
- package/dist/analysis/experiment-groups.cjs.map +1 -1
- 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/cli/application.cjs +4 -13
- package/dist/cli/application.cjs.map +1 -1
- package/dist/cli/application.d.cts +62 -59
- package/dist/cli/application.d.mts +62 -59
- package/dist/cli/application.d.ts +62 -59
- package/dist/cli/application.js +6 -12
- package/dist/cli/bootstrap.cjs +28 -2
- package/dist/cli/bootstrap.cjs.map +1 -1
- package/dist/cli/contribution.cjs +185 -0
- package/dist/cli/contribution.cjs.map +1 -0
- package/dist/cli/contribution.d.cts +55 -0
- package/dist/cli/contribution.d.mts +55 -0
- package/dist/cli/contribution.d.ts +55 -0
- package/dist/cli/contribution.js +20 -0
- package/dist/cli/contribution.js.map +1 -0
- package/dist/cli/node-application.cjs +119 -87
- package/dist/cli/node-application.cjs.map +1 -1
- package/dist/cli/node-application.d.cts +2 -8
- package/dist/cli/node-application.d.mts +2 -8
- package/dist/cli/node-application.d.ts +2 -8
- package/dist/cli/node-application.js +12 -22
- package/dist/cli/program.cjs +87 -2756
- package/dist/cli/program.cjs.map +1 -1
- package/dist/cli/program.d.cts +11 -332
- package/dist/cli/program.d.mts +11 -332
- package/dist/cli/program.d.ts +11 -332
- package/dist/cli/program.js +4 -28
- package/dist/cli.cjs +0 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +0 -1
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +6 -14
- package/dist/define.cjs +1 -1
- package/dist/define.cjs.map +1 -1
- package/dist/docker/cache-administration.cjs +8 -0
- package/dist/docker/cache-administration.cjs.map +1 -0
- package/dist/docker/cache-administration.d.cts +33 -0
- package/dist/docker/cache-administration.d.mts +33 -0
- package/dist/docker/cache-administration.d.ts +33 -0
- package/dist/docker/cache-administration.js +6 -0
- package/dist/docker/cache-administration.js.map +1 -0
- package/dist/docker/cache-live.cjs +27 -0
- package/dist/docker/cache-live.cjs.map +1 -0
- package/dist/docker/cache-live.d.cts +3 -0
- package/dist/docker/cache-live.d.mts +3 -0
- package/dist/docker/cache-live.d.ts +3 -0
- package/dist/docker/cache-live.js +6 -0
- package/dist/docker/cache-live.js.map +1 -0
- package/dist/docker/cli/contribution.cjs +223 -0
- package/dist/docker/cli/contribution.cjs.map +1 -0
- package/dist/docker/cli/contribution.d.cts +48 -0
- package/dist/docker/cli/contribution.d.mts +48 -0
- package/dist/docker/cli/contribution.d.ts +48 -0
- package/dist/docker/cli/contribution.js +8 -0
- package/dist/docker/cli/contribution.js.map +1 -0
- package/dist/eval/cli/contribution.cjs +62 -0
- package/dist/eval/cli/contribution.cjs.map +1 -0
- package/dist/eval/cli/contribution.d.cts +21 -0
- package/dist/eval/cli/contribution.d.mts +21 -0
- package/dist/eval/cli/contribution.d.ts +21 -0
- package/dist/eval/cli/contribution.js +8 -0
- package/dist/eval/cli/contribution.js.map +1 -0
- package/dist/eval/host/index.cjs +23 -0
- package/dist/eval/host/index.cjs.map +1 -0
- package/dist/eval/host/index.d.cts +27 -0
- package/dist/eval/host/index.d.mts +27 -0
- package/dist/eval/host/index.d.ts +27 -0
- package/dist/eval/host/index.js +8 -0
- package/dist/eval/host/index.js.map +1 -0
- package/dist/eval/host/index.mjs +8 -0
- package/dist/eval/host/index.mjs.map +1 -0
- package/dist/experiment/host/cli/contribution.cjs +835 -0
- package/dist/experiment/host/cli/contribution.cjs.map +1 -0
- package/dist/experiment/host/cli/contribution.d.cts +329 -0
- package/dist/experiment/host/cli/contribution.d.mts +329 -0
- package/dist/experiment/host/cli/contribution.d.ts +329 -0
- package/dist/experiment/host/cli/contribution.js +22 -0
- package/dist/experiment/host/cli/contribution.js.map +1 -0
- package/dist/experiment/host/cli/index.cjs +9 -0
- package/dist/experiment/host/cli/index.cjs.map +1 -0
- package/dist/experiment/host/cli/index.d.cts +2 -0
- package/dist/experiment/host/cli/index.d.mts +2 -0
- package/dist/experiment/host/cli/index.d.ts +2 -0
- package/dist/experiment/host/cli/index.js +10 -0
- package/dist/experiment/host/cli/index.js.map +1 -0
- package/dist/experiment/host/cli/terminal.cjs +15 -0
- package/dist/experiment/host/cli/terminal.cjs.map +1 -0
- package/dist/experiment/host/cli/terminal.d.cts +14 -0
- package/dist/experiment/host/cli/terminal.d.mts +14 -0
- package/dist/experiment/host/cli/terminal.d.ts +14 -0
- package/dist/experiment/host/cli/terminal.js +8 -0
- package/dist/experiment/host/cli/terminal.js.map +1 -0
- package/dist/experiment/host/index.cjs +35 -58
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/experiment/host/index.d.cts +5 -79
- package/dist/experiment/host/index.d.mts +5 -79
- package/dist/experiment/host/index.d.ts +5 -79
- package/dist/experiment/host/index.js +4 -2
- package/dist/experiment/host/index.mjs +4 -2
- package/dist/experiment/host/operations.cjs +678 -0
- package/dist/experiment/host/operations.cjs.map +1 -0
- package/dist/experiment/host/operations.d.cts +19 -0
- package/dist/experiment/host/operations.d.mts +19 -0
- package/dist/experiment/host/operations.d.ts +19 -0
- package/dist/experiment/host/operations.js +24 -0
- package/dist/experiment/host/operations.js.map +1 -0
- package/dist/experiment/host/presentation.cjs +81 -0
- package/dist/experiment/host/presentation.cjs.map +1 -0
- package/dist/experiment/host/presentation.d.cts +9 -0
- package/dist/experiment/host/presentation.d.mts +9 -0
- package/dist/experiment/host/presentation.d.ts +9 -0
- package/dist/experiment/host/presentation.js +8 -0
- package/dist/experiment/host/presentation.js.map +1 -0
- package/dist/experiment/host/teardown.cjs +394 -0
- package/dist/experiment/host/teardown.cjs.map +1 -0
- package/dist/experiment/host/teardown.d.cts +5 -0
- package/dist/experiment/host/teardown.d.mts +5 -0
- package/dist/experiment/host/teardown.d.ts +5 -0
- package/dist/experiment/host/teardown.js +8 -0
- package/dist/experiment/host/teardown.js.map +1 -0
- package/dist/experiment/host/types.cjs +9 -0
- package/dist/experiment/host/types.cjs.map +1 -0
- package/dist/experiment/host/types.d.cts +423 -0
- package/dist/experiment/host/types.d.mts +423 -0
- package/dist/experiment/host/types.d.ts +423 -0
- package/dist/experiment/host/types.js +6 -0
- package/dist/experiment/host/types.js.map +1 -0
- package/dist/i18n/en.cjs +8 -50
- package/dist/i18n/en.cjs.map +1 -1
- package/dist/i18n/en.d.cts +2 -6
- package/dist/i18n/en.d.mts +2 -6
- package/dist/i18n/en.d.ts +2 -6
- package/dist/o11y/project.json +6 -0
- package/dist/project/cli/contribution.cjs +66 -0
- package/dist/project/cli/contribution.cjs.map +1 -0
- package/dist/project/cli/contribution.d.cts +17 -0
- package/dist/project/cli/contribution.d.mts +17 -0
- package/dist/project/cli/contribution.d.ts +17 -0
- package/dist/project/cli/contribution.js +8 -0
- package/dist/project/cli/contribution.js.map +1 -0
- package/dist/project/cli/index.cjs +7 -0
- package/dist/project/cli/index.cjs.map +1 -0
- package/dist/project/cli/index.d.cts +1 -0
- package/dist/project/cli/index.d.mts +1 -0
- package/dist/project/cli/index.d.ts +1 -0
- package/dist/project/cli/index.js +8 -0
- package/dist/project/cli/index.js.map +1 -0
- package/dist/project/host/index.cjs +11 -0
- package/dist/project/host/index.cjs.map +1 -0
- package/dist/project/host/index.d.cts +4 -0
- package/dist/project/host/index.d.mts +4 -0
- package/dist/project/host/index.d.ts +4 -0
- package/dist/project/host/index.js +14 -0
- package/dist/project/host/index.js.map +1 -0
- package/dist/project/host/index.mjs +14 -0
- package/dist/project/host/index.mjs.map +1 -0
- package/dist/project/host.cjs +59 -0
- package/dist/project/host.cjs.map +1 -0
- package/dist/project/host.d.cts +17 -0
- package/dist/project/host.d.mts +17 -0
- package/dist/project/host.d.ts +17 -0
- package/dist/project/host.js +6 -0
- package/dist/project/host.js.map +1 -0
- package/dist/project/index.cjs +11 -0
- package/dist/project/index.cjs.map +1 -0
- package/dist/project/index.d.cts +4 -0
- package/dist/project/index.d.mts +4 -0
- package/dist/project/index.d.ts +4 -0
- package/dist/project/index.js +14 -0
- package/dist/project/index.js.map +1 -0
- package/dist/project/node.cjs +91 -0
- package/dist/project/node.cjs.map +1 -0
- package/dist/project/node.d.cts +6 -0
- package/dist/project/node.d.mts +6 -0
- package/dist/project/node.d.ts +6 -0
- package/dist/project/node.js +12 -0
- package/dist/project/node.js.map +1 -0
- package/dist/project/services.cjs +17 -0
- package/dist/project/services.cjs.map +1 -0
- package/dist/project/services.d.cts +47 -0
- package/dist/project/services.d.mts +47 -0
- package/dist/project/services.d.ts +47 -0
- package/dist/project/services.js +12 -0
- package/dist/project/services.js.map +1 -0
- package/dist/project/templates.cjs +28 -0
- package/dist/project/templates.cjs.map +1 -0
- package/dist/project/templates.d.cts +4 -0
- package/dist/project/templates.d.mts +4 -0
- package/dist/project/templates.d.ts +4 -0
- package/dist/project/templates.js +12 -0
- package/dist/project/templates.js.map +1 -0
- package/dist/project.json +6 -0
- package/dist/record/family/catalog.d.cts +10 -10
- package/dist/record/family/catalog.d.mts +10 -10
- package/dist/record/family/catalog.d.ts +10 -10
- package/dist/record/family/file-changes.d.cts +8 -8
- package/dist/record/family/file-changes.d.mts +8 -8
- package/dist/record/family/file-changes.d.ts +8 -8
- package/dist/record/host/cli/contribution.cjs +206 -0
- package/dist/record/host/cli/contribution.cjs.map +1 -0
- package/dist/record/host/cli/contribution.d.cts +32 -0
- package/dist/record/host/cli/contribution.d.mts +32 -0
- package/dist/record/host/cli/contribution.d.ts +32 -0
- package/dist/record/host/cli/contribution.js +10 -0
- package/dist/record/host/cli/contribution.js.map +1 -0
- package/dist/record/host/cli/index.cjs +8 -0
- package/dist/record/host/cli/index.cjs.map +1 -0
- package/dist/record/host/cli/index.d.cts +1 -0
- package/dist/record/host/cli/index.d.mts +1 -0
- package/dist/record/host/cli/index.d.ts +1 -0
- package/dist/record/host/cli/index.js +10 -0
- package/dist/record/host/cli/index.js.map +1 -0
- package/dist/record/host/cli/presentation.cjs +122 -0
- package/dist/record/host/cli/presentation.cjs.map +1 -0
- package/dist/record/host/cli/presentation.d.cts +7 -0
- package/dist/record/host/cli/presentation.d.mts +7 -0
- package/dist/record/host/cli/presentation.d.ts +7 -0
- package/dist/record/host/cli/presentation.js +12 -0
- package/dist/record/host/cli/presentation.js.map +1 -0
- package/dist/record/host/index.cjs.map +1 -1
- package/dist/record/host/index.d.cts +1 -1
- package/dist/record/host/index.d.mts +1 -1
- package/dist/record/host/index.d.ts +1 -1
- package/dist/record/host/runtime.cjs +184 -1
- 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 +120 -0
- package/dist/record/host/types.d.mts +120 -0
- package/dist/record/host/types.d.ts +120 -0
- package/dist/record/project.json +6 -0
- package/dist/report/assets/styles.css +80 -0
- package/dist/report/cli/contribution.cjs +325 -0
- package/dist/report/cli/contribution.cjs.map +1 -0
- package/dist/report/cli/contribution.d.cts +143 -0
- package/dist/report/cli/contribution.d.mts +143 -0
- package/dist/report/cli/contribution.d.ts +143 -0
- package/dist/report/cli/contribution.js +12 -0
- package/dist/report/cli/contribution.js.map +1 -0
- package/dist/report/client-dist/app.js +9 -9
- package/dist/report/components/attempt-detail/content.cjs +1 -1
- package/dist/report/components/attempt-detail/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.cjs +5 -0
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.d.cts +2 -0
- package/dist/report/components/entity-lists/compute.d.mts +2 -0
- package/dist/report/components/entity-lists/compute.d.ts +2 -0
- package/dist/report/components/entity-lists/content.cjs +35 -12
- package/dist/report/components/entity-lists/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.cjs +0 -3
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/summaries/index.cjs +2 -4
- package/dist/report/components/summaries/index.cjs.map +1 -1
- package/dist/report/definition/cell.cjs +7 -2
- package/dist/report/definition/cell.cjs.map +1 -1
- package/dist/report/definition/cell.d.cts +2 -0
- package/dist/report/definition/cell.d.mts +2 -0
- package/dist/report/definition/cell.d.ts +2 -0
- package/dist/report/definition/primitives/assertion-evidence.cjs +190 -4
- package/dist/report/definition/primitives/assertion-evidence.cjs.map +1 -1
- package/dist/report/definition/primitives/assertion-evidence.d.cts +4 -0
- package/dist/report/definition/primitives/assertion-evidence.d.mts +4 -0
- package/dist/report/definition/primitives/assertion-evidence.d.ts +4 -0
- package/dist/report/execution/machine.cjs +2 -3
- package/dist/report/execution/machine.cjs.map +1 -1
- package/dist/report/execution/machine.d.cts +11 -8
- package/dist/report/execution/machine.d.mts +11 -8
- package/dist/report/execution/machine.d.ts +11 -8
- package/dist/report/host/from-record.cjs +13 -8
- package/dist/report/host/from-record.cjs.map +1 -1
- package/dist/report/host/index.cjs +5 -1
- package/dist/report/host/index.cjs.map +1 -1
- package/dist/report/host/index.d.cts +1 -0
- package/dist/report/host/index.d.mts +1 -0
- package/dist/report/host/index.d.ts +1 -0
- package/dist/report/host/index.js +8 -2
- package/dist/report/host/index.mjs +8 -2
- package/dist/report/host/machine.cjs +23 -22
- package/dist/report/host/machine.cjs.map +1 -1
- package/dist/report/host/machine.d.cts +1 -1
- package/dist/report/host/machine.d.mts +1 -1
- package/dist/report/host/machine.d.ts +1 -1
- package/dist/report/host/node/loader.cjs +4 -2
- package/dist/report/host/node/loader.cjs.map +1 -1
- package/dist/report/host/node/loader.d.cts +3 -1
- package/dist/report/host/node/loader.d.mts +3 -1
- package/dist/report/host/node/loader.d.ts +3 -1
- package/dist/report/host/node.cjs +44 -9
- package/dist/report/host/node.cjs.map +1 -1
- package/dist/report/host/node.d.cts +13 -3
- package/dist/report/host/node.d.mts +13 -3
- package/dist/report/host/node.d.ts +13 -3
- package/dist/report/host/node.js +44 -32
- package/dist/report/host/operations.cjs +14 -0
- package/dist/report/host/operations.cjs.map +1 -0
- package/dist/report/host/operations.d.cts +39 -0
- package/dist/report/host/operations.d.mts +39 -0
- package/dist/report/host/operations.d.ts +39 -0
- package/dist/report/host/operations.js +10 -0
- package/dist/report/host/operations.js.map +1 -0
- package/dist/report/model/chart/plot.cjs +1 -1
- package/dist/report/model/chart/plot.cjs.map +1 -1
- package/dist/report/model/locale.cjs +4 -0
- package/dist/report/model/locale.cjs.map +1 -1
- package/dist/report/model/locale.d.cts +3 -1
- package/dist/report/model/locale.d.mts +3 -1
- package/dist/report/model/locale.d.ts +3 -1
- package/dist/report/react/styles.css +80 -0
- package/dist/runner/build-preparation.cjs +5 -5
- package/dist/runner/build-preparation.cjs.map +1 -1
- package/dist/runner/build-preparation.d.cts +2 -3
- package/dist/runner/build-preparation.d.mts +2 -3
- package/dist/runner/build-preparation.d.ts +2 -3
- package/dist/runner/feedback/coordinator.cjs +18 -15
- package/dist/runner/feedback/coordinator.cjs.map +1 -1
- package/dist/runner/feedback/coordinator.d.cts +6 -0
- package/dist/runner/feedback/coordinator.d.mts +6 -0
- package/dist/runner/feedback/coordinator.d.ts +6 -0
- package/dist/runner/ledger.cjs +3 -13
- package/dist/runner/ledger.cjs.map +1 -1
- package/dist/runner/ledger.d.cts +1 -3
- package/dist/runner/ledger.d.mts +1 -3
- package/dist/runner/ledger.d.ts +1 -3
- package/dist/runner/run.cjs +63 -18
- package/dist/runner/run.cjs.map +1 -1
- package/dist/runner/session.cjs +10 -0
- package/dist/runner/session.cjs.map +1 -1
- package/dist/runner/session.d.cts +25 -0
- package/dist/runner/session.d.mts +25 -0
- package/dist/runner/session.d.ts +25 -0
- package/dist/runner/types.cjs.map +1 -1
- package/dist/runner/types.d.cts +1 -2
- package/dist/runner/types.d.mts +1 -2
- package/dist/runner/types.d.ts +1 -2
- package/dist/sandbox/build-coordinator.cjs +38 -19
- package/dist/sandbox/build-coordinator.cjs.map +1 -1
- package/dist/sandbox/build-coordinator.d.cts +47 -7
- package/dist/sandbox/build-coordinator.d.mts +47 -7
- package/dist/sandbox/build-coordinator.d.ts +47 -7
- package/dist/sandbox/build-coordinator.js +8 -4
- package/dist/sandbox/cli/contribution.cjs +128 -0
- package/dist/sandbox/cli/contribution.cjs.map +1 -0
- package/dist/sandbox/cli/contribution.d.cts +71 -0
- package/dist/sandbox/cli/contribution.d.mts +71 -0
- package/dist/sandbox/cli/contribution.d.ts +71 -0
- package/dist/sandbox/cli/contribution.js +8 -0
- package/dist/sandbox/cli/contribution.js.map +1 -0
- package/dist/sandbox/cli-commands.cjs +14 -21
- package/dist/sandbox/cli-commands.cjs.map +1 -1
- package/dist/sandbox/cli-commands.d.cts +12 -8
- package/dist/sandbox/cli-commands.d.mts +12 -8
- package/dist/sandbox/cli-commands.d.ts +12 -8
- package/dist/sandbox/compose.cjs +22 -2
- package/dist/sandbox/compose.cjs.map +1 -1
- package/dist/sandbox/compose.d.cts +1 -1
- package/dist/sandbox/compose.d.mts +1 -1
- package/dist/sandbox/compose.d.ts +1 -1
- package/dist/sandbox/docker-profile/cli.cjs +13 -9
- package/dist/sandbox/docker-profile/cli.cjs.map +1 -1
- package/dist/sandbox/docker-profile/cli.d.cts +2 -0
- package/dist/sandbox/docker-profile/cli.d.mts +2 -0
- package/dist/sandbox/docker-profile/cli.d.ts +2 -0
- package/dist/sandbox/docker-profile/runtime.cjs +68 -7
- package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
- package/dist/sandbox/docker-profile/runtime.d.cts +19 -1
- package/dist/sandbox/docker-profile/runtime.d.mts +19 -1
- package/dist/sandbox/docker-profile/runtime.d.ts +19 -1
- package/dist/sandbox/docker-profile/runtime.js +10 -8
- package/dist/sandbox/docker-profile/schema.cjs +68 -19
- package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.d.cts +23 -9
- package/dist/sandbox/docker-profile/schema.d.mts +23 -9
- package/dist/sandbox/docker-profile/schema.d.ts +23 -9
- package/dist/sandbox/docker-task-build-cache.cjs +532 -0
- package/dist/sandbox/docker-task-build-cache.cjs.map +1 -0
- package/dist/sandbox/docker-task-build-cache.d.cts +68 -0
- package/dist/sandbox/docker-task-build-cache.d.mts +68 -0
- package/dist/sandbox/docker-task-build-cache.d.ts +68 -0
- package/dist/sandbox/docker-task-build-cache.js +20 -0
- package/dist/sandbox/docker-task-build-cache.js.map +1 -0
- package/dist/sandbox/docker.cjs +50 -0
- package/dist/sandbox/docker.cjs.map +1 -1
- package/dist/sandbox/docker.d.cts +15 -0
- package/dist/sandbox/docker.d.mts +15 -0
- package/dist/sandbox/docker.d.ts +15 -0
- package/dist/sandbox/dockerfile-build.cjs +55 -5
- package/dist/sandbox/dockerfile-build.cjs.map +1 -1
- package/dist/sandbox/dockerfile-build.d.cts +2 -2
- package/dist/sandbox/dockerfile-build.d.mts +2 -2
- package/dist/sandbox/dockerfile-build.d.ts +2 -2
- package/dist/sandbox/index.cjs +5 -3
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +4 -3
- package/dist/sandbox/index.d.mts +4 -3
- package/dist/sandbox/index.d.ts +4 -3
- package/dist/sandbox/index.js +16 -14
- package/dist/sandbox/index.mjs +16 -14
- package/dist/sandbox/keep.cjs +1 -3
- package/dist/sandbox/keep.cjs.map +1 -1
- package/dist/sandbox/layer.cjs +70 -79
- package/dist/sandbox/layer.cjs.map +1 -1
- package/dist/sandbox/layer.d.cts +6 -12
- package/dist/sandbox/layer.d.mts +6 -12
- package/dist/sandbox/layer.d.ts +6 -12
- package/dist/sandbox/layer.js +16 -18
- package/dist/sandbox/ledger-paths.cjs +4 -18
- package/dist/sandbox/ledger-paths.cjs.map +1 -1
- package/dist/sandbox/ledger-paths.d.cts +3 -13
- package/dist/sandbox/ledger-paths.d.mts +3 -13
- package/dist/sandbox/ledger-paths.d.ts +3 -13
- package/dist/sandbox/ledger-paths.js +4 -8
- package/dist/sandbox/registry.cjs +1 -1
- package/dist/sandbox/registry.cjs.map +1 -1
- package/dist/sandbox/runtime.cjs +27 -37
- package/dist/sandbox/runtime.cjs.map +1 -1
- package/dist/sandbox/runtime.d.cts +1 -2
- package/dist/sandbox/runtime.d.mts +1 -2
- package/dist/sandbox/runtime.d.ts +1 -2
- package/dist/sandbox/runtime.js +6 -8
- package/dist/sandbox/types.cjs.map +1 -1
- package/dist/sandbox/types.d.cts +3 -3
- package/dist/sandbox/types.d.mts +3 -3
- package/dist/sandbox/types.d.ts +3 -3
- package/dist/sources/project.json +6 -0
- package/dist/vendor/remark/remark-gfm.cjs +72 -72
- package/dist/vendor/remark/remark-gfm.cjs.map +1 -1
- package/dist/vendor/remark/remark-parse.cjs +54 -54
- package/dist/vendor/remark/remark-parse.cjs.map +1 -1
- package/dist/vendor/remark/remark.cjs +125 -125
- package/dist/vendor/remark/remark.cjs.map +2 -2
- package/docs-site/zh/README.md +1 -1
- package/docs-site/zh/explanation/assert.mdx +4 -0
- package/docs-site/zh/explanation/judge.mdx +40 -9
- package/docs-site/zh/reference/cli.mdx +67 -43
- package/docs-site/zh/reference/define-agent.mdx +2 -2
- package/docs-site/zh/reference/report-components.mdx +4 -3
- package/docs-site/zh/troubleshooting/debug-sandbox.mdx +6 -0
- package/docs-site/zh/troubleshooting/debugging.mdx +28 -1
- package/docs-site/zh/tutorials/agent-feedback-loop.mdx +4 -2
- package/docs-site/zh/tutorials/concurrency.mdx +2 -2
- package/docs-site/zh/tutorials/custom-reports.mdx +175 -9
- package/docs-site/zh/tutorials/docker-in-docker.mdx +52 -7
- package/docs-site/zh/tutorials/eval-groups.mdx +1 -2
- package/docs-site/zh/tutorials/evaluation-kinds.mdx +39 -6
- package/docs-site/zh/tutorials/nixos-managed-dind.mdx +14 -5
- package/docs-site/zh/tutorials/sandbox-providers.mdx +1 -28
- package/docs-site/zh/tutorials/sandbox-reuse.mdx +1 -1
- package/docs-site/zh/tutorials/viewing-results.mdx +2 -0
- package/package.json +24 -19
- package/README.md +0 -176
- package/README.zh.md +0 -176
- package/dist/cli/record.cjs +0 -246
- package/dist/cli/record.cjs.map +0 -1
- package/dist/cli/record.d.cts +0 -40
- package/dist/cli/record.d.mts +0 -40
- package/dist/cli/record.d.ts +0 -40
- package/dist/cli/record.js +0 -10
- package/dist/cli/record.js.map +0 -1
- package/dist/sandbox/local.cjs +0 -361
- package/dist/sandbox/local.cjs.map +0 -1
- package/dist/sandbox/local.d.cts +0 -80
- package/dist/sandbox/local.d.mts +0 -80
- package/dist/sandbox/local.d.ts +0 -80
- package/dist/sandbox/local.js +0 -6
- package/dist/sandbox/local.js.map +0 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CliFeatureError = exports.CliCommandCompositionError = void 0;
|
|
4
|
+
exports.composeCliCommands = composeCliCommands;
|
|
5
|
+
exports.composeCliOptionSchema = composeCliOptionSchema;
|
|
6
|
+
exports.locateCliRoot = locateCliRoot;
|
|
7
|
+
exports.projectCliArgvWithoutRoot = projectCliArgvWithoutRoot;
|
|
8
|
+
exports.matchCliFeatureCommand = matchCliFeatureCommand;
|
|
9
|
+
exports.renderFeatureCommandIndex = renderFeatureCommandIndex;
|
|
10
|
+
const effect_1 = require("effect");
|
|
11
|
+
class CliCommandCompositionError extends Error {
|
|
12
|
+
_tag = "CliCommandCompositionError";
|
|
13
|
+
}
|
|
14
|
+
exports.CliCommandCompositionError = CliCommandCompositionError;
|
|
15
|
+
/** Feature-owned typed failure consumed by the one CLI failure boundary. */
|
|
16
|
+
class CliFeatureError extends effect_1.Data.TaggedError("CliFeatureError") {
|
|
17
|
+
}
|
|
18
|
+
exports.CliFeatureError = CliFeatureError;
|
|
19
|
+
const COMMAND_NAME = /^[a-z][a-z0-9-]*$/u;
|
|
20
|
+
const OPTION_NAME = /^[a-z][a-z0-9-]*$/u;
|
|
21
|
+
function sameOptionShape(left, right) {
|
|
22
|
+
const leftOptional = left.optionalValue;
|
|
23
|
+
const rightOptional = right.optionalValue;
|
|
24
|
+
return left.type === right.type &&
|
|
25
|
+
left.multiple === right.multiple &&
|
|
26
|
+
left.short === right.short &&
|
|
27
|
+
(leftOptional === undefined
|
|
28
|
+
? rightOptional === undefined
|
|
29
|
+
: rightOptional !== undefined &&
|
|
30
|
+
leftOptional.default === rightOptional.default &&
|
|
31
|
+
leftOptional.separated === rightOptional.separated &&
|
|
32
|
+
(leftOptional.values === undefined
|
|
33
|
+
? rightOptional.values === undefined
|
|
34
|
+
: rightOptional.values !== undefined &&
|
|
35
|
+
leftOptional.values.length === rightOptional.values.length &&
|
|
36
|
+
leftOptional.values.every((value, index) => value === rightOptional.values[index])));
|
|
37
|
+
}
|
|
38
|
+
function validateOptionSchema(name, options) {
|
|
39
|
+
if (!Object.isFrozen(options)) {
|
|
40
|
+
throw new CliCommandCompositionError(`CLI feature command ${name} must freeze its option schema`);
|
|
41
|
+
}
|
|
42
|
+
const shortNames = new Set();
|
|
43
|
+
for (const [optionName, option] of Object.entries(options)) {
|
|
44
|
+
if (!OPTION_NAME.test(optionName)) {
|
|
45
|
+
throw new CliCommandCompositionError(`Invalid CLI option name ${JSON.stringify(optionName)} for ${name}`);
|
|
46
|
+
}
|
|
47
|
+
if (!Object.isFrozen(option) || option.help === undefined || !Object.isFrozen(option.help)) {
|
|
48
|
+
throw new CliCommandCompositionError(`CLI option --${optionName} for ${name} must be immutable`);
|
|
49
|
+
}
|
|
50
|
+
if ((option.type !== "string" && option.type !== "boolean") || (option.multiple !== undefined && option.multiple !== true)) {
|
|
51
|
+
throw new CliCommandCompositionError(`Invalid parser shape for CLI option --${optionName} on ${name}`);
|
|
52
|
+
}
|
|
53
|
+
if (option.optionalValue !== undefined) {
|
|
54
|
+
const optional = option.optionalValue;
|
|
55
|
+
if (option.type !== "boolean" || option.multiple !== undefined || option.short !== undefined || !Object.isFrozen(optional)) {
|
|
56
|
+
throw new CliCommandCompositionError(`CLI option --${optionName} on ${name} has an invalid optional-value shape`);
|
|
57
|
+
}
|
|
58
|
+
if (optional.default !== true && (typeof optional.default !== "string" || optional.default.length === 0)) {
|
|
59
|
+
throw new CliCommandCompositionError(`CLI option --${optionName} on ${name} requires a non-empty optional-value default`);
|
|
60
|
+
}
|
|
61
|
+
if (optional.values !== undefined) {
|
|
62
|
+
if (!Object.isFrozen(optional.values) || optional.values.length === 0 ||
|
|
63
|
+
optional.values.some((value) => value.length === 0) ||
|
|
64
|
+
new Set(optional.values).size !== optional.values.length ||
|
|
65
|
+
(typeof optional.default === "string" && !optional.values.includes(optional.default))) {
|
|
66
|
+
throw new CliCommandCompositionError(`CLI option --${optionName} on ${name} requires a frozen, unique optional-value vocabulary containing its default`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (option.short !== undefined) {
|
|
71
|
+
if (!/^[A-Za-z0-9]$/u.test(option.short) || shortNames.has(option.short)) {
|
|
72
|
+
throw new CliCommandCompositionError(`Invalid or duplicate short option ${JSON.stringify(option.short)} on ${name}`);
|
|
73
|
+
}
|
|
74
|
+
shortNames.add(option.short);
|
|
75
|
+
}
|
|
76
|
+
if (option.help.summary.trim() === "" || (option.help.visibility !== "public" && option.help.visibility !== "hidden")) {
|
|
77
|
+
throw new CliCommandCompositionError(`CLI option --${optionName} on ${name} requires valid help metadata`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** Validate once at the composition edge and preserve the caller's deterministic help order. */
|
|
82
|
+
function composeCliCommands(contributions) {
|
|
83
|
+
const occupied = new Set();
|
|
84
|
+
const result = [];
|
|
85
|
+
for (const contribution of contributions) {
|
|
86
|
+
if (!Object.isFrozen(contribution)) {
|
|
87
|
+
throw new CliCommandCompositionError(`CLI feature command ${contribution.name} must be immutable`);
|
|
88
|
+
}
|
|
89
|
+
if (!COMMAND_NAME.test(contribution.name)) {
|
|
90
|
+
throw new CliCommandCompositionError(`Invalid CLI feature command name: ${JSON.stringify(contribution.name)}`);
|
|
91
|
+
}
|
|
92
|
+
if (contribution.summary.trim() === "") {
|
|
93
|
+
throw new CliCommandCompositionError(`CLI feature command ${contribution.name} requires a summary`);
|
|
94
|
+
}
|
|
95
|
+
validateOptionSchema(contribution.name, contribution.options);
|
|
96
|
+
if (occupied.has(contribution.name)) {
|
|
97
|
+
throw new CliCommandCompositionError(`Duplicate CLI root command: ${contribution.name}`);
|
|
98
|
+
}
|
|
99
|
+
occupied.add(contribution.name);
|
|
100
|
+
result.push(Object.freeze(contribution));
|
|
101
|
+
}
|
|
102
|
+
// Composition must reject parser conflicts even before a caller asks for the
|
|
103
|
+
// aggregate schema used by the root parser.
|
|
104
|
+
composeCliOptionSchema(result);
|
|
105
|
+
return Object.freeze(result);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Merge feature-owned schemas at the composition edge. Reusing an option name is
|
|
109
|
+
* only sound when Node will parse it with exactly the same syntax in every owner.
|
|
110
|
+
*/
|
|
111
|
+
function composeCliOptionSchema(contributions, applicationOptions = {}) {
|
|
112
|
+
const options = {};
|
|
113
|
+
const owners = new Map();
|
|
114
|
+
const shortOwners = new Map();
|
|
115
|
+
for (const [name, option] of Object.entries(applicationOptions)) {
|
|
116
|
+
options[name] = Object.freeze({ ...option });
|
|
117
|
+
owners.set(name, "application");
|
|
118
|
+
if (option.short !== undefined)
|
|
119
|
+
shortOwners.set(option.short, { name, owner: "application" });
|
|
120
|
+
}
|
|
121
|
+
for (const contribution of contributions) {
|
|
122
|
+
validateOptionSchema(contribution.name, contribution.options);
|
|
123
|
+
for (const [name, option] of Object.entries(contribution.options)) {
|
|
124
|
+
const existing = options[name];
|
|
125
|
+
if (existing !== undefined && !sameOptionShape(existing, option)) {
|
|
126
|
+
throw new CliCommandCompositionError(`Conflicting CLI option --${name}: ${owners.get(name)} and ${contribution.name} declare different parser shapes`);
|
|
127
|
+
}
|
|
128
|
+
if (existing === undefined) {
|
|
129
|
+
options[name] = option;
|
|
130
|
+
owners.set(name, contribution.name);
|
|
131
|
+
}
|
|
132
|
+
if (option.short !== undefined) {
|
|
133
|
+
const priorShort = shortOwners.get(option.short);
|
|
134
|
+
if (priorShort !== undefined && priorShort.name !== name) {
|
|
135
|
+
throw new CliCommandCompositionError(`Conflicting CLI short option -${option.short}: --${priorShort.name} (${priorShort.owner}) and --${name} (${contribution.name})`);
|
|
136
|
+
}
|
|
137
|
+
shortOwners.set(option.short, { name, owner: contribution.name });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return Object.freeze(options);
|
|
142
|
+
}
|
|
143
|
+
/** First positional Node token identifies the root without rewriting the raw argv. */
|
|
144
|
+
function locateCliRoot(tokens) {
|
|
145
|
+
const token = tokens.find((candidate) => candidate.kind === "positional");
|
|
146
|
+
return token === undefined ? undefined : Object.freeze({ index: token.index, name: token.value });
|
|
147
|
+
}
|
|
148
|
+
/** Delete exactly the command token: flags before/after it and `--` retain byte order. */
|
|
149
|
+
function projectCliArgvWithoutRoot(argv, root) {
|
|
150
|
+
if (root.index < 0 || root.index >= argv.length || argv[root.index] !== root.name) {
|
|
151
|
+
throw new CliCommandCompositionError(`CLI root token ${JSON.stringify(root.name)} has an invalid argv index`);
|
|
152
|
+
}
|
|
153
|
+
return Object.freeze(argv.filter((_, index) => index !== root.index));
|
|
154
|
+
}
|
|
155
|
+
function precedingGlobalHelpOrVersion(tokens, root) {
|
|
156
|
+
return tokens.some((token) => token.kind === "option" && token.index < root.index &&
|
|
157
|
+
(token.name === "help" || token.name === "version"));
|
|
158
|
+
}
|
|
159
|
+
/** Route one indexed root token while keeping application help/version formal capabilities. */
|
|
160
|
+
function matchCliFeatureCommand(argv, parsed, contributions) {
|
|
161
|
+
const root = locateCliRoot(parsed.tokens);
|
|
162
|
+
if (root === undefined)
|
|
163
|
+
return undefined;
|
|
164
|
+
const command = contributions.find((candidate) => candidate.name === root.name);
|
|
165
|
+
if (command === undefined)
|
|
166
|
+
return undefined;
|
|
167
|
+
const applicationHelp = parsed.tokens.some((token) => token.kind === "option" && token.name === "help" &&
|
|
168
|
+
(token.index < root.index || !Object.hasOwn(command.options, "help")));
|
|
169
|
+
if (applicationHelp)
|
|
170
|
+
return Object.freeze({ kind: "application-option", option: "help", root });
|
|
171
|
+
const applicationVersion = parsed.tokens.some((token) => token.kind === "option" && token.name === "version" &&
|
|
172
|
+
(token.index < root.index || !Object.hasOwn(command.options, "version")));
|
|
173
|
+
if (applicationVersion)
|
|
174
|
+
return Object.freeze({ kind: "application-option", option: "version", root });
|
|
175
|
+
if (precedingGlobalHelpOrVersion(parsed.tokens, root)) {
|
|
176
|
+
throw new CliCommandCompositionError("Application help/version routing lost its owner");
|
|
177
|
+
}
|
|
178
|
+
return Object.freeze({ kind: "command", command, argv: projectCliArgvWithoutRoot(argv, root), root });
|
|
179
|
+
}
|
|
180
|
+
function renderFeatureCommandIndex(contributions) {
|
|
181
|
+
if (contributions.length === 0)
|
|
182
|
+
return "";
|
|
183
|
+
return `\nFeature commands:\n${contributions.map(({ name, summary }) => ` niceeval ${name.padEnd(12)} ${summary}`).join("\n")}\n`;
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=contribution.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAsFA,gDAwBC;AAKD,wD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AE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClF,IAAI,4BAA4B,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,0BAA0B,CAAC,iDAAiD,CAAC,CAAC;IAC5F,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,yBAAyB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1G,CAAC;AACD,SAAgB,yBAAyB,CAAO,aAAsD;IAClG,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;QAC1B,OAAO,EAAE,CAAC;IACd,OAAO,wBAAwB,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,cAAc,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACvI,CAAC","sourcesContent":["import { Data, type Effect } from \"effect\";\nimport type { CliOptionDefinition, CliParsedToken, CliParsedTokens } from \"./application.ts\";\n/** A feature-owned root command. Commands are immutable values, not services or registrations. */\nexport interface CliCommandContribution<R, E> {\n readonly name: string;\n readonly summary: string;\n /** Complete parser schema for options this root command actually owns. */\n readonly options: Readonly<Record<string, CliOptionDefinition>>;\n readonly run: (argv: readonly string[]) => Effect.Effect<number, E, R>;\n}\nexport class CliCommandCompositionError extends Error {\n readonly _tag = \"CliCommandCompositionError\";\n}\n/** Feature-owned typed failure consumed by the one CLI failure boundary. */\nexport class CliFeatureError extends Data.TaggedError(\"CliFeatureError\")<{\n readonly feature: string;\n readonly operation: string;\n readonly cause: unknown;\n readonly exitCode: number;\n /** Feature-owned terminal text; the root only writes it once. */\n readonly display?: string;\n}> {\n}\nconst COMMAND_NAME = /^[a-z][a-z0-9-]*$/u;\nconst OPTION_NAME = /^[a-z][a-z0-9-]*$/u;\nfunction sameOptionShape(left: CliOptionDefinition, right: CliOptionDefinition): boolean {\n const leftOptional = left.optionalValue;\n const rightOptional = right.optionalValue;\n return left.type === right.type &&\n left.multiple === right.multiple &&\n left.short === right.short &&\n (leftOptional === undefined\n ? rightOptional === undefined\n : rightOptional !== undefined &&\n leftOptional.default === rightOptional.default &&\n leftOptional.separated === rightOptional.separated &&\n (leftOptional.values === undefined\n ? rightOptional.values === undefined\n : rightOptional.values !== undefined &&\n leftOptional.values.length === rightOptional.values.length &&\n leftOptional.values.every((value, index) => value === rightOptional.values![index])));\n}\nfunction validateOptionSchema(name: string, options: Readonly<Record<string, CliOptionDefinition>>): void {\n if (!Object.isFrozen(options)) {\n throw new CliCommandCompositionError(`CLI feature command ${name} must freeze its option schema`);\n }\n const shortNames = new Set<string>();\n for (const [optionName, option] of Object.entries(options)) {\n if (!OPTION_NAME.test(optionName)) {\n throw new CliCommandCompositionError(`Invalid CLI option name ${JSON.stringify(optionName)} for ${name}`);\n }\n if (!Object.isFrozen(option) || option.help === undefined || !Object.isFrozen(option.help)) {\n throw new CliCommandCompositionError(`CLI option --${optionName} for ${name} must be immutable`);\n }\n if ((option.type !== \"string\" && option.type !== \"boolean\") || (option.multiple !== undefined && option.multiple !== true)) {\n throw new CliCommandCompositionError(`Invalid parser shape for CLI option --${optionName} on ${name}`);\n }\n if (option.optionalValue !== undefined) {\n const optional = option.optionalValue;\n if (option.type !== \"boolean\" || option.multiple !== undefined || option.short !== undefined || !Object.isFrozen(optional)) {\n throw new CliCommandCompositionError(`CLI option --${optionName} on ${name} has an invalid optional-value shape`);\n }\n if (optional.default !== true && (typeof optional.default !== \"string\" || optional.default.length === 0)) {\n throw new CliCommandCompositionError(`CLI option --${optionName} on ${name} requires a non-empty optional-value default`);\n }\n if (optional.values !== undefined) {\n if (!Object.isFrozen(optional.values) || optional.values.length === 0 ||\n optional.values.some((value) => value.length === 0) ||\n new Set(optional.values).size !== optional.values.length ||\n (typeof optional.default === \"string\" && !optional.values.includes(optional.default))) {\n throw new CliCommandCompositionError(`CLI option --${optionName} on ${name} requires a frozen, unique optional-value vocabulary containing its default`);\n }\n }\n }\n if (option.short !== undefined) {\n if (!/^[A-Za-z0-9]$/u.test(option.short) || shortNames.has(option.short)) {\n throw new CliCommandCompositionError(`Invalid or duplicate short option ${JSON.stringify(option.short)} on ${name}`);\n }\n shortNames.add(option.short);\n }\n if (option.help.summary.trim() === \"\" || (option.help.visibility !== \"public\" && option.help.visibility !== \"hidden\")) {\n throw new CliCommandCompositionError(`CLI option --${optionName} on ${name} requires valid help metadata`);\n }\n }\n}\n/** Validate once at the composition edge and preserve the caller's deterministic help order. */\nexport function composeCliCommands<R, E>(contributions: readonly CliCommandContribution<R, E>[]): readonly CliCommandContribution<R, E>[] {\n const occupied = new Set<string>();\n const result: CliCommandContribution<R, E>[] = [];\n for (const contribution of contributions) {\n if (!Object.isFrozen(contribution)) {\n throw new CliCommandCompositionError(`CLI feature command ${contribution.name} must be immutable`);\n }\n if (!COMMAND_NAME.test(contribution.name)) {\n throw new CliCommandCompositionError(`Invalid CLI feature command name: ${JSON.stringify(contribution.name)}`);\n }\n if (contribution.summary.trim() === \"\") {\n throw new CliCommandCompositionError(`CLI feature command ${contribution.name} requires a summary`);\n }\n validateOptionSchema(contribution.name, contribution.options);\n if (occupied.has(contribution.name)) {\n throw new CliCommandCompositionError(`Duplicate CLI root command: ${contribution.name}`);\n }\n occupied.add(contribution.name);\n result.push(Object.freeze(contribution));\n }\n // Composition must reject parser conflicts even before a caller asks for the\n // aggregate schema used by the root parser.\n composeCliOptionSchema(result);\n return Object.freeze(result);\n}\n/**\n * Merge feature-owned schemas at the composition edge. Reusing an option name is\n * only sound when Node will parse it with exactly the same syntax in every owner.\n */\nexport function composeCliOptionSchema<R, E>(contributions: readonly CliCommandContribution<R, E>[], applicationOptions: Readonly<Record<string, CliOptionDefinition>> = {}): Readonly<Record<string, CliOptionDefinition>> {\n const options: Record<string, CliOptionDefinition> = {};\n const owners = new Map<string, string>();\n const shortOwners = new Map<string, {\n readonly name: string;\n readonly owner: string;\n }>();\n for (const [name, option] of Object.entries(applicationOptions)) {\n options[name] = Object.freeze({ ...option });\n owners.set(name, \"application\");\n if (option.short !== undefined)\n shortOwners.set(option.short, { name, owner: \"application\" });\n }\n for (const contribution of contributions) {\n validateOptionSchema(contribution.name, contribution.options);\n for (const [name, option] of Object.entries(contribution.options)) {\n const existing = options[name];\n if (existing !== undefined && !sameOptionShape(existing, option)) {\n throw new CliCommandCompositionError(`Conflicting CLI option --${name}: ${owners.get(name)} and ${contribution.name} declare different parser shapes`);\n }\n if (existing === undefined) {\n options[name] = option;\n owners.set(name, contribution.name);\n }\n if (option.short !== undefined) {\n const priorShort = shortOwners.get(option.short);\n if (priorShort !== undefined && priorShort.name !== name) {\n throw new CliCommandCompositionError(`Conflicting CLI short option -${option.short}: --${priorShort.name} (${priorShort.owner}) and --${name} (${contribution.name})`);\n }\n shortOwners.set(option.short, { name, owner: contribution.name });\n }\n }\n }\n return Object.freeze(options);\n}\nexport interface CliRootToken {\n readonly index: number;\n readonly name: string;\n}\n/** First positional Node token identifies the root without rewriting the raw argv. */\nexport function locateCliRoot(tokens: readonly CliParsedToken[]): CliRootToken | undefined {\n const token = tokens.find((candidate) => candidate.kind === \"positional\");\n return token === undefined ? undefined : Object.freeze({ index: token.index, name: token.value });\n}\n/** Delete exactly the command token: flags before/after it and `--` retain byte order. */\nexport function projectCliArgvWithoutRoot(argv: readonly string[], root: CliRootToken): readonly string[] {\n if (root.index < 0 || root.index >= argv.length || argv[root.index] !== root.name) {\n throw new CliCommandCompositionError(`CLI root token ${JSON.stringify(root.name)} has an invalid argv index`);\n }\n return Object.freeze(argv.filter((_, index) => index !== root.index));\n}\nfunction precedingGlobalHelpOrVersion(tokens: readonly CliParsedToken[], root: CliRootToken): boolean {\n return tokens.some((token) => token.kind === \"option\" && token.index < root.index &&\n (token.name === \"help\" || token.name === \"version\"));\n}\nexport type CliFeatureRoute<R, E> = Readonly<{\n readonly kind: \"application-option\";\n readonly option: \"help\" | \"version\";\n readonly root: CliRootToken;\n}> | Readonly<{\n readonly kind: \"command\";\n readonly command: CliCommandContribution<R, E>;\n readonly argv: readonly string[];\n readonly root: CliRootToken;\n}>;\n/** Route one indexed root token while keeping application help/version formal capabilities. */\nexport function matchCliFeatureCommand<R, E>(argv: readonly string[], parsed: CliParsedTokens, contributions: readonly CliCommandContribution<R, E>[]): CliFeatureRoute<R, E> | undefined {\n const root = locateCliRoot(parsed.tokens);\n if (root === undefined)\n return undefined;\n const command = contributions.find((candidate) => candidate.name === root.name);\n if (command === undefined)\n return undefined;\n const applicationHelp = parsed.tokens.some((token) => token.kind === \"option\" && token.name === \"help\" &&\n (token.index < root.index || !Object.hasOwn(command.options, \"help\")));\n if (applicationHelp)\n return Object.freeze({ kind: \"application-option\", option: \"help\", root });\n const applicationVersion = parsed.tokens.some((token) => token.kind === \"option\" && token.name === \"version\" &&\n (token.index < root.index || !Object.hasOwn(command.options, \"version\")));\n if (applicationVersion)\n return Object.freeze({ kind: \"application-option\", option: \"version\", root });\n if (precedingGlobalHelpOrVersion(parsed.tokens, root)) {\n throw new CliCommandCompositionError(\"Application help/version routing lost its owner\");\n }\n return Object.freeze({ kind: \"command\", command, argv: projectCliArgvWithoutRoot(argv, root), root });\n}\nexport function renderFeatureCommandIndex<R, E>(contributions: readonly CliCommandContribution<R, E>[]): string {\n if (contributions.length === 0)\n return \"\";\n return `\\nFeature commands:\\n${contributions.map(({ name, summary }) => ` niceeval ${name.padEnd(12)} ${summary}`).join(\"\\n\")}\\n`;\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Effect } from "effect";
|
|
2
|
+
import type { CliOptionDefinition, CliParsedToken, CliParsedTokens } from "./application.cjs";
|
|
3
|
+
/** A feature-owned root command. Commands are immutable values, not services or registrations. */
|
|
4
|
+
export interface CliCommandContribution<R, E> {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly summary: string;
|
|
7
|
+
/** Complete parser schema for options this root command actually owns. */
|
|
8
|
+
readonly options: Readonly<Record<string, CliOptionDefinition>>;
|
|
9
|
+
readonly run: (argv: readonly string[]) => Effect.Effect<number, E, R>;
|
|
10
|
+
}
|
|
11
|
+
export declare class CliCommandCompositionError extends Error {
|
|
12
|
+
readonly _tag = "CliCommandCompositionError";
|
|
13
|
+
}
|
|
14
|
+
declare const CliFeatureError_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 & {
|
|
15
|
+
readonly _tag: "CliFeatureError";
|
|
16
|
+
} & Readonly<A>;
|
|
17
|
+
/** Feature-owned typed failure consumed by the one CLI failure boundary. */
|
|
18
|
+
export declare class CliFeatureError extends CliFeatureError_base<{
|
|
19
|
+
readonly feature: string;
|
|
20
|
+
readonly operation: string;
|
|
21
|
+
readonly cause: unknown;
|
|
22
|
+
readonly exitCode: number;
|
|
23
|
+
/** Feature-owned terminal text; the root only writes it once. */
|
|
24
|
+
readonly display?: string;
|
|
25
|
+
}> {
|
|
26
|
+
}
|
|
27
|
+
/** Validate once at the composition edge and preserve the caller's deterministic help order. */
|
|
28
|
+
export declare function composeCliCommands<R, E>(contributions: readonly CliCommandContribution<R, E>[]): readonly CliCommandContribution<R, E>[];
|
|
29
|
+
/**
|
|
30
|
+
* Merge feature-owned schemas at the composition edge. Reusing an option name is
|
|
31
|
+
* only sound when Node will parse it with exactly the same syntax in every owner.
|
|
32
|
+
*/
|
|
33
|
+
export declare function composeCliOptionSchema<R, E>(contributions: readonly CliCommandContribution<R, E>[], applicationOptions?: Readonly<Record<string, CliOptionDefinition>>): Readonly<Record<string, CliOptionDefinition>>;
|
|
34
|
+
export interface CliRootToken {
|
|
35
|
+
readonly index: number;
|
|
36
|
+
readonly name: string;
|
|
37
|
+
}
|
|
38
|
+
/** First positional Node token identifies the root without rewriting the raw argv. */
|
|
39
|
+
export declare function locateCliRoot(tokens: readonly CliParsedToken[]): CliRootToken | undefined;
|
|
40
|
+
/** Delete exactly the command token: flags before/after it and `--` retain byte order. */
|
|
41
|
+
export declare function projectCliArgvWithoutRoot(argv: readonly string[], root: CliRootToken): readonly string[];
|
|
42
|
+
export type CliFeatureRoute<R, E> = Readonly<{
|
|
43
|
+
readonly kind: "application-option";
|
|
44
|
+
readonly option: "help" | "version";
|
|
45
|
+
readonly root: CliRootToken;
|
|
46
|
+
}> | Readonly<{
|
|
47
|
+
readonly kind: "command";
|
|
48
|
+
readonly command: CliCommandContribution<R, E>;
|
|
49
|
+
readonly argv: readonly string[];
|
|
50
|
+
readonly root: CliRootToken;
|
|
51
|
+
}>;
|
|
52
|
+
/** Route one indexed root token while keeping application help/version formal capabilities. */
|
|
53
|
+
export declare function matchCliFeatureCommand<R, E>(argv: readonly string[], parsed: CliParsedTokens, contributions: readonly CliCommandContribution<R, E>[]): CliFeatureRoute<R, E> | undefined;
|
|
54
|
+
export declare function renderFeatureCommandIndex<R, E>(contributions: readonly CliCommandContribution<R, E>[]): string;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Effect } from "effect";
|
|
2
|
+
import type { CliOptionDefinition, CliParsedToken, CliParsedTokens } from "./application.mjs";
|
|
3
|
+
/** A feature-owned root command. Commands are immutable values, not services or registrations. */
|
|
4
|
+
export interface CliCommandContribution<R, E> {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly summary: string;
|
|
7
|
+
/** Complete parser schema for options this root command actually owns. */
|
|
8
|
+
readonly options: Readonly<Record<string, CliOptionDefinition>>;
|
|
9
|
+
readonly run: (argv: readonly string[]) => Effect.Effect<number, E, R>;
|
|
10
|
+
}
|
|
11
|
+
export declare class CliCommandCompositionError extends Error {
|
|
12
|
+
readonly _tag = "CliCommandCompositionError";
|
|
13
|
+
}
|
|
14
|
+
declare const CliFeatureError_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 & {
|
|
15
|
+
readonly _tag: "CliFeatureError";
|
|
16
|
+
} & Readonly<A>;
|
|
17
|
+
/** Feature-owned typed failure consumed by the one CLI failure boundary. */
|
|
18
|
+
export declare class CliFeatureError extends CliFeatureError_base<{
|
|
19
|
+
readonly feature: string;
|
|
20
|
+
readonly operation: string;
|
|
21
|
+
readonly cause: unknown;
|
|
22
|
+
readonly exitCode: number;
|
|
23
|
+
/** Feature-owned terminal text; the root only writes it once. */
|
|
24
|
+
readonly display?: string;
|
|
25
|
+
}> {
|
|
26
|
+
}
|
|
27
|
+
/** Validate once at the composition edge and preserve the caller's deterministic help order. */
|
|
28
|
+
export declare function composeCliCommands<R, E>(contributions: readonly CliCommandContribution<R, E>[]): readonly CliCommandContribution<R, E>[];
|
|
29
|
+
/**
|
|
30
|
+
* Merge feature-owned schemas at the composition edge. Reusing an option name is
|
|
31
|
+
* only sound when Node will parse it with exactly the same syntax in every owner.
|
|
32
|
+
*/
|
|
33
|
+
export declare function composeCliOptionSchema<R, E>(contributions: readonly CliCommandContribution<R, E>[], applicationOptions?: Readonly<Record<string, CliOptionDefinition>>): Readonly<Record<string, CliOptionDefinition>>;
|
|
34
|
+
export interface CliRootToken {
|
|
35
|
+
readonly index: number;
|
|
36
|
+
readonly name: string;
|
|
37
|
+
}
|
|
38
|
+
/** First positional Node token identifies the root without rewriting the raw argv. */
|
|
39
|
+
export declare function locateCliRoot(tokens: readonly CliParsedToken[]): CliRootToken | undefined;
|
|
40
|
+
/** Delete exactly the command token: flags before/after it and `--` retain byte order. */
|
|
41
|
+
export declare function projectCliArgvWithoutRoot(argv: readonly string[], root: CliRootToken): readonly string[];
|
|
42
|
+
export type CliFeatureRoute<R, E> = Readonly<{
|
|
43
|
+
readonly kind: "application-option";
|
|
44
|
+
readonly option: "help" | "version";
|
|
45
|
+
readonly root: CliRootToken;
|
|
46
|
+
}> | Readonly<{
|
|
47
|
+
readonly kind: "command";
|
|
48
|
+
readonly command: CliCommandContribution<R, E>;
|
|
49
|
+
readonly argv: readonly string[];
|
|
50
|
+
readonly root: CliRootToken;
|
|
51
|
+
}>;
|
|
52
|
+
/** Route one indexed root token while keeping application help/version formal capabilities. */
|
|
53
|
+
export declare function matchCliFeatureCommand<R, E>(argv: readonly string[], parsed: CliParsedTokens, contributions: readonly CliCommandContribution<R, E>[]): CliFeatureRoute<R, E> | undefined;
|
|
54
|
+
export declare function renderFeatureCommandIndex<R, E>(contributions: readonly CliCommandContribution<R, E>[]): string;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Effect } from "effect";
|
|
2
|
+
import type { CliOptionDefinition, CliParsedToken, CliParsedTokens } from "./application.js";
|
|
3
|
+
/** A feature-owned root command. Commands are immutable values, not services or registrations. */
|
|
4
|
+
export interface CliCommandContribution<R, E> {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly summary: string;
|
|
7
|
+
/** Complete parser schema for options this root command actually owns. */
|
|
8
|
+
readonly options: Readonly<Record<string, CliOptionDefinition>>;
|
|
9
|
+
readonly run: (argv: readonly string[]) => Effect.Effect<number, E, R>;
|
|
10
|
+
}
|
|
11
|
+
export declare class CliCommandCompositionError extends Error {
|
|
12
|
+
readonly _tag = "CliCommandCompositionError";
|
|
13
|
+
}
|
|
14
|
+
declare const CliFeatureError_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 & {
|
|
15
|
+
readonly _tag: "CliFeatureError";
|
|
16
|
+
} & Readonly<A>;
|
|
17
|
+
/** Feature-owned typed failure consumed by the one CLI failure boundary. */
|
|
18
|
+
export declare class CliFeatureError extends CliFeatureError_base<{
|
|
19
|
+
readonly feature: string;
|
|
20
|
+
readonly operation: string;
|
|
21
|
+
readonly cause: unknown;
|
|
22
|
+
readonly exitCode: number;
|
|
23
|
+
/** Feature-owned terminal text; the root only writes it once. */
|
|
24
|
+
readonly display?: string;
|
|
25
|
+
}> {
|
|
26
|
+
}
|
|
27
|
+
/** Validate once at the composition edge and preserve the caller's deterministic help order. */
|
|
28
|
+
export declare function composeCliCommands<R, E>(contributions: readonly CliCommandContribution<R, E>[]): readonly CliCommandContribution<R, E>[];
|
|
29
|
+
/**
|
|
30
|
+
* Merge feature-owned schemas at the composition edge. Reusing an option name is
|
|
31
|
+
* only sound when Node will parse it with exactly the same syntax in every owner.
|
|
32
|
+
*/
|
|
33
|
+
export declare function composeCliOptionSchema<R, E>(contributions: readonly CliCommandContribution<R, E>[], applicationOptions?: Readonly<Record<string, CliOptionDefinition>>): Readonly<Record<string, CliOptionDefinition>>;
|
|
34
|
+
export interface CliRootToken {
|
|
35
|
+
readonly index: number;
|
|
36
|
+
readonly name: string;
|
|
37
|
+
}
|
|
38
|
+
/** First positional Node token identifies the root without rewriting the raw argv. */
|
|
39
|
+
export declare function locateCliRoot(tokens: readonly CliParsedToken[]): CliRootToken | undefined;
|
|
40
|
+
/** Delete exactly the command token: flags before/after it and `--` retain byte order. */
|
|
41
|
+
export declare function projectCliArgvWithoutRoot(argv: readonly string[], root: CliRootToken): readonly string[];
|
|
42
|
+
export type CliFeatureRoute<R, E> = Readonly<{
|
|
43
|
+
readonly kind: "application-option";
|
|
44
|
+
readonly option: "help" | "version";
|
|
45
|
+
readonly root: CliRootToken;
|
|
46
|
+
}> | Readonly<{
|
|
47
|
+
readonly kind: "command";
|
|
48
|
+
readonly command: CliCommandContribution<R, E>;
|
|
49
|
+
readonly argv: readonly string[];
|
|
50
|
+
readonly root: CliRootToken;
|
|
51
|
+
}>;
|
|
52
|
+
/** Route one indexed root token while keeping application help/version formal capabilities. */
|
|
53
|
+
export declare function matchCliFeatureCommand<R, E>(argv: readonly string[], parsed: CliParsedTokens, contributions: readonly CliCommandContribution<R, E>[]): CliFeatureRoute<R, E> | undefined;
|
|
54
|
+
export declare function renderFeatureCommandIndex<R, E>(contributions: readonly CliCommandContribution<R, E>[]): string;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRequire as __niceevalCreateRequire } from "node:module";
|
|
2
|
+
const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
|
|
3
|
+
const __niceevalCanonical = __niceevalRequire("./contribution.cjs");
|
|
4
|
+
const __niceevalExport0 = __niceevalCanonical["CliCommandCompositionError"];
|
|
5
|
+
export { __niceevalExport0 as CliCommandCompositionError };
|
|
6
|
+
const __niceevalExport1 = __niceevalCanonical["CliFeatureError"];
|
|
7
|
+
export { __niceevalExport1 as CliFeatureError };
|
|
8
|
+
const __niceevalExport2 = __niceevalCanonical["composeCliCommands"];
|
|
9
|
+
export { __niceevalExport2 as composeCliCommands };
|
|
10
|
+
const __niceevalExport3 = __niceevalCanonical["composeCliOptionSchema"];
|
|
11
|
+
export { __niceevalExport3 as composeCliOptionSchema };
|
|
12
|
+
const __niceevalExport4 = __niceevalCanonical["locateCliRoot"];
|
|
13
|
+
export { __niceevalExport4 as locateCliRoot };
|
|
14
|
+
const __niceevalExport5 = __niceevalCanonical["matchCliFeatureCommand"];
|
|
15
|
+
export { __niceevalExport5 as matchCliFeatureCommand };
|
|
16
|
+
const __niceevalExport6 = __niceevalCanonical["projectCliArgvWithoutRoot"];
|
|
17
|
+
export { __niceevalExport6 as projectCliArgvWithoutRoot };
|
|
18
|
+
const __niceevalExport7 = __niceevalCanonical["renderFeatureCommandIndex"];
|
|
19
|
+
export { __niceevalExport7 as renderFeatureCommandIndex };
|
|
20
|
+
//# sourceMappingURL=contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contribution.js","sources":[],"names":[],"mappings":""}
|