deepline 0.3.307 → 0.3.309

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 (103) hide show
  1. package/README.md +2 -1
  2. package/dist/bundling-sources/sdk/src/client.ts +270 -11
  3. package/dist/bundling-sources/sdk/src/compat.ts +27 -9
  4. package/dist/bundling-sources/sdk/src/index.ts +35 -0
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/shared_libs/play-runtime/batch-runtime.ts +4 -0
  7. package/dist/bundling-sources/shared_libs/play-runtime/batching-types.ts +3 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +46 -16
  9. package/dist/bundling-sources/shared_libs/play-runtime/fullenrich-batching.ts +24 -1
  10. package/dist/bundling-sources/shared_libs/play-runtime/run-event-query.ts +872 -0
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +595 -0
  12. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +97 -22
  13. package/dist/cli/{auth-AJPTFFC7.mjs → auth-AA5SXOB6.mjs} +4 -4
  14. package/dist/cli/auth-MXBOMMLC.js +31 -0
  15. package/dist/cli/{billing-SPBWUEOS.js → billing-6DJWMFV7.js} +70 -70
  16. package/dist/cli/{billing-LPDYJLIL.mjs → billing-CXUIXODY.mjs} +4 -4
  17. package/dist/cli/{chunk-QACDLYNO.mjs → chunk-3EVKBS6J.mjs} +1 -1
  18. package/dist/cli/{chunk-MZQP7CIL.js → chunk-3SZSFTLQ.js} +1 -1
  19. package/dist/cli/{chunk-G4SSYZND.mjs → chunk-4A6BYN66.mjs} +1 -1
  20. package/dist/cli/{chunk-IVXD2KA2.js → chunk-4SAHSARB.js} +15 -15
  21. package/dist/cli/{chunk-DF3XJ2V2.js → chunk-52FXVKVC.js} +48 -48
  22. package/dist/cli/{chunk-K2CQ2RBJ.js → chunk-5VHI2LFM.js} +6 -6
  23. package/dist/cli/{chunk-76MFV3AC.js → chunk-6QWXPOZM.js} +2 -2
  24. package/dist/cli/{chunk-RXYYANYP.mjs → chunk-A74BQEUC.mjs} +13 -5
  25. package/dist/cli/{chunk-ILOCS73R.mjs → chunk-ATTN5BOA.mjs} +2 -2
  26. package/dist/cli/{chunk-HWCB5MHF.js → chunk-CO5TGXG2.js} +68 -60
  27. package/dist/cli/{chunk-D55NIPGU.mjs → chunk-GUUQJJBS.mjs} +1 -1
  28. package/dist/cli/{chunk-GUIQWUCB.js → chunk-IQYTESPK.js} +6 -6
  29. package/dist/cli/{chunk-ZIF6JOOI.js → chunk-M2V27CEE.js} +26 -26
  30. package/dist/cli/{chunk-MPVXXDWH.mjs → chunk-N6P7NBX3.mjs} +1 -1
  31. package/dist/cli/{chunk-AKE6ZFIJ.js → chunk-NZCFZXDP.js} +4 -4
  32. package/dist/cli/{chunk-BDFVIOLY.mjs → chunk-OTX2Z2Y7.mjs} +3 -3
  33. package/dist/cli/{chunk-KCHBE2J3.js → chunk-PAJVT47Z.js} +852 -204
  34. package/dist/cli/{chunk-2IKIG333.js → chunk-QJBJZVG6.js} +15 -4
  35. package/dist/cli/{chunk-ZGICKTW7.mjs → chunk-TQ5BV5RT.mjs} +2 -2
  36. package/dist/cli/{chunk-JNHXSZPB.js → chunk-V5PB43SQ.js} +6 -6
  37. package/dist/cli/{chunk-TLTKAJ6S.mjs → chunk-W3CSORIT.mjs} +653 -5
  38. package/dist/cli/{chunk-UABLQKTZ.mjs → chunk-WXLOW623.mjs} +11 -0
  39. package/dist/cli/{chunk-O4OESDIN.mjs → chunk-YBKMQLH2.mjs} +1 -1
  40. package/dist/cli/{chunk-7ONALPWY.mjs → chunk-YV5USGOP.mjs} +4 -4
  41. package/dist/cli/client-B2MYCJW5.js +20 -0
  42. package/dist/cli/{client-7ZL4ROII.mjs → client-GXT2WRBH.mjs} +3 -3
  43. package/dist/cli/{csv-JUDFG7JV.js → csv-FY7CVAUY.js} +12 -12
  44. package/dist/cli/{csv-Y3LYCTGD.mjs → csv-OLMTSK4E.mjs} +3 -3
  45. package/dist/cli/{db-GCOJD2BD.mjs → db-HWYKGEOK.mjs} +4 -4
  46. package/dist/cli/{db-5IXGEXNT.js → db-XHHF7SFB.js} +20 -20
  47. package/dist/cli/{executions-FIICTMSY.mjs → executions-5L7YUA7K.mjs} +4 -4
  48. package/dist/cli/{executions-LIEQKFT7.js → executions-K2IJEKEN.js} +6 -6
  49. package/dist/cli/{feedback-3OVAA3C7.mjs → feedback-BIN2IWO4.mjs} +3 -3
  50. package/dist/cli/{feedback-FAADYNAR.js → feedback-FZLBZKF7.js} +6 -6
  51. package/dist/cli/{git-ESMYCYJO.mjs → git-G4ULJPIH.mjs} +4 -4
  52. package/dist/cli/git-KSXSQSH2.js +23 -0
  53. package/dist/cli/index.js +79 -77
  54. package/dist/cli/index.mjs +33 -31
  55. package/dist/cli/{legacy-noops-PKI3RFZW.js → legacy-noops-TBTYKXMK.js} +7 -7
  56. package/dist/cli/{legacy-noops-KP5CPZRK.mjs → legacy-noops-YBBLHKUV.mjs} +4 -4
  57. package/dist/cli/{monitors-KCFBLAFZ.js → monitors-PXBJTE6Q.js} +85 -85
  58. package/dist/cli/{monitors-A6KGGSBO.mjs → monitors-ZRNDHLTP.mjs} +4 -4
  59. package/dist/cli/{org-WI6DEXZQ.js → org-AUPHYG4W.js} +60 -60
  60. package/dist/cli/{org-DHI24UOK.mjs → org-GR7CKJDU.mjs} +4 -4
  61. package/dist/cli/{play-2YXLQD24.mjs → play-7C4XXDLJ.mjs} +472 -55
  62. package/dist/cli/{play-4EUUN76H.js → play-BXX6KDC5.js} +961 -544
  63. package/dist/cli/{providers-2WZ6KHH2.mjs → providers-2ALIWVHI.mjs} +4 -4
  64. package/dist/cli/{providers-DWS3XIM6.js → providers-X3W5I7AI.js} +7 -7
  65. package/dist/cli/{quickstart-ZFZVG6UO.mjs → quickstart-HFLMM6CB.mjs} +3 -3
  66. package/dist/cli/{quickstart-TDTDKM6F.js → quickstart-YU2FOUGV.js} +5 -5
  67. package/dist/cli/{search-BBE2ZMCI.mjs → search-5W6CX5FT.mjs} +5 -5
  68. package/dist/cli/{search-GMPXRQF4.js → search-LBAPKYPL.js} +6 -6
  69. package/dist/cli/{secrets-SMBX4IE6.js → secrets-4JYV6372.js} +13 -13
  70. package/dist/cli/{secrets-JEJL3KIM.mjs → secrets-N3LH3EFK.mjs} +4 -4
  71. package/dist/cli/{sessions-AVU353UT.mjs → sessions-4TCBDROP.mjs} +4 -4
  72. package/dist/cli/{sessions-S6AWG747.js → sessions-66MKLRBI.js} +5 -5
  73. package/dist/cli/{settings-GY5CYRLF.mjs → settings-33RZDJOH.mjs} +7 -7
  74. package/dist/cli/{settings-KBW4ROHC.js → settings-GQMXHDZN.js} +74 -74
  75. package/dist/cli/{setup-4CW3XGGX.mjs → setup-754356IS.mjs} +6 -6
  76. package/dist/cli/{setup-WSVIDSEV.js → setup-HU6LC4VR.js} +41 -41
  77. package/dist/cli/{skills-U3NXFSFK.mjs → skills-FLWPPQMH.mjs} +4 -4
  78. package/dist/cli/skills-WWO2EIQU.js +28 -0
  79. package/dist/cli/{tools-XU6KLJZT.mjs → tools-IRLN4KYG.mjs} +58 -42
  80. package/dist/cli/{tools-KZKELW25.js → tools-N4OW6HZK.js} +111 -95
  81. package/dist/cli/update-CLSJ7ODP.js +28 -0
  82. package/dist/cli/{update-RZLH46DR.mjs → update-TOQOHGVE.mjs} +6 -6
  83. package/dist/cli/{workflow-ZQUKQI35.mjs → workflow-DRH7T3P4.mjs} +5 -5
  84. package/dist/cli/{workflow-GDOGDGTZ.js → workflow-WSYT32Y3.js} +15 -15
  85. package/dist/{client-Dj8MAkDc.d.mts → client-DpnkGBn-.d.mts} +324 -11
  86. package/dist/{client-DsrFGXJf.d.ts → client-ypdBvf1o.d.ts} +324 -11
  87. package/dist/index.d.mts +2 -2
  88. package/dist/index.d.ts +2 -2
  89. package/dist/index.js +8 -6
  90. package/dist/index.mjs +5 -3
  91. package/dist/install-integrity.json +73 -72
  92. package/dist/plays/run-request.d.mts +1 -1
  93. package/dist/plays/run-request.d.ts +1 -1
  94. package/dist/release.d.mts +1 -1
  95. package/dist/release.d.ts +1 -1
  96. package/dist/release.js +2 -2
  97. package/dist/release.mjs +1 -1
  98. package/package.json +1 -1
  99. package/dist/cli/auth-TUQTQIH4.js +0 -31
  100. package/dist/cli/client-S3MIFPM2.js +0 -20
  101. package/dist/cli/git-GG6LWE2R.js +0 -23
  102. package/dist/cli/skills-6AU3RRAD.js +0 -28
  103. package/dist/cli/update-LVXXQF4A.js +0 -28
@@ -14,7 +14,7 @@ var _chunkLA46MMTLjs = require('./chunk-LA46MMTL.js');
14
14
 
15
15
 
16
16
 
17
- var _chunkAKE6ZFIJjs = require('./chunk-AKE6ZFIJ.js');
17
+ var _chunkNZCFZXDPjs = require('./chunk-NZCFZXDP.js');
18
18
 
19
19
 
20
20
 
@@ -562,11 +562,11 @@ function resolveLegacySlackNotification(destinations) {
562
562
  const slackDestinations = destinations.filter(
563
563
  (destination) => destination.kind === "slack" && destination.archivedAt === void 0
564
564
  );
565
- const canonical = slackDestinations.filter(
565
+ const canonical2 = slackDestinations.filter(
566
566
  (destination) => destination.name === LEGACY_SLACK_NOTIFICATION_NAME
567
567
  );
568
- if (canonical.length === 1) return canonical[0];
569
- if (canonical.length > 1) {
568
+ if (canonical2.length === 1) return canonical2[0];
569
+ if (canonical2.length > 1) {
570
570
  throw new ProductNotificationLegacySelectionError(
571
571
  `More than one "${LEGACY_SLACK_NOTIFICATION_NAME}" Slack notification exists. Use the named notification API to choose one.`
572
572
  );
@@ -1223,6 +1223,7 @@ var RUN_EVENT_TERMINAL_KIND_VALUES = [
1223
1223
  RUN_EVENT_KIND.runCancelled
1224
1224
  ];
1225
1225
  var RUN_LOG_RETENTION_MAX_BYTES = 5 * 1024 * 1024;
1226
+ var RUN_LOG_LEVELS = ["debug", "info", "warn", "error"];
1226
1227
  function sqlStringLiteral(value) {
1227
1228
  return "'" + value.replaceAll("'", "''") + "'";
1228
1229
  }
@@ -2013,6 +2014,528 @@ function parseRunLogsCursor(value) {
2013
2014
  return parsed;
2014
2015
  }
2015
2016
 
2017
+ // ../play-runtime/run-event-query.ts
2018
+ var stringField = { type: "string", nullable: false };
2019
+ var optionalString = { type: "string", nullable: true };
2020
+ var RUN_EVENT_QUERY_FIELD_CATALOG = {
2021
+ eventId: stringField,
2022
+ orgId: stringField,
2023
+ runtimeScope: stringField,
2024
+ runId: stringField,
2025
+ playName: stringField,
2026
+ kind: stringField,
2027
+ source: optionalString,
2028
+ occurredAt: { type: "timestamp", nullable: false },
2029
+ status: optionalString,
2030
+ level: { type: "level", nullable: true },
2031
+ stepId: optionalString,
2032
+ stepKind: optionalString,
2033
+ datasetId: optionalString,
2034
+ phase: optionalString,
2035
+ provider: optionalString,
2036
+ operation: optionalString,
2037
+ producerAttempt: { type: "number", nullable: true }
2038
+ };
2039
+ var RUN_EVENT_QUERY_RETENTION_MS = 7 * 864e5;
2040
+ var RUN_EVENT_QUERY_MAX_LIMIT = 200;
2041
+ var RUN_EVENT_QUERY_MAX_PAYLOAD_LIMIT = 10;
2042
+ var RUN_EVENT_QUERY_MAX_CURSOR_BYTES = 48 * 1024;
2043
+ var RUN_EVENT_QUERY_MAX_REQUEST_BYTES = 64 * 1024;
2044
+ var MAX_BYTES = 8192;
2045
+ var MAX_DEPTH = 8;
2046
+ var MAX_PREDICATES = 64;
2047
+ var OPERATORS = [
2048
+ "eq",
2049
+ "ne",
2050
+ "gt",
2051
+ "gte",
2052
+ "lt",
2053
+ "lte",
2054
+ "exists",
2055
+ "in"
2056
+ ];
2057
+ var RunEventQueryInputError = class extends TypeError {
2058
+ constructor(message, code = "invalid_run_event_query") {
2059
+ super(message);
2060
+ this.code = code;
2061
+ this.name = "RunEventQueryInputError";
2062
+ }
2063
+ };
2064
+ function fail(message) {
2065
+ throw new RunEventQueryInputError(message);
2066
+ }
2067
+ function object(value) {
2068
+ return value !== null && typeof value === "object" && !Array.isArray(value) && (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null);
2069
+ }
2070
+ function bounded(value, maxBytes = MAX_BYTES) {
2071
+ let encoded;
2072
+ try {
2073
+ encoded = JSON.stringify(value);
2074
+ } catch (e3) {
2075
+ fail("Run event query must be bounded JSON without cycles.");
2076
+ }
2077
+ if (!encoded || new TextEncoder().encode(encoded).length > maxBytes)
2078
+ fail(`Run event query exceeds ${maxBytes} bytes.`);
2079
+ }
2080
+ function validateRunEventField(value) {
2081
+ if (typeof value !== "string") fail("Run event field must be a string.");
2082
+ const field = value.startsWith("$.") ? value.slice(2) : value;
2083
+ if (Object.prototype.hasOwnProperty.call(RUN_EVENT_QUERY_FIELD_CATALOG, field))
2084
+ return field;
2085
+ if (/^context\.[A-Za-z_][A-Za-z0-9_]{0,63}$/.test(field) && !["__proto__", "prototype", "constructor"].includes(field.slice(8)))
2086
+ return field;
2087
+ const alternatives = {
2088
+ step: "stepId",
2089
+ severity: "level",
2090
+ timestamp: "occurredAt",
2091
+ play: "playName",
2092
+ run: "runId",
2093
+ attempt: "producerAttempt"
2094
+ };
2095
+ fail(
2096
+ `Unsupported run event field: ${field}. Use ${_nullishCoalesce(alternatives[field], () => ( "a catalog field or context.<key>"))}; call fields() for supported fields.`
2097
+ );
2098
+ }
2099
+ function scalar(field, value, op) {
2100
+ if (value !== null && typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean")
2101
+ fail(`Run event ${field} requires a JSON scalar.`);
2102
+ if (typeof value === "number" && !Number.isFinite(value))
2103
+ fail(`Run event ${field} requires a finite number.`);
2104
+ if (typeof value === "string" && new TextEncoder().encode(value).length > 1024)
2105
+ fail(`Run event ${field} value exceeds 1024 bytes.`);
2106
+ const descriptor = RUN_EVENT_QUERY_FIELD_CATALOG[field];
2107
+ if (descriptor) {
2108
+ if (value === null) {
2109
+ if (!descriptor.nullable) fail(`Run event ${field} cannot be null.`);
2110
+ } else if (descriptor.type === "number") {
2111
+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
2112
+ fail(`Run event ${field} requires a positive integer.`);
2113
+ } else if (typeof value !== "string")
2114
+ fail(`Run event ${field} requires a string.`);
2115
+ else if (descriptor.type === "level" && !RUN_LOG_LEVELS.includes(value))
2116
+ fail("Run event level requires debug, info, warn or error.");
2117
+ else if (descriptor.type === "timestamp") {
2118
+ value = normalizeRunEventQueryTimestamp(value);
2119
+ }
2120
+ }
2121
+ if (["gt", "gte", "lt", "lte"].includes(op) && (value === null || typeof value === "boolean"))
2122
+ fail(`Run event ${op} requires a string or number.`);
2123
+ return value;
2124
+ }
2125
+ function comparison(field, op, value) {
2126
+ if (!OPERATORS.includes(op))
2127
+ fail(`Unsupported run event operator: ${op}. Use ${OPERATORS.join(", ")}.`);
2128
+ if (op === "exists") {
2129
+ if (typeof value !== "boolean")
2130
+ fail("Run event exists requires a boolean.");
2131
+ return { field, op, value };
2132
+ }
2133
+ if (op === "in") {
2134
+ if (!Array.isArray(value) || value.length < 1 || value.length > 32)
2135
+ fail("Run event in requires between 1 and 32 scalars.");
2136
+ return { field, op, value: value.map((item) => scalar(field, item, "eq")) };
2137
+ }
2138
+ return {
2139
+ field,
2140
+ op,
2141
+ value: scalar(field, value, op)
2142
+ };
2143
+ }
2144
+ function admitObject(input, depth = 0, budget = { count: 0 }) {
2145
+ if (depth > MAX_DEPTH) fail("Run event where exceeds depth 8.");
2146
+ if (!object(input) || !Object.keys(input).length)
2147
+ fail("Run event where requires a nonempty object.");
2148
+ const terms = [];
2149
+ const fieldTerms = (raw, filter) => {
2150
+ const field = validateRunEventField(raw);
2151
+ const operators = object(filter) ? Object.entries(filter) : [["eq", filter]];
2152
+ if (!operators.length)
2153
+ fail(`Run event ${field} has an empty operator object.`);
2154
+ for (const [op, value] of operators) {
2155
+ if (++budget.count > MAX_PREDICATES)
2156
+ fail("Run event where exceeds 64 predicates.");
2157
+ terms.push(comparison(field, op, value));
2158
+ }
2159
+ };
2160
+ for (const [key, filter] of Object.entries(input)) {
2161
+ if (key === "and" || key === "or") {
2162
+ if (!Array.isArray(filter) || filter.length < 1 || filter.length > MAX_PREDICATES)
2163
+ fail(`Run event ${key} requires a nonempty bounded array.`);
2164
+ const children = filter.map(
2165
+ (item) => admitObject(item, depth + 1, budget)
2166
+ );
2167
+ terms.push(key === "and" ? { and: children } : { or: children });
2168
+ } else if (key === "context") {
2169
+ if (!object(filter) || !Object.keys(filter).length)
2170
+ fail("Run event context requires flat scalar fields.");
2171
+ for (const [contextKey, value] of Object.entries(filter))
2172
+ fieldTerms(`context.${contextKey}`, value);
2173
+ } else fieldTerms(key, filter);
2174
+ }
2175
+ return terms.length === 1 ? terms[0] : { and: terms };
2176
+ }
2177
+ function compact(predicate) {
2178
+ if ("and" in predicate) {
2179
+ const merged = {};
2180
+ for (const term of predicate.and) {
2181
+ const child = compact(term);
2182
+ for (const [key, value] of Object.entries(child)) {
2183
+ if (key === "and") return { and: predicate.and.map(compact) };
2184
+ if (key === "context") {
2185
+ const context = _nullishCoalesce(merged.context, () => ( {}));
2186
+ for (const [name, filter2] of Object.entries(value)) {
2187
+ if (Object.prototype.hasOwnProperty.call(context, name)) {
2188
+ const combined = combineFilters(context[name], filter2);
2189
+ if (!combined) return { and: predicate.and.map(compact) };
2190
+ context[name] = combined;
2191
+ } else context[name] = filter2;
2192
+ }
2193
+ merged.context = context;
2194
+ } else if (Object.prototype.hasOwnProperty.call(merged, key)) {
2195
+ const combined = key === "or" ? void 0 : combineFilters(merged[key], value);
2196
+ if (!combined) return { and: predicate.and.map(compact) };
2197
+ merged[key] = combined;
2198
+ } else merged[key] = value;
2199
+ }
2200
+ }
2201
+ return merged;
2202
+ }
2203
+ if ("or" in predicate) return { or: predicate.or.map(compact) };
2204
+ const filter = predicate.op === "eq" ? predicate.value : { [predicate.op]: predicate.value };
2205
+ if (predicate.field.startsWith("context."))
2206
+ return { context: { [predicate.field.slice(8)]: filter } };
2207
+ return { [predicate.field]: filter };
2208
+ }
2209
+ function combineFilters(left, right) {
2210
+ const first = object(left) ? left : { eq: left };
2211
+ const second = object(right) ? right : { eq: right };
2212
+ if (Object.keys(first).some(
2213
+ (key) => Object.prototype.hasOwnProperty.call(second, key)
2214
+ ))
2215
+ return void 0;
2216
+ return { ...first, ...second };
2217
+ }
2218
+ function canonical(predicate) {
2219
+ if ("field" in predicate) return predicate;
2220
+ const operator = "and" in predicate ? "and" : "or";
2221
+ const source = "and" in predicate ? predicate.and : predicate.or;
2222
+ const terms = source.map(canonical).flatMap((term) => {
2223
+ if (operator === "and" && "and" in term) return term.and;
2224
+ if (operator === "or" && "or" in term) return term.or;
2225
+ return [term];
2226
+ });
2227
+ terms.sort((a, b) => JSON.stringify(a).localeCompare(JSON.stringify(b)));
2228
+ const unique = terms.filter(
2229
+ (term, i) => i === 0 || JSON.stringify(term) !== JSON.stringify(terms[i - 1])
2230
+ );
2231
+ if (unique.length === 1) return unique[0];
2232
+ return operator === "and" ? { and: unique } : { or: unique };
2233
+ }
2234
+ function parseDsl(input) {
2235
+ let position = 0;
2236
+ let count = 0;
2237
+ const skip = () => {
2238
+ while (/\s/.test(_nullishCoalesce(input[position], () => ( ""))) && position < input.length)
2239
+ position++;
2240
+ };
2241
+ const take = (token) => {
2242
+ skip();
2243
+ if (input.startsWith(token, position)) {
2244
+ position += token.length;
2245
+ return true;
2246
+ }
2247
+ return false;
2248
+ };
2249
+ const json = () => {
2250
+ skip();
2251
+ const start = position;
2252
+ if (input[position] === '"') {
2253
+ position++;
2254
+ let closed = false;
2255
+ while (position < input.length) {
2256
+ const char = input[position++];
2257
+ if (char === "\\") position++;
2258
+ else if (char === '"') {
2259
+ closed = true;
2260
+ break;
2261
+ }
2262
+ }
2263
+ if (!closed) fail("Run event DSL has an unterminated JSON string.");
2264
+ } else {
2265
+ const match = /^(?:true|false|null|-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)/.exec(
2266
+ input.slice(position)
2267
+ );
2268
+ if (!match)
2269
+ fail("Run event DSL requires a JSON quoted string or scalar.");
2270
+ position += match[0].length;
2271
+ }
2272
+ try {
2273
+ return JSON.parse(input.slice(start, position));
2274
+ } catch (e4) {
2275
+ fail("Run event DSL requires valid JSON scalars.");
2276
+ }
2277
+ };
2278
+ const term = (depth) => {
2279
+ if (depth > MAX_DEPTH) fail("Run event where exceeds depth 8.");
2280
+ if (take("(")) {
2281
+ const nested = or(depth + 1);
2282
+ if (!take(")")) fail("Run event DSL is missing a closing parenthesis.");
2283
+ return nested;
2284
+ }
2285
+ skip();
2286
+ const match = /^(?:\$\.)?[A-Za-z_][A-Za-z0-9_.]*/.exec(
2287
+ input.slice(position)
2288
+ );
2289
+ if (!match) fail("Run event DSL requires a supported field.");
2290
+ position += match[0].length;
2291
+ const field = validateRunEventField(match[0]);
2292
+ if (++count > MAX_PREDICATES)
2293
+ fail("Run event where exceeds 64 predicates.");
2294
+ skip();
2295
+ const operation = /^(==|!=|>=|<=|>|<|\b(?:eq|ne|gte|gt|lte|lt|in|exists)\b)/.exec(
2296
+ input.slice(position)
2297
+ );
2298
+ if (!operation)
2299
+ fail("Run event DSL requires a supported comparison operator.");
2300
+ position += operation[0].length;
2301
+ const symbols = {
2302
+ "==": "eq",
2303
+ "!=": "ne",
2304
+ ">=": "gte",
2305
+ "<=": "lte",
2306
+ ">": "gt",
2307
+ "<": "lt"
2308
+ };
2309
+ const op = _nullishCoalesce(symbols[operation[0]], () => ( operation[0]));
2310
+ if (op === "in") {
2311
+ if (!take("[")) fail("Run event DSL in requires a JSON scalar array.");
2312
+ const values = [];
2313
+ if (!take("]")) {
2314
+ do {
2315
+ values.push(json());
2316
+ if (values.length > 32)
2317
+ fail("Run event in requires between 1 and 32 scalars.");
2318
+ } while (take(","));
2319
+ if (!take("]")) fail("Run event DSL in requires a closing bracket.");
2320
+ }
2321
+ return comparison(field, op, values);
2322
+ }
2323
+ return comparison(field, op, json());
2324
+ };
2325
+ const and = (depth) => {
2326
+ const terms = [term(depth)];
2327
+ while (take("&&")) terms.push(term(depth));
2328
+ return terms.length === 1 ? terms[0] : { and: terms };
2329
+ };
2330
+ const or = (depth) => {
2331
+ const terms = [and(depth)];
2332
+ while (take("||")) terms.push(and(depth));
2333
+ return terms.length === 1 ? terms[0] : { or: terms };
2334
+ };
2335
+ const result = or(0);
2336
+ skip();
2337
+ if (position !== input.length)
2338
+ fail(`Run event DSL has unsupported input at position ${position}.`);
2339
+ return result;
2340
+ }
2341
+ function parseRunEventWhere(input) {
2342
+ bounded(input);
2343
+ const where = compact(
2344
+ canonical(typeof input === "string" ? parseDsl(input) : admitObject(input))
2345
+ );
2346
+ bounded(where);
2347
+ return where;
2348
+ }
2349
+ function normalizeRunEventQueryTimestamp(value) {
2350
+ let extraMicros = "";
2351
+ if (typeof value === "string") {
2352
+ const timestamp = /^[+-]?\d{4,6}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.(\d{1,6}))?(?:Z|[+-]\d{2}:\d{2})$/.exec(
2353
+ value
2354
+ );
2355
+ if (!timestamp)
2356
+ fail(
2357
+ "Run event time bounds require an ISO timestamp with a timezone and at most six fractional digits."
2358
+ );
2359
+ extraMicros = (_nullishCoalesce(timestamp[1], () => ( ""))).padEnd(6, "0").slice(3);
2360
+ }
2361
+ const date = new Date(value);
2362
+ if (!Number.isFinite(date.getTime()))
2363
+ fail("Run event time bound is invalid.");
2364
+ const canonical2 = date.toISOString();
2365
+ return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
2366
+ }
2367
+ function timestampMicros(value) {
2368
+ const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _69 => _69.exec, 'call', _70 => _70(value), 'optionalAccess', _71 => _71[1]]), () => ( ""));
2369
+ return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
2370
+ }
2371
+ function time(value, nowMs, fallback) {
2372
+ if (value === void 0) value = fallback;
2373
+ let timestamp;
2374
+ if (typeof value === "number") timestamp = value;
2375
+ else if (typeof value === "string") {
2376
+ const relative = /^(\d+(?:\.\d+)?)(ms|s|m|h|d)$/.exec(value);
2377
+ if (relative) {
2378
+ const units = {
2379
+ ms: 1,
2380
+ s: 1e3,
2381
+ m: 6e4,
2382
+ h: 36e5,
2383
+ d: 864e5
2384
+ };
2385
+ timestamp = nowMs - Number(relative[1]) * units[relative[2]];
2386
+ } else {
2387
+ return normalizeRunEventQueryTimestamp(value);
2388
+ }
2389
+ } else fail("Run event time bounds require a timestamp or duration.");
2390
+ return normalizeRunEventQueryTimestamp(timestamp);
2391
+ }
2392
+ function exact(value, name) {
2393
+ if (typeof value !== "string" || !value.trim() || value.length > 256)
2394
+ fail(
2395
+ `Run event ${name} requires a nonempty string of at most 256 characters.`
2396
+ );
2397
+ return value;
2398
+ }
2399
+ var CRITERIA_KEYS = [
2400
+ "since",
2401
+ "until",
2402
+ "where",
2403
+ "runId",
2404
+ "stepId",
2405
+ "minLevel",
2406
+ "text",
2407
+ "playName",
2408
+ "kind"
2409
+ ];
2410
+ function normalizeRunEventQuery(criteria, nowMs = Date.now()) {
2411
+ if (!object(criteria)) fail("Run event criteria requires an object.");
2412
+ bounded(criteria, RUN_EVENT_QUERY_MAX_REQUEST_BYTES);
2413
+ for (const key of Object.keys(criteria)) {
2414
+ if (!CRITERIA_KEYS.includes(key))
2415
+ fail(`Unsupported run event criterion: ${key}.`);
2416
+ }
2417
+ const until = time(criteria.until, nowMs, nowMs);
2418
+ const since = time(criteria.since, nowMs, Date.parse(until) - 36e5);
2419
+ if (timestampMicros(since) >= timestampMicros(until) || timestampMicros(until) - timestampMicros(since) > BigInt(RUN_EVENT_QUERY_RETENTION_MS) * BigInt(1e3))
2420
+ fail("Run event query requires a window of at most seven days.");
2421
+ const query = { since, until };
2422
+ if (criteria.where !== void 0)
2423
+ query.where = parseRunEventWhere(criteria.where);
2424
+ for (const name of ["runId", "stepId", "playName", "kind"]) {
2425
+ if (criteria[name] !== void 0) query[name] = exact(criteria[name], name);
2426
+ }
2427
+ if (criteria.minLevel !== void 0) {
2428
+ if (!RUN_LOG_LEVELS.includes(criteria.minLevel))
2429
+ fail("Run event minLevel requires debug, info, warn or error.");
2430
+ query.minLevel = criteria.minLevel;
2431
+ }
2432
+ if (criteria.text !== void 0) {
2433
+ if (typeof criteria.text !== "string" || !criteria.text.length || new TextEncoder().encode(criteria.text).length > 1024)
2434
+ fail("Run event text requires between 1 and 1024 bytes.");
2435
+ query.text = criteria.text;
2436
+ }
2437
+ return query;
2438
+ }
2439
+ function normalizeRunEventOperationRequest(input, nowMs = Date.now()) {
2440
+ bounded(input, RUN_EVENT_QUERY_MAX_REQUEST_BYTES);
2441
+ if (!object(input)) fail("Run event operation requires an object.");
2442
+ const operation = input.operation;
2443
+ if (!["list", "count", "summarize", "fields"].includes(String(operation)))
2444
+ fail("Run event operation requires list, count, summarize or fields.");
2445
+ if (input.resource !== "logs" && input.resource !== "events")
2446
+ fail("Run event resource requires logs or events.");
2447
+ const allowed = [
2448
+ "operation",
2449
+ "resource",
2450
+ "runId",
2451
+ ...operation === "fields" ? [] : CRITERIA_KEYS,
2452
+ ...operation === "list" ? ["limit", "cursor", "includePayloads"] : operation === "summarize" ? ["groupBy", "measures", "limit", "cursor"] : []
2453
+ ];
2454
+ for (const key of Object.keys(input)) {
2455
+ if (!allowed.includes(key))
2456
+ fail(`Run event ${operation} does not support ${key}.`);
2457
+ }
2458
+ const base = {
2459
+ operation,
2460
+ resource: input.resource,
2461
+ ...input.runId === void 0 ? {} : { runId: exact(input.runId, "runId") }
2462
+ };
2463
+ if (operation === "fields") return base;
2464
+ if (input.resource === "logs" && !base.runId)
2465
+ fail("Run event logs require runId.");
2466
+ if (input.cursor !== void 0 && (typeof input.cursor !== "string" || !input.cursor.length || input.cursor.length > RUN_EVENT_QUERY_MAX_CURSOR_BYTES))
2467
+ fail("Run event cursor is invalid.");
2468
+ const rawCriteria = Object.fromEntries(
2469
+ Object.entries(input).filter(
2470
+ ([key]) => CRITERIA_KEYS.includes(key) && (key !== "runId" || input.resource === "events")
2471
+ )
2472
+ );
2473
+ const query = normalizeRunEventQuery(
2474
+ input.cursor === void 0 ? rawCriteria : { ...rawCriteria, since: nowMs - 36e5, until: nowMs },
2475
+ nowMs
2476
+ );
2477
+ const criteria = { ...query };
2478
+ if (input.cursor !== void 0) {
2479
+ if (input.since === void 0) delete criteria.since;
2480
+ else criteria.since = time(input.since, nowMs, nowMs - 36e5);
2481
+ if (input.until === void 0) delete criteria.until;
2482
+ else criteria.until = time(input.until, nowMs, nowMs);
2483
+ }
2484
+ if (operation === "count")
2485
+ return { ...base, ...criteria };
2486
+ const limit = _nullishCoalesce(input.limit, () => ( (input.includePayloads === true ? 10 : 50)));
2487
+ if (!Number.isSafeInteger(limit) || limit < 1 || limit > RUN_EVENT_QUERY_MAX_LIMIT)
2488
+ fail("Run event limit must be between 1 and 200.");
2489
+ const page = {
2490
+ limit,
2491
+ ...input.cursor === void 0 ? {} : { cursor: input.cursor }
2492
+ };
2493
+ if (operation === "list") {
2494
+ if (input.includePayloads !== void 0 && typeof input.includePayloads !== "boolean")
2495
+ fail("Run event includePayloads requires a boolean.");
2496
+ if (input.includePayloads === true && limit > RUN_EVENT_QUERY_MAX_PAYLOAD_LIMIT)
2497
+ fail("Run event payload pages cannot exceed 10 rows.");
2498
+ return {
2499
+ ...base,
2500
+ ...criteria,
2501
+ ...page,
2502
+ ...input.includePayloads === void 0 ? {} : { includePayloads: input.includePayloads }
2503
+ };
2504
+ }
2505
+ if (!Array.isArray(input.groupBy) || input.groupBy.length > 4)
2506
+ fail("Run event groupBy requires at most four fields.");
2507
+ const groupBy = input.groupBy.map(validateRunEventField);
2508
+ if (new Set(groupBy).size !== groupBy.length)
2509
+ fail("Run event groupBy fields must be distinct.");
2510
+ const rawMeasures = _nullishCoalesce(input.measures, () => ( [{ op: "count" }]));
2511
+ if (!Array.isArray(rawMeasures) || rawMeasures.length < 1 || rawMeasures.length > 8)
2512
+ fail("Run event measures require between 1 and 8 entries.");
2513
+ const names = /* @__PURE__ */ new Set();
2514
+ const measures = rawMeasures.map((measure) => {
2515
+ if (!object(measure) || measure.op !== "count" && measure.op !== "sum")
2516
+ fail("Run event measures support count and sum.");
2517
+ for (const key of Object.keys(measure)) {
2518
+ if (!["op", "as", ...measure.op === "sum" ? ["field"] : []].includes(key))
2519
+ fail(`Unsupported run event measure option: ${key}.`);
2520
+ }
2521
+ const field = measure.op === "sum" ? validateRunEventField(measure.field) : void 0;
2522
+ if (field && !field.startsWith("context.") && RUN_EVENT_QUERY_FIELD_CATALOG[field].type !== "number")
2523
+ fail(`Run event sum requires a numeric field: ${field}.`);
2524
+ const name = _nullishCoalesce(measure.as, () => ( (field ? `sum_${field.replaceAll(".", "_")}` : "count")));
2525
+ if (typeof name !== "string" || !/^[A-Za-z_][A-Za-z0-9_]{0,63}$/.test(name) || names.has(name))
2526
+ fail("Run event measure names must be distinct identifiers.");
2527
+ names.add(name);
2528
+ return field ? { op: "sum", field, as: name } : { op: "count", as: name };
2529
+ });
2530
+ return {
2531
+ ...base,
2532
+ ...criteria,
2533
+ ...page,
2534
+ groupBy,
2535
+ measures
2536
+ };
2537
+ }
2538
+
2016
2539
  // src/types.ts
2017
2540
  function isStopAllPlayRunsDryRunResult(result) {
2018
2541
  return "dryRun" in result && result.dryRun === true;
@@ -2075,7 +2598,7 @@ function parseNotificationGroupTarget(value) {
2075
2598
  }
2076
2599
  return { kind: "email", email };
2077
2600
  }
2078
- const slack = _optionalChain([/^slack:(.+)$/i, 'access', _69 => _69.exec, 'call', _70 => _70(normalized), 'optionalAccess', _71 => _71[1], 'optionalAccess', _72 => _72.trim, 'call', _73 => _73()]);
2601
+ const slack = _optionalChain([/^slack:(.+)$/i, 'access', _72 => _72.exec, 'call', _73 => _73(normalized), 'optionalAccess', _74 => _74[1], 'optionalAccess', _75 => _75.trim, 'call', _76 => _76()]);
2079
2602
  if (!slack) {
2080
2603
  const provider = normalized.split(":", 1)[0] || normalized;
2081
2604
  throw new Error(
@@ -2083,7 +2606,7 @@ function parseNotificationGroupTarget(value) {
2083
2606
  );
2084
2607
  }
2085
2608
  const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
2086
- if (_optionalChain([member, 'optionalAccess', _74 => _74[1]])) {
2609
+ if (_optionalChain([member, 'optionalAccess', _77 => _77[1]])) {
2087
2610
  return { kind: "slack", memberId: member[1].toUpperCase() };
2088
2611
  }
2089
2612
  if (slack.toLowerCase().startsWith("member:")) {
@@ -2130,10 +2653,10 @@ function resolvePlayRunRuntimeSelection(request) {
2130
2653
  }
2131
2654
  return runtime;
2132
2655
  }
2133
- const configured = _optionalChain([process, 'access', _75 => _75.env, 'access', _76 => _76.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _77 => _77.trim, 'call', _78 => _78()]);
2134
- const configuredNamespace = _optionalChain([process, 'access', _79 => _79.env, 'access', _80 => _80.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _81 => _81.trim, 'call', _82 => _82()]);
2135
- const configuredToken = _optionalChain([process, 'access', _83 => _83.env, 'access', _84 => _84.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _85 => _85.trim, 'call', _86 => _86()]);
2136
- const configuredPlacementPolicy = _optionalChain([process, 'access', _87 => _87.env, 'access', _88 => _88.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _89 => _89.trim, 'call', _90 => _90()]);
2656
+ const configured = _optionalChain([process, 'access', _78 => _78.env, 'access', _79 => _79.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _80 => _80.trim, 'call', _81 => _81()]);
2657
+ const configuredNamespace = _optionalChain([process, 'access', _82 => _82.env, 'access', _83 => _83.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _84 => _84.trim, 'call', _85 => _85()]);
2658
+ const configuredToken = _optionalChain([process, 'access', _86 => _86.env, 'access', _87 => _87.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _88 => _88.trim, 'call', _89 => _89()]);
2659
+ const configuredPlacementPolicy = _optionalChain([process, 'access', _90 => _90.env, 'access', _91 => _91.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _92 => _92.trim, 'call', _93 => _93()]);
2137
2660
  if (!configured) {
2138
2661
  if (configuredNamespace || configuredToken || configuredPlacementPolicy) {
2139
2662
  const present = [];
@@ -2172,7 +2695,7 @@ function resolvePlayRunRuntimeSelection(request) {
2172
2695
  "INVALID_RUNTIME_NAMESPACE"
2173
2696
  );
2174
2697
  }
2175
- const configuredBackendValue = _optionalChain([process, 'access', _91 => _91.env, 'access', _92 => _92.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _93 => _93.trim, 'call', _94 => _94()]);
2698
+ const configuredBackendValue = _optionalChain([process, 'access', _94 => _94.env, 'access', _95 => _95.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _96 => _96.trim, 'call', _97 => _97()]);
2176
2699
  const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
2177
2700
  if (configuredBackendValue && !configuredBackend) {
2178
2701
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
@@ -2210,7 +2733,7 @@ function resolveStartPlayRunRequest(request) {
2210
2733
  }
2211
2734
  function runtimeSelectionHeaders(runtime) {
2212
2735
  if (!runtime) return void 0;
2213
- const token = _optionalChain([process, 'access', _95 => _95.env, 'access', _96 => _96.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _97 => _97.trim, 'call', _98 => _98()]);
2736
+ const token = _optionalChain([process, 'access', _98 => _98.env, 'access', _99 => _99.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _100 => _100.trim, 'call', _101 => _101()]);
2214
2737
  if (!token) {
2215
2738
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
2216
2739
  "DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
@@ -2218,18 +2741,18 @@ function runtimeSelectionHeaders(runtime) {
2218
2741
  "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
2219
2742
  );
2220
2743
  }
2221
- const receivers = _optionalChain([process, 'access', _99 => _99.env, 'access', _100 => _100.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _101 => _101.trim, 'call', _102 => _102()]);
2744
+ const receivers = _optionalChain([process, 'access', _102 => _102.env, 'access', _103 => _103.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _104 => _104.trim, 'call', _105 => _105()]);
2222
2745
  return {
2223
- [_chunkAKE6ZFIJjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2224
- ...receivers ? { [_chunkAKE6ZFIJjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2746
+ [_chunkNZCFZXDPjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2747
+ ...receivers ? { [_chunkNZCFZXDPjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2225
2748
  };
2226
2749
  }
2227
2750
  function isolatedCiRuntimeEventReadHeaders() {
2228
- const schema = _optionalChain([process, 'access', _103 => _103.env, 'access', _104 => _104.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()]);
2229
- if (_optionalChain([process, 'access', _107 => _107.env, 'access', _108 => _108.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
2751
+ const schema = _optionalChain([process, 'access', _106 => _106.env, 'access', _107 => _107.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _108 => _108.trim, 'call', _109 => _109()]);
2752
+ if (_optionalChain([process, 'access', _110 => _110.env, 'access', _111 => _111.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _112 => _112.trim, 'call', _113 => _113()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
2230
2753
  return void 0;
2231
2754
  }
2232
- const token = _optionalChain([process, 'access', _111 => _111.env, 'access', _112 => _112.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _113 => _113.trim, 'call', _114 => _114()]);
2755
+ const token = _optionalChain([process, 'access', _114 => _114.env, 'access', _115 => _115.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _116 => _116.trim, 'call', _117 => _117()]);
2233
2756
  if (!token) {
2234
2757
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
2235
2758
  "DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
@@ -2237,7 +2760,7 @@ function isolatedCiRuntimeEventReadHeaders() {
2237
2760
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
2238
2761
  );
2239
2762
  }
2240
- return { [_chunkAKE6ZFIJjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2763
+ return { [_chunkNZCFZXDPjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2241
2764
  }
2242
2765
  function normalizeTestPolicyOverrides(value, source) {
2243
2766
  if (value && typeof value === "object" && !Array.isArray(value)) {
@@ -2250,8 +2773,8 @@ function normalizeTestPolicyOverrides(value, source) {
2250
2773
  );
2251
2774
  }
2252
2775
  function parseEnvTestPolicyOverrides() {
2253
- const raw = typeof process !== "undefined" ? _optionalChain([process, 'access', _115 => _115.env, 'optionalAccess', _116 => _116.DEEPLINE_TEST_POLICY_OVERRIDES]) : void 0;
2254
- const trimmed = _optionalChain([raw, 'optionalAccess', _117 => _117.trim, 'call', _118 => _118()]);
2776
+ const raw = typeof process !== "undefined" ? _optionalChain([process, 'access', _118 => _118.env, 'optionalAccess', _119 => _119.DEEPLINE_TEST_POLICY_OVERRIDES]) : void 0;
2777
+ const trimmed = _optionalChain([raw, 'optionalAccess', _120 => _120.trim, 'call', _121 => _121()]);
2255
2778
  if (!trimmed) return void 0;
2256
2779
  let parsed;
2257
2780
  try {
@@ -2279,7 +2802,7 @@ function isTransientCompileManifestError(error) {
2279
2802
  );
2280
2803
  }
2281
2804
  function requireCompileManifestResponse(response, playName) {
2282
- const compilerManifest = _optionalChain([response, 'optionalAccess', _119 => _119.compilerManifest]);
2805
+ const compilerManifest = _optionalChain([response, 'optionalAccess', _122 => _122.compilerManifest]);
2283
2806
  if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
2284
2807
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
2285
2808
  `Compile manifest response did not include compilerManifest for ${playName}.`,
@@ -2331,7 +2854,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
2331
2854
  }
2332
2855
  function searchParams(options) {
2333
2856
  const params = new URLSearchParams();
2334
- params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _120 => _120.query, 'optionalAccess', _121 => _121.trim, 'call', _122 => _122()]), () => ( "")));
2857
+ params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _123 => _123.query, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()]), () => ( "")));
2335
2858
  params.set(
2336
2859
  "include_search_debug",
2337
2860
  options.includeSearchDebug ? "true" : "false"
@@ -2341,13 +2864,13 @@ function searchParams(options) {
2341
2864
  if (options.offset !== void 0) {
2342
2865
  params.set("offset", String(options.offset));
2343
2866
  }
2344
- if (_optionalChain([options, 'access', _123 => _123.categories, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()])) {
2867
+ if (_optionalChain([options, 'access', _126 => _126.categories, 'optionalAccess', _127 => _127.trim, 'call', _128 => _128()])) {
2345
2868
  params.set("categories", options.categories.trim());
2346
2869
  }
2347
- if (_optionalChain([options, 'access', _126 => _126.searchTerms, 'optionalAccess', _127 => _127.trim, 'call', _128 => _128()])) {
2870
+ if (_optionalChain([options, 'access', _129 => _129.searchTerms, 'optionalAccess', _130 => _130.trim, 'call', _131 => _131()])) {
2348
2871
  params.set("search_terms", options.searchTerms.trim());
2349
2872
  }
2350
- if (_optionalChain([options, 'access', _129 => _129.task, 'optionalAccess', _130 => _130.trim, 'call', _131 => _131()])) params.set("task", options.task.trim());
2873
+ if (_optionalChain([options, 'access', _132 => _132.task, 'optionalAccess', _133 => _133.trim, 'call', _134 => _134()])) params.set("task", options.task.trim());
2351
2874
  return params;
2352
2875
  }
2353
2876
  var RUNS_FAILED_LOG_LIMIT = 20;
@@ -2397,17 +2920,17 @@ function preferPrebuiltPlayDescriptions(plays) {
2397
2920
  }
2398
2921
  function normalizePlayStatus(raw) {
2399
2922
  const runPackage = _chunkLA46MMTLjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkLA46MMTLjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
2400
- const packageRun = _optionalChain([runPackage, 'optionalAccess', _132 => _132.run]);
2401
- const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _133 => _133.status]) === "string" ? packageRun.status : null;
2923
+ const packageRun = _optionalChain([runPackage, 'optionalAccess', _135 => _135.run]);
2924
+ const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _136 => _136.status]) === "string" ? packageRun.status : null;
2402
2925
  const status = _chunkLA46MMTLjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
2403
2926
  if (!status) {
2404
2927
  throw new Error(
2405
2928
  `Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
2406
2929
  );
2407
2930
  }
2408
- const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _134 => _134.id]), () => ( ""));
2409
- const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _135 => _135.overview]), () => ( raw.overview));
2410
- const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _136 => _136.runStatus]), () => ( raw.runStatus));
2931
+ const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _137 => _137.id]), () => ( ""));
2932
+ const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _138 => _138.overview]), () => ( raw.overview));
2933
+ const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _139 => _139.runStatus]), () => ( raw.runStatus));
2411
2934
  return {
2412
2935
  ...raw,
2413
2936
  runId,
@@ -2509,9 +3032,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
2509
3032
  runId: status.runId || fallbackRunId,
2510
3033
  result: _nullishCoalesce(status.package, () => ( status.result)),
2511
3034
  ...status.package ? { package: status.package } : {},
2512
- logs: _nullishCoalesce(_optionalChain([status, 'access', _137 => _137.progress, 'optionalAccess', _138 => _138.logs]), () => ( [])),
3035
+ logs: _nullishCoalesce(_optionalChain([status, 'access', _140 => _140.progress, 'optionalAccess', _141 => _141.logs]), () => ( [])),
2513
3036
  durationMs: Date.now() - startedAt,
2514
- error: _nullishCoalesce(_optionalChain([status, 'access', _139 => _139.progress, 'optionalAccess', _140 => _140.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3037
+ error: _nullishCoalesce(_optionalChain([status, 'access', _142 => _142.progress, 'optionalAccess', _143 => _143.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
2515
3038
  };
2516
3039
  }
2517
3040
  var DeeplineClient = (_class = class _DeeplineClient {
@@ -2538,12 +3061,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
2538
3061
  * @throws {@link ConfigError} if no API key can be resolved from any source.
2539
3062
  */
2540
3063
  constructor(options) {
2541
- this.config = _chunkAKE6ZFIJjs.resolveConfig.call(void 0, options);
2542
- this.http = new (0, _chunkAKE6ZFIJjs.HttpClient)(this.config);
3064
+ this.config = _chunkNZCFZXDPjs.resolveConfig.call(void 0, options);
3065
+ this.http = new (0, _chunkNZCFZXDPjs.HttpClient)(this.config);
2543
3066
  this.toolCalls = new ToolCalls(
2544
3067
  this.http,
2545
3068
  this.config.timeout,
2546
- _optionalChain([options, 'optionalAccess', _141 => _141.timeout])
3069
+ _optionalChain([options, 'optionalAccess', _144 => _144.timeout])
2547
3070
  );
2548
3071
  this.runs = {
2549
3072
  getReceipts: (runId, options2) => this.getRunReceipts(runId, options2),
@@ -2555,7 +3078,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
2555
3078
  history: (options2) => this.getRunsHistory(options2),
2556
3079
  watch: (runId, options2) => this.watchRunToTerminal(runId, options2),
2557
3080
  tail: (runId, options2) => this.tailRun(runId, options2),
2558
- logs: (runId, options2) => this.getRunLogs(runId, options2),
3081
+ logs: Object.assign(
3082
+ (runId, options2) => this.getRunLogs(runId, options2),
3083
+ {
3084
+ query: (runId, options2) => this.queryRunLogs(runId, options2),
3085
+ count: (runId, criteria) => this.countRunLogs(runId, criteria),
3086
+ summarize: (runId, options2) => this.summarizeRunLogs(runId, options2),
3087
+ fields: (options2) => this.getRunEventFields("logs", options2)
3088
+ }
3089
+ ),
3090
+ events: {
3091
+ list: (options2) => this.listRunEvents(options2),
3092
+ count: (criteria) => this.countRunEvents(criteria),
3093
+ summarize: (options2) => this.summarizeRunEvents(options2),
3094
+ fields: (options2) => this.getRunEventFields("events", options2)
3095
+ },
2559
3096
  searchEvents: (options2) => this.searchRunEvents(options2),
2560
3097
  input: (runId) => this.getRunInput(runId),
2561
3098
  rerun: (runId, options2) => this.rerun(runId, options2),
@@ -2588,7 +3125,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
2588
3125
  {},
2589
3126
  {
2590
3127
  "Idempotency-Key": requireTargetBillingIdempotencyKey(
2591
- _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _142 => _142.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3128
+ _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _145 => _145.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
2592
3129
  )
2593
3130
  }
2594
3131
  ),
@@ -2607,7 +3144,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
2607
3144
  available: (toolIdOrOptions, options2) => this.getMonitorsAvailable(toolIdOrOptions, options2),
2608
3145
  check: (definition) => this.checkMonitor(definition),
2609
3146
  deploy: (definition, options2) => this.deployMonitor(definition, options2),
2610
- sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _143 => _143.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
3147
+ sync: (definition, options2) => _optionalChain([options2, 'optionalAccess', _146 => _146.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options2),
2611
3148
  list: (options2) => this.listMonitors(options2),
2612
3149
  get: (key) => this.getMonitor(key),
2613
3150
  test: (key, payload, options2) => this.testMonitorWebhook(key, payload, options2),
@@ -2616,13 +3153,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
2616
3153
  update: (key, patch) => this.updateMonitor(key, patch),
2617
3154
  delete: (key, options2) => this.deleteMonitor(key, options2),
2618
3155
  reactivate: (key, options2) => this.reactivateMonitor(key, options2),
2619
- start: (key, options2) => _optionalChain([options2, 'optionalAccess', _144 => _144.dryRun]) ? this.submitMonitorBatch({
3156
+ start: (key, options2) => _optionalChain([options2, 'optionalAccess', _147 => _147.dryRun]) ? this.submitMonitorBatch({
2620
3157
  kind: "reactivate",
2621
3158
  scope: { kind: "keys", monitorKeys: [key] },
2622
3159
  dryRun: true,
2623
3160
  idempotencyKey: _nullishCoalesce(options2.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
2624
3161
  }) : this.submitScalarMonitorLifecycle(key, "start", options2),
2625
- stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _145 => _145.dryRun]) ? this.submitMonitorBatch({
3162
+ stop: (key, options2) => _optionalChain([options2, 'optionalAccess', _148 => _148.dryRun]) ? this.submitMonitorBatch({
2626
3163
  kind: "deactivate",
2627
3164
  scope: { kind: "keys", monitorKeys: [key] },
2628
3165
  dryRun: true,
@@ -2673,7 +3210,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
2673
3210
  type: _nullishCoalesce(field.type, () => ( void 0)),
2674
3211
  required: _nullishCoalesce(field.required, () => ( void 0))
2675
3212
  } : null
2676
- ).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _146 => _146.name]))) : [];
3213
+ ).filter((field) => Boolean(_optionalChain([field, 'optionalAccess', _149 => _149.name]))) : [];
2677
3214
  return fields.length > 0 ? { fields } : schema;
2678
3215
  }
2679
3216
  schemaMetadata(schema, key) {
@@ -2703,13 +3240,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
2703
3240
  };
2704
3241
  }
2705
3242
  summarizePlayListItem(play, options) {
2706
- const aliases = _optionalChain([play, 'access', _147 => _147.aliases, 'optionalAccess', _148 => _148.length]) ? play.aliases : [play.name];
3243
+ const aliases = _optionalChain([play, 'access', _150 => _150.aliases, 'optionalAccess', _151 => _151.length]) ? play.aliases : [play.name];
2707
3244
  const csvInput = this.schemaMetadata(play.inputSchema, "csvInput");
2708
3245
  const rowOutputSchema = this.schemaMetadata(
2709
3246
  play.outputSchema,
2710
3247
  "rowOutputSchema"
2711
3248
  );
2712
- const description = _optionalChain([play, 'access', _149 => _149.description, 'optionalAccess', _150 => _150.trim, 'call', _151 => _151()]) || _optionalChain([play, 'access', _152 => _152.currentRevision, 'optionalAccess', _153 => _153.description, 'optionalAccess', _154 => _154.trim, 'call', _155 => _155()]) || _optionalChain([play, 'access', _156 => _156.liveRevision, 'optionalAccess', _157 => _157.description, 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()]) || null;
3249
+ const description = _optionalChain([play, 'access', _152 => _152.description, 'optionalAccess', _153 => _153.trim, 'call', _154 => _154()]) || _optionalChain([play, 'access', _155 => _155.currentRevision, 'optionalAccess', _156 => _156.description, 'optionalAccess', _157 => _157.trim, 'call', _158 => _158()]) || _optionalChain([play, 'access', _159 => _159.liveRevision, 'optionalAccess', _160 => _160.description, 'optionalAccess', _161 => _161.trim, 'call', _162 => _162()]) || null;
2713
3250
  const runCommand = this.playRunCommand(play);
2714
3251
  const cloneEditStarter = this.playCloneEditStarter(play);
2715
3252
  return {
@@ -2729,9 +3266,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
2729
3266
  canEdit: play.canEdit,
2730
3267
  canClone: play.canClone,
2731
3268
  aliases,
2732
- inputSchema: _optionalChain([options, 'optionalAccess', _160 => _160.compact]) ? this.compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
2733
- outputSchema: _optionalChain([options, 'optionalAccess', _161 => _161.compact]) ? this.compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
2734
- staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access', _162 => _162.currentRevision, 'optionalAccess', _163 => _163.staticPipeline])) ? play.currentRevision.staticPipeline : isRecord2(_optionalChain([play, 'access', _164 => _164.liveRevision, 'optionalAccess', _165 => _165.staticPipeline])) ? play.liveRevision.staticPipeline : null,
3269
+ inputSchema: _optionalChain([options, 'optionalAccess', _163 => _163.compact]) ? this.compactSchema(play.inputSchema) : _nullishCoalesce(play.inputSchema, () => ( null)),
3270
+ outputSchema: _optionalChain([options, 'optionalAccess', _164 => _164.compact]) ? this.compactSchema(play.outputSchema) : _nullishCoalesce(play.outputSchema, () => ( null)),
3271
+ staticPipeline: isRecord2(play.staticPipeline) ? play.staticPipeline : isRecord2(_optionalChain([play, 'access', _165 => _165.currentRevision, 'optionalAccess', _166 => _166.staticPipeline])) ? play.currentRevision.staticPipeline : isRecord2(_optionalChain([play, 'access', _167 => _167.liveRevision, 'optionalAccess', _168 => _168.staticPipeline])) ? play.liveRevision.staticPipeline : null,
2735
3272
  ...csvInput ? {
2736
3273
  csvInput: { ...csvInput, headerMatching: CSV_HEADER_MATCHING_NOTE }
2737
3274
  } : {},
@@ -2743,7 +3280,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
2743
3280
  // Read the live version off the live revision. It was previously only
2744
3281
  // ever written by the publish/live routes, so every list and describe
2745
3282
  // payload reported liveVersion: null even for an actively serving play.
2746
- liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _166 => _166.liveRevision, 'optionalAccess', _167 => _167.version]), () => ( null)),
3283
+ liveVersion: _nullishCoalesce(_optionalChain([play, 'access', _169 => _169.liveRevision, 'optionalAccess', _170 => _170.version]), () => ( null)),
2747
3284
  ...play.triggerStatus ? { triggerStatus: play.triggerStatus } : {},
2748
3285
  isDraftDirty: play.isDraftDirty
2749
3286
  };
@@ -2752,8 +3289,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
2752
3289
  const play = detail.play;
2753
3290
  return {
2754
3291
  ...this.summarizePlayListItem(play, options),
2755
- currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _168 => _168.liveRevision, 'optionalAccess', _169 => _169.version]))), () => ( null)),
2756
- latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _170 => _170.latestRuns, 'access', _171 => _171[0], 'optionalAccess', _172 => _172.workflowId]))), () => ( null)),
3292
+ currentPublishedVersion: _nullishCoalesce(_nullishCoalesce(play.currentPublishedVersion, () => ( _optionalChain([play, 'access', _171 => _171.liveRevision, 'optionalAccess', _172 => _172.version]))), () => ( null)),
3293
+ latestRunId: _nullishCoalesce(_nullishCoalesce(play.latestRunId, () => ( _optionalChain([detail, 'access', _173 => _173.latestRuns, 'access', _174 => _174[0], 'optionalAccess', _175 => _175.workflowId]))), () => ( null)),
2757
3294
  ...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
2758
3295
  ...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
2759
3296
  ...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {}
@@ -2820,17 +3357,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
2820
3357
  */
2821
3358
  async listTools(options) {
2822
3359
  const params = new URLSearchParams();
2823
- if (_optionalChain([options, 'optionalAccess', _173 => _173.categories, 'optionalAccess', _174 => _174.trim, 'call', _175 => _175()])) {
3360
+ if (_optionalChain([options, 'optionalAccess', _176 => _176.categories, 'optionalAccess', _177 => _177.trim, 'call', _178 => _178()])) {
2824
3361
  params.set("categories", options.categories.trim());
2825
3362
  }
2826
- if (_optionalChain([options, 'optionalAccess', _176 => _176.tags, 'optionalAccess', _177 => _177.trim, 'call', _178 => _178()])) {
3363
+ if (_optionalChain([options, 'optionalAccess', _179 => _179.tags, 'optionalAccess', _180 => _180.trim, 'call', _181 => _181()])) {
2827
3364
  params.set("tags", options.tags.trim());
2828
3365
  }
2829
- if (_optionalChain([options, 'optionalAccess', _179 => _179.grep, 'optionalAccess', _180 => _180.trim, 'call', _181 => _181()])) {
3366
+ if (_optionalChain([options, 'optionalAccess', _182 => _182.grep, 'optionalAccess', _183 => _183.trim, 'call', _184 => _184()])) {
2830
3367
  params.set("grep", options.grep.trim());
2831
3368
  params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
2832
3369
  }
2833
- params.set("compact", _optionalChain([options, 'optionalAccess', _182 => _182.compact]) === true ? "true" : "false");
3370
+ params.set("compact", _optionalChain([options, 'optionalAccess', _185 => _185.compact]) === true ? "true" : "false");
2834
3371
  const suffix = params.toString() ? `?${params.toString()}` : "";
2835
3372
  const res = await this.http.get(
2836
3373
  `/api/v2/tools${suffix}`
@@ -2839,7 +3376,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
2839
3376
  }
2840
3377
  /** List discoverable providers without requiring a local plugin catalog. */
2841
3378
  async listProviders(options) {
2842
- const suffix = _optionalChain([options, 'optionalAccess', _183 => _183.changed]) ? "?changed=true" : "";
3379
+ const suffix = _optionalChain([options, 'optionalAccess', _186 => _186.changed]) ? "?changed=true" : "";
2843
3380
  const res = await this.http.get(
2844
3381
  `/api/v2/tools/providers${suffix}`
2845
3382
  );
@@ -2870,8 +3407,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
2870
3407
  */
2871
3408
  async search(options = {}) {
2872
3409
  const params = searchParams(options);
2873
- if (_optionalChain([options, 'access', _184 => _184.types, 'optionalAccess', _185 => _185.length])) params.set("types", options.types.join(","));
2874
- if (_optionalChain([options, 'access', _186 => _186.exclude, 'optionalAccess', _187 => _187.length])) {
3410
+ if (_optionalChain([options, 'access', _187 => _187.types, 'optionalAccess', _188 => _188.length])) params.set("types", options.types.join(","));
3411
+ if (_optionalChain([options, 'access', _189 => _189.exclude, 'optionalAccess', _190 => _190.length])) {
2875
3412
  params.set("exclude", options.exclude.join(","));
2876
3413
  }
2877
3414
  return this.http.get(`/api/v2/search?${params.toString()}`);
@@ -2893,7 +3430,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
2893
3430
  * ```
2894
3431
  */
2895
3432
  async getTool(toolId, options) {
2896
- if (_optionalChain([options, 'optionalAccess', _188 => _188.cliInvocationId]) !== void 0) {
3433
+ if (_optionalChain([options, 'optionalAccess', _191 => _191.cliInvocationId]) !== void 0) {
2897
3434
  validateCliInvocationId(options.cliInvocationId);
2898
3435
  }
2899
3436
  return this.http.request(
@@ -2906,7 +3443,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
2906
3443
  retryApiErrors: true,
2907
3444
  headers: {
2908
3445
  "x-deepline-tool-meta-only": "1",
2909
- ..._optionalChain([options, 'optionalAccess', _189 => _189.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3446
+ ..._optionalChain([options, 'optionalAccess', _192 => _192.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
2910
3447
  }
2911
3448
  }
2912
3449
  );
@@ -3008,7 +3545,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3008
3545
  return this.http.post(
3009
3546
  "/api/v2/ingestion/repair",
3010
3547
  {
3011
- ..._optionalChain([input, 'optionalAccess', _190 => _190.provider]) ? { provider: input.provider } : {}
3548
+ ..._optionalChain([input, 'optionalAccess', _193 => _193.provider]) ? { provider: input.provider } : {}
3012
3549
  }
3013
3550
  );
3014
3551
  }
@@ -3078,7 +3615,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3078
3615
  method: "POST",
3079
3616
  body,
3080
3617
  headers: runtimeSelectionHeaders(resolved.runtime),
3081
- signal: _optionalChain([options, 'optionalAccess', _191 => _191.signal])
3618
+ signal: _optionalChain([options, 'optionalAccess', _194 => _194.signal])
3082
3619
  }
3083
3620
  )) {
3084
3621
  if (event.scope === "play") {
@@ -3238,7 +3775,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3238
3775
  compilerManifest,
3239
3776
  ...input.input ? { input: input.input } : {},
3240
3777
  ...input.inputFile ? { inputFile: input.inputFile } : {},
3241
- ..._optionalChain([input, 'access', _192 => _192.packagedFiles, 'optionalAccess', _193 => _193.length]) ? { packagedFiles: input.packagedFiles } : {},
3778
+ ..._optionalChain([input, 'access', _195 => _195.packagedFiles, 'optionalAccess', _196 => _196.length]) ? { packagedFiles: input.packagedFiles } : {},
3242
3779
  ...input.force ? { force: true } : {},
3243
3780
  ...input.forceToolRefresh ? { forceToolRefresh: true } : {}
3244
3781
  });
@@ -3268,29 +3805,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
3268
3805
  * ```
3269
3806
  */
3270
3807
  async submitPlay(code, csvPath, name, options) {
3271
- const runtimeInput = _optionalChain([options, 'optionalAccess', _194 => _194.input]) ? { ...options.input } : {};
3808
+ const runtimeInput = _optionalChain([options, 'optionalAccess', _197 => _197.input]) ? { ...options.input } : {};
3272
3809
  if (csvPath) {
3273
3810
  runtimeInput.file = csvPath;
3274
3811
  }
3275
- const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _195 => _195.sourceCode]), () => ( code));
3276
- const artifact = _optionalChain([options, 'optionalAccess', _196 => _196.artifact]);
3277
- if (!_optionalChain([name, 'optionalAccess', _197 => _197.trim, 'call', _198 => _198()])) {
3812
+ const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _198 => _198.sourceCode]), () => ( code));
3813
+ const artifact = _optionalChain([options, 'optionalAccess', _199 => _199.artifact]);
3814
+ if (!_optionalChain([name, 'optionalAccess', _200 => _200.trim, 'call', _201 => _201()])) {
3278
3815
  throw new Error("submitPlay requires a play name.");
3279
3816
  }
3280
3817
  if (!artifact) {
3281
3818
  throw new Error("submitPlay requires a bundled play artifact.");
3282
3819
  }
3283
- const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _199 => _199.compilerManifest]), async () => ( await this.compilePlayManifest({
3820
+ const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _202 => _202.compilerManifest]), async () => ( await this.compilePlayManifest({
3284
3821
  name,
3285
3822
  sourceCode,
3286
- sourceFiles: _optionalChain([options, 'optionalAccess', _200 => _200.sourceFiles]),
3823
+ sourceFiles: _optionalChain([options, 'optionalAccess', _203 => _203.sourceFiles]),
3287
3824
  artifact
3288
3825
  })));
3289
3826
  const registeredArtifact = await this.registerPlayArtifact({
3290
3827
  name,
3291
3828
  sourceCode,
3292
- sourceFiles: _optionalChain([options, 'optionalAccess', _201 => _201.sourceFiles]),
3293
- description: _optionalChain([options, 'optionalAccess', _202 => _202.description]),
3829
+ sourceFiles: _optionalChain([options, 'optionalAccess', _204 => _204.sourceFiles]),
3830
+ description: _optionalChain([options, 'optionalAccess', _205 => _205.description]),
3294
3831
  artifact,
3295
3832
  compilerManifest,
3296
3833
  publish: false
@@ -3304,17 +3841,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
3304
3841
  name,
3305
3842
  artifactStorageKey: registeredArtifact.artifactStorageKey,
3306
3843
  sourceCode,
3307
- description: _optionalChain([options, 'optionalAccess', _203 => _203.description]),
3844
+ description: _optionalChain([options, 'optionalAccess', _206 => _206.description]),
3308
3845
  staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
3309
3846
  artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
3310
3847
  graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
3311
3848
  runtimeArtifact: artifact,
3312
3849
  compilerManifest,
3313
3850
  ...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
3314
- ..._optionalChain([options, 'optionalAccess', _204 => _204.inputFile]) ? { inputFile: options.inputFile } : {},
3315
- ..._optionalChain([options, 'optionalAccess', _205 => _205.packagedFiles, 'optionalAccess', _206 => _206.length]) ? { packagedFiles: options.packagedFiles } : {},
3316
- ..._optionalChain([options, 'optionalAccess', _207 => _207.force]) ? { force: true } : {},
3317
- ..._optionalChain([options, 'optionalAccess', _208 => _208.forceToolRefresh]) ? { forceToolRefresh: true } : {}
3851
+ ..._optionalChain([options, 'optionalAccess', _207 => _207.inputFile]) ? { inputFile: options.inputFile } : {},
3852
+ ..._optionalChain([options, 'optionalAccess', _208 => _208.packagedFiles, 'optionalAccess', _209 => _209.length]) ? { packagedFiles: options.packagedFiles } : {},
3853
+ ..._optionalChain([options, 'optionalAccess', _210 => _210.force]) ? { force: true } : {},
3854
+ ..._optionalChain([options, 'optionalAccess', _211 => _211.forceToolRefresh]) ? { forceToolRefresh: true } : {}
3318
3855
  });
3319
3856
  }
3320
3857
  /**
@@ -3384,10 +3921,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
3384
3921
  */
3385
3922
  async getPlayStatus(workflowId, options) {
3386
3923
  const params = new URLSearchParams();
3387
- if (_optionalChain([options, 'optionalAccess', _209 => _209.billing]) === false) {
3924
+ if (_optionalChain([options, 'optionalAccess', _212 => _212.billing]) === false) {
3388
3925
  params.set("billing", "false");
3389
3926
  }
3390
- if (_optionalChain([options, 'optionalAccess', _210 => _210.full]) === true) {
3927
+ if (_optionalChain([options, 'optionalAccess', _213 => _213.full]) === true) {
3391
3928
  params.set("full", "true");
3392
3929
  }
3393
3930
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -3401,9 +3938,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
3401
3938
  for await (const event of watchRunEvents({
3402
3939
  http: this.http,
3403
3940
  runId: workflowId,
3404
- signal: _optionalChain([options, 'optionalAccess', _211 => _211.signal]),
3405
- onNotice: _optionalChain([options, 'optionalAccess', _212 => _212.onNotice]),
3406
- onRetry: _optionalChain([options, 'optionalAccess', _213 => _213.onRetry])
3941
+ signal: _optionalChain([options, 'optionalAccess', _214 => _214.signal]),
3942
+ onNotice: _optionalChain([options, 'optionalAccess', _215 => _215.onNotice]),
3943
+ onRetry: _optionalChain([options, 'optionalAccess', _216 => _216.onRetry])
3407
3944
  })) {
3408
3945
  yield event;
3409
3946
  }
@@ -3415,12 +3952,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
3415
3952
  * @deprecated Use `watchRunEvents` for ordinary run watching.
3416
3953
  */
3417
3954
  async *streamPlayRunEvents(workflowId, options) {
3418
- const headers = _optionalChain([options, 'optionalAccess', _214 => _214.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
3955
+ const headers = _optionalChain([options, 'optionalAccess', _217 => _217.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
3419
3956
  const params = new URLSearchParams();
3420
- params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _215 => _215.mode]), () => ( "cli")));
3957
+ params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _218 => _218.mode]), () => ( "cli")));
3421
3958
  for await (const event of this.http.streamSse(
3422
3959
  `/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
3423
- { signal: _optionalChain([options, 'optionalAccess', _216 => _216.signal]), headers }
3960
+ { signal: _optionalChain([options, 'optionalAccess', _219 => _219.signal]), headers }
3424
3961
  )) {
3425
3962
  if (event.scope === "play") {
3426
3963
  yield event;
@@ -3436,24 +3973,24 @@ var DeeplineClient = (_class = class _DeeplineClient {
3436
3973
  */
3437
3974
  async *observeRunEvents(runId, options) {
3438
3975
  yield* this.watchRunEvents(runId, {
3439
- signal: _optionalChain([options, 'optionalAccess', _217 => _217.signal]),
3440
- onNotice: _optionalChain([options, 'optionalAccess', _218 => _218.onNotice])
3976
+ signal: _optionalChain([options, 'optionalAccess', _220 => _220.signal]),
3977
+ onNotice: _optionalChain([options, 'optionalAccess', _221 => _221.onNotice])
3441
3978
  });
3442
3979
  }
3443
3980
  /** Poll snapshots to terminal status and return the durable package. */
3444
3981
  async watchRunToTerminal(runId, options) {
3445
3982
  let terminalObserved = false;
3446
3983
  for await (const event of this.watchRunEvents(runId, {
3447
- signal: _optionalChain([options, 'optionalAccess', _219 => _219.signal]),
3448
- onNotice: _optionalChain([options, 'optionalAccess', _220 => _220.onNotice]),
3449
- onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _221 => _221.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _222 => _222.onReconnect])))
3984
+ signal: _optionalChain([options, 'optionalAccess', _222 => _222.signal]),
3985
+ onNotice: _optionalChain([options, 'optionalAccess', _223 => _223.onNotice]),
3986
+ onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _224 => _224.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _225 => _225.onReconnect])))
3450
3987
  })) {
3451
- _optionalChain([options, 'optionalAccess', _223 => _223.onEvent, 'optionalCall', _224 => _224(event)]);
3988
+ _optionalChain([options, 'optionalAccess', _226 => _226.onEvent, 'optionalCall', _227 => _227(event)]);
3452
3989
  if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
3453
3990
  terminalObserved = true;
3454
3991
  }
3455
3992
  }
3456
- if (_optionalChain([options, 'optionalAccess', _225 => _225.signal, 'optionalAccess', _226 => _226.aborted])) {
3993
+ if (_optionalChain([options, 'optionalAccess', _228 => _228.signal, 'optionalAccess', _229 => _229.aborted])) {
3457
3994
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
3458
3995
  }
3459
3996
  const refreshed = await this.getRunStatus(runId);
@@ -3507,7 +4044,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3507
4044
  async stopPlay(workflowId, options) {
3508
4045
  return this.http.post(
3509
4046
  `/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
3510
- _optionalChain([options, 'optionalAccess', _227 => _227.reason]) ? { reason: options.reason } : {}
4047
+ _optionalChain([options, 'optionalAccess', _230 => _230.reason]) ? { reason: options.reason } : {}
3511
4048
  );
3512
4049
  }
3513
4050
  /**
@@ -3543,7 +4080,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3543
4080
  /** List the org's workflows. `GET /api/v2/workflows`. */
3544
4081
  async listWorkflows(options) {
3545
4082
  const params = new URLSearchParams();
3546
- if (typeof _optionalChain([options, 'optionalAccess', _228 => _228.limit]) === "number") {
4083
+ if (typeof _optionalChain([options, 'optionalAccess', _231 => _231.limit]) === "number") {
3547
4084
  params.set("limit", String(options.limit));
3548
4085
  }
3549
4086
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -3596,7 +4133,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3596
4133
  /** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
3597
4134
  async listWorkflowRuns(id, options) {
3598
4135
  const params = new URLSearchParams();
3599
- if (typeof _optionalChain([options, 'optionalAccess', _229 => _229.limit]) === "number") {
4136
+ if (typeof _optionalChain([options, 'optionalAccess', _232 => _232.limit]) === "number") {
3600
4137
  params.set("limit", String(options.limit));
3601
4138
  }
3602
4139
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -3632,10 +4169,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
3632
4169
  */
3633
4170
  async getRunStatus(runId, options) {
3634
4171
  const params = new URLSearchParams();
3635
- if (_optionalChain([options, 'optionalAccess', _230 => _230.full]) === true) {
4172
+ if (_optionalChain([options, 'optionalAccess', _233 => _233.full]) === true) {
3636
4173
  params.set("full", "true");
3637
4174
  }
3638
- if (_optionalChain([options, 'optionalAccess', _231 => _231.configuration]) === true) {
4175
+ if (_optionalChain([options, 'optionalAccess', _234 => _234.configuration]) === true) {
3639
4176
  params.set("include", "configuration");
3640
4177
  }
3641
4178
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -3643,7 +4180,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3643
4180
  `/api/v2/runs/${encodeURIComponent(runId)}${query}`,
3644
4181
  { headers: { "x-deepline-run-status": "1" } }
3645
4182
  );
3646
- if (_optionalChain([options, 'optionalAccess', _232 => _232.configuration]) === true && !Object.hasOwn(response, "contract")) {
4183
+ if (_optionalChain([options, 'optionalAccess', _235 => _235.configuration]) === true && !Object.hasOwn(response, "contract")) {
3647
4184
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
3648
4185
  "This server does not support recorded configuration reads.",
3649
4186
  void 0,
@@ -3651,7 +4188,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3651
4188
  );
3652
4189
  }
3653
4190
  const status = normalizePlayStatus(response);
3654
- if (_optionalChain([options, 'optionalAccess', _233 => _233.failedLogs]) !== true || status.status !== "failed") {
4191
+ if (_optionalChain([options, 'optionalAccess', _236 => _236.failedLogs]) !== true || status.status !== "failed") {
3655
4192
  return status;
3656
4193
  }
3657
4194
  const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
@@ -3740,7 +4277,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3740
4277
  /** The same tenant-scoped run history searched by the dashboard and CLI. */
3741
4278
  async getRunsHistory(options = {}) {
3742
4279
  const params = new URLSearchParams();
3743
- const search = _optionalChain([options, 'access', _234 => _234.search, 'optionalAccess', _235 => _235.trim, 'call', _236 => _236()]);
4280
+ const search = _optionalChain([options, 'access', _237 => _237.search, 'optionalAccess', _238 => _238.trim, 'call', _239 => _239()]);
3744
4281
  if (search && search.length > 200) {
3745
4282
  throw new Error("Run search must be at most 200 characters.");
3746
4283
  }
@@ -3766,12 +4303,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
3766
4303
  }
3767
4304
  /** Read one run page without discarding server pagination metadata. */
3768
4305
  async listRunsPage(options) {
3769
- const playName = _optionalChain([options, 'access', _237 => _237.play, 'optionalAccess', _238 => _238.trim, 'call', _239 => _239()]);
4306
+ const playName = _optionalChain([options, 'access', _240 => _240.play, 'optionalAccess', _241 => _241.trim, 'call', _242 => _242()]);
3770
4307
  const params = new URLSearchParams();
3771
4308
  if (playName) {
3772
4309
  params.set("play", playName);
3773
4310
  }
3774
- const status = _optionalChain([options, 'access', _240 => _240.status, 'optionalAccess', _241 => _241.trim, 'call', _242 => _242()]);
4311
+ const status = _optionalChain([options, 'access', _243 => _243.status, 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()]);
3775
4312
  if (status) {
3776
4313
  params.set("status", status);
3777
4314
  }
@@ -3839,8 +4376,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3839
4376
  * different key intentionally starts another rerun.
3840
4377
  */
3841
4378
  async rerun(runId, options) {
3842
- const idempotencyKey = _optionalChain([options, 'optionalAccess', _243 => _243.idempotencyKey, 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()]);
3843
- if (_optionalChain([options, 'optionalAccess', _246 => _246.idempotencyKey]) !== void 0 && !idempotencyKey) {
4379
+ const idempotencyKey = _optionalChain([options, 'optionalAccess', _246 => _246.idempotencyKey, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]);
4380
+ if (_optionalChain([options, 'optionalAccess', _249 => _249.idempotencyKey]) !== void 0 && !idempotencyKey) {
3844
4381
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
3845
4382
  "runs.rerun idempotencyKey must not be empty.",
3846
4383
  void 0,
@@ -3849,7 +4386,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3849
4386
  }
3850
4387
  return this.http.post(
3851
4388
  `/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
3852
- _optionalChain([options, 'optionalAccess', _247 => _247.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
4389
+ _optionalChain([options, 'optionalAccess', _250 => _250.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
3853
4390
  { "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
3854
4391
  );
3855
4392
  }
@@ -3863,21 +4400,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
3863
4400
  * ```
3864
4401
  */
3865
4402
  async getRunLogs(runId, options) {
3866
- if (_optionalChain([options, 'optionalAccess', _248 => _248.all]) === true && options.failed === true) {
4403
+ if (_optionalChain([options, 'optionalAccess', _251 => _251.all]) === true && options.failed === true) {
3867
4404
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
3868
4405
  "runs.logs cannot combine all and failed views.",
3869
4406
  void 0,
3870
4407
  "INVALID_RUN_LOG_VIEW"
3871
4408
  );
3872
4409
  }
3873
- if (_optionalChain([options, 'optionalAccess', _249 => _249.cursor]) !== void 0 && options.failed === true) {
4410
+ if (_optionalChain([options, 'optionalAccess', _252 => _252.cursor]) !== void 0 && options.failed === true) {
3874
4411
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
3875
4412
  "runs.logs cannot combine failed with cursor.",
3876
4413
  void 0,
3877
4414
  "INVALID_RUN_LOG_VIEW"
3878
4415
  );
3879
4416
  }
3880
- if (_optionalChain([options, 'optionalAccess', _250 => _250.failed]) === true) {
4417
+ if (_optionalChain([options, 'optionalAccess', _253 => _253.failed]) === true) {
3881
4418
  const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
3882
4419
  const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
3883
4420
  const page = await this.http.get(
@@ -3902,18 +4439,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
3902
4439
  ...page.logsTruncated ? { logsTruncated: true } : {}
3903
4440
  };
3904
4441
  }
3905
- const beforeSequence = _optionalChain([options, 'optionalAccess', _251 => _251.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
3906
- const limit = _optionalChain([options, 'optionalAccess', _252 => _252.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _253 => _253.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
4442
+ const beforeSequence = _optionalChain([options, 'optionalAccess', _254 => _254.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
4443
+ const limit = _optionalChain([options, 'optionalAccess', _255 => _255.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _256 => _256.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
3907
4444
  const fetchPage = (afterSeq2, pageLimit) => this.http.get(
3908
4445
  `/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
3909
4446
  { retryApiErrors: true }
3910
4447
  );
3911
4448
  const probe = await fetchPage(0, 1);
3912
4449
  const lastStoredSeq = probe.lastStoredSeq;
3913
- const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _254 => _254.entries, 'access', _255 => _255[0], 'optionalAccess', _256 => _256.seq]), () => ( null));
4450
+ const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _257 => _257.entries, 'access', _258 => _258[0], 'optionalAccess', _259 => _259.seq]), () => ( null));
3914
4451
  const upperSeq = beforeSequence === null ? Number.POSITIVE_INFINITY : Math.min(beforeSequence - 1, lastStoredSeq);
3915
4452
  const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
3916
- let afterSeq = _optionalChain([options, 'optionalAccess', _257 => _257.all]) ? 0 : Math.max(0, windowEndSeq - limit);
4453
+ let afterSeq = _optionalChain([options, 'optionalAccess', _260 => _260.all]) ? 0 : Math.max(0, windowEndSeq - limit);
3917
4454
  const entries = [];
3918
4455
  while (entries.length < limit && afterSeq < upperSeq) {
3919
4456
  const page = await fetchPage(
@@ -3947,10 +4484,119 @@ var DeeplineClient = (_class = class _DeeplineClient {
3947
4484
  hasMore: olderLinesExist,
3948
4485
  nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
3949
4486
  entries: entries.map((entry) => entry.line),
3950
- view: _optionalChain([options, 'optionalAccess', _258 => _258.all]) ? "all" : "tail",
4487
+ view: _optionalChain([options, 'optionalAccess', _261 => _261.all]) ? "all" : "tail",
3951
4488
  ...probe.logsTruncated ? { logsTruncated: true } : {}
3952
4489
  };
3953
4490
  }
4491
+ /** Query one page of this run's retained logs. `where` accepts typed objects or the shared filter language. */
4492
+ async queryRunLogs(runId, options = {}) {
4493
+ this.assertRunLogQueryRunId(runId, options);
4494
+ const { runtime, ...query } = options;
4495
+ return this.postRunEventQuery(
4496
+ { ...query, operation: "list", resource: "logs", runId },
4497
+ runtime
4498
+ );
4499
+ }
4500
+ /** Count matching retained logs exactly, without fetching list pages or saved results. */
4501
+ async countRunLogs(runId, criteria = {}) {
4502
+ this.assertRunLogQueryRunId(runId, criteria);
4503
+ const { runtime, ...query } = criteria;
4504
+ return this.postRunEventQuery(
4505
+ { ...query, operation: "count", resource: "logs", runId },
4506
+ runtime
4507
+ );
4508
+ }
4509
+ /** Summarize retained logs with explicit group pagination and count or numeric sums. */
4510
+ async summarizeRunLogs(runId, options) {
4511
+ this.assertRunLogQueryRunId(runId, options);
4512
+ const { runtime, ...query } = options;
4513
+ return this.postRunEventQuery(
4514
+ { ...query, operation: "summarize", resource: "logs", runId },
4515
+ runtime
4516
+ );
4517
+ }
4518
+ /** Query one page of retained lifecycle, log and receipt events in the active organization. */
4519
+ async listRunEvents(options = {}) {
4520
+ const { runtime, ...query } = options;
4521
+ return this.postRunEventQuery(
4522
+ { ...query, operation: "list", resource: "events" },
4523
+ runtime
4524
+ );
4525
+ }
4526
+ /** Count matching retained events exactly in one server query. */
4527
+ async countRunEvents(criteria = {}) {
4528
+ const { runtime, ...query } = criteria;
4529
+ return this.postRunEventQuery(
4530
+ { ...query, operation: "count", resource: "events" },
4531
+ runtime
4532
+ );
4533
+ }
4534
+ /**
4535
+ * Group retained events with exact counts, numeric sums and continuation.
4536
+ * Fractional sums use JavaScript number precision.
4537
+ */
4538
+ async summarizeRunEvents(options) {
4539
+ const { runtime, ...query } = options;
4540
+ return this.postRunEventQuery(
4541
+ { ...query, operation: "summarize", resource: "events" },
4542
+ runtime
4543
+ );
4544
+ }
4545
+ /** Discover query fields and their recorded types; custom scalar fields use `context.<key>`. */
4546
+ async getRunEventFields(resource = "events", options = {}) {
4547
+ const { runtime, ...query } = options;
4548
+ return this.postRunEventQuery(
4549
+ { ...query, operation: "fields", resource },
4550
+ runtime
4551
+ );
4552
+ }
4553
+ async postRunEventQuery(input, selection) {
4554
+ const request = normalizeRunEventOperationRequest(input);
4555
+ const params = new URLSearchParams();
4556
+ let headers;
4557
+ let selectedRuntime;
4558
+ if (selection !== void 0) {
4559
+ const runtime = normalizePlayRuntimeSelection(selection);
4560
+ if (!runtime) {
4561
+ throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4562
+ "Run event queries require a valid Preview runtime selection.",
4563
+ void 0,
4564
+ "INVALID_RUNTIME_SELECTION"
4565
+ );
4566
+ }
4567
+ params.set("runtime", "preview");
4568
+ params.set("namespace", runtime.namespace);
4569
+ if (runtime.backend) params.set("backend", runtime.backend);
4570
+ headers = runtimeSelectionHeaders(runtime);
4571
+ selectedRuntime = runtime;
4572
+ } else {
4573
+ headers = isolatedCiRuntimeEventReadHeaders();
4574
+ }
4575
+ const suffix = params.size > 0 ? `?${params.toString()}` : "";
4576
+ const result = await this.http.post(
4577
+ `/api/v2/runs/events${suffix}`,
4578
+ request,
4579
+ headers,
4580
+ { retryApiErrors: true }
4581
+ );
4582
+ if (selectedRuntime && result && typeof result === "object" && "query" in result) {
4583
+ return {
4584
+ ...result,
4585
+ query: {
4586
+ ...result.query,
4587
+ runtime: selectedRuntime
4588
+ }
4589
+ };
4590
+ }
4591
+ return result;
4592
+ }
4593
+ assertRunLogQueryRunId(runId, criteria) {
4594
+ if (criteria && typeof criteria === "object" && "runId" in criteria && criteria.runId !== void 0 && criteria.runId !== runId) {
4595
+ throw new RunEventQueryInputError(
4596
+ "Log criteria runId conflicts with the positional run ID. Pass the run ID only as the first argument."
4597
+ );
4598
+ }
4599
+ }
3954
4600
  /** Read structured history across the active organization without requiring a run ID. Defaults to the last hour, newest first; use the returned cursor and exact time bounds to continue. See [run logs and events](run-events.md) for all kinds, indexed fields, payloads and SDK/API response types. */
3955
4601
  async searchRunEvents(options = {}) {
3956
4602
  const now = Date.now();
@@ -3999,7 +4645,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3999
4645
  limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
4000
4646
  offset: String(_nullishCoalesce(input.offset, () => ( 0)))
4001
4647
  });
4002
- if (_optionalChain([input, 'access', _259 => _259.runId, 'optionalAccess', _260 => _260.trim, 'call', _261 => _261()])) {
4648
+ if (_optionalChain([input, 'access', _262 => _262.runId, 'optionalAccess', _263 => _263.trim, 'call', _264 => _264()])) {
4003
4649
  params.set("runId", input.runId.trim());
4004
4650
  }
4005
4651
  if (input.rowMode === "all" || input.rowMode === "live") {
@@ -4009,9 +4655,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4009
4655
  `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
4010
4656
  { signal: input.signal }
4011
4657
  );
4012
- const requestedRunId = _optionalChain([input, 'access', _262 => _262.runId, 'optionalAccess', _263 => _263.trim, 'call', _264 => _264()]) || "";
4658
+ const requestedRunId = _optionalChain([input, 'access', _265 => _265.runId, 'optionalAccess', _266 => _266.trim, 'call', _267 => _267()]) || "";
4013
4659
  if (requestedRunId) {
4014
- const confirmedRunId = _optionalChain([result, 'access', _265 => _265.scope, 'optionalAccess', _266 => _266.kind]) === "run" ? result.scope.runId.trim() : "";
4660
+ const confirmedRunId = _optionalChain([result, 'access', _268 => _268.scope, 'optionalAccess', _269 => _269.kind]) === "run" ? result.scope.runId.trim() : "";
4015
4661
  const foreignRowRunIds = [
4016
4662
  ...new Set(
4017
4663
  result.rows.map(
@@ -4019,7 +4665,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4019
4665
  ).filter((runId) => runId && runId !== requestedRunId)
4020
4666
  )
4021
4667
  ];
4022
- if (_optionalChain([result, 'access', _267 => _267.scope, 'optionalAccess', _268 => _268.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
4668
+ if (_optionalChain([result, 'access', _270 => _270.scope, 'optionalAccess', _271 => _271.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
4023
4669
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4024
4670
  `Run-scoped dataset export was not confirmed for ${requestedRunId}; no rows were returned to the caller. Update Deepline, then retry the same export command. Do not rerun the play.`,
4025
4671
  void 0,
@@ -4048,7 +4694,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4048
4694
  async stopRun(runId, options) {
4049
4695
  return this.http.post(
4050
4696
  `/api/v2/runs/${encodeURIComponent(runId)}/stop`,
4051
- _optionalChain([options, 'optionalAccess', _269 => _269.reason]) ? { reason: options.reason } : {}
4697
+ _optionalChain([options, 'optionalAccess', _272 => _272.reason]) ? { reason: options.reason } : {}
4052
4698
  );
4053
4699
  }
4054
4700
  /**
@@ -4066,11 +4712,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
4066
4712
  * need to clear the workspace run-slot state without knowing each run id.
4067
4713
  */
4068
4714
  async stopAllRuns(options) {
4069
- const dryRun = _optionalChain([options, 'optionalAccess', _270 => _270.dryRun]) === true;
4715
+ const dryRun = _optionalChain([options, 'optionalAccess', _273 => _273.dryRun]) === true;
4070
4716
  const result = await this.http.post(
4071
4717
  "/api/v2/runs/stop-all",
4072
4718
  {
4073
- ..._optionalChain([options, 'optionalAccess', _271 => _271.reason]) ? { reason: options.reason } : {},
4719
+ ..._optionalChain([options, 'optionalAccess', _274 => _274.reason]) ? { reason: options.reason } : {},
4074
4720
  ...dryRun ? { dryRun: true } : {}
4075
4721
  }
4076
4722
  );
@@ -4091,7 +4737,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4091
4737
  * `origin: "owned"` for org-owned plays.
4092
4738
  */
4093
4739
  async listPlays(options) {
4094
- if (!_optionalChain([options, 'optionalAccess', _272 => _272.grep, 'optionalAccess', _273 => _273.trim, 'call', _274 => _274()])) {
4740
+ if (!_optionalChain([options, 'optionalAccess', _275 => _275.grep, 'optionalAccess', _276 => _276.trim, 'call', _277 => _277()])) {
4095
4741
  return (await this.requestPlaysPage(options, false)).plays;
4096
4742
  }
4097
4743
  const plays = [];
@@ -4113,45 +4759,45 @@ var DeeplineClient = (_class = class _DeeplineClient {
4113
4759
  }
4114
4760
  async requestPlaysPage(options, paginateInventory = true) {
4115
4761
  const params = new URLSearchParams();
4116
- if (paginateInventory && !_optionalChain([options, 'optionalAccess', _275 => _275.grep, 'optionalAccess', _276 => _276.trim, 'call', _277 => _277()]))
4762
+ if (paginateInventory && !_optionalChain([options, 'optionalAccess', _278 => _278.grep, 'optionalAccess', _279 => _279.trim, 'call', _280 => _280()]))
4117
4763
  params.set("inventory_paginated", "1");
4118
- if (_optionalChain([options, 'optionalAccess', _278 => _278.origin])) params.set("origin", options.origin);
4119
- if (_optionalChain([options, 'optionalAccess', _279 => _279.categories])) {
4764
+ if (_optionalChain([options, 'optionalAccess', _281 => _281.origin])) params.set("origin", options.origin);
4765
+ if (_optionalChain([options, 'optionalAccess', _282 => _282.categories])) {
4120
4766
  params.set(
4121
4767
  "categories",
4122
4768
  Array.isArray(options.categories) ? options.categories.join(",") : options.categories
4123
4769
  );
4124
4770
  }
4125
- if (_optionalChain([options, 'optionalAccess', _280 => _280.categories]) || _optionalChain([options, 'optionalAccess', _281 => _281.includeToolCategories])) {
4771
+ if (_optionalChain([options, 'optionalAccess', _283 => _283.categories]) || _optionalChain([options, 'optionalAccess', _284 => _284.includeToolCategories])) {
4126
4772
  params.set("include_tool_categories", "1");
4127
4773
  }
4128
- if (_optionalChain([options, 'optionalAccess', _282 => _282.tags])) {
4774
+ if (_optionalChain([options, 'optionalAccess', _285 => _285.tags])) {
4129
4775
  params.set(
4130
4776
  "tags",
4131
4777
  Array.isArray(options.tags) ? options.tags.join(",") : options.tags
4132
4778
  );
4133
4779
  }
4134
- if (_optionalChain([options, 'optionalAccess', _283 => _283.includeArchived])) params.set("include_archived", "1");
4135
- if (_optionalChain([options, 'optionalAccess', _284 => _284.includeCostEstimates])) {
4780
+ if (_optionalChain([options, 'optionalAccess', _286 => _286.includeArchived])) params.set("include_archived", "1");
4781
+ if (_optionalChain([options, 'optionalAccess', _287 => _287.includeCostEstimates])) {
4136
4782
  params.set("include_cost_estimates", "1");
4137
4783
  }
4138
- if (_optionalChain([options, 'optionalAccess', _285 => _285.grep, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()])) {
4784
+ if (_optionalChain([options, 'optionalAccess', _288 => _288.grep, 'optionalAccess', _289 => _289.trim, 'call', _290 => _290()])) {
4139
4785
  params.set("grep", options.grep.trim());
4140
4786
  params.set("limit", "60");
4141
4787
  }
4142
- if (_optionalChain([options, 'optionalAccess', _288 => _288.limit]) !== void 0) {
4788
+ if (_optionalChain([options, 'optionalAccess', _291 => _291.limit]) !== void 0) {
4143
4789
  if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
4144
4790
  throw new Error("Play page limit must be a positive integer");
4145
4791
  }
4146
4792
  params.set("limit", String(options.limit));
4147
4793
  }
4148
- if (_optionalChain([options, 'optionalAccess', _289 => _289.cursor])) params.set("cursor", options.cursor);
4794
+ if (_optionalChain([options, 'optionalAccess', _292 => _292.cursor])) params.set("cursor", options.cursor);
4149
4795
  const suffix = params.size ? `?${params.toString()}` : "";
4150
4796
  const response = await this.http.get(`/api/v2/plays${suffix}`);
4151
4797
  return {
4152
4798
  plays: _nullishCoalesce(response.plays, () => ( [])),
4153
- cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _290 => _290.pagination, 'optionalAccess', _291 => _291.cursor]), () => ( response.cursor)), () => ( null)),
4154
- hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _292 => _292.pagination, 'optionalAccess', _293 => _293.hasMore]), () => ( response.hasMore)))
4799
+ cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _293 => _293.pagination, 'optionalAccess', _294 => _294.cursor]), () => ( response.cursor)), () => ( null)),
4800
+ hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _295 => _295.pagination, 'optionalAccess', _296 => _296.hasMore]), () => ( response.hasMore)))
4155
4801
  };
4156
4802
  }
4157
4803
  /** Read definition-level settings, independently of code revisions. */
@@ -4201,8 +4847,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4201
4847
  return this.http.post("/api/v2/integrations/connect", {
4202
4848
  provider: "slack",
4203
4849
  scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
4204
- ..._optionalChain([options, 'optionalAccess', _294 => _294.successUrl]) ? { success_url: options.successUrl } : {},
4205
- ..._optionalChain([options, 'optionalAccess', _295 => _295.failureUrl]) ? { failure_url: options.failureUrl } : {}
4850
+ ..._optionalChain([options, 'optionalAccess', _297 => _297.successUrl]) ? { success_url: options.successUrl } : {},
4851
+ ..._optionalChain([options, 'optionalAccess', _298 => _298.failureUrl]) ? { failure_url: options.failureUrl } : {}
4206
4852
  });
4207
4853
  }
4208
4854
  /** List Slack channels visible to the connected Deepline Slack app. */
@@ -4277,7 +4923,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4277
4923
  }
4278
4924
  const targets = input.targets.map(parseNotificationGroupTarget);
4279
4925
  const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
4280
- const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _296 => _296[0], 'optionalAccess', _297 => _297.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
4926
+ const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _299 => _299[0], 'optionalAccess', _300 => _300.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
4281
4927
  if (legacyEvents.length > 0 && !legacyTarget) {
4282
4928
  throw new Error(
4283
4929
  "--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
@@ -4313,7 +4959,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4313
4959
  const existingGroup = current.configuration.groups.find(
4314
4960
  (candidate) => candidate.name.toLowerCase() === name.toLowerCase()
4315
4961
  );
4316
- const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _298 => _298.groupKey]), () => ( notificationObjectKey("group")));
4962
+ const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _301 => _301.groupKey]), () => ( notificationObjectKey("group")));
4317
4963
  const group = _nullishCoalesce(existingGroup, () => ( {
4318
4964
  groupKey,
4319
4965
  name,
@@ -4531,13 +5177,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
4531
5177
  */
4532
5178
  async getPlay(name, options) {
4533
5179
  const encodedName = encodeURIComponent(name);
4534
- const query = _optionalChain([options, 'optionalAccess', _299 => _299.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _300 => _300.guidance]) ? "?include=guidance" : "";
5180
+ const query = _optionalChain([options, 'optionalAccess', _302 => _302.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _303 => _303.guidance]) ? "?include=guidance" : "";
4535
5181
  return this.http.get(`/api/v2/plays/${encodedName}${query}`);
4536
5182
  }
4537
5183
  /** Read one trigger inventory page without loading run histories. */
4538
5184
  async listPlayTriggerInventory(options) {
4539
5185
  const params = new URLSearchParams({ view: "inventory" });
4540
- if (_optionalChain([options, 'optionalAccess', _301 => _301.cursor])) params.set("cursor", options.cursor);
5186
+ if (_optionalChain([options, 'optionalAccess', _304 => _304.cursor])) params.set("cursor", options.cursor);
4541
5187
  return this.http.get(`/api/v2/plays/triggers?${params}`);
4542
5188
  }
4543
5189
  /** Read one trigger's recent runs, with an explicit partial-history flag. */
@@ -4546,7 +5192,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4546
5192
  view: "history",
4547
5193
  binding_id: bindingId
4548
5194
  });
4549
- if (_optionalChain([options, 'optionalAccess', _302 => _302.limit]) !== void 0)
5195
+ if (_optionalChain([options, 'optionalAccess', _305 => _305.limit]) !== void 0)
4550
5196
  params.set("history_limit", String(options.limit));
4551
5197
  return this.http.get(`/api/v2/plays/triggers?${params}`);
4552
5198
  }
@@ -4582,7 +5228,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4582
5228
  */
4583
5229
  async listPlayVersions(name, options) {
4584
5230
  const encodedName = encodeURIComponent(name);
4585
- const suffix = _optionalChain([options, 'optionalAccess', _303 => _303.full]) ? "?full=true" : "";
5231
+ const suffix = _optionalChain([options, 'optionalAccess', _306 => _306.full]) ? "?full=true" : "";
4586
5232
  const response = await this.http.get(
4587
5233
  `/api/v2/plays/${encodedName}/versions${suffix}`
4588
5234
  );
@@ -4735,14 +5381,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
4735
5381
  */
4736
5382
  async runPlay(code, csvPath, name, options) {
4737
5383
  const { workflowId } = await this.submitPlay(code, csvPath, name, {
4738
- input: _optionalChain([options, 'optionalAccess', _304 => _304.input]),
4739
- sourceCode: _optionalChain([options, 'optionalAccess', _305 => _305.sourceCode]),
4740
- artifact: _optionalChain([options, 'optionalAccess', _306 => _306.artifact]),
4741
- compilerManifest: _optionalChain([options, 'optionalAccess', _307 => _307.compilerManifest]),
4742
- inputFile: _optionalChain([options, 'optionalAccess', _308 => _308.inputFile]),
4743
- packagedFiles: _optionalChain([options, 'optionalAccess', _309 => _309.packagedFiles]),
4744
- force: _optionalChain([options, 'optionalAccess', _310 => _310.force]),
4745
- forceToolRefresh: _optionalChain([options, 'optionalAccess', _311 => _311.forceToolRefresh])
5384
+ input: _optionalChain([options, 'optionalAccess', _307 => _307.input]),
5385
+ sourceCode: _optionalChain([options, 'optionalAccess', _308 => _308.sourceCode]),
5386
+ artifact: _optionalChain([options, 'optionalAccess', _309 => _309.artifact]),
5387
+ compilerManifest: _optionalChain([options, 'optionalAccess', _310 => _310.compilerManifest]),
5388
+ inputFile: _optionalChain([options, 'optionalAccess', _311 => _311.inputFile]),
5389
+ packagedFiles: _optionalChain([options, 'optionalAccess', _312 => _312.packagedFiles]),
5390
+ force: _optionalChain([options, 'optionalAccess', _313 => _313.force]),
5391
+ forceToolRefresh: _optionalChain([options, 'optionalAccess', _314 => _314.forceToolRefresh])
4746
5392
  });
4747
5393
  const start = Date.now();
4748
5394
  const state = {
@@ -4753,7 +5399,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4753
5399
  latest: null
4754
5400
  };
4755
5401
  let terminalObserved = null;
4756
- if (_optionalChain([options, 'optionalAccess', _312 => _312.signal, 'optionalAccess', _313 => _313.aborted])) {
5402
+ if (_optionalChain([options, 'optionalAccess', _315 => _315.signal, 'optionalAccess', _316 => _316.aborted])) {
4757
5403
  await this.cancelPlay(workflowId);
4758
5404
  return {
4759
5405
  success: false,
@@ -4764,9 +5410,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4764
5410
  };
4765
5411
  }
4766
5412
  for await (const event of this.watchRunEvents(workflowId, {
4767
- signal: _optionalChain([options, 'optionalAccess', _314 => _314.signal])
5413
+ signal: _optionalChain([options, 'optionalAccess', _317 => _317.signal])
4768
5414
  })) {
4769
- if (_optionalChain([options, 'optionalAccess', _315 => _315.signal, 'optionalAccess', _316 => _316.aborted])) {
5415
+ if (_optionalChain([options, 'optionalAccess', _318 => _318.signal, 'optionalAccess', _319 => _319.aborted])) {
4770
5416
  await this.cancelPlay(workflowId);
4771
5417
  return {
4772
5418
  success: false,
@@ -4776,19 +5422,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
4776
5422
  error: "Cancelled by user"
4777
5423
  };
4778
5424
  }
4779
- const previousStatus = _optionalChain([state, 'access', _317 => _317.latest, 'optionalAccess', _318 => _318.status]);
5425
+ const previousStatus = _optionalChain([state, 'access', _320 => _320.latest, 'optionalAccess', _321 => _321.status]);
4780
5426
  const status = updatePlayLiveStatusState(state, event);
4781
5427
  if (!status) {
4782
5428
  continue;
4783
5429
  }
4784
5430
  if (event.type !== "play.run.status" || status.status !== previousStatus) {
4785
- _optionalChain([options, 'optionalAccess', _319 => _319.onProgress, 'optionalCall', _320 => _320(status)]);
5431
+ _optionalChain([options, 'optionalAccess', _322 => _322.onProgress, 'optionalCall', _323 => _323(status)]);
4786
5432
  }
4787
5433
  if (_chunkLA46MMTLjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
4788
5434
  terminalObserved = status;
4789
5435
  }
4790
5436
  }
4791
- if (_optionalChain([options, 'optionalAccess', _321 => _321.signal, 'optionalAccess', _322 => _322.aborted])) {
5437
+ if (_optionalChain([options, 'optionalAccess', _324 => _324.signal, 'optionalAccess', _325 => _325.aborted])) {
4792
5438
  await this.cancelPlay(workflowId);
4793
5439
  return {
4794
5440
  success: false,
@@ -4841,7 +5487,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4841
5487
  const response = await this.http.get(
4842
5488
  `/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
4843
5489
  );
4844
- const event = _optionalChain([response, 'access', _323 => _323.entries, 'optionalAccess', _324 => _324[0]]);
5490
+ const event = _optionalChain([response, 'access', _326 => _326.entries, 'optionalAccess', _327 => _327[0]]);
4845
5491
  if (!event) {
4846
5492
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
4847
5493
  "No usage event was found for this request_id.",
@@ -4967,7 +5613,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4967
5613
  async cancelBillingSubscription(options) {
4968
5614
  return this.http.post(
4969
5615
  "/api/v2/billing/subscription/cancel",
4970
- { action: _optionalChain([options, 'optionalAccess', _325 => _325.undo]) ? "undo_cancel" : "cancel" }
5616
+ { action: _optionalChain([options, 'optionalAccess', _328 => _328.undo]) ? "undo_cancel" : "cancel" }
4971
5617
  );
4972
5618
  }
4973
5619
  /**
@@ -4979,7 +5625,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4979
5625
  */
4980
5626
  async listBillingInvoices(options) {
4981
5627
  const params = new URLSearchParams();
4982
- if (_optionalChain([options, 'optionalAccess', _326 => _326.limit]) !== void 0) {
5628
+ if (_optionalChain([options, 'optionalAccess', _329 => _329.limit]) !== void 0) {
4983
5629
  params.set("limit", String(options.limit));
4984
5630
  }
4985
5631
  const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
@@ -5089,7 +5735,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5089
5735
  /** Create a Stripe-hosted portal session for payment recovery and invoices. */
5090
5736
  async createTargetBillingPortalSession(options) {
5091
5737
  const response = await this.http.post(
5092
- _optionalChain([options, 'optionalAccess', _327 => _327.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
5738
+ _optionalChain([options, 'optionalAccess', _330 => _330.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
5093
5739
  {}
5094
5740
  );
5095
5741
  return response.data;
@@ -5139,8 +5785,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5139
5785
  return this.http.request("/api/v2/monitors/audit", {
5140
5786
  method: "POST",
5141
5787
  body: {
5142
- ..._optionalChain([options, 'optionalAccess', _328 => _328.fleetId]) ? { fleet_id: options.fleetId } : {},
5143
- ..._optionalChain([options, 'optionalAccess', _329 => _329.cursor]) ? { cursor: options.cursor } : {}
5788
+ ..._optionalChain([options, 'optionalAccess', _331 => _331.fleetId]) ? { fleet_id: options.fleetId } : {},
5789
+ ..._optionalChain([options, 'optionalAccess', _332 => _332.cursor]) ? { cursor: options.cursor } : {}
5144
5790
  },
5145
5791
  maxRetries: 0
5146
5792
  });
@@ -5150,8 +5796,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5150
5796
  return this.http.request("/api/v2/monitors/repair", {
5151
5797
  method: "POST",
5152
5798
  body: {
5153
- ..._optionalChain([options, 'optionalAccess', _330 => _330.fleetId]) ? { fleet_id: options.fleetId } : {},
5154
- ..._optionalChain([options, 'optionalAccess', _331 => _331.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
5799
+ ..._optionalChain([options, 'optionalAccess', _333 => _333.fleetId]) ? { fleet_id: options.fleetId } : {},
5800
+ ..._optionalChain([options, 'optionalAccess', _334 => _334.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
5155
5801
  },
5156
5802
  maxRetries: 0
5157
5803
  });
@@ -5159,7 +5805,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5159
5805
  /** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
5160
5806
  async readMonitorsHealth(options) {
5161
5807
  const params = new URLSearchParams();
5162
- if (_optionalChain([options, 'optionalAccess', _332 => _332.fleetId])) params.set("fleet_id", options.fleetId);
5808
+ if (_optionalChain([options, 'optionalAccess', _335 => _335.fleetId])) params.set("fleet_id", options.fleetId);
5163
5809
  const query = params.toString();
5164
5810
  const suffix = query ? `?${query}` : "";
5165
5811
  return this.http.request(
@@ -5232,7 +5878,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5232
5878
  );
5233
5879
  }
5234
5880
  const params = new URLSearchParams();
5235
- if (_optionalChain([options, 'optionalAccess', _333 => _333.cursor])) params.set("cursor", options.cursor);
5881
+ if (_optionalChain([options, 'optionalAccess', _336 => _336.cursor])) params.set("cursor", options.cursor);
5236
5882
  const suffix = params.size > 0 ? `?${params}` : "";
5237
5883
  return this.http.request(
5238
5884
  `/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
@@ -5276,7 +5922,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5276
5922
  * `client.monitors.deploy(...)`.
5277
5923
  */
5278
5924
  async deployMonitor(definition, options) {
5279
- if (_optionalChain([options, 'optionalAccess', _334 => _334.dryRun])) {
5925
+ if (_optionalChain([options, 'optionalAccess', _337 => _337.dryRun])) {
5280
5926
  return this.http.request("/api/v2/monitors/check", {
5281
5927
  method: "POST",
5282
5928
  body: definition
@@ -5312,12 +5958,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
5312
5958
  /** List deployed monitors. Prefer `client.monitors.list(...)`. */
5313
5959
  async listMonitors(options) {
5314
5960
  const params = new URLSearchParams();
5315
- if (_optionalChain([options, 'optionalAccess', _335 => _335.state])) params.set("state", options.state);
5316
- else if (_optionalChain([options, 'optionalAccess', _336 => _336.status])) params.set("status", options.status);
5317
- if (_optionalChain([options, 'optionalAccess', _337 => _337.limit]) !== void 0)
5961
+ if (_optionalChain([options, 'optionalAccess', _338 => _338.state])) params.set("state", options.state);
5962
+ else if (_optionalChain([options, 'optionalAccess', _339 => _339.status])) params.set("status", options.status);
5963
+ if (_optionalChain([options, 'optionalAccess', _340 => _340.limit]) !== void 0)
5318
5964
  params.set("limit", String(options.limit));
5319
- if (_optionalChain([options, 'optionalAccess', _338 => _338.cursor])) params.set("cursor", options.cursor);
5320
- if (_optionalChain([options, 'optionalAccess', _339 => _339.includeConsumers])) params.set("include_consumers", "true");
5965
+ if (_optionalChain([options, 'optionalAccess', _341 => _341.cursor])) params.set("cursor", options.cursor);
5966
+ if (_optionalChain([options, 'optionalAccess', _342 => _342.includeConsumers])) params.set("include_consumers", "true");
5321
5967
  const query = params.toString();
5322
5968
  const suffix = query ? `?${query}` : "";
5323
5969
  return this.http.request(
@@ -5333,7 +5979,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5333
5979
  );
5334
5980
  }
5335
5981
  async testMonitorWebhook(key, payload, options) {
5336
- if (_optionalChain([options, 'optionalAccess', _340 => _340.dispatch]) === true || _optionalChain([options, 'optionalAccess', _341 => _341.validationOnly]) === false) {
5982
+ if (_optionalChain([options, 'optionalAccess', _343 => _343.dispatch]) === true || _optionalChain([options, 'optionalAccess', _344 => _344.validationOnly]) === false) {
5337
5983
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
5338
5984
  "Monitor tests are validation-only and cannot dispatch events.",
5339
5985
  void 0,
@@ -5388,7 +6034,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5388
6034
  }
5389
6035
  /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
5390
6036
  async deleteMonitor(key, options) {
5391
- if (_optionalChain([options, 'optionalAccess', _342 => _342.localOnly]) === true) {
6037
+ if (_optionalChain([options, 'optionalAccess', _345 => _345.localOnly]) === true) {
5392
6038
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
5393
6039
  "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
5394
6040
  void 0,
@@ -5396,11 +6042,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
5396
6042
  );
5397
6043
  }
5398
6044
  const params = new URLSearchParams();
5399
- if (_optionalChain([options, 'optionalAccess', _343 => _343.dryRun])) params.set("dry_run", "true");
6045
+ if (_optionalChain([options, 'optionalAccess', _346 => _346.dryRun])) params.set("dry_run", "true");
5400
6046
  const query = params.toString();
5401
6047
  return this.http.request(
5402
6048
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
5403
- _optionalChain([options, 'optionalAccess', _344 => _344.dryRun]) ? { method: "DELETE" } : {
6049
+ _optionalChain([options, 'optionalAccess', _347 => _347.dryRun]) ? { method: "DELETE" } : {
5404
6050
  method: "DELETE",
5405
6051
  // Deletion is a provider lifecycle operation. A timeout is an
5406
6052
  // unknown outcome, not authority to begin another delete attempt.
@@ -5413,10 +6059,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
5413
6059
  * Prefer `client.monitors.reactivate(...)`.
5414
6060
  */
5415
6061
  async reactivateMonitor(key, options) {
5416
- const query = _optionalChain([options, 'optionalAccess', _345 => _345.dryRun]) ? "?dry_run=true" : "";
6062
+ const query = _optionalChain([options, 'optionalAccess', _348 => _348.dryRun]) ? "?dry_run=true" : "";
5417
6063
  return this.http.request(
5418
6064
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
5419
- _optionalChain([options, 'optionalAccess', _346 => _346.dryRun]) ? { method: "POST", body: {} } : {
6065
+ _optionalChain([options, 'optionalAccess', _349 => _349.dryRun]) ? { method: "POST", body: {} } : {
5420
6066
  method: "POST",
5421
6067
  body: {},
5422
6068
  // Reactivation can create an upstream resource, so it must not use
@@ -5430,7 +6076,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5430
6076
  // ——————————————————————————————————————————————————————————
5431
6077
  static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
5432
6078
  monitorJobIdempotencyKey(operation) {
5433
- const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _347 => _347.crypto, 'optionalAccess', _348 => _348.randomUUID, 'optionalCall', _349 => _349()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6079
+ const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _350 => _350.crypto, 'optionalAccess', _351 => _351.randomUUID, 'optionalCall', _352 => _352()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
5434
6080
  const prefix = "monitor-job-";
5435
6081
  const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
5436
6082
  const maxOperationLength = Math.max(
@@ -5441,7 +6087,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5441
6087
  }
5442
6088
  monitorJobHeaders(operation, idempotencyKey) {
5443
6089
  return {
5444
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _350 => _350.trim, 'call', _351 => _351()]) || this.monitorJobIdempotencyKey(operation)
6090
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _353 => _353.trim, 'call', _354 => _354()]) || this.monitorJobIdempotencyKey(operation)
5445
6091
  };
5446
6092
  }
5447
6093
  async deployMonitorBatch(definitions, options) {
@@ -5452,7 +6098,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5452
6098
  body: { version: 1, kind: "batch", monitors: definitions },
5453
6099
  headers: this.monitorJobHeaders(
5454
6100
  "batch-deploy",
5455
- _optionalChain([options, 'optionalAccess', _352 => _352.idempotencyKey])
6101
+ _optionalChain([options, 'optionalAccess', _355 => _355.idempotencyKey])
5456
6102
  ),
5457
6103
  maxRetries: 0,
5458
6104
  exactUrlOnly: true
@@ -5471,11 +6117,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
5471
6117
  version: 1,
5472
6118
  kind: "batch",
5473
6119
  monitors: definitions,
5474
- ..._optionalChain([options, 'optionalAccess', _353 => _353.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
6120
+ ..._optionalChain([options, 'optionalAccess', _356 => _356.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
5475
6121
  },
5476
6122
  headers: this.monitorJobHeaders(
5477
6123
  `batch-sync-${batchId}`,
5478
- _optionalChain([options, 'optionalAccess', _354 => _354.idempotencyKey])
6124
+ _optionalChain([options, 'optionalAccess', _357 => _357.idempotencyKey])
5479
6125
  ),
5480
6126
  maxRetries: 0,
5481
6127
  exactUrlOnly: true
@@ -5490,7 +6136,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5490
6136
  body: {},
5491
6137
  headers: this.monitorJobHeaders(
5492
6138
  `batch-start-${batchId}`,
5493
- _optionalChain([options, 'optionalAccess', _355 => _355.idempotencyKey])
6139
+ _optionalChain([options, 'optionalAccess', _358 => _358.idempotencyKey])
5494
6140
  ),
5495
6141
  maxRetries: 0,
5496
6142
  exactUrlOnly: true
@@ -5505,7 +6151,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5505
6151
  body: {},
5506
6152
  headers: this.monitorJobHeaders(
5507
6153
  `batch-stop-${batchId}`,
5508
- _optionalChain([options, 'optionalAccess', _356 => _356.idempotencyKey])
6154
+ _optionalChain([options, 'optionalAccess', _359 => _359.idempotencyKey])
5509
6155
  ),
5510
6156
  maxRetries: 0,
5511
6157
  exactUrlOnly: true
@@ -5526,7 +6172,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5526
6172
  body: {},
5527
6173
  headers: this.monitorJobHeaders(
5528
6174
  `${action}-${monitorKey}`,
5529
- _optionalChain([options, 'optionalAccess', _357 => _357.idempotencyKey])
6175
+ _optionalChain([options, 'optionalAccess', _360 => _360.idempotencyKey])
5530
6176
  ),
5531
6177
  maxRetries: 0,
5532
6178
  exactUrlOnly: true
@@ -5539,7 +6185,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5539
6185
  body: definition,
5540
6186
  headers: this.monitorJobHeaders(
5541
6187
  `sync-${definition.key}`,
5542
- _optionalChain([options, 'optionalAccess', _358 => _358.idempotencyKey])
6188
+ _optionalChain([options, 'optionalAccess', _361 => _361.idempotencyKey])
5543
6189
  ),
5544
6190
  maxRetries: 0,
5545
6191
  exactUrlOnly: true
@@ -5552,7 +6198,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5552
6198
  );
5553
6199
  }
5554
6200
  async getMonitorJobLogs(jobId, options) {
5555
- const query = _optionalChain([options, 'optionalAccess', _359 => _359.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
6201
+ const query = _optionalChain([options, 'optionalAccess', _362 => _362.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
5556
6202
  return this.http.request(
5557
6203
  `/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
5558
6204
  { method: "GET" }
@@ -5565,15 +6211,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
5565
6211
  );
5566
6212
  }
5567
6213
  async waitForMonitorJob(jobId, options) {
5568
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _360 => _360.timeoutMs]), () => ( 10 * 6e4)));
5569
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _361 => _361.pollIntervalMs]), () => ( 2e3)));
6214
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _363 => _363.timeoutMs]), () => ( 10 * 6e4)));
6215
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _364 => _364.pollIntervalMs]), () => ( 2e3)));
5570
6216
  const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
5571
6217
  const startedAt = Date.now();
5572
6218
  let latest = await this.getMonitorJob(jobId);
5573
6219
  while (true) {
5574
- _optionalChain([options, 'optionalAccess', _362 => _362.onProgress, 'optionalCall', _363 => _363(latest)]);
6220
+ _optionalChain([options, 'optionalAccess', _365 => _365.onProgress, 'optionalCall', _366 => _366(latest)]);
5575
6221
  const job = latest.job;
5576
- const state = typeof _optionalChain([job, 'optionalAccess', _364 => _364.state]) === "string" ? job.state : void 0;
6222
+ const state = typeof _optionalChain([job, 'optionalAccess', _367 => _367.state]) === "string" ? job.state : void 0;
5577
6223
  if (state && terminal.has(state)) return latest;
5578
6224
  if (Date.now() - startedAt >= timeoutMs) return latest;
5579
6225
  await sleep(pollIntervalMs);
@@ -5584,12 +6230,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
5584
6230
  // Monitor Fleets
5585
6231
  // ——————————————————————————————————————————————————————————
5586
6232
  monitorFleetIdempotencyKey(operation) {
5587
- const uuid = _optionalChain([globalThis, 'access', _365 => _365.crypto, 'optionalAccess', _366 => _366.randomUUID, 'optionalCall', _367 => _367()]);
6233
+ const uuid = _optionalChain([globalThis, 'access', _368 => _368.crypto, 'optionalAccess', _369 => _369.randomUUID, 'optionalCall', _370 => _370()]);
5588
6234
  return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
5589
6235
  }
5590
6236
  monitorFleetHeaders(operation, idempotencyKey) {
5591
6237
  return {
5592
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _368 => _368.trim, 'call', _369 => _369()]) || this.monitorFleetIdempotencyKey(operation)
6238
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _371 => _371.trim, 'call', _372 => _372()]) || this.monitorFleetIdempotencyKey(operation)
5593
6239
  };
5594
6240
  }
5595
6241
  monitorFleetPath(fleetId) {
@@ -5609,15 +6255,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
5609
6255
  const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
5610
6256
  const body = {
5611
6257
  ...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
5612
- ..._optionalChain([options, 'optionalAccess', _370 => _370.dryRun]) ? { dry_run: true } : {},
5613
- ..._optionalChain([options, 'optionalAccess', _371 => _371.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
6258
+ ..._optionalChain([options, 'optionalAccess', _373 => _373.dryRun]) ? { dry_run: true } : {},
6259
+ ..._optionalChain([options, 'optionalAccess', _374 => _374.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
5614
6260
  };
5615
6261
  return this.http.request(
5616
6262
  this.monitorFleetPath(fleetId),
5617
6263
  {
5618
6264
  method: "PUT",
5619
6265
  body,
5620
- headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _372 => _372.idempotencyKey])),
6266
+ headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _375 => _375.idempotencyKey])),
5621
6267
  maxRetries: 0,
5622
6268
  exactUrlOnly: true
5623
6269
  }
@@ -5630,8 +6276,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5630
6276
  }
5631
6277
  async getMonitorFleet(fleetId, options) {
5632
6278
  const params = new URLSearchParams();
5633
- if (_optionalChain([options, 'optionalAccess', _373 => _373.drift])) params.set("drift", "1");
5634
- if (_optionalChain([options, 'optionalAccess', _374 => _374.limit]) !== void 0)
6279
+ if (_optionalChain([options, 'optionalAccess', _376 => _376.drift])) params.set("drift", "1");
6280
+ if (_optionalChain([options, 'optionalAccess', _377 => _377.limit]) !== void 0)
5635
6281
  params.set("limit", String(options.limit));
5636
6282
  const query = params.toString();
5637
6283
  return this.http.request(
@@ -5644,10 +6290,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
5644
6290
  this.monitorFleetPath(fleetId),
5645
6291
  {
5646
6292
  method: "DELETE",
5647
- body: _optionalChain([options, 'optionalAccess', _375 => _375.dryRun]) ? { dry_run: true } : {},
6293
+ body: _optionalChain([options, 'optionalAccess', _378 => _378.dryRun]) ? { dry_run: true } : {},
5648
6294
  headers: this.monitorFleetHeaders(
5649
6295
  "deactivate",
5650
- _optionalChain([options, 'optionalAccess', _376 => _376.idempotencyKey])
6296
+ _optionalChain([options, 'optionalAccess', _379 => _379.idempotencyKey])
5651
6297
  ),
5652
6298
  maxRetries: 0,
5653
6299
  exactUrlOnly: true
@@ -5662,7 +6308,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5662
6308
  body: {},
5663
6309
  headers: this.monitorFleetHeaders(
5664
6310
  "reactivate",
5665
- _optionalChain([options, 'optionalAccess', _377 => _377.idempotencyKey])
6311
+ _optionalChain([options, 'optionalAccess', _380 => _380.idempotencyKey])
5666
6312
  ),
5667
6313
  maxRetries: 0,
5668
6314
  exactUrlOnly: true
@@ -5679,13 +6325,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
5679
6325
  * identical to "the request failed".
5680
6326
  */
5681
6327
  async waitForMonitorFleetConvergence(fleetId, options) {
5682
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _378 => _378.timeoutMs]), () => ( 10 * 6e4)));
5683
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _379 => _379.pollIntervalMs]), () => ( 2e3)));
5684
- const terminal = _optionalChain([options, 'optionalAccess', _380 => _380.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
6328
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _381 => _381.timeoutMs]), () => ( 10 * 6e4)));
6329
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _382 => _382.pollIntervalMs]), () => ( 2e3)));
6330
+ const terminal = _optionalChain([options, 'optionalAccess', _383 => _383.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
5685
6331
  const startedAt = Date.now();
5686
6332
  let latest = await this.getMonitorFleet(fleetId);
5687
6333
  while (true) {
5688
- _optionalChain([options, 'optionalAccess', _381 => _381.onProgress, 'optionalCall', _382 => _382(latest)]);
6334
+ _optionalChain([options, 'optionalAccess', _384 => _384.onProgress, 'optionalCall', _385 => _385(latest)]);
5689
6335
  const status = typeof latest.status === "string" ? latest.status : void 0;
5690
6336
  if (status && terminal.has(status)) return latest;
5691
6337
  if (Date.now() - startedAt >= timeoutMs) return latest;
@@ -5729,4 +6375,6 @@ var DeeplineClient = (_class = class _DeeplineClient {
5729
6375
 
5730
6376
 
5731
6377
 
5732
- exports.CSV_HEADER_MATCHING_NOTE = CSV_HEADER_MATCHING_NOTE; exports.iterateCursorPages = iterateCursorPages; exports.playInputExampleArgs = playInputExampleArgs; exports.PRODUCT_NOTIFICATION_EVENT_CATALOG = PRODUCT_NOTIFICATION_EVENT_CATALOG; exports.resolveLegacySlackNotification = resolveLegacySlackNotification; exports.RUN_EVENT_SEARCH_KIND_VALUES = RUN_EVENT_SEARCH_KIND_VALUES; exports.logProvenanceReaches = logProvenanceReaches; exports.logLevelReaches = logLevelReaches; exports.parseLogLevel = parseLogLevel; exports.classifyLogLine = classifyLogLine; exports.isTransientPlayRunReadError = isTransientPlayRunReadError; exports.encodeRunLogsCursor = encodeRunLogsCursor; exports.isRunLogsCursor = isRunLogsCursor; exports.isStopAllPlayRunsDryRunResult = isStopAllPlayRunsDryRunResult; exports.MONITOR_JOB_STATES = MONITOR_JOB_STATES; exports.MONITOR_JOB_PHASES = MONITOR_JOB_PHASES; exports.MONITOR_JOB_RECONCILIATION_STATES = MONITOR_JOB_RECONCILIATION_STATES; exports.DeeplineClient = DeeplineClient;
6378
+
6379
+
6380
+ exports.CSV_HEADER_MATCHING_NOTE = CSV_HEADER_MATCHING_NOTE; exports.iterateCursorPages = iterateCursorPages; exports.playInputExampleArgs = playInputExampleArgs; exports.PRODUCT_NOTIFICATION_EVENT_CATALOG = PRODUCT_NOTIFICATION_EVENT_CATALOG; exports.resolveLegacySlackNotification = resolveLegacySlackNotification; exports.RUN_EVENT_SEARCH_KIND_VALUES = RUN_EVENT_SEARCH_KIND_VALUES; exports.logProvenanceReaches = logProvenanceReaches; exports.logLevelReaches = logLevelReaches; exports.parseLogLevel = parseLogLevel; exports.classifyLogLine = classifyLogLine; exports.isTransientPlayRunReadError = isTransientPlayRunReadError; exports.encodeRunLogsCursor = encodeRunLogsCursor; exports.isRunLogsCursor = isRunLogsCursor; exports.RunEventQueryInputError = RunEventQueryInputError; exports.normalizeRunEventOperationRequest = normalizeRunEventOperationRequest; exports.isStopAllPlayRunsDryRunResult = isStopAllPlayRunsDryRunResult; exports.MONITOR_JOB_STATES = MONITOR_JOB_STATES; exports.MONITOR_JOB_PHASES = MONITOR_JOB_PHASES; exports.MONITOR_JOB_RECONCILIATION_STATES = MONITOR_JOB_RECONCILIATION_STATES; exports.DeeplineClient = DeeplineClient;