deepline 0.3.395 → 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 (126) hide show
  1. package/dist/bundling-sources/sdk/src/plays/play-description.ts +1 -1
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
  4. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +2 -2
  5. package/dist/cli/{auth-NMQXZRS7.mjs → auth-AZJFXGKP.mjs} +5 -4
  6. package/dist/cli/auth-CZJQU7B5.js +40 -0
  7. package/dist/cli/{billing-Z4JTGUU3.js → billing-MQV5AGDJ.js} +77 -76
  8. package/dist/cli/{billing-5MVXZRS6.mjs → billing-MZAAUHGH.mjs} +6 -5
  9. package/dist/cli/{chunk-6D7A2FSL.mjs → chunk-2LDADJNO.mjs} +7 -107
  10. package/dist/cli/{chunk-UKU6JM3S.js → chunk-3VP34TAU.js} +8 -8
  11. package/dist/cli/{chunk-7XAM7KDW.mjs → chunk-4D745XZO.mjs} +21 -108
  12. package/dist/cli/chunk-7DRPTGCK.js +930 -0
  13. package/dist/cli/{chunk-ZMVJSS6N.js → chunk-BQR6UN3C.js} +62 -78
  14. package/dist/cli/{chunk-HRWUQJ4K.js → chunk-DQ65ZVHN.js} +6 -6
  15. package/dist/cli/{chunk-5VCZ3WRH.mjs → chunk-EIMG75BT.mjs} +1 -0
  16. package/dist/cli/{chunk-EFLQHJZ6.mjs → chunk-F3BUFYKE.mjs} +182 -1031
  17. package/dist/cli/chunk-FIVKWNMT.mjs +210 -0
  18. package/dist/cli/{describe-DBRY5BNK.mjs → chunk-HFYQBC2D.mjs} +51 -171
  19. package/dist/cli/chunk-HGFFYVXN.js +210 -0
  20. package/dist/cli/{chunk-VB6KECLU.mjs → chunk-IHG7UAHD.mjs} +63 -79
  21. package/dist/cli/{chunk-TO2MWPGR.js → chunk-IZ74ABSX.js} +1 -1
  22. package/dist/cli/{chunk-G4IWGRMK.mjs → chunk-J7ABTQQ7.mjs} +5 -3
  23. package/dist/cli/{chunk-LZLBR2SF.js → chunk-K33MXVXQ.js} +323 -1172
  24. package/dist/cli/{chunk-DRM3CMHL.js → chunk-KXMNM4AQ.js} +2 -1
  25. package/dist/cli/chunk-LJ5747UC.mjs +107 -0
  26. package/dist/cli/{chunk-BON3DRC6.mjs → chunk-MRXMMERY.mjs} +1 -1
  27. package/dist/cli/{chunk-7MVWUXOD.mjs → chunk-MV7QRALK.mjs} +3 -3
  28. package/dist/cli/{chunk-WCCKMLHL.mjs → chunk-MYPH2LUU.mjs} +2 -2
  29. package/dist/cli/{chunk-RDXFGPJU.js → chunk-NA4T3B62.js} +64 -272
  30. package/dist/cli/{chunk-BLYL3KOC.mjs → chunk-NOX2TCBP.mjs} +1 -1
  31. package/dist/cli/chunk-OSDXE27V.mjs +88 -0
  32. package/dist/cli/{chunk-R4XZO6Z5.js → chunk-PSGEDGLT.js} +28 -115
  33. package/dist/cli/chunk-Q2E4E4FJ.js +112 -0
  34. package/dist/cli/chunk-RFG3MRAC.js +286 -0
  35. package/dist/cli/{chunk-47M6HPGP.mjs → chunk-RNSWDKBM.mjs} +1 -1
  36. package/dist/cli/{chunk-56IFFVIB.js → chunk-RYW4HPSM.js} +21 -121
  37. package/dist/cli/{chunk-K5T3EN6D.js → chunk-SO7RUVTY.js} +26 -26
  38. package/dist/cli/{chunk-KZZC33PY.mjs → chunk-TXZVVBQZ.mjs} +63 -271
  39. package/dist/cli/{chunk-36ML3YKA.js → chunk-UVXBVUZQ.js} +15 -13
  40. package/dist/cli/{chunk-PZ5BZ76S.js → chunk-VTF4RRWJ.js} +50 -50
  41. package/dist/cli/{chunk-3TRY7KAC.mjs → chunk-W3HMGKMI.mjs} +2 -2
  42. package/dist/cli/{chunk-ZWH2TFA7.mjs → chunk-WM2QEHZL.mjs} +2 -2
  43. package/dist/cli/chunk-YHPYUZZX.mjs +112 -0
  44. package/dist/cli/chunk-YHZUZO3U.mjs +930 -0
  45. package/dist/cli/{chunk-UCXK2DS4.js → chunk-YLRME7MK.js} +15 -15
  46. package/dist/cli/{chunk-MYIBHORT.js → chunk-YSVORIEW.js} +2 -2
  47. package/dist/cli/{chunk-OCSG6X67.mjs → chunk-YUDKBQUD.mjs} +4 -4
  48. package/dist/cli/chunk-ZAAKSJAS.js +88 -0
  49. package/dist/cli/{chunk-VYLJJQ7Y.js → chunk-ZHUMDMOS.js} +65 -65
  50. package/dist/cli/chunk-ZM2YPJQJ.js +107 -0
  51. package/dist/cli/{csv-HTS5ZYQ4.js → csv-AQBQ5O3I.js} +13 -12
  52. package/dist/cli/{csv-SVOD5UBH.mjs → csv-MB7PJMYQ.mjs} +4 -3
  53. package/dist/cli/{db-7AP4P52N.js → db-JPUYC5RB.js} +31 -30
  54. package/dist/cli/{db-7QLNI3Q4.mjs → db-L5IEI2AU.mjs} +6 -5
  55. package/dist/cli/describe-6WT74AOR.js +164 -0
  56. package/dist/cli/describe-S6BFANVI.mjs +164 -0
  57. package/dist/cli/describe-core.d.mts +100 -0
  58. package/dist/cli/describe-core.d.ts +100 -0
  59. package/dist/cli/describe-core.js +18 -0
  60. package/dist/cli/describe-core.mjs +18 -0
  61. package/dist/cli/{executions-GRQXTB2P.js → executions-6TMQTFP4.js} +8 -7
  62. package/dist/cli/{executions-QNZTPNG4.mjs → executions-L7I2ZW4Z.mjs} +6 -5
  63. package/dist/cli/{feedback-JMCSR624.mjs → feedback-DSJ63HK6.mjs} +4 -3
  64. package/dist/cli/{feedback-ZOLA2KY7.js → feedback-XF7CQGMD.js} +8 -7
  65. package/dist/cli/{git-LJGL2IHS.mjs → git-C3ENM67D.mjs} +5 -4
  66. package/dist/cli/git-HYDZK2QR.js +24 -0
  67. package/dist/cli/index.js +96 -94
  68. package/dist/cli/index.mjs +41 -39
  69. package/dist/cli/{legacy-noops-YSCIR2SD.js → legacy-noops-B2NHWIVD.js} +8 -7
  70. package/dist/cli/{legacy-noops-F23PKVBN.mjs → legacy-noops-VFG2K6HK.mjs} +5 -4
  71. package/dist/cli/{monitors-WMZ6HJZX.js → monitors-ORFWOVZB.js} +87 -86
  72. package/dist/cli/{monitors-S4LOEL7W.mjs → monitors-TCEDBDGY.mjs} +6 -5
  73. package/dist/cli/{org-U3WA2NQM.mjs → org-45KREIKZ.mjs} +6 -5
  74. package/dist/cli/{org-PFHM5ZLY.js → org-T74CJESN.js} +66 -65
  75. package/dist/cli/{chunk-XMAPE2KH.mjs → play-MU7MYBIM.mjs} +78 -131
  76. package/dist/cli/{chunk-4KLCLLTO.js → play-XHK2LPON.js} +273 -326
  77. package/dist/cli/{providers-XYMHLKCA.js → providers-4MGQKYFD.js} +9 -8
  78. package/dist/cli/{providers-QBBRFBOH.mjs → providers-VYCXIJT5.mjs} +6 -5
  79. package/dist/cli/{quickstart-IYGD6ZY3.js → quickstart-47G3VEOT.js} +6 -5
  80. package/dist/cli/{quickstart-5JTDGISY.mjs → quickstart-H724EFM2.mjs} +4 -3
  81. package/dist/cli/search-3356ENLD.js +30 -0
  82. package/dist/cli/{search-X6W6GRHS.mjs → search-VQHXEFQ4.mjs} +8 -6
  83. package/dist/cli/{secrets-UHG6OQFD.js → secrets-ALLKCU35.js} +15 -14
  84. package/dist/cli/{secrets-N55B67H6.mjs → secrets-CPBNGA44.mjs} +6 -5
  85. package/dist/cli/{sessions-JTRSTDSS.mjs → sessions-7RSQB7IX.mjs} +5 -4
  86. package/dist/cli/sessions-FKGAY7WQ.js +16 -0
  87. package/dist/cli/{settings-Q24HRAQI.mjs → settings-UYSGV4IC.mjs} +9 -8
  88. package/dist/cli/{settings-ATX4U5AS.js → settings-Y5BI42P7.js} +76 -75
  89. package/dist/cli/{setup-77ZWLVHT.mjs → setup-L3ZBBTS4.mjs} +7 -6
  90. package/dist/cli/{setup-EJCNOUCE.js → setup-VXQPEU3E.js} +42 -41
  91. package/dist/cli/skills-DUZQTDTE.js +29 -0
  92. package/dist/cli/{skills-XIS5AWQI.mjs → skills-QHVDLSFE.mjs} +5 -4
  93. package/dist/cli/{tools-WCKLYEGQ.mjs → tools-LSCEK4K2.mjs} +16 -19
  94. package/dist/cli/tools-YWU5QOQ5.js +39 -0
  95. package/dist/cli/update-5LYQAI55.js +29 -0
  96. package/dist/cli/{update-UT5WANMV.mjs → update-CU22OTBM.mjs} +7 -6
  97. package/dist/cli/{workflow-226QYUN2.js → workflow-ERFLTRNX.js} +17 -16
  98. package/dist/cli/{workflow-ZMX3L4ML.mjs → workflow-KQARK5BZ.mjs} +7 -6
  99. package/dist/{client-hdFtwhTm.d.mts → client-D0j-_aaa.d.mts} +2 -1
  100. package/dist/{client-CivP-PAI.d.ts → client-DflfVyj6.d.ts} +2 -1
  101. package/dist/index.d.mts +2 -2
  102. package/dist/index.d.ts +2 -2
  103. package/dist/index.js +15 -11
  104. package/dist/index.mjs +19 -15
  105. package/dist/install-integrity.json +94 -80
  106. package/dist/plays/play-description.d.mts +1 -1
  107. package/dist/plays/play-description.d.ts +1 -1
  108. package/dist/plays/play-description.js +4 -2
  109. package/dist/plays/play-description.mjs +3 -1
  110. package/dist/plays/run-request.d.mts +1 -1
  111. package/dist/plays/run-request.d.ts +1 -1
  112. package/dist/release.d.mts +1 -1
  113. package/dist/release.d.ts +1 -1
  114. package/dist/release.js +2 -2
  115. package/dist/release.mjs +1 -1
  116. package/package.json +6 -1
  117. package/dist/cli/auth-UYCOBAL5.js +0 -39
  118. package/dist/cli/describe-YKOE54ZO.js +0 -406
  119. package/dist/cli/git-EJQLRK27.js +0 -23
  120. package/dist/cli/play-AGSECQFN.mjs +0 -159
  121. package/dist/cli/play-BR2LWGXK.js +0 -159
  122. package/dist/cli/search-ZVSYH5GY.js +0 -28
  123. package/dist/cli/sessions-57L5MGHN.js +0 -15
  124. package/dist/cli/skills-SPXUBLII.js +0 -28
  125. package/dist/cli/tools-DBHUUZJX.js +0 -42
  126. package/dist/cli/update-VSNFXRHJ.js +0 -28
@@ -2,10 +2,10 @@ import {
2
2
  DeeplineClient,
3
3
  iterateCursorPages,
4
4
  requireBillingIdempotencyKey
5
- } from "./chunk-G4IWGRMK.mjs";
5
+ } from "./chunk-J7ABTQQ7.mjs";
6
6
  import "./chunk-6IKARAYD.mjs";
7
7
  import "./chunk-JI2B4RZP.mjs";
8
- import "./chunk-5VCZ3WRH.mjs";
8
+ import "./chunk-EIMG75BT.mjs";
9
9
  import "./chunk-UBKA33KY.mjs";
10
10
  import {
11
11
  createTimestampedName,
@@ -13,16 +13,17 @@ import {
13
13
  openInBrowser,
14
14
  printCommandEnvelope,
15
15
  shouldEmitJson
16
- } from "./chunk-47M6HPGP.mjs";
16
+ } from "./chunk-RNSWDKBM.mjs";
17
+ import "./chunk-2LDADJNO.mjs";
17
18
  import {
18
19
  AuthError,
19
20
  ConfigError
20
- } from "./chunk-6D7A2FSL.mjs";
21
+ } from "./chunk-YHPYUZZX.mjs";
21
22
  import "./chunk-DLIRSHV6.mjs";
22
23
  import {
23
24
  DeeplineError
24
25
  } from "./chunk-NXGCO4JB.mjs";
25
- import "./chunk-BON3DRC6.mjs";
26
+ import "./chunk-MRXMMERY.mjs";
26
27
  import "./chunk-WZYKRD7T.mjs";
27
28
  import "./chunk-KRD6H754.mjs";
28
29
 
@@ -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-BON3DRC6.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 _chunkHRWUQJ4Kjs = require('./chunk-HRWUQJ4K.js');
4
+ var _chunkDQ65ZVHNjs = require('./chunk-DQ65ZVHN.js');
5
5
 
6
6
 
7
- var _chunk56IFFVIBjs = require('./chunk-56IFFVIB.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 = _chunk56IFFVIBjs.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 } = _chunkHRWUQJ4Kjs.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
- _chunkHRWUQJ4Kjs.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
- _chunkHRWUQJ4Kjs.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
- _chunkHRWUQJ4Kjs.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
- _chunkHRWUQJ4Kjs.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-G4IWGRMK.mjs";
6
+ } from "./chunk-J7ABTQQ7.mjs";
4
7
  import {
5
8
  printCommandEnvelope,
6
9
  renderCommandEnvelopeText
7
- } from "./chunk-47M6HPGP.mjs";
10
+ } from "./chunk-RNSWDKBM.mjs";
8
11
  import {
9
12
  resolveConfig,
10
13
  sdkCliStateDirPath
11
- } from "./chunk-6D7A2FSL.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());
@@ -238,6 +138,11 @@ function rateLimitDisplay(item) {
238
138
  );
239
139
  return tightest ? `${tightest.requestsPerWindow}/${RATE_WINDOW_UNITS[tightest.windowMs] ?? `${tightest.windowMs / 1e3}s`}` : "\u2014";
240
140
  }
141
+ function failureRateDisplay(rate) {
142
+ if (typeof rate !== "number") return "\u2014";
143
+ const percent = Math.round(rate * 100);
144
+ return percent === 0 && rate > 0 ? "<1%" : `${percent}%`;
145
+ }
241
146
  function searchRow(item) {
242
147
  const { cost, notes } = pricingDisplay(item);
243
148
  const observedMax = item.billingSource === "own_provider_credentials" ? "" : observedMaxText(item.pricing);
@@ -253,6 +158,9 @@ function searchRow(item) {
253
158
  kind: item.kind,
254
159
  cost,
255
160
  rateLimit: rateLimitDisplay(item),
161
+ // Production share of errored or rate-limited calls; absent when too few
162
+ // calls or orgs used the tool to say.
163
+ failureRate: failureRateDisplay(item.failureRate),
256
164
  summary: clipSummary(item.description ?? ""),
257
165
  notes
258
166
  };
@@ -274,6 +182,13 @@ function renderSearchResults(result) {
274
182
  alignment: "right"
275
183
  }
276
184
  ] : [],
185
+ ...rows.some((row) => row.failureRate !== "\u2014") ? [
186
+ {
187
+ header: "FAILURES",
188
+ value: (row) => row.failureRate,
189
+ alignment: "right"
190
+ }
191
+ ] : [],
277
192
  { header: "SUMMARY", value: (row) => row.summary }
278
193
  ];
279
194
  const render = result.render;
@@ -468,8 +383,6 @@ Examples:
468
383
 
469
384
  export {
470
385
  recentSearchRef,
471
- observedMaxText,
472
- Capability,
473
386
  SEARCH_TYPES,
474
387
  parseTypes,
475
388
  appendCsv,