deepline 0.1.148 → 0.1.150

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/index.d.mts CHANGED
@@ -1072,6 +1072,7 @@ type EnrichCompiledConfig = {
1072
1072
 
1073
1073
  type ExecuteToolRawOptions = {
1074
1074
  includeToolMetadata?: boolean;
1075
+ responseIntent?: 'raw' | 'row_artifact';
1075
1076
  };
1076
1077
  /**
1077
1078
  * Standard provider/tool execution envelope returned by low-level SDK calls.
@@ -2739,9 +2740,10 @@ type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Par
2739
2740
  * getters live under `extractedValues.<name>.get()`, and list getters live
2740
2741
  * under `extractedLists.<name>.get()`.
2741
2742
  *
2742
- * Use extractors first when a tool contract exposes them. Drop to
2743
- * `toolResponse.raw` when you need provider-specific fields or when debugging
2744
- * from persisted run rows.
2743
+ * Use extractors first when a tool contract exposes them. Use list getters for
2744
+ * row-shaped data. Drop to `toolResponse.raw` only for provider-specific scalar
2745
+ * fields or bounded debugging context; persisted rows may clip declared lists to
2746
+ * previews.
2745
2747
  *
2746
2748
  * @sdkReference runtime 200
2747
2749
  */
@@ -3951,6 +3953,12 @@ type ListConversionResult = {
3951
3953
  /** Dotted path to where the list was found (e.g. `"output.body"`, `"people"`). */
3952
3954
  sourcePath: string | null;
3953
3955
  };
3956
+ type CsvOutputArtifact = {
3957
+ path: string;
3958
+ rowCount: number;
3959
+ columns: string[];
3960
+ preview: string;
3961
+ };
3954
3962
  type Scalar = string | number | boolean | null;
3955
3963
  /**
3956
3964
  * Extract a list of records from a tool response.
@@ -4042,12 +4050,7 @@ declare function writeJsonOutputFile(payload: unknown, stem: string): string;
4042
4050
  */
4043
4051
  declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem: string, options?: {
4044
4052
  outPath?: string;
4045
- }): {
4046
- path: string;
4047
- rowCount: number;
4048
- columns: string[];
4049
- preview: string;
4050
- };
4053
+ }): CsvOutputArtifact;
4051
4054
  /**
4052
4055
  * Extract scalar (non-nested) fields from a tool response for summary display.
4053
4056
  *
package/dist/index.d.ts CHANGED
@@ -1072,6 +1072,7 @@ type EnrichCompiledConfig = {
1072
1072
 
1073
1073
  type ExecuteToolRawOptions = {
1074
1074
  includeToolMetadata?: boolean;
1075
+ responseIntent?: 'raw' | 'row_artifact';
1075
1076
  };
1076
1077
  /**
1077
1078
  * Standard provider/tool execution envelope returned by low-level SDK calls.
@@ -2739,9 +2740,10 @@ type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Par
2739
2740
  * getters live under `extractedValues.<name>.get()`, and list getters live
2740
2741
  * under `extractedLists.<name>.get()`.
2741
2742
  *
2742
- * Use extractors first when a tool contract exposes them. Drop to
2743
- * `toolResponse.raw` when you need provider-specific fields or when debugging
2744
- * from persisted run rows.
2743
+ * Use extractors first when a tool contract exposes them. Use list getters for
2744
+ * row-shaped data. Drop to `toolResponse.raw` only for provider-specific scalar
2745
+ * fields or bounded debugging context; persisted rows may clip declared lists to
2746
+ * previews.
2745
2747
  *
2746
2748
  * @sdkReference runtime 200
2747
2749
  */
@@ -3951,6 +3953,12 @@ type ListConversionResult = {
3951
3953
  /** Dotted path to where the list was found (e.g. `"output.body"`, `"people"`). */
3952
3954
  sourcePath: string | null;
3953
3955
  };
3956
+ type CsvOutputArtifact = {
3957
+ path: string;
3958
+ rowCount: number;
3959
+ columns: string[];
3960
+ preview: string;
3961
+ };
3954
3962
  type Scalar = string | number | boolean | null;
3955
3963
  /**
3956
3964
  * Extract a list of records from a tool response.
@@ -4042,12 +4050,7 @@ declare function writeJsonOutputFile(payload: unknown, stem: string): string;
4042
4050
  */
4043
4051
  declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem: string, options?: {
4044
4052
  outPath?: string;
4045
- }): {
4046
- path: string;
4047
- rowCount: number;
4048
- columns: string[];
4049
- preview: string;
4050
- };
4053
+ }): CsvOutputArtifact;
4051
4054
  /**
4052
4055
  * Extract scalar (non-nested) fields from a tool response for summary display.
4053
4056
  *
package/dist/index.js CHANGED
@@ -419,10 +419,10 @@ var SDK_RELEASE = {
419
419
  // the SDK enrich generator's one-second stale policy.
420
420
  // 0.1.110 ships authored V2 prebuilts and required top-level play descriptions.
421
421
  // 0.1.111 ships dataset-native tool list getters and result row datasets.
422
- version: "0.1.148",
422
+ version: "0.1.150",
423
423
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
424
424
  supportPolicy: {
425
- latest: "0.1.148",
425
+ latest: "0.1.150",
426
426
  minimumSupported: "0.1.53",
427
427
  deprecatedBelow: "0.1.53",
428
428
  commandMinimumSupported: [
@@ -1886,6 +1886,7 @@ async function* observeRunEvents(options) {
1886
1886
  var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
1887
1887
  var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
1888
1888
  var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
1889
+ var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
1889
1890
  var V2_EXECUTE_RESPONSE_CONTRACT = "v2-tool-response";
1890
1891
  var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
1891
1892
  var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
@@ -2370,7 +2371,8 @@ var DeeplineClient = class {
2370
2371
  async executeTool(toolId, input, options) {
2371
2372
  const headers = {
2372
2373
  [EXECUTE_RESPONSE_CONTRACT_HEADER]: V2_EXECUTE_RESPONSE_CONTRACT,
2373
- ...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {}
2374
+ ...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
2375
+ ...options?.responseIntent ? { [EXECUTE_RESPONSE_INTENT_HEADER]: options.responseIntent } : {}
2374
2376
  };
2375
2377
  return this.http.post(
2376
2378
  `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
@@ -5592,6 +5594,19 @@ function normalizeRows2(value) {
5592
5594
  return { value: entry };
5593
5595
  });
5594
5596
  }
5597
+ function columnsForRows(rows) {
5598
+ const seen = /* @__PURE__ */ new Set();
5599
+ const columns = [];
5600
+ for (const row of rows) {
5601
+ for (const key of Object.keys(row)) {
5602
+ if (!seen.has(key)) {
5603
+ seen.add(key);
5604
+ columns.push(key);
5605
+ }
5606
+ }
5607
+ }
5608
+ return columns;
5609
+ }
5595
5610
  function candidateRoots(payload) {
5596
5611
  const roots = [
5597
5612
  { path: null, value: payload }
@@ -5688,16 +5703,7 @@ function writeJsonOutputFile(payload, stem) {
5688
5703
  function writeCsvOutputFile(rows, stem, options) {
5689
5704
  const outputPath = options?.outPath ? options.outPath : (0, import_node_path3.join)(ensureOutputDir(), `${stem}_${Date.now()}.csv`);
5690
5705
  (0, import_node_fs3.mkdirSync)((0, import_node_path3.dirname)(outputPath), { recursive: true });
5691
- const seen = /* @__PURE__ */ new Set();
5692
- const columns = [];
5693
- for (const row of rows) {
5694
- for (const key of Object.keys(row)) {
5695
- if (!seen.has(key)) {
5696
- seen.add(key);
5697
- columns.push(key);
5698
- }
5699
- }
5700
- }
5706
+ const columns = columnsForRows(rows);
5701
5707
  const escapeCell = (value) => {
5702
5708
  const normalized = value == null ? "" : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
5703
5709
  if (/[",\n]/.test(normalized)) {
@@ -5705,13 +5711,20 @@ function writeCsvOutputFile(rows, stem, options) {
5705
5711
  }
5706
5712
  return normalized;
5707
5713
  };
5708
- const lines = [];
5709
- lines.push(columns.map(escapeCell).join(","));
5710
- for (const row of rows) {
5711
- lines.push(columns.map((column) => escapeCell(row[column])).join(","));
5714
+ const fd = (0, import_node_fs3.openSync)(outputPath, "w");
5715
+ try {
5716
+ (0, import_node_fs3.writeSync)(fd, `${columns.map(escapeCell).join(",")}
5717
+ `);
5718
+ for (const row of rows) {
5719
+ (0, import_node_fs3.writeSync)(
5720
+ fd,
5721
+ `${columns.map((column) => escapeCell(row[column])).join(",")}
5722
+ `
5723
+ );
5724
+ }
5725
+ } finally {
5726
+ (0, import_node_fs3.closeSync)(fd);
5712
5727
  }
5713
- (0, import_node_fs3.writeFileSync)(outputPath, `${lines.join("\n")}
5714
- `, "utf-8");
5715
5728
  const previewRows = rows.slice(0, 5);
5716
5729
  const previewColumns = columns.slice(0, 5);
5717
5730
  const preview = [
package/dist/index.mjs CHANGED
@@ -349,10 +349,10 @@ var SDK_RELEASE = {
349
349
  // the SDK enrich generator's one-second stale policy.
350
350
  // 0.1.110 ships authored V2 prebuilts and required top-level play descriptions.
351
351
  // 0.1.111 ships dataset-native tool list getters and result row datasets.
352
- version: "0.1.148",
352
+ version: "0.1.150",
353
353
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
354
354
  supportPolicy: {
355
- latest: "0.1.148",
355
+ latest: "0.1.150",
356
356
  minimumSupported: "0.1.53",
357
357
  deprecatedBelow: "0.1.53",
358
358
  commandMinimumSupported: [
@@ -1816,6 +1816,7 @@ async function* observeRunEvents(options) {
1816
1816
  var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
1817
1817
  var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
1818
1818
  var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
1819
+ var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
1819
1820
  var V2_EXECUTE_RESPONSE_CONTRACT = "v2-tool-response";
1820
1821
  var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
1821
1822
  var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
@@ -2300,7 +2301,8 @@ var DeeplineClient = class {
2300
2301
  async executeTool(toolId, input, options) {
2301
2302
  const headers = {
2302
2303
  [EXECUTE_RESPONSE_CONTRACT_HEADER]: V2_EXECUTE_RESPONSE_CONTRACT,
2303
- ...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {}
2304
+ ...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
2305
+ ...options?.responseIntent ? { [EXECUTE_RESPONSE_INTENT_HEADER]: options.responseIntent } : {}
2304
2306
  };
2305
2307
  return this.http.post(
2306
2308
  `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
@@ -5499,7 +5501,13 @@ function getDefinedPlayMetadata(value) {
5499
5501
  }
5500
5502
 
5501
5503
  // src/tool-output.ts
5502
- import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "fs";
5504
+ import {
5505
+ closeSync,
5506
+ mkdirSync as mkdirSync2,
5507
+ openSync,
5508
+ writeFileSync as writeFileSync2,
5509
+ writeSync
5510
+ } from "fs";
5503
5511
  import { homedir as homedir4 } from "os";
5504
5512
  import { dirname as dirname2, join as join3 } from "path";
5505
5513
  function isPlainObject(value) {
@@ -5522,6 +5530,19 @@ function normalizeRows2(value) {
5522
5530
  return { value: entry };
5523
5531
  });
5524
5532
  }
5533
+ function columnsForRows(rows) {
5534
+ const seen = /* @__PURE__ */ new Set();
5535
+ const columns = [];
5536
+ for (const row of rows) {
5537
+ for (const key of Object.keys(row)) {
5538
+ if (!seen.has(key)) {
5539
+ seen.add(key);
5540
+ columns.push(key);
5541
+ }
5542
+ }
5543
+ }
5544
+ return columns;
5545
+ }
5525
5546
  function candidateRoots(payload) {
5526
5547
  const roots = [
5527
5548
  { path: null, value: payload }
@@ -5618,16 +5639,7 @@ function writeJsonOutputFile(payload, stem) {
5618
5639
  function writeCsvOutputFile(rows, stem, options) {
5619
5640
  const outputPath = options?.outPath ? options.outPath : join3(ensureOutputDir(), `${stem}_${Date.now()}.csv`);
5620
5641
  mkdirSync2(dirname2(outputPath), { recursive: true });
5621
- const seen = /* @__PURE__ */ new Set();
5622
- const columns = [];
5623
- for (const row of rows) {
5624
- for (const key of Object.keys(row)) {
5625
- if (!seen.has(key)) {
5626
- seen.add(key);
5627
- columns.push(key);
5628
- }
5629
- }
5630
- }
5642
+ const columns = columnsForRows(rows);
5631
5643
  const escapeCell = (value) => {
5632
5644
  const normalized = value == null ? "" : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
5633
5645
  if (/[",\n]/.test(normalized)) {
@@ -5635,13 +5647,20 @@ function writeCsvOutputFile(rows, stem, options) {
5635
5647
  }
5636
5648
  return normalized;
5637
5649
  };
5638
- const lines = [];
5639
- lines.push(columns.map(escapeCell).join(","));
5640
- for (const row of rows) {
5641
- lines.push(columns.map((column) => escapeCell(row[column])).join(","));
5650
+ const fd = openSync(outputPath, "w");
5651
+ try {
5652
+ writeSync(fd, `${columns.map(escapeCell).join(",")}
5653
+ `);
5654
+ for (const row of rows) {
5655
+ writeSync(
5656
+ fd,
5657
+ `${columns.map((column) => escapeCell(row[column])).join(",")}
5658
+ `
5659
+ );
5660
+ }
5661
+ } finally {
5662
+ closeSync(fd);
5642
5663
  }
5643
- writeFileSync2(outputPath, `${lines.join("\n")}
5644
- `, "utf-8");
5645
5664
  const previewRows = rows.slice(0, 5);
5646
5665
  const previewColumns = columns.slice(0, 5);
5647
5666
  const preview = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.148",
3
+ "version": "0.1.150",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {