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,14 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkWQJJNIMQjs = require('./chunk-WQJJNIMQ.js');
3
+ var _chunkZM2YPJQJjs = require('./chunk-ZM2YPJQJ.js');
4
4
 
5
5
 
6
+ var _chunkUVXBVUZQjs = require('./chunk-UVXBVUZQ.js');
6
7
 
7
- var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
8
8
 
9
9
 
10
+ var _chunkDQ65ZVHNjs = require('./chunk-DQ65ZVHN.js');
10
11
 
11
- var _chunkV7UP2F4Ujs = require('./chunk-V7UP2F4U.js');
12
+
13
+
14
+ var _chunkRYW4HPSMjs = require('./chunk-RYW4HPSM.js');
12
15
 
13
16
  // src/cli/commands/search.ts
14
17
  var _commander = require('commander');
@@ -18,7 +21,7 @@ var _fs = require('fs');
18
21
  var _path = require('path');
19
22
  var SEARCH_REF_TTL_MS = 15 * 6e4;
20
23
  function lastSearchPath() {
21
- return _path.join.call(void 0, _chunkV7UP2F4Ujs.sdkCliStateDirPath.call(void 0, _chunkV7UP2F4Ujs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
24
+ return _path.join.call(void 0, _chunkRYW4HPSMjs.sdkCliStateDirPath.call(void 0, _chunkRYW4HPSMjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
22
25
  }
23
26
  function rememberSearchRef(searchRef) {
24
27
  try {
@@ -63,109 +66,6 @@ function formatTextTable(rows, columns) {
63
66
  }).split("\n").map((line) => line.trimEnd()).join("\n").trimEnd();
64
67
  }
65
68
 
66
- // src/cli/tool-description.ts
67
- function observedMaxText(pricing) {
68
- const max = recordValue(recordValue(pricing).observedMax);
69
- return typeof max.creditsPerCall === "number" && max.creditsPerCall > 0 ? `max observed ${max.creditsPerCall} credits/call (last ${String(max.windowDays)} days)` : "";
70
- }
71
- var Capability = class _Capability {
72
- #catalogEntry;
73
- constructor(catalogEntry) {
74
- this.#catalogEntry = catalogEntry;
75
- }
76
- static fromCatalogEntry(catalogEntry) {
77
- return new _Capability(catalogEntry);
78
- }
79
- describe() {
80
- return CapabilityDescription.fromCatalogEntry(this.#catalogEntry);
81
- }
82
- };
83
- var CapabilityDescription = class _CapabilityDescription {
84
- #catalogEntry;
85
- constructor(catalogEntry) {
86
- this.#catalogEntry = catalogEntry;
87
- }
88
- static fromCatalogEntry(catalogEntry) {
89
- return new _CapabilityDescription(catalogEntry);
90
- }
91
- /**
92
- * The customer price already resolved by the catalog. This intentionally
93
- * omits provider-price fields, even when a catalog Adapter carried them.
94
- */
95
- customerCost() {
96
- const legacyCost = recordValue(this.#catalogEntry.cost);
97
- const pricing = recordValue(this.#catalogEntry.pricing);
98
- const unit = stringValue(pricing.unit);
99
- const legacyPricingModel = stringValue(
100
- _nullishCoalesce(legacyCost.pricingModel, () => ( legacyCost.pricing_model))
101
- );
102
- const pricingModel = unit === "call" ? "fixed" : unit === "result" || unit === "page" ? `per_${unit}` : unit === "usage" ? "provider_usage" : legacyPricingModel;
103
- const canonicalCredits = pricingNumber(
104
- pricing,
105
- "creditsPerUnit",
106
- "credits_per_unit",
107
- _nullishCoalesce(this.#catalogEntry.deeplineCreditsPerPricingUnit, () => ( this.#catalogEntry.deepline_credits_per_pricing_unit))
108
- );
109
- const canonicalUsd = pricingNumber(
110
- pricing,
111
- "usdPerUnit",
112
- "usd_per_unit",
113
- _nullishCoalesce(this.#catalogEntry.deeplineUsdPerPricingUnit, () => ( this.#catalogEntry.deepline_usd_per_pricing_unit))
114
- );
115
- const billingSource = stringValue(
116
- _nullishCoalesce(this.#catalogEntry.billingSource, () => ( this.#catalogEntry.billing_source))
117
- );
118
- const billingSourceLabel = stringValue(
119
- _nullishCoalesce(this.#catalogEntry.billingSourceLabel, () => ( this.#catalogEntry.billing_source_label))
120
- );
121
- const isFree = billingSource === "free";
122
- return {
123
- pricingModel: pricingModel || null,
124
- unit: unit || null,
125
- displayText: isFree ? "Free" : stringValue(_nullishCoalesce(pricing.displayText, () => ( pricing.display_text))),
126
- summary: isFree ? null : stringValue(pricing.summary),
127
- billingMode: stringValue(
128
- _nullishCoalesce(legacyCost.billingMode, () => ( legacyCost.billing_mode))
129
- ),
130
- billingSource,
131
- billingSourceLabel,
132
- deeplineCreditsPerPricingUnit: isFree ? 0 : canonicalCredits,
133
- deeplineUsdPerPricingUnit: isFree ? 0 : canonicalUsd,
134
- ...pricing.estimatedRange && !isFree && billingSource !== "own_provider_credentials" ? {
135
- estimatedRange: pricing.estimatedRange,
136
- details: Array.isArray(pricing.details) ? pricing.details.filter(
137
- (value) => typeof value === "string"
138
- ) : []
139
- } : {},
140
- ...pricing.observedReference && !isFree && billingSource !== "own_provider_credentials" ? {
141
- observedReference: pricing.observedReference,
142
- details: Array.isArray(pricing.details) ? pricing.details.filter(
143
- (value) => typeof value === "string"
144
- ) : []
145
- } : {},
146
- ...pricing.observedMax && !isFree && billingSource !== "own_provider_credentials" ? {
147
- observedMax: pricing.observedMax
148
- } : {}
149
- };
150
- }
151
- };
152
- function recordValue(value) {
153
- return value && typeof value === "object" && !Array.isArray(value) ? value : {};
154
- }
155
- function stringValue(value) {
156
- return typeof value === "string" && value.trim() ? value : null;
157
- }
158
- function numberValue(value) {
159
- return typeof value === "number" && Number.isFinite(value) ? value : null;
160
- }
161
- function pricingNumber(pricing, canonicalKey, aliasKey, legacyValue) {
162
- for (const key of [canonicalKey, aliasKey]) {
163
- if (Object.prototype.hasOwnProperty.call(pricing, key))
164
- return numberValue(pricing[key]);
165
- }
166
- return numberValue(legacyValue);
167
- }
168
-
169
69
  // src/cli/search-output.ts
170
70
  function clipSummary(value) {
171
71
  const characters = Array.from(value.replace(/\s+/gu, " ").trim());
@@ -245,7 +145,7 @@ function failureRateDisplay(rate) {
245
145
  }
246
146
  function searchRow(item) {
247
147
  const { cost, notes } = pricingDisplay(item);
248
- const observedMax = item.billingSource === "own_provider_credentials" ? "" : observedMaxText(item.pricing);
148
+ const observedMax = item.billingSource === "own_provider_credentials" ? "" : _chunkZM2YPJQJjs.observedMaxText.call(void 0, item.pricing);
249
149
  if (observedMax)
250
150
  notes.push(`${observedMax[0].toUpperCase()}${observedMax.slice(1)}.`);
251
151
  if (item.credentialStatus === "requires_connection") {
@@ -267,7 +167,7 @@ function searchRow(item) {
267
167
  }
268
168
  function renderSearchResults(result) {
269
169
  if (result.results.length === 0)
270
- return _chunkRTO5QZWTjs.renderCommandEnvelopeText.call(void 0, result);
170
+ return _chunkDQ65ZVHNjs.renderCommandEnvelopeText.call(void 0, result);
271
171
  const rows = result.results.map(searchRow);
272
172
  const kinds = new Set(rows.map((row) => row.kind));
273
173
  const onlyTools = kinds.size === 1 && kinds.has("tool");
@@ -298,7 +198,7 @@ function renderSearchResults(result) {
298
198
  actions: _optionalChain([render, 'optionalAccess', _11 => _11.actions])
299
199
  };
300
200
  const followUps = _optionalChain([remaining, 'access', _12 => _12.sections, 'optionalAccess', _13 => _13.length]) || _optionalChain([remaining, 'access', _14 => _14.actions, 'optionalAccess', _15 => _15.length]) ? `
301
- ${_chunkRTO5QZWTjs.renderCommandEnvelopeText.call(void 0, { render: remaining })}` : "";
201
+ ${_chunkDQ65ZVHNjs.renderCommandEnvelopeText.call(void 0, { render: remaining })}` : "";
302
202
  const notes = rows.flatMap(
303
203
  (row) => row.notes.map((note) => ` ${row.id}: ${note}`)
304
204
  );
@@ -375,7 +275,7 @@ async function runSearch(queryInput, options, types, exclude = []) {
375
275
  console.error(USAGE);
376
276
  return 1;
377
277
  }
378
- const { search_ref: searchRef, ...result } = await new (0, _chunkWQJJNIMQjs.DeeplineClient)().search({
278
+ const { search_ref: searchRef, ...result } = await new (0, _chunkUVXBVUZQjs.DeeplineClient)().search({
379
279
  query,
380
280
  types,
381
281
  exclude,
@@ -389,7 +289,7 @@ async function runSearch(queryInput, options, types, exclude = []) {
389
289
  });
390
290
  if (searchRef) rememberSearchRef(searchRef);
391
291
  pointAtDescribe(result);
392
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, result, {
292
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0, result, {
393
293
  json: options.json === true,
394
294
  text: renderSearchResults(result)
395
295
  });
@@ -489,6 +389,4 @@ Examples:
489
389
 
490
390
 
491
391
 
492
-
493
-
494
- exports.recentSearchRef = recentSearchRef; exports.observedMaxText = observedMaxText; exports.Capability = Capability; exports.SEARCH_TYPES = SEARCH_TYPES; exports.parseTypes = parseTypes; exports.appendCsv = appendCsv; exports.pointAtDescribe = pointAtDescribe; exports.registerDeprecatedSearchCommand = registerDeprecatedSearchCommand; exports.registerSearchCommand = registerSearchCommand;
392
+ exports.recentSearchRef = recentSearchRef; exports.SEARCH_TYPES = SEARCH_TYPES; exports.parseTypes = parseTypes; exports.appendCsv = appendCsv; exports.pointAtDescribe = pointAtDescribe; exports.registerDeprecatedSearchCommand = registerDeprecatedSearchCommand; exports.registerSearchCommand = registerSearchCommand;
@@ -0,0 +1,112 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;
2
+
3
+
4
+
5
+
6
+ var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
7
+
8
+ // src/errors.ts
9
+ var CustomerDbQueryOutcomeUnknownError = (_class = class extends _chunk7P5AA3SNjs.DeeplineError {
10
+ __init() {this.outcome = "unknown"}
11
+
12
+
13
+ constructor(cause, operationKey, options = {}) {
14
+ const recoveryAvailable = operationKey !== void 0 && options.recoveryAvailable !== false;
15
+ super(
16
+ operationKey === void 0 ? "SQL outcome is unknown. The unkeyed request was attempted once; inspect the database before issuing another write. An operation key added afterwards cannot recover this request." : recoveryAvailable ? "SQL outcome is unknown. Recover by submitting the same SQL and options with the original operation key; do not use a new key." : "SQL outcome is unknown. The server did not confirm atomic recovery support. Do not resubmit this write; inspect the database and confirm reader support before recovering with the original operation key.",
17
+ cause.statusCode,
18
+ "CUSTOMER_DB_QUERY_OUTCOME_UNKNOWN",
19
+ {
20
+ outcome: "unknown",
21
+ recovery: recoveryAvailable ? "original_operation_key" : "unavailable",
22
+ causeCode: cause.code
23
+ }
24
+ );_class.prototype.__init.call(this);;
25
+ this.name = "CustomerDbQueryOutcomeUnknownError";
26
+ this.operationKey = operationKey;
27
+ this.retryable = recoveryAvailable;
28
+ Object.defineProperty(this, "cause", { value: cause, configurable: true });
29
+ }
30
+ }, _class);
31
+ var AuthError = class extends _chunk7P5AA3SNjs.DeeplineError {
32
+ /** Constructed by the SDK when Deepline rejects the caller's credentials. */
33
+ constructor(message = "Authentication failed. Check your DEEPLINE_API_KEY.") {
34
+ super(message, 401, "AUTH_ERROR");
35
+ this.name = "AuthError";
36
+ }
37
+ };
38
+ var RateLimitError = class extends _chunk7P5AA3SNjs.DeeplineError {
39
+ /** Milliseconds to wait before retrying, from the `Retry-After` response header. Defaults to 5000. */
40
+
41
+ /** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
42
+ constructor(retryAfterMs = 5e3, message) {
43
+ super(
44
+ _nullishCoalesce(message, () => ( `Rate limited. Retry after ${retryAfterMs}ms.`)),
45
+ 429,
46
+ "RATE_LIMIT"
47
+ );
48
+ this.name = "RateLimitError";
49
+ this.retryAfterMs = retryAfterMs;
50
+ }
51
+ };
52
+ var ToolRateLimitError = class extends RateLimitError {
53
+ /** Public tool id passed to `tools.execute`. */
54
+
55
+ /** Provider responsible for the operation, or `null`. */
56
+
57
+ /** Provider operation name, or `null`. */
58
+
59
+ /** Stable machine-readable failure code when one exists. */
60
+
61
+ /** Boundary responsible for the failure. */
62
+
63
+ /** Stable reason family for policy and diagnostics. */
64
+
65
+ /** Whether repeating the same semantic call is delivery-safe. */
66
+
67
+ /** Provider or Deepline request id, or `null`. */
68
+
69
+ /** Network failure kind, or `null` for non-network failures. */
70
+
71
+ /** Network boundary that failed, or `null` for non-network failures. */
72
+
73
+ /** Explicitly allowlisted diagnostics safe for SDK callers. */
74
+
75
+ /** Constructed by the SDK after a structured tool HTTP 429. */
76
+ constructor(message, options) {
77
+ super(_nullishCoalesce(options.retryAfterMs, () => ( 5e3)), message);
78
+ this.name = "ToolRateLimitError";
79
+ this.statusCode = _nullishCoalesce(options.statusCode, () => ( 429));
80
+ this.code = _nullishCoalesce(options.code, () => ( void 0));
81
+ this.toolId = options.toolId;
82
+ this.provider = options.provider;
83
+ this.operation = options.operation;
84
+ this.origin = options.origin;
85
+ this.category = options.category;
86
+ this.retryable = options.retryable;
87
+ this.requestId = options.requestId;
88
+ this.networkKind = options.networkKind;
89
+ this.networkScope = options.networkScope;
90
+ this.publicDetails = _nullishCoalesce(options.publicDetails, () => ( null));
91
+ this.details = options.details;
92
+ _chunk7P5AA3SNjs.brandAsToolExecutionError.call(void 0, this);
93
+ if (_chunk7P5AA3SNjs.isProviderTransientFailure.call(void 0, this)) {
94
+ _chunk7P5AA3SNjs.brandAsProviderTransientError.call(void 0, this);
95
+ }
96
+ }
97
+ };
98
+ var ConfigError = class extends _chunk7P5AA3SNjs.DeeplineError {
99
+ /** Construct a local SDK configuration failure. */
100
+ constructor(message) {
101
+ super(message, void 0, "CONFIG_ERROR");
102
+ this.name = "ConfigError";
103
+ }
104
+ };
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ exports.CustomerDbQueryOutcomeUnknownError = CustomerDbQueryOutcomeUnknownError; exports.AuthError = AuthError; exports.RateLimitError = RateLimitError; exports.ToolRateLimitError = ToolRateLimitError; exports.ConfigError = ConfigError;
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
4
 
5
5
 
6
+ var _chunk7DRPTGCKjs = require('./chunk-7DRPTGCK.js');
6
7
 
7
- var _chunk2VOLOWYZjs = require('./chunk-2VOLOWYZ.js');
8
8
 
9
9
 
10
10
 
@@ -13,37 +13,10 @@ var _chunk2VOLOWYZjs = require('./chunk-2VOLOWYZ.js');
13
13
 
14
14
 
15
15
 
16
-
17
-
18
-
19
- var _chunkNSOTASOPjs = require('./chunk-NSOTASOP.js');
20
- require('./chunk-AID3OYVJ.js');
21
- require('./chunk-KAEZNPUM.js');
22
- require('./chunk-LWERJUKN.js');
23
- require('./chunk-KB4SDX5S.js');
24
-
25
-
26
- var _chunkWQJJNIMQjs = require('./chunk-WQJJNIMQ.js');
27
- require('./chunk-S6R3OX7B.js');
28
- require('./chunk-UHNDVD3P.js');
29
- require('./chunk-KXMNM4AQ.js');
30
- require('./chunk-XDVT3GOM.js');
31
- require('./chunk-QJBJZVG6.js');
32
-
33
-
34
- var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
35
- require('./chunk-V7UP2F4U.js');
36
- require('./chunk-XNYIZMNQ.js');
16
+ var _chunkBQR6UN3Cjs = require('./chunk-BQR6UN3C.js');
37
17
 
38
18
 
39
19
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
40
- require('./chunk-GNN4MY5X.js');
41
- require('./chunk-OG64RBAC.js');
42
- require('./chunk-COGTRVWW.js');
43
-
44
- // src/cli/commands/describe.ts
45
- var _fs = require('fs');
46
- var _path = require('path');
47
20
 
48
21
  // src/cli/tool-features.ts
49
22
  var VIEWS = {
@@ -58,13 +31,13 @@ var VIEWS = {
58
31
  details: model,
59
32
  lines: [
60
33
  ...unlisted,
61
- ..._chunk2VOLOWYZjs.formatModelDescription.call(void 0, model).trimEnd().split("\n")
34
+ ..._chunk7DRPTGCKjs.formatModelDescription.call(void 0, model).trimEnd().split("\n")
62
35
  ]
63
36
  };
64
37
  },
65
38
  byok: async (_value, tool) => ({
66
39
  details: _nullishCoalesce(tool.byok, () => ( {})),
67
- lines: _chunkNSOTASOPjs.byokLines.call(void 0, _nullishCoalesce(tool.byok, () => ( {})))
40
+ lines: _chunkBQR6UN3Cjs.byokLines.call(void 0, _nullishCoalesce(tool.byok, () => ( {})))
68
41
  })
69
42
  };
70
43
  var isFeatureView = (value) => typeof value === "string" && Object.hasOwn(VIEWS, value);
@@ -115,6 +88,24 @@ var FILTER_OF = {
115
88
  prebuilt_play: "prebuilts",
116
89
  custom_play: "custom"
117
90
  };
91
+ async function found(lookup) {
92
+ try {
93
+ return await lookup;
94
+ } catch (error) {
95
+ if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
96
+ return null;
97
+ }
98
+ throw error;
99
+ }
100
+ }
101
+ function describeLookupsFor(client) {
102
+ return {
103
+ play: (reference) => found(client.describePlay(reference)),
104
+ tool: (name) => found(client.getTool(name)),
105
+ describeModel: (model) => client.describeModel(model),
106
+ baseUrl: client.baseUrl
107
+ };
108
+ }
118
109
  async function describeName(name, options, lookups) {
119
110
  const maintainedOnly = options.prebuilt === true || options.tool === true;
120
111
  const wants = (filter) => (!options.kinds || options.kinds.includes(filter)) && !(maintainedOnly && filter === "custom");
@@ -122,7 +113,7 @@ async function describeName(name, options, lookups) {
122
113
  const record2 = await lookups.play(reference);
123
114
  if (!record2) return null;
124
115
  return {
125
- described: _chunkNSOTASOPjs.describedPlay.call(void 0, record2),
116
+ described: _chunkBQR6UN3Cjs.describedPlay.call(void 0, record2),
126
117
  record: { ...record2 },
127
118
  schemas: {
128
119
  inputSchema: _nullishCoalesce(record2.inputSchema, () => ( null)),
@@ -137,18 +128,18 @@ async function describeName(name, options, lookups) {
137
128
  const features = toolFeatures(record2);
138
129
  return {
139
130
  described: {
140
- ..._chunk2VOLOWYZjs.describedTool.call(void 0, record2, name),
131
+ ..._chunk7DRPTGCKjs.describedTool.call(void 0, record2, name),
141
132
  // Shown when the tool runs only on your own credentials; otherwise
142
133
  // it is a feature, described with --feature byok.
143
134
  ..._optionalChain([byok, 'optionalAccess', _3 => _3.required]) === true ? { byok } : {},
144
135
  ...features.length ? { features: features.map(({ view: _view, ...feature }) => feature) } : {}
145
136
  },
146
- record: _chunk2VOLOWYZjs.toolMetadataJsonForDescribe.call(void 0,
137
+ record: _chunk7DRPTGCKjs.toolMetadataJsonForDescribe.call(void 0,
147
138
  record2,
148
139
  name,
149
140
  lookups.seedStarterScript
150
141
  ),
151
- schemas: _chunk2VOLOWYZjs.publicToolSchemas.call(void 0, record2),
142
+ schemas: _chunk7DRPTGCKjs.publicToolSchemas.call(void 0, record2),
152
143
  feature: (featureName, value) => {
153
144
  const feature = features.find(({ name: name2 }) => name2 === featureName);
154
145
  return feature ? describeFeature(record2, feature, value, {
@@ -179,7 +170,7 @@ async function describeName(name, options, lookups) {
179
170
  const note = shadows ? `Showing your workspace play "${name}". It has the same name as a Deepline ${shadows.kind.replace("_", " ")}; see that one with: ${shadows.describeCommand}` : null;
180
171
  const verbose = options.verbose === true;
181
172
  const isPlay = described.kind === "prebuilt_play" || described.kind === "custom_play";
182
- const dashboardUrl = isPlay ? _chunkNSOTASOPjs.buildPlayDashboardUrl.call(void 0, lookups.baseUrl, described.id) : null;
173
+ const dashboardUrl = isPlay ? _chunkBQR6UN3Cjs.buildPlayDashboardUrl.call(void 0, lookups.baseUrl, described.id) : null;
183
174
  if (options.webUrl) {
184
175
  if (!dashboardUrl) {
185
176
  return {
@@ -243,7 +234,7 @@ async function describeName(name, options, lookups) {
243
234
  },
244
235
  lines: [
245
236
  `${described.id} [${described.kind.replace("_", " ")}]`,
246
- ..._chunkNSOTASOPjs.schemaLines.call(void 0, described, {
237
+ ..._chunkBQR6UN3Cjs.schemaLines.call(void 0, described, {
247
238
  full: true,
248
239
  secondary: true,
249
240
  ...fields.length ? { fields } : {}
@@ -252,17 +243,17 @@ async function describeName(name, options, lookups) {
252
243
  } : {
253
244
  envelope: {
254
245
  ...summary,
255
- inputs: inputs.map(_chunkNSOTASOPjs.topLevelField),
256
- outputs: outputs.map(_chunkNSOTASOPjs.topLevelField),
257
- ...described.rowInputs ? { rowInputs: described.rowInputs.map(_chunkNSOTASOPjs.topLevelField) } : {},
258
- ...described.rowOutputs ? { rowOutputs: described.rowOutputs.map(_chunkNSOTASOPjs.topLevelField) } : {},
259
- runExamples: _chunkNSOTASOPjs.examples.call(void 0, described, { verbose }),
246
+ inputs: inputs.map(_chunkBQR6UN3Cjs.topLevelField),
247
+ outputs: outputs.map(_chunkBQR6UN3Cjs.topLevelField),
248
+ ...described.rowInputs ? { rowInputs: described.rowInputs.map(_chunkBQR6UN3Cjs.topLevelField) } : {},
249
+ ...described.rowOutputs ? { rowOutputs: described.rowOutputs.map(_chunkBQR6UN3Cjs.topLevelField) } : {},
250
+ runExamples: _chunkBQR6UN3Cjs.examples.call(void 0, described, { verbose }),
260
251
  ...dashboardUrl ? { dashboardUrl } : {},
261
252
  ...shadows ? { shadows, note } : {}
262
253
  },
263
254
  lines: [
264
255
  ...note ? [`Note: ${note}`, ""] : [],
265
- ..._chunkNSOTASOPjs.describedLines.call(void 0, described, {
256
+ ..._chunkBQR6UN3Cjs.describedLines.call(void 0, described, {
266
257
  cli: shown && (!named || options.cliExample === true),
267
258
  play: shown && (!named || options.playExample === true),
268
259
  explain: named,
@@ -279,7 +270,7 @@ async function describeName(name, options, lookups) {
279
270
  // its value stands, so callers of the older commands read what they did.
280
271
  { ...view.envelope, ...record }
281
272
  ) : {
282
- ..._chunkNSOTASOPjs.describedJson.call(void 0, described, {
273
+ ..._chunkBQR6UN3Cjs.describedJson.call(void 0, described, {
283
274
  secondary: verbose || fields.length > 0,
284
275
  verbose
285
276
  }),
@@ -289,136 +280,7 @@ async function describeName(name, options, lookups) {
289
280
  return { status: "described", envelope, lines: view.lines };
290
281
  }
291
282
 
292
- // src/cli/commands/describe.ts
293
- async function found(lookup) {
294
- try {
295
- return await lookup;
296
- } catch (error) {
297
- if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
298
- return null;
299
- }
300
- throw error;
301
- }
302
- }
303
- async function describeAnything(name, options, onMissing) {
304
- const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
305
- const outcome = await describeName(name, options, {
306
- play: (reference) => found(client.describePlay(reference)),
307
- tool: async (toolName) => await _asyncNullishCoalesce(options.fetchedTool, async () => ( await found(client.getTool(toolName)))),
308
- describeModel: (model) => client.describeModel(model),
309
- baseUrl: client.baseUrl,
310
- seedStarterScript: _chunk2VOLOWYZjs.seedToolListScript
311
- });
312
- if (outcome.status === "missing") {
313
- if (onMissing) return onMissing();
314
- console.error(
315
- `Nothing named "${name}". Search for it: deepline search ${JSON.stringify(name.replace(/[-_./]+/g, " "))}`
316
- );
317
- return 2;
318
- }
319
- if (outcome.status === "refused") {
320
- console.error(outcome.message);
321
- return outcome.exitCode;
322
- }
323
- return deliver(outcome.envelope, outcome.lines, {
324
- json: options.json === true,
325
- out: options.out
326
- });
327
- }
328
- function deliver(envelope, lines, { json, out }) {
329
- const text = `${lines.join("\n")}
330
- `;
331
- if (out) {
332
- const path = _path.resolve.call(void 0, out);
333
- const content = json ? `${JSON.stringify(envelope, null, 2)}
334
- ` : text;
335
- _fs.writeFileSync.call(void 0, path, content);
336
- const bytes = Buffer.byteLength(content);
337
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
338
- { path, bytes },
339
- { json, text: `Wrote ${path} (${bytes} bytes)
340
- ` }
341
- );
342
- return 0;
343
- }
344
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, envelope, { json, text });
345
- return 0;
346
- }
347
- function registerDescribeCommand(program) {
348
- _chunkNSOTASOPjs.addDescribeOptions.call(void 0, program.command("describe <name>")).option("--web-url", "Print only a play's play page URL").description(
349
- "Describe anything search returns: a tool, monitor type, or play."
350
- ).addHelpText(
351
- "after",
352
- `
353
- What you can describe:
354
- Any id deepline search returns: a tool id, a monitor type id, or a play name
355
- or reference. You do not say which kind it is; tool ids, monitor type ids
356
- and prebuilt play names never overlap.
357
-
358
- When a name is taken twice:
359
- A play your workspace created is shown instead of a Deepline tool, monitor
360
- type or prebuilt play with the same name, and the output says so.
361
- Pass --prebuilt (or --tool) to see the Deepline one.
362
-
363
- What it prints:
364
- The same sections for every kind: what it is, cost, inputs, outputs, then
365
- an example of running it from the CLI and from inside a play.
366
-
367
- Examples in the output:
368
- (default) required inputs filled in, first output read
369
- --verbose every input filled in, every output read; also shows
370
- secondary fields
371
- --cli-example only the CLI example, with how inputs and outputs work
372
- --play-example only the in-play example, with how inputs and outputs work
373
- --no-example no examples
374
-
375
- Features:
376
- A tool lists its features: parts with their own description, such as the
377
- model an AI tool runs. --feature <name> describes one at its default value,
378
- --feature <name>=<value> at another, e.g. --feature model=openai/gpt-5.6-luna.
379
-
380
- Schema size and format:
381
- Secondary fields (diagnostics, attempt logs, echoes of input) are left out
382
- by default; the output names them, and --verbose shows them.
383
- --fields email,miss_reason shows only the fields you name, plus every
384
- required input, and names the rest. Use it when you know what you need.
385
- A schema over ${_chunkNSOTASOPjs.SCHEMA_LINE_LIMIT} lines is folded: deeper objects show only their field
386
- names. A shape used more than once is printed once under Types.
387
- --full-schema the normal output, with the schema not folded
388
- --schema-only only the schema, not folded, and nothing else
389
- --json the same facts as JSON: fields keyed by name, with what
390
- each means and, for a tool, where it is in the result;
391
- secondary fields are named in "hidden"
392
- --json --full-schema the whole catalog record, as tools describe and
393
- plays describe print it
394
- --schema-only --json
395
- only the input and output JSON Schemas; use this for a
396
- program, or for a schema too large to read
397
- --out <path> save any of the above to a file instead of printing it
398
-
399
- Play page:
400
- For a play, the output ends with its play page URL (JSON: dashboardUrl).
401
- --web-url print only that URL; with --json, {"dashboardUrl": ...}.
402
- Fails for a tool or monitor type, which have no play page.
403
-
404
- Older commands:
405
- deepline tools describe and deepline plays describe are this command limited
406
- to one kind. Their own flags still work: --pricing-only, --examples-only,
407
- --model and --estimate-payload on tools; --json <fields> on plays.
408
-
409
- Examples:
410
- deepline describe hunter_email_verifier
411
- deepline describe person-linkedin-to-email
412
- deepline describe my-play --prebuilt
413
- deepline describe ai_ark_people_search --full-schema
414
- deepline describe prebuilt/person-to-email-batch --web-url
415
- deepline describe ai_ark_people_search --schema-only --out schema.json
416
- `
417
- ).action(async (name, options) => {
418
- process.exitCode = await describeAnything(name, options);
419
- });
420
- }
421
283
 
422
284
 
423
285
 
424
- exports.describeAnything = describeAnything; exports.registerDescribeCommand = registerDescribeCommand;
286
+ exports.describeLookupsFor = describeLookupsFor; exports.describeName = describeName;
@@ -3,7 +3,7 @@ import {
3
3
  detectAgentRuntime,
4
4
  resolveCliCommandContext,
5
5
  resolveConfig
6
- } from "./chunk-VE3U3SQC.mjs";
6
+ } from "./chunk-2LDADJNO.mjs";
7
7
  import {
8
8
  DeeplineError,
9
9
  serializeToolExecutionFailure