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,3 +1,9 @@
1
+ import {
2
+ AuthError,
3
+ ConfigError,
4
+ RateLimitError,
5
+ ToolRateLimitError
6
+ } from "./chunk-YHPYUZZX.mjs";
1
7
  import {
2
8
  apiErrorCodeFromResponse,
3
9
  apiErrorMessage
@@ -6,113 +12,12 @@ import {
6
12
  DeeplineError,
7
13
  TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
8
14
  ToolExecutionError,
9
- brandAsProviderTransientError,
10
- brandAsToolExecutionError,
11
15
  deserializeToolExecutionFailure,
12
- isProviderTransientFailure,
13
16
  serializeToolExecutionFailure
14
17
  } from "./chunk-NXGCO4JB.mjs";
15
18
  import {
16
19
  SDK_RELEASE
17
- } from "./chunk-NHB5YUCS.mjs";
18
-
19
- // src/errors.ts
20
- var CustomerDbQueryOutcomeUnknownError = class extends DeeplineError {
21
- outcome = "unknown";
22
- operationKey;
23
- retryable;
24
- constructor(cause, operationKey, options = {}) {
25
- const recoveryAvailable = operationKey !== void 0 && options.recoveryAvailable !== false;
26
- super(
27
- 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.",
28
- cause.statusCode,
29
- "CUSTOMER_DB_QUERY_OUTCOME_UNKNOWN",
30
- {
31
- outcome: "unknown",
32
- recovery: recoveryAvailable ? "original_operation_key" : "unavailable",
33
- causeCode: cause.code
34
- }
35
- );
36
- this.name = "CustomerDbQueryOutcomeUnknownError";
37
- this.operationKey = operationKey;
38
- this.retryable = recoveryAvailable;
39
- Object.defineProperty(this, "cause", { value: cause, configurable: true });
40
- }
41
- };
42
- var AuthError = class extends DeeplineError {
43
- /** Constructed by the SDK when Deepline rejects the caller's credentials. */
44
- constructor(message = "Authentication failed. Check your DEEPLINE_API_KEY.") {
45
- super(message, 401, "AUTH_ERROR");
46
- this.name = "AuthError";
47
- }
48
- };
49
- var RateLimitError = class extends DeeplineError {
50
- /** Milliseconds to wait before retrying, from the `Retry-After` response header. Defaults to 5000. */
51
- retryAfterMs;
52
- /** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
53
- constructor(retryAfterMs = 5e3, message) {
54
- super(
55
- message ?? `Rate limited. Retry after ${retryAfterMs}ms.`,
56
- 429,
57
- "RATE_LIMIT"
58
- );
59
- this.name = "RateLimitError";
60
- this.retryAfterMs = retryAfterMs;
61
- }
62
- };
63
- var ToolRateLimitError = class extends RateLimitError {
64
- /** Public tool id passed to `tools.execute`. */
65
- toolId;
66
- /** Provider responsible for the operation, or `null`. */
67
- provider;
68
- /** Provider operation name, or `null`. */
69
- operation;
70
- /** Stable machine-readable failure code when one exists. */
71
- code;
72
- /** Boundary responsible for the failure. */
73
- origin;
74
- /** Stable reason family for policy and diagnostics. */
75
- category;
76
- /** Whether repeating the same semantic call is delivery-safe. */
77
- retryable;
78
- /** Provider or Deepline request id, or `null`. */
79
- requestId;
80
- /** Network failure kind, or `null` for non-network failures. */
81
- networkKind;
82
- /** Network boundary that failed, or `null` for non-network failures. */
83
- networkScope;
84
- /** Explicitly allowlisted diagnostics safe for SDK callers. */
85
- publicDetails;
86
- /** Constructed by the SDK after a structured tool HTTP 429. */
87
- constructor(message, options) {
88
- super(options.retryAfterMs ?? 5e3, message);
89
- this.name = "ToolRateLimitError";
90
- this.statusCode = options.statusCode ?? 429;
91
- this.code = options.code ?? void 0;
92
- this.toolId = options.toolId;
93
- this.provider = options.provider;
94
- this.operation = options.operation;
95
- this.origin = options.origin;
96
- this.category = options.category;
97
- this.retryable = options.retryable;
98
- this.requestId = options.requestId;
99
- this.networkKind = options.networkKind;
100
- this.networkScope = options.networkScope;
101
- this.publicDetails = options.publicDetails ?? null;
102
- this.details = options.details;
103
- brandAsToolExecutionError(this);
104
- if (isProviderTransientFailure(this)) {
105
- brandAsProviderTransientError(this);
106
- }
107
- }
108
- };
109
- var ConfigError = class extends DeeplineError {
110
- /** Construct a local SDK configuration failure. */
111
- constructor(message) {
112
- super(message, void 0, "CONFIG_ERROR");
113
- this.name = "ConfigError";
114
- }
115
- };
20
+ } from "./chunk-MRXMMERY.mjs";
116
21
 
117
22
  // src/config.ts
118
23
  import {
@@ -2003,11 +1908,6 @@ ${COWORK_NETWORK_HINT}`;
2003
1908
  }
2004
1909
 
2005
1910
  export {
2006
- CustomerDbQueryOutcomeUnknownError,
2007
- AuthError,
2008
- RateLimitError,
2009
- ToolRateLimitError,
2010
- ConfigError,
2011
1911
  HOST_URL_ENV,
2012
1912
  API_KEY_ENV,
2013
1913
  ACTIVE_ORG_ID_ENV,
@@ -1,10 +1,10 @@
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
3
 
4
- var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
4
+ var _chunkDQ65ZVHNjs = require('./chunk-DQ65ZVHN.js');
5
5
 
6
6
 
7
- var _chunkV7UP2F4Ujs = require('./chunk-V7UP2F4U.js');
7
+ var _chunkRYW4HPSMjs = require('./chunk-RYW4HPSM.js');
8
8
 
9
9
  // src/cli/commands/sessions.ts
10
10
 
@@ -139,7 +139,7 @@ function currentSessionFile(agent) {
139
139
  const newestFirst = listSessionFiles(agent).sort(
140
140
  (a, b) => b.mtimeMs - a.mtimeMs
141
141
  );
142
- const sessionId = _chunkV7UP2F4Ujs.agentSessionIdFromEnvironment.call(void 0, );
142
+ const sessionId = _chunkRYW4HPSMjs.agentSessionIdFromEnvironment.call(void 0, );
143
143
  const cwd = process.cwd();
144
144
  return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(newestFirst.find((candidate) => candidate.sessionId === sessionId), () => ( newestFirst.find(
145
145
  (candidate) => sessionStartedInDirectory(candidate, cwd)
@@ -448,7 +448,7 @@ function buildSessionUploadContent(raw) {
448
448
  return { encodedContent: encoded, needsChunking: true };
449
449
  }
450
450
  async function uploadPayload(path, payload) {
451
- const { http } = _chunkRTO5QZWTjs.getAuthedHttpClient.call(void 0, );
451
+ const { http } = _chunkDQ65ZVHNjs.getAuthedHttpClient.call(void 0, );
452
452
  return await http.post(path, payload);
453
453
  }
454
454
  async function uploadChunkedSessions(sessions, options) {
@@ -481,7 +481,7 @@ async function uploadChunkedSessions(sessions, options) {
481
481
  ...options.rating ? { rating: options.rating } : {}
482
482
  });
483
483
  const sessionIds = sessions.map((session) => session.sessionId);
484
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
484
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
485
485
  {
486
486
  ...response,
487
487
  ok: true,
@@ -513,7 +513,7 @@ async function handleSessionsSend(options) {
513
513
  filename: _path.basename.call(void 0, filePath),
514
514
  ...rating ? { rating } : {}
515
515
  });
516
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
516
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
517
517
  {
518
518
  ...response2,
519
519
  ok: true,
@@ -563,7 +563,7 @@ async function handleSessionsSend(options) {
563
563
  ...rating ? { rating } : {}
564
564
  });
565
565
  const sessionIds = built.map((session) => session.sessionId);
566
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
566
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
567
567
  {
568
568
  ...response,
569
569
  ok: true,
@@ -671,7 +671,7 @@ ${refreshMeta}
671
671
  </body>
672
672
  </html>`;
673
673
  _fs.writeFileSync.call(void 0, outputPath, html, "utf8");
674
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
674
+ _chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0,
675
675
  {
676
676
  ok: true,
677
677
  file: outputPath,
@@ -1,14 +1,17 @@
1
+ import {
2
+ observedMaxText
3
+ } from "./chunk-LJ5747UC.mjs";
1
4
  import {
2
5
  DeeplineClient
3
- } from "./chunk-MR6XCBQJ.mjs";
6
+ } from "./chunk-J7ABTQQ7.mjs";
4
7
  import {
5
8
  printCommandEnvelope,
6
9
  renderCommandEnvelopeText
7
- } from "./chunk-XKZXO7D3.mjs";
10
+ } from "./chunk-RNSWDKBM.mjs";
8
11
  import {
9
12
  resolveConfig,
10
13
  sdkCliStateDirPath
11
- } from "./chunk-VE3U3SQC.mjs";
14
+ } from "./chunk-2LDADJNO.mjs";
12
15
 
13
16
  // src/cli/commands/search.ts
14
17
  import { Option } from "commander";
@@ -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
- 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
- this.#catalogEntry.deeplineCreditsPerPricingUnit ?? this.#catalogEntry.deepline_credits_per_pricing_unit
108
- );
109
- const canonicalUsd = pricingNumber(
110
- pricing,
111
- "usdPerUnit",
112
- "usd_per_unit",
113
- this.#catalogEntry.deeplineUsdPerPricingUnit ?? this.#catalogEntry.deepline_usd_per_pricing_unit
114
- );
115
- const billingSource = stringValue(
116
- this.#catalogEntry.billingSource ?? this.#catalogEntry.billing_source
117
- );
118
- const billingSourceLabel = stringValue(
119
- 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(pricing.displayText ?? pricing.display_text),
126
- summary: isFree ? null : stringValue(pricing.summary),
127
- billingMode: stringValue(
128
- 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());
@@ -483,8 +383,6 @@ Examples:
483
383
 
484
384
  export {
485
385
  recentSearchRef,
486
- observedMaxText,
487
- Capability,
488
386
  SEARCH_TYPES,
489
387
  parseTypes,
490
388
  appendCsv,