deepline 0.2.26 → 0.2.28

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.
@@ -912,6 +912,10 @@ export type BillingInvoiceEntry = {
912
912
  url: string | null;
913
913
  /** Direct PDF when Stripe provides one (invoices only). */
914
914
  pdf_url: string | null;
915
+ /** Stripe-hosted invoice page when this purchase has an invoice. */
916
+ invoice_url?: string | null;
917
+ /** Stripe-hosted card receipt when this purchase has one. */
918
+ receipt_url?: string | null;
915
919
  };
916
920
 
917
921
  export type BillingInvoicesResult = {
@@ -4486,10 +4490,22 @@ export class DeeplineClient {
4486
4490
  * // { status: "ok", version: "v2" }
4487
4491
  * ```
4488
4492
  */
4489
- async health(): Promise<{ status: string; version?: string }> {
4490
- return this.http.get<{ status: string; version?: string }>(
4491
- '/api/v2/health',
4492
- );
4493
+ async health(): Promise<{
4494
+ status: string;
4495
+ version?: string;
4496
+ status_banner?: {
4497
+ message: string;
4498
+ updatedAt: number;
4499
+ };
4500
+ }> {
4501
+ return this.http.get<{
4502
+ status: string;
4503
+ version?: string;
4504
+ status_banner?: {
4505
+ message: string;
4506
+ updatedAt: number;
4507
+ };
4508
+ }>('/api/v2/health');
4493
4509
  }
4494
4510
  }
4495
4511
 
@@ -160,7 +160,7 @@ export const SDK_RELEASE = {
160
160
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
161
161
  // exposed storage-dependent synchronous access. This deliberate minor
162
162
  // release keeps lazy paging semantics independent of row residency.
163
- version: '0.2.26',
163
+ version: '0.2.28',
164
164
  contracts: {
165
165
  api: {
166
166
  name: 'sdk-http-api',
@@ -91,8 +91,8 @@ import {
91
91
  normalizePlayContractCompatibility,
92
92
  } from '@shared_libs/plays/contracts';
93
93
  import {
94
- LEGACY_TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
95
94
  serializeToolExecutionFailure,
95
+ TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
96
96
  TOOL_EXECUTION_ERROR_SCHEMA_HEADER,
97
97
  type ToolExecutionErrorSchemaVersion,
98
98
  type ToolExecutionFailureV1,
@@ -1760,11 +1760,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
1760
1760
  * was published, even when the parent was published under another schema.
1761
1761
  */
1762
1762
  private get currentToolErrorSchemaVersion(): ToolExecutionErrorSchemaVersion {
1763
- return (
1764
- this.activeInlineComposition?.toolErrorSchemaVersion ??
1765
- this.#options.toolErrorSchemaVersion ??
1766
- LEGACY_TOOL_EXECUTION_ERROR_SCHEMA_VERSION
1767
- );
1763
+ // Historical artifacts must not turn durable structured failures back into
1764
+ // strings. Every runtime tool call and receipt rehydration uses v1.
1765
+ return TOOL_EXECUTION_ERROR_SCHEMA_VERSION;
1768
1766
  }
1769
1767
 
1770
1768
  private get currentAuthoringContractEdition(): PlayAuthoringContractEdition {
@@ -23,6 +23,7 @@ import { createRuntimeReceiptHeartbeatSupervisor } from './receipt-heartbeat-sup
23
23
  import {
24
24
  deserializeToolExecutionFailure,
25
25
  serializeToolExecutionFailure,
26
+ TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
26
27
  } from '../tool-execution-error';
27
28
  import type {
28
29
  ToolExecutionErrorSchemaVersion,
@@ -308,14 +309,14 @@ export function runtimeReceiptOutput<T>(receipt: RuntimeStepReceipt): T {
308
309
  export function runtimeReceiptFailureError(
309
310
  receipt: RuntimeStepReceipt,
310
311
  legacyPrefix: string,
311
- toolErrorSchemaVersion: ToolExecutionErrorSchemaVersion,
312
+ _toolErrorSchemaVersion: ToolExecutionErrorSchemaVersion,
312
313
  ): Error {
313
314
  const message = receipt.error ?? 'unknown error';
314
315
  return (
315
316
  deserializeToolExecutionFailure(
316
317
  message,
317
318
  receipt.errorPayload,
318
- toolErrorSchemaVersion,
319
+ TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
319
320
  ) ?? new Error(`${legacyPrefix}: ${message}`)
320
321
  );
321
322
  }
@@ -1,6 +1,7 @@
1
1
  import type { WorkReceiptFailureKind } from './work-receipts';
2
2
  import {
3
3
  LEGACY_TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
4
+ TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
4
5
  ToolExecutionError,
5
6
  deserializeToolExecutionFailure,
6
7
  isProviderTransientFailure,
@@ -42,8 +43,8 @@ function applyToolHttpErrorFields(
42
43
  }
43
44
 
44
45
  /**
45
- * Historical play-runtime HTTP error. Existing artifacts must keep this exact
46
- * Error prototype; typed errors are an explicit artifact-contract opt-in.
46
+ * Retained only to deserialize direct SDK callers that explicitly request the
47
+ * retired schema-0 boundary. Play runtime execution always uses schema 1.
47
48
  */
48
49
  export class ToolHttpError extends Error {
49
50
  readonly billing: Record<string, unknown> | null;
@@ -156,6 +157,12 @@ function getStringField(value: unknown, key: string): string | null {
156
157
  return typeof field === 'string' && field.trim() ? field : null;
157
158
  }
158
159
 
160
+ function getBooleanField(value: unknown, key: string): boolean | null {
161
+ if (!isRecord(value)) return null;
162
+ const field = value[key];
163
+ return typeof field === 'boolean' ? field : null;
164
+ }
165
+
159
166
  function getObjectField(
160
167
  value: unknown,
161
168
  key: string,
@@ -377,7 +384,7 @@ export function normalizeToolHttpErrorMessage(input: {
377
384
  schemaVersion?: ToolExecutionErrorSchemaVersion;
378
385
  }): ToolHttpError {
379
386
  const schemaVersion =
380
- input.schemaVersion ?? LEGACY_TOOL_EXECUTION_ERROR_SCHEMA_VERSION;
387
+ input.schemaVersion ?? TOOL_EXECUTION_ERROR_SCHEMA_VERSION;
381
388
  let parsed: Record<string, unknown> | null = null;
382
389
  try {
383
390
  const candidate = JSON.parse(input.bodyText);
@@ -419,7 +426,9 @@ export function normalizeToolHttpErrorMessage(input: {
419
426
  origin,
420
427
  category,
421
428
  retryable: trustworthy
422
- ? (hydratedFailure?.retryable ?? input.retryable === true)
429
+ ? (hydratedFailure?.retryable ??
430
+ getBooleanField(parsed, 'retryable') ??
431
+ input.retryable === true)
423
432
  : false,
424
433
  statusCode: input.status,
425
434
  requestId:
@@ -469,9 +478,8 @@ export function normalizeToolHttpErrorMessage(input: {
469
478
  ? parsed
470
479
  : null;
471
480
  if (hardBillingPayload) {
472
- const providerCapacity = isProviderAccountCapacityFailurePayload(
473
- hardBillingPayload,
474
- );
481
+ const providerCapacity =
482
+ isProviderAccountCapacityFailurePayload(hardBillingPayload);
475
483
  return createToolHttpError(
476
484
  schemaVersion,
477
485
  formatHardBillingFailureMessage({
@@ -1,5 +1,4 @@
1
1
  import {
2
- LEGACY_TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
3
2
  SUPPORTED_TOOL_EXECUTION_ERROR_SCHEMA_VERSIONS,
4
3
  TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
5
4
  type ToolExecutionErrorSchemaVersion,
@@ -36,7 +35,7 @@ export type PlayContractCompatibilitySnapshot = {
36
35
  minRunnerVersion: number;
37
36
  runtimeFeatures: PlayRuntimeFeature[];
38
37
  runtimeBackend?: string | null;
39
- /** Missing preserves the legacy contract used by artifacts stored before this field existed. */
38
+ /** Every Play run uses the structured tool-error contract. */
40
39
  toolErrorSchemaVersion?: ToolExecutionErrorSchemaVersion;
41
40
  /** Missing preserves edition 1 for artifacts stored before authoring contracts were pinned. */
42
41
  authoringContractEdition?: PlayAuthoringContractEdition;
@@ -66,8 +65,10 @@ export class InvalidPlayContractCompatibilityError extends Error {
66
65
 
67
66
  /**
68
67
  * Normalize the artifact-pinned compatibility facts without regenerating them.
69
- * A missing field is the historical production contract, not an opt-in to the
70
- * current runtime behavior.
68
+ *
69
+ * Play failures must retain their typed code across durable receipts. Historical
70
+ * artifacts therefore upgrade to schema 1 at execution time; schema 0's
71
+ * string-only failure shape is retired from Play execution.
71
72
  */
72
73
  export function normalizePlayContractCompatibility(
73
74
  compatibility: PlayContractCompatibilitySnapshot | null | undefined,
@@ -79,22 +80,20 @@ export function normalizePlayContractCompatibility(
79
80
  ) {
80
81
  throw new InvalidPlayContractCompatibilityError();
81
82
  }
82
- const toolErrorSchemaVersion =
83
- compatibility.toolErrorSchemaVersion ??
84
- LEGACY_TOOL_EXECUTION_ERROR_SCHEMA_VERSION;
83
+ const requestedToolErrorSchemaVersion =
84
+ compatibility.toolErrorSchemaVersion ?? TOOL_EXECUTION_ERROR_SCHEMA_VERSION;
85
85
  if (
86
86
  !SUPPORTED_TOOL_EXECUTION_ERROR_SCHEMA_VERSIONS.includes(
87
- toolErrorSchemaVersion as ToolExecutionErrorSchemaVersion,
87
+ requestedToolErrorSchemaVersion,
88
88
  )
89
89
  ) {
90
90
  throw new UnsupportedPlayToolErrorSchemaVersionError(
91
- toolErrorSchemaVersion,
91
+ requestedToolErrorSchemaVersion,
92
92
  );
93
93
  }
94
94
  return {
95
95
  ...compatibility,
96
- toolErrorSchemaVersion:
97
- toolErrorSchemaVersion as ToolExecutionErrorSchemaVersion,
96
+ toolErrorSchemaVersion: TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
98
97
  authoringContractEdition: normalizePlayAuthoringContractEdition(
99
98
  compatibility.authoringContractEdition,
100
99
  ),
package/dist/cli/index.js CHANGED
@@ -1044,7 +1044,7 @@ var SDK_RELEASE = {
1044
1044
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1045
1045
  // exposed storage-dependent synchronous access. This deliberate minor
1046
1046
  // release keeps lazy paging semantics independent of row residency.
1047
- version: "0.2.26",
1047
+ version: "0.2.28",
1048
1048
  contracts: {
1049
1049
  api: {
1050
1050
  name: "sdk-http-api",
@@ -5961,9 +5961,7 @@ var DeeplineClient = class {
5961
5961
  * ```
5962
5962
  */
5963
5963
  async health() {
5964
- return this.http.get(
5965
- "/api/v2/health"
5966
- );
5964
+ return this.http.get("/api/v2/health");
5967
5965
  }
5968
5966
  };
5969
5967
 
@@ -6804,6 +6802,14 @@ function printCommandEnvelope(envelope, options = {}) {
6804
6802
  var EXIT_OK = 0;
6805
6803
  var EXIT_AUTH = 3;
6806
6804
  var EXIT_SERVER = 5;
6805
+ function statusBannerLine(value) {
6806
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
6807
+ const banner = value;
6808
+ if (typeof banner.message !== "string") {
6809
+ return null;
6810
+ }
6811
+ return `Service notice: ${banner.message}`;
6812
+ }
6807
6813
  function envFilePath(baseUrl) {
6808
6814
  return hostEnvFilePath(baseUrl);
6809
6815
  }
@@ -7260,11 +7266,14 @@ async function handleStatus(args) {
7260
7266
  hostStatusPayload = {
7261
7267
  host: baseUrl,
7262
7268
  hostStatus: hData.status || "ok",
7263
- hostVersion: hData.version || "(unknown)"
7269
+ hostVersion: hData.version || "(unknown)",
7270
+ status_banner: hData.status_banner ?? null
7264
7271
  };
7265
7272
  hostLines.push(`Host: ${baseUrl}`);
7266
7273
  hostLines.push(`Host status: ${hData.status || "ok"}`);
7267
7274
  hostLines.push(`Host version: ${hData.version || "(unknown)"}`);
7275
+ const bannerLine = statusBannerLine(hData.status_banner);
7276
+ if (bannerLine) hostLines.push(bannerLine);
7268
7277
  }
7269
7278
  } catch {
7270
7279
  hostStatusPayload = {
@@ -1030,7 +1030,7 @@ var SDK_RELEASE = {
1030
1030
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1031
1031
  // exposed storage-dependent synchronous access. This deliberate minor
1032
1032
  // release keeps lazy paging semantics independent of row residency.
1033
- version: "0.2.26",
1033
+ version: "0.2.28",
1034
1034
  contracts: {
1035
1035
  api: {
1036
1036
  name: "sdk-http-api",
@@ -5947,9 +5947,7 @@ var DeeplineClient = class {
5947
5947
  * ```
5948
5948
  */
5949
5949
  async health() {
5950
- return this.http.get(
5951
- "/api/v2/health"
5952
- );
5950
+ return this.http.get("/api/v2/health");
5953
5951
  }
5954
5952
  };
5955
5953
 
@@ -6802,6 +6800,14 @@ function printCommandEnvelope(envelope, options = {}) {
6802
6800
  var EXIT_OK = 0;
6803
6801
  var EXIT_AUTH = 3;
6804
6802
  var EXIT_SERVER = 5;
6803
+ function statusBannerLine(value) {
6804
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
6805
+ const banner = value;
6806
+ if (typeof banner.message !== "string") {
6807
+ return null;
6808
+ }
6809
+ return `Service notice: ${banner.message}`;
6810
+ }
6805
6811
  function envFilePath(baseUrl) {
6806
6812
  return hostEnvFilePath(baseUrl);
6807
6813
  }
@@ -7258,11 +7264,14 @@ async function handleStatus(args) {
7258
7264
  hostStatusPayload = {
7259
7265
  host: baseUrl,
7260
7266
  hostStatus: hData.status || "ok",
7261
- hostVersion: hData.version || "(unknown)"
7267
+ hostVersion: hData.version || "(unknown)",
7268
+ status_banner: hData.status_banner ?? null
7262
7269
  };
7263
7270
  hostLines.push(`Host: ${baseUrl}`);
7264
7271
  hostLines.push(`Host status: ${hData.status || "ok"}`);
7265
7272
  hostLines.push(`Host version: ${hData.version || "(unknown)"}`);
7273
+ const bannerLine = statusBannerLine(hData.status_banner);
7274
+ if (bannerLine) hostLines.push(bannerLine);
7266
7275
  }
7267
7276
  } catch {
7268
7277
  hostStatusPayload = {
package/dist/index.d.mts CHANGED
@@ -2189,6 +2189,10 @@ type BillingInvoiceEntry = {
2189
2189
  url: string | null;
2190
2190
  /** Direct PDF when Stripe provides one (invoices only). */
2191
2191
  pdf_url: string | null;
2192
+ /** Stripe-hosted invoice page when this purchase has an invoice. */
2193
+ invoice_url?: string | null;
2194
+ /** Stripe-hosted card receipt when this purchase has one. */
2195
+ receipt_url?: string | null;
2192
2196
  };
2193
2197
  type BillingInvoicesResult = {
2194
2198
  org_id: string;
@@ -3390,6 +3394,10 @@ declare class DeeplineClient {
3390
3394
  health(): Promise<{
3391
3395
  status: string;
3392
3396
  version?: string;
3397
+ status_banner?: {
3398
+ message: string;
3399
+ updatedAt: number;
3400
+ };
3393
3401
  }>;
3394
3402
  }
3395
3403
 
package/dist/index.d.ts CHANGED
@@ -2189,6 +2189,10 @@ type BillingInvoiceEntry = {
2189
2189
  url: string | null;
2190
2190
  /** Direct PDF when Stripe provides one (invoices only). */
2191
2191
  pdf_url: string | null;
2192
+ /** Stripe-hosted invoice page when this purchase has an invoice. */
2193
+ invoice_url?: string | null;
2194
+ /** Stripe-hosted card receipt when this purchase has one. */
2195
+ receipt_url?: string | null;
2192
2196
  };
2193
2197
  type BillingInvoicesResult = {
2194
2198
  org_id: string;
@@ -3390,6 +3394,10 @@ declare class DeeplineClient {
3390
3394
  health(): Promise<{
3391
3395
  status: string;
3392
3396
  version?: string;
3397
+ status_banner?: {
3398
+ message: string;
3399
+ updatedAt: number;
3400
+ };
3393
3401
  }>;
3394
3402
  }
3395
3403
 
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.26",
766
+ version: "0.2.28",
767
767
  contracts: {
768
768
  api: {
769
769
  name: "sdk-http-api",
@@ -5680,9 +5680,7 @@ var DeeplineClient = class {
5680
5680
  * ```
5681
5681
  */
5682
5682
  async health() {
5683
- return this.http.get(
5684
- "/api/v2/health"
5685
- );
5683
+ return this.http.get("/api/v2/health");
5686
5684
  }
5687
5685
  };
5688
5686
 
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.26",
692
+ version: "0.2.28",
693
693
  contracts: {
694
694
  api: {
695
695
  name: "sdk-http-api",
@@ -5606,9 +5606,7 @@ var DeeplineClient = class {
5606
5606
  * ```
5607
5607
  */
5608
5608
  async health() {
5609
- return this.http.get(
5610
- "/api/v2/health"
5611
- );
5609
+ return this.http.get("/api/v2/health");
5612
5610
  }
5613
5611
  };
5614
5612
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.2.26",
3
+ "version": "0.2.28",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {