deepline 0.3.460 → 0.3.462
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/client-core.ts +7593 -0
- package/dist/bundling-sources/sdk/src/client.ts +8 -7366
- package/dist/bundling-sources/sdk/src/http-core.ts +1239 -0
- package/dist/bundling-sources/sdk/src/http.ts +6 -1231
- package/dist/bundling-sources/sdk/src/index.ts +4 -1
- package/dist/bundling-sources/sdk/src/play.ts +5 -5
- package/dist/bundling-sources/sdk/src/plays/client-core.ts +437 -0
- package/dist/bundling-sources/sdk/src/plays/client.ts +4 -421
- package/dist/bundling-sources/sdk/src/plays/input-example.ts +3 -4
- package/dist/bundling-sources/sdk/src/plays/play-description.ts +1 -1
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/server.ts +43 -0
- package/dist/bundling-sources/sdk/src/types.ts +15 -5
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +15 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/state.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/callback-security.ts +0 -307
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +3 -0
- package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +3 -2
- package/dist/bundling-sources/shared_libs/monitors/package.json +2 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +34 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +59 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +94 -1
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +35 -1
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-failure-codes.ts +24 -0
- package/dist/bundling-sources/shared_libs/observability/dlq.ts +32 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +57 -3
- package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +66 -1
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-column-storage.ts +36 -7
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +250 -11
- package/dist/bundling-sources/shared_libs/play-runtime/array-input-store.ts +319 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +991 -359
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +110 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machines.ts +155 -6
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-registry.ts +110 -6
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +127 -13
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +14 -1
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +57 -1
- package/dist/bundling-sources/shared_libs/play-runtime/free-company-lookup-batching.ts +218 -0
- package/dist/bundling-sources/shared_libs/play-runtime/gateway-postgres-admission.ts +42 -5
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-budget-state-backend.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +92 -31
- package/dist/bundling-sources/shared_libs/play-runtime/governor/block-reserving-budget-state-backend.ts +69 -14
- package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +93 -23
- package/dist/bundling-sources/shared_libs/play-runtime/governor/in-memory-rate-state-backend.ts +15 -4
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +22 -18
- package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +190 -14
- package/dist/bundling-sources/shared_libs/play-runtime/memory-ledger.ts +131 -0
- package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +77 -2
- package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +271 -2
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +51 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +27 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-text-for-log.ts +63 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-event-transport.ts +112 -16
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +104 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +265 -151
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-gateway-transport.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-progress-push.ts +35 -14
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-sheet-persistence-retry.ts +12 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-control-transport.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-labels.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +136 -70
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +237 -36
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-runtime-watchdog.ts +148 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +285 -32
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +251 -56
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +29 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +27 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +22 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +1397 -382
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-array-input-receipts.ts +920 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +16 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-environment.ts +38 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-flow.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +26 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +30 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-store-adapter.ts +14 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-writer.ts +31 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +47 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +20 -7
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +12 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/index.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +1496 -320
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +31 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1389 -129
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +162 -23
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +499 -115
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +377 -9
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +117 -8
- package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +25 -0
- package/dist/bundling-sources/shared_libs/play-runtime/terminal-runtime-performance.ts +391 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +40 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/index.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/mapped-calls.ts +171 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/receipt-cohort.ts +16 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +26 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +16 -2
- package/dist/bundling-sources/shared_libs/play-runtime/transport-error-diagnostics.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +55 -5
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +41 -1
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +4 -0
- package/dist/bundling-sources/shared_libs/plays/dataset.ts +9 -3
- package/dist/bundling-sources/shared_libs/plays/deploy/manifest-contract.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/manifest.ts +3 -2
- package/dist/bundling-sources/shared_libs/plays/deploy/project-serializer.ts +2 -2
- package/dist/bundling-sources/shared_libs/plays/run-output-summary.ts +66 -0
- package/dist/bundling-sources/shared_libs/plays/script-entry.ts +1 -1
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +43 -1
- package/dist/bundling-sources/shared_libs/product-notifications/content.ts +9 -0
- package/dist/bundling-sources/shared_libs/product-notifications/email.ts +91 -13
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +3 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +41 -24
- package/dist/bundling-sources/shared_libs/security/attested-client-ip.ts +91 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +0 -11
- package/dist/cli/{auth-HKA6ZVHQ.mjs → auth-JDLEY7VU.mjs} +5 -4
- package/dist/cli/auth-UXKY6TCC.js +41 -0
- package/dist/cli/{billing-MTO2ZZ3G.js → billing-HXAXB3XZ.js} +152 -78
- package/dist/cli/{billing-26G44S5N.mjs → billing-SDHLBLMV.mjs} +84 -10
- package/dist/cli/{chunk-BHGII2D6.js → chunk-3ACMRZRV.js} +8 -6
- package/dist/cli/{chunk-S4Q2XCGM.mjs → chunk-3KZCFOZ6.mjs} +1 -1
- package/dist/cli/chunk-4KQ6SIBC.mjs +1038 -0
- package/dist/cli/{chunk-Z2GUFYT6.js → chunk-5LEAXRHV.js} +11 -11
- package/dist/cli/{chunk-XAYO3Q2X.mjs → chunk-6NNVJDVR.mjs} +7 -5
- package/dist/cli/{chunk-NMJ4D2WO.js → chunk-6PMCRYDA.js} +216 -91
- package/dist/cli/{chunk-OMM54B3X.mjs → chunk-6RNQGWFD.mjs} +16 -806
- package/dist/cli/{chunk-EBU7LQ64.js → chunk-6V7KVRR5.js} +3 -3
- package/dist/cli/{chunk-RDPTDDKX.js → chunk-7LFIMWMW.js} +2 -2
- package/dist/cli/chunk-7MJ6VI2T.mjs +19 -0
- package/dist/cli/chunk-7SWNPNML.js +1039 -0
- package/dist/cli/{chunk-CTRPCARW.mjs → chunk-7U3XNPOA.mjs} +267 -38
- package/dist/cli/{chunk-RBTTUYZZ.js → chunk-7VZHXVOQ.js} +1 -1
- package/dist/cli/{chunk-YVBWO647.mjs → chunk-AT636LLU.mjs} +2 -2
- package/dist/cli/{chunk-VTODQWQA.js → chunk-BGTPIMSM.js} +392 -261
- package/dist/cli/{chunk-KADIT5NV.mjs → chunk-CKSOY47X.mjs} +2 -2
- package/dist/cli/{chunk-7DH2FD7Y.mjs → chunk-D464JW3N.mjs} +5 -85
- package/dist/cli/chunk-D6DXOUTO.mjs +827 -0
- package/dist/cli/{describe-QW54QQNB.js → chunk-EM4TXCCI.js} +27 -44
- package/dist/cli/chunk-F6QV42MC.mjs +91 -0
- package/dist/cli/chunk-FKVYR3QA.mjs +1039 -0
- package/dist/cli/{chunk-LMAULZLF.js → chunk-GEGW5HPZ.js} +29 -27
- package/dist/cli/{chunk-M52JQSLK.js → chunk-HUB3CCM2.js} +13 -4
- package/dist/cli/{chunk-YHTQM5XI.js → chunk-I6VHOU5O.js} +27 -27
- package/dist/cli/{chunk-Z2XUZC34.js → chunk-IAYSWZDJ.js} +188 -76
- package/dist/cli/chunk-JF3TLIMQ.js +19 -0
- package/dist/cli/{chunk-HDFRJ4IT.mjs → chunk-JVHOS3K3.mjs} +177 -65
- package/dist/cli/{chunk-LAWEURCT.mjs → chunk-LFXLQEZN.mjs} +1 -1
- package/dist/cli/{chunk-2PBN4SZE.js → chunk-LROWFPGN.js} +16 -16
- package/dist/cli/{chunk-SLEUWLJE.mjs → chunk-MSY22NQW.mjs} +5 -5
- package/dist/cli/{chunk-LVJOFUU7.mjs → chunk-MUUQZIOF.mjs} +23 -49
- package/dist/cli/{chunk-2XHWOQF4.js → chunk-NBLSCHKK.js} +52 -50
- package/dist/cli/{chunk-526R2HON.mjs → chunk-NHRWZPWZ.mjs} +4 -2
- package/dist/cli/{chunk-KXMNM4AQ.js → chunk-NMU3VR5U.js} +4 -5
- package/dist/cli/{chunk-W3BE3CHK.mjs → chunk-O2RX5A66.mjs} +14 -12
- package/dist/cli/{chunk-UKFZT7RF.js → chunk-OMQ23IXL.js} +2 -2
- package/dist/cli/{chunk-LJTFZOHU.js → chunk-OPJAJBD4.js} +28 -54
- package/dist/cli/{chunk-MLFR6DVF.mjs → chunk-PHSEINNH.mjs} +5 -5
- package/dist/cli/{chunk-3DNKFH2G.mjs → chunk-PKHVSIJG.mjs} +19 -1
- package/dist/cli/{chunk-WIYWSYDS.mjs → chunk-Q2EIZKVX.mjs} +3 -3
- package/dist/cli/{chunk-VJAEA4CS.js → chunk-QJZ6WNWD.js} +8 -8
- package/dist/cli/{chunk-EIMG75BT.mjs → chunk-S3A4IXBQ.mjs} +4 -5
- package/dist/cli/{chunk-RZSTT45F.mjs → chunk-S42YIQNE.mjs} +13 -8
- package/dist/cli/{chunk-YULBYKAK.mjs → chunk-S6UAJR6V.mjs} +3 -3
- package/dist/cli/{chunk-G7L27KZB.mjs → chunk-TKAQR3IB.mjs} +31 -21
- package/dist/cli/{chunk-QWRHGGUH.js → chunk-UAJFWWZE.js} +20 -2
- package/dist/cli/{chunk-ZR2RLI4O.mjs → chunk-UDRPEZ5F.mjs} +223 -92
- package/dist/cli/{chunk-QGAWTBIR.js → chunk-ULK7JGGI.js} +511 -282
- package/dist/cli/chunk-V335HGX5.js +1038 -0
- package/dist/cli/{chunk-NH6JSJW6.mjs → chunk-V3MEA7NB.mjs} +7 -5
- package/dist/cli/{chunk-NRGGFVVB.js → chunk-VFGVXXZP.js} +37 -35
- package/dist/cli/chunk-VLEVVDWG.js +91 -0
- package/dist/cli/{chunk-R2GLGLDR.mjs → chunk-VPHN2HAL.mjs} +216 -91
- package/dist/cli/{chunk-CFUTOWE4.js → chunk-WG3KGAII.js} +8 -88
- package/dist/cli/{describe-TOMIAT37.mjs → chunk-WIY6U6GD.mjs} +19 -36
- package/dist/cli/{chunk-YS2YBSJB.js → chunk-XANRM3QA.js} +6 -6
- package/dist/cli/{chunk-KGQNIA37.js → chunk-XQCTG5OO.js} +44 -34
- package/dist/cli/{chunk-EJGBLXDZ.mjs → chunk-XZAFIOUQ.mjs} +1 -1
- package/dist/cli/chunk-Y4DPU4OM.js +827 -0
- package/dist/cli/chunk-YT5EODJO.js +920 -0
- package/dist/cli/{chunk-2WRO2UJ5.js → chunk-ZGQSFYD2.js} +56 -51
- package/dist/cli/{chunk-OJ6RUKVT.mjs → chunk-ZUK6LIJB.mjs} +10 -1
- package/dist/cli/command-docs.d.mts +5 -0
- package/dist/cli/command-docs.d.ts +5 -0
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-6FNFYJUC.js → csv-C56GSCEU.js} +13 -12
- package/dist/cli/{csv-MDHT4BKK.mjs → csv-L54JS7TF.mjs} +4 -3
- package/dist/cli/{db-D6AMVOEW.js → db-MOGRMZTA.js} +30 -27
- package/dist/cli/{db-74O3RFWY.mjs → db-YVBUW2DX.mjs} +10 -7
- package/dist/cli/describe-KYEULWPG.js +48 -0
- package/dist/cli/describe-NLZKKT7C.mjs +48 -0
- package/dist/cli/describe-core.d.mts +153 -5
- package/dist/cli/describe-core.d.ts +153 -5
- package/dist/cli/describe-core.js +9 -5
- package/dist/cli/describe-core.mjs +10 -6
- package/dist/cli/{executions-N4FMGVSC.js → executions-A7L4ULPP.js} +9 -7
- package/dist/cli/{executions-PVSF4HUF.mjs → executions-ZBGSTT37.mjs} +7 -5
- package/dist/cli/{feedback-OB7NANZW.mjs → feedback-G6GU37FD.mjs} +6 -5
- package/dist/cli/{feedback-WFSPCAI2.js → feedback-OHLY7RYD.js} +10 -9
- package/dist/cli/getting-started.d.mts +6 -6
- package/dist/cli/getting-started.d.ts +6 -6
- package/dist/cli/getting-started.js +2 -2
- package/dist/cli/getting-started.mjs +1 -1
- package/dist/cli/git-P76N4NDQ.js +25 -0
- package/dist/cli/{git-FHUSPAEU.mjs → git-PKZW3QD5.mjs} +5 -4
- package/dist/cli/index.js +152 -142
- package/dist/cli/index.mjs +56 -46
- package/dist/cli/{legacy-noops-ECHNA5HN.js → legacy-noops-5LM3D724.js} +8 -7
- package/dist/cli/{legacy-noops-HMK4BSCI.mjs → legacy-noops-LJJYG6YA.mjs} +5 -4
- package/dist/cli/{monitors-U7VQ3EZM.mjs → monitors-72QV4ALO.mjs} +19 -6
- package/dist/cli/{monitors-XLLFNENH.js → monitors-UX3H5DC2.js} +103 -90
- package/dist/cli/{org-6H3USO5M.mjs → org-6RRRKOCP.mjs} +9 -6
- package/dist/cli/{org-QX6ER2HN.js → org-IF7ISUVB.js} +70 -67
- package/dist/cli/pages-3SU3HKL7.js +252 -0
- package/dist/cli/pages-DXDYYKEK.mjs +252 -0
- package/dist/cli/{play-MOB2WYOR.mjs → play-AHASKRLA.mjs} +512 -1508
- package/dist/cli/{play-WNB7HBZK.js → play-EUIUVLUH.js} +1090 -2086
- package/dist/cli/{providers-CXEZ23E2.mjs → providers-GWGE3WY3.mjs} +7 -5
- package/dist/cli/{providers-7M3DISKX.js → providers-V5WU4VXJ.js} +10 -8
- package/dist/cli/{quickstart-ZFCHKHF6.mjs → quickstart-OXKQ5ZST.mjs} +5 -4
- package/dist/cli/{quickstart-CLJT4AZL.js → quickstart-QP65I5PF.js} +13 -12
- package/dist/cli/run-6MM72IGL.mjs +443 -0
- package/dist/cli/run-F3FTYS56.js +443 -0
- package/dist/cli/search-OYKOOI7A.js +32 -0
- package/dist/cli/{search-FVYWYIC3.mjs → search-ZMEBVJZB.mjs} +8 -6
- package/dist/cli/{secrets-YRLKZQS5.js → secrets-ACND5N6A.js} +16 -14
- package/dist/cli/{secrets-WAMPTQFC.mjs → secrets-XRCJFF3L.mjs} +7 -5
- package/dist/cli/{sessions-IQ332BJH.mjs → sessions-RTK3CEW6.mjs} +5 -4
- package/dist/cli/{sessions-44J6WIVU.js → sessions-ZGRJPCFF.js} +6 -5
- package/dist/cli/{settings-4IJR2I2T.js → settings-PD5KWQQZ.js} +80 -77
- package/dist/cli/{settings-22S6NIFQ.mjs → settings-XDRBPRDE.mjs} +14 -11
- package/dist/cli/{setup-OZUPKKPW.mjs → setup-3HPYAOCC.mjs} +12 -10
- package/dist/cli/{setup-3FWSRNOX.js → setup-E2Q6PXHC.js} +53 -51
- package/dist/cli/{skills-5CW3NFP3.mjs → skills-OOQFMPOV.mjs} +7 -6
- package/dist/cli/skills-XYWV52KB.js +31 -0
- package/dist/cli/tools-ASCDZJCK.js +55 -0
- package/dist/cli/tools-C5ZT3UIC.mjs +55 -0
- package/dist/cli/update-5RQSEIFM.js +33 -0
- package/dist/cli/{update-IBULOV7P.mjs → update-ZWJTADIW.mjs} +9 -8
- package/dist/cli/{workflow-MVZT7MWT.mjs → workflow-23NMPAJ7.mjs} +10 -8
- package/dist/cli/{workflow-Z7FW6GT2.js → workflow-TCXU5YJV.js} +20 -18
- package/dist/client-DS2IWYZF.d.ts +10 -0
- package/dist/client-DTwnz_AW.d.mts +10 -0
- package/dist/{client-CYqG23K1.d.ts → client-core-B_6HAIBy.d.ts} +385 -12
- package/dist/{client-BbU5_j7n.d.mts → client-core-DzBSlY1U.d.mts} +385 -12
- package/dist/{compiler-manifest-CWz_sNOQ.d.mts → compiler-manifest-Dcyd3-Zd.d.mts} +43 -1
- package/dist/{compiler-manifest-CWz_sNOQ.d.ts → compiler-manifest-Dcyd3-Zd.d.ts} +43 -1
- package/dist/errors-d-sTrZhe.d.mts +142 -0
- package/dist/errors-yQwfgrcX.d.ts +142 -0
- package/dist/{index-BF2JB_Ug.d.mts → index-C6oXchjN.d.mts} +1 -1
- package/dist/{index-4NPXDzlD.d.ts → index-P56zy_z5.d.ts} +1 -1
- package/dist/index.d.mts +11 -147
- package/dist/index.d.ts +11 -147
- package/dist/index.js +15 -11
- package/dist/index.mjs +14 -10
- package/dist/install-integrity.json +141 -104
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +2 -1
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/play-description.js +2 -2
- package/dist/plays/play-description.mjs +1 -1
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +17 -0
- package/dist/server.d.ts +17 -0
- package/dist/server.js +76 -0
- package/dist/server.mjs +76 -0
- package/package.json +6 -1
- package/dist/cli/auth-VDOCNR7H.js +0 -40
- package/dist/cli/chunk-PQUUWFXY.js +0 -95
- package/dist/cli/chunk-QJLKYYPX.js +0 -1710
- package/dist/cli/chunk-YBWAG72P.mjs +0 -95
- package/dist/cli/git-4PMBJSH5.js +0 -24
- package/dist/cli/search-4CCQCTVD.js +0 -30
- package/dist/cli/skills-LMNM6B5F.js +0 -30
- package/dist/cli/tools-AGBBDJ7P.js +0 -45
- package/dist/cli/tools-NOPBDRGW.mjs +0 -45
- package/dist/cli/update-U3W6USVD.js +0 -32
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
daytonaErrorStatusForLog,
|
|
6
6
|
daytonaProviderDetailForRunError,
|
|
7
7
|
daytonaProviderMessageForRunError,
|
|
8
|
+
daytonaSandboxPlacementForLog,
|
|
9
|
+
daytonaSandboxStateForLog,
|
|
8
10
|
isDaytonaProviderError,
|
|
9
11
|
redactDaytonaErrorDetail,
|
|
10
12
|
withoutDaytonaProviderDetail,
|
|
@@ -28,6 +30,7 @@ import {
|
|
|
28
30
|
} from '../types';
|
|
29
31
|
import { buildPlayRunnerBundle } from '../bundle';
|
|
30
32
|
import { findPlayRunnerResult, parsePlayRunnerEvents } from '../runner-events';
|
|
33
|
+
import { logSandboxCreateOutcome } from '../sandbox-create-outcome';
|
|
31
34
|
import type {
|
|
32
35
|
PlayRunnerExecutionConfig,
|
|
33
36
|
PlayRunnerRuntimeTiming,
|
|
@@ -57,6 +60,7 @@ import {
|
|
|
57
60
|
import {
|
|
58
61
|
isPlayRunRecoveryError,
|
|
59
62
|
recoveryForDaytonaSandboxTransitionPending,
|
|
63
|
+
recoveryForRunnerStartupNotLive,
|
|
60
64
|
} from '../../play-run-recovery-policy';
|
|
61
65
|
import {
|
|
62
66
|
stageDaytonaRunnerPayload,
|
|
@@ -844,6 +848,8 @@ export async function inspectDetachedDaytonaRunner(input: {
|
|
|
844
848
|
exitCodePath: string;
|
|
845
849
|
/** Refuse to read a sandbox outside the launch-pinned Daytona organization. */
|
|
846
850
|
expectedOrganizationId?: string | null;
|
|
851
|
+
/** Answer from the sandbox's state alone. See the reconciliation seam. */
|
|
852
|
+
skipCapturedOutput?: boolean;
|
|
847
853
|
}): Promise<{
|
|
848
854
|
exitCode: number | null;
|
|
849
855
|
result: PlayRunnerResult | null;
|
|
@@ -853,6 +859,7 @@ export async function inspectDetachedDaytonaRunner(input: {
|
|
|
853
859
|
| 'command_running'
|
|
854
860
|
| 'result_missing'
|
|
855
861
|
| 'command_inspection_failed'
|
|
862
|
+
| 'sandbox_not_ended'
|
|
856
863
|
| 'sandbox_stopped'
|
|
857
864
|
| 'sandbox_missing'
|
|
858
865
|
| 'sandbox_lookup_failed'
|
|
@@ -880,6 +887,20 @@ export async function inspectDetachedDaytonaRunner(input: {
|
|
|
880
887
|
},
|
|
881
888
|
};
|
|
882
889
|
}
|
|
890
|
+
if (input.skipCapturedOutput) {
|
|
891
|
+
return {
|
|
892
|
+
exitCode: null,
|
|
893
|
+
result: null,
|
|
894
|
+
diagnosis: {
|
|
895
|
+
stage: DAYTONA_SANDBOX_STOPPED_STATES.has(
|
|
896
|
+
String(sandbox.state ?? '').toLowerCase(),
|
|
897
|
+
)
|
|
898
|
+
? 'sandbox_stopped'
|
|
899
|
+
: 'sandbox_not_ended',
|
|
900
|
+
detail: daytonaSandboxStateForLog(sandbox.state),
|
|
901
|
+
},
|
|
902
|
+
};
|
|
903
|
+
}
|
|
883
904
|
let exitCode: number | null = null;
|
|
884
905
|
let commandFound = false;
|
|
885
906
|
let commandInspectionError: string | null = null;
|
|
@@ -900,6 +921,18 @@ export async function inspectDetachedDaytonaRunner(input: {
|
|
|
900
921
|
error: error instanceof Error ? error.message : String(error),
|
|
901
922
|
});
|
|
902
923
|
}
|
|
924
|
+
// The control API can answer while the sandbox itself does not. This is
|
|
925
|
+
// Daytona's account of a silent sandbox, and it is lost with the sandbox.
|
|
926
|
+
console.warn(
|
|
927
|
+
'[play-runner.daytona.detached_provider_snapshot]',
|
|
928
|
+
JSON.stringify({
|
|
929
|
+
sandboxId: input.sandboxId,
|
|
930
|
+
cmdId: input.cmdId,
|
|
931
|
+
toolboxResponded: commandInspectionError === null,
|
|
932
|
+
state: daytonaSandboxStateForLog(sandbox.state),
|
|
933
|
+
...daytonaSandboxPlacementForLog(control.providerData(sandbox)),
|
|
934
|
+
}),
|
|
935
|
+
);
|
|
903
936
|
const stopped = DAYTONA_SANDBOX_STOPPED_STATES.has(
|
|
904
937
|
String(sandbox.state ?? '').toLowerCase(),
|
|
905
938
|
);
|
|
@@ -954,13 +987,24 @@ export async function inspectDetachedDaytonaRunner(input: {
|
|
|
954
987
|
cmdId: input.cmdId,
|
|
955
988
|
failure,
|
|
956
989
|
});
|
|
990
|
+
// A key for another organization gets not-found for every live sandbox, so
|
|
991
|
+
// a 404 proves loss only under the launch's own organization, as in delete.
|
|
992
|
+
const expectedOrganizationId = input.expectedOrganizationId?.trim() || null;
|
|
993
|
+
const configuredOrganizationId =
|
|
994
|
+
process.env.DAYTONA_ORGANIZATION_ID?.trim() || null;
|
|
995
|
+
const notFoundInLaunchOrganization =
|
|
996
|
+
failure.httpStatus === 404 &&
|
|
997
|
+
expectedOrganizationId !== null &&
|
|
998
|
+
(configuredOrganizationId === null ||
|
|
999
|
+
configuredOrganizationId === expectedOrganizationId);
|
|
957
1000
|
return {
|
|
958
1001
|
exitCode: null,
|
|
959
1002
|
result: null,
|
|
960
1003
|
diagnosis: {
|
|
961
|
-
stage:
|
|
962
|
-
|
|
963
|
-
|
|
1004
|
+
stage: notFoundInLaunchOrganization
|
|
1005
|
+
? 'sandbox_missing'
|
|
1006
|
+
: failure.httpStatus === 404 && expectedOrganizationId !== null
|
|
1007
|
+
? 'wrong_routing_domain'
|
|
964
1008
|
: 'sandbox_lookup_failed',
|
|
965
1009
|
detail: failure.detail,
|
|
966
1010
|
},
|
|
@@ -1026,6 +1070,14 @@ export type DaytonaSandboxDeleteOutcome =
|
|
|
1026
1070
|
kind: 'deleted' | 'already_absent';
|
|
1027
1071
|
organizationId: string | null;
|
|
1028
1072
|
}
|
|
1073
|
+
| {
|
|
1074
|
+
kind: 'delete_pending';
|
|
1075
|
+
organizationId: string | null;
|
|
1076
|
+
code: string;
|
|
1077
|
+
detail: string;
|
|
1078
|
+
/** A delete has been accepted, so only the 404 is outstanding. */
|
|
1079
|
+
deleteAccepted: boolean;
|
|
1080
|
+
}
|
|
1029
1081
|
| {
|
|
1030
1082
|
kind: 'timed_out' | 'rate_limited' | 'failed';
|
|
1031
1083
|
organizationId: string | null;
|
|
@@ -1033,11 +1085,23 @@ export type DaytonaSandboxDeleteOutcome =
|
|
|
1033
1085
|
detail: string;
|
|
1034
1086
|
};
|
|
1035
1087
|
|
|
1088
|
+
/** Daytona has already accepted a delete, so another adds nothing. */
|
|
1089
|
+
const DAYTONA_SANDBOX_DELETING_STATES = new Set(['destroying', 'destroyed']);
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* An accepted DELETE only starts the provider's work: on Oct 30 sandboxes
|
|
1093
|
+
* recorded deleted stayed in Daytona's inventory for minutes, and one process
|
|
1094
|
+
* kept posting 8 minutes later. Only a 404 for this exact sandbox settles it.
|
|
1095
|
+
* That 404 reads Daytona's database rather than the host, so it proves the
|
|
1096
|
+
* record is gone, which is the agreed bar.
|
|
1097
|
+
*/
|
|
1036
1098
|
export async function deleteDaytonaSandboxByIdWithOutcome(input: {
|
|
1037
1099
|
sandboxId: string;
|
|
1038
1100
|
timeoutSeconds?: number;
|
|
1039
1101
|
expectedOrganizationId?: string | null;
|
|
1040
1102
|
allowUnscopedAlreadyAbsent?: boolean;
|
|
1103
|
+
/** Durable proof that Daytona accepted this delete on an earlier pass. */
|
|
1104
|
+
deleteAcceptance?: { organizationId: string | null } | null;
|
|
1041
1105
|
}): Promise<DaytonaSandboxDeleteOutcome> {
|
|
1042
1106
|
const sandboxId = input.sandboxId?.trim();
|
|
1043
1107
|
const expectedOrganizationId = input.expectedOrganizationId?.trim() || null;
|
|
@@ -1050,6 +1114,7 @@ export async function deleteDaytonaSandboxByIdWithOutcome(input: {
|
|
|
1050
1114
|
};
|
|
1051
1115
|
}
|
|
1052
1116
|
let control: ReturnType<typeof createDaytonaControlClient> | undefined;
|
|
1117
|
+
let observedOrganizationId: string | null = null;
|
|
1053
1118
|
try {
|
|
1054
1119
|
const { clientOptions } = loadDaytonaRequiredConfig();
|
|
1055
1120
|
control = daytonaSdkClientFactory.createControl(
|
|
@@ -1057,7 +1122,7 @@ export async function deleteDaytonaSandboxByIdWithOutcome(input: {
|
|
|
1057
1122
|
(input.timeoutSeconds ?? 30) * 1_000,
|
|
1058
1123
|
);
|
|
1059
1124
|
const sandbox = await control.get(sandboxId);
|
|
1060
|
-
|
|
1125
|
+
observedOrganizationId = sandbox.organizationId?.trim() || null;
|
|
1061
1126
|
if (
|
|
1062
1127
|
expectedOrganizationId &&
|
|
1063
1128
|
observedOrganizationId !== expectedOrganizationId
|
|
@@ -1069,10 +1134,19 @@ export async function deleteDaytonaSandboxByIdWithOutcome(input: {
|
|
|
1069
1134
|
detail: 'Sandbox belongs to a different Daytona organization.',
|
|
1070
1135
|
};
|
|
1071
1136
|
}
|
|
1072
|
-
|
|
1137
|
+
if (
|
|
1138
|
+
!DAYTONA_SANDBOX_DELETING_STATES.has(
|
|
1139
|
+
String(sandbox.state ?? '').toLowerCase(),
|
|
1140
|
+
)
|
|
1141
|
+
) {
|
|
1142
|
+
await control.delete(sandbox);
|
|
1143
|
+
}
|
|
1073
1144
|
return {
|
|
1074
|
-
kind: '
|
|
1145
|
+
kind: 'delete_pending',
|
|
1075
1146
|
organizationId: observedOrganizationId,
|
|
1147
|
+
code: 'daytona_delete_unconfirmed',
|
|
1148
|
+
detail: `Daytona still returns sandbox ${sandboxId}; only a 404 confirms deletion.`,
|
|
1149
|
+
deleteAccepted: true,
|
|
1076
1150
|
};
|
|
1077
1151
|
} catch (error) {
|
|
1078
1152
|
const failure = describeDaytonaLookupFailure(error);
|
|
@@ -1087,6 +1161,27 @@ export async function deleteDaytonaSandboxByIdWithOutcome(input: {
|
|
|
1087
1161
|
if (failure.httpStatus === 404) {
|
|
1088
1162
|
const configuredOrganizationId =
|
|
1089
1163
|
process.env.DAYTONA_ORGANIZATION_ID?.trim() || null;
|
|
1164
|
+
if (input.deleteAcceptance) {
|
|
1165
|
+
// The read-back confirming an accepted delete: a provider confirmation,
|
|
1166
|
+
// so it may establish a legacy job's domain, which plain absence cannot.
|
|
1167
|
+
const acceptedOrganizationId =
|
|
1168
|
+
input.deleteAcceptance.organizationId?.trim() ||
|
|
1169
|
+
expectedOrganizationId;
|
|
1170
|
+
if (
|
|
1171
|
+
configuredOrganizationId &&
|
|
1172
|
+
acceptedOrganizationId &&
|
|
1173
|
+
configuredOrganizationId !== acceptedOrganizationId
|
|
1174
|
+
) {
|
|
1175
|
+
return {
|
|
1176
|
+
kind: 'failed',
|
|
1177
|
+
organizationId: configuredOrganizationId,
|
|
1178
|
+
code: 'wrong_routing_domain',
|
|
1179
|
+
detail:
|
|
1180
|
+
'Daytona returned not-found from outside the organization that accepted the delete.',
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
return { kind: 'deleted', organizationId: acceptedOrganizationId };
|
|
1184
|
+
}
|
|
1090
1185
|
if (
|
|
1091
1186
|
!input.allowUnscopedAlreadyAbsent &&
|
|
1092
1187
|
(!expectedOrganizationId ||
|
|
@@ -1112,6 +1207,23 @@ export async function deleteDaytonaSandboxByIdWithOutcome(input: {
|
|
|
1112
1207
|
configuredOrganizationId ?? expectedOrganizationId ?? null,
|
|
1113
1208
|
};
|
|
1114
1209
|
}
|
|
1210
|
+
if (failure.httpStatus === 409) {
|
|
1211
|
+
// A state change is in progress. Daytona took no delete, and nothing is
|
|
1212
|
+
// wrong, so this waits for its next read without reporting a failure.
|
|
1213
|
+
console.info(
|
|
1214
|
+
'[play-runner.daytona.reclaim_sandbox_state_change_pending]',
|
|
1215
|
+
{
|
|
1216
|
+
sandboxId,
|
|
1217
|
+
},
|
|
1218
|
+
);
|
|
1219
|
+
return {
|
|
1220
|
+
kind: 'delete_pending',
|
|
1221
|
+
organizationId: observedOrganizationId ?? expectedOrganizationId,
|
|
1222
|
+
code: 'daytona_state_change_in_progress',
|
|
1223
|
+
detail: failure.detail,
|
|
1224
|
+
deleteAccepted: false,
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1115
1227
|
console.warn('[play-runner.daytona.reclaim_sandbox_delete_failed]', {
|
|
1116
1228
|
sandboxId,
|
|
1117
1229
|
failure,
|
|
@@ -1147,7 +1259,11 @@ export async function deleteDaytonaSandboxById(input: {
|
|
|
1147
1259
|
...input,
|
|
1148
1260
|
allowUnscopedAlreadyAbsent: true,
|
|
1149
1261
|
});
|
|
1150
|
-
return
|
|
1262
|
+
return (
|
|
1263
|
+
outcome.kind === 'deleted' ||
|
|
1264
|
+
outcome.kind === 'already_absent' ||
|
|
1265
|
+
(outcome.kind === 'delete_pending' && outcome.deleteAccepted)
|
|
1266
|
+
);
|
|
1151
1267
|
}
|
|
1152
1268
|
|
|
1153
1269
|
export function formatDaytonaError(error: unknown): string {
|
|
@@ -1360,6 +1476,96 @@ function isRetryableDaytonaInfrastructureFailure(error: unknown): boolean {
|
|
|
1360
1476
|
return DAYTONA_INFRASTRUCTURE_RETRY_PATTERN.test(message);
|
|
1361
1477
|
}
|
|
1362
1478
|
|
|
1479
|
+
// A new sandbox can outrun these: the sandbox is gone or busy, the request
|
|
1480
|
+
// timed out, or Daytona is limiting. Other 4xx answers, a refused credential
|
|
1481
|
+
// among them, would fail the same way on every sandbox and stay loud.
|
|
1482
|
+
const DAYTONA_REPLACEABLE_START_STATUSES: ReadonlySet<number> = new Set([
|
|
1483
|
+
404, 408, 409, 429,
|
|
1484
|
+
]);
|
|
1485
|
+
// Codes that mean the request got no answer.
|
|
1486
|
+
const DAYTONA_UNANSWERED_REQUEST_CODES: ReadonlySet<string> = new Set([
|
|
1487
|
+
'ECONNABORTED',
|
|
1488
|
+
'ECONNREFUSED',
|
|
1489
|
+
'ECONNRESET',
|
|
1490
|
+
'EAI_AGAIN',
|
|
1491
|
+
'EPIPE',
|
|
1492
|
+
'ERR_NETWORK',
|
|
1493
|
+
'ETIMEDOUT',
|
|
1494
|
+
]);
|
|
1495
|
+
|
|
1496
|
+
/**
|
|
1497
|
+
* Daytona failed a step of starting the runner: the payload upload, the
|
|
1498
|
+
* session, the command, or a read of a runner that never reported live. No
|
|
1499
|
+
* runner has been released yet, so a new sandbox cannot repeat customer work.
|
|
1500
|
+
* Only Daytona's own failures count: anything else here is our bundle or
|
|
1501
|
+
* config, which fails the same way on every sandbox. A stalled upload stays
|
|
1502
|
+
* loud too, because its input may be too large for any sandbox.
|
|
1503
|
+
*/
|
|
1504
|
+
function isFailedDaytonaRunnerStart(error: unknown): boolean {
|
|
1505
|
+
if (error instanceof DaytonaControlTimeoutError) return true;
|
|
1506
|
+
if (!isDaytonaProviderError(error)) return false;
|
|
1507
|
+
const status = daytonaErrorStatusForLog(error);
|
|
1508
|
+
if (status !== null) {
|
|
1509
|
+
return status >= 500 || DAYTONA_REPLACEABLE_START_STATUSES.has(status);
|
|
1510
|
+
}
|
|
1511
|
+
// A missing status is not proof of a missing answer: the SDK raises
|
|
1512
|
+
// status-less errors for local failures too, such as a module it cannot
|
|
1513
|
+
// load. The 56 October uploads to bad hosts ended in a bare `DaytonaError`
|
|
1514
|
+
// with no status, no code and no message.
|
|
1515
|
+
return (
|
|
1516
|
+
error.name === 'DaytonaConnectionError' ||
|
|
1517
|
+
error.name === 'DaytonaTimeoutError' ||
|
|
1518
|
+
DAYTONA_UNANSWERED_REQUEST_CODES.has(daytonaErrorCodeForLog(error) ?? '') ||
|
|
1519
|
+
error.message === '' ||
|
|
1520
|
+
DAYTONA_INFRASTRUCTURE_RETRY_PATTERN.test(error.message)
|
|
1521
|
+
);
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
/** Which failure ended a start, for the stage log: the run error has less. */
|
|
1525
|
+
function startFailureForLog(error: unknown) {
|
|
1526
|
+
const diagnostic =
|
|
1527
|
+
error instanceof DaytonaRunnerInitializationError
|
|
1528
|
+
? error.startupDiagnostic
|
|
1529
|
+
: null;
|
|
1530
|
+
const startup = diagnostic?.runnerStartup;
|
|
1531
|
+
return {
|
|
1532
|
+
errorName: error instanceof Error ? error.name : null,
|
|
1533
|
+
providerStatus: daytonaErrorStatusForLog(error),
|
|
1534
|
+
providerCode: daytonaErrorCodeForLog(error),
|
|
1535
|
+
...(diagnostic
|
|
1536
|
+
? {
|
|
1537
|
+
// Retain the already-sanitized evidence before sandbox retirement.
|
|
1538
|
+
// Omit inspection messages, process names and the growing state map.
|
|
1539
|
+
startupDiagnostic: {
|
|
1540
|
+
schedulerReadinessObserved: diagnostic.schedulerReadinessObserved,
|
|
1541
|
+
schedulerReadinessResponses: diagnostic.schedulerReadinessResponses,
|
|
1542
|
+
commandFound: diagnostic.commandFound,
|
|
1543
|
+
exitCode: diagnostic.exitCode,
|
|
1544
|
+
sessionFound: diagnostic.sessionFound,
|
|
1545
|
+
sessionCommandCount: diagnostic.sessionCommandCount,
|
|
1546
|
+
exitCodeFile: diagnostic.exitCodeFile,
|
|
1547
|
+
processSummary: diagnostic.processSummary
|
|
1548
|
+
? {
|
|
1549
|
+
total: diagnostic.processSummary.total,
|
|
1550
|
+
node: diagnostic.processSummary.node,
|
|
1551
|
+
}
|
|
1552
|
+
: null,
|
|
1553
|
+
runnerStartup: startup
|
|
1554
|
+
? {
|
|
1555
|
+
phase: startup.phase,
|
|
1556
|
+
outcome: startup.outcome,
|
|
1557
|
+
status: startup.status,
|
|
1558
|
+
errorCode: startup.errorCode,
|
|
1559
|
+
transportAttemptId: startup.transportAttemptId,
|
|
1560
|
+
}
|
|
1561
|
+
: null,
|
|
1562
|
+
inspectionErrorCount: diagnostic.errors.length,
|
|
1563
|
+
},
|
|
1564
|
+
}
|
|
1565
|
+
: {}),
|
|
1566
|
+
};
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1363
1569
|
function isRetryableUnstartedDaytonaRunner(
|
|
1364
1570
|
error: unknown,
|
|
1365
1571
|
): error is DaytonaRunnerInitializationError {
|
|
@@ -1396,12 +1602,22 @@ function prepareDaytonaExecution(
|
|
|
1396
1602
|
context: input.context,
|
|
1397
1603
|
emitStage: (stage, extra) =>
|
|
1398
1604
|
emitDaytonaStage(callbacks, input.context, stage, extra),
|
|
1399
|
-
observeCreateCall:
|
|
1605
|
+
observeCreateCall: (event) => {
|
|
1606
|
+
if (event.type === 'daytona_create_call_succeeded') {
|
|
1607
|
+
logSandboxCreateOutcome({
|
|
1608
|
+
provider: 'daytona',
|
|
1609
|
+
outcome: 'succeeded',
|
|
1610
|
+
runId: input.context.runId,
|
|
1611
|
+
});
|
|
1612
|
+
}
|
|
1613
|
+
return callbacks?.onRuntimeLifecycleEvent?.(event);
|
|
1614
|
+
},
|
|
1400
1615
|
reserveSandboxCapacity: callbacks?.reserveSandboxCapacity
|
|
1401
1616
|
? (providerAttempt) =>
|
|
1402
1617
|
callbacks.reserveSandboxCapacity!('daytona', providerAttempt)
|
|
1403
1618
|
: undefined,
|
|
1404
1619
|
releaseSandboxCapacity: callbacks?.releaseSandboxCapacity,
|
|
1620
|
+
recordCleanupIntent: callbacks?.recordDaytonaCleanupIntent,
|
|
1405
1621
|
startAdmission: daytonaSandboxStartAdmission,
|
|
1406
1622
|
cancellationSignal: callbacks?.cancellationSignal,
|
|
1407
1623
|
});
|
|
@@ -1626,6 +1842,9 @@ export const daytonaPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
1626
1842
|
) {
|
|
1627
1843
|
let sandboxForAttempt: DaytonaSandbox | null = null;
|
|
1628
1844
|
let resourceAccounting: Promise<void> | null = null;
|
|
1845
|
+
// How far this sandbox's start got. The retry decision below reads it.
|
|
1846
|
+
let commandSent = false;
|
|
1847
|
+
let parkStarted = false;
|
|
1629
1848
|
const attemptStartedAt = Date.now();
|
|
1630
1849
|
try {
|
|
1631
1850
|
const acquiredSandbox = await Promise.race([
|
|
@@ -1705,6 +1924,9 @@ export const daytonaPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
1705
1924
|
}
|
|
1706
1925
|
},
|
|
1707
1926
|
cancellation: cancellationPromise,
|
|
1927
|
+
onCommandSending: () => {
|
|
1928
|
+
commandSent = true;
|
|
1929
|
+
},
|
|
1708
1930
|
onCommandAccepted: async () => {
|
|
1709
1931
|
commandAcceptedAtMs = Date.now();
|
|
1710
1932
|
emitDaytonaStage(callbacks, config.context, 'execute:accepted', {
|
|
@@ -1716,6 +1938,7 @@ export const daytonaPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
1716
1938
|
});
|
|
1717
1939
|
},
|
|
1718
1940
|
onReady: async (ready) => {
|
|
1941
|
+
parkStarted = true;
|
|
1719
1942
|
const heartbeatReadyAtMs = Date.now();
|
|
1720
1943
|
emitDaytonaStage(
|
|
1721
1944
|
callbacks,
|
|
@@ -1922,44 +2145,74 @@ export const daytonaPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
1922
2145
|
}
|
|
1923
2146
|
const retryReason = isRetryableUnstartedDaytonaRunner(error)
|
|
1924
2147
|
? 'runner_startup_not_live'
|
|
1925
|
-
:
|
|
1926
|
-
|
|
1927
|
-
|
|
2148
|
+
: sandboxForAttempt &&
|
|
2149
|
+
!parkStarted &&
|
|
2150
|
+
isFailedDaytonaRunnerStart(error)
|
|
2151
|
+
? 'runner_start_failed'
|
|
2152
|
+
: isRetryableDaytonaInfrastructureFailure(error)
|
|
2153
|
+
? 'daytona_infrastructure'
|
|
2154
|
+
: null;
|
|
2155
|
+
const retireSandboxForAttempt = async () => {
|
|
2156
|
+
if (!sandboxForAttempt) return;
|
|
2157
|
+
activeAcquiredResource!.billingEndedAt = Date.now();
|
|
2158
|
+
await reportRetiringRuntimeResource(activeAcquiredResource!);
|
|
2159
|
+
try {
|
|
2160
|
+
await sandboxCleanup.stashActiveSandboxForRetry();
|
|
2161
|
+
} catch (retirementError) {
|
|
2162
|
+
if (runtimeResourceReportErrors.has(retirementError))
|
|
2163
|
+
throw retirementError;
|
|
2164
|
+
// Preserve both causes without feeding a retryable startup
|
|
2165
|
+
// cause back into replacement admission. The cleanup manager
|
|
2166
|
+
// retains the active resource and its single retirement promise.
|
|
2167
|
+
const failure = new Error(
|
|
2168
|
+
`Daytona sandbox retirement unconfirmed: ${formatDaytonaError(retirementError)}. Original startup failure: ${formatDaytonaError(error)}`,
|
|
2169
|
+
{ cause: error },
|
|
2170
|
+
);
|
|
2171
|
+
failure.name = 'DaytonaSandboxRetirementUnconfirmedError';
|
|
2172
|
+
Object.assign(failure, { retirementError });
|
|
2173
|
+
throw failure;
|
|
2174
|
+
}
|
|
2175
|
+
};
|
|
2176
|
+
// A sandbox that never got a command has no runner, so this attempt
|
|
2177
|
+
// can replace it. Once a command went out, a runner may live until
|
|
2178
|
+
// Daytona finishes a delete it has only accepted, and a replacement
|
|
2179
|
+
// here would pass the same attempt fence and could be released with
|
|
2180
|
+
// it. That sandbox moves to a new attempt, whose fence rejects it.
|
|
1928
2181
|
if (
|
|
1929
2182
|
executionAttempt < DAYTONA_INFRASTRUCTURE_MAX_ATTEMPTS &&
|
|
1930
|
-
retryReason
|
|
2183
|
+
retryReason &&
|
|
2184
|
+
!commandSent
|
|
1931
2185
|
) {
|
|
1932
2186
|
emitDaytonaStage(callbacks, config.context, 'execute:retry', {
|
|
1933
2187
|
sandboxId: sandboxForAttempt?.id ?? null,
|
|
1934
2188
|
attempt: executionAttempt + 1,
|
|
1935
2189
|
reason: retryReason,
|
|
1936
2190
|
error: error instanceof Error ? error.message : String(error),
|
|
2191
|
+
...startFailureForLog(error),
|
|
1937
2192
|
elapsedMs: Date.now() - startedAt,
|
|
1938
2193
|
});
|
|
1939
|
-
|
|
1940
|
-
activeAcquiredResource!.billingEndedAt = Date.now();
|
|
1941
|
-
await reportRetiringRuntimeResource(activeAcquiredResource!);
|
|
1942
|
-
try {
|
|
1943
|
-
await sandboxCleanup.stashActiveSandboxForRetry();
|
|
1944
|
-
} catch (retirementError) {
|
|
1945
|
-
if (runtimeResourceReportErrors.has(retirementError))
|
|
1946
|
-
throw retirementError;
|
|
1947
|
-
// Preserve both causes without feeding a retryable startup
|
|
1948
|
-
// cause back into replacement admission. The cleanup manager
|
|
1949
|
-
// retains the active resource and its single retirement promise.
|
|
1950
|
-
const failure = new Error(
|
|
1951
|
-
`Daytona sandbox retirement unconfirmed: ${formatDaytonaError(retirementError)}. Original startup failure: ${formatDaytonaError(error)}`,
|
|
1952
|
-
{ cause: error },
|
|
1953
|
-
);
|
|
1954
|
-
failure.name = 'DaytonaSandboxRetirementUnconfirmedError';
|
|
1955
|
-
Object.assign(failure, { retirementError });
|
|
1956
|
-
throw failure;
|
|
1957
|
-
}
|
|
1958
|
-
}
|
|
2194
|
+
await retireSandboxForAttempt();
|
|
1959
2195
|
throwIfCancellationRequested();
|
|
1960
2196
|
acquiredSandboxPromise = sandboxLifecycle.createFreshSandbox();
|
|
1961
2197
|
continue;
|
|
1962
2198
|
}
|
|
2199
|
+
if (
|
|
2200
|
+
retryReason === 'runner_startup_not_live' ||
|
|
2201
|
+
retryReason === 'runner_start_failed'
|
|
2202
|
+
) {
|
|
2203
|
+
// No runner was released. Retire this sandbox first: the new
|
|
2204
|
+
// attempt starts clean.
|
|
2205
|
+
emitDaytonaStage(callbacks, config.context, 'execute:deferred', {
|
|
2206
|
+
sandboxId: sandboxForAttempt?.id ?? null,
|
|
2207
|
+
attempt: executionAttempt,
|
|
2208
|
+
reason: retryReason,
|
|
2209
|
+
...startFailureForLog(error),
|
|
2210
|
+
elapsedMs: Date.now() - startedAt,
|
|
2211
|
+
});
|
|
2212
|
+
await retireSandboxForAttempt();
|
|
2213
|
+
throwIfCancellationRequested();
|
|
2214
|
+
throw recoveryForRunnerStartupNotLive(error);
|
|
2215
|
+
}
|
|
1963
2216
|
throw error;
|
|
1964
2217
|
}
|
|
1965
2218
|
}
|