niceeval 0.13.1 → 0.13.2
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 +25 -2
- package/README.md +9 -10
- package/README.zh.md +9 -10
- package/dist/agents/ai-sdk.cjs.map +1 -1
- package/dist/agents/ai-sdk.d.cts +1 -1
- package/dist/agents/ai-sdk.d.mts +1 -1
- package/dist/agents/ai-sdk.d.ts +1 -1
- package/dist/agents/bub-install-spec.cjs +19 -5
- package/dist/agents/bub-install-spec.cjs.map +1 -1
- package/dist/agents/bub-install-spec.d.cts +9 -2
- package/dist/agents/bub-install-spec.d.mts +9 -2
- package/dist/agents/bub-install-spec.d.ts +9 -2
- package/dist/agents/bub-install-spec.js +14 -12
- package/dist/agents/bub.cjs +10 -6
- 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.cjs.map +1 -1
- package/dist/agents/claude-code.d.cts +2 -2
- package/dist/agents/claude-code.d.mts +2 -2
- package/dist/agents/claude-code.d.ts +2 -2
- package/dist/agents/codex.cjs +4 -4
- 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/coding-cli-versions.cjs +10 -1
- package/dist/agents/coding-cli-versions.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.d.cts +8 -3
- package/dist/agents/coding-cli-versions.d.mts +8 -3
- package/dist/agents/coding-cli-versions.d.ts +8 -3
- package/dist/agents/coding-cli-versions.js +18 -12
- package/dist/agents/deepseek-harness.cjs +151 -0
- package/dist/agents/deepseek-harness.cjs.map +1 -0
- package/dist/agents/deepseek-harness.d.cts +14 -0
- package/dist/agents/deepseek-harness.d.mts +14 -0
- package/dist/agents/deepseek-harness.d.ts +14 -0
- package/dist/agents/deepseek-harness.js +7 -0
- package/dist/agents/deepseek-harness.js.map +1 -0
- package/dist/agents/exact-npm-plugins.cjs +28 -0
- package/dist/agents/exact-npm-plugins.cjs.map +1 -0
- package/dist/agents/exact-npm-plugins.d.cts +10 -0
- package/dist/agents/exact-npm-plugins.d.mts +10 -0
- package/dist/agents/exact-npm-plugins.d.ts +10 -0
- package/dist/agents/exact-npm-plugins.js +8 -0
- package/dist/agents/exact-npm-plugins.js.map +1 -0
- package/dist/agents/index.cjs +5 -1
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +4 -0
- package/dist/agents/index.d.mts +4 -0
- package/dist/agents/index.d.ts +4 -0
- package/dist/agents/index.js +54 -50
- package/dist/agents/index.mjs +54 -50
- package/dist/agents/omp.cjs +170 -0
- package/dist/agents/omp.cjs.map +1 -0
- package/dist/agents/omp.d.cts +14 -0
- package/dist/agents/omp.d.mts +14 -0
- package/dist/agents/omp.d.ts +14 -0
- package/dist/agents/omp.js +7 -0
- package/dist/agents/omp.js.map +1 -0
- package/dist/agents/openclaw.cjs +51 -2
- package/dist/agents/openclaw.cjs.map +1 -1
- package/dist/agents/openclaw.d.cts +2 -0
- package/dist/agents/openclaw.d.mts +2 -0
- package/dist/agents/openclaw.d.ts +2 -0
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.d.cts +4 -4
- package/dist/agents/types.d.mts +4 -4
- package/dist/agents/types.d.ts +4 -4
- package/dist/agents/ui-message-stream.cjs +24 -7
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/analysis/api.cjs +28 -2
- package/dist/analysis/api.cjs.map +1 -1
- package/dist/analysis/api.d.cts +22 -1
- package/dist/analysis/api.d.mts +22 -1
- package/dist/analysis/api.d.ts +22 -1
- package/dist/analysis/api.js +8 -6
- package/dist/analysis/bindings.cjs +11 -18
- package/dist/analysis/bindings.cjs.map +1 -1
- package/dist/analysis/bindings.d.cts +177 -49
- package/dist/analysis/bindings.d.mts +177 -49
- package/dist/analysis/bindings.d.ts +177 -49
- package/dist/analysis/contracts.cjs +1 -0
- package/dist/analysis/contracts.cjs.map +1 -1
- package/dist/analysis/contracts.d.cts +43 -3
- package/dist/analysis/contracts.d.mts +43 -3
- package/dist/analysis/contracts.d.ts +43 -3
- package/dist/analysis/cost-projection.cjs +2 -1
- package/dist/analysis/cost-projection.cjs.map +1 -1
- package/dist/analysis/cost-projection.d.cts +1 -1
- package/dist/analysis/cost-projection.d.mts +1 -1
- package/dist/analysis/cost-projection.d.ts +1 -1
- package/dist/analysis/cost.cjs +13 -3
- package/dist/analysis/cost.cjs.map +1 -1
- package/dist/analysis/cost.d.cts +10 -3
- package/dist/analysis/cost.d.mts +10 -3
- package/dist/analysis/cost.d.ts +10 -3
- package/dist/analysis/experiment-groups.cjs +96 -0
- package/dist/analysis/experiment-groups.cjs.map +1 -0
- package/dist/analysis/experiment-groups.d.cts +9 -0
- package/dist/analysis/experiment-groups.d.mts +9 -0
- package/dist/analysis/experiment-groups.d.ts +9 -0
- package/dist/analysis/experiment-groups.js +10 -0
- package/dist/analysis/experiment-groups.js.map +1 -0
- package/dist/analysis/index.cjs +4 -1
- package/dist/analysis/index.cjs.map +1 -1
- package/dist/analysis/index.d.cts +4 -2
- package/dist/analysis/index.d.mts +4 -2
- package/dist/analysis/index.d.ts +4 -2
- package/dist/analysis/index.js +40 -36
- package/dist/analysis/index.mjs +40 -36
- package/dist/assertions/limits.cjs +4 -0
- package/dist/assertions/limits.cjs.map +1 -1
- package/dist/assertions/limits.d.cts +4 -0
- package/dist/assertions/limits.d.mts +4 -0
- package/dist/assertions/limits.d.ts +4 -0
- package/dist/assertions/match.cjs +63 -25
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +7 -0
- package/dist/assertions/match.d.mts +7 -0
- package/dist/assertions/match.d.ts +7 -0
- package/dist/assertions/record/attachment.cjs +32 -4
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/diff.cjs +10 -4
- package/dist/assertions/record/diff.cjs.map +1 -1
- package/dist/assertions/record/producer.cjs +101 -4
- package/dist/assertions/record/producer.cjs.map +1 -1
- package/dist/assertions/record/producer.d.cts +4 -1
- package/dist/assertions/record/producer.d.mts +4 -1
- package/dist/assertions/record/producer.d.ts +4 -1
- package/dist/assertions/runtime.cjs +45 -5
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/cli/record.cjs +113 -8
- package/dist/cli/record.cjs.map +1 -1
- package/dist/cli/record.d.cts +20 -1
- package/dist/cli/record.d.mts +20 -1
- package/dist/cli/record.d.ts +20 -1
- package/dist/cli/record.js +4 -2
- package/dist/cli.cjs +386 -31
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +10 -2
- package/dist/cli.d.mts +10 -2
- package/dist/cli.d.ts +10 -2
- package/dist/context/send-retry.cjs +4 -4
- package/dist/context/send-retry.cjs.map +1 -1
- package/dist/coordination/host/runtime.cjs +8 -30
- package/dist/coordination/host/runtime.cjs.map +1 -1
- package/dist/coordination/host/runtime.d.cts +3 -3
- package/dist/coordination/host/runtime.d.mts +3 -3
- package/dist/coordination/host/runtime.d.ts +3 -3
- package/dist/coordination/host/types.cjs.map +1 -1
- package/dist/coordination/host/types.d.cts +0 -5
- package/dist/coordination/host/types.d.mts +0 -5
- package/dist/coordination/host/types.d.ts +0 -5
- package/dist/coordination/platform/node.cjs +90 -9
- package/dist/coordination/platform/node.cjs.map +1 -1
- package/dist/define.cjs +25 -1
- package/dist/define.cjs.map +1 -1
- package/dist/experiment/host/index.cjs +1 -0
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/i18n/en.cjs +26 -8
- package/dist/i18n/en.cjs.map +1 -1
- package/dist/i18n/en.d.cts +19 -6
- package/dist/i18n/en.d.mts +19 -6
- package/dist/i18n/en.d.ts +19 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/o11y/parsers/hermes.cjs +1 -1
- package/dist/o11y/parsers/hermes.cjs.map +1 -1
- package/dist/o11y/prices.json +1 -1
- package/dist/o11y/record/families.cjs +12 -3
- package/dist/o11y/record/families.cjs.map +1 -1
- package/dist/o11y/record/families.d.cts +8 -8
- package/dist/o11y/record/families.d.mts +8 -8
- package/dist/o11y/record/families.d.ts +8 -8
- package/dist/o11y/record/family-projectors.d.cts +66 -18
- package/dist/o11y/record/family-projectors.d.mts +66 -18
- package/dist/o11y/record/family-projectors.d.ts +66 -18
- package/dist/o11y/record/family-writers.d.cts +11 -3
- package/dist/o11y/record/family-writers.d.mts +11 -3
- package/dist/o11y/record/family-writers.d.ts +11 -3
- package/dist/o11y/record/runner-producer.cjs +14 -4
- package/dist/o11y/record/runner-producer.cjs.map +1 -1
- package/dist/record/codec/core.d.cts +2 -2
- package/dist/record/codec/core.d.mts +2 -2
- package/dist/record/codec/core.d.ts +2 -2
- package/dist/record/family/catalog.d.cts +44 -12
- package/dist/record/family/catalog.d.mts +44 -12
- package/dist/record/family/catalog.d.ts +44 -12
- package/dist/record/family/index.js +128 -124
- package/dist/record/family/observability-v1.cjs +35 -0
- package/dist/record/family/observability-v1.cjs.map +1 -0
- package/dist/record/family/observability-v1.d.cts +3 -0
- package/dist/record/family/observability-v1.d.mts +3 -0
- package/dist/record/family/observability-v1.d.ts +3 -0
- package/dist/record/family/observability-v1.js +6 -0
- package/dist/record/family/observability-v1.js.map +1 -0
- package/dist/record/family/observability.cjs +58 -9
- package/dist/record/family/observability.cjs.map +1 -1
- package/dist/record/family/observability.d.cts +1014 -15
- package/dist/record/family/observability.d.mts +1014 -15
- package/dist/record/family/observability.d.ts +1014 -15
- package/dist/record/family/observability.js +22 -18
- package/dist/record/host/runtime.cjs +600 -31
- 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 +33 -9
- package/dist/record/host/types.d.mts +33 -9
- package/dist/record/host/types.d.ts +33 -9
- package/dist/record/maintenance/runtime.cjs +1 -2
- package/dist/record/maintenance/runtime.cjs.map +1 -1
- package/dist/record/model/core.cjs.map +1 -1
- package/dist/record/model/core.d.cts +1 -1
- package/dist/record/model/core.d.mts +1 -1
- package/dist/record/model/core.d.ts +1 -1
- package/dist/record/model/definition.d.cts +6 -6
- package/dist/record/model/definition.d.mts +6 -6
- package/dist/record/model/definition.d.ts +6 -6
- package/dist/record/model/identifiers.cjs +1 -1
- package/dist/record/model/identifiers.cjs.map +1 -1
- package/dist/record/model/identifiers.d.cts +1 -1
- package/dist/record/model/identifiers.d.mts +1 -1
- package/dist/record/model/identifiers.d.ts +1 -1
- package/dist/record/platform/node.cjs +159 -23
- 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 +15 -2
- package/dist/record/platform/services.d.mts +15 -2
- package/dist/record/platform/services.d.ts +15 -2
- package/dist/record/reader/errors.cjs +37 -1
- package/dist/record/reader/errors.cjs.map +1 -1
- package/dist/record/reader/errors.d.cts +49 -1
- package/dist/record/reader/errors.d.mts +49 -1
- package/dist/record/reader/errors.d.ts +49 -1
- package/dist/record/reader/errors.js +22 -12
- package/dist/record/reader/format.cjs +76 -17
- package/dist/record/reader/format.cjs.map +1 -1
- package/dist/record/reader/format.d.cts +11 -4
- package/dist/record/reader/format.d.mts +11 -4
- package/dist/record/reader/format.d.ts +11 -4
- package/dist/record/reader/format.js +2 -0
- package/dist/record/reader/index.js +32 -18
- package/dist/record/reader/runtime.cjs +64 -0
- package/dist/record/reader/runtime.cjs.map +1 -1
- package/dist/record/reader/runtime.d.cts +15 -0
- package/dist/record/reader/runtime.d.mts +15 -0
- package/dist/record/reader/runtime.d.ts +15 -0
- package/dist/record/reader/runtime.js +2 -0
- package/dist/report/assets/styles.css +53 -29
- package/dist/report/built-in/analysis-values.cjs +21 -13
- package/dist/report/built-in/analysis-values.cjs.map +1 -1
- package/dist/report/built-in/analysis-values.d.cts +11 -22
- package/dist/report/built-in/analysis-values.d.mts +11 -22
- package/dist/report/built-in/analysis-values.d.ts +11 -22
- package/dist/report/built-in/analysis-values.js +4 -6
- package/dist/report/built-in/index.cjs +1 -3
- package/dist/report/built-in/index.cjs.map +1 -1
- package/dist/report/built-in/index.d.cts +1 -1
- package/dist/report/built-in/index.d.mts +1 -1
- package/dist/report/built-in/index.d.ts +1 -1
- package/dist/report/built-in/index.js +4 -8
- package/dist/report/built-in/index.mjs +4 -8
- package/dist/report/built-in/machine.cjs +0 -2
- package/dist/report/built-in/machine.cjs.map +1 -1
- package/dist/report/built-in/machine.d.cts +0 -2
- package/dist/report/built-in/machine.d.mts +0 -2
- package/dist/report/built-in/machine.d.ts +0 -2
- package/dist/report/built-in/result-components.cjs +49 -51
- package/dist/report/built-in/result-components.cjs.map +1 -1
- package/dist/report/built-in/result-components.d.cts +16 -17
- package/dist/report/built-in/result-components.d.mts +16 -17
- package/dist/report/built-in/result-components.d.ts +16 -17
- package/dist/report/built-in/result-components.js +0 -4
- package/dist/report/built-in/run-membership-overview.cjs +126 -17
- package/dist/report/built-in/run-membership-overview.cjs.map +1 -1
- package/dist/report/built-in/run-membership-overview.d.cts +14 -0
- package/dist/report/built-in/run-membership-overview.d.mts +14 -0
- package/dist/report/built-in/run-membership-overview.d.ts +14 -0
- package/dist/report/built-in/run-membership-overview.js +4 -2
- package/dist/report/built-in/standard.cjs +80 -45
- package/dist/report/built-in/standard.cjs.map +1 -1
- package/dist/report/built-in/standard.d.cts +19 -41
- package/dist/report/built-in/standard.d.mts +19 -41
- package/dist/report/built-in/standard.d.ts +19 -41
- package/dist/report/built-in/standard.js +6 -6
- package/dist/report/components/attempt-detail/compute.cjs +78 -2
- package/dist/report/components/attempt-detail/compute.cjs.map +1 -1
- package/dist/report/components/attempt-detail/compute.d.cts +1 -1
- package/dist/report/components/attempt-detail/compute.d.mts +1 -1
- package/dist/report/components/attempt-detail/compute.d.ts +1 -1
- 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 +42 -5
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.d.cts +10 -8
- package/dist/report/components/entity-lists/compute.d.mts +10 -8
- package/dist/report/components/entity-lists/compute.d.ts +10 -8
- package/dist/report/components/entity-lists/content.cjs +31 -6
- package/dist/report/components/entity-lists/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.cjs +9 -4
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.d.cts +4 -7
- package/dist/report/components/entity-lists/index.d.mts +4 -7
- package/dist/report/components/entity-lists/index.d.ts +4 -7
- package/dist/report/components/summaries/compute.cjs +8 -1
- package/dist/report/components/summaries/compute.cjs.map +1 -1
- package/dist/report/components/summaries/compute.d.cts +9 -1
- package/dist/report/components/summaries/compute.d.mts +9 -1
- package/dist/report/components/summaries/compute.d.ts +9 -1
- package/dist/report/components/summaries/index.cjs +48 -4
- package/dist/report/components/summaries/index.cjs.map +1 -1
- package/dist/report/components/summaries/index.d.cts +7 -4
- package/dist/report/components/summaries/index.d.mts +7 -4
- package/dist/report/components/summaries/index.d.ts +7 -4
- package/dist/report/definition/cell.cjs +3 -0
- 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/chart.cjs +8 -5
- package/dist/report/definition/primitives/chart.cjs.map +1 -1
- package/dist/report/definition/primitives/points-dataset.cjs +1 -0
- package/dist/report/definition/primitives/points-dataset.cjs.map +1 -1
- package/dist/report/definition/primitives.cjs +15 -2
- package/dist/report/definition/primitives.cjs.map +1 -1
- package/dist/report/definition/report.cjs +27 -3
- package/dist/report/definition/report.cjs.map +1 -1
- package/dist/report/definition/report.d.cts +8 -0
- package/dist/report/definition/report.d.mts +8 -0
- package/dist/report/definition/report.d.ts +8 -0
- package/dist/report/execution/machine.cjs +30 -14
- package/dist/report/execution/machine.cjs.map +1 -1
- package/dist/report/execution/machine.d.cts +20 -10
- package/dist/report/execution/machine.d.mts +20 -10
- package/dist/report/execution/machine.d.ts +20 -10
- package/dist/report/execution/machine.js +6 -6
- package/dist/report/host/execute.cjs +25 -16
- package/dist/report/host/execute.cjs.map +1 -1
- package/dist/report/host/execute.d.cts +4 -0
- package/dist/report/host/execute.d.mts +4 -0
- package/dist/report/host/execute.d.ts +4 -0
- package/dist/report/host/from-record.cjs +22 -5
- package/dist/report/host/from-record.cjs.map +1 -1
- package/dist/report/host/machine.cjs +53 -11
- package/dist/report/host/machine.cjs.map +1 -1
- package/dist/report/host/site-runtime.cjs +9 -8
- package/dist/report/host/site-runtime.cjs.map +1 -1
- package/dist/report/host/site-runtime.d.cts +1 -1
- package/dist/report/host/site-runtime.d.mts +1 -1
- package/dist/report/host/site-runtime.d.ts +1 -1
- package/dist/report/host/static.cjs +56 -9
- package/dist/report/host/static.cjs.map +1 -1
- package/dist/report/index.cjs.map +1 -1
- package/dist/report/index.d.cts +1 -1
- package/dist/report/index.d.mts +1 -1
- package/dist/report/index.d.ts +1 -1
- package/dist/report/model/dataset.cjs +7 -2
- package/dist/report/model/dataset.cjs.map +1 -1
- package/dist/report/model/locale.cjs +2 -0
- package/dist/report/model/locale.cjs.map +1 -1
- package/dist/report/model/locale.d.cts +1 -0
- package/dist/report/model/locale.d.mts +1 -0
- package/dist/report/model/locale.d.ts +1 -0
- package/dist/report/model/metrics.cjs +3 -1
- package/dist/report/model/metrics.cjs.map +1 -1
- package/dist/report/model/pricing.cjs +16 -11
- package/dist/report/model/pricing.cjs.map +1 -1
- package/dist/report/react/styles.css +53 -29
- package/dist/runner/adoption.cjs +1 -0
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/attempt.cjs +44 -5
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/runner/attempt.d.cts +13 -1
- package/dist/runner/attempt.d.mts +13 -1
- package/dist/runner/attempt.d.ts +13 -1
- package/dist/runner/config-identity.cjs +10 -2
- package/dist/runner/config-identity.cjs.map +1 -1
- package/dist/runner/config-identity.d.cts +4 -2
- package/dist/runner/config-identity.d.mts +4 -2
- package/dist/runner/config-identity.d.ts +4 -2
- package/dist/runner/feedback/human.cjs +298 -59
- package/dist/runner/feedback/human.cjs.map +1 -1
- package/dist/runner/feedback/json.cjs +14 -6
- package/dist/runner/feedback/json.cjs.map +1 -1
- package/dist/runner/feedback/json.d.cts +3 -2
- package/dist/runner/feedback/json.d.mts +3 -2
- package/dist/runner/feedback/json.d.ts +3 -2
- package/dist/runner/feedback/reducer.cjs +2 -0
- package/dist/runner/feedback/reducer.cjs.map +1 -1
- package/dist/runner/judge-config.cjs +1 -1
- package/dist/runner/judge-config.cjs.map +1 -1
- package/dist/runner/ledger.cjs +124 -12
- package/dist/runner/ledger.cjs.map +1 -1
- package/dist/runner/project-current.cjs +13 -5
- package/dist/runner/project-current.cjs.map +1 -1
- package/dist/runner/run.cjs +564 -256
- package/dist/runner/run.cjs.map +1 -1
- package/dist/runner/sandbox-pool.cjs +161 -30
- package/dist/runner/sandbox-pool.cjs.map +1 -1
- package/dist/runner/sandbox-pool.d.cts +34 -2
- package/dist/runner/sandbox-pool.d.mts +34 -2
- package/dist/runner/sandbox-pool.d.ts +34 -2
- package/dist/runner/shared-state-lease.cjs +803 -0
- package/dist/runner/shared-state-lease.cjs.map +1 -0
- package/dist/runner/shared-state-lease.d.cts +121 -0
- package/dist/runner/shared-state-lease.d.mts +121 -0
- package/dist/runner/shared-state-lease.d.ts +121 -0
- package/dist/runner/shared-state-lease.js +24 -0
- package/dist/runner/shared-state-lease.js.map +1 -0
- package/dist/runner/teardown-registry.cjs +97 -34
- package/dist/runner/teardown-registry.cjs.map +1 -1
- package/dist/runner/teardown-registry.d.cts +27 -1
- package/dist/runner/teardown-registry.d.mts +27 -1
- package/dist/runner/teardown-registry.d.ts +27 -1
- package/dist/runner/teardown-registry.js +20 -16
- package/dist/runner/types.cjs.map +1 -1
- package/dist/runner/types.d.cts +31 -5
- package/dist/runner/types.d.mts +31 -5
- package/dist/runner/types.d.ts +31 -5
- package/dist/sample/analysis.cjs +249 -459
- package/dist/sample/analysis.cjs.map +1 -1
- package/dist/sample/capability.cjs +138 -7
- package/dist/sample/capability.cjs.map +1 -1
- package/dist/sample/capability.d.cts +3 -1
- package/dist/sample/capability.d.mts +3 -1
- package/dist/sample/capability.d.ts +3 -1
- package/dist/sample/capability.js +8 -6
- package/dist/sandbox/docker-agent-image.cjs +5 -1
- package/dist/sandbox/docker-agent-image.cjs.map +1 -1
- package/dist/sandbox/docker-agent-image.d.cts +2 -0
- package/dist/sandbox/docker-agent-image.d.mts +2 -0
- package/dist/sandbox/docker-agent-image.d.ts +2 -0
- package/dist/sandbox/docker-agent-image.js +14 -10
- package/dist/sandbox/docker-profile/schema.cjs +283 -534
- package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.d.cts +10 -27
- package/dist/sandbox/docker-profile/schema.d.mts +10 -27
- package/dist/sandbox/docker-profile/schema.d.ts +10 -27
- package/dist/sandbox/e2b-agent-template.cjs +5 -2
- package/dist/sandbox/e2b-agent-template.cjs.map +1 -1
- package/dist/sandbox/index.cjs +4 -2
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +1 -1
- package/dist/sandbox/index.d.mts +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.js +120 -116
- package/dist/sandbox/index.mjs +120 -116
- package/dist/sandbox/keep-registry.cjs +28 -66
- package/dist/sandbox/keep-registry.cjs.map +1 -1
- package/dist/sandbox/types.cjs.map +1 -1
- package/dist/sandbox/types.d.cts +1 -1
- package/dist/sandbox/types.d.mts +1 -1
- package/dist/sandbox/types.d.ts +1 -1
- package/dist/shared/aggregate.cjs +16 -6
- package/dist/shared/aggregate.cjs.map +1 -1
- package/dist/shared/aggregate.d.cts +12 -4
- package/dist/shared/aggregate.d.mts +12 -4
- package/dist/shared/aggregate.d.ts +12 -4
- package/dist/shared/turn-label.cjs +20 -2
- package/dist/shared/turn-label.cjs.map +1 -1
- package/dist/shared/turn-label.d.cts +2 -0
- package/dist/shared/turn-label.d.mts +2 -0
- package/dist/shared/turn-label.d.ts +2 -0
- package/dist/shared/turn-label.js +4 -2
- package/dist/vendor/remark/remark-gfm.cjs +7 -7
- package/dist/vendor/remark/remark-gfm.cjs.map +1 -1
- package/dist/vendor/remark/remark-parse.cjs +12 -12
- package/dist/vendor/remark/remark-parse.cjs.map +1 -1
- package/dist/vendor/remark/remark.cjs +13 -13
- package/dist/vendor/remark/remark.cjs.map +1 -1
- package/dist/view/server.cjs +6 -0
- package/dist/view/server.cjs.map +1 -1
- package/docs-site/images/hitl-handshake-zh.svg +3 -3
- package/docs-site/zh/examples/ai-agent-application.mdx +1 -1
- package/docs-site/zh/examples/coding-agent-extensions.mdx +1 -1
- package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +4 -3
- package/docs-site/zh/examples/integrations/claude-sdk.mdx +3 -3
- package/docs-site/zh/examples/integrations/codex-sdk.mdx +5 -5
- package/docs-site/zh/examples/integrations/langgraph.mdx +4 -4
- package/docs-site/zh/examples/integrations/pi-sdk.mdx +5 -5
- package/docs-site/zh/explanation/adapter.mdx +5 -5
- package/docs-site/zh/explanation/assert.mdx +7 -7
- package/docs-site/zh/explanation/drive.mdx +4 -2
- package/docs-site/zh/explanation/evals.mdx +10 -8
- package/docs-site/zh/explanation/experiment.mdx +2 -2
- package/docs-site/zh/explanation/hitl.mdx +9 -9
- package/docs-site/zh/explanation/judge.mdx +5 -5
- package/docs-site/zh/explanation/overview.mdx +3 -3
- package/docs-site/zh/explanation/runner.mdx +1 -1
- package/docs-site/zh/index.mdx +3 -3
- package/docs-site/zh/reference/builtin-agents.mdx +13 -13
- package/docs-site/zh/reference/capabilities.mdx +1 -1
- package/docs-site/zh/reference/cli.mdx +18 -12
- package/docs-site/zh/reference/define-agent.mdx +130 -5
- package/docs-site/zh/reference/define-config.mdx +2 -2
- package/docs-site/zh/reference/define-eval.mdx +4 -4
- package/docs-site/zh/reference/events.mdx +11 -11
- package/docs-site/zh/reference/official-adapters.mdx +6 -6
- package/docs-site/zh/reference/results-data.mdx +6 -0
- package/docs-site/zh/troubleshooting/debugging.mdx +1 -1
- package/docs-site/zh/troubleshooting/recover-after-kill.mdx +37 -5
- package/docs-site/zh/tutorials/accept-results.mdx +72 -0
- package/docs-site/zh/tutorials/agent-onboarding.mdx +6 -6
- package/docs-site/zh/tutorials/authoring.mdx +9 -13
- package/docs-site/zh/tutorials/ci-integration.mdx +6 -6
- package/docs-site/zh/tutorials/compare-runs.mdx +61 -0
- package/docs-site/zh/tutorials/concurrency.mdx +13 -12
- package/docs-site/zh/tutorials/configuration.mdx +4 -6
- package/docs-site/zh/tutorials/connect-your-agent.mdx +1 -1
- package/docs-site/zh/tutorials/control-run-cost.mdx +58 -0
- package/docs-site/zh/tutorials/criteria-files.mdx +2 -2
- package/docs-site/zh/tutorials/custom-reports.mdx +2 -2
- package/docs-site/zh/tutorials/debug-lifecycle-plan.mdx +46 -0
- package/docs-site/zh/tutorials/docker-in-docker.mdx +52 -43
- package/docs-site/zh/tutorials/eval-groups.mdx +6 -6
- package/docs-site/zh/tutorials/evaluation-kinds.mdx +3 -3
- package/docs-site/zh/tutorials/experiments.mdx +2 -3
- package/docs-site/zh/tutorials/handle-execution-failures.mdx +18 -10
- package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +16 -8
- package/docs-site/zh/tutorials/nixos-managed-dind.mdx +160 -0
- package/docs-site/zh/tutorials/plugins.mdx +14 -0
- package/docs-site/zh/tutorials/rerun-and-cache.mdx +4 -2
- package/docs-site/zh/tutorials/sandbox-agent.mdx +17 -11
- package/docs-site/zh/tutorials/sandbox-providers.mdx +17 -13
- package/docs-site/zh/tutorials/sandbox-reuse.mdx +12 -19
- package/docs-site/zh/tutorials/select-and-preview.mdx +65 -0
- package/docs-site/zh/tutorials/verify-judge.mdx +78 -0
- package/docs-site/zh/tutorials/viewing-results.mdx +38 -1
- package/docs-site/zh/tutorials/write-experiment.mdx +7 -5
- package/docs-site/zh/tutorials/write-send.mdx +9 -8
- package/package.json +9 -5
- package/dist/report/built-in/overview.cjs +0 -44
- package/dist/report/built-in/overview.cjs.map +0 -1
- package/dist/report/built-in/overview.d.cts +0 -6
- package/dist/report/built-in/overview.d.mts +0 -6
- package/dist/report/built-in/overview.d.ts +0 -6
- package/dist/report/built-in/overview.js +0 -9
- package/dist/report/built-in/overview.js.map +0 -1
- package/dist/runner/gate-lease.cjs +0 -283
- package/dist/runner/gate-lease.cjs.map +0 -1
- package/dist/runner/gate-lease.d.cts +0 -62
- package/dist/runner/gate-lease.d.mts +0 -62
- package/dist/runner/gate-lease.d.ts +0 -62
- package/dist/runner/gate-lease.js +0 -22
- package/dist/runner/gate-lease.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.dockerProfileDigestOf = exports.createDockerExecutionProfileV1 = exports.decodeDockerExecutionProfileV1 = exports.parseDockerExecutionProfile = exports.dockerProfileSemanticPolicyRevisionOf = exports.DockerExecutionProfileSchema = exports.DockerExecutionProfileV1Schema = exports.DOCKER_PROFILE_NETWORK_DENY_CIDRS = exports.DOCKER_PROFILE_NETWORK_POLICY_VERSION = exports.DOCKER_PROFILE_SCHEMA_VERSION = exports.DOCKER_EXECUTION_PROFILE_SCHEMA_VERSION = void 0;
|
|
4
4
|
exports.dockerExecutionProfileSemanticPolicyRevisionOf = dockerExecutionProfileSemanticPolicyRevisionOf;
|
|
5
|
-
exports.dockerExecutionProfileV1Digest = dockerExecutionProfileV1Digest;
|
|
6
5
|
exports.parseDockerExecutionProfileV1 = parseDockerExecutionProfileV1;
|
|
7
6
|
exports.makeDockerExecutionProfileV1 = makeDockerExecutionProfileV1;
|
|
8
7
|
exports.isDockerExecutionProfileV1 = isDockerExecutionProfileV1;
|
|
8
|
+
exports.dockerExecutionProfileV1Digest = dockerExecutionProfileV1Digest;
|
|
9
9
|
exports.dockerProfilePublicSummaryOf = dockerProfilePublicSummaryOf;
|
|
10
10
|
const effect_1 = require("effect");
|
|
11
11
|
const node_net_1 = require("node:net");
|
|
@@ -16,229 +16,39 @@ exports.DOCKER_EXECUTION_PROFILE_SCHEMA_VERSION = 1;
|
|
|
16
16
|
exports.DOCKER_PROFILE_SCHEMA_VERSION = exports.DOCKER_EXECUTION_PROFILE_SCHEMA_VERSION;
|
|
17
17
|
exports.DOCKER_PROFILE_NETWORK_POLICY_VERSION = 1;
|
|
18
18
|
exports.DOCKER_PROFILE_NETWORK_DENY_CIDRS = Object.freeze([
|
|
19
|
-
"0.0.0.0/8",
|
|
20
|
-
"
|
|
21
|
-
"100.
|
|
22
|
-
"
|
|
23
|
-
"169.254.0.0/16",
|
|
24
|
-
"172.16.0.0/12",
|
|
25
|
-
"192.0.0.0/24",
|
|
26
|
-
"192.0.2.0/24",
|
|
27
|
-
"192.168.0.0/16",
|
|
28
|
-
"198.18.0.0/15",
|
|
29
|
-
"198.51.100.0/24",
|
|
30
|
-
"203.0.113.0/24",
|
|
31
|
-
"224.0.0.0/4",
|
|
32
|
-
"240.0.0.0/4",
|
|
33
|
-
"::/0",
|
|
19
|
+
"0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16",
|
|
20
|
+
"172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16",
|
|
21
|
+
"198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "224.0.0.0/4",
|
|
22
|
+
"240.0.0.0/4", "::/0",
|
|
34
23
|
]);
|
|
35
24
|
const NETWORK_ALLOWED_PROTOCOLS = Object.freeze(["dns", "https"]);
|
|
36
|
-
const PROFILE_CONTROLLERS = Object.freeze([
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (
|
|
25
|
+
const PROFILE_CONTROLLERS = Object.freeze([
|
|
26
|
+
"cpu", "memory", "pids",
|
|
27
|
+
]);
|
|
28
|
+
const ParseOptions = Object.freeze({
|
|
29
|
+
errors: "all",
|
|
30
|
+
exact: true,
|
|
31
|
+
onExcessProperty: "error",
|
|
32
|
+
});
|
|
33
|
+
const PlainObjectSchema = effect_1.Schema.declare((value) => {
|
|
34
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
46
35
|
return false;
|
|
47
36
|
const prototype = Object.getPrototypeOf(value);
|
|
48
37
|
return prototype === Object.prototype || prototype === null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const known = new Set(allowed);
|
|
60
|
-
const unsupported = Object.keys(value).find((key) => !known.has(key));
|
|
61
|
-
if (unsupported !== undefined) {
|
|
62
|
-
fail("sandbox.docker-profile-schema-invalid", `${path}.${unsupported} is not supported by Docker execution profile v1`, `${path}.${unsupported}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function requiredString(value, path) {
|
|
66
|
-
if (typeof value !== "string" || value.trim() === "") {
|
|
67
|
-
fail("sandbox.docker-profile-schema-invalid", `${path} must be a non-empty string`, path);
|
|
68
|
-
}
|
|
69
|
-
if (value.includes("\u0000")) {
|
|
70
|
-
fail("sandbox.docker-profile-schema-invalid", `${path} must not contain NUL`, path);
|
|
71
|
-
}
|
|
72
|
-
return value;
|
|
73
|
-
}
|
|
74
|
-
function absolutePath(value, path) {
|
|
75
|
-
const result = requiredString(value, path);
|
|
76
|
-
if (!(0, node_path_1.isAbsolute)(result)) {
|
|
77
|
-
fail("sandbox.docker-profile-schema-invalid", `${path} must be an absolute path`, path);
|
|
78
|
-
}
|
|
79
|
-
return result;
|
|
80
|
-
}
|
|
81
|
-
function nonNegativeSafeInteger(value, path) {
|
|
82
|
-
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) {
|
|
83
|
-
fail("sandbox.docker-profile-schema-invalid", `${path} must be a non-negative safe integer`, path);
|
|
84
|
-
}
|
|
85
|
-
return value;
|
|
86
|
-
}
|
|
87
|
-
function positiveSafeInteger(value, path) {
|
|
88
|
-
if (typeof value !== "number" || !Number.isSafeInteger(value) || value <= 0) {
|
|
89
|
-
fail("sandbox.docker-profile-schema-invalid", `${path} must be a positive safe integer`, path);
|
|
90
|
-
}
|
|
91
|
-
return value;
|
|
92
|
-
}
|
|
93
|
-
function positiveFinite(value, path) {
|
|
94
|
-
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
|
|
95
|
-
fail("sandbox.docker-profile-schema-invalid", `${path} must be a positive finite number`, path);
|
|
96
|
-
}
|
|
97
|
-
return value;
|
|
98
|
-
}
|
|
99
|
-
function endpoint(value, path) {
|
|
100
|
-
const record = objectAt(value, path);
|
|
101
|
-
onlyKeys(record, ["path", "peerUid"], path);
|
|
102
|
-
return Object.freeze({
|
|
103
|
-
path: absolutePath(record.path, `${path}.path`),
|
|
104
|
-
peerUid: nonNegativeSafeInteger(record.peerUid, `${path}.peerUid`),
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
function semanticPolicyJson(input) {
|
|
108
|
-
return {
|
|
109
|
-
schemaVersion: exports.DOCKER_EXECUTION_PROFILE_SCHEMA_VERSION,
|
|
110
|
-
securityLevel: input.securityLevel,
|
|
111
|
-
backend: {
|
|
112
|
-
kind: input.backend.kind,
|
|
113
|
-
cgroup: {
|
|
114
|
-
policyRevision: input.backend.cgroup.policyRevision,
|
|
115
|
-
controllers: [...input.backend.cgroup.controllers],
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
policy: {
|
|
119
|
-
hostLoopback: input.policy.hostLoopback,
|
|
120
|
-
tcpDockerEndpoint: input.policy.tcpDockerEndpoint,
|
|
121
|
-
outerSocketInjection: input.policy.outerSocketInjection,
|
|
122
|
-
privilegedTranslation: input.policy.privilegedTranslation,
|
|
123
|
-
writableRoot: input.policy.writableRoot,
|
|
124
|
-
network: {
|
|
125
|
-
version: input.policy.network.version,
|
|
126
|
-
dns: {
|
|
127
|
-
mode: input.policy.network.dns.mode,
|
|
128
|
-
servers: [...input.policy.network.dns.servers],
|
|
129
|
-
},
|
|
130
|
-
egress: {
|
|
131
|
-
mode: input.policy.network.egress.mode,
|
|
132
|
-
allowedProtocols: [...input.policy.network.egress.allowedProtocols],
|
|
133
|
-
denyPrivateNetworks: input.policy.network.egress.denyPrivateNetworks,
|
|
134
|
-
denySiblingSyntheticEndpoints: input.policy.network.egress.denySiblingSyntheticEndpoints,
|
|
135
|
-
denyCidrs: [...input.policy.network.egress.denyCidrs],
|
|
136
|
-
ipv6: input.policy.network.egress.ipv6,
|
|
137
|
-
disableHostLoopback: input.policy.network.egress.disableHostLoopback,
|
|
138
|
-
portDriver: input.policy.network.egress.portDriver,
|
|
139
|
-
daemonBridge: input.policy.network.egress.daemonBridge,
|
|
140
|
-
exclusiveNetwork: input.policy.network.egress.exclusiveNetwork,
|
|
141
|
-
icc: input.policy.network.egress.icc,
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
/** 从受信 schema 字段重新计算语义 policy revision;profileId、alias、socket 与容量不参与。 */
|
|
148
|
-
function dockerExecutionProfileSemanticPolicyRevisionOf(input) {
|
|
149
|
-
return (0, identity_ts_1.digestOf)(semanticPolicyJson(input)).slice(0, 8);
|
|
150
|
-
}
|
|
151
|
-
exports.dockerProfileSemanticPolicyRevisionOf = dockerExecutionProfileSemanticPolicyRevisionOf;
|
|
152
|
-
function canonicalJson(profile) {
|
|
153
|
-
return {
|
|
154
|
-
schemaVersion: profile.schemaVersion,
|
|
155
|
-
profileId: profile.profileId,
|
|
156
|
-
securityLevel: profile.securityLevel,
|
|
157
|
-
semanticPolicyRevision: profile.semanticPolicyRevision,
|
|
158
|
-
transport: {
|
|
159
|
-
kind: profile.transport.kind,
|
|
160
|
-
hostMachineIdentity: profile.transport.hostMachineIdentity,
|
|
161
|
-
dockerSocket: {
|
|
162
|
-
path: profile.transport.dockerSocket.path,
|
|
163
|
-
peerUid: profile.transport.dockerSocket.peerUid,
|
|
164
|
-
},
|
|
165
|
-
controlSocket: {
|
|
166
|
-
path: profile.transport.controlSocket.path,
|
|
167
|
-
peerUid: profile.transport.controlSocket.peerUid,
|
|
168
|
-
protocol: profile.transport.controlSocket.protocol,
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
backend: {
|
|
172
|
-
kind: profile.backend.kind,
|
|
173
|
-
machineIdentity: profile.backend.machineIdentity,
|
|
174
|
-
owner: { uid: profile.backend.owner.uid, gid: profile.backend.owner.gid },
|
|
175
|
-
filesystem: {
|
|
176
|
-
identity: profile.backend.filesystem.identity,
|
|
177
|
-
mountPath: profile.backend.filesystem.mountPath,
|
|
178
|
-
dockerRootDir: profile.backend.filesystem.dockerRootDir,
|
|
179
|
-
limitBytes: profile.backend.filesystem.limitBytes,
|
|
180
|
-
},
|
|
181
|
-
cgroup: {
|
|
182
|
-
aggregatePath: profile.backend.cgroup.aggregatePath,
|
|
183
|
-
policyRevision: profile.backend.cgroup.policyRevision,
|
|
184
|
-
controllers: [...profile.backend.cgroup.controllers],
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
capacity: {
|
|
188
|
-
cpus: profile.capacity.cpus,
|
|
189
|
-
memoryBytes: profile.capacity.memoryBytes,
|
|
190
|
-
memorySwapBytes: profile.capacity.memorySwapBytes,
|
|
191
|
-
pids: profile.capacity.pids,
|
|
192
|
-
maxContainers: profile.capacity.maxContainers,
|
|
193
|
-
maxBuilds: profile.capacity.maxBuilds,
|
|
194
|
-
aggregate: {
|
|
195
|
-
cpus: profile.capacity.aggregate.cpus,
|
|
196
|
-
memoryBytes: profile.capacity.aggregate.memoryBytes,
|
|
197
|
-
memorySwapBytes: profile.capacity.aggregate.memorySwapBytes,
|
|
198
|
-
pids: profile.capacity.aggregate.pids,
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
policy: {
|
|
202
|
-
hostLoopback: profile.policy.hostLoopback,
|
|
203
|
-
tcpDockerEndpoint: profile.policy.tcpDockerEndpoint,
|
|
204
|
-
outerSocketInjection: profile.policy.outerSocketInjection,
|
|
205
|
-
privilegedTranslation: profile.policy.privilegedTranslation,
|
|
206
|
-
writableRoot: profile.policy.writableRoot,
|
|
207
|
-
network: {
|
|
208
|
-
version: profile.policy.network.version,
|
|
209
|
-
dns: {
|
|
210
|
-
mode: profile.policy.network.dns.mode,
|
|
211
|
-
servers: [...profile.policy.network.dns.servers],
|
|
212
|
-
},
|
|
213
|
-
egress: {
|
|
214
|
-
mode: profile.policy.network.egress.mode,
|
|
215
|
-
allowedProtocols: [...profile.policy.network.egress.allowedProtocols],
|
|
216
|
-
denyPrivateNetworks: profile.policy.network.egress.denyPrivateNetworks,
|
|
217
|
-
denySiblingSyntheticEndpoints: profile.policy.network.egress.denySiblingSyntheticEndpoints,
|
|
218
|
-
denyCidrs: [...profile.policy.network.egress.denyCidrs],
|
|
219
|
-
ipv6: profile.policy.network.egress.ipv6,
|
|
220
|
-
disableHostLoopback: profile.policy.network.egress.disableHostLoopback,
|
|
221
|
-
portDriver: profile.policy.network.egress.portDriver,
|
|
222
|
-
daemonBridge: profile.policy.network.egress.daemonBridge,
|
|
223
|
-
exclusiveNetwork: profile.policy.network.egress.exclusiveNetwork,
|
|
224
|
-
icc: profile.policy.network.egress.icc,
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
/** 对规范化 descriptor 求稳定 canonical digest;返回值可直接作为 descriptor digest。 */
|
|
231
|
-
function dockerExecutionProfileV1Digest(profile) {
|
|
232
|
-
return `sha256:${(0, identity_ts_1.digestOf)(canonicalJson(parseDockerExecutionProfileV1(profile)))}`;
|
|
233
|
-
}
|
|
234
|
-
exports.dockerProfileDigestOf = dockerExecutionProfileV1Digest;
|
|
38
|
+
}, {
|
|
39
|
+
identifier: "DockerProfilePlainObject",
|
|
40
|
+
description: "a plain object or null-prototype record",
|
|
41
|
+
});
|
|
42
|
+
const plainStruct = (fields) => effect_1.Schema.compose(effect_1.Schema.Struct(fields), { strict: false })(PlainObjectSchema);
|
|
43
|
+
const nonEmptyString = (identifier) => effect_1.Schema.String.pipe(effect_1.Schema.filter((value) => value.trim() !== "" && !value.includes("\0"), { identifier, description: "a non-empty string without NUL" }));
|
|
44
|
+
const absolutePath = (identifier) => nonEmptyString(identifier).pipe(effect_1.Schema.filter(node_path_1.isAbsolute, { identifier, description: "an absolute path" }));
|
|
45
|
+
const nonNegativeSafeInteger = (identifier) => effect_1.Schema.JsonNumber.pipe(effect_1.Schema.filter((value) => Number.isSafeInteger(value) && value >= 0, { identifier, description: "a non-negative safe integer" }));
|
|
46
|
+
const positiveSafeInteger = (identifier) => effect_1.Schema.JsonNumber.pipe(effect_1.Schema.filter((value) => Number.isSafeInteger(value) && value > 0, { identifier, description: "a positive safe integer" }));
|
|
47
|
+
const positiveFinite = (identifier) => effect_1.Schema.JsonNumber.pipe(effect_1.Schema.filter((value) => Number.isFinite(value) && value > 0, { identifier, description: "a positive finite number" }));
|
|
235
48
|
function isPublicDnsServer(value) {
|
|
236
49
|
const kind = (0, node_net_1.isIP)(value);
|
|
237
50
|
if (kind === 4) {
|
|
238
|
-
const
|
|
239
|
-
const first = octets[0];
|
|
240
|
-
const second = octets[1];
|
|
241
|
-
const third = octets[2];
|
|
51
|
+
const [first, second, third] = value.split(".").map(Number);
|
|
242
52
|
if (first === undefined || second === undefined || third === undefined)
|
|
243
53
|
return false;
|
|
244
54
|
if (first === 0 || first === 10 || first === 127 || first >= 224)
|
|
@@ -251,358 +61,260 @@ function isPublicDnsServer(value) {
|
|
|
251
61
|
return false;
|
|
252
62
|
if (first === 192 && second === 168)
|
|
253
63
|
return false;
|
|
254
|
-
if (first === 192 && second === 0 && third === 0)
|
|
255
|
-
return false;
|
|
256
|
-
if (first === 192 && second === 0 && third === 2)
|
|
64
|
+
if (first === 192 && second === 0 && (third === 0 || third === 2))
|
|
257
65
|
return false;
|
|
258
66
|
if (first === 198 && (second === 18 || second === 19))
|
|
259
67
|
return false;
|
|
260
68
|
if (first === 198 && second === 51 && third === 100)
|
|
261
69
|
return false;
|
|
262
|
-
|
|
263
|
-
return false;
|
|
264
|
-
return true;
|
|
265
|
-
}
|
|
266
|
-
if (kind === 6) {
|
|
267
|
-
const normalized = value.toLowerCase();
|
|
268
|
-
if (normalized.startsWith("::ffff:"))
|
|
269
|
-
return isPublicDnsServer(normalized.slice("::ffff:".length));
|
|
270
|
-
return normalized !== "::" && normalized !== "::1" &&
|
|
271
|
-
!normalized.startsWith("fc") && !normalized.startsWith("fd") &&
|
|
272
|
-
!normalized.startsWith("fe8") && !normalized.startsWith("fe9") &&
|
|
273
|
-
!normalized.startsWith("fea") && !normalized.startsWith("feb") &&
|
|
274
|
-
!normalized.startsWith("ff") &&
|
|
275
|
-
!normalized.startsWith("2001:db8:");
|
|
276
|
-
}
|
|
277
|
-
return false;
|
|
278
|
-
}
|
|
279
|
-
function parseNetworkPolicy(value, path) {
|
|
280
|
-
const record = objectAt(value, path);
|
|
281
|
-
onlyKeys(record, ["version", "dns", "egress"], path);
|
|
282
|
-
if (record.version !== exports.DOCKER_PROFILE_NETWORK_POLICY_VERSION) {
|
|
283
|
-
fail("sandbox.docker-profile-schema-invalid", `${path}.version must be 1`, `${path}.version`);
|
|
284
|
-
}
|
|
285
|
-
const dnsPath = `${path}.dns`;
|
|
286
|
-
const dns = objectAt(record.dns, dnsPath);
|
|
287
|
-
onlyKeys(dns, ["mode", "servers"], dnsPath);
|
|
288
|
-
if (dns.mode !== "explicit") {
|
|
289
|
-
fail("sandbox.docker-profile-schema-invalid", `${dnsPath}.mode must be "explicit"`, `${dnsPath}.mode`);
|
|
70
|
+
return !(first === 203 && second === 0 && third === 113);
|
|
290
71
|
}
|
|
291
|
-
if (
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
const egress = objectAt(record.egress, egressPath);
|
|
303
|
-
onlyKeys(egress, [
|
|
304
|
-
"mode",
|
|
305
|
-
"allowedProtocols",
|
|
306
|
-
"denyPrivateNetworks",
|
|
307
|
-
"denySiblingSyntheticEndpoints",
|
|
308
|
-
"denyCidrs",
|
|
309
|
-
"ipv6",
|
|
310
|
-
"disableHostLoopback",
|
|
311
|
-
"portDriver",
|
|
312
|
-
"daemonBridge",
|
|
313
|
-
"exclusiveNetwork",
|
|
314
|
-
"icc",
|
|
315
|
-
], egressPath);
|
|
316
|
-
if (egress.mode !== "rootless-nat") {
|
|
317
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.mode must be "rootless-nat"`, `${egressPath}.mode`);
|
|
318
|
-
}
|
|
319
|
-
if (!Array.isArray(egress.allowedProtocols) || egress.allowedProtocols.length !== 2 ||
|
|
320
|
-
egress.allowedProtocols[0] !== "dns" || egress.allowedProtocols[1] !== "https") {
|
|
321
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.allowedProtocols must be ["dns", "https"]`, `${egressPath}.allowedProtocols`);
|
|
322
|
-
}
|
|
323
|
-
if (egress.denyPrivateNetworks !== true) {
|
|
324
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.denyPrivateNetworks must be true`, `${egressPath}.denyPrivateNetworks`);
|
|
325
|
-
}
|
|
326
|
-
if (egress.denySiblingSyntheticEndpoints !== true) {
|
|
327
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.denySiblingSyntheticEndpoints must be true`, `${egressPath}.denySiblingSyntheticEndpoints`);
|
|
328
|
-
}
|
|
329
|
-
if (!Array.isArray(egress.denyCidrs) || egress.denyCidrs.length !== exports.DOCKER_PROFILE_NETWORK_DENY_CIDRS.length ||
|
|
330
|
-
egress.denyCidrs.some((cidr, index) => cidr !== exports.DOCKER_PROFILE_NETWORK_DENY_CIDRS[index])) {
|
|
331
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.denyCidrs must be the v1 fail-closed CIDR set`, `${egressPath}.denyCidrs`);
|
|
332
|
-
}
|
|
333
|
-
if (egress.ipv6 !== "disabled") {
|
|
334
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.ipv6 must be "disabled"`, `${egressPath}.ipv6`);
|
|
335
|
-
}
|
|
336
|
-
if (egress.disableHostLoopback !== true) {
|
|
337
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.disableHostLoopback must be true`, `${egressPath}.disableHostLoopback`);
|
|
338
|
-
}
|
|
339
|
-
if (egress.portDriver !== "none") {
|
|
340
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.portDriver must be "none"`, `${egressPath}.portDriver`);
|
|
341
|
-
}
|
|
342
|
-
if (egress.daemonBridge !== "none") {
|
|
343
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.daemonBridge must be "none"`, `${egressPath}.daemonBridge`);
|
|
344
|
-
}
|
|
345
|
-
if (egress.exclusiveNetwork !== true) {
|
|
346
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.exclusiveNetwork must be true`, `${egressPath}.exclusiveNetwork`);
|
|
347
|
-
}
|
|
348
|
-
if (egress.icc !== false) {
|
|
349
|
-
fail("sandbox.docker-profile-schema-invalid", `${egressPath}.icc must be false`, `${egressPath}.icc`);
|
|
350
|
-
}
|
|
351
|
-
return Object.freeze({
|
|
352
|
-
version: exports.DOCKER_PROFILE_NETWORK_POLICY_VERSION,
|
|
353
|
-
dns: Object.freeze({ mode: "explicit", servers: frozenNonEmptyStrings(servers) }),
|
|
354
|
-
egress: Object.freeze({
|
|
355
|
-
mode: "rootless-nat",
|
|
356
|
-
allowedProtocols: NETWORK_ALLOWED_PROTOCOLS,
|
|
357
|
-
denyPrivateNetworks: true,
|
|
358
|
-
denySiblingSyntheticEndpoints: true,
|
|
359
|
-
denyCidrs: exports.DOCKER_PROFILE_NETWORK_DENY_CIDRS,
|
|
360
|
-
ipv6: "disabled",
|
|
361
|
-
disableHostLoopback: true,
|
|
362
|
-
portDriver: "none",
|
|
363
|
-
daemonBridge: "none",
|
|
364
|
-
exclusiveNetwork: true,
|
|
365
|
-
icc: false,
|
|
366
|
-
}),
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
function parsePolicy(value, path) {
|
|
370
|
-
const record = objectAt(value, path);
|
|
371
|
-
onlyKeys(record, [
|
|
372
|
-
"hostLoopback",
|
|
373
|
-
"tcpDockerEndpoint",
|
|
374
|
-
"outerSocketInjection",
|
|
375
|
-
"privilegedTranslation",
|
|
376
|
-
"writableRoot",
|
|
377
|
-
"network",
|
|
378
|
-
], path);
|
|
379
|
-
if (record.hostLoopback !== false)
|
|
380
|
-
fail("sandbox.docker-profile-schema-invalid", `${path}.hostLoopback must be false`, `${path}.hostLoopback`);
|
|
381
|
-
if (record.tcpDockerEndpoint !== false)
|
|
382
|
-
fail("sandbox.docker-profile-schema-invalid", `${path}.tcpDockerEndpoint must be false`, `${path}.tcpDockerEndpoint`);
|
|
383
|
-
if (record.outerSocketInjection !== false)
|
|
384
|
-
fail("sandbox.docker-profile-schema-invalid", `${path}.outerSocketInjection must be false`, `${path}.outerSocketInjection`);
|
|
385
|
-
if (record.privilegedTranslation !== "rootless-userns") {
|
|
386
|
-
fail("sandbox.docker-profile-schema-invalid", `${path}.privilegedTranslation must be "rootless-userns"`, `${path}.privilegedTranslation`);
|
|
387
|
-
}
|
|
388
|
-
if (record.writableRoot !== "declared-tmpfs-only") {
|
|
389
|
-
fail("sandbox.docker-profile-schema-invalid", `${path}.writableRoot must be "declared-tmpfs-only"`, `${path}.writableRoot`);
|
|
390
|
-
}
|
|
391
|
-
return Object.freeze({
|
|
392
|
-
hostLoopback: false,
|
|
393
|
-
tcpDockerEndpoint: false,
|
|
394
|
-
outerSocketInjection: false,
|
|
395
|
-
privilegedTranslation: "rootless-userns",
|
|
396
|
-
writableRoot: "declared-tmpfs-only",
|
|
397
|
-
network: parseNetworkPolicy(record.network, `${path}.network`),
|
|
398
|
-
});
|
|
72
|
+
if (kind !== 6)
|
|
73
|
+
return false;
|
|
74
|
+
const normalized = value.toLowerCase();
|
|
75
|
+
if (normalized.startsWith("::ffff:")) {
|
|
76
|
+
return isPublicDnsServer(normalized.slice("::ffff:".length));
|
|
77
|
+
}
|
|
78
|
+
return normalized !== "::" && normalized !== "::1" &&
|
|
79
|
+
!normalized.startsWith("fc") && !normalized.startsWith("fd") &&
|
|
80
|
+
!normalized.startsWith("fe8") && !normalized.startsWith("fe9") &&
|
|
81
|
+
!normalized.startsWith("fea") && !normalized.startsWith("feb") &&
|
|
82
|
+
!normalized.startsWith("ff") && !normalized.startsWith("2001:db8:");
|
|
399
83
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
84
|
+
const DnsServerSchema = nonEmptyString("DockerProfilePublicDnsServer").pipe(effect_1.Schema.filter(isPublicDnsServer, {
|
|
85
|
+
identifier: "DockerProfilePublicDnsServer",
|
|
86
|
+
description: "a public IP address, not a private or synthetic endpoint",
|
|
87
|
+
}));
|
|
88
|
+
const CidrsSchema = effect_1.Schema.NonEmptyArray(effect_1.Schema.String).pipe(effect_1.Schema.filter((value) => value.length === exports.DOCKER_PROFILE_NETWORK_DENY_CIDRS.length &&
|
|
89
|
+
value.every((cidr, index) => cidr === exports.DOCKER_PROFILE_NETWORK_DENY_CIDRS[index]), { identifier: "DockerProfileDenyCidrs", description: "the v1 fail-closed CIDR set" }));
|
|
90
|
+
const EndpointSchema = plainStruct({
|
|
91
|
+
path: absolutePath("DockerProfileSocketPath"),
|
|
92
|
+
peerUid: nonNegativeSafeInteger("DockerProfilePeerUid"),
|
|
93
|
+
});
|
|
94
|
+
const NetworkSchema = plainStruct({
|
|
95
|
+
version: effect_1.Schema.Literal(1),
|
|
96
|
+
dns: plainStruct({
|
|
97
|
+
mode: effect_1.Schema.Literal("explicit"),
|
|
98
|
+
servers: effect_1.Schema.NonEmptyArray(DnsServerSchema),
|
|
99
|
+
}),
|
|
100
|
+
egress: plainStruct({
|
|
101
|
+
mode: effect_1.Schema.Literal("rootless-nat"),
|
|
102
|
+
allowedProtocols: effect_1.Schema.Tuple(effect_1.Schema.Literal("dns"), effect_1.Schema.Literal("https")),
|
|
103
|
+
denyPrivateNetworks: effect_1.Schema.Literal(true),
|
|
104
|
+
denySiblingSyntheticEndpoints: effect_1.Schema.Literal(true),
|
|
105
|
+
denyCidrs: CidrsSchema,
|
|
106
|
+
ipv6: effect_1.Schema.Literal("disabled"),
|
|
107
|
+
disableHostLoopback: effect_1.Schema.Literal(true),
|
|
108
|
+
portDriver: effect_1.Schema.Literal("none"),
|
|
109
|
+
daemonBridge: effect_1.Schema.Literal("none"),
|
|
110
|
+
exclusiveNetwork: effect_1.Schema.Literal(true),
|
|
111
|
+
icc: effect_1.Schema.Literal(false),
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
const CapacitySchema = plainStruct({
|
|
115
|
+
cpus: positiveFinite("DockerProfileCapacityCpus"),
|
|
116
|
+
memoryBytes: positiveSafeInteger("DockerProfileCapacityMemoryBytes"),
|
|
117
|
+
memorySwapBytes: effect_1.Schema.Literal(0),
|
|
118
|
+
pids: positiveSafeInteger("DockerProfileCapacityPids"),
|
|
119
|
+
maxContainers: positiveSafeInteger("DockerProfileCapacityMaxContainers"),
|
|
120
|
+
maxBuilds: positiveSafeInteger("DockerProfileCapacityMaxBuilds"),
|
|
121
|
+
aggregate: plainStruct({
|
|
122
|
+
cpus: positiveFinite("DockerProfileAggregateCpus"),
|
|
123
|
+
memoryBytes: positiveSafeInteger("DockerProfileAggregateMemoryBytes"),
|
|
124
|
+
memorySwapBytes: effect_1.Schema.Literal(0),
|
|
125
|
+
pids: positiveSafeInteger("DockerProfileAggregatePids"),
|
|
126
|
+
}),
|
|
127
|
+
}).pipe(effect_1.Schema.filter((value) => value.aggregate.cpus >= value.cpus &&
|
|
128
|
+
value.aggregate.memoryBytes >= value.memoryBytes &&
|
|
129
|
+
value.aggregate.pids >= value.pids, {
|
|
130
|
+
identifier: "DockerProfileCapacity",
|
|
131
|
+
description: "aggregate capacity at least as large as allocatable CPU, memory and PID capacity",
|
|
132
|
+
}));
|
|
133
|
+
/** Wire structure only; semantic revision and frozen canonical values are checked after decode. */
|
|
134
|
+
exports.DockerExecutionProfileV1Schema = plainStruct({
|
|
135
|
+
schemaVersion: effect_1.Schema.Literal(1),
|
|
136
|
+
profileId: nonEmptyString("DockerProfileId"),
|
|
137
|
+
securityLevel: effect_1.Schema.Literal("managed-rootless/v1", "managed-vm-rootless/v1"),
|
|
138
|
+
semanticPolicyRevision: nonEmptyString("DockerProfileSemanticPolicyRevision"),
|
|
139
|
+
transport: plainStruct({
|
|
140
|
+
kind: effect_1.Schema.Literal("unix"),
|
|
141
|
+
hostMachineIdentity: nonEmptyString("DockerProfileHostMachineIdentity"),
|
|
142
|
+
dockerSocket: EndpointSchema,
|
|
143
|
+
controlSocket: plainStruct({
|
|
144
|
+
path: absolutePath("DockerProfileControlSocketPath"),
|
|
145
|
+
peerUid: nonNegativeSafeInteger("DockerProfileControlPeerUid"),
|
|
146
|
+
protocol: effect_1.Schema.Literal("niceeval-docker-profile-control/v1"),
|
|
420
147
|
}),
|
|
421
|
-
})
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
fail("sandbox.docker-profile-schema-invalid", `${path}.kind is unsupported`, `${path}.kind`);
|
|
429
|
-
}
|
|
430
|
-
const ownerPath = `${path}.owner`;
|
|
431
|
-
const owner = objectAt(record.owner, ownerPath);
|
|
432
|
-
onlyKeys(owner, ["uid", "gid"], ownerPath);
|
|
433
|
-
const filesystemPath = `${path}.filesystem`;
|
|
434
|
-
const filesystem = objectAt(record.filesystem, filesystemPath);
|
|
435
|
-
onlyKeys(filesystem, ["identity", "mountPath", "dockerRootDir", "limitBytes"], filesystemPath);
|
|
436
|
-
const cgroupPath = `${path}.cgroup`;
|
|
437
|
-
const cgroup = objectAt(record.cgroup, cgroupPath);
|
|
438
|
-
onlyKeys(cgroup, ["aggregatePath", "policyRevision", "controllers"], cgroupPath);
|
|
439
|
-
if (!Array.isArray(cgroup.controllers) || cgroup.controllers.length !== 3 ||
|
|
440
|
-
cgroup.controllers[0] !== "cpu" || cgroup.controllers[1] !== "memory" || cgroup.controllers[2] !== "pids") {
|
|
441
|
-
fail("sandbox.docker-profile-schema-invalid", `${cgroupPath}.controllers must be ["cpu", "memory", "pids"]`, `${cgroupPath}.controllers`);
|
|
442
|
-
}
|
|
443
|
-
return Object.freeze({
|
|
444
|
-
kind: record.kind,
|
|
445
|
-
machineIdentity: requiredString(record.machineIdentity, `${path}.machineIdentity`),
|
|
446
|
-
owner: Object.freeze({
|
|
447
|
-
uid: nonNegativeSafeInteger(owner.uid, `${ownerPath}.uid`),
|
|
448
|
-
gid: nonNegativeSafeInteger(owner.gid, `${ownerPath}.gid`),
|
|
148
|
+
}),
|
|
149
|
+
backend: plainStruct({
|
|
150
|
+
kind: effect_1.Schema.Literal("local-systemd", "dedicated-linux-vm"),
|
|
151
|
+
machineIdentity: nonEmptyString("DockerProfileBackendMachineIdentity"),
|
|
152
|
+
owner: plainStruct({
|
|
153
|
+
uid: nonNegativeSafeInteger("DockerProfileOwnerUid"),
|
|
154
|
+
gid: nonNegativeSafeInteger("DockerProfileOwnerGid"),
|
|
449
155
|
}),
|
|
450
|
-
filesystem:
|
|
451
|
-
identity:
|
|
452
|
-
mountPath: absolutePath(
|
|
453
|
-
dockerRootDir: absolutePath(
|
|
454
|
-
limitBytes: positiveSafeInteger(
|
|
156
|
+
filesystem: plainStruct({
|
|
157
|
+
identity: nonEmptyString("DockerProfileFilesystemIdentity"),
|
|
158
|
+
mountPath: absolutePath("DockerProfileMountPath"),
|
|
159
|
+
dockerRootDir: absolutePath("DockerProfileDockerRootDir"),
|
|
160
|
+
limitBytes: positiveSafeInteger("DockerProfileFilesystemLimitBytes"),
|
|
455
161
|
}),
|
|
456
|
-
cgroup:
|
|
457
|
-
aggregatePath: absolutePath(
|
|
458
|
-
policyRevision:
|
|
459
|
-
controllers:
|
|
162
|
+
cgroup: plainStruct({
|
|
163
|
+
aggregatePath: absolutePath("DockerProfileAggregatePath"),
|
|
164
|
+
policyRevision: nonEmptyString("DockerProfileCgroupPolicyRevision"),
|
|
165
|
+
controllers: effect_1.Schema.Tuple(effect_1.Schema.Literal("cpu"), effect_1.Schema.Literal("memory"), effect_1.Schema.Literal("pids")),
|
|
460
166
|
}),
|
|
461
|
-
})
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
pids: positiveSafeInteger(record.pids, `${path}.pids`),
|
|
479
|
-
maxContainers: positiveSafeInteger(record.maxContainers, `${path}.maxContainers`),
|
|
480
|
-
maxBuilds: positiveSafeInteger(record.maxBuilds, `${path}.maxBuilds`),
|
|
481
|
-
aggregate: {
|
|
482
|
-
cpus: positiveFinite(aggregate.cpus, `${aggregatePath}.cpus`),
|
|
483
|
-
memoryBytes: positiveSafeInteger(aggregate.memoryBytes, `${aggregatePath}.memoryBytes`),
|
|
484
|
-
memorySwapBytes: ZERO_SWAP,
|
|
485
|
-
pids: positiveSafeInteger(aggregate.pids, `${aggregatePath}.pids`),
|
|
486
|
-
},
|
|
487
|
-
};
|
|
488
|
-
if (parsed.aggregate.cpus < parsed.cpus || parsed.aggregate.memoryBytes < parsed.memoryBytes || parsed.aggregate.pids < parsed.pids) {
|
|
489
|
-
throw (0, errors_ts_1.dockerProfileError)({
|
|
490
|
-
code: "sandbox.docker-profile-capacity-invalid",
|
|
491
|
-
path,
|
|
492
|
-
message: "profile.capacity.aggregate must be at least as large as allocatable CPU, memory and PID capacity",
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
return Object.freeze({
|
|
496
|
-
cpus: parsed.cpus,
|
|
497
|
-
memoryBytes: parsed.memoryBytes,
|
|
498
|
-
memorySwapBytes: parsed.memorySwapBytes,
|
|
499
|
-
pids: parsed.pids,
|
|
500
|
-
maxContainers: parsed.maxContainers,
|
|
501
|
-
maxBuilds: parsed.maxBuilds,
|
|
502
|
-
aggregate: Object.freeze({ ...parsed.aggregate }),
|
|
503
|
-
});
|
|
167
|
+
}),
|
|
168
|
+
capacity: CapacitySchema,
|
|
169
|
+
policy: plainStruct({
|
|
170
|
+
hostLoopback: effect_1.Schema.Literal(false),
|
|
171
|
+
tcpDockerEndpoint: effect_1.Schema.Literal(false),
|
|
172
|
+
outerSocketInjection: effect_1.Schema.Literal(false),
|
|
173
|
+
privilegedTranslation: effect_1.Schema.Literal("rootless-userns"),
|
|
174
|
+
writableRoot: effect_1.Schema.Literal("declared-tmpfs-only"),
|
|
175
|
+
network: NetworkSchema,
|
|
176
|
+
}),
|
|
177
|
+
});
|
|
178
|
+
exports.DockerExecutionProfileSchema = exports.DockerExecutionProfileV1Schema;
|
|
179
|
+
function frozenNonEmptyStrings(values) {
|
|
180
|
+
const [first, ...rest] = values;
|
|
181
|
+
if (first === undefined)
|
|
182
|
+
throw new Error("expected a non-empty string tuple");
|
|
183
|
+
return Object.freeze([first, ...rest]);
|
|
504
184
|
}
|
|
185
|
+
/** Canonicalize only after structural decoding; nested containers are immutable to callers. */
|
|
505
186
|
function freezeProfile(profile) {
|
|
506
187
|
return Object.freeze({
|
|
507
|
-
|
|
508
|
-
profileId: profile.profileId,
|
|
509
|
-
securityLevel: profile.securityLevel,
|
|
510
|
-
semanticPolicyRevision: profile.semanticPolicyRevision,
|
|
188
|
+
...profile,
|
|
511
189
|
transport: Object.freeze({
|
|
512
|
-
|
|
513
|
-
hostMachineIdentity: profile.transport.hostMachineIdentity,
|
|
190
|
+
...profile.transport,
|
|
514
191
|
dockerSocket: Object.freeze({ ...profile.transport.dockerSocket }),
|
|
515
192
|
controlSocket: Object.freeze({ ...profile.transport.controlSocket }),
|
|
516
193
|
}),
|
|
517
194
|
backend: Object.freeze({
|
|
518
|
-
|
|
519
|
-
machineIdentity: profile.backend.machineIdentity,
|
|
195
|
+
...profile.backend,
|
|
520
196
|
owner: Object.freeze({ ...profile.backend.owner }),
|
|
521
197
|
filesystem: Object.freeze({ ...profile.backend.filesystem }),
|
|
522
|
-
cgroup: Object.freeze({
|
|
523
|
-
aggregatePath: profile.backend.cgroup.aggregatePath,
|
|
524
|
-
policyRevision: profile.backend.cgroup.policyRevision,
|
|
525
|
-
controllers: PROFILE_CONTROLLERS,
|
|
526
|
-
}),
|
|
198
|
+
cgroup: Object.freeze({ ...profile.backend.cgroup, controllers: PROFILE_CONTROLLERS }),
|
|
527
199
|
}),
|
|
528
200
|
capacity: Object.freeze({
|
|
529
|
-
|
|
530
|
-
memoryBytes: profile.capacity.memoryBytes,
|
|
201
|
+
...profile.capacity,
|
|
531
202
|
memorySwapBytes: 0,
|
|
532
|
-
|
|
533
|
-
maxContainers: profile.capacity.maxContainers,
|
|
534
|
-
maxBuilds: profile.capacity.maxBuilds,
|
|
535
|
-
aggregate: Object.freeze({ ...profile.capacity.aggregate }),
|
|
203
|
+
aggregate: Object.freeze({ ...profile.capacity.aggregate, memorySwapBytes: 0 }),
|
|
536
204
|
}),
|
|
537
205
|
policy: Object.freeze({
|
|
538
|
-
|
|
539
|
-
tcpDockerEndpoint: profile.policy.tcpDockerEndpoint,
|
|
540
|
-
outerSocketInjection: profile.policy.outerSocketInjection,
|
|
541
|
-
privilegedTranslation: profile.policy.privilegedTranslation,
|
|
542
|
-
writableRoot: profile.policy.writableRoot,
|
|
206
|
+
...profile.policy,
|
|
543
207
|
network: Object.freeze({
|
|
544
|
-
|
|
208
|
+
...profile.policy.network,
|
|
545
209
|
dns: Object.freeze({
|
|
546
|
-
|
|
210
|
+
...profile.policy.network.dns,
|
|
547
211
|
servers: frozenNonEmptyStrings(profile.policy.network.dns.servers),
|
|
548
212
|
}),
|
|
549
213
|
egress: Object.freeze({
|
|
550
|
-
|
|
214
|
+
...profile.policy.network.egress,
|
|
551
215
|
allowedProtocols: NETWORK_ALLOWED_PROTOCOLS,
|
|
552
|
-
denyPrivateNetworks: profile.policy.network.egress.denyPrivateNetworks,
|
|
553
|
-
denySiblingSyntheticEndpoints: profile.policy.network.egress.denySiblingSyntheticEndpoints,
|
|
554
216
|
denyCidrs: exports.DOCKER_PROFILE_NETWORK_DENY_CIDRS,
|
|
555
|
-
ipv6: profile.policy.network.egress.ipv6,
|
|
556
|
-
disableHostLoopback: profile.policy.network.egress.disableHostLoopback,
|
|
557
|
-
portDriver: profile.policy.network.egress.portDriver,
|
|
558
|
-
daemonBridge: profile.policy.network.egress.daemonBridge,
|
|
559
|
-
exclusiveNetwork: profile.policy.network.egress.exclusiveNetwork,
|
|
560
|
-
icc: profile.policy.network.egress.icc,
|
|
561
217
|
}),
|
|
562
218
|
}),
|
|
563
219
|
}),
|
|
564
220
|
});
|
|
565
221
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
222
|
+
function semanticPolicyJson(input) {
|
|
223
|
+
return {
|
|
224
|
+
schemaVersion: exports.DOCKER_EXECUTION_PROFILE_SCHEMA_VERSION,
|
|
225
|
+
securityLevel: input.securityLevel,
|
|
226
|
+
backend: {
|
|
227
|
+
kind: input.backend.kind,
|
|
228
|
+
cgroup: {
|
|
229
|
+
policyRevision: input.backend.cgroup.policyRevision,
|
|
230
|
+
controllers: [...input.backend.cgroup.controllers],
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
policy: {
|
|
234
|
+
hostLoopback: input.policy.hostLoopback,
|
|
235
|
+
tcpDockerEndpoint: input.policy.tcpDockerEndpoint,
|
|
236
|
+
outerSocketInjection: input.policy.outerSocketInjection,
|
|
237
|
+
privilegedTranslation: input.policy.privilegedTranslation,
|
|
238
|
+
writableRoot: input.policy.writableRoot,
|
|
239
|
+
network: {
|
|
240
|
+
version: input.policy.network.version,
|
|
241
|
+
dns: { mode: input.policy.network.dns.mode, servers: [...input.policy.network.dns.servers] },
|
|
242
|
+
egress: {
|
|
243
|
+
mode: input.policy.network.egress.mode,
|
|
244
|
+
allowedProtocols: [...input.policy.network.egress.allowedProtocols],
|
|
245
|
+
denyPrivateNetworks: input.policy.network.egress.denyPrivateNetworks,
|
|
246
|
+
denySiblingSyntheticEndpoints: input.policy.network.egress.denySiblingSyntheticEndpoints,
|
|
247
|
+
denyCidrs: [...input.policy.network.egress.denyCidrs],
|
|
248
|
+
ipv6: input.policy.network.egress.ipv6,
|
|
249
|
+
disableHostLoopback: input.policy.network.egress.disableHostLoopback,
|
|
250
|
+
portDriver: input.policy.network.egress.portDriver,
|
|
251
|
+
daemonBridge: input.policy.network.egress.daemonBridge,
|
|
252
|
+
exclusiveNetwork: input.policy.network.egress.exclusiveNetwork,
|
|
253
|
+
icc: input.policy.network.egress.icc,
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
function dockerExecutionProfileSemanticPolicyRevisionOf(input) {
|
|
260
|
+
return (0, identity_ts_1.digestOf)(semanticPolicyJson(input)).slice(0, 8);
|
|
261
|
+
}
|
|
262
|
+
exports.dockerProfileSemanticPolicyRevisionOf = dockerExecutionProfileSemanticPolicyRevisionOf;
|
|
263
|
+
function formatSchemaPath(path) {
|
|
264
|
+
return path.reduce((result, segment) => typeof segment === "number" ||
|
|
265
|
+
(typeof segment === "string" && /^\\d+$/.test(segment))
|
|
266
|
+
? `${result}[${String(segment)}]`
|
|
267
|
+
: `${result}.${String(segment)}`, "profile");
|
|
268
|
+
}
|
|
269
|
+
function schemaError(value, error) {
|
|
270
|
+
const issue = effect_1.ParseResult.ArrayFormatter.formatErrorSync(error)[0];
|
|
271
|
+
const path = issue === undefined ? "profile" : formatSchemaPath(issue.path);
|
|
272
|
+
const root = typeof value === "object" && value !== null && !Array.isArray(value)
|
|
273
|
+
? value
|
|
274
|
+
: undefined;
|
|
275
|
+
if (path === "profile.schemaVersion") {
|
|
276
|
+
if (root?.schemaVersion === undefined) {
|
|
277
|
+
return (0, errors_ts_1.dockerProfileError)({
|
|
278
|
+
code: "sandbox.docker-profile-schema-invalid",
|
|
279
|
+
path,
|
|
280
|
+
message: "profile.schemaVersion is required",
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
return (0, errors_ts_1.dockerProfileError)({
|
|
575
284
|
code: "sandbox.docker-profile-unknown-version",
|
|
576
|
-
path
|
|
285
|
+
path,
|
|
577
286
|
message: `Unsupported Docker execution profile schema version ${JSON.stringify(root.schemaVersion)}; expected 1`,
|
|
578
287
|
});
|
|
579
288
|
}
|
|
580
|
-
if (
|
|
581
|
-
|
|
289
|
+
if (path === "profile.securityLevel") {
|
|
290
|
+
return (0, errors_ts_1.dockerProfileError)({
|
|
582
291
|
code: "sandbox.docker-profile-security-level-unsupported",
|
|
583
|
-
path
|
|
584
|
-
message: `Unsupported Docker execution profile security level ${JSON.stringify(root
|
|
292
|
+
path,
|
|
293
|
+
message: `Unsupported Docker execution profile security level ${JSON.stringify(root?.securityLevel)}`,
|
|
585
294
|
});
|
|
586
295
|
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
backend: parseBackend(root.backend),
|
|
596
|
-
capacity: parseCapacity(root.capacity),
|
|
597
|
-
policy: parsePolicy(root.policy, "profile.policy"),
|
|
296
|
+
return (0, errors_ts_1.dockerProfileError)({
|
|
297
|
+
code: path === "profile.capacity"
|
|
298
|
+
? "sandbox.docker-profile-capacity-invalid"
|
|
299
|
+
: "sandbox.docker-profile-schema-invalid",
|
|
300
|
+
path,
|
|
301
|
+
message: issue === undefined
|
|
302
|
+
? "profile is not a valid Docker execution profile v1"
|
|
303
|
+
: `${path} ${issue.message}`,
|
|
598
304
|
});
|
|
599
|
-
|
|
600
|
-
|
|
305
|
+
}
|
|
306
|
+
function parseDockerExecutionProfileV1(value) {
|
|
307
|
+
const decoded = effect_1.Schema.decodeUnknownEither(exports.DockerExecutionProfileV1Schema, ParseOptions)(value);
|
|
308
|
+
if (effect_1.Either.isLeft(decoded))
|
|
309
|
+
throw schemaError(value, decoded.left);
|
|
310
|
+
const profile = freezeProfile(decoded.right);
|
|
311
|
+
const expected = dockerExecutionProfileSemanticPolicyRevisionOf(profile);
|
|
312
|
+
if (profile.semanticPolicyRevision !== expected) {
|
|
601
313
|
throw (0, errors_ts_1.dockerProfileError)({
|
|
602
314
|
code: "sandbox.docker-profile-semantic-policy-mismatch",
|
|
603
315
|
path: "profile.semanticPolicyRevision",
|
|
604
|
-
message: `profile.semanticPolicyRevision does not match the canonical semantic policy revision ${
|
|
605
|
-
details: { expected
|
|
316
|
+
message: `profile.semanticPolicyRevision does not match the canonical semantic policy revision ${expected}`,
|
|
317
|
+
details: { expected, actual: profile.semanticPolicyRevision },
|
|
606
318
|
});
|
|
607
319
|
}
|
|
608
320
|
return profile;
|
|
@@ -610,8 +322,10 @@ function parseDockerExecutionProfileV1(value) {
|
|
|
610
322
|
exports.parseDockerExecutionProfile = parseDockerExecutionProfileV1;
|
|
611
323
|
exports.decodeDockerExecutionProfileV1 = parseDockerExecutionProfileV1;
|
|
612
324
|
function makeDockerExecutionProfileV1(input) {
|
|
613
|
-
|
|
614
|
-
|
|
325
|
+
return parseDockerExecutionProfileV1({
|
|
326
|
+
...input,
|
|
327
|
+
semanticPolicyRevision: dockerExecutionProfileSemanticPolicyRevisionOf(input),
|
|
328
|
+
});
|
|
615
329
|
}
|
|
616
330
|
exports.createDockerExecutionProfileV1 = makeDockerExecutionProfileV1;
|
|
617
331
|
function isDockerExecutionProfileV1(value) {
|
|
@@ -623,12 +337,52 @@ function isDockerExecutionProfileV1(value) {
|
|
|
623
337
|
return false;
|
|
624
338
|
}
|
|
625
339
|
}
|
|
626
|
-
/**
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
340
|
+
/** Digest the fixed v1 wire shape, not incidental object insertion order. */
|
|
341
|
+
function canonicalJson(profile) {
|
|
342
|
+
return {
|
|
343
|
+
schemaVersion: profile.schemaVersion,
|
|
344
|
+
profileId: profile.profileId,
|
|
345
|
+
securityLevel: profile.securityLevel,
|
|
346
|
+
semanticPolicyRevision: profile.semanticPolicyRevision,
|
|
347
|
+
transport: {
|
|
348
|
+
kind: profile.transport.kind,
|
|
349
|
+
hostMachineIdentity: profile.transport.hostMachineIdentity,
|
|
350
|
+
dockerSocket: { ...profile.transport.dockerSocket },
|
|
351
|
+
controlSocket: { ...profile.transport.controlSocket },
|
|
352
|
+
},
|
|
353
|
+
backend: {
|
|
354
|
+
kind: profile.backend.kind,
|
|
355
|
+
machineIdentity: profile.backend.machineIdentity,
|
|
356
|
+
owner: { ...profile.backend.owner },
|
|
357
|
+
filesystem: { ...profile.backend.filesystem },
|
|
358
|
+
cgroup: { ...profile.backend.cgroup, controllers: [...profile.backend.cgroup.controllers] },
|
|
359
|
+
},
|
|
360
|
+
capacity: {
|
|
361
|
+
...profile.capacity,
|
|
362
|
+
aggregate: { ...profile.capacity.aggregate },
|
|
363
|
+
},
|
|
364
|
+
policy: {
|
|
365
|
+
hostLoopback: profile.policy.hostLoopback,
|
|
366
|
+
tcpDockerEndpoint: profile.policy.tcpDockerEndpoint,
|
|
367
|
+
outerSocketInjection: profile.policy.outerSocketInjection,
|
|
368
|
+
privilegedTranslation: profile.policy.privilegedTranslation,
|
|
369
|
+
writableRoot: profile.policy.writableRoot,
|
|
370
|
+
network: {
|
|
371
|
+
version: profile.policy.network.version,
|
|
372
|
+
dns: { mode: profile.policy.network.dns.mode, servers: [...profile.policy.network.dns.servers] },
|
|
373
|
+
egress: {
|
|
374
|
+
...profile.policy.network.egress,
|
|
375
|
+
allowedProtocols: [...profile.policy.network.egress.allowedProtocols],
|
|
376
|
+
denyCidrs: [...profile.policy.network.egress.denyCidrs],
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
function dockerExecutionProfileV1Digest(profile) {
|
|
383
|
+
return `sha256:${(0, identity_ts_1.digestOf)(canonicalJson(parseDockerExecutionProfileV1(profile)))}`;
|
|
384
|
+
}
|
|
385
|
+
exports.dockerProfileDigestOf = dockerExecutionProfileV1Digest;
|
|
632
386
|
function dockerProfilePublicSummaryOf(profile) {
|
|
633
387
|
const normalized = parseDockerExecutionProfileV1(profile);
|
|
634
388
|
return Object.freeze({
|
|
@@ -637,12 +391,7 @@ function dockerProfilePublicSummaryOf(profile) {
|
|
|
637
391
|
securityLevel: normalized.securityLevel,
|
|
638
392
|
semanticPolicyRevision: normalized.semanticPolicyRevision,
|
|
639
393
|
capacity: Object.freeze({
|
|
640
|
-
|
|
641
|
-
memoryBytes: normalized.capacity.memoryBytes,
|
|
642
|
-
memorySwapBytes: 0,
|
|
643
|
-
pids: normalized.capacity.pids,
|
|
644
|
-
maxContainers: normalized.capacity.maxContainers,
|
|
645
|
-
maxBuilds: normalized.capacity.maxBuilds,
|
|
394
|
+
...normalized.capacity,
|
|
646
395
|
aggregate: Object.freeze({ ...normalized.capacity.aggregate }),
|
|
647
396
|
}),
|
|
648
397
|
});
|