deepline 0.2.74 → 0.3.1
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 +75 -4
- package/dist/bundling-sources/sdk/src/compat.ts +4 -0
- package/dist/bundling-sources/sdk/src/play.ts +7 -0
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +15 -1
- package/dist/bundling-sources/sdk/src/release.ts +12 -1
- package/dist/bundling-sources/sdk/src/types.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +146 -29
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +57 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +20 -19
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +100 -25
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +25 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +0 -9
- package/dist/bundling-sources/shared_libs/play-runtime/tool-response-contract.ts +89 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result-types.ts +29 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +203 -16
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +6 -5
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +1 -0
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +5 -2
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
- package/dist/cli/index.js +123 -47
- package/dist/cli/index.mjs +86 -10
- package/dist/{compiler-manifest-DFuz9-0_.d.mts → compiler-manifest-BX85pKXW.d.mts} +7 -2
- package/dist/{compiler-manifest-DFuz9-0_.d.ts → compiler-manifest-BX85pKXW.d.ts} +7 -2
- package/dist/index.d.mts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +85 -4
- package/dist/index.mjs +85 -4
- package/dist/install-integrity.json +3 -2
- package/dist/plays/bundle-play-file.d.mts +12 -2
- package/dist/plays/bundle-play-file.d.ts +12 -2
- package/dist/plays/bundle-play-file.mjs +20 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -185,7 +185,7 @@ function configureProxyFromEnv() {
|
|
|
185
185
|
configureProxyFromEnv();
|
|
186
186
|
|
|
187
187
|
// src/cli/index.ts
|
|
188
|
-
var
|
|
188
|
+
var import_promises10 = require("fs/promises");
|
|
189
189
|
var import_node_path26 = require("path");
|
|
190
190
|
var import_node_os19 = require("os");
|
|
191
191
|
var import_commander4 = require("commander");
|
|
@@ -1044,7 +1044,11 @@ 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
|
-
|
|
1047
|
+
// 0.3.0 introduces raw-v2: complete scrubbed provider responses are
|
|
1048
|
+
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
1049
|
+
// getters keep their established compatibility behavior.
|
|
1050
|
+
version: "0.3.1",
|
|
1051
|
+
updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
|
|
1048
1052
|
contracts: {
|
|
1049
1053
|
api: {
|
|
1050
1054
|
name: "sdk-http-api",
|
|
@@ -3759,12 +3763,33 @@ function normalizePlayRuntimeEnvironment(value) {
|
|
|
3759
3763
|
return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
|
|
3760
3764
|
}
|
|
3761
3765
|
|
|
3766
|
+
// ../shared_libs/play-runtime/tool-response-contract.ts
|
|
3767
|
+
var RAW_V2_TOOL_RESPONSE_CONTRACT = "raw-v2";
|
|
3768
|
+
function legacyRawFromToolResponseRawV2(rawV2, view, responseMeta) {
|
|
3769
|
+
const legacyRaw = view === "data" && rawV2 && typeof rawV2 === "object" && !Array.isArray(rawV2) ? rawV2.data : rawV2;
|
|
3770
|
+
const deeplineBilling = responseMeta?.deepline_billing;
|
|
3771
|
+
if (view === "rawV2" && deeplineBilling !== void 0 && legacyRaw && typeof legacyRaw === "object" && !Array.isArray(legacyRaw)) {
|
|
3772
|
+
return {
|
|
3773
|
+
...legacyRaw,
|
|
3774
|
+
deepline_billing: deeplineBilling
|
|
3775
|
+
};
|
|
3776
|
+
}
|
|
3777
|
+
return legacyRaw;
|
|
3778
|
+
}
|
|
3779
|
+
function providerMetaFromToolResponseRawV2(rawV2, view) {
|
|
3780
|
+
if (view !== "data" || !rawV2 || typeof rawV2 !== "object" || Array.isArray(rawV2)) {
|
|
3781
|
+
return void 0;
|
|
3782
|
+
}
|
|
3783
|
+
const meta = rawV2.meta;
|
|
3784
|
+
return meta && typeof meta === "object" && !Array.isArray(meta) ? meta : void 0;
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3762
3787
|
// src/client.ts
|
|
3763
3788
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
3764
3789
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
3765
3790
|
var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
|
|
3766
3791
|
var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
|
|
3767
|
-
var
|
|
3792
|
+
var RAW_V2_EXECUTE_RESPONSE_CONTRACT = RAW_V2_TOOL_RESPONSE_CONTRACT;
|
|
3768
3793
|
var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
|
|
3769
3794
|
var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
|
|
3770
3795
|
var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
|
|
@@ -3979,6 +4004,50 @@ function requireTargetBillingIdempotencyKey(value) {
|
|
|
3979
4004
|
function isRecord7(value) {
|
|
3980
4005
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
3981
4006
|
}
|
|
4007
|
+
function materializeToolExecutionResponse(response) {
|
|
4008
|
+
const toolResponse = response.toolResponse;
|
|
4009
|
+
if (!toolResponse && isRecord7(response.result)) {
|
|
4010
|
+
const legacyResult = response.result;
|
|
4011
|
+
if (Object.prototype.hasOwnProperty.call(legacyResult, "data")) {
|
|
4012
|
+
const legacyMeta = isRecord7(legacyResult.meta) ? legacyResult.meta : void 0;
|
|
4013
|
+
return {
|
|
4014
|
+
...response,
|
|
4015
|
+
toolResponse: {
|
|
4016
|
+
raw: legacyResult.data,
|
|
4017
|
+
...legacyMeta ? { meta: legacyMeta } : {}
|
|
4018
|
+
}
|
|
4019
|
+
};
|
|
4020
|
+
}
|
|
4021
|
+
}
|
|
4022
|
+
if (!toolResponse || Object.prototype.hasOwnProperty.call(toolResponse, "raw")) {
|
|
4023
|
+
return response;
|
|
4024
|
+
}
|
|
4025
|
+
const rawV2 = toolResponse.rawV2;
|
|
4026
|
+
const view = toolResponse.view;
|
|
4027
|
+
const providerMeta = providerMetaFromToolResponseRawV2(
|
|
4028
|
+
rawV2,
|
|
4029
|
+
view ?? "rawV2"
|
|
4030
|
+
);
|
|
4031
|
+
const responseMeta = isRecord7(toolResponse.responseMeta) ? toolResponse.responseMeta : void 0;
|
|
4032
|
+
return {
|
|
4033
|
+
...response,
|
|
4034
|
+
toolResponse: {
|
|
4035
|
+
...toolResponse,
|
|
4036
|
+
raw: legacyRawFromToolResponseRawV2(
|
|
4037
|
+
rawV2,
|
|
4038
|
+
view ?? "rawV2",
|
|
4039
|
+
responseMeta
|
|
4040
|
+
),
|
|
4041
|
+
...toolResponse.meta || providerMeta || responseMeta ? {
|
|
4042
|
+
meta: {
|
|
4043
|
+
...toolResponse.meta ?? {},
|
|
4044
|
+
...providerMeta ?? {},
|
|
4045
|
+
...responseMeta ?? {}
|
|
4046
|
+
}
|
|
4047
|
+
} : {}
|
|
4048
|
+
}
|
|
4049
|
+
};
|
|
4050
|
+
}
|
|
3982
4051
|
function isPrebuiltPlayDescription(play) {
|
|
3983
4052
|
return play.origin === "prebuilt" || play.ownerType === "deepline";
|
|
3984
4053
|
}
|
|
@@ -4528,14 +4597,14 @@ var DeeplineClient = class {
|
|
|
4528
4597
|
*/
|
|
4529
4598
|
async executeTool(toolId, input2, options) {
|
|
4530
4599
|
const headers = {
|
|
4531
|
-
[EXECUTE_RESPONSE_CONTRACT_HEADER]:
|
|
4600
|
+
[EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
|
|
4532
4601
|
[TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
|
|
4533
4602
|
TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
4534
4603
|
),
|
|
4535
4604
|
...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
|
|
4536
4605
|
[EXECUTE_RESPONSE_INTENT_HEADER]: options?.responseIntent ?? "raw"
|
|
4537
4606
|
};
|
|
4538
|
-
|
|
4607
|
+
const response = await this.http.post(
|
|
4539
4608
|
`/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
|
|
4540
4609
|
{
|
|
4541
4610
|
payload: input2,
|
|
@@ -4549,6 +4618,7 @@ var DeeplineClient = class {
|
|
|
4549
4618
|
toolId
|
|
4550
4619
|
}
|
|
4551
4620
|
);
|
|
4621
|
+
return materializeToolExecutionResponse(response);
|
|
4552
4622
|
}
|
|
4553
4623
|
/**
|
|
4554
4624
|
* Back-compatible alias for {@link executeTool}.
|
|
@@ -10998,7 +11068,7 @@ Examples:
|
|
|
10998
11068
|
}
|
|
10999
11069
|
|
|
11000
11070
|
// src/cli/commands/enrich.ts
|
|
11001
|
-
var
|
|
11071
|
+
var import_promises7 = require("fs/promises");
|
|
11002
11072
|
var import_node_os10 = require("os");
|
|
11003
11073
|
var import_node_path15 = require("path");
|
|
11004
11074
|
var import_commander2 = require("commander");
|
|
@@ -11006,7 +11076,7 @@ var import_commander2 = require("commander");
|
|
|
11006
11076
|
// src/cli/commands/play.ts
|
|
11007
11077
|
var import_node_crypto6 = require("crypto");
|
|
11008
11078
|
var import_node_fs12 = require("fs");
|
|
11009
|
-
var
|
|
11079
|
+
var import_promises6 = require("fs/promises");
|
|
11010
11080
|
var import_node_path14 = require("path");
|
|
11011
11081
|
var import_sync5 = require("csv-parse/sync");
|
|
11012
11082
|
|
|
@@ -12714,6 +12784,7 @@ var import_node_os9 = require("os");
|
|
|
12714
12784
|
var import_node_path13 = require("path");
|
|
12715
12785
|
var import_node_url = require("url");
|
|
12716
12786
|
var import_node_fs11 = require("fs");
|
|
12787
|
+
var import_promises5 = require("fs/promises");
|
|
12717
12788
|
|
|
12718
12789
|
// ../shared_libs/plays/bundling/index.ts
|
|
12719
12790
|
var import_node_crypto4 = require("crypto");
|
|
@@ -18244,7 +18315,7 @@ var PLAY_RUN_RESERVED_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
|
|
|
18244
18315
|
]);
|
|
18245
18316
|
async function pathExistsIncludingSymlink(path) {
|
|
18246
18317
|
try {
|
|
18247
|
-
await (0,
|
|
18318
|
+
await (0, import_promises6.lstat)(path);
|
|
18248
18319
|
return true;
|
|
18249
18320
|
} catch (error) {
|
|
18250
18321
|
if (error.code === "ENOENT") {
|
|
@@ -18261,7 +18332,7 @@ function runIdFileTempPath(destination) {
|
|
|
18261
18332
|
}
|
|
18262
18333
|
async function removeRunIdTempFile(path) {
|
|
18263
18334
|
try {
|
|
18264
|
-
await (0,
|
|
18335
|
+
await (0, import_promises6.unlink)(path);
|
|
18265
18336
|
} catch (error) {
|
|
18266
18337
|
if (error.code !== "ENOENT") {
|
|
18267
18338
|
throw error;
|
|
@@ -18278,7 +18349,7 @@ async function preflightRunIdFile(path) {
|
|
|
18278
18349
|
const tempPath = runIdFileTempPath(destination);
|
|
18279
18350
|
let handle = null;
|
|
18280
18351
|
try {
|
|
18281
|
-
handle = await (0,
|
|
18352
|
+
handle = await (0, import_promises6.open)(tempPath, "wx", 384);
|
|
18282
18353
|
await handle.sync();
|
|
18283
18354
|
} catch (error) {
|
|
18284
18355
|
throw new Error(
|
|
@@ -18296,7 +18367,7 @@ async function readRunIdFile(destination) {
|
|
|
18296
18367
|
}
|
|
18297
18368
|
let parsed;
|
|
18298
18369
|
try {
|
|
18299
|
-
parsed = JSON.parse(await (0,
|
|
18370
|
+
parsed = JSON.parse(await (0, import_promises6.readFile)(destination, "utf8"));
|
|
18300
18371
|
} catch (error) {
|
|
18301
18372
|
throw new Error(
|
|
18302
18373
|
`--run-id-file destination contains invalid JSON: ${destination}. Refusing to overwrite it (${error instanceof Error ? error.message : String(error)}).`
|
|
@@ -18320,7 +18391,7 @@ async function writePlayRunIdFile(destination, runId) {
|
|
|
18320
18391
|
const tempPath = runIdFileTempPath(destination);
|
|
18321
18392
|
let handle = null;
|
|
18322
18393
|
try {
|
|
18323
|
-
handle = await (0,
|
|
18394
|
+
handle = await (0, import_promises6.open)(tempPath, "wx", 384);
|
|
18324
18395
|
await handle.writeFile(
|
|
18325
18396
|
`${JSON.stringify({ version: 1, runId })}
|
|
18326
18397
|
`,
|
|
@@ -18330,8 +18401,8 @@ async function writePlayRunIdFile(destination, runId) {
|
|
|
18330
18401
|
await handle.close();
|
|
18331
18402
|
handle = null;
|
|
18332
18403
|
try {
|
|
18333
|
-
await (0,
|
|
18334
|
-
const directory = await (0,
|
|
18404
|
+
await (0, import_promises6.link)(tempPath, destination);
|
|
18405
|
+
const directory = await (0, import_promises6.open)((0, import_node_path14.dirname)(destination), "r");
|
|
18335
18406
|
try {
|
|
18336
18407
|
await directory.sync();
|
|
18337
18408
|
} finally {
|
|
@@ -27623,6 +27694,7 @@ var ENRICH_DEBUG_T0 = Date.now();
|
|
|
27623
27694
|
var GENERATED_ENRICH_ROWS_TABLE_NAMESPACE = "deepline_enrich_rows";
|
|
27624
27695
|
var SDK_ENRICH_TELEMETRY_TIMEOUT_MS = 1e4;
|
|
27625
27696
|
var SDK_ENRICH_TELEMETRY_COMMAND_MAX_LENGTH = 2e4;
|
|
27697
|
+
var ENRICH_DEPRECATION_NOTICE = "DEPRECATION: `deepline enrich` is deprecated and no longer actively maintained. Use `deepline plays` for the supported workflow.\n";
|
|
27626
27698
|
var ENRICH_AI_RUNTIME_COMPACT_TOOLS = /* @__PURE__ */ new Set([
|
|
27627
27699
|
"ai_inference",
|
|
27628
27700
|
"aiinference",
|
|
@@ -27796,7 +27868,7 @@ async function readAtFileReference(value, argumentName, strip = true) {
|
|
|
27796
27868
|
throw new Error(`Invalid ${argumentName} value: empty @file path.`);
|
|
27797
27869
|
}
|
|
27798
27870
|
try {
|
|
27799
|
-
const text = await (0,
|
|
27871
|
+
const text = await (0, import_promises7.readFile)(filePath, "utf8");
|
|
27800
27872
|
const normalized = text.replace(/^\uFEFF/, "");
|
|
27801
27873
|
return strip ? normalized.trim() : normalized;
|
|
27802
27874
|
} catch (error) {
|
|
@@ -28094,7 +28166,7 @@ async function buildPlanArgs(args) {
|
|
|
28094
28166
|
async function assertInputCsvExists(inputCsv) {
|
|
28095
28167
|
const path = (0, import_node_path15.resolve)(inputCsv);
|
|
28096
28168
|
try {
|
|
28097
|
-
const info = await (0,
|
|
28169
|
+
const info = await (0, import_promises7.stat)(path);
|
|
28098
28170
|
if (info.isFile()) {
|
|
28099
28171
|
return;
|
|
28100
28172
|
}
|
|
@@ -28115,8 +28187,8 @@ async function assertSafeOutputPath(inputCsv, outputPath) {
|
|
|
28115
28187
|
}
|
|
28116
28188
|
try {
|
|
28117
28189
|
const [inputInfo, outputInfo] = await Promise.all([
|
|
28118
|
-
(0,
|
|
28119
|
-
(0,
|
|
28190
|
+
(0, import_promises7.stat)(input2),
|
|
28191
|
+
(0, import_promises7.stat)(output2)
|
|
28120
28192
|
]);
|
|
28121
28193
|
if (inputInfo.dev === outputInfo.dev && inputInfo.ino === outputInfo.ino) {
|
|
28122
28194
|
throw new Error(
|
|
@@ -28136,7 +28208,7 @@ async function assertSafeOutputPath(inputCsv, outputPath) {
|
|
|
28136
28208
|
}
|
|
28137
28209
|
async function regularFileExists(path) {
|
|
28138
28210
|
try {
|
|
28139
|
-
const info = await (0,
|
|
28211
|
+
const info = await (0, import_promises7.stat)((0, import_node_path15.resolve)(path));
|
|
28140
28212
|
return info.isFile();
|
|
28141
28213
|
} catch (error) {
|
|
28142
28214
|
const code = error && typeof error === "object" ? error.code : void 0;
|
|
@@ -28147,7 +28219,7 @@ async function regularFileExists(path) {
|
|
|
28147
28219
|
}
|
|
28148
28220
|
}
|
|
28149
28221
|
async function readConfig(path) {
|
|
28150
|
-
const source = await (0,
|
|
28222
|
+
const source = await (0, import_promises7.readFile)((0, import_node_path15.resolve)(path), "utf8");
|
|
28151
28223
|
let parsed;
|
|
28152
28224
|
try {
|
|
28153
28225
|
parsed = JSON.parse(source);
|
|
@@ -28568,7 +28640,7 @@ async function writeOutputCsv(outputPath, status, options) {
|
|
|
28568
28640
|
]),
|
|
28569
28641
|
options?.config
|
|
28570
28642
|
);
|
|
28571
|
-
await (0,
|
|
28643
|
+
await (0, import_promises7.writeFile)(
|
|
28572
28644
|
(0, import_node_path15.resolve)(outputPath),
|
|
28573
28645
|
csvStringFromRows(merged.rows, columns),
|
|
28574
28646
|
"utf8"
|
|
@@ -30248,7 +30320,7 @@ async function persistEnrichFailureReport(input2) {
|
|
|
30248
30320
|
}
|
|
30249
30321
|
const stateDir = (0, import_node_path15.join)((0, import_node_os10.homedir)(), ".local", "deepline", "runtime", "state");
|
|
30250
30322
|
const reportPrefix = input2.jobs.length > 0 ? "run-block-failures" : "enrich-issues";
|
|
30251
|
-
await (0,
|
|
30323
|
+
await (0, import_promises7.mkdir)(stateDir, { recursive: true });
|
|
30252
30324
|
const reportPath = (0, import_node_path15.join)(
|
|
30253
30325
|
stateDir,
|
|
30254
30326
|
`${reportPrefix}-${Math.floor(Date.now() / 1e3)}-${process.pid}.json`
|
|
@@ -30274,7 +30346,7 @@ async function persistEnrichFailureReport(input2) {
|
|
|
30274
30346
|
if (input2.rows.rowStart !== null && input2.rows.rowEnd !== null) {
|
|
30275
30347
|
report.rows = { start: input2.rows.rowStart, end: input2.rows.rowEnd };
|
|
30276
30348
|
}
|
|
30277
|
-
await (0,
|
|
30349
|
+
await (0, import_promises7.writeFile)(reportPath, `${JSON.stringify(report, null, 2)}
|
|
30278
30350
|
`, "utf8");
|
|
30279
30351
|
return reportPath;
|
|
30280
30352
|
}
|
|
@@ -31092,6 +31164,7 @@ function registerEnrichCommand(program) {
|
|
|
31092
31164
|
"--max-credits-per-run <credits>",
|
|
31093
31165
|
"Set a hard Deepline-credit ceiling enforced by the runtime for this run."
|
|
31094
31166
|
).action(async (options, _command) => {
|
|
31167
|
+
process.stderr.write(ENRICH_DEPRECATION_NOTICE);
|
|
31095
31168
|
if (currentEnrichArgs().some(
|
|
31096
31169
|
(arg) => arg === "--no-open" || arg.startsWith("--no-open=")
|
|
31097
31170
|
)) {
|
|
@@ -31177,13 +31250,13 @@ function registerEnrichCommand(program) {
|
|
|
31177
31250
|
sdkEnrichTelemetryCompleted = true;
|
|
31178
31251
|
await completeSdkEnrichTelemetry(sdkEnrichTelemetry, input2);
|
|
31179
31252
|
};
|
|
31180
|
-
const tempDir = await (0,
|
|
31253
|
+
const tempDir = await (0, import_promises7.mkdtemp)((0, import_node_path15.join)((0, import_node_os10.tmpdir)(), "deepline-enrich-play-"));
|
|
31181
31254
|
await emitSdkEnrichTelemetry(sdkEnrichTelemetry, "enrich_started");
|
|
31182
31255
|
const tempPlay = (0, import_node_path15.join)(tempDir, "deepline-enrich.play.ts");
|
|
31183
31256
|
let inPlaceTempDir = null;
|
|
31184
31257
|
let inPlaceTempOutputPath = null;
|
|
31185
31258
|
const inPlaceFinalOutputPath = options.inPlace ? (0, import_node_path15.resolve)(inputCsv) : null;
|
|
31186
|
-
const inPlaceCommitOutputPath = options.inPlace ? (await (0,
|
|
31259
|
+
const inPlaceCommitOutputPath = options.inPlace ? (await (0, import_promises7.lstat)(inputCsv)).isSymbolicLink() ? await (0, import_promises7.realpath)(inputCsv) : inPlaceFinalOutputPath : null;
|
|
31187
31260
|
const failureReportOutputPath = options.inPlace ? inPlaceFinalOutputPath : null;
|
|
31188
31261
|
const enrichIssueFollowUpOutputPath = options.inPlace && inPlaceFinalOutputPath ? sidecarEnrichRowsExportPath(inPlaceFinalOutputPath) : null;
|
|
31189
31262
|
let activeRunId2 = null;
|
|
@@ -31204,16 +31277,16 @@ function registerEnrichCommand(program) {
|
|
|
31204
31277
|
return;
|
|
31205
31278
|
}
|
|
31206
31279
|
if (inPlaceTempDir) {
|
|
31207
|
-
await (0,
|
|
31280
|
+
await (0, import_promises7.rm)(inPlaceTempDir, { recursive: true, force: true });
|
|
31208
31281
|
}
|
|
31209
|
-
inPlaceTempDir = await (0,
|
|
31282
|
+
inPlaceTempDir = await (0, import_promises7.mkdtemp)(
|
|
31210
31283
|
(0, import_node_path15.join)(
|
|
31211
31284
|
(0, import_node_path15.dirname)(inPlaceCommitOutputPath ?? (0, import_node_path15.resolve)(inputCsv)),
|
|
31212
31285
|
".deepline-enrich-in-place-"
|
|
31213
31286
|
)
|
|
31214
31287
|
);
|
|
31215
31288
|
inPlaceTempOutputPath = (0, import_node_path15.join)(inPlaceTempDir, "output.csv");
|
|
31216
|
-
await (0,
|
|
31289
|
+
await (0, import_promises7.copyFile)((0, import_node_path15.resolve)(inputCsv), inPlaceTempOutputPath);
|
|
31217
31290
|
outputPath = inPlaceTempOutputPath;
|
|
31218
31291
|
};
|
|
31219
31292
|
const commitInPlaceOutput = async (exportResult) => {
|
|
@@ -31221,12 +31294,12 @@ function registerEnrichCommand(program) {
|
|
|
31221
31294
|
return exportResult;
|
|
31222
31295
|
}
|
|
31223
31296
|
const committedTempDir = inPlaceTempDir;
|
|
31224
|
-
await (0,
|
|
31297
|
+
await (0, import_promises7.rename)(inPlaceTempOutputPath, inPlaceCommitOutputPath);
|
|
31225
31298
|
inPlaceTempDir = null;
|
|
31226
31299
|
inPlaceTempOutputPath = null;
|
|
31227
31300
|
outputPath = inPlaceFinalOutputPath;
|
|
31228
31301
|
if (committedTempDir) {
|
|
31229
|
-
await (0,
|
|
31302
|
+
await (0, import_promises7.rm)(committedTempDir, { recursive: true, force: true });
|
|
31230
31303
|
}
|
|
31231
31304
|
if (!exportResult) {
|
|
31232
31305
|
return null;
|
|
@@ -31239,7 +31312,7 @@ function registerEnrichCommand(program) {
|
|
|
31239
31312
|
try {
|
|
31240
31313
|
process.once("SIGINT", onSigint);
|
|
31241
31314
|
process.once("SIGTERM", onSigterm);
|
|
31242
|
-
await (0,
|
|
31315
|
+
await (0, import_promises7.writeFile)(tempPlay, playSource, "utf8");
|
|
31243
31316
|
if (options.inPlace) {
|
|
31244
31317
|
await prepareInPlaceOutput();
|
|
31245
31318
|
}
|
|
@@ -31433,11 +31506,11 @@ function registerEnrichCommand(program) {
|
|
|
31433
31506
|
process.removeListener("SIGINT", onSigint);
|
|
31434
31507
|
process.removeListener("SIGTERM", onSigterm);
|
|
31435
31508
|
if (inPlaceTempDir) {
|
|
31436
|
-
await (0,
|
|
31509
|
+
await (0, import_promises7.rm)(inPlaceTempDir, { recursive: true, force: true });
|
|
31437
31510
|
} else if (inPlaceTempOutputPath) {
|
|
31438
|
-
await (0,
|
|
31511
|
+
await (0, import_promises7.rm)(inPlaceTempOutputPath, { force: true });
|
|
31439
31512
|
}
|
|
31440
|
-
await (0,
|
|
31513
|
+
await (0, import_promises7.rm)(tempDir, { recursive: true, force: true });
|
|
31441
31514
|
}
|
|
31442
31515
|
});
|
|
31443
31516
|
}
|
|
@@ -32329,7 +32402,7 @@ Examples:
|
|
|
32329
32402
|
|
|
32330
32403
|
// src/cli/commands/monitors.ts
|
|
32331
32404
|
var import_node_fs14 = require("fs");
|
|
32332
|
-
var
|
|
32405
|
+
var import_promises8 = require("readline/promises");
|
|
32333
32406
|
var JSON_OPTION_DESCRIPTION = "Emit JSON output. Also automatic when stdout is piped";
|
|
32334
32407
|
function withJsonOption(command) {
|
|
32335
32408
|
return command.option("--json", JSON_OPTION_DESCRIPTION);
|
|
@@ -33098,7 +33171,7 @@ async function handleMonitorsValidate(key, options) {
|
|
|
33098
33171
|
if (result.valid === false) process.exitCode = 7;
|
|
33099
33172
|
}
|
|
33100
33173
|
async function confirmMonitorDelete(key, options) {
|
|
33101
|
-
const rl = (0,
|
|
33174
|
+
const rl = (0, import_promises8.createInterface)({
|
|
33102
33175
|
input: process.stdin,
|
|
33103
33176
|
output: process.stderr
|
|
33104
33177
|
});
|
|
@@ -40115,7 +40188,7 @@ Examples:
|
|
|
40115
40188
|
}
|
|
40116
40189
|
|
|
40117
40190
|
// src/cli/commands/workflow.ts
|
|
40118
|
-
var
|
|
40191
|
+
var import_promises9 = require("fs/promises");
|
|
40119
40192
|
var import_node_path24 = require("path");
|
|
40120
40193
|
|
|
40121
40194
|
// src/cli/workflow-to-play.ts
|
|
@@ -40333,7 +40406,7 @@ function readStatus(payload) {
|
|
|
40333
40406
|
}
|
|
40334
40407
|
async function readJsonOption(payload, file) {
|
|
40335
40408
|
if (file) {
|
|
40336
|
-
const raw = await (0,
|
|
40409
|
+
const raw = await (0, import_promises9.readFile)((0, import_node_path24.resolve)(file), "utf8");
|
|
40337
40410
|
return JSON.parse(raw);
|
|
40338
40411
|
}
|
|
40339
40412
|
if (payload) {
|
|
@@ -40368,8 +40441,8 @@ async function transformOne(api, workflowId, outDir, publish) {
|
|
|
40368
40441
|
{ workflowName: workflow.name, version: revision.version }
|
|
40369
40442
|
);
|
|
40370
40443
|
const file = (0, import_node_path24.join)((0, import_node_path24.resolve)(outDir), `${compiled.playName}.play.ts`);
|
|
40371
|
-
await (0,
|
|
40372
|
-
await (0,
|
|
40444
|
+
await (0, import_promises9.mkdir)((0, import_node_path24.dirname)(file), { recursive: true });
|
|
40445
|
+
await (0, import_promises9.writeFile)(file, compiled.sourceCode, "utf8");
|
|
40373
40446
|
let published = false;
|
|
40374
40447
|
if (publish) {
|
|
40375
40448
|
const code = await handlePlayPublish([file]);
|
|
@@ -40754,9 +40827,7 @@ function shouldSkipSelfUpdate() {
|
|
|
40754
40827
|
function parseSemver(version) {
|
|
40755
40828
|
const trimmed = version?.trim();
|
|
40756
40829
|
if (!trimmed) return null;
|
|
40757
|
-
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(
|
|
40758
|
-
trimmed
|
|
40759
|
-
);
|
|
40830
|
+
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(trimmed);
|
|
40760
40831
|
if (!match) return null;
|
|
40761
40832
|
return {
|
|
40762
40833
|
major: Number(match[1]),
|
|
@@ -40847,7 +40918,12 @@ async function maybeAutoUpdateAndRelaunch(response) {
|
|
|
40847
40918
|
);
|
|
40848
40919
|
return false;
|
|
40849
40920
|
}
|
|
40850
|
-
|
|
40921
|
+
const updateSummary = response.update_summary ? `
|
|
40922
|
+
What changed in ${response.update_summary.version}: ${response.update_summary.summary}` : "";
|
|
40923
|
+
process.stderr.write(
|
|
40924
|
+
`Deepline SDK/CLI updated; rerunning command.${updateSummary}
|
|
40925
|
+
`
|
|
40926
|
+
);
|
|
40851
40927
|
const exitCode = await relaunchCurrentCommand(plan);
|
|
40852
40928
|
process.exit(exitCode);
|
|
40853
40929
|
return true;
|
|
@@ -41500,10 +41576,10 @@ function topLevelCommandKnown(program, commandName) {
|
|
|
41500
41576
|
);
|
|
41501
41577
|
}
|
|
41502
41578
|
async function runPlayRunnerHealthCheck() {
|
|
41503
|
-
const dir = await (0,
|
|
41579
|
+
const dir = await (0, import_promises10.mkdtemp)((0, import_node_path26.join)((0, import_node_os19.tmpdir)(), "deepline-health-play-"));
|
|
41504
41580
|
const file = (0, import_node_path26.join)(dir, "health-check.play.ts");
|
|
41505
41581
|
try {
|
|
41506
|
-
await (0,
|
|
41582
|
+
await (0, import_promises10.writeFile)(
|
|
41507
41583
|
file,
|
|
41508
41584
|
[
|
|
41509
41585
|
"import { definePlay } from 'deepline';",
|
|
@@ -41552,7 +41628,7 @@ async function runPlayRunnerHealthCheck() {
|
|
|
41552
41628
|
}
|
|
41553
41629
|
};
|
|
41554
41630
|
} finally {
|
|
41555
|
-
await (0,
|
|
41631
|
+
await (0, import_promises10.rm)(dir, { recursive: true, force: true });
|
|
41556
41632
|
}
|
|
41557
41633
|
}
|
|
41558
41634
|
function pickString(value, ...keys) {
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1030,7 +1030,11 @@ 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
|
-
|
|
1033
|
+
// 0.3.0 introduces raw-v2: complete scrubbed provider responses are
|
|
1034
|
+
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
1035
|
+
// getters keep their established compatibility behavior.
|
|
1036
|
+
version: "0.3.1",
|
|
1037
|
+
updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
|
|
1034
1038
|
contracts: {
|
|
1035
1039
|
api: {
|
|
1036
1040
|
name: "sdk-http-api",
|
|
@@ -3745,12 +3749,33 @@ function normalizePlayRuntimeEnvironment(value) {
|
|
|
3745
3749
|
return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
|
|
3746
3750
|
}
|
|
3747
3751
|
|
|
3752
|
+
// ../shared_libs/play-runtime/tool-response-contract.ts
|
|
3753
|
+
var RAW_V2_TOOL_RESPONSE_CONTRACT = "raw-v2";
|
|
3754
|
+
function legacyRawFromToolResponseRawV2(rawV2, view, responseMeta) {
|
|
3755
|
+
const legacyRaw = view === "data" && rawV2 && typeof rawV2 === "object" && !Array.isArray(rawV2) ? rawV2.data : rawV2;
|
|
3756
|
+
const deeplineBilling = responseMeta?.deepline_billing;
|
|
3757
|
+
if (view === "rawV2" && deeplineBilling !== void 0 && legacyRaw && typeof legacyRaw === "object" && !Array.isArray(legacyRaw)) {
|
|
3758
|
+
return {
|
|
3759
|
+
...legacyRaw,
|
|
3760
|
+
deepline_billing: deeplineBilling
|
|
3761
|
+
};
|
|
3762
|
+
}
|
|
3763
|
+
return legacyRaw;
|
|
3764
|
+
}
|
|
3765
|
+
function providerMetaFromToolResponseRawV2(rawV2, view) {
|
|
3766
|
+
if (view !== "data" || !rawV2 || typeof rawV2 !== "object" || Array.isArray(rawV2)) {
|
|
3767
|
+
return void 0;
|
|
3768
|
+
}
|
|
3769
|
+
const meta = rawV2.meta;
|
|
3770
|
+
return meta && typeof meta === "object" && !Array.isArray(meta) ? meta : void 0;
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3748
3773
|
// src/client.ts
|
|
3749
3774
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
3750
3775
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
3751
3776
|
var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
|
|
3752
3777
|
var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
|
|
3753
|
-
var
|
|
3778
|
+
var RAW_V2_EXECUTE_RESPONSE_CONTRACT = RAW_V2_TOOL_RESPONSE_CONTRACT;
|
|
3754
3779
|
var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
|
|
3755
3780
|
var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
|
|
3756
3781
|
var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
|
|
@@ -3965,6 +3990,50 @@ function requireTargetBillingIdempotencyKey(value) {
|
|
|
3965
3990
|
function isRecord7(value) {
|
|
3966
3991
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
3967
3992
|
}
|
|
3993
|
+
function materializeToolExecutionResponse(response) {
|
|
3994
|
+
const toolResponse = response.toolResponse;
|
|
3995
|
+
if (!toolResponse && isRecord7(response.result)) {
|
|
3996
|
+
const legacyResult = response.result;
|
|
3997
|
+
if (Object.prototype.hasOwnProperty.call(legacyResult, "data")) {
|
|
3998
|
+
const legacyMeta = isRecord7(legacyResult.meta) ? legacyResult.meta : void 0;
|
|
3999
|
+
return {
|
|
4000
|
+
...response,
|
|
4001
|
+
toolResponse: {
|
|
4002
|
+
raw: legacyResult.data,
|
|
4003
|
+
...legacyMeta ? { meta: legacyMeta } : {}
|
|
4004
|
+
}
|
|
4005
|
+
};
|
|
4006
|
+
}
|
|
4007
|
+
}
|
|
4008
|
+
if (!toolResponse || Object.prototype.hasOwnProperty.call(toolResponse, "raw")) {
|
|
4009
|
+
return response;
|
|
4010
|
+
}
|
|
4011
|
+
const rawV2 = toolResponse.rawV2;
|
|
4012
|
+
const view = toolResponse.view;
|
|
4013
|
+
const providerMeta = providerMetaFromToolResponseRawV2(
|
|
4014
|
+
rawV2,
|
|
4015
|
+
view ?? "rawV2"
|
|
4016
|
+
);
|
|
4017
|
+
const responseMeta = isRecord7(toolResponse.responseMeta) ? toolResponse.responseMeta : void 0;
|
|
4018
|
+
return {
|
|
4019
|
+
...response,
|
|
4020
|
+
toolResponse: {
|
|
4021
|
+
...toolResponse,
|
|
4022
|
+
raw: legacyRawFromToolResponseRawV2(
|
|
4023
|
+
rawV2,
|
|
4024
|
+
view ?? "rawV2",
|
|
4025
|
+
responseMeta
|
|
4026
|
+
),
|
|
4027
|
+
...toolResponse.meta || providerMeta || responseMeta ? {
|
|
4028
|
+
meta: {
|
|
4029
|
+
...toolResponse.meta ?? {},
|
|
4030
|
+
...providerMeta ?? {},
|
|
4031
|
+
...responseMeta ?? {}
|
|
4032
|
+
}
|
|
4033
|
+
} : {}
|
|
4034
|
+
}
|
|
4035
|
+
};
|
|
4036
|
+
}
|
|
3968
4037
|
function isPrebuiltPlayDescription(play) {
|
|
3969
4038
|
return play.origin === "prebuilt" || play.ownerType === "deepline";
|
|
3970
4039
|
}
|
|
@@ -4514,14 +4583,14 @@ var DeeplineClient = class {
|
|
|
4514
4583
|
*/
|
|
4515
4584
|
async executeTool(toolId, input2, options) {
|
|
4516
4585
|
const headers = {
|
|
4517
|
-
[EXECUTE_RESPONSE_CONTRACT_HEADER]:
|
|
4586
|
+
[EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
|
|
4518
4587
|
[TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
|
|
4519
4588
|
TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
4520
4589
|
),
|
|
4521
4590
|
...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
|
|
4522
4591
|
[EXECUTE_RESPONSE_INTENT_HEADER]: options?.responseIntent ?? "raw"
|
|
4523
4592
|
};
|
|
4524
|
-
|
|
4593
|
+
const response = await this.http.post(
|
|
4525
4594
|
`/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
|
|
4526
4595
|
{
|
|
4527
4596
|
payload: input2,
|
|
@@ -4535,6 +4604,7 @@ var DeeplineClient = class {
|
|
|
4535
4604
|
toolId
|
|
4536
4605
|
}
|
|
4537
4606
|
);
|
|
4607
|
+
return materializeToolExecutionResponse(response);
|
|
4538
4608
|
}
|
|
4539
4609
|
/**
|
|
4540
4610
|
* Back-compatible alias for {@link executeTool}.
|
|
@@ -11010,7 +11080,7 @@ import {
|
|
|
11010
11080
|
mkdir as mkdir4,
|
|
11011
11081
|
mkdtemp,
|
|
11012
11082
|
readFile as readFile3,
|
|
11013
|
-
realpath as
|
|
11083
|
+
realpath as realpath3,
|
|
11014
11084
|
rename,
|
|
11015
11085
|
rm,
|
|
11016
11086
|
stat as stat3,
|
|
@@ -12758,6 +12828,7 @@ import { tmpdir as tmpdir3 } from "os";
|
|
|
12758
12828
|
import { dirname as dirname8, join as join9, resolve as resolve10 } from "path";
|
|
12759
12829
|
import { fileURLToPath } from "url";
|
|
12760
12830
|
import { existsSync as existsSync8 } from "fs";
|
|
12831
|
+
import { realpath as realpath2 } from "fs/promises";
|
|
12761
12832
|
|
|
12762
12833
|
// ../shared_libs/plays/bundling/index.ts
|
|
12763
12834
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -27683,6 +27754,7 @@ var ENRICH_DEBUG_T0 = Date.now();
|
|
|
27683
27754
|
var GENERATED_ENRICH_ROWS_TABLE_NAMESPACE = "deepline_enrich_rows";
|
|
27684
27755
|
var SDK_ENRICH_TELEMETRY_TIMEOUT_MS = 1e4;
|
|
27685
27756
|
var SDK_ENRICH_TELEMETRY_COMMAND_MAX_LENGTH = 2e4;
|
|
27757
|
+
var ENRICH_DEPRECATION_NOTICE = "DEPRECATION: `deepline enrich` is deprecated and no longer actively maintained. Use `deepline plays` for the supported workflow.\n";
|
|
27686
27758
|
var ENRICH_AI_RUNTIME_COMPACT_TOOLS = /* @__PURE__ */ new Set([
|
|
27687
27759
|
"ai_inference",
|
|
27688
27760
|
"aiinference",
|
|
@@ -31152,6 +31224,7 @@ function registerEnrichCommand(program) {
|
|
|
31152
31224
|
"--max-credits-per-run <credits>",
|
|
31153
31225
|
"Set a hard Deepline-credit ceiling enforced by the runtime for this run."
|
|
31154
31226
|
).action(async (options, _command) => {
|
|
31227
|
+
process.stderr.write(ENRICH_DEPRECATION_NOTICE);
|
|
31155
31228
|
if (currentEnrichArgs().some(
|
|
31156
31229
|
(arg) => arg === "--no-open" || arg.startsWith("--no-open=")
|
|
31157
31230
|
)) {
|
|
@@ -31243,7 +31316,7 @@ function registerEnrichCommand(program) {
|
|
|
31243
31316
|
let inPlaceTempDir = null;
|
|
31244
31317
|
let inPlaceTempOutputPath = null;
|
|
31245
31318
|
const inPlaceFinalOutputPath = options.inPlace ? resolve12(inputCsv) : null;
|
|
31246
|
-
const inPlaceCommitOutputPath = options.inPlace ? (await lstat2(inputCsv)).isSymbolicLink() ? await
|
|
31319
|
+
const inPlaceCommitOutputPath = options.inPlace ? (await lstat2(inputCsv)).isSymbolicLink() ? await realpath3(inputCsv) : inPlaceFinalOutputPath : null;
|
|
31247
31320
|
const failureReportOutputPath = options.inPlace ? inPlaceFinalOutputPath : null;
|
|
31248
31321
|
const enrichIssueFollowUpOutputPath = options.inPlace && inPlaceFinalOutputPath ? sidecarEnrichRowsExportPath(inPlaceFinalOutputPath) : null;
|
|
31249
31322
|
let activeRunId2 = null;
|
|
@@ -40850,9 +40923,7 @@ function shouldSkipSelfUpdate() {
|
|
|
40850
40923
|
function parseSemver(version) {
|
|
40851
40924
|
const trimmed = version?.trim();
|
|
40852
40925
|
if (!trimmed) return null;
|
|
40853
|
-
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(
|
|
40854
|
-
trimmed
|
|
40855
|
-
);
|
|
40926
|
+
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(trimmed);
|
|
40856
40927
|
if (!match) return null;
|
|
40857
40928
|
return {
|
|
40858
40929
|
major: Number(match[1]),
|
|
@@ -40943,7 +41014,12 @@ async function maybeAutoUpdateAndRelaunch(response) {
|
|
|
40943
41014
|
);
|
|
40944
41015
|
return false;
|
|
40945
41016
|
}
|
|
40946
|
-
|
|
41017
|
+
const updateSummary = response.update_summary ? `
|
|
41018
|
+
What changed in ${response.update_summary.version}: ${response.update_summary.summary}` : "";
|
|
41019
|
+
process.stderr.write(
|
|
41020
|
+
`Deepline SDK/CLI updated; rerunning command.${updateSummary}
|
|
41021
|
+
`
|
|
41022
|
+
);
|
|
40947
41023
|
const exitCode = await relaunchCurrentCommand(plan);
|
|
40948
41024
|
process.exit(exitCode);
|
|
40949
41025
|
return true;
|
|
@@ -724,6 +724,10 @@ type ToolResultListAccessor<T = Record<string, unknown>, TKey extends string = s
|
|
|
724
724
|
};
|
|
725
725
|
type ToolResponseEnvelope<TData = unknown, TMeta = Record<string, unknown>> = {
|
|
726
726
|
raw: TData;
|
|
727
|
+
/** Complete parsed and scrubbed provider response, materialized from raw-v2. */
|
|
728
|
+
rawV2?: unknown;
|
|
729
|
+
/** Durable descriptor for deriving the legacy raw view from `rawV2`. */
|
|
730
|
+
view?: 'data' | 'rawV2';
|
|
727
731
|
meta?: TMeta;
|
|
728
732
|
};
|
|
729
733
|
type ToolExecuteResultBase<TResult = unknown, TMeta = Record<string, unknown>> = {
|
|
@@ -765,8 +769,9 @@ type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Par
|
|
|
765
769
|
* Canonical result returned by Deepline tool execution.
|
|
766
770
|
*
|
|
767
771
|
* The top-level object is Deepline-owned execution metadata and semantic
|
|
768
|
-
* extraction state.
|
|
769
|
-
*
|
|
772
|
+
* extraction state. The canonical provider response lives under
|
|
773
|
+
* `toolResponse.rawV2`; `toolResponse.raw` remains the legacy compatibility
|
|
774
|
+
* projection. Response metadata lives under `toolResponse.meta`. Semantic single-value
|
|
770
775
|
* getters live under `extractedValues.<name>.get()`, and list getters live
|
|
771
776
|
* under `extractedLists.<name>.get()`.
|
|
772
777
|
*
|