deepline 0.3.372 → 0.3.374

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 (116) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +1 -53
  3. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-runtime-watchdog.ts +15 -23
  4. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +65 -3
  5. package/dist/bundling-sources/shared_libs/plays/email-status.ts +95 -0
  6. package/dist/bundling-sources/shared_libs/plays/extractor-targets.ts +14 -0
  7. package/dist/bundling-sources/shared_libs/plays/field-catalog.ts +253 -0
  8. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +2 -0
  9. package/dist/cli/auth-IFXXXZP6.js +33 -0
  10. package/dist/cli/{auth-ODSACXLF.mjs → auth-YGCDA4WG.mjs} +4 -4
  11. package/dist/cli/{billing-OPIOZLAN.mjs → billing-3ZLR3CJU.mjs} +4 -4
  12. package/dist/cli/{billing-4ERXY2DZ.js → billing-ZXRKPD5D.js} +73 -73
  13. package/dist/cli/{chunk-XSPAI6MF.mjs → chunk-2DAWTVNN.mjs} +2 -2
  14. package/dist/cli/{chunk-E5UD3JDQ.js → chunk-3VN4FTE3.js} +289 -5
  15. package/dist/cli/{chunk-VVFH745L.js → chunk-3XKAOV74.js} +6 -6
  16. package/dist/cli/{chunk-N5TPMNTT.js → chunk-53PZA4EP.js} +8 -8
  17. package/dist/cli/{chunk-BFLPCGOR.mjs → chunk-62IBVKWB.mjs} +1 -1
  18. package/dist/cli/{chunk-2RC5JQ3C.mjs → chunk-A62HBMHY.mjs} +1 -1
  19. package/dist/cli/{chunk-3GK3SH3G.mjs → chunk-E6BZWURC.mjs} +200 -13
  20. package/dist/cli/{chunk-KC2YOJTU.mjs → chunk-FT6O2ZVJ.mjs} +319 -115
  21. package/dist/cli/{chunk-5HYD3GMS.mjs → chunk-GT6KGIWV.mjs} +3 -3
  22. package/dist/cli/{chunk-RUYZAREB.js → chunk-HC5L6KGE.js} +9 -9
  23. package/dist/cli/{chunk-JAERLCMH.mjs → chunk-IZVGMVNX.mjs} +1 -1
  24. package/dist/cli/{chunk-ML2ZY7YD.js → chunk-JK547IDB.js} +4 -4
  25. package/dist/cli/{chunk-D6O3NJHX.js → chunk-MOBOAZMA.js} +60 -60
  26. package/dist/cli/{chunk-DONL233W.mjs → chunk-MQ5UW5AZ.mjs} +4 -4
  27. package/dist/cli/{chunk-MIMV5LTU.mjs → chunk-NNYQ24O5.mjs} +1 -1
  28. package/dist/cli/{chunk-DM5QUZJR.js → chunk-NOSIMGZV.js} +1 -1
  29. package/dist/cli/{chunk-AQFA7HMN.js → chunk-O7KJYX7R.js} +15 -15
  30. package/dist/cli/{chunk-U3W7E5WT.mjs → chunk-OS7GXARW.mjs} +27 -15
  31. package/dist/cli/{chunk-BVUGPOU3.mjs → chunk-OYTPVM2R.mjs} +2 -2
  32. package/dist/cli/{chunk-EFJL5FCU.js → chunk-PCYCNZLR.js} +8 -8
  33. package/dist/cli/{chunk-6MDAGRZP.js → chunk-RT5ICJ5V.js} +2 -2
  34. package/dist/cli/{chunk-GZQKUFM5.js → chunk-RXR7A2MX.js} +26 -26
  35. package/dist/cli/{chunk-4LIUZ4QR.mjs → chunk-SBB27CIJ.mjs} +2 -2
  36. package/dist/cli/{chunk-RJ7JJMQO.js → chunk-T35LCTC7.js} +266 -254
  37. package/dist/cli/{chunk-IUWPC5K6.js → chunk-TZTGK5JQ.js} +50 -50
  38. package/dist/cli/{chunk-FGHRRJ3D.mjs → chunk-VZSVYNZH.mjs} +1 -1
  39. package/dist/cli/{chunk-WJWO74MM.js → chunk-X5V2QTDR.js} +390 -186
  40. package/dist/cli/{chunk-JB6ERQUV.mjs → chunk-Y6VOGHF2.mjs} +284 -0
  41. package/dist/cli/{chunk-3CTB7V5F.mjs → chunk-YFFH6NDU.mjs} +2 -2
  42. package/dist/cli/{chunk-2JRRXXTA.js → chunk-YPVTQRUM.js} +201 -14
  43. package/dist/cli/client-O6IEMURJ.js +20 -0
  44. package/dist/cli/{client-KF2J754U.mjs → client-TV254HC4.mjs} +3 -3
  45. package/dist/cli/{csv-UL3MCD5D.mjs → csv-VEHHRUG4.mjs} +3 -3
  46. package/dist/cli/{csv-UJ3M7NFP.js → csv-WSRTANXI.js} +12 -12
  47. package/dist/cli/{db-SIOWA63T.mjs → db-BH25DX2G.mjs} +4 -4
  48. package/dist/cli/{db-444XYOTV.js → db-JXZNMFCE.js} +29 -29
  49. package/dist/cli/{describe-RRBESS3S.js → describe-N2OBGVJM.js} +61 -32
  50. package/dist/cli/{describe-GI5GHAKO.mjs → describe-TMBECHTX.mjs} +46 -17
  51. package/dist/cli/{executions-ERXZUOL5.js → executions-TX5CQF66.js} +6 -6
  52. package/dist/cli/{executions-4YDP6BXI.mjs → executions-Y4HQHYSO.mjs} +4 -4
  53. package/dist/cli/{feedback-3M7D7DZQ.js → feedback-ASEJ5A7I.js} +7 -7
  54. package/dist/cli/{feedback-CPWQL5LU.mjs → feedback-W7SRXYSP.mjs} +3 -3
  55. package/dist/cli/{git-XN6C3TJZ.mjs → git-2W7CZZRC.mjs} +4 -4
  56. package/dist/cli/git-SSSOIQ2L.js +23 -0
  57. package/dist/cli/index.js +81 -81
  58. package/dist/cli/index.mjs +32 -32
  59. package/dist/cli/{legacy-noops-5XDGOFWH.js → legacy-noops-NJYAAGBY.js} +7 -7
  60. package/dist/cli/{legacy-noops-KXQ6TFFL.mjs → legacy-noops-TXMPY3P7.mjs} +4 -4
  61. package/dist/cli/{monitors-33IU5JR6.mjs → monitors-G4L65QGQ.mjs} +4 -4
  62. package/dist/cli/{monitors-KH22PDOC.js → monitors-YLKTQ57D.js} +85 -85
  63. package/dist/cli/{org-MHYMWUEP.mjs → org-BCHOWKIA.mjs} +4 -4
  64. package/dist/cli/{org-X4NSLQG5.js → org-ENXO2A33.js} +64 -64
  65. package/dist/cli/{play-LCZKHKW2.mjs → play-JBY7HUYN.mjs} +8 -8
  66. package/dist/cli/play-SSJ3PO4D.js +155 -0
  67. package/dist/cli/{providers-J6LWCF5R.js → providers-GWFX3E7C.js} +7 -7
  68. package/dist/cli/{providers-L5FJTSEA.mjs → providers-JV2DZG43.mjs} +4 -4
  69. package/dist/cli/{quickstart-NE3BTWGL.mjs → quickstart-AIXURXZQ.mjs} +3 -3
  70. package/dist/cli/{quickstart-OOPFA4MX.js → quickstart-CASPK7F4.js} +5 -5
  71. package/dist/cli/{search-DBXOEOIE.mjs → search-DYQB7LHK.mjs} +5 -5
  72. package/dist/cli/search-N7K6A2YV.js +26 -0
  73. package/dist/cli/{secrets-WPMU7UBD.js → secrets-AZQG2E4U.js} +13 -13
  74. package/dist/cli/{secrets-U2MLWZH2.mjs → secrets-RQZPIPO5.mjs} +4 -4
  75. package/dist/cli/{sessions-WYNC4AUE.mjs → sessions-3FJJDMBB.mjs} +4 -4
  76. package/dist/cli/{sessions-YYZ3UJDS.js → sessions-ZY6RBYD4.js} +5 -5
  77. package/dist/cli/{settings-WQDFX3X6.js → settings-GXKWNR5V.js} +74 -74
  78. package/dist/cli/{settings-FQZSHFC6.mjs → settings-UNZDQGSE.mjs} +7 -7
  79. package/dist/cli/{setup-JKYJT35S.mjs → setup-PIRXJ2KJ.mjs} +6 -6
  80. package/dist/cli/{setup-DKYVNDTM.js → setup-UURZD4YO.js} +41 -41
  81. package/dist/cli/skills-4OUZLKTW.js +28 -0
  82. package/dist/cli/{skills-VHVCJJJY.mjs → skills-B4AQEIAF.mjs} +4 -4
  83. package/dist/cli/tools-MIZS5UN6.js +40 -0
  84. package/dist/cli/{tools-E23PU7KM.mjs → tools-UMGQKUSW.mjs} +8 -8
  85. package/dist/cli/update-3CO7LA4M.js +28 -0
  86. package/dist/cli/{update-4A4VU6CW.mjs → update-SFUTMEKL.mjs} +6 -6
  87. package/dist/cli/{workflow-WB2USWAA.js → workflow-CDAJCMT7.js} +15 -15
  88. package/dist/cli/{workflow-2ZR2ECTG.mjs → workflow-ON6XVW36.mjs} +5 -5
  89. package/dist/{client-Cw0e2Uec.d.mts → client-Cn-txrXv.d.mts} +1 -1
  90. package/dist/{client-CwdiawoG.d.ts → client-fPoIN-3V.d.ts} +1 -1
  91. package/dist/{compiler-manifest-DgdW0q0b.d.mts → compiler-manifest-CY2v8ab0.d.mts} +2 -0
  92. package/dist/{compiler-manifest-DgdW0q0b.d.ts → compiler-manifest-CY2v8ab0.d.ts} +2 -0
  93. package/dist/{index-C3nQQTI-.d.mts → index-B9fBZH1g.d.mts} +1 -1
  94. package/dist/{index-CEYQAfS0.d.ts → index-BZ6uzZJl.d.ts} +1 -1
  95. package/dist/index.d.mts +5 -5
  96. package/dist/index.d.ts +5 -5
  97. package/dist/index.js +79 -249
  98. package/dist/index.mjs +10 -180
  99. package/dist/install-integrity.json +85 -84
  100. package/dist/plays/bundle-play-file.d.mts +3 -3
  101. package/dist/plays/bundle-play-file.d.ts +3 -3
  102. package/dist/plays/run-request.d.mts +2 -2
  103. package/dist/plays/run-request.d.ts +2 -2
  104. package/dist/release.d.mts +1 -1
  105. package/dist/release.d.ts +1 -1
  106. package/dist/release.js +2 -2
  107. package/dist/release.mjs +1 -1
  108. package/package.json +1 -1
  109. package/dist/cli/auth-4SXMV3CD.js +0 -33
  110. package/dist/cli/client-UUNLXOHF.js +0 -20
  111. package/dist/cli/git-ITSCNUVB.js +0 -23
  112. package/dist/cli/play-4QRPOBWW.js +0 -155
  113. package/dist/cli/search-UGQDBP76.js +0 -26
  114. package/dist/cli/skills-VBQMXDAX.js +0 -28
  115. package/dist/cli/tools-ACEJZMJD.js +0 -40
  116. package/dist/cli/update-V5KMYHVE.js +0 -28
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  addDescribeOptions,
3
+ byokLines,
3
4
  rateLimitSummary,
4
5
  recordApiResponse,
5
6
  schemaField,
6
7
  schemaFields
7
- } from "./chunk-3GK3SH3G.mjs";
8
+ } from "./chunk-E6BZWURC.mjs";
8
9
  import {
9
10
  shellQuote
10
11
  } from "./chunk-OVDNJAJN.mjs";
@@ -13,22 +14,26 @@ import {
13
14
  observedMaxText,
14
15
  recentSearchRef,
15
16
  registerDeprecatedSearchCommand
16
- } from "./chunk-5HYD3GMS.mjs";
17
+ } from "./chunk-GT6KGIWV.mjs";
17
18
  import {
19
+ DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS,
20
+ EMAIL_STATUS_JSON_SCHEMA,
21
+ JOB_CHANGE_JSON_SCHEMA,
18
22
  extractSummaryFields,
23
+ isDeeplineExtractorTarget,
19
24
  projectRowOutput,
20
25
  stableStringify,
21
26
  tryConvertToList,
22
27
  writeCsvOutputFile,
23
28
  writeJsonOutputFile
24
- } from "./chunk-JB6ERQUV.mjs";
29
+ } from "./chunk-Y6VOGHF2.mjs";
25
30
  import {
26
31
  playToolListGetterMode
27
32
  } from "./chunk-7E66A24V.mjs";
28
33
  import {
29
34
  DeeplineClient,
30
35
  validateExecutionIdempotencyKey
31
- } from "./chunk-2RC5JQ3C.mjs";
36
+ } from "./chunk-A62HBMHY.mjs";
32
37
  import {
33
38
  beginToolExecuteCommand,
34
39
  getToolExecuteInvocationId,
@@ -42,11 +47,11 @@ import {
42
47
  printJsonError,
43
48
  renderCommandEnvelopeText,
44
49
  shouldEmitJson
45
- } from "./chunk-MIMV5LTU.mjs";
50
+ } from "./chunk-NNYQ24O5.mjs";
46
51
  import {
47
52
  resolveConfig,
48
53
  sdkCliStateDirPath
49
- } from "./chunk-FGHRRJ3D.mjs";
54
+ } from "./chunk-VZSVYNZH.mjs";
50
55
  import {
51
56
  DeeplineError
52
57
  } from "./chunk-NXGCO4JB.mjs";
@@ -185,6 +190,179 @@ function describeToolCategory(category) {
185
190
  return TOOL_CATEGORY_DESCRIPTIONS[category] ?? null;
186
191
  }
187
192
 
193
+ // ../plays/field-catalog.ts
194
+ var value = (description) => ({ type: "string", description });
195
+ var SOURCE = {
196
+ type: "string",
197
+ description: "The provider or step that found it."
198
+ };
199
+ var FIELD_CATALOG = {
200
+ person: {
201
+ name: {
202
+ description: "The person's name.",
203
+ leaves: {
204
+ value: value("Full name."),
205
+ first: value("First (given) name."),
206
+ last: value("Last (family) name.")
207
+ }
208
+ },
209
+ email: {
210
+ description: "An email address for the person.",
211
+ leaves: {
212
+ value: value("The address."),
213
+ validated: {
214
+ type: "boolean",
215
+ description: "Whether the address passed validation."
216
+ },
217
+ status: {
218
+ type: "EmailStatus",
219
+ description: "The validation verdict and its signals."
220
+ },
221
+ source: SOURCE
222
+ },
223
+ kinds: {
224
+ work: "At their employer.",
225
+ personal: "Their own, not tied to an employer."
226
+ }
227
+ },
228
+ phone: {
229
+ description: "A phone number for the person.",
230
+ leaves: {
231
+ value: value("The number."),
232
+ validated: {
233
+ type: "boolean",
234
+ description: "Whether the number passed validation."
235
+ },
236
+ status: {
237
+ type: '"valid" | "invalid" | "unknown"',
238
+ description: "The validation verdict."
239
+ },
240
+ line_type: value("Mobile, landline, VoIP and so on."),
241
+ carrier: value("The carrier serving the number."),
242
+ source: SOURCE
243
+ },
244
+ kinds: {
245
+ mobile: "Their mobile.",
246
+ work: "A direct line at their employer."
247
+ }
248
+ },
249
+ linkedin: {
250
+ description: "The person's LinkedIn profile.",
251
+ leaves: { url: value("The profile URL.") }
252
+ },
253
+ job: {
254
+ description: "The person's current role.",
255
+ leaves: {
256
+ title: value("Job title."),
257
+ change: {
258
+ type: "JobChange",
259
+ description: "Whether they changed jobs, and to what."
260
+ },
261
+ change_status: {
262
+ type: "JobChangeStatus",
263
+ description: "The job-change verdict alone."
264
+ }
265
+ }
266
+ },
267
+ record: {
268
+ description: "A provider's own record of the person.",
269
+ leaves: { id: value("The provider's id for the person.") }
270
+ }
271
+ },
272
+ company: {
273
+ name: {
274
+ description: "The company's name.",
275
+ leaves: { value: value("The name.") },
276
+ kinds: { legal: "As registered with a government." }
277
+ },
278
+ domain: {
279
+ description: "The company's web domain.",
280
+ leaves: { value: value("The bare domain, such as example.com.") }
281
+ },
282
+ website: {
283
+ description: "The company's website.",
284
+ leaves: { url: value("The site URL.") }
285
+ },
286
+ linkedin: {
287
+ description: "The company's LinkedIn page.",
288
+ leaves: { url: value("The page URL.") }
289
+ },
290
+ phone: {
291
+ description: "A phone number for the company.",
292
+ leaves: { value: value("The number.") }
293
+ },
294
+ industry: {
295
+ description: "The industry the company is in.",
296
+ leaves: { value: value("The industry.") }
297
+ },
298
+ record: {
299
+ description: "A provider's own record of the company.",
300
+ leaves: { id: value("The provider's id for the company.") }
301
+ }
302
+ }
303
+ };
304
+ function catalogFields() {
305
+ return Object.entries(FIELD_CATALOG).flatMap(
306
+ ([entity, groups]) => Object.entries(groups).flatMap(
307
+ ([group, definition]) => [void 0, ...Object.keys(definition.kinds ?? {})].flatMap(
308
+ (kind) => Object.entries(definition.leaves).map(([leaf, described]) => ({
309
+ ...described,
310
+ id: [entity, group, kind, leaf].filter(Boolean).join("."),
311
+ entity,
312
+ group,
313
+ ...kind ? { kind } : {},
314
+ leaf
315
+ }))
316
+ )
317
+ )
318
+ );
319
+ }
320
+ var FIELDS_BY_ID = new Map(catalogFields().map((field) => [field.id, field]));
321
+ function generalField(id) {
322
+ const field = FIELDS_BY_ID.get(id);
323
+ return field?.kind ? [field.entity, field.group, field.leaf].join(".") : null;
324
+ }
325
+ function fieldSatisfies(offered, wanted) {
326
+ return offered === wanted || generalField(offered) === wanted;
327
+ }
328
+ var EXTRACTOR_TARGET_FIELDS = {
329
+ email: ["person.email.value"],
330
+ personal_email: ["person.email.personal.value"],
331
+ email_status: ["person.email.status"],
332
+ phone: ["person.phone.value", "company.phone.value"],
333
+ phone_status: ["person.phone.status"],
334
+ first_name: ["person.name.first"],
335
+ last_name: ["person.name.last"],
336
+ full_name: ["person.name.value"],
337
+ // Also used for a list name, a channel title and a search suggestion.
338
+ name: ["person.name.value", "company.name.value"],
339
+ linkedin: ["person.linkedin.url", "company.linkedin.url"],
340
+ linkedin_url: ["person.linkedin.url"],
341
+ title: ["person.job.title"],
342
+ job_change: ["person.job.change"],
343
+ job_change_status: ["person.job.change_status"],
344
+ company: ["company.name.value"],
345
+ company_name: ["company.name.value"],
346
+ organization_name: ["company.name.value"],
347
+ company_domain: ["company.domain.value"],
348
+ domain: ["company.domain.value"],
349
+ company_website: ["company.website.url"],
350
+ // Also used for a podcast URL.
351
+ website: ["company.website.url"],
352
+ company_linkedin_url: ["company.linkedin.url"],
353
+ industry: ["company.industry.value"],
354
+ id: ["person.record.id", "company.record.id"],
355
+ // Used for unrelated provider statuses; none is a catalog field.
356
+ status: []
357
+ };
358
+ function fieldOfName(name, declared) {
359
+ const meanings = EXTRACTOR_TARGET_FIELDS[name] ?? [];
360
+ if (declared === void 0) {
361
+ return meanings.length === 1 ? meanings[0] : void 0;
362
+ }
363
+ return meanings.some((meaning) => fieldSatisfies(declared, meaning)) ? declared : void 0;
364
+ }
365
+
188
366
  // src/cli/commands/model-description.ts
189
367
  function formatModelDescription(description) {
190
368
  const lines = [];
@@ -198,7 +376,7 @@ function formatModelDescription(description) {
198
376
  );
199
377
  if (contextWindow !== null) lines.push(`Context: ${contextWindow}`);
200
378
  const tags = arrayField(description.modelMetadata, "tags").filter(
201
- (value) => typeof value === "string"
379
+ (value2) => typeof value2 === "string"
202
380
  );
203
381
  if (tags.length) lines.push(`Tags: ${tags.join(", ")}`);
204
382
  lines.push("");
@@ -223,25 +401,25 @@ function formatModelDescription(description) {
223
401
  function appendNamespace(lines, namespace) {
224
402
  lines.push(`- ${namespace.provider} (${namespace.sourceSymbol})`);
225
403
  for (const field of namespace.fields) {
226
- const values = field.enumValues?.length ? ` (${field.enumValues.map((value) => JSON.stringify(value)).join(" | ")})` : "";
404
+ const values = field.enumValues?.length ? ` (${field.enumValues.map((value2) => JSON.stringify(value2)).join(" | ")})` : "";
227
405
  lines.push(
228
406
  ` - ${field.name}: ${field.type}${values} - ${field.description}`
229
407
  );
230
408
  }
231
409
  }
232
- function stringField(value, key) {
233
- if (!value || typeof value !== "object" || Array.isArray(value)) return null;
234
- const candidate = value[key];
410
+ function stringField(value2, key) {
411
+ if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) return null;
412
+ const candidate = value2[key];
235
413
  return typeof candidate === "string" && candidate.trim() ? candidate.trim() : null;
236
414
  }
237
- function numberField(value, key) {
238
- if (!value || typeof value !== "object" || Array.isArray(value)) return null;
239
- const candidate = value[key];
415
+ function numberField(value2, key) {
416
+ if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) return null;
417
+ const candidate = value2[key];
240
418
  return typeof candidate === "number" ? candidate : null;
241
419
  }
242
- function arrayField(value, key) {
243
- if (!value || typeof value !== "object" || Array.isArray(value)) return [];
244
- const candidate = value[key];
420
+ function arrayField(value2, key) {
421
+ if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) return [];
422
+ const candidate = value2[key];
245
423
  return Array.isArray(candidate) ? candidate : [];
246
424
  }
247
425
 
@@ -279,15 +457,15 @@ function toListedTool(tool) {
279
457
  executeCommand: `deepline tools execute ${tool.toolId}`
280
458
  };
281
459
  }
282
- function normalizeGrepText(value) {
283
- if (value === null || value === void 0) return "";
284
- if (typeof value === "string") return value.toLowerCase();
285
- if (typeof value === "number" || typeof value === "boolean") {
286
- return String(value).toLowerCase();
460
+ function normalizeGrepText(value2) {
461
+ if (value2 === null || value2 === void 0) return "";
462
+ if (typeof value2 === "string") return value2.toLowerCase();
463
+ if (typeof value2 === "number" || typeof value2 === "boolean") {
464
+ return String(value2).toLowerCase();
287
465
  }
288
- if (Array.isArray(value)) return value.map(normalizeGrepText).join(" ");
289
- if (typeof value === "object") {
290
- return Object.values(value).map(normalizeGrepText).join(" ");
466
+ if (Array.isArray(value2)) return value2.map(normalizeGrepText).join(" ");
467
+ if (typeof value2 === "object") {
468
+ return Object.values(value2).map(normalizeGrepText).join(" ");
291
469
  }
292
470
  return "";
293
471
  }
@@ -298,15 +476,15 @@ function parseGrepTerms(query, mode) {
298
476
  const matches = trimmed.match(/"([^"]+)"|'([^']+)'|\S+/g) ?? [];
299
477
  return matches.map((term) => term.replace(/^["']|["']$/g, "").trim()).filter(Boolean);
300
478
  }
301
- function matchesGrepQuery(value, query, mode) {
479
+ function matchesGrepQuery(value2, query, mode) {
302
480
  const terms = parseGrepTerms(query, mode);
303
481
  if (terms.length === 0) return true;
304
- const haystack = normalizeGrepText(value);
482
+ const haystack = normalizeGrepText(value2);
305
483
  if (mode === "any") return terms.some((term) => haystack.includes(term));
306
484
  return terms.every((term) => haystack.includes(term));
307
485
  }
308
- function shellCommandArg(value) {
309
- return `'${value.replace(/'/g, `'\\''`)}'`;
486
+ function shellCommandArg(value2) {
487
+ return `'${value2.replace(/'/g, `'\\''`)}'`;
310
488
  }
311
489
  function zeroMatchToolGuidance(options) {
312
490
  const categories = options.categories ?? [];
@@ -683,8 +861,8 @@ async function grepTools(queryInput, options = {}) {
683
861
  return 0;
684
862
  }
685
863
  function numericToolField(tool, field) {
686
- const value = tool[field];
687
- return typeof value === "number" ? value : void 0;
864
+ const value2 = tool[field];
865
+ return typeof value2 === "number" ? value2 : void 0;
688
866
  }
689
867
  function compactTool(tool) {
690
868
  const listed = toListedTool(tool);
@@ -704,7 +882,7 @@ function compactTool(tool) {
704
882
  };
705
883
  }
706
884
  function playIdentifiers(play) {
707
- return [play.name, play.reference, ...play.aliases ?? []].filter((value) => Boolean(value?.trim())).map((value) => value.trim());
885
+ return [play.name, play.reference, ...play.aliases ?? []].filter((value2) => Boolean(value2?.trim())).map((value2) => value2.trim());
708
886
  }
709
887
  async function findPlayForToolId(client, toolId, cliInvocationId) {
710
888
  const requested = toolId.trim();
@@ -940,10 +1118,15 @@ Examples:
940
1118
  process.exitCode = await narrowView();
941
1119
  return;
942
1120
  }
943
- const { describeAnything } = await import("./describe-GI5GHAKO.mjs");
1121
+ const { describeAnything } = await import("./describe-TMBECHTX.mjs");
944
1122
  process.exitCode = await describeAnything(
945
1123
  toolId,
946
- { ...options, kinds: ["tools", "monitors"], fetchedTool: metadata },
1124
+ {
1125
+ ...options,
1126
+ kinds: ["tools", "monitors"],
1127
+ fetchedTool: metadata,
1128
+ fullRecord: true
1129
+ },
947
1130
  // An unknown id keeps this command's own error and play hint.
948
1131
  narrowView
949
1132
  );
@@ -952,7 +1135,7 @@ Examples:
952
1135
  addToolMetadataCommand(
953
1136
  addDescribeOptions(
954
1137
  tools.command("describe <toolId>", { hidden: true }).alias("get"),
955
- { json: false }
1138
+ { json: false, byok: false }
956
1139
  )
957
1140
  );
958
1141
  tools.command("execute <toolId>").alias("call").description("Execute a tool by id.").addHelpText(
@@ -980,8 +1163,8 @@ Examples:
980
1163
  ).option(
981
1164
  "-p, --param <key=value>",
982
1165
  "Pass one parameter. Repeat for multiple values.",
983
- (value, acc) => {
984
- acc.push(value);
1166
+ (value2, acc) => {
1167
+ acc.push(value2);
985
1168
  return acc;
986
1169
  },
987
1170
  []
@@ -1079,7 +1262,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
1079
1262
  { toolId: resolvedToolId, byok },
1080
1263
  {
1081
1264
  json: Boolean(options.json || options.contractJson),
1082
- text: `${toolByokLines(resolvedToolId, byok).join("\n")}
1265
+ text: `${[resolvedToolId, ...byokLines(byok)].join("\n")}
1083
1266
  `
1084
1267
  }
1085
1268
  );
@@ -1324,7 +1507,7 @@ function printMonitorTypeFilterExamples(tool) {
1324
1507
  const example = stringField2(grammar, "example");
1325
1508
  const values = [
1326
1509
  ...arrayField2(grammar, "examples").filter(
1327
- (value) => typeof value === "string" && Boolean(value)
1510
+ (value2) => typeof value2 === "string" && Boolean(value2)
1328
1511
  ),
1329
1512
  ...example ? [example] : []
1330
1513
  ];
@@ -1417,6 +1600,23 @@ function schemaNodeAt(schema, path) {
1417
1600
  }
1418
1601
  return node;
1419
1602
  }
1603
+ var NAMED_VALUE_SHAPES = {
1604
+ email_status: { shape: "EmailStatus", schema: EMAIL_STATUS_JSON_SCHEMA },
1605
+ job_change: { shape: "JobChange", schema: JOB_CHANGE_JSON_SCHEMA }
1606
+ };
1607
+ function extractorValueType(name) {
1608
+ if (!isDeeplineExtractorTarget(name)) return void 0;
1609
+ const definition = DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS[name];
1610
+ if (definition.enum) {
1611
+ return {
1612
+ type: definition.enum.map((value2) => JSON.stringify(value2)).join(" | ")
1613
+ };
1614
+ }
1615
+ const named = NAMED_VALUE_SHAPES[definition.valueKind];
1616
+ if (!named) return { type: "string" };
1617
+ const { type, fields } = schemaField(name, named.schema, true);
1618
+ return { type, ...fields ? { fields } : {}, shape: named.shape };
1619
+ }
1420
1620
  function jsonSchemaOf(wrapper) {
1421
1621
  return isRecord(wrapper.jsonSchema) ? wrapper.jsonSchema : wrapper;
1422
1622
  }
@@ -1442,7 +1642,7 @@ function publicToolSchemas(tool) {
1442
1642
  function describedTool(tool, requestedToolId) {
1443
1643
  const id = stringField2(tool, "toolId") || requestedToolId;
1444
1644
  const displayName = stringField2(tool, "displayName") || void 0;
1445
- const description = stringField2(tool, "description") || void 0;
1645
+ const description = stringField2(tool, "bestFor", "best_for") || stringField2(tool, "description") || void 0;
1446
1646
  if (isMonitorTypeTool(tool)) {
1447
1647
  return {
1448
1648
  kind: "monitor_type",
@@ -1474,24 +1674,37 @@ function describedTool(tool, requestedToolId) {
1474
1674
  recordField(item, "details")
1475
1675
  ])
1476
1676
  );
1677
+ const declared = recordField(tool, "extractors");
1477
1678
  const getterOutputs = (kind, roots) => {
1478
1679
  const details = getterDetails(kind);
1479
1680
  return arrayField2(getters, kind).filter(isRecord).map((entry) => {
1480
1681
  const name = stringField2(entry, "name");
1481
- const paths = arrayField2(
1682
+ const rawPaths = arrayField2(
1482
1683
  details.get(name) ?? {},
1483
1684
  "rawToolOutputPaths"
1484
- ).map((path) => String(path).replace(/^toolResponse\.raw\./, ""));
1685
+ ).map(String);
1686
+ const paths = rawPaths.map(
1687
+ (path) => path.replace(/^toolResponse\.raw\./, "")
1688
+ );
1485
1689
  const node = roots.flatMap((root) => paths.map((path) => schemaNodeAt(root, path))).find(isRecord);
1486
1690
  const { fields, ...typed } = schemaField(name, node, true);
1487
1691
  const valueType = stringField2(details.get(name) ?? {}, "valueType");
1692
+ const deepline = kind === "extractedValues" ? extractorValueType(name) : void 0;
1693
+ const known = typed.type !== "unknown" ? void 0 : kind === "extractedLists" ? { type: "object[]" } : deepline;
1694
+ const means = kind === "extractedValues" ? fieldOfName(
1695
+ name,
1696
+ stringField2(declared[name] ?? {}, "means") || void 0
1697
+ ) : void 0;
1488
1698
  const field = {
1489
1699
  ...typed,
1490
- // A normalized value has a named type instead of the response's shape.
1491
- ...valueType ? { type: valueType } : fields ? { fields } : {},
1700
+ ...means ? { means } : {},
1701
+ // A normalized value has a named type instead of the response's
1702
+ // shape; a normalized object is spelled out once under Types.
1703
+ ...deepline?.shape ? deepline : valueType ? { type: valueType } : known ? known : fields ? { fields } : {},
1492
1704
  // A list's row columns that matter are value getters of their own.
1493
1705
  ...kind === "extractedLists" && fields ? { summarized: true } : {},
1494
- read: playResultExpression(entry)
1706
+ read: playResultExpression(entry),
1707
+ ...rawPaths.length ? { paths: rawPaths } : {}
1495
1708
  };
1496
1709
  return { field, node };
1497
1710
  });
@@ -1500,7 +1713,19 @@ function describedTool(tool, requestedToolId) {
1500
1713
  const values = getterOutputs("extractedValues", [
1501
1714
  outputSchema,
1502
1715
  ...lists.map(({ node }) => node?.items)
1503
- ]);
1716
+ ]).map((value2) => {
1717
+ if (!lists.length || !value2.field.paths) return value2;
1718
+ const within = value2.field.paths.map(
1719
+ (path) => path.replace(/^toolResponse\.raw\./, "")
1720
+ );
1721
+ const list = lists.find(
1722
+ ({ node }) => within.some((path) => isRecord(schemaNodeAt(node?.items, path)))
1723
+ ) ?? lists[0];
1724
+ return {
1725
+ ...value2,
1726
+ field: { ...value2.field, in: list.field.name, paths: within }
1727
+ };
1728
+ });
1504
1729
  const playReference = isPlayLikeTool(tool) ? playReferenceForTool(tool) : null;
1505
1730
  return {
1506
1731
  kind: "tool",
@@ -1643,25 +1868,6 @@ function printCompactToolContract(tool, requestedToolId) {
1643
1868
  );
1644
1869
  console.log(`More: deepline describe ${contract.toolId}`);
1645
1870
  }
1646
- function toolByokLines(toolId, byok) {
1647
- if (typeof byok.supported !== "boolean") {
1648
- return [`${toolId}`, "BYOK: unknown (this server does not report it)"];
1649
- }
1650
- if (!byok.supported) {
1651
- return [
1652
- `${toolId}`,
1653
- "BYOK: not supported. Deepline runs this tool with its own credentials."
1654
- ];
1655
- }
1656
- const setup = stringField2(byok, "setup");
1657
- const setupUrl = stringField2(byok, "setupUrl");
1658
- return [
1659
- `${toolId}`,
1660
- byok.required === true ? "BYOK: required. This tool runs only on your own provider credentials." : "BYOK: supported (optional).",
1661
- ...setup ? [`Setup: ${setup}`] : [],
1662
- ...setupUrl ? [`Connect: ${setupUrl}`] : []
1663
- ];
1664
- }
1665
1871
  function toolPricingOnlyLines(tool, requestedToolId, options = {}) {
1666
1872
  if (isMonitorTypeTool(tool)) {
1667
1873
  return monitorTypePricingLines(tool);
@@ -1839,9 +2045,7 @@ function printToolGettersOnly(tool, requestedToolId) {
1839
2045
  const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
1840
2046
  console.log(`Getters: ${contract.toolId}`);
1841
2047
  if (!listGetters.length && !valueGetters.length) {
1842
- console.log(
1843
- "No generated getters declared."
1844
- );
2048
+ console.log("No generated getters declared.");
1845
2049
  return;
1846
2050
  }
1847
2051
  if (listGetters.length) {
@@ -2031,9 +2235,9 @@ function usageGuidanceWithAccessDefaults(usageGuidance) {
2031
2235
  }
2032
2236
  };
2033
2237
  }
2034
- function singleLineText(value, maxLength = 260) {
2035
- if (typeof value !== "string") return "";
2036
- const text = value.replace(/\s+/g, " ").trim();
2238
+ function singleLineText(value2, maxLength = 260) {
2239
+ if (typeof value2 !== "string") return "";
2240
+ const text = value2.replace(/\s+/g, " ").trim();
2037
2241
  if (text.length <= maxLength) return text;
2038
2242
  return `${text.slice(0, maxLength - 3).trimEnd()}...`;
2039
2243
  }
@@ -2077,8 +2281,8 @@ function toolInputFieldsForDisplay(inputSchema) {
2077
2281
  const jsonSchema = isRecord(inputSchema.jsonSchema) ? inputSchema.jsonSchema : inputSchema;
2078
2282
  const properties = isRecord(jsonSchema.properties) ? jsonSchema.properties : {};
2079
2283
  const required = Array.isArray(jsonSchema.required) ? new Set(jsonSchema.required.map(String)) : /* @__PURE__ */ new Set();
2080
- return Object.entries(properties).map(([name, value]) => {
2081
- const property = isRecord(value) ? value : {};
2284
+ return Object.entries(properties).map(([name, value2]) => {
2285
+ const property = isRecord(value2) ? value2 : {};
2082
2286
  return {
2083
2287
  name,
2084
2288
  type: typeof property.type === "string" ? property.type : "unknown",
@@ -2142,11 +2346,11 @@ function publicToolInputSchemaForDescribe(inputSchema) {
2142
2346
  withoutDeeplineCredits
2143
2347
  ) || /\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);
2144
2348
  };
2145
- const stripDescriptions = (value) => {
2146
- if (Array.isArray(value)) return value.map(stripDescriptions);
2147
- if (!isRecord(value)) return value;
2349
+ const stripDescriptions = (value2) => {
2350
+ if (Array.isArray(value2)) return value2.map(stripDescriptions);
2351
+ if (!isRecord(value2)) return value2;
2148
2352
  return Object.fromEntries(
2149
- Object.entries(value).flatMap(([key, nested]) => {
2353
+ Object.entries(value2).flatMap(([key, nested]) => {
2150
2354
  if (key === "description" && typeof nested === "string" && exposesProviderSpend(nested)) {
2151
2355
  return [];
2152
2356
  }
@@ -2160,16 +2364,16 @@ function recursiveToolInputFieldsForDisplay(inputSchema) {
2160
2364
  const root = canonicalToolJsonSchema(inputSchema);
2161
2365
  const fields = /* @__PURE__ */ new Map();
2162
2366
  const schemasById = /* @__PURE__ */ new Map();
2163
- const collectSchemaIds = (value) => {
2164
- if (Array.isArray(value)) {
2165
- for (const item of value) collectSchemaIds(item);
2367
+ const collectSchemaIds = (value2) => {
2368
+ if (Array.isArray(value2)) {
2369
+ for (const item of value2) collectSchemaIds(item);
2166
2370
  return;
2167
2371
  }
2168
- if (!isRecord(value)) return;
2169
- if (typeof value.$id === "string" && value.$id.trim()) {
2170
- schemasById.set(value.$id.trim(), value);
2372
+ if (!isRecord(value2)) return;
2373
+ if (typeof value2.$id === "string" && value2.$id.trim()) {
2374
+ schemasById.set(value2.$id.trim(), value2);
2171
2375
  }
2172
- for (const nested of Object.values(value)) collectSchemaIds(nested);
2376
+ for (const nested of Object.values(value2)) collectSchemaIds(nested);
2173
2377
  };
2174
2378
  collectSchemaIds(root);
2175
2379
  const resolveRef = (schema) => {
@@ -2214,10 +2418,10 @@ function recursiveToolInputFieldsForDisplay(inputSchema) {
2214
2418
  const requiredNames = new Set(
2215
2419
  Array.isArray(schema.required) ? schema.required.map(String) : []
2216
2420
  );
2217
- for (const [name, value] of Object.entries(properties)) {
2218
- if (!isRecord(value)) continue;
2421
+ for (const [name, value2] of Object.entries(properties)) {
2422
+ if (!isRecord(value2)) continue;
2219
2423
  visit(
2220
- value,
2424
+ value2,
2221
2425
  path ? `${path}.${name}` : name,
2222
2426
  requiredNames.has(name),
2223
2427
  nextActiveRefs
@@ -2265,15 +2469,15 @@ function arrayItemBoundsSuffix(field) {
2265
2469
  if (maxItems !== null) return `${itemTypeSuffix} maxItems=${maxItems}`;
2266
2470
  return itemTypeSuffix;
2267
2471
  }
2268
- function printToolExecutionHints(value) {
2472
+ function printToolExecutionHints(value2) {
2269
2473
  const batchCapabilityRecord = recordField(
2270
- isRecord(value) ? value : {},
2474
+ isRecord(value2) ? value2 : {},
2271
2475
  "batchCapability",
2272
2476
  "batch_capability"
2273
2477
  );
2274
2478
  const batchCapability = Object.keys(batchCapabilityRecord).length > 0 ? batchCapabilityRecord : null;
2275
2479
  const executionMetadata = recordField(
2276
- isRecord(value) ? value : {},
2480
+ isRecord(value2) ? value2 : {},
2277
2481
  "executionMetadata",
2278
2482
  "execution_metadata"
2279
2483
  );
@@ -2429,41 +2633,41 @@ function listExtractorPathsFromUsageGuidance(tool) {
2429
2633
  ).filter(Boolean);
2430
2634
  });
2431
2635
  }
2432
- function formatDecimal(value) {
2433
- const text = value.toFixed(12).replace(/0+$/, "").replace(/\.$/, "");
2636
+ function formatDecimal(value2) {
2637
+ const text = value2.toFixed(12).replace(/0+$/, "").replace(/\.$/, "");
2434
2638
  return text || "0";
2435
2639
  }
2436
- function formatUsd(value) {
2437
- return `$${formatDecimal(value)}`;
2640
+ function formatUsd(value2) {
2641
+ return `$${formatDecimal(value2)}`;
2438
2642
  }
2439
- function isRecord(value) {
2440
- return Boolean(value && typeof value === "object" && !Array.isArray(value));
2643
+ function isRecord(value2) {
2644
+ return Boolean(value2 && typeof value2 === "object" && !Array.isArray(value2));
2441
2645
  }
2442
2646
  function stringField2(source, ...keys) {
2443
2647
  for (const key of keys) {
2444
- const value = source[key];
2445
- if (typeof value === "string" && value.trim()) return value.trim();
2648
+ const value2 = source[key];
2649
+ if (typeof value2 === "string" && value2.trim()) return value2.trim();
2446
2650
  }
2447
2651
  return "";
2448
2652
  }
2449
2653
  function numberField2(source, ...keys) {
2450
2654
  for (const key of keys) {
2451
- const value = source[key];
2452
- if (typeof value === "number" && Number.isFinite(value)) return value;
2655
+ const value2 = source[key];
2656
+ if (typeof value2 === "number" && Number.isFinite(value2)) return value2;
2453
2657
  }
2454
2658
  return null;
2455
2659
  }
2456
2660
  function arrayField2(source, ...keys) {
2457
2661
  for (const key of keys) {
2458
- const value = source[key];
2459
- if (Array.isArray(value)) return value;
2662
+ const value2 = source[key];
2663
+ if (Array.isArray(value2)) return value2;
2460
2664
  }
2461
2665
  return [];
2462
2666
  }
2463
2667
  function recordField(source, ...keys) {
2464
2668
  for (const key of keys) {
2465
- const value = source[key];
2466
- if (isRecord(value)) return value;
2669
+ const value2 = source[key];
2670
+ if (isRecord(value2)) return value2;
2467
2671
  }
2468
2672
  return {};
2469
2673
  }
@@ -2534,10 +2738,10 @@ function parseJsonObjectArgument(raw, flagName) {
2534
2738
  }
2535
2739
  return parsed;
2536
2740
  }
2537
- function toolExecuteJsonOption(value) {
2538
- const legacyInput = typeof value === "string" ? value : void 0;
2741
+ function toolExecuteJsonOption(value2) {
2742
+ const legacyInput = typeof value2 === "string" ? value2 : void 0;
2539
2743
  return {
2540
- requested: value === true || legacyInput !== void 0,
2744
+ requested: value2 === true || legacyInput !== void 0,
2541
2745
  legacyInput
2542
2746
  };
2543
2747
  }
@@ -2601,10 +2805,10 @@ function parseToolExecuteTimeout(raw) {
2601
2805
  "--timeout must be a duration like 500ms, 90s, 10m, or 1h (a bare number is seconds)."
2602
2806
  );
2603
2807
  }
2604
- const value = Number(match[1]);
2808
+ const value2 = Number(match[1]);
2605
2809
  const unit = (match[2] ?? "s").toLowerCase();
2606
2810
  const factor = unit === "ms" ? 1 : unit === "s" ? 1e3 : unit === "m" ? 6e4 : 36e5;
2607
- const timeoutMs = value * factor;
2811
+ const timeoutMs = value2 * factor;
2608
2812
  if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 2147483647) {
2609
2813
  throw new Error(
2610
2814
  "--timeout must be between 1ms and 2147483647ms (24d 20h 31m 23s)."
@@ -2612,11 +2816,11 @@ function parseToolExecuteTimeout(raw) {
2612
2816
  }
2613
2817
  return timeoutMs;
2614
2818
  }
2615
- function safeFileStem(value) {
2616
- return value.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "tool";
2819
+ function safeFileStem(value2) {
2820
+ return value2.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "tool";
2617
2821
  }
2618
- function powerShellQuote(value) {
2619
- return `'${value.replace(/'/g, "''")}'`;
2822
+ function powerShellQuote(value2) {
2823
+ return `'${value2.replace(/'/g, "''")}'`;
2620
2824
  }
2621
2825
  function starterScriptJson(script) {
2622
2826
  return {
@@ -2774,7 +2978,7 @@ function buildToolExecuteBaseEnvelope(input) {
2774
2978
  lines: apifyRecovery ? [
2775
2979
  "Apify is still running. Run the follow-up command(s) below."
2776
2980
  ] : summaryEntries.length > 0 ? summaryEntries.map(
2777
- ([key, value]) => `${key}=${String(value)}`
2981
+ ([key, value2]) => `${key}=${String(value2)}`
2778
2982
  ) : [JSON.stringify(input.rawResponse, null, 2)]
2779
2983
  },
2780
2984
  ...guidanceLines.length > 0 ? [{ title: "guidance", lines: guidanceLines }] : []
@@ -2856,7 +3060,7 @@ function buildToolExecuteRowArtifactEnvelope(input) {
2856
3060
  lines: [
2857
3061
  ...input.csv.columns.length > 0 ? [`columns: ${JSON.stringify(input.csv.columns)}`] : [],
2858
3062
  ...Object.keys(input.summary).length > 0 ? [
2859
- `summary: ${Object.entries(input.summary).map(([key, value]) => `${key}=${String(value)}`).join(", ")}`
3063
+ `summary: ${Object.entries(input.summary).map(([key, value2]) => `${key}=${String(value2)}`).join(", ")}`
2860
3064
  ] : [],
2861
3065
  `preview: ${JSON.stringify(input.rowOutput.previewRows)}`,
2862
3066
  `starter script: ${input.seededScript.path}`