deepline 0.3.395 → 0.3.396
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/plays/play-description.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
- package/dist/cli/{auth-NMQXZRS7.mjs → auth-3LTD62VL.mjs} +4 -4
- package/dist/cli/auth-562JPKOM.js +39 -0
- package/dist/cli/{billing-5MVXZRS6.mjs → billing-DP7ZAJBO.mjs} +5 -5
- package/dist/cli/{billing-Z4JTGUU3.js → billing-PA5OXEM5.js} +76 -76
- package/dist/cli/{chunk-BLYL3KOC.mjs → chunk-23GAA3YO.mjs} +1 -1
- package/dist/cli/{chunk-LZLBR2SF.js → chunk-2VOLOWYZ.js} +1087 -1056
- package/dist/cli/{chunk-EFLQHJZ6.mjs → chunk-3T4MCB5R.mjs} +1026 -995
- package/dist/cli/{chunk-VB6KECLU.mjs → chunk-5WNJF2T3.mjs} +102 -36
- package/dist/cli/{chunk-UKU6JM3S.js → chunk-772W2SAU.js} +8 -8
- package/dist/cli/{chunk-K5T3EN6D.js → chunk-7Z66NHUC.js} +26 -26
- package/dist/cli/{chunk-WCCKMLHL.mjs → chunk-AUYXWELC.mjs} +2 -2
- package/dist/cli/{chunk-PZ5BZ76S.js → chunk-AVHLATII.js} +50 -50
- package/dist/cli/{chunk-MYIBHORT.js → chunk-DC6LTULT.js} +2 -2
- package/dist/cli/{chunk-5VCZ3WRH.mjs → chunk-EIMG75BT.mjs} +1 -0
- package/dist/cli/{chunk-TO2MWPGR.js → chunk-GNN4MY5X.js} +1 -1
- package/dist/cli/{chunk-OCSG6X67.mjs → chunk-I4T4XAA2.mjs} +4 -4
- package/dist/cli/{chunk-ZWH2TFA7.mjs → chunk-JCN4DHF7.mjs} +2 -2
- package/dist/cli/{chunk-R4XZO6Z5.js → chunk-KAEZNPUM.js} +23 -8
- package/dist/cli/{chunk-DRM3CMHL.js → chunk-KXMNM4AQ.js} +2 -1
- package/dist/cli/{chunk-3TRY7KAC.mjs → chunk-LOGGNW4H.mjs} +2 -2
- package/dist/cli/{chunk-RDXFGPJU.js → chunk-LWERJUKN.js} +218 -218
- package/dist/cli/{chunk-UCXK2DS4.js → chunk-ME6XRFLY.js} +15 -15
- package/dist/cli/{chunk-G4IWGRMK.mjs → chunk-MR6XCBQJ.mjs} +2 -2
- package/dist/cli/{chunk-BON3DRC6.mjs → chunk-NHB5YUCS.mjs} +1 -1
- package/dist/cli/{chunk-ZMVJSS6N.js → chunk-NSOTASOP.js} +101 -35
- package/dist/cli/{chunk-7XAM7KDW.mjs → chunk-QHGPA362.mjs} +18 -3
- package/dist/cli/{chunk-VYLJJQ7Y.js → chunk-RMTASUAK.js} +65 -65
- package/dist/cli/{chunk-HRWUQJ4K.js → chunk-RTO5QZWT.js} +6 -6
- package/dist/cli/{chunk-7MVWUXOD.mjs → chunk-TLQ3FZOC.mjs} +3 -3
- package/dist/cli/{chunk-56IFFVIB.js → chunk-V7UP2F4U.js} +4 -4
- package/dist/cli/{chunk-6D7A2FSL.mjs → chunk-VE3U3SQC.mjs} +1 -1
- package/dist/cli/{chunk-36ML3YKA.js → chunk-WQJJNIMQ.js} +13 -13
- package/dist/cli/{chunk-47M6HPGP.mjs → chunk-XKZXO7D3.mjs} +1 -1
- package/dist/cli/{csv-SVOD5UBH.mjs → csv-RLRR74RQ.mjs} +3 -3
- package/dist/cli/{csv-HTS5ZYQ4.js → csv-TF576S77.js} +12 -12
- package/dist/cli/{db-7AP4P52N.js → db-FDBJUTFO.js} +30 -30
- package/dist/cli/{db-7QLNI3Q4.mjs → db-XORGNBIC.mjs} +5 -5
- package/dist/cli/{describe-DBRY5BNK.mjs → describe-6O2ENKTP.mjs} +86 -68
- package/dist/cli/{describe-YKOE54ZO.js → describe-EFWNECHI.js} +100 -82
- package/dist/cli/{executions-GRQXTB2P.js → executions-SFYAXPF4.js} +7 -7
- package/dist/cli/{executions-QNZTPNG4.mjs → executions-YPP7WR77.mjs} +5 -5
- package/dist/cli/{feedback-ZOLA2KY7.js → feedback-5UZFYMGB.js} +7 -7
- package/dist/cli/{feedback-JMCSR624.mjs → feedback-RBGA5ARU.mjs} +3 -3
- package/dist/cli/git-5LDY5ZID.js +23 -0
- package/dist/cli/{git-LJGL2IHS.mjs → git-IRSAJEK2.mjs} +4 -4
- package/dist/cli/index.js +94 -94
- package/dist/cli/index.mjs +38 -38
- package/dist/cli/{legacy-noops-YSCIR2SD.js → legacy-noops-CVAOQY2F.js} +7 -7
- package/dist/cli/{legacy-noops-F23PKVBN.mjs → legacy-noops-NA7N6ZOU.mjs} +4 -4
- package/dist/cli/{monitors-WMZ6HJZX.js → monitors-4OMRXCXP.js} +86 -86
- package/dist/cli/{monitors-S4LOEL7W.mjs → monitors-ILZ2XHYG.mjs} +5 -5
- package/dist/cli/{org-U3WA2NQM.mjs → org-QDDXAE3J.mjs} +5 -5
- package/dist/cli/{org-PFHM5ZLY.js → org-YGNJDD2X.js} +65 -65
- package/dist/cli/{chunk-4KLCLLTO.js → play-L535H26U.js} +266 -323
- package/dist/cli/{chunk-XMAPE2KH.mjs → play-VT6OHB2D.mjs} +72 -129
- package/dist/cli/{providers-XYMHLKCA.js → providers-GPZ6PQAL.js} +8 -8
- package/dist/cli/{providers-QBBRFBOH.mjs → providers-KG4W5MPK.mjs} +5 -5
- package/dist/cli/{quickstart-5JTDGISY.mjs → quickstart-2JDGTXIG.mjs} +3 -3
- package/dist/cli/{quickstart-IYGD6ZY3.js → quickstart-UI27S5LO.js} +5 -5
- package/dist/cli/search-MGWROZ33.js +28 -0
- package/dist/cli/{search-X6W6GRHS.mjs → search-PW3RAUX7.mjs} +6 -6
- package/dist/cli/{secrets-N55B67H6.mjs → secrets-HNOMK5A2.mjs} +5 -5
- package/dist/cli/{secrets-UHG6OQFD.js → secrets-WFAXOUZE.js} +14 -14
- package/dist/cli/{sessions-57L5MGHN.js → sessions-366KROUA.js} +5 -5
- package/dist/cli/{sessions-JTRSTDSS.mjs → sessions-XLX3E5UO.mjs} +4 -4
- package/dist/cli/{settings-ATX4U5AS.js → settings-GADAG2UK.js} +75 -75
- package/dist/cli/{settings-Q24HRAQI.mjs → settings-YNZ4YKCH.mjs} +8 -8
- package/dist/cli/{setup-77ZWLVHT.mjs → setup-PSEHIUXO.mjs} +6 -6
- package/dist/cli/{setup-EJCNOUCE.js → setup-R5YO7GT6.js} +41 -41
- package/dist/cli/skills-JF2LPEGM.js +28 -0
- package/dist/cli/{skills-XIS5AWQI.mjs → skills-LTQBP6CZ.mjs} +4 -4
- package/dist/cli/tools-CP2PEFRN.js +34 -0
- package/dist/cli/{tools-WCKLYEGQ.mjs → tools-UAXDWU63.mjs} +11 -19
- package/dist/cli/update-HZHZOU6C.js +28 -0
- package/dist/cli/{update-UT5WANMV.mjs → update-SMNIBIMS.mjs} +6 -6
- package/dist/cli/{workflow-226QYUN2.js → workflow-AOQVZHMD.js} +16 -16
- package/dist/cli/{workflow-ZMX3L4ML.mjs → workflow-IKGMBGF6.mjs} +6 -6
- package/dist/{client-CivP-PAI.d.ts → client-Bgis7F6-.d.ts} +2 -1
- package/dist/{client-hdFtwhTm.d.mts → client-DiGl8ska.d.mts} +2 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -11
- package/dist/index.mjs +9 -9
- package/dist/install-integrity.json +78 -80
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/play-description.js +4 -2
- package/dist/plays/play-description.mjs +3 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- 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-UYCOBAL5.js +0 -39
- package/dist/cli/git-EJQLRK27.js +0 -23
- package/dist/cli/play-AGSECQFN.mjs +0 -159
- package/dist/cli/play-BR2LWGXK.js +0 -159
- package/dist/cli/search-ZVSYH5GY.js +0 -28
- package/dist/cli/skills-SPXUBLII.js +0 -28
- package/dist/cli/tools-DBHUUZJX.js +0 -42
- package/dist/cli/update-VSNFXRHJ.js +0 -28
- package/dist/cli/{chunk-KZZC33PY.mjs → chunk-H5KLUGY7.mjs} +214 -214
|
@@ -1,51 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buildPlayDashboardUrl,
|
|
3
|
-
describedPlay
|
|
4
|
-
} from "./chunk-XMAPE2KH.mjs";
|
|
5
|
-
import "./chunk-3TRY7KAC.mjs";
|
|
6
1
|
import {
|
|
7
2
|
describedTool,
|
|
8
3
|
formatModelDescription,
|
|
9
4
|
publicToolSchemas,
|
|
5
|
+
seedToolListScript,
|
|
10
6
|
toolMetadataJsonForDescribe
|
|
11
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3T4MCB5R.mjs";
|
|
12
8
|
import {
|
|
13
9
|
SCHEMA_LINE_LIMIT,
|
|
14
10
|
addDescribeOptions,
|
|
11
|
+
buildPlayDashboardUrl,
|
|
15
12
|
byokLines,
|
|
16
13
|
describedJson,
|
|
17
14
|
describedLines,
|
|
15
|
+
describedPlay,
|
|
18
16
|
examples,
|
|
19
17
|
schemaLines,
|
|
20
18
|
topLevelField
|
|
21
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5WNJF2T3.mjs";
|
|
22
20
|
import "./chunk-OVDNJAJN.mjs";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-HQXL5526.mjs";
|
|
26
|
-
import "./chunk-7XAM7KDW.mjs";
|
|
27
|
-
import "./chunk-ERFN2QY4.mjs";
|
|
28
|
-
import "./chunk-KZZC33PY.mjs";
|
|
21
|
+
import "./chunk-QHGPA362.mjs";
|
|
22
|
+
import "./chunk-H5KLUGY7.mjs";
|
|
29
23
|
import "./chunk-3HU47EGZ.mjs";
|
|
30
24
|
import {
|
|
31
25
|
DeeplineClient
|
|
32
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-MR6XCBQJ.mjs";
|
|
33
27
|
import "./chunk-6IKARAYD.mjs";
|
|
34
28
|
import "./chunk-JI2B4RZP.mjs";
|
|
35
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-EIMG75BT.mjs";
|
|
36
30
|
import "./chunk-UBKA33KY.mjs";
|
|
37
|
-
import "./chunk-UFS752TU.mjs";
|
|
38
|
-
import "./chunk-GAMFK2ZP.mjs";
|
|
39
31
|
import "./chunk-WXLOW623.mjs";
|
|
40
32
|
import {
|
|
41
33
|
printCommandEnvelope
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-
|
|
34
|
+
} from "./chunk-XKZXO7D3.mjs";
|
|
35
|
+
import "./chunk-VE3U3SQC.mjs";
|
|
44
36
|
import "./chunk-DLIRSHV6.mjs";
|
|
45
37
|
import {
|
|
46
38
|
DeeplineError
|
|
47
39
|
} from "./chunk-NXGCO4JB.mjs";
|
|
48
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-NHB5YUCS.mjs";
|
|
49
41
|
import "./chunk-WZYKRD7T.mjs";
|
|
50
42
|
import "./chunk-KRD6H754.mjs";
|
|
51
43
|
|
|
@@ -116,29 +108,19 @@ async function describeFeature(tool, feature, value, dependencies) {
|
|
|
116
108
|
return VIEWS[feature.view](value ?? feature.defaultValue, tool, dependencies);
|
|
117
109
|
}
|
|
118
110
|
|
|
119
|
-
// src/cli/
|
|
111
|
+
// src/cli/describe-core.ts
|
|
120
112
|
var FILTER_OF = {
|
|
121
113
|
tool: "tools",
|
|
122
114
|
monitor_type: "monitors",
|
|
123
115
|
prebuilt_play: "prebuilts",
|
|
124
116
|
custom_play: "custom"
|
|
125
117
|
};
|
|
126
|
-
async function
|
|
127
|
-
try {
|
|
128
|
-
return await lookup;
|
|
129
|
-
} catch (error) {
|
|
130
|
-
if (error instanceof DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
throw error;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
async function describeAnything(name, options, onMissing) {
|
|
118
|
+
async function describeName(name, options, lookups) {
|
|
137
119
|
const maintainedOnly = options.prebuilt === true || options.tool === true;
|
|
138
120
|
const wants = (filter) => (!options.kinds || options.kinds.includes(filter)) && !(maintainedOnly && filter === "custom");
|
|
139
|
-
const client = new DeeplineClient();
|
|
140
121
|
const play = async (reference) => {
|
|
141
|
-
const record2 = await
|
|
122
|
+
const record2 = await lookups.play(reference);
|
|
123
|
+
if (!record2) return null;
|
|
142
124
|
return {
|
|
143
125
|
described: describedPlay(record2),
|
|
144
126
|
record: { ...record2 },
|
|
@@ -149,7 +131,8 @@ async function describeAnything(name, options, onMissing) {
|
|
|
149
131
|
};
|
|
150
132
|
};
|
|
151
133
|
const tool = async () => {
|
|
152
|
-
const record2 =
|
|
134
|
+
const record2 = await lookups.tool(name);
|
|
135
|
+
if (!record2) return null;
|
|
153
136
|
const { byok } = record2;
|
|
154
137
|
const features = toolFeatures(record2);
|
|
155
138
|
return {
|
|
@@ -160,12 +143,16 @@ async function describeAnything(name, options, onMissing) {
|
|
|
160
143
|
...byok?.required === true ? { byok } : {},
|
|
161
144
|
...features.length ? { features: features.map(({ view: _view, ...feature }) => feature) } : {}
|
|
162
145
|
},
|
|
163
|
-
record: toolMetadataJsonForDescribe(
|
|
146
|
+
record: toolMetadataJsonForDescribe(
|
|
147
|
+
record2,
|
|
148
|
+
name,
|
|
149
|
+
lookups.seedStarterScript
|
|
150
|
+
),
|
|
164
151
|
schemas: publicToolSchemas(record2),
|
|
165
152
|
feature: (featureName, value) => {
|
|
166
153
|
const feature = features.find(({ name: name2 }) => name2 === featureName);
|
|
167
154
|
return feature ? describeFeature(record2, feature, value, {
|
|
168
|
-
describeModel: (model) =>
|
|
155
|
+
describeModel: (model) => lookups.describeModel(model)
|
|
169
156
|
}) : null;
|
|
170
157
|
}
|
|
171
158
|
};
|
|
@@ -177,19 +164,13 @@ async function describeAnything(name, options, onMissing) {
|
|
|
177
164
|
];
|
|
178
165
|
const matches = await Promise.all(
|
|
179
166
|
sources.filter((source) => source.kinds.some(wants)).map(async ({ kinds, find }) => {
|
|
180
|
-
const match = await
|
|
167
|
+
const match = await find();
|
|
181
168
|
const filter = match && FILTER_OF[match.described.kind];
|
|
182
169
|
return filter && kinds.includes(filter) && wants(filter) ? match : null;
|
|
183
170
|
})
|
|
184
171
|
);
|
|
185
172
|
const [chosen, shadowed] = matches.filter((match) => match !== null);
|
|
186
|
-
if (!chosen) {
|
|
187
|
-
if (onMissing) return onMissing();
|
|
188
|
-
console.error(
|
|
189
|
-
`Nothing named "${name}". Search for it: deepline search ${JSON.stringify(name.replace(/[-_./]+/g, " "))}`
|
|
190
|
-
);
|
|
191
|
-
return 2;
|
|
192
|
-
}
|
|
173
|
+
if (!chosen) return { status: "missing" };
|
|
193
174
|
const { described, record } = chosen;
|
|
194
175
|
const shadows = described.kind === "custom_play" && shadowed ? {
|
|
195
176
|
kind: shadowed.described.kind,
|
|
@@ -197,49 +178,49 @@ async function describeAnything(name, options, onMissing) {
|
|
|
197
178
|
} : null;
|
|
198
179
|
const note = shadows ? `Showing your workspace play "${name}". It has the same name as a Deepline ${shadows.kind.replace("_", " ")}; see that one with: ${shadows.describeCommand}` : null;
|
|
199
180
|
const verbose = options.verbose === true;
|
|
200
|
-
const json = options.json === true;
|
|
201
181
|
const isPlay = described.kind === "prebuilt_play" || described.kind === "custom_play";
|
|
202
|
-
const dashboardUrl = isPlay ? buildPlayDashboardUrl(
|
|
182
|
+
const dashboardUrl = isPlay ? buildPlayDashboardUrl(lookups.baseUrl, described.id) : null;
|
|
203
183
|
if (options.webUrl) {
|
|
204
184
|
if (!dashboardUrl) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
185
|
+
return {
|
|
186
|
+
status: "refused",
|
|
187
|
+
message: `${described.id} is a ${described.kind.replace("_", " ")}, not a play; only plays have a play page.`,
|
|
188
|
+
exitCode: 1
|
|
189
|
+
};
|
|
209
190
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
return 0;
|
|
191
|
+
return {
|
|
192
|
+
status: "described",
|
|
193
|
+
envelope: { dashboardUrl },
|
|
194
|
+
lines: [dashboardUrl]
|
|
195
|
+
};
|
|
216
196
|
}
|
|
217
197
|
if (options.feature !== void 0) {
|
|
218
198
|
const { name: featureName, value } = parseFeatureRequest(options.feature);
|
|
219
199
|
const pending = chosen.feature?.(featureName, value) ?? null;
|
|
220
200
|
const features = described.features ?? [];
|
|
221
201
|
if (!pending) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
202
|
+
return {
|
|
203
|
+
status: "refused",
|
|
204
|
+
message: features.length ? `${described.id} has no feature "${featureName}". Its features: ${features.map(({ name: name2 }) => name2).join(", ")}.` : `${described.id} has no features to describe.`,
|
|
205
|
+
exitCode: 2
|
|
206
|
+
};
|
|
226
207
|
}
|
|
227
208
|
const shownValue = value ?? features.find(({ name: name2 }) => name2 === featureName)?.defaultValue;
|
|
228
209
|
const { details, lines } = await pending;
|
|
229
|
-
return
|
|
230
|
-
|
|
210
|
+
return {
|
|
211
|
+
status: "described",
|
|
212
|
+
envelope: {
|
|
231
213
|
kind: described.kind,
|
|
232
214
|
id: described.id,
|
|
233
215
|
feature: featureName,
|
|
234
216
|
...shownValue ? { value: shownValue } : {},
|
|
235
217
|
details
|
|
236
218
|
},
|
|
237
|
-
[
|
|
219
|
+
lines: [
|
|
238
220
|
`${described.id} --feature ${featureName}${shownValue ? `=${shownValue}` : ""}`,
|
|
239
221
|
...lines
|
|
240
|
-
]
|
|
241
|
-
|
|
242
|
-
);
|
|
222
|
+
]
|
|
223
|
+
};
|
|
243
224
|
}
|
|
244
225
|
const fields = (options.fields ?? "").split(",").map((name2) => name2.trim()).filter(Boolean);
|
|
245
226
|
const named = options.cliExample === true || options.playExample === true;
|
|
@@ -305,7 +286,44 @@ async function describeAnything(name, options, onMissing) {
|
|
|
305
286
|
...dashboardUrl ? { dashboardUrl } : {},
|
|
306
287
|
...shadows ? { shadows, note } : {}
|
|
307
288
|
};
|
|
308
|
-
return
|
|
289
|
+
return { status: "described", envelope, lines: view.lines };
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// src/cli/commands/describe.ts
|
|
293
|
+
async function found(lookup) {
|
|
294
|
+
try {
|
|
295
|
+
return await lookup;
|
|
296
|
+
} catch (error) {
|
|
297
|
+
if (error instanceof DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
throw error;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
async function describeAnything(name, options, onMissing) {
|
|
304
|
+
const client = new DeeplineClient();
|
|
305
|
+
const outcome = await describeName(name, options, {
|
|
306
|
+
play: (reference) => found(client.describePlay(reference)),
|
|
307
|
+
tool: async (toolName) => options.fetchedTool ?? await found(client.getTool(toolName)),
|
|
308
|
+
describeModel: (model) => client.describeModel(model),
|
|
309
|
+
baseUrl: client.baseUrl,
|
|
310
|
+
seedStarterScript: seedToolListScript
|
|
311
|
+
});
|
|
312
|
+
if (outcome.status === "missing") {
|
|
313
|
+
if (onMissing) return onMissing();
|
|
314
|
+
console.error(
|
|
315
|
+
`Nothing named "${name}". Search for it: deepline search ${JSON.stringify(name.replace(/[-_./]+/g, " "))}`
|
|
316
|
+
);
|
|
317
|
+
return 2;
|
|
318
|
+
}
|
|
319
|
+
if (outcome.status === "refused") {
|
|
320
|
+
console.error(outcome.message);
|
|
321
|
+
return outcome.exitCode;
|
|
322
|
+
}
|
|
323
|
+
return deliver(outcome.envelope, outcome.lines, {
|
|
324
|
+
json: options.json === true,
|
|
325
|
+
out: options.out
|
|
326
|
+
});
|
|
309
327
|
}
|
|
310
328
|
function deliver(envelope, lines, { json, out }) {
|
|
311
329
|
const text = `${lines.join("\n")}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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
3
|
|
|
4
|
-
var _chunk4KLCLLTOjs = require('./chunk-4KLCLLTO.js');
|
|
5
|
-
require('./chunk-K5T3EN6D.js');
|
|
6
4
|
|
|
7
5
|
|
|
8
6
|
|
|
7
|
+
var _chunk2VOLOWYZjs = require('./chunk-2VOLOWYZ.js');
|
|
9
8
|
|
|
10
9
|
|
|
11
|
-
var _chunkLZLBR2SFjs = require('./chunk-LZLBR2SF.js');
|
|
12
10
|
|
|
13
11
|
|
|
14
12
|
|
|
@@ -18,34 +16,28 @@ var _chunkLZLBR2SFjs = require('./chunk-LZLBR2SF.js');
|
|
|
18
16
|
|
|
19
17
|
|
|
20
18
|
|
|
21
|
-
var
|
|
19
|
+
var _chunkNSOTASOPjs = require('./chunk-NSOTASOP.js');
|
|
22
20
|
require('./chunk-AID3OYVJ.js');
|
|
23
|
-
require('./chunk-
|
|
24
|
-
require('./chunk-
|
|
25
|
-
require('./chunk-GSK6NHVM.js');
|
|
26
|
-
require('./chunk-R4XZO6Z5.js');
|
|
27
|
-
require('./chunk-GEJDBXXM.js');
|
|
28
|
-
require('./chunk-RDXFGPJU.js');
|
|
21
|
+
require('./chunk-KAEZNPUM.js');
|
|
22
|
+
require('./chunk-LWERJUKN.js');
|
|
29
23
|
require('./chunk-KB4SDX5S.js');
|
|
30
24
|
|
|
31
25
|
|
|
32
|
-
var
|
|
26
|
+
var _chunkWQJJNIMQjs = require('./chunk-WQJJNIMQ.js');
|
|
33
27
|
require('./chunk-S6R3OX7B.js');
|
|
34
28
|
require('./chunk-UHNDVD3P.js');
|
|
35
|
-
require('./chunk-
|
|
29
|
+
require('./chunk-KXMNM4AQ.js');
|
|
36
30
|
require('./chunk-XDVT3GOM.js');
|
|
37
|
-
require('./chunk-AYHLUHE5.js');
|
|
38
|
-
require('./chunk-WJYPBHTE.js');
|
|
39
31
|
require('./chunk-QJBJZVG6.js');
|
|
40
32
|
|
|
41
33
|
|
|
42
|
-
var
|
|
43
|
-
require('./chunk-
|
|
34
|
+
var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
|
|
35
|
+
require('./chunk-V7UP2F4U.js');
|
|
44
36
|
require('./chunk-XNYIZMNQ.js');
|
|
45
37
|
|
|
46
38
|
|
|
47
39
|
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
48
|
-
require('./chunk-
|
|
40
|
+
require('./chunk-GNN4MY5X.js');
|
|
49
41
|
require('./chunk-OG64RBAC.js');
|
|
50
42
|
require('./chunk-COGTRVWW.js');
|
|
51
43
|
|
|
@@ -66,13 +58,13 @@ var VIEWS = {
|
|
|
66
58
|
details: model,
|
|
67
59
|
lines: [
|
|
68
60
|
...unlisted,
|
|
69
|
-
...
|
|
61
|
+
..._chunk2VOLOWYZjs.formatModelDescription.call(void 0, model).trimEnd().split("\n")
|
|
70
62
|
]
|
|
71
63
|
};
|
|
72
64
|
},
|
|
73
65
|
byok: async (_value, tool) => ({
|
|
74
66
|
details: _nullishCoalesce(tool.byok, () => ( {})),
|
|
75
|
-
lines:
|
|
67
|
+
lines: _chunkNSOTASOPjs.byokLines.call(void 0, _nullishCoalesce(tool.byok, () => ( {})))
|
|
76
68
|
})
|
|
77
69
|
};
|
|
78
70
|
var isFeatureView = (value) => typeof value === "string" && Object.hasOwn(VIEWS, value);
|
|
@@ -116,31 +108,21 @@ async function describeFeature(tool, feature, value, dependencies) {
|
|
|
116
108
|
return VIEWS[feature.view](_nullishCoalesce(value, () => ( feature.defaultValue)), tool, dependencies);
|
|
117
109
|
}
|
|
118
110
|
|
|
119
|
-
// src/cli/
|
|
111
|
+
// src/cli/describe-core.ts
|
|
120
112
|
var FILTER_OF = {
|
|
121
113
|
tool: "tools",
|
|
122
114
|
monitor_type: "monitors",
|
|
123
115
|
prebuilt_play: "prebuilts",
|
|
124
116
|
custom_play: "custom"
|
|
125
117
|
};
|
|
126
|
-
async function
|
|
127
|
-
try {
|
|
128
|
-
return await lookup;
|
|
129
|
-
} catch (error) {
|
|
130
|
-
if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
throw error;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
async function describeAnything(name, options, onMissing) {
|
|
118
|
+
async function describeName(name, options, lookups) {
|
|
137
119
|
const maintainedOnly = options.prebuilt === true || options.tool === true;
|
|
138
120
|
const wants = (filter) => (!options.kinds || options.kinds.includes(filter)) && !(maintainedOnly && filter === "custom");
|
|
139
|
-
const client = new (0, _chunk36ML3YKAjs.DeeplineClient)();
|
|
140
121
|
const play = async (reference) => {
|
|
141
|
-
const record2 = await
|
|
122
|
+
const record2 = await lookups.play(reference);
|
|
123
|
+
if (!record2) return null;
|
|
142
124
|
return {
|
|
143
|
-
described:
|
|
125
|
+
described: _chunkNSOTASOPjs.describedPlay.call(void 0, record2),
|
|
144
126
|
record: { ...record2 },
|
|
145
127
|
schemas: {
|
|
146
128
|
inputSchema: _nullishCoalesce(record2.inputSchema, () => ( null)),
|
|
@@ -149,23 +131,28 @@ async function describeAnything(name, options, onMissing) {
|
|
|
149
131
|
};
|
|
150
132
|
};
|
|
151
133
|
const tool = async () => {
|
|
152
|
-
const record2 = await
|
|
134
|
+
const record2 = await lookups.tool(name);
|
|
135
|
+
if (!record2) return null;
|
|
153
136
|
const { byok } = record2;
|
|
154
137
|
const features = toolFeatures(record2);
|
|
155
138
|
return {
|
|
156
139
|
described: {
|
|
157
|
-
...
|
|
140
|
+
..._chunk2VOLOWYZjs.describedTool.call(void 0, record2, name),
|
|
158
141
|
// Shown when the tool runs only on your own credentials; otherwise
|
|
159
142
|
// it is a feature, described with --feature byok.
|
|
160
143
|
..._optionalChain([byok, 'optionalAccess', _3 => _3.required]) === true ? { byok } : {},
|
|
161
144
|
...features.length ? { features: features.map(({ view: _view, ...feature }) => feature) } : {}
|
|
162
145
|
},
|
|
163
|
-
record:
|
|
164
|
-
|
|
146
|
+
record: _chunk2VOLOWYZjs.toolMetadataJsonForDescribe.call(void 0,
|
|
147
|
+
record2,
|
|
148
|
+
name,
|
|
149
|
+
lookups.seedStarterScript
|
|
150
|
+
),
|
|
151
|
+
schemas: _chunk2VOLOWYZjs.publicToolSchemas.call(void 0, record2),
|
|
165
152
|
feature: (featureName, value) => {
|
|
166
153
|
const feature = features.find(({ name: name2 }) => name2 === featureName);
|
|
167
154
|
return feature ? describeFeature(record2, feature, value, {
|
|
168
|
-
describeModel: (model) =>
|
|
155
|
+
describeModel: (model) => lookups.describeModel(model)
|
|
169
156
|
}) : null;
|
|
170
157
|
}
|
|
171
158
|
};
|
|
@@ -177,19 +164,13 @@ async function describeAnything(name, options, onMissing) {
|
|
|
177
164
|
];
|
|
178
165
|
const matches = await Promise.all(
|
|
179
166
|
sources.filter((source) => source.kinds.some(wants)).map(async ({ kinds, find }) => {
|
|
180
|
-
const match = await
|
|
167
|
+
const match = await find();
|
|
181
168
|
const filter = match && FILTER_OF[match.described.kind];
|
|
182
169
|
return filter && kinds.includes(filter) && wants(filter) ? match : null;
|
|
183
170
|
})
|
|
184
171
|
);
|
|
185
172
|
const [chosen, shadowed] = matches.filter((match) => match !== null);
|
|
186
|
-
if (!chosen) {
|
|
187
|
-
if (onMissing) return onMissing();
|
|
188
|
-
console.error(
|
|
189
|
-
`Nothing named "${name}". Search for it: deepline search ${JSON.stringify(name.replace(/[-_./]+/g, " "))}`
|
|
190
|
-
);
|
|
191
|
-
return 2;
|
|
192
|
-
}
|
|
173
|
+
if (!chosen) return { status: "missing" };
|
|
193
174
|
const { described, record } = chosen;
|
|
194
175
|
const shadows = described.kind === "custom_play" && shadowed ? {
|
|
195
176
|
kind: shadowed.described.kind,
|
|
@@ -197,49 +178,49 @@ async function describeAnything(name, options, onMissing) {
|
|
|
197
178
|
} : null;
|
|
198
179
|
const note = shadows ? `Showing your workspace play "${name}". It has the same name as a Deepline ${shadows.kind.replace("_", " ")}; see that one with: ${shadows.describeCommand}` : null;
|
|
199
180
|
const verbose = options.verbose === true;
|
|
200
|
-
const json = options.json === true;
|
|
201
181
|
const isPlay = described.kind === "prebuilt_play" || described.kind === "custom_play";
|
|
202
|
-
const dashboardUrl = isPlay ?
|
|
182
|
+
const dashboardUrl = isPlay ? _chunkNSOTASOPjs.buildPlayDashboardUrl.call(void 0, lookups.baseUrl, described.id) : null;
|
|
203
183
|
if (options.webUrl) {
|
|
204
184
|
if (!dashboardUrl) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
185
|
+
return {
|
|
186
|
+
status: "refused",
|
|
187
|
+
message: `${described.id} is a ${described.kind.replace("_", " ")}, not a play; only plays have a play page.`,
|
|
188
|
+
exitCode: 1
|
|
189
|
+
};
|
|
209
190
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
return 0;
|
|
191
|
+
return {
|
|
192
|
+
status: "described",
|
|
193
|
+
envelope: { dashboardUrl },
|
|
194
|
+
lines: [dashboardUrl]
|
|
195
|
+
};
|
|
216
196
|
}
|
|
217
197
|
if (options.feature !== void 0) {
|
|
218
198
|
const { name: featureName, value } = parseFeatureRequest(options.feature);
|
|
219
199
|
const pending = _nullishCoalesce(_optionalChain([chosen, 'access', _4 => _4.feature, 'optionalCall', _5 => _5(featureName, value)]), () => ( null));
|
|
220
200
|
const features = _nullishCoalesce(described.features, () => ( []));
|
|
221
201
|
if (!pending) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
202
|
+
return {
|
|
203
|
+
status: "refused",
|
|
204
|
+
message: features.length ? `${described.id} has no feature "${featureName}". Its features: ${features.map(({ name: name2 }) => name2).join(", ")}.` : `${described.id} has no features to describe.`,
|
|
205
|
+
exitCode: 2
|
|
206
|
+
};
|
|
226
207
|
}
|
|
227
208
|
const shownValue = _nullishCoalesce(value, () => ( _optionalChain([features, 'access', _6 => _6.find, 'call', _7 => _7(({ name: name2 }) => name2 === featureName), 'optionalAccess', _8 => _8.defaultValue])));
|
|
228
209
|
const { details, lines } = await pending;
|
|
229
|
-
return
|
|
230
|
-
|
|
210
|
+
return {
|
|
211
|
+
status: "described",
|
|
212
|
+
envelope: {
|
|
231
213
|
kind: described.kind,
|
|
232
214
|
id: described.id,
|
|
233
215
|
feature: featureName,
|
|
234
216
|
...shownValue ? { value: shownValue } : {},
|
|
235
217
|
details
|
|
236
218
|
},
|
|
237
|
-
[
|
|
219
|
+
lines: [
|
|
238
220
|
`${described.id} --feature ${featureName}${shownValue ? `=${shownValue}` : ""}`,
|
|
239
221
|
...lines
|
|
240
|
-
]
|
|
241
|
-
|
|
242
|
-
);
|
|
222
|
+
]
|
|
223
|
+
};
|
|
243
224
|
}
|
|
244
225
|
const fields = (_nullishCoalesce(options.fields, () => ( ""))).split(",").map((name2) => name2.trim()).filter(Boolean);
|
|
245
226
|
const named = options.cliExample === true || options.playExample === true;
|
|
@@ -262,7 +243,7 @@ async function describeAnything(name, options, onMissing) {
|
|
|
262
243
|
},
|
|
263
244
|
lines: [
|
|
264
245
|
`${described.id} [${described.kind.replace("_", " ")}]`,
|
|
265
|
-
...
|
|
246
|
+
..._chunkNSOTASOPjs.schemaLines.call(void 0, described, {
|
|
266
247
|
full: true,
|
|
267
248
|
secondary: true,
|
|
268
249
|
...fields.length ? { fields } : {}
|
|
@@ -271,17 +252,17 @@ async function describeAnything(name, options, onMissing) {
|
|
|
271
252
|
} : {
|
|
272
253
|
envelope: {
|
|
273
254
|
...summary,
|
|
274
|
-
inputs: inputs.map(
|
|
275
|
-
outputs: outputs.map(
|
|
276
|
-
...described.rowInputs ? { rowInputs: described.rowInputs.map(
|
|
277
|
-
...described.rowOutputs ? { rowOutputs: described.rowOutputs.map(
|
|
278
|
-
runExamples:
|
|
255
|
+
inputs: inputs.map(_chunkNSOTASOPjs.topLevelField),
|
|
256
|
+
outputs: outputs.map(_chunkNSOTASOPjs.topLevelField),
|
|
257
|
+
...described.rowInputs ? { rowInputs: described.rowInputs.map(_chunkNSOTASOPjs.topLevelField) } : {},
|
|
258
|
+
...described.rowOutputs ? { rowOutputs: described.rowOutputs.map(_chunkNSOTASOPjs.topLevelField) } : {},
|
|
259
|
+
runExamples: _chunkNSOTASOPjs.examples.call(void 0, described, { verbose }),
|
|
279
260
|
...dashboardUrl ? { dashboardUrl } : {},
|
|
280
261
|
...shadows ? { shadows, note } : {}
|
|
281
262
|
},
|
|
282
263
|
lines: [
|
|
283
264
|
...note ? [`Note: ${note}`, ""] : [],
|
|
284
|
-
...
|
|
265
|
+
..._chunkNSOTASOPjs.describedLines.call(void 0, described, {
|
|
285
266
|
cli: shown && (!named || options.cliExample === true),
|
|
286
267
|
play: shown && (!named || options.playExample === true),
|
|
287
268
|
explain: named,
|
|
@@ -298,14 +279,51 @@ async function describeAnything(name, options, onMissing) {
|
|
|
298
279
|
// its value stands, so callers of the older commands read what they did.
|
|
299
280
|
{ ...view.envelope, ...record }
|
|
300
281
|
) : {
|
|
301
|
-
...
|
|
282
|
+
..._chunkNSOTASOPjs.describedJson.call(void 0, described, {
|
|
302
283
|
secondary: verbose || fields.length > 0,
|
|
303
284
|
verbose
|
|
304
285
|
}),
|
|
305
286
|
...dashboardUrl ? { dashboardUrl } : {},
|
|
306
287
|
...shadows ? { shadows, note } : {}
|
|
307
288
|
};
|
|
308
|
-
return
|
|
289
|
+
return { status: "described", envelope, lines: view.lines };
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// src/cli/commands/describe.ts
|
|
293
|
+
async function found(lookup) {
|
|
294
|
+
try {
|
|
295
|
+
return await lookup;
|
|
296
|
+
} catch (error) {
|
|
297
|
+
if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
throw error;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
async function describeAnything(name, options, onMissing) {
|
|
304
|
+
const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
|
|
305
|
+
const outcome = await describeName(name, options, {
|
|
306
|
+
play: (reference) => found(client.describePlay(reference)),
|
|
307
|
+
tool: async (toolName) => await _asyncNullishCoalesce(options.fetchedTool, async () => ( await found(client.getTool(toolName)))),
|
|
308
|
+
describeModel: (model) => client.describeModel(model),
|
|
309
|
+
baseUrl: client.baseUrl,
|
|
310
|
+
seedStarterScript: _chunk2VOLOWYZjs.seedToolListScript
|
|
311
|
+
});
|
|
312
|
+
if (outcome.status === "missing") {
|
|
313
|
+
if (onMissing) return onMissing();
|
|
314
|
+
console.error(
|
|
315
|
+
`Nothing named "${name}". Search for it: deepline search ${JSON.stringify(name.replace(/[-_./]+/g, " "))}`
|
|
316
|
+
);
|
|
317
|
+
return 2;
|
|
318
|
+
}
|
|
319
|
+
if (outcome.status === "refused") {
|
|
320
|
+
console.error(outcome.message);
|
|
321
|
+
return outcome.exitCode;
|
|
322
|
+
}
|
|
323
|
+
return deliver(outcome.envelope, outcome.lines, {
|
|
324
|
+
json: options.json === true,
|
|
325
|
+
out: options.out
|
|
326
|
+
});
|
|
309
327
|
}
|
|
310
328
|
function deliver(envelope, lines, { json, out }) {
|
|
311
329
|
const text = `${lines.join("\n")}
|
|
@@ -316,18 +334,18 @@ function deliver(envelope, lines, { json, out }) {
|
|
|
316
334
|
` : text;
|
|
317
335
|
_fs.writeFileSync.call(void 0, path, content);
|
|
318
336
|
const bytes = Buffer.byteLength(content);
|
|
319
|
-
|
|
337
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
|
|
320
338
|
{ path, bytes },
|
|
321
339
|
{ json, text: `Wrote ${path} (${bytes} bytes)
|
|
322
340
|
` }
|
|
323
341
|
);
|
|
324
342
|
return 0;
|
|
325
343
|
}
|
|
326
|
-
|
|
344
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, envelope, { json, text });
|
|
327
345
|
return 0;
|
|
328
346
|
}
|
|
329
347
|
function registerDescribeCommand(program) {
|
|
330
|
-
|
|
348
|
+
_chunkNSOTASOPjs.addDescribeOptions.call(void 0, program.command("describe <name>")).option("--web-url", "Print only a play's play page URL").description(
|
|
331
349
|
"Describe anything search returns: a tool, monitor type, or play."
|
|
332
350
|
).addHelpText(
|
|
333
351
|
"after",
|
|
@@ -364,7 +382,7 @@ Schema size and format:
|
|
|
364
382
|
by default; the output names them, and --verbose shows them.
|
|
365
383
|
--fields email,miss_reason shows only the fields you name, plus every
|
|
366
384
|
required input, and names the rest. Use it when you know what you need.
|
|
367
|
-
A schema over ${
|
|
385
|
+
A schema over ${_chunkNSOTASOPjs.SCHEMA_LINE_LIMIT} lines is folded: deeper objects show only their field
|
|
368
386
|
names. A shape used more than once is printed once under Types.
|
|
369
387
|
--full-schema the normal output, with the schema not folded
|
|
370
388
|
--schema-only only the schema, not folded, and nothing else
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkWQJJNIMQjs = require('./chunk-WQJJNIMQ.js');
|
|
4
4
|
require('./chunk-S6R3OX7B.js');
|
|
5
5
|
require('./chunk-UHNDVD3P.js');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-KXMNM4AQ.js');
|
|
7
7
|
require('./chunk-XDVT3GOM.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('./chunk-
|
|
10
|
+
var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
|
|
11
|
+
require('./chunk-V7UP2F4U.js');
|
|
12
12
|
require('./chunk-XNYIZMNQ.js');
|
|
13
13
|
require('./chunk-7P5AA3SN.js');
|
|
14
|
-
require('./chunk-
|
|
14
|
+
require('./chunk-GNN4MY5X.js');
|
|
15
15
|
require('./chunk-OG64RBAC.js');
|
|
16
16
|
require('./chunk-COGTRVWW.js');
|
|
17
17
|
|
|
@@ -19,10 +19,10 @@ require('./chunk-COGTRVWW.js');
|
|
|
19
19
|
function registerExecutionsCommands(program) {
|
|
20
20
|
const executions = program.command("executions").description("Inspect and recover keyed tool executions.");
|
|
21
21
|
executions.command("get").description("Retrieve a tool execution by its idempotency key.").requiredOption("--idempotency-key <key>", "Stable execution recovery key").option("--json", "Emit the stable JSON response").action(async (options) => {
|
|
22
|
-
const result = await new (0,
|
|
22
|
+
const result = await new (0, _chunkWQJJNIMQjs.DeeplineClient)().executions.getByKey(
|
|
23
23
|
options.idempotencyKey
|
|
24
24
|
);
|
|
25
|
-
|
|
25
|
+
_chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, result, { json: true });
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|