deepline 0.3.546 → 0.3.548
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 +13 -0
- package/dist/bundling-sources/sdk/src/index.ts +7 -1
- package/dist/bundling-sources/sdk/src/integrations.ts +17 -7
- package/dist/bundling-sources/sdk/src/play.ts +71 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +13 -4
- package/dist/bundling-sources/sdk/src/types.ts +33 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +7 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +19 -1
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +17 -2
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +57 -5
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +295 -52
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +10 -1
- package/dist/bundling-sources/shared_libs/play-runtime/docflow-decision-tracker.ts +135 -0
- package/dist/bundling-sources/shared_libs/play-runtime/docflow-fail-open.ts +177 -0
- package/dist/bundling-sources/shared_libs/play-runtime/docflow-node-io.ts +99 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +16 -10
- package/dist/bundling-sources/shared_libs/play-runtime/fenced-call-diagnostics.ts +211 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +52 -14
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +68 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +100 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +9 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +48 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +6 -1
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +716 -51
- package/dist/bundling-sources/shared_libs/plays/docflow-decision-arms.ts +146 -0
- package/dist/bundling-sources/shared_libs/plays/docflow-flow-order.ts +94 -0
- package/dist/bundling-sources/shared_libs/plays/docflow-unreached-reason.ts +10 -1
- package/dist/bundling-sources/shared_libs/plays/docflow.ts +787 -117
- package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +8 -2
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +6 -0
- package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +13 -0
- package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +25 -0
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +3 -0
- package/dist/bundling-sources/shared_libs/security/email-domain.ts +24 -0
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +56 -0
- package/dist/cli/auth-7UJFY5BY.js +43 -0
- package/dist/cli/{auth-KFWG72AZ.mjs → auth-YOOVLLUL.mjs} +5 -5
- package/dist/cli/{billing-MMZ336HO.mjs → billing-2NCNX6L2.mjs} +10 -10
- package/dist/cli/{billing-OQVOAZ4S.js → billing-HETIOUD6.js} +96 -96
- package/dist/cli/{chunk-JVOUQFHT.js → chunk-2OG2KBYJ.js} +1 -1
- package/dist/cli/{chunk-JA633HRV.mjs → chunk-3QRU6RY7.mjs} +3 -3
- package/dist/cli/{chunk-TI6DTURF.js → chunk-4WAM6TLD.js} +7 -1
- package/dist/cli/{chunk-RO66FPTS.mjs → chunk-53QLWPZK.mjs} +1 -1
- package/dist/cli/{chunk-6LG7MLJ2.js → chunk-5OJOFUMO.js} +44 -44
- package/dist/cli/{chunk-F2VEFMU5.js → chunk-5XFJBIQT.js} +13 -13
- package/dist/cli/{chunk-UQJBV5PM.js → chunk-5XXPP3PR.js} +10 -10
- package/dist/cli/{chunk-6FBDTYR2.mjs → chunk-64BFUBXX.mjs} +2 -2
- package/dist/cli/{chunk-VAT2SXFF.js → chunk-6GIZNOXQ.js} +12 -12
- package/dist/cli/{chunk-7MY7KWJS.mjs → chunk-7AJ5V3BK.mjs} +1 -1
- package/dist/cli/{chunk-MEGHIX4M.js → chunk-7H6TQ6W2.js} +5 -5
- package/dist/cli/{chunk-PMDHY2YK.js → chunk-7JIOJLTS.js} +7 -7
- package/dist/cli/{chunk-EEJHB76U.js → chunk-7UJZWI5Z.js} +12 -12
- package/dist/cli/{chunk-X5KOHDJN.mjs → chunk-ATTURFOV.mjs} +1 -1
- package/dist/cli/{chunk-SH32HL7I.js → chunk-AUYBBFPT.js} +53 -53
- package/dist/cli/{chunk-JCWNF44W.js → chunk-BDBEEV6X.js} +22 -22
- package/dist/cli/{chunk-WKHPLBJK.js → chunk-BWJZ4NQJ.js} +15 -15
- package/dist/cli/{chunk-2JHYYB3F.js → chunk-CSPHSNBW.js} +3 -3
- package/dist/cli/{chunk-4AZLGNXV.js → chunk-CXZLHBNK.js} +4 -4
- package/dist/cli/{chunk-J65HJCJO.mjs → chunk-F4ON5COB.mjs} +2 -2
- package/dist/cli/{chunk-KUK7ARXA.mjs → chunk-FMQA7UZZ.mjs} +2 -2
- package/dist/cli/{chunk-UREAIHUU.mjs → chunk-FUUYWEF4.mjs} +3 -3
- package/dist/cli/{chunk-HXIR3VQL.mjs → chunk-FZHMNK6F.mjs} +7 -1
- package/dist/cli/{chunk-PU3ZAG6V.mjs → chunk-GCEGQ7TQ.mjs} +1 -1
- package/dist/cli/{chunk-BLYW6FFB.js → chunk-GJA2PRHJ.js} +2 -2
- package/dist/cli/{chunk-TBWYZOSV.js → chunk-GUIYFOG2.js} +3 -3
- package/dist/cli/{chunk-BTFUAGHC.js → chunk-HDLMX7SG.js} +16 -16
- package/dist/cli/{chunk-VTK3HGMN.mjs → chunk-HIMZ57QD.mjs} +5 -5
- package/dist/cli/{chunk-JYG4XZLT.js → chunk-HTZIJORU.js} +99 -99
- package/dist/cli/{chunk-VPERQ3U6.mjs → chunk-HU3DDLGD.mjs} +5 -5
- package/dist/cli/{chunk-H7Q5IDO3.js → chunk-I2JIWKCQ.js} +20 -20
- package/dist/cli/{chunk-MXQP7CXZ.js → chunk-IIWXBRDK.js} +3 -3
- package/dist/cli/{chunk-MI7X6V6V.mjs → chunk-IQBXX54G.mjs} +3 -3
- package/dist/cli/{chunk-SYTWWVIQ.js → chunk-JQWX377P.js} +5 -5
- package/dist/cli/{chunk-Z3UEBFIN.js → chunk-LAVPP6WD.js} +41 -41
- package/dist/cli/{chunk-JCH4UNNS.js → chunk-M2OZORIH.js} +2 -2
- package/dist/cli/{chunk-Z7SXGOIQ.mjs → chunk-MF7PCM6C.mjs} +1 -1
- package/dist/cli/{chunk-7ZW67ME6.mjs → chunk-MQSKSISW.mjs} +1 -1
- package/dist/cli/{chunk-JARZ47OP.mjs → chunk-MWQ4WWZF.mjs} +2 -2
- package/dist/cli/{chunk-EEG46QZY.mjs → chunk-NFMX7BRF.mjs} +2 -2
- package/dist/cli/{chunk-VXTTAYOT.mjs → chunk-OGDQFVCP.mjs} +3 -3
- package/dist/cli/{chunk-3DUNNZB6.mjs → chunk-OQCYSLML.mjs} +4 -4
- package/dist/cli/{chunk-5W4ENHWM.js → chunk-PVE3A2BO.js} +285 -264
- package/dist/cli/{chunk-F5YQXCP3.js → chunk-PVQCX6KQ.js} +50 -7
- package/dist/cli/{chunk-GYTSDSQD.mjs → chunk-QQBRXMZM.mjs} +11 -11
- package/dist/cli/{chunk-6Y5TU3R7.mjs → chunk-QZ74ZC55.mjs} +1 -1
- package/dist/cli/{chunk-5OEFXAKP.mjs → chunk-RMCCB3XY.mjs} +50 -7
- package/dist/cli/{chunk-5V7NZKGG.js → chunk-T3RDWG5J.js} +2 -2
- package/dist/cli/{chunk-OAKWSLKS.mjs → chunk-TKGFHRHE.mjs} +28 -7
- package/dist/cli/{chunk-HJR2DDJS.mjs → chunk-U35ZLVBA.mjs} +2 -2
- package/dist/cli/{chunk-ND7SFRQL.js → chunk-U7HJXE6Y.js} +2 -2
- package/dist/cli/{chunk-LX2TC3HO.mjs → chunk-UBQQR56I.mjs} +4 -4
- package/dist/cli/{chunk-5VNQMVCU.js → chunk-VK2GSTRN.js} +26 -26
- package/dist/cli/{chunk-K2XELBPF.mjs → chunk-VSACOMIA.mjs} +5 -5
- package/dist/cli/{chunk-IVWU7SJC.js → chunk-WI4MCR7M.js} +5 -5
- package/dist/cli/{chunk-LIJKRDDG.js → chunk-WIHQAZPV.js} +6 -6
- package/dist/cli/{chunk-LHE2TSV6.mjs → chunk-WVZF4DU7.mjs} +1 -1
- package/dist/cli/{chunk-2HSZCQMT.mjs → chunk-WYT3H6JD.mjs} +1 -1
- package/dist/cli/{chunk-GOOF7E2B.mjs → chunk-XKEBQVCP.mjs} +5 -5
- package/dist/cli/{chunk-P7A3H6G5.mjs → chunk-XU3D2KFR.mjs} +1 -1
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/concurrent-runs-help-A2IQVZRJ.js +21 -0
- package/dist/cli/{concurrent-runs-help-C2O5YKQA.mjs → concurrent-runs-help-FDCCZ45D.mjs} +6 -6
- package/dist/cli/{csv-Z4DNGR54.mjs → csv-GJYLQ52D.mjs} +4 -4
- package/dist/cli/{csv-MJDNOIQJ.js → csv-OCEQWZO3.js} +13 -13
- package/dist/cli/{db-4RL2BNOF.mjs → db-5MA2UUHQ.mjs} +7 -7
- package/dist/cli/{db-S5QVPK5E.js → db-G5QGXFAX.js} +28 -28
- package/dist/cli/{describe-L4P5SZLQ.mjs → describe-4DOJ4DHA.mjs} +19 -19
- package/dist/cli/describe-SD7DRTBW.js +50 -0
- package/dist/cli/describe-core.d.mts +4 -4
- package/dist/cli/describe-core.d.ts +4 -4
- package/dist/cli/{executions-RR6O3XK5.mjs → executions-C7SMBHHB.mjs} +7 -7
- package/dist/cli/{executions-MFZ2Z36O.js → executions-IYEVUPJI.js} +9 -9
- package/dist/cli/{feedback-YDAG7VH2.js → feedback-GYAF46GA.js} +14 -14
- package/dist/cli/{feedback-EQBQ3ABB.mjs → feedback-XUU2UKM6.mjs} +6 -6
- package/dist/cli/git-7YYVMY6L.js +25 -0
- package/dist/cli/{git-YGLCCU35.mjs → git-WVCMK5AH.mjs} +5 -5
- package/dist/cli/index.js +146 -146
- package/dist/cli/index.mjs +45 -45
- package/dist/cli/{integrations-FWYXSBHK.mjs → integrations-FXADGAX2.mjs} +11 -9
- package/dist/cli/{integrations-IQXYMRMW.js → integrations-YYBJJFVX.js} +19 -17
- package/dist/cli/{legacy-noops-I4YRIX5F.mjs → legacy-noops-LJY7LDUE.mjs} +6 -6
- package/dist/cli/{legacy-noops-U7LI7UXC.js → legacy-noops-REZCYES2.js} +9 -9
- package/dist/cli/{mcp-GX2UKKWU.js → mcp-L5PURE5S.js} +24 -24
- package/dist/cli/{mcp-QJBMB6VS.mjs → mcp-XSB3ZJFR.mjs} +4 -4
- package/dist/cli/{monitors-WCJYINGX.js → monitors-I5EIHSGV.js} +119 -101
- package/dist/cli/{monitors-Z6EGKYJP.mjs → monitors-UBPF2OLO.mjs} +26 -8
- package/dist/cli/{org-NNHICBR2.mjs → org-PHHIN2ER.mjs} +7 -7
- package/dist/cli/{org-7SKG423N.js → org-SGSTGGUD.js} +89 -89
- package/dist/cli/{play-CXDFPJ7Z.mjs → play-LEJNJLWY.mjs} +295 -67
- package/dist/cli/{play-4P4DTG3Q.js → play-WQEKMANL.js} +897 -669
- package/dist/cli/{providers-VQLQ7DTR.mjs → providers-3W26ZDAV.mjs} +7 -7
- package/dist/cli/{providers-EE4TUE3O.js → providers-RSDXBXIS.js} +10 -10
- package/dist/cli/{quickstart-IYNJRB5G.mjs → quickstart-LGJD2M36.mjs} +4 -4
- package/dist/cli/{quickstart-RVXHK4WA.js → quickstart-U3QX4EMI.js} +6 -6
- package/dist/cli/{run-R3F34KU3.js → run-F2UPZUJS.js} +45 -45
- package/dist/cli/{run-VBQPPMEX.mjs → run-YWZ3W5HK.mjs} +25 -25
- package/dist/cli/search-K6ANAXLF.js +32 -0
- package/dist/cli/{search-B7R62HX5.mjs → search-O2OJH3PY.mjs} +8 -8
- package/dist/cli/{search-output-LNQQXIGZ.mjs → search-output-H5BF6SJ3.mjs} +4 -4
- package/dist/cli/{search-output-LWHWEPOT.js → search-output-W7OCBYBU.js} +6 -6
- package/dist/cli/{secrets-NM3VAJLO.mjs → secrets-65XCAA7U.mjs} +7 -7
- package/dist/cli/{secrets-QBOZ7WTD.js → secrets-BN4GYVRI.js} +16 -16
- package/dist/cli/sessions-M52QWLA6.js +22 -0
- package/dist/cli/{sessions-R5BSIJ4I.mjs → sessions-SVEVESCQ.mjs} +6 -6
- package/dist/cli/{settings-POYWKNRD.js → settings-7YMDAFCN.js} +86 -86
- package/dist/cli/{settings-S4PN7WLY.mjs → settings-HAU2NP2H.mjs} +13 -13
- package/dist/cli/{setup-PFLXVBTL.mjs → setup-5RXHZ6YI.mjs} +9 -9
- package/dist/cli/{setup-VHB4Z654.js → setup-G37QXQGM.js} +49 -49
- package/dist/cli/{skills-W2TELEU7.mjs → skills-Q7A3XFAU.mjs} +7 -7
- package/dist/cli/skills-ZK4D5BJW.js +36 -0
- package/dist/cli/tools-DBZTLYFM.js +57 -0
- package/dist/cli/{tools-M4FA6N3Y.mjs → tools-ZG4NYRGB.mjs} +18 -18
- package/dist/cli/{update-W7LIHEA7.mjs → update-2CMZTZCL.mjs} +9 -9
- package/dist/cli/update-LC5HGEEH.js +34 -0
- package/dist/cli/{views-KTVPV6UP.mjs → views-A6IIY4OQ.mjs} +7 -7
- package/dist/cli/{views-DJXAGD7V.js → views-XUMDMDIE.js} +22 -22
- package/dist/cli/{workflow-NVZDJKH2.js → workflow-4EEW6MCD.js} +18 -18
- package/dist/cli/{workflow-LGKCRODX.mjs → workflow-74MYISHU.mjs} +8 -8
- package/dist/{client-Tp1LSULB.d.mts → client-D1uWA2Vc.d.mts} +1 -1
- package/dist/{client-CCyWJqAI.d.ts → client-Hz7SsBXs.d.ts} +1 -1
- package/dist/{client-core-BpYiYEfu.d.ts → client-core-D3Ad7Flt.d.ts} +554 -504
- package/dist/{client-core-D8eCZz3O.d.mts → client-core-Db_e63Hb.d.mts} +554 -504
- package/dist/{compiler-manifest-EBWEUj0b.d.ts → compiler-manifest-BqwVrOri.d.mts} +38 -18
- package/dist/{compiler-manifest-EBWEUj0b.d.mts → compiler-manifest-BqwVrOri.d.ts} +38 -18
- package/dist/{errors-CParKUQR.d.mts → errors-BU8FB99X.d.mts} +1 -1
- package/dist/{errors-Qt0OTA7_.d.ts → errors-DfVN_FUG.d.ts} +1 -1
- package/dist/{index-CoqDkIw0.d.ts → index-BGnvtYGc.d.ts} +6 -1
- package/dist/{index-BMUVCNp7.d.mts → index-DjZgwpGw.d.mts} +6 -1
- package/dist/index.d.mts +28 -8
- package/dist/index.d.ts +28 -8
- package/dist/index.js +64 -39
- package/dist/index.mjs +32 -7
- package/dist/install-integrity.json +133 -128
- 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 +620 -124
- package/dist/plays/play-description.d.mts +3 -3
- package/dist/plays/play-description.d.ts +3 -3
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +6 -6
- package/dist/server.mjs +4 -4
- package/package.json +1 -1
- package/dist/cli/auth-W32GMYND.js +0 -43
- package/dist/cli/concurrent-runs-help-6QT7ZR4W.js +0 -21
- package/dist/cli/describe-VLU2LUDJ.js +0 -50
- package/dist/cli/git-E6W44F5M.js +0 -25
- package/dist/cli/search-UUVFXZRA.js +0 -32
- package/dist/cli/sessions-K3PD73Q2.js +0 -22
- package/dist/cli/skills-QNE2EYT3.js +0 -36
- package/dist/cli/tools-3RLI4HGF.js +0 -57
- package/dist/cli/update-UT6KIW2W.js +0 -34
|
@@ -26,9 +26,10 @@ export const RUNTIME_CAPACITY_POLICY = {
|
|
|
26
26
|
*/
|
|
27
27
|
maxActiveLaneMachines: 8,
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* Started/pending worker budget shared by historical (draining) release
|
|
30
|
+
* lanes, counted over their own Machines. The active lane grows against
|
|
31
|
+
* maxActiveLaneMachines instead, so draining lanes cannot hold new runs at
|
|
32
|
+
* the warm floor. Existing claim owners and rollback holds are retained.
|
|
32
33
|
*/
|
|
33
34
|
maxFleetMachines: 8,
|
|
34
35
|
workerSlotsPerMachine: 8,
|
|
@@ -44,7 +45,7 @@ export const RUNTIME_CAPACITY_POLICY = {
|
|
|
44
45
|
* boots it in about 1.3 s, against about 12 s for a new Machine, which
|
|
45
46
|
* waits for its app-scoped static egress IP before it can reach the
|
|
46
47
|
* database (16% of fresh boots crashed on that wait, 2026-11-10/11).
|
|
47
|
-
* Six is the whole burst headroom (
|
|
48
|
+
* Six is the whole burst headroom (maxActiveLaneMachines - activeLaneMachines);
|
|
48
49
|
* 99% of 161 Production bursts added at most six Machines in their first
|
|
49
50
|
* minute. More could never start at once inside the fleet budget. Fly
|
|
50
51
|
* bills a stopped Machine's rootfs at $0.15 per GB-month.
|
|
@@ -169,13 +170,23 @@ export function desiredAbsurdLaneMachines(input: {
|
|
|
169
170
|
* not free budget until Fly confirms them. This function never removes workers.
|
|
170
171
|
*
|
|
171
172
|
* Restore the active warm floor first, even when that reports budget debt.
|
|
172
|
-
*
|
|
173
|
-
*
|
|
173
|
+
* Historical runnable lanes share maxFleetMachines (counted over their own
|
|
174
|
+
* Machines) in round-robin order; the active lane grows to
|
|
175
|
+
* maxActiveLaneMachines (counted over its own Machines). Neither partition can
|
|
176
|
+
* starve the other. Persist nextCursor between reconciliations so repeated
|
|
174
177
|
* single-slot openings do not always favor the first historical release.
|
|
175
178
|
*/
|
|
176
179
|
export function planAbsurdWorkerFleetGrowth(input: {
|
|
177
180
|
existingMachines: number;
|
|
181
|
+
/**
|
|
182
|
+
* Started and pending Machines on the active release lane, out of
|
|
183
|
+
* existingMachines. The active lane grows against maxActiveLaneMachines and
|
|
184
|
+
* historical lanes against maxFleetMachines, each counting only its own
|
|
185
|
+
* Machines, so neither can starve the other.
|
|
186
|
+
*/
|
|
187
|
+
activeLaneMachines: number;
|
|
178
188
|
maxFleetMachines?: number;
|
|
189
|
+
maxActiveLaneMachines?: number;
|
|
179
190
|
activeWarmFloorMissing: number;
|
|
180
191
|
demands: readonly {
|
|
181
192
|
releaseId: string;
|
|
@@ -203,6 +214,17 @@ export function planAbsurdWorkerFleetGrowth(input: {
|
|
|
203
214
|
const maxFleetMachines = requireMachineCount(
|
|
204
215
|
input.maxFleetMachines ?? RUNTIME_CAPACITY_POLICY.absurd.maxFleetMachines,
|
|
205
216
|
);
|
|
217
|
+
const maxActiveLaneMachines = requireMachineCount(
|
|
218
|
+
input.maxActiveLaneMachines ??
|
|
219
|
+
RUNTIME_CAPACITY_POLICY.absurd.maxActiveLaneMachines,
|
|
220
|
+
);
|
|
221
|
+
const activeLaneMachines = requireMachineCount(input.activeLaneMachines);
|
|
222
|
+
if (activeLaneMachines > physicalCount) {
|
|
223
|
+
throw new Error(
|
|
224
|
+
'Active-lane Machines cannot exceed the physical worker fleet.',
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
const historicalPhysicalCount = physicalCount - activeLaneMachines;
|
|
206
228
|
const warmFloorMissing = requireMachineCount(input.activeWarmFloorMissing);
|
|
207
229
|
const cursor = input.cursor ?? '';
|
|
208
230
|
if (typeof cursor !== 'string') {
|
|
@@ -259,10 +281,10 @@ export function planAbsurdWorkerFleetGrowth(input: {
|
|
|
259
281
|
activeLane?.remaining ?? 0,
|
|
260
282
|
);
|
|
261
283
|
for (let seat = 0; seat < warmFloorGrowth; seat += 1) grant(activeLane!);
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
);
|
|
284
|
+
// Historical lanes share maxFleetMachines, counted over their own Machines.
|
|
285
|
+
// On 2026-11-18 one shared budget let nine draining lanes (18 Machines) hold
|
|
286
|
+
// the active lane at its 2-Machine warm floor, and new runs queued 6-12 s.
|
|
287
|
+
let available = Math.max(0, maxFleetMachines - historicalPhysicalCount);
|
|
266
288
|
const historical = lanes
|
|
267
289
|
.filter((lane) => !lane.demand.active && lane.remaining > 0)
|
|
268
290
|
.sort((a, b) =>
|
|
@@ -294,27 +316,43 @@ export function planAbsurdWorkerFleetGrowth(input: {
|
|
|
294
316
|
}
|
|
295
317
|
index = (index + 1) % historical.length;
|
|
296
318
|
}
|
|
297
|
-
|
|
319
|
+
// The active lane grows against its own cap, after its warm floor.
|
|
320
|
+
let activeAvailable = Math.max(
|
|
321
|
+
0,
|
|
322
|
+
maxActiveLaneMachines - activeLaneMachines - warmFloorGrowth,
|
|
323
|
+
);
|
|
324
|
+
while (activeAvailable > 0 && activeLane && activeLane.remaining > 0) {
|
|
298
325
|
grant(activeLane);
|
|
299
|
-
|
|
326
|
+
activeAvailable -= 1;
|
|
300
327
|
}
|
|
301
328
|
let allocatedCount = 0;
|
|
329
|
+
let activeAllocated = 0;
|
|
302
330
|
let deferredCount = 0;
|
|
303
331
|
const allocations = lanes.map((lane) => {
|
|
304
|
-
|
|
332
|
+
const laneAllocated =
|
|
305
333
|
lane.allocation.startMachineIds.length + lane.allocation.createCount;
|
|
334
|
+
allocatedCount += laneAllocated;
|
|
335
|
+
if (lane.demand.active) activeAllocated += laneAllocated;
|
|
306
336
|
deferredCount += lane.remaining;
|
|
307
337
|
return { ...lane.allocation, deferredCount: lane.remaining };
|
|
308
338
|
});
|
|
309
339
|
const projectedPhysicalCount = requireMachineCount(
|
|
310
340
|
physicalCount + allocatedCount,
|
|
311
341
|
);
|
|
342
|
+
const historicalAllocated = allocatedCount - activeAllocated;
|
|
312
343
|
return {
|
|
313
344
|
allocations,
|
|
314
345
|
nextCursor,
|
|
315
346
|
physicalCount,
|
|
316
347
|
projectedPhysicalCount,
|
|
317
|
-
|
|
348
|
+
// Debt is reported per partition; the warm floor may exceed the active
|
|
349
|
+
// cap only when protected capacity already fills it.
|
|
350
|
+
budgetDebt:
|
|
351
|
+
Math.max(
|
|
352
|
+
0,
|
|
353
|
+
historicalPhysicalCount + historicalAllocated - maxFleetMachines,
|
|
354
|
+
) +
|
|
355
|
+
Math.max(0, activeLaneMachines + activeAllocated - maxActiveLaneMachines),
|
|
318
356
|
deferredCount,
|
|
319
357
|
warmFloorGrowth,
|
|
320
358
|
maxFleetMachines,
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts
CHANGED
|
@@ -376,6 +376,7 @@ import {
|
|
|
376
376
|
abandonRuntimeSandboxOperationReservation,
|
|
377
377
|
bindRuntimeSandboxCapacityLease,
|
|
378
378
|
createRuntimeSandboxOperationReservation,
|
|
379
|
+
precheckRuntimeSandboxCapacity,
|
|
379
380
|
readReservedDaytonaCancellationOperation,
|
|
380
381
|
recordDaytonaSandboxCleanupIntent,
|
|
381
382
|
reserveRuntimeSandboxOperation,
|
|
@@ -776,10 +777,23 @@ function isTransientHeartbeatTimeout(error: unknown): boolean {
|
|
|
776
777
|
);
|
|
777
778
|
}
|
|
778
779
|
|
|
779
|
-
function capacityDeferralSeconds(
|
|
780
|
+
export function capacityDeferralSeconds(
|
|
781
|
+
error: unknown,
|
|
782
|
+
runId: string,
|
|
783
|
+
generation?: number,
|
|
784
|
+
): number {
|
|
780
785
|
if (!isRuntimeSchedulerCapacityError(error)) return 5;
|
|
786
|
+
// A run repeatedly rejected at the workspace cap does not need to claim
|
|
787
|
+
// another generation every 15 seconds. Preserve short retries on young
|
|
788
|
+
// runs and use the existing durable task defer for older generations.
|
|
789
|
+
const workspaceCapFloorSeconds =
|
|
790
|
+
error instanceof RuntimeSandboxCapacityLimitError &&
|
|
791
|
+
generation !== undefined &&
|
|
792
|
+
generation >= 5
|
|
793
|
+
? 60
|
|
794
|
+
: 1;
|
|
781
795
|
const baseSeconds = Math.max(
|
|
782
|
-
|
|
796
|
+
workspaceCapFloorSeconds,
|
|
783
797
|
Math.ceil(runtimeSchedulerCapacityRetryAfterMs(error) / 1_000),
|
|
784
798
|
);
|
|
785
799
|
// Keep a saturated fleet from waking every parked run in the same second.
|
|
@@ -3824,6 +3838,52 @@ async function executeAbsurdAttemptAdapter(
|
|
|
3824
3838
|
});
|
|
3825
3839
|
if (gated) return gated;
|
|
3826
3840
|
}
|
|
3841
|
+
// Before any launch work (token mint, the fleet-wide sandbox start limiter,
|
|
3842
|
+
// provider resolution), defer an attempt whose organization is already at
|
|
3843
|
+
// its sandbox capacity. The reservation below stays the authority; this
|
|
3844
|
+
// only spares a doomed attempt that work, and throws the same capacity
|
|
3845
|
+
// error, so deferral and terminalization are unchanged. A failed read
|
|
3846
|
+
// falls through to the ordinary path.
|
|
3847
|
+
if (
|
|
3848
|
+
isManagedSandboxRuntimeBackend(launch.runtimeBackend) &&
|
|
3849
|
+
launch.orgId
|
|
3850
|
+
) {
|
|
3851
|
+
const capacityMode = runtimeSandboxCapacityAdmissionMode();
|
|
3852
|
+
let precheck: Awaited<
|
|
3853
|
+
ReturnType<typeof precheckRuntimeSandboxCapacity>
|
|
3854
|
+
> | null = null;
|
|
3855
|
+
if (capacityMode === 'enforce') {
|
|
3856
|
+
try {
|
|
3857
|
+
precheck = await deps.runWithClient(
|
|
3858
|
+
(client) =>
|
|
3859
|
+
precheckRuntimeSandboxCapacity(
|
|
3860
|
+
client,
|
|
3861
|
+
{
|
|
3862
|
+
orgId: launch.orgId!,
|
|
3863
|
+
runId,
|
|
3864
|
+
mode: capacityMode,
|
|
3865
|
+
entitlementLimit: launch.concurrentRunsLimit ?? null,
|
|
3866
|
+
},
|
|
3867
|
+
options,
|
|
3868
|
+
),
|
|
3869
|
+
{ runId, phase: 'sandbox_capacity_precheck' },
|
|
3870
|
+
);
|
|
3871
|
+
} catch (error) {
|
|
3872
|
+
console.warn('[absurd-runtime.worker] sandbox_capacity_precheck_failed', {
|
|
3873
|
+
runId,
|
|
3874
|
+
attempt: generation,
|
|
3875
|
+
error: error instanceof Error ? error.message : String(error),
|
|
3876
|
+
});
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
if (precheck?.full) {
|
|
3880
|
+
throw new RuntimeSandboxCapacityLimitError({
|
|
3881
|
+
orgId: launch.orgId,
|
|
3882
|
+
limit: precheck.limit,
|
|
3883
|
+
activeLeases: precheck.activeLeases,
|
|
3884
|
+
});
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3827
3887
|
const carriedExperimentSwitches = readCarriedExperimentSwitchOverrides(
|
|
3828
3888
|
launch.experimentSwitchOverrides,
|
|
3829
3889
|
);
|
|
@@ -4121,6 +4181,12 @@ async function executeAbsurdAttemptAdapter(
|
|
|
4121
4181
|
options,
|
|
4122
4182
|
),
|
|
4123
4183
|
);
|
|
4184
|
+
if (error instanceof RuntimeSandboxCapacityLimitError) {
|
|
4185
|
+
throw new DeferTask(
|
|
4186
|
+
error.message,
|
|
4187
|
+
capacityDeferralSeconds(error, runId, generation),
|
|
4188
|
+
);
|
|
4189
|
+
}
|
|
4124
4190
|
throw error;
|
|
4125
4191
|
}
|
|
4126
4192
|
await salvageAbsurdFinalAttemptTerminal({
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts
CHANGED
|
@@ -1191,6 +1191,14 @@ export function createPostgresSchedulerProgressReporter(input: {
|
|
|
1191
1191
|
return;
|
|
1192
1192
|
}
|
|
1193
1193
|
if (event.type === 'docflow.node.completed') {
|
|
1194
|
+
// A decision's completion is re-emitted carrying the arm it took; a
|
|
1195
|
+
// repeat of the same invocation without it must not erase that arm.
|
|
1196
|
+
const decision =
|
|
1197
|
+
event.decision ??
|
|
1198
|
+
(current?.nodeIo?.attempt === event.attempt &&
|
|
1199
|
+
current.nodeIo.invocationId === event.invocationId
|
|
1200
|
+
? current.nodeIo.decision
|
|
1201
|
+
: undefined);
|
|
1194
1202
|
setNodeProgress(event.nodeId, {
|
|
1195
1203
|
startedAt: current?.startedAt ?? event.at,
|
|
1196
1204
|
completedAt: event.at,
|
|
@@ -1202,6 +1210,7 @@ export function createPostgresSchedulerProgressReporter(input: {
|
|
|
1202
1210
|
outputs: event.outputs,
|
|
1203
1211
|
...(event.outputsTruncated ? { outputsTruncated: true } : {}),
|
|
1204
1212
|
error: null,
|
|
1213
|
+
...(decision ? { decision } : {}),
|
|
1205
1214
|
},
|
|
1206
1215
|
});
|
|
1207
1216
|
scheduleFlush(true);
|
|
@@ -1560,6 +1569,14 @@ export function createPostgresSchedulerProgressReporter(input: {
|
|
|
1560
1569
|
continue;
|
|
1561
1570
|
}
|
|
1562
1571
|
const at = observation.settledAt ?? observation.startedAt ?? Date.now();
|
|
1572
|
+
// Durable observations carry no decision arm; the live completion that
|
|
1573
|
+
// recorded one for this same invocation keeps it.
|
|
1574
|
+
const decision =
|
|
1575
|
+
observation.status === 'completed' &&
|
|
1576
|
+
current?.nodeIo?.attempt === observation.attempt &&
|
|
1577
|
+
current.nodeIo.invocationId === (observation.invocationId ?? undefined)
|
|
1578
|
+
? current.nodeIo.decision
|
|
1579
|
+
: undefined;
|
|
1563
1580
|
setNodeProgress(nodeId, {
|
|
1564
1581
|
startedAt: current?.startedAt ?? observation.startedAt ?? at,
|
|
1565
1582
|
...(observation.status === 'started' ? {} : { completedAt: at }),
|
|
@@ -1581,6 +1598,7 @@ export function createPostgresSchedulerProgressReporter(input: {
|
|
|
1581
1598
|
: observation.status === 'completed'
|
|
1582
1599
|
? { error: null }
|
|
1583
1600
|
: {}),
|
|
1601
|
+
...(decision ? { decision } : {}),
|
|
1584
1602
|
},
|
|
1585
1603
|
});
|
|
1586
1604
|
}
|
|
@@ -19815,6 +19815,74 @@ export async function getPostgresSchedulerObservationsForRuns(
|
|
|
19815
19815
|
return result.rows.map(mapObservationRow);
|
|
19816
19816
|
}
|
|
19817
19817
|
|
|
19818
|
+
/**
|
|
19819
|
+
* The newest settled observation of EVERY node for a bounded page of runs, in
|
|
19820
|
+
* one org-scoped read over the observations primary key — what a runs grid's
|
|
19821
|
+
* per-step columns summarize. Same winner rule as the one-node read: highest
|
|
19822
|
+
* attempt, then latest invocation.
|
|
19823
|
+
*/
|
|
19824
|
+
export async function getPostgresSchedulerSettledObservationsForRuns(
|
|
19825
|
+
client: PostgresSchedulerQueryClient,
|
|
19826
|
+
input: { runIds: readonly string[] },
|
|
19827
|
+
options: PostgresSchedulerReceiptOptions,
|
|
19828
|
+
): Promise<DocflowObservationRecord[]> {
|
|
19829
|
+
const runIds = [
|
|
19830
|
+
...new Set(input.runIds.map((runId) => runId.trim()).filter(Boolean)),
|
|
19831
|
+
];
|
|
19832
|
+
if (runIds.length === 0) return [];
|
|
19833
|
+
const result = await client.query<ObservationRow>(
|
|
19834
|
+
`
|
|
19835
|
+
SELECT DISTINCT ON (run_id, node_id)
|
|
19836
|
+
run_id, attempt, node_id, invocation_seq, invocation_id, status,
|
|
19837
|
+
inputs_json, outputs_json, inputs_truncated, outputs_truncated,
|
|
19838
|
+
error, started_at, settled_at
|
|
19839
|
+
FROM ${tableName('observations', options)}
|
|
19840
|
+
WHERE org_id = $1
|
|
19841
|
+
AND run_id = ANY($2::text[])
|
|
19842
|
+
AND status IN ('completed', 'failed')
|
|
19843
|
+
ORDER BY run_id, node_id, attempt DESC, invocation_seq DESC
|
|
19844
|
+
`,
|
|
19845
|
+
[receiptOrgId(options), runIds],
|
|
19846
|
+
);
|
|
19847
|
+
return result.rows.map(mapObservationRow);
|
|
19848
|
+
}
|
|
19849
|
+
|
|
19850
|
+
/**
|
|
19851
|
+
* The diagram each run of a bounded page pinned at launch: the `docflow` of
|
|
19852
|
+
* the static pipeline frozen into its contract snapshot. A run's steps are
|
|
19853
|
+
* read against the diagram it ran with, not the Play's current one, so an
|
|
19854
|
+
* edited diagram never relabels or drops an old run's recorded steps. Read
|
|
19855
|
+
* through the runs primary key, org-scoped; the JSON path is extracted in the
|
|
19856
|
+
* database so the rest of the launch never leaves it. Runs without a pinned
|
|
19857
|
+
* diagram are absent.
|
|
19858
|
+
*/
|
|
19859
|
+
export async function getPostgresSchedulerPinnedDocflowsForRuns(
|
|
19860
|
+
client: PostgresSchedulerQueryClient,
|
|
19861
|
+
input: { runIds: readonly string[] },
|
|
19862
|
+
options: PostgresSchedulerReceiptOptions,
|
|
19863
|
+
): Promise<Map<string, unknown>> {
|
|
19864
|
+
const runIds = [
|
|
19865
|
+
...new Set(input.runIds.map((runId) => runId.trim()).filter(Boolean)),
|
|
19866
|
+
];
|
|
19867
|
+
if (runIds.length === 0) return new Map();
|
|
19868
|
+
const result = await client.query<{ run_id: string; docflow: unknown }>(
|
|
19869
|
+
`
|
|
19870
|
+
SELECT run_id,
|
|
19871
|
+
launch_json #> '{contractSnapshot,staticPipeline,docflow}' AS docflow
|
|
19872
|
+
FROM ${tableName('runs', options)}
|
|
19873
|
+
WHERE org_id = $1
|
|
19874
|
+
AND run_id = ANY($2::text[])
|
|
19875
|
+
`,
|
|
19876
|
+
[receiptOrgId(options), runIds],
|
|
19877
|
+
);
|
|
19878
|
+
const docflows = new Map<string, unknown>();
|
|
19879
|
+
for (const row of result.rows) {
|
|
19880
|
+
if (row.docflow && typeof row.docflow === 'object')
|
|
19881
|
+
docflows.set(row.run_id, row.docflow);
|
|
19882
|
+
}
|
|
19883
|
+
return docflows;
|
|
19884
|
+
}
|
|
19885
|
+
|
|
19818
19886
|
export async function countPostgresSchedulerReceipts(
|
|
19819
19887
|
client: PostgresSchedulerQueryClient,
|
|
19820
19888
|
input: {
|
|
@@ -286,6 +286,95 @@ type RuntimeSandboxReservationProof = {
|
|
|
286
286
|
sandbox_id: string | null;
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
+
/**
|
|
290
|
+
* Advisory, lock-free read of an organization's sandbox capacity, used before
|
|
291
|
+
* an attempt does any launch work (executor-token mint, the fleet-wide sandbox
|
|
292
|
+
* start limiter, provider resolution). It mirrors the counting in
|
|
293
|
+
* `runtime_sandbox_capacity_observation` without taking its advisory lock, so
|
|
294
|
+
* it never contends with real reservations. `reserveRuntimeSandboxCapacityLease`
|
|
295
|
+
* stays the only authority: this read can only defer an attempt that the
|
|
296
|
+
* reservation would also refuse, and a run that already holds an unreleased
|
|
297
|
+
* lease (a resume or a pending provider operation) is never reported full.
|
|
298
|
+
*
|
|
299
|
+
* On 2026-11-18 one capacity-capped organization's blocked cron runs retried
|
|
300
|
+
* every ~21 s through the whole launch path before the reservation refused
|
|
301
|
+
* them: about 27,000 attempts an hour, nearly all of the fleet's sandbox-start
|
|
302
|
+
* limiter traffic.
|
|
303
|
+
*/
|
|
304
|
+
export async function precheckRuntimeSandboxCapacity(
|
|
305
|
+
client: PostgresSchedulerQueryClient,
|
|
306
|
+
input: {
|
|
307
|
+
orgId: string;
|
|
308
|
+
runId: string;
|
|
309
|
+
mode?: RuntimeSandboxCapacityAdmissionMode;
|
|
310
|
+
entitlementLimit?: number | null;
|
|
311
|
+
},
|
|
312
|
+
options?: Pick<PostgresSchedulerOptions, 'schema'>,
|
|
313
|
+
): Promise<{ full: boolean; limit: number; activeLeases: number }> {
|
|
314
|
+
const orgId = assertId(input.orgId, 'orgId');
|
|
315
|
+
const runId = assertId(input.runId, 'runId');
|
|
316
|
+
const { cache, leases } = schemaTables(options);
|
|
317
|
+
const result = await client.query<{
|
|
318
|
+
limit: number;
|
|
319
|
+
active_leases: number;
|
|
320
|
+
run_holds_lease: boolean;
|
|
321
|
+
}>(
|
|
322
|
+
`
|
|
323
|
+
SELECT
|
|
324
|
+
-- Same order as the reservation: an unexpired time-limited override,
|
|
325
|
+
-- then the launch-carried entitlement, then the observation's
|
|
326
|
+
-- configured limit (an expired mirror falls back to the default).
|
|
327
|
+
coalesce(
|
|
328
|
+
(
|
|
329
|
+
SELECT override."limit" FROM ${cache} AS override
|
|
330
|
+
WHERE override.org_id = $1
|
|
331
|
+
AND override.expires_at IS NOT NULL
|
|
332
|
+
AND override.expires_at > clock_timestamp()
|
|
333
|
+
),
|
|
334
|
+
$3::integer,
|
|
335
|
+
(
|
|
336
|
+
SELECT CASE
|
|
337
|
+
WHEN expires_at IS NOT NULL AND expires_at <= clock_timestamp()
|
|
338
|
+
THEN $2::integer
|
|
339
|
+
ELSE "limit"
|
|
340
|
+
END
|
|
341
|
+
FROM ${cache}
|
|
342
|
+
WHERE org_id = $1
|
|
343
|
+
),
|
|
344
|
+
$2::integer
|
|
345
|
+
) AS "limit",
|
|
346
|
+
(
|
|
347
|
+
SELECT count(*)::integer
|
|
348
|
+
FROM ${leases}
|
|
349
|
+
WHERE org_id = $1
|
|
350
|
+
AND released_at IS NULL
|
|
351
|
+
AND (sandbox_id IS NOT NULL OR expires_at > clock_timestamp())
|
|
352
|
+
) AS active_leases,
|
|
353
|
+
EXISTS (
|
|
354
|
+
SELECT 1
|
|
355
|
+
FROM ${leases}
|
|
356
|
+
WHERE org_id = $1
|
|
357
|
+
AND run_id = $4
|
|
358
|
+
AND released_at IS NULL
|
|
359
|
+
) AS run_holds_lease
|
|
360
|
+
`,
|
|
361
|
+
[
|
|
362
|
+
orgId,
|
|
363
|
+
DEFAULT_PLAY_SANDBOX_CONCURRENCY,
|
|
364
|
+
entitlementLimit(input.entitlementLimit),
|
|
365
|
+
runId,
|
|
366
|
+
],
|
|
367
|
+
);
|
|
368
|
+
const row = result.rows[0];
|
|
369
|
+
const limit = Number(row?.limit ?? DEFAULT_PLAY_SANDBOX_CONCURRENCY);
|
|
370
|
+
const activeLeases = Number(row?.active_leases ?? 0);
|
|
371
|
+
const full =
|
|
372
|
+
(input.mode ?? 'enforce') === 'enforce' &&
|
|
373
|
+
row?.run_holds_lease !== true &&
|
|
374
|
+
activeLeases >= limit;
|
|
375
|
+
return { full, limit, activeLeases };
|
|
376
|
+
}
|
|
377
|
+
|
|
289
378
|
/** A launch-carried limit inside the runtime's bounds, or null to ignore it. */
|
|
290
379
|
function entitlementLimit(value: number | null | undefined): number | null {
|
|
291
380
|
return typeof value === 'number' &&
|
|
@@ -310,8 +399,11 @@ export async function reserveRuntimeSandboxCapacityLease(
|
|
|
310
399
|
/** Resume the one unresolved Daytona create for this run, if present. */
|
|
311
400
|
resumePendingDaytonaOperation?: boolean;
|
|
312
401
|
/**
|
|
313
|
-
* The `play.concurrent_runs` entitlement the launch carries.
|
|
314
|
-
*
|
|
402
|
+
* The `play.concurrent_runs` entitlement the launch carries. Any unexpired
|
|
403
|
+
* time-limited row in the mirrored org limit cache wins, raising or
|
|
404
|
+
* lowering the limit, so an operator can resize an org's already-queued
|
|
405
|
+
* runs; otherwise this, then the mirrored cap, then the runtime default.
|
|
406
|
+
* A permanent mirrored row never outranks the launch.
|
|
315
407
|
*/
|
|
316
408
|
entitlementLimit?: number | null;
|
|
317
409
|
},
|
|
@@ -392,7 +484,12 @@ export async function reserveRuntimeSandboxCapacityLease(
|
|
|
392
484
|
`
|
|
393
485
|
WITH observed AS MATERIALIZED (
|
|
394
486
|
SELECT
|
|
395
|
-
coalesce(
|
|
487
|
+
coalesce((
|
|
488
|
+
SELECT override."limit" FROM ${cache} AS override
|
|
489
|
+
WHERE override.org_id = $1
|
|
490
|
+
AND override.expires_at IS NOT NULL
|
|
491
|
+
AND override.expires_at > clock_timestamp()
|
|
492
|
+
), $14::integer, capacity.configured_limit) AS "limit",
|
|
396
493
|
capacity.active_leases,
|
|
397
494
|
coalesce((
|
|
398
495
|
SELECT jsonb_agg(pending)
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
isQueryResultDatasetReadRequest,
|
|
5
5
|
} from './query-result-dataset';
|
|
6
6
|
|
|
7
|
+
const WORKSPACE_CALENDAR_LIST_ALIAS =
|
|
8
|
+
'events.google-calendar.calendars.list-workspace';
|
|
9
|
+
|
|
7
10
|
const ALWAYS_FRESH_INTEGRATION_TOOL_IDS = new Set([
|
|
8
11
|
'google_workspace_request',
|
|
9
12
|
'google_workspace_export_dataset',
|
|
@@ -12,6 +15,8 @@ const ALWAYS_FRESH_INTEGRATION_TOOL_IDS = new Set([
|
|
|
12
15
|
// Google sharing and the current credential must be checked on every call.
|
|
13
16
|
'google_calendar_availability_get_free_busy',
|
|
14
17
|
'google_calendar_availability_get_workspace_free_busy',
|
|
18
|
+
'google_calendar_availability_list_workspace_calendars',
|
|
19
|
+
WORKSPACE_CALENDAR_LIST_ALIAS,
|
|
15
20
|
'google_calendar_availability_query_free_busy',
|
|
16
21
|
'google_calendar_availability_get_booking_event',
|
|
17
22
|
'google_calendar_availability_insert_event',
|
|
@@ -33,6 +38,8 @@ const ALWAYS_FRESH_INTEGRATION_READ_TOOL_IDS = new Set([
|
|
|
33
38
|
'google_workspace_request',
|
|
34
39
|
'google_calendar_availability_get_free_busy',
|
|
35
40
|
'google_calendar_availability_get_workspace_free_busy',
|
|
41
|
+
'google_calendar_availability_list_workspace_calendars',
|
|
42
|
+
WORKSPACE_CALENDAR_LIST_ALIAS,
|
|
36
43
|
'google_calendar_availability_query_free_busy',
|
|
37
44
|
'google_calendar_availability_get_booking_event',
|
|
38
45
|
]);
|
|
@@ -175,7 +182,8 @@ export function reusableWindowEligibility(
|
|
|
175
182
|
return refuse(
|
|
176
183
|
'workspace',
|
|
177
184
|
toolId,
|
|
178
|
-
toolId.startsWith('google_calendar_availability_')
|
|
185
|
+
toolId.startsWith('google_calendar_availability_') ||
|
|
186
|
+
toolId === WORKSPACE_CALENDAR_LIST_ALIAS
|
|
179
187
|
? 'checks current calendar access on every call'
|
|
180
188
|
: 'works on a live Google Workspace file whose edits and conflict checks must be seen each run',
|
|
181
189
|
);
|
|
@@ -2030,6 +2030,54 @@ export function createToolExecuteResult<TResult = unknown>(input: {
|
|
|
2030
2030
|
return wrapper;
|
|
2031
2031
|
}
|
|
2032
2032
|
|
|
2033
|
+
const DOCFLOW_TOOL_RESULT_PREVIEW_FIELDS = 16;
|
|
2034
|
+
|
|
2035
|
+
/**
|
|
2036
|
+
* A plain-data view of a tool result for diagram node previews, which never
|
|
2037
|
+
* invoke getters on authored values. A tool result is runtime-owned: its
|
|
2038
|
+
* fields read the provider response through runtime accessors, so this view
|
|
2039
|
+
* resolves them here, bounded and fail-safe.
|
|
2040
|
+
*
|
|
2041
|
+
* Enumerable keys are the tool's declared outputs, in declared order (so every
|
|
2042
|
+
* run of a node previews the same fields in the same order), each resolved
|
|
2043
|
+
* through `result.field(name)`. `fields` (the catalog tree, as plain data) and
|
|
2044
|
+
* `status` stay readable by an `out:` path without crowding the preview. A
|
|
2045
|
+
* result with no declared outputs, and any other value, is returned unchanged.
|
|
2046
|
+
*/
|
|
2047
|
+
export function docflowToolResultPreviewProjection(value: unknown): unknown {
|
|
2048
|
+
let outputs: string[];
|
|
2049
|
+
try {
|
|
2050
|
+
if (!isToolExecuteResult(value)) return value;
|
|
2051
|
+
const extractors = (value._metadata as { extractors?: unknown })
|
|
2052
|
+
.extractors;
|
|
2053
|
+
outputs = isRecord(extractors) ? Object.keys(extractors) : [];
|
|
2054
|
+
} catch {
|
|
2055
|
+
return value;
|
|
2056
|
+
}
|
|
2057
|
+
if (outputs.length === 0) return value;
|
|
2058
|
+
const projection: Record<string, unknown> = {};
|
|
2059
|
+
for (const name of outputs.slice(0, DOCFLOW_TOOL_RESULT_PREVIEW_FIELDS)) {
|
|
2060
|
+
try {
|
|
2061
|
+
projection[name] = (value as { field(name: string): unknown }).field(
|
|
2062
|
+
name,
|
|
2063
|
+
);
|
|
2064
|
+
} catch {
|
|
2065
|
+
// An ambiguous or unreadable field is left out of the preview.
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
let tree: unknown = null;
|
|
2069
|
+
try {
|
|
2070
|
+
tree = JSON.parse(JSON.stringify(value.fields ?? {}) ?? 'null');
|
|
2071
|
+
} catch {
|
|
2072
|
+
tree = null;
|
|
2073
|
+
}
|
|
2074
|
+
Object.defineProperties(projection, {
|
|
2075
|
+
fields: { value: tree, enumerable: false },
|
|
2076
|
+
status: { value: value.status, enumerable: false },
|
|
2077
|
+
});
|
|
2078
|
+
return projection;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2033
2081
|
export function isToolExecuteResult(
|
|
2034
2082
|
value: unknown,
|
|
2035
2083
|
): value is ToolExecuteResult {
|
|
@@ -234,6 +234,10 @@ export const PLAY_AUTHORING_CONTRACT_ISSUE_CODES = [
|
|
|
234
234
|
'docflow_binding_drift',
|
|
235
235
|
'docflow_branch_labels_required',
|
|
236
236
|
'docflow_branch_requires_decision',
|
|
237
|
+
'docflow_decision_arms_incomplete',
|
|
238
|
+
'docflow_decision_outside_region',
|
|
239
|
+
'docflow_region_exits_unlabeled',
|
|
240
|
+
'docflow_show_undeclared',
|
|
237
241
|
'docflow_direction_not_top_down',
|
|
238
242
|
'docflow_directive_ignored',
|
|
239
243
|
'docflow_dataset_unrepresented',
|
|
@@ -245,7 +249,8 @@ export const PLAY_AUTHORING_CONTRACT_ISSUE_CODES = [
|
|
|
245
249
|
'play_dataset_column_order_unknown',
|
|
246
250
|
'docflow_layout_complexity',
|
|
247
251
|
'docflow_topology_invalid',
|
|
248
|
-
'
|
|
252
|
+
'docflow_io_missing',
|
|
253
|
+
'docflow_box_is_sketch',
|
|
249
254
|
'docflow_input_not_found',
|
|
250
255
|
'docflow_output_not_found',
|
|
251
256
|
'docflow_label_counts_rows',
|