deepline 0.2.55 → 0.2.57

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 (49) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +14 -0
  2. package/dist/bundling-sources/sdk/src/http.ts +19 -1
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/bundling-sources/sdk/src/stream-reconnect.ts +6 -0
  5. package/dist/bundling-sources/sdk/src/types.ts +7 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +146 -12
  7. package/dist/bundling-sources/shared_libs/play-runtime/batch-runtime.ts +6 -3
  8. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +1631 -748
  9. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +20 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +81 -52
  11. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +146 -6
  12. package/dist/bundling-sources/shared_libs/play-runtime/gateway-auth-session.ts +56 -22
  13. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +14 -11
  14. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +21 -2
  15. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +81 -21
  16. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +7 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +3 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +21 -0
  19. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +27 -2
  20. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-runtime-watchdog.ts +49 -10
  21. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +96 -3
  22. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +341 -67
  23. package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +10 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/runtime-contract.ts +8 -1
  25. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver-pg.ts +17 -2
  26. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver.ts +4 -1
  27. package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-store-adapter.ts +17 -1
  28. package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-writer.ts +16 -2
  29. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-writer.ts +25 -0
  30. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +3 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +2 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +80 -1
  33. package/dist/bundling-sources/shared_libs/plays/docflow.ts +113 -14
  34. package/dist/bundling-sources/shared_libs/plays/play-exports.ts +53 -4
  35. package/dist/bundling-sources/shared_libs/security/safe-fetch.ts +9 -0
  36. package/dist/bundling-sources/shared_libs/security/safe-outbound-fetch.ts +85 -48
  37. package/dist/cli/index.js +429 -54
  38. package/dist/cli/index.mjs +409 -28
  39. package/dist/{compiler-manifest-Bl8kmLx9.d.mts → compiler-manifest-TgaC4DeD.d.mts} +13 -0
  40. package/dist/{compiler-manifest-Bl8kmLx9.d.ts → compiler-manifest-TgaC4DeD.d.ts} +13 -0
  41. package/dist/index.d.mts +21 -3
  42. package/dist/index.d.ts +21 -3
  43. package/dist/index.js +29 -2
  44. package/dist/index.mjs +29 -2
  45. package/dist/install-integrity.json +2 -2
  46. package/dist/plays/bundle-play-file.d.mts +2 -2
  47. package/dist/plays/bundle-play-file.d.ts +2 -2
  48. package/dist/plays/bundle-play-file.mjs +78 -18
  49. package/package.json +1 -1
@@ -21,6 +21,19 @@ type PlayDocflowNode = {
21
21
  id: string;
22
22
  label: string;
23
23
  kind: PlayDocflowNodeKind;
24
+ /**
25
+ * No statement in this play runs this box — the author said so with
26
+ * `class <id> sketch`. See {@link SKETCH_CLASS}.
27
+ *
28
+ * Deliberately NOT a `kind`. What a box IS (an action, a decision, a dataset)
29
+ * and whether code binds it are two different questions, and folding the
30
+ * second into the first was wrong in a way the tests caught immediately: a
31
+ * sketched diamond stopped being a decision, so it lost its shape on the
32
+ * canvas and the branch-label lint stopped checking its arms. Absent rather
33
+ * than `false` when bound, so the JSON a bound diagram hashes to is byte for
34
+ * byte what it was before sketches existed.
35
+ */
36
+ sketch?: true;
24
37
  };
25
38
  /**
26
39
  * Which arm of a conditional a drawn decision edge IS.
@@ -21,6 +21,19 @@ type PlayDocflowNode = {
21
21
  id: string;
22
22
  label: string;
23
23
  kind: PlayDocflowNodeKind;
24
+ /**
25
+ * No statement in this play runs this box — the author said so with
26
+ * `class <id> sketch`. See {@link SKETCH_CLASS}.
27
+ *
28
+ * Deliberately NOT a `kind`. What a box IS (an action, a decision, a dataset)
29
+ * and whether code binds it are two different questions, and folding the
30
+ * second into the first was wrong in a way the tests caught immediately: a
31
+ * sketched diamond stopped being a decision, so it lost its shape on the
32
+ * canvas and the branch-label lint stopped checking its arms. Absent rather
33
+ * than `false` when bound, so the JSON a bound diagram hashes to is byte for
34
+ * byte what it was before sketches existed.
35
+ */
36
+ sketch?: true;
24
37
  };
25
38
  /**
26
39
  * Which arm of a conditional a drawn decision edge IS.
package/dist/index.d.mts CHANGED
@@ -1,9 +1,10 @@
1
- import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest } from './compiler-manifest-Bl8kmLx9.mjs';
2
- export { O as DEEPLINE_EXTRACTOR_TARGETS, Q as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, R as DeeplineEmailStatusGetterValue, S as DeeplineExtractorTarget, U as DeeplineGetterValue, V as DeeplineGetterValueMap, W as JOB_CHANGE_STATUS_VALUES, X as JobChangeStatus, Y as PHONE_STATUS_VALUES, Z as PhoneStatus, _ as PlayDataset, $ as PlayDatasetInput, a0 as PreviousCell, a1 as ProviderTransientError, a2 as ProviderTransientErrorCategory, a3 as ToolExecutionErrorCategory, a4 as ToolExecutionErrorOrigin, a5 as ToolExecutionFailureV1, a6 as ToolExecutionNetworkKind, a7 as ToolExecutionNetworkScope, a8 as isDeeplineExtractorTarget } from './compiler-manifest-Bl8kmLx9.mjs';
1
+ import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest } from './compiler-manifest-TgaC4DeD.mjs';
2
+ export { O as DEEPLINE_EXTRACTOR_TARGETS, Q as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, R as DeeplineEmailStatusGetterValue, S as DeeplineExtractorTarget, U as DeeplineGetterValue, V as DeeplineGetterValueMap, W as JOB_CHANGE_STATUS_VALUES, X as JobChangeStatus, Y as PHONE_STATUS_VALUES, Z as PhoneStatus, _ as PlayDataset, $ as PlayDatasetInput, a0 as PreviousCell, a1 as ProviderTransientError, a2 as ProviderTransientErrorCategory, a3 as ToolExecutionErrorCategory, a4 as ToolExecutionErrorOrigin, a5 as ToolExecutionFailureV1, a6 as ToolExecutionNetworkKind, a7 as ToolExecutionNetworkScope, a8 as isDeeplineExtractorTarget } from './compiler-manifest-TgaC4DeD.mjs';
3
3
  import '@sinclair/typebox';
4
4
 
5
5
  declare const FIXTURE_BEHAVIOR_VERSION: 1;
6
6
  declare const FIXTURE_BEHAVIOR_RESPONSE_VERSION: 2;
7
+ declare const FIXTURE_BEHAVIOR_REPLAY_VERSION: 3;
7
8
  type FixtureBehaviorV1 = {
8
9
  version: typeof FIXTURE_BEHAVIOR_VERSION;
9
10
  responseDelaySamplesMs: number[];
@@ -23,7 +24,17 @@ type FixtureBehaviorV2 = {
23
24
  version: typeof FIXTURE_BEHAVIOR_RESPONSE_VERSION;
24
25
  responseSamples: FixtureResponseSample[];
25
26
  };
26
- type FixtureBehavior = FixtureBehaviorV1 | FixtureBehaviorV2;
27
+ type FixtureReplayBundle = {
28
+ bundleId: string;
29
+ manifestSha256: string;
30
+ syntheticFallbackToolIds?: string[];
31
+ };
32
+ type FixtureBehaviorV3 = {
33
+ version: typeof FIXTURE_BEHAVIOR_REPLAY_VERSION;
34
+ responseSamples: FixtureResponseSample[];
35
+ replayBundle: FixtureReplayBundle;
36
+ };
37
+ type FixtureBehavior = FixtureBehaviorV1 | FixtureBehaviorV2 | FixtureBehaviorV3;
27
38
 
28
39
  type PlayRuntimeSelection = {
29
40
  environment: 'preview';
@@ -1567,6 +1578,13 @@ interface StartPlayRunRequest {
1567
1578
  force?: boolean;
1568
1579
  /** Explicit cache-bypass flag for durable dataset and tool-call reuse. */
1569
1580
  forceToolRefresh?: boolean;
1581
+ /**
1582
+ * Per-run ceiling for concurrently resident provider-tool executions and
1583
+ * direct ctx.fetch calls. The server validates the supported range.
1584
+ */
1585
+ maxConcurrentExternalCalls?: number;
1586
+ /** Run-wide default and ceiling for live dataset-map row resolvers. */
1587
+ maxConcurrentRows?: number;
1570
1588
  /** Optionally let the start request wait briefly and return a terminal result. */
1571
1589
  waitForCompletionMs?: number;
1572
1590
  /**
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest } from './compiler-manifest-Bl8kmLx9.js';
2
- export { O as DEEPLINE_EXTRACTOR_TARGETS, Q as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, R as DeeplineEmailStatusGetterValue, S as DeeplineExtractorTarget, U as DeeplineGetterValue, V as DeeplineGetterValueMap, W as JOB_CHANGE_STATUS_VALUES, X as JobChangeStatus, Y as PHONE_STATUS_VALUES, Z as PhoneStatus, _ as PlayDataset, $ as PlayDatasetInput, a0 as PreviousCell, a1 as ProviderTransientError, a2 as ProviderTransientErrorCategory, a3 as ToolExecutionErrorCategory, a4 as ToolExecutionErrorOrigin, a5 as ToolExecutionFailureV1, a6 as ToolExecutionNetworkKind, a7 as ToolExecutionNetworkScope, a8 as isDeeplineExtractorTarget } from './compiler-manifest-Bl8kmLx9.js';
1
+ import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest } from './compiler-manifest-TgaC4DeD.js';
2
+ export { O as DEEPLINE_EXTRACTOR_TARGETS, Q as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, R as DeeplineEmailStatusGetterValue, S as DeeplineExtractorTarget, U as DeeplineGetterValue, V as DeeplineGetterValueMap, W as JOB_CHANGE_STATUS_VALUES, X as JobChangeStatus, Y as PHONE_STATUS_VALUES, Z as PhoneStatus, _ as PlayDataset, $ as PlayDatasetInput, a0 as PreviousCell, a1 as ProviderTransientError, a2 as ProviderTransientErrorCategory, a3 as ToolExecutionErrorCategory, a4 as ToolExecutionErrorOrigin, a5 as ToolExecutionFailureV1, a6 as ToolExecutionNetworkKind, a7 as ToolExecutionNetworkScope, a8 as isDeeplineExtractorTarget } from './compiler-manifest-TgaC4DeD.js';
3
3
  import '@sinclair/typebox';
4
4
 
5
5
  declare const FIXTURE_BEHAVIOR_VERSION: 1;
6
6
  declare const FIXTURE_BEHAVIOR_RESPONSE_VERSION: 2;
7
+ declare const FIXTURE_BEHAVIOR_REPLAY_VERSION: 3;
7
8
  type FixtureBehaviorV1 = {
8
9
  version: typeof FIXTURE_BEHAVIOR_VERSION;
9
10
  responseDelaySamplesMs: number[];
@@ -23,7 +24,17 @@ type FixtureBehaviorV2 = {
23
24
  version: typeof FIXTURE_BEHAVIOR_RESPONSE_VERSION;
24
25
  responseSamples: FixtureResponseSample[];
25
26
  };
26
- type FixtureBehavior = FixtureBehaviorV1 | FixtureBehaviorV2;
27
+ type FixtureReplayBundle = {
28
+ bundleId: string;
29
+ manifestSha256: string;
30
+ syntheticFallbackToolIds?: string[];
31
+ };
32
+ type FixtureBehaviorV3 = {
33
+ version: typeof FIXTURE_BEHAVIOR_REPLAY_VERSION;
34
+ responseSamples: FixtureResponseSample[];
35
+ replayBundle: FixtureReplayBundle;
36
+ };
37
+ type FixtureBehavior = FixtureBehaviorV1 | FixtureBehaviorV2 | FixtureBehaviorV3;
27
38
 
28
39
  type PlayRuntimeSelection = {
29
40
  environment: 'preview';
@@ -1567,6 +1578,13 @@ interface StartPlayRunRequest {
1567
1578
  force?: boolean;
1568
1579
  /** Explicit cache-bypass flag for durable dataset and tool-call reuse. */
1569
1580
  forceToolRefresh?: boolean;
1581
+ /**
1582
+ * Per-run ceiling for concurrently resident provider-tool executions and
1583
+ * direct ctx.fetch calls. The server validates the supported range.
1584
+ */
1585
+ maxConcurrentExternalCalls?: number;
1586
+ /** Run-wide default and ceiling for live dataset-map row resolvers. */
1587
+ maxConcurrentRows?: number;
1570
1588
  /** Optionally let the start request wait briefly and return a terminal result. */
1571
1589
  waitForCompletionMs?: number;
1572
1590
  /**
package/dist/index.js CHANGED
@@ -763,7 +763,7 @@ var SDK_RELEASE = {
763
763
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
764
764
  // exposed storage-dependent synchronous access. This deliberate minor
765
765
  // release keeps lazy paging semantics independent of row residency.
766
- version: "0.2.55",
766
+ version: "0.2.57",
767
767
  contracts: {
768
768
  api: {
769
769
  name: "sdk-http-api",
@@ -1346,9 +1346,26 @@ var HttpClient = class {
1346
1346
  if (error instanceof AuthError || error instanceof DeeplineError) {
1347
1347
  throw error;
1348
1348
  }
1349
- lastError = error instanceof Error ? error : new Error(String(error));
1349
+ const normalized = error instanceof Error ? error : new Error(String(error));
1350
+ if (isAbortLikeError(normalized) && options?.signal?.aborted) {
1351
+ throw new DeeplineError(
1352
+ `Stream from ${this.config.baseUrl} was aborted by the caller.`,
1353
+ void 0,
1354
+ "ABORTED"
1355
+ );
1356
+ }
1357
+ lastError = normalized;
1350
1358
  }
1351
1359
  }
1360
+ if (lastError && isAbortLikeError(lastError)) {
1361
+ throw new DeeplineError(
1362
+ withCoworkNetworkHint(
1363
+ `Unable to stream from ${this.config.baseUrl}. The remote stream was interrupted.`
1364
+ ),
1365
+ void 0,
1366
+ "PLAY_STREAM_NETWORK_ABORTED"
1367
+ );
1368
+ }
1352
1369
  throw new DeeplineError(
1353
1370
  withCoworkNetworkHint(
1354
1371
  lastError?.message ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
@@ -1611,6 +1628,9 @@ function streamReconnectDelayMs(attempt) {
1611
1628
  return Math.max(1, Math.floor(Math.random() * (cappedExponentialMs + 1)));
1612
1629
  }
1613
1630
  function isTransientPlayStreamError(error) {
1631
+ if (error instanceof DeeplineError && error.code === "PLAY_STREAM_NETWORK_ABORTED") {
1632
+ return true;
1633
+ }
1614
1634
  if (error instanceof DeeplineError && typeof error.statusCode === "number") {
1615
1635
  return error.statusCode >= 500 && error.statusCode < 600;
1616
1636
  }
@@ -1763,6 +1783,7 @@ var RUNTIME_RECEIPT_OUTPUT_MAX_BYTES = 10 * 1024 * 1024;
1763
1783
  var RUNTIME_RECEIPT_COMPLETION_BUFFER_MAX_BYTES = 32 * 1024 * 1024;
1764
1784
  var RUNNER_TERMINAL_PUSH_MAX_BODY_BYTES = 16 * 1024 * 1024;
1765
1785
  var RUNTIME_RECEIPT_GATEWAY_BATCH_MAX_BYTES = 12 * 1024 * 1024;
1786
+ var RUNTIME_RECEIPT_WRITER_TARGET_BATCH_BYTES = 4 * 1024 * 1024;
1766
1787
  var RUNNER_POST_TERMINAL_DIAGNOSTIC_MAX_BYTES = 64 * 1024;
1767
1788
 
1768
1789
  // ../shared_libs/play-runtime/ledger-safe-payload.ts
@@ -4345,6 +4366,10 @@ var DeeplineClient = class {
4345
4366
  ...request.packagedFiles?.length ? { packagedFiles: request.packagedFiles } : {},
4346
4367
  ...request.force ? { force: true } : {},
4347
4368
  ...forceToolRefresh ? { forceToolRefresh: true } : {},
4369
+ ...typeof request.maxConcurrentExternalCalls === "number" ? {
4370
+ maxConcurrentExternalCalls: request.maxConcurrentExternalCalls
4371
+ } : {},
4372
+ ...typeof request.maxConcurrentRows === "number" ? { maxConcurrentRows: request.maxConcurrentRows } : {},
4348
4373
  ...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
4349
4374
  // Profile selection is the API's job, not the CLI's. The server
4350
4375
  // defaults to absurd; callers normally omit this field.
@@ -4397,6 +4422,8 @@ var DeeplineClient = class {
4397
4422
  ...request.packagedFiles?.length ? { packagedFiles: request.packagedFiles } : {},
4398
4423
  ...request.force ? { force: true } : {},
4399
4424
  ...forceToolRefresh ? { forceToolRefresh: true } : {},
4425
+ ...typeof request.maxConcurrentExternalCalls === "number" ? { maxConcurrentExternalCalls: request.maxConcurrentExternalCalls } : {},
4426
+ ...typeof request.maxConcurrentRows === "number" ? { maxConcurrentRows: request.maxConcurrentRows } : {},
4400
4427
  ...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
4401
4428
  ...request.profile ? { profile: request.profile } : {},
4402
4429
  ...integrationMode ? { integrationMode } : {},
package/dist/index.mjs CHANGED
@@ -689,7 +689,7 @@ var SDK_RELEASE = {
689
689
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
690
690
  // exposed storage-dependent synchronous access. This deliberate minor
691
691
  // release keeps lazy paging semantics independent of row residency.
692
- version: "0.2.55",
692
+ version: "0.2.57",
693
693
  contracts: {
694
694
  api: {
695
695
  name: "sdk-http-api",
@@ -1272,9 +1272,26 @@ var HttpClient = class {
1272
1272
  if (error instanceof AuthError || error instanceof DeeplineError) {
1273
1273
  throw error;
1274
1274
  }
1275
- lastError = error instanceof Error ? error : new Error(String(error));
1275
+ const normalized = error instanceof Error ? error : new Error(String(error));
1276
+ if (isAbortLikeError(normalized) && options?.signal?.aborted) {
1277
+ throw new DeeplineError(
1278
+ `Stream from ${this.config.baseUrl} was aborted by the caller.`,
1279
+ void 0,
1280
+ "ABORTED"
1281
+ );
1282
+ }
1283
+ lastError = normalized;
1276
1284
  }
1277
1285
  }
1286
+ if (lastError && isAbortLikeError(lastError)) {
1287
+ throw new DeeplineError(
1288
+ withCoworkNetworkHint(
1289
+ `Unable to stream from ${this.config.baseUrl}. The remote stream was interrupted.`
1290
+ ),
1291
+ void 0,
1292
+ "PLAY_STREAM_NETWORK_ABORTED"
1293
+ );
1294
+ }
1278
1295
  throw new DeeplineError(
1279
1296
  withCoworkNetworkHint(
1280
1297
  lastError?.message ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
@@ -1537,6 +1554,9 @@ function streamReconnectDelayMs(attempt) {
1537
1554
  return Math.max(1, Math.floor(Math.random() * (cappedExponentialMs + 1)));
1538
1555
  }
1539
1556
  function isTransientPlayStreamError(error) {
1557
+ if (error instanceof DeeplineError && error.code === "PLAY_STREAM_NETWORK_ABORTED") {
1558
+ return true;
1559
+ }
1540
1560
  if (error instanceof DeeplineError && typeof error.statusCode === "number") {
1541
1561
  return error.statusCode >= 500 && error.statusCode < 600;
1542
1562
  }
@@ -1689,6 +1709,7 @@ var RUNTIME_RECEIPT_OUTPUT_MAX_BYTES = 10 * 1024 * 1024;
1689
1709
  var RUNTIME_RECEIPT_COMPLETION_BUFFER_MAX_BYTES = 32 * 1024 * 1024;
1690
1710
  var RUNNER_TERMINAL_PUSH_MAX_BODY_BYTES = 16 * 1024 * 1024;
1691
1711
  var RUNTIME_RECEIPT_GATEWAY_BATCH_MAX_BYTES = 12 * 1024 * 1024;
1712
+ var RUNTIME_RECEIPT_WRITER_TARGET_BATCH_BYTES = 4 * 1024 * 1024;
1692
1713
  var RUNNER_POST_TERMINAL_DIAGNOSTIC_MAX_BYTES = 64 * 1024;
1693
1714
 
1694
1715
  // ../shared_libs/play-runtime/ledger-safe-payload.ts
@@ -4271,6 +4292,10 @@ var DeeplineClient = class {
4271
4292
  ...request.packagedFiles?.length ? { packagedFiles: request.packagedFiles } : {},
4272
4293
  ...request.force ? { force: true } : {},
4273
4294
  ...forceToolRefresh ? { forceToolRefresh: true } : {},
4295
+ ...typeof request.maxConcurrentExternalCalls === "number" ? {
4296
+ maxConcurrentExternalCalls: request.maxConcurrentExternalCalls
4297
+ } : {},
4298
+ ...typeof request.maxConcurrentRows === "number" ? { maxConcurrentRows: request.maxConcurrentRows } : {},
4274
4299
  ...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
4275
4300
  // Profile selection is the API's job, not the CLI's. The server
4276
4301
  // defaults to absurd; callers normally omit this field.
@@ -4323,6 +4348,8 @@ var DeeplineClient = class {
4323
4348
  ...request.packagedFiles?.length ? { packagedFiles: request.packagedFiles } : {},
4324
4349
  ...request.force ? { force: true } : {},
4325
4350
  ...forceToolRefresh ? { forceToolRefresh: true } : {},
4351
+ ...typeof request.maxConcurrentExternalCalls === "number" ? { maxConcurrentExternalCalls: request.maxConcurrentExternalCalls } : {},
4352
+ ...typeof request.maxConcurrentRows === "number" ? { maxConcurrentRows: request.maxConcurrentRows } : {},
4326
4353
  ...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
4327
4354
  ...request.profile ? { profile: request.profile } : {},
4328
4355
  ...integrationMode ? { integrationMode } : {},
@@ -225,8 +225,8 @@
225
225
  "dist/cli/index.d.ts",
226
226
  "dist/cli/index.js",
227
227
  "dist/cli/index.mjs",
228
- "dist/compiler-manifest-Bl8kmLx9.d.mts",
229
- "dist/compiler-manifest-Bl8kmLx9.d.ts",
228
+ "dist/compiler-manifest-TgaC4DeD.d.mts",
229
+ "dist/compiler-manifest-TgaC4DeD.d.ts",
230
230
  "dist/helpers.d.mts",
231
231
  "dist/helpers.d.ts",
232
232
  "dist/helpers.js",
@@ -1,5 +1,5 @@
1
- import { T as ToolExecutionErrorSchemaVersion, P as PlayAuthoringContractEdition, a as PlayArtifactKind$1, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-Bl8kmLx9.mjs';
2
- export { d as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-Bl8kmLx9.mjs';
1
+ import { T as ToolExecutionErrorSchemaVersion, P as PlayAuthoringContractEdition, a as PlayArtifactKind$1, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-TgaC4DeD.mjs';
2
+ export { d as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-TgaC4DeD.mjs';
3
3
  import '@sinclair/typebox';
4
4
 
5
5
  type PlayPackageImport = {
@@ -1,5 +1,5 @@
1
- import { T as ToolExecutionErrorSchemaVersion, P as PlayAuthoringContractEdition, a as PlayArtifactKind$1, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-Bl8kmLx9.js';
2
- export { d as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-Bl8kmLx9.js';
1
+ import { T as ToolExecutionErrorSchemaVersion, P as PlayAuthoringContractEdition, a as PlayArtifactKind$1, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-TgaC4DeD.js';
2
+ export { d as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-TgaC4DeD.js';
3
3
  import '@sinclair/typebox';
4
4
 
5
5
  type PlayPackageImport = {
@@ -4059,6 +4059,12 @@ function isDefinePlayCall(node) {
4059
4059
  }
4060
4060
  return false;
4061
4061
  }
4062
+ function definePlayName(node) {
4063
+ const expression = unwrapStaticExpression(node);
4064
+ if (!expression || expression.type !== "CallExpression") return null;
4065
+ const first = astArray(expression.arguments)[0] ?? null;
4066
+ return first?.type === "Literal" && typeof first.value === "string" ? first.value : null;
4067
+ }
4062
4068
  function listPlayFileExports(sourceCode) {
4063
4069
  const ast = parsePlaySourceForAnalysis(sourceCode);
4064
4070
  if (!ast) return null;
@@ -4108,13 +4114,24 @@ function listPlayFileExports(sourceCode) {
4108
4114
  if (defaultIsPlay) {
4109
4115
  const aliases = defaultLocalName ? [...namedExports.entries()].filter(([, local]) => local === defaultLocalName).map(([exported]) => exported) : [];
4110
4116
  if (defaultLocalName) aliasedLocals.add(defaultLocalName);
4111
- exports.push({ name: PLAY_DEFAULT_EXPORT, aliases });
4117
+ exports.push({
4118
+ name: PLAY_DEFAULT_EXPORT,
4119
+ aliases,
4120
+ playName: definePlayName(
4121
+ defaultLocalName ? declarations.get(defaultLocalName) ?? null : defaultExpression
4122
+ )
4123
+ });
4112
4124
  }
4113
4125
  for (const [exportedName, localName] of namedExports) {
4114
4126
  if (exportedName === PLAY_DEFAULT_EXPORT) continue;
4115
4127
  if (aliasedLocals.has(localName)) continue;
4116
- if (!isDefinePlayCall(declarations.get(localName) ?? null)) continue;
4117
- exports.push({ name: exportedName, aliases: [] });
4128
+ const declaration = declarations.get(localName) ?? null;
4129
+ if (!isDefinePlayCall(declaration)) continue;
4130
+ exports.push({
4131
+ name: exportedName,
4132
+ aliases: [],
4133
+ playName: definePlayName(declaration)
4134
+ });
4118
4135
  }
4119
4136
  return exports;
4120
4137
  }
@@ -4125,10 +4142,17 @@ function canonicalPlayExportName(exportName, exports) {
4125
4142
  return entry.name;
4126
4143
  }
4127
4144
  }
4145
+ for (const entry of exports) {
4146
+ if (entry.playName === requested) return entry.name;
4147
+ }
4128
4148
  return null;
4129
4149
  }
4130
4150
  function playExportNamesForMessage(exports) {
4131
- return exports.flatMap((entry) => [entry.name, ...entry.aliases]);
4151
+ return exports.flatMap((entry) => [
4152
+ ...entry.playName ? [entry.playName] : [],
4153
+ entry.name,
4154
+ ...entry.aliases
4155
+ ]);
4132
4156
  }
4133
4157
 
4134
4158
  // ../shared_libs/plays/docflow.ts
@@ -4150,6 +4174,7 @@ var ATTRIBUTE = /([A-Za-z][\w-]*)\s*:\s*"([^"\n]*)"/y;
4150
4174
  var MERMAID_NODE_ATTRIBUTES = ["label", "type", "in", "out", "arm"];
4151
4175
  var LEGACY_DOCFLOW_ATTRIBUTES = ["id", ...MERMAID_NODE_ATTRIBUTES];
4152
4176
  var MERMAID_NODE_ID = /^[A-Za-z][\w-]*/;
4177
+ var SKETCH_CLASS = /^\s*class\s+([A-Za-z][\w-]*(?:\s*,\s*[A-Za-z][\w-]*)*)\s+sketch\s*;?\s*$/;
4153
4178
  var MERMAID_NODE_SHAPES = [
4154
4179
  ["[[", "]]"],
4155
4180
  ["[(", ")]"],
@@ -4375,7 +4400,7 @@ function inferBindingIo(statement) {
4375
4400
  }
4376
4401
  var MERMAID_BLOCK = /\/\*\*\s*@mermaid(?:\s|\r?\n)([\s\S]*?)\*\//g;
4377
4402
  var LEGACY_BLOCK = /\/\*\*\s*@docflow(?:\s|\r?\n)([\s\S]*?)\*\//;
4378
- var BLOCK_EXPORT_HEADER = /^[A-Za-z_$][\w$]*$/;
4403
+ var BLOCK_EXPORT_HEADER = /^[A-Za-z_$][\w$-]*$/;
4379
4404
  function cleanBlockBody(raw) {
4380
4405
  return raw.split(/\r?\n/).map((line) => /^\s*\*/.test(line) ? line.replace(/^\s*\* ?/, "") : line).join("\n").trim();
4381
4406
  }
@@ -4407,6 +4432,7 @@ function parseDocflowBlockGraph(mermaidSource, syntax, errors) {
4407
4432
  const edges = [];
4408
4433
  const subgraphs = /* @__PURE__ */ new Map();
4409
4434
  const ignoredDirectives = [];
4435
+ const sketchIds = /* @__PURE__ */ new Set();
4410
4436
  const subgraphStack = [];
4411
4437
  const subgraphIds = /* @__PURE__ */ new Set();
4412
4438
  if (syntax === "mermaid") {
@@ -4483,7 +4509,15 @@ function parseDocflowBlockGraph(mermaidSource, syntax, errors) {
4483
4509
  let declaredOnThisLine = false;
4484
4510
  const isDirective = /^\s*(?:direction|classDef|class|style|linkStyle|click)\b/i.test(line);
4485
4511
  if (syntax === "mermaid" && isDirective) {
4486
- ignoredDirectives.push(line.trim());
4512
+ const sketch = SKETCH_CLASS.exec(line);
4513
+ if (sketch) {
4514
+ for (const id of sketch[1].split(",")) {
4515
+ const trimmed = id.trim();
4516
+ if (trimmed) sketchIds.add(trimmed);
4517
+ }
4518
+ } else {
4519
+ ignoredDirectives.push(line.trim());
4520
+ }
4487
4521
  }
4488
4522
  if (syntax === "mermaid" && !isDirective) {
4489
4523
  declaredOnThisLine = addNodes(line, line);
@@ -4532,7 +4566,17 @@ function parseDocflowBlockGraph(mermaidSource, syntax, errors) {
4532
4566
  `Docflow node "${node.id}" is referenced by an edge but never declared with a shape and label, so the canvas would show its id. Declare it once, e.g. \`${node.id}["What this step does"]\`.`
4533
4567
  );
4534
4568
  }
4535
- return { direction, nodes, edges, subgraphs, ignoredDirectives };
4569
+ for (const id of sketchIds) {
4570
+ const node = nodes.get(id);
4571
+ if (!node) {
4572
+ errors.push(
4573
+ subgraphs.has(id) ? `Docflow \`class ${id} sketch\` names a subgraph. A subgraph is a region, not a box, and never binds code \u2014 drop it from the class line.` : `Docflow \`class ${id} sketch\` names "${id}", which this diagram does not draw.`
4574
+ );
4575
+ continue;
4576
+ }
4577
+ node.sketch = true;
4578
+ }
4579
+ return { direction, nodes, edges, subgraphs, ignoredDirectives, sketchIds };
4536
4580
  }
4537
4581
  function materializeDocflow(block) {
4538
4582
  return {
@@ -4548,7 +4592,8 @@ function materializeDocflow(block) {
4548
4592
  }
4549
4593
  function parsePlayDocflowFile(sourceCode) {
4550
4594
  const errors = [];
4551
- const bindings = parseDocflowBindings(sourceCode, errors);
4595
+ const rejectedNodeIds = /* @__PURE__ */ new Set();
4596
+ const bindings = parseDocflowBindings(sourceCode, errors, rejectedNodeIds);
4552
4597
  const rawBlocks = [];
4553
4598
  MERMAID_BLOCK.lastIndex = 0;
4554
4599
  for (const match of sourceCode.matchAll(MERMAID_BLOCK)) {
@@ -4576,7 +4621,13 @@ function parsePlayDocflowFile(sourceCode) {
4576
4621
  });
4577
4622
  }
4578
4623
  resolveBlockExports(sourceCode, parsedBlocks, errors);
4579
- attachBindingsToBlocks(sourceCode, parsedBlocks, bindings, errors);
4624
+ attachBindingsToBlocks(
4625
+ sourceCode,
4626
+ parsedBlocks,
4627
+ bindings,
4628
+ errors,
4629
+ rejectedNodeIds
4630
+ );
4580
4631
  return {
4581
4632
  blocks: parsedBlocks.filter((block) => block.exportName !== null).map((block) => ({
4582
4633
  exportName: block.exportName,
@@ -4723,7 +4774,7 @@ function projectRecordedArms(block, errors) {
4723
4774
  edge.arm = binding.arm;
4724
4775
  }
4725
4776
  }
4726
- function attachBindingsToBlocks(sourceCode, blocks, bindings, errors) {
4777
+ function attachBindingsToBlocks(sourceCode, blocks, bindings, errors, rejectedNodeIds) {
4727
4778
  const lineStarts = sourceLineStartsForDocflow(sourceCode);
4728
4779
  const exportRanges = playExportSourceRanges(sourceCode);
4729
4780
  for (const binding of bindings) {
@@ -4764,17 +4815,22 @@ function attachBindingsToBlocks(sourceCode, blocks, bindings, errors) {
4764
4815
  for (const binding of block.bindings) {
4765
4816
  const node = block.nodes.get(binding.nodeId);
4766
4817
  if (binding.label) node.label = binding.label;
4818
+ if (block.sketchIds.has(binding.nodeId)) {
4819
+ errors.push(
4820
+ `Docflow box "${binding.nodeId}" is declared \`class ${binding.nodeId} sketch\` and also bound by \`// @mermaid-node ${binding.nodeId}\` on line ${binding.line}. It is one or the other: drop it from the class line, or drop the annotation.`
4821
+ );
4822
+ continue;
4823
+ }
4767
4824
  if (binding.kind) node.kind = binding.kind;
4768
4825
  }
4769
4826
  projectRecordedArms(block, errors);
4770
- if (block.syntax !== "docflow") continue;
4771
4827
  const bound = new Set(block.bindings.map((binding) => binding.nodeId));
4772
4828
  for (const node of block.nodes.values()) {
4773
- if (node.kind !== "conceptual" && !bound.has(node.id)) {
4774
- errors.push(
4775
- `Docflow node "${node.id}" has no code binding; mark it type:"conceptual" or bind it.`
4776
- );
4777
- }
4829
+ if (node.sketch || node.kind === "conceptual" || bound.has(node.id) || rejectedNodeIds.has(node.id))
4830
+ continue;
4831
+ errors.push(
4832
+ block.syntax === "docflow" ? `Docflow node "${node.id}" has no code binding; mark it type:"conceptual" or bind it.` : `Docflow box "${node.id}" in \`${blockLabel(block)}\` points at nothing, so the canvas can only draw it and say nothing about it. Either put \`// @mermaid-node ${node.id}\` above the statement it runs, or \u2014 if this play has no such statement, because the work happens in another module or inside a loop \u2014 add it to a \`class ${node.id} sketch\` line in the block to declare it a sketch.`
4833
+ );
4778
4834
  }
4779
4835
  }
4780
4836
  }
@@ -4785,7 +4841,7 @@ function sourceLineStartsForDocflow(sourceCode) {
4785
4841
  }
4786
4842
  return starts;
4787
4843
  }
4788
- function parseDocflowBindings(sourceCode, errors) {
4844
+ function parseDocflowBindings(sourceCode, errors, rejectedNodeIds) {
4789
4845
  const lines = sourceCode.split(/\r?\n/);
4790
4846
  const bindings = [];
4791
4847
  for (let index = 0; index < lines.length; index += 1) {
@@ -4794,6 +4850,8 @@ function parseDocflowBindings(sourceCode, errors) {
4794
4850
  const legacyMatch = PUT.exec(lines[index]);
4795
4851
  const mermaidMatch = MERMAID_NODE.exec(lines[index]);
4796
4852
  if (!legacyMatch && !mermaidMatch) continue;
4853
+ const annotatedId = mermaidMatch?.[1]?.trim();
4854
+ if (annotatedId) rejectedNodeIds.add(annotatedId);
4797
4855
  const attributes = parseAttributes(
4798
4856
  mermaidMatch ? mermaidMatch[2] ?? "" : legacyMatch[1],
4799
4857
  {
@@ -4803,11 +4861,12 @@ function parseDocflowBindings(sourceCode, errors) {
4803
4861
  }
4804
4862
  );
4805
4863
  if (!attributes) continue;
4806
- const id = (mermaidMatch ? mermaidMatch[1] : attributes.id)?.trim();
4864
+ const id = (annotatedId ?? attributes.id)?.trim();
4807
4865
  if (!id) {
4808
4866
  errors.push(`Docflow annotation on line ${index + 1} requires id:"\u2026".`);
4809
4867
  continue;
4810
4868
  }
4869
+ rejectedNodeIds.add(id);
4811
4870
  const kind = nodeKind(attributes.type);
4812
4871
  if (attributes.type && !kind) {
4813
4872
  errors.push(
@@ -4853,6 +4912,7 @@ function parseDocflowBindings(sourceCode, errors) {
4853
4912
  ...outputs ? { outputs } : {},
4854
4913
  ioConfidence: "explicit"
4855
4914
  } : inferBindingIo(lines[nextLine]);
4915
+ rejectedNodeIds.delete(id);
4856
4916
  bindings.push({
4857
4917
  nodeId: id,
4858
4918
  line: nextLine + 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.2.55",
3
+ "version": "0.2.57",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {