deepline 0.3.472 → 0.3.473
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/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-control.ts +17 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +55 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +14 -5
- package/dist/cli/auth-IJOWKNSB.js +41 -0
- package/dist/cli/{auth-35DAEPHC.mjs → auth-KLJOQ4DZ.mjs} +5 -5
- package/dist/cli/{billing-CXVBJEC4.mjs → billing-DNDYNBQ7.mjs} +6 -6
- package/dist/cli/{billing-5ED5X2IO.js → billing-IQNJXKH5.js} +79 -79
- package/dist/cli/{chunk-L3AXQXNT.js → chunk-36KEQFWZ.js} +13 -13
- package/dist/cli/{chunk-RDOPZK7A.js → chunk-3J2N7YF5.js} +18 -4
- package/dist/cli/{chunk-UPXGN62E.js → chunk-3LFSIUFI.js} +21 -21
- package/dist/cli/{chunk-T5H7ETIM.mjs → chunk-3OPQLFUK.mjs} +4 -4
- package/dist/cli/{chunk-V6OMS7E2.js → chunk-4IOY2SCQ.js} +10 -2
- package/dist/cli/{chunk-LQUOZGM6.js → chunk-4U3RNA3J.js} +51 -51
- package/dist/cli/{chunk-SBPI7AEB.js → chunk-63OOFT6B.js} +272 -258
- package/dist/cli/{chunk-TMMODGPV.mjs → chunk-6QS7522K.mjs} +2 -2
- package/dist/cli/{chunk-MRZ7AO72.mjs → chunk-6YOGOXOJ.mjs} +26 -12
- package/dist/cli/{chunk-6PKONIIP.mjs → chunk-ABLEU3QI.mjs} +5 -5
- package/dist/cli/{chunk-T5GRG37B.js → chunk-AK7UKQ5R.js} +5 -5
- package/dist/cli/{chunk-HBVT4FW5.js → chunk-B3BM3PAI.js} +6 -6
- package/dist/cli/{chunk-YNW47NOJ.mjs → chunk-CNCK2D6B.mjs} +2 -2
- package/dist/cli/{chunk-RMQB72WW.js → chunk-D22QIUE3.js} +9 -9
- package/dist/cli/{chunk-ODAARZSK.js → chunk-D4B3EV55.js} +36 -36
- package/dist/cli/{chunk-H7YFUC3J.js → chunk-DD7E4ZVH.js} +7 -7
- package/dist/cli/{chunk-OMPW5ELS.mjs → chunk-EUHTZV2E.mjs} +1 -1
- package/dist/cli/{chunk-FHIO7WI2.mjs → chunk-EVLUSXQG.mjs} +2 -2
- package/dist/cli/{chunk-5FHU67AT.js → chunk-F4PUDYBY.js} +3 -3
- package/dist/cli/{chunk-R73LE2IM.mjs → chunk-GAWP2YF5.mjs} +1 -1
- package/dist/cli/{chunk-KQJHIVCE.mjs → chunk-GE5GPLNM.mjs} +1 -1
- package/dist/cli/{chunk-C5PY2PP6.mjs → chunk-GISBRE2H.mjs} +3 -3
- package/dist/cli/{chunk-R6L6JRDR.mjs → chunk-GQBAJTQU.mjs} +2 -2
- package/dist/cli/{chunk-CFDQZQE2.mjs → chunk-GTH7JORC.mjs} +2 -2
- package/dist/cli/{chunk-2S36YV2K.mjs → chunk-HQCTPAXP.mjs} +1 -1
- package/dist/cli/{chunk-UKKCS6Z4.js → chunk-IC6AHOYS.js} +1 -1
- package/dist/cli/{chunk-QSCLOPWR.mjs → chunk-IFZ76E5H.mjs} +16 -2
- package/dist/cli/{chunk-VDHDTXCK.js → chunk-MREO5LZD.js} +2 -2
- package/dist/cli/{chunk-XSSIBO74.js → chunk-N4ZCMQ54.js} +8 -8
- package/dist/cli/{chunk-ZZQIS3TH.mjs → chunk-NTFM7JQW.mjs} +3 -3
- package/dist/cli/{chunk-GJPRBELO.js → chunk-OHUGXZ7N.js} +16 -16
- package/dist/cli/{chunk-X3RAGNNZ.mjs → chunk-OWUZKXE7.mjs} +1 -1
- package/dist/cli/{chunk-SKVMC6K6.js → chunk-PMJAGTSQ.js} +5 -5
- package/dist/cli/{chunk-NZBZFEVA.mjs → chunk-QD6IW2HP.mjs} +4 -4
- package/dist/cli/{chunk-4NFBYW7X.mjs → chunk-QG3THSTN.mjs} +2 -2
- package/dist/cli/{chunk-QLVYYDUI.js → chunk-QI73EL5C.js} +26 -26
- package/dist/cli/{chunk-2DND7LLL.js → chunk-RVRG57OB.js} +8 -8
- package/dist/cli/{chunk-XSX6TJUA.mjs → chunk-SD7QWZTV.mjs} +10 -2
- package/dist/cli/{chunk-52VOORHM.mjs → chunk-SWAYZST7.mjs} +2 -2
- package/dist/cli/{chunk-JRZW4LWK.mjs → chunk-TBLBYIKO.mjs} +1 -1
- package/dist/cli/{chunk-3L76SFGN.js → chunk-TUFQFTOC.js} +53 -53
- package/dist/cli/{chunk-M475BQ77.js → chunk-UON3WCBD.js} +3 -3
- package/dist/cli/{chunk-IPJ27SD2.mjs → chunk-V25CXRQ7.mjs} +5 -5
- package/dist/cli/{chunk-UXFUD2MB.mjs → chunk-VGVSHQN5.mjs} +5 -5
- package/dist/cli/{chunk-YMB2CD55.mjs → chunk-VS7JKS22.mjs} +1 -1
- package/dist/cli/{chunk-7KAS4QOW.js → chunk-WGQKOLXH.js} +6 -6
- package/dist/cli/{chunk-YK64LQPQ.mjs → chunk-X6R5UNDZ.mjs} +1 -1
- package/dist/cli/{chunk-SYWOSAW7.js → chunk-YH5SFKHJ.js} +4 -4
- package/dist/cli/{chunk-2G4R4APL.js → chunk-YHB6MASP.js} +2 -2
- package/dist/cli/{chunk-IIQ6O5F3.js → chunk-ZVLYUKJU.js} +5 -5
- package/dist/cli/{csv-OSDYY3QW.mjs → csv-NCY5MWS2.mjs} +4 -4
- package/dist/cli/{csv-SQJQM3B2.js → csv-OVV3HWN4.js} +13 -13
- package/dist/cli/{db-ATDYXAD5.js → db-BOELNDS4.js} +27 -27
- package/dist/cli/{db-2M6BU6G5.mjs → db-VPH6JHUD.mjs} +6 -6
- package/dist/cli/describe-7SFESEFL.js +48 -0
- package/dist/cli/{describe-WIAJCWF3.mjs → describe-FFDCPYZH.mjs} +19 -19
- package/dist/cli/describe-core.js +3 -3
- package/dist/cli/describe-core.mjs +2 -2
- package/dist/cli/{executions-2J6CCJL2.mjs → executions-5GCCDENS.mjs} +6 -6
- package/dist/cli/{executions-Y32LMYH6.js → executions-RF44ANF5.js} +8 -8
- package/dist/cli/{feedback-RXQLS6QU.js → feedback-NJM3V7QV.js} +8 -8
- package/dist/cli/{feedback-L4AVIMGI.mjs → feedback-OI2A5L6F.mjs} +4 -4
- package/dist/cli/git-4V5ZS5SE.js +25 -0
- package/dist/cli/{git-V3K77AWH.mjs → git-EOGSZ3T2.mjs} +5 -5
- package/dist/cli/index.js +135 -135
- package/dist/cli/index.mjs +40 -40
- package/dist/cli/{legacy-noops-B2KJT4CZ.js → legacy-noops-5QM7XGGX.js} +8 -8
- package/dist/cli/{legacy-noops-LOGMYOY5.mjs → legacy-noops-UYKK7AAB.mjs} +5 -5
- package/dist/cli/{monitors-A5WYUCGD.js → monitors-52GW2V4V.js} +91 -91
- package/dist/cli/{monitors-5ETSB7S7.mjs → monitors-N3ITC5MP.mjs} +7 -7
- package/dist/cli/{org-7EZDWYKK.js → org-ADF47NPV.js} +72 -72
- package/dist/cli/{org-BJOAUSXL.mjs → org-KUZUG33W.mjs} +6 -6
- package/dist/cli/{pages-3BYGBTVK.mjs → pages-C3S5WU3S.mjs} +6 -6
- package/dist/cli/{pages-45VNTEQU.js → pages-H3H7ODBN.js} +17 -17
- package/dist/cli/{play-R7JQV533.mjs → play-SZETTQPV.mjs} +17 -17
- package/dist/cli/{play-5KER3JFU.js → play-YWZWBG32.js} +306 -306
- package/dist/cli/{providers-RMFCE6MM.mjs → providers-FSCD35HB.mjs} +6 -6
- package/dist/cli/{providers-OHMZ6QIF.js → providers-V3BP7ZB2.js} +9 -9
- package/dist/cli/{quickstart-GNRE4SAT.js → quickstart-ICULVGAR.js} +6 -6
- package/dist/cli/{quickstart-IHR4VC5K.mjs → quickstart-SYZCT2WI.mjs} +4 -4
- package/dist/cli/{run-Y4MIRFJY.mjs → run-HA5B3AYQ.mjs} +24 -24
- package/dist/cli/{run-77QIMUUV.js → run-WUJSKGUM.js} +39 -39
- package/dist/cli/{search-24YKTHMK.mjs → search-A27AGYDV.mjs} +7 -7
- package/dist/cli/search-XATDPNEM.js +32 -0
- package/dist/cli/{secrets-KHX62AWC.mjs → secrets-2L4VRJ2F.mjs} +6 -6
- package/dist/cli/{secrets-SSEBT3IS.js → secrets-ODX56QBF.js} +15 -15
- package/dist/cli/{sessions-E6KNWYEH.js → sessions-DVZ4FECP.js} +6 -6
- package/dist/cli/{sessions-H7T25HGE.mjs → sessions-PRF36DHO.mjs} +5 -5
- package/dist/cli/{settings-XSJG6M32.mjs → settings-LUATIKJE.mjs} +11 -11
- package/dist/cli/{settings-GXUYF5G7.js → settings-RJT5DBWG.js} +78 -78
- package/dist/cli/{setup-JP5YPIA4.js → setup-FJSBKCLU.js} +44 -44
- package/dist/cli/{setup-GD7IOD4U.mjs → setup-IQXTYLRH.mjs} +9 -9
- package/dist/cli/skills-N6CPBF6T.js +31 -0
- package/dist/cli/{skills-HLHE3ENN.mjs → skills-XJH4ZC5Y.mjs} +7 -7
- package/dist/cli/{tools-Q4XIQX7W.mjs → tools-IGXLZCKZ.mjs} +17 -17
- package/dist/cli/tools-YMVEVRCE.js +55 -0
- package/dist/cli/{update-3KRMR2QJ.mjs → update-AH7G5VSL.mjs} +9 -9
- package/dist/cli/update-MUCWGTXH.js +33 -0
- package/dist/cli/{workflow-NMUESL3O.js → workflow-IQ2J7LWM.js} +17 -17
- package/dist/cli/{workflow-NOZ7WFEY.mjs → workflow-WOYSCWVD.mjs} +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +100 -100
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-Q5TM66UI.js +0 -41
- package/dist/cli/describe-37QXXDCF.js +0 -48
- package/dist/cli/git-JGUR335T.js +0 -25
- package/dist/cli/search-S3VO2UKV.js +0 -32
- package/dist/cli/skills-C4KTW3US.js +0 -31
- package/dist/cli/tools-KS7JMRK6.js +0 -55
- package/dist/cli/update-GYTQYK2W.js +0 -33
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk3J2N7YF5js = require('./chunk-3J2N7YF5.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkRVRG57OBjs = require('./chunk-RVRG57OB.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -25,7 +25,7 @@ var _chunk2DND7LLLjs = require('./chunk-2DND7LLL.js');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunk4IOY2SCQjs = require('./chunk-4IOY2SCQ.js');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
var _chunkIAYSWZDJjs = require('./chunk-IAYSWZDJ.js');
|
|
@@ -48,10 +48,10 @@ var _chunkJ33TSWO5js = require('./chunk-J33TSWO5.js');
|
|
|
48
48
|
var _chunkHGFFYVXNjs = require('./chunk-HGFFYVXN.js');
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
var
|
|
51
|
+
var _chunkPMJAGTSQjs = require('./chunk-PMJAGTSQ.js');
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
var
|
|
54
|
+
var _chunkWGQKOLXHjs = require('./chunk-WGQKOLXH.js');
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
var _chunkXDVT3GOMjs = require('./chunk-XDVT3GOM.js');
|
|
@@ -61,18 +61,18 @@ var _chunkXDVT3GOMjs = require('./chunk-XDVT3GOM.js');
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
var
|
|
64
|
+
var _chunk3LFSIUFIjs = require('./chunk-3LFSIUFI.js');
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
var
|
|
69
|
+
var _chunkYHB6MASPjs = require('./chunk-YHB6MASP.js');
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
var
|
|
75
|
+
var _chunkTUFQFTOCjs = require('./chunk-TUFQFTOC.js');
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
@@ -80,12 +80,12 @@ var _chunk3L76SFGNjs = require('./chunk-3L76SFGN.js');
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
var
|
|
83
|
+
var _chunkDD7E4ZVHjs = require('./chunk-DD7E4ZVH.js');
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
var
|
|
88
|
+
var _chunkF4PUDYBYjs = require('./chunk-F4PUDYBY.js');
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
var _chunkDIAWYWT5js = require('./chunk-DIAWYWT5.js');
|
|
@@ -191,10 +191,10 @@ var ToolCallRecovery = class _ToolCallRecovery {
|
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
193
|
function pendingToolExecutionPath(input) {
|
|
194
|
-
const config =
|
|
194
|
+
const config = _chunkF4PUDYBYjs.resolveConfig.call(void 0, );
|
|
195
195
|
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");
|
|
196
196
|
return _path.join.call(void 0,
|
|
197
|
-
|
|
197
|
+
_chunkF4PUDYBYjs.sdkCliStateDirPath.call(void 0, config.baseUrl),
|
|
198
198
|
`${PENDING_PREFIX}${fingerprint}.json`
|
|
199
199
|
);
|
|
200
200
|
}
|
|
@@ -346,13 +346,13 @@ var TOOL_COMMAND_TEMPLATES = {
|
|
|
346
346
|
execute: "deepline run <toolId> --input '{...}'"
|
|
347
347
|
};
|
|
348
348
|
function toListedTool(tool) {
|
|
349
|
-
if (
|
|
349
|
+
if (_chunk4IOY2SCQjs.isPlayLikeTool.call(void 0, tool)) {
|
|
350
350
|
return {
|
|
351
351
|
...tool,
|
|
352
352
|
description: listedToolDescription(tool),
|
|
353
353
|
id: tool.toolId,
|
|
354
354
|
type: "play",
|
|
355
|
-
executeCommand:
|
|
355
|
+
executeCommand: _chunk4IOY2SCQjs.playRunCommandForTool.call(void 0, tool, tool.toolId)
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
358
|
return {
|
|
@@ -434,16 +434,16 @@ function firstSentence(text) {
|
|
|
434
434
|
return (match ? match[0] : clean).trim();
|
|
435
435
|
}
|
|
436
436
|
function requiredInputIds(tool) {
|
|
437
|
-
const inputSchema =
|
|
437
|
+
const inputSchema = _chunk4IOY2SCQjs.recordField.call(void 0,
|
|
438
438
|
tool,
|
|
439
439
|
"inputSchema",
|
|
440
440
|
"input_schema"
|
|
441
441
|
);
|
|
442
|
-
return
|
|
442
|
+
return _chunk4IOY2SCQjs.toolInputFieldsForDisplay.call(void 0, inputSchema).filter((field) => field.required === true).map((field) => String(_nullishCoalesce(field.name, () => ( "")))).filter(Boolean);
|
|
443
443
|
}
|
|
444
444
|
function notConnectedSuffix(tool) {
|
|
445
445
|
const record = tool;
|
|
446
|
-
const status =
|
|
446
|
+
const status = _chunk4IOY2SCQjs.stringField.call(void 0, record, "credentialStatus", "credential_status");
|
|
447
447
|
const connected = record.connected;
|
|
448
448
|
const message = toolConnectionStatusMessage({
|
|
449
449
|
connected: connected === false ? false : void 0,
|
|
@@ -452,18 +452,18 @@ function notConnectedSuffix(tool) {
|
|
|
452
452
|
return message ? ` - \u26A0 ${message}` : "";
|
|
453
453
|
}
|
|
454
454
|
function shortPricingHint(tool) {
|
|
455
|
-
const pricing =
|
|
455
|
+
const pricing = _chunk4IOY2SCQjs.recordField.call(void 0,
|
|
456
456
|
tool,
|
|
457
457
|
"pricing"
|
|
458
458
|
);
|
|
459
459
|
const credits = numberField(pricing, "creditsPerUnit", "credits_per_unit");
|
|
460
|
-
const unit =
|
|
460
|
+
const unit = _chunk4IOY2SCQjs.stringField.call(void 0, pricing, "unit");
|
|
461
461
|
if (credits !== null) {
|
|
462
462
|
return `${formatDecimal(credits)} cr/${unit || "unit"}`;
|
|
463
463
|
}
|
|
464
|
-
const summary =
|
|
464
|
+
const summary = _chunk4IOY2SCQjs.stringField.call(void 0, pricing, "summary");
|
|
465
465
|
if (summary) return summary;
|
|
466
|
-
const displayText =
|
|
466
|
+
const displayText = _chunk4IOY2SCQjs.stringField.call(void 0, pricing, "displayText", "display_text");
|
|
467
467
|
return displayText || null;
|
|
468
468
|
}
|
|
469
469
|
function aggregateCategorySummaries(tools) {
|
|
@@ -507,13 +507,13 @@ function categoryEnumerationRender(summaries) {
|
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
509
|
async function listToolCategories(emitJson, compact) {
|
|
510
|
-
const client = new (0,
|
|
510
|
+
const client = new (0, _chunkPMJAGTSQjs.DeeplineClient)();
|
|
511
511
|
if (!emitJson) {
|
|
512
512
|
const summaries2 = (await client.listToolCategories()).map((category) => ({
|
|
513
513
|
...category,
|
|
514
514
|
description: describeToolCategory(category.name)
|
|
515
515
|
}));
|
|
516
|
-
|
|
516
|
+
_chunkDD7E4ZVHjs.printCommandEnvelope.call(void 0,
|
|
517
517
|
{ categories: summaries2, render: categoryEnumerationRender(summaries2) },
|
|
518
518
|
{ json: false }
|
|
519
519
|
);
|
|
@@ -523,7 +523,7 @@ async function listToolCategories(emitJson, compact) {
|
|
|
523
523
|
const items = rawTools.map(toListedTool);
|
|
524
524
|
const summaries = aggregateCategorySummaries(rawTools);
|
|
525
525
|
const outputItems = compact ? items.map(compactTool) : items;
|
|
526
|
-
|
|
526
|
+
_chunkDD7E4ZVHjs.printCommandEnvelope.call(void 0,
|
|
527
527
|
{
|
|
528
528
|
tools: outputItems,
|
|
529
529
|
count: outputItems.length,
|
|
@@ -542,7 +542,7 @@ function unknownCategoryError(category, summaries, emitJson) {
|
|
|
542
542
|
const known = summaries.map((item) => item.name);
|
|
543
543
|
const message = `Unknown tool category "${category}". Run \`deepline tools list\` to browse categories.`;
|
|
544
544
|
if (emitJson) {
|
|
545
|
-
|
|
545
|
+
_chunkDD7E4ZVHjs.printJson.call(void 0, {
|
|
546
546
|
ok: false,
|
|
547
547
|
exitCode: 4,
|
|
548
548
|
code: "TOOL_CATEGORY_NOT_FOUND",
|
|
@@ -556,13 +556,13 @@ function unknownCategoryError(category, summaries, emitJson) {
|
|
|
556
556
|
const render = categoryEnumerationRender(summaries);
|
|
557
557
|
console.error(message);
|
|
558
558
|
console.error("");
|
|
559
|
-
console.error(
|
|
559
|
+
console.error(_chunkDD7E4ZVHjs.renderCommandEnvelopeText.call(void 0, { render }).trimEnd());
|
|
560
560
|
console.error("");
|
|
561
561
|
console.error(`Valid categories: ${known.join(", ")}`);
|
|
562
562
|
return 4;
|
|
563
563
|
}
|
|
564
564
|
async function listToolsInCategory(category, emitJson) {
|
|
565
|
-
const client = new (0,
|
|
565
|
+
const client = new (0, _chunkPMJAGTSQjs.DeeplineClient)();
|
|
566
566
|
const { tools: rawTools, categories } = await client.listToolsInCategory(category);
|
|
567
567
|
const summaries = categories.map((item) => ({
|
|
568
568
|
...item,
|
|
@@ -598,7 +598,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
598
598
|
}
|
|
599
599
|
]
|
|
600
600
|
};
|
|
601
|
-
|
|
601
|
+
_chunkDD7E4ZVHjs.printCommandEnvelope.call(void 0,
|
|
602
602
|
{
|
|
603
603
|
category,
|
|
604
604
|
total: rows.length,
|
|
@@ -611,7 +611,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
611
611
|
return 0;
|
|
612
612
|
}
|
|
613
613
|
async function listToolsForCategoryFilter(requestedCategories, emitJson, compact) {
|
|
614
|
-
const client = new (0,
|
|
614
|
+
const client = new (0, _chunkPMJAGTSQjs.DeeplineClient)();
|
|
615
615
|
const items = (await client.listTools({
|
|
616
616
|
categories: requestedCategories.join(","),
|
|
617
617
|
compact
|
|
@@ -640,7 +640,7 @@ async function listToolsForCategoryFilter(requestedCategories, emitJson, compact
|
|
|
640
640
|
]
|
|
641
641
|
};
|
|
642
642
|
const outputItems = compact ? items.map(compactTool) : items;
|
|
643
|
-
|
|
643
|
+
_chunkDD7E4ZVHjs.printCommandEnvelope.call(void 0,
|
|
644
644
|
{
|
|
645
645
|
tools: outputItems,
|
|
646
646
|
count: outputItems.length,
|
|
@@ -659,13 +659,13 @@ async function listTools(category, options = {}) {
|
|
|
659
659
|
const positional = _nullishCoalesce(_optionalChain([category, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()]), () => ( ""));
|
|
660
660
|
const flagCategories = (_nullishCoalesce(options.categories, () => ( ""))).split(",").map((item) => item.trim()).filter(Boolean);
|
|
661
661
|
const compact = options.compact !== false;
|
|
662
|
-
const emitJson = options.json === true ||
|
|
662
|
+
const emitJson = options.json === true || _chunkDD7E4ZVHjs.shouldEmitJson.call(void 0, );
|
|
663
663
|
if (positional && flagCategories.length > 0) {
|
|
664
664
|
const flagIsSameSingle = flagCategories.length === 1 && flagCategories[0] === positional;
|
|
665
665
|
if (!flagIsSameSingle) {
|
|
666
666
|
const message = `Category "${positional}" and --categories ${flagCategories.join(",")} disagree. Pass one: deepline tools list ${positional}`;
|
|
667
667
|
if (emitJson) {
|
|
668
|
-
|
|
668
|
+
_chunkDD7E4ZVHjs.printJson.call(void 0, {
|
|
669
669
|
ok: false,
|
|
670
670
|
exitCode: 2,
|
|
671
671
|
code: "TOOL_LIST_CATEGORY_CONFLICT",
|
|
@@ -692,7 +692,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
692
692
|
console.error("Usage: deepline tools grep <query> [--json]");
|
|
693
693
|
return 1;
|
|
694
694
|
}
|
|
695
|
-
const client = new (0,
|
|
695
|
+
const client = new (0, _chunkPMJAGTSQjs.DeeplineClient)();
|
|
696
696
|
const requestedCategories = options.categories ? options.categories.split(",").map((item) => item.trim()).filter(Boolean) : [];
|
|
697
697
|
const mode = _nullishCoalesce(options.mode, () => ( "all"));
|
|
698
698
|
const jsonOutput = options.json === true;
|
|
@@ -716,7 +716,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
716
716
|
query,
|
|
717
717
|
mode
|
|
718
718
|
}) : null;
|
|
719
|
-
|
|
719
|
+
_chunkDD7E4ZVHjs.printCommandEnvelope.call(void 0,
|
|
720
720
|
{
|
|
721
721
|
tools: outputTools,
|
|
722
722
|
count: outputTools.length,
|
|
@@ -734,7 +734,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
734
734
|
} : {},
|
|
735
735
|
commandTemplates: TOOL_COMMAND_TEMPLATES
|
|
736
736
|
},
|
|
737
|
-
{ json: options.json ||
|
|
737
|
+
{ json: options.json || _chunkDD7E4ZVHjs.shouldEmitJson.call(void 0, ) }
|
|
738
738
|
);
|
|
739
739
|
return 0;
|
|
740
740
|
}
|
|
@@ -789,8 +789,8 @@ function printPlayAliasToolError(toolId, play) {
|
|
|
789
789
|
console.error(playAliasToolErrorMessage(toolId, play));
|
|
790
790
|
}
|
|
791
791
|
function playLikeToolExecuteErrorMessage(toolId, tool) {
|
|
792
|
-
const playReference = tool ?
|
|
793
|
-
const nextStep = playReference ? `Use: deepline run ${playReference} --input '{...}'` : `Find the maintained workflow with: ${
|
|
792
|
+
const playReference = tool ? _chunk4IOY2SCQjs.playReferenceForTool.call(void 0, tool) : null;
|
|
793
|
+
const nextStep = playReference ? `Use: deepline run ${playReference} --input '{...}'` : `Find the maintained workflow with: ${_chunk4IOY2SCQjs.playSearchCommandForToolId.call(void 0, toolId)}`;
|
|
794
794
|
return [
|
|
795
795
|
`${toolId} is a workflow/play entry, not an atomic provider tool.`,
|
|
796
796
|
nextStep,
|
|
@@ -845,7 +845,7 @@ Output:
|
|
|
845
845
|
if (options.preset !== void 0 && (options.scopes !== void 0 || options.optionalScopes !== void 0))
|
|
846
846
|
throw new Error("Use --preset or individual scopes, not both.");
|
|
847
847
|
const splitScopes = (value) => value.split(",").map((scope) => scope.trim()).filter(Boolean);
|
|
848
|
-
const result2 = await new (0,
|
|
848
|
+
const result2 = await new (0, _chunkPMJAGTSQjs.DeeplineClient)().startIntegrationOAuth(
|
|
849
849
|
provider,
|
|
850
850
|
{
|
|
851
851
|
...options.preset !== void 0 ? { preset: options.preset } : {},
|
|
@@ -857,7 +857,7 @@ Output:
|
|
|
857
857
|
throw new Error(
|
|
858
858
|
"The API did not return an OAuth authorization URL."
|
|
859
859
|
);
|
|
860
|
-
if (
|
|
860
|
+
if (_chunkDD7E4ZVHjs.shouldEmitJson.call(void 0, options.json))
|
|
861
861
|
console.log(
|
|
862
862
|
JSON.stringify({ provider, redirect_url: result2.redirect_url })
|
|
863
863
|
);
|
|
@@ -883,7 +883,7 @@ Output:
|
|
|
883
883
|
"--credentials-file must contain a nonempty JSON object of string credential values."
|
|
884
884
|
);
|
|
885
885
|
}
|
|
886
|
-
const result = await new (0,
|
|
886
|
+
const result = await new (0, _chunkPMJAGTSQjs.DeeplineClient)().setIntegrationCredentials(
|
|
887
887
|
provider,
|
|
888
888
|
credentials
|
|
889
889
|
);
|
|
@@ -893,7 +893,7 @@ Output:
|
|
|
893
893
|
);
|
|
894
894
|
}
|
|
895
895
|
const confirmation = { provider, credential_saved: true };
|
|
896
|
-
if (
|
|
896
|
+
if (_chunkDD7E4ZVHjs.shouldEmitJson.call(void 0, options.json))
|
|
897
897
|
console.log(JSON.stringify(confirmation));
|
|
898
898
|
else
|
|
899
899
|
console.log(
|
|
@@ -933,7 +933,7 @@ Examples:
|
|
|
933
933
|
json: Boolean(options.json)
|
|
934
934
|
});
|
|
935
935
|
});
|
|
936
|
-
|
|
936
|
+
_chunkRVRG57OBjs.registerDeprecatedSearchCommand.call(void 0, tools, () => ["tools", "monitors"]);
|
|
937
937
|
tools.command("grep <query>").description(
|
|
938
938
|
"Regex grep over tool ids, descriptions, categories, and input fields."
|
|
939
939
|
).addHelpText(
|
|
@@ -968,7 +968,7 @@ Examples:
|
|
|
968
968
|
});
|
|
969
969
|
const addToolMetadataCommand = (command) => {
|
|
970
970
|
let compatibilityMetadata;
|
|
971
|
-
|
|
971
|
+
_chunk3LFSIUFIjs.registerCompatibilityCatalog.call(void 0, command, () => ({
|
|
972
972
|
toolId: command.args[0],
|
|
973
973
|
acceptMetadata: (metadata) => {
|
|
974
974
|
compatibilityMetadata = metadata;
|
|
@@ -1038,7 +1038,7 @@ Examples:
|
|
|
1038
1038
|
process.exitCode = await narrowView();
|
|
1039
1039
|
return;
|
|
1040
1040
|
}
|
|
1041
|
-
const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-
|
|
1041
|
+
const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-7SFESEFL.js")));
|
|
1042
1042
|
process.exitCode = await describeAnything(
|
|
1043
1043
|
toolId,
|
|
1044
1044
|
{
|
|
@@ -1053,7 +1053,7 @@ Examples:
|
|
|
1053
1053
|
});
|
|
1054
1054
|
};
|
|
1055
1055
|
addToolMetadataCommand(
|
|
1056
|
-
|
|
1056
|
+
_chunk3J2N7YF5js.addDescribeOptions.call(void 0,
|
|
1057
1057
|
tools.command("describe <toolId>", { hidden: true }).alias("get"),
|
|
1058
1058
|
{ json: false }
|
|
1059
1059
|
)
|
|
@@ -1122,7 +1122,7 @@ Examples:
|
|
|
1122
1122
|
options,
|
|
1123
1123
|
void 0,
|
|
1124
1124
|
true,
|
|
1125
|
-
|
|
1125
|
+
_chunkYHB6MASPjs.resolveCliMaintenancePolicy.call(void 0, command.optsWithGlobals())
|
|
1126
1126
|
);
|
|
1127
1127
|
}
|
|
1128
1128
|
);
|
|
@@ -1130,13 +1130,13 @@ Examples:
|
|
|
1130
1130
|
function beginDeferredToolExecuteCompatibility(toolId, cliInvocationId) {
|
|
1131
1131
|
let metadata;
|
|
1132
1132
|
const startedAt = performance.now();
|
|
1133
|
-
const baseUrl =
|
|
1134
|
-
|
|
1135
|
-
const result =
|
|
1133
|
+
const baseUrl = _chunkF4PUDYBYjs.resolveConfig.call(void 0, ).baseUrl;
|
|
1134
|
+
_chunkYHB6MASPjs.recordCliTrace.call(void 0, { phase: "cli.tool_execute_compatibility_start" });
|
|
1135
|
+
const result = _chunk3LFSIUFIjs.runToolExecuteStage.call(void 0,
|
|
1136
1136
|
"SDK compatibility",
|
|
1137
|
-
() =>
|
|
1137
|
+
() => _chunkTUFQFTOCjs.checkSdkCompatibility.call(void 0, baseUrl, {
|
|
1138
1138
|
command: "tools execute",
|
|
1139
|
-
skillsVersion:
|
|
1139
|
+
skillsVersion: _chunkF4PUDYBYjs.readSdkSkillsLocalVersion.call(void 0, baseUrl),
|
|
1140
1140
|
persistCache: false,
|
|
1141
1141
|
timeoutMs: TOOL_EXECUTE_PREFLIGHT_TIMEOUT_MS,
|
|
1142
1142
|
catalog: {
|
|
@@ -1150,7 +1150,7 @@ function beginDeferredToolExecuteCompatibility(toolId, cliInvocationId) {
|
|
|
1150
1150
|
})
|
|
1151
1151
|
).then(
|
|
1152
1152
|
(compatibility) => {
|
|
1153
|
-
|
|
1153
|
+
_chunkYHB6MASPjs.recordCliTrace.call(void 0, {
|
|
1154
1154
|
phase: "cli.tool_execute_compatibility_ready",
|
|
1155
1155
|
ms: performance.now() - startedAt,
|
|
1156
1156
|
ok: compatibility.error === null,
|
|
@@ -1159,7 +1159,7 @@ function beginDeferredToolExecuteCompatibility(toolId, cliInvocationId) {
|
|
|
1159
1159
|
return compatibility;
|
|
1160
1160
|
},
|
|
1161
1161
|
(error) => {
|
|
1162
|
-
|
|
1162
|
+
_chunkYHB6MASPjs.recordCliTrace.call(void 0, {
|
|
1163
1163
|
phase: "cli.tool_execute_compatibility_ready",
|
|
1164
1164
|
ms: performance.now() - startedAt,
|
|
1165
1165
|
ok: false
|
|
@@ -1174,7 +1174,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1174
1174
|
console.error("Usage: deepline tools describe <toolId> [--json]");
|
|
1175
1175
|
return 1;
|
|
1176
1176
|
}
|
|
1177
|
-
const client = new (0,
|
|
1177
|
+
const client = new (0, _chunkPMJAGTSQjs.DeeplineClient)();
|
|
1178
1178
|
let tool;
|
|
1179
1179
|
try {
|
|
1180
1180
|
tool = await _asyncNullishCoalesce(compatibilityMetadata, async () => ( await client.getTool(toolId)));
|
|
@@ -1228,12 +1228,12 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1228
1228
|
const lines = toolPricingOnlyLines(tool, toolId);
|
|
1229
1229
|
if (inferenceQuote)
|
|
1230
1230
|
lines.push(...inferenceQuoteSummaryLines(inferenceQuote));
|
|
1231
|
-
|
|
1231
|
+
_chunkDD7E4ZVHjs.printCommandEnvelope.call(void 0,
|
|
1232
1232
|
{
|
|
1233
1233
|
toolId: String(tool.toolId || toolId),
|
|
1234
1234
|
cost: _chunkZM2YPJQJjs.Capability.fromCatalogEntry(tool).describe().customerCost(),
|
|
1235
1235
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1236
|
-
...
|
|
1236
|
+
..._chunk4IOY2SCQjs.isMonitorTypeTool.call(void 0, tool) ? { pricing: _chunk4IOY2SCQjs.recordField.call(void 0, tool, "pricing") } : {},
|
|
1237
1237
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
1238
1238
|
},
|
|
1239
1239
|
{
|
|
@@ -1244,14 +1244,14 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1244
1244
|
);
|
|
1245
1245
|
return 0;
|
|
1246
1246
|
}
|
|
1247
|
-
if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !
|
|
1248
|
-
const contract =
|
|
1247
|
+
if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !_chunk4IOY2SCQjs.isMonitorTypeTool.call(void 0, tool) && !_chunk4IOY2SCQjs.isPlayLikeTool.call(void 0, tool) && (options.json || options.contractJson)) {
|
|
1248
|
+
const contract = _chunk4IOY2SCQjs.toolContractJsonForDescribe.call(void 0,
|
|
1249
1249
|
tool,
|
|
1250
1250
|
toolId,
|
|
1251
1251
|
void 0,
|
|
1252
1252
|
seedToolListScript
|
|
1253
1253
|
);
|
|
1254
|
-
|
|
1254
|
+
_chunkDD7E4ZVHjs.printCompactJson.call(void 0, {
|
|
1255
1255
|
toolId: contract.toolId,
|
|
1256
1256
|
...options.schemaOnly ? {
|
|
1257
1257
|
inputSchema: contract.inputSchema,
|
|
@@ -1274,8 +1274,8 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1274
1274
|
return 0;
|
|
1275
1275
|
}
|
|
1276
1276
|
if (options.contractJson) {
|
|
1277
|
-
|
|
1278
|
-
...
|
|
1277
|
+
_chunkDD7E4ZVHjs.printCompactJson.call(void 0, {
|
|
1278
|
+
..._chunk4IOY2SCQjs.toolContractJsonForDescribe.call(void 0,
|
|
1279
1279
|
tool,
|
|
1280
1280
|
toolId,
|
|
1281
1281
|
void 0,
|
|
@@ -1288,8 +1288,8 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
const emitJson = options.json === true;
|
|
1290
1290
|
if (emitJson) {
|
|
1291
|
-
|
|
1292
|
-
...
|
|
1291
|
+
_chunkDD7E4ZVHjs.printCompactJson.call(void 0, {
|
|
1292
|
+
..._chunk4IOY2SCQjs.toolMetadataJsonForDescribe.call(void 0, tool, toolId, seedToolListScript),
|
|
1293
1293
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1294
1294
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
1295
1295
|
});
|
|
@@ -1314,7 +1314,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1314
1314
|
printCompactToolContract(tool, toolId);
|
|
1315
1315
|
if (modelDescription) {
|
|
1316
1316
|
process.stdout.write(`
|
|
1317
|
-
${
|
|
1317
|
+
${_chunk4IOY2SCQjs.formatModelDescription.call(void 0, modelDescription)}`);
|
|
1318
1318
|
}
|
|
1319
1319
|
if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
|
|
1320
1320
|
return 0;
|
|
@@ -1322,7 +1322,7 @@ ${_chunkV6OMS7E2js.formatModelDescription.call(void 0, modelDescription)}`);
|
|
|
1322
1322
|
printCompactToolContract(tool, toolId);
|
|
1323
1323
|
if (modelDescription) {
|
|
1324
1324
|
process.stdout.write(`
|
|
1325
|
-
${
|
|
1325
|
+
${_chunk4IOY2SCQjs.formatModelDescription.call(void 0, modelDescription)}`);
|
|
1326
1326
|
}
|
|
1327
1327
|
if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
|
|
1328
1328
|
return 0;
|
|
@@ -1339,10 +1339,10 @@ function printInferenceQuoteSummary(quote) {
|
|
|
1339
1339
|
for (const line of inferenceQuoteSummaryLines(quote)) console.log(line);
|
|
1340
1340
|
}
|
|
1341
1341
|
function printMonitorTypeFilters(tool) {
|
|
1342
|
-
const schema =
|
|
1343
|
-
const properties =
|
|
1342
|
+
const schema = _chunk4IOY2SCQjs.recordField.call(void 0, tool, "payload_schema", "payloadSchema");
|
|
1343
|
+
const properties = _chunk4IOY2SCQjs.recordField.call(void 0, schema, "properties");
|
|
1344
1344
|
const required = new Set(
|
|
1345
|
-
|
|
1345
|
+
_chunk4IOY2SCQjs.arrayField.call(void 0, schema, "required").filter(
|
|
1346
1346
|
(v) => typeof v === "string"
|
|
1347
1347
|
)
|
|
1348
1348
|
);
|
|
@@ -1353,24 +1353,24 @@ function printMonitorTypeFilters(tool) {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
console.log("Deploy filters (set in the monitor payload):");
|
|
1355
1355
|
for (const name of names) {
|
|
1356
|
-
const field =
|
|
1356
|
+
const field = _chunk4IOY2SCQjs.isRecord.call(void 0, properties[name]) ? properties[name] : {};
|
|
1357
1357
|
const star = required.has(name) ? "*" : "";
|
|
1358
|
-
const enumVals =
|
|
1358
|
+
const enumVals = _chunk4IOY2SCQjs.arrayField.call(void 0, field, "enum").filter(
|
|
1359
1359
|
(v) => typeof v === "string"
|
|
1360
1360
|
);
|
|
1361
|
-
const type = enumVals.length ? `one of [${enumVals.join(", ")}]` :
|
|
1362
|
-
const desc =
|
|
1361
|
+
const type = enumVals.length ? `one of [${enumVals.join(", ")}]` : _chunk4IOY2SCQjs.stringField.call(void 0, field, "type") || "string";
|
|
1362
|
+
const desc = _chunk4IOY2SCQjs.stringField.call(void 0, field, "description");
|
|
1363
1363
|
console.log(`- ${name}${star}: ${type}${desc ? ` - ${desc}` : ""}`);
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
1366
|
function printMonitorTypeFilterExamples(tool) {
|
|
1367
|
-
const documentation =
|
|
1368
|
-
const fields =
|
|
1367
|
+
const documentation = _chunk4IOY2SCQjs.recordField.call(void 0, tool, "documentation");
|
|
1368
|
+
const fields = _chunk4IOY2SCQjs.recordField.call(void 0, documentation, "fields");
|
|
1369
1369
|
const examples = Object.entries(fields).flatMap(([name, rawField]) => {
|
|
1370
|
-
const grammar =
|
|
1371
|
-
const example =
|
|
1370
|
+
const grammar = _chunk4IOY2SCQjs.recordField.call(void 0, _chunk4IOY2SCQjs.isRecord.call(void 0, rawField) ? rawField : {}, "grammar");
|
|
1371
|
+
const example = _chunk4IOY2SCQjs.stringField.call(void 0, grammar, "example");
|
|
1372
1372
|
const values = [
|
|
1373
|
-
...
|
|
1373
|
+
..._chunk4IOY2SCQjs.arrayField.call(void 0, grammar, "examples").filter(
|
|
1374
1374
|
(value) => typeof value === "string" && Boolean(value)
|
|
1375
1375
|
),
|
|
1376
1376
|
...example ? [example] : []
|
|
@@ -1385,21 +1385,21 @@ function printMonitorTypeFilterExamples(tool) {
|
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
1387
|
function printMonitorTypeStreams(tool) {
|
|
1388
|
-
const streams =
|
|
1389
|
-
|
|
1388
|
+
const streams = _chunk4IOY2SCQjs.arrayField.call(void 0, tool, "streams", "output_streams").filter(
|
|
1389
|
+
_chunk4IOY2SCQjs.isRecord
|
|
1390
1390
|
);
|
|
1391
1391
|
if (!streams.length) return;
|
|
1392
1392
|
console.log("");
|
|
1393
1393
|
console.log("Filter columns (a play's sqlListeners.where, per stream):");
|
|
1394
1394
|
for (const stream of streams) {
|
|
1395
|
-
const name =
|
|
1396
|
-
const cols =
|
|
1395
|
+
const name = _chunk4IOY2SCQjs.stringField.call(void 0, stream, "stream");
|
|
1396
|
+
const cols = _chunk4IOY2SCQjs.arrayField.call(void 0, stream, "columns").filter(_chunk4IOY2SCQjs.isRecord).map((col) => _chunk4IOY2SCQjs.stringField.call(void 0, col, "name")).filter(Boolean);
|
|
1397
1397
|
console.log(`- ${name}: ${cols.join(", ")}`);
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
1400
|
function monitorTypePricingLines(tool) {
|
|
1401
|
-
const pricing =
|
|
1402
|
-
const byType =
|
|
1401
|
+
const pricing = _chunk4IOY2SCQjs.recordField.call(void 0, tool, "pricing");
|
|
1402
|
+
const byType = _chunk4IOY2SCQjs.recordField.call(void 0,
|
|
1403
1403
|
pricing,
|
|
1404
1404
|
"pricing_by_radar_type",
|
|
1405
1405
|
"pricingByRadarType"
|
|
@@ -1410,9 +1410,9 @@ function monitorTypePricingLines(tool) {
|
|
|
1410
1410
|
}
|
|
1411
1411
|
const lines = ["Pricing (Deepline credits per accepted event):"];
|
|
1412
1412
|
for (const key of keys) {
|
|
1413
|
-
const entry =
|
|
1413
|
+
const entry = _chunk4IOY2SCQjs.isRecord.call(void 0, byType[key]) ? byType[key] : {};
|
|
1414
1414
|
const credits = numberField(entry, "deepline_credits", "deeplineCredits");
|
|
1415
|
-
const display =
|
|
1415
|
+
const display = _chunk4IOY2SCQjs.stringField.call(void 0, entry, "display");
|
|
1416
1416
|
const shown = display || (credits !== null ? `${formatDecimal(credits)} credits/event` : "not listed");
|
|
1417
1417
|
lines.push(`- ${key}: ${shown}`);
|
|
1418
1418
|
}
|
|
@@ -1422,20 +1422,20 @@ function printMonitorTypePricing(tool) {
|
|
|
1422
1422
|
for (const line of monitorTypePricingLines(tool)) console.log(line);
|
|
1423
1423
|
}
|
|
1424
1424
|
function printMonitorTypeDeploy(tool) {
|
|
1425
|
-
const deploy =
|
|
1426
|
-
const toolId =
|
|
1427
|
-
const example =
|
|
1425
|
+
const deploy = _chunk4IOY2SCQjs.recordField.call(void 0, tool, "deploy");
|
|
1426
|
+
const toolId = _chunk4IOY2SCQjs.stringField.call(void 0, tool, "toolId");
|
|
1427
|
+
const example = _chunk4IOY2SCQjs.stringField.call(void 0, deploy, "example") || `deepline monitors deploy '{"key":"...","tool":"${toolId}","payload":{...}}'`;
|
|
1428
1428
|
console.log("Deploy (a monitor type is deployed, not executed):");
|
|
1429
1429
|
console.log(` ${example}`);
|
|
1430
1430
|
}
|
|
1431
1431
|
function printMonitorTypeContract(tool, requestedToolId) {
|
|
1432
|
-
const toolId =
|
|
1432
|
+
const toolId = _chunk4IOY2SCQjs.stringField.call(void 0, tool, "toolId") || requestedToolId;
|
|
1433
1433
|
console.log(toolId);
|
|
1434
|
-
const displayName =
|
|
1434
|
+
const displayName = _chunk4IOY2SCQjs.stringField.call(void 0, tool, "displayName");
|
|
1435
1435
|
if (displayName) console.log(`Best for: ${displayName}`);
|
|
1436
|
-
const description =
|
|
1436
|
+
const description = _chunk4IOY2SCQjs.stringField.call(void 0, tool, "description");
|
|
1437
1437
|
if (description) console.log(`Description: ${description}`);
|
|
1438
|
-
const categories =
|
|
1438
|
+
const categories = _chunk4IOY2SCQjs.arrayField.call(void 0, tool, "categories").filter(
|
|
1439
1439
|
(v) => typeof v === "string"
|
|
1440
1440
|
);
|
|
1441
1441
|
if (categories.length) console.log(`Tags: ${categories.join(", ")}`);
|
|
@@ -1455,31 +1455,31 @@ function printMonitorTypeContract(tool, requestedToolId) {
|
|
|
1455
1455
|
console.log(`More: deepline describe ${toolId}`);
|
|
1456
1456
|
}
|
|
1457
1457
|
function toolGuidanceLines(guidance) {
|
|
1458
|
-
const record =
|
|
1459
|
-
const toolGuidance =
|
|
1460
|
-
const providerGuidance =
|
|
1458
|
+
const record = _chunk4IOY2SCQjs.isRecord.call(void 0, guidance) ? guidance : {};
|
|
1459
|
+
const toolGuidance = _chunk4IOY2SCQjs.stringField.call(void 0, record, "tool");
|
|
1460
|
+
const providerGuidance = _chunk4IOY2SCQjs.stringField.call(void 0, record, "provider");
|
|
1461
1461
|
return [
|
|
1462
1462
|
...toolGuidance ? [`- This tool: ${toolGuidance}`] : [],
|
|
1463
1463
|
...providerGuidance ? [`- Provider: ${providerGuidance}`] : []
|
|
1464
1464
|
];
|
|
1465
1465
|
}
|
|
1466
1466
|
function printCompactToolContract(tool, requestedToolId) {
|
|
1467
|
-
if (
|
|
1467
|
+
if (_chunk4IOY2SCQjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1468
1468
|
printMonitorTypeContract(tool, requestedToolId);
|
|
1469
1469
|
return;
|
|
1470
1470
|
}
|
|
1471
|
-
const contract =
|
|
1471
|
+
const contract = _chunk4IOY2SCQjs.toolContractJsonForDescribe.call(void 0,
|
|
1472
1472
|
tool,
|
|
1473
1473
|
requestedToolId,
|
|
1474
1474
|
void 0,
|
|
1475
1475
|
seedToolListScript
|
|
1476
1476
|
);
|
|
1477
|
-
const cost =
|
|
1478
|
-
const getters =
|
|
1477
|
+
const cost = _chunk4IOY2SCQjs.isRecord.call(void 0, contract.cost) ? contract.cost : {};
|
|
1478
|
+
const getters = _chunk4IOY2SCQjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1479
1479
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1480
1480
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1481
|
-
const inputFields =
|
|
1482
|
-
|
|
1481
|
+
const inputFields = _chunk4IOY2SCQjs.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1482
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, contract, "inputSchema")
|
|
1483
1483
|
);
|
|
1484
1484
|
console.log(String(contract.toolId));
|
|
1485
1485
|
if (contract.displayName) console.log(`Best for: ${contract.displayName}`);
|
|
@@ -1496,9 +1496,9 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1496
1496
|
printToolOutputArrayShape(contract);
|
|
1497
1497
|
printToolExecutionHints(contract);
|
|
1498
1498
|
if (contract.deprecated === true) {
|
|
1499
|
-
const deprecation =
|
|
1500
|
-
const message =
|
|
1501
|
-
const replacementToolId =
|
|
1499
|
+
const deprecation = _chunk4IOY2SCQjs.isRecord.call(void 0, contract.deprecation) ? contract.deprecation : {};
|
|
1500
|
+
const message = _chunk4IOY2SCQjs.stringField.call(void 0, deprecation, "message");
|
|
1501
|
+
const replacementToolId = _chunk4IOY2SCQjs.stringField.call(void 0,
|
|
1502
1502
|
deprecation,
|
|
1503
1503
|
"replacementToolId",
|
|
1504
1504
|
"replacement_tool_id"
|
|
@@ -1521,12 +1521,12 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1521
1521
|
console.log("");
|
|
1522
1522
|
console.log("Inputs:");
|
|
1523
1523
|
for (const field of inputFields) {
|
|
1524
|
-
if (!
|
|
1525
|
-
const name =
|
|
1524
|
+
if (!_chunk4IOY2SCQjs.isRecord.call(void 0, field)) continue;
|
|
1525
|
+
const name = _chunk4IOY2SCQjs.stringField.call(void 0, field, "name");
|
|
1526
1526
|
if (!name) continue;
|
|
1527
1527
|
const required = field.required ? "*" : "";
|
|
1528
|
-
const type =
|
|
1529
|
-
const description =
|
|
1528
|
+
const type = _chunk4IOY2SCQjs.stringField.call(void 0, field, "type") || "unknown";
|
|
1529
|
+
const description = _chunk4IOY2SCQjs.stringField.call(void 0, field, "description");
|
|
1530
1530
|
const enumValues = Array.isArray(field.enum) ? field.enum : [];
|
|
1531
1531
|
const enumSuffix = enumValues.length ? ` enum=${enumValues.map(String).join("|")}` : "";
|
|
1532
1532
|
const itemBoundsSuffix = arrayItemBoundsSuffix(field);
|
|
@@ -1541,8 +1541,8 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
console.log("");
|
|
1543
1543
|
printToolExamplesOnly(tool, requestedToolId);
|
|
1544
|
-
const starterScript =
|
|
1545
|
-
const starterPath =
|
|
1544
|
+
const starterScript = _chunk4IOY2SCQjs.isRecord.call(void 0, contract.starterScript) ? contract.starterScript : {};
|
|
1545
|
+
const starterPath = _chunk4IOY2SCQjs.stringField.call(void 0, starterScript, "path");
|
|
1546
1546
|
if (starterPath) {
|
|
1547
1547
|
console.log("");
|
|
1548
1548
|
console.log(`Starter script: ${starterPath}`);
|
|
@@ -1553,16 +1553,16 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1553
1553
|
console.log("Getters:");
|
|
1554
1554
|
if (listGetters.length) console.log(listGetterHeading());
|
|
1555
1555
|
for (const entry of listGetters) {
|
|
1556
|
-
if (
|
|
1556
|
+
if (_chunk4IOY2SCQjs.isRecord.call(void 0, entry))
|
|
1557
1557
|
console.log(
|
|
1558
|
-
`- ${
|
|
1558
|
+
`- ${_chunk4IOY2SCQjs.stringField.call(void 0, entry, "name")}: ${_chunk4IOY2SCQjs.playResultExpression.call(void 0, entry)}`
|
|
1559
1559
|
);
|
|
1560
1560
|
}
|
|
1561
1561
|
if (valueGetters.length) console.log("Values:");
|
|
1562
1562
|
for (const entry of valueGetters) {
|
|
1563
|
-
if (
|
|
1563
|
+
if (_chunk4IOY2SCQjs.isRecord.call(void 0, entry))
|
|
1564
1564
|
console.log(
|
|
1565
|
-
`- ${
|
|
1565
|
+
`- ${_chunk4IOY2SCQjs.stringField.call(void 0, entry, "name")}: ${_chunk4IOY2SCQjs.playResultExpression.call(void 0, entry)}`
|
|
1566
1566
|
);
|
|
1567
1567
|
}
|
|
1568
1568
|
}
|
|
@@ -1573,19 +1573,19 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1573
1573
|
console.log(`More: deepline describe ${contract.toolId}`);
|
|
1574
1574
|
}
|
|
1575
1575
|
function toolPricingOnlyLines(tool, requestedToolId, options = {}) {
|
|
1576
|
-
if (
|
|
1576
|
+
if (_chunk4IOY2SCQjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1577
1577
|
return monitorTypePricingLines(tool);
|
|
1578
1578
|
}
|
|
1579
1579
|
const toolId = String(tool.toolId || requestedToolId);
|
|
1580
1580
|
const cost = _chunkZM2YPJQJjs.Capability.fromCatalogEntry(tool).describe().customerCost();
|
|
1581
|
-
const pricingModel =
|
|
1582
|
-
const billing =
|
|
1583
|
-
const explicitUnit =
|
|
1581
|
+
const pricingModel = _chunk4IOY2SCQjs.stringField.call(void 0, cost, "pricingModel") || "unknown";
|
|
1582
|
+
const billing = _chunk4IOY2SCQjs.stringField.call(void 0, cost, "billingSourceLabel") || _chunk4IOY2SCQjs.stringField.call(void 0, cost, "billingSource") || _chunk4IOY2SCQjs.stringField.call(void 0, cost, "billingMode") || "unknown";
|
|
1583
|
+
const explicitUnit = _chunk4IOY2SCQjs.stringField.call(void 0, cost, "unit");
|
|
1584
1584
|
const unit = explicitUnit || (pricingModel === "per_page" ? "page" : pricingModel === "per_result" ? "result" : pricingModel === "fixed" ? "call" : pricingModel.replace(/^per_/, "") || "unit");
|
|
1585
1585
|
const credits = numberField(cost, "deeplineCreditsPerPricingUnit");
|
|
1586
1586
|
const usd = numberField(cost, "deeplineUsdPerPricingUnit");
|
|
1587
|
-
const displayText =
|
|
1588
|
-
const summary =
|
|
1587
|
+
const displayText = _chunk4IOY2SCQjs.stringField.call(void 0, cost, "displayText");
|
|
1588
|
+
const summary = _chunk4IOY2SCQjs.stringField.call(void 0, cost, "summary");
|
|
1589
1589
|
const price = displayText || summary || (credits !== null ? `${formatDecimal(credits)} Deepline credits${usd !== null ? ` / ${formatUsd(usd)}` : ""} per ${unit}` : "pricing unavailable");
|
|
1590
1590
|
return [
|
|
1591
1591
|
`${_nullishCoalesce(options.heading, () => ( `Pricing: ${toolId}`))}: ${price}`,
|
|
@@ -1602,19 +1602,19 @@ function printToolPricingOnly(tool, requestedToolId, options = {}) {
|
|
|
1602
1602
|
console.log(line);
|
|
1603
1603
|
}
|
|
1604
1604
|
function printToolSchemaOnly(tool, requestedToolId) {
|
|
1605
|
-
if (
|
|
1605
|
+
if (_chunk4IOY2SCQjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1606
1606
|
printMonitorTypeFilters(tool);
|
|
1607
1607
|
printMonitorTypeStreams(tool);
|
|
1608
1608
|
return;
|
|
1609
1609
|
}
|
|
1610
|
-
const contract =
|
|
1610
|
+
const contract = _chunk4IOY2SCQjs.toolContractJsonForDescribe.call(void 0,
|
|
1611
1611
|
tool,
|
|
1612
1612
|
requestedToolId,
|
|
1613
1613
|
void 0,
|
|
1614
1614
|
seedToolListScript
|
|
1615
1615
|
);
|
|
1616
|
-
const inputFields =
|
|
1617
|
-
|
|
1616
|
+
const inputFields = _chunk4IOY2SCQjs.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1617
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, contract, "inputSchema")
|
|
1618
1618
|
);
|
|
1619
1619
|
console.log(`Schema: ${contract.toolId}`);
|
|
1620
1620
|
if (!inputFields.length) {
|
|
@@ -1641,27 +1641,27 @@ function printToolSchemaOnly(tool, requestedToolId) {
|
|
|
1641
1641
|
}
|
|
1642
1642
|
printToolOutputArrayShape(contract);
|
|
1643
1643
|
const declaredSchema = declaredToolJsonSchema(
|
|
1644
|
-
|
|
1644
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, contract, "inputSchema")
|
|
1645
1645
|
);
|
|
1646
1646
|
if (declaredSchema) {
|
|
1647
1647
|
console.log("Declared input JSON Schema:");
|
|
1648
1648
|
console.log(JSON.stringify(declaredSchema, null, 2));
|
|
1649
1649
|
}
|
|
1650
|
-
if (
|
|
1650
|
+
if (_chunk4IOY2SCQjs.isRecord.call(void 0, contract.responseSchema)) {
|
|
1651
1651
|
console.log("Deepline execution response JSON Schema:");
|
|
1652
1652
|
console.log(JSON.stringify(contract.responseSchema, null, 2));
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
1655
|
function printToolExamplesOnly(tool, requestedToolId) {
|
|
1656
|
-
if (
|
|
1656
|
+
if (_chunk4IOY2SCQjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1657
1657
|
printMonitorTypeDeploy(tool);
|
|
1658
1658
|
return;
|
|
1659
1659
|
}
|
|
1660
|
-
if (
|
|
1660
|
+
if (_chunk4IOY2SCQjs.isPlayLikeTool.call(void 0, tool)) {
|
|
1661
1661
|
printPlayLikeToolUsage(tool, requestedToolId);
|
|
1662
1662
|
return;
|
|
1663
1663
|
}
|
|
1664
|
-
const contract =
|
|
1664
|
+
const contract = _chunk4IOY2SCQjs.toolContractJsonForDescribe.call(void 0,
|
|
1665
1665
|
tool,
|
|
1666
1666
|
requestedToolId,
|
|
1667
1667
|
void 0,
|
|
@@ -1669,9 +1669,9 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1669
1669
|
);
|
|
1670
1670
|
const toolId = String(contract.toolId);
|
|
1671
1671
|
const inputFields = Array.isArray(contract.inputFields) ? contract.inputFields : [];
|
|
1672
|
-
const examples =
|
|
1672
|
+
const examples = _chunk4IOY2SCQjs.arrayField.call(void 0, tool, "examples").filter(_chunk4IOY2SCQjs.isRecord);
|
|
1673
1673
|
const firstExample = examples[0];
|
|
1674
|
-
const sampleInput = firstExample &&
|
|
1674
|
+
const sampleInput = firstExample && _chunk4IOY2SCQjs.isRecord.call(void 0, firstExample.input) ? firstExample.input : _nullishCoalesce(samplePayload(_chunk4IOY2SCQjs.recordField.call(void 0, tool, "samples"), "request"), () => ( _chunk4IOY2SCQjs.samplePayloadForInputFields.call(void 0, inputFields)));
|
|
1675
1675
|
console.log("Example input payload:");
|
|
1676
1676
|
console.log(JSON.stringify(sampleInput, null, 2));
|
|
1677
1677
|
console.log(`Use in a play:`);
|
|
@@ -1685,32 +1685,32 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1685
1685
|
);
|
|
1686
1686
|
console.log("});");
|
|
1687
1687
|
console.log("const response = result.toolResponse.rawV2;");
|
|
1688
|
-
const getters =
|
|
1688
|
+
const getters = _chunk4IOY2SCQjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1689
1689
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1690
1690
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1691
|
-
const firstGetter = valueGetters.find(
|
|
1691
|
+
const firstGetter = valueGetters.find(_chunk4IOY2SCQjs.isRecord);
|
|
1692
1692
|
if (firstGetter) {
|
|
1693
|
-
const name =
|
|
1694
|
-
const expression =
|
|
1693
|
+
const name = _chunk4IOY2SCQjs.stringField.call(void 0, firstGetter, "name") || "value";
|
|
1694
|
+
const expression = _chunk4IOY2SCQjs.stringField.call(void 0, firstGetter, "expression");
|
|
1695
1695
|
if (expression)
|
|
1696
1696
|
console.log(
|
|
1697
1697
|
`const ${safeIdentifier(name)} = ${expression.replace(/^toolExecutionResult\./, "result.")};`
|
|
1698
1698
|
);
|
|
1699
1699
|
}
|
|
1700
1700
|
const arrayNames = new Set(
|
|
1701
|
-
|
|
1702
|
-
|
|
1701
|
+
_chunk4IOY2SCQjs.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1702
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, tool, "outputSchema", "output_schema")
|
|
1703
1703
|
).filter((field) => String(field.type).split("|").includes("array")).map((field) => String(field.name).split(".").at(-1))
|
|
1704
1704
|
);
|
|
1705
1705
|
const firstList = _nullishCoalesce(listGetters.find(
|
|
1706
|
-
(entry) =>
|
|
1707
|
-
), () => ( listGetters.find(
|
|
1708
|
-
if (
|
|
1709
|
-
const name = safeIdentifier(
|
|
1706
|
+
(entry) => _chunk4IOY2SCQjs.isRecord.call(void 0, entry) && arrayNames.has(_chunk4IOY2SCQjs.stringField.call(void 0, entry, "name"))
|
|
1707
|
+
), () => ( listGetters.find(_chunk4IOY2SCQjs.isRecord)));
|
|
1708
|
+
if (_chunk4IOY2SCQjs.isRecord.call(void 0, firstList)) {
|
|
1709
|
+
const name = safeIdentifier(_chunk4IOY2SCQjs.stringField.call(void 0, firstList, "name") || "list");
|
|
1710
1710
|
if (_chunkJ33TSWO5js.playToolListGetterMode.call(void 0, ) === "array") {
|
|
1711
|
-
console.log(`const ${name}_rows = ${
|
|
1711
|
+
console.log(`const ${name}_rows = ${_chunk4IOY2SCQjs.playResultExpression.call(void 0, firstList)};`);
|
|
1712
1712
|
} else {
|
|
1713
|
-
console.log(`const ${name}_ds = ${
|
|
1713
|
+
console.log(`const ${name}_ds = ${_chunk4IOY2SCQjs.playResultExpression.call(void 0, firstList)};`);
|
|
1714
1714
|
console.log(
|
|
1715
1715
|
"// Complete small list from this response; throws above the memory cap."
|
|
1716
1716
|
);
|
|
@@ -1720,7 +1720,7 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1720
1720
|
console.log("```");
|
|
1721
1721
|
if (firstList) printListGetterConsumption();
|
|
1722
1722
|
for (const example of examples) {
|
|
1723
|
-
const description =
|
|
1723
|
+
const description = _chunk4IOY2SCQjs.stringField.call(void 0, example, "description");
|
|
1724
1724
|
if (description) console.log(description);
|
|
1725
1725
|
console.log("Example Deepline execution response:");
|
|
1726
1726
|
console.log(JSON.stringify(example.response, null, 2));
|
|
@@ -1735,14 +1735,14 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1735
1735
|
}
|
|
1736
1736
|
function printPlayLikeToolUsage(tool, requestedToolId) {
|
|
1737
1737
|
const toolId = String(tool.toolId || requestedToolId);
|
|
1738
|
-
const inputFields =
|
|
1739
|
-
|
|
1738
|
+
const inputFields = _chunk4IOY2SCQjs.toolInputFieldsForDisplay.call(void 0,
|
|
1739
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, tool, "inputSchema", "input_schema")
|
|
1740
1740
|
);
|
|
1741
|
-
const sampleInput =
|
|
1742
|
-
const playReference =
|
|
1741
|
+
const sampleInput = _chunk4IOY2SCQjs.samplePayloadForInputFields.call(void 0, inputFields);
|
|
1742
|
+
const playReference = _chunk4IOY2SCQjs.playReferenceForTool.call(void 0, tool);
|
|
1743
1743
|
console.log("Run as a play:");
|
|
1744
1744
|
console.log(
|
|
1745
|
-
|
|
1745
|
+
_chunk4IOY2SCQjs.playRunCommandForTool.call(void 0,
|
|
1746
1746
|
tool,
|
|
1747
1747
|
toolId,
|
|
1748
1748
|
Object.keys(sampleInput).length ? sampleInput : void 0
|
|
@@ -1753,13 +1753,13 @@ function printPlayLikeToolUsage(tool, requestedToolId) {
|
|
|
1753
1753
|
}
|
|
1754
1754
|
}
|
|
1755
1755
|
function printToolGettersOnly(tool, requestedToolId) {
|
|
1756
|
-
const contract =
|
|
1756
|
+
const contract = _chunk4IOY2SCQjs.toolContractJsonForDescribe.call(void 0,
|
|
1757
1757
|
tool,
|
|
1758
1758
|
requestedToolId,
|
|
1759
1759
|
void 0,
|
|
1760
1760
|
seedToolListScript
|
|
1761
1761
|
);
|
|
1762
|
-
const getters =
|
|
1762
|
+
const getters = _chunk4IOY2SCQjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1763
1763
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1764
1764
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1765
1765
|
console.log(`Getters: ${contract.toolId}`);
|
|
@@ -1770,9 +1770,9 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
1770
1770
|
if (listGetters.length) {
|
|
1771
1771
|
console.log(listGetterHeading());
|
|
1772
1772
|
for (const entry of listGetters) {
|
|
1773
|
-
if (
|
|
1773
|
+
if (_chunk4IOY2SCQjs.isRecord.call(void 0, entry))
|
|
1774
1774
|
console.log(
|
|
1775
|
-
`- ${
|
|
1775
|
+
`- ${_chunk4IOY2SCQjs.stringField.call(void 0, entry, "name")}: ${_chunk4IOY2SCQjs.playResultExpression.call(void 0, entry)}`
|
|
1776
1776
|
);
|
|
1777
1777
|
}
|
|
1778
1778
|
printListGetterConsumption();
|
|
@@ -1780,9 +1780,9 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
1780
1780
|
if (valueGetters.length) {
|
|
1781
1781
|
console.log("Values:");
|
|
1782
1782
|
for (const entry of valueGetters) {
|
|
1783
|
-
if (
|
|
1783
|
+
if (_chunk4IOY2SCQjs.isRecord.call(void 0, entry))
|
|
1784
1784
|
console.log(
|
|
1785
|
-
`- ${
|
|
1785
|
+
`- ${_chunk4IOY2SCQjs.stringField.call(void 0, entry, "name")}: ${_chunk4IOY2SCQjs.playResultExpression.call(void 0, entry)}`
|
|
1786
1786
|
);
|
|
1787
1787
|
}
|
|
1788
1788
|
}
|
|
@@ -1820,22 +1820,22 @@ function listedToolDescription(tool) {
|
|
|
1820
1820
|
}
|
|
1821
1821
|
function formatListedToolCost(tool) {
|
|
1822
1822
|
const record = tool;
|
|
1823
|
-
if (
|
|
1823
|
+
if (_chunk4IOY2SCQjs.stringField.call(void 0, record, "billingSource", "billing_source") === "free") {
|
|
1824
1824
|
return "Cost: Free";
|
|
1825
1825
|
}
|
|
1826
|
-
const pricing =
|
|
1827
|
-
const displayText =
|
|
1826
|
+
const pricing = _chunk4IOY2SCQjs.recordField.call(void 0, record, "pricing");
|
|
1827
|
+
const displayText = _chunk4IOY2SCQjs.stringField.call(void 0, pricing, "displayText", "display_text");
|
|
1828
1828
|
return displayText ? `Cost: ${displayText}` : "";
|
|
1829
1829
|
}
|
|
1830
1830
|
function printToolOutputArrayShape(tool) {
|
|
1831
|
-
const outputFields =
|
|
1832
|
-
|
|
1831
|
+
const outputFields = _chunk4IOY2SCQjs.toolOutputFieldsForDisplay.call(void 0,
|
|
1832
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, _chunk4IOY2SCQjs.isRecord.call(void 0, tool) ? tool : {}, "outputSchema", "output_schema")
|
|
1833
1833
|
);
|
|
1834
1834
|
if (outputFields.length === 0) return;
|
|
1835
1835
|
console.log(" Output array shape (declared schema):");
|
|
1836
1836
|
for (const field of outputFields.slice(0, 60)) {
|
|
1837
1837
|
const name = String(field.name);
|
|
1838
|
-
const type =
|
|
1838
|
+
const type = _chunk4IOY2SCQjs.stringField.call(void 0, field, "type") || "unknown";
|
|
1839
1839
|
const itemBounds = arrayItemBoundsSuffix(field);
|
|
1840
1840
|
console.log(` - ${name}: ${type}${itemBounds}`);
|
|
1841
1841
|
}
|
|
@@ -1844,14 +1844,14 @@ function printToolOutputArrayShape(tool) {
|
|
|
1844
1844
|
}
|
|
1845
1845
|
}
|
|
1846
1846
|
function declaredToolJsonSchema(inputSchema) {
|
|
1847
|
-
if (
|
|
1847
|
+
if (_chunk4IOY2SCQjs.isRecord.call(void 0, inputSchema.jsonSchema)) {
|
|
1848
1848
|
return inputSchema.jsonSchema;
|
|
1849
1849
|
}
|
|
1850
1850
|
return Array.isArray(inputSchema.fields) ? null : inputSchema;
|
|
1851
1851
|
}
|
|
1852
1852
|
function arrayItemBoundsSuffix(field) {
|
|
1853
|
-
const itemSchema =
|
|
1854
|
-
const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type :
|
|
1853
|
+
const itemSchema = _chunk4IOY2SCQjs.isRecord.call(void 0, field.items) ? field.items : null;
|
|
1854
|
+
const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type : _chunk4IOY2SCQjs.isRecord.call(void 0, itemSchema.properties) ? "object" : "unknown" : null;
|
|
1855
1855
|
const itemEnum = Array.isArray(_optionalChain([itemSchema, 'optionalAccess', _14 => _14.enum])) ? ` enum=${itemSchema.enum.map(String).join("|")}` : "";
|
|
1856
1856
|
const itemTypeSuffix = itemType && itemType !== "unknown" ? ` items=${itemType}${itemEnum}` : "";
|
|
1857
1857
|
const minItems = typeof field.minItems === "number" && Number.isFinite(field.minItems) ? field.minItems : null;
|
|
@@ -1864,21 +1864,21 @@ function arrayItemBoundsSuffix(field) {
|
|
|
1864
1864
|
return itemTypeSuffix;
|
|
1865
1865
|
}
|
|
1866
1866
|
function printToolExecutionHints(value) {
|
|
1867
|
-
const batchCapabilityRecord =
|
|
1868
|
-
|
|
1867
|
+
const batchCapabilityRecord = _chunk4IOY2SCQjs.recordField.call(void 0,
|
|
1868
|
+
_chunk4IOY2SCQjs.isRecord.call(void 0, value) ? value : {},
|
|
1869
1869
|
"batchCapability",
|
|
1870
1870
|
"batch_capability"
|
|
1871
1871
|
);
|
|
1872
1872
|
const batchCapability = Object.keys(batchCapabilityRecord).length > 0 ? batchCapabilityRecord : null;
|
|
1873
|
-
const executionMetadata =
|
|
1874
|
-
|
|
1873
|
+
const executionMetadata = _chunk4IOY2SCQjs.recordField.call(void 0,
|
|
1874
|
+
_chunk4IOY2SCQjs.isRecord.call(void 0, value) ? value : {},
|
|
1875
1875
|
"executionMetadata",
|
|
1876
1876
|
"execution_metadata"
|
|
1877
1877
|
);
|
|
1878
1878
|
if (batchCapability) {
|
|
1879
|
-
const status =
|
|
1880
|
-
const surface =
|
|
1881
|
-
const operation =
|
|
1879
|
+
const status = _chunk4IOY2SCQjs.stringField.call(void 0, batchCapability, "status") || "unknown";
|
|
1880
|
+
const surface = _chunk4IOY2SCQjs.stringField.call(void 0, batchCapability, "surface");
|
|
1881
|
+
const operation = _chunk4IOY2SCQjs.stringField.call(void 0,
|
|
1882
1882
|
batchCapability,
|
|
1883
1883
|
"batchOperation",
|
|
1884
1884
|
"batch_operation"
|
|
@@ -1888,7 +1888,7 @@ function printToolExecutionHints(value) {
|
|
|
1888
1888
|
"maxBatchSize",
|
|
1889
1889
|
"max_batch_size"
|
|
1890
1890
|
);
|
|
1891
|
-
const notes =
|
|
1891
|
+
const notes = _chunk4IOY2SCQjs.stringField.call(void 0, batchCapability, "notes");
|
|
1892
1892
|
console.log("");
|
|
1893
1893
|
console.log("Batching:");
|
|
1894
1894
|
console.log(`- Catalog status: ${status}${surface ? ` (${surface})` : ""}`);
|
|
@@ -1907,11 +1907,11 @@ function printToolExecutionHints(value) {
|
|
|
1907
1907
|
}
|
|
1908
1908
|
if (notes) console.log(`- Details: ${notes}`);
|
|
1909
1909
|
}
|
|
1910
|
-
const configuredRateLimits =
|
|
1910
|
+
const configuredRateLimits = _chunk4IOY2SCQjs.arrayField.call(void 0,
|
|
1911
1911
|
executionMetadata,
|
|
1912
1912
|
"configuredRateLimits",
|
|
1913
1913
|
"configured_rate_limits"
|
|
1914
|
-
).filter(
|
|
1914
|
+
).filter(_chunk4IOY2SCQjs.isRecord);
|
|
1915
1915
|
if (configuredRateLimits.length > 0) {
|
|
1916
1916
|
console.log("");
|
|
1917
1917
|
console.log(
|
|
@@ -1921,7 +1921,7 @@ function printToolExecutionHints(value) {
|
|
|
1921
1921
|
const requests = numberField(limit, "requestsPerWindow");
|
|
1922
1922
|
const windowMs = numberField(limit, "windowMs");
|
|
1923
1923
|
if (requests === null || windowMs === null) continue;
|
|
1924
|
-
const usage =
|
|
1924
|
+
const usage = _chunk4IOY2SCQjs.stringField.call(void 0, limit, "usage") || "unknown";
|
|
1925
1925
|
const usageText = usage === "queue_hint" ? "queue hint" : usage === "enforced" ? "Deepline enforced" : usage === "queue_hint_and_enforced" ? "queue hint and Deepline enforced" : usage === "disabled" ? "disabled" : usage;
|
|
1926
1926
|
const explicitMaxConcurrency = numberField(
|
|
1927
1927
|
limit,
|
|
@@ -1934,7 +1934,7 @@ function printToolExecutionHints(value) {
|
|
|
1934
1934
|
);
|
|
1935
1935
|
}
|
|
1936
1936
|
}
|
|
1937
|
-
const queueHint =
|
|
1937
|
+
const queueHint = _chunk4IOY2SCQjs.recordField.call(void 0, executionMetadata, "queueHint", "queue_hint");
|
|
1938
1938
|
const requestsPerSecondHint = numberField(
|
|
1939
1939
|
queueHint,
|
|
1940
1940
|
"requestsPerSecondHint",
|
|
@@ -1960,25 +1960,25 @@ function formatRateWindow(windowMs) {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
function samplePayload(samples, key) {
|
|
1962
1962
|
const entry = samples[key];
|
|
1963
|
-
if (!
|
|
1963
|
+
if (!_chunk4IOY2SCQjs.isRecord.call(void 0, entry)) return void 0;
|
|
1964
1964
|
return Object.prototype.hasOwnProperty.call(entry, "payload") ? entry.payload : entry;
|
|
1965
1965
|
}
|
|
1966
1966
|
function commandEnvelopeFromRawResponse(rawResponse) {
|
|
1967
|
-
return
|
|
1967
|
+
return _chunk4IOY2SCQjs.isRecord.call(void 0, rawResponse) ? { ...rawResponse } : { status: "completed", result: rawResponse };
|
|
1968
1968
|
}
|
|
1969
1969
|
function toolExecuteExitCode(envelope) {
|
|
1970
1970
|
return envelope.status === "failed" || envelope.ok === false ? 1 : 0;
|
|
1971
1971
|
}
|
|
1972
1972
|
function extractToolExecutionWarningMessages(rawResponse) {
|
|
1973
|
-
if (!
|
|
1973
|
+
if (!_chunk4IOY2SCQjs.isRecord.call(void 0, rawResponse)) return [];
|
|
1974
1974
|
const candidates = [
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1975
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, _chunk4IOY2SCQjs.recordField.call(void 0, rawResponse, "toolResponse"), "meta"),
|
|
1976
|
+
_chunk4IOY2SCQjs.recordField.call(void 0,
|
|
1977
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, _chunk4IOY2SCQjs.recordField.call(void 0, rawResponse, "toolResponse"), "raw"),
|
|
1978
1978
|
"meta"
|
|
1979
1979
|
),
|
|
1980
|
-
|
|
1981
|
-
|
|
1980
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, rawResponse, "meta"),
|
|
1981
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, _chunk4IOY2SCQjs.recordField.call(void 0, rawResponse, "result"), "meta")
|
|
1982
1982
|
];
|
|
1983
1983
|
const messages = [];
|
|
1984
1984
|
for (const candidate of candidates) {
|
|
@@ -1987,8 +1987,8 @@ function extractToolExecutionWarningMessages(rawResponse) {
|
|
|
1987
1987
|
for (const warning of warnings) {
|
|
1988
1988
|
if (typeof warning === "string" && warning.trim()) {
|
|
1989
1989
|
messages.push(warning.trim());
|
|
1990
|
-
} else if (
|
|
1991
|
-
const message =
|
|
1990
|
+
} else if (_chunk4IOY2SCQjs.isRecord.call(void 0, warning)) {
|
|
1991
|
+
const message = _chunk4IOY2SCQjs.stringField.call(void 0, warning, "message");
|
|
1992
1992
|
if (message) messages.push(message);
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
@@ -1996,20 +1996,20 @@ function extractToolExecutionWarningMessages(rawResponse) {
|
|
|
1996
1996
|
return [...new Set(messages)];
|
|
1997
1997
|
}
|
|
1998
1998
|
function apifySyncRecoveryNext(rawResponse) {
|
|
1999
|
-
if (!
|
|
2000
|
-
const toolResponse =
|
|
2001
|
-
const raw =
|
|
1999
|
+
if (!_chunk4IOY2SCQjs.isRecord.call(void 0, rawResponse) || rawResponse.status !== "running") return null;
|
|
2000
|
+
const toolResponse = _chunk4IOY2SCQjs.recordField.call(void 0, rawResponse, "toolResponse");
|
|
2001
|
+
const raw = _chunk4IOY2SCQjs.recordField.call(void 0, toolResponse, "raw");
|
|
2002
2002
|
if (raw.state !== "awaiting_apify") return null;
|
|
2003
|
-
const next =
|
|
2004
|
-
const getActorRun =
|
|
2005
|
-
const getActorRunTool =
|
|
2006
|
-
const getActorRunPayload =
|
|
2003
|
+
const next = _chunk4IOY2SCQjs.recordField.call(void 0, raw, "next");
|
|
2004
|
+
const getActorRun = _chunk4IOY2SCQjs.recordField.call(void 0, next, "getActorRun");
|
|
2005
|
+
const getActorRunTool = _chunk4IOY2SCQjs.stringField.call(void 0, getActorRun, "tool");
|
|
2006
|
+
const getActorRunPayload = _chunk4IOY2SCQjs.recordField.call(void 0, getActorRun, "payload");
|
|
2007
2007
|
if (!getActorRunTool || Object.keys(getActorRunPayload).length === 0) {
|
|
2008
2008
|
return null;
|
|
2009
2009
|
}
|
|
2010
|
-
const getDatasetItems =
|
|
2011
|
-
const getDatasetItemsTool =
|
|
2012
|
-
const getDatasetItemsPayload =
|
|
2010
|
+
const getDatasetItems = _chunk4IOY2SCQjs.recordField.call(void 0, next, "getDatasetItems");
|
|
2011
|
+
const getDatasetItemsTool = _chunk4IOY2SCQjs.stringField.call(void 0, getDatasetItems, "tool");
|
|
2012
|
+
const getDatasetItemsPayload = _chunk4IOY2SCQjs.recordField.call(void 0, getDatasetItems, "payload");
|
|
2013
2013
|
return {
|
|
2014
2014
|
getActorRun: `deepline run ${getActorRunTool} --input ${_chunkAID3OYVJjs.shellQuote.call(void 0, JSON.stringify(getActorRunPayload))}`,
|
|
2015
2015
|
...getDatasetItemsTool && Object.keys(getDatasetItemsPayload).length > 0 ? {
|
|
@@ -2019,7 +2019,7 @@ function apifySyncRecoveryNext(rawResponse) {
|
|
|
2019
2019
|
}
|
|
2020
2020
|
function listExtractorPathsFromUsageGuidance(tool) {
|
|
2021
2021
|
const toolExecutionResult = _optionalChain([tool, 'access', _16 => _16.usageGuidance, 'optionalAccess', _17 => _17.toolExecutionResult]);
|
|
2022
|
-
const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _18 => _18.extractedLists])) ? toolExecutionResult.extractedLists :
|
|
2022
|
+
const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _18 => _18.extractedLists])) ? toolExecutionResult.extractedLists : _chunk4IOY2SCQjs.isRecord.call(void 0, _optionalChain([toolExecutionResult, 'optionalAccess', _19 => _19.extractedLists])) ? Object.values(toolExecutionResult.extractedLists) : [];
|
|
2023
2023
|
return extractedLists.flatMap((entry) => {
|
|
2024
2024
|
const paths = _nullishCoalesce(_optionalChain([entry, 'access', _20 => _20.details, 'optionalAccess', _21 => _21.candidatePaths]), () => ( _optionalChain([entry, 'access', _22 => _22.details, 'optionalAccess', _23 => _23.rawToolOutputPaths])));
|
|
2025
2025
|
if (!Array.isArray(paths)) return [];
|
|
@@ -2104,7 +2104,7 @@ function parseJsonObjectArgument(raw, flagName) {
|
|
|
2104
2104
|
}
|
|
2105
2105
|
throw invalidJsonError(flagName, message);
|
|
2106
2106
|
}
|
|
2107
|
-
if (!
|
|
2107
|
+
if (!_chunk4IOY2SCQjs.isRecord.call(void 0, parsed)) {
|
|
2108
2108
|
throw invalidJsonError(flagName, "expected an object.");
|
|
2109
2109
|
}
|
|
2110
2110
|
return parsed;
|
|
@@ -2148,7 +2148,7 @@ function parseExecuteOptions(toolId, options, output) {
|
|
|
2148
2148
|
outputFormat = normalizeOutputFormat(options.outputFormat);
|
|
2149
2149
|
}
|
|
2150
2150
|
if (options.idempotencyKey !== void 0) {
|
|
2151
|
-
|
|
2151
|
+
_chunkWGQKOLXHjs.validateExecutionIdempotencyKey.call(void 0, options.idempotencyKey);
|
|
2152
2152
|
}
|
|
2153
2153
|
if (options.recoveryTimeoutMs !== void 0) {
|
|
2154
2154
|
const parsed = Number(options.recoveryTimeoutMs);
|
|
@@ -2277,7 +2277,7 @@ function buildToolExecuteBaseEnvelope(input) {
|
|
|
2277
2277
|
kind: summaryEntries.length > 0 ? "object" : "raw",
|
|
2278
2278
|
summary: input.summary
|
|
2279
2279
|
};
|
|
2280
|
-
const envelopeHasCanonicalOutput =
|
|
2280
|
+
const envelopeHasCanonicalOutput = _chunk4IOY2SCQjs.isRecord.call(void 0, envelope.toolResponse) && Object.prototype.hasOwnProperty.call(envelope.toolResponse, "raw");
|
|
2281
2281
|
const envelopeHasDeclaredOutput = Object.prototype.hasOwnProperty.call(
|
|
2282
2282
|
envelope,
|
|
2283
2283
|
"output"
|
|
@@ -2305,7 +2305,7 @@ function buildToolExecuteBaseEnvelope(input) {
|
|
|
2305
2305
|
return {
|
|
2306
2306
|
...envelope,
|
|
2307
2307
|
...input.idempotencyKey ? { idempotency_key: input.idempotencyKey } : {},
|
|
2308
|
-
...
|
|
2308
|
+
..._chunk4IOY2SCQjs.isRecord.call(void 0, input.rawResponse) && _chunk4IOY2SCQjs.isRecord.call(void 0, input.rawResponse.executionRecovery) ? { execution_recovery: input.rawResponse.executionRecovery } : {},
|
|
2309
2309
|
...envelopeHasCanonicalOutput || envelopeHasDeclaredOutput ? { output_preview: outputPreview } : { output: outputPreview },
|
|
2310
2310
|
...summaryEntries.length > 0 ? { summary: input.summary } : {},
|
|
2311
2311
|
...warningMessages.length > 0 ? { warnings: warningMessages } : {},
|
|
@@ -2366,7 +2366,7 @@ function buildToolExecuteRowArtifactEnvelope(input) {
|
|
|
2366
2366
|
void _render;
|
|
2367
2367
|
void _next;
|
|
2368
2368
|
void _local;
|
|
2369
|
-
const billingLookup =
|
|
2369
|
+
const billingLookup = _chunk4IOY2SCQjs.isRecord.call(void 0, input.baseEnvelope.next) && typeof input.baseEnvelope.next.billing === "string" ? input.baseEnvelope.next.billing : null;
|
|
2370
2370
|
const inspection = toolExecutionInspection(input);
|
|
2371
2371
|
return {
|
|
2372
2372
|
...base,
|
|
@@ -2462,14 +2462,28 @@ function printToolExecutionWarnings(toolId, params, metadata) {
|
|
|
2462
2462
|
}
|
|
2463
2463
|
}
|
|
2464
2464
|
function valueAt(value, path) {
|
|
2465
|
-
|
|
2465
|
+
const parts = path.split(".");
|
|
2466
|
+
let at = value;
|
|
2467
|
+
for (const [index, part] of parts.entries()) {
|
|
2468
|
+
const each = part === "*" || part.endsWith("[*]");
|
|
2469
|
+
if (part !== "*") {
|
|
2470
|
+
at = _chunk4IOY2SCQjs.isRecord.call(void 0, at) ? at[each ? part.slice(0, -3) : part] : void 0;
|
|
2471
|
+
}
|
|
2472
|
+
if (!each) continue;
|
|
2473
|
+
if (!Array.isArray(at)) return void 0;
|
|
2474
|
+
const rest = parts.slice(index + 1).join(".");
|
|
2475
|
+
if (!rest) return at;
|
|
2476
|
+
const values = at.map((row) => valueAt(row, rest));
|
|
2477
|
+
return values.some((row) => row !== void 0) ? values.map((row) => _nullishCoalesce(row, () => ( null))) : void 0;
|
|
2478
|
+
}
|
|
2479
|
+
return at;
|
|
2466
2480
|
}
|
|
2467
2481
|
function declaredOutputs(metadata, envelope, data) {
|
|
2468
2482
|
const result = _optionalChain([metadata, 'access', _26 => _26.usageGuidance, 'optionalAccess', _27 => _27.toolExecutionResult]);
|
|
2469
2483
|
const getters = ["extractedValues", "extractedLists"].flatMap(
|
|
2470
2484
|
(kind) => {
|
|
2471
2485
|
const group = _optionalChain([result, 'optionalAccess', _28 => _28[kind]]);
|
|
2472
|
-
return Array.isArray(group) ? group :
|
|
2486
|
+
return Array.isArray(group) ? group : _chunk4IOY2SCQjs.isRecord.call(void 0, group) ? Object.entries(group).map(([name, getter]) => ({
|
|
2473
2487
|
name,
|
|
2474
2488
|
...getter
|
|
2475
2489
|
})) : [];
|
|
@@ -2494,13 +2508,13 @@ function declaredOutputs(metadata, envelope, data) {
|
|
|
2494
2508
|
}
|
|
2495
2509
|
function writeToolReceipt(input) {
|
|
2496
2510
|
const { response, metadata } = input;
|
|
2497
|
-
const envelope =
|
|
2511
|
+
const envelope = _chunk4IOY2SCQjs.isRecord.call(void 0, response) ? response : {};
|
|
2498
2512
|
const jobId = typeof envelope.job_id === "string" ? envelope.job_id : null;
|
|
2499
|
-
const toolResponse =
|
|
2513
|
+
const toolResponse = _chunk4IOY2SCQjs.recordField.call(void 0, envelope, "toolResponse");
|
|
2500
2514
|
const data = Object.hasOwn(toolResponse, "rawV2") ? toolResponse.rawV2 : Object.hasOwn(toolResponse, "raw") ? toolResponse.raw : Object.hasOwn(envelope, "output") ? envelope.output : Object.hasOwn(envelope, "result") ? envelope.result : response;
|
|
2501
2515
|
const status = typeof envelope.status === "string" ? envelope.status : "completed";
|
|
2502
|
-
const charged =
|
|
2503
|
-
|
|
2516
|
+
const charged = _chunk4IOY2SCQjs.recordField.call(void 0, envelope, "billing").credits_charged;
|
|
2517
|
+
_chunk3J2N7YF5js.writeExecutionOutput.call(void 0,
|
|
2504
2518
|
{
|
|
2505
2519
|
id: _nullishCoalesce(input.key, () => ( jobId)),
|
|
2506
2520
|
status,
|
|
@@ -2531,8 +2545,8 @@ async function executeToolForReceipt(input) {
|
|
|
2531
2545
|
let retryKey = null;
|
|
2532
2546
|
let received = false;
|
|
2533
2547
|
try {
|
|
2534
|
-
const cliInvocationId = _nullishCoalesce(
|
|
2535
|
-
const client = new (0,
|
|
2548
|
+
const cliInvocationId = _nullishCoalesce(_chunk3LFSIUFIjs.getToolExecuteInvocationId.call(void 0, ), () => ( _chunk3LFSIUFIjs.beginToolExecuteCommand.call(void 0, )));
|
|
2549
|
+
const client = new (0, _chunkPMJAGTSQjs.DeeplineClient)();
|
|
2536
2550
|
const metadata = await _asyncNullishCoalesce(input.metadata, async () => ( await client.getTool(toolId, { cliInvocationId })));
|
|
2537
2551
|
printToolExecutionWarnings(toolId, params, metadata);
|
|
2538
2552
|
const responseIntent = _optionalChain([output, 'access', _33 => _33.csvOut, 'optionalAccess', _34 => _34.length]) ? "row_artifact" : "raw";
|
|
@@ -2550,9 +2564,9 @@ async function executeToolForReceipt(input) {
|
|
|
2550
2564
|
...input.timeoutMs !== void 0 ? { timeout: input.timeoutMs } : {},
|
|
2551
2565
|
..._optionalChain([metadata, 'access', _35 => _35.executionMetadata, 'optionalAccess', _36 => _36.retrySafeTransientHttp]) === true ? { maxRetries: 2, retryApiErrors: true } : {},
|
|
2552
2566
|
...key ? { idempotencyKey: key } : {},
|
|
2553
|
-
searchRef:
|
|
2567
|
+
searchRef: _chunkRVRG57OBjs.recentSearchRef.call(void 0, ),
|
|
2554
2568
|
cliInvocationId,
|
|
2555
|
-
onResponseReceived:
|
|
2569
|
+
onResponseReceived: _chunk3J2N7YF5js.recordApiResponse
|
|
2556
2570
|
}).catch((error) => {
|
|
2557
2571
|
const guidance = toolGuidanceLines(metadata.guidance);
|
|
2558
2572
|
if (guidance.length)
|
|
@@ -2575,7 +2589,7 @@ async function executeToolForReceipt(input) {
|
|
|
2575
2589
|
if (received) throw error;
|
|
2576
2590
|
const outcomeKnown = answeredWithFailure(error);
|
|
2577
2591
|
if (outcomeKnown) _optionalChain([retryKey, 'optionalAccess', _37 => _37.discard, 'call', _38 => _38()]);
|
|
2578
|
-
|
|
2592
|
+
_chunk3J2N7YF5js.writeExecutionOutput.call(void 0,
|
|
2579
2593
|
{
|
|
2580
2594
|
id: outcomeKnown ? null : key,
|
|
2581
2595
|
status: "failed",
|
|
@@ -2599,11 +2613,11 @@ function answeredWithFailure(error) {
|
|
|
2599
2613
|
error.statusCode !== 408 && error.code !== "EXECUTION_OUTCOME_UNKNOWN";
|
|
2600
2614
|
}
|
|
2601
2615
|
async function getToolExecutionReceipt(key, output) {
|
|
2602
|
-
const client = new (0,
|
|
2616
|
+
const client = new (0, _chunkPMJAGTSQjs.DeeplineClient)();
|
|
2603
2617
|
const execution = await client.executions.getByKey(key);
|
|
2604
2618
|
output.label = `${execution.toolId} (tool)`;
|
|
2605
2619
|
if (execution.response === void 0) {
|
|
2606
|
-
|
|
2620
|
+
_chunk3J2N7YF5js.writeExecutionOutput.call(void 0,
|
|
2607
2621
|
{
|
|
2608
2622
|
id: key,
|
|
2609
2623
|
status: execution.executionRecovery.state,
|
|
@@ -2629,19 +2643,19 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2629
2643
|
parsed = parseExecuteOptions(toolId, options, output);
|
|
2630
2644
|
} catch (error) {
|
|
2631
2645
|
if (wantsJson) {
|
|
2632
|
-
|
|
2646
|
+
_chunkDD7E4ZVHjs.printJsonError.call(void 0, error);
|
|
2633
2647
|
} else {
|
|
2634
2648
|
console.error(error instanceof Error ? error.message : String(error));
|
|
2635
2649
|
}
|
|
2636
2650
|
return error instanceof _chunkDIAWYWT5js.DeeplineError && error.code === "IDEMPOTENCY_KEY_INVALID" ? 2 : 1;
|
|
2637
2651
|
}
|
|
2638
|
-
const cliInvocationId = _nullishCoalesce(
|
|
2652
|
+
const cliInvocationId = _nullishCoalesce(_chunk3LFSIUFIjs.getToolExecuteInvocationId.call(void 0, ), () => ( _chunk3LFSIUFIjs.beginToolExecuteCommand.call(void 0, )));
|
|
2639
2653
|
const deferredCompatibility = deferCompatibility ? beginDeferredToolExecuteCompatibility(toolId, cliInvocationId) : void 0;
|
|
2640
|
-
const tracing =
|
|
2654
|
+
const tracing = _chunkYHB6MASPjs.isCliTraceEnabled.call(void 0, );
|
|
2641
2655
|
const clientStartedAt = tracing ? performance.now() : void 0;
|
|
2642
|
-
const client = new (0,
|
|
2656
|
+
const client = new (0, _chunkPMJAGTSQjs.DeeplineClient)();
|
|
2643
2657
|
if (clientStartedAt !== void 0) {
|
|
2644
|
-
|
|
2658
|
+
_chunkYHB6MASPjs.recordCliTrace.call(void 0, {
|
|
2645
2659
|
phase: "cli.tool_execute_client_setup",
|
|
2646
2660
|
ms: performance.now() - clientStartedAt
|
|
2647
2661
|
});
|
|
@@ -2650,13 +2664,13 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2650
2664
|
const readMetadata = async () => {
|
|
2651
2665
|
if (metadata) return metadata;
|
|
2652
2666
|
try {
|
|
2653
|
-
metadata = await
|
|
2667
|
+
metadata = await _chunk3LFSIUFIjs.runToolExecuteStage.call(void 0,
|
|
2654
2668
|
"tool metadata lookup",
|
|
2655
2669
|
() => client.getTool(parsed.toolId, { cliInvocationId })
|
|
2656
2670
|
);
|
|
2657
2671
|
} catch (error) {
|
|
2658
2672
|
if (isMissingToolMetadataError(error)) {
|
|
2659
|
-
const play = await
|
|
2673
|
+
const play = await _chunk3LFSIUFIjs.runToolExecuteStage.call(void 0,
|
|
2660
2674
|
"play alias lookup",
|
|
2661
2675
|
() => findPlayForToolId(client, parsed.toolId, cliInvocationId)
|
|
2662
2676
|
);
|
|
@@ -2670,7 +2684,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2670
2684
|
}
|
|
2671
2685
|
throw error;
|
|
2672
2686
|
}
|
|
2673
|
-
if (
|
|
2687
|
+
if (_chunk4IOY2SCQjs.isPlayLikeTool.call(void 0, metadata)) {
|
|
2674
2688
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
2675
2689
|
playLikeToolExecuteErrorMessage(
|
|
2676
2690
|
parsed.toolId,
|
|
@@ -2695,7 +2709,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2695
2709
|
metadata = await readMetadata();
|
|
2696
2710
|
} catch (error) {
|
|
2697
2711
|
if (error instanceof _chunkDIAWYWT5js.DeeplineError && error.code === "PLAY_ALIAS_USED_AS_TOOL") {
|
|
2698
|
-
if (wantsJson)
|
|
2712
|
+
if (wantsJson) _chunkDD7E4ZVHjs.printJsonError.call(void 0, error);
|
|
2699
2713
|
else console.error(error.message);
|
|
2700
2714
|
return 2;
|
|
2701
2715
|
}
|
|
@@ -2711,7 +2725,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2711
2725
|
metadata = await readMetadata();
|
|
2712
2726
|
} catch (error) {
|
|
2713
2727
|
if (error instanceof _chunkDIAWYWT5js.DeeplineError && error.code === "PLAY_ALIAS_USED_AS_TOOL") {
|
|
2714
|
-
if (wantsJson)
|
|
2728
|
+
if (wantsJson) _chunkDD7E4ZVHjs.printJsonError.call(void 0, error);
|
|
2715
2729
|
else console.error(error.message);
|
|
2716
2730
|
return 2;
|
|
2717
2731
|
}
|
|
@@ -2737,11 +2751,11 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2737
2751
|
responseIntent,
|
|
2738
2752
|
...idempotencyKey ? { idempotencyKey } : {},
|
|
2739
2753
|
...parsed.recoveryTimeoutMs !== void 0 ? { recoveryTimeoutMs: parsed.recoveryTimeoutMs } : {},
|
|
2740
|
-
searchRef:
|
|
2754
|
+
searchRef: _chunkRVRG57OBjs.recentSearchRef.call(void 0, ),
|
|
2741
2755
|
cliInvocationId,
|
|
2742
|
-
onResponseReceived:
|
|
2756
|
+
onResponseReceived: _chunk3J2N7YF5js.recordApiResponse,
|
|
2743
2757
|
...tracing ? {
|
|
2744
|
-
onServerTiming: (serverTiming) =>
|
|
2758
|
+
onServerTiming: (serverTiming) => _chunkYHB6MASPjs.recordCliTrace.call(void 0, {
|
|
2745
2759
|
phase: "tool_execute_server_timing",
|
|
2746
2760
|
cliInvocationId,
|
|
2747
2761
|
serverTiming,
|
|
@@ -2752,13 +2766,13 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2752
2766
|
let rawResponse;
|
|
2753
2767
|
let successfulCompatibilityResponse;
|
|
2754
2768
|
try {
|
|
2755
|
-
const executeResult = await
|
|
2769
|
+
const executeResult = await _chunk3LFSIUFIjs.runToolExecuteStage.call(void 0,
|
|
2756
2770
|
"execute request",
|
|
2757
2771
|
async () => {
|
|
2758
2772
|
try {
|
|
2759
2773
|
if (tracing) {
|
|
2760
2774
|
submissionStartedAt = performance.now();
|
|
2761
|
-
|
|
2775
|
+
_chunkYHB6MASPjs.recordCliTrace.call(void 0, { phase: "cli.tool_execute_request_start" });
|
|
2762
2776
|
}
|
|
2763
2777
|
return await client.executeTool(parsed.toolId, parsed.params, {
|
|
2764
2778
|
...executeOptions,
|
|
@@ -2768,34 +2782,34 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2768
2782
|
} catch (error) {
|
|
2769
2783
|
if (!(error instanceof _chunkDIAWYWT5js.DeeplineError) || error.code !== "ATOMIC_TOOL_EXECUTE_UNSUPPORTED")
|
|
2770
2784
|
throw error;
|
|
2771
|
-
const baseUrl =
|
|
2785
|
+
const baseUrl = _chunkF4PUDYBYjs.resolveConfig.call(void 0, ).baseUrl;
|
|
2772
2786
|
if (maintenancePolicy !== "off") {
|
|
2773
|
-
|
|
2787
|
+
_chunkTUFQFTOCjs.flushDeferredSkillsSyncNotices.call(void 0, baseUrl);
|
|
2774
2788
|
}
|
|
2775
|
-
const compatibility = deferredCompatibility ? await deferredCompatibility.result : await
|
|
2789
|
+
const compatibility = deferredCompatibility ? await deferredCompatibility.result : await _chunk3LFSIUFIjs.runToolExecuteStage.call(void 0,
|
|
2776
2790
|
"SDK compatibility",
|
|
2777
|
-
() =>
|
|
2791
|
+
() => _chunkTUFQFTOCjs.checkSdkCompatibility.call(void 0, baseUrl, {
|
|
2778
2792
|
command: "tools execute",
|
|
2779
|
-
skillsVersion:
|
|
2793
|
+
skillsVersion: _chunkF4PUDYBYjs.readSdkSkillsLocalVersion.call(void 0, baseUrl),
|
|
2780
2794
|
persistCache: maintenancePolicy !== "off"
|
|
2781
2795
|
})
|
|
2782
2796
|
);
|
|
2783
2797
|
if (compatibility.error) throw compatibility.error;
|
|
2784
2798
|
metadata = _nullishCoalesce(_optionalChain([deferredCompatibility, 'optionalAccess', _43 => _43.readMetadata, 'call', _44 => _44()]), () => ( metadata));
|
|
2785
|
-
if (maintenancePolicy !== "off" && await
|
|
2799
|
+
if (maintenancePolicy !== "off" && await _chunk3LFSIUFIjs.maybeAutoUpdateAndRelaunch.call(void 0,
|
|
2786
2800
|
compatibility.response,
|
|
2787
2801
|
baseUrl,
|
|
2788
2802
|
maintenancePolicy
|
|
2789
2803
|
)) {
|
|
2790
2804
|
return void 0;
|
|
2791
2805
|
}
|
|
2792
|
-
|
|
2806
|
+
_chunkTUFQFTOCjs.enforceSdkCompatibilityResponse.call(void 0, compatibility.response, {
|
|
2793
2807
|
quietAdvisory: wantsJson
|
|
2794
2808
|
});
|
|
2795
2809
|
if (maintenancePolicy !== "off") {
|
|
2796
|
-
await
|
|
2810
|
+
await _chunk3LFSIUFIjs.runToolExecuteStage.call(void 0,
|
|
2797
2811
|
"agent skills sync",
|
|
2798
|
-
() =>
|
|
2812
|
+
() => _chunkTUFQFTOCjs.syncSdkSkillsIfNeeded.call(void 0, baseUrl, {
|
|
2799
2813
|
update: _optionalChain([compatibility, 'access', _45 => _45.response, 'optionalAccess', _46 => _46.skills]),
|
|
2800
2814
|
mode: "detached"
|
|
2801
2815
|
})
|
|
@@ -2804,7 +2818,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2804
2818
|
const legacyMetadata = await readMetadata();
|
|
2805
2819
|
if (tracing) {
|
|
2806
2820
|
submissionStartedAt = performance.now();
|
|
2807
|
-
|
|
2821
|
+
_chunkYHB6MASPjs.recordCliTrace.call(void 0, { phase: "cli.tool_execute_request_start" });
|
|
2808
2822
|
}
|
|
2809
2823
|
return client.executeTool(parsed.toolId, parsed.params, {
|
|
2810
2824
|
...executeOptions,
|
|
@@ -2825,8 +2839,8 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2825
2839
|
metadata = _nullishCoalesce(deferredCompatibility.readMetadata(), () => ( metadata));
|
|
2826
2840
|
const updateRequiredBeforeExecution = error instanceof _chunkDIAWYWT5js.DeeplineError && error.code === "SDK_UPDATE_REQUIRED";
|
|
2827
2841
|
if (updateRequiredBeforeExecution && maintenancePolicy !== "off" && compatibility && !compatibility.error) {
|
|
2828
|
-
const baseUrl =
|
|
2829
|
-
if (await
|
|
2842
|
+
const baseUrl = _chunkF4PUDYBYjs.resolveConfig.call(void 0, ).baseUrl;
|
|
2843
|
+
if (await _chunk3LFSIUFIjs.maybeAutoUpdateAndRelaunch.call(void 0,
|
|
2830
2844
|
compatibility.response,
|
|
2831
2845
|
baseUrl,
|
|
2832
2846
|
maintenancePolicy
|
|
@@ -2845,7 +2859,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2845
2859
|
failure = diagnosticError;
|
|
2846
2860
|
}
|
|
2847
2861
|
if (failure instanceof _chunkDIAWYWT5js.DeeplineError && failure.code === "PLAY_ALIAS_USED_AS_TOOL") {
|
|
2848
|
-
if (wantsJson)
|
|
2862
|
+
if (wantsJson) _chunkDD7E4ZVHjs.printJsonError.call(void 0, failure);
|
|
2849
2863
|
else console.error(failure.message);
|
|
2850
2864
|
return 2;
|
|
2851
2865
|
}
|
|
@@ -2872,9 +2886,9 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2872
2886
|
successfulCompatibilityResponse = _nullishCoalesce(compatibilityResponse, () => ( void 0));
|
|
2873
2887
|
const autoUpdate = _optionalChain([compatibilityResponse, 'optionalAccess', _52 => _52.auto_update]);
|
|
2874
2888
|
if (maintenancePolicy !== "off" && compatibilityResponse && _optionalChain([autoUpdate, 'optionalAccess', _53 => _53.should_auto_update]) && !autoUpdate.required && autoUpdate.reason !== "rollback_forced") {
|
|
2875
|
-
await
|
|
2889
|
+
await _chunk3LFSIUFIjs.maybeAutoUpdateAndRelaunch.call(void 0,
|
|
2876
2890
|
compatibilityResponse,
|
|
2877
|
-
|
|
2891
|
+
_chunkF4PUDYBYjs.resolveConfig.call(void 0, ).baseUrl,
|
|
2878
2892
|
maintenancePolicy
|
|
2879
2893
|
);
|
|
2880
2894
|
}
|
|
@@ -2892,8 +2906,8 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2892
2906
|
);
|
|
2893
2907
|
}
|
|
2894
2908
|
}
|
|
2895
|
-
const responseMetadata =
|
|
2896
|
-
|
|
2909
|
+
const responseMetadata = _chunk4IOY2SCQjs.recordField.call(void 0,
|
|
2910
|
+
_chunk4IOY2SCQjs.recordField.call(void 0, rawResponse, "_metadata"),
|
|
2897
2911
|
"tool"
|
|
2898
2912
|
);
|
|
2899
2913
|
const listOutputPaths = responseMetadata.listOutputPaths;
|
|
@@ -2905,11 +2919,11 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2905
2919
|
await readMetadata()
|
|
2906
2920
|
);
|
|
2907
2921
|
}
|
|
2908
|
-
if (
|
|
2922
|
+
if (_chunk4IOY2SCQjs.isRecord.call(void 0, rawResponse)) {
|
|
2909
2923
|
const { _metadata, ...execution } = rawResponse;
|
|
2910
2924
|
rawResponse = execution;
|
|
2911
2925
|
}
|
|
2912
|
-
const { listConversion, summary, baseEnvelope } = await
|
|
2926
|
+
const { listConversion, summary, baseEnvelope } = await _chunk3LFSIUFIjs.runToolExecuteStage.call(void 0,
|
|
2913
2927
|
"result formatting",
|
|
2914
2928
|
async () => {
|
|
2915
2929
|
const listConversion2 = _chunkHGFFYVXNjs.tryConvertToList.call(void 0, rawResponse, {
|
|
@@ -2944,9 +2958,9 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2944
2958
|
}
|
|
2945
2959
|
skillsSyncAttempted = true;
|
|
2946
2960
|
try {
|
|
2947
|
-
await
|
|
2961
|
+
await _chunk3LFSIUFIjs.runToolExecuteStage.call(void 0,
|
|
2948
2962
|
"agent skills sync",
|
|
2949
|
-
() =>
|
|
2963
|
+
() => _chunkTUFQFTOCjs.syncSdkSkillsIfNeeded.call(void 0, _chunkF4PUDYBYjs.resolveConfig.call(void 0, ).baseUrl, {
|
|
2950
2964
|
update: deliveredCompatibilityResponse.skills,
|
|
2951
2965
|
mode: "detached"
|
|
2952
2966
|
})
|
|
@@ -2957,15 +2971,15 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2957
2971
|
);
|
|
2958
2972
|
}
|
|
2959
2973
|
};
|
|
2960
|
-
const printDeliveredEnvelope = (envelope, options2 = {}) =>
|
|
2974
|
+
const printDeliveredEnvelope = (envelope, options2 = {}) => _chunkDD7E4ZVHjs.printCommandEnvelope.call(void 0, envelope, {
|
|
2961
2975
|
...options2,
|
|
2962
2976
|
json: _nullishCoalesce(options2.json, () => ( wantsJson))
|
|
2963
2977
|
});
|
|
2964
2978
|
const printDeliveredJsonEnvelope = async (envelope, options2 = {}) => {
|
|
2965
2979
|
await syncSkillsForDeliveredOutput();
|
|
2966
|
-
|
|
2980
|
+
_chunkDD7E4ZVHjs.printCommandEnvelope.call(void 0, envelope, { ...options2, json: true });
|
|
2967
2981
|
};
|
|
2968
|
-
const delivered = await
|
|
2982
|
+
const delivered = await _chunk3LFSIUFIjs.runToolExecuteStage.call(void 0, "output delivery", async () => {
|
|
2969
2983
|
if (!parsed.outPath && (parsed.outputFormat === "json" || parsed.outputFormat === "auto" && wantsJson)) {
|
|
2970
2984
|
await printDeliveredJsonEnvelope(baseEnvelope);
|
|
2971
2985
|
return true;
|
|
@@ -2978,7 +2992,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2978
2992
|
await printDeliveredJsonEnvelope({
|
|
2979
2993
|
...baseEnvelope,
|
|
2980
2994
|
local: {
|
|
2981
|
-
...
|
|
2995
|
+
..._chunk4IOY2SCQjs.isRecord.call(void 0, baseEnvelope.local) ? baseEnvelope.local : {},
|
|
2982
2996
|
payload_file: jsonPath
|
|
2983
2997
|
}
|
|
2984
2998
|
});
|
|
@@ -2994,7 +3008,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2994
3008
|
`${parsed.toolId} did not expose row-shaped output to write as CSV. ${inspection.inspectDescription} Run: ${inspection.inspect}`
|
|
2995
3009
|
);
|
|
2996
3010
|
if (wantsJson) {
|
|
2997
|
-
|
|
3011
|
+
_chunkDD7E4ZVHjs.printJsonError.call(void 0, error);
|
|
2998
3012
|
} else {
|
|
2999
3013
|
console.error(error.message);
|
|
3000
3014
|
}
|
|
@@ -3089,13 +3103,13 @@ inspect: ${inspection.inspect}
|
|
|
3089
3103
|
return true;
|
|
3090
3104
|
});
|
|
3091
3105
|
if (delivered) {
|
|
3092
|
-
await
|
|
3106
|
+
await _chunk3LFSIUFIjs.runToolExecuteStage.call(void 0,
|
|
3093
3107
|
"acknowledge delivery",
|
|
3094
3108
|
() => recovery.acknowledgeDelivery()
|
|
3095
3109
|
);
|
|
3096
3110
|
}
|
|
3097
3111
|
if (delivered && deliveredCompatibilityResponse && deliveredCompatibilityResponse.update_required !== true) {
|
|
3098
|
-
|
|
3112
|
+
_chunkTUFQFTOCjs.enforceSdkCompatibilityResponse.call(void 0, deliveredCompatibilityResponse, {
|
|
3099
3113
|
quietAdvisory: wantsJson || maintenancePolicy === "off" || _optionalChain([deliveredCompatibilityResponse, 'access', _55 => _55.auto_update, 'optionalAccess', _56 => _56.should_auto_update]) === true
|
|
3100
3114
|
});
|
|
3101
3115
|
}
|