self-bench 0.3.5 → 0.3.8
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/.dockerignore +11 -1
- package/Dockerfile +9 -9
- package/Dockerfile.sandbox +5 -4
- package/README.md +38 -21
- package/bun.lock +462 -95
- package/compose.yaml +64 -20
- package/dist/agent-feed.d.ts +8 -0
- package/dist/agent-feed.d.ts.map +1 -0
- package/dist/agent-feed.js +56 -0
- package/dist/agent-feed.js.map +1 -0
- package/dist/api/http.d.ts +18 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/http.js +111 -0
- package/dist/api/http.js.map +1 -0
- package/dist/api/run-request.d.ts +37 -0
- package/dist/api/run-request.d.ts.map +1 -0
- package/dist/api/run-request.js +59 -0
- package/dist/api/run-request.js.map +1 -0
- package/dist/api/status.d.ts +4 -0
- package/dist/api/status.d.ts.map +1 -0
- package/dist/api/status.js +36 -0
- package/dist/api/status.js.map +1 -0
- package/dist/api/viewer-routes.d.ts +9 -0
- package/dist/api/viewer-routes.d.ts.map +1 -0
- package/dist/api/viewer-routes.js +98 -0
- package/dist/api/viewer-routes.js.map +1 -0
- package/dist/api-main.js +5 -1
- package/dist/api-main.js.map +1 -1
- package/dist/api.d.ts +7 -25
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +80 -148
- package/dist/api.js.map +1 -1
- package/dist/archive.d.ts +14 -0
- package/dist/archive.d.ts.map +1 -0
- package/dist/archive.js +114 -0
- package/dist/archive.js.map +1 -0
- package/dist/artifacts/common.d.ts +15 -0
- package/dist/artifacts/common.d.ts.map +1 -0
- package/dist/artifacts/common.js +58 -0
- package/dist/artifacts/common.js.map +1 -0
- package/dist/artifacts/gcs.d.ts +18 -0
- package/dist/artifacts/gcs.d.ts.map +1 -0
- package/dist/artifacts/gcs.js +178 -0
- package/dist/artifacts/gcs.js.map +1 -0
- package/dist/artifacts/local.d.ts +17 -0
- package/dist/artifacts/local.d.ts.map +1 -0
- package/dist/artifacts/local.js +205 -0
- package/dist/artifacts/local.js.map +1 -0
- package/dist/artifacts/types.d.ts +18 -0
- package/dist/artifacts/types.d.ts.map +1 -0
- package/dist/artifacts/types.js +2 -0
- package/dist/artifacts/types.js.map +1 -0
- package/dist/artifacts.d.ts +5 -28
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +5 -302
- package/dist/artifacts.js.map +1 -1
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +8 -2
- package/dist/audit.js.map +1 -1
- package/dist/auth/api-key-routes.d.ts +17 -0
- package/dist/auth/api-key-routes.d.ts.map +1 -0
- package/dist/auth/api-key-routes.js +57 -0
- package/dist/auth/api-key-routes.js.map +1 -0
- package/dist/auth/api-keys.d.ts +47 -0
- package/dist/auth/api-keys.d.ts.map +1 -0
- package/dist/auth/api-keys.js +102 -0
- package/dist/auth/api-keys.js.map +1 -0
- package/dist/auth/config.d.ts +17 -0
- package/dist/auth/config.d.ts.map +1 -0
- package/dist/auth/config.js +38 -0
- package/dist/auth/config.js.map +1 -0
- package/dist/auth/cookies.d.ts +12 -0
- package/dist/auth/cookies.d.ts.map +1 -0
- package/dist/auth/cookies.js +45 -0
- package/dist/auth/cookies.js.map +1 -0
- package/dist/auth/crypto.d.ts +19 -0
- package/dist/auth/crypto.d.ts.map +1 -0
- package/dist/auth/crypto.js +48 -0
- package/dist/auth/crypto.js.map +1 -0
- package/dist/auth/github.d.ts +37 -0
- package/dist/auth/github.d.ts.map +1 -0
- package/dist/auth/github.js +127 -0
- package/dist/auth/github.js.map +1 -0
- package/dist/auth/routes.d.ts +41 -0
- package/dist/auth/routes.d.ts.map +1 -0
- package/dist/auth/routes.js +153 -0
- package/dist/auth/routes.js.map +1 -0
- package/dist/auth/session-expired.d.ts +4 -0
- package/dist/auth/session-expired.d.ts.map +1 -0
- package/dist/auth/session-expired.js +17 -0
- package/dist/auth/session-expired.js.map +1 -0
- package/dist/auth/session.d.ts +23 -0
- package/dist/auth/session.d.ts.map +1 -0
- package/dist/auth/session.js +56 -0
- package/dist/auth/session.js.map +1 -0
- package/dist/auth/users.d.ts +49 -0
- package/dist/auth/users.d.ts.map +1 -0
- package/dist/auth/users.js +125 -0
- package/dist/auth/users.js.map +1 -0
- package/dist/build-metadata.js +1 -1
- package/dist/cli/api-client.d.ts +8 -0
- package/dist/cli/api-client.d.ts.map +1 -0
- package/dist/cli/api-client.js +71 -0
- package/dist/cli/api-client.js.map +1 -0
- package/dist/cli/associate.d.ts +2 -0
- package/dist/cli/associate.d.ts.map +1 -0
- package/dist/cli/associate.js +51 -0
- package/dist/cli/associate.js.map +1 -0
- package/dist/cli/help.d.ts +2 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +52 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +55 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/replay.d.ts +3 -0
- package/dist/cli/replay.d.ts.map +1 -0
- package/dist/cli/replay.js +59 -0
- package/dist/cli/replay.js.map +1 -0
- package/dist/cli/repository.d.ts +6 -0
- package/dist/cli/repository.d.ts.map +1 -0
- package/dist/cli/repository.js +36 -0
- package/dist/cli/repository.js.map +1 -0
- package/dist/cli/run.d.ts +2 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +93 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/stack-environment.d.ts +26 -0
- package/dist/cli/stack-environment.d.ts.map +1 -0
- package/dist/cli/stack-environment.js +86 -0
- package/dist/cli/stack-environment.js.map +1 -0
- package/dist/cli/stack.d.ts +6 -0
- package/dist/cli/stack.d.ts.map +1 -0
- package/dist/cli/stack.js +131 -0
- package/dist/cli/stack.js.map +1 -0
- package/dist/cli/values.d.ts +8 -0
- package/dist/cli/values.d.ts.map +1 -0
- package/dist/cli/values.js +30 -0
- package/dist/cli/values.js.map +1 -0
- package/dist/cli/view.d.ts +2 -0
- package/dist/cli/view.d.ts.map +1 -0
- package/dist/cli/view.js +40 -0
- package/dist/cli/view.js.map +1 -0
- package/dist/cli.js +2 -369
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +16 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +60 -22
- package/dist/config.js.map +1 -1
- package/dist/contracts/common.d.ts +22 -0
- package/dist/contracts/common.d.ts.map +1 -0
- package/dist/contracts/common.js +29 -0
- package/dist/contracts/common.js.map +1 -0
- package/dist/contracts/results.d.ts +66 -0
- package/dist/contracts/results.d.ts.map +1 -0
- package/dist/contracts/results.js +2 -0
- package/dist/contracts/results.js.map +1 -0
- package/dist/contracts/run.d.ts +145 -0
- package/dist/contracts/run.d.ts.map +1 -0
- package/dist/contracts/run.js +74 -0
- package/dist/contracts/run.js.map +1 -0
- package/dist/contracts/task.d.ts +232 -0
- package/dist/contracts/task.d.ts.map +1 -0
- package/dist/contracts/task.js +198 -0
- package/dist/contracts/task.js.map +1 -0
- package/dist/contracts/verify.d.ts +331 -0
- package/dist/contracts/verify.d.ts.map +1 -0
- package/dist/contracts/verify.js +84 -0
- package/dist/contracts/verify.js.map +1 -0
- package/dist/contracts.d.ts +5 -242
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +5 -127
- package/dist/contracts.js.map +1 -1
- package/dist/db/client.d.ts +12 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/client.js +16 -0
- package/dist/db/client.js.map +1 -0
- package/dist/db/schema.d.ts +1256 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +128 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/environment.d.ts +9 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +101 -0
- package/dist/environment.js.map +1 -0
- package/dist/evaluation/account.d.ts +30 -0
- package/dist/evaluation/account.d.ts.map +1 -0
- package/dist/evaluation/account.js +34 -0
- package/dist/evaluation/account.js.map +1 -0
- package/dist/evaluation/activities.d.ts +9 -0
- package/dist/evaluation/activities.d.ts.map +1 -0
- package/dist/evaluation/activities.js +40 -0
- package/dist/evaluation/activities.js.map +1 -0
- package/dist/evaluation/catalog-pricing.d.ts +3 -0
- package/dist/evaluation/catalog-pricing.d.ts.map +1 -0
- package/dist/evaluation/catalog-pricing.js +37 -0
- package/dist/evaluation/catalog-pricing.js.map +1 -0
- package/dist/evaluation/catalog.d.ts +17 -0
- package/dist/evaluation/catalog.d.ts.map +1 -0
- package/dist/evaluation/catalog.js +126 -0
- package/dist/evaluation/catalog.js.map +1 -0
- package/dist/evaluation/codex-login-process.d.ts +12 -0
- package/dist/evaluation/codex-login-process.d.ts.map +1 -0
- package/dist/evaluation/codex-login-process.js +121 -0
- package/dist/evaluation/codex-login-process.js.map +1 -0
- package/dist/evaluation/codex-login-routes.d.ts +5 -0
- package/dist/evaluation/codex-login-routes.d.ts.map +1 -0
- package/dist/evaluation/codex-login-routes.js +55 -0
- package/dist/evaluation/codex-login-routes.js.map +1 -0
- package/dist/evaluation/codex-login.d.ts +42 -0
- package/dist/evaluation/codex-login.d.ts.map +1 -0
- package/dist/evaluation/codex-login.js +143 -0
- package/dist/evaluation/codex-login.js.map +1 -0
- package/dist/evaluation/comparisons.d.ts +65 -0
- package/dist/evaluation/comparisons.d.ts.map +1 -0
- package/dist/evaluation/comparisons.js +161 -0
- package/dist/evaluation/comparisons.js.map +1 -0
- package/dist/evaluation/config.d.ts +43 -0
- package/dist/evaluation/config.d.ts.map +1 -0
- package/dist/evaluation/config.js +116 -0
- package/dist/evaluation/config.js.map +1 -0
- package/dist/evaluation/cost.d.ts +3 -0
- package/dist/evaluation/cost.d.ts.map +1 -0
- package/dist/evaluation/cost.js +95 -0
- package/dist/evaluation/cost.js.map +1 -0
- package/dist/evaluation/credential-execution.d.ts +10 -0
- package/dist/evaluation/credential-execution.d.ts.map +1 -0
- package/dist/evaluation/credential-execution.js +65 -0
- package/dist/evaluation/credential-execution.js.map +1 -0
- package/dist/evaluation/credentials.d.ts +40 -0
- package/dist/evaluation/credentials.d.ts.map +1 -0
- package/dist/evaluation/credentials.js +146 -0
- package/dist/evaluation/credentials.js.map +1 -0
- package/dist/evaluation/encrypted-records.d.ts +15 -0
- package/dist/evaluation/encrypted-records.d.ts.map +1 -0
- package/dist/evaluation/encrypted-records.js +57 -0
- package/dist/evaluation/encrypted-records.js.map +1 -0
- package/dist/evaluation/gateway-execution.d.ts +18 -0
- package/dist/evaluation/gateway-execution.d.ts.map +1 -0
- package/dist/evaluation/gateway-execution.js +38 -0
- package/dist/evaluation/gateway-execution.js.map +1 -0
- package/dist/evaluation/harbor-cost.d.ts +3 -0
- package/dist/evaluation/harbor-cost.d.ts.map +1 -0
- package/dist/evaluation/harbor-cost.js +39 -0
- package/dist/evaluation/harbor-cost.js.map +1 -0
- package/dist/evaluation/harbor_e2b.py +20 -0
- package/dist/evaluation/harbor_gateway.py +22 -0
- package/dist/evaluation/harnesses.d.ts +8 -0
- package/dist/evaluation/harnesses.d.ts.map +1 -0
- package/dist/evaluation/harnesses.js +10 -0
- package/dist/evaluation/harnesses.js.map +1 -0
- package/dist/evaluation/model-options.d.ts +9 -0
- package/dist/evaluation/model-options.d.ts.map +1 -0
- package/dist/evaluation/model-options.js +81 -0
- package/dist/evaluation/model-options.js.map +1 -0
- package/dist/evaluation/org-credential-routes.d.ts +5 -0
- package/dist/evaluation/org-credential-routes.d.ts.map +1 -0
- package/dist/evaluation/org-credential-routes.js +56 -0
- package/dist/evaluation/org-credential-routes.js.map +1 -0
- package/dist/evaluation/org-records.d.ts +4 -0
- package/dist/evaluation/org-records.d.ts.map +1 -0
- package/dist/evaluation/org-records.js +14 -0
- package/dist/evaluation/org-records.js.map +1 -0
- package/dist/evaluation/output.d.ts +9 -0
- package/dist/evaluation/output.d.ts.map +1 -0
- package/dist/evaluation/output.js +171 -0
- package/dist/evaluation/output.js.map +1 -0
- package/dist/evaluation/platform-routes.d.ts +5 -0
- package/dist/evaluation/platform-routes.d.ts.map +1 -0
- package/dist/evaluation/platform-routes.js +123 -0
- package/dist/evaluation/platform-routes.js.map +1 -0
- package/dist/evaluation/profile-routes.d.ts +16 -0
- package/dist/evaluation/profile-routes.d.ts.map +1 -0
- package/dist/evaluation/profile-routes.js +47 -0
- package/dist/evaluation/profile-routes.js.map +1 -0
- package/dist/evaluation/profiles.d.ts +48 -0
- package/dist/evaluation/profiles.d.ts.map +1 -0
- package/dist/evaluation/profiles.js +134 -0
- package/dist/evaluation/profiles.js.map +1 -0
- package/dist/evaluation/providers.d.ts +11 -0
- package/dist/evaluation/providers.d.ts.map +1 -0
- package/dist/evaluation/providers.js +30 -0
- package/dist/evaluation/providers.js.map +1 -0
- package/dist/evaluation/routes.d.ts +23 -0
- package/dist/evaluation/routes.d.ts.map +1 -0
- package/dist/evaluation/routes.js +212 -0
- package/dist/evaluation/routes.js.map +1 -0
- package/dist/evaluation/runner.d.ts +16 -0
- package/dist/evaluation/runner.d.ts.map +1 -0
- package/dist/evaluation/runner.js +241 -0
- package/dist/evaluation/runner.js.map +1 -0
- package/dist/evaluation/store.d.ts +8 -0
- package/dist/evaluation/store.d.ts.map +1 -0
- package/dist/evaluation/store.js +60 -0
- package/dist/evaluation/store.js.map +1 -0
- package/dist/evaluation/types.d.ts +98 -0
- package/dist/evaluation/types.d.ts.map +1 -0
- package/dist/evaluation/types.js +2 -0
- package/dist/evaluation/types.js.map +1 -0
- package/dist/evaluation/worker-main.d.ts +2 -0
- package/dist/evaluation/worker-main.d.ts.map +1 -0
- package/dist/evaluation/worker-main.js +26 -0
- package/dist/evaluation/worker-main.js.map +1 -0
- package/dist/evaluation/worker-records.d.ts +5 -0
- package/dist/evaluation/worker-records.d.ts.map +1 -0
- package/dist/evaluation/worker-records.js +11 -0
- package/dist/evaluation/worker-records.js.map +1 -0
- package/dist/evaluation/workflow.d.ts +3 -0
- package/dist/evaluation/workflow.d.ts.map +1 -0
- package/dist/evaluation/workflow.js +20 -0
- package/dist/evaluation/workflow.js.map +1 -0
- package/dist/execution-environment.d.ts +3 -0
- package/dist/execution-environment.d.ts.map +1 -0
- package/dist/execution-environment.js +9 -0
- package/dist/execution-environment.js.map +1 -0
- package/dist/extension-authoring.bundle.js +347 -0
- package/dist/extension-verifier.bundle.js +73 -0
- package/dist/extensions/authoring.d.ts.map +1 -1
- package/dist/extensions/authoring.js +70 -59
- package/dist/extensions/authoring.js.map +1 -1
- package/dist/extensions/discovery.d.ts.map +1 -1
- package/dist/extensions/discovery.js +12 -5
- package/dist/extensions/discovery.js.map +1 -1
- package/dist/extensions/shared/deliverable.d.ts +33 -0
- package/dist/extensions/shared/deliverable.d.ts.map +1 -0
- package/dist/extensions/shared/deliverable.js +123 -0
- package/dist/extensions/shared/deliverable.js.map +1 -0
- package/dist/extensions/shared/mailbox.d.ts +33 -0
- package/dist/extensions/shared/mailbox.d.ts.map +1 -0
- package/dist/extensions/shared/mailbox.js +102 -0
- package/dist/extensions/shared/mailbox.js.map +1 -0
- package/dist/extensions/shared/schemas.d.ts +90 -0
- package/dist/extensions/shared/schemas.d.ts.map +1 -0
- package/dist/extensions/shared/schemas.js +71 -0
- package/dist/extensions/shared/schemas.js.map +1 -0
- package/dist/extensions/shared/static-check.d.ts +38 -0
- package/dist/extensions/shared/static-check.d.ts.map +1 -0
- package/dist/extensions/shared/static-check.js +52 -0
- package/dist/extensions/shared/static-check.js.map +1 -0
- package/dist/extensions/verifier.d.ts +4 -0
- package/dist/extensions/verifier.d.ts.map +1 -0
- package/dist/extensions/verifier.js +70 -0
- package/dist/extensions/verifier.js.map +1 -0
- package/dist/github.d.ts +1 -1
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +3 -3
- package/dist/github.js.map +1 -1
- package/dist/harbor-environment.d.ts +13 -1
- package/dist/harbor-environment.d.ts.map +1 -1
- package/dist/harbor-environment.js +37 -4
- package/dist/harbor-environment.js.map +1 -1
- package/dist/harbor-results.d.ts +2 -0
- package/dist/harbor-results.d.ts.map +1 -1
- package/dist/harbor-results.js +2 -0
- package/dist/harbor-results.js.map +1 -1
- package/dist/harbor-task/compiler.d.ts +10 -0
- package/dist/harbor-task/compiler.d.ts.map +1 -0
- package/dist/harbor-task/compiler.js +174 -0
- package/dist/harbor-task/compiler.js.map +1 -0
- package/dist/harbor-task/constants.d.ts +3 -0
- package/dist/harbor-task/constants.d.ts.map +1 -0
- package/dist/harbor-task/constants.js +3 -0
- package/dist/harbor-task/constants.js.map +1 -0
- package/dist/harbor-task/dependencies.d.ts +3 -0
- package/dist/harbor-task/dependencies.d.ts.map +1 -0
- package/dist/harbor-task/dependencies.js +20 -0
- package/dist/harbor-task/dependencies.js.map +1 -0
- package/dist/harbor-task/paths.d.ts +6 -0
- package/dist/harbor-task/paths.d.ts.map +1 -0
- package/dist/harbor-task/paths.js +37 -0
- package/dist/harbor-task/paths.js.map +1 -0
- package/dist/harbor-task/render.d.ts +11 -0
- package/dist/harbor-task/render.d.ts.map +1 -0
- package/dist/harbor-task/render.js +194 -0
- package/dist/harbor-task/render.js.map +1 -0
- package/dist/harbor-task/runtime/command.sh +26 -0
- package/dist/harbor-task/runtime/junit.py +69 -0
- package/dist/harbor-task/runtime-assets.d.ts +2 -0
- package/dist/harbor-task/runtime-assets.d.ts.map +1 -0
- package/dist/harbor-task/runtime-assets.js +8 -0
- package/dist/harbor-task/runtime-assets.js.map +1 -0
- package/dist/harbor-task/test-patch.d.ts +4 -0
- package/dist/harbor-task/test-patch.d.ts.map +1 -0
- package/dist/harbor-task/test-patch.js +15 -0
- package/dist/harbor-task/test-patch.js.map +1 -0
- package/dist/harbor-task/verifier.d.ts +4 -0
- package/dist/harbor-task/verifier.d.ts.map +1 -0
- package/dist/harbor-task/verifier.js +105 -0
- package/dist/harbor-task/verifier.js.map +1 -0
- package/dist/harbor-task.d.ts +3 -11
- package/dist/harbor-task.d.ts.map +1 -1
- package/dist/harbor-task.js +2 -461
- package/dist/harbor-task.js.map +1 -1
- package/dist/log-excerpt.d.ts +15 -0
- package/dist/log-excerpt.d.ts.map +1 -0
- package/dist/log-excerpt.js +104 -0
- package/dist/log-excerpt.js.map +1 -0
- package/dist/patch-check.d.ts +26 -0
- package/dist/patch-check.d.ts.map +1 -0
- package/dist/patch-check.js +137 -0
- package/dist/patch-check.js.map +1 -0
- package/dist/pi-event-feed.d.ts +16 -0
- package/dist/pi-event-feed.d.ts.map +1 -0
- package/dist/pi-event-feed.js +86 -0
- package/dist/pi-event-feed.js.map +1 -0
- package/dist/pi-session.d.ts +32 -0
- package/dist/pi-session.d.ts.map +1 -0
- package/dist/pi-session.js +175 -0
- package/dist/pi-session.js.map +1 -0
- package/dist/process.d.ts +5 -0
- package/dist/process.d.ts.map +1 -1
- package/dist/process.js +31 -9
- package/dist/process.js.map +1 -1
- package/dist/project-paths.d.ts +2 -0
- package/dist/project-paths.d.ts.map +1 -0
- package/dist/project-paths.js +15 -0
- package/dist/project-paths.js.map +1 -0
- package/dist/provenance/github.d.ts +4 -0
- package/dist/provenance/github.d.ts.map +1 -0
- package/dist/provenance/github.js +65 -0
- package/dist/provenance/github.js.map +1 -0
- package/dist/provenance/local.d.ts +4 -0
- package/dist/provenance/local.d.ts.map +1 -0
- package/dist/provenance/local.js +82 -0
- package/dist/provenance/local.js.map +1 -0
- package/dist/provenance/redact.d.ts +2 -0
- package/dist/provenance/redact.d.ts.map +1 -0
- package/dist/provenance/redact.js +28 -0
- package/dist/provenance/redact.js.map +1 -0
- package/dist/provenance/selection.d.ts +4 -0
- package/dist/provenance/selection.d.ts.map +1 -0
- package/dist/provenance/selection.js +29 -0
- package/dist/provenance/selection.js.map +1 -0
- package/dist/provenance/session.d.ts +3 -0
- package/dist/provenance/session.d.ts.map +1 -0
- package/dist/provenance/session.js +214 -0
- package/dist/provenance/session.js.map +1 -0
- package/dist/provenance/shared.d.ts +7 -0
- package/dist/provenance/shared.d.ts.map +1 -0
- package/dist/provenance/shared.js +10 -0
- package/dist/provenance/shared.js.map +1 -0
- package/dist/provenance/types.d.ts +34 -0
- package/dist/provenance/types.d.ts.map +1 -0
- package/dist/provenance/types.js +22 -0
- package/dist/provenance/types.js.map +1 -0
- package/dist/provenance-associations/apply.d.ts +3 -0
- package/dist/provenance-associations/apply.d.ts.map +1 -0
- package/dist/provenance-associations/apply.js +66 -0
- package/dist/provenance-associations/apply.js.map +1 -0
- package/dist/provenance-associations/shared.d.ts +45 -0
- package/dist/provenance-associations/shared.d.ts.map +1 -0
- package/dist/provenance-associations/shared.js +42 -0
- package/dist/provenance-associations/shared.js.map +1 -0
- package/dist/provenance-associations.d.ts +22 -0
- package/dist/provenance-associations.d.ts.map +1 -0
- package/dist/provenance-associations.js +121 -0
- package/dist/provenance-associations.js.map +1 -0
- package/dist/provenance.d.ts +7 -20
- package/dist/provenance.d.ts.map +1 -1
- package/dist/provenance.js +6 -360
- package/dist/provenance.js.map +1 -1
- package/dist/providers.d.ts +25 -2
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +23 -2
- package/dist/providers.js.map +1 -1
- package/dist/repair.d.ts +1 -6
- package/dist/repair.d.ts.map +1 -1
- package/dist/repair.js +17 -27
- package/dist/repair.js.map +1 -1
- package/dist/review/assets/index-BHHztQ9x.js +1679 -0
- package/dist/review/assets/index-KQ1eFQ0t.css +1 -0
- package/dist/review/index.html +11 -8
- package/dist/runtime/command.sh +26 -0
- package/dist/runtime/junit.py +69 -0
- package/dist/sandbox/contracts.d.ts +76 -0
- package/dist/sandbox/contracts.d.ts.map +1 -0
- package/dist/sandbox/contracts.js +12 -0
- package/dist/sandbox/contracts.js.map +1 -0
- package/dist/sandbox/index.d.ts +5 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +27 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/live.d.ts +18 -0
- package/dist/sandbox/live.d.ts.map +1 -0
- package/dist/sandbox/live.js +55 -0
- package/dist/sandbox/live.js.map +1 -0
- package/dist/sandbox/output-retry.d.ts +16 -0
- package/dist/sandbox/output-retry.d.ts.map +1 -0
- package/dist/sandbox/output-retry.js +36 -0
- package/dist/sandbox/output-retry.js.map +1 -0
- package/dist/sandbox/programs/author.d.ts +3 -0
- package/dist/sandbox/programs/author.d.ts.map +1 -0
- package/dist/sandbox/programs/author.js +27 -0
- package/dist/sandbox/programs/author.js.map +1 -0
- package/dist/sandbox/programs/check.d.ts +3 -0
- package/dist/sandbox/programs/check.d.ts.map +1 -0
- package/dist/sandbox/programs/check.js +76 -0
- package/dist/sandbox/programs/check.js.map +1 -0
- package/dist/sandbox/programs/prepare-task.d.ts +12 -0
- package/dist/sandbox/programs/prepare-task.d.ts.map +1 -0
- package/dist/sandbox/programs/prepare-task.js +32 -0
- package/dist/sandbox/programs/prepare-task.js.map +1 -0
- package/dist/sandbox/programs/verifier.d.ts +3 -0
- package/dist/sandbox/programs/verifier.d.ts.map +1 -0
- package/dist/sandbox/programs/verifier.js +9 -0
- package/dist/sandbox/programs/verifier.js.map +1 -0
- package/dist/sandbox/providers/docker/executor.d.ts +14 -0
- package/dist/sandbox/providers/docker/executor.d.ts.map +1 -0
- package/dist/sandbox/providers/docker/executor.js +153 -0
- package/dist/sandbox/providers/docker/executor.js.map +1 -0
- package/dist/sandbox/providers/e2b/bytes.d.ts +3 -0
- package/dist/sandbox/providers/e2b/bytes.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/bytes.js +8 -0
- package/dist/sandbox/providers/e2b/bytes.js.map +1 -0
- package/dist/sandbox/providers/e2b/cleanup.d.ts +8 -0
- package/dist/sandbox/providers/e2b/cleanup.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/cleanup.js +124 -0
- package/dist/sandbox/providers/e2b/cleanup.js.map +1 -0
- package/dist/sandbox/providers/e2b/command.d.ts +23 -0
- package/dist/sandbox/providers/e2b/command.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/command.js +160 -0
- package/dist/sandbox/providers/e2b/command.js.map +1 -0
- package/dist/sandbox/providers/e2b/config.d.ts +13 -0
- package/dist/sandbox/providers/e2b/config.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/config.js +2 -0
- package/dist/sandbox/providers/e2b/config.js.map +1 -0
- package/dist/sandbox/providers/e2b/executor.d.ts +15 -0
- package/dist/sandbox/providers/e2b/executor.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/executor.js +207 -0
- package/dist/sandbox/providers/e2b/executor.js.map +1 -0
- package/dist/sandbox/providers/e2b/lifecycle.d.ts +8 -0
- package/dist/sandbox/providers/e2b/lifecycle.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/lifecycle.js +37 -0
- package/dist/sandbox/providers/e2b/lifecycle.js.map +1 -0
- package/dist/sandbox/providers/e2b/outcome.d.ts +11 -0
- package/dist/sandbox/providers/e2b/outcome.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/outcome.js +72 -0
- package/dist/sandbox/providers/e2b/outcome.js.map +1 -0
- package/dist/sandbox/providers/e2b/stage-files.d.ts +10 -0
- package/dist/sandbox/providers/e2b/stage-files.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/stage-files.js +45 -0
- package/dist/sandbox/providers/e2b/stage-files.js.map +1 -0
- package/dist/sandbox/providers/e2b/startup.d.ts +10 -0
- package/dist/sandbox/providers/e2b/startup.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/startup.js +26 -0
- package/dist/sandbox/providers/e2b/startup.js.map +1 -0
- package/dist/sandbox/providers/e2b/types.d.ts +9 -0
- package/dist/sandbox/providers/e2b/types.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/types.js +2 -0
- package/dist/sandbox/providers/e2b/types.js.map +1 -0
- package/dist/sandbox/providers/e2b/validation.d.ts +14 -0
- package/dist/sandbox/providers/e2b/validation.d.ts.map +1 -0
- package/dist/sandbox/providers/e2b/validation.js +60 -0
- package/dist/sandbox/providers/e2b/validation.js.map +1 -0
- package/dist/sandbox/providers/modal/auth.d.ts +2 -0
- package/dist/sandbox/providers/modal/auth.d.ts.map +1 -0
- package/dist/sandbox/providers/modal/auth.js +9 -0
- package/dist/sandbox/providers/modal/auth.js.map +1 -0
- package/dist/sandbox/providers/modal/executor.d.ts +15 -0
- package/dist/sandbox/providers/modal/executor.d.ts.map +1 -0
- package/dist/sandbox/providers/modal/executor.js +207 -0
- package/dist/sandbox/providers/modal/executor.js.map +1 -0
- package/dist/sandbox/providers/modal/live.d.ts +7 -0
- package/dist/sandbox/providers/modal/live.d.ts.map +1 -0
- package/dist/sandbox/providers/modal/live.js +50 -0
- package/dist/sandbox/providers/modal/live.js.map +1 -0
- package/dist/sandbox/providers/vercel/command.d.ts +20 -0
- package/dist/sandbox/providers/vercel/command.d.ts.map +1 -0
- package/dist/sandbox/providers/vercel/command.js +126 -0
- package/dist/sandbox/providers/vercel/command.js.map +1 -0
- package/dist/sandbox/providers/vercel/executor.d.ts +13 -0
- package/dist/sandbox/providers/vercel/executor.d.ts.map +1 -0
- package/dist/sandbox/providers/vercel/executor.js +190 -0
- package/dist/sandbox/providers/vercel/executor.js.map +1 -0
- package/dist/sandbox/providers/vercel/fetch.d.ts +6 -0
- package/dist/sandbox/providers/vercel/fetch.d.ts.map +1 -0
- package/dist/sandbox/providers/vercel/fetch.js +39 -0
- package/dist/sandbox/providers/vercel/fetch.js.map +1 -0
- package/dist/sandbox/providers/vercel/lifecycle.d.ts +13 -0
- package/dist/sandbox/providers/vercel/lifecycle.d.ts.map +1 -0
- package/dist/sandbox/providers/vercel/lifecycle.js +140 -0
- package/dist/sandbox/providers/vercel/lifecycle.js.map +1 -0
- package/dist/sandbox/providers/vercel/validation.d.ts +11 -0
- package/dist/sandbox/providers/vercel/validation.d.ts.map +1 -0
- package/dist/sandbox/providers/vercel/validation.js +30 -0
- package/dist/sandbox/providers/vercel/validation.js.map +1 -0
- package/dist/sandbox/remote-files.d.ts +11 -0
- package/dist/sandbox/remote-files.d.ts.map +1 -0
- package/dist/sandbox/remote-files.js +41 -0
- package/dist/sandbox/remote-files.js.map +1 -0
- package/dist/sandbox/request-validation.d.ts +5 -0
- package/dist/sandbox/request-validation.d.ts.map +1 -0
- package/dist/sandbox/request-validation.js +43 -0
- package/dist/sandbox/request-validation.js.map +1 -0
- package/dist/sandbox/supervisor.d.ts +42 -0
- package/dist/sandbox/supervisor.d.ts.map +1 -0
- package/dist/sandbox/supervisor.js +126 -0
- package/dist/sandbox/supervisor.js.map +1 -0
- package/dist/sandbox/timeout.d.ts +16 -0
- package/dist/sandbox/timeout.d.ts.map +1 -0
- package/dist/sandbox/timeout.js +53 -0
- package/dist/sandbox/timeout.js.map +1 -0
- package/dist/sandbox-author.bundle.js +48 -14877
- package/dist/sandbox-check.bundle.js +20155 -0
- package/dist/sandbox-verifier.bundle.js +307 -0
- package/dist/setup/e2b/build.d.ts +24 -0
- package/dist/setup/e2b/build.d.ts.map +1 -0
- package/dist/setup/e2b/build.js +46 -0
- package/dist/setup/e2b/build.js.map +1 -0
- package/dist/setup/e2b/cli.d.ts +2 -0
- package/dist/setup/e2b/cli.d.ts.map +1 -0
- package/dist/setup/e2b/cli.js +51 -0
- package/dist/setup/e2b/cli.js.map +1 -0
- package/dist/setup/e2b/index.d.ts +5 -0
- package/dist/setup/e2b/index.d.ts.map +1 -0
- package/dist/setup/e2b/index.js +4 -0
- package/dist/setup/e2b/index.js.map +1 -0
- package/dist/setup/e2b/template.d.ts +4 -0
- package/dist/setup/e2b/template.d.ts.map +1 -0
- package/dist/setup/e2b/template.js +53 -0
- package/dist/setup/e2b/template.js.map +1 -0
- package/dist/setup/vercel/cli-helpers.d.ts +22 -0
- package/dist/setup/vercel/cli-helpers.d.ts.map +1 -0
- package/dist/setup/vercel/cli-helpers.js +87 -0
- package/dist/setup/vercel/cli-helpers.js.map +1 -0
- package/dist/setup/vercel/cli-runner.d.ts +14 -0
- package/dist/setup/vercel/cli-runner.d.ts.map +1 -0
- package/dist/setup/vercel/cli-runner.js +24 -0
- package/dist/setup/vercel/cli-runner.js.map +1 -0
- package/dist/setup/vercel/cli-types.d.ts +24 -0
- package/dist/setup/vercel/cli-types.d.ts.map +1 -0
- package/dist/setup/vercel/cli-types.js +18 -0
- package/dist/setup/vercel/cli-types.js.map +1 -0
- package/dist/setup/vercel/cli.d.ts +38 -0
- package/dist/setup/vercel/cli.d.ts.map +1 -0
- package/dist/setup/vercel/cli.js +193 -0
- package/dist/setup/vercel/cli.js.map +1 -0
- package/dist/setup/vercel/index.d.ts +4 -0
- package/dist/setup/vercel/index.d.ts.map +1 -0
- package/dist/setup/vercel/index.js +3 -0
- package/dist/setup/vercel/index.js.map +1 -0
- package/dist/setup/vercel/probe.d.ts +49 -0
- package/dist/setup/vercel/probe.d.ts.map +1 -0
- package/dist/setup/vercel/probe.js +151 -0
- package/dist/setup/vercel/probe.js.map +1 -0
- package/dist/setup/vercel/profile-files.d.ts +6 -0
- package/dist/setup/vercel/profile-files.d.ts.map +1 -0
- package/dist/setup/vercel/profile-files.js +100 -0
- package/dist/setup/vercel/profile-files.js.map +1 -0
- package/dist/setup/vercel/profile-schema.d.ts +48 -0
- package/dist/setup/vercel/profile-schema.d.ts.map +1 -0
- package/dist/setup/vercel/profile-schema.js +39 -0
- package/dist/setup/vercel/profile-schema.js.map +1 -0
- package/dist/setup/vercel/profile.d.ts +18 -0
- package/dist/setup/vercel/profile.d.ts.map +1 -0
- package/dist/setup/vercel/profile.js +118 -0
- package/dist/setup/vercel/profile.js.map +1 -0
- package/dist/setup/vercel/runtime-image.d.ts +51 -0
- package/dist/setup/vercel/runtime-image.d.ts.map +1 -0
- package/dist/setup/vercel/runtime-image.js +123 -0
- package/dist/setup/vercel/runtime-image.js.map +1 -0
- package/dist/setup/vercel/selection.d.ts +18 -0
- package/dist/setup/vercel/selection.d.ts.map +1 -0
- package/dist/setup/vercel/selection.js +113 -0
- package/dist/setup/vercel/selection.js.map +1 -0
- package/dist/setup/vercel/setup-types.d.ts +34 -0
- package/dist/setup/vercel/setup-types.d.ts.map +1 -0
- package/dist/setup/vercel/setup-types.js +2 -0
- package/dist/setup/vercel/setup-types.js.map +1 -0
- package/dist/setup/vercel/setup.d.ts +17 -0
- package/dist/setup/vercel/setup.d.ts.map +1 -0
- package/dist/setup/vercel/setup.js +172 -0
- package/dist/setup/vercel/setup.js.map +1 -0
- package/dist/site/batch-activity.d.ts +5 -0
- package/dist/site/batch-activity.d.ts.map +1 -0
- package/dist/site/batch-activity.js +31 -0
- package/dist/site/batch-activity.js.map +1 -0
- package/dist/site/batch-progress.d.ts +16 -0
- package/dist/site/batch-progress.d.ts.map +1 -0
- package/dist/site/batch-progress.js +52 -0
- package/dist/site/batch-progress.js.map +1 -0
- package/dist/site/batch-routes.d.ts +30 -0
- package/dist/site/batch-routes.d.ts.map +1 -0
- package/dist/site/batch-routes.js +117 -0
- package/dist/site/batch-routes.js.map +1 -0
- package/dist/site/batch-start.d.ts +60 -0
- package/dist/site/batch-start.d.ts.map +1 -0
- package/dist/site/batch-start.js +39 -0
- package/dist/site/batch-start.js.map +1 -0
- package/dist/site/connected-repos.d.ts +25 -0
- package/dist/site/connected-repos.d.ts.map +1 -0
- package/dist/site/connected-repos.js +109 -0
- package/dist/site/connected-repos.js.map +1 -0
- package/dist/site/evaluation-start.d.ts +4 -0
- package/dist/site/evaluation-start.d.ts.map +1 -0
- package/dist/site/evaluation-start.js +19 -0
- package/dist/site/evaluation-start.js.map +1 -0
- package/dist/site/generation-config.d.ts +4 -0
- package/dist/site/generation-config.d.ts.map +1 -0
- package/dist/site/generation-config.js +16 -0
- package/dist/site/generation-config.js.map +1 -0
- package/dist/site/generation-credentials.d.ts +6 -0
- package/dist/site/generation-credentials.d.ts.map +1 -0
- package/dist/site/generation-credentials.js +101 -0
- package/dist/site/generation-credentials.js.map +1 -0
- package/dist/site/generation-run.d.ts +6 -0
- package/dist/site/generation-run.d.ts.map +1 -0
- package/dist/site/generation-run.js +22 -0
- package/dist/site/generation-run.js.map +1 -0
- package/dist/site/generation-settings.d.ts +80 -0
- package/dist/site/generation-settings.d.ts.map +1 -0
- package/dist/site/generation-settings.js +84 -0
- package/dist/site/generation-settings.js.map +1 -0
- package/dist/site/generation-subscription.d.ts +3 -0
- package/dist/site/generation-subscription.d.ts.map +1 -0
- package/dist/site/generation-subscription.js +38 -0
- package/dist/site/generation-subscription.js.map +1 -0
- package/dist/site/github-repos.d.ts +35 -0
- package/dist/site/github-repos.d.ts.map +1 -0
- package/dist/site/github-repos.js +121 -0
- package/dist/site/github-repos.js.map +1 -0
- package/dist/site/pr-candidate.d.ts +26 -0
- package/dist/site/pr-candidate.d.ts.map +1 -0
- package/dist/site/pr-candidate.js +101 -0
- package/dist/site/pr-candidate.js.map +1 -0
- package/dist/site/pr-list.d.ts +13 -0
- package/dist/site/pr-list.d.ts.map +1 -0
- package/dist/site/pr-list.js +24 -0
- package/dist/site/pr-list.js.map +1 -0
- package/dist/site/pr-routes.d.ts +26 -0
- package/dist/site/pr-routes.d.ts.map +1 -0
- package/dist/site/pr-routes.js +139 -0
- package/dist/site/pr-routes.js.map +1 -0
- package/dist/site/repo-store.d.ts +40 -0
- package/dist/site/repo-store.d.ts.map +1 -0
- package/dist/site/repo-store.js +74 -0
- package/dist/site/repo-store.js.map +1 -0
- package/dist/site/run-store.d.ts +17 -0
- package/dist/site/run-store.d.ts.map +1 -0
- package/dist/site/run-store.js +42 -0
- package/dist/site/run-store.js.map +1 -0
- package/dist/site/runtime.d.ts +27 -0
- package/dist/site/runtime.d.ts.map +1 -0
- package/dist/site/runtime.js +97 -0
- package/dist/site/runtime.js.map +1 -0
- package/dist/site/task-deletion.d.ts +7 -0
- package/dist/site/task-deletion.d.ts.map +1 -0
- package/dist/site/task-deletion.js +29 -0
- package/dist/site/task-deletion.js.map +1 -0
- package/dist/site/task-start-reservation.d.ts +4 -0
- package/dist/site/task-start-reservation.d.ts.map +1 -0
- package/dist/site/task-start-reservation.js +18 -0
- package/dist/site/task-start-reservation.js.map +1 -0
- package/dist/site/task-start.d.ts +33 -0
- package/dist/site/task-start.d.ts.map +1 -0
- package/dist/site/task-start.js +50 -0
- package/dist/site/task-start.js.map +1 -0
- package/dist/site/task-status.d.ts +36 -0
- package/dist/site/task-status.d.ts.map +1 -0
- package/dist/site/task-status.js +113 -0
- package/dist/site/task-status.js.map +1 -0
- package/dist/site/task-store.d.ts +78 -0
- package/dist/site/task-store.d.ts.map +1 -0
- package/dist/site/task-store.js +186 -0
- package/dist/site/task-store.js.map +1 -0
- package/dist/site/task-sync.d.ts +30 -0
- package/dist/site/task-sync.d.ts.map +1 -0
- package/dist/site/task-sync.js +121 -0
- package/dist/site/task-sync.js.map +1 -0
- package/dist/site/tasks.d.ts +47 -0
- package/dist/site/tasks.d.ts.map +1 -0
- package/dist/site/tasks.js +164 -0
- package/dist/site/tasks.js.map +1 -0
- package/dist/site/temporal-status.d.ts +8 -0
- package/dist/site/temporal-status.d.ts.map +1 -0
- package/dist/site/temporal-status.js +41 -0
- package/dist/site/temporal-status.js.map +1 -0
- package/dist/site/tenant.d.ts +4 -0
- package/dist/site/tenant.d.ts.map +1 -0
- package/dist/site/tenant.js +6 -0
- package/dist/site/tenant.js.map +1 -0
- package/dist/static-check.d.ts +38 -0
- package/dist/static-check.d.ts.map +1 -0
- package/dist/static-check.js +131 -0
- package/dist/static-check.js.map +1 -0
- package/dist/submission-hash.d.ts +18 -0
- package/dist/submission-hash.d.ts.map +1 -0
- package/dist/submission-hash.js +16 -0
- package/dist/submission-hash.js.map +1 -0
- package/dist/subscription-auth.d.ts +0 -7
- package/dist/subscription-auth.d.ts.map +1 -1
- package/dist/subscription-auth.js +3 -23
- package/dist/subscription-auth.js.map +1 -1
- package/dist/temporal/activities/agent-feed.d.ts +5 -0
- package/dist/temporal/activities/agent-feed.d.ts.map +1 -0
- package/dist/temporal/activities/agent-feed.js +41 -0
- package/dist/temporal/activities/agent-feed.js.map +1 -0
- package/dist/temporal/activities/agent-scripts.d.ts +16 -0
- package/dist/temporal/activities/agent-scripts.d.ts.map +1 -0
- package/dist/temporal/activities/agent-scripts.js +162 -0
- package/dist/temporal/activities/agent-scripts.js.map +1 -0
- package/dist/temporal/activities/authoring-round.d.ts +13 -0
- package/dist/temporal/activities/authoring-round.d.ts.map +1 -0
- package/dist/temporal/activities/authoring-round.js +160 -0
- package/dist/temporal/activities/authoring-round.js.map +1 -0
- package/dist/temporal/activities/constants.d.ts +5 -0
- package/dist/temporal/activities/constants.d.ts.map +1 -0
- package/dist/temporal/activities/constants.js +5 -0
- package/dist/temporal/activities/constants.js.map +1 -0
- package/dist/temporal/activities/discovery.d.ts +17 -0
- package/dist/temporal/activities/discovery.d.ts.map +1 -0
- package/dist/temporal/activities/discovery.js +153 -0
- package/dist/temporal/activities/discovery.js.map +1 -0
- package/dist/temporal/activities/drafts.d.ts +15 -0
- package/dist/temporal/activities/drafts.d.ts.map +1 -0
- package/dist/temporal/activities/drafts.js +51 -0
- package/dist/temporal/activities/drafts.js.map +1 -0
- package/dist/temporal/activities/excluded-source-prs.d.ts +9 -0
- package/dist/temporal/activities/excluded-source-prs.d.ts.map +1 -0
- package/dist/temporal/activities/excluded-source-prs.js +132 -0
- package/dist/temporal/activities/excluded-source-prs.js.map +1 -0
- package/dist/temporal/activities/export.d.ts +38 -0
- package/dist/temporal/activities/export.d.ts.map +1 -0
- package/dist/temporal/activities/export.js +79 -0
- package/dist/temporal/activities/export.js.map +1 -0
- package/dist/temporal/activities/factory.d.ts +5 -0
- package/dist/temporal/activities/factory.d.ts.map +1 -0
- package/dist/temporal/activities/factory.js +26 -0
- package/dist/temporal/activities/factory.js.map +1 -0
- package/dist/temporal/activities/gate-logs.d.ts +20 -0
- package/dist/temporal/activities/gate-logs.d.ts.map +1 -0
- package/dist/temporal/activities/gate-logs.js +62 -0
- package/dist/temporal/activities/gate-logs.js.map +1 -0
- package/dist/temporal/activities/generation-runtime.d.ts +6 -0
- package/dist/temporal/activities/generation-runtime.d.ts.map +1 -0
- package/dist/temporal/activities/generation-runtime.js +56 -0
- package/dist/temporal/activities/generation-runtime.js.map +1 -0
- package/dist/temporal/activities/harbor.d.ts +11 -0
- package/dist/temporal/activities/harbor.d.ts.map +1 -0
- package/dist/temporal/activities/harbor.js +112 -0
- package/dist/temporal/activities/harbor.js.map +1 -0
- package/dist/temporal/activities/modal-build-log.d.ts +12 -0
- package/dist/temporal/activities/modal-build-log.d.ts.map +1 -0
- package/dist/temporal/activities/modal-build-log.js +57 -0
- package/dist/temporal/activities/modal-build-log.js.map +1 -0
- package/dist/temporal/activities/prompts-authoring.d.ts +6 -0
- package/dist/temporal/activities/prompts-authoring.d.ts.map +1 -0
- package/dist/temporal/activities/prompts-authoring.js +87 -0
- package/dist/temporal/activities/prompts-authoring.js.map +1 -0
- package/dist/temporal/activities/prompts-verifier.d.ts +17 -0
- package/dist/temporal/activities/prompts-verifier.d.ts.map +1 -0
- package/dist/temporal/activities/prompts-verifier.js +66 -0
- package/dist/temporal/activities/prompts-verifier.js.map +1 -0
- package/dist/temporal/activities/provenance.d.ts +4 -0
- package/dist/temporal/activities/provenance.d.ts.map +1 -0
- package/dist/temporal/activities/provenance.js +18 -0
- package/dist/temporal/activities/provenance.js.map +1 -0
- package/dist/temporal/activities/replay.d.ts +20 -0
- package/dist/temporal/activities/replay.d.ts.map +1 -0
- package/dist/temporal/activities/replay.js +135 -0
- package/dist/temporal/activities/replay.js.map +1 -0
- package/dist/temporal/activities/round-outcome.d.ts +63 -0
- package/dist/temporal/activities/round-outcome.d.ts.map +1 -0
- package/dist/temporal/activities/round-outcome.js +127 -0
- package/dist/temporal/activities/round-outcome.js.map +1 -0
- package/dist/temporal/activities/runtime.d.ts +38 -0
- package/dist/temporal/activities/runtime.d.ts.map +1 -0
- package/dist/temporal/activities/runtime.js +146 -0
- package/dist/temporal/activities/runtime.js.map +1 -0
- package/dist/temporal/activities/session-verify.d.ts +45 -0
- package/dist/temporal/activities/session-verify.d.ts.map +1 -0
- package/dist/temporal/activities/session-verify.js +91 -0
- package/dist/temporal/activities/session-verify.js.map +1 -0
- package/dist/temporal/activities/submissions.d.ts +9 -0
- package/dist/temporal/activities/submissions.d.ts.map +1 -0
- package/dist/temporal/activities/submissions.js +28 -0
- package/dist/temporal/activities/submissions.js.map +1 -0
- package/dist/temporal/activities/task-compiler.d.ts +21 -0
- package/dist/temporal/activities/task-compiler.d.ts.map +1 -0
- package/dist/temporal/activities/task-compiler.js +63 -0
- package/dist/temporal/activities/task-compiler.js.map +1 -0
- package/dist/temporal/activities/types.d.ts +57 -0
- package/dist/temporal/activities/types.d.ts.map +1 -0
- package/dist/temporal/activities/types.js +2 -0
- package/dist/temporal/activities/types.js.map +1 -0
- package/dist/temporal/activities/verifier-material.d.ts +18 -0
- package/dist/temporal/activities/verifier-material.d.ts.map +1 -0
- package/dist/temporal/activities/verifier-material.js +49 -0
- package/dist/temporal/activities/verifier-material.js.map +1 -0
- package/dist/temporal/activities/verifier-outcome.d.ts +19 -0
- package/dist/temporal/activities/verifier-outcome.d.ts.map +1 -0
- package/dist/temporal/activities/verifier-outcome.js +70 -0
- package/dist/temporal/activities/verifier-outcome.js.map +1 -0
- package/dist/temporal/activities/verifier-round.d.ts +8 -0
- package/dist/temporal/activities/verifier-round.d.ts.map +1 -0
- package/dist/temporal/activities/verifier-round.js +110 -0
- package/dist/temporal/activities/verifier-round.js.map +1 -0
- package/dist/temporal/activities/verify-harbor.d.ts +15 -0
- package/dist/temporal/activities/verify-harbor.d.ts.map +1 -0
- package/dist/temporal/activities/verify-harbor.js +193 -0
- package/dist/temporal/activities/verify-harbor.js.map +1 -0
- package/dist/temporal/activities/verify.d.ts +11 -0
- package/dist/temporal/activities/verify.d.ts.map +1 -0
- package/dist/temporal/activities/verify.js +151 -0
- package/dist/temporal/activities/verify.js.map +1 -0
- package/dist/temporal/activities.d.ts +3 -39
- package/dist/temporal/activities.d.ts.map +1 -1
- package/dist/temporal/activities.js +2 -839
- package/dist/temporal/activities.js.map +1 -1
- package/dist/temporal/connection.d.ts.map +1 -1
- package/dist/temporal/connection.js +3 -2
- package/dist/temporal/connection.js.map +1 -1
- package/dist/temporal/worker-main.js +19 -3
- package/dist/temporal/worker-main.js.map +1 -1
- package/dist/temporal/workflow/activity-proxies.d.ts +3 -0
- package/dist/temporal/workflow/activity-proxies.d.ts.map +1 -0
- package/dist/temporal/workflow/activity-proxies.js +45 -0
- package/dist/temporal/workflow/activity-proxies.js.map +1 -0
- package/dist/temporal/workflow/authoring-stage.d.ts +5 -0
- package/dist/temporal/workflow/authoring-stage.d.ts.map +1 -0
- package/dist/temporal/workflow/authoring-stage.js +64 -0
- package/dist/temporal/workflow/authoring-stage.js.map +1 -0
- package/dist/temporal/workflow/candidate-tracker.d.ts +28 -0
- package/dist/temporal/workflow/candidate-tracker.d.ts.map +1 -0
- package/dist/temporal/workflow/candidate-tracker.js +85 -0
- package/dist/temporal/workflow/candidate-tracker.js.map +1 -0
- package/dist/temporal/workflow/candidate.d.ts +6 -0
- package/dist/temporal/workflow/candidate.d.ts.map +1 -0
- package/dist/temporal/workflow/candidate.js +54 -0
- package/dist/temporal/workflow/candidate.js.map +1 -0
- package/dist/temporal/workflow/discovery.d.ts +19 -0
- package/dist/temporal/workflow/discovery.d.ts.map +1 -0
- package/dist/temporal/workflow/discovery.js +137 -0
- package/dist/temporal/workflow/discovery.js.map +1 -0
- package/dist/temporal/workflow/failures.d.ts +5 -0
- package/dist/temporal/workflow/failures.d.ts.map +1 -0
- package/dist/temporal/workflow/failures.js +28 -0
- package/dist/temporal/workflow/failures.js.map +1 -0
- package/dist/temporal/workflow/run.d.ts +5 -0
- package/dist/temporal/workflow/run.d.ts.map +1 -0
- package/dist/temporal/workflow/run.js +154 -0
- package/dist/temporal/workflow/run.js.map +1 -0
- package/dist/temporal/workflow/stage.d.ts +26 -0
- package/dist/temporal/workflow/stage.d.ts.map +1 -0
- package/dist/temporal/workflow/stage.js +16 -0
- package/dist/temporal/workflow/stage.js.map +1 -0
- package/dist/temporal/workflow/verification-stage.d.ts +11 -0
- package/dist/temporal/workflow/verification-stage.d.ts.map +1 -0
- package/dist/temporal/workflow/verification-stage.js +20 -0
- package/dist/temporal/workflow/verification-stage.js.map +1 -0
- package/dist/temporal/workflow.d.ts +13 -5
- package/dist/temporal/workflow.d.ts.map +1 -1
- package/dist/temporal/workflow.js +38 -420
- package/dist/temporal/workflow.js.map +1 -1
- package/dist/verifier-fix.d.ts +20 -0
- package/dist/verifier-fix.d.ts.map +1 -0
- package/dist/verifier-fix.js +62 -0
- package/dist/verifier-fix.js.map +1 -0
- package/dist/verify-report.d.ts +9 -0
- package/dist/verify-report.d.ts.map +1 -0
- package/dist/verify-report.js +135 -0
- package/dist/verify-report.js.map +1 -0
- package/dist/viewer/archived-keys.d.ts +9 -0
- package/dist/viewer/archived-keys.d.ts.map +1 -0
- package/dist/viewer/archived-keys.js +36 -0
- package/dist/viewer/archived-keys.js.map +1 -0
- package/dist/viewer/archived.d.ts +20 -0
- package/dist/viewer/archived.d.ts.map +1 -0
- package/dist/viewer/archived.js +238 -0
- package/dist/viewer/archived.js.map +1 -0
- package/dist/viewer/artifacts.d.ts +8 -0
- package/dist/viewer/artifacts.d.ts.map +1 -0
- package/dist/viewer/artifacts.js +96 -0
- package/dist/viewer/artifacts.js.map +1 -0
- package/dist/viewer/bundle.d.ts +9 -0
- package/dist/viewer/bundle.d.ts.map +1 -0
- package/dist/viewer/bundle.js +79 -0
- package/dist/viewer/bundle.js.map +1 -0
- package/dist/viewer/candidates.d.ts +9 -0
- package/dist/viewer/candidates.d.ts.map +1 -0
- package/dist/viewer/candidates.js +137 -0
- package/dist/viewer/candidates.js.map +1 -0
- package/dist/viewer/local-server.d.ts +11 -0
- package/dist/viewer/local-server.d.ts.map +1 -0
- package/dist/viewer/local-server.js +64 -0
- package/dist/viewer/local-server.js.map +1 -0
- package/dist/viewer/task-files.d.ts +10 -0
- package/dist/viewer/task-files.d.ts.map +1 -0
- package/dist/viewer/task-files.js +120 -0
- package/dist/viewer/task-files.js.map +1 -0
- package/dist/viewer/types.d.ts +78 -0
- package/dist/viewer/types.d.ts.map +1 -0
- package/dist/viewer/types.js +36 -0
- package/dist/viewer/types.js.map +1 -0
- package/docs/api.md +168 -0
- package/docs/evaluations.md +42 -15
- package/docs/operations.md +292 -30
- package/docs/solver-evaluations.md +63 -0
- package/docs/task-construction.md +24 -12
- package/drizzle/0000_glossy_johnny_blaze.sql +97 -0
- package/drizzle/0001_evaluation_records.sql +5 -0
- package/drizzle/0002_task_deletion.sql +1 -0
- package/drizzle/0003_drop_repo_runs.sql +3 -0
- package/drizzle/0004_preserve_batch_runs.sql +8 -0
- package/drizzle/0005_api_keys.sql +15 -0
- package/drizzle/meta/0000_snapshot.json +776 -0
- package/drizzle/meta/0001_snapshot.json +807 -0
- package/drizzle/meta/0002_snapshot.json +813 -0
- package/drizzle/meta/0003_snapshot.json +726 -0
- package/drizzle/meta/0004_snapshot.json +813 -0
- package/drizzle/meta/0005_snapshot.json +919 -0
- package/drizzle/meta/_journal.json +48 -0
- package/package.json +43 -29
- package/src/extensions/authoring.ts +83 -72
- package/src/extensions/discovery.ts +14 -5
- package/src/extensions/shared/deliverable.ts +153 -0
- package/src/extensions/shared/mailbox.ts +128 -0
- package/src/extensions/shared/schemas.ts +101 -0
- package/src/extensions/shared/static-check.ts +103 -0
- package/src/extensions/verifier.ts +88 -0
- package/src/skills/selfbench/SKILL.md +71 -13
- package/biome.json +0 -18
- package/dist/agent-smoke-main.d.ts +0 -3
- package/dist/agent-smoke-main.d.ts.map +0 -1
- package/dist/agent-smoke-main.js +0 -55
- package/dist/agent-smoke-main.js.map +0 -1
- package/dist/agent-smoke.d.ts +0 -18
- package/dist/agent-smoke.d.ts.map +0 -1
- package/dist/agent-smoke.js +0 -103
- package/dist/agent-smoke.js.map +0 -1
- package/dist/codex-review.d.ts +0 -41
- package/dist/codex-review.d.ts.map +0 -1
- package/dist/codex-review.js +0 -193
- package/dist/codex-review.js.map +0 -1
- package/dist/docker-executor.d.ts +0 -11
- package/dist/docker-executor.d.ts.map +0 -1
- package/dist/docker-executor.js +0 -103
- package/dist/docker-executor.js.map +0 -1
- package/dist/eval-main.d.ts +0 -3
- package/dist/eval-main.d.ts.map +0 -1
- package/dist/eval-main.js +0 -81
- package/dist/eval-main.js.map +0 -1
- package/dist/evaluate.d.ts +0 -25
- package/dist/evaluate.d.ts.map +0 -1
- package/dist/evaluate.js +0 -214
- package/dist/evaluate.js.map +0 -1
- package/dist/modal-auth.d.ts +0 -2
- package/dist/modal-auth.d.ts.map +0 -1
- package/dist/modal-auth.js +0 -9
- package/dist/modal-auth.js.map +0 -1
- package/dist/modal-executor.d.ts +0 -12
- package/dist/modal-executor.d.ts.map +0 -1
- package/dist/modal-executor.js +0 -152
- package/dist/modal-executor.js.map +0 -1
- package/dist/reaudit-main.d.ts +0 -3
- package/dist/reaudit-main.d.ts.map +0 -1
- package/dist/reaudit-main.js +0 -158
- package/dist/reaudit-main.js.map +0 -1
- package/dist/repair-main.d.ts +0 -3
- package/dist/repair-main.d.ts.map +0 -1
- package/dist/repair-main.js +0 -171
- package/dist/repair-main.js.map +0 -1
- package/dist/review/assets/index-CZ3G759O.js +0 -1568
- package/dist/review/assets/index-DgSLzX8l.css +0 -1
- package/dist/sandbox-author.d.ts +0 -3
- package/dist/sandbox-author.d.ts.map +0 -1
- package/dist/sandbox-author.js +0 -17
- package/dist/sandbox-author.js.map +0 -1
- package/dist/sandbox-repair.bundle.js +0 -315
- package/dist/sandbox-repair.d.ts +0 -3
- package/dist/sandbox-repair.d.ts.map +0 -1
- package/dist/sandbox-repair.js +0 -121
- package/dist/sandbox-repair.js.map +0 -1
- package/dist/sandbox-review.bundle.js +0 -14462
- package/dist/sandbox-review.d.ts +0 -2
- package/dist/sandbox-review.d.ts.map +0 -1
- package/dist/sandbox-review.js +0 -18
- package/dist/sandbox-review.js.map +0 -1
- package/dist/sandbox-timeout.d.ts +0 -11
- package/dist/sandbox-timeout.d.ts.map +0 -1
- package/dist/sandbox-timeout.js +0 -41
- package/dist/sandbox-timeout.js.map +0 -1
- package/dist/sandbox-validation-repair.bundle.js +0 -14778
- package/dist/sandbox-validation-repair.d.ts +0 -3
- package/dist/sandbox-validation-repair.d.ts.map +0 -1
- package/dist/sandbox-validation-repair.js +0 -136
- package/dist/sandbox-validation-repair.js.map +0 -1
- package/dist/sandbox.d.ts +0 -39
- package/dist/sandbox.d.ts.map +0 -1
- package/dist/sandbox.js +0 -15
- package/dist/sandbox.js.map +0 -1
- package/dist/validate-main.d.ts +0 -3
- package/dist/validate-main.d.ts.map +0 -1
- package/dist/validate-main.js +0 -143
- package/dist/validate-main.js.map +0 -1
- package/dist/validation-repair.d.ts +0 -10
- package/dist/validation-repair.d.ts.map +0 -1
- package/dist/validation-repair.js +0 -72
- package/dist/validation-repair.js.map +0 -1
- package/dist/vercel-cli.d.ts +0 -64
- package/dist/vercel-cli.d.ts.map +0 -1
- package/dist/vercel-cli.js +0 -303
- package/dist/vercel-cli.js.map +0 -1
- package/dist/vercel-command.d.ts +0 -14
- package/dist/vercel-command.d.ts.map +0 -1
- package/dist/vercel-command.js +0 -93
- package/dist/vercel-command.js.map +0 -1
- package/dist/vercel-executor.d.ts +0 -14
- package/dist/vercel-executor.d.ts.map +0 -1
- package/dist/vercel-executor.js +0 -356
- package/dist/vercel-executor.js.map +0 -1
- package/dist/vercel-fetch.d.ts +0 -6
- package/dist/vercel-fetch.d.ts.map +0 -1
- package/dist/vercel-fetch.js +0 -39
- package/dist/vercel-fetch.js.map +0 -1
- package/dist/vercel-profile.d.ts +0 -34
- package/dist/vercel-profile.d.ts.map +0 -1
- package/dist/vercel-profile.js +0 -244
- package/dist/vercel-profile.js.map +0 -1
- package/dist/vercel-runtime-image.d.ts +0 -51
- package/dist/vercel-runtime-image.d.ts.map +0 -1
- package/dist/vercel-runtime-image.js +0 -123
- package/dist/vercel-runtime-image.js.map +0 -1
- package/dist/vercel-setup-probe.d.ts +0 -49
- package/dist/vercel-setup-probe.d.ts.map +0 -1
- package/dist/vercel-setup-probe.js +0 -151
- package/dist/vercel-setup-probe.js.map +0 -1
- package/dist/vercel-setup.d.ts +0 -42
- package/dist/vercel-setup.d.ts.map +0 -1
- package/dist/vercel-setup.js +0 -280
- package/dist/vercel-setup.js.map +0 -1
- package/review/index.html +0 -14
- package/review/src/App.tsx +0 -338
- package/review/src/export-loader.test.ts +0 -57
- package/review/src/export-loader.ts +0 -151
- package/review/src/main.tsx +0 -15
- package/review/src/styles.css +0 -162
- package/review/src/types.ts +0 -47
- package/review/tsconfig.json +0 -16
- package/review/vite.config.ts +0 -20
- package/scripts/verify-package.ts +0 -81
- package/scripts/write-build-metadata.ts +0 -27
- package/src/agent-smoke-main.ts +0 -64
- package/src/agent-smoke.ts +0 -138
- package/src/api-main.ts +0 -12
- package/src/api.ts +0 -290
- package/src/artifacts.ts +0 -357
- package/src/audit.ts +0 -106
- package/src/build-metadata.ts +0 -3
- package/src/cli.ts +0 -420
- package/src/codex-review.ts +0 -229
- package/src/config.ts +0 -239
- package/src/contracts.ts +0 -231
- package/src/coupling.ts +0 -259
- package/src/docker-executor.ts +0 -115
- package/src/eval-main.ts +0 -93
- package/src/evaluate.ts +0 -300
- package/src/github.ts +0 -26
- package/src/harbor-environment.ts +0 -17
- package/src/harbor-results.ts +0 -144
- package/src/harbor-task.ts +0 -528
- package/src/hash.ts +0 -5
- package/src/modal-auth.ts +0 -11
- package/src/modal-executor.ts +0 -176
- package/src/parallel.ts +0 -24
- package/src/process.ts +0 -167
- package/src/provenance.ts +0 -457
- package/src/providers.ts +0 -22
- package/src/reaudit-main.ts +0 -198
- package/src/repair-main.ts +0 -209
- package/src/repair.ts +0 -55
- package/src/run-wait.ts +0 -40
- package/src/sandbox-author.ts +0 -19
- package/src/sandbox-repair.ts +0 -156
- package/src/sandbox-review.ts +0 -19
- package/src/sandbox-timeout.ts +0 -56
- package/src/sandbox-validation-repair.ts +0 -177
- package/src/sandbox.ts +0 -61
- package/src/subscription-auth.ts +0 -80
- package/src/temporal/activities.ts +0 -1247
- package/src/temporal/connection.ts +0 -23
- package/src/temporal/worker-main.ts +0 -28
- package/src/temporal/workflow.ts +0 -519
- package/src/terminal-prompts.ts +0 -197
- package/src/terminal-reporter.ts +0 -126
- package/src/validate-main.ts +0 -177
- package/src/validation-repair.ts +0 -94
- package/src/vercel-cli.ts +0 -403
- package/src/vercel-command.ts +0 -127
- package/src/vercel-executor.ts +0 -448
- package/src/vercel-fetch.ts +0 -45
- package/src/vercel-profile.ts +0 -319
- package/src/vercel-runtime-image.ts +0 -204
- package/src/vercel-setup-probe.ts +0 -229
- package/src/vercel-setup.ts +0 -419
- package/tsconfig.build.json +0 -13
- package/tsconfig.json +0 -21
package/src/api.ts
DELETED
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import { timingSafeEqual } from "node:crypto";
|
|
2
|
-
import { readFile } from "node:fs/promises";
|
|
3
|
-
import { createServer, type IncomingMessage, type ServerResponse } from "node:http";
|
|
4
|
-
import { dirname, join } from "node:path";
|
|
5
|
-
import { pipeline } from "node:stream/promises";
|
|
6
|
-
import { fileURLToPath } from "node:url";
|
|
7
|
-
import { Client } from "@temporalio/client";
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
import { createArtifactStore } from "./artifacts.js";
|
|
10
|
-
import type { SelfBenchConfig } from "./config.js";
|
|
11
|
-
import {
|
|
12
|
-
artifactRefSchema,
|
|
13
|
-
type RunPhase,
|
|
14
|
-
type RunRequest,
|
|
15
|
-
type RunStatus,
|
|
16
|
-
repositoryRefSchema,
|
|
17
|
-
runRequestSchema,
|
|
18
|
-
} from "./contracts.js";
|
|
19
|
-
import { connectTemporalClient } from "./temporal/connection.js";
|
|
20
|
-
import { selfBenchRunWorkflow, statusQuery } from "./temporal/workflow.js";
|
|
21
|
-
|
|
22
|
-
const submissionSchema = z.object({
|
|
23
|
-
runId: z.string().regex(/^[a-z0-9][a-z0-9-]{2,62}$/),
|
|
24
|
-
repository: repositoryRefSchema,
|
|
25
|
-
provenance: artifactRefSchema,
|
|
26
|
-
candidateCounts: z.object({
|
|
27
|
-
easy: z.number().int().min(0).max(100),
|
|
28
|
-
medium: z.number().int().min(0).max(100),
|
|
29
|
-
hard: z.number().int().min(0).max(100),
|
|
30
|
-
}),
|
|
31
|
-
authoringModel: z.string().min(1).default("gpt-5.6-sol"),
|
|
32
|
-
selfbenchCommit: z.string().regex(/^[0-9a-f]{40}$/i),
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export async function startApi(config: SelfBenchConfig): Promise<() => Promise<void>> {
|
|
36
|
-
const connection = await connectTemporalClient(config.temporal);
|
|
37
|
-
const client = new Client({ connection, namespace: config.temporal.namespace });
|
|
38
|
-
const artifacts = createArtifactStore(config.artifact);
|
|
39
|
-
const server = createServer(async (request, response) => {
|
|
40
|
-
try {
|
|
41
|
-
const url = new URL(request.url ?? "/", `http://${request.headers.host ?? "localhost"}`);
|
|
42
|
-
if (request.method === "GET" && url.pathname === "/healthz") {
|
|
43
|
-
sendJson(response, 200, { ok: true });
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (
|
|
47
|
-
request.method === "GET" &&
|
|
48
|
-
(url.pathname === "/" || url.pathname.startsWith("/assets/"))
|
|
49
|
-
) {
|
|
50
|
-
await sendReviewAsset(response, url.pathname);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (!authorized(request, config.apiToken)) {
|
|
54
|
-
sendJson(response, 401, { error: "unauthorized" });
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
if (request.method === "POST" && url.pathname === "/v1/provenance") {
|
|
58
|
-
const runId = z
|
|
59
|
-
.string()
|
|
60
|
-
.regex(/^[a-z0-9][a-z0-9-]{2,62}$/)
|
|
61
|
-
.parse(url.searchParams.get("runId"));
|
|
62
|
-
const body = await readBody(request, 100 * 1024 * 1024);
|
|
63
|
-
const reference = await artifacts.put(
|
|
64
|
-
`runs/${runId}/input/provenance.jsonl`,
|
|
65
|
-
body,
|
|
66
|
-
"application/x-ndjson",
|
|
67
|
-
);
|
|
68
|
-
sendJson(response, 201, reference);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (request.method === "POST" && url.pathname === "/v1/runs") {
|
|
72
|
-
const workflowInput = buildRunRequest(
|
|
73
|
-
config,
|
|
74
|
-
JSON.parse((await readBody(request)).toString("utf8")),
|
|
75
|
-
);
|
|
76
|
-
await client.workflow.start(selfBenchRunWorkflow, {
|
|
77
|
-
workflowId: workflowInput.runId,
|
|
78
|
-
taskQueue: config.temporal.taskQueue,
|
|
79
|
-
args: [workflowInput],
|
|
80
|
-
workflowExecutionTimeout: "14 days",
|
|
81
|
-
});
|
|
82
|
-
sendJson(response, 202, { runId: workflowInput.runId });
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const runMatch = /^\/v1\/runs\/([a-z0-9][a-z0-9-]{2,62})(?:\/(cancel|export))?$/.exec(
|
|
86
|
-
url.pathname,
|
|
87
|
-
);
|
|
88
|
-
if (runMatch?.[1] && request.method === "GET" && runMatch[2] === "export") {
|
|
89
|
-
const status = await queryStatus(client.workflow.getHandle(runMatch[1]));
|
|
90
|
-
if (!("export" in status) || !status.export) {
|
|
91
|
-
sendJson(response, 409, { error: "run export is not ready" });
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const body = await artifacts.openRead(status.export);
|
|
95
|
-
response.writeHead(200, {
|
|
96
|
-
"content-type": status.export.contentType,
|
|
97
|
-
"content-length": status.export.sizeBytes,
|
|
98
|
-
"content-disposition": `attachment; filename="selfbench-${runMatch[1]}.tar.gz"`,
|
|
99
|
-
"x-content-sha256": status.export.sha256,
|
|
100
|
-
});
|
|
101
|
-
await pipeline(body, response);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (runMatch?.[1] && request.method === "GET" && !runMatch[2]) {
|
|
105
|
-
const handle = client.workflow.getHandle(runMatch[1]);
|
|
106
|
-
const status = await queryStatus(handle);
|
|
107
|
-
sendJson(response, 200, status);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
if (runMatch?.[1] && request.method === "POST" && runMatch[2] === "cancel") {
|
|
111
|
-
await client.workflow.getHandle(runMatch[1]).cancel();
|
|
112
|
-
sendJson(response, 202, { runId: runMatch[1], cancellationRequested: true });
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (request.method === "GET" && url.pathname === "/v1/runs") {
|
|
116
|
-
const runs: unknown[] = [];
|
|
117
|
-
for await (const execution of client.workflow.list({
|
|
118
|
-
query: "WorkflowType = 'selfBenchRunWorkflow'",
|
|
119
|
-
})) {
|
|
120
|
-
runs.push({
|
|
121
|
-
runId: execution.workflowId,
|
|
122
|
-
status: execution.status.name,
|
|
123
|
-
startedAt: execution.startTime.toISOString(),
|
|
124
|
-
closedAt: execution.closeTime?.toISOString(),
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
sendJson(response, 200, runs);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
sendJson(response, 404, { error: "not found" });
|
|
131
|
-
} catch (error) {
|
|
132
|
-
if (response.headersSent) {
|
|
133
|
-
response.destroy(error instanceof Error ? error : new Error(String(error)));
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
137
|
-
sendJson(response, error instanceof z.ZodError || error instanceof SyntaxError ? 400 : 500, {
|
|
138
|
-
error: message,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
await new Promise<void>((resolve, reject) => {
|
|
144
|
-
server.once("error", reject);
|
|
145
|
-
server.listen(config.apiPort, config.apiHost, resolve);
|
|
146
|
-
});
|
|
147
|
-
return async () => {
|
|
148
|
-
await new Promise<void>((resolve, reject) =>
|
|
149
|
-
server.close((error) => (error ? reject(error) : resolve())),
|
|
150
|
-
);
|
|
151
|
-
await connection.close();
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export function buildRunRequest(
|
|
156
|
-
config: SelfBenchConfig,
|
|
157
|
-
submission: z.input<typeof submissionSchema>,
|
|
158
|
-
): RunRequest {
|
|
159
|
-
const parsed = submissionSchema.parse(submission);
|
|
160
|
-
return runRequestSchema.parse({
|
|
161
|
-
runId: parsed.runId,
|
|
162
|
-
repository: parsed.repository,
|
|
163
|
-
provenance: parsed.provenance,
|
|
164
|
-
candidateCounts: parsed.candidateCounts,
|
|
165
|
-
authoring: {
|
|
166
|
-
provider: "openai-codex",
|
|
167
|
-
model: parsed.authoringModel,
|
|
168
|
-
reasoningEffort: "high",
|
|
169
|
-
},
|
|
170
|
-
version: {
|
|
171
|
-
selfbenchCommit: config.buildCommit ?? parsed.selfbenchCommit,
|
|
172
|
-
executionBackend: config.execution.kind,
|
|
173
|
-
harborEnvironment: config.harborEnvironment,
|
|
174
|
-
sandboxImage: config.execution.image,
|
|
175
|
-
...(config.execution.kind === "vercel"
|
|
176
|
-
? { sandboxTimeoutCapMs: config.execution.timeoutCapMs }
|
|
177
|
-
: {}),
|
|
178
|
-
schema: 1,
|
|
179
|
-
},
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
async function queryStatus(
|
|
184
|
-
handle: ReturnType<Client["workflow"]["getHandle"]>,
|
|
185
|
-
): Promise<RunStatus | object> {
|
|
186
|
-
try {
|
|
187
|
-
const [status, description] = await Promise.all([handle.query(statusQuery), handle.describe()]);
|
|
188
|
-
if (description.status.name === "RUNNING" || terminalRunPhase(status.phase)) {
|
|
189
|
-
return status;
|
|
190
|
-
}
|
|
191
|
-
const phase = executionPhase(description.status.name);
|
|
192
|
-
return {
|
|
193
|
-
...status,
|
|
194
|
-
phase,
|
|
195
|
-
...(phase === "failed" && !status.error
|
|
196
|
-
? { error: `Temporal workflow ${description.status.name.toLowerCase()}` }
|
|
197
|
-
: {}),
|
|
198
|
-
};
|
|
199
|
-
} catch {
|
|
200
|
-
const description = await handle.describe();
|
|
201
|
-
return {
|
|
202
|
-
runId: description.workflowId,
|
|
203
|
-
phase: executionPhase(description.status.name),
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function terminalRunPhase(phase: RunPhase): boolean {
|
|
209
|
-
return ["complete", "blocked", "failed", "cancelled"].includes(phase);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function executionPhase(status: string): RunPhase {
|
|
213
|
-
switch (status) {
|
|
214
|
-
case "COMPLETED":
|
|
215
|
-
return "complete";
|
|
216
|
-
case "CANCELED":
|
|
217
|
-
return "cancelled";
|
|
218
|
-
case "RUNNING":
|
|
219
|
-
return "queued";
|
|
220
|
-
default:
|
|
221
|
-
return "failed";
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
async function readBody(request: IncomingMessage, limit = 10 * 1024 * 1024): Promise<Buffer> {
|
|
226
|
-
const chunks: Buffer[] = [];
|
|
227
|
-
let size = 0;
|
|
228
|
-
for await (const chunk of request) {
|
|
229
|
-
const value = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
230
|
-
size += value.byteLength;
|
|
231
|
-
if (size > limit) {
|
|
232
|
-
throw new Error(`request body exceeds ${limit} bytes`);
|
|
233
|
-
}
|
|
234
|
-
chunks.push(value);
|
|
235
|
-
}
|
|
236
|
-
return Buffer.concat(chunks);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function authorized(request: IncomingMessage, token: string | undefined): boolean {
|
|
240
|
-
if (!token) {
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
|
-
const supplied = request.headers.authorization?.replace(/^Bearer\s+/i, "");
|
|
244
|
-
if (!supplied) {
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
const expectedBuffer = Buffer.from(token);
|
|
248
|
-
const suppliedBuffer = Buffer.from(supplied);
|
|
249
|
-
return (
|
|
250
|
-
expectedBuffer.length === suppliedBuffer.length &&
|
|
251
|
-
timingSafeEqual(expectedBuffer, suppliedBuffer)
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
async function sendReviewAsset(response: ServerResponse, pathname: string): Promise<void> {
|
|
256
|
-
const relativePath = pathname === "/" ? "index.html" : pathname.slice(1);
|
|
257
|
-
const root = join(dirname(fileURLToPath(import.meta.url)), "review");
|
|
258
|
-
const path = join(root, relativePath);
|
|
259
|
-
if (!path.startsWith(`${root}/`)) {
|
|
260
|
-
sendJson(response, 400, { error: "invalid asset path" });
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
try {
|
|
264
|
-
const body = await readFile(path);
|
|
265
|
-
response.writeHead(200, {
|
|
266
|
-
"content-type": contentType(path),
|
|
267
|
-
"content-length": body.byteLength,
|
|
268
|
-
"cache-control": pathname === "/" ? "no-cache" : "public, max-age=31536000, immutable",
|
|
269
|
-
});
|
|
270
|
-
response.end(body);
|
|
271
|
-
} catch {
|
|
272
|
-
sendJson(response, 404, { error: "asset not found" });
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
function contentType(path: string): string {
|
|
277
|
-
if (path.endsWith(".html")) return "text/html; charset=utf-8";
|
|
278
|
-
if (path.endsWith(".css")) return "text/css; charset=utf-8";
|
|
279
|
-
if (path.endsWith(".js")) return "text/javascript; charset=utf-8";
|
|
280
|
-
return "application/octet-stream";
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
function sendJson(response: ServerResponse, status: number, value: unknown): void {
|
|
284
|
-
const body = `${JSON.stringify(value, null, 2)}\n`;
|
|
285
|
-
response.writeHead(status, {
|
|
286
|
-
"content-type": "application/json; charset=utf-8",
|
|
287
|
-
"content-length": Buffer.byteLength(body),
|
|
288
|
-
});
|
|
289
|
-
response.end(body);
|
|
290
|
-
}
|
package/src/artifacts.ts
DELETED
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
-
import { createReadStream, createWriteStream } from "node:fs";
|
|
3
|
-
import { link, mkdir, mkdtemp, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import { dirname, join, resolve, sep } from "node:path";
|
|
6
|
-
import { Readable, Transform } from "node:stream";
|
|
7
|
-
import { pipeline } from "node:stream/promises";
|
|
8
|
-
import { Storage } from "@google-cloud/storage";
|
|
9
|
-
import type { SelfBenchConfig } from "./config.js";
|
|
10
|
-
import type { ArtifactRef } from "./contracts.js";
|
|
11
|
-
import { sha256 } from "./hash.js";
|
|
12
|
-
|
|
13
|
-
export interface ArtifactStore {
|
|
14
|
-
put(key: string, value: Uint8Array, contentType: string): Promise<ArtifactRef>;
|
|
15
|
-
putFile(key: string, sourcePath: string, contentType: string): Promise<ArtifactRef>;
|
|
16
|
-
get(reference: ArtifactRef): Promise<Uint8Array>;
|
|
17
|
-
openRead(reference: ArtifactRef): Promise<Readable>;
|
|
18
|
-
getByKey(key: string): Promise<Uint8Array | undefined>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function createArtifactStore(config: SelfBenchConfig["artifact"]): ArtifactStore {
|
|
22
|
-
return config.kind === "gcs"
|
|
23
|
-
? new GcsArtifactStore(config.bucket, config.prefix)
|
|
24
|
-
: new LocalArtifactStore(config.directory);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export class LocalArtifactStore implements ArtifactStore {
|
|
28
|
-
readonly #root: string;
|
|
29
|
-
|
|
30
|
-
constructor(root: string) {
|
|
31
|
-
this.#root = resolve(root);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async put(key: string, value: Uint8Array, contentType: string): Promise<ArtifactRef> {
|
|
35
|
-
const path = this.#pathFor(key);
|
|
36
|
-
await mkdir(dirname(path), { recursive: true });
|
|
37
|
-
const digest = sha256(value);
|
|
38
|
-
try {
|
|
39
|
-
await writeFile(path, value, { flag: "wx" });
|
|
40
|
-
} catch (error) {
|
|
41
|
-
const existing = await fileDigest(path).catch(() => undefined);
|
|
42
|
-
if (!existing || existing.sha256 !== digest || existing.sizeBytes !== value.byteLength) {
|
|
43
|
-
throw error;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
uri: `file://${path}`,
|
|
48
|
-
sha256: digest,
|
|
49
|
-
sizeBytes: value.byteLength,
|
|
50
|
-
contentType,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async putFile(key: string, sourcePath: string, contentType: string): Promise<ArtifactRef> {
|
|
55
|
-
const path = this.#pathFor(key);
|
|
56
|
-
await mkdir(dirname(path), { recursive: true });
|
|
57
|
-
const temporaryPath = `${path}.${randomUUID()}.tmp`;
|
|
58
|
-
try {
|
|
59
|
-
const digest = await copyWithDigest(sourcePath, temporaryPath);
|
|
60
|
-
try {
|
|
61
|
-
await link(temporaryPath, path);
|
|
62
|
-
} catch (error) {
|
|
63
|
-
if (!hasCode(error, "EEXIST")) {
|
|
64
|
-
throw error;
|
|
65
|
-
}
|
|
66
|
-
const existing = await fileDigest(path).catch(() => undefined);
|
|
67
|
-
if (
|
|
68
|
-
!existing ||
|
|
69
|
-
existing.sha256 !== digest.sha256 ||
|
|
70
|
-
existing.sizeBytes !== digest.sizeBytes
|
|
71
|
-
) {
|
|
72
|
-
throw new Error(`artifact already exists with different contents: file://${path}`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
uri: `file://${path}`,
|
|
77
|
-
...digest,
|
|
78
|
-
contentType,
|
|
79
|
-
};
|
|
80
|
-
} finally {
|
|
81
|
-
await rm(temporaryPath, { force: true });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
async get(reference: ArtifactRef): Promise<Uint8Array> {
|
|
86
|
-
const url = new URL(reference.uri);
|
|
87
|
-
if (url.protocol !== "file:") {
|
|
88
|
-
throw new Error(`local artifact store cannot read ${reference.uri}`);
|
|
89
|
-
}
|
|
90
|
-
const path = resolve(decodeURIComponent(url.pathname));
|
|
91
|
-
this.#assertInsideRoot(path);
|
|
92
|
-
const value = await readFile(path);
|
|
93
|
-
verifyArtifact(reference, value);
|
|
94
|
-
return value;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async openRead(reference: ArtifactRef): Promise<Readable> {
|
|
98
|
-
const path = this.#pathForReference(reference);
|
|
99
|
-
if ((await stat(path)).size !== reference.sizeBytes) {
|
|
100
|
-
throw new Error(`artifact integrity check failed: ${reference.uri}`);
|
|
101
|
-
}
|
|
102
|
-
return verifiedArtifactReadStream(reference, createReadStream(path));
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
async getByKey(key: string): Promise<Uint8Array | undefined> {
|
|
106
|
-
try {
|
|
107
|
-
return await readFile(this.#pathFor(key));
|
|
108
|
-
} catch (error) {
|
|
109
|
-
if (isNotFound(error)) {
|
|
110
|
-
return undefined;
|
|
111
|
-
}
|
|
112
|
-
throw error;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
#pathForReference(reference: ArtifactRef): string {
|
|
117
|
-
const url = new URL(reference.uri);
|
|
118
|
-
if (url.protocol !== "file:") {
|
|
119
|
-
throw new Error(`local artifact store cannot read ${reference.uri}`);
|
|
120
|
-
}
|
|
121
|
-
const path = resolve(decodeURIComponent(url.pathname));
|
|
122
|
-
this.#assertInsideRoot(path);
|
|
123
|
-
return path;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
#pathFor(key: string): string {
|
|
127
|
-
if (!key || key.startsWith("/") || key.split("/").some((part) => part === "..")) {
|
|
128
|
-
throw new Error(`unsafe artifact key: ${key}`);
|
|
129
|
-
}
|
|
130
|
-
const path = resolve(this.#root, key);
|
|
131
|
-
this.#assertInsideRoot(path);
|
|
132
|
-
return path;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
#assertInsideRoot(path: string): void {
|
|
136
|
-
if (path !== this.#root && !path.startsWith(`${this.#root}${sep}`)) {
|
|
137
|
-
throw new Error(`artifact path escapes root: ${path}`);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export class GcsArtifactStore implements ArtifactStore {
|
|
143
|
-
readonly #storage = new Storage();
|
|
144
|
-
readonly #bucket: string;
|
|
145
|
-
readonly #prefix: string;
|
|
146
|
-
|
|
147
|
-
constructor(bucket: string, prefix: string) {
|
|
148
|
-
this.#bucket = bucket;
|
|
149
|
-
this.#prefix = prefix.replace(/^\/+|\/+$/g, "");
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
async put(key: string, value: Uint8Array, contentType: string): Promise<ArtifactRef> {
|
|
153
|
-
const object = this.#objectFor(key);
|
|
154
|
-
const digest = sha256(value);
|
|
155
|
-
const file = this.#storage.bucket(this.#bucket).file(object);
|
|
156
|
-
try {
|
|
157
|
-
await file.save(value, {
|
|
158
|
-
resumable: false,
|
|
159
|
-
preconditionOpts: { ifGenerationMatch: 0 },
|
|
160
|
-
metadata: {
|
|
161
|
-
contentType,
|
|
162
|
-
metadata: { sha256: digest },
|
|
163
|
-
},
|
|
164
|
-
});
|
|
165
|
-
} catch (error) {
|
|
166
|
-
const [exists] = await file.exists();
|
|
167
|
-
if (!exists) {
|
|
168
|
-
throw error;
|
|
169
|
-
}
|
|
170
|
-
const [metadata] = await file.getMetadata();
|
|
171
|
-
if (metadata.metadata?.sha256 !== digest) {
|
|
172
|
-
throw new Error(
|
|
173
|
-
`artifact already exists with different contents: gs://${this.#bucket}/${object}`,
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return {
|
|
178
|
-
uri: `gs://${this.#bucket}/${object}`,
|
|
179
|
-
sha256: digest,
|
|
180
|
-
sizeBytes: value.byteLength,
|
|
181
|
-
contentType,
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
async putFile(key: string, sourcePath: string, contentType: string): Promise<ArtifactRef> {
|
|
186
|
-
const object = this.#objectFor(key);
|
|
187
|
-
const bucket = this.#storage.bucket(this.#bucket);
|
|
188
|
-
const file = bucket.file(object);
|
|
189
|
-
const snapshotDirectory = await mkdtemp(join(tmpdir(), "selfbench-artifact-"));
|
|
190
|
-
const snapshotPath = join(snapshotDirectory, "upload");
|
|
191
|
-
try {
|
|
192
|
-
const digest = await copyWithDigest(sourcePath, snapshotPath);
|
|
193
|
-
try {
|
|
194
|
-
await bucket.upload(snapshotPath, {
|
|
195
|
-
destination: object,
|
|
196
|
-
resumable: true,
|
|
197
|
-
preconditionOpts: { ifGenerationMatch: 0 },
|
|
198
|
-
metadata: {
|
|
199
|
-
contentType,
|
|
200
|
-
metadata: { sha256: digest.sha256 },
|
|
201
|
-
},
|
|
202
|
-
});
|
|
203
|
-
} catch (error) {
|
|
204
|
-
const [exists] = await file.exists();
|
|
205
|
-
if (!exists) {
|
|
206
|
-
throw error;
|
|
207
|
-
}
|
|
208
|
-
const [metadata] = await file.getMetadata();
|
|
209
|
-
if (
|
|
210
|
-
metadata.metadata?.sha256 !== digest.sha256 ||
|
|
211
|
-
Number(metadata.size) !== digest.sizeBytes
|
|
212
|
-
) {
|
|
213
|
-
throw new Error(
|
|
214
|
-
`artifact already exists with different contents: gs://${this.#bucket}/${object}`,
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
return {
|
|
219
|
-
uri: `gs://${this.#bucket}/${object}`,
|
|
220
|
-
...digest,
|
|
221
|
-
contentType,
|
|
222
|
-
};
|
|
223
|
-
} finally {
|
|
224
|
-
await rm(snapshotDirectory, { recursive: true, force: true });
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
async get(reference: ArtifactRef): Promise<Uint8Array> {
|
|
229
|
-
const match = /^gs:\/\/([^/]+)\/(.+)$/.exec(reference.uri);
|
|
230
|
-
if (!match) {
|
|
231
|
-
throw new Error(`GCS artifact store cannot read ${reference.uri}`);
|
|
232
|
-
}
|
|
233
|
-
const [, bucket, object] = match;
|
|
234
|
-
if (bucket !== this.#bucket || !object) {
|
|
235
|
-
throw new Error(`artifact is outside configured bucket: ${reference.uri}`);
|
|
236
|
-
}
|
|
237
|
-
if (this.#prefix && object !== this.#prefix && !object.startsWith(`${this.#prefix}/`)) {
|
|
238
|
-
throw new Error(`artifact is outside configured bucket: ${reference.uri}`);
|
|
239
|
-
}
|
|
240
|
-
const [value] = await this.#storage.bucket(bucket).file(object).download();
|
|
241
|
-
verifyArtifact(reference, value);
|
|
242
|
-
return value;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
async openRead(reference: ArtifactRef): Promise<Readable> {
|
|
246
|
-
const file = this.#fileForReference(reference);
|
|
247
|
-
const [metadata] = await file.getMetadata();
|
|
248
|
-
if (
|
|
249
|
-
Number(metadata.size) !== reference.sizeBytes ||
|
|
250
|
-
metadata.metadata?.sha256 !== reference.sha256
|
|
251
|
-
) {
|
|
252
|
-
throw new Error(`artifact integrity check failed: ${reference.uri}`);
|
|
253
|
-
}
|
|
254
|
-
return verifiedArtifactReadStream(reference, file.createReadStream());
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
async getByKey(key: string): Promise<Uint8Array | undefined> {
|
|
258
|
-
const file = this.#storage.bucket(this.#bucket).file(this.#objectFor(key));
|
|
259
|
-
const [exists] = await file.exists();
|
|
260
|
-
if (!exists) {
|
|
261
|
-
return undefined;
|
|
262
|
-
}
|
|
263
|
-
const [value] = await file.download();
|
|
264
|
-
return value;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
#fileForReference(reference: ArtifactRef) {
|
|
268
|
-
const match = /^gs:\/\/([^/]+)\/(.+)$/.exec(reference.uri);
|
|
269
|
-
if (!match) {
|
|
270
|
-
throw new Error(`GCS artifact store cannot read ${reference.uri}`);
|
|
271
|
-
}
|
|
272
|
-
const [, bucket, object] = match;
|
|
273
|
-
if (bucket !== this.#bucket || !object) {
|
|
274
|
-
throw new Error(`artifact is outside configured bucket: ${reference.uri}`);
|
|
275
|
-
}
|
|
276
|
-
if (this.#prefix && object !== this.#prefix && !object.startsWith(`${this.#prefix}/`)) {
|
|
277
|
-
throw new Error(`artifact is outside configured bucket: ${reference.uri}`);
|
|
278
|
-
}
|
|
279
|
-
return this.#storage.bucket(bucket).file(object);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
#objectFor(key: string): string {
|
|
283
|
-
if (!key || key.startsWith("/") || key.split("/").some((part) => part === "..")) {
|
|
284
|
-
throw new Error(`unsafe artifact key: ${key}`);
|
|
285
|
-
}
|
|
286
|
-
return this.#prefix ? `${this.#prefix}/${key}` : key;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
export function verifiedArtifactReadStream(reference: ArtifactRef, input: Readable): Readable {
|
|
291
|
-
return Readable.from(
|
|
292
|
-
(async function* () {
|
|
293
|
-
const hash = createHash("sha256");
|
|
294
|
-
let sizeBytes = 0;
|
|
295
|
-
for await (const chunk of input) {
|
|
296
|
-
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
297
|
-
hash.update(bytes);
|
|
298
|
-
sizeBytes += bytes.byteLength;
|
|
299
|
-
yield bytes;
|
|
300
|
-
}
|
|
301
|
-
if (sizeBytes !== reference.sizeBytes || hash.digest("hex") !== reference.sha256) {
|
|
302
|
-
throw new Error(`artifact integrity check failed: ${reference.uri}`);
|
|
303
|
-
}
|
|
304
|
-
})(),
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
async function copyWithDigest(
|
|
309
|
-
sourcePath: string,
|
|
310
|
-
destinationPath: string,
|
|
311
|
-
): Promise<{ sha256: string; sizeBytes: number }> {
|
|
312
|
-
const hash = createHash("sha256");
|
|
313
|
-
let sizeBytes = 0;
|
|
314
|
-
const hasher = new Transform({
|
|
315
|
-
transform(chunk: Buffer, _encoding, callback) {
|
|
316
|
-
hash.update(chunk);
|
|
317
|
-
sizeBytes += chunk.byteLength;
|
|
318
|
-
callback(undefined, chunk);
|
|
319
|
-
},
|
|
320
|
-
});
|
|
321
|
-
await pipeline(
|
|
322
|
-
createReadStream(sourcePath),
|
|
323
|
-
hasher,
|
|
324
|
-
createWriteStream(destinationPath, { flags: "wx" }),
|
|
325
|
-
);
|
|
326
|
-
return { sha256: hash.digest("hex"), sizeBytes };
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
async function fileDigest(path: string): Promise<{ sha256: string; sizeBytes: number }> {
|
|
330
|
-
const hash = createHash("sha256");
|
|
331
|
-
let sizeBytes = 0;
|
|
332
|
-
for await (const chunk of createReadStream(path)) {
|
|
333
|
-
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
334
|
-
hash.update(bytes);
|
|
335
|
-
sizeBytes += bytes.byteLength;
|
|
336
|
-
}
|
|
337
|
-
return { sha256: hash.digest("hex"), sizeBytes };
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function hasCode(error: unknown, code: string): boolean {
|
|
341
|
-
return (
|
|
342
|
-
typeof error === "object" &&
|
|
343
|
-
error !== null &&
|
|
344
|
-
"code" in error &&
|
|
345
|
-
(error as { code?: unknown }).code === code
|
|
346
|
-
);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
function isNotFound(error: unknown): boolean {
|
|
350
|
-
return hasCode(error, "ENOENT");
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
function verifyArtifact(reference: ArtifactRef, value: Uint8Array): void {
|
|
354
|
-
if (value.byteLength !== reference.sizeBytes || sha256(value) !== reference.sha256) {
|
|
355
|
-
throw new Error(`artifact integrity check failed: ${reference.uri}`);
|
|
356
|
-
}
|
|
357
|
-
}
|