deepline 0.3.535 → 0.3.536
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 +232 -147
- package/dist/bundling-sources/sdk/src/index.ts +4 -0
- package/dist/bundling-sources/sdk/src/plays/local-file-discovery.ts +27 -1
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +16 -5
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +2 -23
- package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +26 -14
- package/dist/bundling-sources/shared_libs/integration-contracts/monitor-input-contract.ts +33 -8
- package/dist/bundling-sources/shared_libs/monitors/fleets/count-drift-alert.ts +121 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +8 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +14 -82
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +4 -4
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +0 -26
- package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +21 -31
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +88 -96
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +12 -10
- package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +71 -2
- package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +127 -9
- package/dist/bundling-sources/shared_libs/play-runtime/memory-ledger.ts +15 -2
- package/dist/bundling-sources/shared_libs/play-runtime/prebuilt-result-quality.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/fixture-capacity-simulator.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/gradient2-concurrency-controller.ts +41 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-capacity-policy.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-concurrency-policy.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +5 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +8 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +26 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-scope.ts +11 -4
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +73 -18
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +169 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +26 -4
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +84 -49
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -32
- package/dist/bundling-sources/shared_libs/plays/launch/input-contract.ts +13 -1
- package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +68 -1
- package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +57 -1
- package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +22 -9
- package/dist/cli/auth-6XQKFOLG.js +43 -0
- package/dist/cli/{auth-ZCTMB5RA.mjs → auth-KCTCUO7P.mjs} +7 -7
- package/dist/cli/{billing-GVFKZQH3.js → billing-4VBGZ3CT.js} +273 -112
- package/dist/cli/{billing-OU2ZHL72.mjs → billing-OOJHKLNS.mjs} +185 -24
- package/dist/cli/{chunk-FGN75ZN6.js → chunk-2B4IOGFD.js} +390 -382
- package/dist/cli/{chunk-KOZBZPRM.js → chunk-2FCSUOYN.js} +55 -55
- package/dist/cli/{chunk-T2N3B7IQ.js → chunk-2GJZLIKW.js} +8 -8
- package/dist/cli/{chunk-AUEUAPVS.mjs → chunk-2YWJS76L.mjs} +1 -1
- package/dist/cli/{chunk-W5YJYU4G.mjs → chunk-3PCYV6ZJ.mjs} +2 -2
- package/dist/cli/{chunk-UUQ2OXMH.js → chunk-4E5JXZ3W.js} +18 -20
- package/dist/cli/{chunk-R4RG4FV5.mjs → chunk-4KWD3MX2.mjs} +13 -10
- package/dist/cli/{chunk-XSOTEVOB.js → chunk-6BBGUQJJ.js} +50 -141
- package/dist/cli/{chunk-PHLNYBAA.js → chunk-6VUGBQZQ.js} +5 -5
- package/dist/cli/{chunk-G2DLG32W.mjs → chunk-AB2GBOD4.mjs} +40 -27
- package/dist/cli/{chunk-JWWYLGUT.mjs → chunk-ANUKBZ6W.mjs} +475 -11
- package/dist/cli/{chunk-FZKPPB5P.mjs → chunk-BASLYGXK.mjs} +85 -77
- package/dist/cli/{chunk-SQWET4SL.js → chunk-BBTKAASQ.js} +2 -1
- package/dist/cli/{chunk-NRO3NTVO.js → chunk-CBV7AKWM.js} +5 -5
- package/dist/cli/{chunk-PI5R65OQ.js → chunk-CIDN5K23.js} +1 -1
- package/dist/cli/{chunk-QNHHZ63P.mjs → chunk-CQBIO6HW.mjs} +1 -1
- package/dist/cli/{chunk-2KHUFWTK.js → chunk-CQDQNZGH.js} +42 -37
- package/dist/cli/{chunk-D4MHCCIR.js → chunk-CWSLUNA6.js} +33 -33
- package/dist/cli/{chunk-E3CLOVG5.mjs → chunk-CXTW7SRW.mjs} +50 -141
- package/dist/cli/{chunk-H6SWS5CG.mjs → chunk-DA2I2M7D.mjs} +2 -2
- package/dist/cli/{chunk-WAIBM6KX.mjs → chunk-DQHUJMCL.mjs} +5 -5
- package/dist/cli/{chunk-DWPY6ZID.mjs → chunk-DUYAMLOC.mjs} +1 -1
- package/dist/cli/{chunk-K53NKWZO.mjs → chunk-E24UGPGG.mjs} +13 -15
- package/dist/cli/{chunk-STR5LXK4.mjs → chunk-FSIVF2SI.mjs} +1 -1
- package/dist/cli/{chunk-7R5DAANG.mjs → chunk-GF32SBST.mjs} +1 -1
- package/dist/cli/{chunk-7CWSAEYS.mjs → chunk-GHLDCLSC.mjs} +1 -1
- package/dist/cli/{chunk-ZUVE63Y7.js → chunk-GTVZKY3F.js} +2 -2
- package/dist/cli/{chunk-J75DANZY.mjs → chunk-HAJQGP5V.mjs} +2 -2
- package/dist/cli/{chunk-RFQWSH6I.js → chunk-HWDKRN7L.js} +3 -3
- package/dist/cli/{chunk-5YAJGRWB.js → chunk-IPVRMYWT.js} +7 -7
- package/dist/cli/{chunk-ZPGGW27Q.mjs → chunk-JL2OTMSG.mjs} +1 -0
- package/dist/cli/{chunk-K76AEBFY.mjs → chunk-JUHDJNSI.mjs} +4 -4
- package/dist/cli/{chunk-R2KKEHJN.mjs → chunk-KPQHUVYW.mjs} +5 -5
- package/dist/cli/{chunk-6LHX33VN.js → chunk-KWYGWO4Y.js} +9 -6
- package/dist/cli/{chunk-7PXP2FQK.js → chunk-LDGZFDUB.js} +2 -2
- package/dist/cli/{chunk-KWGXHPHL.js → chunk-LN6RXDTB.js} +523 -59
- package/dist/cli/{chunk-TCVCFZP6.mjs → chunk-LZXZQPA2.mjs} +4 -1
- package/dist/cli/{chunk-2D6SWQTK.js → chunk-MSP4DTSD.js} +13 -13
- package/dist/cli/{chunk-BNH4Y35W.mjs → chunk-OLH2PHMC.mjs} +2 -2
- package/dist/cli/{chunk-QYBAHYP4.mjs → chunk-OUDTOMZC.mjs} +7 -9
- package/dist/cli/{chunk-GESIFFQX.mjs → chunk-OVX3Q5Q3.mjs} +1 -1
- package/dist/cli/{chunk-6TYRRNXY.mjs → chunk-PNY3BWHP.mjs} +2 -2
- package/dist/cli/{chunk-DYIWDUY4.js → chunk-Q4MNUOS4.js} +316 -303
- package/dist/cli/{chunk-5EKNDNFQ.js → chunk-Q5CXV3E3.js} +2 -2
- package/dist/cli/{chunk-W6T23EUC.mjs → chunk-RVSSQPQO.mjs} +1 -1
- package/dist/cli/{chunk-WNNA4L6Z.js → chunk-SLPJ3LXI.js} +22 -22
- package/dist/cli/{chunk-K3IPGMGP.js → chunk-TX5TUHJN.js} +17 -19
- package/dist/cli/{chunk-IF75RD6U.js → chunk-U2LVWCTD.js} +18 -6
- package/dist/cli/{chunk-ZS2WHWWL.js → chunk-UNDLNT3V.js} +1 -1
- package/dist/cli/{chunk-4NLRWKZB.js → chunk-VBDZIMWD.js} +26 -26
- package/dist/cli/{chunk-DAPKLYST.js → chunk-W7AEIGZR.js} +41 -41
- package/dist/cli/{chunk-LVISZFYO.mjs → chunk-WC5M3JXE.mjs} +2 -2
- package/dist/cli/{chunk-C374C22Y.js → chunk-WOQO3GV4.js} +14 -11
- package/dist/cli/{chunk-243O3FH5.js → chunk-XBAH3TKU.js} +5 -5
- package/dist/cli/{chunk-DFJODFMC.mjs → chunk-XJD2GYUP.mjs} +5 -5
- package/dist/cli/{chunk-BF65LB7X.mjs → chunk-XVZRJJDS.mjs} +4 -4
- package/dist/cli/{chunk-OM732MGV.js → chunk-Y2NTPYGS.js} +17 -17
- package/dist/cli/{chunk-YFZLZNTH.mjs → chunk-YBMHOH6H.mjs} +4 -4
- package/dist/cli/{chunk-RKY4LBX3.mjs → chunk-YRLAUGQY.mjs} +3 -3
- package/dist/cli/{chunk-FKD3KL5Q.mjs → chunk-Z2XA6YU4.mjs} +10 -5
- package/dist/cli/{chunk-JQQG4QL4.mjs → chunk-Z7UIOGW4.mjs} +3 -3
- package/dist/cli/{chunk-HYBZWSSH.js → chunk-ZEV2Y56V.js} +44 -44
- package/dist/cli/{chunk-MI6ZP7XI.mjs → chunk-ZG7BOECV.mjs} +18 -6
- package/dist/cli/{chunk-HWPOXCCK.js → chunk-ZILSRDIN.js} +8 -8
- package/dist/cli/{chunk-CIDATNTY.js → chunk-ZISEH7OL.js} +16 -16
- package/dist/cli/{chunk-KA6ZERJL.js → chunk-ZZ4MF2GI.js} +6 -6
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-CD55KEIO.js → csv-2V2DIFNG.js} +15 -15
- package/dist/cli/{csv-CLPVMIRF.mjs → csv-P3HLK4GO.mjs} +6 -6
- package/dist/cli/{db-MQKLDAEO.js → db-MREAQVW6.js} +36 -36
- package/dist/cli/{db-AU4SMWUN.mjs → db-ZYOY3QRQ.mjs} +9 -9
- package/dist/cli/describe-IKZFOADR.mjs +49 -0
- package/dist/cli/describe-WW3OQRLP.js +49 -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 +5 -5
- package/dist/cli/describe-core.mjs +4 -4
- package/dist/cli/{executions-77GOLWRM.js → executions-H5IJ7QSQ.js} +11 -11
- package/dist/cli/{executions-TFIJPUX7.mjs → executions-KTSY5M34.mjs} +9 -9
- package/dist/cli/{feedback-OV5YAL3A.js → feedback-724QK3Z5.js} +16 -16
- package/dist/cli/{feedback-2WRSZ5WL.mjs → feedback-WWJRIXEU.mjs} +8 -8
- package/dist/cli/git-PHYRD56H.js +25 -0
- package/dist/cli/{git-VNS4ATLZ.mjs → git-R5VRG7X6.mjs} +7 -7
- package/dist/cli/index.js +151 -157
- package/dist/cli/index.mjs +51 -57
- package/dist/cli/{legacy-noops-HDOB5C6F.js → legacy-noops-C6GDEGPU.js} +11 -11
- package/dist/cli/{legacy-noops-C732QDCY.mjs → legacy-noops-PWZ5XLAO.mjs} +8 -8
- package/dist/cli/{monitors-5IUMHH3E.js → monitors-VAVQ4WCE.js} +125 -122
- package/dist/cli/{monitors-2LYEFXOU.mjs → monitors-WQSKMHAP.mjs} +19 -16
- package/dist/cli/{org-ADW2EVAC.js → org-CWWRWXZQ.js} +89 -89
- package/dist/cli/{org-G4YGZPHS.mjs → org-MAL4QPVF.mjs} +9 -9
- package/dist/cli/{play-7GQ56C2D.mjs → play-ILW6MSNG.mjs} +123 -76
- package/dist/cli/{play-EHSOSSHT.js → play-WJOWK5PQ.js} +641 -594
- package/dist/cli/{providers-WL3YTCSV.mjs → providers-4V2NMLZZ.mjs} +9 -9
- package/dist/cli/{providers-PWCF6OOO.js → providers-W662ANCH.js} +12 -12
- package/dist/cli/{quickstart-ZKI5MURA.js → quickstart-BW6EBUYX.js} +8 -8
- package/dist/cli/{quickstart-323XOPGI.mjs → quickstart-C22BR743.mjs} +6 -6
- package/dist/cli/{run-XZPWA6JS.js → run-KW7KW4FX.js} +50 -53
- package/dist/cli/{run-ZCNZU3K2.mjs → run-SPAU5IMW.mjs} +31 -34
- package/dist/cli/search-HLE54W5G.js +32 -0
- package/dist/cli/{search-CVLVSFMJ.mjs → search-XPC75HLM.mjs} +10 -11
- package/dist/cli/{search-output-6PY6RN2R.mjs → search-output-JKYJSEPM.mjs} +6 -6
- package/dist/cli/{search-output-7HRSSRBS.js → search-output-VJYE7USJ.js} +8 -8
- package/dist/cli/{secrets-6S2ZWDIM.mjs → secrets-OJG73GXQ.mjs} +9 -9
- package/dist/cli/{secrets-IYD5VKY4.js → secrets-YB57KGSB.js} +18 -18
- package/dist/cli/{sessions-GVEX5TUJ.mjs → sessions-7ZL37BW4.mjs} +8 -8
- package/dist/cli/sessions-VEBYZIEU.js +22 -0
- package/dist/cli/{settings-CANK4HJQ.js → settings-A7DD2ZYE.js} +88 -89
- package/dist/cli/{settings-BN5MJZ3C.mjs → settings-RKSQB7FA.mjs} +15 -16
- package/dist/cli/{setup-JNMSCCU4.mjs → setup-NXDUTITY.mjs} +11 -12
- package/dist/cli/{setup-YSGKGLSJ.js → setup-S3K5YU62.js} +51 -52
- package/dist/cli/skills-NVQ744CN.js +36 -0
- package/dist/cli/{skills-QCQN2UM2.mjs → skills-VMFAIDO6.mjs} +9 -10
- package/dist/cli/{tools-CDPOID7V.mjs → tools-52NTHBSJ.mjs} +20 -21
- package/dist/cli/tools-SBDUL3WB.js +56 -0
- package/dist/cli/update-HHVFZPCV.js +34 -0
- package/dist/cli/{update-D3ZERUQ3.mjs → update-SAKBEKMV.mjs} +11 -12
- package/dist/cli/{views-RDZRWQBQ.mjs → views-ACRV7MD6.mjs} +54 -10
- package/dist/cli/{views-4NV2KQKA.js → views-C3GJOBDG.js} +66 -22
- package/dist/cli/{workflow-2CG3TVCG.mjs → workflow-CS22E7TC.mjs} +10 -10
- package/dist/cli/{workflow-RABJCAZC.js → workflow-ZNWCZEGN.js} +20 -20
- package/dist/{client-DhSvMO3A.d.mts → client-BlLYQDNo.d.mts} +1 -1
- package/dist/{client-oGNJMQFd.d.ts → client-DSQlkIDO.d.ts} +1 -1
- package/dist/{client-core-CdWH6Sii.d.ts → client-core-CDwapXy5.d.ts} +159 -108
- package/dist/{client-core-CVG1Et-4.d.mts → client-core-rX7n2H8U.d.mts} +159 -108
- package/dist/{compiler-manifest-D2ZlBGxj.d.ts → compiler-manifest-BHNC4RL-.d.mts} +15 -22
- package/dist/{compiler-manifest-D2ZlBGxj.d.mts → compiler-manifest-BHNC4RL-.d.ts} +15 -22
- package/dist/{errors-B-gOQdj-.d.mts → errors-D7sPXrvB.d.mts} +1 -1
- package/dist/{errors-CB0KAmmV.d.ts → errors-lhtIWG5Z.d.ts} +1 -1
- package/dist/{index-c3nvUGCS.d.ts → index-CQTBHXHr.d.ts} +1 -1
- package/dist/{index-BbJADro4.d.mts → index-NaDZq2xf.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +15 -15
- package/dist/index.mjs +11 -11
- package/dist/install-integrity.json +129 -132
- package/dist/monitor-fleet-contract.d.mts +17 -11
- package/dist/monitor-fleet-contract.d.ts +17 -11
- package/dist/monitor-fleet-contract.js +3 -3
- package/dist/monitor-fleet-contract.mjs +2 -2
- package/dist/monitor-input-contract.js +2 -2
- package/dist/monitor-input-contract.mjs +1 -1
- 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 +17 -5
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- 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 +3 -3
- package/dist/plays/run-request.mjs +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 +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +12 -12
- package/dist/server.mjs +6 -6
- package/package.json +1 -1
- package/dist/cli/auth-VDCU3T6A.js +0 -43
- package/dist/cli/chunk-4QELPWUW.mjs +0 -405
- package/dist/cli/chunk-T7RBM2WX.js +0 -405
- package/dist/cli/describe-5BFNHT5V.js +0 -50
- package/dist/cli/describe-AWJUXE2U.mjs +0 -50
- package/dist/cli/git-HGMX52XU.js +0 -25
- package/dist/cli/pages-KXKWSCEV.mjs +0 -266
- package/dist/cli/pages-VTJGAI2D.js +0 -266
- package/dist/cli/search-J6EY7DQN.js +0 -33
- package/dist/cli/sessions-7HPIVSQ4.js +0 -22
- package/dist/cli/skills-WDGSSKJZ.js +0 -37
- package/dist/cli/tools-URNVXSTZ.js +0 -57
- package/dist/cli/update-Q6JW32IA.js +0 -35
|
@@ -376,7 +376,7 @@ type RuntimeApiRequest =
|
|
|
376
376
|
action: 'governor_budget_charge';
|
|
377
377
|
} & PlayRunnerBudgetChargeInput)
|
|
378
378
|
| { action: 'get_billing_entitlements' }
|
|
379
|
-
|
|
|
379
|
+
| { action: 'list_views' }
|
|
380
380
|
| { action: 'get_runtime_traffic_policy' }
|
|
381
381
|
| RuntimeReceiptAction;
|
|
382
382
|
|
|
@@ -2456,51 +2456,41 @@ export async function getBillingEntitlementsViaAppRuntime(
|
|
|
2456
2456
|
}
|
|
2457
2457
|
}
|
|
2458
2458
|
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
contentType: string;
|
|
2463
|
-
description?: string;
|
|
2464
|
-
/** Exactly one of these carries the content. */
|
|
2465
|
-
contentText?: string;
|
|
2466
|
-
contentBase64?: string;
|
|
2467
|
-
};
|
|
2468
|
-
|
|
2469
|
-
export type PlayPageWriteResult = {
|
|
2459
|
+
/** A view of the running Play, as `deepline.views.list()` returns it. */
|
|
2460
|
+
export type PlayViewLink = {
|
|
2461
|
+
id: string;
|
|
2470
2462
|
name: string;
|
|
2463
|
+
/** Opens the view at its latest run. */
|
|
2471
2464
|
url: string;
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2465
|
+
/** Opens the view at the run that asked. */
|
|
2466
|
+
runUrl: string;
|
|
2467
|
+
access: 'workspace' | 'public';
|
|
2475
2468
|
};
|
|
2476
2469
|
|
|
2477
|
-
export async function
|
|
2470
|
+
export async function listViewsViaAppRuntime(
|
|
2478
2471
|
context: WorkerRuntimeApiContext,
|
|
2479
|
-
|
|
2480
|
-
): Promise<PlayPageWriteResult> {
|
|
2472
|
+
): Promise<PlayViewLink[]> {
|
|
2481
2473
|
try {
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2474
|
+
const result = await postAppRuntimeApi<{ views: PlayViewLink[] }>(
|
|
2475
|
+
context,
|
|
2476
|
+
{ action: 'list_views' },
|
|
2477
|
+
);
|
|
2478
|
+
return result.views;
|
|
2486
2479
|
} catch (error) {
|
|
2487
|
-
// An older receiver does not know
|
|
2488
|
-
//
|
|
2489
|
-
// page.write, so either exact 403 means page writes are not available yet.
|
|
2480
|
+
// An older receiver does not know list_views. Say so instead of returning
|
|
2481
|
+
// an empty list, which would read as "this Play has no views".
|
|
2490
2482
|
if (
|
|
2491
2483
|
error instanceof AppRuntimeApiResponseError &&
|
|
2492
2484
|
error.status === 403 &&
|
|
2493
2485
|
error.code === null &&
|
|
2494
|
-
|
|
2495
|
-
error.detail ===
|
|
2496
|
-
'Workflow executor token does not permit this operation.')
|
|
2486
|
+
error.detail === 'Unsupported runtime action capability scope.'
|
|
2497
2487
|
) {
|
|
2498
2488
|
throw new AppRuntimeApiResponseError({
|
|
2499
|
-
action: '
|
|
2489
|
+
action: 'list_views',
|
|
2500
2490
|
status: 503,
|
|
2501
|
-
code: '
|
|
2491
|
+
code: 'VIEWS_UNAVAILABLE',
|
|
2502
2492
|
retryable: false,
|
|
2503
|
-
detail: '
|
|
2493
|
+
detail: 'Listing views is not available to this run yet.',
|
|
2504
2494
|
});
|
|
2505
2495
|
}
|
|
2506
2496
|
throw error;
|
|
@@ -68,7 +68,7 @@ import type { CompiledRequestBatch } from './batch-runtime';
|
|
|
68
68
|
import type { AnyBatchOperationStrategy } from './batching-types';
|
|
69
69
|
import {
|
|
70
70
|
getBillingEntitlementsViaAppRuntime,
|
|
71
|
-
|
|
71
|
+
listViewsViaAppRuntime,
|
|
72
72
|
type RuntimeApiResponseMeta,
|
|
73
73
|
} from './app-runtime-api';
|
|
74
74
|
import {
|
|
@@ -262,6 +262,7 @@ import {
|
|
|
262
262
|
TOOL_EXECUTE_PROVIDER_RATE_RETRY_SNAPSHOT_HEADER,
|
|
263
263
|
TOOL_EXECUTE_PROVIDER_PERMIT_PATH_SUFFIX,
|
|
264
264
|
TOOL_EXECUTE_PROVIDER_PERMIT_RECEIVER_HEADER,
|
|
265
|
+
isProviderPacingWaitResponse,
|
|
265
266
|
isProviderPermitExecuteReceiverUnavailable,
|
|
266
267
|
TOOL_EXECUTE_APP_PACING_REFUSAL_HEADER,
|
|
267
268
|
TOOL_EXECUTE_APP_PACING_REFUSAL_VALUE,
|
|
@@ -275,6 +276,7 @@ import {
|
|
|
275
276
|
ToolExecuteAuthScopeChangedError,
|
|
276
277
|
toolExecuteBillingRetryIdentity,
|
|
277
278
|
type ToolExecuteHttpFailureOutcome,
|
|
279
|
+
type ProviderServerErrorReplay,
|
|
278
280
|
} from './tool-execute-retry-policy';
|
|
279
281
|
import {
|
|
280
282
|
createToolHttpError,
|
|
@@ -328,10 +330,9 @@ import {
|
|
|
328
330
|
type PlaySecretPromise,
|
|
329
331
|
type PlaySqlQuery,
|
|
330
332
|
type PlayAuthoringRunScope,
|
|
331
|
-
type PlayAuthoringPageWriteOptions,
|
|
332
|
-
type PlayAuthoringPageWriteResult,
|
|
333
333
|
type PlayAuthoringRuntimeContext,
|
|
334
334
|
type PlayAuthoringRunStepsOptions,
|
|
335
|
+
hostedPagesRemovedMessage,
|
|
335
336
|
} from '../plays/authoring-contract';
|
|
336
337
|
import {
|
|
337
338
|
resolvePlayArtifactRuntimeContract,
|
|
@@ -447,6 +448,7 @@ import {
|
|
|
447
448
|
resolveRuntimeMapMemoryLimits,
|
|
448
449
|
RuntimeMapMemoryLimitError,
|
|
449
450
|
type RuntimeMapHeapAdmissionSnapshot,
|
|
451
|
+
type RuntimeMapTrackedRow,
|
|
450
452
|
} from './map-memory-limits';
|
|
451
453
|
import { RuntimeMapRowFeed } from './runtime-map-row-feed';
|
|
452
454
|
import {
|
|
@@ -463,6 +465,7 @@ import type { RuntimeMapRowFeedSnapshot } from './runtime-map-row-feed';
|
|
|
463
465
|
import { createRuntimeDispatchFlow, createRuntimeFlow } from './runtime-flow';
|
|
464
466
|
import {
|
|
465
467
|
createRuntimeMemoryLedger,
|
|
468
|
+
RUNTIME_MEMORY_LEDGER_OBJECT_PRIOR_FACTOR,
|
|
466
469
|
type RuntimeMemoryLedger,
|
|
467
470
|
type RuntimeMemoryLedgerHandle,
|
|
468
471
|
} from './memory-ledger';
|
|
@@ -2216,23 +2219,6 @@ function durableRetryErrorClassForHttpFailure(input: {
|
|
|
2216
2219
|
});
|
|
2217
2220
|
}
|
|
2218
2221
|
|
|
2219
|
-
/**
|
|
2220
|
-
* Whether a call retries durably. Only a call that sets its own `retry` does
|
|
2221
|
-
* for now; a call without one keeps the behaviour from before durable
|
|
2222
|
-
* retries (in-call retries, then the error reaches the Play).
|
|
2223
|
-
*
|
|
2224
|
-
* Temporary ordering, not a switch: prebuilt Plays typecheck against the SDK
|
|
2225
|
-
* Production runs, which gains `retry` only when this ships, so they cannot
|
|
2226
|
-
* bound their fallback legs yet. PR #10348 removes this predicate together
|
|
2227
|
-
* with the prebuilt `retry` legs, making durable retry every call's
|
|
2228
|
-
* behaviour.
|
|
2229
|
-
*/
|
|
2230
|
-
export function callOptsIntoDurableRetry(
|
|
2231
|
-
retry: PlayToolCallRetryPolicy | undefined,
|
|
2232
|
-
): boolean {
|
|
2233
|
-
return retry !== undefined;
|
|
2234
|
-
}
|
|
2235
|
-
|
|
2236
2222
|
/**
|
|
2237
2223
|
* A call's own `retry` governs its in-call resends too, like an activity
|
|
2238
2224
|
* RetryPolicy counts every attempt. A class it lists as `nonRetryable`, or
|
|
@@ -3069,7 +3055,7 @@ type ScalarPlayAuthoringRuntimeContext = Pick<
|
|
|
3069
3055
|
| 'tools'
|
|
3070
3056
|
| 'customerDb'
|
|
3071
3057
|
| 'billing'
|
|
3072
|
-
| '
|
|
3058
|
+
| 'views'
|
|
3073
3059
|
| 'run'
|
|
3074
3060
|
| 'tool'
|
|
3075
3061
|
| 'step'
|
|
@@ -3080,36 +3066,6 @@ type ScalarPlayAuthoringRuntimeContext = Pick<
|
|
|
3080
3066
|
| 'sleep'
|
|
3081
3067
|
>;
|
|
3082
3068
|
|
|
3083
|
-
/** Text stays text on the wire, so only real binary pays the base64 overhead. */
|
|
3084
|
-
function encodePageContent(
|
|
3085
|
-
name: string,
|
|
3086
|
-
options: PlayAuthoringPageWriteOptions,
|
|
3087
|
-
): { contentType: string } & (
|
|
3088
|
-
| { contentText: string }
|
|
3089
|
-
| { contentBase64: string }
|
|
3090
|
-
) {
|
|
3091
|
-
const { content, contentType } = options;
|
|
3092
|
-
if (typeof content === 'string') {
|
|
3093
|
-
return {
|
|
3094
|
-
contentType: contentType ?? 'text/plain; charset=utf-8',
|
|
3095
|
-
contentText: content,
|
|
3096
|
-
};
|
|
3097
|
-
}
|
|
3098
|
-
if (content instanceof Uint8Array || content instanceof ArrayBuffer) {
|
|
3099
|
-
return {
|
|
3100
|
-
contentType: contentType ?? 'application/octet-stream',
|
|
3101
|
-
contentBase64: Buffer.from(content as Uint8Array).toString('base64'),
|
|
3102
|
-
};
|
|
3103
|
-
}
|
|
3104
|
-
const contentText = JSON.stringify(content);
|
|
3105
|
-
if (contentText === undefined) {
|
|
3106
|
-
throw new Error(
|
|
3107
|
-
`ctx.pages.write("${name}") requires content: a string, bytes, or a JSON value.`,
|
|
3108
|
-
);
|
|
3109
|
-
}
|
|
3110
|
-
return { contentType: contentType ?? 'application/json', contentText };
|
|
3111
|
-
}
|
|
3112
|
-
|
|
3113
3069
|
export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
3114
3070
|
private rowStates = new Map<number, RowState>();
|
|
3115
3071
|
private toolCallQueue: ToolCallRequest[] = [];
|
|
@@ -3770,37 +3726,26 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
3770
3726
|
},
|
|
3771
3727
|
};
|
|
3772
3728
|
|
|
3773
|
-
readonly
|
|
3774
|
-
|
|
3775
|
-
name: string,
|
|
3776
|
-
options: PlayAuthoringPageWriteOptions,
|
|
3777
|
-
): Promise<PlayAuthoringPageWriteResult> => {
|
|
3729
|
+
readonly views = {
|
|
3730
|
+
list: () => {
|
|
3778
3731
|
this.assertNoPendingDurableSuspension();
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
name,
|
|
3797
|
-
public: options.public,
|
|
3798
|
-
description: options.description,
|
|
3799
|
-
...encodePageContent(name, options),
|
|
3800
|
-
},
|
|
3801
|
-
);
|
|
3802
|
-
for (const warning of result.warnings) this.log(warning);
|
|
3803
|
-
return result;
|
|
3732
|
+
return listViewsViaAppRuntime({
|
|
3733
|
+
baseUrl: this.#options.baseUrl ?? '',
|
|
3734
|
+
executorToken: this.#options.executorToken ?? '',
|
|
3735
|
+
vercelProtectionBypassToken: this.#options.vercelProtectionBypassToken,
|
|
3736
|
+
signal: this.#options.executionSignal,
|
|
3737
|
+
});
|
|
3738
|
+
},
|
|
3739
|
+
};
|
|
3740
|
+
|
|
3741
|
+
/**
|
|
3742
|
+
* Hosted pages were removed. Plays bundled before the removal still call
|
|
3743
|
+
* this, so it fails with a message the author can act on instead of a
|
|
3744
|
+
* TypeError on an undefined property.
|
|
3745
|
+
*/
|
|
3746
|
+
readonly pages = {
|
|
3747
|
+
write: async (name: unknown): Promise<never> => {
|
|
3748
|
+
throw new Error(hostedPagesRemovedMessage(name));
|
|
3804
3749
|
},
|
|
3805
3750
|
};
|
|
3806
3751
|
|
|
@@ -4954,7 +4899,19 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
4954
4899
|
bytes: 0,
|
|
4955
4900
|
});
|
|
4956
4901
|
}
|
|
4957
|
-
this.
|
|
4902
|
+
this.updateActiveMapCheckpointMemory();
|
|
4903
|
+
}
|
|
4904
|
+
|
|
4905
|
+
/**
|
|
4906
|
+
* `materializedRows` registers resident bytes and opens at a factor of 1.
|
|
4907
|
+
* Checkpoint patches are measured as JSON length, so they register that
|
|
4908
|
+
* length at the object prior: the charge the category's old prior of 3 gave
|
|
4909
|
+
* them, rather than a third of it.
|
|
4910
|
+
*/
|
|
4911
|
+
private updateActiveMapCheckpointMemory(): void {
|
|
4912
|
+
this.activeMapCheckpointMemory?.update(
|
|
4913
|
+
this.activeMapCheckpointBytes * RUNTIME_MEMORY_LEDGER_OBJECT_PRIOR_FACTOR,
|
|
4914
|
+
);
|
|
4958
4915
|
}
|
|
4959
4916
|
|
|
4960
4917
|
private releaseActiveMapCheckpointBytes(checkpointKey: string): void {
|
|
@@ -4969,7 +4926,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
4969
4926
|
0,
|
|
4970
4927
|
this.activeMapCheckpointBytes - releasedBytes,
|
|
4971
4928
|
);
|
|
4972
|
-
this.
|
|
4929
|
+
this.updateActiveMapCheckpointMemory();
|
|
4973
4930
|
}
|
|
4974
4931
|
|
|
4975
4932
|
private emitExecutionEvent(event: PlayExecutionEvent): void {
|
|
@@ -12154,6 +12111,12 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
12154
12111
|
mapName: normalizedTableNamespace,
|
|
12155
12112
|
budgetBytes: runtimeOptions?.retainedRowsMemoryBudgetBytes,
|
|
12156
12113
|
});
|
|
12114
|
+
// What each retained row was charged, so a row the map stops retaining
|
|
12115
|
+
// gives its charge back.
|
|
12116
|
+
const retainedRowCharges = new WeakMap<
|
|
12117
|
+
PersistableMapRow,
|
|
12118
|
+
RuntimeMapTrackedRow
|
|
12119
|
+
>();
|
|
12157
12120
|
// The Runtime Sheet is already the authoritative result store for these
|
|
12158
12121
|
// maps. Once live RSS says response bodies are constraining row admission,
|
|
12159
12122
|
// retain only rows whose terminal write has not committed yet. This keeps
|
|
@@ -12173,6 +12136,11 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
12173
12136
|
for (const row of rows) {
|
|
12174
12137
|
if (incrementalPersistence.isPersisted(row)) {
|
|
12175
12138
|
released += 1;
|
|
12139
|
+
const charge = retainedRowCharges.get(row);
|
|
12140
|
+
if (charge) {
|
|
12141
|
+
retainedRowsMemoryTracker.release(charge);
|
|
12142
|
+
retainedRowCharges.delete(row);
|
|
12143
|
+
}
|
|
12176
12144
|
continue;
|
|
12177
12145
|
}
|
|
12178
12146
|
rows[retained] = row;
|
|
@@ -12182,6 +12150,12 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
12182
12150
|
}
|
|
12183
12151
|
if (released > 0) {
|
|
12184
12152
|
retainedRowsComplete = false;
|
|
12153
|
+
// The ledger now reads only the rows still retained. Left at the
|
|
12154
|
+
// charge it carried when the rows went, occupancy stayed at the heap
|
|
12155
|
+
// target with the rows gone and kept re-arming the hold: a 600-row
|
|
12156
|
+
// map crossing a 64 MiB target took 17 pressure episodes and 55
|
|
12157
|
+
// holds, against one of each with the charge given back.
|
|
12158
|
+
trackMaterializedRowBytes();
|
|
12185
12159
|
this.runtimeLog(
|
|
12186
12160
|
`Dataset ${normalizedTableNamespace} released ${released} durably persisted row(s) under live memory pressure; using the Runtime Sheet.`,
|
|
12187
12161
|
);
|
|
@@ -12189,10 +12163,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
12189
12163
|
};
|
|
12190
12164
|
// The retained-result cache is the map's other resident budget. The
|
|
12191
12165
|
// tracker already measures every row it admits, so the ledger reads that
|
|
12192
|
-
// estimate rather than serializing the same rows a second time
|
|
12193
|
-
//
|
|
12194
|
-
//
|
|
12195
|
-
// holds admission early, which is the safe direction to be wrong in.
|
|
12166
|
+
// estimate rather than serializing the same rows a second time: an upper
|
|
12167
|
+
// bound on what the rows still retained hold, which falls as rows are
|
|
12168
|
+
// released under pressure.
|
|
12196
12169
|
// This mutable holder crosses asynchronous row workers. Keeping the
|
|
12197
12170
|
// handle in an object also makes that ownership visible to TypeScript's
|
|
12198
12171
|
// control-flow analysis; assignments inside the tracker closure are real
|
|
@@ -12215,7 +12188,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
12215
12188
|
): void => {
|
|
12216
12189
|
if (!retainedRowsComplete) return;
|
|
12217
12190
|
try {
|
|
12218
|
-
retainedRowsMemoryTracker.track(row);
|
|
12191
|
+
retainedRowCharges.set(row, retainedRowsMemoryTracker.track(row));
|
|
12219
12192
|
target.push(row);
|
|
12220
12193
|
trackMaterializedRowBytes();
|
|
12221
12194
|
} catch (error) {
|
|
@@ -17530,7 +17503,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
17530
17503
|
| ToolExecuteHttpFailureOutcome
|
|
17531
17504
|
| { errorClass: DurableRetryErrorClass };
|
|
17532
17505
|
responseText: string;
|
|
17533
|
-
|
|
17506
|
+
/** Absent: an unclassified action. */
|
|
17507
|
+
providerServerErrorReplay: ProviderServerErrorReplay | undefined;
|
|
17534
17508
|
rowScoped: boolean;
|
|
17535
17509
|
/** The call's input, for a per-request write class (generic HTTP). */
|
|
17536
17510
|
toolInput: Record<string, unknown>;
|
|
@@ -21429,8 +21403,15 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
21429
21403
|
.catch(() => null);
|
|
21430
21404
|
const retrySafeTransientHttp =
|
|
21431
21405
|
retryPolicy?.retrySafeTransientHttp === true;
|
|
21432
|
-
|
|
21433
|
-
|
|
21406
|
+
// Owner rule (2026-11-16): a provider 5xx retries unless the action
|
|
21407
|
+
// declares `never`; absent is an unclassified action and retries.
|
|
21408
|
+
// A policy that could not be read is not known to allow it, so it
|
|
21409
|
+
// stays `never`.
|
|
21410
|
+
const providerServerErrorReplay:
|
|
21411
|
+
| ProviderServerErrorReplay
|
|
21412
|
+
| undefined = retryPolicy
|
|
21413
|
+
? retryPolicy.providerServerErrorReplay
|
|
21414
|
+
: 'never';
|
|
21434
21415
|
const requiresExecutionFence =
|
|
21435
21416
|
retryPolicy?.requiresExecutionFence === true;
|
|
21436
21417
|
// Fenced execution is an operation-specific opt-in. A gateway may
|
|
@@ -21843,7 +21824,6 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
21843
21824
|
// `retry`; the policy (`park.enabled` per class) is the live off
|
|
21844
21825
|
// switch.
|
|
21845
21826
|
const callRequeueKey =
|
|
21846
|
-
callOptsIntoDurableRetry(options?.retry) &&
|
|
21847
21827
|
this.#options.durableBoundaries &&
|
|
21848
21828
|
// A durable retry must find its own record after a replay, so it
|
|
21849
21829
|
// needs a replay-stable receipt key. A per-invocation transport
|
|
@@ -22299,8 +22279,10 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
22299
22279
|
let dispatchedWithProviderPermit = false;
|
|
22300
22280
|
let providerPermitReceiverRejected = false;
|
|
22301
22281
|
let providerDispatchCounted = false;
|
|
22282
|
+
let providerPacingWaitRefusedDispatch = false;
|
|
22302
22283
|
const recordProviderDispatch = () => {
|
|
22303
|
-
if (providerDispatchCounted)
|
|
22284
|
+
if (providerDispatchCounted || providerPacingWaitRefusedDispatch)
|
|
22285
|
+
return;
|
|
22304
22286
|
providerDispatchCounted = true;
|
|
22305
22287
|
this.resourceGovernor.recordProviderDispatch();
|
|
22306
22288
|
recordToolCallSend(retryFactsTargets, provider);
|
|
@@ -22729,12 +22711,15 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
22729
22711
|
// headers arrive; decoded body data stays scoped until
|
|
22730
22712
|
// it has been read and verified below.
|
|
22731
22713
|
response = dispatchedResponse;
|
|
22714
|
+
// A delegated 503 can attest that it never dispatched.
|
|
22715
|
+
// Read its body before counting it as a provider request.
|
|
22732
22716
|
if (
|
|
22733
|
-
dispatchedResponse.
|
|
22717
|
+
dispatchedResponse.status !== 503 &&
|
|
22718
|
+
(dispatchedResponse.headers.has(
|
|
22734
22719
|
TOOL_EXECUTE_PROVIDER_PERMIT_RECEIVER_HEADER,
|
|
22735
22720
|
) ||
|
|
22736
|
-
|
|
22737
|
-
|
|
22721
|
+
(dispatchedResponse.status !== 403 &&
|
|
22722
|
+
dispatchedResponse.status !== 404))
|
|
22738
22723
|
)
|
|
22739
22724
|
recordProviderDispatch();
|
|
22740
22725
|
if (dispatchedResponse.status === 429) {
|
|
@@ -22907,6 +22892,13 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
22907
22892
|
dispatchedResponse,
|
|
22908
22893
|
dispatchedResponseErrorText ?? '',
|
|
22909
22894
|
);
|
|
22895
|
+
providerPacingWaitRefusedDispatch =
|
|
22896
|
+
dispatchedWithProviderPermit &&
|
|
22897
|
+
dispatchedResponse.status === 503 &&
|
|
22898
|
+
isProviderPacingWaitResponse({
|
|
22899
|
+
status: dispatchedResponse.status,
|
|
22900
|
+
bodyText: dispatchedResponseErrorText ?? '',
|
|
22901
|
+
});
|
|
22910
22902
|
if (!providerPermitReceiverRejected)
|
|
22911
22903
|
recordProviderDispatch();
|
|
22912
22904
|
if (dispatchedResponse.status === 429) {
|
|
@@ -47,17 +47,19 @@ export const DURABLE_RUNS_ROLLOUT = {
|
|
|
47
47
|
sharedReadCacheWrites: true,
|
|
48
48
|
/**
|
|
49
49
|
* A provider's 5xx is retried inside the attempt with exponential backoff
|
|
50
|
-
* and jitter, sending the same provider idempotency key
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
50
|
+
* and jitter, sending the same provider idempotency key. Owner rule
|
|
51
|
+
* (2026-11-16): every action retries, writes and unclassified actions
|
|
52
|
+
* included, because at-least-once is worth more than a lost write. Not
|
|
53
|
+
* retried: an action that declares `retry.providerServerErrorReplay:
|
|
54
|
+
* 'never'`, a model's own invalid answer (`model_output`), and any timeout
|
|
55
|
+
* (a transport failure or a 504), since a timeout is never retried. Only
|
|
56
|
+
* successes are final. The runner decides; the gateway previous-outcome
|
|
57
|
+
* check only validates the recorded outcome.
|
|
57
58
|
*
|
|
58
|
-
* Known limit: a provider that ignores idempotency
|
|
59
|
-
*
|
|
60
|
-
* action
|
|
59
|
+
* Known limit, accepted by the owner: a provider that ignores idempotency
|
|
60
|
+
* keys may apply a write twice when its 5xx came after it applied the
|
|
61
|
+
* write. There is no exactly-once claim; an action whose duplicate would
|
|
62
|
+
* be unacceptable declares `never`.
|
|
61
63
|
* Each call is retried at most twice (3 sends), a provider Retry-After wait
|
|
62
64
|
* is capped at 30 s, and the retries never charge the run-wide retry
|
|
63
65
|
* budget. Off again stops new retries; a call already retried keeps its
|
|
@@ -192,7 +192,9 @@ export function playCallErrorKind(input: {
|
|
|
192
192
|
if (category === 'network' || input.networkKind !== null) {
|
|
193
193
|
return 'timeout_network';
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
// An upstream category is a 5xx only when no status says otherwise: a
|
|
196
|
+
// provider's 400 or 422 is a 4xx whatever its category.
|
|
197
|
+
if (httpStatus !== null ? httpStatus >= 500 : category === 'upstream') {
|
|
196
198
|
return origin === 'provider' ? 'provider_5xx' : 'platform';
|
|
197
199
|
}
|
|
198
200
|
if (category === 'internal') return 'platform';
|
package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts
CHANGED
|
@@ -62,6 +62,13 @@ export const RATE_ACQUIRE_MAX_WAIT_MS = 300_000;
|
|
|
62
62
|
export const PROVIDER_ADMISSION_WAIT_BUDGET_MS = 120_000;
|
|
63
63
|
const PROVIDER_NO_PROGRESS_WARNING_MS = 180_000;
|
|
64
64
|
const SUCCESS_FEEDBACK_DRAIN_TIMEOUT_MS = 10_000;
|
|
65
|
+
/**
|
|
66
|
+
* The longest a confirmed success waits for its lane's next acquire to carry
|
|
67
|
+
* it before it is sent on its own. A single-call run makes no next acquire,
|
|
68
|
+
* so its success otherwise reached the shared learner only in the end-of-run
|
|
69
|
+
* flush, a whole run after the provider answered (p50 35 s in a burst).
|
|
70
|
+
*/
|
|
71
|
+
const SUCCESS_FEEDBACK_MAX_DELAY_MS = 1_000;
|
|
65
72
|
|
|
66
73
|
/**
|
|
67
74
|
* Permits leased per app-runtime round trip for the direct Node substrate.
|
|
@@ -205,7 +212,13 @@ type PendingConcurrencyObservations = {
|
|
|
205
212
|
laneId: string;
|
|
206
213
|
sequence: number;
|
|
207
214
|
};
|
|
208
|
-
observations:
|
|
215
|
+
observations: SuccessObservation[];
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
type SuccessObservation = {
|
|
219
|
+
kind: 'success';
|
|
220
|
+
latencyMs: number;
|
|
221
|
+
inFlightAtStart?: number;
|
|
209
222
|
};
|
|
210
223
|
|
|
211
224
|
type SuccessFeedback = {
|
|
@@ -326,6 +339,10 @@ export class AppRuntimeRateStateBackend implements RateStateBackend {
|
|
|
326
339
|
}
|
|
327
340
|
>();
|
|
328
341
|
private readonly successFeedbackSupported = new Set<string>();
|
|
342
|
+
private readonly successFeedbackTimers = new Map<
|
|
343
|
+
string,
|
|
344
|
+
ReturnType<typeof setTimeout>
|
|
345
|
+
>();
|
|
329
346
|
private successFeedbackDrain: Promise<void> | null = null;
|
|
330
347
|
/**
|
|
331
348
|
* Completion samples travel with the next lease refill. This keeps the
|
|
@@ -1729,6 +1746,7 @@ export class AppRuntimeRateStateBackend implements RateStateBackend {
|
|
|
1729
1746
|
rateScopeToken?: string | null;
|
|
1730
1747
|
rules: readonly PacingRule[];
|
|
1731
1748
|
latencyMs?: number | null;
|
|
1749
|
+
inFlightAtStart?: number | null;
|
|
1732
1750
|
}): void {
|
|
1733
1751
|
this.providerStalls.delete(input.bucketId);
|
|
1734
1752
|
const key = pendingSuccessKey(input.bucketId, input.rules);
|
|
@@ -1756,6 +1774,11 @@ export class AppRuntimeRateStateBackend implements RateStateBackend {
|
|
|
1756
1774
|
pending.observations.push({
|
|
1757
1775
|
kind: 'success',
|
|
1758
1776
|
latencyMs: input.latencyMs,
|
|
1777
|
+
...(input.inFlightAtStart != null &&
|
|
1778
|
+
Number.isSafeInteger(input.inFlightAtStart) &&
|
|
1779
|
+
input.inFlightAtStart >= 1
|
|
1780
|
+
? { inFlightAtStart: input.inFlightAtStart }
|
|
1781
|
+
: {}),
|
|
1759
1782
|
});
|
|
1760
1783
|
}
|
|
1761
1784
|
}
|
|
@@ -1764,6 +1787,52 @@ export class AppRuntimeRateStateBackend implements RateStateBackend {
|
|
|
1764
1787
|
// retaining an empty Gradient2 list still makes a lost acquire response
|
|
1765
1788
|
// unable to replay that rate recovery signal.
|
|
1766
1789
|
this.pendingConcurrencyObservations.set(key, pending);
|
|
1790
|
+
this.scheduleSuccessFeedback(key, input.bucketId);
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
/**
|
|
1794
|
+
* Send this lane's successes on their own if no acquire has carried them
|
|
1795
|
+
* within SUCCESS_FEEDBACK_MAX_DELAY_MS. A lane that acquires often takes
|
|
1796
|
+
* them along first, so it adds no request.
|
|
1797
|
+
*/
|
|
1798
|
+
private scheduleSuccessFeedback(key: string, bucketId: string): void {
|
|
1799
|
+
if (
|
|
1800
|
+
!this.port.flushFeedback ||
|
|
1801
|
+
!this.successFeedbackSupported.has(bucketId) ||
|
|
1802
|
+
this.successFeedbackTimers.has(key)
|
|
1803
|
+
) {
|
|
1804
|
+
return;
|
|
1805
|
+
}
|
|
1806
|
+
const timer = setTimeout(() => {
|
|
1807
|
+
this.successFeedbackTimers.delete(key);
|
|
1808
|
+
// Advisory: a failed send leaves its frozen batch for the next acquire
|
|
1809
|
+
// or the end-of-run drain, which retry the same identity.
|
|
1810
|
+
void this.sendLaneSuccessFeedback(key).catch(() => undefined);
|
|
1811
|
+
}, SUCCESS_FEEDBACK_MAX_DELAY_MS);
|
|
1812
|
+
timer.unref?.();
|
|
1813
|
+
this.successFeedbackTimers.set(key, timer);
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
private async sendLaneSuccessFeedback(key: string): Promise<void> {
|
|
1817
|
+
// An acquire, penalty or the final drain already carries this lane's batch.
|
|
1818
|
+
if (this.successFeedbackFlights.has(key) || this.successFeedbackDrain) {
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
const scope = this.successFeedbackScopes.get(key);
|
|
1822
|
+
if (!scope || !this.successFeedbackSupported.has(scope.bucketId)) return;
|
|
1823
|
+
const feedback = this.snapshotSuccessFeedback(key);
|
|
1824
|
+
if (!feedback.concurrencyObservationBatch) return;
|
|
1825
|
+
await this.port.flushFeedback!(
|
|
1826
|
+
{
|
|
1827
|
+
...scope,
|
|
1828
|
+
rules: [...scope.rules],
|
|
1829
|
+
leaseIds: [],
|
|
1830
|
+
...feedback,
|
|
1831
|
+
schedulerSchema: this.schedulerSchema,
|
|
1832
|
+
},
|
|
1833
|
+
AbortSignal.timeout(SUCCESS_FEEDBACK_DRAIN_TIMEOUT_MS),
|
|
1834
|
+
);
|
|
1835
|
+
this.acknowledgeSuccessFeedback(key, feedback);
|
|
1767
1836
|
}
|
|
1768
1837
|
|
|
1769
1838
|
async flushSuccessFeedback(): Promise<void> {
|
|
@@ -1805,7 +1874,7 @@ export class AppRuntimeRateStateBackend implements RateStateBackend {
|
|
|
1805
1874
|
|
|
1806
1875
|
private newPendingConcurrencyObservations(
|
|
1807
1876
|
key: string,
|
|
1808
|
-
observations:
|
|
1877
|
+
observations: SuccessObservation[] = [],
|
|
1809
1878
|
): PendingConcurrencyObservations {
|
|
1810
1879
|
const laneId =
|
|
1811
1880
|
this.concurrencyObservationLanes.get(key) ??
|
|
@@ -269,11 +269,14 @@ export interface PlayExecutionGovernor {
|
|
|
269
269
|
provider: string;
|
|
270
270
|
toolId?: string;
|
|
271
271
|
latencyMs?: number | null;
|
|
272
|
+
/** The admitting permit's server-authored `inFlightAtStart`, when known. */
|
|
273
|
+
inFlightAtStart?: number | null;
|
|
272
274
|
}): void;
|
|
273
275
|
/** Feed success back using the same tool-to-provider resolution as acquire. */
|
|
274
276
|
observeToolSuccess(input: {
|
|
275
277
|
toolId: string;
|
|
276
278
|
latencyMs?: number | null;
|
|
279
|
+
inFlightAtStart?: number | null;
|
|
277
280
|
}): void;
|
|
278
281
|
|
|
279
282
|
snapshot(): GovernanceSnapshot;
|
|
@@ -915,6 +918,9 @@ export function createPlayExecutionGovernor(
|
|
|
915
918
|
...(rateScope[1] ? { rateScopeToken: rateScope[1] } : {}),
|
|
916
919
|
rules,
|
|
917
920
|
latencyMs: success.latencyMs,
|
|
921
|
+
...(success.inFlightAtStart != null
|
|
922
|
+
? { inFlightAtStart: success.inFlightAtStart }
|
|
923
|
+
: {}),
|
|
918
924
|
});
|
|
919
925
|
return;
|
|
920
926
|
}
|
|
@@ -933,6 +939,9 @@ export function createPlayExecutionGovernor(
|
|
|
933
939
|
provider,
|
|
934
940
|
toolId: success.toolId,
|
|
935
941
|
latencyMs: success.latencyMs,
|
|
942
|
+
...(success.inFlightAtStart != null
|
|
943
|
+
? { inFlightAtStart: success.inFlightAtStart }
|
|
944
|
+
: {}),
|
|
936
945
|
});
|
|
937
946
|
},
|
|
938
947
|
|
|
@@ -196,6 +196,8 @@ export interface RateStateBackend {
|
|
|
196
196
|
rules: readonly PacingRule[];
|
|
197
197
|
/** Provider residence measured at the HTTP boundary. */
|
|
198
198
|
latencyMs?: number | null;
|
|
199
|
+
/** The admitting permit's server-authored `inFlightAtStart`, when known. */
|
|
200
|
+
inFlightAtStart?: number | null;
|
|
199
201
|
}): void;
|
|
200
202
|
|
|
201
203
|
/** Bounded final feedback write after the invocation's provider work settles. */
|
|
@@ -97,6 +97,7 @@ export const PLAY_LAUNCH_ENVELOPE_FIELD_ROLES: {
|
|
|
97
97
|
runtimeTestFaultHeader: 'detail',
|
|
98
98
|
testPolicyOverrides: 'detail',
|
|
99
99
|
submittedAtMs: 'detail',
|
|
100
|
+
concurrentRunsLimit: 'detail',
|
|
100
101
|
schedulerBackend: 'detail',
|
|
101
102
|
executionProfile: 'detail',
|
|
102
103
|
runtimeBackend: 'detail',
|