deepline 0.3.392 → 0.3.393
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 +156 -24
- package/dist/bundling-sources/sdk/src/compat.ts +9 -0
- package/dist/bundling-sources/sdk/src/http.ts +5 -1
- package/dist/bundling-sources/sdk/src/index.ts +5 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +182 -6
- package/dist/bundling-sources/sdk/src/release.ts +4 -1
- package/dist/bundling-sources/sdk/src/types.ts +13 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/request-warnings.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +315 -0
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +41 -8
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +418 -44
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +36 -3
- package/dist/bundling-sources/shared_libs/play-runtime/durable-invocation-fence.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +11 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +19 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +26 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +158 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +235 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +92 -58
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +30 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1161 -316
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +28 -15
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +24 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +31 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -4
- package/dist/bundling-sources/shared_libs/plays/dataset.ts +172 -79
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +173 -1
- package/dist/cli/{auth-6JSA2ZCW.mjs → auth-5PXHA232.mjs} +4 -4
- package/dist/cli/auth-P3MVDTXM.js +39 -0
- package/dist/cli/{billing-Q5BLQHIU.js → billing-JFB2XLSO.js} +101 -74
- package/dist/cli/{billing-MRRO643H.mjs → billing-Z2N7ZAGM.mjs} +32 -5
- package/dist/cli/{chunk-CVLM3WMJ.js → chunk-2HAD745V.js} +242 -183
- package/dist/cli/{chunk-HGYBEAQP.mjs → chunk-2LGC4EFT.mjs} +3 -3
- package/dist/cli/{chunk-A3APGZFP.mjs → chunk-4PT2VA3A.mjs} +2 -2
- package/dist/cli/{chunk-6DBOU7UH.js → chunk-4XX6443T.js} +176 -87
- package/dist/cli/{chunk-2QLML6G4.mjs → chunk-5KWKZIQR.mjs} +4 -4
- package/dist/cli/{chunk-2G7DXFHI.mjs → chunk-5PRVMXKB.mjs} +27 -2
- package/dist/cli/{chunk-DSWSEHRX.mjs → chunk-6I73X254.mjs} +1 -1
- package/dist/cli/{chunk-ZTACINO5.mjs → chunk-7HR7BGZL.mjs} +13 -3
- package/dist/cli/{chunk-BB3FNYFY.js → chunk-AARX5L4B.js} +2 -2
- package/dist/cli/{chunk-WMS5U6YB.js → chunk-CDFH2DYL.js} +20 -19
- package/dist/cli/{chunk-R3O2CZ4H.mjs → chunk-FQ6VHPW4.mjs} +2 -2
- package/dist/cli/{chunk-MU6M3URX.mjs → chunk-HLEESTCH.mjs} +1 -1
- package/dist/cli/{chunk-Q6EOHNRH.mjs → chunk-JI2B4RZP.mjs} +119 -6
- package/dist/cli/{chunk-2Q3GEFL4.mjs → chunk-KIYU2TGL.mjs} +2 -2
- package/dist/cli/{chunk-Y6VOGHF2.mjs → chunk-KZZC33PY.mjs} +0 -181
- package/dist/cli/{chunk-UCKJQG25.js → chunk-L2SYLGRP.js} +8 -8
- package/dist/cli/{chunk-2GAHHSLB.mjs → chunk-LMMEAMA7.mjs} +3 -2
- package/dist/cli/{chunk-YAZCDBXX.mjs → chunk-LZPCDB7U.mjs} +3 -2
- package/dist/cli/{chunk-RV6ALZIX.js → chunk-M7Y7JYZX.js} +32 -7
- package/dist/cli/{chunk-QGKPTBRR.js → chunk-MS6GUPBB.js} +3 -3
- package/dist/cli/{chunk-4SFPVW7A.js → chunk-OXNOAD6Y.js} +26 -26
- package/dist/cli/{chunk-JOFPQGXW.js → chunk-PTDECJGP.js} +50 -50
- package/dist/cli/{chunk-5O4B6AUN.js → chunk-PWSWAN7Q.js} +25 -2
- package/dist/cli/{chunk-YN6YA7ZZ.mjs → chunk-Q26LUSQ2.mjs} +79 -20
- package/dist/cli/{chunk-3VN4FTE3.js → chunk-RDXFGPJU.js} +1 -182
- package/dist/cli/{chunk-7E66A24V.mjs → chunk-RKMB3N7K.mjs} +25 -2
- package/dist/cli/{chunk-JSLPHFP7.js → chunk-RWHWF5ZJ.js} +3 -2
- package/dist/cli/{chunk-3FV4GBRK.mjs → chunk-STNYIMIV.mjs} +97 -8
- package/dist/cli/chunk-UBKA33KY.mjs +310 -0
- package/dist/cli/{chunk-PAIMOGCM.js → chunk-UHNDVD3P.js} +125 -12
- package/dist/cli/{chunk-24VEN5PQ.mjs → chunk-UOGZUA24.mjs} +179 -17
- package/dist/cli/{chunk-T7OKJ2T6.js → chunk-VIQJIX2P.js} +73 -63
- package/dist/cli/{chunk-RIV2GS5E.js → chunk-VIWE6WRK.js} +627 -465
- package/dist/cli/{chunk-EY7RFC6A.js → chunk-W4WOMXR3.js} +15 -15
- package/dist/cli/chunk-XDVT3GOM.js +310 -0
- package/dist/cli/{chunk-2FQG2HU4.js → chunk-Z3OOZM5L.js} +8 -8
- package/dist/cli/{csv-E4QGUIGI.mjs → csv-KJWZHKCH.mjs} +3 -3
- package/dist/cli/{csv-26U5T24Z.js → csv-P3Z3YE7H.js} +12 -12
- package/dist/cli/{db-JTRJIAQW.mjs → db-NCM4CQIS.mjs} +6 -5
- package/dist/cli/{db-QHBFLMVL.js → db-NUZGJNQC.js} +31 -30
- package/dist/cli/{describe-E3DE3ZK3.mjs → describe-WT6MM2GO.mjs} +17 -16
- package/dist/cli/{describe-FDV2V74F.js → describe-YGSEN5WC.js} +24 -23
- package/dist/cli/{executions-VZYOGVQY.js → executions-PCOLHN7Q.js} +8 -7
- package/dist/cli/{executions-B3GTNPRE.mjs → executions-XS2IPJ4W.mjs} +6 -5
- package/dist/cli/{feedback-CR55FJA2.js → feedback-4MSH7TFU.js} +7 -7
- package/dist/cli/{feedback-4CEBR3OV.mjs → feedback-CCLTS5SV.mjs} +3 -3
- package/dist/cli/{git-NM2PHHZ4.mjs → git-K2DHPMPC.mjs} +4 -4
- package/dist/cli/git-RNM45FX4.js +23 -0
- package/dist/cli/index.js +96 -92
- package/dist/cli/index.mjs +46 -42
- package/dist/cli/{legacy-noops-A7MSW5ND.mjs → legacy-noops-B5S4AR3P.mjs} +4 -4
- package/dist/cli/{legacy-noops-ZUA4YFIH.js → legacy-noops-GPNOPFXV.js} +7 -7
- package/dist/cli/{monitors-NVPRQYP3.mjs → monitors-JLMAIPRG.mjs} +6 -5
- package/dist/cli/{monitors-ZE3TLZ4H.js → monitors-ZAWD7NSN.js} +87 -86
- package/dist/cli/{org-U7A6DV5D.js → org-P2KN4CES.js} +66 -65
- package/dist/cli/{org-KUBILNQV.mjs → org-T3JTHP4G.mjs} +6 -5
- package/dist/cli/{play-HRDXQ4QE.mjs → play-NK6BLRGL.mjs} +11 -10
- package/dist/cli/play-PDXR6JFB.js +158 -0
- package/dist/cli/{providers-OHIWI453.mjs → providers-3NQRA7IT.mjs} +6 -5
- package/dist/cli/{providers-VD6YTVQZ.js → providers-5QRZN3DT.js} +9 -8
- package/dist/cli/{quickstart-UBV2FONF.mjs → quickstart-PIA2JGPV.mjs} +3 -3
- package/dist/cli/{quickstart-ETTCWPA4.js → quickstart-R7NUZGNW.js} +5 -5
- package/dist/cli/run-identity-G257GQED.js +25 -0
- package/dist/cli/run-identity-MRNCEGV2.mjs +25 -0
- package/dist/cli/{search-F44IZRT7.mjs → search-AIDIIGLY.mjs} +7 -6
- package/dist/cli/search-QRWL7MFM.js +27 -0
- package/dist/cli/{secrets-CAEMRORF.js → secrets-BT3PGMWN.js} +15 -14
- package/dist/cli/{secrets-R6XOJZKU.mjs → secrets-OQNHL45O.mjs} +6 -5
- package/dist/cli/{sessions-6GC7OFTT.js → sessions-EYXWOSWK.js} +5 -5
- package/dist/cli/{sessions-RLN6UQS3.mjs → sessions-SF7WJPJP.mjs} +4 -4
- package/dist/cli/{settings-DPNVUAV2.js → settings-BA3GHBOD.js} +76 -75
- package/dist/cli/{settings-KIPAMRPP.mjs → settings-Y57JTFDD.mjs} +9 -8
- package/dist/cli/{setup-TU2F7PU5.mjs → setup-7GR5GBHA.mjs} +6 -6
- package/dist/cli/{setup-DTL3L5SG.js → setup-RERXYC66.js} +41 -41
- package/dist/cli/{skills-UV5MYJ46.mjs → skills-SJWIQAV5.mjs} +4 -4
- package/dist/cli/skills-V7EY75HB.js +28 -0
- package/dist/cli/tools-H5HLBCHH.js +41 -0
- package/dist/cli/{tools-QRRNDCQ7.mjs → tools-ZF3JXPNL.mjs} +10 -9
- package/dist/cli/update-472HA3LT.js +28 -0
- package/dist/cli/{update-4426TF35.mjs → update-FFFYQAOJ.mjs} +6 -6
- package/dist/cli/{workflow-HNLOVISB.js → workflow-SZJVQH4T.js} +17 -16
- package/dist/cli/{workflow-N4U5VLZ3.mjs → workflow-XVFEEGAS.mjs} +7 -6
- package/dist/{client-e6Qh5ZIg.d.mts → client-DU5dtHDy.d.mts} +153 -4
- package/dist/{client-Uxuy-xQ2.d.ts → client-mCE88hC4.d.ts} +153 -4
- package/dist/{compiler-manifest-CY2v8ab0.d.ts → compiler-manifest-DE4RdAiY.d.mts} +61 -1
- package/dist/{compiler-manifest-CY2v8ab0.d.mts → compiler-manifest-DE4RdAiY.d.ts} +61 -1
- package/dist/{index-B9fBZH1g.d.mts → index-BI6nWgaV.d.mts} +1 -1
- package/dist/{index-BZ6uzZJl.d.ts → index-Bi-f7HFT.d.ts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +120 -29
- package/dist/index.mjs +111 -20
- package/dist/install-integrity.json +91 -86
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +5 -2
- package/dist/plays/run-request.mjs +4 -1
- package/dist/release.d.mts +4 -1
- package/dist/release.d.ts +4 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-67TAELQL.js +0 -39
- package/dist/cli/git-I5JTK6YU.js +0 -23
- package/dist/cli/play-A2V7YDU7.js +0 -157
- package/dist/cli/search-WWXMBVPH.js +0 -26
- package/dist/cli/skills-SWOSEZLB.js +0 -28
- package/dist/cli/tools-IL2YCDQ6.js +0 -40
- package/dist/cli/update-BERDPEYR.js +0 -28
|
@@ -13,7 +13,7 @@ var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkL2SYLGRPjs = require('./chunk-L2SYLGRP.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -24,15 +24,17 @@ var _chunkUCKJQG25js = require('./chunk-UCKJQG25.js');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
var _chunkRDXFGPJUjs = require('./chunk-RDXFGPJU.js');
|
|
27
28
|
|
|
28
|
-
var _chunk3VN4FTE3js = require('./chunk-3VN4FTE3.js');
|
|
29
29
|
|
|
30
|
+
var _chunkPWSWAN7Qjs = require('./chunk-PWSWAN7Q.js');
|
|
30
31
|
|
|
31
|
-
var _chunk5O4B6AUNjs = require('./chunk-5O4B6AUN.js');
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
var _chunk2HAD745Vjs = require('./chunk-2HAD745V.js');
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
|
|
37
|
+
var _chunkXDVT3GOMjs = require('./chunk-XDVT3GOM.js');
|
|
36
38
|
|
|
37
39
|
|
|
38
40
|
|
|
@@ -46,11 +48,11 @@ var _chunkQJBJZVG6js = require('./chunk-QJBJZVG6.js');
|
|
|
46
48
|
|
|
47
49
|
|
|
48
50
|
|
|
49
|
-
var
|
|
51
|
+
var _chunkM7Y7JYZXjs = require('./chunk-M7Y7JYZX.js');
|
|
50
52
|
|
|
51
53
|
|
|
52
54
|
|
|
53
|
-
var
|
|
55
|
+
var _chunkCDFH2DYLjs = require('./chunk-CDFH2DYL.js');
|
|
54
56
|
|
|
55
57
|
|
|
56
58
|
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
@@ -58,6 +60,40 @@ var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
|
58
60
|
// src/cli/commands/tools.ts
|
|
59
61
|
var _commander = require('commander');
|
|
60
62
|
|
|
63
|
+
// ../integration-contracts/request-warnings.ts
|
|
64
|
+
function matchesToolRequestCondition(condition, payload) {
|
|
65
|
+
if ("all" in condition) {
|
|
66
|
+
return condition.all.every(
|
|
67
|
+
(entry) => matchesToolRequestCondition(entry, payload)
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
if ("any" in condition) {
|
|
71
|
+
return condition.any.some(
|
|
72
|
+
(entry) => matchesToolRequestCondition(entry, payload)
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
const value2 = _optionalChain([payload, 'optionalAccess', _ => _[condition.field]]);
|
|
76
|
+
switch (condition.operator) {
|
|
77
|
+
case "equals":
|
|
78
|
+
return value2 === condition.value;
|
|
79
|
+
case "number_equals":
|
|
80
|
+
try {
|
|
81
|
+
return Number(value2) === condition.value;
|
|
82
|
+
} catch (e) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
case "present_nonblank":
|
|
86
|
+
return typeof value2 === "string" ? value2.trim().length > 0 : value2 !== void 0 && value2 !== null;
|
|
87
|
+
default:
|
|
88
|
+
throw new Error("Unsupported tool request warning condition.");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function firstMatchingToolRequestWarning(rules, payload) {
|
|
92
|
+
return _optionalChain([rules, 'optionalAccess', _2 => _2.find, 'call', _3 => _3((rule) => matchesToolRequestCondition(rule.when, payload))]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// src/cli/commands/tools.ts
|
|
96
|
+
|
|
61
97
|
|
|
62
98
|
|
|
63
99
|
|
|
@@ -95,10 +131,10 @@ var ToolCallRecovery = class _ToolCallRecovery {
|
|
|
95
131
|
}
|
|
96
132
|
};
|
|
97
133
|
function pendingToolExecutionPath(input) {
|
|
98
|
-
const config =
|
|
99
|
-
const fingerprint = _crypto.createHash.call(void 0, "sha256").update(config.baseUrl).update("\0").update(_crypto.createHash.call(void 0, "sha256").update(config.apiKey).digest("hex")).update("\0").update(input.toolId).update("\0").update(
|
|
134
|
+
const config = _chunkCDFH2DYLjs.resolveConfig.call(void 0, );
|
|
135
|
+
const fingerprint = _crypto.createHash.call(void 0, "sha256").update(config.baseUrl).update("\0").update(_crypto.createHash.call(void 0, "sha256").update(config.apiKey).digest("hex")).update("\0").update(input.toolId).update("\0").update(_chunkXDVT3GOMjs.stableStringify.call(void 0, input.params)).update("\0").update(input.responseIntent).digest("hex");
|
|
100
136
|
return _path.join.call(void 0,
|
|
101
|
-
|
|
137
|
+
_chunkCDFH2DYLjs.sdkCliStateDirPath.call(void 0, config.baseUrl),
|
|
102
138
|
`pending-tool-execution-${fingerprint}.json`
|
|
103
139
|
);
|
|
104
140
|
}
|
|
@@ -319,7 +355,7 @@ function catalogFields() {
|
|
|
319
355
|
var FIELDS_BY_ID = new Map(catalogFields().map((field) => [field.id, field]));
|
|
320
356
|
function generalField(id) {
|
|
321
357
|
const field = FIELDS_BY_ID.get(id);
|
|
322
|
-
return _optionalChain([field, 'optionalAccess',
|
|
358
|
+
return _optionalChain([field, 'optionalAccess', _4 => _4.kind]) ? [field.entity, field.group, field.leaf].join(".") : null;
|
|
323
359
|
}
|
|
324
360
|
function fieldSatisfies(offered, wanted) {
|
|
325
361
|
return offered === wanted || generalField(offered) === wanted;
|
|
@@ -400,7 +436,7 @@ function formatModelDescription(description) {
|
|
|
400
436
|
function appendNamespace(lines, namespace) {
|
|
401
437
|
lines.push(`- ${namespace.provider} (${namespace.sourceSymbol})`);
|
|
402
438
|
for (const field of namespace.fields) {
|
|
403
|
-
const values = _optionalChain([field, 'access',
|
|
439
|
+
const values = _optionalChain([field, 'access', _5 => _5.enumValues, 'optionalAccess', _6 => _6.length]) ? ` (${field.enumValues.map((value2) => JSON.stringify(value2)).join(" | ")})` : "";
|
|
404
440
|
lines.push(
|
|
405
441
|
` - ${field.name}: ${field.type}${values} - ${field.description}`
|
|
406
442
|
);
|
|
@@ -487,7 +523,7 @@ function shellCommandArg(value2) {
|
|
|
487
523
|
}
|
|
488
524
|
function zeroMatchToolGuidance(options) {
|
|
489
525
|
const categories = _nullishCoalesce(options.categories, () => ( []));
|
|
490
|
-
const query = _nullishCoalesce(_optionalChain([options, 'access',
|
|
526
|
+
const query = _nullishCoalesce(_optionalChain([options, 'access', _7 => _7.query, 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()]), () => ( ""));
|
|
491
527
|
const filterText = [
|
|
492
528
|
categories.length ? `categories=${categories.join(",")}` : null,
|
|
493
529
|
query ? `grep=${query}` : null,
|
|
@@ -619,12 +655,12 @@ function categoryEnumerationRender(summaries) {
|
|
|
619
655
|
};
|
|
620
656
|
}
|
|
621
657
|
async function listToolCategories(emitJson, compact) {
|
|
622
|
-
const client = new (0,
|
|
658
|
+
const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
|
|
623
659
|
const rawTools = await client.listTools({ compact });
|
|
624
660
|
const items = rawTools.map(toListedTool);
|
|
625
661
|
const summaries = aggregateCategorySummaries(rawTools);
|
|
626
662
|
const outputItems = compact ? items.map(compactTool) : items;
|
|
627
|
-
|
|
663
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
|
|
628
664
|
{
|
|
629
665
|
tools: outputItems,
|
|
630
666
|
count: outputItems.length,
|
|
@@ -643,7 +679,7 @@ function unknownCategoryError(category, summaries, emitJson) {
|
|
|
643
679
|
const known = summaries.map((item) => item.name);
|
|
644
680
|
const message = `Unknown tool category "${category}". Run \`deepline tools list\` to browse categories.`;
|
|
645
681
|
if (emitJson) {
|
|
646
|
-
|
|
682
|
+
_chunkM7Y7JYZXjs.printJson.call(void 0, {
|
|
647
683
|
ok: false,
|
|
648
684
|
exitCode: 4,
|
|
649
685
|
code: "TOOL_CATEGORY_NOT_FOUND",
|
|
@@ -657,13 +693,13 @@ function unknownCategoryError(category, summaries, emitJson) {
|
|
|
657
693
|
const render = categoryEnumerationRender(summaries);
|
|
658
694
|
console.error(message);
|
|
659
695
|
console.error("");
|
|
660
|
-
console.error(
|
|
696
|
+
console.error(_chunkM7Y7JYZXjs.renderCommandEnvelopeText.call(void 0, { render }).trimEnd());
|
|
661
697
|
console.error("");
|
|
662
698
|
console.error(`Valid categories: ${known.join(", ")}`);
|
|
663
699
|
return 4;
|
|
664
700
|
}
|
|
665
701
|
async function listToolsInCategory(category, emitJson) {
|
|
666
|
-
const client = new (0,
|
|
702
|
+
const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
|
|
667
703
|
const rawTools = await client.listTools({
|
|
668
704
|
categories: category,
|
|
669
705
|
compact: false
|
|
@@ -673,7 +709,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
673
709
|
if (!summaries.some((item) => item.name === category)) {
|
|
674
710
|
return unknownCategoryError(category, summaries, emitJson);
|
|
675
711
|
}
|
|
676
|
-
const rows = rawTools.filter((tool) => _optionalChain([tool, 'access',
|
|
712
|
+
const rows = rawTools.filter((tool) => _optionalChain([tool, 'access', _10 => _10.categories, 'optionalAccess', _11 => _11.includes, 'call', _12 => _12(category)])).map((tool) => ({
|
|
677
713
|
id: tool.toolId,
|
|
678
714
|
provider: tool.provider,
|
|
679
715
|
required: requiredInputIds(tool),
|
|
@@ -700,7 +736,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
700
736
|
}
|
|
701
737
|
]
|
|
702
738
|
};
|
|
703
|
-
|
|
739
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
|
|
704
740
|
{
|
|
705
741
|
category,
|
|
706
742
|
total: rows.length,
|
|
@@ -713,7 +749,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
713
749
|
return 0;
|
|
714
750
|
}
|
|
715
751
|
async function listToolsForCategoryFilter(requestedCategories, emitJson, compact) {
|
|
716
|
-
const client = new (0,
|
|
752
|
+
const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
|
|
717
753
|
const items = (await client.listTools({
|
|
718
754
|
categories: requestedCategories.join(","),
|
|
719
755
|
compact
|
|
@@ -742,7 +778,7 @@ async function listToolsForCategoryFilter(requestedCategories, emitJson, compact
|
|
|
742
778
|
]
|
|
743
779
|
};
|
|
744
780
|
const outputItems = compact ? items.map(compactTool) : items;
|
|
745
|
-
|
|
781
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
|
|
746
782
|
{
|
|
747
783
|
tools: outputItems,
|
|
748
784
|
count: outputItems.length,
|
|
@@ -758,16 +794,16 @@ async function listToolsForCategoryFilter(requestedCategories, emitJson, compact
|
|
|
758
794
|
return 0;
|
|
759
795
|
}
|
|
760
796
|
async function listTools(category, options = {}) {
|
|
761
|
-
const positional = _nullishCoalesce(_optionalChain([category, 'optionalAccess',
|
|
797
|
+
const positional = _nullishCoalesce(_optionalChain([category, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14()]), () => ( ""));
|
|
762
798
|
const flagCategories = (_nullishCoalesce(options.categories, () => ( ""))).split(",").map((item) => item.trim()).filter(Boolean);
|
|
763
799
|
const compact = options.compact !== false;
|
|
764
|
-
const emitJson = options.json === true ||
|
|
800
|
+
const emitJson = options.json === true || _chunkM7Y7JYZXjs.shouldEmitJson.call(void 0, );
|
|
765
801
|
if (positional && flagCategories.length > 0) {
|
|
766
802
|
const flagIsSameSingle = flagCategories.length === 1 && flagCategories[0] === positional;
|
|
767
803
|
if (!flagIsSameSingle) {
|
|
768
804
|
const message = `Category "${positional}" and --categories ${flagCategories.join(",")} disagree. Pass one: deepline tools list ${positional}`;
|
|
769
805
|
if (emitJson) {
|
|
770
|
-
|
|
806
|
+
_chunkM7Y7JYZXjs.printJson.call(void 0, {
|
|
771
807
|
ok: false,
|
|
772
808
|
exitCode: 2,
|
|
773
809
|
code: "TOOL_LIST_CATEGORY_CONFLICT",
|
|
@@ -794,7 +830,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
794
830
|
console.error("Usage: deepline tools grep <query> [--json]");
|
|
795
831
|
return 1;
|
|
796
832
|
}
|
|
797
|
-
const client = new (0,
|
|
833
|
+
const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
|
|
798
834
|
const requestedCategories = options.categories ? options.categories.split(",").map((item) => item.trim()).filter(Boolean) : [];
|
|
799
835
|
const mode = _nullishCoalesce(options.mode, () => ( "all"));
|
|
800
836
|
const jsonOutput = options.json === true;
|
|
@@ -837,7 +873,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
837
873
|
query,
|
|
838
874
|
mode
|
|
839
875
|
}) : null;
|
|
840
|
-
|
|
876
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
|
|
841
877
|
{
|
|
842
878
|
tools: outputTools,
|
|
843
879
|
count: outputTools.length,
|
|
@@ -855,7 +891,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
855
891
|
} : {},
|
|
856
892
|
commandTemplates: TOOL_COMMAND_TEMPLATES
|
|
857
893
|
},
|
|
858
|
-
{ json: options.json ||
|
|
894
|
+
{ json: options.json || _chunkM7Y7JYZXjs.shouldEmitJson.call(void 0, ) }
|
|
859
895
|
);
|
|
860
896
|
return 0;
|
|
861
897
|
}
|
|
@@ -881,7 +917,7 @@ function compactTool(tool) {
|
|
|
881
917
|
};
|
|
882
918
|
}
|
|
883
919
|
function playIdentifiers(play) {
|
|
884
|
-
return [play.name, play.reference, ..._nullishCoalesce(play.aliases, () => ( []))].filter((value2) => Boolean(_optionalChain([value2, 'optionalAccess',
|
|
920
|
+
return [play.name, play.reference, ..._nullishCoalesce(play.aliases, () => ( []))].filter((value2) => Boolean(_optionalChain([value2, 'optionalAccess', _15 => _15.trim, 'call', _16 => _16()]))).map((value2) => value2.trim());
|
|
885
921
|
}
|
|
886
922
|
async function findPlayForToolId(client, toolId, cliInvocationId) {
|
|
887
923
|
const requested = toolId.trim();
|
|
@@ -979,6 +1015,46 @@ Output:
|
|
|
979
1015
|
exact charge. Workspace balance changes also include other callers' activity.
|
|
980
1016
|
`
|
|
981
1017
|
);
|
|
1018
|
+
tools.command("connect <provider>").description(
|
|
1019
|
+
"Save your provider credentials for the active workspace (owner/admin required)."
|
|
1020
|
+
).requiredOption(
|
|
1021
|
+
"--credentials-file <path>",
|
|
1022
|
+
"JSON object of credential field names and string values; keep this file private"
|
|
1023
|
+
).option("--json", "Emit a confirmation without credential values").action(
|
|
1024
|
+
async (provider, options) => {
|
|
1025
|
+
let credentials;
|
|
1026
|
+
try {
|
|
1027
|
+
credentials = JSON.parse(
|
|
1028
|
+
_fs.readFileSync.call(void 0, _path.resolve.call(void 0, options.credentialsFile), "utf8")
|
|
1029
|
+
);
|
|
1030
|
+
} catch (e2) {
|
|
1031
|
+
throw new Error(
|
|
1032
|
+
"Unable to read --credentials-file as a JSON object."
|
|
1033
|
+
);
|
|
1034
|
+
}
|
|
1035
|
+
if (!credentials || typeof credentials !== "object" || Array.isArray(credentials) || Object.keys(credentials).length === 0 || Object.values(credentials).some((value2) => typeof value2 !== "string")) {
|
|
1036
|
+
throw new Error(
|
|
1037
|
+
"--credentials-file must contain a nonempty JSON object of string credential values."
|
|
1038
|
+
);
|
|
1039
|
+
}
|
|
1040
|
+
const result = await new (0, _chunk2HAD745Vjs.DeeplineClient)().setIntegrationCredentials(
|
|
1041
|
+
provider,
|
|
1042
|
+
credentials
|
|
1043
|
+
);
|
|
1044
|
+
if (!result.ok || result.credential_saved !== true) {
|
|
1045
|
+
throw new Error(
|
|
1046
|
+
"The API did not confirm that provider credentials were saved. Inspect the integration before retrying."
|
|
1047
|
+
);
|
|
1048
|
+
}
|
|
1049
|
+
const confirmation = { provider, credential_saved: true };
|
|
1050
|
+
if (_chunkM7Y7JYZXjs.shouldEmitJson.call(void 0, options.json))
|
|
1051
|
+
console.log(JSON.stringify(confirmation));
|
|
1052
|
+
else
|
|
1053
|
+
console.log(
|
|
1054
|
+
`Credentials saved for ${provider} in the active workspace.`
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
);
|
|
982
1058
|
tools.command("list [category]").description("Browse tool categories, or list every tool in a category.").addHelpText(
|
|
983
1059
|
"after",
|
|
984
1060
|
`
|
|
@@ -1011,7 +1087,7 @@ Examples:
|
|
|
1011
1087
|
json: Boolean(options.json)
|
|
1012
1088
|
});
|
|
1013
1089
|
});
|
|
1014
|
-
|
|
1090
|
+
_chunkL2SYLGRPjs.registerDeprecatedSearchCommand.call(void 0, tools, () => ["tools", "monitors"]);
|
|
1015
1091
|
tools.command("grep <query>").description(
|
|
1016
1092
|
"Literal grep over tool ids, descriptions, categories, and input fields."
|
|
1017
1093
|
).addHelpText(
|
|
@@ -1112,7 +1188,7 @@ Examples:
|
|
|
1112
1188
|
process.exitCode = await narrowView();
|
|
1113
1189
|
return;
|
|
1114
1190
|
}
|
|
1115
|
-
const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-
|
|
1191
|
+
const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-YGSEN5WC.js")));
|
|
1116
1192
|
process.exitCode = await describeAnything(
|
|
1117
1193
|
toolId,
|
|
1118
1194
|
{
|
|
@@ -1198,7 +1274,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1198
1274
|
console.error("Usage: deepline tools describe <toolId> [--json]");
|
|
1199
1275
|
return 1;
|
|
1200
1276
|
}
|
|
1201
|
-
const client = new (0,
|
|
1277
|
+
const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
|
|
1202
1278
|
let tool;
|
|
1203
1279
|
try {
|
|
1204
1280
|
tool = await _asyncNullishCoalesce(compatibilityMetadata, async () => ( await client.getTool(toolId)));
|
|
@@ -1252,10 +1328,10 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1252
1328
|
const lines = toolPricingOnlyLines(tool, toolId);
|
|
1253
1329
|
if (inferenceQuote)
|
|
1254
1330
|
lines.push(...inferenceQuoteSummaryLines(inferenceQuote));
|
|
1255
|
-
|
|
1331
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
|
|
1256
1332
|
{
|
|
1257
1333
|
toolId: String(tool.toolId || toolId),
|
|
1258
|
-
cost:
|
|
1334
|
+
cost: _chunkL2SYLGRPjs.Capability.fromCatalogEntry(tool).describe().customerCost(),
|
|
1259
1335
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1260
1336
|
...isMonitorTypeTool(tool) ? { pricing: recordField(tool, "pricing") } : {},
|
|
1261
1337
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
@@ -1270,7 +1346,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1270
1346
|
}
|
|
1271
1347
|
if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !isMonitorTypeTool(tool) && !isPlayLikeTool(tool) && (options.json || options.contractJson)) {
|
|
1272
1348
|
const contract = toolContractJsonForDescribe(tool, toolId);
|
|
1273
|
-
|
|
1349
|
+
_chunkM7Y7JYZXjs.printCompactJson.call(void 0, {
|
|
1274
1350
|
toolId: contract.toolId,
|
|
1275
1351
|
...options.schemaOnly ? {
|
|
1276
1352
|
inputSchema: contract.inputSchema,
|
|
@@ -1293,7 +1369,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1293
1369
|
return 0;
|
|
1294
1370
|
}
|
|
1295
1371
|
if (options.contractJson) {
|
|
1296
|
-
|
|
1372
|
+
_chunkM7Y7JYZXjs.printCompactJson.call(void 0, {
|
|
1297
1373
|
...toolContractJsonForDescribe(tool, toolId),
|
|
1298
1374
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1299
1375
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
@@ -1302,7 +1378,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1302
1378
|
}
|
|
1303
1379
|
const emitJson = options.json === true;
|
|
1304
1380
|
if (emitJson) {
|
|
1305
|
-
|
|
1381
|
+
_chunkM7Y7JYZXjs.printCompactJson.call(void 0, {
|
|
1306
1382
|
...toolMetadataJsonForDescribe(tool, toolId),
|
|
1307
1383
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1308
1384
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
@@ -1373,13 +1449,13 @@ function toolContractJsonForDescribe(tool, requestedToolId, authoringContractEdi
|
|
|
1373
1449
|
arrayField2(toolExecutionResult, "extractedLists", "extracted_lists")
|
|
1374
1450
|
).map((entry) => ({
|
|
1375
1451
|
...entry,
|
|
1376
|
-
returnType:
|
|
1377
|
-
rowsExpression:
|
|
1452
|
+
returnType: _chunkPWSWAN7Qjs.playToolListGetterMode.call(void 0, authoringContractEdition) === "array" ? "Array" : "PlayDataset",
|
|
1453
|
+
rowsExpression: _chunkPWSWAN7Qjs.playToolListGetterMode.call(void 0, authoringContractEdition) === "array" ? entry.expression : `await ${entry.expression}.materialize()`
|
|
1378
1454
|
}));
|
|
1379
1455
|
const extractedValues = extractionContractEntries(
|
|
1380
1456
|
arrayField2(toolExecutionResult, "extractedValues", "extracted_values")
|
|
1381
1457
|
);
|
|
1382
|
-
const pricing =
|
|
1458
|
+
const pricing = _chunkL2SYLGRPjs.Capability.fromCatalogEntry(tool).describe().customerCost();
|
|
1383
1459
|
const executionMetadataRecord = recordField(
|
|
1384
1460
|
tool,
|
|
1385
1461
|
"executionMetadata",
|
|
@@ -1418,6 +1494,7 @@ function toolContractJsonForDescribe(tool, requestedToolId, authoringContractEdi
|
|
|
1418
1494
|
description: tool.description,
|
|
1419
1495
|
...Object.keys(guidance).length > 0 ? { guidance } : {},
|
|
1420
1496
|
categories: tool.categories,
|
|
1497
|
+
...Array.isArray(tool.requestWarnings) ? { requestWarnings: tool.requestWarnings } : {},
|
|
1421
1498
|
...deprecated ? {
|
|
1422
1499
|
deprecated: true,
|
|
1423
1500
|
callable: tool.callable !== false,
|
|
@@ -1581,12 +1658,12 @@ function schemaNodeAt(schema, path) {
|
|
|
1581
1658
|
return node;
|
|
1582
1659
|
}
|
|
1583
1660
|
var NAMED_VALUE_SHAPES = {
|
|
1584
|
-
email_status: { shape: "EmailStatus", schema:
|
|
1585
|
-
job_change: { shape: "JobChange", schema:
|
|
1661
|
+
email_status: { shape: "EmailStatus", schema: _chunkRDXFGPJUjs.EMAIL_STATUS_JSON_SCHEMA },
|
|
1662
|
+
job_change: { shape: "JobChange", schema: _chunkRDXFGPJUjs.JOB_CHANGE_JSON_SCHEMA }
|
|
1586
1663
|
};
|
|
1587
1664
|
function extractorValueType(name) {
|
|
1588
|
-
if (!
|
|
1589
|
-
const definition =
|
|
1665
|
+
if (!_chunkRDXFGPJUjs.isDeeplineExtractorTarget.call(void 0, name)) return void 0;
|
|
1666
|
+
const definition = _chunkRDXFGPJUjs.DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS[name];
|
|
1590
1667
|
if (definition.enum) {
|
|
1591
1668
|
return {
|
|
1592
1669
|
type: definition.enum.map((value2) => JSON.stringify(value2)).join(" | ")
|
|
@@ -1680,7 +1757,7 @@ function describedTool(tool, requestedToolId) {
|
|
|
1680
1757
|
...means ? { means } : {},
|
|
1681
1758
|
// A normalized value has a named type instead of the response's
|
|
1682
1759
|
// shape; a normalized object is spelled out once under Types.
|
|
1683
|
-
..._optionalChain([deepline, 'optionalAccess',
|
|
1760
|
+
..._optionalChain([deepline, 'optionalAccess', _17 => _17.shape]) ? deepline : valueType ? { type: valueType } : known ? known : fields ? { fields } : {},
|
|
1684
1761
|
// A list's row columns that matter are value getters of their own.
|
|
1685
1762
|
...kind === "extractedLists" && fields ? { summarized: true } : {},
|
|
1686
1763
|
read: playResultExpression(entry),
|
|
@@ -1693,14 +1770,14 @@ function describedTool(tool, requestedToolId) {
|
|
|
1693
1770
|
const lists = declaredLists.some(({ node }) => node) ? declaredLists.filter(({ node }) => node) : declaredLists;
|
|
1694
1771
|
const values = getterOutputs("extractedValues", [
|
|
1695
1772
|
outputSchema,
|
|
1696
|
-
...lists.map(({ node }) => _optionalChain([node, 'optionalAccess',
|
|
1773
|
+
...lists.map(({ node }) => _optionalChain([node, 'optionalAccess', _18 => _18.items]))
|
|
1697
1774
|
]).map((value2) => {
|
|
1698
1775
|
if (!lists.length || !value2.field.paths) return value2;
|
|
1699
1776
|
const within = value2.field.paths.map(
|
|
1700
1777
|
(path) => path.replace(/^toolResponse\.raw\./, "")
|
|
1701
1778
|
);
|
|
1702
1779
|
const list = _nullishCoalesce(lists.find(
|
|
1703
|
-
({ node }) => within.some((path) => isRecord(schemaNodeAt(_optionalChain([node, 'optionalAccess',
|
|
1780
|
+
({ node }) => within.some((path) => isRecord(schemaNodeAt(_optionalChain([node, 'optionalAccess', _19 => _19.items]), path)))
|
|
1704
1781
|
), () => ( lists[0]));
|
|
1705
1782
|
return {
|
|
1706
1783
|
...value2,
|
|
@@ -1717,7 +1794,7 @@ function describedTool(tool, requestedToolId) {
|
|
|
1717
1794
|
stringField2(cost, "displayText"),
|
|
1718
1795
|
// "Free (free)" says the same thing twice.
|
|
1719
1796
|
billing.toLowerCase() === stringField2(cost, "displayText").toLowerCase() ? "" : billing && `(${billing})`,
|
|
1720
|
-
|
|
1797
|
+
_chunkL2SYLGRPjs.observedMaxText.call(void 0, cost) && `\u2014 ${_chunkL2SYLGRPjs.observedMaxText.call(void 0, cost)}`
|
|
1721
1798
|
].filter(Boolean).join(" ") || void 0,
|
|
1722
1799
|
guidance: [
|
|
1723
1800
|
...contract.deprecated === true ? [`Deprecated. ${stringField2(deprecation, "message")}`.trim()] : [],
|
|
@@ -1854,7 +1931,7 @@ function toolPricingOnlyLines(tool, requestedToolId, options = {}) {
|
|
|
1854
1931
|
return monitorTypePricingLines(tool);
|
|
1855
1932
|
}
|
|
1856
1933
|
const toolId = String(tool.toolId || requestedToolId);
|
|
1857
|
-
const cost =
|
|
1934
|
+
const cost = _chunkL2SYLGRPjs.Capability.fromCatalogEntry(tool).describe().customerCost();
|
|
1858
1935
|
const pricingModel = stringField2(cost, "pricingModel") || "unknown";
|
|
1859
1936
|
const billing = stringField2(cost, "billingSourceLabel") || stringField2(cost, "billingSource") || stringField2(cost, "billingMode") || "unknown";
|
|
1860
1937
|
const explicitUnit = stringField2(cost, "unit");
|
|
@@ -1866,7 +1943,7 @@ function toolPricingOnlyLines(tool, requestedToolId, options = {}) {
|
|
|
1866
1943
|
const price = displayText || summary || (credits !== null ? `${formatDecimal(credits)} Deepline credits${usd !== null ? ` / ${formatUsd(usd)}` : ""} per ${unit}` : "pricing unavailable");
|
|
1867
1944
|
return [
|
|
1868
1945
|
`${_nullishCoalesce(options.heading, () => ( `Pricing: ${toolId}`))}: ${price}`,
|
|
1869
|
-
...
|
|
1946
|
+
..._chunkL2SYLGRPjs.observedMaxText.call(void 0, cost) ? [` ${_chunkL2SYLGRPjs.observedMaxText.call(void 0, cost)}`] : [],
|
|
1870
1947
|
...cost.observedReference || cost.estimatedRange ? [
|
|
1871
1948
|
...summary ? [` ${summary}`] : [],
|
|
1872
1949
|
...(_nullishCoalesce(cost.details, () => ( []))).map((detail) => ` ${detail}`)
|
|
@@ -1974,7 +2051,7 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1974
2051
|
), () => ( listGetters.find(isRecord)));
|
|
1975
2052
|
if (isRecord(firstList)) {
|
|
1976
2053
|
const name = safeIdentifier(stringField2(firstList, "name") || "list");
|
|
1977
|
-
if (
|
|
2054
|
+
if (_chunkPWSWAN7Qjs.playToolListGetterMode.call(void 0, ) === "array") {
|
|
1978
2055
|
console.log(`const ${name}_rows = ${playResultExpression(firstList)};`);
|
|
1979
2056
|
} else {
|
|
1980
2057
|
console.log(`const ${name}_ds = ${playResultExpression(firstList)};`);
|
|
@@ -2050,7 +2127,7 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
2050
2127
|
}
|
|
2051
2128
|
}
|
|
2052
2129
|
function printListGetterConsumption() {
|
|
2053
|
-
if (
|
|
2130
|
+
if (_chunkPWSWAN7Qjs.playToolListGetterMode.call(void 0, ) === "array") {
|
|
2054
2131
|
console.log(
|
|
2055
2132
|
"Use the ordinary array directly, or pass it to ctx.dataset to persist row work. No provider pagination is fetched. Lazy or incomplete lists throw; use readList for an explicit dataset read. A missing getter is not an empty list."
|
|
2056
2133
|
);
|
|
@@ -2061,7 +2138,7 @@ function printListGetterConsumption() {
|
|
|
2061
2138
|
);
|
|
2062
2139
|
}
|
|
2063
2140
|
function listGetterHeading() {
|
|
2064
|
-
return
|
|
2141
|
+
return _chunkPWSWAN7Qjs.playToolListGetterMode.call(void 0, ) === "array" ? "Lists (ordinary JavaScript arrays):" : "Lists (PlayDataset, not a JavaScript array):";
|
|
2065
2142
|
}
|
|
2066
2143
|
function sampleValueForField(field) {
|
|
2067
2144
|
const name = stringField2(field, "name").toLowerCase();
|
|
@@ -2144,7 +2221,7 @@ function toolMetadataJsonForDescribe(tool, requestedToolId) {
|
|
|
2144
2221
|
} = tool;
|
|
2145
2222
|
const outputSchemaRecord = recordField(tool, "outputSchema", "output_schema");
|
|
2146
2223
|
return {
|
|
2147
|
-
cost:
|
|
2224
|
+
cost: _chunkL2SYLGRPjs.Capability.fromCatalogEntry(tool).describe().customerCost(),
|
|
2148
2225
|
...publicTool,
|
|
2149
2226
|
toolId,
|
|
2150
2227
|
provider: tool.provider,
|
|
@@ -2202,7 +2279,7 @@ function usageGuidanceWithAccessDefaults(usageGuidance) {
|
|
|
2202
2279
|
extractedLists: {
|
|
2203
2280
|
...recordField(existingAccess, "extractedLists"),
|
|
2204
2281
|
expression: "toolExecutionResult.extractedLists.<name>.get()",
|
|
2205
|
-
meaning:
|
|
2282
|
+
meaning: _chunkPWSWAN7Qjs.playToolListGetterMode.call(void 0, ) === "array" ? "Returns an ordinary array from this response. Use array methods directly or pass it to ctx.dataset to persist row work. Lazy or incomplete lists throw; use readList for an explicit dataset read. It does not fetch provider pages." : "Returns a PlayDataset, not a JavaScript array. Pass the handle to ctx.dataset, use first(), async iteration, or await handle.materialize() for the complete current list within the memory cap. materialize(n) and peek(n) return a prefix; none fetch additional provider pages. A missing getter is not an empty list."
|
|
2206
2283
|
},
|
|
2207
2284
|
rawToolResponse: {
|
|
2208
2285
|
expression: "toolExecutionResult.toolResponse.rawV2",
|
|
@@ -2248,9 +2325,9 @@ function toolInputFieldsForDisplay(inputSchema) {
|
|
|
2248
2325
|
);
|
|
2249
2326
|
return fields.map((field) => {
|
|
2250
2327
|
const jsonSchemaField = typeof field.name === "string" ? jsonSchemaFields.get(field.name) : void 0;
|
|
2251
|
-
const minItems = typeof field.minItems === "number" ? field.minItems : _optionalChain([jsonSchemaField, 'optionalAccess',
|
|
2252
|
-
const maxItems = typeof field.maxItems === "number" ? field.maxItems : _optionalChain([jsonSchemaField, 'optionalAccess',
|
|
2253
|
-
const items = isRecord(field.items) ? field.items : _optionalChain([jsonSchemaField, 'optionalAccess',
|
|
2328
|
+
const minItems = typeof field.minItems === "number" ? field.minItems : _optionalChain([jsonSchemaField, 'optionalAccess', _20 => _20.minItems]);
|
|
2329
|
+
const maxItems = typeof field.maxItems === "number" ? field.maxItems : _optionalChain([jsonSchemaField, 'optionalAccess', _21 => _21.maxItems]);
|
|
2330
|
+
const items = isRecord(field.items) ? field.items : _optionalChain([jsonSchemaField, 'optionalAccess', _22 => _22.items]);
|
|
2254
2331
|
return {
|
|
2255
2332
|
...field,
|
|
2256
2333
|
...isRecord(items) ? { items } : {},
|
|
@@ -2439,7 +2516,7 @@ function inputFieldJsonForDescribe(field) {
|
|
|
2439
2516
|
function arrayItemBoundsSuffix(field) {
|
|
2440
2517
|
const itemSchema = isRecord(field.items) ? field.items : null;
|
|
2441
2518
|
const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type : isRecord(itemSchema.properties) ? "object" : "unknown" : null;
|
|
2442
|
-
const itemEnum = Array.isArray(_optionalChain([itemSchema, 'optionalAccess',
|
|
2519
|
+
const itemEnum = Array.isArray(_optionalChain([itemSchema, 'optionalAccess', _23 => _23.enum])) ? ` enum=${itemSchema.enum.map(String).join("|")}` : "";
|
|
2443
2520
|
const itemTypeSuffix = itemType && itemType !== "unknown" ? ` items=${itemType}${itemEnum}` : "";
|
|
2444
2521
|
const minItems = typeof field.minItems === "number" && Number.isFinite(field.minItems) ? field.minItems : null;
|
|
2445
2522
|
const maxItems = typeof field.maxItems === "number" && Number.isFinite(field.maxItems) ? field.maxItems : null;
|
|
@@ -2568,7 +2645,7 @@ function extractToolExecutionWarningMessages(rawResponse) {
|
|
|
2568
2645
|
];
|
|
2569
2646
|
const messages = [];
|
|
2570
2647
|
for (const candidate of candidates) {
|
|
2571
|
-
const warnings = _optionalChain([candidate, 'optionalAccess',
|
|
2648
|
+
const warnings = _optionalChain([candidate, 'optionalAccess', _24 => _24.warnings]);
|
|
2572
2649
|
if (!Array.isArray(warnings)) continue;
|
|
2573
2650
|
for (const warning of warnings) {
|
|
2574
2651
|
if (typeof warning === "string" && warning.trim()) {
|
|
@@ -2604,10 +2681,10 @@ function apifySyncRecoveryNext(rawResponse) {
|
|
|
2604
2681
|
};
|
|
2605
2682
|
}
|
|
2606
2683
|
function listExtractorPathsFromUsageGuidance(tool) {
|
|
2607
|
-
const toolExecutionResult = _optionalChain([tool, 'access',
|
|
2608
|
-
const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess',
|
|
2684
|
+
const toolExecutionResult = _optionalChain([tool, 'access', _25 => _25.usageGuidance, 'optionalAccess', _26 => _26.toolExecutionResult]);
|
|
2685
|
+
const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _27 => _27.extractedLists])) ? toolExecutionResult.extractedLists : isRecord(_optionalChain([toolExecutionResult, 'optionalAccess', _28 => _28.extractedLists])) ? Object.values(toolExecutionResult.extractedLists) : [];
|
|
2609
2686
|
return extractedLists.flatMap((entry) => {
|
|
2610
|
-
const paths = _nullishCoalesce(_optionalChain([entry, 'access',
|
|
2687
|
+
const paths = _nullishCoalesce(_optionalChain([entry, 'access', _29 => _29.details, 'optionalAccess', _30 => _30.candidatePaths]), () => ( _optionalChain([entry, 'access', _31 => _31.details, 'optionalAccess', _32 => _32.rawToolOutputPaths])));
|
|
2611
2688
|
if (!Array.isArray(paths)) return [];
|
|
2612
2689
|
return paths.map(
|
|
2613
2690
|
(path) => path.trim().replace(/^toolExecutionResult\.toolResponse\.raw\.?/, "").replace(/^toolExecutionResult\.toolOutput\.raw\.?/, "").replace(/^\./, "")
|
|
@@ -2758,7 +2835,7 @@ function parseExecuteOptions(toolId, options, output) {
|
|
|
2758
2835
|
outputFormat = normalizeOutputFormat(options.outputFormat);
|
|
2759
2836
|
}
|
|
2760
2837
|
if (options.idempotencyKey !== void 0) {
|
|
2761
|
-
|
|
2838
|
+
_chunk2HAD745Vjs.validateExecutionIdempotencyKey.call(void 0, options.idempotencyKey);
|
|
2762
2839
|
}
|
|
2763
2840
|
if (options.recoveryTimeoutMs !== void 0) {
|
|
2764
2841
|
const parsed = Number(options.recoveryTimeoutMs);
|
|
@@ -2843,8 +2920,8 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
|
|
|
2843
2920
|
const rows = list.get();
|
|
2844
2921
|
// ${sampleRows}
|
|
2845
2922
|
// columns: ${columns}
|
|
2846
|
-
// ${
|
|
2847
|
-
// ${
|
|
2923
|
+
// ${_chunkPWSWAN7Qjs.playToolListGetterMode.call(void 0, ) === "array" ? "extractedLists.<name>.get() returns an ordinary array from this response." : "extractedLists.<name>.get() returns a dataset handle for row-shaped list outputs."}
|
|
2924
|
+
// ${_chunkPWSWAN7Qjs.playToolListGetterMode.call(void 0, ) === "array" ? "Use array methods directly; pass rows to ctx.dataset to persist row work." : "Pass it to ctx.dataset; use rows.peek/count/materialize only for deliberate bounded inspection."}
|
|
2848
2925
|
// .withColumn('email_waterfall', (row, rowCtx) => rowCtx.runPlay('name_domain_email', 'name-and-domain-to-email', { first_name: String(row.first_name ?? ''), last_name: String(row.last_name ?? ''), domain: String(row.domain ?? '') }, { description: 'Resolve email.' }))
|
|
2849
2926
|
// .withColumn('phone_waterfall', (row, rowCtx) => rowCtx.runPlay('contact_phone', 'contact-to-phone', { first_name: String(row.first_name ?? ''), last_name: String(row.last_name ?? ''), email: String(row.email ?? '') }, { description: 'Resolve phone.' }))
|
|
2850
2927
|
// ctx.dataset is idempotent for completed rows during same-run recovery. New runs follow each call's freshness.
|
|
@@ -3069,20 +3146,20 @@ function buildToolExecuteRowArtifactEnvelope(input) {
|
|
|
3069
3146
|
}
|
|
3070
3147
|
async function executeTool(toolId, options) {
|
|
3071
3148
|
const output = toolExecuteJsonOption(options.json);
|
|
3072
|
-
const wantsJson =
|
|
3149
|
+
const wantsJson = _chunkM7Y7JYZXjs.shouldEmitJson.call(void 0, output.requested) || (_nullishCoalesce(options.outputFormat, () => ( "auto"))).trim().toLowerCase() !== "csv";
|
|
3073
3150
|
let parsed;
|
|
3074
3151
|
try {
|
|
3075
3152
|
parsed = parseExecuteOptions(toolId, options, output);
|
|
3076
3153
|
} catch (error) {
|
|
3077
3154
|
if (wantsJson) {
|
|
3078
|
-
|
|
3155
|
+
_chunkM7Y7JYZXjs.printJsonError.call(void 0, error);
|
|
3079
3156
|
} else {
|
|
3080
3157
|
console.error(error instanceof Error ? error.message : String(error));
|
|
3081
3158
|
}
|
|
3082
3159
|
return error instanceof _chunk7P5AA3SNjs.DeeplineError && error.code === "IDEMPOTENCY_KEY_INVALID" ? 2 : 1;
|
|
3083
3160
|
}
|
|
3084
3161
|
const cliInvocationId = _nullishCoalesce(_chunkQJBJZVG6js.getToolExecuteInvocationId.call(void 0, ), () => ( _chunkQJBJZVG6js.beginToolExecuteCommand.call(void 0, )));
|
|
3085
|
-
const client = new (0,
|
|
3162
|
+
const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
|
|
3086
3163
|
let metadata;
|
|
3087
3164
|
try {
|
|
3088
3165
|
metadata = await _chunkQJBJZVG6js.runToolExecuteStage.call(void 0,
|
|
@@ -3097,7 +3174,7 @@ async function executeTool(toolId, options) {
|
|
|
3097
3174
|
);
|
|
3098
3175
|
if (play) {
|
|
3099
3176
|
if (wantsJson) {
|
|
3100
|
-
|
|
3177
|
+
_chunkM7Y7JYZXjs.printJsonError.call(void 0,
|
|
3101
3178
|
new Error(playAliasToolErrorMessage(parsed.toolId, play))
|
|
3102
3179
|
);
|
|
3103
3180
|
} else {
|
|
@@ -3110,7 +3187,7 @@ async function executeTool(toolId, options) {
|
|
|
3110
3187
|
}
|
|
3111
3188
|
if (isPlayLikeTool(metadata)) {
|
|
3112
3189
|
if (wantsJson) {
|
|
3113
|
-
|
|
3190
|
+
_chunkM7Y7JYZXjs.printJsonError.call(void 0,
|
|
3114
3191
|
new Error(
|
|
3115
3192
|
playLikeToolExecuteErrorMessage(
|
|
3116
3193
|
parsed.toolId,
|
|
@@ -3126,6 +3203,18 @@ async function executeTool(toolId, options) {
|
|
|
3126
3203
|
}
|
|
3127
3204
|
return 2;
|
|
3128
3205
|
}
|
|
3206
|
+
if (_optionalChain([metadata, 'access', _33 => _33.deprecation, 'optionalAccess', _34 => _34.message])) {
|
|
3207
|
+
console.error(
|
|
3208
|
+
`Warning: ${parsed.toolId} is deprecated. ${metadata.deprecation.message}`
|
|
3209
|
+
);
|
|
3210
|
+
}
|
|
3211
|
+
const requestWarning = firstMatchingToolRequestWarning(
|
|
3212
|
+
metadata.requestWarnings,
|
|
3213
|
+
parsed.params
|
|
3214
|
+
);
|
|
3215
|
+
if (requestWarning) {
|
|
3216
|
+
console.error(`Warning: ${requestWarning.message}`);
|
|
3217
|
+
}
|
|
3129
3218
|
const responseIntent = parsed.outPath || parsed.outputFormat === "csv" || parsed.outputFormat === "csv_file" ? "row_artifact" : "raw";
|
|
3130
3219
|
const recovery = ToolCallRecovery.open({
|
|
3131
3220
|
toolId: parsed.toolId,
|
|
@@ -3142,11 +3231,11 @@ async function executeTool(toolId, options) {
|
|
|
3142
3231
|
"execute request",
|
|
3143
3232
|
() => client.executeTool(parsed.toolId, parsed.params, {
|
|
3144
3233
|
...parsed.timeoutMs !== void 0 ? { timeout: parsed.timeoutMs } : {},
|
|
3145
|
-
..._optionalChain([metadata, 'access',
|
|
3234
|
+
..._optionalChain([metadata, 'access', _35 => _35.executionMetadata, 'optionalAccess', _36 => _36.retrySafeTransientHttp]) === true ? { maxRetries: 2, retryApiErrors: true } : {},
|
|
3146
3235
|
responseIntent,
|
|
3147
3236
|
...idempotencyKey ? { idempotencyKey } : {},
|
|
3148
3237
|
...parsed.recoveryTimeoutMs !== void 0 ? { recoveryTimeoutMs: parsed.recoveryTimeoutMs } : {},
|
|
3149
|
-
searchRef:
|
|
3238
|
+
searchRef: _chunkL2SYLGRPjs.recentSearchRef.call(void 0, ),
|
|
3150
3239
|
cliInvocationId,
|
|
3151
3240
|
onResponseReceived: _chunkZMVJSS6Njs.recordApiResponse
|
|
3152
3241
|
}).catch((error) => {
|
|
@@ -3167,10 +3256,10 @@ async function executeTool(toolId, options) {
|
|
|
3167
3256
|
"result formatting",
|
|
3168
3257
|
() => {
|
|
3169
3258
|
const listExtractorPaths = listExtractorPathsFromUsageGuidance(metadata);
|
|
3170
|
-
const listConversion2 =
|
|
3259
|
+
const listConversion2 = _chunkRDXFGPJUjs.tryConvertToList.call(void 0, rawResponse, {
|
|
3171
3260
|
listExtractorPaths
|
|
3172
3261
|
});
|
|
3173
|
-
const summary2 =
|
|
3262
|
+
const summary2 = _chunkRDXFGPJUjs.extractSummaryFields.call(void 0, rawResponse);
|
|
3174
3263
|
const baseEnvelope2 = buildToolExecuteBaseEnvelope({
|
|
3175
3264
|
toolId: parsed.toolId,
|
|
3176
3265
|
params: parsed.params,
|
|
@@ -3187,15 +3276,15 @@ async function executeTool(toolId, options) {
|
|
|
3187
3276
|
const executeExitCode = toolExecuteExitCode(baseEnvelope);
|
|
3188
3277
|
const delivered = await _chunkQJBJZVG6js.runToolExecuteStage.call(void 0, "output delivery", () => {
|
|
3189
3278
|
if (!parsed.outPath && (parsed.outputFormat === "json" || parsed.outputFormat === "auto" && wantsJson)) {
|
|
3190
|
-
|
|
3279
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, baseEnvelope, { json: true });
|
|
3191
3280
|
return true;
|
|
3192
3281
|
}
|
|
3193
3282
|
if (parsed.outputFormat === "json_file") {
|
|
3194
|
-
const jsonPath =
|
|
3283
|
+
const jsonPath = _chunkRDXFGPJUjs.writeJsonOutputFile.call(void 0,
|
|
3195
3284
|
rawResponse,
|
|
3196
3285
|
`payload_${parsed.toolId}`
|
|
3197
3286
|
);
|
|
3198
|
-
|
|
3287
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
|
|
3199
3288
|
{
|
|
3200
3289
|
...baseEnvelope,
|
|
3201
3290
|
local: {
|
|
@@ -3217,18 +3306,18 @@ async function executeTool(toolId, options) {
|
|
|
3217
3306
|
`${parsed.toolId} did not expose row-shaped output to write as CSV. ${inspection.inspectDescription} Run: ${inspection.inspect}`
|
|
3218
3307
|
);
|
|
3219
3308
|
if (wantsJson) {
|
|
3220
|
-
|
|
3309
|
+
_chunkM7Y7JYZXjs.printJsonError.call(void 0, error);
|
|
3221
3310
|
} else {
|
|
3222
3311
|
console.error(error.message);
|
|
3223
3312
|
}
|
|
3224
3313
|
return false;
|
|
3225
3314
|
}
|
|
3226
3315
|
if (parsed.outputFormat === "csv" || parsed.outputFormat === "csv_file") {
|
|
3227
|
-
const jsonPath =
|
|
3316
|
+
const jsonPath = _chunkRDXFGPJUjs.writeJsonOutputFile.call(void 0,
|
|
3228
3317
|
rawResponse,
|
|
3229
3318
|
`payload_${parsed.toolId}`
|
|
3230
3319
|
);
|
|
3231
|
-
|
|
3320
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
|
|
3232
3321
|
{
|
|
3233
3322
|
...baseEnvelope,
|
|
3234
3323
|
local: {
|
|
@@ -3239,11 +3328,11 @@ async function executeTool(toolId, options) {
|
|
|
3239
3328
|
);
|
|
3240
3329
|
return true;
|
|
3241
3330
|
}
|
|
3242
|
-
|
|
3331
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, baseEnvelope, { json: false });
|
|
3243
3332
|
return true;
|
|
3244
3333
|
}
|
|
3245
|
-
const rowOutput =
|
|
3246
|
-
const csv =
|
|
3334
|
+
const rowOutput = _chunkRDXFGPJUjs.projectRowOutput.call(void 0, listConversion);
|
|
3335
|
+
const csv = _chunkRDXFGPJUjs.writeCsvOutputFile.call(void 0,
|
|
3247
3336
|
listConversion.rows,
|
|
3248
3337
|
`${parsed.toolId}_output`,
|
|
3249
3338
|
parsed.outPath ? { outPath: parsed.outPath } : void 0
|
|
@@ -3263,7 +3352,7 @@ async function executeTool(toolId, options) {
|
|
|
3263
3352
|
seededScript
|
|
3264
3353
|
});
|
|
3265
3354
|
if (parsed.outputFormat === "csv_file") {
|
|
3266
|
-
|
|
3355
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, materializedEnvelope, { json: true });
|
|
3267
3356
|
return true;
|
|
3268
3357
|
}
|
|
3269
3358
|
if (parsed.outPath) {
|
|
@@ -3271,7 +3360,7 @@ async function executeTool(toolId, options) {
|
|
|
3271
3360
|
toolId: parsed.toolId,
|
|
3272
3361
|
idempotencyKey
|
|
3273
3362
|
});
|
|
3274
|
-
|
|
3363
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, materializedEnvelope, {
|
|
3275
3364
|
json: wantsJson,
|
|
3276
3365
|
text: `Wrote ${csv.rowCount} row(s) to ${csv.path}
|
|
3277
3366
|
inspect: ${inspection.inspect}
|
|
@@ -3280,7 +3369,7 @@ inspect: ${inspection.inspect}
|
|
|
3280
3369
|
return true;
|
|
3281
3370
|
}
|
|
3282
3371
|
if (parsed.noPreview) {
|
|
3283
|
-
|
|
3372
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
|
|
3284
3373
|
{
|
|
3285
3374
|
...materializedEnvelope,
|
|
3286
3375
|
local: {
|
|
@@ -3293,7 +3382,7 @@ inspect: ${inspection.inspect}
|
|
|
3293
3382
|
);
|
|
3294
3383
|
return true;
|
|
3295
3384
|
}
|
|
3296
|
-
|
|
3385
|
+
_chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, materializedEnvelope, {
|
|
3297
3386
|
json: wantsJson && parsed.outputFormat !== "csv"
|
|
3298
3387
|
});
|
|
3299
3388
|
return true;
|