deepline 0.3.402 → 0.3.404
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 +14 -2
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +7 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +114 -50
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +6 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +379 -133
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +2 -1
- package/dist/cli/{auth-GJGFHAUP.mjs → auth-DVJWHHC3.mjs} +4 -4
- package/dist/cli/auth-UIC53AE2.js +40 -0
- package/dist/cli/{billing-7YYI5OFD.mjs → billing-7UDFOLCT.mjs} +4 -4
- package/dist/cli/{billing-UBBNYU74.js → billing-MHS6WS77.js} +73 -73
- package/dist/cli/{chunk-3HWALOL2.mjs → chunk-6BJK4EJ3.mjs} +1 -1
- package/dist/cli/{chunk-5Z7SAD3Q.js → chunk-7CFSSEN3.js} +207 -207
- package/dist/cli/{chunk-TWZEHT5L.mjs → chunk-ANL3NJV5.mjs} +7 -7
- package/dist/cli/{chunk-65YHUBYZ.js → chunk-AYUR2RZ6.js} +8 -8
- package/dist/cli/{chunk-MSS6UHGK.js → chunk-B2BO6G7L.js} +26 -26
- package/dist/cli/{chunk-YHZUZO3U.mjs → chunk-BZAMOCPA.mjs} +1 -1
- package/dist/cli/{chunk-LQS5XUFL.js → chunk-CBMYUXAT.js} +6 -6
- package/dist/cli/{chunk-3HU47EGZ.mjs → chunk-CLJGSOVM.mjs} +2 -1
- package/dist/cli/{chunk-Q77JWGMZ.mjs → chunk-DSXMTZ64.mjs} +1 -1
- package/dist/cli/{chunk-RLL23M7M.mjs → chunk-EDSBH6W7.mjs} +2 -2
- package/dist/cli/{chunk-7DRPTGCK.js → chunk-FERRDNMO.js} +4 -4
- package/dist/cli/{chunk-Z7MNFHHE.mjs → chunk-FF2H4YLR.mjs} +4 -4
- package/dist/cli/{chunk-JHFX74T6.js → chunk-GPWTKORH.js} +4 -4
- package/dist/cli/{chunk-RFG3MRAC.js → chunk-ILHRA7AD.js} +5 -5
- package/dist/cli/{chunk-V4TFEZ47.mjs → chunk-JJZOGHEF.mjs} +1 -1
- package/dist/cli/{chunk-QPIAVCCS.mjs → chunk-KTWTQPYM.mjs} +2 -2
- package/dist/cli/{chunk-B2FAQ3AX.js → chunk-L3JGXPGB.js} +50 -50
- package/dist/cli/{chunk-TPPHH3FS.mjs → chunk-M55M5LDV.mjs} +3 -3
- package/dist/cli/{chunk-NMPFKSZN.mjs → chunk-NRI4TJVF.mjs} +1 -1
- package/dist/cli/{chunk-CIOMFOJJ.js → chunk-ODKHUBU3.js} +6 -6
- package/dist/cli/{chunk-JT7XZP4U.mjs → chunk-OHGXSFDQ.mjs} +1 -1
- package/dist/cli/{chunk-CBPK2TLC.js → chunk-OPGILU75.js} +65 -65
- package/dist/cli/{chunk-HFYQBC2D.mjs → chunk-PMVFAYL7.mjs} +1 -1
- package/dist/cli/{chunk-MH73HMPV.js → chunk-SEFMGO3Z.js} +3 -3
- package/dist/cli/{chunk-OPS5KQVF.mjs → chunk-TFIB4VNU.mjs} +2 -2
- package/dist/cli/{chunk-IK7J2DE5.js → chunk-URQAM7RR.js} +1 -1
- package/dist/cli/{chunk-L5UOVDJV.js → chunk-V5DPHNTE.js} +2 -2
- package/dist/cli/{chunk-OIUXHL7G.mjs → chunk-VPCIT5N6.mjs} +3 -3
- package/dist/cli/{chunk-ZOKF4F65.js → chunk-W3SACRLJ.js} +8 -8
- package/dist/cli/{chunk-4EWCKDFC.mjs → chunk-XKVJZ5JC.mjs} +1 -1
- package/dist/cli/{chunk-VHZOTHAD.js → chunk-Y5QWK7SS.js} +15 -15
- package/dist/cli/{chunk-KB4SDX5S.js → chunk-Z4VNJOF7.js} +2 -1
- package/dist/cli/{csv-V6JDZEWY.js → csv-7BXOAC3V.js} +12 -12
- package/dist/cli/{csv-USUSIYER.mjs → csv-TG7SSGXW.mjs} +3 -3
- package/dist/cli/{db-HRWKCFXF.js → db-BQCWAL3D.js} +25 -25
- package/dist/cli/{db-F5GMBQ65.mjs → db-GBVIPT7D.mjs} +4 -4
- package/dist/cli/{describe-R6KMEHL5.js → describe-3ROS6TC6.js} +15 -15
- package/dist/cli/{describe-S5O6FVT3.mjs → describe-6LP2CWEF.mjs} +9 -9
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/describe-core.js +4 -4
- package/dist/cli/describe-core.mjs +3 -3
- package/dist/cli/{executions-YPZREEMY.mjs → executions-4TJOBZOQ.mjs} +4 -4
- package/dist/cli/{executions-PZIPKQBP.js → executions-KCKC2KKP.js} +6 -6
- package/dist/cli/{feedback-VDJR5X3J.js → feedback-7T77UCIV.js} +7 -7
- package/dist/cli/{feedback-BTETOM6H.mjs → feedback-CGJNFV3G.mjs} +3 -3
- package/dist/cli/{git-INUECEXT.mjs → git-5E3HETBN.mjs} +4 -4
- package/dist/cli/git-DRUSBG74.js +24 -0
- package/dist/cli/index.js +89 -89
- package/dist/cli/index.mjs +32 -32
- package/dist/cli/{legacy-noops-MDN77QAS.mjs → legacy-noops-4FGVQLLD.mjs} +4 -4
- package/dist/cli/{legacy-noops-45WQXPUD.js → legacy-noops-X5MCVE34.js} +7 -7
- package/dist/cli/{monitors-BMQEIYV6.js → monitors-OTAQWJH5.js} +84 -84
- package/dist/cli/{monitors-4BTZGTJW.mjs → monitors-QRZEIITA.mjs} +4 -4
- package/dist/cli/{org-6YNJ7VNJ.mjs → org-A6KANSFR.mjs} +4 -4
- package/dist/cli/{org-GTZDYRD3.js → org-B3JK2BND.js} +64 -64
- package/dist/cli/{play-GGQBJQG4.mjs → play-CN6DOFMT.mjs} +9 -9
- package/dist/cli/{play-BDIBVDSU.js → play-HLDZVD47.js} +249 -249
- package/dist/cli/{providers-6EYFXCHM.mjs → providers-EVPLX6BG.mjs} +4 -4
- package/dist/cli/{providers-AFQ6FQWQ.js → providers-XGCTTZ7T.js} +7 -7
- package/dist/cli/{quickstart-FIK5TO73.mjs → quickstart-HXORYMNO.mjs} +3 -3
- package/dist/cli/{quickstart-PUXYA3QD.js → quickstart-LTH2MZNQ.js} +5 -5
- package/dist/cli/search-MH6VAITK.js +30 -0
- package/dist/cli/{search-UTPRENV4.mjs → search-S4JOGJMH.mjs} +5 -5
- package/dist/cli/{secrets-FMM4RFK2.js → secrets-JV3TPKE6.js} +13 -13
- package/dist/cli/{secrets-R2RJ2J7Z.mjs → secrets-VNHUBHLN.mjs} +4 -4
- package/dist/cli/{sessions-HA2B7AYB.mjs → sessions-CDBTN53U.mjs} +4 -4
- package/dist/cli/{sessions-ZRXUQIVV.js → sessions-QYYFCXGY.js} +5 -5
- package/dist/cli/{settings-HPGNP7UU.mjs → settings-I6LQQCMK.mjs} +7 -7
- package/dist/cli/{settings-KKHOBBKF.js → settings-YYZ2IHFU.js} +74 -74
- package/dist/cli/{setup-FTSDFQOK.js → setup-IZQI5RZA.js} +41 -41
- package/dist/cli/{setup-WERVZIIX.mjs → setup-X24RP6O7.mjs} +6 -6
- package/dist/cli/skills-U4MIVNPW.js +29 -0
- package/dist/cli/{skills-D4BGGD5D.mjs → skills-UYIFSY2Y.mjs} +4 -4
- package/dist/cli/tools-BLP2VRAN.js +39 -0
- package/dist/cli/{tools-TKQW72OL.mjs → tools-IR5JEQF6.mjs} +8 -8
- package/dist/cli/update-EIYE45GT.js +29 -0
- package/dist/cli/{update-O77BPQAE.mjs → update-MXFLD3ZQ.mjs} +6 -6
- package/dist/cli/{workflow-GIDAYVSL.js → workflow-CZ6CXXOL.js} +15 -15
- package/dist/cli/{workflow-IJCMSPGJ.mjs → workflow-QGY342J5.mjs} +5 -5
- package/dist/{client-D0j-_aaa.d.mts → client-Buv1_ktG.d.mts} +4 -2
- package/dist/{client-DflfVyj6.d.ts → client-Db1jFLpF.d.ts} +4 -2
- package/dist/{compiler-manifest-DLxUY5kI.d.ts → compiler-manifest-N77W75Py.d.mts} +10 -6
- package/dist/{compiler-manifest-DLxUY5kI.d.mts → compiler-manifest-N77W75Py.d.ts} +10 -6
- package/dist/{index-SCb0NvDb.d.mts → index-3WOfyVhW.d.mts} +1 -1
- package/dist/{index-B_GM9E3q.d.ts → index-CtIJFTCl.d.ts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -7
- package/dist/index.mjs +4 -4
- package/dist/install-integrity.json +84 -84
- 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/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- 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/package.json +1 -1
- package/dist/cli/auth-CF34E66T.js +0 -40
- package/dist/cli/git-B5DP75FD.js +0 -24
- package/dist/cli/search-64GE26YS.js +0 -30
- package/dist/cli/skills-O7HGWWGF.js +0 -29
- package/dist/cli/tools-EKVHV35B.js +0 -39
- package/dist/cli/update-5CP72TRU.js +0 -29
|
@@ -5,7 +5,7 @@ var _chunkZAAKSJASjs = require('./chunk-ZAAKSJAS.js');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkW3SACRLJjs = require('./chunk-W3SACRLJ.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -24,7 +24,7 @@ var _chunkZOKF4F65js = require('./chunk-ZOKF4F65.js');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkFERRDNMOjs = require('./chunk-FERRDNMO.js');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
|
|
@@ -41,11 +41,11 @@ var _chunkZM2YPJQJjs = require('./chunk-ZM2YPJQJ.js');
|
|
|
41
41
|
var _chunkHGFFYVXNjs = require('./chunk-HGFFYVXN.js');
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _chunkZ4VNJOF7js = require('./chunk-Z4VNJOF7.js');
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkCBMYUXATjs = require('./chunk-CBMYUXAT.js');
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
var _chunkXDVT3GOMjs = require('./chunk-XDVT3GOM.js');
|
|
@@ -62,11 +62,11 @@ var _chunkQJBJZVG6js = require('./chunk-QJBJZVG6.js');
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var _chunkODKHUBU3js = require('./chunk-ODKHUBU3.js');
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
var
|
|
69
|
+
var _chunkGPWTKORHjs = require('./chunk-GPWTKORH.js');
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
@@ -145,10 +145,10 @@ var ToolCallRecovery = class _ToolCallRecovery {
|
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
147
|
function pendingToolExecutionPath(input) {
|
|
148
|
-
const config =
|
|
148
|
+
const config = _chunkGPWTKORHjs.resolveConfig.call(void 0, );
|
|
149
149
|
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");
|
|
150
150
|
return _path.join.call(void 0,
|
|
151
|
-
|
|
151
|
+
_chunkGPWTKORHjs.sdkCliStateDirPath.call(void 0, config.baseUrl),
|
|
152
152
|
`pending-tool-execution-${fingerprint}.json`
|
|
153
153
|
);
|
|
154
154
|
}
|
|
@@ -256,13 +256,13 @@ var TOOL_COMMAND_TEMPLATES = {
|
|
|
256
256
|
execute: "deepline tools execute <toolId> --input '{...}'"
|
|
257
257
|
};
|
|
258
258
|
function toListedTool(tool) {
|
|
259
|
-
if (
|
|
259
|
+
if (_chunkFERRDNMOjs.isPlayLikeTool.call(void 0, tool)) {
|
|
260
260
|
return {
|
|
261
261
|
...tool,
|
|
262
262
|
description: listedToolDescription(tool),
|
|
263
263
|
id: tool.toolId,
|
|
264
264
|
type: "play",
|
|
265
|
-
executeCommand:
|
|
265
|
+
executeCommand: _chunkFERRDNMOjs.playRunCommandForTool.call(void 0, tool, tool.toolId)
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
268
|
return {
|
|
@@ -363,16 +363,16 @@ function firstSentence(text) {
|
|
|
363
363
|
return (match ? match[0] : clean).trim();
|
|
364
364
|
}
|
|
365
365
|
function requiredInputIds(tool) {
|
|
366
|
-
const inputSchema =
|
|
366
|
+
const inputSchema = _chunkFERRDNMOjs.recordField.call(void 0,
|
|
367
367
|
tool,
|
|
368
368
|
"inputSchema",
|
|
369
369
|
"input_schema"
|
|
370
370
|
);
|
|
371
|
-
return
|
|
371
|
+
return _chunkFERRDNMOjs.toolInputFieldsForDisplay.call(void 0, inputSchema).filter((field) => field.required === true).map((field) => String(_nullishCoalesce(field.name, () => ( "")))).filter(Boolean);
|
|
372
372
|
}
|
|
373
373
|
function notConnectedSuffix(tool) {
|
|
374
374
|
const record = tool;
|
|
375
|
-
const status =
|
|
375
|
+
const status = _chunkFERRDNMOjs.stringField.call(void 0, record, "credentialStatus", "credential_status");
|
|
376
376
|
const connected = record.connected;
|
|
377
377
|
const message = toolConnectionStatusMessage({
|
|
378
378
|
connected: connected === false ? false : void 0,
|
|
@@ -381,18 +381,18 @@ function notConnectedSuffix(tool) {
|
|
|
381
381
|
return message ? ` - \u26A0 ${message}` : "";
|
|
382
382
|
}
|
|
383
383
|
function shortPricingHint(tool) {
|
|
384
|
-
const pricing =
|
|
384
|
+
const pricing = _chunkFERRDNMOjs.recordField.call(void 0,
|
|
385
385
|
tool,
|
|
386
386
|
"pricing"
|
|
387
387
|
);
|
|
388
388
|
const credits = numberField(pricing, "creditsPerUnit", "credits_per_unit");
|
|
389
|
-
const unit =
|
|
389
|
+
const unit = _chunkFERRDNMOjs.stringField.call(void 0, pricing, "unit");
|
|
390
390
|
if (credits !== null) {
|
|
391
391
|
return `${formatDecimal(credits)} cr/${unit || "unit"}`;
|
|
392
392
|
}
|
|
393
|
-
const summary =
|
|
393
|
+
const summary = _chunkFERRDNMOjs.stringField.call(void 0, pricing, "summary");
|
|
394
394
|
if (summary) return summary;
|
|
395
|
-
const displayText =
|
|
395
|
+
const displayText = _chunkFERRDNMOjs.stringField.call(void 0, pricing, "displayText", "display_text");
|
|
396
396
|
return displayText || null;
|
|
397
397
|
}
|
|
398
398
|
function aggregateCategorySummaries(tools) {
|
|
@@ -436,12 +436,12 @@ function categoryEnumerationRender(summaries) {
|
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
438
|
async function listToolCategories(emitJson, compact) {
|
|
439
|
-
const client = new (0,
|
|
439
|
+
const client = new (0, _chunkCBMYUXATjs.DeeplineClient)();
|
|
440
440
|
const rawTools = await client.listTools({ compact });
|
|
441
441
|
const items = rawTools.map(toListedTool);
|
|
442
442
|
const summaries = aggregateCategorySummaries(rawTools);
|
|
443
443
|
const outputItems = compact ? items.map(compactTool) : items;
|
|
444
|
-
|
|
444
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0,
|
|
445
445
|
{
|
|
446
446
|
tools: outputItems,
|
|
447
447
|
count: outputItems.length,
|
|
@@ -460,7 +460,7 @@ function unknownCategoryError(category, summaries, emitJson) {
|
|
|
460
460
|
const known = summaries.map((item) => item.name);
|
|
461
461
|
const message = `Unknown tool category "${category}". Run \`deepline tools list\` to browse categories.`;
|
|
462
462
|
if (emitJson) {
|
|
463
|
-
|
|
463
|
+
_chunkODKHUBU3js.printJson.call(void 0, {
|
|
464
464
|
ok: false,
|
|
465
465
|
exitCode: 4,
|
|
466
466
|
code: "TOOL_CATEGORY_NOT_FOUND",
|
|
@@ -474,13 +474,13 @@ function unknownCategoryError(category, summaries, emitJson) {
|
|
|
474
474
|
const render = categoryEnumerationRender(summaries);
|
|
475
475
|
console.error(message);
|
|
476
476
|
console.error("");
|
|
477
|
-
console.error(
|
|
477
|
+
console.error(_chunkODKHUBU3js.renderCommandEnvelopeText.call(void 0, { render }).trimEnd());
|
|
478
478
|
console.error("");
|
|
479
479
|
console.error(`Valid categories: ${known.join(", ")}`);
|
|
480
480
|
return 4;
|
|
481
481
|
}
|
|
482
482
|
async function listToolsInCategory(category, emitJson) {
|
|
483
|
-
const client = new (0,
|
|
483
|
+
const client = new (0, _chunkCBMYUXATjs.DeeplineClient)();
|
|
484
484
|
const rawTools = await client.listTools({
|
|
485
485
|
categories: category,
|
|
486
486
|
compact: false
|
|
@@ -517,7 +517,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
517
517
|
}
|
|
518
518
|
]
|
|
519
519
|
};
|
|
520
|
-
|
|
520
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0,
|
|
521
521
|
{
|
|
522
522
|
category,
|
|
523
523
|
total: rows.length,
|
|
@@ -530,7 +530,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
530
530
|
return 0;
|
|
531
531
|
}
|
|
532
532
|
async function listToolsForCategoryFilter(requestedCategories, emitJson, compact) {
|
|
533
|
-
const client = new (0,
|
|
533
|
+
const client = new (0, _chunkCBMYUXATjs.DeeplineClient)();
|
|
534
534
|
const items = (await client.listTools({
|
|
535
535
|
categories: requestedCategories.join(","),
|
|
536
536
|
compact
|
|
@@ -559,7 +559,7 @@ async function listToolsForCategoryFilter(requestedCategories, emitJson, compact
|
|
|
559
559
|
]
|
|
560
560
|
};
|
|
561
561
|
const outputItems = compact ? items.map(compactTool) : items;
|
|
562
|
-
|
|
562
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0,
|
|
563
563
|
{
|
|
564
564
|
tools: outputItems,
|
|
565
565
|
count: outputItems.length,
|
|
@@ -578,13 +578,13 @@ async function listTools(category, options = {}) {
|
|
|
578
578
|
const positional = _nullishCoalesce(_optionalChain([category, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()]), () => ( ""));
|
|
579
579
|
const flagCategories = (_nullishCoalesce(options.categories, () => ( ""))).split(",").map((item) => item.trim()).filter(Boolean);
|
|
580
580
|
const compact = options.compact !== false;
|
|
581
|
-
const emitJson = options.json === true ||
|
|
581
|
+
const emitJson = options.json === true || _chunkODKHUBU3js.shouldEmitJson.call(void 0, );
|
|
582
582
|
if (positional && flagCategories.length > 0) {
|
|
583
583
|
const flagIsSameSingle = flagCategories.length === 1 && flagCategories[0] === positional;
|
|
584
584
|
if (!flagIsSameSingle) {
|
|
585
585
|
const message = `Category "${positional}" and --categories ${flagCategories.join(",")} disagree. Pass one: deepline tools list ${positional}`;
|
|
586
586
|
if (emitJson) {
|
|
587
|
-
|
|
587
|
+
_chunkODKHUBU3js.printJson.call(void 0, {
|
|
588
588
|
ok: false,
|
|
589
589
|
exitCode: 2,
|
|
590
590
|
code: "TOOL_LIST_CATEGORY_CONFLICT",
|
|
@@ -611,7 +611,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
611
611
|
console.error("Usage: deepline tools grep <query> [--json]");
|
|
612
612
|
return 1;
|
|
613
613
|
}
|
|
614
|
-
const client = new (0,
|
|
614
|
+
const client = new (0, _chunkCBMYUXATjs.DeeplineClient)();
|
|
615
615
|
const requestedCategories = options.categories ? options.categories.split(",").map((item) => item.trim()).filter(Boolean) : [];
|
|
616
616
|
const mode = _nullishCoalesce(options.mode, () => ( "all"));
|
|
617
617
|
const jsonOutput = options.json === true;
|
|
@@ -654,7 +654,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
654
654
|
query,
|
|
655
655
|
mode
|
|
656
656
|
}) : null;
|
|
657
|
-
|
|
657
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0,
|
|
658
658
|
{
|
|
659
659
|
tools: outputTools,
|
|
660
660
|
count: outputTools.length,
|
|
@@ -672,7 +672,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
672
672
|
} : {},
|
|
673
673
|
commandTemplates: TOOL_COMMAND_TEMPLATES
|
|
674
674
|
},
|
|
675
|
-
{ json: options.json ||
|
|
675
|
+
{ json: options.json || _chunkODKHUBU3js.shouldEmitJson.call(void 0, ) }
|
|
676
676
|
);
|
|
677
677
|
return 0;
|
|
678
678
|
}
|
|
@@ -725,8 +725,8 @@ function printPlayAliasToolError(toolId, play) {
|
|
|
725
725
|
console.error(playAliasToolErrorMessage(toolId, play));
|
|
726
726
|
}
|
|
727
727
|
function playLikeToolExecuteErrorMessage(toolId, tool) {
|
|
728
|
-
const playReference = tool ?
|
|
729
|
-
const nextStep = playReference ? `Use: deepline plays run ${playReference} --input '{...}'` : `Find the maintained workflow with: ${
|
|
728
|
+
const playReference = tool ? _chunkFERRDNMOjs.playReferenceForTool.call(void 0, tool) : null;
|
|
729
|
+
const nextStep = playReference ? `Use: deepline plays run ${playReference} --input '{...}'` : `Find the maintained workflow with: ${_chunkFERRDNMOjs.playSearchCommandForToolId.call(void 0, toolId)}`;
|
|
730
730
|
return [
|
|
731
731
|
`${toolId} is a workflow/play entry, not an atomic provider tool.`,
|
|
732
732
|
nextStep,
|
|
@@ -790,7 +790,7 @@ Output:
|
|
|
790
790
|
"--credentials-file must contain a nonempty JSON object of string credential values."
|
|
791
791
|
);
|
|
792
792
|
}
|
|
793
|
-
const result = await new (0,
|
|
793
|
+
const result = await new (0, _chunkCBMYUXATjs.DeeplineClient)().setIntegrationCredentials(
|
|
794
794
|
provider,
|
|
795
795
|
credentials
|
|
796
796
|
);
|
|
@@ -800,7 +800,7 @@ Output:
|
|
|
800
800
|
);
|
|
801
801
|
}
|
|
802
802
|
const confirmation = { provider, credential_saved: true };
|
|
803
|
-
if (
|
|
803
|
+
if (_chunkODKHUBU3js.shouldEmitJson.call(void 0, options.json))
|
|
804
804
|
console.log(JSON.stringify(confirmation));
|
|
805
805
|
else
|
|
806
806
|
console.log(
|
|
@@ -840,7 +840,7 @@ Examples:
|
|
|
840
840
|
json: Boolean(options.json)
|
|
841
841
|
});
|
|
842
842
|
});
|
|
843
|
-
|
|
843
|
+
_chunkW3SACRLJjs.registerDeprecatedSearchCommand.call(void 0, tools, () => ["tools", "monitors"]);
|
|
844
844
|
tools.command("grep <query>").description(
|
|
845
845
|
"Literal grep over tool ids, descriptions, categories, and input fields."
|
|
846
846
|
).addHelpText(
|
|
@@ -941,7 +941,7 @@ Examples:
|
|
|
941
941
|
process.exitCode = await narrowView();
|
|
942
942
|
return;
|
|
943
943
|
}
|
|
944
|
-
const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-
|
|
944
|
+
const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-3ROS6TC6.js")));
|
|
945
945
|
process.exitCode = await describeAnything(
|
|
946
946
|
toolId,
|
|
947
947
|
{
|
|
@@ -1027,7 +1027,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1027
1027
|
console.error("Usage: deepline tools describe <toolId> [--json]");
|
|
1028
1028
|
return 1;
|
|
1029
1029
|
}
|
|
1030
|
-
const client = new (0,
|
|
1030
|
+
const client = new (0, _chunkCBMYUXATjs.DeeplineClient)();
|
|
1031
1031
|
let tool;
|
|
1032
1032
|
try {
|
|
1033
1033
|
tool = await _asyncNullishCoalesce(compatibilityMetadata, async () => ( await client.getTool(toolId)));
|
|
@@ -1081,12 +1081,12 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1081
1081
|
const lines = toolPricingOnlyLines(tool, toolId);
|
|
1082
1082
|
if (inferenceQuote)
|
|
1083
1083
|
lines.push(...inferenceQuoteSummaryLines(inferenceQuote));
|
|
1084
|
-
|
|
1084
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0,
|
|
1085
1085
|
{
|
|
1086
1086
|
toolId: String(tool.toolId || toolId),
|
|
1087
1087
|
cost: _chunkZM2YPJQJjs.Capability.fromCatalogEntry(tool).describe().customerCost(),
|
|
1088
1088
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1089
|
-
...
|
|
1089
|
+
..._chunkFERRDNMOjs.isMonitorTypeTool.call(void 0, tool) ? { pricing: _chunkFERRDNMOjs.recordField.call(void 0, tool, "pricing") } : {},
|
|
1090
1090
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
1091
1091
|
},
|
|
1092
1092
|
{
|
|
@@ -1097,14 +1097,14 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1097
1097
|
);
|
|
1098
1098
|
return 0;
|
|
1099
1099
|
}
|
|
1100
|
-
if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !
|
|
1101
|
-
const contract =
|
|
1100
|
+
if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !_chunkFERRDNMOjs.isMonitorTypeTool.call(void 0, tool) && !_chunkFERRDNMOjs.isPlayLikeTool.call(void 0, tool) && (options.json || options.contractJson)) {
|
|
1101
|
+
const contract = _chunkFERRDNMOjs.toolContractJsonForDescribe.call(void 0,
|
|
1102
1102
|
tool,
|
|
1103
1103
|
toolId,
|
|
1104
1104
|
void 0,
|
|
1105
1105
|
seedToolListScript
|
|
1106
1106
|
);
|
|
1107
|
-
|
|
1107
|
+
_chunkODKHUBU3js.printCompactJson.call(void 0, {
|
|
1108
1108
|
toolId: contract.toolId,
|
|
1109
1109
|
...options.schemaOnly ? {
|
|
1110
1110
|
inputSchema: contract.inputSchema,
|
|
@@ -1127,8 +1127,8 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1127
1127
|
return 0;
|
|
1128
1128
|
}
|
|
1129
1129
|
if (options.contractJson) {
|
|
1130
|
-
|
|
1131
|
-
...
|
|
1130
|
+
_chunkODKHUBU3js.printCompactJson.call(void 0, {
|
|
1131
|
+
..._chunkFERRDNMOjs.toolContractJsonForDescribe.call(void 0,
|
|
1132
1132
|
tool,
|
|
1133
1133
|
toolId,
|
|
1134
1134
|
void 0,
|
|
@@ -1141,8 +1141,8 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
const emitJson = options.json === true;
|
|
1143
1143
|
if (emitJson) {
|
|
1144
|
-
|
|
1145
|
-
...
|
|
1144
|
+
_chunkODKHUBU3js.printCompactJson.call(void 0, {
|
|
1145
|
+
..._chunkFERRDNMOjs.toolMetadataJsonForDescribe.call(void 0, tool, toolId, seedToolListScript),
|
|
1146
1146
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1147
1147
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
1148
1148
|
});
|
|
@@ -1167,7 +1167,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1167
1167
|
printCompactToolContract(tool, toolId);
|
|
1168
1168
|
if (modelDescription) {
|
|
1169
1169
|
process.stdout.write(`
|
|
1170
|
-
${
|
|
1170
|
+
${_chunkFERRDNMOjs.formatModelDescription.call(void 0, modelDescription)}`);
|
|
1171
1171
|
}
|
|
1172
1172
|
if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
|
|
1173
1173
|
return 0;
|
|
@@ -1175,7 +1175,7 @@ ${_chunk7DRPTGCKjs.formatModelDescription.call(void 0, modelDescription)}`);
|
|
|
1175
1175
|
printCompactToolContract(tool, toolId);
|
|
1176
1176
|
if (modelDescription) {
|
|
1177
1177
|
process.stdout.write(`
|
|
1178
|
-
${
|
|
1178
|
+
${_chunkFERRDNMOjs.formatModelDescription.call(void 0, modelDescription)}`);
|
|
1179
1179
|
}
|
|
1180
1180
|
if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
|
|
1181
1181
|
return 0;
|
|
@@ -1192,10 +1192,10 @@ function printInferenceQuoteSummary(quote) {
|
|
|
1192
1192
|
for (const line of inferenceQuoteSummaryLines(quote)) console.log(line);
|
|
1193
1193
|
}
|
|
1194
1194
|
function printMonitorTypeFilters(tool) {
|
|
1195
|
-
const schema =
|
|
1196
|
-
const properties =
|
|
1195
|
+
const schema = _chunkFERRDNMOjs.recordField.call(void 0, tool, "payload_schema", "payloadSchema");
|
|
1196
|
+
const properties = _chunkFERRDNMOjs.recordField.call(void 0, schema, "properties");
|
|
1197
1197
|
const required = new Set(
|
|
1198
|
-
|
|
1198
|
+
_chunkFERRDNMOjs.arrayField.call(void 0, schema, "required").filter(
|
|
1199
1199
|
(v) => typeof v === "string"
|
|
1200
1200
|
)
|
|
1201
1201
|
);
|
|
@@ -1206,24 +1206,24 @@ function printMonitorTypeFilters(tool) {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
console.log("Deploy filters (set in the monitor payload):");
|
|
1208
1208
|
for (const name of names) {
|
|
1209
|
-
const field =
|
|
1209
|
+
const field = _chunkFERRDNMOjs.isRecord.call(void 0, properties[name]) ? properties[name] : {};
|
|
1210
1210
|
const star = required.has(name) ? "*" : "";
|
|
1211
|
-
const enumVals =
|
|
1211
|
+
const enumVals = _chunkFERRDNMOjs.arrayField.call(void 0, field, "enum").filter(
|
|
1212
1212
|
(v) => typeof v === "string"
|
|
1213
1213
|
);
|
|
1214
|
-
const type = enumVals.length ? `one of [${enumVals.join(", ")}]` :
|
|
1215
|
-
const desc =
|
|
1214
|
+
const type = enumVals.length ? `one of [${enumVals.join(", ")}]` : _chunkFERRDNMOjs.stringField.call(void 0, field, "type") || "string";
|
|
1215
|
+
const desc = _chunkFERRDNMOjs.stringField.call(void 0, field, "description");
|
|
1216
1216
|
console.log(`- ${name}${star}: ${type}${desc ? ` - ${desc}` : ""}`);
|
|
1217
1217
|
}
|
|
1218
1218
|
}
|
|
1219
1219
|
function printMonitorTypeFilterExamples(tool) {
|
|
1220
|
-
const documentation =
|
|
1221
|
-
const fields =
|
|
1220
|
+
const documentation = _chunkFERRDNMOjs.recordField.call(void 0, tool, "documentation");
|
|
1221
|
+
const fields = _chunkFERRDNMOjs.recordField.call(void 0, documentation, "fields");
|
|
1222
1222
|
const examples = Object.entries(fields).flatMap(([name, rawField]) => {
|
|
1223
|
-
const grammar =
|
|
1224
|
-
const example =
|
|
1223
|
+
const grammar = _chunkFERRDNMOjs.recordField.call(void 0, _chunkFERRDNMOjs.isRecord.call(void 0, rawField) ? rawField : {}, "grammar");
|
|
1224
|
+
const example = _chunkFERRDNMOjs.stringField.call(void 0, grammar, "example");
|
|
1225
1225
|
const values = [
|
|
1226
|
-
...
|
|
1226
|
+
..._chunkFERRDNMOjs.arrayField.call(void 0, grammar, "examples").filter(
|
|
1227
1227
|
(value) => typeof value === "string" && Boolean(value)
|
|
1228
1228
|
),
|
|
1229
1229
|
...example ? [example] : []
|
|
@@ -1238,21 +1238,21 @@ function printMonitorTypeFilterExamples(tool) {
|
|
|
1238
1238
|
}
|
|
1239
1239
|
}
|
|
1240
1240
|
function printMonitorTypeStreams(tool) {
|
|
1241
|
-
const streams =
|
|
1242
|
-
|
|
1241
|
+
const streams = _chunkFERRDNMOjs.arrayField.call(void 0, tool, "streams", "output_streams").filter(
|
|
1242
|
+
_chunkFERRDNMOjs.isRecord
|
|
1243
1243
|
);
|
|
1244
1244
|
if (!streams.length) return;
|
|
1245
1245
|
console.log("");
|
|
1246
1246
|
console.log("Filter columns (a play's sqlListeners.where, per stream):");
|
|
1247
1247
|
for (const stream of streams) {
|
|
1248
|
-
const name =
|
|
1249
|
-
const cols =
|
|
1248
|
+
const name = _chunkFERRDNMOjs.stringField.call(void 0, stream, "stream");
|
|
1249
|
+
const cols = _chunkFERRDNMOjs.arrayField.call(void 0, stream, "columns").filter(_chunkFERRDNMOjs.isRecord).map((col) => _chunkFERRDNMOjs.stringField.call(void 0, col, "name")).filter(Boolean);
|
|
1250
1250
|
console.log(`- ${name}: ${cols.join(", ")}`);
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
1253
|
function monitorTypePricingLines(tool) {
|
|
1254
|
-
const pricing =
|
|
1255
|
-
const byType =
|
|
1254
|
+
const pricing = _chunkFERRDNMOjs.recordField.call(void 0, tool, "pricing");
|
|
1255
|
+
const byType = _chunkFERRDNMOjs.recordField.call(void 0,
|
|
1256
1256
|
pricing,
|
|
1257
1257
|
"pricing_by_radar_type",
|
|
1258
1258
|
"pricingByRadarType"
|
|
@@ -1263,9 +1263,9 @@ function monitorTypePricingLines(tool) {
|
|
|
1263
1263
|
}
|
|
1264
1264
|
const lines = ["Pricing (Deepline credits per accepted event):"];
|
|
1265
1265
|
for (const key of keys) {
|
|
1266
|
-
const entry =
|
|
1266
|
+
const entry = _chunkFERRDNMOjs.isRecord.call(void 0, byType[key]) ? byType[key] : {};
|
|
1267
1267
|
const credits = numberField(entry, "deepline_credits", "deeplineCredits");
|
|
1268
|
-
const display =
|
|
1268
|
+
const display = _chunkFERRDNMOjs.stringField.call(void 0, entry, "display");
|
|
1269
1269
|
const shown = display || (credits !== null ? `${formatDecimal(credits)} credits/event` : "not listed");
|
|
1270
1270
|
lines.push(`- ${key}: ${shown}`);
|
|
1271
1271
|
}
|
|
@@ -1275,20 +1275,20 @@ function printMonitorTypePricing(tool) {
|
|
|
1275
1275
|
for (const line of monitorTypePricingLines(tool)) console.log(line);
|
|
1276
1276
|
}
|
|
1277
1277
|
function printMonitorTypeDeploy(tool) {
|
|
1278
|
-
const deploy =
|
|
1279
|
-
const toolId =
|
|
1280
|
-
const example =
|
|
1278
|
+
const deploy = _chunkFERRDNMOjs.recordField.call(void 0, tool, "deploy");
|
|
1279
|
+
const toolId = _chunkFERRDNMOjs.stringField.call(void 0, tool, "toolId");
|
|
1280
|
+
const example = _chunkFERRDNMOjs.stringField.call(void 0, deploy, "example") || `deepline monitors deploy '{"key":"...","tool":"${toolId}","payload":{...}}'`;
|
|
1281
1281
|
console.log("Deploy (a monitor type is deployed, not executed):");
|
|
1282
1282
|
console.log(` ${example}`);
|
|
1283
1283
|
}
|
|
1284
1284
|
function printMonitorTypeContract(tool, requestedToolId) {
|
|
1285
|
-
const toolId =
|
|
1285
|
+
const toolId = _chunkFERRDNMOjs.stringField.call(void 0, tool, "toolId") || requestedToolId;
|
|
1286
1286
|
console.log(toolId);
|
|
1287
|
-
const displayName =
|
|
1287
|
+
const displayName = _chunkFERRDNMOjs.stringField.call(void 0, tool, "displayName");
|
|
1288
1288
|
if (displayName) console.log(`Best for: ${displayName}`);
|
|
1289
|
-
const description =
|
|
1289
|
+
const description = _chunkFERRDNMOjs.stringField.call(void 0, tool, "description");
|
|
1290
1290
|
if (description) console.log(`Description: ${description}`);
|
|
1291
|
-
const categories =
|
|
1291
|
+
const categories = _chunkFERRDNMOjs.arrayField.call(void 0, tool, "categories").filter(
|
|
1292
1292
|
(v) => typeof v === "string"
|
|
1293
1293
|
);
|
|
1294
1294
|
if (categories.length) console.log(`Tags: ${categories.join(", ")}`);
|
|
@@ -1308,31 +1308,31 @@ function printMonitorTypeContract(tool, requestedToolId) {
|
|
|
1308
1308
|
console.log(`More: deepline describe ${toolId}`);
|
|
1309
1309
|
}
|
|
1310
1310
|
function toolGuidanceLines(guidance) {
|
|
1311
|
-
const record =
|
|
1312
|
-
const toolGuidance =
|
|
1313
|
-
const providerGuidance =
|
|
1311
|
+
const record = _chunkFERRDNMOjs.isRecord.call(void 0, guidance) ? guidance : {};
|
|
1312
|
+
const toolGuidance = _chunkFERRDNMOjs.stringField.call(void 0, record, "tool");
|
|
1313
|
+
const providerGuidance = _chunkFERRDNMOjs.stringField.call(void 0, record, "provider");
|
|
1314
1314
|
return [
|
|
1315
1315
|
...toolGuidance ? [`- This tool: ${toolGuidance}`] : [],
|
|
1316
1316
|
...providerGuidance ? [`- Provider: ${providerGuidance}`] : []
|
|
1317
1317
|
];
|
|
1318
1318
|
}
|
|
1319
1319
|
function printCompactToolContract(tool, requestedToolId) {
|
|
1320
|
-
if (
|
|
1320
|
+
if (_chunkFERRDNMOjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1321
1321
|
printMonitorTypeContract(tool, requestedToolId);
|
|
1322
1322
|
return;
|
|
1323
1323
|
}
|
|
1324
|
-
const contract =
|
|
1324
|
+
const contract = _chunkFERRDNMOjs.toolContractJsonForDescribe.call(void 0,
|
|
1325
1325
|
tool,
|
|
1326
1326
|
requestedToolId,
|
|
1327
1327
|
void 0,
|
|
1328
1328
|
seedToolListScript
|
|
1329
1329
|
);
|
|
1330
|
-
const cost =
|
|
1331
|
-
const getters =
|
|
1330
|
+
const cost = _chunkFERRDNMOjs.isRecord.call(void 0, contract.cost) ? contract.cost : {};
|
|
1331
|
+
const getters = _chunkFERRDNMOjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1332
1332
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1333
1333
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1334
|
-
const inputFields =
|
|
1335
|
-
|
|
1334
|
+
const inputFields = _chunkFERRDNMOjs.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1335
|
+
_chunkFERRDNMOjs.recordField.call(void 0, contract, "inputSchema")
|
|
1336
1336
|
);
|
|
1337
1337
|
console.log(String(contract.toolId));
|
|
1338
1338
|
if (contract.displayName) console.log(`Best for: ${contract.displayName}`);
|
|
@@ -1349,9 +1349,9 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1349
1349
|
printToolOutputArrayShape(contract);
|
|
1350
1350
|
printToolExecutionHints(contract);
|
|
1351
1351
|
if (contract.deprecated === true) {
|
|
1352
|
-
const deprecation =
|
|
1353
|
-
const message =
|
|
1354
|
-
const replacementToolId =
|
|
1352
|
+
const deprecation = _chunkFERRDNMOjs.isRecord.call(void 0, contract.deprecation) ? contract.deprecation : {};
|
|
1353
|
+
const message = _chunkFERRDNMOjs.stringField.call(void 0, deprecation, "message");
|
|
1354
|
+
const replacementToolId = _chunkFERRDNMOjs.stringField.call(void 0,
|
|
1355
1355
|
deprecation,
|
|
1356
1356
|
"replacementToolId",
|
|
1357
1357
|
"replacement_tool_id"
|
|
@@ -1376,12 +1376,12 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1376
1376
|
console.log("");
|
|
1377
1377
|
console.log("Inputs:");
|
|
1378
1378
|
for (const field of inputFields) {
|
|
1379
|
-
if (!
|
|
1380
|
-
const name =
|
|
1379
|
+
if (!_chunkFERRDNMOjs.isRecord.call(void 0, field)) continue;
|
|
1380
|
+
const name = _chunkFERRDNMOjs.stringField.call(void 0, field, "name");
|
|
1381
1381
|
if (!name) continue;
|
|
1382
1382
|
const required = field.required ? "*" : "";
|
|
1383
|
-
const type =
|
|
1384
|
-
const description =
|
|
1383
|
+
const type = _chunkFERRDNMOjs.stringField.call(void 0, field, "type") || "unknown";
|
|
1384
|
+
const description = _chunkFERRDNMOjs.stringField.call(void 0, field, "description");
|
|
1385
1385
|
const enumValues = Array.isArray(field.enum) ? field.enum : [];
|
|
1386
1386
|
const enumSuffix = enumValues.length ? ` enum=${enumValues.map(String).join("|")}` : "";
|
|
1387
1387
|
const itemBoundsSuffix = arrayItemBoundsSuffix(field);
|
|
@@ -1396,8 +1396,8 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
console.log("");
|
|
1398
1398
|
printToolExamplesOnly(tool, requestedToolId);
|
|
1399
|
-
const starterScript =
|
|
1400
|
-
const starterPath =
|
|
1399
|
+
const starterScript = _chunkFERRDNMOjs.isRecord.call(void 0, contract.starterScript) ? contract.starterScript : {};
|
|
1400
|
+
const starterPath = _chunkFERRDNMOjs.stringField.call(void 0, starterScript, "path");
|
|
1401
1401
|
if (starterPath) {
|
|
1402
1402
|
console.log("");
|
|
1403
1403
|
console.log(`Starter script: ${starterPath}`);
|
|
@@ -1408,16 +1408,16 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1408
1408
|
console.log("Getters:");
|
|
1409
1409
|
if (listGetters.length) console.log(listGetterHeading());
|
|
1410
1410
|
for (const entry of listGetters) {
|
|
1411
|
-
if (
|
|
1411
|
+
if (_chunkFERRDNMOjs.isRecord.call(void 0, entry))
|
|
1412
1412
|
console.log(
|
|
1413
|
-
`- ${
|
|
1413
|
+
`- ${_chunkFERRDNMOjs.stringField.call(void 0, entry, "name")}: ${_chunkFERRDNMOjs.playResultExpression.call(void 0, entry)}`
|
|
1414
1414
|
);
|
|
1415
1415
|
}
|
|
1416
1416
|
if (valueGetters.length) console.log("Values:");
|
|
1417
1417
|
for (const entry of valueGetters) {
|
|
1418
|
-
if (
|
|
1418
|
+
if (_chunkFERRDNMOjs.isRecord.call(void 0, entry))
|
|
1419
1419
|
console.log(
|
|
1420
|
-
`- ${
|
|
1420
|
+
`- ${_chunkFERRDNMOjs.stringField.call(void 0, entry, "name")}: ${_chunkFERRDNMOjs.playResultExpression.call(void 0, entry)}`
|
|
1421
1421
|
);
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
@@ -1428,19 +1428,19 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1428
1428
|
console.log(`More: deepline describe ${contract.toolId}`);
|
|
1429
1429
|
}
|
|
1430
1430
|
function toolPricingOnlyLines(tool, requestedToolId, options = {}) {
|
|
1431
|
-
if (
|
|
1431
|
+
if (_chunkFERRDNMOjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1432
1432
|
return monitorTypePricingLines(tool);
|
|
1433
1433
|
}
|
|
1434
1434
|
const toolId = String(tool.toolId || requestedToolId);
|
|
1435
1435
|
const cost = _chunkZM2YPJQJjs.Capability.fromCatalogEntry(tool).describe().customerCost();
|
|
1436
|
-
const pricingModel =
|
|
1437
|
-
const billing =
|
|
1438
|
-
const explicitUnit =
|
|
1436
|
+
const pricingModel = _chunkFERRDNMOjs.stringField.call(void 0, cost, "pricingModel") || "unknown";
|
|
1437
|
+
const billing = _chunkFERRDNMOjs.stringField.call(void 0, cost, "billingSourceLabel") || _chunkFERRDNMOjs.stringField.call(void 0, cost, "billingSource") || _chunkFERRDNMOjs.stringField.call(void 0, cost, "billingMode") || "unknown";
|
|
1438
|
+
const explicitUnit = _chunkFERRDNMOjs.stringField.call(void 0, cost, "unit");
|
|
1439
1439
|
const unit = explicitUnit || (pricingModel === "per_page" ? "page" : pricingModel === "per_result" ? "result" : pricingModel === "fixed" ? "call" : pricingModel.replace(/^per_/, "") || "unit");
|
|
1440
1440
|
const credits = numberField(cost, "deeplineCreditsPerPricingUnit");
|
|
1441
1441
|
const usd = numberField(cost, "deeplineUsdPerPricingUnit");
|
|
1442
|
-
const displayText =
|
|
1443
|
-
const summary =
|
|
1442
|
+
const displayText = _chunkFERRDNMOjs.stringField.call(void 0, cost, "displayText");
|
|
1443
|
+
const summary = _chunkFERRDNMOjs.stringField.call(void 0, cost, "summary");
|
|
1444
1444
|
const price = displayText || summary || (credits !== null ? `${formatDecimal(credits)} Deepline credits${usd !== null ? ` / ${formatUsd(usd)}` : ""} per ${unit}` : "pricing unavailable");
|
|
1445
1445
|
return [
|
|
1446
1446
|
`${_nullishCoalesce(options.heading, () => ( `Pricing: ${toolId}`))}: ${price}`,
|
|
@@ -1457,19 +1457,19 @@ function printToolPricingOnly(tool, requestedToolId, options = {}) {
|
|
|
1457
1457
|
console.log(line);
|
|
1458
1458
|
}
|
|
1459
1459
|
function printToolSchemaOnly(tool, requestedToolId) {
|
|
1460
|
-
if (
|
|
1460
|
+
if (_chunkFERRDNMOjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1461
1461
|
printMonitorTypeFilters(tool);
|
|
1462
1462
|
printMonitorTypeStreams(tool);
|
|
1463
1463
|
return;
|
|
1464
1464
|
}
|
|
1465
|
-
const contract =
|
|
1465
|
+
const contract = _chunkFERRDNMOjs.toolContractJsonForDescribe.call(void 0,
|
|
1466
1466
|
tool,
|
|
1467
1467
|
requestedToolId,
|
|
1468
1468
|
void 0,
|
|
1469
1469
|
seedToolListScript
|
|
1470
1470
|
);
|
|
1471
|
-
const inputFields =
|
|
1472
|
-
|
|
1471
|
+
const inputFields = _chunkFERRDNMOjs.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1472
|
+
_chunkFERRDNMOjs.recordField.call(void 0, contract, "inputSchema")
|
|
1473
1473
|
);
|
|
1474
1474
|
console.log(`Schema: ${contract.toolId}`);
|
|
1475
1475
|
if (!inputFields.length) {
|
|
@@ -1496,27 +1496,27 @@ function printToolSchemaOnly(tool, requestedToolId) {
|
|
|
1496
1496
|
}
|
|
1497
1497
|
printToolOutputArrayShape(contract);
|
|
1498
1498
|
const declaredSchema = declaredToolJsonSchema(
|
|
1499
|
-
|
|
1499
|
+
_chunkFERRDNMOjs.recordField.call(void 0, contract, "inputSchema")
|
|
1500
1500
|
);
|
|
1501
1501
|
if (declaredSchema) {
|
|
1502
1502
|
console.log("Declared input JSON Schema:");
|
|
1503
1503
|
console.log(JSON.stringify(declaredSchema, null, 2));
|
|
1504
1504
|
}
|
|
1505
|
-
if (
|
|
1505
|
+
if (_chunkFERRDNMOjs.isRecord.call(void 0, contract.responseSchema)) {
|
|
1506
1506
|
console.log("Deepline execution response JSON Schema:");
|
|
1507
1507
|
console.log(JSON.stringify(contract.responseSchema, null, 2));
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
1510
1510
|
function printToolExamplesOnly(tool, requestedToolId) {
|
|
1511
|
-
if (
|
|
1511
|
+
if (_chunkFERRDNMOjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1512
1512
|
printMonitorTypeDeploy(tool);
|
|
1513
1513
|
return;
|
|
1514
1514
|
}
|
|
1515
|
-
if (
|
|
1515
|
+
if (_chunkFERRDNMOjs.isPlayLikeTool.call(void 0, tool)) {
|
|
1516
1516
|
printPlayLikeToolUsage(tool, requestedToolId);
|
|
1517
1517
|
return;
|
|
1518
1518
|
}
|
|
1519
|
-
const contract =
|
|
1519
|
+
const contract = _chunkFERRDNMOjs.toolContractJsonForDescribe.call(void 0,
|
|
1520
1520
|
tool,
|
|
1521
1521
|
requestedToolId,
|
|
1522
1522
|
void 0,
|
|
@@ -1524,9 +1524,9 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1524
1524
|
);
|
|
1525
1525
|
const toolId = String(contract.toolId);
|
|
1526
1526
|
const inputFields = Array.isArray(contract.inputFields) ? contract.inputFields : [];
|
|
1527
|
-
const examples =
|
|
1527
|
+
const examples = _chunkFERRDNMOjs.arrayField.call(void 0, tool, "examples").filter(_chunkFERRDNMOjs.isRecord);
|
|
1528
1528
|
const firstExample = examples[0];
|
|
1529
|
-
const sampleInput = firstExample &&
|
|
1529
|
+
const sampleInput = firstExample && _chunkFERRDNMOjs.isRecord.call(void 0, firstExample.input) ? firstExample.input : _nullishCoalesce(samplePayload(_chunkFERRDNMOjs.recordField.call(void 0, tool, "samples"), "request"), () => ( _chunkFERRDNMOjs.samplePayloadForInputFields.call(void 0, inputFields)));
|
|
1530
1530
|
console.log("Example input payload:");
|
|
1531
1531
|
console.log(JSON.stringify(sampleInput, null, 2));
|
|
1532
1532
|
console.log(`Use in a play:`);
|
|
@@ -1540,32 +1540,32 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1540
1540
|
);
|
|
1541
1541
|
console.log("});");
|
|
1542
1542
|
console.log("const response = result.toolResponse.rawV2;");
|
|
1543
|
-
const getters =
|
|
1543
|
+
const getters = _chunkFERRDNMOjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1544
1544
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1545
1545
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1546
|
-
const firstGetter = valueGetters.find(
|
|
1546
|
+
const firstGetter = valueGetters.find(_chunkFERRDNMOjs.isRecord);
|
|
1547
1547
|
if (firstGetter) {
|
|
1548
|
-
const name =
|
|
1549
|
-
const expression =
|
|
1548
|
+
const name = _chunkFERRDNMOjs.stringField.call(void 0, firstGetter, "name") || "value";
|
|
1549
|
+
const expression = _chunkFERRDNMOjs.stringField.call(void 0, firstGetter, "expression");
|
|
1550
1550
|
if (expression)
|
|
1551
1551
|
console.log(
|
|
1552
1552
|
`const ${safeIdentifier(name)} = ${expression.replace(/^toolExecutionResult\./, "result.")};`
|
|
1553
1553
|
);
|
|
1554
1554
|
}
|
|
1555
1555
|
const arrayNames = new Set(
|
|
1556
|
-
|
|
1557
|
-
|
|
1556
|
+
_chunkFERRDNMOjs.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1557
|
+
_chunkFERRDNMOjs.recordField.call(void 0, tool, "outputSchema", "output_schema")
|
|
1558
1558
|
).filter((field) => String(field.type).split("|").includes("array")).map((field) => String(field.name).split(".").at(-1))
|
|
1559
1559
|
);
|
|
1560
1560
|
const firstList = _nullishCoalesce(listGetters.find(
|
|
1561
|
-
(entry) =>
|
|
1562
|
-
), () => ( listGetters.find(
|
|
1563
|
-
if (
|
|
1564
|
-
const name = safeIdentifier(
|
|
1565
|
-
if (
|
|
1566
|
-
console.log(`const ${name}_rows = ${
|
|
1561
|
+
(entry) => _chunkFERRDNMOjs.isRecord.call(void 0, entry) && arrayNames.has(_chunkFERRDNMOjs.stringField.call(void 0, entry, "name"))
|
|
1562
|
+
), () => ( listGetters.find(_chunkFERRDNMOjs.isRecord)));
|
|
1563
|
+
if (_chunkFERRDNMOjs.isRecord.call(void 0, firstList)) {
|
|
1564
|
+
const name = safeIdentifier(_chunkFERRDNMOjs.stringField.call(void 0, firstList, "name") || "list");
|
|
1565
|
+
if (_chunkZ4VNJOF7js.playToolListGetterMode.call(void 0, ) === "array") {
|
|
1566
|
+
console.log(`const ${name}_rows = ${_chunkFERRDNMOjs.playResultExpression.call(void 0, firstList)};`);
|
|
1567
1567
|
} else {
|
|
1568
|
-
console.log(`const ${name}_ds = ${
|
|
1568
|
+
console.log(`const ${name}_ds = ${_chunkFERRDNMOjs.playResultExpression.call(void 0, firstList)};`);
|
|
1569
1569
|
console.log(
|
|
1570
1570
|
"// Complete small list from this response; throws above the memory cap."
|
|
1571
1571
|
);
|
|
@@ -1575,7 +1575,7 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1575
1575
|
console.log("```");
|
|
1576
1576
|
if (firstList) printListGetterConsumption();
|
|
1577
1577
|
for (const example of examples) {
|
|
1578
|
-
const description =
|
|
1578
|
+
const description = _chunkFERRDNMOjs.stringField.call(void 0, example, "description");
|
|
1579
1579
|
if (description) console.log(description);
|
|
1580
1580
|
console.log("Example Deepline execution response:");
|
|
1581
1581
|
console.log(JSON.stringify(example.response, null, 2));
|
|
@@ -1590,14 +1590,14 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
function printPlayLikeToolUsage(tool, requestedToolId) {
|
|
1592
1592
|
const toolId = String(tool.toolId || requestedToolId);
|
|
1593
|
-
const inputFields =
|
|
1594
|
-
|
|
1593
|
+
const inputFields = _chunkFERRDNMOjs.toolInputFieldsForDisplay.call(void 0,
|
|
1594
|
+
_chunkFERRDNMOjs.recordField.call(void 0, tool, "inputSchema", "input_schema")
|
|
1595
1595
|
);
|
|
1596
|
-
const sampleInput =
|
|
1597
|
-
const playReference =
|
|
1596
|
+
const sampleInput = _chunkFERRDNMOjs.samplePayloadForInputFields.call(void 0, inputFields);
|
|
1597
|
+
const playReference = _chunkFERRDNMOjs.playReferenceForTool.call(void 0, tool);
|
|
1598
1598
|
console.log("Run as a play:");
|
|
1599
1599
|
console.log(
|
|
1600
|
-
|
|
1600
|
+
_chunkFERRDNMOjs.playRunCommandForTool.call(void 0,
|
|
1601
1601
|
tool,
|
|
1602
1602
|
toolId,
|
|
1603
1603
|
Object.keys(sampleInput).length ? sampleInput : void 0
|
|
@@ -1608,13 +1608,13 @@ function printPlayLikeToolUsage(tool, requestedToolId) {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
}
|
|
1610
1610
|
function printToolGettersOnly(tool, requestedToolId) {
|
|
1611
|
-
const contract =
|
|
1611
|
+
const contract = _chunkFERRDNMOjs.toolContractJsonForDescribe.call(void 0,
|
|
1612
1612
|
tool,
|
|
1613
1613
|
requestedToolId,
|
|
1614
1614
|
void 0,
|
|
1615
1615
|
seedToolListScript
|
|
1616
1616
|
);
|
|
1617
|
-
const getters =
|
|
1617
|
+
const getters = _chunkFERRDNMOjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1618
1618
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1619
1619
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1620
1620
|
console.log(`Getters: ${contract.toolId}`);
|
|
@@ -1625,9 +1625,9 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
1625
1625
|
if (listGetters.length) {
|
|
1626
1626
|
console.log(listGetterHeading());
|
|
1627
1627
|
for (const entry of listGetters) {
|
|
1628
|
-
if (
|
|
1628
|
+
if (_chunkFERRDNMOjs.isRecord.call(void 0, entry))
|
|
1629
1629
|
console.log(
|
|
1630
|
-
`- ${
|
|
1630
|
+
`- ${_chunkFERRDNMOjs.stringField.call(void 0, entry, "name")}: ${_chunkFERRDNMOjs.playResultExpression.call(void 0, entry)}`
|
|
1631
1631
|
);
|
|
1632
1632
|
}
|
|
1633
1633
|
printListGetterConsumption();
|
|
@@ -1635,15 +1635,15 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
1635
1635
|
if (valueGetters.length) {
|
|
1636
1636
|
console.log("Values:");
|
|
1637
1637
|
for (const entry of valueGetters) {
|
|
1638
|
-
if (
|
|
1638
|
+
if (_chunkFERRDNMOjs.isRecord.call(void 0, entry))
|
|
1639
1639
|
console.log(
|
|
1640
|
-
`- ${
|
|
1640
|
+
`- ${_chunkFERRDNMOjs.stringField.call(void 0, entry, "name")}: ${_chunkFERRDNMOjs.playResultExpression.call(void 0, entry)}`
|
|
1641
1641
|
);
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
1644
|
}
|
|
1645
1645
|
function printListGetterConsumption() {
|
|
1646
|
-
if (
|
|
1646
|
+
if (_chunkZ4VNJOF7js.playToolListGetterMode.call(void 0, ) === "array") {
|
|
1647
1647
|
console.log(
|
|
1648
1648
|
"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."
|
|
1649
1649
|
);
|
|
@@ -1654,7 +1654,7 @@ function printListGetterConsumption() {
|
|
|
1654
1654
|
);
|
|
1655
1655
|
}
|
|
1656
1656
|
function listGetterHeading() {
|
|
1657
|
-
return
|
|
1657
|
+
return _chunkZ4VNJOF7js.playToolListGetterMode.call(void 0, ) === "array" ? "Lists (ordinary JavaScript arrays):" : "Lists (PlayDataset, not a JavaScript array):";
|
|
1658
1658
|
}
|
|
1659
1659
|
function stableStepIdForTool(toolId) {
|
|
1660
1660
|
return toolId.replace(/^[a-z0-9]+_/, "").replace(/[^a-z0-9_]+/gi, "_") || "tool_call";
|
|
@@ -1675,22 +1675,22 @@ function listedToolDescription(tool) {
|
|
|
1675
1675
|
}
|
|
1676
1676
|
function formatListedToolCost(tool) {
|
|
1677
1677
|
const record = tool;
|
|
1678
|
-
if (
|
|
1678
|
+
if (_chunkFERRDNMOjs.stringField.call(void 0, record, "billingSource", "billing_source") === "free") {
|
|
1679
1679
|
return "Cost: Free";
|
|
1680
1680
|
}
|
|
1681
|
-
const pricing =
|
|
1682
|
-
const displayText =
|
|
1681
|
+
const pricing = _chunkFERRDNMOjs.recordField.call(void 0, record, "pricing");
|
|
1682
|
+
const displayText = _chunkFERRDNMOjs.stringField.call(void 0, pricing, "displayText", "display_text");
|
|
1683
1683
|
return displayText ? `Cost: ${displayText}` : "";
|
|
1684
1684
|
}
|
|
1685
1685
|
function printToolOutputArrayShape(tool) {
|
|
1686
|
-
const outputFields =
|
|
1687
|
-
|
|
1686
|
+
const outputFields = _chunkFERRDNMOjs.toolOutputFieldsForDisplay.call(void 0,
|
|
1687
|
+
_chunkFERRDNMOjs.recordField.call(void 0, _chunkFERRDNMOjs.isRecord.call(void 0, tool) ? tool : {}, "outputSchema", "output_schema")
|
|
1688
1688
|
);
|
|
1689
1689
|
if (outputFields.length === 0) return;
|
|
1690
1690
|
console.log(" Output array shape (declared schema):");
|
|
1691
1691
|
for (const field of outputFields.slice(0, 60)) {
|
|
1692
1692
|
const name = String(field.name);
|
|
1693
|
-
const type =
|
|
1693
|
+
const type = _chunkFERRDNMOjs.stringField.call(void 0, field, "type") || "unknown";
|
|
1694
1694
|
const itemBounds = arrayItemBoundsSuffix(field);
|
|
1695
1695
|
console.log(` - ${name}: ${type}${itemBounds}`);
|
|
1696
1696
|
}
|
|
@@ -1699,14 +1699,14 @@ function printToolOutputArrayShape(tool) {
|
|
|
1699
1699
|
}
|
|
1700
1700
|
}
|
|
1701
1701
|
function declaredToolJsonSchema(inputSchema) {
|
|
1702
|
-
if (
|
|
1702
|
+
if (_chunkFERRDNMOjs.isRecord.call(void 0, inputSchema.jsonSchema)) {
|
|
1703
1703
|
return inputSchema.jsonSchema;
|
|
1704
1704
|
}
|
|
1705
1705
|
return Array.isArray(inputSchema.fields) ? null : inputSchema;
|
|
1706
1706
|
}
|
|
1707
1707
|
function arrayItemBoundsSuffix(field) {
|
|
1708
|
-
const itemSchema =
|
|
1709
|
-
const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type :
|
|
1708
|
+
const itemSchema = _chunkFERRDNMOjs.isRecord.call(void 0, field.items) ? field.items : null;
|
|
1709
|
+
const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type : _chunkFERRDNMOjs.isRecord.call(void 0, itemSchema.properties) ? "object" : "unknown" : null;
|
|
1710
1710
|
const itemEnum = Array.isArray(_optionalChain([itemSchema, 'optionalAccess', _14 => _14.enum])) ? ` enum=${itemSchema.enum.map(String).join("|")}` : "";
|
|
1711
1711
|
const itemTypeSuffix = itemType && itemType !== "unknown" ? ` items=${itemType}${itemEnum}` : "";
|
|
1712
1712
|
const minItems = typeof field.minItems === "number" && Number.isFinite(field.minItems) ? field.minItems : null;
|
|
@@ -1719,21 +1719,21 @@ function arrayItemBoundsSuffix(field) {
|
|
|
1719
1719
|
return itemTypeSuffix;
|
|
1720
1720
|
}
|
|
1721
1721
|
function printToolExecutionHints(value) {
|
|
1722
|
-
const batchCapabilityRecord =
|
|
1723
|
-
|
|
1722
|
+
const batchCapabilityRecord = _chunkFERRDNMOjs.recordField.call(void 0,
|
|
1723
|
+
_chunkFERRDNMOjs.isRecord.call(void 0, value) ? value : {},
|
|
1724
1724
|
"batchCapability",
|
|
1725
1725
|
"batch_capability"
|
|
1726
1726
|
);
|
|
1727
1727
|
const batchCapability = Object.keys(batchCapabilityRecord).length > 0 ? batchCapabilityRecord : null;
|
|
1728
|
-
const executionMetadata =
|
|
1729
|
-
|
|
1728
|
+
const executionMetadata = _chunkFERRDNMOjs.recordField.call(void 0,
|
|
1729
|
+
_chunkFERRDNMOjs.isRecord.call(void 0, value) ? value : {},
|
|
1730
1730
|
"executionMetadata",
|
|
1731
1731
|
"execution_metadata"
|
|
1732
1732
|
);
|
|
1733
1733
|
if (batchCapability) {
|
|
1734
|
-
const status =
|
|
1735
|
-
const surface =
|
|
1736
|
-
const operation =
|
|
1734
|
+
const status = _chunkFERRDNMOjs.stringField.call(void 0, batchCapability, "status") || "unknown";
|
|
1735
|
+
const surface = _chunkFERRDNMOjs.stringField.call(void 0, batchCapability, "surface");
|
|
1736
|
+
const operation = _chunkFERRDNMOjs.stringField.call(void 0,
|
|
1737
1737
|
batchCapability,
|
|
1738
1738
|
"batchOperation",
|
|
1739
1739
|
"batch_operation"
|
|
@@ -1743,7 +1743,7 @@ function printToolExecutionHints(value) {
|
|
|
1743
1743
|
"maxBatchSize",
|
|
1744
1744
|
"max_batch_size"
|
|
1745
1745
|
);
|
|
1746
|
-
const notes =
|
|
1746
|
+
const notes = _chunkFERRDNMOjs.stringField.call(void 0, batchCapability, "notes");
|
|
1747
1747
|
console.log("");
|
|
1748
1748
|
console.log("Batching:");
|
|
1749
1749
|
console.log(`- Catalog status: ${status}${surface ? ` (${surface})` : ""}`);
|
|
@@ -1762,11 +1762,11 @@ function printToolExecutionHints(value) {
|
|
|
1762
1762
|
}
|
|
1763
1763
|
if (notes) console.log(`- Details: ${notes}`);
|
|
1764
1764
|
}
|
|
1765
|
-
const configuredRateLimits =
|
|
1765
|
+
const configuredRateLimits = _chunkFERRDNMOjs.arrayField.call(void 0,
|
|
1766
1766
|
executionMetadata,
|
|
1767
1767
|
"configuredRateLimits",
|
|
1768
1768
|
"configured_rate_limits"
|
|
1769
|
-
).filter(
|
|
1769
|
+
).filter(_chunkFERRDNMOjs.isRecord);
|
|
1770
1770
|
if (configuredRateLimits.length > 0) {
|
|
1771
1771
|
console.log("");
|
|
1772
1772
|
console.log(
|
|
@@ -1776,7 +1776,7 @@ function printToolExecutionHints(value) {
|
|
|
1776
1776
|
const requests = numberField(limit, "requestsPerWindow");
|
|
1777
1777
|
const windowMs = numberField(limit, "windowMs");
|
|
1778
1778
|
if (requests === null || windowMs === null) continue;
|
|
1779
|
-
const usage =
|
|
1779
|
+
const usage = _chunkFERRDNMOjs.stringField.call(void 0, limit, "usage") || "unknown";
|
|
1780
1780
|
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;
|
|
1781
1781
|
const explicitMaxConcurrency = numberField(
|
|
1782
1782
|
limit,
|
|
@@ -1789,7 +1789,7 @@ function printToolExecutionHints(value) {
|
|
|
1789
1789
|
);
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
1792
|
-
const queueHint =
|
|
1792
|
+
const queueHint = _chunkFERRDNMOjs.recordField.call(void 0, executionMetadata, "queueHint", "queue_hint");
|
|
1793
1793
|
const requestsPerSecondHint = numberField(
|
|
1794
1794
|
queueHint,
|
|
1795
1795
|
"requestsPerSecondHint",
|
|
@@ -1814,25 +1814,25 @@ function formatRateWindow(windowMs) {
|
|
|
1814
1814
|
}
|
|
1815
1815
|
function samplePayload(samples, key) {
|
|
1816
1816
|
const entry = samples[key];
|
|
1817
|
-
if (!
|
|
1817
|
+
if (!_chunkFERRDNMOjs.isRecord.call(void 0, entry)) return void 0;
|
|
1818
1818
|
return Object.prototype.hasOwnProperty.call(entry, "payload") ? entry.payload : entry;
|
|
1819
1819
|
}
|
|
1820
1820
|
function commandEnvelopeFromRawResponse(rawResponse) {
|
|
1821
|
-
return
|
|
1821
|
+
return _chunkFERRDNMOjs.isRecord.call(void 0, rawResponse) ? { ...rawResponse } : { status: "completed", result: rawResponse };
|
|
1822
1822
|
}
|
|
1823
1823
|
function toolExecuteExitCode(envelope) {
|
|
1824
1824
|
return envelope.status === "failed" || envelope.ok === false ? 1 : 0;
|
|
1825
1825
|
}
|
|
1826
1826
|
function extractToolExecutionWarningMessages(rawResponse) {
|
|
1827
|
-
if (!
|
|
1827
|
+
if (!_chunkFERRDNMOjs.isRecord.call(void 0, rawResponse)) return [];
|
|
1828
1828
|
const candidates = [
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1829
|
+
_chunkFERRDNMOjs.recordField.call(void 0, _chunkFERRDNMOjs.recordField.call(void 0, rawResponse, "toolResponse"), "meta"),
|
|
1830
|
+
_chunkFERRDNMOjs.recordField.call(void 0,
|
|
1831
|
+
_chunkFERRDNMOjs.recordField.call(void 0, _chunkFERRDNMOjs.recordField.call(void 0, rawResponse, "toolResponse"), "raw"),
|
|
1832
1832
|
"meta"
|
|
1833
1833
|
),
|
|
1834
|
-
|
|
1835
|
-
|
|
1834
|
+
_chunkFERRDNMOjs.recordField.call(void 0, rawResponse, "meta"),
|
|
1835
|
+
_chunkFERRDNMOjs.recordField.call(void 0, _chunkFERRDNMOjs.recordField.call(void 0, rawResponse, "result"), "meta")
|
|
1836
1836
|
];
|
|
1837
1837
|
const messages = [];
|
|
1838
1838
|
for (const candidate of candidates) {
|
|
@@ -1841,8 +1841,8 @@ function extractToolExecutionWarningMessages(rawResponse) {
|
|
|
1841
1841
|
for (const warning of warnings) {
|
|
1842
1842
|
if (typeof warning === "string" && warning.trim()) {
|
|
1843
1843
|
messages.push(warning.trim());
|
|
1844
|
-
} else if (
|
|
1845
|
-
const message =
|
|
1844
|
+
} else if (_chunkFERRDNMOjs.isRecord.call(void 0, warning)) {
|
|
1845
|
+
const message = _chunkFERRDNMOjs.stringField.call(void 0, warning, "message");
|
|
1846
1846
|
if (message) messages.push(message);
|
|
1847
1847
|
}
|
|
1848
1848
|
}
|
|
@@ -1850,20 +1850,20 @@ function extractToolExecutionWarningMessages(rawResponse) {
|
|
|
1850
1850
|
return [...new Set(messages)];
|
|
1851
1851
|
}
|
|
1852
1852
|
function apifySyncRecoveryNext(rawResponse) {
|
|
1853
|
-
if (!
|
|
1854
|
-
const toolResponse =
|
|
1855
|
-
const raw =
|
|
1853
|
+
if (!_chunkFERRDNMOjs.isRecord.call(void 0, rawResponse) || rawResponse.status !== "running") return null;
|
|
1854
|
+
const toolResponse = _chunkFERRDNMOjs.recordField.call(void 0, rawResponse, "toolResponse");
|
|
1855
|
+
const raw = _chunkFERRDNMOjs.recordField.call(void 0, toolResponse, "raw");
|
|
1856
1856
|
if (raw.state !== "awaiting_apify") return null;
|
|
1857
|
-
const next =
|
|
1858
|
-
const getActorRun =
|
|
1859
|
-
const getActorRunTool =
|
|
1860
|
-
const getActorRunPayload =
|
|
1857
|
+
const next = _chunkFERRDNMOjs.recordField.call(void 0, raw, "next");
|
|
1858
|
+
const getActorRun = _chunkFERRDNMOjs.recordField.call(void 0, next, "getActorRun");
|
|
1859
|
+
const getActorRunTool = _chunkFERRDNMOjs.stringField.call(void 0, getActorRun, "tool");
|
|
1860
|
+
const getActorRunPayload = _chunkFERRDNMOjs.recordField.call(void 0, getActorRun, "payload");
|
|
1861
1861
|
if (!getActorRunTool || Object.keys(getActorRunPayload).length === 0) {
|
|
1862
1862
|
return null;
|
|
1863
1863
|
}
|
|
1864
|
-
const getDatasetItems =
|
|
1865
|
-
const getDatasetItemsTool =
|
|
1866
|
-
const getDatasetItemsPayload =
|
|
1864
|
+
const getDatasetItems = _chunkFERRDNMOjs.recordField.call(void 0, next, "getDatasetItems");
|
|
1865
|
+
const getDatasetItemsTool = _chunkFERRDNMOjs.stringField.call(void 0, getDatasetItems, "tool");
|
|
1866
|
+
const getDatasetItemsPayload = _chunkFERRDNMOjs.recordField.call(void 0, getDatasetItems, "payload");
|
|
1867
1867
|
return {
|
|
1868
1868
|
getActorRun: `deepline tools execute ${getActorRunTool} --input ${_chunkAID3OYVJjs.shellQuote.call(void 0, JSON.stringify(getActorRunPayload))}`,
|
|
1869
1869
|
...getDatasetItemsTool && Object.keys(getDatasetItemsPayload).length > 0 ? {
|
|
@@ -1873,7 +1873,7 @@ function apifySyncRecoveryNext(rawResponse) {
|
|
|
1873
1873
|
}
|
|
1874
1874
|
function listExtractorPathsFromUsageGuidance(tool) {
|
|
1875
1875
|
const toolExecutionResult = _optionalChain([tool, 'access', _16 => _16.usageGuidance, 'optionalAccess', _17 => _17.toolExecutionResult]);
|
|
1876
|
-
const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _18 => _18.extractedLists])) ? toolExecutionResult.extractedLists :
|
|
1876
|
+
const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _18 => _18.extractedLists])) ? toolExecutionResult.extractedLists : _chunkFERRDNMOjs.isRecord.call(void 0, _optionalChain([toolExecutionResult, 'optionalAccess', _19 => _19.extractedLists])) ? Object.values(toolExecutionResult.extractedLists) : [];
|
|
1877
1877
|
return extractedLists.flatMap((entry) => {
|
|
1878
1878
|
const paths = _nullishCoalesce(_optionalChain([entry, 'access', _20 => _20.details, 'optionalAccess', _21 => _21.candidatePaths]), () => ( _optionalChain([entry, 'access', _22 => _22.details, 'optionalAccess', _23 => _23.rawToolOutputPaths])));
|
|
1879
1879
|
if (!Array.isArray(paths)) return [];
|
|
@@ -1958,7 +1958,7 @@ function parseJsonObjectArgument(raw, flagName) {
|
|
|
1958
1958
|
}
|
|
1959
1959
|
throw invalidJsonError(flagName, message);
|
|
1960
1960
|
}
|
|
1961
|
-
if (!
|
|
1961
|
+
if (!_chunkFERRDNMOjs.isRecord.call(void 0, parsed)) {
|
|
1962
1962
|
throw invalidJsonError(flagName, "expected an object.");
|
|
1963
1963
|
}
|
|
1964
1964
|
return parsed;
|
|
@@ -2002,7 +2002,7 @@ function parseExecuteOptions(toolId, options, output) {
|
|
|
2002
2002
|
outputFormat = normalizeOutputFormat(options.outputFormat);
|
|
2003
2003
|
}
|
|
2004
2004
|
if (options.idempotencyKey !== void 0) {
|
|
2005
|
-
|
|
2005
|
+
_chunkCBMYUXATjs.validateExecutionIdempotencyKey.call(void 0, options.idempotencyKey);
|
|
2006
2006
|
}
|
|
2007
2007
|
if (options.recoveryTimeoutMs !== void 0) {
|
|
2008
2008
|
const parsed = Number(options.recoveryTimeoutMs);
|
|
@@ -2076,8 +2076,8 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
|
|
|
2076
2076
|
const rows = list.get();
|
|
2077
2077
|
// ${sampleRows}
|
|
2078
2078
|
// columns: ${columns}
|
|
2079
|
-
// ${
|
|
2080
|
-
// ${
|
|
2079
|
+
// ${_chunkZ4VNJOF7js.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."}
|
|
2080
|
+
// ${_chunkZ4VNJOF7js.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."}
|
|
2081
2081
|
// .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.' }))
|
|
2082
2082
|
// .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.' }))
|
|
2083
2083
|
// ctx.dataset is idempotent for completed rows during same-run recovery. New runs follow each call's freshness.
|
|
@@ -2130,7 +2130,7 @@ function buildToolExecuteBaseEnvelope(input) {
|
|
|
2130
2130
|
kind: summaryEntries.length > 0 ? "object" : "raw",
|
|
2131
2131
|
summary: input.summary
|
|
2132
2132
|
};
|
|
2133
|
-
const envelopeHasCanonicalOutput =
|
|
2133
|
+
const envelopeHasCanonicalOutput = _chunkFERRDNMOjs.isRecord.call(void 0, envelope.toolResponse) && Object.prototype.hasOwnProperty.call(envelope.toolResponse, "raw");
|
|
2134
2134
|
const envelopeHasDeclaredOutput = Object.prototype.hasOwnProperty.call(
|
|
2135
2135
|
envelope,
|
|
2136
2136
|
"output"
|
|
@@ -2158,7 +2158,7 @@ function buildToolExecuteBaseEnvelope(input) {
|
|
|
2158
2158
|
return {
|
|
2159
2159
|
...envelope,
|
|
2160
2160
|
...input.idempotencyKey ? { idempotency_key: input.idempotencyKey } : {},
|
|
2161
|
-
...
|
|
2161
|
+
..._chunkFERRDNMOjs.isRecord.call(void 0, input.rawResponse) && _chunkFERRDNMOjs.isRecord.call(void 0, input.rawResponse.executionRecovery) ? { execution_recovery: input.rawResponse.executionRecovery } : {},
|
|
2162
2162
|
...envelopeHasCanonicalOutput || envelopeHasDeclaredOutput ? { output_preview: outputPreview } : { output: outputPreview },
|
|
2163
2163
|
...summaryEntries.length > 0 ? { summary: input.summary } : {},
|
|
2164
2164
|
...warningMessages.length > 0 ? { warnings: warningMessages } : {},
|
|
@@ -2219,7 +2219,7 @@ function buildToolExecuteRowArtifactEnvelope(input) {
|
|
|
2219
2219
|
void _render;
|
|
2220
2220
|
void _next;
|
|
2221
2221
|
void _local;
|
|
2222
|
-
const billingLookup =
|
|
2222
|
+
const billingLookup = _chunkFERRDNMOjs.isRecord.call(void 0, input.baseEnvelope.next) && typeof input.baseEnvelope.next.billing === "string" ? input.baseEnvelope.next.billing : null;
|
|
2223
2223
|
const inspection = toolExecutionInspection(input);
|
|
2224
2224
|
return {
|
|
2225
2225
|
...base,
|
|
@@ -2302,20 +2302,20 @@ function buildToolExecuteRowArtifactEnvelope(input) {
|
|
|
2302
2302
|
}
|
|
2303
2303
|
async function executeTool(toolId, options) {
|
|
2304
2304
|
const output = toolExecuteJsonOption(options.json);
|
|
2305
|
-
const wantsJson =
|
|
2305
|
+
const wantsJson = _chunkODKHUBU3js.shouldEmitJson.call(void 0, output.requested) || (_nullishCoalesce(options.outputFormat, () => ( "auto"))).trim().toLowerCase() !== "csv";
|
|
2306
2306
|
let parsed;
|
|
2307
2307
|
try {
|
|
2308
2308
|
parsed = parseExecuteOptions(toolId, options, output);
|
|
2309
2309
|
} catch (error) {
|
|
2310
2310
|
if (wantsJson) {
|
|
2311
|
-
|
|
2311
|
+
_chunkODKHUBU3js.printJsonError.call(void 0, error);
|
|
2312
2312
|
} else {
|
|
2313
2313
|
console.error(error instanceof Error ? error.message : String(error));
|
|
2314
2314
|
}
|
|
2315
2315
|
return error instanceof _chunk7P5AA3SNjs.DeeplineError && error.code === "IDEMPOTENCY_KEY_INVALID" ? 2 : 1;
|
|
2316
2316
|
}
|
|
2317
2317
|
const cliInvocationId = _nullishCoalesce(_chunkQJBJZVG6js.getToolExecuteInvocationId.call(void 0, ), () => ( _chunkQJBJZVG6js.beginToolExecuteCommand.call(void 0, )));
|
|
2318
|
-
const client = new (0,
|
|
2318
|
+
const client = new (0, _chunkCBMYUXATjs.DeeplineClient)();
|
|
2319
2319
|
let metadata;
|
|
2320
2320
|
try {
|
|
2321
2321
|
metadata = await _chunkQJBJZVG6js.runToolExecuteStage.call(void 0,
|
|
@@ -2330,7 +2330,7 @@ async function executeTool(toolId, options) {
|
|
|
2330
2330
|
);
|
|
2331
2331
|
if (play) {
|
|
2332
2332
|
if (wantsJson) {
|
|
2333
|
-
|
|
2333
|
+
_chunkODKHUBU3js.printJsonError.call(void 0,
|
|
2334
2334
|
new Error(playAliasToolErrorMessage(parsed.toolId, play))
|
|
2335
2335
|
);
|
|
2336
2336
|
} else {
|
|
@@ -2341,9 +2341,9 @@ async function executeTool(toolId, options) {
|
|
|
2341
2341
|
}
|
|
2342
2342
|
throw error;
|
|
2343
2343
|
}
|
|
2344
|
-
if (
|
|
2344
|
+
if (_chunkFERRDNMOjs.isPlayLikeTool.call(void 0, metadata)) {
|
|
2345
2345
|
if (wantsJson) {
|
|
2346
|
-
|
|
2346
|
+
_chunkODKHUBU3js.printJsonError.call(void 0,
|
|
2347
2347
|
new Error(
|
|
2348
2348
|
playLikeToolExecuteErrorMessage(
|
|
2349
2349
|
parsed.toolId,
|
|
@@ -2391,7 +2391,7 @@ async function executeTool(toolId, options) {
|
|
|
2391
2391
|
responseIntent,
|
|
2392
2392
|
...idempotencyKey ? { idempotencyKey } : {},
|
|
2393
2393
|
...parsed.recoveryTimeoutMs !== void 0 ? { recoveryTimeoutMs: parsed.recoveryTimeoutMs } : {},
|
|
2394
|
-
searchRef:
|
|
2394
|
+
searchRef: _chunkW3SACRLJjs.recentSearchRef.call(void 0, ),
|
|
2395
2395
|
cliInvocationId,
|
|
2396
2396
|
onResponseReceived: _chunkZAAKSJASjs.recordApiResponse
|
|
2397
2397
|
}).catch((error) => {
|
|
@@ -2432,7 +2432,7 @@ async function executeTool(toolId, options) {
|
|
|
2432
2432
|
const executeExitCode = toolExecuteExitCode(baseEnvelope);
|
|
2433
2433
|
const delivered = await _chunkQJBJZVG6js.runToolExecuteStage.call(void 0, "output delivery", () => {
|
|
2434
2434
|
if (!parsed.outPath && (parsed.outputFormat === "json" || parsed.outputFormat === "auto" && wantsJson)) {
|
|
2435
|
-
|
|
2435
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0, baseEnvelope, { json: true });
|
|
2436
2436
|
return true;
|
|
2437
2437
|
}
|
|
2438
2438
|
if (parsed.outputFormat === "json_file") {
|
|
@@ -2440,11 +2440,11 @@ async function executeTool(toolId, options) {
|
|
|
2440
2440
|
rawResponse,
|
|
2441
2441
|
`payload_${parsed.toolId}`
|
|
2442
2442
|
);
|
|
2443
|
-
|
|
2443
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0,
|
|
2444
2444
|
{
|
|
2445
2445
|
...baseEnvelope,
|
|
2446
2446
|
local: {
|
|
2447
|
-
...
|
|
2447
|
+
..._chunkFERRDNMOjs.isRecord.call(void 0, baseEnvelope.local) ? baseEnvelope.local : {},
|
|
2448
2448
|
payload_file: jsonPath
|
|
2449
2449
|
}
|
|
2450
2450
|
},
|
|
@@ -2462,7 +2462,7 @@ async function executeTool(toolId, options) {
|
|
|
2462
2462
|
`${parsed.toolId} did not expose row-shaped output to write as CSV. ${inspection.inspectDescription} Run: ${inspection.inspect}`
|
|
2463
2463
|
);
|
|
2464
2464
|
if (wantsJson) {
|
|
2465
|
-
|
|
2465
|
+
_chunkODKHUBU3js.printJsonError.call(void 0, error);
|
|
2466
2466
|
} else {
|
|
2467
2467
|
console.error(error.message);
|
|
2468
2468
|
}
|
|
@@ -2473,7 +2473,7 @@ async function executeTool(toolId, options) {
|
|
|
2473
2473
|
rawResponse,
|
|
2474
2474
|
`payload_${parsed.toolId}`
|
|
2475
2475
|
);
|
|
2476
|
-
|
|
2476
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0,
|
|
2477
2477
|
{
|
|
2478
2478
|
...baseEnvelope,
|
|
2479
2479
|
local: {
|
|
@@ -2484,7 +2484,7 @@ async function executeTool(toolId, options) {
|
|
|
2484
2484
|
);
|
|
2485
2485
|
return true;
|
|
2486
2486
|
}
|
|
2487
|
-
|
|
2487
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0, baseEnvelope, { json: false });
|
|
2488
2488
|
return true;
|
|
2489
2489
|
}
|
|
2490
2490
|
const rowOutput = _chunkHGFFYVXNjs.projectRowOutput.call(void 0, listConversion);
|
|
@@ -2508,7 +2508,7 @@ async function executeTool(toolId, options) {
|
|
|
2508
2508
|
seededScript
|
|
2509
2509
|
});
|
|
2510
2510
|
if (parsed.outputFormat === "csv_file") {
|
|
2511
|
-
|
|
2511
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0, materializedEnvelope, { json: true });
|
|
2512
2512
|
return true;
|
|
2513
2513
|
}
|
|
2514
2514
|
if (parsed.outPath) {
|
|
@@ -2516,7 +2516,7 @@ async function executeTool(toolId, options) {
|
|
|
2516
2516
|
toolId: parsed.toolId,
|
|
2517
2517
|
idempotencyKey
|
|
2518
2518
|
});
|
|
2519
|
-
|
|
2519
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0, materializedEnvelope, {
|
|
2520
2520
|
json: wantsJson,
|
|
2521
2521
|
text: `Wrote ${csv.rowCount} row(s) to ${csv.path}
|
|
2522
2522
|
inspect: ${inspection.inspect}
|
|
@@ -2525,7 +2525,7 @@ inspect: ${inspection.inspect}
|
|
|
2525
2525
|
return true;
|
|
2526
2526
|
}
|
|
2527
2527
|
if (parsed.noPreview) {
|
|
2528
|
-
|
|
2528
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0,
|
|
2529
2529
|
{
|
|
2530
2530
|
...materializedEnvelope,
|
|
2531
2531
|
local: {
|
|
@@ -2538,7 +2538,7 @@ inspect: ${inspection.inspect}
|
|
|
2538
2538
|
);
|
|
2539
2539
|
return true;
|
|
2540
2540
|
}
|
|
2541
|
-
|
|
2541
|
+
_chunkODKHUBU3js.printCommandEnvelope.call(void 0, materializedEnvelope, {
|
|
2542
2542
|
json: wantsJson && parsed.outputFormat !== "csv"
|
|
2543
2543
|
});
|
|
2544
2544
|
return true;
|