deepline 0.3.541 → 0.3.543
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 +106 -2
- package/dist/bundling-sources/sdk/src/index.ts +7 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +198 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +35 -11
- package/dist/bundling-sources/sdk/src/types.ts +17 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +132 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +5 -5
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +34 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +11 -5
- package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +9 -7
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +235 -12
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +39 -30
- package/dist/bundling-sources/shared_libs/play-runtime/event-wait-tools.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +10 -4
- package/dist/bundling-sources/shared_libs/play-runtime/fleet-sandbox-sweep.ts +209 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +37 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +42 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +23 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +320 -836
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/vercel-sandbox.ts +1061 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +862 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +45 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +11 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +20 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +71 -34
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-provider-profile.ts +286 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -1
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +12 -3
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +46 -55
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +127 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +214 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/managed-sandbox-resource-sql.ts +118 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +226 -144
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +11 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +42 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/vercel-sandbox-runtime-config.ts +217 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -0
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +1 -0
- package/dist/bundling-sources/shared_libs/plays/script-entry.ts +76 -6
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -0
- package/dist/bundling-sources/shared_libs/security/credential-revision.ts +50 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +2 -1
- package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +37 -0
- package/dist/cli/{auth-WJXA7XGM.mjs → auth-ITAELTOA.mjs} +5 -5
- package/dist/cli/auth-S6B5WUU5.js +43 -0
- package/dist/cli/{billing-34IV5DSV.js → billing-33XVFDUJ.js} +101 -101
- package/dist/cli/{billing-SHS4HMWT.mjs → billing-WZ7RVZW4.mjs} +12 -12
- package/dist/cli/{chunk-UKO6POLZ.js → chunk-23D224GI.js} +37 -17
- package/dist/cli/{chunk-DF7ARQRB.mjs → chunk-274WKLSY.mjs} +2 -2
- package/dist/cli/{chunk-GBAT5NMI.mjs → chunk-2HSZCQMT.mjs} +48 -6
- package/dist/cli/{chunk-VLEVVDWG.js → chunk-2JHYYB3F.js} +3 -3
- package/dist/cli/{chunk-FVZ5Y5L6.js → chunk-2KTGZKRE.js} +18 -18
- package/dist/cli/{chunk-6TZEDCN7.js → chunk-2LNTKICO.js} +3 -3
- package/dist/cli/{chunk-FYQWTENQ.js → chunk-2NCJQEZH.js} +53 -53
- package/dist/cli/{chunk-CNBPATLI.js → chunk-3JZXU5OB.js} +5 -5
- package/dist/cli/{chunk-323I5KQ5.js → chunk-46BEBZ3M.js} +497 -328
- package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
- package/dist/cli/{chunk-XO2SGONT.mjs → chunk-4SKDSSPU.mjs} +2 -2
- package/dist/cli/{chunk-53QZ24DP.mjs → chunk-52YK3EII.mjs} +2 -2
- package/dist/cli/{chunk-S7NKIEHL.js → chunk-5MN3BKNB.js} +16 -16
- package/dist/cli/{chunk-XTR32PMA.mjs → chunk-5VIPTLRX.mjs} +1 -1
- package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
- package/dist/cli/{chunk-QI76LGE3.mjs → chunk-6SJZMMD5.mjs} +37 -190
- package/dist/cli/chunk-7AUQTNLB.mjs +455 -0
- package/dist/cli/{chunk-GLINYHY7.mjs → chunk-AACKPOGA.mjs} +1 -1
- package/dist/cli/{chunk-Q66ADD4O.js → chunk-BGAUADV4.js} +41 -41
- package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
- package/dist/cli/{chunk-F3TLGM2U.js → chunk-C35NLLSA.js} +5 -5
- package/dist/cli/{chunk-LRPFCB2P.mjs → chunk-D6YAU3CF.mjs} +182 -13
- package/dist/cli/{chunk-FRPJSFNL.mjs → chunk-DH43ECTN.mjs} +7 -3
- package/dist/cli/{chunk-IZXMX65M.js → chunk-DI3GL3T6.js} +316 -469
- package/dist/cli/{chunk-OK4JMVTM.js → chunk-DUGTPVT7.js} +7 -7
- package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
- package/dist/cli/{chunk-KIYETQ6K.js → chunk-EHUG6EUT.js} +26 -26
- package/dist/cli/chunk-F6VSQ5LN.js +455 -0
- package/dist/cli/{chunk-JZNKEHXQ.mjs → chunk-FNW2SGPD.mjs} +2 -2
- package/dist/cli/{chunk-M6XIKHBS.js → chunk-GRCFX2EG.js} +4 -4
- package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
- package/dist/cli/{chunk-FTKX7OGB.mjs → chunk-HKJ26NRN.mjs} +5 -5
- package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
- package/dist/cli/{chunk-POZPEDW7.js → chunk-J2F6F5GL.js} +7 -7
- package/dist/cli/{chunk-7AUQSK24.mjs → chunk-JXG7HWBA.mjs} +1 -1
- package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
- package/dist/cli/{chunk-WIV3E6Y7.js → chunk-MCBUWK5K.js} +22 -22
- package/dist/cli/{chunk-2TAGAPLL.js → chunk-NHKP2NSU.js} +2 -2
- package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
- package/dist/cli/{chunk-UXXFCOE3.js → chunk-NLENABRU.js} +6 -6
- package/dist/cli/{chunk-DHC7EGI7.mjs → chunk-NR3O56FT.mjs} +5 -5
- package/dist/cli/{chunk-MPYM6TUO.js → chunk-O2KLWUNI.js} +44 -44
- package/dist/cli/{chunk-BMNLD63A.mjs → chunk-OAFKUHN5.mjs} +4 -4
- package/dist/cli/{chunk-RYYGNUNO.mjs → chunk-OELJKQOL.mjs} +24 -4
- package/dist/cli/{chunk-ZD673XAL.js → chunk-PX7XAVUC.js} +24 -20
- package/dist/cli/{chunk-FOCNY4GV.js → chunk-QFRMVI4S.js} +3 -3
- package/dist/cli/{chunk-AU7ZKXW5.mjs → chunk-R57UCXQG.mjs} +1 -1
- package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
- package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
- package/dist/cli/{chunk-BUCTWJBM.js → chunk-STXG2LFC.js} +2 -2
- package/dist/cli/{chunk-ECPCZVDM.mjs → chunk-SU4K4SUU.mjs} +1 -1
- package/dist/cli/{chunk-ABDXKELH.mjs → chunk-SYOPHFKB.mjs} +6 -6
- package/dist/cli/{chunk-H74CLEMB.mjs → chunk-SZNJENGT.mjs} +3 -3
- package/dist/cli/{chunk-5N4ENMYE.js → chunk-TBCNL2T5.js} +1 -1
- package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
- package/dist/cli/{chunk-C2LYJ3EX.js → chunk-UJ6GOV7K.js} +13 -13
- package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
- package/dist/cli/{chunk-6PJAC3P5.mjs → chunk-VSJEOSYL.mjs} +1 -1
- package/dist/cli/{chunk-NB4AIXEA.mjs → chunk-W2OPPSAZ.mjs} +3 -3
- package/dist/cli/{chunk-5LNWLEO3.mjs → chunk-XBM3KABD.mjs} +3 -3
- package/dist/cli/{chunk-VMIIUMAN.mjs → chunk-XFPVFWZR.mjs} +1 -1
- package/dist/cli/{chunk-UC5QFQGC.mjs → chunk-XSN6BAZT.mjs} +5 -5
- package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
- package/dist/cli/{chunk-S6FF7Q5P.js → chunk-YE3T73BV.js} +10 -10
- package/dist/cli/{chunk-CY5LW6DW.js → chunk-YJYKZ2U3.js} +2 -2
- package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
- package/dist/cli/{chunk-ZL2DER5D.mjs → chunk-ZRT2PNYY.mjs} +1 -1
- package/dist/cli/{chunk-WZMG2M65.mjs → chunk-ZSPBJB7I.mjs} +4 -4
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/concurrent-runs-help-E4OYD3DS.js +21 -0
- package/dist/cli/{concurrent-runs-help-ZJ77SAEU.mjs → concurrent-runs-help-Z6ODNL4E.mjs} +7 -7
- package/dist/cli/{csv-PX7F5YJN.mjs → csv-5QW2HPHT.mjs} +4 -4
- package/dist/cli/{csv-MJLIZZOR.js → csv-SSOFTXHU.js} +13 -13
- package/dist/cli/{db-BNCNAY4G.js → db-4LK5AJNO.js} +29 -29
- package/dist/cli/{db-KPKGTHPA.mjs → db-K2JMR6EM.mjs} +8 -8
- package/dist/cli/describe-AC6PLEFP.js +50 -0
- package/dist/cli/describe-AXHQZHTT.mjs +50 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/describe-core.js +3 -3
- package/dist/cli/describe-core.mjs +2 -2
- package/dist/cli/{executions-YNOFR7T2.js → executions-AATJQQAQ.js} +10 -10
- package/dist/cli/{executions-NMQY4GEY.mjs → executions-FY2XTX2W.mjs} +8 -8
- package/dist/cli/{feedback-LWYEO5LL.mjs → feedback-MKBPRGS6.mjs} +6 -6
- package/dist/cli/{feedback-RCP5DPO6.js → feedback-QPVJER75.js} +14 -14
- package/dist/cli/{git-3O4PFP3Q.mjs → git-AGRFZR3K.mjs} +5 -5
- package/dist/cli/git-RUYFQEJX.js +25 -0
- package/dist/cli/index.js +150 -146
- package/dist/cli/index.mjs +49 -45
- package/dist/cli/integrations-OUQ6U33M.mjs +98 -0
- package/dist/cli/integrations-R6OUFZXI.js +98 -0
- package/dist/cli/{legacy-noops-KFP674JT.mjs → legacy-noops-DVL2RRKL.mjs} +6 -6
- package/dist/cli/{legacy-noops-ZPZRG366.js → legacy-noops-H7INM2QN.js} +9 -9
- package/dist/cli/{mcp-OCYUXQ6L.mjs → mcp-2Z2YVOLK.mjs} +72 -15
- package/dist/cli/{mcp-HCXDW6PL.js → mcp-33F7D7WI.js} +89 -32
- package/dist/cli/{monitors-7Q7YT22Y.js → monitors-KDUJHAKJ.js} +102 -102
- package/dist/cli/{monitors-V5KJIJJE.mjs → monitors-NZD2WIKK.mjs} +9 -9
- package/dist/cli/{org-S37K6QYH.js → org-4PQGHLEB.js} +164 -88
- package/dist/cli/{org-C3QLHX7U.mjs → org-EJW45RUA.mjs} +84 -8
- package/dist/cli/{play-MXQ2DKML.mjs → play-3CM5RT5J.mjs} +44 -25
- package/dist/cli/{play-MLREAYHJ.js → play-MLHMQL4G.js} +374 -355
- package/dist/cli/{providers-FDJ4ZOST.mjs → providers-BHYBJI4R.mjs} +10 -9
- package/dist/cli/{providers-PPDWY7DH.js → providers-YBJG7277.js} +13 -12
- package/dist/cli/{quickstart-2Z57AMB7.mjs → quickstart-LL3MR562.mjs} +4 -4
- package/dist/cli/{quickstart-BOWQM7S7.js → quickstart-O7L2NNGJ.js} +6 -6
- package/dist/cli/{run-66HXNJNV.js → run-HJ2AR6CM.js} +49 -48
- package/dist/cli/{run-5RNJGPQ2.mjs → run-OK545H5Q.mjs} +28 -27
- package/dist/cli/search-UUNS6BCC.js +32 -0
- package/dist/cli/{search-7G4FYQYO.mjs → search-Z5ZKMRTX.mjs} +9 -9
- package/dist/cli/{search-output-6K4FHCVI.mjs → search-output-Q5VHNUWG.mjs} +4 -4
- package/dist/cli/{search-output-L6ICQDBL.js → search-output-SVW4DETG.js} +6 -6
- package/dist/cli/{secrets-PWFJKF7G.js → secrets-ENQWMCB5.js} +17 -17
- package/dist/cli/{secrets-FTQPCU7O.mjs → secrets-QIKIEFWB.mjs} +8 -8
- package/dist/cli/{sessions-YSSAAQVJ.mjs → sessions-AETO22RF.mjs} +6 -6
- package/dist/cli/sessions-FNSUDERA.js +22 -0
- package/dist/cli/{settings-KN7GNZ5J.mjs → settings-G5RGRPFV.mjs} +16 -16
- package/dist/cli/{settings-CZEMF2WD.js → settings-OFLIFTMZ.js} +89 -89
- package/dist/cli/{setup-5WLHGH57.mjs → setup-G4N3X6KG.mjs} +9 -9
- package/dist/cli/{setup-RW4X6DX4.js → setup-QW7Y62XD.js} +49 -49
- package/dist/cli/skills-3IXIY2IV.js +36 -0
- package/dist/cli/{skills-DLVI7IZK.mjs → skills-QRFQGHNA.mjs} +7 -7
- package/dist/cli/{tools-JVYQF7P3.mjs → tools-52BH7UTF.mjs} +20 -19
- package/dist/cli/tools-MYBUMPKH.js +57 -0
- package/dist/cli/update-GT7574UU.js +34 -0
- package/dist/cli/{update-XKLXU7YS.mjs → update-SDGZLAGL.mjs} +9 -9
- package/dist/cli/{views-QRRCWP6B.mjs → views-3BIJFJMQ.mjs} +8 -8
- package/dist/cli/{views-YNUYFS3S.js → views-5QKAWYPI.js} +23 -23
- package/dist/cli/{workflow-YUKADKCJ.js → workflow-G67RPWVY.js} +19 -19
- package/dist/cli/{workflow-KYFMA4LM.mjs → workflow-QAK773FR.mjs} +9 -9
- package/dist/{client-B1fixtK1.d.ts → client-D1ga52xq.d.ts} +1 -1
- package/dist/{client-CE4QBVbp.d.mts → client-bd4QQIXo.d.mts} +1 -1
- package/dist/{client-core-C-3FVlVq.d.ts → client-core-B6eMVx8h.d.ts} +335 -4
- package/dist/{client-core-2BkNBgrx.d.mts → client-core-CqfWNf2Q.d.mts} +335 -4
- package/dist/{compiler-manifest-Cys06iYg.d.ts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
- package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.ts} +21 -0
- package/dist/{errors-B6eMjKcr.d.mts → errors-CwKXXtuu.d.mts} +1 -1
- package/dist/{errors-rdOUqcU2.d.ts → errors-Lm9_vJHZ.d.ts} +1 -1
- package/dist/{index-ejWadAL5.d.ts → index-3vJ-V9yw.d.ts} +1 -1
- package/dist/{index-CZdYO81A.d.mts → index-DjwsAt82.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +12 -12
- package/dist/index.mjs +8 -8
- package/dist/install-integrity.json +147 -133
- 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 +23 -4
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +2 -2
- package/dist/plays/run-request.mjs +1 -1
- 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 +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +7 -7
- package/dist/server.mjs +5 -5
- package/package.json +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal-resource-usage.ts +0 -222
- package/dist/cli/auth-V76O674K.js +0 -43
- package/dist/cli/concurrent-runs-help-MFEPUP6Y.js +0 -21
- package/dist/cli/describe-5OUJA5TH.mjs +0 -49
- package/dist/cli/describe-7MF5AHIU.js +0 -49
- package/dist/cli/git-WLQ3BS6K.js +0 -25
- package/dist/cli/search-LTUIIV6W.js +0 -32
- package/dist/cli/sessions-2IVFGTPA.js +0 -22
- package/dist/cli/skills-WT42AZVH.js +0 -36
- package/dist/cli/tools-D6STYBQG.js +0 -56
- package/dist/cli/update-XTUKBC3J.js +0 -34
|
@@ -127,6 +127,15 @@ export const OPERATIONS_QUEUE_CATALOG = [
|
|
|
127
127
|
300_000,
|
|
128
128
|
900_000,
|
|
129
129
|
),
|
|
130
|
+
queue(
|
|
131
|
+
'communication-wait-deliveries',
|
|
132
|
+
'Communication wait deliveries',
|
|
133
|
+
'leased_workset',
|
|
134
|
+
'runtime',
|
|
135
|
+
'Deliver a verified response to its existing Play run through the shared admission Workpool',
|
|
136
|
+
60_000,
|
|
137
|
+
300_000,
|
|
138
|
+
),
|
|
130
139
|
queue(
|
|
131
140
|
'play-webhook-receipts',
|
|
132
141
|
'Play webhook receipts',
|
|
@@ -264,6 +264,7 @@ export function createProviderQueueItemConnector(
|
|
|
264
264
|
export const QUEUE_CONNECTOR_BACKENDS: Readonly<
|
|
265
265
|
Record<string, QueueConnectorBackend>
|
|
266
266
|
> = {
|
|
267
|
+
'communication-wait-deliveries': 'convex',
|
|
267
268
|
'play-runtime-tasks': 'absurd',
|
|
268
269
|
'run-ledger-projector-outbox': 'postgres-outbox',
|
|
269
270
|
'compute-billing-jobs': 'postgres-outbox',
|
|
@@ -277,17 +277,17 @@
|
|
|
277
277
|
"id": "github.prebuilt-benchmarks",
|
|
278
278
|
"name": "Prebuilt benchmarks",
|
|
279
279
|
"scheduler": "github_actions",
|
|
280
|
-
"cadence": "
|
|
280
|
+
"cadence": "30 7 * * *",
|
|
281
281
|
"timezone": "UTC",
|
|
282
282
|
"source": ".github/workflows/prebuilt-benchmarks.yml",
|
|
283
283
|
"locator": "schedule:",
|
|
284
284
|
"owner": "evals",
|
|
285
285
|
"criticality": "reporting",
|
|
286
|
-
"purpose": "Run each prebuilt play on its fixed labeled sample in
|
|
287
|
-
"successDefinition": "Every benchmark exports its rows, scores them, settles within its credit cap
|
|
288
|
-
"failureDefinition": "
|
|
286
|
+
"purpose": "Run each prebuilt play on its fixed labeled sample in the persistent benchmark workspace on Production with the published CLI (reusing results under 4 days old when nothing changed) and publish found, exact, recall, precision and settled credits.",
|
|
287
|
+
"successDefinition": "Every benchmark exports its rows (or reuses a recent fresh run), scores them, settles within its credit cap and the workspace's 2000-credit monthly usage cap, and the summary uploads.",
|
|
288
|
+
"failureDefinition": "A dataset load, play run, export, scoring or credit-cap overrun fails, or the workspace's monthly usage cap is missing or used up.",
|
|
289
289
|
"startGraceMs": 600000,
|
|
290
|
-
"runTimeoutMs":
|
|
290
|
+
"runTimeoutMs": 18000000,
|
|
291
291
|
"failureAlert": "github_workflow_run",
|
|
292
292
|
"domainReportRequired": true
|
|
293
293
|
},
|
|
@@ -284,3 +284,37 @@ export function augmentSheetContractWithDatasetFields(input: {
|
|
|
284
284
|
|
|
285
285
|
return { ...input.contract, columns: [...inputColumns, ...outputColumns] };
|
|
286
286
|
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* A dataset's stored column names in the order a run wrote them: each row's
|
|
290
|
+
* keys in the order the Play built them (first seen across `rows`), then each
|
|
291
|
+
* output field (its `withColumn`s, in declaration order), continuing an order
|
|
292
|
+
* recorded earlier in the run (`existing`). This is the order the run page
|
|
293
|
+
* shows; the table's own column order is creation order across every run and
|
|
294
|
+
* goes stale when a Play changes.
|
|
295
|
+
*/
|
|
296
|
+
export function datasetWrittenColumnOrder(input: {
|
|
297
|
+
contract: PlaySheetContract;
|
|
298
|
+
rows: readonly Record<string, unknown>[];
|
|
299
|
+
outputFields?: readonly string[];
|
|
300
|
+
existing?: readonly string[];
|
|
301
|
+
}): string[] {
|
|
302
|
+
const order = [...(input.existing ?? [])];
|
|
303
|
+
const seen = new Set(order);
|
|
304
|
+
const append = (field: string) => {
|
|
305
|
+
if (!isDatasetPayloadField(field)) return;
|
|
306
|
+
const declared = input.contract.columns.find(
|
|
307
|
+
(column) =>
|
|
308
|
+
(column.source === 'input' || column.source === 'datasetColumn') &&
|
|
309
|
+
(column.field ?? column.id) === field,
|
|
310
|
+
);
|
|
311
|
+
const sqlName = declared?.sqlName ?? sqlSafePlayColumnName(field);
|
|
312
|
+
if (seen.has(sqlName)) return;
|
|
313
|
+
seen.add(sqlName);
|
|
314
|
+
order.push(sqlName);
|
|
315
|
+
};
|
|
316
|
+
for (const row of input.rows)
|
|
317
|
+
for (const field of Object.keys(row)) append(field);
|
|
318
|
+
for (const field of input.outputFields ?? []) append(field);
|
|
319
|
+
return order;
|
|
320
|
+
}
|
|
@@ -165,6 +165,8 @@ export type RuntimeStatusUpdate = {
|
|
|
165
165
|
complete?: boolean;
|
|
166
166
|
/** Dataset-grain row birth, stated once per dataset (ADR 0019). */
|
|
167
167
|
bornFrom?: PlayDatasetBornFrom;
|
|
168
|
+
/** Stored column names in the order the run wrote them. */
|
|
169
|
+
columns?: string[];
|
|
168
170
|
at: number;
|
|
169
171
|
}>;
|
|
170
172
|
/** Sparse typed activity facts. Routing/deduplication happens server-side. */
|
|
@@ -2472,10 +2474,9 @@ export async function listViewsViaAppRuntime(
|
|
|
2472
2474
|
context: WorkerRuntimeApiContext,
|
|
2473
2475
|
): Promise<PlayViewLink[]> {
|
|
2474
2476
|
try {
|
|
2475
|
-
const result = await postAppRuntimeApi<{ views: PlayViewLink[] }>(
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
);
|
|
2477
|
+
const result = await postAppRuntimeApi<{ views: PlayViewLink[] }>(context, {
|
|
2478
|
+
action: 'list_views',
|
|
2479
|
+
});
|
|
2479
2480
|
return result.views;
|
|
2480
2481
|
} catch (error) {
|
|
2481
2482
|
// An older receiver does not know list_views. Say so instead of returning
|
|
@@ -2728,7 +2729,11 @@ async function updateRunStatusViaAppRuntimeUnlocked(
|
|
|
2728
2729
|
// an unattributed or stale birth for the whole run.
|
|
2729
2730
|
(event.bornFrom !== undefined &&
|
|
2730
2731
|
(!current.bornFrom ||
|
|
2731
|
-
event.bornFrom.rowCountIn > current.bornFrom.rowCountIn))
|
|
2732
|
+
event.bornFrom.rowCountIn > current.bornFrom.rowCountIn)) ||
|
|
2733
|
+
// A longer written column order (a later page or the terminal write
|
|
2734
|
+
// adding withColumns) is a change the snapshot must keep.
|
|
2735
|
+
(event.columns !== undefined &&
|
|
2736
|
+
event.columns.length > (current.columns?.length ?? 0));
|
|
2732
2737
|
if (!changesSnapshot) continue;
|
|
2733
2738
|
events.push({
|
|
2734
2739
|
type: RUN_EVENT_KIND.datasetLifecycle,
|
|
@@ -2750,6 +2755,7 @@ async function updateRunStatusViaAppRuntimeUnlocked(
|
|
|
2750
2755
|
: { failedRows: event.failedRows }),
|
|
2751
2756
|
...(event.complete === undefined ? {} : { complete: event.complete }),
|
|
2752
2757
|
...(event.bornFrom === undefined ? {} : { bornFrom: event.bornFrom }),
|
|
2758
|
+
...(event.columns === undefined ? {} : { columns: event.columns }),
|
|
2753
2759
|
});
|
|
2754
2760
|
}
|
|
2755
2761
|
const latestActivities = new Map(
|
|
@@ -32,14 +32,16 @@ export const BAKED_RUNNER_SELF_MODE = 'self';
|
|
|
32
32
|
export const BAKED_RUNNER_OFF_MODE = 'off';
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Release-owned enable for self-versioned baked runner images. While
|
|
36
|
-
* unset worker setting
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
35
|
+
* Release-owned enable for self-versioned baked runner images. While true, an
|
|
36
|
+
* unset worker setting means `self`: each worker looks up
|
|
37
|
+
* `deepline-play-runner:<own bundle hash>`, and the Production release and
|
|
38
|
+
* Preview preparation publish that image beside the worker roll. A worker
|
|
39
|
+
* whose image is absent, unreadable or mismatched uploads the runner as
|
|
40
|
+
* before. `DEEPLINE_BAKED_RUNNER_HASH=off` on a worker is the kill switch.
|
|
41
|
+
* Read from the release SHA by `.github/workflows/production-release.yml` and
|
|
42
|
+
* from the target checkout by `scripts/run-daytona-preview-release-gate.sh`.
|
|
41
43
|
*/
|
|
42
|
-
export const BAKED_RUNNER_SELF_VERSIONED: boolean =
|
|
44
|
+
export const BAKED_RUNNER_SELF_VERSIONED: boolean = true;
|
|
43
45
|
export const BAKED_RUNNER_ROOT = '/opt/deepline/runner';
|
|
44
46
|
export const BAKED_RUNNER_FILE_NAME = 'play-runner.cjs';
|
|
45
47
|
|
|
@@ -340,6 +340,7 @@ import {
|
|
|
340
340
|
import {
|
|
341
341
|
CtxFetchHttpError,
|
|
342
342
|
LEGACY_PLAY_AUTHORING_CONTRACT_EDITION,
|
|
343
|
+
isToolConnectionName,
|
|
343
344
|
PLAY_AUTHORING_CONTRACT_EDITION,
|
|
344
345
|
normalizePlayAuthoringCustomerDbStatement,
|
|
345
346
|
validateOptionalPlayAuthoringField,
|
|
@@ -402,6 +403,7 @@ import {
|
|
|
402
403
|
isQueryResultDatasetTool,
|
|
403
404
|
} from './query-result-dataset';
|
|
404
405
|
import {
|
|
406
|
+
applyCacheReuseWindow,
|
|
405
407
|
isAlwaysFreshIntegrationTool,
|
|
406
408
|
isAlwaysFreshIntegrationWriteTool,
|
|
407
409
|
reusableWindowEligibility,
|
|
@@ -751,6 +753,14 @@ const authoredStepContext = new AsyncLocalStorage<{
|
|
|
751
753
|
invocationId?: string;
|
|
752
754
|
}>();
|
|
753
755
|
const toolExecutionOverrides = new AsyncLocalStorage<{ force: boolean }>();
|
|
756
|
+
const namedWorkspaceTool = new AsyncLocalStorage<{
|
|
757
|
+
toolId: string;
|
|
758
|
+
name: string;
|
|
759
|
+
id: string;
|
|
760
|
+
grantGeneration: number;
|
|
761
|
+
digest: string;
|
|
762
|
+
rateScope: { bucketId: string; token: string };
|
|
763
|
+
}>();
|
|
754
764
|
/**
|
|
755
765
|
* `ctx.runSteps` passes each `runIf` leg to `ctx.step` with a receipt gate
|
|
756
766
|
* keyed by the leg's body. Unless the run's checkpoint already holds the
|
|
@@ -3390,9 +3400,11 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
3390
3400
|
Promise<ResolvedPlayExecutor>
|
|
3391
3401
|
>();
|
|
3392
3402
|
readonly tools = {
|
|
3403
|
+
namedWorkspaceConnections: true,
|
|
3393
3404
|
execute: <TOutput = unknown>(request: {
|
|
3394
3405
|
id: string;
|
|
3395
3406
|
tool: string;
|
|
3407
|
+
connection?: string;
|
|
3396
3408
|
input: Record<string, unknown>;
|
|
3397
3409
|
description?: string;
|
|
3398
3410
|
force?: boolean;
|
|
@@ -3407,6 +3419,12 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
3407
3419
|
'ctx.tools.execute requires a request object: ctx.tools.execute({ id, tool, input, description }).',
|
|
3408
3420
|
);
|
|
3409
3421
|
}
|
|
3422
|
+
if (request.connection !== undefined) {
|
|
3423
|
+
const { connection, ...call } = request;
|
|
3424
|
+
return this.withNamedWorkspaceTool(call.tool, connection, () =>
|
|
3425
|
+
this.tools.execute<TOutput>(call),
|
|
3426
|
+
);
|
|
3427
|
+
}
|
|
3410
3428
|
validatePlayAuthoringField('ctx.tools.execute.id', request.id);
|
|
3411
3429
|
validatePlayAuthoringField('ctx.tools.execute.tool', request.tool);
|
|
3412
3430
|
validatePlayAuthoringField('ctx.tools.execute.input', request.input);
|
|
@@ -3886,7 +3904,12 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
3886
3904
|
options.getToolQueueHints,
|
|
3887
3905
|
options.getToolProvider,
|
|
3888
3906
|
),
|
|
3889
|
-
resolveRateScope:
|
|
3907
|
+
resolveRateScope: (toolId, provider) => {
|
|
3908
|
+
const named = namedWorkspaceTool.getStore();
|
|
3909
|
+
return named?.toolId === toolId
|
|
3910
|
+
? named.rateScope
|
|
3911
|
+
: (options.getToolRateScope?.(toolId, provider) ?? null);
|
|
3912
|
+
},
|
|
3890
3913
|
maxConcurrentExternalCalls: options.maxConcurrentExternalCalls,
|
|
3891
3914
|
maxConcurrentRows: options.maxConcurrentRows,
|
|
3892
3915
|
// A root run keeps depth 0 (its first child play is depth 1) but still
|
|
@@ -4390,6 +4413,33 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
4390
4413
|
return callOrder.id;
|
|
4391
4414
|
}
|
|
4392
4415
|
|
|
4416
|
+
/**
|
|
4417
|
+
* Whether the run's internal reuse window may lengthen this call's window.
|
|
4418
|
+
* The Play author never accepted reuse, so only a catalog read qualifies:
|
|
4419
|
+
* effect `read`, no invocation-scoped idempotency, no execution fence. A
|
|
4420
|
+
* write, send or purchase keeps its authored window, as does a tool whose
|
|
4421
|
+
* effect is unknown or whose metadata lookup fails.
|
|
4422
|
+
*/
|
|
4423
|
+
private async cacheReuseWindowAdmits(
|
|
4424
|
+
toolId: string,
|
|
4425
|
+
input: Record<string, unknown>,
|
|
4426
|
+
): Promise<boolean> {
|
|
4427
|
+
try {
|
|
4428
|
+
const [scope, retry, effect] = await Promise.all([
|
|
4429
|
+
this.#options.getToolIdempotencyScope?.(toolId),
|
|
4430
|
+
this.#options.getToolRetryPolicy?.(toolId, input),
|
|
4431
|
+
this.#options.getToolEffect?.(toolId),
|
|
4432
|
+
]);
|
|
4433
|
+
return (
|
|
4434
|
+
effect === 'read' &&
|
|
4435
|
+
scope !== 'invocation' &&
|
|
4436
|
+
retry?.requiresExecutionFence !== true
|
|
4437
|
+
);
|
|
4438
|
+
} catch {
|
|
4439
|
+
return false;
|
|
4440
|
+
}
|
|
4441
|
+
}
|
|
4442
|
+
|
|
4393
4443
|
/**
|
|
4394
4444
|
* A tool is a read on replay mismatch only when its metadata proves it: no
|
|
4395
4445
|
* invocation-scoped idempotency, no execution fence, not SQL, and either a
|
|
@@ -7355,6 +7405,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
7355
7405
|
private async resolveToolAuthScopeDigest(
|
|
7356
7406
|
toolId: string,
|
|
7357
7407
|
): Promise<string | null> {
|
|
7408
|
+
const named = namedWorkspaceTool.getStore();
|
|
7409
|
+
if (named?.toolId === toolId) return named.digest;
|
|
7358
7410
|
const configured = await this.#options.getToolAuthScopeDigest?.(toolId);
|
|
7359
7411
|
if (typeof configured === 'string' && configured.trim()) {
|
|
7360
7412
|
return configured.trim();
|
|
@@ -7366,6 +7418,73 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
7366
7418
|
this.#options.invalidateToolAuthScopeDigest?.(toolId);
|
|
7367
7419
|
}
|
|
7368
7420
|
|
|
7421
|
+
private async withNamedWorkspaceTool<T>(
|
|
7422
|
+
toolId: string,
|
|
7423
|
+
name: string,
|
|
7424
|
+
execute: () => Promise<T>,
|
|
7425
|
+
): Promise<T> {
|
|
7426
|
+
if (!isToolConnectionName(name)) {
|
|
7427
|
+
throw new Error('Choose a valid workspace connection name.');
|
|
7428
|
+
}
|
|
7429
|
+
if (
|
|
7430
|
+
rowContext.getStore() ||
|
|
7431
|
+
authoredStepContext.getStore() ||
|
|
7432
|
+
this.activeInlineComposition ||
|
|
7433
|
+
this.pureMapExecutionActive
|
|
7434
|
+
) {
|
|
7435
|
+
throw new Error(
|
|
7436
|
+
'Named workspace connections currently require a tool call in the Play entry function.',
|
|
7437
|
+
);
|
|
7438
|
+
}
|
|
7439
|
+
const { baseUrl, executorToken } = this.#options;
|
|
7440
|
+
if (!baseUrl || !executorToken)
|
|
7441
|
+
throw new Error(
|
|
7442
|
+
'Named workspace connections require a Deepline Play run.',
|
|
7443
|
+
);
|
|
7444
|
+
const path = `/api/v2/plays/runtime-tools/${encodeURIComponent(toolId)}/auth-scope`;
|
|
7445
|
+
const url = new URL(path, baseUrl);
|
|
7446
|
+
url.searchParams.set('connection', name);
|
|
7447
|
+
const response = await fetch(url, {
|
|
7448
|
+
headers: {
|
|
7449
|
+
Authorization: `Bearer ${executorToken}`,
|
|
7450
|
+
...(await this.vercelProtectionHeaders()),
|
|
7451
|
+
},
|
|
7452
|
+
redirect: 'error',
|
|
7453
|
+
signal: AbortSignal.timeout(15_000),
|
|
7454
|
+
});
|
|
7455
|
+
const result = await response.json().catch(() => null);
|
|
7456
|
+
const binding = result?.workspaceConnection;
|
|
7457
|
+
if (!response.ok)
|
|
7458
|
+
throw new Error(
|
|
7459
|
+
typeof result?.error === 'string'
|
|
7460
|
+
? result.error
|
|
7461
|
+
: 'Could not resolve the named workspace connection.',
|
|
7462
|
+
);
|
|
7463
|
+
if (
|
|
7464
|
+
binding?.name !== name ||
|
|
7465
|
+
typeof binding.id !== 'string' ||
|
|
7466
|
+
!Number.isSafeInteger(binding.grantGeneration) ||
|
|
7467
|
+
typeof result?.digest !== 'string' ||
|
|
7468
|
+
!result.digest ||
|
|
7469
|
+
typeof result?.rateScope?.bucketId !== 'string' ||
|
|
7470
|
+
typeof result.rateScope.token !== 'string'
|
|
7471
|
+
)
|
|
7472
|
+
throw new Error(
|
|
7473
|
+
'The runtime gateway did not confirm the named workspace connection.',
|
|
7474
|
+
);
|
|
7475
|
+
return namedWorkspaceTool.run(
|
|
7476
|
+
{
|
|
7477
|
+
toolId,
|
|
7478
|
+
name,
|
|
7479
|
+
id: binding.id,
|
|
7480
|
+
grantGeneration: binding.grantGeneration,
|
|
7481
|
+
digest: result.digest,
|
|
7482
|
+
rateScope: result.rateScope,
|
|
7483
|
+
},
|
|
7484
|
+
execute,
|
|
7485
|
+
);
|
|
7486
|
+
}
|
|
7487
|
+
|
|
7369
7488
|
#replayUnsafeMarker: Promise<void> | null = null;
|
|
7370
7489
|
|
|
7371
7490
|
/**
|
|
@@ -15103,14 +15222,44 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
15103
15222
|
'Call the Google Calendar booking tool directly in the admitted Play.',
|
|
15104
15223
|
);
|
|
15105
15224
|
}
|
|
15225
|
+
const refreshed =
|
|
15226
|
+
this.#options.cachePolicy?.forceToolRefresh === true ||
|
|
15227
|
+
toolExecutionOverrides.getStore()?.force === true;
|
|
15228
|
+
// The run's internal reuse window (`cacheReuseWindowSeconds`). A refresh
|
|
15229
|
+
// and an authored `force` still win over it.
|
|
15230
|
+
const reuseWindow =
|
|
15231
|
+
refreshed || options?.force === true
|
|
15232
|
+
? undefined
|
|
15233
|
+
: this.#options.cachePolicy?.cacheReuseWindowSeconds;
|
|
15106
15234
|
if (!this.usesExplicitFreshness) {
|
|
15107
15235
|
this.reuseCountSupported = false;
|
|
15108
|
-
|
|
15236
|
+
let legacyOptions = options;
|
|
15237
|
+
if (reuseWindow) {
|
|
15238
|
+
const eventWait = Boolean(
|
|
15239
|
+
await this.#options.getIntegrationEventWaitHandler?.(toolId),
|
|
15240
|
+
);
|
|
15241
|
+
const verdict = reusableWindowEligibility({
|
|
15242
|
+
kind: 'tool',
|
|
15243
|
+
toolId,
|
|
15244
|
+
input,
|
|
15245
|
+
eventWait,
|
|
15246
|
+
});
|
|
15247
|
+
if (
|
|
15248
|
+
!('message' in verdict) &&
|
|
15249
|
+
(await this.cacheReuseWindowAdmits(toolId, input))
|
|
15250
|
+
) {
|
|
15251
|
+
legacyOptions = {
|
|
15252
|
+
...options,
|
|
15253
|
+
staleAfterSeconds: applyCacheReuseWindow(
|
|
15254
|
+
options?.staleAfterSeconds,
|
|
15255
|
+
reuseWindow,
|
|
15256
|
+
),
|
|
15257
|
+
};
|
|
15258
|
+
}
|
|
15259
|
+
}
|
|
15260
|
+
return this.executeToolLegacyInternal(key, toolId, input, legacyOptions);
|
|
15109
15261
|
}
|
|
15110
15262
|
const policy = resolveExplicitDurableCallPolicy(options ?? {});
|
|
15111
|
-
const refreshed =
|
|
15112
|
-
this.#options.cachePolicy?.forceToolRefresh === true ||
|
|
15113
|
-
toolExecutionOverrides.getStore()?.force === true;
|
|
15114
15263
|
// A refresh of an authored reusable read still publishes its fresh result
|
|
15115
15264
|
// as the request's newest shared result. An authored 0 never does.
|
|
15116
15265
|
const refreshMayPublish =
|
|
@@ -15177,7 +15326,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
15177
15326
|
throw new Error(reuseVerdict.message);
|
|
15178
15327
|
}
|
|
15179
15328
|
const eventWait =
|
|
15180
|
-
policy.effective === 0 && !refreshMayPublish
|
|
15329
|
+
policy.effective === 0 && !refreshMayPublish && !reuseWindow
|
|
15181
15330
|
? null
|
|
15182
15331
|
: ((await this.#options.getIntegrationEventWaitHandler?.(toolId)) ??
|
|
15183
15332
|
null);
|
|
@@ -15195,6 +15344,13 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
15195
15344
|
throw new Error(effectiveVerdict.message);
|
|
15196
15345
|
}
|
|
15197
15346
|
const mustExecuteEveryTime = 'message' in effectiveVerdict;
|
|
15347
|
+
if (
|
|
15348
|
+
reuseWindow &&
|
|
15349
|
+
!mustExecuteEveryTime &&
|
|
15350
|
+
(await this.cacheReuseWindowAdmits(toolId, input))
|
|
15351
|
+
) {
|
|
15352
|
+
policy.effective = applyCacheReuseWindow(policy.effective, reuseWindow);
|
|
15353
|
+
}
|
|
15198
15354
|
// A refresh of a reusable call still publishes its fresh result as the
|
|
15199
15355
|
// request's newest shared result; an authored 0 never does.
|
|
15200
15356
|
const publishLatestOnRefresh = refreshMayPublish && !mustExecuteEveryTime;
|
|
@@ -16838,7 +16994,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
16838
16994
|
} catch (error) {
|
|
16839
16995
|
if (
|
|
16840
16996
|
!(error instanceof ToolExecuteAuthScopeChangedError) ||
|
|
16841
|
-
authScopeAttempt > 0
|
|
16997
|
+
authScopeAttempt > 0 ||
|
|
16998
|
+
namedWorkspaceTool.getStore() !== undefined
|
|
16842
16999
|
) {
|
|
16843
17000
|
throw error;
|
|
16844
17001
|
}
|
|
@@ -16974,7 +17131,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
16974
17131
|
// durable can still repeat the finalizer on a later attempt.
|
|
16975
17132
|
if (timeoutFinalizedAt === undefined && handler.onTimeout) {
|
|
16976
17133
|
try {
|
|
16977
|
-
await handler.onTimeout({
|
|
17134
|
+
const finalized = await handler.onTimeout({
|
|
16978
17135
|
payload: input,
|
|
16979
17136
|
context: eventContext,
|
|
16980
17137
|
boundary: {
|
|
@@ -16995,6 +17152,29 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
16995
17152
|
...(timeoutPolicy ? { timeoutPolicy } : {}),
|
|
16996
17153
|
},
|
|
16997
17154
|
});
|
|
17155
|
+
if (finalized && finalized.resolvedOutput) {
|
|
17156
|
+
// The provider owner arbitrates a reply racing the scheduler's
|
|
17157
|
+
// timeout. Persist its winning outcome before the Play consumes it.
|
|
17158
|
+
existing.output = finalized.resolvedOutput;
|
|
17159
|
+
this.checkpoint.resolvedBoundaries = {
|
|
17160
|
+
...(this.checkpoint.resolvedBoundaries ?? {}),
|
|
17161
|
+
[preparedBoundary.boundaryId]: {
|
|
17162
|
+
...existing,
|
|
17163
|
+
timeoutFinalizedAt: Date.now(),
|
|
17164
|
+
},
|
|
17165
|
+
};
|
|
17166
|
+
this.#options.onBatchComplete?.(this.checkpoint);
|
|
17167
|
+
return await this.wrapToolExecutionResult({
|
|
17168
|
+
toolId,
|
|
17169
|
+
status: 'completed',
|
|
17170
|
+
result: existing.output,
|
|
17171
|
+
toolResponse: { rawV2: existing.output, view: 'rawV2' },
|
|
17172
|
+
execution: toolExecutionMetadataForOutcome({
|
|
17173
|
+
kind: 'checkpoint',
|
|
17174
|
+
cacheKey: `integration_event:${preparedBoundary.boundaryId}`,
|
|
17175
|
+
}),
|
|
17176
|
+
});
|
|
17177
|
+
}
|
|
16998
17178
|
timeoutFinalizedAt = Date.now();
|
|
16999
17179
|
} catch (error) {
|
|
17000
17180
|
this.recordSlackHitlTimeoutFailure(error);
|
|
@@ -17051,6 +17231,27 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
17051
17231
|
this.runtimeLog(
|
|
17052
17232
|
`Integration event ${preparedBoundary.boundaryId}: recovered response from checkpoint`,
|
|
17053
17233
|
);
|
|
17234
|
+
const outputProjection =
|
|
17235
|
+
existing.outputProjection ?? preparedBoundary.outputProjection;
|
|
17236
|
+
const eventOutput = recordOrNull(existing.output);
|
|
17237
|
+
if (
|
|
17238
|
+
outputProjection === 'event_payload' &&
|
|
17239
|
+
eventOutput?.timed_out !== true &&
|
|
17240
|
+
eventOutput &&
|
|
17241
|
+
'event_payload' in eventOutput
|
|
17242
|
+
) {
|
|
17243
|
+
const providerOutput = recordOrNull(eventOutput.event_payload);
|
|
17244
|
+
if (!providerOutput)
|
|
17245
|
+
throw new Error(
|
|
17246
|
+
'The integration event has no provider reply payload.',
|
|
17247
|
+
);
|
|
17248
|
+
existing.output = providerOutput;
|
|
17249
|
+
this.checkpoint.resolvedBoundaries = {
|
|
17250
|
+
...(this.checkpoint.resolvedBoundaries ?? {}),
|
|
17251
|
+
[preparedBoundary.boundaryId]: { ...existing, outputProjection },
|
|
17252
|
+
};
|
|
17253
|
+
this.#options.onBatchComplete?.(this.checkpoint);
|
|
17254
|
+
}
|
|
17054
17255
|
// Wrapped like every other tool result (toolOutput.raw, getters) — the
|
|
17055
17256
|
// non-suspending runtimes (workers' synthetic wait interception) hand
|
|
17056
17257
|
// plays a wrapped ToolExecuteResult, so the resume replay must too.
|
|
@@ -17095,7 +17296,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
17095
17296
|
});
|
|
17096
17297
|
// An unanswered checkpoint suspends above without re-arming the provider.
|
|
17097
17298
|
// New boundaries receive one absolute expiry, persisted for later replays.
|
|
17098
|
-
const eventExpiresAtMs =
|
|
17299
|
+
const eventExpiresAtMs =
|
|
17300
|
+
boundary.eventExpiresAtMs ?? Date.now() + boundary.timeoutMs;
|
|
17099
17301
|
|
|
17100
17302
|
if (boundary.resolvedOutput) {
|
|
17101
17303
|
this.checkpoint.resolvedBoundaries = {
|
|
@@ -17108,6 +17310,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
17108
17310
|
provider: boundary.provider,
|
|
17109
17311
|
toolId: boundary.toolId,
|
|
17110
17312
|
output: boundary.resolvedOutput,
|
|
17313
|
+
...(boundary.outputProjection
|
|
17314
|
+
? { outputProjection: boundary.outputProjection }
|
|
17315
|
+
: {}),
|
|
17111
17316
|
...(boundary.timeoutPolicy
|
|
17112
17317
|
? { timeoutPolicy: boundary.timeoutPolicy }
|
|
17113
17318
|
: {}),
|
|
@@ -17157,6 +17362,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
17157
17362
|
eventExpiresAtMs,
|
|
17158
17363
|
provider: boundary.provider,
|
|
17159
17364
|
toolId: boundary.toolId,
|
|
17365
|
+
...(boundary.outputProjection
|
|
17366
|
+
? { outputProjection: boundary.outputProjection }
|
|
17367
|
+
: {}),
|
|
17160
17368
|
...(boundary.requestKey ? { requestKey: boundary.requestKey } : {}),
|
|
17161
17369
|
...(boundary.interactionId
|
|
17162
17370
|
? { interactionId: boundary.interactionId }
|
|
@@ -21550,6 +21758,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
21550
21758
|
'executorToken and baseUrl are required for tool API calls (cloud execution only)',
|
|
21551
21759
|
);
|
|
21552
21760
|
}
|
|
21761
|
+
const selected = namedWorkspaceTool.getStore();
|
|
21762
|
+
const named = selected?.toolId === toolId ? selected : undefined;
|
|
21553
21763
|
const requestsDurableInvocationFence =
|
|
21554
21764
|
this.#options.requestDurableInvocationFence === true ||
|
|
21555
21765
|
this.#options.durableInvocationFence === true;
|
|
@@ -21605,8 +21815,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
21605
21815
|
// Keep receipts, runner heartbeats, terminals, sheets, and runtime control
|
|
21606
21816
|
// on baseUrl (the receipt gateway). Only the potentially long-lived
|
|
21607
21817
|
// provider request may use the separately managed execution relay.
|
|
21608
|
-
const executionBaseUrl =
|
|
21609
|
-
|
|
21818
|
+
const executionBaseUrl = named
|
|
21819
|
+
? this.#options.baseUrl
|
|
21820
|
+
: this.#options.executionGatewayBaseUrl?.trim() || this.#options.baseUrl;
|
|
21610
21821
|
const toolErrorSchemaVersion = this.currentToolErrorSchemaVersion;
|
|
21611
21822
|
const providerNoProgressScope = stableDigest(
|
|
21612
21823
|
`${provider}\u0000${executionAuthScopeDigest ?? ''}`,
|
|
@@ -21794,6 +22005,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
21794
22005
|
// support execute-fenced-v2 while ordinary provider calls continue
|
|
21795
22006
|
// through /execute with no durable-operation metadata at all.
|
|
21796
22007
|
const usesDurableInvocationFence =
|
|
22008
|
+
!named &&
|
|
21797
22009
|
requestsDurableInvocationFence &&
|
|
21798
22010
|
requiresExecutionFence &&
|
|
21799
22011
|
!uncachedAsyncLifecycleCall;
|
|
@@ -21832,7 +22044,10 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
21832
22044
|
DURABLE_INVOCATION_FENCE_VERSION,
|
|
21833
22045
|
)
|
|
21834
22046
|
: 'execute';
|
|
21835
|
-
const
|
|
22047
|
+
const executePath = named
|
|
22048
|
+
? `/api/v2/tools/${encodeURIComponent(toolId)}/execute-with-connection`
|
|
22049
|
+
: integrationExecutePath(toolId, executeSuffix);
|
|
22050
|
+
const url = `${executionBaseUrl.replace(/\/$/, '')}${executePath}`;
|
|
21836
22051
|
const fixtureReplaySafe = this.#options.integrationMode === 'fixture';
|
|
21837
22052
|
const readOnlyQuery = isQueryResultDatasetReadRequest(
|
|
21838
22053
|
toolId,
|
|
@@ -22063,6 +22278,13 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
22063
22278
|
} | null = null;
|
|
22064
22279
|
const serializedRequestBody = (invocationAttempt: number) =>
|
|
22065
22280
|
JSON.stringify({
|
|
22281
|
+
...(named
|
|
22282
|
+
? {
|
|
22283
|
+
connection: named.name,
|
|
22284
|
+
connectionId: named.id,
|
|
22285
|
+
authorizationVersion: named.grantGeneration,
|
|
22286
|
+
}
|
|
22287
|
+
: {}),
|
|
22066
22288
|
payload: shouldResolveAsyncOperationInRuntime
|
|
22067
22289
|
? asyncOperationLaunchInput(asyncContract!, toolInputSnapshot)
|
|
22068
22290
|
: toolInputSnapshot,
|
|
@@ -23064,6 +23286,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
23064
23286
|
// actual receiver. Older gateways refuse this path
|
|
23065
23287
|
// before admission; direct app routes do not serve it.
|
|
23066
23288
|
dispatchedWithProviderPermit =
|
|
23289
|
+
!named &&
|
|
23067
23290
|
!providerPermitReceiverUnavailable &&
|
|
23068
23291
|
providerGatewayDispatchProof?.dispatchValidationSupported ===
|
|
23069
23292
|
true;
|
|
@@ -693,6 +693,8 @@ export type PlayExecutionEvent =
|
|
|
693
693
|
* than repeated — or invented — per row.
|
|
694
694
|
*/
|
|
695
695
|
bornFrom?: PlayDatasetBornFrom;
|
|
696
|
+
/** Stored column names in the order the run wrote them (row keys, then withColumns). Absent from older runs. */
|
|
697
|
+
columns?: string[];
|
|
696
698
|
at: number;
|
|
697
699
|
}
|
|
698
700
|
| {
|
|
@@ -806,6 +808,8 @@ export type IntegrationEventWaitBoundary = {
|
|
|
806
808
|
boundaryId: string;
|
|
807
809
|
eventKey: string;
|
|
808
810
|
timeoutMs: number;
|
|
811
|
+
/** Owner's absolute deadline; old providers may omit it. */
|
|
812
|
+
eventExpiresAtMs?: number;
|
|
809
813
|
provider: string;
|
|
810
814
|
toolId: string;
|
|
811
815
|
messageRef?: {
|
|
@@ -817,6 +821,8 @@ export type IntegrationEventWaitBoundary = {
|
|
|
817
821
|
interactionId?: string;
|
|
818
822
|
/** A previously completed identical request can resolve without parking. */
|
|
819
823
|
resolvedOutput?: Record<string, unknown>;
|
|
824
|
+
/** Absent preserves the historical scheduler event envelope. */
|
|
825
|
+
outputProjection?: 'event_payload';
|
|
820
826
|
/**
|
|
821
827
|
* Optional control-plane timeout behavior. Missing preserves the legacy
|
|
822
828
|
* "return the timed_out result" replay behavior for older app deployments.
|
|
@@ -856,7 +862,7 @@ export type IntegrationEventWaitHandler = {
|
|
|
856
862
|
payload: Record<string, unknown>;
|
|
857
863
|
context: IntegrationEventWaitRuntimeContext;
|
|
858
864
|
boundary: IntegrationEventWaitBoundary;
|
|
859
|
-
}) => Promise<void>;
|
|
865
|
+
}) => Promise<void | { resolvedOutput: Record<string, unknown> }>;
|
|
860
866
|
/**
|
|
861
867
|
* When set, timeout finalization is side-effect-only: the Play stays parked
|
|
862
868
|
* instead of consuming a `timed_out` result.
|
|
@@ -973,11 +979,16 @@ export interface ContextOptions {
|
|
|
973
979
|
* runs; a resumed attempt of the current run reuses its completed receipts.
|
|
974
980
|
* forceFailedToolRefresh reclaims only failed receipts, preserving completed
|
|
975
981
|
* provider-call idempotency while allowing forced repair runs to make progress.
|
|
982
|
+
* cacheReuseWindowSeconds (internal, `play_run.cache_reuse_window`) lets each
|
|
983
|
+
* tool call that `reusableWindowEligibility` allows reuse completed results
|
|
984
|
+
* up to this many seconds old, an authored 0 included. forceToolRefresh and
|
|
985
|
+
* an authored `force` win over it.
|
|
976
986
|
*/
|
|
977
987
|
cachePolicy?: {
|
|
978
988
|
forceStepRefresh?: boolean;
|
|
979
989
|
forceToolRefresh?: boolean;
|
|
980
990
|
forceFailedToolRefresh?: boolean;
|
|
991
|
+
cacheReuseWindowSeconds?: number;
|
|
981
992
|
};
|
|
982
993
|
/** Called after each durable batch completes for scheduler checkpointing. */
|
|
983
994
|
onBatchComplete?: (checkpoint: PlayCheckpoint) => void;
|
|
@@ -1164,6 +1175,13 @@ export interface ContextOptions {
|
|
|
1164
1175
|
getToolReusableResultSupport?: (
|
|
1165
1176
|
toolId: string,
|
|
1166
1177
|
) => Promise<{ supported: boolean; unavailableReason: string | null }>;
|
|
1178
|
+
/**
|
|
1179
|
+
* What one call can change, from the catalog. Null when the metadata
|
|
1180
|
+
* predates the field: callers treat that as a write.
|
|
1181
|
+
*/
|
|
1182
|
+
getToolEffect?: (
|
|
1183
|
+
toolId: string,
|
|
1184
|
+
) => Promise<'read' | 'write' | 'destructive' | null>;
|
|
1167
1185
|
getToolRetryPolicy?: (
|
|
1168
1186
|
toolId: string,
|
|
1169
1187
|
input: Record<string, unknown>,
|
|
@@ -1449,6 +1467,7 @@ export interface PlayCheckpoint {
|
|
|
1449
1467
|
* Missing fields preserve legacy checkpoint replay behavior.
|
|
1450
1468
|
*/
|
|
1451
1469
|
timeoutPolicy?: IntegrationEventWaitBoundary['timeoutPolicy'];
|
|
1470
|
+
outputProjection?: IntegrationEventWaitBoundary['outputProjection'];
|
|
1452
1471
|
output?: unknown;
|
|
1453
1472
|
completedAt?: number;
|
|
1454
1473
|
/** Timestamp of the successful provider timeout finalizer, if any. */
|