deepline 0.1.149 → 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/bundling-sources/sdk/src/client.ts +5 -0
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/sdk/src/tool-output.ts +63 -17
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result-types.ts +17 -4
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +343 -26
- package/dist/cli/index.js +153 -104
- package/dist/cli/index.mjs +160 -105
- package/dist/index.d.mts +12 -9
- package/dist/index.d.ts +12 -9
- package/dist/index.js +32 -19
- package/dist/index.mjs +39 -20
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -640,10 +640,10 @@ var SDK_RELEASE = {
|
|
|
640
640
|
// the SDK enrich generator's one-second stale policy.
|
|
641
641
|
// 0.1.110 ships authored V2 prebuilts and required top-level play descriptions.
|
|
642
642
|
// 0.1.111 ships dataset-native tool list getters and result row datasets.
|
|
643
|
-
version: "0.1.
|
|
643
|
+
version: "0.1.150",
|
|
644
644
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
645
645
|
supportPolicy: {
|
|
646
|
-
latest: "0.1.
|
|
646
|
+
latest: "0.1.150",
|
|
647
647
|
minimumSupported: "0.1.53",
|
|
648
648
|
deprecatedBelow: "0.1.53",
|
|
649
649
|
commandMinimumSupported: [
|
|
@@ -2107,6 +2107,7 @@ async function* observeRunEvents(options) {
|
|
|
2107
2107
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
2108
2108
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
2109
2109
|
var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
|
|
2110
|
+
var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
|
|
2110
2111
|
var V2_EXECUTE_RESPONSE_CONTRACT = "v2-tool-response";
|
|
2111
2112
|
var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
|
|
2112
2113
|
var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
|
|
@@ -2591,7 +2592,8 @@ var DeeplineClient = class {
|
|
|
2591
2592
|
async executeTool(toolId, input2, options) {
|
|
2592
2593
|
const headers = {
|
|
2593
2594
|
[EXECUTE_RESPONSE_CONTRACT_HEADER]: V2_EXECUTE_RESPONSE_CONTRACT,
|
|
2594
|
-
...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {}
|
|
2595
|
+
...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
|
|
2596
|
+
...options?.responseIntent ? { [EXECUTE_RESPONSE_INTENT_HEADER]: options.responseIntent } : {}
|
|
2595
2597
|
};
|
|
2596
2598
|
return this.http.post(
|
|
2597
2599
|
`/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
|
|
@@ -20561,7 +20563,13 @@ import { tmpdir as tmpdir3 } from "os";
|
|
|
20561
20563
|
import { join as join10, resolve as resolve10 } from "path";
|
|
20562
20564
|
|
|
20563
20565
|
// src/tool-output.ts
|
|
20564
|
-
import {
|
|
20566
|
+
import {
|
|
20567
|
+
closeSync as closeSync2,
|
|
20568
|
+
mkdirSync as mkdirSync7,
|
|
20569
|
+
openSync as openSync2,
|
|
20570
|
+
writeFileSync as writeFileSync11,
|
|
20571
|
+
writeSync
|
|
20572
|
+
} from "fs";
|
|
20565
20573
|
import { homedir as homedir9 } from "os";
|
|
20566
20574
|
import { dirname as dirname9, join as join9 } from "path";
|
|
20567
20575
|
function isPlainObject(value) {
|
|
@@ -20584,6 +20592,19 @@ function normalizeRows(value) {
|
|
|
20584
20592
|
return { value: entry };
|
|
20585
20593
|
});
|
|
20586
20594
|
}
|
|
20595
|
+
function columnsForRows(rows) {
|
|
20596
|
+
const seen = /* @__PURE__ */ new Set();
|
|
20597
|
+
const columns = [];
|
|
20598
|
+
for (const row of rows) {
|
|
20599
|
+
for (const key of Object.keys(row)) {
|
|
20600
|
+
if (!seen.has(key)) {
|
|
20601
|
+
seen.add(key);
|
|
20602
|
+
columns.push(key);
|
|
20603
|
+
}
|
|
20604
|
+
}
|
|
20605
|
+
}
|
|
20606
|
+
return columns;
|
|
20607
|
+
}
|
|
20587
20608
|
function candidateRoots(payload) {
|
|
20588
20609
|
const roots = [
|
|
20589
20610
|
{ path: null, value: payload }
|
|
@@ -20666,6 +20687,16 @@ function tryConvertToList(payload, options) {
|
|
|
20666
20687
|
}
|
|
20667
20688
|
return null;
|
|
20668
20689
|
}
|
|
20690
|
+
function projectRowOutput(conversion) {
|
|
20691
|
+
return {
|
|
20692
|
+
rows: conversion.rows,
|
|
20693
|
+
rowCount: conversion.rows.length,
|
|
20694
|
+
columns: columnsForRows(conversion.rows),
|
|
20695
|
+
previewRows: conversion.rows.slice(0, 5),
|
|
20696
|
+
strategy: conversion.strategy,
|
|
20697
|
+
sourcePath: conversion.sourcePath
|
|
20698
|
+
};
|
|
20699
|
+
}
|
|
20669
20700
|
function ensureOutputDir() {
|
|
20670
20701
|
const outputDir = join9(homedir9(), ".local", "share", "deepline", "data");
|
|
20671
20702
|
mkdirSync7(outputDir, { recursive: true });
|
|
@@ -20680,16 +20711,7 @@ function writeJsonOutputFile(payload, stem) {
|
|
|
20680
20711
|
function writeCsvOutputFile(rows, stem, options) {
|
|
20681
20712
|
const outputPath = options?.outPath ? options.outPath : join9(ensureOutputDir(), `${stem}_${Date.now()}.csv`);
|
|
20682
20713
|
mkdirSync7(dirname9(outputPath), { recursive: true });
|
|
20683
|
-
const
|
|
20684
|
-
const columns = [];
|
|
20685
|
-
for (const row of rows) {
|
|
20686
|
-
for (const key of Object.keys(row)) {
|
|
20687
|
-
if (!seen.has(key)) {
|
|
20688
|
-
seen.add(key);
|
|
20689
|
-
columns.push(key);
|
|
20690
|
-
}
|
|
20691
|
-
}
|
|
20692
|
-
}
|
|
20714
|
+
const columns = columnsForRows(rows);
|
|
20693
20715
|
const escapeCell = (value) => {
|
|
20694
20716
|
const normalized = value == null ? "" : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
|
|
20695
20717
|
if (/[",\n]/.test(normalized)) {
|
|
@@ -20697,13 +20719,20 @@ function writeCsvOutputFile(rows, stem, options) {
|
|
|
20697
20719
|
}
|
|
20698
20720
|
return normalized;
|
|
20699
20721
|
};
|
|
20700
|
-
const
|
|
20701
|
-
|
|
20702
|
-
|
|
20703
|
-
|
|
20722
|
+
const fd = openSync2(outputPath, "w");
|
|
20723
|
+
try {
|
|
20724
|
+
writeSync(fd, `${columns.map(escapeCell).join(",")}
|
|
20725
|
+
`);
|
|
20726
|
+
for (const row of rows) {
|
|
20727
|
+
writeSync(
|
|
20728
|
+
fd,
|
|
20729
|
+
`${columns.map((column) => escapeCell(row[column])).join(",")}
|
|
20730
|
+
`
|
|
20731
|
+
);
|
|
20732
|
+
}
|
|
20733
|
+
} finally {
|
|
20734
|
+
closeSync2(fd);
|
|
20704
20735
|
}
|
|
20705
|
-
writeFileSync11(outputPath, `${lines.join("\n")}
|
|
20706
|
-
`, "utf-8");
|
|
20707
20736
|
const previewRows = rows.slice(0, 5);
|
|
20708
20737
|
const previewColumns = columns.slice(0, 5);
|
|
20709
20738
|
const preview = [
|
|
@@ -21230,10 +21259,7 @@ Examples:
|
|
|
21230
21259
|
).option(
|
|
21231
21260
|
"--output-format <format>",
|
|
21232
21261
|
"Output format: auto, csv, csv_file, json, or json_file"
|
|
21233
|
-
).option(
|
|
21234
|
-
"-o, --out <path>",
|
|
21235
|
-
"Write row-shaped tool output to this CSV path"
|
|
21236
|
-
).option(
|
|
21262
|
+
).option("-o, --out <path>", "Write row-shaped tool output to this CSV path").option(
|
|
21237
21263
|
"--no-preview",
|
|
21238
21264
|
"Only print the extracted output path when applicable"
|
|
21239
21265
|
).action(async (toolId, options) => {
|
|
@@ -22087,6 +22113,100 @@ function buildToolExecuteBaseEnvelope(input2) {
|
|
|
22087
22113
|
}
|
|
22088
22114
|
};
|
|
22089
22115
|
}
|
|
22116
|
+
function buildToolExecuteRowArtifactEnvelope(input2) {
|
|
22117
|
+
const {
|
|
22118
|
+
toolResponse: _toolResponse,
|
|
22119
|
+
result: _result,
|
|
22120
|
+
output: _output,
|
|
22121
|
+
output_preview: _outputPreview,
|
|
22122
|
+
render: _render,
|
|
22123
|
+
next: _next,
|
|
22124
|
+
local: _local,
|
|
22125
|
+
...base
|
|
22126
|
+
} = input2.baseEnvelope;
|
|
22127
|
+
void _toolResponse;
|
|
22128
|
+
void _result;
|
|
22129
|
+
void _output;
|
|
22130
|
+
void _outputPreview;
|
|
22131
|
+
void _render;
|
|
22132
|
+
void _next;
|
|
22133
|
+
void _local;
|
|
22134
|
+
return {
|
|
22135
|
+
...base,
|
|
22136
|
+
status: typeof base.status === "string" ? base.status : "completed",
|
|
22137
|
+
output_preview: {
|
|
22138
|
+
kind: "list",
|
|
22139
|
+
rowCount: input2.rowOutput.rowCount,
|
|
22140
|
+
columns: input2.rowOutput.columns,
|
|
22141
|
+
preview: input2.rowOutput.previewRows,
|
|
22142
|
+
listStrategy: input2.rowOutput.strategy,
|
|
22143
|
+
listSourcePath: input2.rowOutput.sourcePath
|
|
22144
|
+
},
|
|
22145
|
+
csv_path: input2.csv.path,
|
|
22146
|
+
row_count: input2.csv.rowCount,
|
|
22147
|
+
row_count_returned: input2.csv.rowCount,
|
|
22148
|
+
columns: input2.csv.columns,
|
|
22149
|
+
extracted_csv: input2.csv.path,
|
|
22150
|
+
extracted_csv_rows: input2.csv.rowCount,
|
|
22151
|
+
extracted_csv_columns: input2.csv.columns,
|
|
22152
|
+
preview: input2.csv.preview,
|
|
22153
|
+
list_strategy: input2.rowOutput.strategy,
|
|
22154
|
+
list_source_path: input2.rowOutput.sourcePath,
|
|
22155
|
+
summary: input2.summary,
|
|
22156
|
+
local: {
|
|
22157
|
+
extracted_csv: input2.csv.path,
|
|
22158
|
+
extracted_csv_rows: input2.csv.rowCount,
|
|
22159
|
+
extracted_csv_columns: input2.csv.columns,
|
|
22160
|
+
preview: input2.csv.preview,
|
|
22161
|
+
starter_script: input2.seededScript.path,
|
|
22162
|
+
project_dir: input2.seededScript.projectDir,
|
|
22163
|
+
copy_to_project: {
|
|
22164
|
+
macos_linux: input2.seededScript.macCopyCommand,
|
|
22165
|
+
windows_powershell: input2.seededScript.windowsCopyCommand
|
|
22166
|
+
}
|
|
22167
|
+
},
|
|
22168
|
+
starter_script: input2.seededScript.path,
|
|
22169
|
+
project_dir: input2.seededScript.projectDir,
|
|
22170
|
+
copy_to_project: {
|
|
22171
|
+
macos_linux: input2.seededScript.macCopyCommand,
|
|
22172
|
+
windows_powershell: input2.seededScript.windowsCopyCommand
|
|
22173
|
+
},
|
|
22174
|
+
next: {
|
|
22175
|
+
inspect: "Re-run with --json only when you need the raw provider/tool response.",
|
|
22176
|
+
listSourcePath: input2.rowOutput.sourcePath,
|
|
22177
|
+
expandToPlay: "Use stable map and step keys so reruns are idempotent: completed rows are reused, and only missing or stale work runs again."
|
|
22178
|
+
},
|
|
22179
|
+
render: {
|
|
22180
|
+
sections: [
|
|
22181
|
+
{
|
|
22182
|
+
title: `${input2.csv.path} (${input2.csv.rowCount} rows)`,
|
|
22183
|
+
lines: [
|
|
22184
|
+
...input2.csv.columns.length > 0 ? [`columns: ${JSON.stringify(input2.csv.columns)}`] : [],
|
|
22185
|
+
...Object.keys(input2.summary).length > 0 ? [
|
|
22186
|
+
`summary: ${Object.entries(input2.summary).map(([key, value]) => `${key}=${String(value)}`).join(", ")}`
|
|
22187
|
+
] : [],
|
|
22188
|
+
`preview: ${JSON.stringify(input2.rowOutput.previewRows)}`,
|
|
22189
|
+
`starter script: ${input2.seededScript.path}`
|
|
22190
|
+
]
|
|
22191
|
+
}
|
|
22192
|
+
],
|
|
22193
|
+
actions: [
|
|
22194
|
+
{
|
|
22195
|
+
label: "next",
|
|
22196
|
+
command: "Move the script into a project folder and expand it into a Deepline play. Use stable map and step keys so reruns are idempotent: completed rows are reused, and only missing or stale work runs again."
|
|
22197
|
+
},
|
|
22198
|
+
{
|
|
22199
|
+
label: "macOS/Linux",
|
|
22200
|
+
command: input2.seededScript.macCopyCommand
|
|
22201
|
+
},
|
|
22202
|
+
{
|
|
22203
|
+
label: "Windows PowerShell",
|
|
22204
|
+
command: input2.seededScript.windowsCopyCommand
|
|
22205
|
+
}
|
|
22206
|
+
]
|
|
22207
|
+
}
|
|
22208
|
+
};
|
|
22209
|
+
}
|
|
22090
22210
|
async function executeTool(args) {
|
|
22091
22211
|
let parsed;
|
|
22092
22212
|
try {
|
|
@@ -22138,7 +22258,9 @@ async function executeTool(args) {
|
|
|
22138
22258
|
}
|
|
22139
22259
|
return 2;
|
|
22140
22260
|
}
|
|
22141
|
-
const rawResponse = await client2.executeTool(parsed.toolId, parsed.params
|
|
22261
|
+
const rawResponse = await client2.executeTool(parsed.toolId, parsed.params, {
|
|
22262
|
+
responseIntent: parsed.outPath || parsed.outputFormat === "csv" || parsed.outputFormat === "csv_file" ? "row_artifact" : "raw"
|
|
22263
|
+
});
|
|
22142
22264
|
const listConversion = tryConvertToList(rawResponse, {
|
|
22143
22265
|
listExtractorPaths: listExtractorPathsFromUsageGuidance(metadata)
|
|
22144
22266
|
});
|
|
@@ -22202,6 +22324,7 @@ async function executeTool(args) {
|
|
|
22202
22324
|
printCommandEnvelope(baseEnvelope, { json: false });
|
|
22203
22325
|
return 0;
|
|
22204
22326
|
}
|
|
22327
|
+
const rowOutput = projectRowOutput(listConversion);
|
|
22205
22328
|
const csv = writeCsvOutputFile(
|
|
22206
22329
|
listConversion.rows,
|
|
22207
22330
|
`${parsed.toolId}_output`,
|
|
@@ -22212,91 +22335,23 @@ async function executeTool(args) {
|
|
|
22212
22335
|
payload: parsed.params,
|
|
22213
22336
|
rows: listConversion.rows
|
|
22214
22337
|
});
|
|
22215
|
-
const materializedEnvelope = {
|
|
22216
|
-
|
|
22217
|
-
|
|
22218
|
-
|
|
22219
|
-
|
|
22220
|
-
|
|
22221
|
-
|
|
22222
|
-
starter_script: seededScript.path,
|
|
22223
|
-
project_dir: seededScript.projectDir,
|
|
22224
|
-
copy_to_project: {
|
|
22225
|
-
macos_linux: seededScript.macCopyCommand,
|
|
22226
|
-
windows_powershell: seededScript.windowsCopyCommand
|
|
22227
|
-
}
|
|
22228
|
-
},
|
|
22229
|
-
render: {
|
|
22230
|
-
sections: [
|
|
22231
|
-
{
|
|
22232
|
-
title: `${csv.path} (${csv.rowCount} rows)`,
|
|
22233
|
-
lines: [
|
|
22234
|
-
...csv.columns.length > 0 ? [`columns: ${JSON.stringify(csv.columns)}`] : [],
|
|
22235
|
-
...Object.keys(summary).length > 0 ? [
|
|
22236
|
-
`summary: ${Object.entries(summary).map(([key, value]) => `${key}=${String(value)}`).join(", ")}`
|
|
22237
|
-
] : [],
|
|
22238
|
-
`preview: ${JSON.stringify(csv.preview)}`,
|
|
22239
|
-
`starter script: ${seededScript.path}`
|
|
22240
|
-
]
|
|
22241
|
-
}
|
|
22242
|
-
],
|
|
22243
|
-
actions: [
|
|
22244
|
-
{
|
|
22245
|
-
label: "next",
|
|
22246
|
-
command: "Move the script into a project folder and expand it into a Deepline play. Use stable map and step keys so reruns are idempotent: completed rows are reused, and only missing or stale work runs again."
|
|
22247
|
-
},
|
|
22248
|
-
{
|
|
22249
|
-
label: "macOS/Linux",
|
|
22250
|
-
command: seededScript.macCopyCommand
|
|
22251
|
-
},
|
|
22252
|
-
{
|
|
22253
|
-
label: "Windows PowerShell",
|
|
22254
|
-
command: seededScript.windowsCopyCommand
|
|
22255
|
-
}
|
|
22256
|
-
]
|
|
22257
|
-
}
|
|
22258
|
-
};
|
|
22338
|
+
const materializedEnvelope = buildToolExecuteRowArtifactEnvelope({
|
|
22339
|
+
baseEnvelope,
|
|
22340
|
+
csv,
|
|
22341
|
+
rowOutput,
|
|
22342
|
+
summary,
|
|
22343
|
+
seededScript
|
|
22344
|
+
});
|
|
22259
22345
|
if (parsed.outputFormat === "csv_file") {
|
|
22260
|
-
printCommandEnvelope(
|
|
22261
|
-
{
|
|
22262
|
-
...materializedEnvelope,
|
|
22263
|
-
extracted_csv: csv.path,
|
|
22264
|
-
extracted_csv_rows: csv.rowCount,
|
|
22265
|
-
extracted_csv_columns: csv.columns,
|
|
22266
|
-
preview: csv.preview,
|
|
22267
|
-
list_strategy: listConversion.strategy,
|
|
22268
|
-
list_source_path: listConversion.sourcePath,
|
|
22269
|
-
starter_script: seededScript.path,
|
|
22270
|
-
project_dir: seededScript.projectDir,
|
|
22271
|
-
copy_to_project: {
|
|
22272
|
-
macos_linux: seededScript.macCopyCommand,
|
|
22273
|
-
windows_powershell: seededScript.windowsCopyCommand
|
|
22274
|
-
},
|
|
22275
|
-
summary
|
|
22276
|
-
},
|
|
22277
|
-
{ json: true }
|
|
22278
|
-
);
|
|
22346
|
+
printCommandEnvelope(materializedEnvelope, { json: true });
|
|
22279
22347
|
return 0;
|
|
22280
22348
|
}
|
|
22281
22349
|
if (parsed.outPath) {
|
|
22282
|
-
printCommandEnvelope(
|
|
22283
|
-
|
|
22284
|
-
|
|
22285
|
-
csv_path: csv.path,
|
|
22286
|
-
row_count: csv.rowCount,
|
|
22287
|
-
row_count_returned: csv.rowCount,
|
|
22288
|
-
columns: csv.columns,
|
|
22289
|
-
preview: csv.preview,
|
|
22290
|
-
list_strategy: listConversion.strategy,
|
|
22291
|
-
list_source_path: listConversion.sourcePath,
|
|
22292
|
-
summary
|
|
22293
|
-
},
|
|
22294
|
-
{
|
|
22295
|
-
json: argsWantJson(args) || shouldEmitJson(),
|
|
22296
|
-
text: `Wrote ${csv.rowCount} row(s) to ${csv.path}
|
|
22350
|
+
printCommandEnvelope(materializedEnvelope, {
|
|
22351
|
+
json: argsWantJson(args) || shouldEmitJson(),
|
|
22352
|
+
text: `Wrote ${csv.rowCount} row(s) to ${csv.path}
|
|
22297
22353
|
`
|
|
22298
|
-
|
|
22299
|
-
);
|
|
22354
|
+
});
|
|
22300
22355
|
return 0;
|
|
22301
22356
|
}
|
|
22302
22357
|
if (parsed.noPreview) {
|
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.
|
|
2743
|
-
* `toolResponse.raw`
|
|
2744
|
-
*
|
|
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.
|
|
2743
|
-
* `toolResponse.raw`
|
|
2744
|
-
*
|
|
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.
|
|
422
|
+
version: "0.1.150",
|
|
423
423
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
424
424
|
supportPolicy: {
|
|
425
|
-
latest: "0.1.
|
|
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
|
|
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
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
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.
|
|
352
|
+
version: "0.1.150",
|
|
353
353
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
354
354
|
supportPolicy: {
|
|
355
|
-
latest: "0.1.
|
|
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 {
|
|
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
|
|
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
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
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 = [
|