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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
1
2
|
import type { ModalClient } from 'modal';
|
|
2
3
|
import { isIsolatedRuntimeSchedulerSchema } from './runtime-scheduler-topology';
|
|
3
4
|
import {
|
|
@@ -84,15 +85,89 @@ export async function loadModalRequiredConfig(input: {
|
|
|
84
85
|
};
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
type ModalGrpcMiddleware = NonNullable<
|
|
89
|
+
NonNullable<ConstructorParameters<typeof ModalClient>[0]>['grpcMiddleware']
|
|
90
|
+
>[number];
|
|
91
|
+
|
|
92
|
+
const modalCallSignal = new AsyncLocalStorage<AbortSignal>();
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Cancel every Modal control-plane call `fn` makes once `signal` aborts. A
|
|
96
|
+
* deadline that only stops waiting leaves the call open, so a stuck provider
|
|
97
|
+
* would pile up unanswered reads behind it.
|
|
98
|
+
*/
|
|
99
|
+
export function withModalCallSignal<T>(
|
|
100
|
+
signal: AbortSignal,
|
|
101
|
+
fn: () => Promise<T>,
|
|
102
|
+
): Promise<T> {
|
|
103
|
+
return modalCallSignal.run(signal, fn);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Modal runs custom middleware outside its own retry loop, so the signal also
|
|
107
|
+
// ends a retry or throttle wait.
|
|
108
|
+
const cancelModalCallsWithScopedSignal: ModalGrpcMiddleware =
|
|
109
|
+
async function* (call, options) {
|
|
110
|
+
const signal = modalCallSignal.getStore();
|
|
111
|
+
// Every caller shares one auth token refresh, so one read's deadline must
|
|
112
|
+
// not cancel it.
|
|
113
|
+
if (
|
|
114
|
+
!signal ||
|
|
115
|
+
call.method.path === '/modal.client.ModalClient/AuthTokenGet'
|
|
116
|
+
) {
|
|
117
|
+
return yield* call.next(call.request, options);
|
|
118
|
+
}
|
|
119
|
+
return yield* call.next(call.request, {
|
|
120
|
+
...options,
|
|
121
|
+
signal: options.signal
|
|
122
|
+
? AbortSignal.any([options.signal, signal])
|
|
123
|
+
: signal,
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
let sharedModalClient: {
|
|
128
|
+
tokenId: string;
|
|
129
|
+
tokenSecret: string;
|
|
130
|
+
client: Promise<ModalClient>;
|
|
131
|
+
} | null = null;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Each `ModalClient` opens its own gRPC channel and nothing here closes one, so
|
|
135
|
+
* a client per call grows a long-lived process with every Modal read.
|
|
136
|
+
*/
|
|
137
|
+
function modalClientForTokens(
|
|
138
|
+
tokenId: string,
|
|
139
|
+
tokenSecret: string,
|
|
140
|
+
): Promise<ModalClient> {
|
|
141
|
+
if (
|
|
142
|
+
sharedModalClient?.tokenId === tokenId &&
|
|
143
|
+
sharedModalClient.tokenSecret === tokenSecret
|
|
144
|
+
) {
|
|
145
|
+
return sharedModalClient.client;
|
|
146
|
+
}
|
|
147
|
+
const client = import('modal').then(
|
|
148
|
+
({ ModalClient }) =>
|
|
149
|
+
new ModalClient({
|
|
150
|
+
tokenId,
|
|
151
|
+
tokenSecret,
|
|
152
|
+
grpcMiddleware: [cancelModalCallsWithScopedSignal],
|
|
153
|
+
}),
|
|
154
|
+
);
|
|
155
|
+
const entry = { tokenId, tokenSecret, client };
|
|
156
|
+
sharedModalClient = entry;
|
|
157
|
+
client.catch(() => {
|
|
158
|
+
if (sharedModalClient === entry) sharedModalClient = null;
|
|
159
|
+
});
|
|
160
|
+
return client;
|
|
161
|
+
}
|
|
162
|
+
|
|
87
163
|
export async function loadModalClientConfig(
|
|
88
164
|
input: { env?: NodeJS.ProcessEnv } = {},
|
|
89
165
|
): Promise<ModalClientConfig> {
|
|
90
166
|
const env = input.env ?? process.env;
|
|
91
167
|
const tokenId = requiredEnv(env, 'MODAL_TOKEN_ID');
|
|
92
168
|
const tokenSecret = requiredEnv(env, 'MODAL_TOKEN_SECRET');
|
|
93
|
-
const { ModalClient } = await import('modal');
|
|
94
169
|
return {
|
|
95
|
-
client:
|
|
170
|
+
client: await modalClientForTokens(tokenId, tokenSecret),
|
|
96
171
|
appName:
|
|
97
172
|
env.DEEPLINE_MODAL_RUNNER_APP_NAME?.trim() || MODAL_RUNNER_APP_NAME,
|
|
98
173
|
image: env.DEEPLINE_MODAL_RUNNER_IMAGE?.trim() || MODAL_RUNNER_IMAGE,
|
|
@@ -31,7 +31,7 @@ export const LEDGER_TERMINAL_RESULT_MAX_DEPTH = 10;
|
|
|
31
31
|
export const CONVEX_LEDGER_ARRAY_MAX_ITEMS = 8_192;
|
|
32
32
|
export const CONVEX_LEDGER_OBJECT_MAX_FIELDS = 1_024;
|
|
33
33
|
export const CONVEX_LEDGER_FIELD_NAME_MAX_LENGTH = 1_024;
|
|
34
|
-
/** Customer-visible values and
|
|
34
|
+
/** Customer-visible values and retained authored returns share one 5 MiB cap. */
|
|
35
35
|
export const CUSTOMER_OUTPUT_VALUE_MAX_BYTES = 5 * 1024 * 1024;
|
|
36
36
|
export const CUSTOMER_OUTPUT_TOTAL_MAX_BYTES = 5 * 1024 * 1024;
|
|
37
37
|
/** Inline Postgres receipt contract: one serialized output is at most 10 MiB. */
|
|
@@ -58,6 +58,12 @@ export const RUNTIME_RECEIPT_CONTROL_BUFFER_MAX_ITEMS = 2_000;
|
|
|
58
58
|
* is required to resume execution.
|
|
59
59
|
*/
|
|
60
60
|
export const RUNNER_TERMINAL_PUSH_MAX_BODY_BYTES = 16 * 1024 * 1024;
|
|
61
|
+
/**
|
|
62
|
+
* Oversized sheet admissions use bounded requests with room for returned row
|
|
63
|
+
* metadata. A single row may exceed this target, up to the unchanged gateway
|
|
64
|
+
* body ceiling; the target is never a new customer input-value limit.
|
|
65
|
+
*/
|
|
66
|
+
export const RUNTIME_SHEET_START_TARGET_BODY_BYTES = 12 * 1024 * 1024;
|
|
61
67
|
/**
|
|
62
68
|
* Receipt commands are measured before the runtime client adds its request
|
|
63
69
|
* envelope. Keep a full 4 MiB below the gateway body ceiling so one legal
|
|
@@ -459,7 +465,7 @@ export const RUN_LIST_OUTPUT_PREVIEW_LIMITS = {
|
|
|
459
465
|
maxFields: 40,
|
|
460
466
|
// The list endpoint returns multiple historical runs in one polling page.
|
|
461
467
|
// Reserve enough room for run state and legacy rows by keeping each preview
|
|
462
|
-
// at 4 KiB; the
|
|
468
|
+
// at 4 KiB; the retained authored result remains separately readable up to
|
|
463
469
|
// the 5 MiB customer-output ceiling.
|
|
464
470
|
maxBytes: 4_000,
|
|
465
471
|
maxDepth: 4,
|
|
@@ -1436,6 +1442,269 @@ export function assertCustomerPlayReturnWithinLimit(input: {
|
|
|
1436
1442
|
});
|
|
1437
1443
|
}
|
|
1438
1444
|
|
|
1445
|
+
const JSON_OUTPUT_TRUNCATION_SUFFIX = '…[truncated]';
|
|
1446
|
+
const OMIT_JSON_OUTPUT_VALUE = Symbol('OMIT_JSON_OUTPUT_VALUE');
|
|
1447
|
+
|
|
1448
|
+
type JsonOutputProjection = {
|
|
1449
|
+
value: unknown;
|
|
1450
|
+
bytes: number;
|
|
1451
|
+
truncated: boolean;
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
function jsonStringCharacterBytes(value: string, index: number) {
|
|
1455
|
+
const code = value.charCodeAt(index);
|
|
1456
|
+
if (code === 0x22 || code === 0x5c) return { bytes: 2, width: 1 };
|
|
1457
|
+
if (code <= 0x1f) {
|
|
1458
|
+
return {
|
|
1459
|
+
bytes:
|
|
1460
|
+
code === 0x08 ||
|
|
1461
|
+
code === 0x09 ||
|
|
1462
|
+
code === 0x0a ||
|
|
1463
|
+
code === 0x0c ||
|
|
1464
|
+
code === 0x0d
|
|
1465
|
+
? 2
|
|
1466
|
+
: 6,
|
|
1467
|
+
width: 1,
|
|
1468
|
+
};
|
|
1469
|
+
}
|
|
1470
|
+
if (code >= 0xd800 && code <= 0xdbff) {
|
|
1471
|
+
const next = value.charCodeAt(index + 1);
|
|
1472
|
+
return next >= 0xdc00 && next <= 0xdfff
|
|
1473
|
+
? { bytes: 4, width: 2 }
|
|
1474
|
+
: { bytes: 6, width: 1 };
|
|
1475
|
+
}
|
|
1476
|
+
if (code >= 0xdc00 && code <= 0xdfff) return { bytes: 6, width: 1 };
|
|
1477
|
+
if (code <= 0x7f) return { bytes: 1, width: 1 };
|
|
1478
|
+
if (code <= 0x7ff) return { bytes: 2, width: 1 };
|
|
1479
|
+
return { bytes: 3, width: 1 };
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
function truncateJsonStringToByteLimit(
|
|
1483
|
+
value: string,
|
|
1484
|
+
limitBytes: number,
|
|
1485
|
+
): JsonOutputProjection | null {
|
|
1486
|
+
if (limitBytes < 2) return null;
|
|
1487
|
+
const suffixBytes = jsonStringByteLength(JSON_OUTPUT_TRUNCATION_SUFFIX) - 2;
|
|
1488
|
+
const prefixLimitBytes = limitBytes - 2 - suffixBytes;
|
|
1489
|
+
if (prefixLimitBytes < 0) {
|
|
1490
|
+
return { value: '', bytes: 2, truncated: true };
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
let prefixBytes = 0;
|
|
1494
|
+
let prefixEnd = 0;
|
|
1495
|
+
while (prefixEnd < value.length) {
|
|
1496
|
+
const next = jsonStringCharacterBytes(value, prefixEnd);
|
|
1497
|
+
if (prefixBytes + next.bytes > prefixLimitBytes) break;
|
|
1498
|
+
prefixBytes += next.bytes;
|
|
1499
|
+
prefixEnd += next.width;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
const projected = `${value.slice(0, prefixEnd)}${JSON_OUTPUT_TRUNCATION_SUFFIX}`;
|
|
1503
|
+
return {
|
|
1504
|
+
value: projected,
|
|
1505
|
+
bytes: jsonStringByteLength(projected),
|
|
1506
|
+
truncated: true,
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
function projectJsonValueWithinByteLimit(
|
|
1511
|
+
value: unknown,
|
|
1512
|
+
limitBytes: number,
|
|
1513
|
+
key: string,
|
|
1514
|
+
inArray: boolean,
|
|
1515
|
+
toJsonAlreadyApplied = false,
|
|
1516
|
+
): JsonOutputProjection | null {
|
|
1517
|
+
let normalized = value;
|
|
1518
|
+
if (
|
|
1519
|
+
!toJsonAlreadyApplied &&
|
|
1520
|
+
normalized !== null &&
|
|
1521
|
+
typeof normalized === 'object' &&
|
|
1522
|
+
typeof (normalized as { toJSON?: unknown }).toJSON === 'function'
|
|
1523
|
+
) {
|
|
1524
|
+
normalized = (normalized as { toJSON: (key: string) => unknown }).toJSON(
|
|
1525
|
+
key,
|
|
1526
|
+
);
|
|
1527
|
+
return projectJsonValueWithinByteLimit(
|
|
1528
|
+
normalized,
|
|
1529
|
+
limitBytes,
|
|
1530
|
+
key,
|
|
1531
|
+
inArray,
|
|
1532
|
+
true,
|
|
1533
|
+
);
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
if (
|
|
1537
|
+
normalized === undefined ||
|
|
1538
|
+
typeof normalized === 'function' ||
|
|
1539
|
+
typeof normalized === 'symbol'
|
|
1540
|
+
) {
|
|
1541
|
+
return inArray
|
|
1542
|
+
? { value: null, bytes: 4, truncated: false }
|
|
1543
|
+
: { value: OMIT_JSON_OUTPUT_VALUE, bytes: 0, truncated: false };
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
let measurement: BoundedJsonByteLength;
|
|
1547
|
+
try {
|
|
1548
|
+
measurement = jsonByteLengthUpTo(normalized, limitBytes);
|
|
1549
|
+
} catch (error) {
|
|
1550
|
+
throw new Error(
|
|
1551
|
+
`play return cannot be serialized as JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
1552
|
+
);
|
|
1553
|
+
}
|
|
1554
|
+
if (!measurement.exceeded) {
|
|
1555
|
+
return {
|
|
1556
|
+
value: normalized,
|
|
1557
|
+
bytes: measurement.bytes,
|
|
1558
|
+
truncated: false,
|
|
1559
|
+
};
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
if (typeof normalized === 'string') {
|
|
1563
|
+
return truncateJsonStringToByteLimit(normalized, limitBytes);
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
if (Array.isArray(normalized)) {
|
|
1567
|
+
if (limitBytes < 2) return null;
|
|
1568
|
+
const values: unknown[] = [];
|
|
1569
|
+
let bytes = 2;
|
|
1570
|
+
let truncated = false;
|
|
1571
|
+
for (let index = 0; index < normalized.length; index += 1) {
|
|
1572
|
+
const separatorBytes = values.length > 0 ? 1 : 0;
|
|
1573
|
+
const childLimitBytes = limitBytes - bytes - separatorBytes;
|
|
1574
|
+
if (childLimitBytes < 1) {
|
|
1575
|
+
truncated = true;
|
|
1576
|
+
break;
|
|
1577
|
+
}
|
|
1578
|
+
const child = projectJsonValueWithinByteLimit(
|
|
1579
|
+
normalized[index],
|
|
1580
|
+
childLimitBytes,
|
|
1581
|
+
String(index),
|
|
1582
|
+
true,
|
|
1583
|
+
);
|
|
1584
|
+
if (!child || child.value === OMIT_JSON_OUTPUT_VALUE) {
|
|
1585
|
+
truncated = true;
|
|
1586
|
+
break;
|
|
1587
|
+
}
|
|
1588
|
+
values.push(child.value);
|
|
1589
|
+
bytes += separatorBytes + child.bytes;
|
|
1590
|
+
if (child.truncated) {
|
|
1591
|
+
truncated = true;
|
|
1592
|
+
break;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
return {
|
|
1596
|
+
value: values,
|
|
1597
|
+
bytes,
|
|
1598
|
+
truncated: truncated || values.length < normalized.length,
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
if (normalized !== null && typeof normalized === 'object') {
|
|
1603
|
+
if (limitBytes < 2) return null;
|
|
1604
|
+
const output = Object.create(null) as Record<string, unknown>;
|
|
1605
|
+
const entries = Object.keys(normalized);
|
|
1606
|
+
let bytes = 2;
|
|
1607
|
+
let fields = 0;
|
|
1608
|
+
let truncated = false;
|
|
1609
|
+
for (const childKey of entries) {
|
|
1610
|
+
const childValue = (normalized as Record<string, unknown>)[childKey];
|
|
1611
|
+
if (
|
|
1612
|
+
childValue === undefined ||
|
|
1613
|
+
typeof childValue === 'function' ||
|
|
1614
|
+
typeof childValue === 'symbol'
|
|
1615
|
+
) {
|
|
1616
|
+
continue;
|
|
1617
|
+
}
|
|
1618
|
+
const keyBytes = jsonStringByteLength(childKey) + 1;
|
|
1619
|
+
const separatorBytes = fields > 0 ? 1 : 0;
|
|
1620
|
+
const childLimitBytes = limitBytes - bytes - separatorBytes - keyBytes;
|
|
1621
|
+
if (childLimitBytes < 1) {
|
|
1622
|
+
truncated = true;
|
|
1623
|
+
break;
|
|
1624
|
+
}
|
|
1625
|
+
const child = projectJsonValueWithinByteLimit(
|
|
1626
|
+
childValue,
|
|
1627
|
+
childLimitBytes,
|
|
1628
|
+
childKey,
|
|
1629
|
+
false,
|
|
1630
|
+
);
|
|
1631
|
+
if (!child || child.value === OMIT_JSON_OUTPUT_VALUE) {
|
|
1632
|
+
truncated = true;
|
|
1633
|
+
break;
|
|
1634
|
+
}
|
|
1635
|
+
output[childKey] = child.value;
|
|
1636
|
+
bytes += separatorBytes + keyBytes + child.bytes;
|
|
1637
|
+
fields += 1;
|
|
1638
|
+
if (child.truncated) {
|
|
1639
|
+
truncated = true;
|
|
1640
|
+
break;
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
return {
|
|
1644
|
+
value: output,
|
|
1645
|
+
bytes,
|
|
1646
|
+
truncated: truncated || fields < entries.length,
|
|
1647
|
+
};
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
return null;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
export function truncateCustomerPlayReturnWithinLimit(input: {
|
|
1654
|
+
value: Record<string, unknown>;
|
|
1655
|
+
path?: string;
|
|
1656
|
+
totalLimitBytes?: number;
|
|
1657
|
+
}): {
|
|
1658
|
+
value: Record<string, unknown>;
|
|
1659
|
+
truncated: boolean;
|
|
1660
|
+
originalBytesAtLeast: number;
|
|
1661
|
+
retainedBytes: number;
|
|
1662
|
+
limitBytes: number;
|
|
1663
|
+
} {
|
|
1664
|
+
const path = input.path ?? 'play return';
|
|
1665
|
+
const limitBytes = input.totalLimitBytes ?? CUSTOMER_OUTPUT_TOTAL_MAX_BYTES;
|
|
1666
|
+
let measurement: BoundedJsonByteLength;
|
|
1667
|
+
try {
|
|
1668
|
+
measurement = jsonByteLengthUpTo(input.value, limitBytes);
|
|
1669
|
+
} catch (error) {
|
|
1670
|
+
throw new Error(
|
|
1671
|
+
`${path} cannot be serialized as JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
1672
|
+
);
|
|
1673
|
+
}
|
|
1674
|
+
if (!measurement.exceeded) {
|
|
1675
|
+
return {
|
|
1676
|
+
value: input.value,
|
|
1677
|
+
truncated: false,
|
|
1678
|
+
originalBytesAtLeast: measurement.bytes,
|
|
1679
|
+
retainedBytes: measurement.bytes,
|
|
1680
|
+
limitBytes,
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
const projection = projectJsonValueWithinByteLimit(
|
|
1685
|
+
input.value,
|
|
1686
|
+
limitBytes,
|
|
1687
|
+
'',
|
|
1688
|
+
false,
|
|
1689
|
+
);
|
|
1690
|
+
if (
|
|
1691
|
+
!projection ||
|
|
1692
|
+
projection.value === OMIT_JSON_OUTPUT_VALUE ||
|
|
1693
|
+
!projection.value ||
|
|
1694
|
+
typeof projection.value !== 'object' ||
|
|
1695
|
+
Array.isArray(projection.value)
|
|
1696
|
+
) {
|
|
1697
|
+
throw new Error(`${path} could not be truncated to valid JSON output.`);
|
|
1698
|
+
}
|
|
1699
|
+
return {
|
|
1700
|
+
value: projection.value as Record<string, unknown>,
|
|
1701
|
+
truncated: true,
|
|
1702
|
+
originalBytesAtLeast: measurement.bytes,
|
|
1703
|
+
retainedBytes: projection.bytes,
|
|
1704
|
+
limitBytes,
|
|
1705
|
+
};
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1439
1708
|
const RUNTIME_RECEIPT_OUTPUT_SIZE_ADVICE =
|
|
1440
1709
|
'This receipt result is too large for durable call caching. This usually means raw search results, HTML, or a large list is being cached as one cell. Parse it before returning it from the tool boundary.';
|
|
1441
1710
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { boundedProviderTextForLog } from './provider-text-for-log';
|
|
1
2
|
import { RUNTIME_RELIABILITY_POLICY } from './runtime-reliability-policy';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -45,6 +46,7 @@ export type PlayRunRecoveryReason =
|
|
|
45
46
|
| 'daytona_sandbox_acquisition_unavailable_before_execution'
|
|
46
47
|
| 'runtime_scheduler_unavailable_before_execution'
|
|
47
48
|
| 'runtime_initialization_transport_before_execution'
|
|
49
|
+
| 'runner_startup_not_live_before_execution'
|
|
48
50
|
| 'runtime_traffic_hold_before_execution'
|
|
49
51
|
| 'runtime_traffic_throttled_before_execution';
|
|
50
52
|
|
|
@@ -145,6 +147,29 @@ export function playRunRecoveryLogDetail(
|
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
149
|
|
|
150
|
+
/**
|
|
151
|
+
* The provider's own words from the cause of a recovery error, for the same
|
|
152
|
+
* defer log and under the same rules as the detail above. One reason covers a
|
|
153
|
+
* spend limit and a busy provider, and only this text tells them apart. gRPC
|
|
154
|
+
* `details` wins because `message` spends the bound on the RPC path first.
|
|
155
|
+
*/
|
|
156
|
+
export function playRunRecoveryProviderText(error: unknown): string | null {
|
|
157
|
+
try {
|
|
158
|
+
if (!isPlayRunRecoveryError(error)) return null;
|
|
159
|
+
const cause: unknown = error.cause;
|
|
160
|
+
if (!cause || typeof cause !== 'object') return null;
|
|
161
|
+
const { details, message } = cause as {
|
|
162
|
+
details?: unknown;
|
|
163
|
+
message?: unknown;
|
|
164
|
+
};
|
|
165
|
+
return (
|
|
166
|
+
boundedProviderTextForLog(details) ?? boundedProviderTextForLog(message)
|
|
167
|
+
);
|
|
168
|
+
} catch {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
148
173
|
function errorCode(error: unknown): string | number | null {
|
|
149
174
|
if (!error || typeof error !== 'object') return null;
|
|
150
175
|
const code = (error as { code?: unknown }).code;
|
|
@@ -369,6 +394,32 @@ export function recoveryForModalRunnerStartupFailure(
|
|
|
369
394
|
});
|
|
370
395
|
}
|
|
371
396
|
|
|
397
|
+
/**
|
|
398
|
+
* No sandbox this attempt started got a live runner: the runner never reached
|
|
399
|
+
* the sandbox, because its upload or command failed, or it never reached the
|
|
400
|
+
* gateway. The worker never parked a runner, so none could release customer
|
|
401
|
+
* code, and the attempt fence rejects any runner left behind. The fault can
|
|
402
|
+
* outlast an attempt's own starts, so it waits on the durable defer ladder
|
|
403
|
+
* rather than failing the run. It names no provider: a bad host or the
|
|
404
|
+
* sandbox's network is not a provider account fault, so it must not open a
|
|
405
|
+
* provider circuit.
|
|
406
|
+
*/
|
|
407
|
+
export function recoveryForRunnerStartupNotLive(
|
|
408
|
+
error: unknown,
|
|
409
|
+
): PlayRunRecoveryError {
|
|
410
|
+
return new PlayRunRecoveryError({
|
|
411
|
+
decision: {
|
|
412
|
+
stage: 'pre_code',
|
|
413
|
+
action: 'defer',
|
|
414
|
+
reason: 'runner_startup_not_live_before_execution',
|
|
415
|
+
dependency: 'runtime',
|
|
416
|
+
},
|
|
417
|
+
message:
|
|
418
|
+
'The sandbox runner did not start before customer execution began.',
|
|
419
|
+
cause: error,
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
|
|
372
423
|
/**
|
|
373
424
|
* A runner transport classifier has already proved that the result has no
|
|
374
425
|
* customer rows or steps. Keep its engine retry typed so an ordinary failed
|
package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts
CHANGED
|
@@ -17,6 +17,8 @@ export type SandboxCleanupResource = {
|
|
|
17
17
|
export type SandboxCleanupDeleteOutcome =
|
|
18
18
|
| { kind: 'deleted'; routingDomain: string | null }
|
|
19
19
|
| { kind: 'already_absent'; routingDomain: string | null }
|
|
20
|
+
/** Nothing failed, but the provider has not yet shown the resource is gone. */
|
|
21
|
+
| { kind: 'pending'; code: string; detail: string }
|
|
20
22
|
/** The provider outcome is ambiguous or failed; its resource remains live. */
|
|
21
23
|
| { kind: 'failed'; code: string; detail: string };
|
|
22
24
|
|
|
@@ -37,6 +37,14 @@ export function createSandboxCleanupJob(
|
|
|
37
37
|
|
|
38
38
|
try {
|
|
39
39
|
const deletion = await ports.deletion.delete(input);
|
|
40
|
+
if (deletion.kind === 'pending') {
|
|
41
|
+
return await scheduleRetry(
|
|
42
|
+
ports,
|
|
43
|
+
input,
|
|
44
|
+
deletion.detail,
|
|
45
|
+
confirmationReadDelay(input.resource.failureCount + 1),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
40
48
|
if (deletion.kind === 'failed') {
|
|
41
49
|
if (deletion.code === 'missing_routing_domain') {
|
|
42
50
|
const reason = `missing_routing_domain: ${deletion.detail}`.slice(
|
|
@@ -120,8 +128,8 @@ async function scheduleRetry(
|
|
|
120
128
|
ports: SandboxCleanupPorts,
|
|
121
129
|
input: SandboxCleanupInput,
|
|
122
130
|
error: string,
|
|
131
|
+
retryAfterMs = retryDelay(input.resource.failureCount + 1),
|
|
123
132
|
): Promise<SandboxCleanupOutcome> {
|
|
124
|
-
const retryAfterMs = retryDelay(input.resource.failureCount + 1);
|
|
125
133
|
const scheduled = await ports.store.retry({
|
|
126
134
|
resource: input.resource,
|
|
127
135
|
error,
|
|
@@ -139,6 +147,24 @@ function retryDelay(nextFailureCount: number): number {
|
|
|
139
147
|
);
|
|
140
148
|
}
|
|
141
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Janitor sightings put Daytona's record about 3 seconds behind an accepted
|
|
152
|
+
* delete on Oct 31 (115 sightings of 10,785 deletes, 5-minute passes). Reading
|
|
153
|
+
* at 5 seconds usually needs one read, so a cleanup costs three control
|
|
154
|
+
* requests. At 500,000 cleanups a month that is under 1 request per second, and
|
|
155
|
+
* the 4/s dense-load peak stays near 12/s, against a budget of 25/s. Doubling
|
|
156
|
+
* to 5 minutes leaves a stuck sandbox costing one read per interval.
|
|
157
|
+
*/
|
|
158
|
+
const CONFIRMATION_READ_DELAY_MS = 5_000;
|
|
159
|
+
|
|
160
|
+
function confirmationReadDelay(nextFailureCount: number): number {
|
|
161
|
+
return Math.min(
|
|
162
|
+
5 * 60_000,
|
|
163
|
+
CONFIRMATION_READ_DELAY_MS *
|
|
164
|
+
2 ** Math.min(6, Math.max(0, nextFailureCount - 1)),
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
142
168
|
function validate(input: SandboxCleanupInput): void {
|
|
143
169
|
const { resource } = input;
|
|
144
170
|
if (!resource.sandboxId.trim() || !resource.runId.trim()) {
|
|
@@ -2,6 +2,7 @@ import { bouncebanBatchStrategies } from './/bounceban-batching';
|
|
|
2
2
|
import type { AnyBatchOperationStrategy } from './batching-types';
|
|
3
3
|
import { bettercontactBatchStrategies } from './bettercontact-batching';
|
|
4
4
|
import { DEFAULT_PLAY_RUNTIME_BATCH_STRATEGIES } from './default-batch-strategies';
|
|
5
|
+
import { freeCompanyLookupBatchStrategies } from './free-company-lookup-batching';
|
|
5
6
|
import { fullenrichBatchStrategies } from './fullenrich-batching';
|
|
6
7
|
import { opensosdataBatchStrategies } from './opensosdata-batching';
|
|
7
8
|
import { zerobounceBatchStrategies } from './zerobounce-batching';
|
|
@@ -15,6 +16,7 @@ export const PLAY_RUNTIME_BATCH_OPERATION_REGISTRY: Record<
|
|
|
15
16
|
...DEFAULT_PLAY_RUNTIME_BATCH_STRATEGIES,
|
|
16
17
|
...bettercontactBatchStrategies,
|
|
17
18
|
...bouncebanBatchStrategies,
|
|
19
|
+
...freeCompanyLookupBatchStrategies,
|
|
18
20
|
...fullenrichBatchStrategies,
|
|
19
21
|
...opensosdataBatchStrategies,
|
|
20
22
|
...testAsyncBatchStrategies,
|
|
@@ -312,6 +312,9 @@ export interface RunnerPushExecutionConfig {
|
|
|
312
312
|
/** The provider that acquired this sandbox, which a Daytona-selected launch
|
|
313
313
|
* can differ from after fallback. Absent from older workers. */
|
|
314
314
|
sandboxProvider?: 'daytona' | 'modal';
|
|
315
|
+
/** Test drill only: how long the sandbox watchdog withholds heartbeats once
|
|
316
|
+
* customer code starts. Absent from every ordinary launch. */
|
|
317
|
+
heartbeatSilenceMs?: number;
|
|
315
318
|
}
|
|
316
319
|
|
|
317
320
|
export interface PlayRunnerExecutionConfig {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const LOGGED_PROVIDER_TEXT_MAX_CHARS = 160;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Credential redaction for a provider control-plane error message. Shared by
|
|
5
|
+
* lookup-failure descriptions and the provider text below.
|
|
6
|
+
*/
|
|
7
|
+
export function redactProviderErrorDetail(value: string): string {
|
|
8
|
+
return value
|
|
9
|
+
.replace(
|
|
10
|
+
/authorization\s*[=:]\s*bearer\s+[^\s,;]+/gi,
|
|
11
|
+
'Authorization=Bearer [redacted]',
|
|
12
|
+
)
|
|
13
|
+
.replace(
|
|
14
|
+
/(authorization\s*[=:]\s*)(?!bearer\s+\[redacted\])[^\s,;]+/gi,
|
|
15
|
+
'$1[redacted]',
|
|
16
|
+
)
|
|
17
|
+
.replace(/(bearer\s+)[^\s,;]+/gi, '$1[redacted]')
|
|
18
|
+
.replace(/((?:api[_-]?key|token)\s*[=:]\s*)[^\s,;]+/gi, '$1[redacted]')
|
|
19
|
+
.replace(/\s+/g, ' ')
|
|
20
|
+
.trim()
|
|
21
|
+
.slice(0, 1_000);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Provider free text (for example a sandbox `errorReason`) for logs. This
|
|
26
|
+
* field is written by the provider, so it is redacted more strictly than the
|
|
27
|
+
* shared function alone: URL userinfo, any authorization scheme, password,
|
|
28
|
+
* secret, token, signature, credential and key pairs in query, header or JSON
|
|
29
|
+
* form, email addresses, and opaque identifiers such as organization ids. It
|
|
30
|
+
* is then cut to one short fixed bound so an upstream response is never
|
|
31
|
+
* copied wholesale.
|
|
32
|
+
*/
|
|
33
|
+
export function boundedProviderTextForLog(value: unknown): string | null {
|
|
34
|
+
if (typeof value !== 'string') return null;
|
|
35
|
+
const strict = value
|
|
36
|
+
.replace(/(\b[a-z][a-z0-9+.-]*:\/\/)[^\s/@]+@/gi, '$1[redacted]@')
|
|
37
|
+
.replace(
|
|
38
|
+
/(authorization\s*[=:]\s*["']?)(?:[a-z]+\s+)?[^\s,;"']+/gi,
|
|
39
|
+
'$1[redacted]',
|
|
40
|
+
)
|
|
41
|
+
.replace(/\b(basic|bearer)\s+[A-Za-z0-9+/=._~-]{8,}/gi, '$1 [redacted]')
|
|
42
|
+
.replace(
|
|
43
|
+
/(["']?[\w.-]*(?:password|passwd|secret|token|signature|credential|api[_-]?key|access[_-]?key)[\w.-]*["']?\s*[=:]\s*)(?:"[^"]*"|'[^']*'|[^\s&,;"'}\]]+)/gi,
|
|
44
|
+
'$1[redacted]',
|
|
45
|
+
)
|
|
46
|
+
.replace(
|
|
47
|
+
/[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+/g,
|
|
48
|
+
'[redacted-email]',
|
|
49
|
+
)
|
|
50
|
+
.replace(
|
|
51
|
+
/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,
|
|
52
|
+
'[redacted-id]',
|
|
53
|
+
)
|
|
54
|
+
.replace(
|
|
55
|
+
/\b(?=[A-Za-z0-9_-]*\d)(?=[A-Za-z0-9_-]*[A-Za-z])[A-Za-z0-9_-]{24,}\b/g,
|
|
56
|
+
'[redacted-id]',
|
|
57
|
+
);
|
|
58
|
+
const bounded = redactProviderErrorDetail(strict).slice(
|
|
59
|
+
0,
|
|
60
|
+
LOGGED_PROVIDER_TEXT_MAX_CHARS,
|
|
61
|
+
);
|
|
62
|
+
return bounded || null;
|
|
63
|
+
}
|
|
@@ -230,7 +230,26 @@ export type RuntimeResourceObservation = {
|
|
|
230
230
|
sheetFlushBytes?: number | null;
|
|
231
231
|
};
|
|
232
232
|
|
|
233
|
+
/** Decoded runner execute-response envelopes; permits are not resident memory. */
|
|
234
|
+
export type RuntimeToolResponseBodyAdmissionSnapshot = {
|
|
235
|
+
turns: number;
|
|
236
|
+
measuredTurns: number;
|
|
237
|
+
decodedUtf8BytesTotal: number;
|
|
238
|
+
decodedUtf8BytesMax: number;
|
|
239
|
+
/** Peak concurrent expected-or-measured reservations; not RSS or heap usage. */
|
|
240
|
+
permitBytesPeak: number;
|
|
241
|
+
queuedTurns: number;
|
|
242
|
+
/** Budget refusal checks, not distinct delayed calls or rows. */
|
|
243
|
+
budgetRefusals: number;
|
|
244
|
+
progressAdmissions: number;
|
|
245
|
+
unpricedAdmissions: number;
|
|
246
|
+
};
|
|
247
|
+
|
|
233
248
|
export type RuntimeResourceSnapshot = {
|
|
249
|
+
/** Optional for snapshots produced before byte-lane telemetry was added. */
|
|
250
|
+
memoryAdmission?: {
|
|
251
|
+
toolResponseBody: RuntimeToolResponseBodyAdmissionSnapshot;
|
|
252
|
+
};
|
|
234
253
|
/**
|
|
235
254
|
* Selected execute-route stages across every physical request that published
|
|
236
255
|
* the complete timing header. Kept once per run so mixed-provider fixtures
|