deepline 0.1.302 → 0.1.304
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/errors.ts +40 -22
- package/dist/bundling-sources/sdk/src/index.ts +9 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result-paths.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result-types.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +33 -24
- package/dist/bundling-sources/shared_libs/tool-execution-error.ts +132 -3
- package/dist/cli/index.js +64 -13
- package/dist/cli/index.mjs +64 -13
- package/dist/index.d.mts +32 -24
- package/dist/index.d.ts +32 -24
- package/dist/index.js +87 -22
- package/dist/index.mjs +87 -22
- package/dist/plays/bundle-play-file.d.mts +2 -2
- package/dist/plays/bundle-play-file.d.ts +2 -2
- package/dist/{tool-execution-error-9mH4i-mJ.d.mts → tool-execution-error-YDz7UMl-.d.mts} +127 -5
- package/dist/{tool-execution-error-9mH4i-mJ.d.ts → tool-execution-error-YDz7UMl-.d.ts} +127 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -222,33 +222,68 @@ function applyBrand(value, brand) {
|
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
var DeeplineError = class _DeeplineError extends Error {
|
|
225
|
+
/** HTTP status when the failure crossed an HTTP boundary. */
|
|
226
|
+
statusCode;
|
|
227
|
+
/** Stable machine-readable error code when one exists. */
|
|
228
|
+
code;
|
|
229
|
+
/** Local diagnostic context; not a portable error contract. */
|
|
230
|
+
details;
|
|
231
|
+
/**
|
|
232
|
+
* Construct a Deepline error.
|
|
233
|
+
*
|
|
234
|
+
* SDK and runtime code construct these errors. Application and Play code
|
|
235
|
+
* normally catches the public subclasses instead.
|
|
236
|
+
*
|
|
237
|
+
* @param message Human-readable failure summary.
|
|
238
|
+
* @param statusCode HTTP status when one exists.
|
|
239
|
+
* @param code Stable machine-readable code when one exists.
|
|
240
|
+
* @param details Local diagnostic context; never a portable error contract.
|
|
241
|
+
*/
|
|
225
242
|
constructor(message, statusCode, code, details) {
|
|
226
243
|
super(message);
|
|
244
|
+
this.name = "DeeplineError";
|
|
227
245
|
this.statusCode = statusCode;
|
|
228
246
|
this.code = code;
|
|
229
247
|
this.details = details;
|
|
230
|
-
this.name = "DeeplineError";
|
|
231
248
|
applyBrand(this, DEEPLINE_ERROR_BRAND);
|
|
232
249
|
}
|
|
233
|
-
statusCode;
|
|
234
|
-
code;
|
|
235
|
-
details;
|
|
236
250
|
static [Symbol.hasInstance](value) {
|
|
237
251
|
if (this !== _DeeplineError) return nativeInstanceOf(this, value);
|
|
238
252
|
return hasBrand(value, DEEPLINE_ERROR_BRAND);
|
|
239
253
|
}
|
|
240
254
|
};
|
|
241
255
|
var ToolExecutionError = class _ToolExecutionError extends DeeplineError {
|
|
256
|
+
/** Public tool id passed to `tools.execute`. */
|
|
242
257
|
toolId;
|
|
258
|
+
/** Provider responsible for the operation, or `null` when unattributed. */
|
|
243
259
|
provider;
|
|
260
|
+
/** Provider operation name, or `null` when unavailable. */
|
|
244
261
|
operation;
|
|
262
|
+
/** Boundary responsible for the failure. */
|
|
245
263
|
origin;
|
|
264
|
+
/** Stable reason family for policy and diagnostics. */
|
|
246
265
|
category;
|
|
266
|
+
/**
|
|
267
|
+
* Whether repeating the same semantic call is delivery-safe.
|
|
268
|
+
*
|
|
269
|
+
* This does not mean the error may be ignored. Waterfall fallthrough is
|
|
270
|
+
* represented by `ProviderTransientError`.
|
|
271
|
+
*/
|
|
247
272
|
retryable;
|
|
273
|
+
/** Provider or Deepline request id, or `null` when unavailable. */
|
|
248
274
|
requestId;
|
|
275
|
+
/** Suggested same-call retry delay in milliseconds, or `null`. */
|
|
249
276
|
retryAfterMs;
|
|
277
|
+
/** Network failure kind, or `null` for non-network failures. */
|
|
250
278
|
networkKind;
|
|
279
|
+
/** Network boundary that failed, or `null` for non-network failures. */
|
|
251
280
|
networkScope;
|
|
281
|
+
/**
|
|
282
|
+
* Construct a structured tool error.
|
|
283
|
+
*
|
|
284
|
+
* Deepline constructs this from the versioned `tool_error` payload.
|
|
285
|
+
* Application and Play code should catch it rather than create it.
|
|
286
|
+
*/
|
|
252
287
|
constructor(message, options) {
|
|
253
288
|
super(
|
|
254
289
|
message,
|
|
@@ -284,7 +319,9 @@ function isProviderTransientFailure(input2) {
|
|
|
284
319
|
return input2.origin === "provider" && (input2.category === "rate_limit" || input2.category === "network" || input2.category === "upstream");
|
|
285
320
|
}
|
|
286
321
|
var ProviderTransientError = class _ProviderTransientError extends ToolExecutionError {
|
|
322
|
+
/** Provider attribution is guaranteed for this subtype. */
|
|
287
323
|
origin = "provider";
|
|
324
|
+
/** Constructed by Deepline when a provider-owned transient failure arrives. */
|
|
288
325
|
constructor(message, options) {
|
|
289
326
|
super(message, {
|
|
290
327
|
...options,
|
|
@@ -438,6 +475,7 @@ function deserializeToolExecutionFailure(message, value, acceptedSchemaVersion)
|
|
|
438
475
|
|
|
439
476
|
// src/errors.ts
|
|
440
477
|
var AuthError = class extends DeeplineError {
|
|
478
|
+
/** Constructed by the SDK when Deepline rejects the caller's credentials. */
|
|
441
479
|
constructor(message = "Authentication failed. Check your DEEPLINE_API_KEY.") {
|
|
442
480
|
super(message, 401, "AUTH_ERROR");
|
|
443
481
|
this.name = "AuthError";
|
|
@@ -446,6 +484,7 @@ var AuthError = class extends DeeplineError {
|
|
|
446
484
|
var RateLimitError = class extends DeeplineError {
|
|
447
485
|
/** Milliseconds to wait before retrying, from the `Retry-After` response header. Defaults to 5000. */
|
|
448
486
|
retryAfterMs;
|
|
487
|
+
/** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
|
|
449
488
|
constructor(retryAfterMs = 5e3, message) {
|
|
450
489
|
super(
|
|
451
490
|
message ?? `Rate limited. Retry after ${retryAfterMs}ms.`,
|
|
@@ -457,16 +496,27 @@ var RateLimitError = class extends DeeplineError {
|
|
|
457
496
|
}
|
|
458
497
|
};
|
|
459
498
|
var ToolRateLimitError = class extends RateLimitError {
|
|
499
|
+
/** Public tool id passed to `tools.execute`. */
|
|
460
500
|
toolId;
|
|
501
|
+
/** Provider responsible for the operation, or `null`. */
|
|
461
502
|
provider;
|
|
503
|
+
/** Provider operation name, or `null`. */
|
|
462
504
|
operation;
|
|
505
|
+
/** Stable machine-readable failure code when one exists. */
|
|
463
506
|
code;
|
|
507
|
+
/** Boundary responsible for the failure. */
|
|
464
508
|
origin;
|
|
509
|
+
/** Stable reason family for policy and diagnostics. */
|
|
465
510
|
category;
|
|
511
|
+
/** Whether repeating the same semantic call is delivery-safe. */
|
|
466
512
|
retryable;
|
|
513
|
+
/** Provider or Deepline request id, or `null`. */
|
|
467
514
|
requestId;
|
|
515
|
+
/** Network failure kind, or `null` for non-network failures. */
|
|
468
516
|
networkKind;
|
|
517
|
+
/** Network boundary that failed, or `null` for non-network failures. */
|
|
469
518
|
networkScope;
|
|
519
|
+
/** Constructed by the SDK after a structured tool HTTP 429. */
|
|
470
520
|
constructor(message, options) {
|
|
471
521
|
super(options.retryAfterMs ?? 5e3, message);
|
|
472
522
|
this.name = "ToolRateLimitError";
|
|
@@ -489,6 +539,7 @@ var ToolRateLimitError = class extends RateLimitError {
|
|
|
489
539
|
}
|
|
490
540
|
};
|
|
491
541
|
var ConfigError = class extends DeeplineError {
|
|
542
|
+
/** Construct a local SDK configuration failure. */
|
|
492
543
|
constructor(message) {
|
|
493
544
|
super(message, void 0, "CONFIG_ERROR");
|
|
494
545
|
this.name = "ConfigError";
|
|
@@ -986,7 +1037,7 @@ var SDK_RELEASE = {
|
|
|
986
1037
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
987
1038
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
988
1039
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
989
|
-
version: "0.1.
|
|
1040
|
+
version: "0.1.304",
|
|
990
1041
|
contracts: {
|
|
991
1042
|
api: {
|
|
992
1043
|
name: "sdk-http-api",
|
|
@@ -9699,14 +9750,14 @@ function formatDbQueryError(sql, error) {
|
|
|
9699
9750
|
if (referencesStorage && relationMissing) {
|
|
9700
9751
|
return [
|
|
9701
9752
|
"Customer DB query failed: the referenced storage table does not exist.",
|
|
9702
|
-
"Play
|
|
9753
|
+
"Play dataset tables are created only when the corresponding ctx.dataset(...).run(...) call executes. Pilot branches, early returns, and runs that fail before the dataset do not create that table.",
|
|
9703
9754
|
"Use `deepline runs get <run-id> --full --json` to inspect returned dataset handles, then export them with `deepline runs export <run-id> --dataset result.rows --out rows.csv`.",
|
|
9704
9755
|
`Original error: ${errorMessage(error)}`
|
|
9705
9756
|
].join("\n");
|
|
9706
9757
|
}
|
|
9707
9758
|
if (referencesStorage && runIdColumnMissing) {
|
|
9708
9759
|
return [
|
|
9709
|
-
"Customer DB query failed: storage
|
|
9760
|
+
"Customer DB query failed: storage dataset tables use `_run_id`, not `run_id`.",
|
|
9710
9761
|
"Prefer `deepline runs export <run-id> --dataset result.rows --out rows.csv` unless you are doing deep table debugging.",
|
|
9711
9762
|
`Original error: ${errorMessage(error)}`
|
|
9712
9763
|
].join("\n");
|
|
@@ -11160,7 +11211,7 @@ function assertComposablePlayRoute(input2) {
|
|
|
11160
11211
|
if (!input2.playRef || !playUsesMapBackedRuntime(input2.play)) return;
|
|
11161
11212
|
const runCommand2 = input2.play?.runCommand?.trim() || `deepline plays run ${input2.playRef} --input '{...}' --watch`;
|
|
11162
11213
|
throw new PlayBootstrapValidationError(
|
|
11163
|
-
`Cannot use ${input2.stageLabel} play:${input2.playRef} in plays bootstrap composition: the selected play is
|
|
11214
|
+
`Cannot use ${input2.stageLabel} play:${input2.playRef} in plays bootstrap composition: the selected play is dataset-backed/direct-run-only. Child plays that use ctx.dataset() own durable table state and must be run directly, exported, or validated as their own play instead of wrapped with ctx.runPlay. Run it directly first: ${runCommand2}`
|
|
11164
11215
|
);
|
|
11165
11216
|
}
|
|
11166
11217
|
function sourcePlayNeedsExportFirst(input2) {
|
|
@@ -11201,7 +11252,7 @@ function generatePlaySourceRowsBlock(input2) {
|
|
|
11201
11252
|
})) {
|
|
11202
11253
|
const sourcePlay = input2.sourcePlay;
|
|
11203
11254
|
const runCommand2 = sourcePlay?.runCommand?.trim() || `deepline plays run ${input2.source.value} --input '{...}' --watch`;
|
|
11204
|
-
return `// Source play ${input2.source.value} is
|
|
11255
|
+
return `// Source play ${input2.source.value} is dataset-backed/direct-run-only, so this generated play is stage 2.
|
|
11205
11256
|
// Stage 1:
|
|
11206
11257
|
// ${runCommand2}
|
|
11207
11258
|
// Stage 2:
|
|
@@ -11932,8 +11983,8 @@ var EXTRACTED_GETTER_ERROR_HINT = "Deepline hint: extractedValues/extractedLists
|
|
|
11932
11983
|
var DATASET_API_HINT = "Deepline hint: PlayDataset is lazy and durable. Use `.peek(n)` for a small preview or `.materialize()` when you intentionally need rows in memory; do not use `.rows`, `.toArray()`, or array methods directly on the dataset handle.";
|
|
11933
11984
|
var ROW_PROPERTY_HINT = "Deepline hint: this row type only contains fields produced by the CSV/schema and previous map steps. Check source column casing and the exact output field names from earlier steps before scaling.";
|
|
11934
11985
|
var TOOLS_EXECUTE_SIGNATURE_HINT = "Deepline hint: ctx.tools.execute requires a request object: `ctx.tools.execute({ id, tool, input, description })`. The stable `id` is required for logs, metadata, and receipt attachment; provider-call reuse is based on play, tool, semantic input, auth scope, provider action version, and cache policy.";
|
|
11935
|
-
var RUN_PLAY_SIGNATURE_HINT = "Deepline hint: ctx.runPlay uses a stable key plus a composable child play reference. Direct-run-only or
|
|
11936
|
-
var MAP_BACKED_CHILD_HINT = "Deepline hint:
|
|
11986
|
+
var RUN_PLAY_SIGNATURE_HINT = "Deepline hint: ctx.runPlay uses a stable key plus a composable child play reference. Direct-run-only or dataset-backed batch plays must be run directly, exported, then consumed by a separate play.";
|
|
11987
|
+
var MAP_BACKED_CHILD_HINT = "Deepline hint: dataset-backed child plays own durable table state and cannot be called from another play. Run that play directly, export its dataset, then pass the CSV to the next play.";
|
|
11937
11988
|
function sourceLineForError(sourceCode, error) {
|
|
11938
11989
|
const match = error.match(/:(\d+):(\d+)\s/);
|
|
11939
11990
|
const lineNumber = match?.[1] ? Number(match[1]) : NaN;
|
|
@@ -11963,7 +12014,7 @@ function looksLikeRunPlaySignature(error, sourceLine) {
|
|
|
11963
12014
|
return /ctx\.runPlay/i.test(error) || /(?:Expected|Argument of type|No overload matches)/.test(error) && /\brunPlay\(/.test(sourceLine);
|
|
11964
12015
|
}
|
|
11965
12016
|
function looksLikeMapBackedChild(error) {
|
|
11966
|
-
return /map-backed child play|direct-run-only|cannot call a map-backed|own durable table/i.test(
|
|
12017
|
+
return /(?:map|dataset)-backed child play|direct-run-only|cannot call a (?:map|dataset)-backed|own durable table/i.test(
|
|
11967
12018
|
error
|
|
11968
12019
|
);
|
|
11969
12020
|
}
|
|
@@ -13433,7 +13484,7 @@ function emitLiveDebugTableHints(input2) {
|
|
|
13433
13484
|
}
|
|
13434
13485
|
input2.state.emittedDebugKeys.add(tableKey);
|
|
13435
13486
|
input2.progress.writeLine(
|
|
13436
|
-
`Possible
|
|
13487
|
+
`Possible dataset table ${tableNamespace}: created only after this ctx.dataset(...).run(...) executes. Inspect returned datasets with ${buildRunInspectCommand(input2.runId)}`,
|
|
13437
13488
|
process.stdout
|
|
13438
13489
|
);
|
|
13439
13490
|
}
|
package/dist/cli/index.mjs
CHANGED
|
@@ -207,33 +207,68 @@ function applyBrand(value, brand) {
|
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
var DeeplineError = class _DeeplineError extends Error {
|
|
210
|
+
/** HTTP status when the failure crossed an HTTP boundary. */
|
|
211
|
+
statusCode;
|
|
212
|
+
/** Stable machine-readable error code when one exists. */
|
|
213
|
+
code;
|
|
214
|
+
/** Local diagnostic context; not a portable error contract. */
|
|
215
|
+
details;
|
|
216
|
+
/**
|
|
217
|
+
* Construct a Deepline error.
|
|
218
|
+
*
|
|
219
|
+
* SDK and runtime code construct these errors. Application and Play code
|
|
220
|
+
* normally catches the public subclasses instead.
|
|
221
|
+
*
|
|
222
|
+
* @param message Human-readable failure summary.
|
|
223
|
+
* @param statusCode HTTP status when one exists.
|
|
224
|
+
* @param code Stable machine-readable code when one exists.
|
|
225
|
+
* @param details Local diagnostic context; never a portable error contract.
|
|
226
|
+
*/
|
|
210
227
|
constructor(message, statusCode, code, details) {
|
|
211
228
|
super(message);
|
|
229
|
+
this.name = "DeeplineError";
|
|
212
230
|
this.statusCode = statusCode;
|
|
213
231
|
this.code = code;
|
|
214
232
|
this.details = details;
|
|
215
|
-
this.name = "DeeplineError";
|
|
216
233
|
applyBrand(this, DEEPLINE_ERROR_BRAND);
|
|
217
234
|
}
|
|
218
|
-
statusCode;
|
|
219
|
-
code;
|
|
220
|
-
details;
|
|
221
235
|
static [Symbol.hasInstance](value) {
|
|
222
236
|
if (this !== _DeeplineError) return nativeInstanceOf(this, value);
|
|
223
237
|
return hasBrand(value, DEEPLINE_ERROR_BRAND);
|
|
224
238
|
}
|
|
225
239
|
};
|
|
226
240
|
var ToolExecutionError = class _ToolExecutionError extends DeeplineError {
|
|
241
|
+
/** Public tool id passed to `tools.execute`. */
|
|
227
242
|
toolId;
|
|
243
|
+
/** Provider responsible for the operation, or `null` when unattributed. */
|
|
228
244
|
provider;
|
|
245
|
+
/** Provider operation name, or `null` when unavailable. */
|
|
229
246
|
operation;
|
|
247
|
+
/** Boundary responsible for the failure. */
|
|
230
248
|
origin;
|
|
249
|
+
/** Stable reason family for policy and diagnostics. */
|
|
231
250
|
category;
|
|
251
|
+
/**
|
|
252
|
+
* Whether repeating the same semantic call is delivery-safe.
|
|
253
|
+
*
|
|
254
|
+
* This does not mean the error may be ignored. Waterfall fallthrough is
|
|
255
|
+
* represented by `ProviderTransientError`.
|
|
256
|
+
*/
|
|
232
257
|
retryable;
|
|
258
|
+
/** Provider or Deepline request id, or `null` when unavailable. */
|
|
233
259
|
requestId;
|
|
260
|
+
/** Suggested same-call retry delay in milliseconds, or `null`. */
|
|
234
261
|
retryAfterMs;
|
|
262
|
+
/** Network failure kind, or `null` for non-network failures. */
|
|
235
263
|
networkKind;
|
|
264
|
+
/** Network boundary that failed, or `null` for non-network failures. */
|
|
236
265
|
networkScope;
|
|
266
|
+
/**
|
|
267
|
+
* Construct a structured tool error.
|
|
268
|
+
*
|
|
269
|
+
* Deepline constructs this from the versioned `tool_error` payload.
|
|
270
|
+
* Application and Play code should catch it rather than create it.
|
|
271
|
+
*/
|
|
237
272
|
constructor(message, options) {
|
|
238
273
|
super(
|
|
239
274
|
message,
|
|
@@ -269,7 +304,9 @@ function isProviderTransientFailure(input2) {
|
|
|
269
304
|
return input2.origin === "provider" && (input2.category === "rate_limit" || input2.category === "network" || input2.category === "upstream");
|
|
270
305
|
}
|
|
271
306
|
var ProviderTransientError = class _ProviderTransientError extends ToolExecutionError {
|
|
307
|
+
/** Provider attribution is guaranteed for this subtype. */
|
|
272
308
|
origin = "provider";
|
|
309
|
+
/** Constructed by Deepline when a provider-owned transient failure arrives. */
|
|
273
310
|
constructor(message, options) {
|
|
274
311
|
super(message, {
|
|
275
312
|
...options,
|
|
@@ -423,6 +460,7 @@ function deserializeToolExecutionFailure(message, value, acceptedSchemaVersion)
|
|
|
423
460
|
|
|
424
461
|
// src/errors.ts
|
|
425
462
|
var AuthError = class extends DeeplineError {
|
|
463
|
+
/** Constructed by the SDK when Deepline rejects the caller's credentials. */
|
|
426
464
|
constructor(message = "Authentication failed. Check your DEEPLINE_API_KEY.") {
|
|
427
465
|
super(message, 401, "AUTH_ERROR");
|
|
428
466
|
this.name = "AuthError";
|
|
@@ -431,6 +469,7 @@ var AuthError = class extends DeeplineError {
|
|
|
431
469
|
var RateLimitError = class extends DeeplineError {
|
|
432
470
|
/** Milliseconds to wait before retrying, from the `Retry-After` response header. Defaults to 5000. */
|
|
433
471
|
retryAfterMs;
|
|
472
|
+
/** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
|
|
434
473
|
constructor(retryAfterMs = 5e3, message) {
|
|
435
474
|
super(
|
|
436
475
|
message ?? `Rate limited. Retry after ${retryAfterMs}ms.`,
|
|
@@ -442,16 +481,27 @@ var RateLimitError = class extends DeeplineError {
|
|
|
442
481
|
}
|
|
443
482
|
};
|
|
444
483
|
var ToolRateLimitError = class extends RateLimitError {
|
|
484
|
+
/** Public tool id passed to `tools.execute`. */
|
|
445
485
|
toolId;
|
|
486
|
+
/** Provider responsible for the operation, or `null`. */
|
|
446
487
|
provider;
|
|
488
|
+
/** Provider operation name, or `null`. */
|
|
447
489
|
operation;
|
|
490
|
+
/** Stable machine-readable failure code when one exists. */
|
|
448
491
|
code;
|
|
492
|
+
/** Boundary responsible for the failure. */
|
|
449
493
|
origin;
|
|
494
|
+
/** Stable reason family for policy and diagnostics. */
|
|
450
495
|
category;
|
|
496
|
+
/** Whether repeating the same semantic call is delivery-safe. */
|
|
451
497
|
retryable;
|
|
498
|
+
/** Provider or Deepline request id, or `null`. */
|
|
452
499
|
requestId;
|
|
500
|
+
/** Network failure kind, or `null` for non-network failures. */
|
|
453
501
|
networkKind;
|
|
502
|
+
/** Network boundary that failed, or `null` for non-network failures. */
|
|
454
503
|
networkScope;
|
|
504
|
+
/** Constructed by the SDK after a structured tool HTTP 429. */
|
|
455
505
|
constructor(message, options) {
|
|
456
506
|
super(options.retryAfterMs ?? 5e3, message);
|
|
457
507
|
this.name = "ToolRateLimitError";
|
|
@@ -474,6 +524,7 @@ var ToolRateLimitError = class extends RateLimitError {
|
|
|
474
524
|
}
|
|
475
525
|
};
|
|
476
526
|
var ConfigError = class extends DeeplineError {
|
|
527
|
+
/** Construct a local SDK configuration failure. */
|
|
477
528
|
constructor(message) {
|
|
478
529
|
super(message, void 0, "CONFIG_ERROR");
|
|
479
530
|
this.name = "ConfigError";
|
|
@@ -971,7 +1022,7 @@ var SDK_RELEASE = {
|
|
|
971
1022
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
972
1023
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
973
1024
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
974
|
-
version: "0.1.
|
|
1025
|
+
version: "0.1.304",
|
|
975
1026
|
contracts: {
|
|
976
1027
|
api: {
|
|
977
1028
|
name: "sdk-http-api",
|
|
@@ -9704,14 +9755,14 @@ function formatDbQueryError(sql, error) {
|
|
|
9704
9755
|
if (referencesStorage && relationMissing) {
|
|
9705
9756
|
return [
|
|
9706
9757
|
"Customer DB query failed: the referenced storage table does not exist.",
|
|
9707
|
-
"Play
|
|
9758
|
+
"Play dataset tables are created only when the corresponding ctx.dataset(...).run(...) call executes. Pilot branches, early returns, and runs that fail before the dataset do not create that table.",
|
|
9708
9759
|
"Use `deepline runs get <run-id> --full --json` to inspect returned dataset handles, then export them with `deepline runs export <run-id> --dataset result.rows --out rows.csv`.",
|
|
9709
9760
|
`Original error: ${errorMessage(error)}`
|
|
9710
9761
|
].join("\n");
|
|
9711
9762
|
}
|
|
9712
9763
|
if (referencesStorage && runIdColumnMissing) {
|
|
9713
9764
|
return [
|
|
9714
|
-
"Customer DB query failed: storage
|
|
9765
|
+
"Customer DB query failed: storage dataset tables use `_run_id`, not `run_id`.",
|
|
9715
9766
|
"Prefer `deepline runs export <run-id> --dataset result.rows --out rows.csv` unless you are doing deep table debugging.",
|
|
9716
9767
|
`Original error: ${errorMessage(error)}`
|
|
9717
9768
|
].join("\n");
|
|
@@ -11189,7 +11240,7 @@ function assertComposablePlayRoute(input2) {
|
|
|
11189
11240
|
if (!input2.playRef || !playUsesMapBackedRuntime(input2.play)) return;
|
|
11190
11241
|
const runCommand2 = input2.play?.runCommand?.trim() || `deepline plays run ${input2.playRef} --input '{...}' --watch`;
|
|
11191
11242
|
throw new PlayBootstrapValidationError(
|
|
11192
|
-
`Cannot use ${input2.stageLabel} play:${input2.playRef} in plays bootstrap composition: the selected play is
|
|
11243
|
+
`Cannot use ${input2.stageLabel} play:${input2.playRef} in plays bootstrap composition: the selected play is dataset-backed/direct-run-only. Child plays that use ctx.dataset() own durable table state and must be run directly, exported, or validated as their own play instead of wrapped with ctx.runPlay. Run it directly first: ${runCommand2}`
|
|
11193
11244
|
);
|
|
11194
11245
|
}
|
|
11195
11246
|
function sourcePlayNeedsExportFirst(input2) {
|
|
@@ -11230,7 +11281,7 @@ function generatePlaySourceRowsBlock(input2) {
|
|
|
11230
11281
|
})) {
|
|
11231
11282
|
const sourcePlay = input2.sourcePlay;
|
|
11232
11283
|
const runCommand2 = sourcePlay?.runCommand?.trim() || `deepline plays run ${input2.source.value} --input '{...}' --watch`;
|
|
11233
|
-
return `// Source play ${input2.source.value} is
|
|
11284
|
+
return `// Source play ${input2.source.value} is dataset-backed/direct-run-only, so this generated play is stage 2.
|
|
11234
11285
|
// Stage 1:
|
|
11235
11286
|
// ${runCommand2}
|
|
11236
11287
|
// Stage 2:
|
|
@@ -11961,8 +12012,8 @@ var EXTRACTED_GETTER_ERROR_HINT = "Deepline hint: extractedValues/extractedLists
|
|
|
11961
12012
|
var DATASET_API_HINT = "Deepline hint: PlayDataset is lazy and durable. Use `.peek(n)` for a small preview or `.materialize()` when you intentionally need rows in memory; do not use `.rows`, `.toArray()`, or array methods directly on the dataset handle.";
|
|
11962
12013
|
var ROW_PROPERTY_HINT = "Deepline hint: this row type only contains fields produced by the CSV/schema and previous map steps. Check source column casing and the exact output field names from earlier steps before scaling.";
|
|
11963
12014
|
var TOOLS_EXECUTE_SIGNATURE_HINT = "Deepline hint: ctx.tools.execute requires a request object: `ctx.tools.execute({ id, tool, input, description })`. The stable `id` is required for logs, metadata, and receipt attachment; provider-call reuse is based on play, tool, semantic input, auth scope, provider action version, and cache policy.";
|
|
11964
|
-
var RUN_PLAY_SIGNATURE_HINT = "Deepline hint: ctx.runPlay uses a stable key plus a composable child play reference. Direct-run-only or
|
|
11965
|
-
var MAP_BACKED_CHILD_HINT = "Deepline hint:
|
|
12015
|
+
var RUN_PLAY_SIGNATURE_HINT = "Deepline hint: ctx.runPlay uses a stable key plus a composable child play reference. Direct-run-only or dataset-backed batch plays must be run directly, exported, then consumed by a separate play.";
|
|
12016
|
+
var MAP_BACKED_CHILD_HINT = "Deepline hint: dataset-backed child plays own durable table state and cannot be called from another play. Run that play directly, export its dataset, then pass the CSV to the next play.";
|
|
11966
12017
|
function sourceLineForError(sourceCode, error) {
|
|
11967
12018
|
const match = error.match(/:(\d+):(\d+)\s/);
|
|
11968
12019
|
const lineNumber = match?.[1] ? Number(match[1]) : NaN;
|
|
@@ -11992,7 +12043,7 @@ function looksLikeRunPlaySignature(error, sourceLine) {
|
|
|
11992
12043
|
return /ctx\.runPlay/i.test(error) || /(?:Expected|Argument of type|No overload matches)/.test(error) && /\brunPlay\(/.test(sourceLine);
|
|
11993
12044
|
}
|
|
11994
12045
|
function looksLikeMapBackedChild(error) {
|
|
11995
|
-
return /map-backed child play|direct-run-only|cannot call a map-backed|own durable table/i.test(
|
|
12046
|
+
return /(?:map|dataset)-backed child play|direct-run-only|cannot call a (?:map|dataset)-backed|own durable table/i.test(
|
|
11996
12047
|
error
|
|
11997
12048
|
);
|
|
11998
12049
|
}
|
|
@@ -13462,7 +13513,7 @@ function emitLiveDebugTableHints(input2) {
|
|
|
13462
13513
|
}
|
|
13463
13514
|
input2.state.emittedDebugKeys.add(tableKey);
|
|
13464
13515
|
input2.progress.writeLine(
|
|
13465
|
-
`Possible
|
|
13516
|
+
`Possible dataset table ${tableNamespace}: created only after this ctx.dataset(...).run(...) executes. Inspect returned datasets with ${buildRunInspectCommand(input2.runId)}`,
|
|
13466
13517
|
process.stdout
|
|
13467
13518
|
);
|
|
13468
13519
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as PlayCompilerManifest, D as DeeplineError, c as ToolExecutionError, d as ToolExecutionErrorOptions, T as ToolExecutionErrorSchemaVersion } from './tool-execution-error-
|
|
2
|
-
export { e as ProviderTransientError } from './tool-execution-error-
|
|
1
|
+
import { a as PlayCompilerManifest, D as DeeplineError, c as ToolExecutionError, d as ToolExecutionErrorOptions, T as ToolExecutionErrorSchemaVersion } from './tool-execution-error-YDz7UMl-.mjs';
|
|
2
|
+
export { e as ProviderTransientError, f as ProviderTransientErrorCategory, g as ToolExecutionErrorCategory, h as ToolExecutionErrorOrigin, i as ToolExecutionFailureV1, j as ToolExecutionNetworkKind, k as ToolExecutionNetworkScope } from './tool-execution-error-YDz7UMl-.mjs';
|
|
3
3
|
|
|
4
4
|
type PlayRuntimeSelection = {
|
|
5
5
|
environment: 'preview';
|
|
@@ -3168,28 +3168,6 @@ declare const SDK_VERSION: string;
|
|
|
3168
3168
|
/** @deprecated Transitional wire id for pre-major-header SDKs only. */
|
|
3169
3169
|
declare const SDK_API_CONTRACT: string;
|
|
3170
3170
|
|
|
3171
|
-
/**
|
|
3172
|
-
* Base error class for all Deepline SDK errors.
|
|
3173
|
-
*
|
|
3174
|
-
* Every error thrown by the SDK extends this class, so you can catch all
|
|
3175
|
-
* Deepline-specific errors with a single `catch (e) { if (e instanceof DeeplineError) }`.
|
|
3176
|
-
*
|
|
3177
|
-
* @example
|
|
3178
|
-
* ```typescript
|
|
3179
|
-
* import { DeeplineClient, DeeplineError, AuthError } from 'deepline';
|
|
3180
|
-
*
|
|
3181
|
-
* const client = new DeeplineClient();
|
|
3182
|
-
* try {
|
|
3183
|
-
* await client.executeTool('dropleads_search_people', { query: 'cto' });
|
|
3184
|
-
* } catch (err) {
|
|
3185
|
-
* if (err instanceof AuthError) {
|
|
3186
|
-
* console.error('Bad API key — run: deepline auth register');
|
|
3187
|
-
* } else if (err instanceof DeeplineError) {
|
|
3188
|
-
* console.error(`API error ${err.statusCode}: ${err.message}`);
|
|
3189
|
-
* }
|
|
3190
|
-
* }
|
|
3191
|
-
* ```
|
|
3192
|
-
*/
|
|
3193
3171
|
/**
|
|
3194
3172
|
* Thrown when the API rejects the request due to an invalid or missing API key.
|
|
3195
3173
|
*
|
|
@@ -3211,8 +3189,11 @@ declare const SDK_API_CONTRACT: string;
|
|
|
3211
3189
|
* }
|
|
3212
3190
|
* }
|
|
3213
3191
|
* ```
|
|
3192
|
+
*
|
|
3193
|
+
* @sdkReference errors 090
|
|
3214
3194
|
*/
|
|
3215
3195
|
declare class AuthError extends DeeplineError {
|
|
3196
|
+
/** Constructed by the SDK when Deepline rejects the caller's credentials. */
|
|
3216
3197
|
constructor(message?: string);
|
|
3217
3198
|
}
|
|
3218
3199
|
/**
|
|
@@ -3237,10 +3218,13 @@ declare class AuthError extends DeeplineError {
|
|
|
3237
3218
|
* }
|
|
3238
3219
|
* }
|
|
3239
3220
|
* ```
|
|
3221
|
+
*
|
|
3222
|
+
* @sdkReference errors 100
|
|
3240
3223
|
*/
|
|
3241
3224
|
declare class RateLimitError extends DeeplineError {
|
|
3242
3225
|
/** Milliseconds to wait before retrying, from the `Retry-After` response header. Defaults to 5000. */
|
|
3243
3226
|
retryAfterMs: number;
|
|
3227
|
+
/** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
|
|
3244
3228
|
constructor(retryAfterMs?: number, message?: string);
|
|
3245
3229
|
}
|
|
3246
3230
|
/**
|
|
@@ -3248,18 +3232,37 @@ declare class RateLimitError extends DeeplineError {
|
|
|
3248
3232
|
* structured ToolExecutionError ontology. JavaScript has one prototype chain,
|
|
3249
3233
|
* so this class extends RateLimitError and carries ToolExecutionError's stable
|
|
3250
3234
|
* cross-bundle brand.
|
|
3235
|
+
*
|
|
3236
|
+
* This class appears in external SDK calls after HTTP 429 retries are
|
|
3237
|
+
* exhausted. It also satisfies `instanceof ToolExecutionError` and, for a
|
|
3238
|
+
* provider-owned rate limit, `instanceof ProviderTransientError`. Authored
|
|
3239
|
+
* Plays should use `ProviderTransientError`; they do not need this
|
|
3240
|
+
* compatibility class.
|
|
3241
|
+
*
|
|
3242
|
+
* @sdkReference errors 110
|
|
3251
3243
|
*/
|
|
3252
3244
|
declare class ToolRateLimitError extends RateLimitError {
|
|
3245
|
+
/** Public tool id passed to `tools.execute`. */
|
|
3253
3246
|
readonly toolId: string;
|
|
3247
|
+
/** Provider responsible for the operation, or `null`. */
|
|
3254
3248
|
readonly provider: string | null;
|
|
3249
|
+
/** Provider operation name, or `null`. */
|
|
3255
3250
|
readonly operation: string | null;
|
|
3251
|
+
/** Stable machine-readable failure code when one exists. */
|
|
3256
3252
|
readonly code: string | undefined;
|
|
3253
|
+
/** Boundary responsible for the failure. */
|
|
3257
3254
|
readonly origin: ToolExecutionError['origin'];
|
|
3255
|
+
/** Stable reason family for policy and diagnostics. */
|
|
3258
3256
|
readonly category: ToolExecutionError['category'];
|
|
3257
|
+
/** Whether repeating the same semantic call is delivery-safe. */
|
|
3259
3258
|
readonly retryable: boolean;
|
|
3259
|
+
/** Provider or Deepline request id, or `null`. */
|
|
3260
3260
|
readonly requestId: string | null;
|
|
3261
|
+
/** Network failure kind, or `null` for non-network failures. */
|
|
3261
3262
|
readonly networkKind: ToolExecutionError['networkKind'];
|
|
3263
|
+
/** Network boundary that failed, or `null` for non-network failures. */
|
|
3262
3264
|
readonly networkScope: ToolExecutionError['networkScope'];
|
|
3265
|
+
/** Constructed by the SDK after a structured tool HTTP 429. */
|
|
3263
3266
|
constructor(message: string, options: ToolExecutionErrorOptions);
|
|
3264
3267
|
}
|
|
3265
3268
|
/**
|
|
@@ -3280,8 +3283,11 @@ declare class ToolRateLimitError extends RateLimitError {
|
|
|
3280
3283
|
* }
|
|
3281
3284
|
* }
|
|
3282
3285
|
* ```
|
|
3286
|
+
*
|
|
3287
|
+
* @sdkReference errors 120
|
|
3283
3288
|
*/
|
|
3284
3289
|
declare class ConfigError extends DeeplineError {
|
|
3290
|
+
/** Construct a local SDK configuration failure. */
|
|
3285
3291
|
constructor(message: string);
|
|
3286
3292
|
}
|
|
3287
3293
|
|
|
@@ -3672,6 +3678,8 @@ type ToolExecuteResultBase<TResult = unknown, TMeta = Record<string, unknown>> =
|
|
|
3672
3678
|
count: number | null;
|
|
3673
3679
|
keys: Record<string, string>;
|
|
3674
3680
|
}>;
|
|
3681
|
+
/** Original declarations preserve semantic accessor names across replay. */
|
|
3682
|
+
listExtractorPaths?: readonly string[];
|
|
3675
3683
|
};
|
|
3676
3684
|
};
|
|
3677
3685
|
type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Partial<DeeplineGetterValueMap>, TLists extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>> = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as PlayCompilerManifest, D as DeeplineError, c as ToolExecutionError, d as ToolExecutionErrorOptions, T as ToolExecutionErrorSchemaVersion } from './tool-execution-error-
|
|
2
|
-
export { e as ProviderTransientError } from './tool-execution-error-
|
|
1
|
+
import { a as PlayCompilerManifest, D as DeeplineError, c as ToolExecutionError, d as ToolExecutionErrorOptions, T as ToolExecutionErrorSchemaVersion } from './tool-execution-error-YDz7UMl-.js';
|
|
2
|
+
export { e as ProviderTransientError, f as ProviderTransientErrorCategory, g as ToolExecutionErrorCategory, h as ToolExecutionErrorOrigin, i as ToolExecutionFailureV1, j as ToolExecutionNetworkKind, k as ToolExecutionNetworkScope } from './tool-execution-error-YDz7UMl-.js';
|
|
3
3
|
|
|
4
4
|
type PlayRuntimeSelection = {
|
|
5
5
|
environment: 'preview';
|
|
@@ -3168,28 +3168,6 @@ declare const SDK_VERSION: string;
|
|
|
3168
3168
|
/** @deprecated Transitional wire id for pre-major-header SDKs only. */
|
|
3169
3169
|
declare const SDK_API_CONTRACT: string;
|
|
3170
3170
|
|
|
3171
|
-
/**
|
|
3172
|
-
* Base error class for all Deepline SDK errors.
|
|
3173
|
-
*
|
|
3174
|
-
* Every error thrown by the SDK extends this class, so you can catch all
|
|
3175
|
-
* Deepline-specific errors with a single `catch (e) { if (e instanceof DeeplineError) }`.
|
|
3176
|
-
*
|
|
3177
|
-
* @example
|
|
3178
|
-
* ```typescript
|
|
3179
|
-
* import { DeeplineClient, DeeplineError, AuthError } from 'deepline';
|
|
3180
|
-
*
|
|
3181
|
-
* const client = new DeeplineClient();
|
|
3182
|
-
* try {
|
|
3183
|
-
* await client.executeTool('dropleads_search_people', { query: 'cto' });
|
|
3184
|
-
* } catch (err) {
|
|
3185
|
-
* if (err instanceof AuthError) {
|
|
3186
|
-
* console.error('Bad API key — run: deepline auth register');
|
|
3187
|
-
* } else if (err instanceof DeeplineError) {
|
|
3188
|
-
* console.error(`API error ${err.statusCode}: ${err.message}`);
|
|
3189
|
-
* }
|
|
3190
|
-
* }
|
|
3191
|
-
* ```
|
|
3192
|
-
*/
|
|
3193
3171
|
/**
|
|
3194
3172
|
* Thrown when the API rejects the request due to an invalid or missing API key.
|
|
3195
3173
|
*
|
|
@@ -3211,8 +3189,11 @@ declare const SDK_API_CONTRACT: string;
|
|
|
3211
3189
|
* }
|
|
3212
3190
|
* }
|
|
3213
3191
|
* ```
|
|
3192
|
+
*
|
|
3193
|
+
* @sdkReference errors 090
|
|
3214
3194
|
*/
|
|
3215
3195
|
declare class AuthError extends DeeplineError {
|
|
3196
|
+
/** Constructed by the SDK when Deepline rejects the caller's credentials. */
|
|
3216
3197
|
constructor(message?: string);
|
|
3217
3198
|
}
|
|
3218
3199
|
/**
|
|
@@ -3237,10 +3218,13 @@ declare class AuthError extends DeeplineError {
|
|
|
3237
3218
|
* }
|
|
3238
3219
|
* }
|
|
3239
3220
|
* ```
|
|
3221
|
+
*
|
|
3222
|
+
* @sdkReference errors 100
|
|
3240
3223
|
*/
|
|
3241
3224
|
declare class RateLimitError extends DeeplineError {
|
|
3242
3225
|
/** Milliseconds to wait before retrying, from the `Retry-After` response header. Defaults to 5000. */
|
|
3243
3226
|
retryAfterMs: number;
|
|
3227
|
+
/** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
|
|
3244
3228
|
constructor(retryAfterMs?: number, message?: string);
|
|
3245
3229
|
}
|
|
3246
3230
|
/**
|
|
@@ -3248,18 +3232,37 @@ declare class RateLimitError extends DeeplineError {
|
|
|
3248
3232
|
* structured ToolExecutionError ontology. JavaScript has one prototype chain,
|
|
3249
3233
|
* so this class extends RateLimitError and carries ToolExecutionError's stable
|
|
3250
3234
|
* cross-bundle brand.
|
|
3235
|
+
*
|
|
3236
|
+
* This class appears in external SDK calls after HTTP 429 retries are
|
|
3237
|
+
* exhausted. It also satisfies `instanceof ToolExecutionError` and, for a
|
|
3238
|
+
* provider-owned rate limit, `instanceof ProviderTransientError`. Authored
|
|
3239
|
+
* Plays should use `ProviderTransientError`; they do not need this
|
|
3240
|
+
* compatibility class.
|
|
3241
|
+
*
|
|
3242
|
+
* @sdkReference errors 110
|
|
3251
3243
|
*/
|
|
3252
3244
|
declare class ToolRateLimitError extends RateLimitError {
|
|
3245
|
+
/** Public tool id passed to `tools.execute`. */
|
|
3253
3246
|
readonly toolId: string;
|
|
3247
|
+
/** Provider responsible for the operation, or `null`. */
|
|
3254
3248
|
readonly provider: string | null;
|
|
3249
|
+
/** Provider operation name, or `null`. */
|
|
3255
3250
|
readonly operation: string | null;
|
|
3251
|
+
/** Stable machine-readable failure code when one exists. */
|
|
3256
3252
|
readonly code: string | undefined;
|
|
3253
|
+
/** Boundary responsible for the failure. */
|
|
3257
3254
|
readonly origin: ToolExecutionError['origin'];
|
|
3255
|
+
/** Stable reason family for policy and diagnostics. */
|
|
3258
3256
|
readonly category: ToolExecutionError['category'];
|
|
3257
|
+
/** Whether repeating the same semantic call is delivery-safe. */
|
|
3259
3258
|
readonly retryable: boolean;
|
|
3259
|
+
/** Provider or Deepline request id, or `null`. */
|
|
3260
3260
|
readonly requestId: string | null;
|
|
3261
|
+
/** Network failure kind, or `null` for non-network failures. */
|
|
3261
3262
|
readonly networkKind: ToolExecutionError['networkKind'];
|
|
3263
|
+
/** Network boundary that failed, or `null` for non-network failures. */
|
|
3262
3264
|
readonly networkScope: ToolExecutionError['networkScope'];
|
|
3265
|
+
/** Constructed by the SDK after a structured tool HTTP 429. */
|
|
3263
3266
|
constructor(message: string, options: ToolExecutionErrorOptions);
|
|
3264
3267
|
}
|
|
3265
3268
|
/**
|
|
@@ -3280,8 +3283,11 @@ declare class ToolRateLimitError extends RateLimitError {
|
|
|
3280
3283
|
* }
|
|
3281
3284
|
* }
|
|
3282
3285
|
* ```
|
|
3286
|
+
*
|
|
3287
|
+
* @sdkReference errors 120
|
|
3283
3288
|
*/
|
|
3284
3289
|
declare class ConfigError extends DeeplineError {
|
|
3290
|
+
/** Construct a local SDK configuration failure. */
|
|
3285
3291
|
constructor(message: string);
|
|
3286
3292
|
}
|
|
3287
3293
|
|
|
@@ -3672,6 +3678,8 @@ type ToolExecuteResultBase<TResult = unknown, TMeta = Record<string, unknown>> =
|
|
|
3672
3678
|
count: number | null;
|
|
3673
3679
|
keys: Record<string, string>;
|
|
3674
3680
|
}>;
|
|
3681
|
+
/** Original declarations preserve semantic accessor names across replay. */
|
|
3682
|
+
listExtractorPaths?: readonly string[];
|
|
3675
3683
|
};
|
|
3676
3684
|
};
|
|
3677
3685
|
type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Partial<DeeplineGetterValueMap>, TLists extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>> = {
|