deepline 0.3.64 → 0.3.66

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.
@@ -0,0 +1,141 @@
1
+ import {
2
+ defineBatchStrategyMap,
3
+ type BatchOperationStrategy,
4
+ } from './batching-types';
5
+
6
+ type TestAsyncLookupPayload = Record<string, unknown> & {
7
+ key: string;
8
+ row_number: number;
9
+ capacity_key: string;
10
+ polls_before_terminal?: number;
11
+ result_page_size?: number;
12
+ pre_attach_delay_ms?: number;
13
+ };
14
+
15
+ type TestAsyncBatchPayload = Record<string, unknown> & {
16
+ key: string;
17
+ capacity_key: string;
18
+ wait_for_completion: true;
19
+ terminal_outcome: 'completed';
20
+ polls_before_terminal?: number;
21
+ result_page_size?: number;
22
+ pre_attach_delay_ms?: number;
23
+ items: Array<{
24
+ itemKey: string;
25
+ payload: { key: string; row_number: number };
26
+ }>;
27
+ };
28
+
29
+ type TestAsyncBatchResult = Record<string, unknown> & {
30
+ items?: Array<{
31
+ itemKey?: string;
32
+ result?: Record<string, unknown>;
33
+ }>;
34
+ };
35
+
36
+ function resultItems(
37
+ value: unknown,
38
+ ): NonNullable<TestAsyncBatchResult['items']> {
39
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return [];
40
+ const record = value as Record<string, unknown>;
41
+ if (Array.isArray(record.items)) {
42
+ return record.items as NonNullable<TestAsyncBatchResult['items']>;
43
+ }
44
+ for (const candidate of [record.data, record.result, record.output]) {
45
+ const nested = resultItems(candidate);
46
+ if (nested.length > 0) return nested;
47
+ }
48
+ return [];
49
+ }
50
+
51
+ export const testAsyncContractLookupBatchStrategy: BatchOperationStrategy<
52
+ TestAsyncLookupPayload,
53
+ TestAsyncBatchPayload,
54
+ TestAsyncBatchResult,
55
+ Record<string, unknown>
56
+ > = {
57
+ sourceOperation: 'test_async_contract_lookup',
58
+ batchOperation: 'test_async_contract_start',
59
+ kind: 'async_dataset_job',
60
+ maxBatchSize: 3,
61
+ bucketKeyPayloadFields: [
62
+ 'capacity_key',
63
+ 'polls_before_terminal',
64
+ 'result_page_size',
65
+ 'pre_attach_delay_ms',
66
+ ],
67
+ canBatchWith(left, right) {
68
+ return (
69
+ left.capacity_key === right.capacity_key &&
70
+ left.polls_before_terminal === right.polls_before_terminal &&
71
+ left.result_page_size === right.result_page_size &&
72
+ left.pre_attach_delay_ms === right.pre_attach_delay_ms
73
+ );
74
+ },
75
+ toBucketKey(payload) {
76
+ return JSON.stringify([
77
+ payload.capacity_key,
78
+ payload.polls_before_terminal ?? null,
79
+ payload.result_page_size ?? null,
80
+ payload.pre_attach_delay_ms ?? null,
81
+ ]);
82
+ },
83
+ toItemKey(payload) {
84
+ return payload.key;
85
+ },
86
+ compile(payloads) {
87
+ const first = payloads[0]!;
88
+ const items = payloads.map((payload) => ({
89
+ itemKey: payload.key,
90
+ payload: { key: payload.key, row_number: payload.row_number },
91
+ }));
92
+ return {
93
+ batchOperation: 'test_async_contract_start',
94
+ batchPayload: {
95
+ key: `async-contract:${first.capacity_key}:${items.map((item) => item.itemKey).join(',')}`,
96
+ capacity_key: first.capacity_key,
97
+ wait_for_completion: true,
98
+ terminal_outcome: 'completed',
99
+ ...(first.polls_before_terminal !== undefined
100
+ ? { polls_before_terminal: first.polls_before_terminal }
101
+ : {}),
102
+ ...(first.result_page_size !== undefined
103
+ ? { result_page_size: first.result_page_size }
104
+ : {}),
105
+ ...(first.pre_attach_delay_ms !== undefined
106
+ ? { pre_attach_delay_ms: first.pre_attach_delay_ms }
107
+ : {}),
108
+ items,
109
+ },
110
+ items: payloads.map((payload) => ({
111
+ itemKey: payload.key,
112
+ payload,
113
+ })),
114
+ };
115
+ },
116
+ splitResult(fullResult, compiled) {
117
+ const items = resultItems(fullResult);
118
+ if (items.length !== compiled.items.length) {
119
+ throw new Error(
120
+ `Synthetic async batch returned ${items.length} results for ${compiled.items.length} inputs.`,
121
+ );
122
+ }
123
+ return compiled.items.map((item, index) => {
124
+ const resultItem = items[index];
125
+ if (!resultItem || resultItem.itemKey !== item.itemKey) {
126
+ throw new Error(
127
+ `Synthetic async batch result ${index} did not preserve item identity ${item.itemKey}.`,
128
+ );
129
+ }
130
+ return {
131
+ itemKey: item.itemKey,
132
+ result: resultItem.result ?? {},
133
+ rawResult: resultItem,
134
+ };
135
+ });
136
+ },
137
+ };
138
+
139
+ export const testAsyncBatchStrategies = defineBatchStrategyMap({
140
+ test_async_contract_lookup: testAsyncContractLookupBatchStrategy,
141
+ });
@@ -16,10 +16,17 @@ export const TOOL_EXECUTE_IDEMPOTENCY_IN_PROGRESS_MAX_ATTEMPTS =
16
16
  TOOL_EXECUTE_IDEMPOTENCY_IN_PROGRESS_RETRY_DELAYS_MS.length + 1;
17
17
  export const TOOL_EXECUTE_RATE_LIMIT_MAX_ATTEMPTS = 8;
18
18
  export const TOOL_EXECUTE_BARE_RATE_LIMIT_MAX_ATTEMPTS = 2;
19
+ // A Deepline async-capacity denial means the provider has not been called.
20
+ // Treat it as queueing, not a failed physical provider attempt. The enclosing
21
+ // tool deadline remains the hard bound; this prevents a normal one-minute
22
+ // queue wait from being compressed into eight five-second retries.
23
+ export const TOOL_EXECUTE_CONCURRENCY_BACKPRESSURE_MAX_ATTEMPTS = 65;
19
24
  export const TOOL_EXECUTE_TRANSPORT_MAX_ATTEMPTS = 3;
20
25
  export const TOOL_EXECUTE_TRANSPORT_RETRY_DELAY_MS = 1_000;
21
26
  export const TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS = 1_000;
22
27
  export const TOOL_EXECUTE_RETRY_DELAY_MAX_MS = 5_000;
28
+ export const TOOL_EXECUTE_RATE_LIMIT_RETRY_DELAY_MAX_MS = 30_000;
29
+ export const TOOL_EXECUTE_CONCURRENCY_BACKPRESSURE_DELAY_MAX_MS = 5 * 60_000;
23
30
  export const TOOL_EXECUTE_BARE_RATE_LIMIT_BACKPRESSURE_MS = 60_000;
24
31
  export const TOOL_EXECUTE_AUTH_SCOPE_CHANGED_CODE = 'AUTH_SCOPE_CHANGED';
25
32
  export const TOOL_EXECUTE_CUSTOMER_DB_STORAGE_UNAVAILABLE_CODE =
@@ -50,6 +57,7 @@ export type ToolExecuteHttpRetryDecision = {
50
57
  attemptCap: number;
51
58
  reason:
52
59
  | 'rate_limit'
60
+ | 'concurrency_backpressure'
53
61
  | 'idempotency_in_progress'
54
62
  | 'gateway_invocation_in_progress'
55
63
  | 'customer_db_storage_unavailable'
@@ -131,6 +139,19 @@ function isCustomerDbStorageUnavailableResponse(input: {
131
139
  );
132
140
  }
133
141
 
142
+ function isConcurrencyBackpressureResponse(input: {
143
+ status: number;
144
+ bodyText: string;
145
+ }): boolean {
146
+ if (input.status !== 429) return false;
147
+ const body = parseJsonObject(input.bodyText);
148
+ return (
149
+ body?.code === 'RATE_LIMIT' &&
150
+ body.rate_limit_kind === 'concurrency' &&
151
+ body.failure_origin === 'deepline_rate_limit'
152
+ );
153
+ }
154
+
134
155
  function idempotencyInProgressRetryDelayMs(attempt: number): number {
135
156
  return (
136
157
  TOOL_EXECUTE_IDEMPOTENCY_IN_PROGRESS_RETRY_DELAYS_MS[
@@ -164,6 +185,7 @@ function decideToolExecuteHttpRetry(input: {
164
185
  idempotencyInProgress?: boolean;
165
186
  gatewayInvocationInProgress?: boolean;
166
187
  customerDbStorageUnavailable?: boolean;
188
+ concurrencyBackpressure?: boolean;
167
189
  hardBillingFailure?: boolean;
168
190
  hasRetryAfterHeader?: boolean;
169
191
  transientHttpRetrySafe?: boolean;
@@ -177,6 +199,13 @@ function decideToolExecuteHttpRetry(input: {
177
199
  };
178
200
  }
179
201
  if (input.status === 429) {
202
+ if (input.concurrencyBackpressure) {
203
+ return {
204
+ retryable: true,
205
+ attemptCap: TOOL_EXECUTE_CONCURRENCY_BACKPRESSURE_MAX_ATTEMPTS,
206
+ reason: 'concurrency_backpressure',
207
+ };
208
+ }
180
209
  if (!input.hasRetryAfterHeader) {
181
210
  return {
182
211
  retryable: true,
@@ -241,6 +270,7 @@ export function createToolExecuteHttpFailureAttemptTracker(): ToolExecuteHttpFai
241
270
  number
242
271
  > = {
243
272
  rate_limit: 0,
273
+ concurrency_backpressure: 0,
244
274
  idempotency_in_progress: 0,
245
275
  gateway_invocation_in_progress: 0,
246
276
  customer_db_storage_unavailable: 0,
@@ -267,6 +297,10 @@ export function createToolExecuteHttpFailureAttemptTracker(): ToolExecuteHttpFai
267
297
  status: input.status,
268
298
  bodyText: input.bodyText ?? '',
269
299
  }),
300
+ concurrencyBackpressure: isConcurrencyBackpressureResponse({
301
+ status: input.status,
302
+ bodyText: input.bodyText ?? '',
303
+ }),
270
304
  hasRetryAfterHeader: true,
271
305
  transientHttpRetrySafe: input.transientHttpRetrySafe === true,
272
306
  });
@@ -312,11 +346,13 @@ export function classifyToolExecuteHttpFailure(input: {
312
346
  isGatewayInvocationInProgressResponse(input);
313
347
  const customerDbStorageUnavailable =
314
348
  isCustomerDbStorageUnavailableResponse(input);
349
+ const concurrencyBackpressure = isConcurrencyBackpressureResponse(input);
315
350
  const initialRetryDecision = decideToolExecuteHttpRetry({
316
351
  status: input.status,
317
352
  idempotencyInProgress,
318
353
  gatewayInvocationInProgress,
319
354
  customerDbStorageUnavailable,
355
+ concurrencyBackpressure,
320
356
  hasRetryAfterHeader,
321
357
  transientHttpRetrySafe,
322
358
  });
@@ -348,6 +384,7 @@ export function classifyToolExecuteHttpFailure(input: {
348
384
  idempotencyInProgress,
349
385
  gatewayInvocationInProgress,
350
386
  customerDbStorageUnavailable,
387
+ concurrencyBackpressure,
351
388
  hardBillingFailure,
352
389
  hasRetryAfterHeader,
353
390
  transientHttpRetrySafe,
@@ -366,23 +403,31 @@ export function classifyToolExecuteHttpFailure(input: {
366
403
  error.receiptFailureKind = 'repairable';
367
404
  }
368
405
  const retryDelayMs =
369
- input.status === 429
406
+ retryDecision.reason === 'concurrency_backpressure'
370
407
  ? Math.min(
371
- TOOL_EXECUTE_RETRY_DELAY_MAX_MS,
408
+ TOOL_EXECUTE_CONCURRENCY_BACKPRESSURE_DELAY_MAX_MS,
372
409
  Math.max(
373
410
  retryAfterMs,
374
411
  TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS * input.attempt,
375
412
  ),
376
413
  )
377
- : retryDecision.reason === 'idempotency_in_progress' &&
378
- !hasRetryAfterHeader
379
- ? idempotencyInProgressRetryDelayMs(input.attempt)
380
- : retryDecision.reason === 'gateway_invocation_in_progress' &&
414
+ : input.status === 429
415
+ ? Math.min(
416
+ TOOL_EXECUTE_RATE_LIMIT_RETRY_DELAY_MAX_MS,
417
+ Math.max(
418
+ retryAfterMs,
419
+ TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS * input.attempt,
420
+ ),
421
+ )
422
+ : retryDecision.reason === 'idempotency_in_progress' &&
381
423
  !hasRetryAfterHeader
382
424
  ? idempotencyInProgressRetryDelayMs(input.attempt)
383
- : retryAfterMs > 0
384
- ? Math.min(TOOL_EXECUTE_RETRY_DELAY_MAX_MS, retryAfterMs)
385
- : TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS;
425
+ : retryDecision.reason === 'gateway_invocation_in_progress' &&
426
+ !hasRetryAfterHeader
427
+ ? idempotencyInProgressRetryDelayMs(input.attempt)
428
+ : retryAfterMs > 0
429
+ ? Math.min(TOOL_EXECUTE_RETRY_DELAY_MAX_MS, retryAfterMs)
430
+ : TOOL_EXECUTE_RETRY_DELAY_FALLBACK_MS;
386
431
  return {
387
432
  ...retryDecision,
388
433
  error,
@@ -401,6 +446,8 @@ export function classifyToolExecuteHttpFailure(input: {
401
446
  : TOOL_EXECUTE_BARE_RATE_LIMIT_BACKPRESSURE_MS
402
447
  : null,
403
448
  chargeRetryBudget:
404
- shouldRetry && retryDecision.reason !== 'gateway_invocation_in_progress',
449
+ shouldRetry &&
450
+ retryDecision.reason !== 'gateway_invocation_in_progress' &&
451
+ retryDecision.reason !== 'concurrency_backpressure',
405
452
  };
406
453
  }
package/dist/cli/index.js CHANGED
@@ -1214,7 +1214,7 @@ var SDK_RELEASE = {
1214
1214
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1215
1215
  // getters keep their established compatibility behavior.
1216
1216
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1217
- version: "0.3.64",
1217
+ version: "0.3.66",
1218
1218
  updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
1219
1219
  packageCapabilities: {
1220
1220
  updatePreferences: 1
@@ -16758,9 +16758,7 @@ function readProvenanceTag(line) {
16758
16758
  return { provenance: null, line };
16759
16759
  }
16760
16760
  const candidate = line.slice(PROVENANCE_PREFIX.length, end);
16761
- const provenance = LOG_PROVENANCE_CLASSES.includes(
16762
- candidate
16763
- ) ? candidate : null;
16761
+ const provenance = LOG_PROVENANCE_CLASSES.includes(candidate) ? candidate : null;
16764
16762
  return { provenance, line: line.slice(end + 1) };
16765
16763
  }
16766
16764
  function classifyLegacyLogLine(line) {
@@ -17094,12 +17092,16 @@ var PLAY_RUN_RESERVED_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
17094
17092
  "--watch",
17095
17093
  "--no-wait",
17096
17094
  "--logs",
17095
+ "--debug",
17097
17096
  "--full",
17098
17097
  "--force",
17099
17098
  "--force-tool-refresh",
17100
17099
  "--open",
17101
17100
  "--debug-map-latency"
17102
17101
  ]);
17102
+ function isBarePlayRunDebugFlag(args, index) {
17103
+ return args[index] === "--debug" && (args[index + 1] === void 0 || args[index + 1].startsWith("--"));
17104
+ }
17103
17105
  async function pathExistsIncludingSymlink(path) {
17104
17106
  try {
17105
17107
  await (0, import_promises6.lstat)(path);
@@ -21057,12 +21059,13 @@ function parsePlayRunOptions(args) {
21057
21059
  const watch = !args.includes("--no-wait");
21058
21060
  let jsonOutput = watch ? args.includes("--json") : argsWantJson(args);
21059
21061
  const fullJson = args.includes("--full");
21060
- const emitLogs = !jsonOutput || args.includes("--logs");
21062
+ const explicitDebugLogs = args.includes("--logs") || args.some((_, index) => isBarePlayRunDebugFlag(args, index));
21063
+ const emitLogs = !jsonOutput || explicitDebugLogs;
21061
21064
  const force = args.includes("--force");
21062
21065
  const forceToolRefresh = args.includes("--force-tool-refresh");
21063
21066
  const open2 = args.includes("--open");
21064
21067
  const debugMapLatency = args.includes("--debug-map-latency");
21065
- const verboseLogs = args.includes("--logs") || debugMapLatency;
21068
+ const verboseLogs = explicitDebugLogs || debugMapLatency;
21066
21069
  let waitTimeoutMs = null;
21067
21070
  let maxConcurrentExternalCalls = null;
21068
21071
  let maxConcurrentRows = null;
@@ -21193,6 +21196,20 @@ function parsePlayRunOptions(args) {
21193
21196
  waitTimeoutMs = parsePositiveInteger3(args[++index], arg);
21194
21197
  continue;
21195
21198
  }
21199
+ if (arg === "--debug" && args[index + 1] && !args[index + 1].startsWith("--")) {
21200
+ input2 ??= {};
21201
+ setDottedInputValue(input2, "debug", parseInputFlagValue(args[++index]));
21202
+ continue;
21203
+ }
21204
+ if (arg.startsWith("--debug=")) {
21205
+ input2 ??= {};
21206
+ setDottedInputValue(
21207
+ input2,
21208
+ "debug",
21209
+ parseInputFlagValue(arg.slice("--debug=".length))
21210
+ );
21211
+ continue;
21212
+ }
21196
21213
  if (PLAY_RUN_RESERVED_BOOLEAN_FLAGS.has(arg)) {
21197
21214
  if (arg === "--watch") {
21198
21215
  continue;
@@ -22451,7 +22468,7 @@ async function handlePlayRun(args, hooks) {
22451
22468
  function parseRunIdPositional(args, usage) {
22452
22469
  for (let index = 0; index < args.length; index += 1) {
22453
22470
  const arg = args[index];
22454
- if (arg === "--json" || arg === "--full" || arg === "--input" || arg === "--logs" || arg === "--compact" || arg === "--log-failed" || arg === "--failed" || arg === "--limit") {
22471
+ if (arg === "--json" || arg === "--full" || arg === "--input" || arg === "--logs" || arg === "--debug" || arg === "--compact" || arg === "--log-failed" || arg === "--failed" || arg === "--limit") {
22455
22472
  if (arg === "--limit" && args[index + 1]) {
22456
22473
  index += 1;
22457
22474
  }
@@ -22599,7 +22616,7 @@ async function handleRunsList(args) {
22599
22616
  return 0;
22600
22617
  }
22601
22618
  async function handleRunTail(args) {
22602
- const usage = "Usage: deepline runs tail <run-id> [--json | --jsonl] [--compact]";
22619
+ const usage = "Usage: deepline runs tail <run-id> [--json | --jsonl] [--compact] [--debug]";
22603
22620
  let runId;
22604
22621
  try {
22605
22622
  runId = parseRunIdPositional(args, usage);
@@ -22615,7 +22632,7 @@ async function handleRunTail(args) {
22615
22632
  );
22616
22633
  return 1;
22617
22634
  }
22618
- if (arg.startsWith("--") && arg !== "--json" && arg !== "--jsonl" && arg !== "--compact") {
22635
+ if (arg.startsWith("--") && arg !== "--json" && arg !== "--jsonl" && arg !== "--compact" && arg !== "--logs" && arg !== "--debug") {
22619
22636
  console.error(`${arg} is not supported by deepline runs tail.`);
22620
22637
  return 1;
22621
22638
  }
@@ -22624,6 +22641,13 @@ async function handleRunTail(args) {
22624
22641
  console.error("--json and --jsonl cannot be used together.");
22625
22642
  return 1;
22626
22643
  }
22644
+ const debug = args.includes("--logs") || args.includes("--debug");
22645
+ if (args.includes("--jsonl") && debug) {
22646
+ console.error(
22647
+ "--debug is redundant with --jsonl: JSON Lines already includes every canonical live event."
22648
+ );
22649
+ return 1;
22650
+ }
22627
22651
  const client2 = new DeeplineClient();
22628
22652
  const jsonLines = args.includes("--jsonl");
22629
22653
  const jsonOutput = !jsonLines && argsWantJson(args);
@@ -22633,7 +22657,8 @@ async function handleRunTail(args) {
22633
22657
  emittedRunnerStarted: false,
22634
22658
  lastProgressSignature: null,
22635
22659
  lastProgressHeartbeatAt: 0,
22636
- lastStatusHeartbeatAt: 0
22660
+ lastStatusHeartbeatAt: 0,
22661
+ verbose: debug
22637
22662
  };
22638
22663
  const status = await client2.runs.tail(runId, {
22639
22664
  onEvent: jsonLines ? (event) => {
@@ -22645,7 +22670,20 @@ async function handleRunTail(args) {
22645
22670
  })}
22646
22671
  `
22647
22672
  );
22648
- } : compact && !jsonOutput ? (event) => {
22673
+ } : compact || debug ? (event) => {
22674
+ if (debug) {
22675
+ for (const line of getLogLinesFromLiveEvent(event)) {
22676
+ const formatted = formatPlayLogLine(
22677
+ line,
22678
+ void 0,
22679
+ compactState
22680
+ );
22681
+ if (formatted) process.stderr.write(`${formatted}
22682
+ `);
22683
+ compactState.lastLogIndex += 1;
22684
+ }
22685
+ }
22686
+ if (!compact || jsonOutput) return;
22649
22687
  const transition = getStepTransitionLineFromLiveEvent(
22650
22688
  event,
22651
22689
  compactState
@@ -22668,7 +22706,7 @@ async function handleRunTail(args) {
22668
22706
  }
22669
22707
  } : void 0,
22670
22708
  // Human mode only: in --json mode emit nothing non-protocol.
22671
- onReconnect: jsonOutput ? void 0 : ({ reason }) => {
22709
+ onReconnect: jsonOutput && !debug ? void 0 : ({ reason }) => {
22672
22710
  process.stderr.write(
22673
22711
  `[runs tail] stream ended without a terminal status; reconnecting to run ${runId} (${reason})
22674
22712
  `
@@ -22684,7 +22722,7 @@ async function handleRunTail(args) {
22684
22722
  return status.status === "failed" ? 1 : 0;
22685
22723
  }
22686
22724
  async function handleRunLogs(args) {
22687
- const usage = "Usage: deepline runs logs <run-id> [--limit 200] [--failed] [--out run.log] [--json]";
22725
+ const usage = "Usage: deepline runs logs <run-id> [--limit 200] [--failed] [--out run.log] [--json] [--debug]";
22688
22726
  let runId;
22689
22727
  try {
22690
22728
  runId = parseRunIdPositional(args, usage);
@@ -22697,12 +22735,20 @@ async function handleRunLogs(args) {
22697
22735
  const failed = args.includes("--failed");
22698
22736
  for (let index = 0; index < args.length; index += 1) {
22699
22737
  const arg = args[index];
22738
+ if (arg === "--debug" || arg === "--logs" || arg === "--json" || arg === "--failed") {
22739
+ continue;
22740
+ }
22700
22741
  if (arg === "--limit" && args[index + 1]) {
22701
22742
  limit = parsePositiveInteger3(args[++index], "--limit");
22702
22743
  continue;
22703
22744
  }
22704
22745
  if (arg === "--out" && args[index + 1]) {
22705
22746
  outPath = (0, import_node_path14.resolve)(args[++index]);
22747
+ continue;
22748
+ }
22749
+ if (arg.startsWith("--")) {
22750
+ console.error(`${arg} is not supported by deepline runs logs.`);
22751
+ return 1;
22706
22752
  }
22707
22753
  }
22708
22754
  if (failed && outPath) {
@@ -24175,9 +24221,9 @@ Examples:
24175
24221
  ).option("--watch", "Compatibility alias; run waits by default").option("--wait", "Compatibility alias; run waits by default").option("--no-wait", "Start the run and return immediately").option(
24176
24222
  "--run-id-file <path>",
24177
24223
  "Atomically write the accepted run id to a new JSON file"
24178
- ).option(
24179
- "--logs",
24180
- "When output is non-interactive, stream play logs to stderr while waiting"
24224
+ ).option("--logs", "Compatibility alias for --debug").option(
24225
+ "--debug [value]",
24226
+ "Stream complete customer-safe runtime logs when passed without a value; otherwise pass input.debug"
24181
24227
  ).option("--tail-timeout-ms <ms>", "Timeout while watching the run stream").option("--force", "Start a fresh run graph").option(
24182
24228
  "--force-tool-refresh",
24183
24229
  "Refresh completed tool receipts; may repeat billed provider calls"
@@ -24226,6 +24272,7 @@ Pass-through input flags:
24226
24272
  ...options.runIdFile ? ["--run-id-file", options.runIdFile] : [],
24227
24273
  ...options.watch || options.wait ? ["--watch"] : [],
24228
24274
  ...options.logs ? ["--logs"] : [],
24275
+ ...options.debug === true ? ["--debug"] : typeof options.debug === "string" ? ["--debug", options.debug] : [],
24229
24276
  ...options.tailTimeoutMs ? ["--tail-timeout-ms", options.tailTimeoutMs] : [],
24230
24277
  ...options.force ? ["--force"] : [],
24231
24278
  ...options.forceToolRefresh ? ["--force-tool-refresh"] : [],
@@ -24643,11 +24690,13 @@ Notes:
24643
24690
  logs for persisted log history. In human output, --compact prints deduplicated
24644
24691
  step transitions and progress instead of the full event stream. --json emits
24645
24692
  one terminal package. --jsonl emits canonical live events as JSON Lines and
24646
- ends with the same compact package shape as runs get --json.
24693
+ ends with the same compact package shape as runs get --json. Use --debug
24694
+ (or legacy --logs) to also print customer-safe runtime log lines to stderr.
24647
24695
 
24648
24696
  Examples:
24649
24697
  deepline runs tail play/my-play/run/20260501t000000-000
24650
24698
  deepline runs tail play/my-play/run/20260501t000000-000 --compact
24699
+ deepline runs tail play/my-play/run/20260501t000000-000 --debug
24651
24700
  deepline runs tail play/my-play/run/20260501t000000-000 --jsonl
24652
24701
  `
24653
24702
  ).option("--json", "Emit one terminal JSON package after the run completes").option(
@@ -24656,12 +24705,17 @@ Examples:
24656
24705
  ).option(
24657
24706
  "--compact",
24658
24707
  "Show deduplicated human step transitions and progress"
24708
+ ).option("--logs", "Compatibility alias for --debug").option(
24709
+ "--debug",
24710
+ "Print customer-safe runtime log lines to stderr while tailing"
24659
24711
  ).action(async (runId, options) => {
24660
24712
  process.exitCode = await handleRunTail([
24661
24713
  runId,
24662
24714
  ...options.json ? ["--json"] : [],
24663
24715
  ...options.jsonl ? ["--jsonl"] : [],
24664
- ...options.compact ? ["--compact"] : []
24716
+ ...options.compact ? ["--compact"] : [],
24717
+ ...options.logs ? ["--logs"] : [],
24718
+ ...options.debug ? ["--debug"] : []
24665
24719
  ]);
24666
24720
  });
24667
24721
  runs.command("logs <runId>").description("Fetch persisted logs for a play run.").addHelpText(
@@ -24669,24 +24723,31 @@ Examples:
24669
24723
  `
24670
24724
  Notes:
24671
24725
  Prints a bounded recent log preview by default. Use --out to write the full
24672
- persisted log stream to a local file.
24726
+ persisted log stream to a local file. --debug (or legacy --logs) is accepted
24727
+ for script parity; this command already returns the unfiltered durable stream.
24673
24728
 
24674
24729
  Examples:
24675
24730
  deepline runs logs play/my-play/run/20260501t000000-000
24676
24731
  deepline runs logs play/my-play/run/20260501t000000-000 --limit 500
24677
24732
  deepline runs logs play/my-play/run/20260501t000000-000 --failed --json
24733
+ deepline runs logs play/my-play/run/20260501t000000-000 --debug
24678
24734
  deepline runs logs play/my-play/run/20260501t000000-000 --out run.log --json
24679
24735
  `
24680
24736
  ).option(
24681
24737
  "--limit <count>",
24682
24738
  "Maximum recent log lines to print without --out",
24683
24739
  "200"
24684
- ).option("--out <path>", "Write the full persisted log stream to a file").option("--failed", "Show the bounded terminal-failure log window").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (runId, options) => {
24740
+ ).option("--out <path>", "Write the full persisted log stream to a file").option("--failed", "Show the bounded terminal-failure log window").option("--logs", "Compatibility alias for --debug").option(
24741
+ "--debug",
24742
+ "Explicitly request the same persisted log view (no provenance filtering)"
24743
+ ).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (runId, options) => {
24685
24744
  process.exitCode = await handleRunLogs([
24686
24745
  runId,
24687
24746
  ...options.limit ? ["--limit", options.limit] : [],
24688
24747
  ...options.out ? ["--out", options.out] : [],
24689
24748
  ...options.failed ? ["--failed"] : [],
24749
+ ...options.logs ? ["--logs"] : [],
24750
+ ...options.debug ? ["--debug"] : [],
24690
24751
  ...options.json ? ["--json"] : []
24691
24752
  ]);
24692
24753
  });