deepline 0.3.409 → 0.3.411
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/agent-runtime.ts +18 -1
- package/dist/bundling-sources/sdk/src/client.ts +206 -333
- package/dist/bundling-sources/sdk/src/compat.ts +45 -2
- package/dist/bundling-sources/sdk/src/db/query.ts +9 -10
- package/dist/bundling-sources/sdk/src/http.ts +38 -20
- package/dist/bundling-sources/sdk/src/index.ts +4 -5
- package/dist/bundling-sources/sdk/src/play.ts +10 -10
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +6 -4
- package/dist/bundling-sources/sdk/src/plays/check-local-play-graph.ts +114 -0
- package/dist/bundling-sources/sdk/src/plays/client.ts +431 -0
- package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +106 -16
- package/dist/bundling-sources/sdk/src/release.ts +13 -7
- package/dist/bundling-sources/sdk/src/runs/read-errors.ts +8 -0
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +124 -13
- package/dist/bundling-sources/sdk/src/tool-calls.ts +108 -19
- package/dist/bundling-sources/sdk/src/types.ts +18 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/execute-retry-contract.ts +37 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/package.json +3 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +277 -76
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/dataset-row-input.ts +124 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +6 -62
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +67 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +64 -6
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +1 -5
- package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/egress-probe.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +26 -16
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +36 -11
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +35 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +21 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +11 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +85 -20
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +71 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-execution-queries.ts +100 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +9 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +337 -146
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +26 -12
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +425 -102
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +181 -124
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +152 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +5 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +10 -0
- package/dist/bundling-sources/shared_libs/plays/ambiguous-write-error.ts +25 -0
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +4 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +63 -68
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +129 -63
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
- package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +58 -16
- package/dist/bundling-sources/shared_libs/plays/fetch-http-error.ts +50 -0
- package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +351 -0
- package/dist/bundling-sources/shared_libs/plays/tool-list-getter-mode.ts +9 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
- package/dist/cli/auth-M7TBLW55.js +40 -0
- package/dist/cli/{auth-5HIIACF7.mjs → auth-YD6ZTMB2.mjs} +6 -6
- package/dist/cli/{billing-4275N7FL.js → billing-2L3MOB42.js} +84 -84
- package/dist/cli/{billing-EVZ3ZWKC.mjs → billing-ZT46GV4C.mjs} +8 -8
- package/dist/cli/{chunk-ZAAKSJAS.js → chunk-27GJKC5Q.js} +17 -10
- package/dist/cli/{chunk-UHNDVD3P.js → chunk-2H4EY7KH.js} +100 -41
- package/dist/cli/{chunk-GAICVLKL.js → chunk-2NI6DHN7.js} +2 -2
- package/dist/cli/{chunk-JGHG4NBA.js → chunk-2WUY3VNK.js} +19 -4
- package/dist/cli/{chunk-FHPCKULR.mjs → chunk-4BA6ATHA.mjs} +2 -2
- package/dist/cli/{chunk-RTCDW2GU.js → chunk-4O4WNFFC.js} +170 -49
- package/dist/cli/{chunk-OSDXE27V.mjs → chunk-4PG4ARL2.mjs} +17 -10
- package/dist/cli/{chunk-AU4OFDFX.js → chunk-5IGDNBG7.js} +26 -26
- package/dist/cli/{chunk-WYQO2CBS.mjs → chunk-5LRWWMRV.mjs} +149 -28
- package/dist/cli/{chunk-PMVFAYL7.mjs → chunk-63ILLN5H.mjs} +2 -2
- package/dist/cli/chunk-6AUE6JXY.js +35 -0
- package/dist/cli/chunk-7DSMMCXP.js +501 -0
- package/dist/cli/{chunk-6BJK4EJ3.mjs → chunk-AARWVK4C.mjs} +2132 -65
- package/dist/cli/{chunk-FERRDNMO.js → chunk-AD47BXN2.js} +5 -5
- package/dist/cli/{chunk-J6DCKJNM.mjs → chunk-BJV3VSKE.mjs} +16 -1
- package/dist/cli/{chunk-S6R3OX7B.js → chunk-E4CABWXL.js} +25 -2
- package/dist/cli/{chunk-NXGCO4JB.mjs → chunk-E4IXDAZI.mjs} +5 -0
- package/dist/cli/{chunk-BEVLCKXG.mjs → chunk-E4KBNNNB.mjs} +1 -1
- package/dist/cli/{chunk-2PRO2JTX.mjs → chunk-E52TKKVI.mjs} +36 -284
- package/dist/cli/chunk-FR2ILQ4G.mjs +8 -0
- package/dist/cli/{chunk-2GI3QD3L.js → chunk-FRVPOXGB.js} +644 -330
- package/dist/cli/chunk-G43JLBDE.mjs +501 -0
- package/dist/cli/{chunk-BZAMOCPA.mjs → chunk-IMZ56EOH.mjs} +3 -3
- package/dist/cli/chunk-IPGV6VFA.mjs +6084 -0
- package/dist/cli/{chunk-IT3XBJQR.mjs → chunk-IR3AKJAY.mjs} +330 -625
- package/dist/cli/chunk-J33TSWO5.js +8 -0
- package/dist/cli/chunk-JQMZUWNM.mjs +35 -0
- package/dist/cli/chunk-JYHSEGRM.js +6084 -0
- package/dist/cli/{chunk-JI2B4RZP.mjs → chunk-KCC3FKIW.mjs} +71 -12
- package/dist/cli/{chunk-6IKARAYD.mjs → chunk-L2VKAASU.mjs} +23 -0
- package/dist/cli/{chunk-O3VSXP2F.js → chunk-LWBM5FFL.js} +50 -50
- package/dist/cli/{chunk-VWBTTJYQ.mjs → chunk-M6OASCVL.mjs} +6 -3
- package/dist/cli/{chunk-YHPYUZZX.mjs → chunk-MAMVGOSC.mjs} +1 -1
- package/dist/cli/{chunk-Q2E4E4FJ.js → chunk-NPBJI7RE.js} +8 -8
- package/dist/cli/chunk-NQWIZ5PZ.js +313 -0
- package/dist/cli/{chunk-HQXL5526.mjs → chunk-NUX2QHNC.mjs} +1 -1
- package/dist/cli/{chunk-TQNHMWUR.mjs → chunk-OGSXENOF.mjs} +5 -2
- package/dist/cli/{chunk-SEFMGO3Z.js → chunk-OQQOXSYA.js} +2184 -117
- package/dist/cli/{chunk-FJCIUF34.js → chunk-OZSC6CEW.js} +128 -376
- package/dist/cli/{chunk-NZSF57UO.mjs → chunk-PO2VU6WV.mjs} +2 -2
- package/dist/cli/{chunk-7P5AA3SN.js → chunk-PPDBRJRW.js} +6 -1
- package/dist/cli/{chunk-ILHRA7AD.js → chunk-QADCFSGH.js} +7 -7
- package/dist/cli/{chunk-N44JHMKY.mjs → chunk-RFES6Q2J.mjs} +452 -138
- package/dist/cli/{chunk-DEC3JECC.js → chunk-RMINBDYY.js} +5 -2
- package/dist/cli/{chunk-WLOCMJWV.js → chunk-TPFD4F5S.js} +426 -721
- package/dist/cli/{chunk-V76R6HMV.js → chunk-U5AQKE3T.js} +1029 -806
- package/dist/cli/{chunk-PBZYY7VZ.mjs → chunk-UAEVKAUR.mjs} +734 -511
- package/dist/cli/{chunk-WHG43Z67.js → chunk-VGHWJL4W.js} +11 -8
- package/dist/cli/chunk-VKKVSFRD.js +62 -0
- package/dist/cli/{chunk-GSK6NHVM.js → chunk-WU4U6VSB.js} +5 -5
- package/dist/cli/chunk-XAB47ZRV.mjs +313 -0
- package/dist/cli/{chunk-JRAVVJ3T.mjs → chunk-XJD6LZCO.mjs} +2 -2
- package/dist/cli/chunk-ZCALLYF6.mjs +62 -0
- package/dist/cli/{chunk-YD7B53RW.js → chunk-ZHWBU36H.js} +12 -12
- package/dist/cli/{csv-A2MP6EFV.mjs → csv-BKNRRW7D.mjs} +5 -5
- package/dist/cli/{csv-BBOTCGQY.js → csv-SVDP2EU7.js} +14 -14
- package/dist/cli/{db-3W5DMTUX.mjs → db-LU4KLRM6.mjs} +15 -20
- package/dist/cli/{db-G4CODDCA.js → db-OQ6S7TTZ.js} +42 -47
- package/dist/cli/{describe-PQTQ5B6F.js → describe-45TGETKR.js} +27 -22
- package/dist/cli/{describe-XYJ2ZT4M.mjs → describe-U4KOGDRA.mjs} +20 -15
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/describe-core.js +6 -6
- package/dist/cli/describe-core.mjs +5 -5
- package/dist/cli/{executions-UR67CA5H.mjs → executions-2GAAUXLA.mjs} +8 -8
- package/dist/cli/{executions-TLANVR7Y.js → executions-VZN56VRC.js} +10 -10
- package/dist/cli/{feedback-6C2YTRJL.js → feedback-NS76B5GU.js} +13 -9
- package/dist/cli/{feedback-WHCMGEIL.mjs → feedback-XW5IWA5R.mjs} +11 -7
- package/dist/cli/{git-GWLB6VSA.mjs → git-CLI66XP6.mjs} +6 -6
- package/dist/cli/git-VGYRGFEN.js +24 -0
- package/dist/cli/index.js +236 -348
- package/dist/cli/index.mjs +162 -274
- package/dist/cli/{legacy-noops-ZUFA7RWI.js → legacy-noops-HCFB3ZOV.js} +9 -9
- package/dist/cli/{legacy-noops-KF4XIFEF.mjs → legacy-noops-ODDOMLBL.mjs} +6 -6
- package/dist/cli/{monitors-TB3K2IVE.js → monitors-7WXQ7JFT.js} +94 -94
- package/dist/cli/{monitors-6UOIDIMB.mjs → monitors-ZXX456TE.mjs} +8 -8
- package/dist/cli/{org-CKWMBPIR.js → org-YLX5PHBQ.js} +68 -68
- package/dist/cli/{org-WGHHMVDZ.mjs → org-YUN3TLNP.mjs} +8 -8
- package/dist/cli/{play-LYPAXCLD.mjs → play-LL73A7EP.mjs} +533 -98
- package/dist/cli/{play-N2B3KAVS.js → play-YGOXL52D.js} +1067 -632
- package/dist/cli/{providers-6DI5BVZJ.mjs → providers-35QSAUHL.mjs} +8 -8
- package/dist/cli/{providers-UR42MD6Z.js → providers-RHCIU2PX.js} +11 -11
- package/dist/cli/{quickstart-MNA2S6PO.mjs → quickstart-6BN3LCZH.mjs} +5 -5
- package/dist/cli/{quickstart-FCJG4XGB.js → quickstart-ORMM4NRK.js} +7 -7
- package/dist/cli/search-EWDMUPHR.js +30 -0
- package/dist/cli/{search-VPPYUJ2M.mjs → search-GAERWLSE.mjs} +9 -9
- package/dist/cli/{secrets-QOSMVO36.js → secrets-3AFCTGT7.js} +17 -17
- package/dist/cli/{secrets-DRI4W7Z5.mjs → secrets-FCL5PALY.mjs} +8 -8
- package/dist/cli/sessions-3OEHEQG7.js +16 -0
- package/dist/cli/{sessions-DQNUKP43.mjs → sessions-RSSL7I7O.mjs} +6 -6
- package/dist/cli/{settings-DWDK3Y2R.mjs → settings-GE4NRE7Y.mjs} +12 -12
- package/dist/cli/{settings-JUGGCOPS.js → settings-RX5K4I7H.js} +79 -79
- package/dist/cli/{setup-AWBHNYXK.js → setup-N3ZNAEL5.js} +45 -44
- package/dist/cli/{setup-D5DWVNY4.mjs → setup-X3RXGG4F.mjs} +11 -10
- package/dist/cli/{skills-YV2XR35J.mjs → skills-5JEAJBDE.mjs} +7 -7
- package/dist/cli/skills-VAAQVEQC.js +29 -0
- package/dist/cli/tools-BYYOT2DU.js +44 -0
- package/dist/cli/{tools-VFJYHNV2.mjs → tools-JOKUWEBZ.mjs} +19 -14
- package/dist/cli/update-36G4ZD7B.js +31 -0
- package/dist/cli/{update-IM6VOTGL.mjs → update-UBHEVFR3.mjs} +11 -9
- package/dist/cli/{workflow-26URBWPV.mjs → workflow-FR6EXAXF.mjs} +44 -20
- package/dist/cli/{workflow-3BS6U6SL.js → workflow-SZAVOHN6.js} +54 -30
- package/dist/{client-BfInrZPB.d.mts → client-74k4IPh6.d.mts} +135 -54
- package/dist/{client-BMjJFpan.d.ts → client-C1IK1f8c.d.ts} +135 -54
- package/dist/{compiler-manifest-Ycx-hoAr.d.mts → compiler-manifest-lzWpbV3w.d.mts} +83 -66
- package/dist/{compiler-manifest-Ycx-hoAr.d.ts → compiler-manifest-lzWpbV3w.d.ts} +83 -66
- package/dist/{index-CZXgiN3E.d.mts → index-C8Cy-YTm.d.ts} +5 -1
- package/dist/{index-NPG5pqxQ.d.ts → index-CtNK-0nI.d.mts} +5 -1
- package/dist/index.d.mts +47 -9
- package/dist/index.d.ts +47 -9
- package/dist/index.js +17 -14
- package/dist/index.mjs +13 -10
- package/dist/install-integrity.json +118 -102
- 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 +5 -4
- 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 +11 -3
- package/dist/plays/run-request.mjs +10 -2
- package/dist/release.d.mts +15 -6
- package/dist/release.d.ts +15 -6
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +2 -2
- package/dist/cli/auth-F6BX32XZ.js +0 -40
- package/dist/cli/chunk-264PC2RN.mjs +0 -83
- package/dist/cli/chunk-44ZTYHMQ.mjs +0 -155
- package/dist/cli/chunk-53HN7WZN.js +0 -392
- package/dist/cli/chunk-7AALNGTA.mjs +0 -392
- package/dist/cli/chunk-ALD4COBH.js +0 -155
- package/dist/cli/chunk-CLJGSOVM.mjs +0 -1716
- package/dist/cli/chunk-WNUR6VP5.js +0 -83
- package/dist/cli/chunk-Z4VNJOF7.js +0 -1716
- package/dist/cli/git-VQFF6D7C.js +0 -24
- package/dist/cli/search-NCEEONMQ.js +0 -30
- package/dist/cli/sessions-3WYKQABW.js +0 -16
- package/dist/cli/skills-AKPAJVSO.js +0 -29
- package/dist/cli/tools-RBKEK6PM.js +0 -39
- package/dist/cli/update-VFNUBLDA.js +0 -29
|
@@ -56,6 +56,8 @@ export type EnrichCompiledConfig = {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
export type EnrichPlaySourceOptions = {
|
|
59
|
+
/** Current CLI authoring emits fresh logical operations; legacy callers keep their source format. */
|
|
60
|
+
explicitFreshness?: boolean;
|
|
59
61
|
playName?: string;
|
|
60
62
|
mapName?: string;
|
|
61
63
|
forceAliases?: Iterable<string>;
|
|
@@ -139,6 +141,7 @@ function renderExecuteStep(
|
|
|
139
141
|
command: EnrichStepCommand,
|
|
140
142
|
options: {
|
|
141
143
|
force: boolean;
|
|
144
|
+
explicitFreshness?: boolean;
|
|
142
145
|
precheck?: string;
|
|
143
146
|
legacyEnvelope?: boolean;
|
|
144
147
|
inlineRunJavascript?: boolean;
|
|
@@ -172,7 +175,8 @@ function renderExecuteStep(
|
|
|
172
175
|
const description = command.description
|
|
173
176
|
? `,\n description: ${stringLiteral(command.description)}`
|
|
174
177
|
: '';
|
|
175
|
-
const force =
|
|
178
|
+
const force =
|
|
179
|
+
options.force && !options.explicitFreshness ? `,\n force: true` : '';
|
|
176
180
|
const legacyEnvelope = options.legacyEnvelope
|
|
177
181
|
? `,\n legacyEnvelope: true`
|
|
178
182
|
: '';
|
|
@@ -256,6 +260,7 @@ function renderIdiomaticExecuteStep(
|
|
|
256
260
|
command: EnrichStepCommand,
|
|
257
261
|
options: {
|
|
258
262
|
force: boolean;
|
|
263
|
+
explicitFreshness?: boolean;
|
|
259
264
|
precheck?: string;
|
|
260
265
|
nativeRunIf?: boolean;
|
|
261
266
|
},
|
|
@@ -287,8 +292,11 @@ function renderIdiomaticExecuteStep(
|
|
|
287
292
|
` id: ${callId},`,
|
|
288
293
|
` tool: ${tool},`,
|
|
289
294
|
` input: ${input} as any,`,
|
|
295
|
+
...(options.explicitFreshness ? [` staleAfterSeconds: 0,`] : []),
|
|
290
296
|
` description: ${stringLiteral((command.description ?? '').trim() || `Run ${command.alias} via ${command.tool}.`)},`,
|
|
291
|
-
...(options.force
|
|
297
|
+
...(options.force && !options.explicitFreshness
|
|
298
|
+
? [` force: true,`]
|
|
299
|
+
: []),
|
|
292
300
|
` });`,
|
|
293
301
|
` __dlAssertSuccessfulToolResult(result);`,
|
|
294
302
|
` return ${extraction};`,
|
|
@@ -300,6 +308,7 @@ function renderPlayStep(
|
|
|
300
308
|
command: EnrichStepCommand,
|
|
301
309
|
options: {
|
|
302
310
|
force: boolean;
|
|
311
|
+
explicitFreshness?: boolean;
|
|
303
312
|
precheck?: string;
|
|
304
313
|
legacyEnvelope?: boolean;
|
|
305
314
|
nativeRunIf?: boolean;
|
|
@@ -334,7 +343,9 @@ function renderPlayStep(
|
|
|
334
343
|
// Enrich validates and normalizes this payload against the certified
|
|
335
344
|
// prebuilt contract before code generation. The attachment retains
|
|
336
345
|
// its concrete input type, while generated payloads are records.
|
|
337
|
-
|
|
346
|
+
options.explicitFreshness
|
|
347
|
+
? ` await __dlRunInlinePlay_${inline!.sourceHash.slice(0, 16)}(stepCtx, payload as never, ${options.force});`
|
|
348
|
+
: ` await __dlRunInlinePlay(${inlineHandler}, stepCtx, payload as never, ${options.force});`,
|
|
338
349
|
]
|
|
339
350
|
: [
|
|
340
351
|
` await stepCtx.runPlay(${callId}, ${playRef}, payload, {`,
|
|
@@ -554,6 +565,7 @@ function renderWaterfallColumns(
|
|
|
554
565
|
forceAliases: Set<string>,
|
|
555
566
|
inlineRunJavascript: boolean,
|
|
556
567
|
idiomaticGetters: boolean,
|
|
568
|
+
explicitFreshness: boolean,
|
|
557
569
|
): string[] {
|
|
558
570
|
const activeChildren = command.commands.filter(
|
|
559
571
|
(nested): nested is EnrichStepCommand =>
|
|
@@ -587,6 +599,7 @@ function renderWaterfallColumns(
|
|
|
587
599
|
nested.alias,
|
|
588
600
|
renderExecuteStep(nested, {
|
|
589
601
|
force,
|
|
602
|
+
explicitFreshness,
|
|
590
603
|
precheck,
|
|
591
604
|
legacyEnvelope: Boolean(nested.extract_js),
|
|
592
605
|
inlineRunJavascript,
|
|
@@ -657,6 +670,7 @@ export function compileEnrichConfigToPlaySource(
|
|
|
657
670
|
forceAliases,
|
|
658
671
|
inlineRunJavascript,
|
|
659
672
|
idiomaticGetters,
|
|
673
|
+
options.explicitFreshness === true,
|
|
660
674
|
),
|
|
661
675
|
);
|
|
662
676
|
return;
|
|
@@ -671,6 +685,7 @@ export function compileEnrichConfigToPlaySource(
|
|
|
671
685
|
command.alias,
|
|
672
686
|
renderExecuteStep(command, {
|
|
673
687
|
force,
|
|
688
|
+
explicitFreshness: options.explicitFreshness,
|
|
674
689
|
inlineRunJavascript,
|
|
675
690
|
idiomaticGetters,
|
|
676
691
|
nativeRunIf: Boolean(runIfSource),
|
|
@@ -705,24 +720,45 @@ export function compileEnrichConfigToPlaySource(
|
|
|
705
720
|
: 'Prepare CSV rows for enrichment.';
|
|
706
721
|
const playOptionsSource = [
|
|
707
722
|
`description: ${stringLiteral(generatedDescription)}`,
|
|
723
|
+
...(options.explicitFreshness === true
|
|
724
|
+
? [`compatibility: { authoringContract: 'explicit-freshness' }`]
|
|
725
|
+
: []),
|
|
708
726
|
...(options.maxCreditsPerRun === undefined
|
|
709
727
|
? []
|
|
710
728
|
: [`billing: { maxCreditsPerRun: ${String(options.maxCreditsPerRun)} }`]),
|
|
711
729
|
].join(', ');
|
|
712
730
|
|
|
731
|
+
const legacyInlineHelper = options.explicitFreshness
|
|
732
|
+
? []
|
|
733
|
+
: [
|
|
734
|
+
`function __dlRunInlinePlay<TContext, TInput, TOutput>(handler: (ctx: TContext, input: TInput) => Promise<TOutput>, scope: TContext, payload: TInput, force: boolean): Promise<TOutput> {`,
|
|
735
|
+
` if (!force) return handler(scope, payload);`,
|
|
736
|
+
` const runtimeScope = scope as TContext & { __deeplineRunWithForcedTools?: <T>(run: () => Promise<T>) => Promise<T> };`,
|
|
737
|
+
` if (typeof runtimeScope.__deeplineRunWithForcedTools !== 'function') {`,
|
|
738
|
+
` throw new Error('This runtime does not support forced certified inline play execution.');`,
|
|
739
|
+
` }`,
|
|
740
|
+
` return runtimeScope.__deeplineRunWithForcedTools(() => handler(scope, payload));`,
|
|
741
|
+
`}`,
|
|
742
|
+
``,
|
|
743
|
+
];
|
|
713
744
|
const body = [
|
|
714
|
-
|
|
715
|
-
` if (!force) return handler(scope, payload);`,
|
|
716
|
-
` const runtimeScope = scope as TContext & { __deeplineRunWithForcedTools?: <T>(run: () => Promise<T>) => Promise<T> };`,
|
|
717
|
-
` if (typeof runtimeScope.__deeplineRunWithForcedTools !== 'function') {`,
|
|
718
|
-
` throw new Error('This runtime does not support forced certified inline play execution.');`,
|
|
719
|
-
` }`,
|
|
720
|
-
` return runtimeScope.__deeplineRunWithForcedTools(() => handler(scope, payload));`,
|
|
721
|
-
`}`,
|
|
722
|
-
``,
|
|
745
|
+
...legacyInlineHelper,
|
|
723
746
|
...inlineHandlers.flatMap((inline) => [
|
|
724
747
|
`const __dlInlinePlay_${inline.sourceHash.slice(0, 16)} = ${inline.functionExpressionSource};`,
|
|
725
748
|
``,
|
|
749
|
+
...(options.explicitFreshness
|
|
750
|
+
? [
|
|
751
|
+
`async function __dlRunInlinePlay_${inline.sourceHash.slice(0, 16)}(scope: Parameters<typeof __dlInlinePlay_${inline.sourceHash.slice(0, 16)}>[0], payload: Parameters<typeof __dlInlinePlay_${inline.sourceHash.slice(0, 16)}>[1], force: boolean): Promise<unknown> {`,
|
|
752
|
+
` if (!force) return __dlInlinePlay_${inline.sourceHash.slice(0, 16)}(scope, payload);`,
|
|
753
|
+
` const runtimeScope = scope as typeof scope & { __deeplineRunWithForcedTools?: <T>(run: () => Promise<T>) => Promise<T> };`,
|
|
754
|
+
` if (typeof runtimeScope.__deeplineRunWithForcedTools !== 'function') {`,
|
|
755
|
+
` throw new Error('This runtime does not support forced certified inline play execution.');`,
|
|
756
|
+
` }`,
|
|
757
|
+
` return runtimeScope.__deeplineRunWithForcedTools(() => __dlInlinePlay_${inline.sourceHash.slice(0, 16)}(scope, payload));`,
|
|
758
|
+
`}`,
|
|
759
|
+
``,
|
|
760
|
+
]
|
|
761
|
+
: []),
|
|
726
762
|
]),
|
|
727
763
|
`export default definePlay(${stringLiteral(playName)}, async (ctx, input: EnrichInput) => {`,
|
|
728
764
|
` const sourceRows = await ctx.csv<Record<string, unknown>>(input.file);`,
|
|
@@ -751,8 +787,11 @@ export function compileEnrichConfigToPlaySource(
|
|
|
751
787
|
// legacy extraction preamble. Tree-shake it to only the helpers the body
|
|
752
788
|
// actually uses (plus their transitive deps) so the emitted play is clean.
|
|
753
789
|
const helpers = idiomaticGetters
|
|
754
|
-
? selectUsedHelpers(
|
|
755
|
-
|
|
790
|
+
? selectUsedHelpers(
|
|
791
|
+
helperSource(options.explicitFreshness),
|
|
792
|
+
body.join('\n'),
|
|
793
|
+
)
|
|
794
|
+
: helperSource(options.explicitFreshness);
|
|
756
795
|
const typeImports = idiomaticGetters
|
|
757
796
|
? inlineTypeImports
|
|
758
797
|
: [...new Set([...inlineTypeImports, 'DeeplinePlayRuntimeContext'])].sort();
|
|
@@ -828,7 +867,7 @@ function selectUsedHelpers(
|
|
|
828
867
|
.join('\n\n');
|
|
829
868
|
}
|
|
830
869
|
|
|
831
|
-
function helperSource(): string {
|
|
870
|
+
function helperSource(explicitFreshness = false): string {
|
|
832
871
|
return [
|
|
833
872
|
`function __dlWholeNumber(value: unknown, fallback: number): number {`,
|
|
834
873
|
` const numeric = Number(value);`,
|
|
@@ -1555,8 +1594,11 @@ function helperSource(): string {
|
|
|
1555
1594
|
` id: input.callId,`,
|
|
1556
1595
|
` tool: input.tool,`,
|
|
1557
1596
|
` input: payload,`,
|
|
1597
|
+
...(explicitFreshness ? [` staleAfterSeconds: 0,`] : []),
|
|
1558
1598
|
` ...(input.description ? { description: input.description } : {}),`,
|
|
1559
|
-
|
|
1599
|
+
...(explicitFreshness
|
|
1600
|
+
? []
|
|
1601
|
+
: [` ...(input.force ? { force: true } : {}),`]),
|
|
1560
1602
|
` });`,
|
|
1561
1603
|
` __dlAssertSuccessfulToolResult(result);`,
|
|
1562
1604
|
` return __dlExtract(input.alias, result, input.row, input.extract, Boolean(input.legacyEnvelope));`,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { PlayAuthoringFetchResponse } from './authoring-contract';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Edition 5+ `ctx.fetch` error for a non-2xx response. Its full readable body is secret-redacted; editions 1–4 retain `PlayFetchResponse { ok: false }`.
|
|
5
|
+
*
|
|
6
|
+
* @sdkReference runtime 178 CtxFetchHttpError
|
|
7
|
+
*/
|
|
8
|
+
export class CtxFetchHttpError extends Error {
|
|
9
|
+
/**
|
|
10
|
+
* Play source and the runtime are separately bundled. Recognize the stable
|
|
11
|
+
* public error code so `instanceof` works across that boundary as well.
|
|
12
|
+
*/
|
|
13
|
+
static [Symbol.hasInstance](value: unknown): boolean {
|
|
14
|
+
return (
|
|
15
|
+
value !== null &&
|
|
16
|
+
typeof value === 'object' &&
|
|
17
|
+
(value as { code?: unknown }).code === 'CTX_FETCH_HTTP_ERROR'
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Stable machine-readable HTTP-failure code. */
|
|
22
|
+
readonly code = 'CTX_FETCH_HTTP_ERROR' as const;
|
|
23
|
+
/** Upstream HTTP status. */
|
|
24
|
+
readonly status: number;
|
|
25
|
+
/** Upstream HTTP status text. */
|
|
26
|
+
readonly statusText: string;
|
|
27
|
+
/** Final response URL after redirects. */
|
|
28
|
+
readonly url: string;
|
|
29
|
+
/** Secret-redacted response headers. */
|
|
30
|
+
readonly headers: Record<string, string>;
|
|
31
|
+
/** Complete secret-redacted response body. */
|
|
32
|
+
readonly bodyText: string;
|
|
33
|
+
/** Eagerly parsed secret-redacted JSON, or null. */
|
|
34
|
+
readonly json: unknown | null;
|
|
35
|
+
|
|
36
|
+
/** Build the error from the durable response record. */
|
|
37
|
+
constructor(readonly response: PlayAuthoringFetchResponse) {
|
|
38
|
+
const body = response.bodyText || 'empty response body';
|
|
39
|
+
super(
|
|
40
|
+
`ctx.fetch(${response.url}) returned HTTP ${response.status}${response.statusText ? ` ${response.statusText}` : ''}: ${body}`,
|
|
41
|
+
);
|
|
42
|
+
this.name = 'CtxFetchHttpError';
|
|
43
|
+
this.status = response.status;
|
|
44
|
+
this.statusText = response.statusText;
|
|
45
|
+
this.url = response.url;
|
|
46
|
+
this.headers = response.headers;
|
|
47
|
+
this.bodyText = response.bodyText;
|
|
48
|
+
this.json = response.json;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PLAY_AUTHORING_CONTRACT_EDITION,
|
|
3
|
+
PlayAuthoringFieldValidationError,
|
|
4
|
+
validatePlayAuthoringField,
|
|
5
|
+
type PlayAuthoringContractEdition,
|
|
6
|
+
} from './authoring-contract';
|
|
7
|
+
import { isDefinePlayCall } from './play-exports';
|
|
8
|
+
import { astArray, isAstNode, type AstNode } from './ts-ast';
|
|
9
|
+
|
|
10
|
+
export type PlaySourceAuthoringEdition =
|
|
11
|
+
| { kind: 'absent' }
|
|
12
|
+
| { kind: 'value'; value: unknown }
|
|
13
|
+
| { kind: 'unknown' };
|
|
14
|
+
|
|
15
|
+
type Property =
|
|
16
|
+
| { kind: 'absent' }
|
|
17
|
+
| { kind: 'found'; value: AstNode }
|
|
18
|
+
| { kind: 'unknown' };
|
|
19
|
+
|
|
20
|
+
function unwrap(node: AstNode | null): AstNode | null {
|
|
21
|
+
let current = node;
|
|
22
|
+
while (
|
|
23
|
+
current &&
|
|
24
|
+
[
|
|
25
|
+
'TSAsExpression',
|
|
26
|
+
'TSSatisfiesExpression',
|
|
27
|
+
'TSTypeAssertion',
|
|
28
|
+
'TSNonNullExpression',
|
|
29
|
+
'ParenthesizedExpression',
|
|
30
|
+
].includes(current.type)
|
|
31
|
+
) {
|
|
32
|
+
current = isAstNode(current.expression) ? current.expression : null;
|
|
33
|
+
}
|
|
34
|
+
return current;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function identifier(node: unknown): string | null {
|
|
38
|
+
return isAstNode(node) &&
|
|
39
|
+
node.type === 'Identifier' &&
|
|
40
|
+
typeof node.name === 'string'
|
|
41
|
+
? node.name
|
|
42
|
+
: null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Shared source selection and final-property semantics; no bundle compiler. */
|
|
46
|
+
export function extractPlaySourceAuthoringEdition(
|
|
47
|
+
ast: AstNode,
|
|
48
|
+
exportName: string | null = null,
|
|
49
|
+
): {
|
|
50
|
+
marker: PlaySourceAuthoringEdition;
|
|
51
|
+
localExport: boolean;
|
|
52
|
+
definition?: AstNode;
|
|
53
|
+
} {
|
|
54
|
+
const declarations = new Map<string, AstNode | null>();
|
|
55
|
+
const exports = new Map<string, AstNode>();
|
|
56
|
+
const legacyExports = new Map<string, AstNode>();
|
|
57
|
+
const definitions: AstNode[] = [];
|
|
58
|
+
const defineAliases = new Set<string>();
|
|
59
|
+
const record = (statement: AstNode, exported: boolean) => {
|
|
60
|
+
for (const declaration of astArray(statement.declarations)) {
|
|
61
|
+
const name = identifier(declaration.id);
|
|
62
|
+
const initializer = isAstNode(declaration.init) ? declaration.init : null;
|
|
63
|
+
if (!name) continue;
|
|
64
|
+
// A mutable option/alias is unresolved. Historical direct Play bindings
|
|
65
|
+
// are still recognizable, as they are in the existing metadata adapters.
|
|
66
|
+
declarations.set(
|
|
67
|
+
name,
|
|
68
|
+
statement.kind === 'const' || isDefinePlayCall(initializer)
|
|
69
|
+
? initializer
|
|
70
|
+
: null,
|
|
71
|
+
);
|
|
72
|
+
if (initializer && isDefinePlayCall(initializer))
|
|
73
|
+
definitions.push(initializer);
|
|
74
|
+
if (exported) exports.set(name, { type: 'Identifier', name });
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
for (const statement of astArray(ast.body)) {
|
|
78
|
+
if (statement.type === 'ImportDeclaration') {
|
|
79
|
+
for (const specifier of astArray(statement.specifiers)) {
|
|
80
|
+
if (
|
|
81
|
+
specifier.type === 'ImportSpecifier' &&
|
|
82
|
+
['definePlay', 'defineWorkflow'].includes(
|
|
83
|
+
identifier(specifier.imported) ?? '',
|
|
84
|
+
)
|
|
85
|
+
) {
|
|
86
|
+
const name = identifier(specifier.local);
|
|
87
|
+
if (name) defineAliases.add(name);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (statement.type === 'VariableDeclaration') record(statement, false);
|
|
92
|
+
if (
|
|
93
|
+
statement.type === 'ExportDefaultDeclaration' &&
|
|
94
|
+
isAstNode(statement.declaration)
|
|
95
|
+
) {
|
|
96
|
+
exports.set('default', statement.declaration);
|
|
97
|
+
}
|
|
98
|
+
if (
|
|
99
|
+
statement.type === 'TSExportAssignment' &&
|
|
100
|
+
isAstNode(statement.expression)
|
|
101
|
+
) {
|
|
102
|
+
legacyExports.set('default', statement.expression);
|
|
103
|
+
}
|
|
104
|
+
if (statement.type === 'ExportNamedDeclaration') {
|
|
105
|
+
if (isAstNode(statement.source) || statement.exportKind === 'type')
|
|
106
|
+
continue;
|
|
107
|
+
if (
|
|
108
|
+
isAstNode(statement.declaration) &&
|
|
109
|
+
statement.declaration.type === 'VariableDeclaration'
|
|
110
|
+
) {
|
|
111
|
+
record(statement.declaration, true);
|
|
112
|
+
}
|
|
113
|
+
for (const specifier of astArray(statement.specifiers)) {
|
|
114
|
+
if (specifier.exportKind === 'type') continue;
|
|
115
|
+
const local = identifier(specifier.local);
|
|
116
|
+
const exported =
|
|
117
|
+
identifier(specifier.exported) ??
|
|
118
|
+
(isAstNode(specifier.exported) &&
|
|
119
|
+
specifier.exported.type === 'Literal' &&
|
|
120
|
+
typeof specifier.exported.value === 'string'
|
|
121
|
+
? specifier.exported.value
|
|
122
|
+
: null);
|
|
123
|
+
if (local && exported)
|
|
124
|
+
exports.set(exported, { type: 'Identifier', name: local });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (
|
|
128
|
+
statement.type === 'ExpressionStatement' &&
|
|
129
|
+
isAstNode(statement.expression) &&
|
|
130
|
+
statement.expression.type === 'AssignmentExpression'
|
|
131
|
+
) {
|
|
132
|
+
const left = isAstNode(statement.expression.left)
|
|
133
|
+
? statement.expression.left
|
|
134
|
+
: null;
|
|
135
|
+
const right = isAstNode(statement.expression.right)
|
|
136
|
+
? statement.expression.right
|
|
137
|
+
: null;
|
|
138
|
+
if (left?.type === 'MemberExpression' && !left.computed && right) {
|
|
139
|
+
const object = isAstNode(left.object) ? left.object : null;
|
|
140
|
+
if (
|
|
141
|
+
identifier(object) === 'module' &&
|
|
142
|
+
identifier(left.property) === 'exports'
|
|
143
|
+
) {
|
|
144
|
+
legacyExports.set('default', right);
|
|
145
|
+
} else if (
|
|
146
|
+
identifier(object) === 'exports' &&
|
|
147
|
+
identifier(left.property) === 'default'
|
|
148
|
+
) {
|
|
149
|
+
legacyExports.set('default', right);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const resolve = (
|
|
155
|
+
node: AstNode | null,
|
|
156
|
+
seen = new Set<string>(),
|
|
157
|
+
): AstNode | null => {
|
|
158
|
+
const value = unwrap(node);
|
|
159
|
+
if (value?.type === 'UnaryExpression' && value.operator === 'void') {
|
|
160
|
+
const operand = unwrap(isAstNode(value.argument) ? value.argument : null);
|
|
161
|
+
if (operand?.type === 'Literal')
|
|
162
|
+
return { type: 'Literal', value: undefined };
|
|
163
|
+
}
|
|
164
|
+
const name = identifier(value);
|
|
165
|
+
if (!name) return value;
|
|
166
|
+
if (name === 'undefined' && !declarations.has(name))
|
|
167
|
+
return { type: 'Literal', value: undefined };
|
|
168
|
+
if (seen.has(name)) return null;
|
|
169
|
+
return resolve(declarations.get(name) ?? null, new Set(seen).add(name));
|
|
170
|
+
};
|
|
171
|
+
const staticKey = (node: AstNode | null): string | null => {
|
|
172
|
+
const value = resolve(node);
|
|
173
|
+
if (
|
|
174
|
+
value?.type === 'Literal' &&
|
|
175
|
+
(typeof value.value === 'string' || typeof value.value === 'number')
|
|
176
|
+
) {
|
|
177
|
+
return String(value.value);
|
|
178
|
+
}
|
|
179
|
+
if (
|
|
180
|
+
value?.type === 'TemplateLiteral' &&
|
|
181
|
+
astArray(value.expressions).length === 0
|
|
182
|
+
) {
|
|
183
|
+
const quasi = astArray(value.quasis)[0];
|
|
184
|
+
const cooked =
|
|
185
|
+
quasi?.value && typeof quasi.value === 'object'
|
|
186
|
+
? (quasi.value as { cooked?: unknown }).cooked
|
|
187
|
+
: null;
|
|
188
|
+
return typeof cooked === 'string' ? cooked : null;
|
|
189
|
+
}
|
|
190
|
+
return null;
|
|
191
|
+
};
|
|
192
|
+
const property = (
|
|
193
|
+
node: AstNode | null,
|
|
194
|
+
key: string,
|
|
195
|
+
ancestors = new Set<AstNode>(),
|
|
196
|
+
): Property => {
|
|
197
|
+
if (!node) return { kind: 'absent' };
|
|
198
|
+
const object = resolve(node);
|
|
199
|
+
if (object?.type === 'Literal' && object.value == null)
|
|
200
|
+
return { kind: 'absent' };
|
|
201
|
+
if (object?.type !== 'ObjectExpression' || ancestors.has(object))
|
|
202
|
+
return { kind: 'unknown' };
|
|
203
|
+
const next = new Set(ancestors).add(object);
|
|
204
|
+
for (const entry of astArray(object.properties).reverse()) {
|
|
205
|
+
if (entry.type === 'SpreadElement') {
|
|
206
|
+
const spread = property(
|
|
207
|
+
isAstNode(entry.argument) ? entry.argument : null,
|
|
208
|
+
key,
|
|
209
|
+
next,
|
|
210
|
+
);
|
|
211
|
+
if (spread.kind !== 'absent') return spread;
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
if (entry.type !== 'Property') return { kind: 'unknown' };
|
|
215
|
+
const name = entry.computed
|
|
216
|
+
? staticKey(isAstNode(entry.key) ? entry.key : null)
|
|
217
|
+
: (identifier(entry.key) ??
|
|
218
|
+
staticKey(isAstNode(entry.key) ? entry.key : null));
|
|
219
|
+
if (name === null) return { kind: 'unknown' };
|
|
220
|
+
if (name !== key) continue;
|
|
221
|
+
if (entry.kind !== 'init' || entry.method) return { kind: 'unknown' };
|
|
222
|
+
return isAstNode(entry.value)
|
|
223
|
+
? { kind: 'found', value: entry.value }
|
|
224
|
+
: { kind: 'unknown' };
|
|
225
|
+
}
|
|
226
|
+
return { kind: 'absent' };
|
|
227
|
+
};
|
|
228
|
+
const callMarker = (call: AstNode): Property => {
|
|
229
|
+
const args = astArray(call.arguments);
|
|
230
|
+
const first = resolve(args[0] ?? null);
|
|
231
|
+
const objectForm = first?.type === 'ObjectExpression' || args.length === 1;
|
|
232
|
+
const options = objectForm ? (args[0] ?? null) : (args[2] ?? null);
|
|
233
|
+
const direct = property(options, 'compatibility');
|
|
234
|
+
let compatibility = direct;
|
|
235
|
+
// definePlay uses whole-object nullish precedence, never merges bindings.
|
|
236
|
+
if (
|
|
237
|
+
direct.kind === 'absent' ||
|
|
238
|
+
(direct.kind === 'found' &&
|
|
239
|
+
resolve(direct.value)?.type === 'Literal' &&
|
|
240
|
+
resolve(direct.value)?.value == null)
|
|
241
|
+
) {
|
|
242
|
+
const bindings = objectForm
|
|
243
|
+
? property(options, 'bindings')
|
|
244
|
+
: ({ kind: 'absent' } as Property);
|
|
245
|
+
compatibility =
|
|
246
|
+
bindings.kind === 'found'
|
|
247
|
+
? property(bindings.value, 'compatibility')
|
|
248
|
+
: bindings;
|
|
249
|
+
}
|
|
250
|
+
return compatibility.kind === 'found'
|
|
251
|
+
? property(compatibility.value, 'authoringContract')
|
|
252
|
+
: compatibility;
|
|
253
|
+
};
|
|
254
|
+
const reachesMarker = (
|
|
255
|
+
node: AstNode | null,
|
|
256
|
+
seen = new Set<AstNode>(),
|
|
257
|
+
): boolean => {
|
|
258
|
+
const value = resolve(node);
|
|
259
|
+
if (!value || seen.has(value)) return false;
|
|
260
|
+
seen.add(value);
|
|
261
|
+
// A handler's nested child declaration does not declare its parent edition.
|
|
262
|
+
if (
|
|
263
|
+
[
|
|
264
|
+
'FunctionExpression',
|
|
265
|
+
'ArrowFunctionExpression',
|
|
266
|
+
'FunctionDeclaration',
|
|
267
|
+
].includes(value.type)
|
|
268
|
+
)
|
|
269
|
+
return false;
|
|
270
|
+
if (
|
|
271
|
+
(isDefinePlayCall(value) ||
|
|
272
|
+
(value.type === 'CallExpression' &&
|
|
273
|
+
defineAliases.has(identifier(value.callee) ?? ''))) &&
|
|
274
|
+
callMarker(value).kind !== 'absent'
|
|
275
|
+
)
|
|
276
|
+
return true;
|
|
277
|
+
return Object.values(value).some((child) =>
|
|
278
|
+
isAstNode(child)
|
|
279
|
+
? reachesMarker(child, seen)
|
|
280
|
+
: Array.isArray(child) &&
|
|
281
|
+
astArray(child).some((entry) => reachesMarker(entry, seen)),
|
|
282
|
+
);
|
|
283
|
+
};
|
|
284
|
+
const requested = exportName ?? 'default';
|
|
285
|
+
const local = exports.get(requested);
|
|
286
|
+
const expression = resolve(
|
|
287
|
+
local ??
|
|
288
|
+
legacyExports.get(requested) ??
|
|
289
|
+
(exportName === null ? (definitions[0] ?? null) : null),
|
|
290
|
+
);
|
|
291
|
+
if (!expression || expression.type !== 'CallExpression') {
|
|
292
|
+
return {
|
|
293
|
+
marker: {
|
|
294
|
+
kind:
|
|
295
|
+
(local && !expression) || reachesMarker(expression)
|
|
296
|
+
? 'unknown'
|
|
297
|
+
: 'absent',
|
|
298
|
+
},
|
|
299
|
+
localExport: false,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
const recognized = isDefinePlayCall(expression);
|
|
303
|
+
const marker = callMarker(expression);
|
|
304
|
+
if (!recognized && marker.kind === 'absent' && reachesMarker(expression)) {
|
|
305
|
+
return { marker: { kind: 'unknown' }, localExport: false };
|
|
306
|
+
}
|
|
307
|
+
if (marker.kind !== 'found') return { marker, localExport: Boolean(local) };
|
|
308
|
+
// Historical wrappers remain unmarked. An explicit marker on a wrapper or
|
|
309
|
+
// imported helper alias cannot silently downgrade to legacy behavior.
|
|
310
|
+
if (!recognized) return { marker: { kind: 'unknown' }, localExport: false };
|
|
311
|
+
const value = resolve(marker.value);
|
|
312
|
+
return {
|
|
313
|
+
marker:
|
|
314
|
+
value?.type === 'Literal'
|
|
315
|
+
? { kind: 'value', value: value.value }
|
|
316
|
+
: { kind: 'unknown' },
|
|
317
|
+
localExport: Boolean(local),
|
|
318
|
+
definition: expression,
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/** Source defaults and stored snapshot defaults are deliberately independent. */
|
|
323
|
+
export function resolvePlaySourceAuthoringContractEdition(
|
|
324
|
+
marker: PlaySourceAuthoringEdition,
|
|
325
|
+
pinnedEdition?: PlayAuthoringContractEdition,
|
|
326
|
+
): PlayAuthoringContractEdition {
|
|
327
|
+
if (marker.kind === 'unknown') {
|
|
328
|
+
throw new PlayAuthoringFieldValidationError(
|
|
329
|
+
'compatibility.authoringContract',
|
|
330
|
+
'play_authoring_binding_invalid',
|
|
331
|
+
'compatibility.authoringContract must be statically resolvable; declare "explicit-freshness" to opt into explicit freshness.',
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
if (marker.kind === 'absent')
|
|
335
|
+
return pinnedEdition ?? PLAY_AUTHORING_CONTRACT_EDITION;
|
|
336
|
+
validatePlayAuthoringField('compatibility.authoringContract', marker.value);
|
|
337
|
+
if (
|
|
338
|
+
pinnedEdition !== undefined &&
|
|
339
|
+
pinnedEdition !== 10 &&
|
|
340
|
+
pinnedEdition !== PLAY_AUTHORING_CONTRACT_EDITION
|
|
341
|
+
) {
|
|
342
|
+
throw new PlayAuthoringFieldValidationError(
|
|
343
|
+
'compatibility.authoringContract',
|
|
344
|
+
'play_authoring_binding_invalid',
|
|
345
|
+
`The source explicit-freshness contract requires authoringContractEdition ${PLAY_AUTHORING_CONTRACT_EDITION}; artifact-pinned edition 10 remains valid only for an already-published artifact.`,
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
// Keep already-published edition-10 artifacts on their admitted contract.
|
|
349
|
+
// Newly authored marked source adopts the current strict writer edition.
|
|
350
|
+
return pinnedEdition === 10 ? 10 : PLAY_AUTHORING_CONTRACT_EDITION;
|
|
351
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PlayAuthoringContractEdition } from './authoring-contract';
|
|
2
|
+
export type { PlayAuthoringContractEdition } from './authoring-contract';
|
|
3
|
+
|
|
4
|
+
/** CLI presentation shares getter policy without initializing Play schemas. */
|
|
5
|
+
export function playToolListGetterMode(
|
|
6
|
+
edition: PlayAuthoringContractEdition | undefined = undefined,
|
|
7
|
+
): 'dataset' | 'array' {
|
|
8
|
+
return edition === undefined || edition >= 10 ? 'array' : 'dataset';
|
|
9
|
+
}
|
|
@@ -299,7 +299,7 @@ export type ToolExecuteResultAccessors<
|
|
|
299
299
|
* Provider data: `toolResponse.rawV2`; metadata: `toolResponse.meta`.
|
|
300
300
|
* Single-value getters: `extractedValues.<name>.get()`; lists: `extractedLists.<name>.get()`.
|
|
301
301
|
*
|
|
302
|
-
* Prefer declared getters.
|
|
302
|
+
* Prefer declared getters. Edition 10 and later Plays receive ordinary arrays from
|
|
303
303
|
* list `.get()` synchronously; persist explicitly with ctx.dataset. Lazy or
|
|
304
304
|
* incomplete lists throw: use readList(result, path) for explicit dataset access.
|
|
305
305
|
* Provider pagination requires a separate request; getters never fetch it.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkLWBM5FFLjs = require('./chunk-LWBM5FFL.js');
|
|
17
|
+
require('./chunk-ZHWBU36H.js');
|
|
18
|
+
require('./chunk-OZSC6CEW.js');
|
|
19
|
+
require('./chunk-NPBJI7RE.js');
|
|
20
|
+
require('./chunk-XNYIZMNQ.js');
|
|
21
|
+
require('./chunk-PPDBRJRW.js');
|
|
22
|
+
require('./chunk-RMINBDYY.js');
|
|
23
|
+
require('./chunk-OG64RBAC.js');
|
|
24
|
+
require('./chunk-COGTRVWW.js');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkLWBM5FFLjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkLWBM5FFLjs.authStatusLine; exports.clearPendingClaim = _chunkLWBM5FFLjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkLWBM5FFLjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkLWBM5FFLjs.handleRegister; exports.handleStatus = _chunkLWBM5FFLjs.handleStatus; exports.handleWait = _chunkLWBM5FFLjs.handleWait; exports.httpJson = _chunkLWBM5FFLjs.httpJson; exports.readPendingAuthClaim = _chunkLWBM5FFLjs.readPendingAuthClaim; exports.readStatusBanner = _chunkLWBM5FFLjs.readStatusBanner; exports.registerAuthCommands = _chunkLWBM5FFLjs.registerAuthCommands; exports.reportSetupCompleted = _chunkLWBM5FFLjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkLWBM5FFLjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkLWBM5FFLjs.statusBannerLine;
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
reportSetupCompleted,
|
|
14
14
|
resolvePendingAuthClaimForResume,
|
|
15
15
|
statusBannerLine
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-4BA6ATHA.mjs";
|
|
17
|
+
import "./chunk-XJD6LZCO.mjs";
|
|
18
|
+
import "./chunk-E52TKKVI.mjs";
|
|
19
|
+
import "./chunk-MAMVGOSC.mjs";
|
|
20
20
|
import "./chunk-DLIRSHV6.mjs";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-E4IXDAZI.mjs";
|
|
22
|
+
import "./chunk-OGSXENOF.mjs";
|
|
23
23
|
import "./chunk-WZYKRD7T.mjs";
|
|
24
24
|
import "./chunk-KRD6H754.mjs";
|
|
25
25
|
export {
|