deepline 0.3.328 → 0.3.330
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/billing-idempotency.ts +24 -0
- package/dist/bundling-sources/sdk/src/client.ts +22 -22
- package/dist/bundling-sources/sdk/src/index.ts +1 -0
- package/dist/bundling-sources/sdk/src/play.ts +55 -45
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +16 -0
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +31 -15
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +22 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +29 -11
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +145 -19
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -10
- package/dist/bundling-sources/shared_libs/plays/dataset.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +59 -10
- package/dist/cli/{auth-ANHHABWT.mjs → auth-A4XQ3KMW.mjs} +4 -4
- package/dist/cli/auth-XJJYQESF.js +31 -0
- package/dist/cli/{billing-R6NYYO6G.mjs → billing-634WZLKG.mjs} +36 -14
- package/dist/cli/{billing-GGVKLFE6.js → billing-WLHXYC5Z.js} +101 -79
- package/dist/cli/{chunk-ZND34HL7.mjs → chunk-3QZ22IZO.mjs} +4 -4
- package/dist/cli/{chunk-UDIPEHNJ.js → chunk-46IVSO6O.js} +141 -11
- package/dist/cli/{chunk-GZV5F6CL.mjs → chunk-56RM5AQF.mjs} +79 -26
- package/dist/cli/{chunk-UM4ZE3P7.mjs → chunk-5W636CDP.mjs} +2 -2
- package/dist/cli/{chunk-W6WV6UME.js → chunk-63W4744F.js} +563 -555
- package/dist/cli/{chunk-OOLIEDIJ.mjs → chunk-6VBXS43D.mjs} +2 -2
- package/dist/cli/{chunk-B2R66UTW.mjs → chunk-7DGZCMXQ.mjs} +1 -1
- package/dist/cli/{chunk-7DDNACAQ.js → chunk-7FWHOKNS.js} +26 -26
- package/dist/cli/{chunk-YIY74KUF.mjs → chunk-EV4QJE4J.mjs} +1 -1
- package/dist/cli/{chunk-2HKPAZVJ.js → chunk-FKKNYKDY.js} +14 -3
- package/dist/cli/{chunk-DNYRAZSK.js → chunk-FLIABSY6.js} +48 -48
- package/dist/cli/{chunk-O5GPNPOC.js → chunk-GHHLLEZK.js} +4 -4
- package/dist/cli/{chunk-ZFKUVDOM.js → chunk-GKZZ32EV.js} +60 -60
- package/dist/cli/{chunk-LJWC5HSO.js → chunk-GS7GA7PI.js} +15 -15
- package/dist/cli/{chunk-7R6KQSFA.mjs → chunk-GTBS6LQH.mjs} +38 -22
- package/dist/cli/{chunk-2FPVWL4W.js → chunk-LNDGT7NV.js} +119 -66
- package/dist/cli/{chunk-SMGNDW7O.mjs → chunk-LQ5DD2UF.mjs} +2 -2
- package/dist/cli/{chunk-WWVE4HFN.mjs → chunk-MBI3BVSQ.mjs} +1 -1
- package/dist/cli/{chunk-KP7W5NO6.mjs → chunk-NTVTZAVZ.mjs} +13 -2
- package/dist/cli/{chunk-XVKQ6D4K.js → chunk-O2L46S3I.js} +2 -2
- package/dist/cli/{chunk-BC7FMQ2G.mjs → chunk-PH2N6GC7.mjs} +1 -1
- package/dist/cli/{chunk-6ENR652E.mjs → chunk-SDSS4OTO.mjs} +77 -69
- package/dist/cli/{chunk-YFCHBN3C.mjs → chunk-SZCUJ4AL.mjs} +1 -1
- package/dist/cli/{chunk-AGH6YP2T.js → chunk-UQV5M6HN.js} +3 -3
- package/dist/cli/{chunk-7MABE3ZK.mjs → chunk-VFC6CZLF.mjs} +135 -5
- package/dist/cli/{chunk-DNMV2L7Q.js → chunk-WHKTRZ3J.js} +6 -6
- package/dist/cli/{chunk-Y4LXIUHX.js → chunk-XUNMVZOW.js} +1 -1
- package/dist/cli/{chunk-LEEXRXQQ.js → chunk-YFP4UH2Y.js} +6 -6
- package/dist/cli/{chunk-ITFUZEHE.js → chunk-YGFQ7YSM.js} +51 -35
- package/dist/cli/{chunk-AKKQ26RX.mjs → chunk-ZYPFCBW5.mjs} +1 -1
- package/dist/cli/client-3CREIHGC.js +20 -0
- package/dist/cli/{client-ZABA5NMD.mjs → client-WYFGEJOX.mjs} +3 -3
- package/dist/cli/{csv-VECE3PWX.mjs → csv-BDZSDXLU.mjs} +3 -3
- package/dist/cli/{csv-4ZK5ZJAJ.js → csv-THMQDXCJ.js} +12 -12
- package/dist/cli/{db-UJPCDBV7.js → db-5BQJOZG7.js} +29 -29
- package/dist/cli/{db-6VE4OEWW.mjs → db-R2LTNLFM.mjs} +4 -4
- package/dist/cli/{describe-CFUZZ326.js → describe-F4G5H3SC.js} +17 -17
- package/dist/cli/{describe-W6X5G4JR.mjs → describe-WECII7FS.mjs} +10 -10
- package/dist/cli/{executions-AI4DTQQL.js → executions-HJRVD4M6.js} +6 -6
- package/dist/cli/{executions-ZZWB75DF.mjs → executions-HPRIRB73.mjs} +4 -4
- package/dist/cli/{feedback-IM5Z6T5K.mjs → feedback-5VVW5WW7.mjs} +3 -3
- package/dist/cli/{feedback-FYSNSYUU.js → feedback-GHGDH43D.js} +6 -6
- package/dist/cli/{git-YNYTK3YW.mjs → git-BBXML2UJ.mjs} +4 -4
- package/dist/cli/git-NNEBLRVP.js +23 -0
- package/dist/cli/index.js +79 -79
- package/dist/cli/index.mjs +31 -31
- package/dist/cli/{legacy-noops-4DTMYYUY.mjs → legacy-noops-IALOUAGL.mjs} +4 -4
- package/dist/cli/{legacy-noops-PHJE2XFK.js → legacy-noops-VNZZ3VVT.js} +7 -7
- package/dist/cli/{monitors-27JP76WE.js → monitors-MLP6IA2R.js} +85 -85
- package/dist/cli/{monitors-HUP4MVWJ.mjs → monitors-VDEB2FKS.mjs} +4 -4
- package/dist/cli/{org-RHVDMUKN.js → org-N6ADDGEV.js} +60 -60
- package/dist/cli/{org-L3B2RR4U.mjs → org-SDSSKY42.mjs} +4 -4
- package/dist/cli/play-UTIPBVDQ.js +153 -0
- package/dist/cli/{play-UXIJVYNF.mjs → play-VSTVY6PM.mjs} +9 -9
- package/dist/cli/{providers-VL6VY56M.js → providers-TJ42O6NN.js} +7 -7
- package/dist/cli/{providers-FABWTNKR.mjs → providers-UKC7KD3W.mjs} +4 -4
- package/dist/cli/{quickstart-IIPZ6DSY.js → quickstart-7S7NMCMX.js} +5 -5
- package/dist/cli/{quickstart-OA54A4IE.mjs → quickstart-WSKATNHJ.mjs} +3 -3
- package/dist/cli/{search-YDK4V2EW.mjs → search-6OS6VVCJ.mjs} +5 -5
- package/dist/cli/search-Y6UGKL5C.js +26 -0
- package/dist/cli/{secrets-JGU7ZRUW.js → secrets-GWLYB2KD.js} +13 -13
- package/dist/cli/{secrets-4MQF6RF6.mjs → secrets-QTTR5R5M.mjs} +4 -4
- package/dist/cli/{sessions-PTHOMSZ5.mjs → sessions-Q7MY5YYI.mjs} +4 -4
- package/dist/cli/{sessions-I7ZZYSYW.js → sessions-SUURWTVX.js} +5 -5
- package/dist/cli/{settings-X4ENSGNK.mjs → settings-3D5YDD2B.mjs} +7 -7
- package/dist/cli/{settings-ZUUBKIG6.js → settings-W4DYMYFA.js} +74 -74
- package/dist/cli/{setup-4UM6FCZL.mjs → setup-5F5OGYKW.mjs} +6 -6
- package/dist/cli/{setup-6L576TQE.js → setup-NIUADTDP.js} +41 -41
- package/dist/cli/skills-SHUL5UT7.js +28 -0
- package/dist/cli/{skills-U3BS5KUI.mjs → skills-TV3ORUIG.mjs} +4 -4
- package/dist/cli/tools-GNIVV4OF.js +40 -0
- package/dist/cli/{tools-O4PX6UVB.mjs → tools-YSZWAFKO.mjs} +7 -6
- package/dist/cli/{update-OHWSK2WN.mjs → update-FJAMLGLT.mjs} +6 -6
- package/dist/cli/update-U3XGY6IT.js +28 -0
- package/dist/cli/{workflow-QWTZBLT3.js → workflow-C6ZCM5S4.js} +15 -15
- package/dist/cli/{workflow-RVMGBMLX.mjs → workflow-HDHBYC7S.mjs} +5 -5
- package/dist/{client-wiWPZhnI.d.mts → client-D5XOQKsA.d.mts} +20 -1
- package/dist/{client-DHq8dJ56.d.ts → client-l-IoLh8Z.d.ts} +20 -1
- package/dist/{compiler-manifest-9TkZ_ykI.d.mts → compiler-manifest-82q4jtfQ.d.mts} +44 -17
- package/dist/{compiler-manifest-9TkZ_ykI.d.ts → compiler-manifest-82q4jtfQ.d.ts} +44 -17
- package/dist/{index-B-5_Xhud.d.mts → index-BPbW2XHF.d.mts} +1 -1
- package/dist/{index-ykksoEyR.d.ts → index-k0rquHIm.d.ts} +1 -1
- package/dist/index.d.mts +14 -8
- package/dist/index.d.ts +14 -8
- package/dist/index.js +194 -69
- package/dist/index.mjs +162 -37
- package/dist/install-integrity.json +85 -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/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 +2 -1
- package/dist/cli/auth-EKRB4GMP.js +0 -31
- package/dist/cli/client-55BDB4LE.js +0 -20
- package/dist/cli/git-VWXH6LCP.js +0 -23
- package/dist/cli/play-UKH4VFPF.js +0 -153
- package/dist/cli/search-JD2VTR4A.js +0 -26
- package/dist/cli/skills-TLPNCERR.js +0 -28
- package/dist/cli/tools-26JTFFU4.js +0 -39
- package/dist/cli/update-35RRCU2G.js +0 -28
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYGFQ7YSMjs = require('./chunk-YGFQ7YSM.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _chunkDNMV2L7Qjs = require('./chunk-DNMV2L7Q.js');
|
|
7
6
|
|
|
7
|
+
var _chunkWHKTRZ3Jjs = require('./chunk-WHKTRZ3J.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
var _chunkGHHLLEZKjs = require('./chunk-GHHLLEZK.js');
|
|
11
12
|
|
|
12
13
|
// src/cli/search-ref.ts
|
|
13
14
|
var _fs = require('fs');
|
|
14
15
|
var _path = require('path');
|
|
15
16
|
var SEARCH_REF_TTL_MS = 15 * 6e4;
|
|
16
17
|
function lastSearchPath() {
|
|
17
|
-
return _path.join.call(void 0,
|
|
18
|
+
return _path.join.call(void 0, _chunkGHHLLEZKjs.sdkCliStateDirPath.call(void 0, _chunkGHHLLEZKjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
|
|
18
19
|
}
|
|
19
20
|
function rememberSearchRef(searchRef) {
|
|
20
21
|
try {
|
|
@@ -36,6 +37,132 @@ function recentSearchRef() {
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
40
|
+
// src/cli/text-table.ts
|
|
41
|
+
var _table = require('table');
|
|
42
|
+
function formatTextTable(rows, columns) {
|
|
43
|
+
if (columns.length === 0) return "";
|
|
44
|
+
const data = [
|
|
45
|
+
columns.map((column) => column.header),
|
|
46
|
+
...rows.map((row) => columns.map((column) => column.value(row)))
|
|
47
|
+
];
|
|
48
|
+
return _table.table.call(void 0, data, {
|
|
49
|
+
border: _table.getBorderCharacters.call(void 0, "void"),
|
|
50
|
+
drawHorizontalLine: () => false,
|
|
51
|
+
columnDefault: { paddingLeft: 0, paddingRight: 2 },
|
|
52
|
+
columns: columns.map((column, index) => ({
|
|
53
|
+
alignment: _nullishCoalesce(column.alignment, () => ( "left")),
|
|
54
|
+
// table@6's word wrapper counts UTF-16 characters instead of display
|
|
55
|
+
// cells. Use its display-width-safe character wrapper for Unicode;
|
|
56
|
+
// unbounded identifiers never need wrapping in the first place.
|
|
57
|
+
wrapWord: column.width !== void 0 && data.every((row) => new RegExp("^\\p{ASCII}*$", "u").test(row[index])),
|
|
58
|
+
...column.width === void 0 ? {} : { width: column.width }
|
|
59
|
+
}))
|
|
60
|
+
}).split("\n").map((line) => line.trimEnd()).join("\n").trimEnd();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// src/cli/search-output.ts
|
|
64
|
+
function clipSummary(value) {
|
|
65
|
+
const characters = Array.from(value.replace(/\s+/gu, " ").trim());
|
|
66
|
+
return characters.length <= 78 ? characters.join("") : `${characters.slice(0, 77).join("")}\u2026`;
|
|
67
|
+
}
|
|
68
|
+
function pricingDisplay(item) {
|
|
69
|
+
const pricing = item.pricing;
|
|
70
|
+
if (!pricing)
|
|
71
|
+
return { cost: item.kind === "tool" ? "unknown" : "\u2014", notes: [] };
|
|
72
|
+
const range = pricing.estimatedRange;
|
|
73
|
+
if (range && item.billingSource !== "own_provider_credentials") {
|
|
74
|
+
return {
|
|
75
|
+
cost: `${range.minCreditsPerUnit}\u2013${range.maxCreditsPerUnit}/${pricing.unit} (estimate)`,
|
|
76
|
+
notes: [range.scope]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const observed = pricing.observedReference;
|
|
80
|
+
if (observed) {
|
|
81
|
+
return {
|
|
82
|
+
cost: `${observed.creditsPerCall}/call (observed)`,
|
|
83
|
+
notes: [
|
|
84
|
+
`Observed reference: ${observed.sampleSize} call(s), ${observed.observedAt}; ${observed.inputMode} Not a quote.`
|
|
85
|
+
]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (item.billingSource === "own_provider_credentials") {
|
|
89
|
+
return {
|
|
90
|
+
cost: "0 (own credentials)",
|
|
91
|
+
notes: ["Your provider quota still applies."]
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const display = _nullishCoalesce(pricing.displayText, () => ( ""));
|
|
95
|
+
const rate = display.match(
|
|
96
|
+
/^([\d.,]+) Deepline credits(?: \/ \$[\d.,]+)? per (call|result|page)( \(estimate\))?$/
|
|
97
|
+
);
|
|
98
|
+
if (rate)
|
|
99
|
+
return {
|
|
100
|
+
cost: `${rate[1]}/${rate[2]}${_nullishCoalesce(rate[3], () => ( ""))}${pricing.summary || _optionalChain([pricing, 'access', _ => _.details, 'optionalAccess', _2 => _2.length]) ? "*" : ""}`,
|
|
101
|
+
notes: []
|
|
102
|
+
};
|
|
103
|
+
if (pricing.creditsPerUnit === 0 && /^Free\b/.test(display)) {
|
|
104
|
+
return { cost: "0 (free)", notes: [] };
|
|
105
|
+
}
|
|
106
|
+
if (!display || display === "Pricing unavailable.")
|
|
107
|
+
return { cost: "unknown", notes: [] };
|
|
108
|
+
return {
|
|
109
|
+
cost: pricing.unit === "usage" ? "usage-based" : "variable",
|
|
110
|
+
notes: display ? [clipSummary(display)] : []
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function searchRow(item) {
|
|
114
|
+
const { cost, notes } = pricingDisplay(item);
|
|
115
|
+
if (item.credentialStatus === "requires_connection") {
|
|
116
|
+
notes.push("Requires your credentials \u2014 not connected (connect to use).");
|
|
117
|
+
} else if (item.connected === false && item.credentialStatus === "managed") {
|
|
118
|
+
notes.push("Temporarily unavailable.");
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
id: item.id,
|
|
122
|
+
kind: item.kind,
|
|
123
|
+
cost,
|
|
124
|
+
summary: clipSummary(_nullishCoalesce(item.description, () => ( ""))),
|
|
125
|
+
notes
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function renderSearchResults(result) {
|
|
129
|
+
if (result.results.length === 0)
|
|
130
|
+
return _chunkWHKTRZ3Jjs.renderCommandEnvelopeText.call(void 0, result);
|
|
131
|
+
const rows = result.results.map(searchRow);
|
|
132
|
+
const kinds = new Set(rows.map((row) => row.kind));
|
|
133
|
+
const onlyTools = kinds.size === 1 && kinds.has("tool");
|
|
134
|
+
const columns = [
|
|
135
|
+
{ header: onlyTools ? "TOOL" : "ID", value: (row) => row.id },
|
|
136
|
+
...!onlyTools ? [{ header: "KIND", value: (row) => row.kind }] : [],
|
|
137
|
+
{ header: "CREDITS", value: (row) => row.cost, alignment: "right" },
|
|
138
|
+
{ header: "SUMMARY", value: (row) => row.summary }
|
|
139
|
+
];
|
|
140
|
+
const render = result.render;
|
|
141
|
+
const title = _nullishCoalesce(_optionalChain([render, 'optionalAccess', _3 => _3.sections, 'optionalAccess', _4 => _4[0], 'optionalAccess', _5 => _5.title]), () => ( `${_nullishCoalesce(result.total, () => ( rows.length))} matches \u2014 showing ${rows.length}`));
|
|
142
|
+
const remaining = {
|
|
143
|
+
sections: _optionalChain([render, 'optionalAccess', _6 => _6.sections, 'optionalAccess', _7 => _7.slice, 'call', _8 => _8(1)]),
|
|
144
|
+
actions: _optionalChain([render, 'optionalAccess', _9 => _9.actions])
|
|
145
|
+
};
|
|
146
|
+
const followUps = _optionalChain([remaining, 'access', _10 => _10.sections, 'optionalAccess', _11 => _11.length]) || _optionalChain([remaining, 'access', _12 => _12.actions, 'optionalAccess', _13 => _13.length]) ? `
|
|
147
|
+
${_chunkWHKTRZ3Jjs.renderCommandEnvelopeText.call(void 0, { render: remaining })}` : "";
|
|
148
|
+
const notes = rows.flatMap(
|
|
149
|
+
(row) => row.notes.map((note) => ` ${row.id}: ${note}`)
|
|
150
|
+
);
|
|
151
|
+
const details = [
|
|
152
|
+
...notes.length ? ["Notes", ...notes, ""] : [],
|
|
153
|
+
...rows.some((row) => row.cost.endsWith("*")) ? [
|
|
154
|
+
"* Additional pricing conditions apply; see full pricing before execution."
|
|
155
|
+
] : [],
|
|
156
|
+
"Full descriptions and pricing: deepline tools describe <toolId> or search --json."
|
|
157
|
+
].join("\n");
|
|
158
|
+
return `${title}
|
|
159
|
+
|
|
160
|
+
${formatTextTable(rows, columns)}
|
|
161
|
+
|
|
162
|
+
${details}
|
|
163
|
+
${followUps}`;
|
|
164
|
+
}
|
|
165
|
+
|
|
39
166
|
// src/cli/commands/search.ts
|
|
40
167
|
var SEARCH_TYPES = [
|
|
41
168
|
"tools",
|
|
@@ -78,8 +205,8 @@ function addSearchOptions(command) {
|
|
|
78
205
|
function pointAtDescribe(result) {
|
|
79
206
|
const old = /`deepline (tools|plays) describe [^`]*`/;
|
|
80
207
|
const render = result.render;
|
|
81
|
-
for (const section of _nullishCoalesce(_optionalChain([render, 'optionalAccess',
|
|
82
|
-
if (!_optionalChain([section, 'access',
|
|
208
|
+
for (const section of _nullishCoalesce(_optionalChain([render, 'optionalAccess', _14 => _14.sections]), () => ( []))) {
|
|
209
|
+
if (!_optionalChain([section, 'access', _15 => _15.lines, 'optionalAccess', _16 => _16.some, 'call', _17 => _17((line) => old.test(line))])) continue;
|
|
83
210
|
section.lines = [
|
|
84
211
|
"Run `deepline describe <id>` before executing a tool or running a play.",
|
|
85
212
|
...section.lines.filter((line) => !old.test(line))
|
|
@@ -91,13 +218,13 @@ function pointAtDescribe(result) {
|
|
|
91
218
|
}
|
|
92
219
|
}
|
|
93
220
|
async function runSearch(queryInput, options, types, exclude = []) {
|
|
94
|
-
const query = _nullishCoalesce(_optionalChain([queryInput, 'optionalAccess',
|
|
221
|
+
const query = _nullishCoalesce(_optionalChain([queryInput, 'optionalAccess', _18 => _18.trim, 'call', _19 => _19()]), () => ( ""));
|
|
95
222
|
const searchTerms = _nullishCoalesce(options.searchTerms, () => ( options.search_terms));
|
|
96
|
-
if (!query && !_optionalChain([options, 'access',
|
|
223
|
+
if (!query && !_optionalChain([options, 'access', _20 => _20.categories, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]) && !_optionalChain([searchTerms, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()])) {
|
|
97
224
|
console.error(USAGE);
|
|
98
225
|
return 1;
|
|
99
226
|
}
|
|
100
|
-
const { search_ref: searchRef, ...result } = await new (0,
|
|
227
|
+
const { search_ref: searchRef, ...result } = await new (0, _chunkYGFQ7YSMjs.DeeplineClient)().search({
|
|
101
228
|
query,
|
|
102
229
|
types,
|
|
103
230
|
exclude,
|
|
@@ -111,8 +238,9 @@ async function runSearch(queryInput, options, types, exclude = []) {
|
|
|
111
238
|
});
|
|
112
239
|
if (searchRef) rememberSearchRef(searchRef);
|
|
113
240
|
pointAtDescribe(result);
|
|
114
|
-
|
|
115
|
-
json: options.json === true
|
|
241
|
+
_chunkWHKTRZ3Jjs.printCommandEnvelope.call(void 0, result, {
|
|
242
|
+
json: options.json === true,
|
|
243
|
+
text: renderSearchResults(result)
|
|
116
244
|
});
|
|
117
245
|
return 0;
|
|
118
246
|
}
|
|
@@ -166,6 +294,8 @@ Notes:
|
|
|
166
294
|
materially improves ranking, especially for short queries.
|
|
167
295
|
Search prints a readable result list by default, piped or not, and that is
|
|
168
296
|
the recommended form. Pass --json only when a program parses the result.
|
|
297
|
+
Readable prices are Deepline credits with a per-row unit. Estimates and
|
|
298
|
+
observed historical charges are labelled; usage-based prices are not quotes.
|
|
169
299
|
|
|
170
300
|
Examples:
|
|
171
301
|
deepline search "find work email"
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
recentSearchRef,
|
|
12
12
|
registerDeprecatedSearchCommand
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VFC6CZLF.mjs";
|
|
14
14
|
import {
|
|
15
15
|
extractSummaryFields,
|
|
16
16
|
projectRowOutput,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
DeeplineClient,
|
|
24
24
|
validateExecutionIdempotencyKey
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-GTBS6LQH.mjs";
|
|
26
26
|
import {
|
|
27
27
|
beginToolExecuteCommand,
|
|
28
28
|
getToolExecuteInvocationId,
|
|
@@ -36,11 +36,14 @@ import {
|
|
|
36
36
|
printJsonError,
|
|
37
37
|
renderCommandEnvelopeText,
|
|
38
38
|
shouldEmitJson
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-7DGZCMXQ.mjs";
|
|
40
40
|
import {
|
|
41
41
|
resolveConfig,
|
|
42
42
|
sdkCliStateDirPath
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-MBI3BVSQ.mjs";
|
|
44
|
+
import {
|
|
45
|
+
playToolListGetterMode
|
|
46
|
+
} from "./chunk-NTVTZAVZ.mjs";
|
|
44
47
|
import {
|
|
45
48
|
DeeplineError
|
|
46
49
|
} from "./chunk-NXGCO4JB.mjs";
|
|
@@ -302,7 +305,19 @@ var CapabilityDescription = class _CapabilityDescription {
|
|
|
302
305
|
billingSource,
|
|
303
306
|
billingSourceLabel,
|
|
304
307
|
deeplineCreditsPerPricingUnit: isFree ? 0 : canonicalCredits,
|
|
305
|
-
deeplineUsdPerPricingUnit: isFree ? 0 : canonicalUsd
|
|
308
|
+
deeplineUsdPerPricingUnit: isFree ? 0 : canonicalUsd,
|
|
309
|
+
...pricing.estimatedRange && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
310
|
+
estimatedRange: pricing.estimatedRange,
|
|
311
|
+
details: Array.isArray(pricing.details) ? pricing.details.filter(
|
|
312
|
+
(value) => typeof value === "string"
|
|
313
|
+
) : []
|
|
314
|
+
} : {},
|
|
315
|
+
...pricing.observedReference && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
316
|
+
observedReference: pricing.observedReference,
|
|
317
|
+
details: Array.isArray(pricing.details) ? pricing.details.filter(
|
|
318
|
+
(value) => typeof value === "string"
|
|
319
|
+
) : []
|
|
320
|
+
} : {}
|
|
306
321
|
};
|
|
307
322
|
}
|
|
308
323
|
};
|
|
@@ -959,6 +974,7 @@ Notes:
|
|
|
959
974
|
preserve the nesting shown in the tool's example. Schemas and examples are
|
|
960
975
|
separate describe fields.
|
|
961
976
|
get is accepted as a compatibility alias for describe.
|
|
977
|
+
Text by default, including when piped; pass --json for structured output.
|
|
962
978
|
|
|
963
979
|
Examples:
|
|
964
980
|
deepline tools describe hunter_email_verifier
|
|
@@ -971,7 +987,7 @@ Examples:
|
|
|
971
987
|
deepline tools describe ai_evaluate --estimate-payload @payload.json --json
|
|
972
988
|
deepline tools execute hunter_email_verifier --input '{"email":"a@b.com"}'
|
|
973
989
|
`
|
|
974
|
-
).option("--json", "Emit JSON output
|
|
990
|
+
).option("--json", "Emit JSON output").option(
|
|
975
991
|
"--model <model>",
|
|
976
992
|
"For language tools, include AI Gateway metadata; for ai_evaluate, set the quote payload model"
|
|
977
993
|
).option(
|
|
@@ -1013,7 +1029,7 @@ Examples:
|
|
|
1013
1029
|
process.exitCode = await narrowView();
|
|
1014
1030
|
return;
|
|
1015
1031
|
}
|
|
1016
|
-
const { describeAnything } = await import("./describe-
|
|
1032
|
+
const { describeAnything } = await import("./describe-WECII7FS.mjs");
|
|
1017
1033
|
process.exitCode = await describeAnything(
|
|
1018
1034
|
toolId,
|
|
1019
1035
|
{ ...options, kinds: ["tools", "monitors"], fetchedTool: metadata },
|
|
@@ -1230,14 +1246,6 @@ ${formatModelDescription(modelDescription)}`);
|
|
|
1230
1246
|
if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
|
|
1231
1247
|
return 0;
|
|
1232
1248
|
}
|
|
1233
|
-
if (shouldEmitJson()) {
|
|
1234
|
-
printCompactJson({
|
|
1235
|
-
...toolContractJsonForDescribe(tool, toolId),
|
|
1236
|
-
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1237
|
-
...inferenceQuote ? { inferenceQuote } : {}
|
|
1238
|
-
});
|
|
1239
|
-
return 0;
|
|
1240
|
-
}
|
|
1241
1249
|
printCompactToolContract(tool, toolId);
|
|
1242
1250
|
if (modelDescription) {
|
|
1243
1251
|
process.stdout.write(`
|
|
@@ -1257,7 +1265,7 @@ function inferenceQuoteSummaryLines(_quote) {
|
|
|
1257
1265
|
function printInferenceQuoteSummary(quote) {
|
|
1258
1266
|
for (const line of inferenceQuoteSummaryLines(quote)) console.log(line);
|
|
1259
1267
|
}
|
|
1260
|
-
function toolContractJsonForDescribe(tool, requestedToolId) {
|
|
1268
|
+
function toolContractJsonForDescribe(tool, requestedToolId, authoringContractEdition) {
|
|
1261
1269
|
const toolId = String(tool.toolId || requestedToolId);
|
|
1262
1270
|
const inputFields = toolInputFieldsForDisplay(
|
|
1263
1271
|
recordField(tool, "inputSchema", "input_schema")
|
|
@@ -1276,7 +1284,11 @@ function toolContractJsonForDescribe(tool, requestedToolId) {
|
|
|
1276
1284
|
);
|
|
1277
1285
|
const extractedLists = extractionContractEntries(
|
|
1278
1286
|
arrayField2(toolExecutionResult, "extractedLists", "extracted_lists")
|
|
1279
|
-
)
|
|
1287
|
+
).map((entry) => ({
|
|
1288
|
+
...entry,
|
|
1289
|
+
returnType: playToolListGetterMode(authoringContractEdition) === "array" ? "Array" : "PlayDataset",
|
|
1290
|
+
rowsExpression: playToolListGetterMode(authoringContractEdition) === "array" ? entry.expression : `await ${entry.expression}.materialize()`
|
|
1291
|
+
}));
|
|
1280
1292
|
const extractedValues = extractionContractEntries(
|
|
1281
1293
|
arrayField2(toolExecutionResult, "extractedValues", "extracted_values")
|
|
1282
1294
|
);
|
|
@@ -1685,7 +1697,7 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1685
1697
|
if (listGetters.length || valueGetters.length) {
|
|
1686
1698
|
console.log("");
|
|
1687
1699
|
console.log("Getters:");
|
|
1688
|
-
if (listGetters.length) console.log(
|
|
1700
|
+
if (listGetters.length) console.log(listGetterHeading());
|
|
1689
1701
|
for (const entry of listGetters) {
|
|
1690
1702
|
if (isRecord(entry))
|
|
1691
1703
|
console.log(
|
|
@@ -1723,6 +1735,10 @@ function toolPricingOnlyLines(tool, requestedToolId, options = {}) {
|
|
|
1723
1735
|
const price = displayText || summary || (credits !== null ? `${formatDecimal(credits)} Deepline credits${usd !== null ? ` / ${formatUsd(usd)}` : ""} per ${unit}` : "pricing unavailable");
|
|
1724
1736
|
return [
|
|
1725
1737
|
`${options.heading ?? `Pricing: ${toolId}`}: ${price}`,
|
|
1738
|
+
...cost.observedReference || cost.estimatedRange ? [
|
|
1739
|
+
...summary ? [` ${summary}`] : [],
|
|
1740
|
+
...(cost.details ?? []).map((detail) => ` ${detail}`)
|
|
1741
|
+
] : [],
|
|
1726
1742
|
`Billing: ${billing}`
|
|
1727
1743
|
];
|
|
1728
1744
|
}
|
|
@@ -1807,7 +1823,7 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1807
1823
|
const getters = isRecord(contract.getters) ? contract.getters : {};
|
|
1808
1824
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1809
1825
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1810
|
-
const firstGetter =
|
|
1826
|
+
const firstGetter = valueGetters.find(isRecord);
|
|
1811
1827
|
if (firstGetter) {
|
|
1812
1828
|
const name = stringField2(firstGetter, "name") || "value";
|
|
1813
1829
|
const expression = stringField2(firstGetter, "expression");
|
|
@@ -1816,7 +1832,28 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1816
1832
|
`const ${safeIdentifier(name)} = ${expression.replace(/^toolExecutionResult\./, "result.")};`
|
|
1817
1833
|
);
|
|
1818
1834
|
}
|
|
1835
|
+
const arrayNames = new Set(
|
|
1836
|
+
recursiveToolInputFieldsForDisplay(
|
|
1837
|
+
recordField(tool, "outputSchema", "output_schema")
|
|
1838
|
+
).filter((field) => String(field.type).split("|").includes("array")).map((field) => String(field.name).split(".").at(-1))
|
|
1839
|
+
);
|
|
1840
|
+
const firstList = listGetters.find(
|
|
1841
|
+
(entry) => isRecord(entry) && arrayNames.has(stringField2(entry, "name"))
|
|
1842
|
+
) ?? listGetters.find(isRecord);
|
|
1843
|
+
if (isRecord(firstList)) {
|
|
1844
|
+
const name = safeIdentifier(stringField2(firstList, "name") || "list");
|
|
1845
|
+
if (playToolListGetterMode() === "array") {
|
|
1846
|
+
console.log(`const ${name}_rows = ${playResultExpression(firstList)};`);
|
|
1847
|
+
} else {
|
|
1848
|
+
console.log(`const ${name}_ds = ${playResultExpression(firstList)};`);
|
|
1849
|
+
console.log(
|
|
1850
|
+
"// Complete small list from this response; throws above the memory cap."
|
|
1851
|
+
);
|
|
1852
|
+
console.log(`const ${name}_rows = await ${name}_ds.materialize();`);
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1819
1855
|
console.log("```");
|
|
1856
|
+
if (firstList) printListGetterConsumption();
|
|
1820
1857
|
for (const example of examples) {
|
|
1821
1858
|
const description = stringField2(example, "description");
|
|
1822
1859
|
if (description) console.log(description);
|
|
@@ -1863,13 +1900,14 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
1863
1900
|
return;
|
|
1864
1901
|
}
|
|
1865
1902
|
if (listGetters.length) {
|
|
1866
|
-
console.log(
|
|
1903
|
+
console.log(listGetterHeading());
|
|
1867
1904
|
for (const entry of listGetters) {
|
|
1868
1905
|
if (isRecord(entry))
|
|
1869
1906
|
console.log(
|
|
1870
1907
|
`- ${stringField2(entry, "name")}: ${playResultExpression(entry)}`
|
|
1871
1908
|
);
|
|
1872
1909
|
}
|
|
1910
|
+
printListGetterConsumption();
|
|
1873
1911
|
}
|
|
1874
1912
|
if (valueGetters.length) {
|
|
1875
1913
|
console.log("Values:");
|
|
@@ -1881,6 +1919,20 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
1881
1919
|
}
|
|
1882
1920
|
}
|
|
1883
1921
|
}
|
|
1922
|
+
function printListGetterConsumption() {
|
|
1923
|
+
if (playToolListGetterMode() === "array") {
|
|
1924
|
+
console.log(
|
|
1925
|
+
"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."
|
|
1926
|
+
);
|
|
1927
|
+
return;
|
|
1928
|
+
}
|
|
1929
|
+
console.log(
|
|
1930
|
+
"Pass the handle to ctx.dataset, use first() for one row, or for await...of to stream rows. materialize() loads the complete current list within the memory cap; materialize(n) and peek(n) return only a prefix. None fetch additional provider pagination. A missing getter is not an empty list."
|
|
1931
|
+
);
|
|
1932
|
+
}
|
|
1933
|
+
function listGetterHeading() {
|
|
1934
|
+
return playToolListGetterMode() === "array" ? "Lists (ordinary JavaScript arrays):" : "Lists (PlayDataset, not a JavaScript array):";
|
|
1935
|
+
}
|
|
1884
1936
|
function sampleValueForField(field) {
|
|
1885
1937
|
const name = stringField2(field, "name").toLowerCase();
|
|
1886
1938
|
const type = stringField2(field, "type").toLowerCase();
|
|
@@ -2010,15 +2062,16 @@ function usageGuidanceWithAccessDefaults(usageGuidance) {
|
|
|
2010
2062
|
},
|
|
2011
2063
|
access: {
|
|
2012
2064
|
...existingAccess,
|
|
2013
|
-
extractedLists: {
|
|
2014
|
-
expression: "toolExecutionResult.extractedLists.<name>.get()",
|
|
2015
|
-
meaning: "Declared Deepline list extractors only."
|
|
2016
|
-
},
|
|
2017
2065
|
extractedValues: {
|
|
2018
2066
|
expression: "toolExecutionResult.extractedValues.<name>.get()",
|
|
2019
2067
|
meaning: "Declared Deepline scalar or normalized object extractors only."
|
|
2020
2068
|
},
|
|
2021
2069
|
...existingAccess,
|
|
2070
|
+
extractedLists: {
|
|
2071
|
+
...recordField(existingAccess, "extractedLists"),
|
|
2072
|
+
expression: "toolExecutionResult.extractedLists.<name>.get()",
|
|
2073
|
+
meaning: playToolListGetterMode() === "array" ? "Returns an ordinary array from this response. Use array methods directly or pass it to ctx.dataset to persist row work. Lazy or incomplete lists throw; use readList for an explicit dataset read. It does not fetch provider pages." : "Returns a PlayDataset, not a JavaScript array. Pass the handle to ctx.dataset, use first(), async iteration, or await handle.materialize() for the complete current list within the memory cap. materialize(n) and peek(n) return a prefix; none fetch additional provider pages. A missing getter is not an empty list."
|
|
2074
|
+
},
|
|
2022
2075
|
rawToolResponse: {
|
|
2023
2076
|
expression: "toolExecutionResult.toolResponse.rawV2",
|
|
2024
2077
|
meaning: "Complete tool response with its original nesting. Read tool-specific fields here; use declared getters for extracted values and lists."
|
|
@@ -2658,8 +2711,8 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
|
|
|
2658
2711
|
const rows = list.get();
|
|
2659
2712
|
// ${sampleRows}
|
|
2660
2713
|
// columns: ${columns}
|
|
2661
|
-
// extractedLists.<name>.get() returns a dataset handle for row-shaped list outputs.
|
|
2662
|
-
// Pass it to ctx.dataset; use rows.peek/count/materialize only for deliberate bounded inspection.
|
|
2714
|
+
// ${playToolListGetterMode() === "array" ? "extractedLists.<name>.get() returns an ordinary array from this response." : "extractedLists.<name>.get() returns a dataset handle for row-shaped list outputs."}
|
|
2715
|
+
// ${playToolListGetterMode() === "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."}
|
|
2663
2716
|
// .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.' }))
|
|
2664
2717
|
// .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.' }))
|
|
2665
2718
|
// ctx.dataset is idempotent for completed rows during same-run recovery. New runs follow each call's freshness.
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
getAuthedHttpClient,
|
|
3
3
|
openInBrowser,
|
|
4
4
|
printCommandEnvelope
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7DGZCMXQ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
resolveBaseUrlOnly
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MBI3BVSQ.mjs";
|
|
9
9
|
|
|
10
10
|
// src/cli/commands/git.ts
|
|
11
11
|
function shellQuote(value) {
|