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.
Files changed (107) hide show
  1. package/dist/bundling-sources/sdk/src/plays/play-description.ts +1 -1
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
  4. package/dist/cli/{auth-NMQXZRS7.mjs → auth-3LTD62VL.mjs} +4 -4
  5. package/dist/cli/auth-562JPKOM.js +39 -0
  6. package/dist/cli/{billing-5MVXZRS6.mjs → billing-DP7ZAJBO.mjs} +5 -5
  7. package/dist/cli/{billing-Z4JTGUU3.js → billing-PA5OXEM5.js} +76 -76
  8. package/dist/cli/{chunk-BLYL3KOC.mjs → chunk-23GAA3YO.mjs} +1 -1
  9. package/dist/cli/{chunk-LZLBR2SF.js → chunk-2VOLOWYZ.js} +1087 -1056
  10. package/dist/cli/{chunk-EFLQHJZ6.mjs → chunk-3T4MCB5R.mjs} +1026 -995
  11. package/dist/cli/{chunk-VB6KECLU.mjs → chunk-5WNJF2T3.mjs} +102 -36
  12. package/dist/cli/{chunk-UKU6JM3S.js → chunk-772W2SAU.js} +8 -8
  13. package/dist/cli/{chunk-K5T3EN6D.js → chunk-7Z66NHUC.js} +26 -26
  14. package/dist/cli/{chunk-WCCKMLHL.mjs → chunk-AUYXWELC.mjs} +2 -2
  15. package/dist/cli/{chunk-PZ5BZ76S.js → chunk-AVHLATII.js} +50 -50
  16. package/dist/cli/{chunk-MYIBHORT.js → chunk-DC6LTULT.js} +2 -2
  17. package/dist/cli/{chunk-5VCZ3WRH.mjs → chunk-EIMG75BT.mjs} +1 -0
  18. package/dist/cli/{chunk-TO2MWPGR.js → chunk-GNN4MY5X.js} +1 -1
  19. package/dist/cli/{chunk-OCSG6X67.mjs → chunk-I4T4XAA2.mjs} +4 -4
  20. package/dist/cli/{chunk-ZWH2TFA7.mjs → chunk-JCN4DHF7.mjs} +2 -2
  21. package/dist/cli/{chunk-R4XZO6Z5.js → chunk-KAEZNPUM.js} +23 -8
  22. package/dist/cli/{chunk-DRM3CMHL.js → chunk-KXMNM4AQ.js} +2 -1
  23. package/dist/cli/{chunk-3TRY7KAC.mjs → chunk-LOGGNW4H.mjs} +2 -2
  24. package/dist/cli/{chunk-RDXFGPJU.js → chunk-LWERJUKN.js} +218 -218
  25. package/dist/cli/{chunk-UCXK2DS4.js → chunk-ME6XRFLY.js} +15 -15
  26. package/dist/cli/{chunk-G4IWGRMK.mjs → chunk-MR6XCBQJ.mjs} +2 -2
  27. package/dist/cli/{chunk-BON3DRC6.mjs → chunk-NHB5YUCS.mjs} +1 -1
  28. package/dist/cli/{chunk-ZMVJSS6N.js → chunk-NSOTASOP.js} +101 -35
  29. package/dist/cli/{chunk-7XAM7KDW.mjs → chunk-QHGPA362.mjs} +18 -3
  30. package/dist/cli/{chunk-VYLJJQ7Y.js → chunk-RMTASUAK.js} +65 -65
  31. package/dist/cli/{chunk-HRWUQJ4K.js → chunk-RTO5QZWT.js} +6 -6
  32. package/dist/cli/{chunk-7MVWUXOD.mjs → chunk-TLQ3FZOC.mjs} +3 -3
  33. package/dist/cli/{chunk-56IFFVIB.js → chunk-V7UP2F4U.js} +4 -4
  34. package/dist/cli/{chunk-6D7A2FSL.mjs → chunk-VE3U3SQC.mjs} +1 -1
  35. package/dist/cli/{chunk-36ML3YKA.js → chunk-WQJJNIMQ.js} +13 -13
  36. package/dist/cli/{chunk-47M6HPGP.mjs → chunk-XKZXO7D3.mjs} +1 -1
  37. package/dist/cli/{csv-SVOD5UBH.mjs → csv-RLRR74RQ.mjs} +3 -3
  38. package/dist/cli/{csv-HTS5ZYQ4.js → csv-TF576S77.js} +12 -12
  39. package/dist/cli/{db-7AP4P52N.js → db-FDBJUTFO.js} +30 -30
  40. package/dist/cli/{db-7QLNI3Q4.mjs → db-XORGNBIC.mjs} +5 -5
  41. package/dist/cli/{describe-DBRY5BNK.mjs → describe-6O2ENKTP.mjs} +86 -68
  42. package/dist/cli/{describe-YKOE54ZO.js → describe-EFWNECHI.js} +100 -82
  43. package/dist/cli/{executions-GRQXTB2P.js → executions-SFYAXPF4.js} +7 -7
  44. package/dist/cli/{executions-QNZTPNG4.mjs → executions-YPP7WR77.mjs} +5 -5
  45. package/dist/cli/{feedback-ZOLA2KY7.js → feedback-5UZFYMGB.js} +7 -7
  46. package/dist/cli/{feedback-JMCSR624.mjs → feedback-RBGA5ARU.mjs} +3 -3
  47. package/dist/cli/git-5LDY5ZID.js +23 -0
  48. package/dist/cli/{git-LJGL2IHS.mjs → git-IRSAJEK2.mjs} +4 -4
  49. package/dist/cli/index.js +94 -94
  50. package/dist/cli/index.mjs +38 -38
  51. package/dist/cli/{legacy-noops-YSCIR2SD.js → legacy-noops-CVAOQY2F.js} +7 -7
  52. package/dist/cli/{legacy-noops-F23PKVBN.mjs → legacy-noops-NA7N6ZOU.mjs} +4 -4
  53. package/dist/cli/{monitors-WMZ6HJZX.js → monitors-4OMRXCXP.js} +86 -86
  54. package/dist/cli/{monitors-S4LOEL7W.mjs → monitors-ILZ2XHYG.mjs} +5 -5
  55. package/dist/cli/{org-U3WA2NQM.mjs → org-QDDXAE3J.mjs} +5 -5
  56. package/dist/cli/{org-PFHM5ZLY.js → org-YGNJDD2X.js} +65 -65
  57. package/dist/cli/{chunk-4KLCLLTO.js → play-L535H26U.js} +266 -323
  58. package/dist/cli/{chunk-XMAPE2KH.mjs → play-VT6OHB2D.mjs} +72 -129
  59. package/dist/cli/{providers-XYMHLKCA.js → providers-GPZ6PQAL.js} +8 -8
  60. package/dist/cli/{providers-QBBRFBOH.mjs → providers-KG4W5MPK.mjs} +5 -5
  61. package/dist/cli/{quickstart-5JTDGISY.mjs → quickstart-2JDGTXIG.mjs} +3 -3
  62. package/dist/cli/{quickstart-IYGD6ZY3.js → quickstart-UI27S5LO.js} +5 -5
  63. package/dist/cli/search-MGWROZ33.js +28 -0
  64. package/dist/cli/{search-X6W6GRHS.mjs → search-PW3RAUX7.mjs} +6 -6
  65. package/dist/cli/{secrets-N55B67H6.mjs → secrets-HNOMK5A2.mjs} +5 -5
  66. package/dist/cli/{secrets-UHG6OQFD.js → secrets-WFAXOUZE.js} +14 -14
  67. package/dist/cli/{sessions-57L5MGHN.js → sessions-366KROUA.js} +5 -5
  68. package/dist/cli/{sessions-JTRSTDSS.mjs → sessions-XLX3E5UO.mjs} +4 -4
  69. package/dist/cli/{settings-ATX4U5AS.js → settings-GADAG2UK.js} +75 -75
  70. package/dist/cli/{settings-Q24HRAQI.mjs → settings-YNZ4YKCH.mjs} +8 -8
  71. package/dist/cli/{setup-77ZWLVHT.mjs → setup-PSEHIUXO.mjs} +6 -6
  72. package/dist/cli/{setup-EJCNOUCE.js → setup-R5YO7GT6.js} +41 -41
  73. package/dist/cli/skills-JF2LPEGM.js +28 -0
  74. package/dist/cli/{skills-XIS5AWQI.mjs → skills-LTQBP6CZ.mjs} +4 -4
  75. package/dist/cli/tools-CP2PEFRN.js +34 -0
  76. package/dist/cli/{tools-WCKLYEGQ.mjs → tools-UAXDWU63.mjs} +11 -19
  77. package/dist/cli/update-HZHZOU6C.js +28 -0
  78. package/dist/cli/{update-UT5WANMV.mjs → update-SMNIBIMS.mjs} +6 -6
  79. package/dist/cli/{workflow-226QYUN2.js → workflow-AOQVZHMD.js} +16 -16
  80. package/dist/cli/{workflow-ZMX3L4ML.mjs → workflow-IKGMBGF6.mjs} +6 -6
  81. package/dist/{client-CivP-PAI.d.ts → client-Bgis7F6-.d.ts} +2 -1
  82. package/dist/{client-hdFtwhTm.d.mts → client-DiGl8ska.d.mts} +2 -1
  83. package/dist/index.d.mts +2 -2
  84. package/dist/index.d.ts +2 -2
  85. package/dist/index.js +11 -11
  86. package/dist/index.mjs +9 -9
  87. package/dist/install-integrity.json +78 -80
  88. package/dist/plays/play-description.d.mts +1 -1
  89. package/dist/plays/play-description.d.ts +1 -1
  90. package/dist/plays/play-description.js +4 -2
  91. package/dist/plays/play-description.mjs +3 -1
  92. package/dist/plays/run-request.d.mts +1 -1
  93. package/dist/plays/run-request.d.ts +1 -1
  94. package/dist/release.d.mts +1 -1
  95. package/dist/release.d.ts +1 -1
  96. package/dist/release.js +2 -2
  97. package/dist/release.mjs +1 -1
  98. package/package.json +1 -1
  99. package/dist/cli/auth-UYCOBAL5.js +0 -39
  100. package/dist/cli/git-EJQLRK27.js +0 -23
  101. package/dist/cli/play-AGSECQFN.mjs +0 -159
  102. package/dist/cli/play-BR2LWGXK.js +0 -159
  103. package/dist/cli/search-ZVSYH5GY.js +0 -28
  104. package/dist/cli/skills-SPXUBLII.js +0 -28
  105. package/dist/cli/tools-DBHUUZJX.js +0 -42
  106. package/dist/cli/update-VSNFXRHJ.js +0 -28
  107. 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-EFLQHJZ6.mjs";
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-VB6KECLU.mjs";
19
+ } from "./chunk-5WNJF2T3.mjs";
22
20
  import "./chunk-OVDNJAJN.mjs";
23
- import "./chunk-3HWALOL2.mjs";
24
- import "./chunk-H7HIDGZ7.mjs";
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-G4IWGRMK.mjs";
26
+ } from "./chunk-MR6XCBQJ.mjs";
33
27
  import "./chunk-6IKARAYD.mjs";
34
28
  import "./chunk-JI2B4RZP.mjs";
35
- import "./chunk-5VCZ3WRH.mjs";
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-47M6HPGP.mjs";
43
- import "./chunk-6D7A2FSL.mjs";
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-BON3DRC6.mjs";
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/commands/describe.ts
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 found(lookup) {
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 client.describePlay(reference);
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 = options.fetchedTool ?? await client.getTool(name);
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(record2, name),
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) => client.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 found(find());
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(client.baseUrl, described.id) : null;
182
+ const dashboardUrl = isPlay ? buildPlayDashboardUrl(lookups.baseUrl, described.id) : null;
203
183
  if (options.webUrl) {
204
184
  if (!dashboardUrl) {
205
- console.error(
206
- `${described.id} is a ${described.kind.replace("_", " ")}, not a play; only plays have a play page.`
207
- );
208
- return 1;
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
- printCommandEnvelope(
211
- { dashboardUrl },
212
- { json, text: `${dashboardUrl}
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
- console.error(
223
- features.length ? `${described.id} has no feature "${featureName}". Its features: ${features.map(({ name: name2 }) => name2).join(", ")}.` : `${described.id} has no features to describe.`
224
- );
225
- return 2;
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 deliver(
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
- { json, out: options.out }
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 deliver(envelope, view.lines, { json, out: options.out });
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 _chunkZMVJSS6Njs = require('./chunk-ZMVJSS6N.js');
19
+ var _chunkNSOTASOPjs = require('./chunk-NSOTASOP.js');
22
20
  require('./chunk-AID3OYVJ.js');
23
- require('./chunk-MH73HMPV.js');
24
- require('./chunk-3KC45UVF.js');
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 _chunk36ML3YKAjs = require('./chunk-36ML3YKA.js');
26
+ var _chunkWQJJNIMQjs = require('./chunk-WQJJNIMQ.js');
33
27
  require('./chunk-S6R3OX7B.js');
34
28
  require('./chunk-UHNDVD3P.js');
35
- require('./chunk-DRM3CMHL.js');
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 _chunkHRWUQJ4Kjs = require('./chunk-HRWUQJ4K.js');
43
- require('./chunk-56IFFVIB.js');
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-TO2MWPGR.js');
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
- ..._chunkLZLBR2SFjs.formatModelDescription.call(void 0, model).trimEnd().split("\n")
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: _chunkZMVJSS6Njs.byokLines.call(void 0, _nullishCoalesce(tool.byok, () => ( {})))
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/commands/describe.ts
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 found(lookup) {
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 client.describePlay(reference);
122
+ const record2 = await lookups.play(reference);
123
+ if (!record2) return null;
142
124
  return {
143
- described: _chunk4KLCLLTOjs.describedPlay.call(void 0, record2),
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 _asyncNullishCoalesce(options.fetchedTool, async () => ( await client.getTool(name)));
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
- ..._chunkLZLBR2SFjs.describedTool.call(void 0, record2, name),
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: _chunkLZLBR2SFjs.toolMetadataJsonForDescribe.call(void 0, record2, name),
164
- schemas: _chunkLZLBR2SFjs.publicToolSchemas.call(void 0, record2),
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) => client.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 found(find());
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 ? _chunk4KLCLLTOjs.buildPlayDashboardUrl.call(void 0, client.baseUrl, described.id) : null;
182
+ const dashboardUrl = isPlay ? _chunkNSOTASOPjs.buildPlayDashboardUrl.call(void 0, lookups.baseUrl, described.id) : null;
203
183
  if (options.webUrl) {
204
184
  if (!dashboardUrl) {
205
- console.error(
206
- `${described.id} is a ${described.kind.replace("_", " ")}, not a play; only plays have a play page.`
207
- );
208
- return 1;
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
- _chunkHRWUQJ4Kjs.printCommandEnvelope.call(void 0,
211
- { dashboardUrl },
212
- { json, text: `${dashboardUrl}
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
- console.error(
223
- features.length ? `${described.id} has no feature "${featureName}". Its features: ${features.map(({ name: name2 }) => name2).join(", ")}.` : `${described.id} has no features to describe.`
224
- );
225
- return 2;
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 deliver(
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
- { json, out: options.out }
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
- ..._chunkZMVJSS6Njs.schemaLines.call(void 0, described, {
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(_chunkZMVJSS6Njs.topLevelField),
275
- outputs: outputs.map(_chunkZMVJSS6Njs.topLevelField),
276
- ...described.rowInputs ? { rowInputs: described.rowInputs.map(_chunkZMVJSS6Njs.topLevelField) } : {},
277
- ...described.rowOutputs ? { rowOutputs: described.rowOutputs.map(_chunkZMVJSS6Njs.topLevelField) } : {},
278
- runExamples: _chunkZMVJSS6Njs.examples.call(void 0, described, { verbose }),
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
- ..._chunkZMVJSS6Njs.describedLines.call(void 0, described, {
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
- ..._chunkZMVJSS6Njs.describedJson.call(void 0, described, {
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 deliver(envelope, view.lines, { json, out: options.out });
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
- _chunkHRWUQJ4Kjs.printCommandEnvelope.call(void 0,
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
- _chunkHRWUQJ4Kjs.printCommandEnvelope.call(void 0, envelope, { json, text });
344
+ _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, envelope, { json, text });
327
345
  return 0;
328
346
  }
329
347
  function registerDescribeCommand(program) {
330
- _chunkZMVJSS6Njs.addDescribeOptions.call(void 0, program.command("describe <name>")).option("--web-url", "Print only a play's play page URL").description(
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 ${_chunkZMVJSS6Njs.SCHEMA_LINE_LIMIT} lines is folded: deeper objects show only their field
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 _chunk36ML3YKAjs = require('./chunk-36ML3YKA.js');
3
+ var _chunkWQJJNIMQjs = require('./chunk-WQJJNIMQ.js');
4
4
  require('./chunk-S6R3OX7B.js');
5
5
  require('./chunk-UHNDVD3P.js');
6
- require('./chunk-DRM3CMHL.js');
6
+ require('./chunk-KXMNM4AQ.js');
7
7
  require('./chunk-XDVT3GOM.js');
8
8
 
9
9
 
10
- var _chunkHRWUQJ4Kjs = require('./chunk-HRWUQJ4K.js');
11
- require('./chunk-56IFFVIB.js');
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-TO2MWPGR.js');
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, _chunk36ML3YKAjs.DeeplineClient)().executions.getByKey(
22
+ const result = await new (0, _chunkWQJJNIMQjs.DeeplineClient)().executions.getByKey(
23
23
  options.idempotencyKey
24
24
  );
25
- _chunkHRWUQJ4Kjs.printCommandEnvelope.call(void 0, result, { json: true });
25
+ _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, result, { json: true });
26
26
  });
27
27
  }
28
28