deepline 0.3.393 → 0.3.394

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.
Files changed (122) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +477 -10
  3. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +5 -1
  4. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-policy.ts +28 -0
  5. package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +251 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +12 -1
  7. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +10 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +25 -16
  9. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +1 -0
  10. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +69 -22
  11. package/dist/bundling-sources/shared_libs/plays/core.ts +1 -1
  12. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +18 -0
  13. package/dist/cli/auth-IHKISLJQ.js +39 -0
  14. package/dist/cli/{auth-5PXHA232.mjs → auth-OSXDAVCF.mjs} +4 -4
  15. package/dist/cli/{billing-JFB2XLSO.js → billing-EKLYOXUY.js} +75 -75
  16. package/dist/cli/{billing-Z2N7ZAGM.mjs → billing-ZNNKX3UR.mjs} +4 -4
  17. package/dist/cli/{chunk-OXNOAD6Y.js → chunk-2MDDA7A4.js} +26 -26
  18. package/dist/cli/{chunk-PTDECJGP.js → chunk-354JCXA2.js} +50 -50
  19. package/dist/cli/{chunk-RKMB3N7K.mjs → chunk-3HU47EGZ.mjs} +48 -9
  20. package/dist/cli/{chunk-6I73X254.mjs → chunk-3HWALOL2.mjs} +1 -1
  21. package/dist/cli/{chunk-VIQJIX2P.js → chunk-4P27AXEA.js} +65 -65
  22. package/dist/cli/{chunk-UOGZUA24.mjs → chunk-5BB2RGAX.mjs} +18 -8
  23. package/dist/cli/{chunk-RWHWF5ZJ.js → chunk-6YAUMG27.js} +1 -1
  24. package/dist/cli/{chunk-HLEESTCH.mjs → chunk-BP33SIZF.mjs} +1 -1
  25. package/dist/cli/{chunk-CDFH2DYL.js → chunk-CS6RAIVY.js} +4 -4
  26. package/dist/cli/{chunk-2HAD745V.js → chunk-E23BQ5SC.js} +9 -9
  27. package/dist/cli/{chunk-LMMEAMA7.mjs → chunk-FJGW5GXU.mjs} +1 -1
  28. package/dist/cli/{chunk-Q26LUSQ2.mjs → chunk-JHIJIHFB.mjs} +1 -1
  29. package/dist/cli/{chunk-PWSWAN7Q.js → chunk-KB4SDX5S.js} +48 -9
  30. package/dist/cli/{chunk-M7Y7JYZX.js → chunk-KGNTKMRG.js} +6 -6
  31. package/dist/cli/{chunk-4XX6443T.js → chunk-KI635JN4.js} +59 -59
  32. package/dist/cli/{chunk-Z3OOZM5L.js → chunk-KIUMEOM5.js} +8 -8
  33. package/dist/cli/{chunk-KIYU2TGL.mjs → chunk-M57J2SK4.mjs} +2 -2
  34. package/dist/cli/{chunk-FQ6VHPW4.mjs → chunk-MFB2VKBO.mjs} +2 -2
  35. package/dist/cli/{chunk-MS6GUPBB.js → chunk-MH73HMPV.js} +3 -3
  36. package/dist/cli/{chunk-AARX5L4B.js → chunk-MLPU5SMZ.js} +2 -2
  37. package/dist/cli/{chunk-5PRVMXKB.mjs → chunk-NR3DFKNF.mjs} +1 -1
  38. package/dist/cli/{chunk-W4WOMXR3.js → chunk-QIQBYKLB.js} +15 -15
  39. package/dist/cli/{chunk-VIWE6WRK.js → chunk-RBJYWRCF.js} +260 -250
  40. package/dist/cli/{chunk-LZPCDB7U.mjs → chunk-TJI2EN6K.mjs} +1 -1
  41. package/dist/cli/{chunk-4TCT77UF.js → chunk-URWF7NGQ.js} +6 -1
  42. package/dist/cli/{chunk-5KWKZIQR.mjs → chunk-UXFSWG3Q.mjs} +4 -4
  43. package/dist/cli/{chunk-L2SYLGRP.js → chunk-VK6FYZLP.js} +8 -8
  44. package/dist/cli/{chunk-7HR7BGZL.mjs → chunk-X63FDZJZ.mjs} +3 -3
  45. package/dist/cli/{chunk-4PT2VA3A.mjs → chunk-XRQ2AQL7.mjs} +2 -2
  46. package/dist/cli/{chunk-STNYIMIV.mjs → chunk-XXUDVEXK.mjs} +6 -6
  47. package/dist/cli/{chunk-PQSA443V.mjs → chunk-ZI2ZNDJK.mjs} +6 -1
  48. package/dist/cli/{chunk-2LGC4EFT.mjs → chunk-ZYBGA4AR.mjs} +3 -3
  49. package/dist/cli/command-docs.js +2 -2
  50. package/dist/cli/command-docs.mjs +1 -1
  51. package/dist/cli/{csv-KJWZHKCH.mjs → csv-5AXRB35H.mjs} +3 -3
  52. package/dist/cli/{csv-P3Z3YE7H.js → csv-LU7O75WE.js} +12 -12
  53. package/dist/cli/{db-NCM4CQIS.mjs → db-7XP5UWEW.mjs} +4 -4
  54. package/dist/cli/{db-NUZGJNQC.js → db-F7YTFKVM.js} +29 -29
  55. package/dist/cli/{describe-YGSEN5WC.js → describe-FRH32RDV.js} +20 -20
  56. package/dist/cli/{describe-WT6MM2GO.mjs → describe-K4ES5LIL.mjs} +10 -10
  57. package/dist/cli/{executions-XS2IPJ4W.mjs → executions-IEHEHJUO.mjs} +4 -4
  58. package/dist/cli/{executions-PCOLHN7Q.js → executions-RZV5XPT2.js} +6 -6
  59. package/dist/cli/{feedback-4MSH7TFU.js → feedback-3P65QTX3.js} +7 -7
  60. package/dist/cli/{feedback-CCLTS5SV.mjs → feedback-FPUVZBAN.mjs} +3 -3
  61. package/dist/cli/{git-K2DHPMPC.mjs → git-GLVVP7TY.mjs} +4 -4
  62. package/dist/cli/git-MFFAWVVX.js +23 -0
  63. package/dist/cli/index.js +95 -95
  64. package/dist/cli/index.mjs +33 -33
  65. package/dist/cli/{legacy-noops-B5S4AR3P.mjs → legacy-noops-3MOI6NBM.mjs} +4 -4
  66. package/dist/cli/{legacy-noops-GPNOPFXV.js → legacy-noops-XKSGZR7Q.js} +7 -7
  67. package/dist/cli/{monitors-JLMAIPRG.mjs → monitors-FTBGNEFG.mjs} +4 -4
  68. package/dist/cli/{monitors-ZAWD7NSN.js → monitors-NZ2DYNST.js} +85 -85
  69. package/dist/cli/{org-P2KN4CES.js → org-MCKDQXIV.js} +64 -64
  70. package/dist/cli/{org-T3JTHP4G.mjs → org-V2J5RBCN.mjs} +4 -4
  71. package/dist/cli/{play-NK6BLRGL.mjs → play-AJFGME3B.mjs} +9 -9
  72. package/dist/cli/play-WLSN2EO2.js +158 -0
  73. package/dist/cli/{providers-5QRZN3DT.js → providers-2JEZ2264.js} +7 -7
  74. package/dist/cli/{providers-3NQRA7IT.mjs → providers-I6RQJZFZ.mjs} +4 -4
  75. package/dist/cli/{quickstart-PIA2JGPV.mjs → quickstart-BIDQDMO4.mjs} +3 -3
  76. package/dist/cli/{quickstart-R7NUZGNW.js → quickstart-GJ2RPDU3.js} +5 -5
  77. package/dist/cli/search-5VN4YD4I.js +27 -0
  78. package/dist/cli/{search-AIDIIGLY.mjs → search-ELRXFWG5.mjs} +5 -5
  79. package/dist/cli/{secrets-BT3PGMWN.js → secrets-53IT6VXD.js} +13 -13
  80. package/dist/cli/{secrets-OQNHL45O.mjs → secrets-SQXGZXIC.mjs} +4 -4
  81. package/dist/cli/{sessions-SF7WJPJP.mjs → sessions-2X5QF7SL.mjs} +4 -4
  82. package/dist/cli/{sessions-EYXWOSWK.js → sessions-CAV5M77Y.js} +5 -5
  83. package/dist/cli/{settings-BA3GHBOD.js → settings-532WNAZO.js} +74 -74
  84. package/dist/cli/{settings-Y57JTFDD.mjs → settings-7P67VGCJ.mjs} +7 -7
  85. package/dist/cli/{setup-RERXYC66.js → setup-6L2VSUWJ.js} +41 -41
  86. package/dist/cli/{setup-7GR5GBHA.mjs → setup-QGGBV2LE.mjs} +6 -6
  87. package/dist/cli/{skills-SJWIQAV5.mjs → skills-3FE62WBG.mjs} +4 -4
  88. package/dist/cli/skills-S6NPZAN7.js +28 -0
  89. package/dist/cli/tools-647RLXQS.js +41 -0
  90. package/dist/cli/{tools-ZF3JXPNL.mjs → tools-DMR25DEF.mjs} +7 -7
  91. package/dist/cli/{update-FFFYQAOJ.mjs → update-6RZMHJZP.mjs} +6 -6
  92. package/dist/cli/update-WVTSC3EM.js +28 -0
  93. package/dist/cli/{workflow-XVFEEGAS.mjs → workflow-L2DQRE6R.mjs} +5 -5
  94. package/dist/cli/{workflow-SZJVQH4T.js → workflow-TX4F2PIX.js} +15 -15
  95. package/dist/{client-DU5dtHDy.d.mts → client-BktIPdIj.d.mts} +1 -1
  96. package/dist/{client-mCE88hC4.d.ts → client-C3O1Ipf3.d.ts} +1 -1
  97. package/dist/{compiler-manifest-DE4RdAiY.d.ts → compiler-manifest-DLxUY5kI.d.mts} +65 -11
  98. package/dist/{compiler-manifest-DE4RdAiY.d.mts → compiler-manifest-DLxUY5kI.d.ts} +65 -11
  99. package/dist/{index-Bi-f7HFT.d.ts → index-B_GM9E3q.d.ts} +1 -1
  100. package/dist/{index-BI6nWgaV.d.mts → index-SCb0NvDb.d.mts} +1 -1
  101. package/dist/index.d.mts +5 -5
  102. package/dist/index.d.ts +5 -5
  103. package/dist/index.js +7 -7
  104. package/dist/index.mjs +4 -4
  105. package/dist/install-integrity.json +85 -84
  106. package/dist/plays/bundle-play-file.d.mts +3 -3
  107. package/dist/plays/bundle-play-file.d.ts +3 -3
  108. package/dist/plays/bundle-play-file.mjs +2 -2
  109. package/dist/plays/run-request.d.mts +2 -2
  110. package/dist/plays/run-request.d.ts +2 -2
  111. package/dist/release.d.mts +1 -1
  112. package/dist/release.d.ts +1 -1
  113. package/dist/release.js +2 -2
  114. package/dist/release.mjs +1 -1
  115. package/package.json +1 -1
  116. package/dist/cli/auth-P3MVDTXM.js +0 -39
  117. package/dist/cli/git-RNM45FX4.js +0 -23
  118. package/dist/cli/play-PDXR6JFB.js +0 -158
  119. package/dist/cli/search-QRWL7MFM.js +0 -27
  120. package/dist/cli/skills-V7EY75HB.js +0 -28
  121. package/dist/cli/tools-H5HLBCHH.js +0 -41
  122. package/dist/cli/update-472HA3LT.js +0 -28
@@ -15,6 +15,16 @@ export const LEGACY_PLAY_AUTHORING_CONTRACT_EDITION = 1 as const;
15
15
  // Edition 11 readers retain every CSV source row. Promote this writer in the
16
16
  // follow-up PR after those readers are deployed everywhere.
17
17
  export const PLAY_AUTHORING_CONTRACT_EDITION = 10 as const;
18
+ export const PLAY_AUTHORING_SLACK_INTERACTIVE_MESSAGE_STRICT_THRESHOLD =
19
+ 10 as const;
20
+ export const EXPLICIT_FRESHNESS_PLAY_AUTHORING_THRESHOLD = 11 as const;
21
+ const EXPLICIT_FRESHNESS_STALE_AFTER_SECONDS_DESCRIPTION = [
22
+ 'Edition 11 requires an explicit choice.',
23
+ '`0` starts a fresh logical call, though a matching operation receipt may recover that same operation after resume;',
24
+ '`null` allows indefinite result reuse;',
25
+ 'a positive integer is the maximum result age in seconds.',
26
+ 'Omitted values retain legacy behavior in older editions.',
27
+ ].join(' ');
18
28
  export const PLAY_AUTHORING_INPUT_SCHEMA_SNAPSHOT_EDITION = 3 as const;
19
29
  export const SUPPORTED_PLAY_AUTHORING_CONTRACT_EDITIONS = [
20
30
  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
@@ -98,7 +108,7 @@ const PLAY_AUTHORING_CONTRACT_CHANGELOG_DETAILS = [
98
108
  },
99
109
  {
100
110
  changed:
101
- 'CSV datasets always use source row identity and process every input occurrence, even when key or rowIdentity: "key" is supplied. Editions 1–10 retain their admitted row identity and completed receipts; non-CSV datasets retain explicit key deduplication.',
111
+ 'Requires explicit freshness and semantic identity for supported durable calls, and gives CSV datasets source-row identity so every input occurrence is processed even when key or rowIdentity: "key" is supplied. Edition 10 retains its list-getter behavior and editions 1–10 retain their admitted CSV identity and completed receipts; non-CSV datasets keep explicit key deduplication.',
102
112
  compatibilityOwner: 'Plays Runtime',
103
113
  newWritesEnd: null,
104
114
  readerRemoval: null,
@@ -141,7 +151,7 @@ export const PLAY_AUTHORING_RUNTIME_CAPABILITIES = [
141
151
  capability: 'Web Crypto',
142
152
  surface: '`crypto.subtle`',
143
153
  contract:
144
- 'WebCrypto is available for standards-based signing, verification, encryption, and key import. Keep private material in `ctx.secrets`; `docs-examples/sdk-v2/github-app-jwt.play.ts` signs an RS256 GitHub App JWT and uses `staleAfterSeconds: 0` for its time-varying auth exchange.',
154
+ 'WebCrypto is available for standards-based signing, verification, encryption, and key import. Keep private material in `ctx.secrets`. `docs-examples/sdk-v2/github-app-jwt.play.ts` is an edition-10 compatibility example; edition 11 allows transient fetches only for read-only methods, so do not copy its credential-returning POST into new source.',
145
155
  },
146
156
  {
147
157
  capability: 'Workspace secrets',
@@ -153,7 +163,7 @@ export const PLAY_AUTHORING_RUNTIME_CAPABILITIES = [
153
163
  capability: 'Freshness',
154
164
  surface: '`staleAfterSeconds` on durable calls',
155
165
  contract:
156
- 'This is call-receipt freshness: omitted/null reuses forever, zero always executes, and a positive integer is a TTL in seconds. It never changes dataset or request identity.',
166
+ 'New source in edition 11 must choose freshness explicitly. Zero executes a new logical call, a positive integer is a maximum result age in seconds, and null allows indefinite reuse. A completed operation receipt separately recovers the same intended operation after resume.',
157
167
  },
158
168
  ] as const;
159
169
 
@@ -1040,7 +1050,7 @@ export type PlayAuthoringStepOptions<Row, Value = unknown> = {
1040
1050
  /** Legacy error-recompute flag accepted for older authored Plays. */
1041
1051
  readonly recomputeOnError?: boolean;
1042
1052
  /** Legacy cell staleness metadata accepted for older authored Plays. */
1043
- readonly staleAfterSeconds?: number;
1053
+ readonly staleAfterSeconds?: DurableCallStaleAfterSeconds;
1044
1054
  };
1045
1055
 
1046
1056
  /** Explicitly mark a step program as a provider fallback waterfall. */
@@ -1104,7 +1114,7 @@ export type PlayAuthoringStepProgramStep<TContext> = {
1104
1114
  readonly name: string;
1105
1115
  readonly recompute?: boolean;
1106
1116
  readonly recomputeOnError?: boolean;
1107
- readonly staleAfterSeconds?: number;
1117
+ readonly staleAfterSeconds?: DurableCallStaleAfterSeconds;
1108
1118
  readonly resolver:
1109
1119
  | PlayAuthoringStepResolver<Record<string, unknown>, unknown, TContext>
1110
1120
  | PlayAuthoringConditionalStepResolver<
@@ -1146,7 +1156,7 @@ export type PlayAuthoringDatasetDefinitionOptions<InputRow extends object> = {
1146
1156
  export type PlayAuthoringDatasetRunOptions<InputRow extends object> = {
1147
1157
  description?: string;
1148
1158
  key?: PlayAuthoringDatasetRowKey<InputRow>;
1149
- /** CSV defaults to source row identity. Use key only for intentional deduplication. */
1159
+ /** Edition 11 CSVs always use source-row identity; key-based deduplication remains for non-CSV inputs and earlier editions. */
1150
1160
  rowIdentity?: 'source_row' | 'key';
1151
1161
  onRowError?: 'isolate' | 'fail';
1152
1162
  mode?: 'upsert' | 'net_new';
@@ -1359,8 +1369,10 @@ export type PlayAuthoringRuntimeStepOptions = {
1359
1369
  /**
1360
1370
  * Durable freshness for one `ctx.fetch` call. The key identifies the request;
1361
1371
  * `staleAfterSeconds` controls when that completed request may be reused across
1362
- * Play runs. Omit it (or pass `null`) to reuse indefinitely, pass `0` to
1363
- * execute on every new run, or pass a positive number of seconds for a TTL.
1372
+ * Play runs. Edition 11 requires an explicit choice: `null` reuses indefinitely,
1373
+ * `0` executes on every new run, and a positive whole number sets the maximum
1374
+ * result age. Retained results are supported only for read methods (GET, HEAD,
1375
+ * OPTIONS); mutating methods require `0`. Transient calls do not retain results.
1364
1376
  *
1365
1377
  * Use this for polling or periodically refreshing one external resource. It
1366
1378
  * does not change dataset row identity.
@@ -1368,7 +1380,7 @@ export type PlayAuthoringRuntimeStepOptions = {
1368
1380
  */
1369
1381
  export type PlayAuthoringFetchOptions = {
1370
1382
  staleAfterSeconds?: DurableCallStaleAfterSeconds;
1371
- /** Run through Deepline's guarded outbound path without retaining a response receipt or checkpoint. Use this for short-lived credential exchanges or other response data that should stay in the running Play only. */
1383
+ /** Run through Deepline's guarded outbound path without retaining a response receipt or checkpoint. Edition 11 permits transient fetches only for GET, HEAD, and OPTIONS. */
1372
1384
  transient?: boolean;
1373
1385
  };
1374
1386
 
@@ -1446,6 +1458,8 @@ export class CtxFetchHttpError extends Error {
1446
1458
  }
1447
1459
 
1448
1460
  export type PlayAuthoringCustomerDbQueryOptions = {
1461
+ id?: string;
1462
+ staleAfterSeconds?: 0;
1449
1463
  maxRows?: number;
1450
1464
  timeoutMs?: number;
1451
1465
  };
@@ -1571,7 +1585,10 @@ export interface PlayAuthoringRuntimeContext<
1571
1585
  key: string,
1572
1586
  toolId: string,
1573
1587
  input: Record<string, unknown>,
1574
- options?: { description?: string },
1588
+ options?: {
1589
+ description?: string;
1590
+ staleAfterSeconds?: DurableCallStaleAfterSeconds;
1591
+ },
1575
1592
  ): Promise<
1576
1593
  TListGetter extends 'array'
1577
1594
  ? BasicToolExecuteResult<TOutput>
@@ -1602,7 +1619,7 @@ export interface PlayAuthoringRuntimeContext<
1602
1619
  ): Promise<T>;
1603
1620
 
1604
1621
  /**
1605
- * Execute a guarded HTTP request. By default, completed responses are durably reused; `staleAfterSeconds` governs only that completed call receipt, never dataset/request identity. Failed requests do not publish completed cache entries. A headers timeout leaves an upstream write's outcome unknown and does not establish whether its body was sent. The transport does not automatically retry that timed-out write, but a later invocation can execute it again. Mutating requests require provider-supported idempotency with the same key retained across retries and replay. Deadlines are platform-controlled; callers may cancel through `init.signal`. Pass `{ transient: true }` for short-lived credential exchanges or other response data that must not be retained in a receipt or checkpoint. Edition 5+ throws `CtxFetchHttpError` for non-2xx; catch it only when the Play intentionally recovers, otherwise let it fail the Play. Editions 1–4 retain their previous response projections.
1622
+ * Execute a guarded HTTP request. Edition 11 requires an explicit freshness choice; only GET, HEAD, and OPTIONS can retain completed responses. Mutating methods must use `staleAfterSeconds: 0`; the choice governs only the completed call receipt, never dataset/request identity. Failed requests do not publish completed cache entries. A headers timeout leaves an upstream write's outcome unknown and does not establish whether its body was sent. The transport does not automatically retry that timed-out write, but a later invocation can execute it again. Mutating requests require provider-supported idempotency with the same key retained across retries and replay. Deadlines are platform-controlled; callers may cancel through `init.signal`. Pass `{ transient: true }` only on GET, HEAD, and OPTIONS when the response must not be retained in a receipt or checkpoint; edition 11 rejects transient writes. Edition 5+ throws `CtxFetchHttpError` for non-2xx; catch it only when the Play intentionally recovers, otherwise let it fail the Play. Editions 1–4 retain their previous response projections.
1606
1623
  *
1607
1624
  * @sdkReference runtime 170 ctx.fetch(key, url, init)
1608
1625
  */
@@ -2273,8 +2290,7 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
2273
2290
  required: false,
2274
2291
  resolution: 'runtime-allowed',
2275
2292
  issueCode: 'play_authoring_durable_policy_invalid',
2276
- description:
2277
- '`0` always executes; `null`/omitted never expires; a positive integer is a TTL in seconds.',
2293
+ description: EXPLICIT_FRESHNESS_STALE_AFTER_SECONDS_DESCRIPTION,
2278
2294
  errorMessage:
2279
2295
  'staleAfterSeconds must be null, 0 (always execute), or a positive whole number of seconds.',
2280
2296
  },
@@ -2547,7 +2563,7 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
2547
2563
  resolution: 'static-when-present',
2548
2564
  issueCode: 'play_authoring_dataset_option_invalid',
2549
2565
  description:
2550
- 'Select source_row to process every input occurrence. CSV datasets default to source_row in edition 11; earlier editions retain key identity. Select key only to intentionally deduplicate business keys.',
2566
+ 'Edition 11 CSV inputs always use source-row occurrence identity, even with rowIdentity: key; key-based deduplication remains available for non-CSV inputs and editions 1–10.',
2551
2567
  errorMessage: 'ctx.dataset run rowIdentity must be "source_row" or "key".',
2552
2568
  },
2553
2569
  'ctx.dataset.run.onRowError': {
@@ -2646,8 +2662,7 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
2646
2662
  required: false,
2647
2663
  resolution: 'runtime-dynamic',
2648
2664
  issueCode: 'play_authoring_durable_policy_invalid',
2649
- description:
2650
- 'Checkpoint freshness: null/omitted never expires, 0 always executes.',
2665
+ description: EXPLICIT_FRESHNESS_STALE_AFTER_SECONDS_DESCRIPTION,
2651
2666
  errorMessage:
2652
2667
  'staleAfterSeconds must be null, 0 (always execute), or a positive whole number of seconds.',
2653
2668
  },
@@ -2681,8 +2696,7 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
2681
2696
  required: false,
2682
2697
  resolution: 'runtime-dynamic',
2683
2698
  issueCode: 'play_authoring_durable_policy_invalid',
2684
- description:
2685
- 'Fetch freshness: null/omitted never expires, 0 always executes.',
2699
+ description: EXPLICIT_FRESHNESS_STALE_AFTER_SECONDS_DESCRIPTION,
2686
2700
  errorMessage:
2687
2701
  'staleAfterSeconds must be null, 0 (always execute), or a positive whole number of seconds.',
2688
2702
  },
@@ -2936,6 +2950,39 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
2936
2950
  errorMessage:
2937
2951
  'ctx.customerDb.query statement must be a non-empty SQL string. Deprecated SqlQuery objects cannot contain parameter values.',
2938
2952
  },
2953
+ 'ctx.customerDb.query.options.id': {
2954
+ schema: Type.String({ pattern: '\\S' }),
2955
+ fixtures: {
2956
+ valid: 'customer-report-read',
2957
+ invalid: '',
2958
+ absent: undefined,
2959
+ unresolved: { expression: 'operationId' },
2960
+ edition1: 'query',
2961
+ },
2962
+ referenceType: 'string',
2963
+ required: true,
2964
+ resolution: 'runtime-dynamic',
2965
+ issueCode: 'play_authoring_tool_request_invalid',
2966
+ description: 'Stable operation identity for Customer DB query recovery.',
2967
+ errorMessage:
2968
+ 'ctx.customerDb.query options.id must be a non-empty stable string.',
2969
+ },
2970
+ 'ctx.customerDb.query.options.staleAfterSeconds': {
2971
+ schema: Type.Literal(0),
2972
+ fixtures: {
2973
+ valid: 0,
2974
+ invalid: 1,
2975
+ absent: undefined,
2976
+ unresolved: { expression: 'ttl' },
2977
+ edition1: 0,
2978
+ },
2979
+ referenceType: 'number | null',
2980
+ required: false,
2981
+ resolution: 'runtime-dynamic',
2982
+ issueCode: 'play_authoring_durable_policy_invalid',
2983
+ description: 'Customer DB queries always execute with freshness 0.',
2984
+ errorMessage: 'Customer DB queries must use staleAfterSeconds: 0.',
2985
+ },
2939
2986
  'ctx.customerDb.query.options.maxRows': {
2940
2987
  schema: Type.Integer({ minimum: 1 }),
2941
2988
  fixtures: {
@@ -3337,13 +3384,13 @@ export const PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
3337
3384
  'export type DatasetColumnRunInput<Row, Value> = { readonly row: Row; readonly ctx: DeeplinePlayRuntimeContext; readonly index: number; readonly previousCell?: PreviousCell<Value> };',
3338
3385
  'export type DatasetColumnDefinition<Row, Value> = { readonly run: (input: DatasetColumnRunInput<Row, Value>) => Value | Promise<Value>; readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean> };',
3339
3386
  "export type ConditionalStepResolver<Row, Value, Else = null> = { readonly kind: 'conditional'; readonly when: (row: Row, index: number) => boolean | Promise<boolean>; readonly run: StepResolver<Row, Value>; readonly elseValue: Else; else<ValueElse>(value: ValueElse): ConditionalStepResolver<Row, Value, ValueElse>; };",
3340
- 'export type StepOptions<Row, Value = unknown> = { readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean>; readonly recompute?: boolean; readonly recomputeOnError?: boolean; readonly staleAfterSeconds?: number };',
3387
+ 'export type StepOptions<Row, Value = unknown> = { readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean>; readonly recompute?: boolean; readonly recomputeOnError?: boolean; readonly staleAfterSeconds?: DurableCallStaleAfterSeconds };',
3341
3388
  'export type StepProgramOptions = { readonly continueOnProviderUnavailable?: boolean };',
3342
3389
  "export type StepProgram<Input, Output, Return = Output> = { readonly kind: 'steps'; readonly steps: readonly PlayStepProgramStep[]; readonly returnResolver?: StepResolver<Output, Return>; readonly continueOnProviderUnavailable?: boolean; readonly __inputType?: (input: Input) => void; step<Name extends string, Value>(name: Name, resolver: StepResolver<Output, Value> | ConditionalStepResolver<Output, Value> | StepProgramResolver<Output, Value>): StepProgram<Input, Output & Record<Name, Value>, Return>; step<Name extends string, Value>(name: Name, resolver: StepResolver<Output, Value> | StepProgramResolver<Output, Value>, options: StepOptions<Output, Value>): StepProgram<Input, Output & Record<Name, Value | null>, Return>; return<Value>(resolver: StepResolver<Output, Value>): StepProgram<Input, Output, Value>; };",
3343
3390
  "export type StepProgramResolver<Input, Return> = { readonly kind: 'steps'; readonly steps: readonly PlayStepProgramStep[]; readonly returnResolver?: StepResolver<never, Return>; readonly __inputType?: (input: Input) => void };",
3344
3391
  "export type RunnableStepProgram<Input, Return> = Pick<StepProgram<Input, never, Return>, 'kind' | 'steps' | 'returnResolver' | '__inputType'>;",
3345
3392
  "export type RunnableColumnStepProgram<Return> = Pick<StepProgramResolver<unknown, Return>, 'kind' | 'steps' | 'returnResolver'>;",
3346
- 'export type PlayStepProgramStep = { readonly name: string; readonly recompute?: boolean; readonly recomputeOnError?: boolean; readonly staleAfterSeconds?: number; readonly resolver: StepResolver<Record<string, unknown>, unknown> | ConditionalStepResolver<Record<string, unknown>, unknown> | StepProgramResolver<Record<string, unknown>, unknown> };',
3393
+ 'export type PlayStepProgramStep = { readonly name: string; readonly recompute?: boolean; readonly recomputeOnError?: boolean; readonly staleAfterSeconds?: DurableCallStaleAfterSeconds; readonly resolver: StepResolver<Record<string, unknown>, unknown> | ConditionalStepResolver<Record<string, unknown>, unknown> | StepProgramResolver<Record<string, unknown>, unknown> };',
3347
3394
  'export type ColumnResolver<Row, Value> = StepResolver<Row, Value> | ConditionalStepResolver<Row, Value> | RunnableColumnStepProgram<Value>;',
3348
3395
  'export type StepProgramOutput<TProgram> = TProgram extends StepProgram<unknown, infer Output, unknown> ? Output : never;',
3349
3396
  'export type DatasetRowKey<InputRow extends object> = (keyof InputRow & string) | readonly (keyof InputRow & string)[] | ((row: InputRow, index: number) => string | number | readonly unknown[]);',
@@ -3368,8 +3415,8 @@ export const PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
3368
3415
  ' readonly run: { readonly id: string };',
3369
3416
  ` runSteps<TInput extends Record<string, unknown>, TOutput>(program: RunnableStepProgram<TInput, TOutput>, input: TInput, options?: { description?: ${cloudReferenceType('ctx.runSteps.options.description')} }): Promise<TOutput>;`,
3370
3417
  ' tools: { execute<K extends string>(request: ToolExecutionRequest<K>): Promise<ToolExecutionOutput<K>> };',
3371
- ` customerDb: { query<TRow extends Record<string, unknown> = Record<string, unknown>>(statement: SqlQuery, options?: { maxRows?: ${cloudReferenceType('ctx.customerDb.query.options.maxRows')}; timeoutMs?: ${cloudReferenceType('ctx.customerDb.query.options.timeoutMs')} }): Promise<TRow[]> };`,
3372
- ` tool<K extends string>(key: ${cloudReferenceType('ctx.tool.key')}, toolId: K, input: ${cloudReferenceType('ctx.tool.input')}, options?: { description?: ${cloudReferenceType('ctx.tool.options.description')} }): Promise<ToolExecutionOutput<K>>;`,
3418
+ ` customerDb: { query<TRow extends Record<string, unknown> = Record<string, unknown>>(statement: SqlQuery, options?: { id?: ${cloudReferenceType('ctx.customerDb.query.options.id')}; staleAfterSeconds?: ${cloudReferenceType('ctx.customerDb.query.options.staleAfterSeconds')}; maxRows?: ${cloudReferenceType('ctx.customerDb.query.options.maxRows')}; timeoutMs?: ${cloudReferenceType('ctx.customerDb.query.options.timeoutMs')} }): Promise<TRow[]> };`,
3419
+ ` tool<K extends string>(key: ${cloudReferenceType('ctx.tool.key')}, toolId: K, input: ${cloudReferenceType('ctx.tool.input')}, options?: { description?: ${cloudReferenceType('ctx.tool.options.description')}; staleAfterSeconds?: DurableCallStaleAfterSeconds }): Promise<ToolExecutionOutput<K>>;`,
3373
3420
  ' step<T>(id: string, run: () => T | Promise<T>, options?: RuntimeStepOptions): Promise<T>;',
3374
3421
  " fetch(key: string, url: string | URL, init?: RequestInit & { headers?: HeadersInit & { 'Idempotency-Key'?: string; 'X-Idempotency-Key'?: string }; auth?: SecretAuthInput }, options?: FetchOptions): Promise<PlayFetchResponse>;",
3375
3422
  ' secrets: { get(name: string): SecretPromise; bearer(secret: string | SecretPromise | SecretHandle): SecretAuth; header(header: string, secret: string | SecretPromise | SecretHandle): SecretAuth };',
@@ -270,7 +270,7 @@ class PlayCoreStepProgram<Input, Output, ReturnValue> implements StepProgram<
270
270
  ...(options?.recomputeOnError === true
271
271
  ? { recomputeOnError: true }
272
272
  : {}),
273
- ...(typeof options?.staleAfterSeconds === 'number'
273
+ ...(options?.staleAfterSeconds !== undefined
274
274
  ? { staleAfterSeconds: options.staleAfterSeconds }
275
275
  : {}),
276
276
  resolver: stepResolver as PlayStepProgramStep['resolver'],
@@ -40,6 +40,24 @@ export type ToolResultExecutionMetadata = {
40
40
  /** Canonical saved result identity; receiptKey may name a transport alias. */
41
41
  resultReceiptKey?: string;
42
42
  attachedToReceiptKey?: string;
43
+ /** Freshness and operation recovery are independent of provider idempotency. */
44
+ freshness?: CallFreshnessMetadata;
45
+ /** Time the live result completed, retained unchanged through recovery. */
46
+ completedAt?: number;
47
+ };
48
+
49
+ export type CallFreshnessMetadata = {
50
+ requestedStaleAfterSeconds: number | null;
51
+ effectiveStaleAfterSeconds: number | null;
52
+ source:
53
+ | 'executed'
54
+ | 'operation_recovery'
55
+ | 'reusable_result'
56
+ | 'live_observation';
57
+ resultAgeMs: number;
58
+ completedAt: number;
59
+ operationReceiptKey?: string;
60
+ unavailableReason?: string;
43
61
  };
44
62
 
45
63
  export type ToolResultTargetMetadata = {
@@ -0,0 +1,39 @@
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 _chunk354JCXA2js = require('./chunk-354JCXA2.js');
17
+ require('./chunk-KGNTKMRG.js');
18
+ require('./chunk-CS6RAIVY.js');
19
+ require('./chunk-XNYIZMNQ.js');
20
+ require('./chunk-7P5AA3SN.js');
21
+ require('./chunk-6YAUMG27.js');
22
+ require('./chunk-OG64RBAC.js');
23
+ require('./chunk-COGTRVWW.js');
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+ exports.EXIT_WORKSPACE_MISMATCH = _chunk354JCXA2js.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunk354JCXA2js.authStatusLine; exports.clearPendingClaim = _chunk354JCXA2js.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunk354JCXA2js.clearSatisfiedPendingClaim; exports.handleRegister = _chunk354JCXA2js.handleRegister; exports.handleStatus = _chunk354JCXA2js.handleStatus; exports.handleWait = _chunk354JCXA2js.handleWait; exports.httpJson = _chunk354JCXA2js.httpJson; exports.readPendingAuthClaim = _chunk354JCXA2js.readPendingAuthClaim; exports.readStatusBanner = _chunk354JCXA2js.readStatusBanner; exports.registerAuthCommands = _chunk354JCXA2js.registerAuthCommands; exports.reportSetupCompleted = _chunk354JCXA2js.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunk354JCXA2js.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunk354JCXA2js.statusBannerLine;
@@ -13,12 +13,12 @@ import {
13
13
  reportSetupCompleted,
14
14
  resolvePendingAuthClaimForResume,
15
15
  statusBannerLine
16
- } from "./chunk-FQ6VHPW4.mjs";
17
- import "./chunk-5PRVMXKB.mjs";
18
- import "./chunk-LMMEAMA7.mjs";
16
+ } from "./chunk-MFB2VKBO.mjs";
17
+ import "./chunk-NR3DFKNF.mjs";
18
+ import "./chunk-FJGW5GXU.mjs";
19
19
  import "./chunk-DLIRSHV6.mjs";
20
20
  import "./chunk-NXGCO4JB.mjs";
21
- import "./chunk-LZPCDB7U.mjs";
21
+ import "./chunk-TJI2EN6K.mjs";
22
22
  import "./chunk-WZYKRD7T.mjs";
23
23
  import "./chunk-KRD6H754.mjs";
24
24
  export {