deepline 0.3.396 → 0.3.397

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 (117) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +2 -2
  3. package/dist/cli/{auth-3LTD62VL.mjs → auth-AZJFXGKP.mjs} +5 -4
  4. package/dist/cli/auth-CZJQU7B5.js +40 -0
  5. package/dist/cli/{billing-PA5OXEM5.js → billing-MQV5AGDJ.js} +76 -75
  6. package/dist/cli/{billing-DP7ZAJBO.mjs → billing-MZAAUHGH.mjs} +5 -4
  7. package/dist/cli/{chunk-VE3U3SQC.mjs → chunk-2LDADJNO.mjs} +7 -107
  8. package/dist/cli/{chunk-772W2SAU.js → chunk-3VP34TAU.js} +8 -8
  9. package/dist/cli/{chunk-QHGPA362.mjs → chunk-4D745XZO.mjs} +6 -108
  10. package/dist/cli/chunk-7DRPTGCK.js +930 -0
  11. package/dist/cli/{chunk-NSOTASOP.js → chunk-BQR6UN3C.js} +1 -83
  12. package/dist/cli/{chunk-RTO5QZWT.js → chunk-DQ65ZVHN.js} +6 -6
  13. package/dist/cli/{chunk-3T4MCB5R.mjs → chunk-F3BUFYKE.mjs} +89 -969
  14. package/dist/cli/chunk-FIVKWNMT.mjs +210 -0
  15. package/dist/cli/{describe-6O2ENKTP.mjs → chunk-HFYQBC2D.mjs} +22 -160
  16. package/dist/cli/chunk-HGFFYVXN.js +210 -0
  17. package/dist/cli/{chunk-5WNJF2T3.mjs → chunk-IHG7UAHD.mjs} +1 -83
  18. package/dist/cli/{chunk-GNN4MY5X.js → chunk-IZ74ABSX.js} +1 -1
  19. package/dist/cli/{chunk-MR6XCBQJ.mjs → chunk-J7ABTQQ7.mjs} +4 -2
  20. package/dist/cli/{chunk-2VOLOWYZ.js → chunk-K33MXVXQ.js} +293 -1173
  21. package/dist/cli/chunk-LJ5747UC.mjs +107 -0
  22. package/dist/cli/{chunk-NHB5YUCS.mjs → chunk-MRXMMERY.mjs} +1 -1
  23. package/dist/cli/{chunk-TLQ3FZOC.mjs → chunk-MV7QRALK.mjs} +3 -3
  24. package/dist/cli/{chunk-AUYXWELC.mjs → chunk-MYPH2LUU.mjs} +2 -2
  25. package/dist/cli/{chunk-LWERJUKN.js → chunk-NA4T3B62.js} +7 -215
  26. package/dist/cli/{chunk-23GAA3YO.mjs → chunk-NOX2TCBP.mjs} +1 -1
  27. package/dist/cli/chunk-OSDXE27V.mjs +88 -0
  28. package/dist/cli/{chunk-KAEZNPUM.js → chunk-PSGEDGLT.js} +13 -115
  29. package/dist/cli/chunk-Q2E4E4FJ.js +112 -0
  30. package/dist/cli/{describe-EFWNECHI.js → chunk-RFG3MRAC.js} +37 -175
  31. package/dist/cli/{chunk-XKZXO7D3.mjs → chunk-RNSWDKBM.mjs} +1 -1
  32. package/dist/cli/{chunk-V7UP2F4U.js → chunk-RYW4HPSM.js} +21 -121
  33. package/dist/cli/{chunk-7Z66NHUC.js → chunk-SO7RUVTY.js} +26 -26
  34. package/dist/cli/{chunk-H5KLUGY7.mjs → chunk-TXZVVBQZ.mjs} +1 -209
  35. package/dist/cli/{chunk-WQJJNIMQ.js → chunk-UVXBVUZQ.js} +11 -9
  36. package/dist/cli/{chunk-AVHLATII.js → chunk-VTF4RRWJ.js} +50 -50
  37. package/dist/cli/{chunk-LOGGNW4H.mjs → chunk-W3HMGKMI.mjs} +2 -2
  38. package/dist/cli/{chunk-JCN4DHF7.mjs → chunk-WM2QEHZL.mjs} +2 -2
  39. package/dist/cli/chunk-YHPYUZZX.mjs +112 -0
  40. package/dist/cli/chunk-YHZUZO3U.mjs +930 -0
  41. package/dist/cli/{chunk-ME6XRFLY.js → chunk-YLRME7MK.js} +15 -15
  42. package/dist/cli/{chunk-DC6LTULT.js → chunk-YSVORIEW.js} +2 -2
  43. package/dist/cli/{chunk-I4T4XAA2.mjs → chunk-YUDKBQUD.mjs} +4 -4
  44. package/dist/cli/chunk-ZAAKSJAS.js +88 -0
  45. package/dist/cli/{chunk-RMTASUAK.js → chunk-ZHUMDMOS.js} +65 -65
  46. package/dist/cli/chunk-ZM2YPJQJ.js +107 -0
  47. package/dist/cli/{csv-TF576S77.js → csv-AQBQ5O3I.js} +13 -12
  48. package/dist/cli/{csv-RLRR74RQ.mjs → csv-MB7PJMYQ.mjs} +4 -3
  49. package/dist/cli/{db-FDBJUTFO.js → db-JPUYC5RB.js} +30 -29
  50. package/dist/cli/{db-XORGNBIC.mjs → db-L5IEI2AU.mjs} +5 -4
  51. package/dist/cli/describe-6WT74AOR.js +164 -0
  52. package/dist/cli/describe-S6BFANVI.mjs +164 -0
  53. package/dist/cli/describe-core.d.mts +100 -0
  54. package/dist/cli/describe-core.d.ts +100 -0
  55. package/dist/cli/describe-core.js +18 -0
  56. package/dist/cli/describe-core.mjs +18 -0
  57. package/dist/cli/{executions-SFYAXPF4.js → executions-6TMQTFP4.js} +7 -6
  58. package/dist/cli/{executions-YPP7WR77.mjs → executions-L7I2ZW4Z.mjs} +5 -4
  59. package/dist/cli/{feedback-RBGA5ARU.mjs → feedback-DSJ63HK6.mjs} +4 -3
  60. package/dist/cli/{feedback-5UZFYMGB.js → feedback-XF7CQGMD.js} +8 -7
  61. package/dist/cli/{git-IRSAJEK2.mjs → git-C3ENM67D.mjs} +5 -4
  62. package/dist/cli/git-HYDZK2QR.js +24 -0
  63. package/dist/cli/index.js +93 -91
  64. package/dist/cli/index.mjs +35 -33
  65. package/dist/cli/{legacy-noops-CVAOQY2F.js → legacy-noops-B2NHWIVD.js} +8 -7
  66. package/dist/cli/{legacy-noops-NA7N6ZOU.mjs → legacy-noops-VFG2K6HK.mjs} +5 -4
  67. package/dist/cli/{monitors-4OMRXCXP.js → monitors-ORFWOVZB.js} +86 -85
  68. package/dist/cli/{monitors-ILZ2XHYG.mjs → monitors-TCEDBDGY.mjs} +5 -4
  69. package/dist/cli/{org-QDDXAE3J.mjs → org-45KREIKZ.mjs} +5 -4
  70. package/dist/cli/{org-YGNJDD2X.js → org-T74CJESN.js} +65 -64
  71. package/dist/cli/{play-VT6OHB2D.mjs → play-MU7MYBIM.mjs} +19 -15
  72. package/dist/cli/{play-L535H26U.js → play-XHK2LPON.js} +251 -247
  73. package/dist/cli/{providers-GPZ6PQAL.js → providers-4MGQKYFD.js} +8 -7
  74. package/dist/cli/{providers-KG4W5MPK.mjs → providers-VYCXIJT5.mjs} +5 -4
  75. package/dist/cli/{quickstart-UI27S5LO.js → quickstart-47G3VEOT.js} +6 -5
  76. package/dist/cli/{quickstart-2JDGTXIG.mjs → quickstart-H724EFM2.mjs} +4 -3
  77. package/dist/cli/search-3356ENLD.js +30 -0
  78. package/dist/cli/{search-PW3RAUX7.mjs → search-VQHXEFQ4.mjs} +7 -5
  79. package/dist/cli/{secrets-WFAXOUZE.js → secrets-ALLKCU35.js} +14 -13
  80. package/dist/cli/{secrets-HNOMK5A2.mjs → secrets-CPBNGA44.mjs} +5 -4
  81. package/dist/cli/{sessions-XLX3E5UO.mjs → sessions-7RSQB7IX.mjs} +5 -4
  82. package/dist/cli/sessions-FKGAY7WQ.js +16 -0
  83. package/dist/cli/{settings-YNZ4YKCH.mjs → settings-UYSGV4IC.mjs} +8 -7
  84. package/dist/cli/{settings-GADAG2UK.js → settings-Y5BI42P7.js} +75 -74
  85. package/dist/cli/{setup-PSEHIUXO.mjs → setup-L3ZBBTS4.mjs} +7 -6
  86. package/dist/cli/{setup-R5YO7GT6.js → setup-VXQPEU3E.js} +42 -41
  87. package/dist/cli/skills-DUZQTDTE.js +29 -0
  88. package/dist/cli/{skills-LTQBP6CZ.mjs → skills-QHVDLSFE.mjs} +5 -4
  89. package/dist/cli/{tools-UAXDWU63.mjs → tools-LSCEK4K2.mjs} +13 -8
  90. package/dist/cli/tools-YWU5QOQ5.js +39 -0
  91. package/dist/cli/update-5LYQAI55.js +29 -0
  92. package/dist/cli/{update-SMNIBIMS.mjs → update-CU22OTBM.mjs} +7 -6
  93. package/dist/cli/{workflow-AOQVZHMD.js → workflow-ERFLTRNX.js} +16 -15
  94. package/dist/cli/{workflow-IKGMBGF6.mjs → workflow-KQARK5BZ.mjs} +6 -5
  95. package/dist/{client-DiGl8ska.d.mts → client-D0j-_aaa.d.mts} +1 -1
  96. package/dist/{client-Bgis7F6-.d.ts → client-DflfVyj6.d.ts} +1 -1
  97. package/dist/index.d.mts +2 -2
  98. package/dist/index.d.ts +2 -2
  99. package/dist/index.js +14 -10
  100. package/dist/index.mjs +19 -15
  101. package/dist/install-integrity.json +92 -76
  102. package/dist/plays/play-description.d.mts +1 -1
  103. package/dist/plays/play-description.d.ts +1 -1
  104. package/dist/plays/run-request.d.mts +1 -1
  105. package/dist/plays/run-request.d.ts +1 -1
  106. package/dist/release.d.mts +1 -1
  107. package/dist/release.d.ts +1 -1
  108. package/dist/release.js +2 -2
  109. package/dist/release.mjs +1 -1
  110. package/package.json +6 -1
  111. package/dist/cli/auth-562JPKOM.js +0 -39
  112. package/dist/cli/git-5LDY5ZID.js +0 -23
  113. package/dist/cli/search-MGWROZ33.js +0 -28
  114. package/dist/cli/sessions-366KROUA.js +0 -15
  115. package/dist/cli/skills-JF2LPEGM.js +0 -28
  116. package/dist/cli/tools-CP2PEFRN.js +0 -34
  117. package/dist/cli/update-HZHZOU6C.js +0 -28
@@ -1,37 +1,51 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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 _chunkZAAKSJASjs = require('./chunk-ZAAKSJAS.js');
5
+
6
+
7
+
8
+ var _chunkPSGEDGLTjs = require('./chunk-PSGEDGLT.js');
9
+
10
+
11
+
4
12
 
5
13
 
6
14
 
7
- var _chunkNSOTASOPjs = require('./chunk-NSOTASOP.js');
8
15
 
9
16
 
10
- var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
11
17
 
12
18
 
13
19
 
14
20
 
15
21
 
16
- var _chunkKAEZNPUMjs = require('./chunk-KAEZNPUM.js');
17
22
 
18
23
 
19
24
 
20
25
 
21
26
 
27
+ var _chunk7DRPTGCKjs = require('./chunk-7DRPTGCK.js');
28
+
29
+
30
+ var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
31
+
32
+
33
+
34
+ var _chunkZM2YPJQJjs = require('./chunk-ZM2YPJQJ.js');
35
+
22
36
 
23
37
 
24
38
 
25
39
 
26
40
 
27
- var _chunkLWERJUKNjs = require('./chunk-LWERJUKN.js');
41
+ var _chunkHGFFYVXNjs = require('./chunk-HGFFYVXN.js');
28
42
 
29
43
 
30
44
  var _chunkKB4SDX5Sjs = require('./chunk-KB4SDX5S.js');
31
45
 
32
46
 
33
47
 
34
- var _chunkWQJJNIMQjs = require('./chunk-WQJJNIMQ.js');
48
+ var _chunkUVXBVUZQjs = require('./chunk-UVXBVUZQ.js');
35
49
 
36
50
 
37
51
  var _chunkXDVT3GOMjs = require('./chunk-XDVT3GOM.js');
@@ -48,11 +62,11 @@ var _chunkQJBJZVG6js = require('./chunk-QJBJZVG6.js');
48
62
 
49
63
 
50
64
 
51
- var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
65
+ var _chunkDQ65ZVHNjs = require('./chunk-DQ65ZVHN.js');
52
66
 
53
67
 
54
68
 
55
- var _chunkV7UP2F4Ujs = require('./chunk-V7UP2F4U.js');
69
+ var _chunkRYW4HPSMjs = require('./chunk-RYW4HPSM.js');
56
70
 
57
71
 
58
72
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
@@ -72,18 +86,18 @@ function matchesToolRequestCondition(condition, payload) {
72
86
  (entry) => matchesToolRequestCondition(entry, payload)
73
87
  );
74
88
  }
75
- const value2 = _optionalChain([payload, 'optionalAccess', _ => _[condition.field]]);
89
+ const value = _optionalChain([payload, 'optionalAccess', _ => _[condition.field]]);
76
90
  switch (condition.operator) {
77
91
  case "equals":
78
- return value2 === condition.value;
92
+ return value === condition.value;
79
93
  case "number_equals":
80
94
  try {
81
- return Number(value2) === condition.value;
95
+ return Number(value) === condition.value;
82
96
  } catch (e) {
83
97
  return false;
84
98
  }
85
99
  case "present_nonblank":
86
- return typeof value2 === "string" ? value2.trim().length > 0 : value2 !== void 0 && value2 !== null;
100
+ return typeof value === "string" ? value.trim().length > 0 : value !== void 0 && value !== null;
87
101
  default:
88
102
  throw new Error("Unsupported tool request warning condition.");
89
103
  }
@@ -131,10 +145,10 @@ var ToolCallRecovery = class _ToolCallRecovery {
131
145
  }
132
146
  };
133
147
  function pendingToolExecutionPath(input) {
134
- const config = _chunkV7UP2F4Ujs.resolveConfig.call(void 0, );
148
+ const config = _chunkRYW4HPSMjs.resolveConfig.call(void 0, );
135
149
  const fingerprint = _crypto.createHash.call(void 0, "sha256").update(config.baseUrl).update("\0").update(_crypto.createHash.call(void 0, "sha256").update(config.apiKey).digest("hex")).update("\0").update(input.toolId).update("\0").update(_chunkXDVT3GOMjs.stableStringify.call(void 0, input.params)).update("\0").update(input.responseIntent).digest("hex");
136
150
  return _path.join.call(void 0,
137
- _chunkV7UP2F4Ujs.sdkCliStateDirPath.call(void 0, config.baseUrl),
151
+ _chunkRYW4HPSMjs.sdkCliStateDirPath.call(void 0, config.baseUrl),
138
152
  `pending-tool-execution-${fingerprint}.json`
139
153
  );
140
154
  }
@@ -195,836 +209,6 @@ async function completePendingToolExecution(path, idempotencyKey) {
195
209
  }
196
210
  }
197
211
 
198
- // ../plays/field-catalog.ts
199
- var value = (description) => ({ type: "string", description });
200
- var SOURCE = {
201
- type: "string",
202
- description: "The provider or step that found it."
203
- };
204
- var FIELD_CATALOG = {
205
- person: {
206
- name: {
207
- description: "The person's name.",
208
- leaves: {
209
- value: value("Full name."),
210
- first: value("First (given) name."),
211
- last: value("Last (family) name.")
212
- }
213
- },
214
- email: {
215
- description: "An email address for the person.",
216
- leaves: {
217
- value: value("The address."),
218
- validated: {
219
- type: "boolean",
220
- description: "Whether the address passed validation."
221
- },
222
- status: {
223
- type: "EmailStatus",
224
- description: "The validation verdict and its signals."
225
- },
226
- source: SOURCE
227
- },
228
- kinds: {
229
- work: "At their employer.",
230
- personal: "Their own, not tied to an employer."
231
- }
232
- },
233
- phone: {
234
- description: "A phone number for the person.",
235
- leaves: {
236
- value: value("The number."),
237
- validated: {
238
- type: "boolean",
239
- description: "Whether the number passed validation."
240
- },
241
- status: {
242
- type: '"valid" | "invalid" | "unknown"',
243
- description: "The validation verdict."
244
- },
245
- line_type: value("Mobile, landline, VoIP and so on."),
246
- carrier: value("The carrier serving the number."),
247
- source: SOURCE
248
- },
249
- kinds: {
250
- mobile: "Their mobile.",
251
- work: "A direct line at their employer."
252
- }
253
- },
254
- linkedin: {
255
- description: "The person's LinkedIn profile.",
256
- leaves: { url: value("The profile URL.") }
257
- },
258
- job: {
259
- description: "The person's current role.",
260
- leaves: {
261
- title: value("Job title."),
262
- change: {
263
- type: "JobChange",
264
- description: "Whether they changed jobs, and to what."
265
- },
266
- change_status: {
267
- type: "JobChangeStatus",
268
- description: "The job-change verdict alone."
269
- }
270
- }
271
- },
272
- record: {
273
- description: "A provider's own record of the person.",
274
- leaves: { id: value("The provider's id for the person.") }
275
- }
276
- },
277
- company: {
278
- name: {
279
- description: "The company's name.",
280
- leaves: { value: value("The name.") },
281
- kinds: { legal: "As registered with a government." }
282
- },
283
- domain: {
284
- description: "The company's web domain.",
285
- leaves: { value: value("The bare domain, such as example.com.") }
286
- },
287
- website: {
288
- description: "The company's website.",
289
- leaves: { url: value("The site URL.") }
290
- },
291
- linkedin: {
292
- description: "The company's LinkedIn page.",
293
- leaves: { url: value("The page URL.") }
294
- },
295
- phone: {
296
- description: "A phone number for the company.",
297
- leaves: { value: value("The number.") }
298
- },
299
- industry: {
300
- description: "The industry the company is in.",
301
- leaves: { value: value("The industry.") }
302
- },
303
- record: {
304
- description: "A provider's own record of the company.",
305
- leaves: { id: value("The provider's id for the company.") }
306
- }
307
- }
308
- };
309
- function catalogFields() {
310
- return Object.entries(FIELD_CATALOG).flatMap(
311
- ([entity, groups]) => Object.entries(groups).flatMap(
312
- ([group, definition]) => [void 0, ...Object.keys(_nullishCoalesce(definition.kinds, () => ( {})))].flatMap(
313
- (kind) => Object.entries(definition.leaves).map(([leaf, described]) => ({
314
- ...described,
315
- id: [entity, group, kind, leaf].filter(Boolean).join("."),
316
- entity,
317
- group,
318
- ...kind ? { kind } : {},
319
- leaf
320
- }))
321
- )
322
- )
323
- );
324
- }
325
- var FIELDS_BY_ID = new Map(catalogFields().map((field) => [field.id, field]));
326
- function generalField(id) {
327
- const field = FIELDS_BY_ID.get(id);
328
- return _optionalChain([field, 'optionalAccess', _4 => _4.kind]) ? [field.entity, field.group, field.leaf].join(".") : null;
329
- }
330
- function fieldSatisfies(offered, wanted) {
331
- return offered === wanted || generalField(offered) === wanted;
332
- }
333
- var EXTRACTOR_TARGET_FIELDS = {
334
- email: ["person.email.value"],
335
- personal_email: ["person.email.personal.value"],
336
- email_status: ["person.email.status"],
337
- phone: ["person.phone.value", "company.phone.value"],
338
- phone_status: ["person.phone.status"],
339
- first_name: ["person.name.first"],
340
- last_name: ["person.name.last"],
341
- full_name: ["person.name.value"],
342
- // Also used for a list name, a channel title and a search suggestion.
343
- name: ["person.name.value", "company.name.value"],
344
- linkedin: ["person.linkedin.url", "company.linkedin.url"],
345
- linkedin_url: ["person.linkedin.url"],
346
- title: ["person.job.title"],
347
- job_change: ["person.job.change"],
348
- job_change_status: ["person.job.change_status"],
349
- company: ["company.name.value"],
350
- company_name: ["company.name.value"],
351
- organization_name: ["company.name.value"],
352
- company_domain: ["company.domain.value"],
353
- domain: ["company.domain.value"],
354
- company_website: ["company.website.url"],
355
- // Also used for a podcast URL.
356
- website: ["company.website.url"],
357
- company_linkedin_url: ["company.linkedin.url"],
358
- industry: ["company.industry.value"],
359
- id: ["person.record.id", "company.record.id"],
360
- // Used for unrelated provider statuses; none is a catalog field.
361
- status: []
362
- };
363
- function fieldOfName(name, declared) {
364
- const meanings = _nullishCoalesce(EXTRACTOR_TARGET_FIELDS[name], () => ( []));
365
- if (declared === void 0) {
366
- return meanings.length === 1 ? meanings[0] : void 0;
367
- }
368
- return meanings.some((meaning) => fieldSatisfies(declared, meaning)) ? declared : void 0;
369
- }
370
-
371
- // src/cli/described-tool.ts
372
- function isPlayLikeTool(tool) {
373
- const record = tool;
374
- if (record.isPlay === true || record.is_play === true) return true;
375
- const playExpansion = recordField(record, "playExpansion", "play_expansion");
376
- if (Object.keys(playExpansion).length > 0) return true;
377
- const toolId = typeof record.toolId === "string" ? record.toolId : "";
378
- return toolId.endsWith("_waterfall");
379
- }
380
- function isMonitorTypeTool(tool) {
381
- return stringField(tool, "kind") === "monitor_type";
382
- }
383
- function playReferenceForTool(tool) {
384
- const record = tool;
385
- const declared = stringField(record, "playReference", "play_reference");
386
- if (declared.startsWith("prebuilt/")) {
387
- return declared;
388
- }
389
- return null;
390
- }
391
- function playSearchCommandForToolId(toolId) {
392
- return `deepline search --type prebuilts ${JSON.stringify(toolId.replace(/_/g, " "))}`;
393
- }
394
- function playRunCommandForTool(tool, toolId, input) {
395
- const playReference = playReferenceForTool(tool);
396
- if (!playReference) return playSearchCommandForToolId(toolId);
397
- const inputArg = input === void 0 ? "'{...}'" : `'${JSON.stringify(input)}'`;
398
- return `deepline plays run ${playReference} --input ${inputArg}`;
399
- }
400
- function toolContractJsonForDescribe(tool, requestedToolId, authoringContractEdition, seedStarterScript) {
401
- const toolId = String(tool.toolId || requestedToolId);
402
- const inputFields = toolInputFieldsForDisplay(
403
- recordField(tool, "inputSchema", "input_schema")
404
- );
405
- const inputSchema = publicToolInputSchemaForDescribe(
406
- recordField(tool, "inputSchema", "input_schema")
407
- );
408
- const outputSchemaRecord = recordField(tool, "outputSchema", "output_schema");
409
- const outputFields = toolOutputFieldsForDisplay(outputSchemaRecord);
410
- const usageGuidance = recordField(tool, "usageGuidance", "usage_guidance");
411
- const guidance = recordField(tool, "guidance");
412
- const toolExecutionResult = recordField(
413
- usageGuidance,
414
- "toolExecutionResult",
415
- "tool_execution_result"
416
- );
417
- const extractedLists = extractionContractEntries(
418
- arrayField(toolExecutionResult, "extractedLists", "extracted_lists")
419
- ).map((entry) => ({
420
- ...entry,
421
- returnType: _chunkKB4SDX5Sjs.playToolListGetterMode.call(void 0, authoringContractEdition) === "array" ? "Array" : "PlayDataset",
422
- rowsExpression: _chunkKB4SDX5Sjs.playToolListGetterMode.call(void 0, authoringContractEdition) === "array" ? entry.expression : `await ${entry.expression}.materialize()`
423
- }));
424
- const extractedValues = extractionContractEntries(
425
- arrayField(toolExecutionResult, "extractedValues", "extracted_values")
426
- );
427
- const pricing = _chunkKAEZNPUMjs.Capability.fromCatalogEntry(tool).describe().customerCost();
428
- const executionMetadataRecord = recordField(
429
- tool,
430
- "executionMetadata",
431
- "execution_metadata"
432
- );
433
- const executionMetadata = Object.keys(executionMetadataRecord).length > 0 ? executionMetadataRecord : null;
434
- const batchCapabilityRecord = recordField(
435
- tool,
436
- "batchCapability",
437
- "batch_capability"
438
- );
439
- const batchCapability = Object.keys(batchCapabilityRecord).length > 0 ? batchCapabilityRecord : null;
440
- const deprecation = recordField(tool, "deprecation");
441
- const replacementToolId = stringField(
442
- deprecation,
443
- "replacementToolId",
444
- "replacement_tool_id"
445
- );
446
- const deprecationMessage = stringField(deprecation, "message");
447
- const deprecationExecution = stringField(deprecation, "execution");
448
- const deprecated = tool.deprecated === true || stringField(tool, "credentialStatus", "credential_status") === "deprecated";
449
- const starterScript = seedStarterScript && !deprecated && !isPlayLikeTool(tool) && extractedLists.length > 0 ? starterScriptJson(
450
- seedStarterScript({
451
- toolId,
452
- payload: samplePayloadForInputFields(inputFields),
453
- rows: []
454
- })
455
- ) : null;
456
- const executeCommand = deprecated && replacementToolId ? `deepline tools execute ${replacementToolId} --input '{...}'` : isPlayLikeTool(tool) ? playRunCommandForTool(tool, toolId) : `deepline tools execute ${toolId} --input '{...}'`;
457
- return {
458
- schemaVersion: 1,
459
- toolId,
460
- provider: tool.provider,
461
- displayName: tool.displayName,
462
- cost: pricing,
463
- description: tool.description,
464
- ...Object.keys(guidance).length > 0 ? { guidance } : {},
465
- categories: tool.categories,
466
- ...Array.isArray(tool.requestWarnings) ? { requestWarnings: tool.requestWarnings } : {},
467
- ...deprecated ? {
468
- deprecated: true,
469
- callable: tool.callable !== false,
470
- deprecation: {
471
- replacementToolId,
472
- message: deprecationMessage,
473
- ...deprecationExecution ? { execution: deprecationExecution } : {}
474
- }
475
- } : {},
476
- inputFields: inputFields.map(inputFieldJsonForDescribe),
477
- inputSchema,
478
- ...isRecord(tool.responseSchema) ? { responseSchema: tool.responseSchema } : {},
479
- ...Array.isArray(tool.examples) ? { examples: tool.examples } : {},
480
- responseAccess: "result.toolResponse.rawV2",
481
- ...Object.keys(outputSchemaRecord).length > 0 ? {
482
- outputSchema: publicToolInputSchemaForDescribe(outputSchemaRecord),
483
- outputFields: outputFields.map(inputFieldJsonForDescribe)
484
- } : {},
485
- ...executionMetadata ? { executionMetadata } : {},
486
- ...batchCapability ? { batchCapability } : {},
487
- getters: {
488
- extractedLists,
489
- extractedValues
490
- },
491
- executeCommand,
492
- ...starterScript ? { starterScript } : {}
493
- };
494
- }
495
- function extractionContractEntries(entries) {
496
- return entries.flatMap((entry) => {
497
- if (!isRecord(entry)) return [];
498
- const name = stringField(entry, "name");
499
- const expression = stringField(entry, "expression");
500
- return name && expression ? [{ name, expression }] : [];
501
- });
502
- }
503
- function schemaNodeAt(schema, path) {
504
- let node = schema;
505
- for (const part of path.split(".").filter(Boolean)) {
506
- const [key, ...indexes] = part.split("[");
507
- node = recordField(isRecord(node) ? node : {}, "properties")[key];
508
- for (const _index of indexes)
509
- node = isRecord(node) ? node.items : void 0;
510
- }
511
- return node;
512
- }
513
- var NAMED_VALUE_SHAPES = {
514
- email_status: { shape: "EmailStatus", schema: _chunkLWERJUKNjs.EMAIL_STATUS_JSON_SCHEMA },
515
- job_change: { shape: "JobChange", schema: _chunkLWERJUKNjs.JOB_CHANGE_JSON_SCHEMA }
516
- };
517
- function extractorValueType(name) {
518
- if (!_chunkLWERJUKNjs.isDeeplineExtractorTarget.call(void 0, name)) return void 0;
519
- const definition = _chunkLWERJUKNjs.DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS[name];
520
- if (definition.enum) {
521
- return {
522
- type: definition.enum.map((value2) => JSON.stringify(value2)).join(" | ")
523
- };
524
- }
525
- const named = NAMED_VALUE_SHAPES[definition.valueKind];
526
- if (!named) return { type: "string" };
527
- const { type, fields } = _chunkNSOTASOPjs.schemaField.call(void 0, name, named.schema, true);
528
- return { type, ...fields ? { fields } : {}, shape: named.shape };
529
- }
530
- function jsonSchemaOf(wrapper) {
531
- return isRecord(wrapper.jsonSchema) ? wrapper.jsonSchema : wrapper;
532
- }
533
- function publicToolSchemas(tool) {
534
- const scrubbed = (...keys) => {
535
- const schema = recordField(tool, ...keys);
536
- if (Object.keys(schema).length === 0) return null;
537
- const cleaned = publicToolInputSchemaForDescribe(schema);
538
- return isRecord(cleaned.jsonSchema) ? cleaned.jsonSchema : cleaned;
539
- };
540
- const responseSchema = scrubbed("responseSchema", "response_schema");
541
- return {
542
- inputSchema: scrubbed(
543
- "inputSchema",
544
- "input_schema",
545
- "payload_schema",
546
- "payloadSchema"
547
- ),
548
- outputSchema: scrubbed("outputSchema", "output_schema"),
549
- ...responseSchema ? { responseSchema } : {}
550
- };
551
- }
552
- function describedTool(tool, requestedToolId) {
553
- const id = stringField(tool, "toolId") || requestedToolId;
554
- const displayName = stringField(tool, "displayName") || void 0;
555
- const description = stringField(tool, "bestFor", "best_for") || stringField(tool, "description") || void 0;
556
- if (isMonitorTypeTool(tool)) {
557
- return {
558
- kind: "monitor_type",
559
- id,
560
- displayName,
561
- description,
562
- cost: stringField(recordField(tool, "pricing"), "displayText") || void 0,
563
- guidance: [],
564
- inputs: _chunkNSOTASOPjs.schemaFields.call(void 0,
565
- recordField(tool, "payload_schema", "payloadSchema")
566
- ),
567
- outputs: [],
568
- runner: {
569
- via: "monitor",
570
- deploy: stringField(recordField(tool, "deploy"), "example") || `deepline monitors deploy '{"key":"...","tool":"${id}","payload":{...}}'`
571
- }
572
- };
573
- }
574
- const contract = toolContractJsonForDescribe(tool, requestedToolId);
575
- const cost = recordField(contract, "cost");
576
- const billing = stringField(cost, "billingSourceLabel");
577
- const deprecation = recordField(contract, "deprecation");
578
- const getters = recordField(contract, "getters");
579
- const outputSchema = jsonSchemaOf(recordField(contract, "outputSchema"));
580
- const toolResult = recordField(tool, "toolResult", "tool_result");
581
- const getterDetails = (kind) => new Map(
582
- arrayField(toolResult, kind).filter(isRecord).map((item) => [
583
- stringField(item, "name"),
584
- recordField(item, "details")
585
- ])
586
- );
587
- const declared = recordField(tool, "extractors");
588
- const getterOutputs = (kind, roots) => {
589
- const details = getterDetails(kind);
590
- return arrayField(getters, kind).filter(isRecord).map((entry) => {
591
- const name = stringField(entry, "name");
592
- const rawPaths = arrayField(
593
- _nullishCoalesce(details.get(name), () => ( {})),
594
- "rawToolOutputPaths"
595
- ).map(String);
596
- const paths = rawPaths.map(
597
- (path) => path.replace(/^toolResponse\.raw\./, "")
598
- );
599
- const node = roots.flatMap((root) => paths.map((path) => schemaNodeAt(root, path))).find(isRecord);
600
- const { fields, ...typed } = _chunkNSOTASOPjs.schemaField.call(void 0, name, node, true);
601
- const valueType = stringField(_nullishCoalesce(details.get(name), () => ( {})), "valueType");
602
- const deepline = kind === "extractedValues" ? extractorValueType(name) : void 0;
603
- const known = typed.type !== "unknown" ? void 0 : kind === "extractedLists" ? { type: "object[]" } : deepline;
604
- const means = kind === "extractedValues" ? fieldOfName(
605
- name,
606
- stringField(_nullishCoalesce(declared[name], () => ( {})), "means") || void 0
607
- ) : void 0;
608
- const field = {
609
- ...typed,
610
- ...means ? { means } : {},
611
- // A normalized value has a named type instead of the response's
612
- // shape; a normalized object is spelled out once under Types.
613
- ..._optionalChain([deepline, 'optionalAccess', _5 => _5.shape]) ? deepline : valueType ? { type: valueType } : known ? known : fields ? { fields } : {},
614
- // A list's row columns that matter are value getters of their own.
615
- ...kind === "extractedLists" && fields ? { summarized: true } : {},
616
- read: playResultExpression(entry),
617
- ...rawPaths.length ? { paths: rawPaths } : {}
618
- };
619
- return { field, node };
620
- });
621
- };
622
- const declaredLists = getterOutputs("extractedLists", [outputSchema]);
623
- const lists = declaredLists.some(({ node }) => node) ? declaredLists.filter(({ node }) => node) : declaredLists;
624
- const values = getterOutputs("extractedValues", [
625
- outputSchema,
626
- ...lists.map(({ node }) => _optionalChain([node, 'optionalAccess', _6 => _6.items]))
627
- ]).map((value2) => {
628
- if (!lists.length || !value2.field.paths) return value2;
629
- const within = value2.field.paths.map(
630
- (path) => path.replace(/^toolResponse\.raw\./, "")
631
- );
632
- const list = _nullishCoalesce(lists.find(
633
- ({ node }) => within.some((path) => isRecord(schemaNodeAt(_optionalChain([node, 'optionalAccess', _7 => _7.items]), path)))
634
- ), () => ( lists[0]));
635
- return {
636
- ...value2,
637
- field: { ...value2.field, in: list.field.name, paths: within }
638
- };
639
- });
640
- const playReference = isPlayLikeTool(tool) ? playReferenceForTool(tool) : null;
641
- return {
642
- kind: "tool",
643
- id: String(contract.toolId),
644
- displayName,
645
- description,
646
- cost: [
647
- stringField(cost, "displayText"),
648
- // "Free (free)" says the same thing twice.
649
- billing.toLowerCase() === stringField(cost, "displayText").toLowerCase() ? "" : billing && `(${billing})`,
650
- _chunkKAEZNPUMjs.observedMaxText.call(void 0, cost) && `\u2014 ${_chunkKAEZNPUMjs.observedMaxText.call(void 0, cost)}`
651
- ].filter(Boolean).join(" ") || void 0,
652
- guidance: [
653
- ...contract.deprecated === true ? [`Deprecated. ${stringField(deprecation, "message")}`.trim()] : [],
654
- ...Object.values(recordField(contract, "guidance")).filter(
655
- (line) => typeof line === "string" && /[a-z0-9]/i.test(line)
656
- )
657
- ],
658
- rateLimit: _chunkNSOTASOPjs.rateLimitSummary.call(void 0,
659
- recordField(contract, "executionMetadata").configuredRateLimits
660
- ),
661
- inputs: _chunkNSOTASOPjs.schemaFields.call(void 0, jsonSchemaOf(recordField(contract, "inputSchema"))),
662
- outputs: [...lists, ...values].map(({ field }) => field),
663
- rawResponse: _chunkNSOTASOPjs.schemaFields.call(void 0, outputSchema),
664
- runner: playReference ? { via: "play", reference: playReference } : { via: "tool", toolId: String(contract.toolId) }
665
- };
666
- }
667
- function sampleValueForField(field) {
668
- const name = stringField(field, "name").toLowerCase();
669
- const type = stringField(field, "type").toLowerCase();
670
- if (Object.prototype.hasOwnProperty.call(field, "default"))
671
- return field.default;
672
- if (name.includes("email")) return "ada@example.com";
673
- if (name.includes("domain") || name.includes("website")) return "example.com";
674
- if (name.includes("first")) return "Ada";
675
- if (name.includes("last")) return "Lovelace";
676
- if (name.includes("name")) return "Ada Lovelace";
677
- if (type === "integer" || type === "number") return 1;
678
- if (type === "boolean") return true;
679
- if (type === "array") return [];
680
- if (type === "object") return {};
681
- return "...";
682
- }
683
- function samplePayloadForInputFields(fields) {
684
- return Object.fromEntries(
685
- fields.slice(0, 4).flatMap((field) => {
686
- if (!isRecord(field)) return [];
687
- const name = stringField(field, "name");
688
- if (!name) return [];
689
- return [[name, sampleValueForField(field)]];
690
- })
691
- );
692
- }
693
- function playResultExpression(entry) {
694
- return stringField(entry, "expression").replace(
695
- /^toolExecutionResult\./,
696
- "result."
697
- );
698
- }
699
- function toolMetadataJsonForDescribe(tool, requestedToolId, seedStarterScript) {
700
- const toolId = String(tool.toolId || requestedToolId);
701
- const inputFields = toolInputFieldsForDisplay(
702
- recordField(tool, "inputSchema", "input_schema")
703
- );
704
- const usageGuidance = usageGuidanceWithAccessDefaults(
705
- recordField(tool, "usageGuidance", "usage_guidance")
706
- );
707
- const toolExecutionResult = recordField(
708
- usageGuidance,
709
- "toolExecutionResult",
710
- "tool_execution_result"
711
- );
712
- const extractedLists = extractionContractEntries(
713
- arrayField(toolExecutionResult, "extractedLists", "extracted_lists")
714
- );
715
- const starterScript = seedStarterScript && !isPlayLikeTool(tool) && extractedLists.length > 0 ? starterScriptJson(
716
- seedStarterScript({
717
- toolId,
718
- payload: samplePayloadForInputFields(inputFields),
719
- rows: []
720
- })
721
- ) : null;
722
- const observedOutputCommand = isPlayLikeTool(tool) ? playRunCommandForTool(tool, toolId) : `deepline tools execute ${toolId} --input '{...}'`;
723
- const {
724
- cost: _cost,
725
- deeplineCreditsPerPricingUnit: _deeplineCreditsPerPricingUnit,
726
- deeplineUsdPerPricingUnit: _deeplineUsdPerPricingUnit,
727
- deeplineUsdPerCredit: _deeplineUsdPerCredit,
728
- deeplinePricingSummary: _deeplinePricingSummary,
729
- deeplinePricingDetails: _deeplinePricingDetails,
730
- deepline_credits_per_pricing_unit: _snakeDeeplineCreditsPerPricingUnit,
731
- deepline_usd_per_pricing_unit: _snakeDeeplineUsdPerPricingUnit,
732
- deepline_usd_per_credit: _snakeDeeplineUsdPerCredit,
733
- deepline_pricing_summary: _snakeDeeplinePricingSummary,
734
- deepline_pricing_details: _snakeDeeplinePricingDetails,
735
- // BYOK is shown only on request, via describe --feature byok.
736
- byok: _byok,
737
- ...publicTool
738
- } = tool;
739
- const outputSchemaRecord = recordField(tool, "outputSchema", "output_schema");
740
- return {
741
- cost: _chunkKAEZNPUMjs.Capability.fromCatalogEntry(tool).describe().customerCost(),
742
- ...publicTool,
743
- toolId,
744
- provider: tool.provider,
745
- displayName: tool.displayName,
746
- ...Object.keys(outputSchemaRecord).length > 0 ? {
747
- outputSchema: publicToolInputSchemaForDescribe(outputSchemaRecord),
748
- outputFields: toolOutputFieldsForDisplay(outputSchemaRecord).map(
749
- inputFieldJsonForDescribe
750
- )
751
- } : {},
752
- inputFields: inputFields.map(inputFieldJsonForDescribe),
753
- usageGuidance,
754
- runtimeOutputHelp: {
755
- contract: "Schemas declare field shapes. Examples illustrate input payloads and full Deepline execution responses; they are not observed responses from this call.",
756
- getterScope: "extractedValues/extractedLists .get() only works for declared Deepline getters listed in usageGuidance.toolExecutionResult.",
757
- rawToolResponse: "Use toolExecutionResult.toolResponse.rawV2 for the complete tool response. Preserve its nesting and sibling fields as shown in examples; use declared getters for extracted values and lists.",
758
- invalidGetterHint: "If TypeScript says an extractedValues/extractedLists property does not exist, that field is not a declared Deepline getter.",
759
- observeActualShape: observedOutputCommand,
760
- observedOutput: observedOutputCommand,
761
- forPlayGetterBugs: "Run a tiny play, inspect returned handles with `deepline runs get <run-id> --full`, then export row datasets with `deepline runs export`.",
762
- executeOutputFields: "tools execute JSON may include output_preview for this direct probe only; play debugging uses run output and returned dataset handles."
763
- },
764
- ...starterScript ? { starterScript } : {}
765
- };
766
- }
767
- function usageGuidanceWithAccessDefaults(usageGuidance) {
768
- if (Object.keys(usageGuidance).length === 0) return usageGuidance;
769
- const existingAccess = recordField(usageGuidance, "access");
770
- return {
771
- ...usageGuidance,
772
- prefer: [
773
- "Use only the declared extractedLists and extractedValues getters listed below.",
774
- "Use toolExecutionResult.toolResponse.rawV2 for the complete tool response, preserving the nesting shown in the response example.",
775
- "Schemas declare field shapes; examples illustrate input values and full Deepline execution responses."
776
- ],
777
- toolExecutionResult: {
778
- ...recordField(
779
- usageGuidance,
780
- "toolExecutionResult",
781
- "tool_execution_result"
782
- ),
783
- toolResponse: {
784
- rawV2: "toolResponse.rawV2",
785
- view: "toolResponse.view",
786
- responseMeta: "toolResponse.responseMeta"
787
- }
788
- },
789
- access: {
790
- ...existingAccess,
791
- extractedValues: {
792
- expression: "toolExecutionResult.extractedValues.<name>.get()",
793
- meaning: "Declared Deepline scalar or normalized object extractors only."
794
- },
795
- ...existingAccess,
796
- extractedLists: {
797
- ...recordField(existingAccess, "extractedLists"),
798
- expression: "toolExecutionResult.extractedLists.<name>.get()",
799
- meaning: _chunkKB4SDX5Sjs.playToolListGetterMode.call(void 0, ) === "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."
800
- },
801
- rawToolResponse: {
802
- expression: "toolExecutionResult.toolResponse.rawV2",
803
- meaning: "Complete tool response with its original nesting. Read tool-specific fields here; use declared getters for extracted values and lists."
804
- },
805
- canonicalToolResponse: {
806
- expression: "toolExecutionResult.toolResponse.rawV2",
807
- meaning: "Complete tool response with its original nesting and sibling fields."
808
- },
809
- invalidGetterHint: "If TypeScript says an extractedValues/extractedLists property does not exist, that field is not a declared Deepline getter; read it from toolResponse.rawV2 using the nesting shown in the response example."
810
- }
811
- };
812
- }
813
- function toolInputFieldsForDisplay(inputSchema) {
814
- if (Array.isArray(inputSchema.fields)) {
815
- const fields = inputSchema.fields.filter(isRecord);
816
- if (!isRecord(inputSchema.jsonSchema)) return fields;
817
- const jsonSchemaFields = new Map(
818
- recursiveToolInputFieldsForDisplay({
819
- jsonSchema: inputSchema.jsonSchema
820
- }).flatMap(
821
- (field) => typeof field.name === "string" ? [[field.name, field]] : []
822
- )
823
- );
824
- return fields.map((field) => {
825
- const jsonSchemaField = typeof field.name === "string" ? jsonSchemaFields.get(field.name) : void 0;
826
- const minItems = typeof field.minItems === "number" ? field.minItems : _optionalChain([jsonSchemaField, 'optionalAccess', _8 => _8.minItems]);
827
- const maxItems = typeof field.maxItems === "number" ? field.maxItems : _optionalChain([jsonSchemaField, 'optionalAccess', _9 => _9.maxItems]);
828
- const items = isRecord(field.items) ? field.items : _optionalChain([jsonSchemaField, 'optionalAccess', _10 => _10.items]);
829
- return {
830
- ...field,
831
- ...isRecord(items) ? { items } : {},
832
- ...typeof minItems === "number" ? { minItems } : {},
833
- ...typeof maxItems === "number" ? { maxItems } : {}
834
- };
835
- });
836
- }
837
- const jsonSchema = isRecord(inputSchema.jsonSchema) ? inputSchema.jsonSchema : inputSchema;
838
- const properties = isRecord(jsonSchema.properties) ? jsonSchema.properties : {};
839
- const required = Array.isArray(jsonSchema.required) ? new Set(jsonSchema.required.map(String)) : /* @__PURE__ */ new Set();
840
- return Object.entries(properties).map(([name, value2]) => {
841
- const property = isRecord(value2) ? value2 : {};
842
- return {
843
- name,
844
- type: typeof property.type === "string" ? property.type : "unknown",
845
- required: required.has(name),
846
- description: property.description,
847
- ...isRecord(property.items) ? { items: property.items } : {},
848
- ...typeof property.minItems === "number" ? { minItems: property.minItems } : {},
849
- ...typeof property.maxItems === "number" ? { maxItems: property.maxItems } : {},
850
- ...Object.prototype.hasOwnProperty.call(property, "default") ? { default: property.default } : {}
851
- };
852
- });
853
- }
854
- function toolOutputFieldsForDisplay(outputSchema) {
855
- if (Object.keys(outputSchema).length === 0) return [];
856
- return recursiveToolInputFieldsForDisplay({
857
- jsonSchema: outputSchema
858
- }).filter(
859
- (field) => typeof field.name === "string" && field.name.includes("[]")
860
- );
861
- }
862
- function canonicalToolJsonSchema(inputSchema) {
863
- return isRecord(inputSchema.jsonSchema) ? inputSchema.jsonSchema : inputSchema;
864
- }
865
- function publicToolInputSchemaForDescribe(inputSchema) {
866
- const exposesProviderSpend = (description) => {
867
- const withoutDeeplineCredits = description.replace(
868
- /\bdeepline(?:-facing)?\s+credits?\b/gi,
869
- ""
870
- );
871
- return /\bcredits?\b/i.test(withoutDeeplineCredits) || /\bprovider\s+(?:cost|spend|price|pricing|usage)\b/i.test(
872
- withoutDeeplineCredits
873
- ) || /\b(?:costs?|charges?|priced at)\s+[$€£]\s*\d/i.test(
874
- withoutDeeplineCredits
875
- ) || /\b(?:costs?|charges?|priced at)\s+\d+(?:\.\d+)?\s*(?:usd|eur|gbp)\b/i.test(
876
- withoutDeeplineCredits
877
- ) || /\battribute-priced\b/i.test(withoutDeeplineCredits) || /\b(?:cost|price|pricing)\s+(?:grows?|increases?|scales?|varies?)\b/i.test(
878
- withoutDeeplineCredits
879
- ) || /\b(?:will be|are|is|be)\s+(?:billed|charged)\b/i.test(
880
- withoutDeeplineCredits
881
- ) || /\b(?:additional|extra)\s+charges?\b/i.test(withoutDeeplineCredits) || /\bcharg(?:e|ed)\s+(?:double|per)\b/i.test(withoutDeeplineCredits) || /\bpricing page\b/i.test(withoutDeeplineCredits);
882
- };
883
- const stripDescriptions = (value2) => {
884
- if (Array.isArray(value2)) return value2.map(stripDescriptions);
885
- if (!isRecord(value2)) return value2;
886
- return Object.fromEntries(
887
- Object.entries(value2).flatMap(([key, nested]) => {
888
- if (key === "description" && typeof nested === "string" && exposesProviderSpend(nested)) {
889
- return [];
890
- }
891
- return [[key, stripDescriptions(nested)]];
892
- })
893
- );
894
- };
895
- return stripDescriptions(inputSchema);
896
- }
897
- function recursiveToolInputFieldsForDisplay(inputSchema) {
898
- const root = canonicalToolJsonSchema(inputSchema);
899
- const fields = /* @__PURE__ */ new Map();
900
- const schemasById = /* @__PURE__ */ new Map();
901
- const collectSchemaIds = (value2) => {
902
- if (Array.isArray(value2)) {
903
- for (const item of value2) collectSchemaIds(item);
904
- return;
905
- }
906
- if (!isRecord(value2)) return;
907
- if (typeof value2.$id === "string" && value2.$id.trim()) {
908
- schemasById.set(value2.$id.trim(), value2);
909
- }
910
- for (const nested of Object.values(value2)) collectSchemaIds(nested);
911
- };
912
- collectSchemaIds(root);
913
- const resolveRef = (schema) => {
914
- const ref = typeof schema.$ref === "string" ? schema.$ref : "";
915
- if (!ref.startsWith("#/")) return _nullishCoalesce(schemasById.get(ref), () => ( schema));
916
- let current = root;
917
- for (const rawSegment of ref.slice(2).split("/")) {
918
- const segment = rawSegment.replace(/~1/g, "/").replace(/~0/g, "~");
919
- if (!isRecord(current)) return schema;
920
- current = current[segment];
921
- }
922
- return isRecord(current) ? current : schema;
923
- };
924
- const addField = (field) => {
925
- const name = typeof field.name === "string" ? field.name : "";
926
- if (!name) return;
927
- const existing = fields.get(name);
928
- if (!existing || existing.type === "unknown") {
929
- fields.set(name, field);
930
- }
931
- };
932
- const visit = (unresolvedSchema, path, required, activeRefs = /* @__PURE__ */ new Set()) => {
933
- const ref = typeof unresolvedSchema.$ref === "string" ? unresolvedSchema.$ref : "";
934
- if (ref && activeRefs.has(ref)) return;
935
- const schema = resolveRef(unresolvedSchema);
936
- const nextActiveRefs = ref ? /* @__PURE__ */ new Set([...activeRefs, ref]) : activeRefs;
937
- const type = Array.isArray(schema.type) ? schema.type.map(String).join("|") : typeof schema.type === "string" ? schema.type : isRecord(schema.properties) ? "object" : schema.items ? "array" : "unknown";
938
- if (path) {
939
- addField({
940
- name: path,
941
- type,
942
- required,
943
- description: schema.description,
944
- ...Array.isArray(schema.enum) ? { enum: schema.enum } : {},
945
- ...isRecord(schema.items) ? { items: schema.items } : {},
946
- ...typeof schema.minItems === "number" ? { minItems: schema.minItems } : {},
947
- ...typeof schema.maxItems === "number" ? { maxItems: schema.maxItems } : {},
948
- ...Object.prototype.hasOwnProperty.call(schema, "default") ? { default: schema.default } : {}
949
- });
950
- }
951
- const properties = isRecord(schema.properties) ? schema.properties : {};
952
- const requiredNames = new Set(
953
- Array.isArray(schema.required) ? schema.required.map(String) : []
954
- );
955
- for (const [name, value2] of Object.entries(properties)) {
956
- if (!isRecord(value2)) continue;
957
- visit(
958
- value2,
959
- path ? `${path}.${name}` : name,
960
- requiredNames.has(name),
961
- nextActiveRefs
962
- );
963
- }
964
- if (isRecord(schema.items)) {
965
- visit(schema.items, `${path}[]`, false, nextActiveRefs);
966
- }
967
- for (const keyword of ["anyOf", "oneOf", "allOf"]) {
968
- const branches = Array.isArray(schema[keyword]) ? schema[keyword] : [];
969
- for (const branch of branches) {
970
- if (isRecord(branch)) {
971
- visit(branch, path, required, nextActiveRefs);
972
- }
973
- }
974
- }
975
- };
976
- visit(root, "", false);
977
- return fields.size ? [...fields.values()] : toolInputFieldsForDisplay(inputSchema);
978
- }
979
- function inputFieldJsonForDescribe(field) {
980
- const publicItems = isRecord(field.items) ? publicToolInputSchemaForDescribe({ items: field.items }).items : void 0;
981
- return {
982
- name: field.name,
983
- type: _nullishCoalesce(field.type, () => ( "unknown")),
984
- required: Boolean(field.required),
985
- ...field.description ? { description: field.description } : {},
986
- ...isRecord(publicItems) ? { items: publicItems } : {},
987
- ...typeof field.minItems === "number" ? { minItems: field.minItems } : {},
988
- ...typeof field.maxItems === "number" ? { maxItems: field.maxItems } : {},
989
- ...Object.prototype.hasOwnProperty.call(field, "default") ? { default: field.default } : {}
990
- };
991
- }
992
- function isRecord(value2) {
993
- return Boolean(value2 && typeof value2 === "object" && !Array.isArray(value2));
994
- }
995
- function stringField(source, ...keys) {
996
- for (const key of keys) {
997
- const value2 = source[key];
998
- if (typeof value2 === "string" && value2.trim()) return value2.trim();
999
- }
1000
- return "";
1001
- }
1002
- function arrayField(source, ...keys) {
1003
- for (const key of keys) {
1004
- const value2 = source[key];
1005
- if (Array.isArray(value2)) return value2;
1006
- }
1007
- return [];
1008
- }
1009
- function recordField(source, ...keys) {
1010
- for (const key of keys) {
1011
- const value2 = source[key];
1012
- if (isRecord(value2)) return value2;
1013
- }
1014
- return {};
1015
- }
1016
- function starterScriptJson(script) {
1017
- return {
1018
- path: script.path,
1019
- sourceCode: script.sourceCode,
1020
- projectDir: script.projectDir,
1021
- copyToProject: {
1022
- macosLinux: script.macCopyCommand,
1023
- windowsPowerShell: script.windowsCopyCommand
1024
- }
1025
- };
1026
- }
1027
-
1028
212
  // ../plays/tool-category-descriptions.ts
1029
213
  var TOOL_CATEGORY_DESCRIPTIONS = {
1030
214
  company_search: "Find companies matching firmographic, ad, or web criteria.",
@@ -1055,66 +239,6 @@ function describeToolCategory(category) {
1055
239
  return _nullishCoalesce(TOOL_CATEGORY_DESCRIPTIONS[category], () => ( null));
1056
240
  }
1057
241
 
1058
- // src/cli/commands/model-description.ts
1059
- function formatModelDescription(description) {
1060
- const lines = [];
1061
- lines.push(description.model);
1062
- lines.push(`Provider: ${description.provider}`);
1063
- const name = stringField2(description.modelMetadata, "name");
1064
- if (name) lines.push(`Name: ${name}`);
1065
- const contextWindow = numberField(
1066
- description.modelMetadata,
1067
- "context_window"
1068
- );
1069
- if (contextWindow !== null) lines.push(`Context: ${contextWindow}`);
1070
- const tags = arrayField2(description.modelMetadata, "tags").filter(
1071
- (value2) => typeof value2 === "string"
1072
- );
1073
- if (tags.length) lines.push(`Tags: ${tags.join(", ")}`);
1074
- lines.push("");
1075
- lines.push("Provider options:");
1076
- appendNamespace(lines, description.providerOptions.gateway);
1077
- if (description.providerOptions.selectedProvider) {
1078
- appendNamespace(lines, description.providerOptions.selectedProvider);
1079
- }
1080
- lines.push("");
1081
- lines.push("Example input:");
1082
- lines.push(JSON.stringify(description.exampleInput, null, 2));
1083
- if (description.caveats.length) {
1084
- lines.push("");
1085
- lines.push("Caveats:");
1086
- for (const caveat of description.caveats) {
1087
- lines.push(`- ${caveat}`);
1088
- }
1089
- }
1090
- return `${lines.join("\n")}
1091
- `;
1092
- }
1093
- function appendNamespace(lines, namespace) {
1094
- lines.push(`- ${namespace.provider} (${namespace.sourceSymbol})`);
1095
- for (const field of namespace.fields) {
1096
- const values = _optionalChain([field, 'access', _11 => _11.enumValues, 'optionalAccess', _12 => _12.length]) ? ` (${field.enumValues.map((value2) => JSON.stringify(value2)).join(" | ")})` : "";
1097
- lines.push(
1098
- ` - ${field.name}: ${field.type}${values} - ${field.description}`
1099
- );
1100
- }
1101
- }
1102
- function stringField2(value2, key) {
1103
- if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) return null;
1104
- const candidate = value2[key];
1105
- return typeof candidate === "string" && candidate.trim() ? candidate.trim() : null;
1106
- }
1107
- function numberField(value2, key) {
1108
- if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) return null;
1109
- const candidate = value2[key];
1110
- return typeof candidate === "number" ? candidate : null;
1111
- }
1112
- function arrayField2(value2, key) {
1113
- if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) return [];
1114
- const candidate = value2[key];
1115
- return Array.isArray(candidate) ? candidate : [];
1116
- }
1117
-
1118
242
  // src/cli/tool-connection-status.ts
1119
243
  function toolConnectionStatusMessage(input) {
1120
244
  if (input.credentialStatus === "requires_connection") {
@@ -1132,13 +256,13 @@ var TOOL_COMMAND_TEMPLATES = {
1132
256
  execute: "deepline tools execute <toolId> --input '{...}'"
1133
257
  };
1134
258
  function toListedTool(tool) {
1135
- if (isPlayLikeTool(tool)) {
259
+ if (_chunk7DRPTGCKjs.isPlayLikeTool.call(void 0, tool)) {
1136
260
  return {
1137
261
  ...tool,
1138
262
  description: listedToolDescription(tool),
1139
263
  id: tool.toolId,
1140
264
  type: "play",
1141
- executeCommand: playRunCommandForTool(tool, tool.toolId)
265
+ executeCommand: _chunk7DRPTGCKjs.playRunCommandForTool.call(void 0, tool, tool.toolId)
1142
266
  };
1143
267
  }
1144
268
  return {
@@ -1149,15 +273,15 @@ function toListedTool(tool) {
1149
273
  executeCommand: `deepline tools execute ${tool.toolId}`
1150
274
  };
1151
275
  }
1152
- function normalizeGrepText(value2) {
1153
- if (value2 === null || value2 === void 0) return "";
1154
- if (typeof value2 === "string") return value2.toLowerCase();
1155
- if (typeof value2 === "number" || typeof value2 === "boolean") {
1156
- return String(value2).toLowerCase();
276
+ function normalizeGrepText(value) {
277
+ if (value === null || value === void 0) return "";
278
+ if (typeof value === "string") return value.toLowerCase();
279
+ if (typeof value === "number" || typeof value === "boolean") {
280
+ return String(value).toLowerCase();
1157
281
  }
1158
- if (Array.isArray(value2)) return value2.map(normalizeGrepText).join(" ");
1159
- if (typeof value2 === "object") {
1160
- return Object.values(value2).map(normalizeGrepText).join(" ");
282
+ if (Array.isArray(value)) return value.map(normalizeGrepText).join(" ");
283
+ if (typeof value === "object") {
284
+ return Object.values(value).map(normalizeGrepText).join(" ");
1161
285
  }
1162
286
  return "";
1163
287
  }
@@ -1168,19 +292,19 @@ function parseGrepTerms(query, mode) {
1168
292
  const matches = _nullishCoalesce(trimmed.match(/"([^"]+)"|'([^']+)'|\S+/g), () => ( []));
1169
293
  return matches.map((term) => term.replace(/^["']|["']$/g, "").trim()).filter(Boolean);
1170
294
  }
1171
- function matchesGrepQuery(value2, query, mode) {
295
+ function matchesGrepQuery(value, query, mode) {
1172
296
  const terms = parseGrepTerms(query, mode);
1173
297
  if (terms.length === 0) return true;
1174
- const haystack = normalizeGrepText(value2);
298
+ const haystack = normalizeGrepText(value);
1175
299
  if (mode === "any") return terms.some((term) => haystack.includes(term));
1176
300
  return terms.every((term) => haystack.includes(term));
1177
301
  }
1178
- function shellCommandArg(value2) {
1179
- return `'${value2.replace(/'/g, `'\\''`)}'`;
302
+ function shellCommandArg(value) {
303
+ return `'${value.replace(/'/g, `'\\''`)}'`;
1180
304
  }
1181
305
  function zeroMatchToolGuidance(options) {
1182
306
  const categories = _nullishCoalesce(options.categories, () => ( []));
1183
- const query = _nullishCoalesce(_optionalChain([options, 'access', _13 => _13.query, 'optionalAccess', _14 => _14.trim, 'call', _15 => _15()]), () => ( ""));
307
+ const query = _nullishCoalesce(_optionalChain([options, 'access', _4 => _4.query, 'optionalAccess', _5 => _5.trim, 'call', _6 => _6()]), () => ( ""));
1184
308
  const filterText = [
1185
309
  categories.length ? `categories=${categories.join(",")}` : null,
1186
310
  query ? `grep=${query}` : null,
@@ -1239,16 +363,16 @@ function firstSentence(text) {
1239
363
  return (match ? match[0] : clean).trim();
1240
364
  }
1241
365
  function requiredInputIds(tool) {
1242
- const inputSchema = recordField(
366
+ const inputSchema = _chunk7DRPTGCKjs.recordField.call(void 0,
1243
367
  tool,
1244
368
  "inputSchema",
1245
369
  "input_schema"
1246
370
  );
1247
- return toolInputFieldsForDisplay(inputSchema).filter((field) => field.required === true).map((field) => String(_nullishCoalesce(field.name, () => ( "")))).filter(Boolean);
371
+ return _chunk7DRPTGCKjs.toolInputFieldsForDisplay.call(void 0, inputSchema).filter((field) => field.required === true).map((field) => String(_nullishCoalesce(field.name, () => ( "")))).filter(Boolean);
1248
372
  }
1249
373
  function notConnectedSuffix(tool) {
1250
374
  const record = tool;
1251
- const status = stringField(record, "credentialStatus", "credential_status");
375
+ const status = _chunk7DRPTGCKjs.stringField.call(void 0, record, "credentialStatus", "credential_status");
1252
376
  const connected = record.connected;
1253
377
  const message = toolConnectionStatusMessage({
1254
378
  connected: connected === false ? false : void 0,
@@ -1257,18 +381,18 @@ function notConnectedSuffix(tool) {
1257
381
  return message ? ` - \u26A0 ${message}` : "";
1258
382
  }
1259
383
  function shortPricingHint(tool) {
1260
- const pricing = recordField(
384
+ const pricing = _chunk7DRPTGCKjs.recordField.call(void 0,
1261
385
  tool,
1262
386
  "pricing"
1263
387
  );
1264
- const credits = numberField2(pricing, "creditsPerUnit", "credits_per_unit");
1265
- const unit = stringField(pricing, "unit");
388
+ const credits = numberField(pricing, "creditsPerUnit", "credits_per_unit");
389
+ const unit = _chunk7DRPTGCKjs.stringField.call(void 0, pricing, "unit");
1266
390
  if (credits !== null) {
1267
391
  return `${formatDecimal(credits)} cr/${unit || "unit"}`;
1268
392
  }
1269
- const summary = stringField(pricing, "summary");
393
+ const summary = _chunk7DRPTGCKjs.stringField.call(void 0, pricing, "summary");
1270
394
  if (summary) return summary;
1271
- const displayText = stringField(pricing, "displayText", "display_text");
395
+ const displayText = _chunk7DRPTGCKjs.stringField.call(void 0, pricing, "displayText", "display_text");
1272
396
  return displayText || null;
1273
397
  }
1274
398
  function aggregateCategorySummaries(tools) {
@@ -1312,12 +436,12 @@ function categoryEnumerationRender(summaries) {
1312
436
  };
1313
437
  }
1314
438
  async function listToolCategories(emitJson, compact) {
1315
- const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
439
+ const client = new (0, _chunkUVXBVUZQjs.DeeplineClient)();
1316
440
  const rawTools = await client.listTools({ compact });
1317
441
  const items = rawTools.map(toListedTool);
1318
442
  const summaries = aggregateCategorySummaries(rawTools);
1319
443
  const outputItems = compact ? items.map(compactTool) : items;
1320
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
444
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
1321
445
  {
1322
446
  tools: outputItems,
1323
447
  count: outputItems.length,
@@ -1336,7 +460,7 @@ function unknownCategoryError(category, summaries, emitJson) {
1336
460
  const known = summaries.map((item) => item.name);
1337
461
  const message = `Unknown tool category "${category}". Run \`deepline tools list\` to browse categories.`;
1338
462
  if (emitJson) {
1339
- _chunkRTO5QZWTjs.printJson.call(void 0, {
463
+ _chunkDQ65ZVHNjs.printJson.call(void 0, {
1340
464
  ok: false,
1341
465
  exitCode: 4,
1342
466
  code: "TOOL_CATEGORY_NOT_FOUND",
@@ -1350,13 +474,13 @@ function unknownCategoryError(category, summaries, emitJson) {
1350
474
  const render = categoryEnumerationRender(summaries);
1351
475
  console.error(message);
1352
476
  console.error("");
1353
- console.error(_chunkRTO5QZWTjs.renderCommandEnvelopeText.call(void 0, { render }).trimEnd());
477
+ console.error(_chunkDQ65ZVHNjs.renderCommandEnvelopeText.call(void 0, { render }).trimEnd());
1354
478
  console.error("");
1355
479
  console.error(`Valid categories: ${known.join(", ")}`);
1356
480
  return 4;
1357
481
  }
1358
482
  async function listToolsInCategory(category, emitJson) {
1359
- const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
483
+ const client = new (0, _chunkUVXBVUZQjs.DeeplineClient)();
1360
484
  const rawTools = await client.listTools({
1361
485
  categories: category,
1362
486
  compact: false
@@ -1366,7 +490,7 @@ async function listToolsInCategory(category, emitJson) {
1366
490
  if (!summaries.some((item) => item.name === category)) {
1367
491
  return unknownCategoryError(category, summaries, emitJson);
1368
492
  }
1369
- const rows = rawTools.filter((tool) => _optionalChain([tool, 'access', _16 => _16.categories, 'optionalAccess', _17 => _17.includes, 'call', _18 => _18(category)])).map((tool) => ({
493
+ const rows = rawTools.filter((tool) => _optionalChain([tool, 'access', _7 => _7.categories, 'optionalAccess', _8 => _8.includes, 'call', _9 => _9(category)])).map((tool) => ({
1370
494
  id: tool.toolId,
1371
495
  provider: tool.provider,
1372
496
  required: requiredInputIds(tool),
@@ -1393,7 +517,7 @@ async function listToolsInCategory(category, emitJson) {
1393
517
  }
1394
518
  ]
1395
519
  };
1396
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
520
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
1397
521
  {
1398
522
  category,
1399
523
  total: rows.length,
@@ -1406,7 +530,7 @@ async function listToolsInCategory(category, emitJson) {
1406
530
  return 0;
1407
531
  }
1408
532
  async function listToolsForCategoryFilter(requestedCategories, emitJson, compact) {
1409
- const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
533
+ const client = new (0, _chunkUVXBVUZQjs.DeeplineClient)();
1410
534
  const items = (await client.listTools({
1411
535
  categories: requestedCategories.join(","),
1412
536
  compact
@@ -1435,7 +559,7 @@ async function listToolsForCategoryFilter(requestedCategories, emitJson, compact
1435
559
  ]
1436
560
  };
1437
561
  const outputItems = compact ? items.map(compactTool) : items;
1438
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
562
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
1439
563
  {
1440
564
  tools: outputItems,
1441
565
  count: outputItems.length,
@@ -1451,16 +575,16 @@ async function listToolsForCategoryFilter(requestedCategories, emitJson, compact
1451
575
  return 0;
1452
576
  }
1453
577
  async function listTools(category, options = {}) {
1454
- const positional = _nullishCoalesce(_optionalChain([category, 'optionalAccess', _19 => _19.trim, 'call', _20 => _20()]), () => ( ""));
578
+ const positional = _nullishCoalesce(_optionalChain([category, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()]), () => ( ""));
1455
579
  const flagCategories = (_nullishCoalesce(options.categories, () => ( ""))).split(",").map((item) => item.trim()).filter(Boolean);
1456
580
  const compact = options.compact !== false;
1457
- const emitJson = options.json === true || _chunkRTO5QZWTjs.shouldEmitJson.call(void 0, );
581
+ const emitJson = options.json === true || _chunkDQ65ZVHNjs.shouldEmitJson.call(void 0, );
1458
582
  if (positional && flagCategories.length > 0) {
1459
583
  const flagIsSameSingle = flagCategories.length === 1 && flagCategories[0] === positional;
1460
584
  if (!flagIsSameSingle) {
1461
585
  const message = `Category "${positional}" and --categories ${flagCategories.join(",")} disagree. Pass one: deepline tools list ${positional}`;
1462
586
  if (emitJson) {
1463
- _chunkRTO5QZWTjs.printJson.call(void 0, {
587
+ _chunkDQ65ZVHNjs.printJson.call(void 0, {
1464
588
  ok: false,
1465
589
  exitCode: 2,
1466
590
  code: "TOOL_LIST_CATEGORY_CONFLICT",
@@ -1487,7 +611,7 @@ async function grepTools(queryInput, options = {}) {
1487
611
  console.error("Usage: deepline tools grep <query> [--json]");
1488
612
  return 1;
1489
613
  }
1490
- const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
614
+ const client = new (0, _chunkUVXBVUZQjs.DeeplineClient)();
1491
615
  const requestedCategories = options.categories ? options.categories.split(",").map((item) => item.trim()).filter(Boolean) : [];
1492
616
  const mode = _nullishCoalesce(options.mode, () => ( "all"));
1493
617
  const jsonOutput = options.json === true;
@@ -1530,7 +654,7 @@ async function grepTools(queryInput, options = {}) {
1530
654
  query,
1531
655
  mode
1532
656
  }) : null;
1533
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
657
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
1534
658
  {
1535
659
  tools: outputTools,
1536
660
  count: outputTools.length,
@@ -1548,13 +672,13 @@ async function grepTools(queryInput, options = {}) {
1548
672
  } : {},
1549
673
  commandTemplates: TOOL_COMMAND_TEMPLATES
1550
674
  },
1551
- { json: options.json || _chunkRTO5QZWTjs.shouldEmitJson.call(void 0, ) }
675
+ { json: options.json || _chunkDQ65ZVHNjs.shouldEmitJson.call(void 0, ) }
1552
676
  );
1553
677
  return 0;
1554
678
  }
1555
679
  function numericToolField(tool, field) {
1556
- const value2 = tool[field];
1557
- return typeof value2 === "number" ? value2 : void 0;
680
+ const value = tool[field];
681
+ return typeof value === "number" ? value : void 0;
1558
682
  }
1559
683
  function compactTool(tool) {
1560
684
  const listed = toListedTool(tool);
@@ -1574,7 +698,7 @@ function compactTool(tool) {
1574
698
  };
1575
699
  }
1576
700
  function playIdentifiers(play) {
1577
- return [play.name, play.reference, ..._nullishCoalesce(play.aliases, () => ( []))].filter((value2) => Boolean(_optionalChain([value2, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]))).map((value2) => value2.trim());
701
+ return [play.name, play.reference, ..._nullishCoalesce(play.aliases, () => ( []))].filter((value) => Boolean(_optionalChain([value, 'optionalAccess', _12 => _12.trim, 'call', _13 => _13()]))).map((value) => value.trim());
1578
702
  }
1579
703
  async function findPlayForToolId(client, toolId, cliInvocationId) {
1580
704
  const requested = toolId.trim();
@@ -1601,8 +725,8 @@ function printPlayAliasToolError(toolId, play) {
1601
725
  console.error(playAliasToolErrorMessage(toolId, play));
1602
726
  }
1603
727
  function playLikeToolExecuteErrorMessage(toolId, tool) {
1604
- const playReference = tool ? playReferenceForTool(tool) : null;
1605
- const nextStep = playReference ? `Use: deepline plays run ${playReference} --input '{...}'` : `Find the maintained workflow with: ${playSearchCommandForToolId(toolId)}`;
728
+ const playReference = tool ? _chunk7DRPTGCKjs.playReferenceForTool.call(void 0, tool) : null;
729
+ const nextStep = playReference ? `Use: deepline plays run ${playReference} --input '{...}'` : `Find the maintained workflow with: ${_chunk7DRPTGCKjs.playSearchCommandForToolId.call(void 0, toolId)}`;
1606
730
  return [
1607
731
  `${toolId} is a workflow/play entry, not an atomic provider tool.`,
1608
732
  nextStep,
@@ -1661,12 +785,12 @@ Output:
1661
785
  "Unable to read --credentials-file as a JSON object."
1662
786
  );
1663
787
  }
1664
- if (!credentials || typeof credentials !== "object" || Array.isArray(credentials) || Object.keys(credentials).length === 0 || Object.values(credentials).some((value2) => typeof value2 !== "string")) {
788
+ if (!credentials || typeof credentials !== "object" || Array.isArray(credentials) || Object.keys(credentials).length === 0 || Object.values(credentials).some((value) => typeof value !== "string")) {
1665
789
  throw new Error(
1666
790
  "--credentials-file must contain a nonempty JSON object of string credential values."
1667
791
  );
1668
792
  }
1669
- const result = await new (0, _chunkWQJJNIMQjs.DeeplineClient)().setIntegrationCredentials(
793
+ const result = await new (0, _chunkUVXBVUZQjs.DeeplineClient)().setIntegrationCredentials(
1670
794
  provider,
1671
795
  credentials
1672
796
  );
@@ -1676,7 +800,7 @@ Output:
1676
800
  );
1677
801
  }
1678
802
  const confirmation = { provider, credential_saved: true };
1679
- if (_chunkRTO5QZWTjs.shouldEmitJson.call(void 0, options.json))
803
+ if (_chunkDQ65ZVHNjs.shouldEmitJson.call(void 0, options.json))
1680
804
  console.log(JSON.stringify(confirmation));
1681
805
  else
1682
806
  console.log(
@@ -1716,7 +840,7 @@ Examples:
1716
840
  json: Boolean(options.json)
1717
841
  });
1718
842
  });
1719
- _chunkKAEZNPUMjs.registerDeprecatedSearchCommand.call(void 0, tools, () => ["tools", "monitors"]);
843
+ _chunkPSGEDGLTjs.registerDeprecatedSearchCommand.call(void 0, tools, () => ["tools", "monitors"]);
1720
844
  tools.command("grep <query>").description(
1721
845
  "Literal grep over tool ids, descriptions, categories, and input fields."
1722
846
  ).addHelpText(
@@ -1817,7 +941,7 @@ Examples:
1817
941
  process.exitCode = await narrowView();
1818
942
  return;
1819
943
  }
1820
- const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-EFWNECHI.js")));
944
+ const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-6WT74AOR.js")));
1821
945
  process.exitCode = await describeAnything(
1822
946
  toolId,
1823
947
  {
@@ -1832,7 +956,7 @@ Examples:
1832
956
  });
1833
957
  };
1834
958
  addToolMetadataCommand(
1835
- _chunkNSOTASOPjs.addDescribeOptions.call(void 0,
959
+ _chunkZAAKSJASjs.addDescribeOptions.call(void 0,
1836
960
  tools.command("describe <toolId>", { hidden: true }).alias("get"),
1837
961
  { json: false }
1838
962
  )
@@ -1862,8 +986,8 @@ Examples:
1862
986
  ).option(
1863
987
  "-p, --param <key=value>",
1864
988
  "Pass one parameter. Repeat for multiple values.",
1865
- (value2, acc) => {
1866
- acc.push(value2);
989
+ (value, acc) => {
990
+ acc.push(value);
1867
991
  return acc;
1868
992
  },
1869
993
  []
@@ -1903,7 +1027,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
1903
1027
  console.error("Usage: deepline tools describe <toolId> [--json]");
1904
1028
  return 1;
1905
1029
  }
1906
- const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
1030
+ const client = new (0, _chunkUVXBVUZQjs.DeeplineClient)();
1907
1031
  let tool;
1908
1032
  try {
1909
1033
  tool = await _asyncNullishCoalesce(compatibilityMetadata, async () => ( await client.getTool(toolId)));
@@ -1957,12 +1081,12 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
1957
1081
  const lines = toolPricingOnlyLines(tool, toolId);
1958
1082
  if (inferenceQuote)
1959
1083
  lines.push(...inferenceQuoteSummaryLines(inferenceQuote));
1960
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
1084
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
1961
1085
  {
1962
1086
  toolId: String(tool.toolId || toolId),
1963
- cost: _chunkKAEZNPUMjs.Capability.fromCatalogEntry(tool).describe().customerCost(),
1087
+ cost: _chunkZM2YPJQJjs.Capability.fromCatalogEntry(tool).describe().customerCost(),
1964
1088
  ...modelDescription ? { modelOptions: modelDescription } : {},
1965
- ...isMonitorTypeTool(tool) ? { pricing: recordField(tool, "pricing") } : {},
1089
+ ..._chunk7DRPTGCKjs.isMonitorTypeTool.call(void 0, tool) ? { pricing: _chunk7DRPTGCKjs.recordField.call(void 0, tool, "pricing") } : {},
1966
1090
  ...inferenceQuote ? { inferenceQuote } : {}
1967
1091
  },
1968
1092
  {
@@ -1973,14 +1097,14 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
1973
1097
  );
1974
1098
  return 0;
1975
1099
  }
1976
- if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !isMonitorTypeTool(tool) && !isPlayLikeTool(tool) && (options.json || options.contractJson)) {
1977
- const contract = toolContractJsonForDescribe(
1100
+ if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !_chunk7DRPTGCKjs.isMonitorTypeTool.call(void 0, tool) && !_chunk7DRPTGCKjs.isPlayLikeTool.call(void 0, tool) && (options.json || options.contractJson)) {
1101
+ const contract = _chunk7DRPTGCKjs.toolContractJsonForDescribe.call(void 0,
1978
1102
  tool,
1979
1103
  toolId,
1980
1104
  void 0,
1981
1105
  seedToolListScript
1982
1106
  );
1983
- _chunkRTO5QZWTjs.printCompactJson.call(void 0, {
1107
+ _chunkDQ65ZVHNjs.printCompactJson.call(void 0, {
1984
1108
  toolId: contract.toolId,
1985
1109
  ...options.schemaOnly ? {
1986
1110
  inputSchema: contract.inputSchema,
@@ -2003,8 +1127,8 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
2003
1127
  return 0;
2004
1128
  }
2005
1129
  if (options.contractJson) {
2006
- _chunkRTO5QZWTjs.printCompactJson.call(void 0, {
2007
- ...toolContractJsonForDescribe(
1130
+ _chunkDQ65ZVHNjs.printCompactJson.call(void 0, {
1131
+ ..._chunk7DRPTGCKjs.toolContractJsonForDescribe.call(void 0,
2008
1132
  tool,
2009
1133
  toolId,
2010
1134
  void 0,
@@ -2017,8 +1141,8 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
2017
1141
  }
2018
1142
  const emitJson = options.json === true;
2019
1143
  if (emitJson) {
2020
- _chunkRTO5QZWTjs.printCompactJson.call(void 0, {
2021
- ...toolMetadataJsonForDescribe(tool, toolId, seedToolListScript),
1144
+ _chunkDQ65ZVHNjs.printCompactJson.call(void 0, {
1145
+ ..._chunk7DRPTGCKjs.toolMetadataJsonForDescribe.call(void 0, tool, toolId, seedToolListScript),
2022
1146
  ...modelDescription ? { modelOptions: modelDescription } : {},
2023
1147
  ...inferenceQuote ? { inferenceQuote } : {}
2024
1148
  });
@@ -2043,7 +1167,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
2043
1167
  printCompactToolContract(tool, toolId);
2044
1168
  if (modelDescription) {
2045
1169
  process.stdout.write(`
2046
- ${formatModelDescription(modelDescription)}`);
1170
+ ${_chunk7DRPTGCKjs.formatModelDescription.call(void 0, modelDescription)}`);
2047
1171
  }
2048
1172
  if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
2049
1173
  return 0;
@@ -2051,7 +1175,7 @@ ${formatModelDescription(modelDescription)}`);
2051
1175
  printCompactToolContract(tool, toolId);
2052
1176
  if (modelDescription) {
2053
1177
  process.stdout.write(`
2054
- ${formatModelDescription(modelDescription)}`);
1178
+ ${_chunk7DRPTGCKjs.formatModelDescription.call(void 0, modelDescription)}`);
2055
1179
  }
2056
1180
  if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
2057
1181
  return 0;
@@ -2068,10 +1192,10 @@ function printInferenceQuoteSummary(quote) {
2068
1192
  for (const line of inferenceQuoteSummaryLines(quote)) console.log(line);
2069
1193
  }
2070
1194
  function printMonitorTypeFilters(tool) {
2071
- const schema = recordField(tool, "payload_schema", "payloadSchema");
2072
- const properties = recordField(schema, "properties");
1195
+ const schema = _chunk7DRPTGCKjs.recordField.call(void 0, tool, "payload_schema", "payloadSchema");
1196
+ const properties = _chunk7DRPTGCKjs.recordField.call(void 0, schema, "properties");
2073
1197
  const required = new Set(
2074
- arrayField(schema, "required").filter(
1198
+ _chunk7DRPTGCKjs.arrayField.call(void 0, schema, "required").filter(
2075
1199
  (v) => typeof v === "string"
2076
1200
  )
2077
1201
  );
@@ -2082,25 +1206,25 @@ function printMonitorTypeFilters(tool) {
2082
1206
  }
2083
1207
  console.log("Deploy filters (set in the monitor payload):");
2084
1208
  for (const name of names) {
2085
- const field = isRecord(properties[name]) ? properties[name] : {};
1209
+ const field = _chunk7DRPTGCKjs.isRecord.call(void 0, properties[name]) ? properties[name] : {};
2086
1210
  const star = required.has(name) ? "*" : "";
2087
- const enumVals = arrayField(field, "enum").filter(
1211
+ const enumVals = _chunk7DRPTGCKjs.arrayField.call(void 0, field, "enum").filter(
2088
1212
  (v) => typeof v === "string"
2089
1213
  );
2090
- const type = enumVals.length ? `one of [${enumVals.join(", ")}]` : stringField(field, "type") || "string";
2091
- const desc = stringField(field, "description");
1214
+ const type = enumVals.length ? `one of [${enumVals.join(", ")}]` : _chunk7DRPTGCKjs.stringField.call(void 0, field, "type") || "string";
1215
+ const desc = _chunk7DRPTGCKjs.stringField.call(void 0, field, "description");
2092
1216
  console.log(`- ${name}${star}: ${type}${desc ? ` - ${desc}` : ""}`);
2093
1217
  }
2094
1218
  }
2095
1219
  function printMonitorTypeFilterExamples(tool) {
2096
- const documentation = recordField(tool, "documentation");
2097
- const fields = recordField(documentation, "fields");
1220
+ const documentation = _chunk7DRPTGCKjs.recordField.call(void 0, tool, "documentation");
1221
+ const fields = _chunk7DRPTGCKjs.recordField.call(void 0, documentation, "fields");
2098
1222
  const examples = Object.entries(fields).flatMap(([name, rawField]) => {
2099
- const grammar = recordField(isRecord(rawField) ? rawField : {}, "grammar");
2100
- const example = stringField(grammar, "example");
1223
+ const grammar = _chunk7DRPTGCKjs.recordField.call(void 0, _chunk7DRPTGCKjs.isRecord.call(void 0, rawField) ? rawField : {}, "grammar");
1224
+ const example = _chunk7DRPTGCKjs.stringField.call(void 0, grammar, "example");
2101
1225
  const values = [
2102
- ...arrayField(grammar, "examples").filter(
2103
- (value2) => typeof value2 === "string" && Boolean(value2)
1226
+ ..._chunk7DRPTGCKjs.arrayField.call(void 0, grammar, "examples").filter(
1227
+ (value) => typeof value === "string" && Boolean(value)
2104
1228
  ),
2105
1229
  ...example ? [example] : []
2106
1230
  ];
@@ -2114,21 +1238,21 @@ function printMonitorTypeFilterExamples(tool) {
2114
1238
  }
2115
1239
  }
2116
1240
  function printMonitorTypeStreams(tool) {
2117
- const streams = arrayField(tool, "streams", "output_streams").filter(
2118
- isRecord
1241
+ const streams = _chunk7DRPTGCKjs.arrayField.call(void 0, tool, "streams", "output_streams").filter(
1242
+ _chunk7DRPTGCKjs.isRecord
2119
1243
  );
2120
1244
  if (!streams.length) return;
2121
1245
  console.log("");
2122
1246
  console.log("Filter columns (a play's sqlListeners.where, per stream):");
2123
1247
  for (const stream of streams) {
2124
- const name = stringField(stream, "stream");
2125
- const cols = arrayField(stream, "columns").filter(isRecord).map((col) => stringField(col, "name")).filter(Boolean);
1248
+ const name = _chunk7DRPTGCKjs.stringField.call(void 0, stream, "stream");
1249
+ const cols = _chunk7DRPTGCKjs.arrayField.call(void 0, stream, "columns").filter(_chunk7DRPTGCKjs.isRecord).map((col) => _chunk7DRPTGCKjs.stringField.call(void 0, col, "name")).filter(Boolean);
2126
1250
  console.log(`- ${name}: ${cols.join(", ")}`);
2127
1251
  }
2128
1252
  }
2129
1253
  function monitorTypePricingLines(tool) {
2130
- const pricing = recordField(tool, "pricing");
2131
- const byType = recordField(
1254
+ const pricing = _chunk7DRPTGCKjs.recordField.call(void 0, tool, "pricing");
1255
+ const byType = _chunk7DRPTGCKjs.recordField.call(void 0,
2132
1256
  pricing,
2133
1257
  "pricing_by_radar_type",
2134
1258
  "pricingByRadarType"
@@ -2139,9 +1263,9 @@ function monitorTypePricingLines(tool) {
2139
1263
  }
2140
1264
  const lines = ["Pricing (Deepline credits per accepted event):"];
2141
1265
  for (const key of keys) {
2142
- const entry = isRecord(byType[key]) ? byType[key] : {};
2143
- const credits = numberField2(entry, "deepline_credits", "deeplineCredits");
2144
- const display = stringField(entry, "display");
1266
+ const entry = _chunk7DRPTGCKjs.isRecord.call(void 0, byType[key]) ? byType[key] : {};
1267
+ const credits = numberField(entry, "deepline_credits", "deeplineCredits");
1268
+ const display = _chunk7DRPTGCKjs.stringField.call(void 0, entry, "display");
2145
1269
  const shown = display || (credits !== null ? `${formatDecimal(credits)} credits/event` : "not listed");
2146
1270
  lines.push(`- ${key}: ${shown}`);
2147
1271
  }
@@ -2151,20 +1275,20 @@ function printMonitorTypePricing(tool) {
2151
1275
  for (const line of monitorTypePricingLines(tool)) console.log(line);
2152
1276
  }
2153
1277
  function printMonitorTypeDeploy(tool) {
2154
- const deploy = recordField(tool, "deploy");
2155
- const toolId = stringField(tool, "toolId");
2156
- const example = stringField(deploy, "example") || `deepline monitors deploy '{"key":"...","tool":"${toolId}","payload":{...}}'`;
1278
+ const deploy = _chunk7DRPTGCKjs.recordField.call(void 0, tool, "deploy");
1279
+ const toolId = _chunk7DRPTGCKjs.stringField.call(void 0, tool, "toolId");
1280
+ const example = _chunk7DRPTGCKjs.stringField.call(void 0, deploy, "example") || `deepline monitors deploy '{"key":"...","tool":"${toolId}","payload":{...}}'`;
2157
1281
  console.log("Deploy (a monitor type is deployed, not executed):");
2158
1282
  console.log(` ${example}`);
2159
1283
  }
2160
1284
  function printMonitorTypeContract(tool, requestedToolId) {
2161
- const toolId = stringField(tool, "toolId") || requestedToolId;
1285
+ const toolId = _chunk7DRPTGCKjs.stringField.call(void 0, tool, "toolId") || requestedToolId;
2162
1286
  console.log(toolId);
2163
- const displayName = stringField(tool, "displayName");
1287
+ const displayName = _chunk7DRPTGCKjs.stringField.call(void 0, tool, "displayName");
2164
1288
  if (displayName) console.log(`Best for: ${displayName}`);
2165
- const description = stringField(tool, "description");
1289
+ const description = _chunk7DRPTGCKjs.stringField.call(void 0, tool, "description");
2166
1290
  if (description) console.log(`Description: ${description}`);
2167
- const categories = arrayField(tool, "categories").filter(
1291
+ const categories = _chunk7DRPTGCKjs.arrayField.call(void 0, tool, "categories").filter(
2168
1292
  (v) => typeof v === "string"
2169
1293
  );
2170
1294
  if (categories.length) console.log(`Tags: ${categories.join(", ")}`);
@@ -2184,31 +1308,31 @@ function printMonitorTypeContract(tool, requestedToolId) {
2184
1308
  console.log(`More: deepline describe ${toolId}`);
2185
1309
  }
2186
1310
  function toolGuidanceLines(guidance) {
2187
- const record = isRecord(guidance) ? guidance : {};
2188
- const toolGuidance = stringField(record, "tool");
2189
- const providerGuidance = stringField(record, "provider");
1311
+ const record = _chunk7DRPTGCKjs.isRecord.call(void 0, guidance) ? guidance : {};
1312
+ const toolGuidance = _chunk7DRPTGCKjs.stringField.call(void 0, record, "tool");
1313
+ const providerGuidance = _chunk7DRPTGCKjs.stringField.call(void 0, record, "provider");
2190
1314
  return [
2191
1315
  ...toolGuidance ? [`- This tool: ${toolGuidance}`] : [],
2192
1316
  ...providerGuidance ? [`- Provider: ${providerGuidance}`] : []
2193
1317
  ];
2194
1318
  }
2195
1319
  function printCompactToolContract(tool, requestedToolId) {
2196
- if (isMonitorTypeTool(tool)) {
1320
+ if (_chunk7DRPTGCKjs.isMonitorTypeTool.call(void 0, tool)) {
2197
1321
  printMonitorTypeContract(tool, requestedToolId);
2198
1322
  return;
2199
1323
  }
2200
- const contract = toolContractJsonForDescribe(
1324
+ const contract = _chunk7DRPTGCKjs.toolContractJsonForDescribe.call(void 0,
2201
1325
  tool,
2202
1326
  requestedToolId,
2203
1327
  void 0,
2204
1328
  seedToolListScript
2205
1329
  );
2206
- const cost = isRecord(contract.cost) ? contract.cost : {};
2207
- const getters = isRecord(contract.getters) ? contract.getters : {};
1330
+ const cost = _chunk7DRPTGCKjs.isRecord.call(void 0, contract.cost) ? contract.cost : {};
1331
+ const getters = _chunk7DRPTGCKjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
2208
1332
  const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
2209
1333
  const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
2210
- const inputFields = recursiveToolInputFieldsForDisplay(
2211
- recordField(contract, "inputSchema")
1334
+ const inputFields = _chunk7DRPTGCKjs.recursiveToolInputFieldsForDisplay.call(void 0,
1335
+ _chunk7DRPTGCKjs.recordField.call(void 0, contract, "inputSchema")
2212
1336
  );
2213
1337
  console.log(String(contract.toolId));
2214
1338
  if (contract.displayName) console.log(`Best for: ${contract.displayName}`);
@@ -2225,9 +1349,9 @@ function printCompactToolContract(tool, requestedToolId) {
2225
1349
  printToolOutputArrayShape(contract);
2226
1350
  printToolExecutionHints(contract);
2227
1351
  if (contract.deprecated === true) {
2228
- const deprecation = isRecord(contract.deprecation) ? contract.deprecation : {};
2229
- const message = stringField(deprecation, "message");
2230
- const replacementToolId = stringField(
1352
+ const deprecation = _chunk7DRPTGCKjs.isRecord.call(void 0, contract.deprecation) ? contract.deprecation : {};
1353
+ const message = _chunk7DRPTGCKjs.stringField.call(void 0, deprecation, "message");
1354
+ const replacementToolId = _chunk7DRPTGCKjs.stringField.call(void 0,
2231
1355
  deprecation,
2232
1356
  "replacementToolId",
2233
1357
  "replacement_tool_id"
@@ -2252,12 +1376,12 @@ function printCompactToolContract(tool, requestedToolId) {
2252
1376
  console.log("");
2253
1377
  console.log("Inputs:");
2254
1378
  for (const field of inputFields) {
2255
- if (!isRecord(field)) continue;
2256
- const name = stringField(field, "name");
1379
+ if (!_chunk7DRPTGCKjs.isRecord.call(void 0, field)) continue;
1380
+ const name = _chunk7DRPTGCKjs.stringField.call(void 0, field, "name");
2257
1381
  if (!name) continue;
2258
1382
  const required = field.required ? "*" : "";
2259
- const type = stringField(field, "type") || "unknown";
2260
- const description = stringField(field, "description");
1383
+ const type = _chunk7DRPTGCKjs.stringField.call(void 0, field, "type") || "unknown";
1384
+ const description = _chunk7DRPTGCKjs.stringField.call(void 0, field, "description");
2261
1385
  const enumValues = Array.isArray(field.enum) ? field.enum : [];
2262
1386
  const enumSuffix = enumValues.length ? ` enum=${enumValues.map(String).join("|")}` : "";
2263
1387
  const itemBoundsSuffix = arrayItemBoundsSuffix(field);
@@ -2272,8 +1396,8 @@ function printCompactToolContract(tool, requestedToolId) {
2272
1396
  }
2273
1397
  console.log("");
2274
1398
  printToolExamplesOnly(tool, requestedToolId);
2275
- const starterScript = isRecord(contract.starterScript) ? contract.starterScript : {};
2276
- const starterPath = stringField(starterScript, "path");
1399
+ const starterScript = _chunk7DRPTGCKjs.isRecord.call(void 0, contract.starterScript) ? contract.starterScript : {};
1400
+ const starterPath = _chunk7DRPTGCKjs.stringField.call(void 0, starterScript, "path");
2277
1401
  if (starterPath) {
2278
1402
  console.log("");
2279
1403
  console.log(`Starter script: ${starterPath}`);
@@ -2284,16 +1408,16 @@ function printCompactToolContract(tool, requestedToolId) {
2284
1408
  console.log("Getters:");
2285
1409
  if (listGetters.length) console.log(listGetterHeading());
2286
1410
  for (const entry of listGetters) {
2287
- if (isRecord(entry))
1411
+ if (_chunk7DRPTGCKjs.isRecord.call(void 0, entry))
2288
1412
  console.log(
2289
- `- ${stringField(entry, "name")}: ${playResultExpression(entry)}`
1413
+ `- ${_chunk7DRPTGCKjs.stringField.call(void 0, entry, "name")}: ${_chunk7DRPTGCKjs.playResultExpression.call(void 0, entry)}`
2290
1414
  );
2291
1415
  }
2292
1416
  if (valueGetters.length) console.log("Values:");
2293
1417
  for (const entry of valueGetters) {
2294
- if (isRecord(entry))
1418
+ if (_chunk7DRPTGCKjs.isRecord.call(void 0, entry))
2295
1419
  console.log(
2296
- `- ${stringField(entry, "name")}: ${playResultExpression(entry)}`
1420
+ `- ${_chunk7DRPTGCKjs.stringField.call(void 0, entry, "name")}: ${_chunk7DRPTGCKjs.playResultExpression.call(void 0, entry)}`
2297
1421
  );
2298
1422
  }
2299
1423
  }
@@ -2304,23 +1428,23 @@ function printCompactToolContract(tool, requestedToolId) {
2304
1428
  console.log(`More: deepline describe ${contract.toolId}`);
2305
1429
  }
2306
1430
  function toolPricingOnlyLines(tool, requestedToolId, options = {}) {
2307
- if (isMonitorTypeTool(tool)) {
1431
+ if (_chunk7DRPTGCKjs.isMonitorTypeTool.call(void 0, tool)) {
2308
1432
  return monitorTypePricingLines(tool);
2309
1433
  }
2310
1434
  const toolId = String(tool.toolId || requestedToolId);
2311
- const cost = _chunkKAEZNPUMjs.Capability.fromCatalogEntry(tool).describe().customerCost();
2312
- const pricingModel = stringField(cost, "pricingModel") || "unknown";
2313
- const billing = stringField(cost, "billingSourceLabel") || stringField(cost, "billingSource") || stringField(cost, "billingMode") || "unknown";
2314
- const explicitUnit = stringField(cost, "unit");
1435
+ const cost = _chunkZM2YPJQJjs.Capability.fromCatalogEntry(tool).describe().customerCost();
1436
+ const pricingModel = _chunk7DRPTGCKjs.stringField.call(void 0, cost, "pricingModel") || "unknown";
1437
+ const billing = _chunk7DRPTGCKjs.stringField.call(void 0, cost, "billingSourceLabel") || _chunk7DRPTGCKjs.stringField.call(void 0, cost, "billingSource") || _chunk7DRPTGCKjs.stringField.call(void 0, cost, "billingMode") || "unknown";
1438
+ const explicitUnit = _chunk7DRPTGCKjs.stringField.call(void 0, cost, "unit");
2315
1439
  const unit = explicitUnit || (pricingModel === "per_page" ? "page" : pricingModel === "per_result" ? "result" : pricingModel === "fixed" ? "call" : pricingModel.replace(/^per_/, "") || "unit");
2316
- const credits = numberField2(cost, "deeplineCreditsPerPricingUnit");
2317
- const usd = numberField2(cost, "deeplineUsdPerPricingUnit");
2318
- const displayText = stringField(cost, "displayText");
2319
- const summary = stringField(cost, "summary");
1440
+ const credits = numberField(cost, "deeplineCreditsPerPricingUnit");
1441
+ const usd = numberField(cost, "deeplineUsdPerPricingUnit");
1442
+ const displayText = _chunk7DRPTGCKjs.stringField.call(void 0, cost, "displayText");
1443
+ const summary = _chunk7DRPTGCKjs.stringField.call(void 0, cost, "summary");
2320
1444
  const price = displayText || summary || (credits !== null ? `${formatDecimal(credits)} Deepline credits${usd !== null ? ` / ${formatUsd(usd)}` : ""} per ${unit}` : "pricing unavailable");
2321
1445
  return [
2322
1446
  `${_nullishCoalesce(options.heading, () => ( `Pricing: ${toolId}`))}: ${price}`,
2323
- ..._chunkKAEZNPUMjs.observedMaxText.call(void 0, cost) ? [` ${_chunkKAEZNPUMjs.observedMaxText.call(void 0, cost)}`] : [],
1447
+ ..._chunkZM2YPJQJjs.observedMaxText.call(void 0, cost) ? [` ${_chunkZM2YPJQJjs.observedMaxText.call(void 0, cost)}`] : [],
2324
1448
  ...cost.observedReference || cost.estimatedRange ? [
2325
1449
  ...summary ? [` ${summary}`] : [],
2326
1450
  ...(_nullishCoalesce(cost.details, () => ( []))).map((detail) => ` ${detail}`)
@@ -2333,19 +1457,19 @@ function printToolPricingOnly(tool, requestedToolId, options = {}) {
2333
1457
  console.log(line);
2334
1458
  }
2335
1459
  function printToolSchemaOnly(tool, requestedToolId) {
2336
- if (isMonitorTypeTool(tool)) {
1460
+ if (_chunk7DRPTGCKjs.isMonitorTypeTool.call(void 0, tool)) {
2337
1461
  printMonitorTypeFilters(tool);
2338
1462
  printMonitorTypeStreams(tool);
2339
1463
  return;
2340
1464
  }
2341
- const contract = toolContractJsonForDescribe(
1465
+ const contract = _chunk7DRPTGCKjs.toolContractJsonForDescribe.call(void 0,
2342
1466
  tool,
2343
1467
  requestedToolId,
2344
1468
  void 0,
2345
1469
  seedToolListScript
2346
1470
  );
2347
- const inputFields = recursiveToolInputFieldsForDisplay(
2348
- recordField(contract, "inputSchema")
1471
+ const inputFields = _chunk7DRPTGCKjs.recursiveToolInputFieldsForDisplay.call(void 0,
1472
+ _chunk7DRPTGCKjs.recordField.call(void 0, contract, "inputSchema")
2349
1473
  );
2350
1474
  console.log(`Schema: ${contract.toolId}`);
2351
1475
  if (!inputFields.length) {
@@ -2372,27 +1496,27 @@ function printToolSchemaOnly(tool, requestedToolId) {
2372
1496
  }
2373
1497
  printToolOutputArrayShape(contract);
2374
1498
  const declaredSchema = declaredToolJsonSchema(
2375
- recordField(contract, "inputSchema")
1499
+ _chunk7DRPTGCKjs.recordField.call(void 0, contract, "inputSchema")
2376
1500
  );
2377
1501
  if (declaredSchema) {
2378
1502
  console.log("Declared input JSON Schema:");
2379
1503
  console.log(JSON.stringify(declaredSchema, null, 2));
2380
1504
  }
2381
- if (isRecord(contract.responseSchema)) {
1505
+ if (_chunk7DRPTGCKjs.isRecord.call(void 0, contract.responseSchema)) {
2382
1506
  console.log("Deepline execution response JSON Schema:");
2383
1507
  console.log(JSON.stringify(contract.responseSchema, null, 2));
2384
1508
  }
2385
1509
  }
2386
1510
  function printToolExamplesOnly(tool, requestedToolId) {
2387
- if (isMonitorTypeTool(tool)) {
1511
+ if (_chunk7DRPTGCKjs.isMonitorTypeTool.call(void 0, tool)) {
2388
1512
  printMonitorTypeDeploy(tool);
2389
1513
  return;
2390
1514
  }
2391
- if (isPlayLikeTool(tool)) {
1515
+ if (_chunk7DRPTGCKjs.isPlayLikeTool.call(void 0, tool)) {
2392
1516
  printPlayLikeToolUsage(tool, requestedToolId);
2393
1517
  return;
2394
1518
  }
2395
- const contract = toolContractJsonForDescribe(
1519
+ const contract = _chunk7DRPTGCKjs.toolContractJsonForDescribe.call(void 0,
2396
1520
  tool,
2397
1521
  requestedToolId,
2398
1522
  void 0,
@@ -2400,9 +1524,9 @@ function printToolExamplesOnly(tool, requestedToolId) {
2400
1524
  );
2401
1525
  const toolId = String(contract.toolId);
2402
1526
  const inputFields = Array.isArray(contract.inputFields) ? contract.inputFields : [];
2403
- const examples = arrayField(tool, "examples").filter(isRecord);
1527
+ const examples = _chunk7DRPTGCKjs.arrayField.call(void 0, tool, "examples").filter(_chunk7DRPTGCKjs.isRecord);
2404
1528
  const firstExample = examples[0];
2405
- const sampleInput = firstExample && isRecord(firstExample.input) ? firstExample.input : _nullishCoalesce(samplePayload(recordField(tool, "samples"), "request"), () => ( samplePayloadForInputFields(inputFields)));
1529
+ const sampleInput = firstExample && _chunk7DRPTGCKjs.isRecord.call(void 0, firstExample.input) ? firstExample.input : _nullishCoalesce(samplePayload(_chunk7DRPTGCKjs.recordField.call(void 0, tool, "samples"), "request"), () => ( _chunk7DRPTGCKjs.samplePayloadForInputFields.call(void 0, inputFields)));
2406
1530
  console.log("Example input payload:");
2407
1531
  console.log(JSON.stringify(sampleInput, null, 2));
2408
1532
  console.log(`Use in a play:`);
@@ -2416,32 +1540,32 @@ function printToolExamplesOnly(tool, requestedToolId) {
2416
1540
  );
2417
1541
  console.log("});");
2418
1542
  console.log("const response = result.toolResponse.rawV2;");
2419
- const getters = isRecord(contract.getters) ? contract.getters : {};
1543
+ const getters = _chunk7DRPTGCKjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
2420
1544
  const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
2421
1545
  const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
2422
- const firstGetter = valueGetters.find(isRecord);
1546
+ const firstGetter = valueGetters.find(_chunk7DRPTGCKjs.isRecord);
2423
1547
  if (firstGetter) {
2424
- const name = stringField(firstGetter, "name") || "value";
2425
- const expression = stringField(firstGetter, "expression");
1548
+ const name = _chunk7DRPTGCKjs.stringField.call(void 0, firstGetter, "name") || "value";
1549
+ const expression = _chunk7DRPTGCKjs.stringField.call(void 0, firstGetter, "expression");
2426
1550
  if (expression)
2427
1551
  console.log(
2428
1552
  `const ${safeIdentifier(name)} = ${expression.replace(/^toolExecutionResult\./, "result.")};`
2429
1553
  );
2430
1554
  }
2431
1555
  const arrayNames = new Set(
2432
- recursiveToolInputFieldsForDisplay(
2433
- recordField(tool, "outputSchema", "output_schema")
1556
+ _chunk7DRPTGCKjs.recursiveToolInputFieldsForDisplay.call(void 0,
1557
+ _chunk7DRPTGCKjs.recordField.call(void 0, tool, "outputSchema", "output_schema")
2434
1558
  ).filter((field) => String(field.type).split("|").includes("array")).map((field) => String(field.name).split(".").at(-1))
2435
1559
  );
2436
1560
  const firstList = _nullishCoalesce(listGetters.find(
2437
- (entry) => isRecord(entry) && arrayNames.has(stringField(entry, "name"))
2438
- ), () => ( listGetters.find(isRecord)));
2439
- if (isRecord(firstList)) {
2440
- const name = safeIdentifier(stringField(firstList, "name") || "list");
1561
+ (entry) => _chunk7DRPTGCKjs.isRecord.call(void 0, entry) && arrayNames.has(_chunk7DRPTGCKjs.stringField.call(void 0, entry, "name"))
1562
+ ), () => ( listGetters.find(_chunk7DRPTGCKjs.isRecord)));
1563
+ if (_chunk7DRPTGCKjs.isRecord.call(void 0, firstList)) {
1564
+ const name = safeIdentifier(_chunk7DRPTGCKjs.stringField.call(void 0, firstList, "name") || "list");
2441
1565
  if (_chunkKB4SDX5Sjs.playToolListGetterMode.call(void 0, ) === "array") {
2442
- console.log(`const ${name}_rows = ${playResultExpression(firstList)};`);
1566
+ console.log(`const ${name}_rows = ${_chunk7DRPTGCKjs.playResultExpression.call(void 0, firstList)};`);
2443
1567
  } else {
2444
- console.log(`const ${name}_ds = ${playResultExpression(firstList)};`);
1568
+ console.log(`const ${name}_ds = ${_chunk7DRPTGCKjs.playResultExpression.call(void 0, firstList)};`);
2445
1569
  console.log(
2446
1570
  "// Complete small list from this response; throws above the memory cap."
2447
1571
  );
@@ -2451,7 +1575,7 @@ function printToolExamplesOnly(tool, requestedToolId) {
2451
1575
  console.log("```");
2452
1576
  if (firstList) printListGetterConsumption();
2453
1577
  for (const example of examples) {
2454
- const description = stringField(example, "description");
1578
+ const description = _chunk7DRPTGCKjs.stringField.call(void 0, example, "description");
2455
1579
  if (description) console.log(description);
2456
1580
  console.log("Example Deepline execution response:");
2457
1581
  console.log(JSON.stringify(example.response, null, 2));
@@ -2466,14 +1590,14 @@ function printToolExamplesOnly(tool, requestedToolId) {
2466
1590
  }
2467
1591
  function printPlayLikeToolUsage(tool, requestedToolId) {
2468
1592
  const toolId = String(tool.toolId || requestedToolId);
2469
- const inputFields = toolInputFieldsForDisplay(
2470
- recordField(tool, "inputSchema", "input_schema")
1593
+ const inputFields = _chunk7DRPTGCKjs.toolInputFieldsForDisplay.call(void 0,
1594
+ _chunk7DRPTGCKjs.recordField.call(void 0, tool, "inputSchema", "input_schema")
2471
1595
  );
2472
- const sampleInput = samplePayloadForInputFields(inputFields);
2473
- const playReference = playReferenceForTool(tool);
1596
+ const sampleInput = _chunk7DRPTGCKjs.samplePayloadForInputFields.call(void 0, inputFields);
1597
+ const playReference = _chunk7DRPTGCKjs.playReferenceForTool.call(void 0, tool);
2474
1598
  console.log("Run as a play:");
2475
1599
  console.log(
2476
- playRunCommandForTool(
1600
+ _chunk7DRPTGCKjs.playRunCommandForTool.call(void 0,
2477
1601
  tool,
2478
1602
  toolId,
2479
1603
  Object.keys(sampleInput).length ? sampleInput : void 0
@@ -2484,13 +1608,13 @@ function printPlayLikeToolUsage(tool, requestedToolId) {
2484
1608
  }
2485
1609
  }
2486
1610
  function printToolGettersOnly(tool, requestedToolId) {
2487
- const contract = toolContractJsonForDescribe(
1611
+ const contract = _chunk7DRPTGCKjs.toolContractJsonForDescribe.call(void 0,
2488
1612
  tool,
2489
1613
  requestedToolId,
2490
1614
  void 0,
2491
1615
  seedToolListScript
2492
1616
  );
2493
- const getters = isRecord(contract.getters) ? contract.getters : {};
1617
+ const getters = _chunk7DRPTGCKjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
2494
1618
  const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
2495
1619
  const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
2496
1620
  console.log(`Getters: ${contract.toolId}`);
@@ -2501,9 +1625,9 @@ function printToolGettersOnly(tool, requestedToolId) {
2501
1625
  if (listGetters.length) {
2502
1626
  console.log(listGetterHeading());
2503
1627
  for (const entry of listGetters) {
2504
- if (isRecord(entry))
1628
+ if (_chunk7DRPTGCKjs.isRecord.call(void 0, entry))
2505
1629
  console.log(
2506
- `- ${stringField(entry, "name")}: ${playResultExpression(entry)}`
1630
+ `- ${_chunk7DRPTGCKjs.stringField.call(void 0, entry, "name")}: ${_chunk7DRPTGCKjs.playResultExpression.call(void 0, entry)}`
2507
1631
  );
2508
1632
  }
2509
1633
  printListGetterConsumption();
@@ -2511,9 +1635,9 @@ function printToolGettersOnly(tool, requestedToolId) {
2511
1635
  if (valueGetters.length) {
2512
1636
  console.log("Values:");
2513
1637
  for (const entry of valueGetters) {
2514
- if (isRecord(entry))
1638
+ if (_chunk7DRPTGCKjs.isRecord.call(void 0, entry))
2515
1639
  console.log(
2516
- `- ${stringField(entry, "name")}: ${playResultExpression(entry)}`
1640
+ `- ${_chunk7DRPTGCKjs.stringField.call(void 0, entry, "name")}: ${_chunk7DRPTGCKjs.playResultExpression.call(void 0, entry)}`
2517
1641
  );
2518
1642
  }
2519
1643
  }
@@ -2539,9 +1663,9 @@ function safeIdentifier(name) {
2539
1663
  const cleaned = name.replace(/[^a-zA-Z0-9_$]+/g, "_").replace(/^[^a-zA-Z_$]+/, "");
2540
1664
  return cleaned || "value";
2541
1665
  }
2542
- function singleLineText(value2, maxLength = 260) {
2543
- if (typeof value2 !== "string") return "";
2544
- const text = value2.replace(/\s+/g, " ").trim();
1666
+ function singleLineText(value, maxLength = 260) {
1667
+ if (typeof value !== "string") return "";
1668
+ const text = value.replace(/\s+/g, " ").trim();
2545
1669
  if (text.length <= maxLength) return text;
2546
1670
  return `${text.slice(0, maxLength - 3).trimEnd()}...`;
2547
1671
  }
@@ -2551,22 +1675,22 @@ function listedToolDescription(tool) {
2551
1675
  }
2552
1676
  function formatListedToolCost(tool) {
2553
1677
  const record = tool;
2554
- if (stringField(record, "billingSource", "billing_source") === "free") {
1678
+ if (_chunk7DRPTGCKjs.stringField.call(void 0, record, "billingSource", "billing_source") === "free") {
2555
1679
  return "Cost: Free";
2556
1680
  }
2557
- const pricing = recordField(record, "pricing");
2558
- const displayText = stringField(pricing, "displayText", "display_text");
1681
+ const pricing = _chunk7DRPTGCKjs.recordField.call(void 0, record, "pricing");
1682
+ const displayText = _chunk7DRPTGCKjs.stringField.call(void 0, pricing, "displayText", "display_text");
2559
1683
  return displayText ? `Cost: ${displayText}` : "";
2560
1684
  }
2561
1685
  function printToolOutputArrayShape(tool) {
2562
- const outputFields = toolOutputFieldsForDisplay(
2563
- recordField(isRecord(tool) ? tool : {}, "outputSchema", "output_schema")
1686
+ const outputFields = _chunk7DRPTGCKjs.toolOutputFieldsForDisplay.call(void 0,
1687
+ _chunk7DRPTGCKjs.recordField.call(void 0, _chunk7DRPTGCKjs.isRecord.call(void 0, tool) ? tool : {}, "outputSchema", "output_schema")
2564
1688
  );
2565
1689
  if (outputFields.length === 0) return;
2566
1690
  console.log(" Output array shape (declared schema):");
2567
1691
  for (const field of outputFields.slice(0, 60)) {
2568
1692
  const name = String(field.name);
2569
- const type = stringField(field, "type") || "unknown";
1693
+ const type = _chunk7DRPTGCKjs.stringField.call(void 0, field, "type") || "unknown";
2570
1694
  const itemBounds = arrayItemBoundsSuffix(field);
2571
1695
  console.log(` - ${name}: ${type}${itemBounds}`);
2572
1696
  }
@@ -2575,15 +1699,15 @@ function printToolOutputArrayShape(tool) {
2575
1699
  }
2576
1700
  }
2577
1701
  function declaredToolJsonSchema(inputSchema) {
2578
- if (isRecord(inputSchema.jsonSchema)) {
1702
+ if (_chunk7DRPTGCKjs.isRecord.call(void 0, inputSchema.jsonSchema)) {
2579
1703
  return inputSchema.jsonSchema;
2580
1704
  }
2581
1705
  return Array.isArray(inputSchema.fields) ? null : inputSchema;
2582
1706
  }
2583
1707
  function arrayItemBoundsSuffix(field) {
2584
- const itemSchema = isRecord(field.items) ? field.items : null;
2585
- const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type : isRecord(itemSchema.properties) ? "object" : "unknown" : null;
2586
- const itemEnum = Array.isArray(_optionalChain([itemSchema, 'optionalAccess', _23 => _23.enum])) ? ` enum=${itemSchema.enum.map(String).join("|")}` : "";
1708
+ const itemSchema = _chunk7DRPTGCKjs.isRecord.call(void 0, field.items) ? field.items : null;
1709
+ const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type : _chunk7DRPTGCKjs.isRecord.call(void 0, itemSchema.properties) ? "object" : "unknown" : null;
1710
+ const itemEnum = Array.isArray(_optionalChain([itemSchema, 'optionalAccess', _14 => _14.enum])) ? ` enum=${itemSchema.enum.map(String).join("|")}` : "";
2587
1711
  const itemTypeSuffix = itemType && itemType !== "unknown" ? ` items=${itemType}${itemEnum}` : "";
2588
1712
  const minItems = typeof field.minItems === "number" && Number.isFinite(field.minItems) ? field.minItems : null;
2589
1713
  const maxItems = typeof field.maxItems === "number" && Number.isFinite(field.maxItems) ? field.maxItems : null;
@@ -2594,32 +1718,32 @@ function arrayItemBoundsSuffix(field) {
2594
1718
  if (maxItems !== null) return `${itemTypeSuffix} maxItems=${maxItems}`;
2595
1719
  return itemTypeSuffix;
2596
1720
  }
2597
- function printToolExecutionHints(value2) {
2598
- const batchCapabilityRecord = recordField(
2599
- isRecord(value2) ? value2 : {},
1721
+ function printToolExecutionHints(value) {
1722
+ const batchCapabilityRecord = _chunk7DRPTGCKjs.recordField.call(void 0,
1723
+ _chunk7DRPTGCKjs.isRecord.call(void 0, value) ? value : {},
2600
1724
  "batchCapability",
2601
1725
  "batch_capability"
2602
1726
  );
2603
1727
  const batchCapability = Object.keys(batchCapabilityRecord).length > 0 ? batchCapabilityRecord : null;
2604
- const executionMetadata = recordField(
2605
- isRecord(value2) ? value2 : {},
1728
+ const executionMetadata = _chunk7DRPTGCKjs.recordField.call(void 0,
1729
+ _chunk7DRPTGCKjs.isRecord.call(void 0, value) ? value : {},
2606
1730
  "executionMetadata",
2607
1731
  "execution_metadata"
2608
1732
  );
2609
1733
  if (batchCapability) {
2610
- const status = stringField(batchCapability, "status") || "unknown";
2611
- const surface = stringField(batchCapability, "surface");
2612
- const operation = stringField(
1734
+ const status = _chunk7DRPTGCKjs.stringField.call(void 0, batchCapability, "status") || "unknown";
1735
+ const surface = _chunk7DRPTGCKjs.stringField.call(void 0, batchCapability, "surface");
1736
+ const operation = _chunk7DRPTGCKjs.stringField.call(void 0,
2613
1737
  batchCapability,
2614
1738
  "batchOperation",
2615
1739
  "batch_operation"
2616
1740
  );
2617
- const maxBatchSize = numberField2(
1741
+ const maxBatchSize = numberField(
2618
1742
  batchCapability,
2619
1743
  "maxBatchSize",
2620
1744
  "max_batch_size"
2621
1745
  );
2622
- const notes = stringField(batchCapability, "notes");
1746
+ const notes = _chunk7DRPTGCKjs.stringField.call(void 0, batchCapability, "notes");
2623
1747
  console.log("");
2624
1748
  console.log("Batching:");
2625
1749
  console.log(`- Catalog status: ${status}${surface ? ` (${surface})` : ""}`);
@@ -2638,23 +1762,23 @@ function printToolExecutionHints(value2) {
2638
1762
  }
2639
1763
  if (notes) console.log(`- Details: ${notes}`);
2640
1764
  }
2641
- const configuredRateLimits = arrayField(
1765
+ const configuredRateLimits = _chunk7DRPTGCKjs.arrayField.call(void 0,
2642
1766
  executionMetadata,
2643
1767
  "configuredRateLimits",
2644
1768
  "configured_rate_limits"
2645
- ).filter(isRecord);
1769
+ ).filter(_chunk7DRPTGCKjs.isRecord);
2646
1770
  if (configuredRateLimits.length > 0) {
2647
1771
  console.log("");
2648
1772
  console.log(
2649
1773
  "Configured Deepline pacing (guidance, not a guaranteed provider quota):"
2650
1774
  );
2651
1775
  for (const limit of configuredRateLimits) {
2652
- const requests = numberField2(limit, "requestsPerWindow");
2653
- const windowMs = numberField2(limit, "windowMs");
1776
+ const requests = numberField(limit, "requestsPerWindow");
1777
+ const windowMs = numberField(limit, "windowMs");
2654
1778
  if (requests === null || windowMs === null) continue;
2655
- const usage = stringField(limit, "usage") || "unknown";
1779
+ const usage = _chunk7DRPTGCKjs.stringField.call(void 0, limit, "usage") || "unknown";
2656
1780
  const usageText = usage === "queue_hint" ? "queue hint" : usage === "enforced" ? "Deepline enforced" : usage === "queue_hint_and_enforced" ? "queue hint and Deepline enforced" : usage === "disabled" ? "disabled" : usage;
2657
- const explicitMaxConcurrency = numberField2(
1781
+ const explicitMaxConcurrency = numberField(
2658
1782
  limit,
2659
1783
  "explicitMaxConcurrency",
2660
1784
  "explicit_max_concurrency"
@@ -2665,13 +1789,13 @@ function printToolExecutionHints(value2) {
2665
1789
  );
2666
1790
  }
2667
1791
  }
2668
- const queueHint = recordField(executionMetadata, "queueHint", "queue_hint");
2669
- const requestsPerSecondHint = numberField2(
1792
+ const queueHint = _chunk7DRPTGCKjs.recordField.call(void 0, executionMetadata, "queueHint", "queue_hint");
1793
+ const requestsPerSecondHint = numberField(
2670
1794
  queueHint,
2671
1795
  "requestsPerSecondHint",
2672
1796
  "requests_per_second_hint"
2673
1797
  );
2674
- const derivedConcurrency = numberField2(
1798
+ const derivedConcurrency = numberField(
2675
1799
  queueHint,
2676
1800
  "derivedConcurrency",
2677
1801
  "derived_concurrency"
@@ -2690,35 +1814,35 @@ function formatRateWindow(windowMs) {
2690
1814
  }
2691
1815
  function samplePayload(samples, key) {
2692
1816
  const entry = samples[key];
2693
- if (!isRecord(entry)) return void 0;
1817
+ if (!_chunk7DRPTGCKjs.isRecord.call(void 0, entry)) return void 0;
2694
1818
  return Object.prototype.hasOwnProperty.call(entry, "payload") ? entry.payload : entry;
2695
1819
  }
2696
1820
  function commandEnvelopeFromRawResponse(rawResponse) {
2697
- return isRecord(rawResponse) ? { ...rawResponse } : { status: "completed", result: rawResponse };
1821
+ return _chunk7DRPTGCKjs.isRecord.call(void 0, rawResponse) ? { ...rawResponse } : { status: "completed", result: rawResponse };
2698
1822
  }
2699
1823
  function toolExecuteExitCode(envelope) {
2700
1824
  return envelope.status === "failed" || envelope.ok === false ? 1 : 0;
2701
1825
  }
2702
1826
  function extractToolExecutionWarningMessages(rawResponse) {
2703
- if (!isRecord(rawResponse)) return [];
1827
+ if (!_chunk7DRPTGCKjs.isRecord.call(void 0, rawResponse)) return [];
2704
1828
  const candidates = [
2705
- recordField(recordField(rawResponse, "toolResponse"), "meta"),
2706
- recordField(
2707
- recordField(recordField(rawResponse, "toolResponse"), "raw"),
1829
+ _chunk7DRPTGCKjs.recordField.call(void 0, _chunk7DRPTGCKjs.recordField.call(void 0, rawResponse, "toolResponse"), "meta"),
1830
+ _chunk7DRPTGCKjs.recordField.call(void 0,
1831
+ _chunk7DRPTGCKjs.recordField.call(void 0, _chunk7DRPTGCKjs.recordField.call(void 0, rawResponse, "toolResponse"), "raw"),
2708
1832
  "meta"
2709
1833
  ),
2710
- recordField(rawResponse, "meta"),
2711
- recordField(recordField(rawResponse, "result"), "meta")
1834
+ _chunk7DRPTGCKjs.recordField.call(void 0, rawResponse, "meta"),
1835
+ _chunk7DRPTGCKjs.recordField.call(void 0, _chunk7DRPTGCKjs.recordField.call(void 0, rawResponse, "result"), "meta")
2712
1836
  ];
2713
1837
  const messages = [];
2714
1838
  for (const candidate of candidates) {
2715
- const warnings = _optionalChain([candidate, 'optionalAccess', _24 => _24.warnings]);
1839
+ const warnings = _optionalChain([candidate, 'optionalAccess', _15 => _15.warnings]);
2716
1840
  if (!Array.isArray(warnings)) continue;
2717
1841
  for (const warning of warnings) {
2718
1842
  if (typeof warning === "string" && warning.trim()) {
2719
1843
  messages.push(warning.trim());
2720
- } else if (isRecord(warning)) {
2721
- const message = stringField(warning, "message");
1844
+ } else if (_chunk7DRPTGCKjs.isRecord.call(void 0, warning)) {
1845
+ const message = _chunk7DRPTGCKjs.stringField.call(void 0, warning, "message");
2722
1846
  if (message) messages.push(message);
2723
1847
  }
2724
1848
  }
@@ -2726,20 +1850,20 @@ function extractToolExecutionWarningMessages(rawResponse) {
2726
1850
  return [...new Set(messages)];
2727
1851
  }
2728
1852
  function apifySyncRecoveryNext(rawResponse) {
2729
- if (!isRecord(rawResponse) || rawResponse.status !== "running") return null;
2730
- const toolResponse = recordField(rawResponse, "toolResponse");
2731
- const raw = recordField(toolResponse, "raw");
1853
+ if (!_chunk7DRPTGCKjs.isRecord.call(void 0, rawResponse) || rawResponse.status !== "running") return null;
1854
+ const toolResponse = _chunk7DRPTGCKjs.recordField.call(void 0, rawResponse, "toolResponse");
1855
+ const raw = _chunk7DRPTGCKjs.recordField.call(void 0, toolResponse, "raw");
2732
1856
  if (raw.state !== "awaiting_apify") return null;
2733
- const next = recordField(raw, "next");
2734
- const getActorRun = recordField(next, "getActorRun");
2735
- const getActorRunTool = stringField(getActorRun, "tool");
2736
- const getActorRunPayload = recordField(getActorRun, "payload");
1857
+ const next = _chunk7DRPTGCKjs.recordField.call(void 0, raw, "next");
1858
+ const getActorRun = _chunk7DRPTGCKjs.recordField.call(void 0, next, "getActorRun");
1859
+ const getActorRunTool = _chunk7DRPTGCKjs.stringField.call(void 0, getActorRun, "tool");
1860
+ const getActorRunPayload = _chunk7DRPTGCKjs.recordField.call(void 0, getActorRun, "payload");
2737
1861
  if (!getActorRunTool || Object.keys(getActorRunPayload).length === 0) {
2738
1862
  return null;
2739
1863
  }
2740
- const getDatasetItems = recordField(next, "getDatasetItems");
2741
- const getDatasetItemsTool = stringField(getDatasetItems, "tool");
2742
- const getDatasetItemsPayload = recordField(getDatasetItems, "payload");
1864
+ const getDatasetItems = _chunk7DRPTGCKjs.recordField.call(void 0, next, "getDatasetItems");
1865
+ const getDatasetItemsTool = _chunk7DRPTGCKjs.stringField.call(void 0, getDatasetItems, "tool");
1866
+ const getDatasetItemsPayload = _chunk7DRPTGCKjs.recordField.call(void 0, getDatasetItems, "payload");
2743
1867
  return {
2744
1868
  getActorRun: `deepline tools execute ${getActorRunTool} --input ${_chunkAID3OYVJjs.shellQuote.call(void 0, JSON.stringify(getActorRunPayload))}`,
2745
1869
  ...getDatasetItemsTool && Object.keys(getDatasetItemsPayload).length > 0 ? {
@@ -2748,27 +1872,27 @@ function apifySyncRecoveryNext(rawResponse) {
2748
1872
  };
2749
1873
  }
2750
1874
  function listExtractorPathsFromUsageGuidance(tool) {
2751
- const toolExecutionResult = _optionalChain([tool, 'access', _25 => _25.usageGuidance, 'optionalAccess', _26 => _26.toolExecutionResult]);
2752
- const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _27 => _27.extractedLists])) ? toolExecutionResult.extractedLists : isRecord(_optionalChain([toolExecutionResult, 'optionalAccess', _28 => _28.extractedLists])) ? Object.values(toolExecutionResult.extractedLists) : [];
1875
+ const toolExecutionResult = _optionalChain([tool, 'access', _16 => _16.usageGuidance, 'optionalAccess', _17 => _17.toolExecutionResult]);
1876
+ const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _18 => _18.extractedLists])) ? toolExecutionResult.extractedLists : _chunk7DRPTGCKjs.isRecord.call(void 0, _optionalChain([toolExecutionResult, 'optionalAccess', _19 => _19.extractedLists])) ? Object.values(toolExecutionResult.extractedLists) : [];
2753
1877
  return extractedLists.flatMap((entry) => {
2754
- const paths = _nullishCoalesce(_optionalChain([entry, 'access', _29 => _29.details, 'optionalAccess', _30 => _30.candidatePaths]), () => ( _optionalChain([entry, 'access', _31 => _31.details, 'optionalAccess', _32 => _32.rawToolOutputPaths])));
1878
+ const paths = _nullishCoalesce(_optionalChain([entry, 'access', _20 => _20.details, 'optionalAccess', _21 => _21.candidatePaths]), () => ( _optionalChain([entry, 'access', _22 => _22.details, 'optionalAccess', _23 => _23.rawToolOutputPaths])));
2755
1879
  if (!Array.isArray(paths)) return [];
2756
1880
  return paths.map(
2757
1881
  (path) => path.trim().replace(/^toolExecutionResult\.toolResponse\.raw\.?/, "").replace(/^toolExecutionResult\.toolOutput\.raw\.?/, "").replace(/^\./, "")
2758
1882
  ).filter(Boolean);
2759
1883
  });
2760
1884
  }
2761
- function formatDecimal(value2) {
2762
- const text = value2.toFixed(12).replace(/0+$/, "").replace(/\.$/, "");
1885
+ function formatDecimal(value) {
1886
+ const text = value.toFixed(12).replace(/0+$/, "").replace(/\.$/, "");
2763
1887
  return text || "0";
2764
1888
  }
2765
- function formatUsd(value2) {
2766
- return `$${formatDecimal(value2)}`;
1889
+ function formatUsd(value) {
1890
+ return `$${formatDecimal(value)}`;
2767
1891
  }
2768
- function numberField2(source, ...keys) {
1892
+ function numberField(source, ...keys) {
2769
1893
  for (const key of keys) {
2770
- const value2 = source[key];
2771
- if (typeof value2 === "number" && Number.isFinite(value2)) return value2;
1894
+ const value = source[key];
1895
+ if (typeof value === "number" && Number.isFinite(value)) return value;
2772
1896
  }
2773
1897
  return null;
2774
1898
  }
@@ -2834,15 +1958,15 @@ function parseJsonObjectArgument(raw, flagName) {
2834
1958
  }
2835
1959
  throw invalidJsonError(flagName, message);
2836
1960
  }
2837
- if (!isRecord(parsed)) {
1961
+ if (!_chunk7DRPTGCKjs.isRecord.call(void 0, parsed)) {
2838
1962
  throw invalidJsonError(flagName, "expected an object.");
2839
1963
  }
2840
1964
  return parsed;
2841
1965
  }
2842
- function toolExecuteJsonOption(value2) {
2843
- const legacyInput = typeof value2 === "string" ? value2 : void 0;
1966
+ function toolExecuteJsonOption(value) {
1967
+ const legacyInput = typeof value === "string" ? value : void 0;
2844
1968
  return {
2845
- requested: value2 === true || legacyInput !== void 0,
1969
+ requested: value === true || legacyInput !== void 0,
2846
1970
  legacyInput
2847
1971
  };
2848
1972
  }
@@ -2878,7 +2002,7 @@ function parseExecuteOptions(toolId, options, output) {
2878
2002
  outputFormat = normalizeOutputFormat(options.outputFormat);
2879
2003
  }
2880
2004
  if (options.idempotencyKey !== void 0) {
2881
- _chunkWQJJNIMQjs.validateExecutionIdempotencyKey.call(void 0, options.idempotencyKey);
2005
+ _chunkUVXBVUZQjs.validateExecutionIdempotencyKey.call(void 0, options.idempotencyKey);
2882
2006
  }
2883
2007
  if (options.recoveryTimeoutMs !== void 0) {
2884
2008
  const parsed = Number(options.recoveryTimeoutMs);
@@ -2906,10 +2030,10 @@ function parseToolExecuteTimeout(raw) {
2906
2030
  "--timeout must be a duration like 500ms, 90s, 10m, or 1h (a bare number is seconds)."
2907
2031
  );
2908
2032
  }
2909
- const value2 = Number(match[1]);
2033
+ const value = Number(match[1]);
2910
2034
  const unit = (_nullishCoalesce(match[2], () => ( "s"))).toLowerCase();
2911
2035
  const factor = unit === "ms" ? 1 : unit === "s" ? 1e3 : unit === "m" ? 6e4 : 36e5;
2912
- const timeoutMs = value2 * factor;
2036
+ const timeoutMs = value * factor;
2913
2037
  if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 2147483647) {
2914
2038
  throw new Error(
2915
2039
  "--timeout must be between 1ms and 2147483647ms (24d 20h 31m 23s)."
@@ -2917,11 +2041,11 @@ function parseToolExecuteTimeout(raw) {
2917
2041
  }
2918
2042
  return timeoutMs;
2919
2043
  }
2920
- function safeFileStem(value2) {
2921
- return value2.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "tool";
2044
+ function safeFileStem(value) {
2045
+ return value.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "tool";
2922
2046
  }
2923
- function powerShellQuote(value2) {
2924
- return `'${value2.replace(/'/g, "''")}'`;
2047
+ function powerShellQuote(value) {
2048
+ return `'${value.replace(/'/g, "''")}'`;
2925
2049
  }
2926
2050
  function seedToolListScript(input) {
2927
2051
  const stem = safeFileStem(input.toolId);
@@ -3006,7 +2130,7 @@ function buildToolExecuteBaseEnvelope(input) {
3006
2130
  kind: summaryEntries.length > 0 ? "object" : "raw",
3007
2131
  summary: input.summary
3008
2132
  };
3009
- const envelopeHasCanonicalOutput = isRecord(envelope.toolResponse) && Object.prototype.hasOwnProperty.call(envelope.toolResponse, "raw");
2133
+ const envelopeHasCanonicalOutput = _chunk7DRPTGCKjs.isRecord.call(void 0, envelope.toolResponse) && Object.prototype.hasOwnProperty.call(envelope.toolResponse, "raw");
3010
2134
  const envelopeHasDeclaredOutput = Object.prototype.hasOwnProperty.call(
3011
2135
  envelope,
3012
2136
  "output"
@@ -3034,7 +2158,7 @@ function buildToolExecuteBaseEnvelope(input) {
3034
2158
  return {
3035
2159
  ...envelope,
3036
2160
  ...input.idempotencyKey ? { idempotency_key: input.idempotencyKey } : {},
3037
- ...isRecord(input.rawResponse) && isRecord(input.rawResponse.executionRecovery) ? { execution_recovery: input.rawResponse.executionRecovery } : {},
2161
+ ..._chunk7DRPTGCKjs.isRecord.call(void 0, input.rawResponse) && _chunk7DRPTGCKjs.isRecord.call(void 0, input.rawResponse.executionRecovery) ? { execution_recovery: input.rawResponse.executionRecovery } : {},
3038
2162
  ...envelopeHasCanonicalOutput || envelopeHasDeclaredOutput ? { output_preview: outputPreview } : { output: outputPreview },
3039
2163
  ...summaryEntries.length > 0 ? { summary: input.summary } : {},
3040
2164
  ...warningMessages.length > 0 ? { warnings: warningMessages } : {},
@@ -3068,7 +2192,7 @@ function buildToolExecuteBaseEnvelope(input) {
3068
2192
  lines: apifyRecovery ? [
3069
2193
  "Apify is still running. Run the follow-up command(s) below."
3070
2194
  ] : summaryEntries.length > 0 ? summaryEntries.map(
3071
- ([key, value2]) => `${key}=${String(value2)}`
2195
+ ([key, value]) => `${key}=${String(value)}`
3072
2196
  ) : [JSON.stringify(input.rawResponse, null, 2)]
3073
2197
  },
3074
2198
  ...guidanceLines.length > 0 ? [{ title: "guidance", lines: guidanceLines }] : []
@@ -3095,7 +2219,7 @@ function buildToolExecuteRowArtifactEnvelope(input) {
3095
2219
  void _render;
3096
2220
  void _next;
3097
2221
  void _local;
3098
- const billingLookup = isRecord(input.baseEnvelope.next) && typeof input.baseEnvelope.next.billing === "string" ? input.baseEnvelope.next.billing : null;
2222
+ const billingLookup = _chunk7DRPTGCKjs.isRecord.call(void 0, input.baseEnvelope.next) && typeof input.baseEnvelope.next.billing === "string" ? input.baseEnvelope.next.billing : null;
3099
2223
  const inspection = toolExecutionInspection(input);
3100
2224
  return {
3101
2225
  ...base,
@@ -3150,7 +2274,7 @@ function buildToolExecuteRowArtifactEnvelope(input) {
3150
2274
  lines: [
3151
2275
  ...input.csv.columns.length > 0 ? [`columns: ${JSON.stringify(input.csv.columns)}`] : [],
3152
2276
  ...Object.keys(input.summary).length > 0 ? [
3153
- `summary: ${Object.entries(input.summary).map(([key, value2]) => `${key}=${String(value2)}`).join(", ")}`
2277
+ `summary: ${Object.entries(input.summary).map(([key, value]) => `${key}=${String(value)}`).join(", ")}`
3154
2278
  ] : [],
3155
2279
  `preview: ${JSON.stringify(input.rowOutput.previewRows)}`,
3156
2280
  `starter script: ${input.seededScript.path}`
@@ -3178,20 +2302,20 @@ function buildToolExecuteRowArtifactEnvelope(input) {
3178
2302
  }
3179
2303
  async function executeTool(toolId, options) {
3180
2304
  const output = toolExecuteJsonOption(options.json);
3181
- const wantsJson = _chunkRTO5QZWTjs.shouldEmitJson.call(void 0, output.requested) || (_nullishCoalesce(options.outputFormat, () => ( "auto"))).trim().toLowerCase() !== "csv";
2305
+ const wantsJson = _chunkDQ65ZVHNjs.shouldEmitJson.call(void 0, output.requested) || (_nullishCoalesce(options.outputFormat, () => ( "auto"))).trim().toLowerCase() !== "csv";
3182
2306
  let parsed;
3183
2307
  try {
3184
2308
  parsed = parseExecuteOptions(toolId, options, output);
3185
2309
  } catch (error) {
3186
2310
  if (wantsJson) {
3187
- _chunkRTO5QZWTjs.printJsonError.call(void 0, error);
2311
+ _chunkDQ65ZVHNjs.printJsonError.call(void 0, error);
3188
2312
  } else {
3189
2313
  console.error(error instanceof Error ? error.message : String(error));
3190
2314
  }
3191
2315
  return error instanceof _chunk7P5AA3SNjs.DeeplineError && error.code === "IDEMPOTENCY_KEY_INVALID" ? 2 : 1;
3192
2316
  }
3193
2317
  const cliInvocationId = _nullishCoalesce(_chunkQJBJZVG6js.getToolExecuteInvocationId.call(void 0, ), () => ( _chunkQJBJZVG6js.beginToolExecuteCommand.call(void 0, )));
3194
- const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
2318
+ const client = new (0, _chunkUVXBVUZQjs.DeeplineClient)();
3195
2319
  let metadata;
3196
2320
  try {
3197
2321
  metadata = await _chunkQJBJZVG6js.runToolExecuteStage.call(void 0,
@@ -3206,7 +2330,7 @@ async function executeTool(toolId, options) {
3206
2330
  );
3207
2331
  if (play) {
3208
2332
  if (wantsJson) {
3209
- _chunkRTO5QZWTjs.printJsonError.call(void 0,
2333
+ _chunkDQ65ZVHNjs.printJsonError.call(void 0,
3210
2334
  new Error(playAliasToolErrorMessage(parsed.toolId, play))
3211
2335
  );
3212
2336
  } else {
@@ -3217,9 +2341,9 @@ async function executeTool(toolId, options) {
3217
2341
  }
3218
2342
  throw error;
3219
2343
  }
3220
- if (isPlayLikeTool(metadata)) {
2344
+ if (_chunk7DRPTGCKjs.isPlayLikeTool.call(void 0, metadata)) {
3221
2345
  if (wantsJson) {
3222
- _chunkRTO5QZWTjs.printJsonError.call(void 0,
2346
+ _chunkDQ65ZVHNjs.printJsonError.call(void 0,
3223
2347
  new Error(
3224
2348
  playLikeToolExecuteErrorMessage(
3225
2349
  parsed.toolId,
@@ -3235,7 +2359,7 @@ async function executeTool(toolId, options) {
3235
2359
  }
3236
2360
  return 2;
3237
2361
  }
3238
- if (_optionalChain([metadata, 'access', _33 => _33.deprecation, 'optionalAccess', _34 => _34.message])) {
2362
+ if (_optionalChain([metadata, 'access', _24 => _24.deprecation, 'optionalAccess', _25 => _25.message])) {
3239
2363
  console.error(
3240
2364
  `Warning: ${parsed.toolId} is deprecated. ${metadata.deprecation.message}`
3241
2365
  );
@@ -3263,13 +2387,13 @@ async function executeTool(toolId, options) {
3263
2387
  "execute request",
3264
2388
  () => client.executeTool(parsed.toolId, parsed.params, {
3265
2389
  ...parsed.timeoutMs !== void 0 ? { timeout: parsed.timeoutMs } : {},
3266
- ..._optionalChain([metadata, 'access', _35 => _35.executionMetadata, 'optionalAccess', _36 => _36.retrySafeTransientHttp]) === true ? { maxRetries: 2, retryApiErrors: true } : {},
2390
+ ..._optionalChain([metadata, 'access', _26 => _26.executionMetadata, 'optionalAccess', _27 => _27.retrySafeTransientHttp]) === true ? { maxRetries: 2, retryApiErrors: true } : {},
3267
2391
  responseIntent,
3268
2392
  ...idempotencyKey ? { idempotencyKey } : {},
3269
2393
  ...parsed.recoveryTimeoutMs !== void 0 ? { recoveryTimeoutMs: parsed.recoveryTimeoutMs } : {},
3270
- searchRef: _chunkKAEZNPUMjs.recentSearchRef.call(void 0, ),
2394
+ searchRef: _chunkPSGEDGLTjs.recentSearchRef.call(void 0, ),
3271
2395
  cliInvocationId,
3272
- onResponseReceived: _chunkNSOTASOPjs.recordApiResponse
2396
+ onResponseReceived: _chunkZAAKSJASjs.recordApiResponse
3273
2397
  }).catch((error) => {
3274
2398
  const guidanceLines = toolGuidanceLines(metadata.guidance);
3275
2399
  if (guidanceLines.length > 0) {
@@ -3288,10 +2412,10 @@ async function executeTool(toolId, options) {
3288
2412
  "result formatting",
3289
2413
  () => {
3290
2414
  const listExtractorPaths = listExtractorPathsFromUsageGuidance(metadata);
3291
- const listConversion2 = _chunkLWERJUKNjs.tryConvertToList.call(void 0, rawResponse, {
2415
+ const listConversion2 = _chunkHGFFYVXNjs.tryConvertToList.call(void 0, rawResponse, {
3292
2416
  listExtractorPaths
3293
2417
  });
3294
- const summary2 = _chunkLWERJUKNjs.extractSummaryFields.call(void 0, rawResponse);
2418
+ const summary2 = _chunkHGFFYVXNjs.extractSummaryFields.call(void 0, rawResponse);
3295
2419
  const baseEnvelope2 = buildToolExecuteBaseEnvelope({
3296
2420
  toolId: parsed.toolId,
3297
2421
  params: parsed.params,
@@ -3308,19 +2432,19 @@ async function executeTool(toolId, options) {
3308
2432
  const executeExitCode = toolExecuteExitCode(baseEnvelope);
3309
2433
  const delivered = await _chunkQJBJZVG6js.runToolExecuteStage.call(void 0, "output delivery", () => {
3310
2434
  if (!parsed.outPath && (parsed.outputFormat === "json" || parsed.outputFormat === "auto" && wantsJson)) {
3311
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, baseEnvelope, { json: true });
2435
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0, baseEnvelope, { json: true });
3312
2436
  return true;
3313
2437
  }
3314
2438
  if (parsed.outputFormat === "json_file") {
3315
- const jsonPath = _chunkLWERJUKNjs.writeJsonOutputFile.call(void 0,
2439
+ const jsonPath = _chunkHGFFYVXNjs.writeJsonOutputFile.call(void 0,
3316
2440
  rawResponse,
3317
2441
  `payload_${parsed.toolId}`
3318
2442
  );
3319
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
2443
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
3320
2444
  {
3321
2445
  ...baseEnvelope,
3322
2446
  local: {
3323
- ...isRecord(baseEnvelope.local) ? baseEnvelope.local : {},
2447
+ ..._chunk7DRPTGCKjs.isRecord.call(void 0, baseEnvelope.local) ? baseEnvelope.local : {},
3324
2448
  payload_file: jsonPath
3325
2449
  }
3326
2450
  },
@@ -3338,18 +2462,18 @@ async function executeTool(toolId, options) {
3338
2462
  `${parsed.toolId} did not expose row-shaped output to write as CSV. ${inspection.inspectDescription} Run: ${inspection.inspect}`
3339
2463
  );
3340
2464
  if (wantsJson) {
3341
- _chunkRTO5QZWTjs.printJsonError.call(void 0, error);
2465
+ _chunkDQ65ZVHNjs.printJsonError.call(void 0, error);
3342
2466
  } else {
3343
2467
  console.error(error.message);
3344
2468
  }
3345
2469
  return false;
3346
2470
  }
3347
2471
  if (parsed.outputFormat === "csv" || parsed.outputFormat === "csv_file") {
3348
- const jsonPath = _chunkLWERJUKNjs.writeJsonOutputFile.call(void 0,
2472
+ const jsonPath = _chunkHGFFYVXNjs.writeJsonOutputFile.call(void 0,
3349
2473
  rawResponse,
3350
2474
  `payload_${parsed.toolId}`
3351
2475
  );
3352
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
2476
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
3353
2477
  {
3354
2478
  ...baseEnvelope,
3355
2479
  local: {
@@ -3360,11 +2484,11 @@ async function executeTool(toolId, options) {
3360
2484
  );
3361
2485
  return true;
3362
2486
  }
3363
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, baseEnvelope, { json: false });
2487
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0, baseEnvelope, { json: false });
3364
2488
  return true;
3365
2489
  }
3366
- const rowOutput = _chunkLWERJUKNjs.projectRowOutput.call(void 0, listConversion);
3367
- const csv = _chunkLWERJUKNjs.writeCsvOutputFile.call(void 0,
2490
+ const rowOutput = _chunkHGFFYVXNjs.projectRowOutput.call(void 0, listConversion);
2491
+ const csv = _chunkHGFFYVXNjs.writeCsvOutputFile.call(void 0,
3368
2492
  listConversion.rows,
3369
2493
  `${parsed.toolId}_output`,
3370
2494
  parsed.outPath ? { outPath: parsed.outPath } : void 0
@@ -3384,7 +2508,7 @@ async function executeTool(toolId, options) {
3384
2508
  seededScript
3385
2509
  });
3386
2510
  if (parsed.outputFormat === "csv_file") {
3387
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, materializedEnvelope, { json: true });
2511
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0, materializedEnvelope, { json: true });
3388
2512
  return true;
3389
2513
  }
3390
2514
  if (parsed.outPath) {
@@ -3392,7 +2516,7 @@ async function executeTool(toolId, options) {
3392
2516
  toolId: parsed.toolId,
3393
2517
  idempotencyKey
3394
2518
  });
3395
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, materializedEnvelope, {
2519
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0, materializedEnvelope, {
3396
2520
  json: wantsJson,
3397
2521
  text: `Wrote ${csv.rowCount} row(s) to ${csv.path}
3398
2522
  inspect: ${inspection.inspect}
@@ -3401,7 +2525,7 @@ inspect: ${inspection.inspect}
3401
2525
  return true;
3402
2526
  }
3403
2527
  if (parsed.noPreview) {
3404
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
2528
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
3405
2529
  {
3406
2530
  ...materializedEnvelope,
3407
2531
  local: {
@@ -3414,7 +2538,7 @@ inspect: ${inspection.inspect}
3414
2538
  );
3415
2539
  return true;
3416
2540
  }
3417
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, materializedEnvelope, {
2541
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0, materializedEnvelope, {
3418
2542
  json: wantsJson && parsed.outputFormat !== "csv"
3419
2543
  });
3420
2544
  return true;
@@ -3435,8 +2559,4 @@ inspect: ${inspection.inspect}
3435
2559
 
3436
2560
 
3437
2561
 
3438
-
3439
-
3440
-
3441
-
3442
- exports.publicToolSchemas = publicToolSchemas; exports.describedTool = describedTool; exports.toolMetadataJsonForDescribe = toolMetadataJsonForDescribe; exports.formatModelDescription = formatModelDescription; exports.registerToolsCommands = registerToolsCommands; exports.printMonitorTypeContract = printMonitorTypeContract; exports.printCompactToolContract = printCompactToolContract; exports.extractToolExecutionWarningMessages = extractToolExecutionWarningMessages; exports.seedToolListScript = seedToolListScript; exports.buildToolExecuteBaseEnvelope = buildToolExecuteBaseEnvelope;
2562
+ exports.registerToolsCommands = registerToolsCommands; exports.printMonitorTypeContract = printMonitorTypeContract; exports.printCompactToolContract = printCompactToolContract; exports.extractToolExecutionWarningMessages = extractToolExecutionWarningMessages; exports.seedToolListScript = seedToolListScript; exports.buildToolExecuteBaseEnvelope = buildToolExecuteBaseEnvelope;