deepline 0.3.396 → 0.3.398

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 (118) 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/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +50 -26
  4. package/dist/cli/auth-3GA2ASQF.js +40 -0
  5. package/dist/cli/{auth-3LTD62VL.mjs → auth-7ZBPAAZU.mjs} +5 -4
  6. package/dist/cli/{billing-DP7ZAJBO.mjs → billing-QTWEEL27.mjs} +5 -4
  7. package/dist/cli/{billing-PA5OXEM5.js → billing-WHP3YMNQ.js} +76 -75
  8. package/dist/cli/{chunk-I4T4XAA2.mjs → chunk-2QC2T7E3.mjs} +4 -4
  9. package/dist/cli/{chunk-3T4MCB5R.mjs → chunk-52HHMLRM.mjs} +89 -969
  10. package/dist/cli/{chunk-ME6XRFLY.js → chunk-6CBU7W56.js} +15 -15
  11. package/dist/cli/{chunk-LOGGNW4H.mjs → chunk-6DVXLWPB.mjs} +2 -2
  12. package/dist/cli/{chunk-AUYXWELC.mjs → chunk-6HXULNTW.mjs} +2 -2
  13. package/dist/cli/chunk-7DRPTGCK.js +930 -0
  14. package/dist/cli/{chunk-TLQ3FZOC.mjs → chunk-ATDUVJCW.mjs} +3 -3
  15. package/dist/cli/{chunk-23GAA3YO.mjs → chunk-AWQNG55D.mjs} +1 -1
  16. package/dist/cli/{chunk-NSOTASOP.js → chunk-BQR6UN3C.js} +1 -83
  17. package/dist/cli/{chunk-XKZXO7D3.mjs → chunk-CH6EFAJ3.mjs} +1 -1
  18. package/dist/cli/{chunk-KAEZNPUM.js → chunk-CTZJLQ7A.js} +13 -115
  19. package/dist/cli/{chunk-AVHLATII.js → chunk-FDAMQFQ7.js} +50 -50
  20. package/dist/cli/chunk-FIVKWNMT.mjs +210 -0
  21. package/dist/cli/{chunk-7Z66NHUC.js → chunk-G6BP55EP.js} +26 -26
  22. package/dist/cli/{chunk-GNN4MY5X.js → chunk-HFDBZXMV.js} +1 -1
  23. package/dist/cli/{describe-6O2ENKTP.mjs → chunk-HFYQBC2D.mjs} +22 -160
  24. package/dist/cli/chunk-HGFFYVXN.js +210 -0
  25. package/dist/cli/{chunk-5WNJF2T3.mjs → chunk-IHG7UAHD.mjs} +1 -83
  26. package/dist/cli/{chunk-QHGPA362.mjs → chunk-IJU5YQSF.mjs} +6 -108
  27. package/dist/cli/{chunk-772W2SAU.js → chunk-J4WYPANC.js} +8 -8
  28. package/dist/cli/{chunk-V7UP2F4U.js → chunk-JU3PF7WM.js} +21 -121
  29. package/dist/cli/{chunk-MR6XCBQJ.mjs → chunk-LCRQKI7D.mjs} +4 -2
  30. package/dist/cli/chunk-LJ5747UC.mjs +107 -0
  31. package/dist/cli/{chunk-LWERJUKN.js → chunk-NA4T3B62.js} +7 -215
  32. package/dist/cli/{chunk-WQJJNIMQ.js → chunk-NUBIAJI2.js} +11 -9
  33. package/dist/cli/chunk-OSDXE27V.mjs +88 -0
  34. package/dist/cli/{chunk-RMTASUAK.js → chunk-OU2RZYVS.js} +65 -65
  35. package/dist/cli/{chunk-JCN4DHF7.mjs → chunk-OVUFHUMG.mjs} +2 -2
  36. package/dist/cli/chunk-Q2E4E4FJ.js +112 -0
  37. package/dist/cli/{chunk-2VOLOWYZ.js → chunk-Q3FNSWJG.js} +293 -1173
  38. package/dist/cli/{chunk-NHB5YUCS.mjs → chunk-QP2TRM7M.mjs} +1 -1
  39. package/dist/cli/{describe-EFWNECHI.js → chunk-RFG3MRAC.js} +37 -175
  40. package/dist/cli/{chunk-RTO5QZWT.js → chunk-S22ZQZMU.js} +6 -6
  41. package/dist/cli/{chunk-H5KLUGY7.mjs → chunk-TXZVVBQZ.mjs} +1 -209
  42. package/dist/cli/{chunk-DC6LTULT.js → chunk-U46S43LV.js} +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-ZAAKSJAS.js +88 -0
  46. package/dist/cli/{chunk-VE3U3SQC.mjs → chunk-ZJ7HLJRF.mjs} +7 -107
  47. package/dist/cli/chunk-ZM2YPJQJ.js +107 -0
  48. package/dist/cli/{csv-TF576S77.js → csv-NM25BBX7.js} +13 -12
  49. package/dist/cli/{csv-RLRR74RQ.mjs → csv-TSBHKVNU.mjs} +4 -3
  50. package/dist/cli/{db-FDBJUTFO.js → db-GBDNQJF3.js} +30 -29
  51. package/dist/cli/{db-XORGNBIC.mjs → db-JQN6SYLK.mjs} +5 -4
  52. package/dist/cli/describe-ETTGW5LT.mjs +164 -0
  53. package/dist/cli/describe-NVLINP5A.js +164 -0
  54. package/dist/cli/describe-core.d.mts +100 -0
  55. package/dist/cli/describe-core.d.ts +100 -0
  56. package/dist/cli/describe-core.js +18 -0
  57. package/dist/cli/describe-core.mjs +18 -0
  58. package/dist/cli/{executions-YPP7WR77.mjs → executions-6S4KIVEY.mjs} +5 -4
  59. package/dist/cli/{executions-SFYAXPF4.js → executions-IH5JUPIT.js} +7 -6
  60. package/dist/cli/{feedback-5UZFYMGB.js → feedback-ER375ZCB.js} +8 -7
  61. package/dist/cli/{feedback-RBGA5ARU.mjs → feedback-PGOZLNXU.mjs} +4 -3
  62. package/dist/cli/{git-IRSAJEK2.mjs → git-7SBFCM52.mjs} +5 -4
  63. package/dist/cli/git-W6DBPLZO.js +24 -0
  64. package/dist/cli/index.js +93 -91
  65. package/dist/cli/index.mjs +35 -33
  66. package/dist/cli/{legacy-noops-CVAOQY2F.js → legacy-noops-IOEF2SB7.js} +8 -7
  67. package/dist/cli/{legacy-noops-NA7N6ZOU.mjs → legacy-noops-Q4UQIOQN.mjs} +5 -4
  68. package/dist/cli/{monitors-4OMRXCXP.js → monitors-NZ2J4YGD.js} +86 -85
  69. package/dist/cli/{monitors-ILZ2XHYG.mjs → monitors-RZYBFY3Z.mjs} +5 -4
  70. package/dist/cli/{org-YGNJDD2X.js → org-ERUOT4B2.js} +65 -64
  71. package/dist/cli/{org-QDDXAE3J.mjs → org-JLSEM6GG.mjs} +5 -4
  72. package/dist/cli/{play-L535H26U.js → play-7TUO7YNG.js} +251 -247
  73. package/dist/cli/{play-VT6OHB2D.mjs → play-Z73VC7YR.mjs} +19 -15
  74. package/dist/cli/{providers-KG4W5MPK.mjs → providers-7HIII2PW.mjs} +5 -4
  75. package/dist/cli/{providers-GPZ6PQAL.js → providers-ABKBK2C7.js} +8 -7
  76. package/dist/cli/{quickstart-UI27S5LO.js → quickstart-JBG5RTFZ.js} +6 -5
  77. package/dist/cli/{quickstart-2JDGTXIG.mjs → quickstart-QQAOCPCZ.mjs} +4 -3
  78. package/dist/cli/{search-PW3RAUX7.mjs → search-MT2Q64WC.mjs} +7 -5
  79. package/dist/cli/search-QMQBC6SV.js +30 -0
  80. package/dist/cli/{secrets-WFAXOUZE.js → secrets-MEW6LLU5.js} +14 -13
  81. package/dist/cli/{secrets-HNOMK5A2.mjs → secrets-ZFJPIT6B.mjs} +5 -4
  82. package/dist/cli/{sessions-XLX3E5UO.mjs → sessions-F2KVVZ2Z.mjs} +5 -4
  83. package/dist/cli/sessions-TBPU4S6M.js +16 -0
  84. package/dist/cli/{settings-GADAG2UK.js → settings-6VDZ6G5V.js} +75 -74
  85. package/dist/cli/{settings-YNZ4YKCH.mjs → settings-LUDDM7HO.mjs} +8 -7
  86. package/dist/cli/{setup-R5YO7GT6.js → setup-IP2KTFYO.js} +42 -41
  87. package/dist/cli/{setup-PSEHIUXO.mjs → setup-MCEY473G.mjs} +7 -6
  88. package/dist/cli/skills-EVIIEX6N.js +29 -0
  89. package/dist/cli/{skills-LTQBP6CZ.mjs → skills-KMJ3CY4O.mjs} +5 -4
  90. package/dist/cli/tools-KNLHQ3L6.js +39 -0
  91. package/dist/cli/{tools-UAXDWU63.mjs → tools-WY3PLUA7.mjs} +13 -8
  92. package/dist/cli/update-LVADY5YE.js +29 -0
  93. package/dist/cli/{update-SMNIBIMS.mjs → update-XBV52OFM.mjs} +7 -6
  94. package/dist/cli/{workflow-IKGMBGF6.mjs → workflow-5N5HMYDY.mjs} +6 -5
  95. package/dist/cli/{workflow-AOQVZHMD.js → workflow-CO7XWS4D.js} +16 -15
  96. package/dist/{client-DiGl8ska.d.mts → client-D0j-_aaa.d.mts} +1 -1
  97. package/dist/{client-Bgis7F6-.d.ts → client-DflfVyj6.d.ts} +1 -1
  98. package/dist/index.d.mts +2 -2
  99. package/dist/index.d.ts +2 -2
  100. package/dist/index.js +14 -10
  101. package/dist/index.mjs +19 -15
  102. package/dist/install-integrity.json +92 -76
  103. package/dist/plays/play-description.d.mts +1 -1
  104. package/dist/plays/play-description.d.ts +1 -1
  105. package/dist/plays/run-request.d.mts +1 -1
  106. package/dist/plays/run-request.d.ts +1 -1
  107. package/dist/release.d.mts +1 -1
  108. package/dist/release.d.ts +1 -1
  109. package/dist/release.js +2 -2
  110. package/dist/release.mjs +1 -1
  111. package/package.json +6 -1
  112. package/dist/cli/auth-562JPKOM.js +0 -39
  113. package/dist/cli/git-5LDY5ZID.js +0 -23
  114. package/dist/cli/search-MGWROZ33.js +0 -28
  115. package/dist/cli/sessions-366KROUA.js +0 -15
  116. package/dist/cli/skills-JF2LPEGM.js +0 -28
  117. package/dist/cli/tools-CP2PEFRN.js +0 -34
  118. package/dist/cli/update-HZHZOU6C.js +0 -28
@@ -0,0 +1,88 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkBQR6UN3Cjs = require('./chunk-BQR6UN3C.js');
4
+
5
+ // src/cli/describe-options.ts
6
+ function addDescribeOptions(command, options = {}) {
7
+ command.option(
8
+ "--prebuilt",
9
+ "Show the Deepline tool or play, not a play your workspace created under the same name"
10
+ ).option("--tool", "Same as --prebuilt").option(
11
+ "--verbose",
12
+ "Show secondary fields, and fill in every input and read every output in the examples"
13
+ ).option(
14
+ "--cli-example",
15
+ "Show only the CLI example, and explain how it takes inputs and returns outputs"
16
+ ).option(
17
+ "--play-example",
18
+ "Show only the in-play example, and explain how it takes inputs and returns outputs"
19
+ ).option("--no-example", "Hide the run examples").option(
20
+ "--full-schema",
21
+ `Print every field: a long schema unfolded (over ${_chunkBQR6UN3Cjs.SCHEMA_LINE_LIMIT} lines), list rows, and a tool's raw response`
22
+ ).option(
23
+ "--fields <names>",
24
+ "Show only these fields, comma-separated, plus every required input"
25
+ ).option(
26
+ "--feature <name[=value]>",
27
+ "Describe one feature of a tool, such as a model: --feature model=openai/gpt-5.6-luna. A tool lists its features."
28
+ ).option(
29
+ "-o, --out <path>",
30
+ "Save the output to this file instead of printing it"
31
+ );
32
+ if (options.schemaOnly !== false) {
33
+ command.option(
34
+ "--schema-only",
35
+ "Print only the schema, with every field, and nothing else"
36
+ );
37
+ }
38
+ if (options.json !== false) {
39
+ command.option(
40
+ "--json",
41
+ "Print JSON instead of text; with --schema-only, only the input and output JSON Schemas"
42
+ );
43
+ }
44
+ return command;
45
+ }
46
+
47
+ // src/cli/execution-observation.ts
48
+ var _fs = require('fs');
49
+ function writeObservation(observation) {
50
+ const path = process.env.DEEPLINE_EXECUTION_OBSERVATION_PATH;
51
+ const invocationId = process.env.DEEPLINE_EXECUTION_OBSERVATION_ID;
52
+ if (!path || !invocationId) return;
53
+ const pending = `${path}.pending`;
54
+ _fs.writeFileSync.call(void 0,
55
+ pending,
56
+ JSON.stringify({
57
+ schema_version: 1,
58
+ invocation_id: invocationId,
59
+ ...observation
60
+ }),
61
+ { mode: 384 }
62
+ );
63
+ _fs.renameSync.call(void 0, pending, path);
64
+ }
65
+ function recordApiResponse(observation) {
66
+ writeObservation({
67
+ kind: "api_response",
68
+ received_at_ms: observation.receivedAtMs,
69
+ state: observation.state,
70
+ http_status: observation.httpStatus
71
+ });
72
+ }
73
+ function recordPlayTermination(run) {
74
+ if (typeof run.id !== "string" || !["completed", "failed", "cancelled", "canceled"].includes(
75
+ String(run.status)
76
+ ) || typeof run.finishedAt !== "number" || !Number.isSafeInteger(run.finishedAt) || run.finishedAt <= 0)
77
+ return;
78
+ writeObservation({
79
+ kind: "play_terminal",
80
+ run: { id: run.id, status: run.status, finishedAt: run.finishedAt }
81
+ });
82
+ }
83
+
84
+
85
+
86
+
87
+
88
+ exports.addDescribeOptions = addDescribeOptions; exports.recordApiResponse = recordApiResponse; exports.recordPlayTermination = recordPlayTermination;
@@ -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-QP2TRM7M.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,
@@ -0,0 +1,107 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/cli/tool-description.ts
2
+ function observedMaxText(pricing) {
3
+ const max = recordValue(recordValue(pricing).observedMax);
4
+ return typeof max.creditsPerCall === "number" && max.creditsPerCall > 0 ? `max observed ${max.creditsPerCall} credits/call (last ${String(max.windowDays)} days)` : "";
5
+ }
6
+ var Capability = class _Capability {
7
+ #catalogEntry;
8
+ constructor(catalogEntry) {
9
+ this.#catalogEntry = catalogEntry;
10
+ }
11
+ static fromCatalogEntry(catalogEntry) {
12
+ return new _Capability(catalogEntry);
13
+ }
14
+ describe() {
15
+ return CapabilityDescription.fromCatalogEntry(this.#catalogEntry);
16
+ }
17
+ };
18
+ var CapabilityDescription = class _CapabilityDescription {
19
+ #catalogEntry;
20
+ constructor(catalogEntry) {
21
+ this.#catalogEntry = catalogEntry;
22
+ }
23
+ static fromCatalogEntry(catalogEntry) {
24
+ return new _CapabilityDescription(catalogEntry);
25
+ }
26
+ /**
27
+ * The customer price already resolved by the catalog. This intentionally
28
+ * omits provider-price fields, even when a catalog Adapter carried them.
29
+ */
30
+ customerCost() {
31
+ const legacyCost = recordValue(this.#catalogEntry.cost);
32
+ const pricing = recordValue(this.#catalogEntry.pricing);
33
+ const unit = stringValue(pricing.unit);
34
+ const legacyPricingModel = stringValue(
35
+ _nullishCoalesce(legacyCost.pricingModel, () => ( legacyCost.pricing_model))
36
+ );
37
+ const pricingModel = unit === "call" ? "fixed" : unit === "result" || unit === "page" ? `per_${unit}` : unit === "usage" ? "provider_usage" : legacyPricingModel;
38
+ const canonicalCredits = pricingNumber(
39
+ pricing,
40
+ "creditsPerUnit",
41
+ "credits_per_unit",
42
+ _nullishCoalesce(this.#catalogEntry.deeplineCreditsPerPricingUnit, () => ( this.#catalogEntry.deepline_credits_per_pricing_unit))
43
+ );
44
+ const canonicalUsd = pricingNumber(
45
+ pricing,
46
+ "usdPerUnit",
47
+ "usd_per_unit",
48
+ _nullishCoalesce(this.#catalogEntry.deeplineUsdPerPricingUnit, () => ( this.#catalogEntry.deepline_usd_per_pricing_unit))
49
+ );
50
+ const billingSource = stringValue(
51
+ _nullishCoalesce(this.#catalogEntry.billingSource, () => ( this.#catalogEntry.billing_source))
52
+ );
53
+ const billingSourceLabel = stringValue(
54
+ _nullishCoalesce(this.#catalogEntry.billingSourceLabel, () => ( this.#catalogEntry.billing_source_label))
55
+ );
56
+ const isFree = billingSource === "free";
57
+ return {
58
+ pricingModel: pricingModel || null,
59
+ unit: unit || null,
60
+ displayText: isFree ? "Free" : stringValue(_nullishCoalesce(pricing.displayText, () => ( pricing.display_text))),
61
+ summary: isFree ? null : stringValue(pricing.summary),
62
+ billingMode: stringValue(
63
+ _nullishCoalesce(legacyCost.billingMode, () => ( legacyCost.billing_mode))
64
+ ),
65
+ billingSource,
66
+ billingSourceLabel,
67
+ deeplineCreditsPerPricingUnit: isFree ? 0 : canonicalCredits,
68
+ deeplineUsdPerPricingUnit: isFree ? 0 : canonicalUsd,
69
+ ...pricing.estimatedRange && !isFree && billingSource !== "own_provider_credentials" ? {
70
+ estimatedRange: pricing.estimatedRange,
71
+ details: Array.isArray(pricing.details) ? pricing.details.filter(
72
+ (value) => typeof value === "string"
73
+ ) : []
74
+ } : {},
75
+ ...pricing.observedReference && !isFree && billingSource !== "own_provider_credentials" ? {
76
+ observedReference: pricing.observedReference,
77
+ details: Array.isArray(pricing.details) ? pricing.details.filter(
78
+ (value) => typeof value === "string"
79
+ ) : []
80
+ } : {},
81
+ ...pricing.observedMax && !isFree && billingSource !== "own_provider_credentials" ? {
82
+ observedMax: pricing.observedMax
83
+ } : {}
84
+ };
85
+ }
86
+ };
87
+ function recordValue(value) {
88
+ return value && typeof value === "object" && !Array.isArray(value) ? value : {};
89
+ }
90
+ function stringValue(value) {
91
+ return typeof value === "string" && value.trim() ? value : null;
92
+ }
93
+ function numberValue(value) {
94
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
95
+ }
96
+ function pricingNumber(pricing, canonicalKey, aliasKey, legacyValue) {
97
+ for (const key of [canonicalKey, aliasKey]) {
98
+ if (Object.prototype.hasOwnProperty.call(pricing, key))
99
+ return numberValue(pricing[key]);
100
+ }
101
+ return numberValue(legacyValue);
102
+ }
103
+
104
+
105
+
106
+
107
+ exports.observedMaxText = observedMaxText; exports.Capability = Capability;
@@ -4,11 +4,12 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
8
- require('./chunk-V7UP2F4U.js');
7
+ var _chunkS22ZQZMUjs = require('./chunk-S22ZQZMU.js');
8
+ require('./chunk-JU3PF7WM.js');
9
+ require('./chunk-Q2E4E4FJ.js');
9
10
  require('./chunk-XNYIZMNQ.js');
10
11
  require('./chunk-7P5AA3SN.js');
11
- require('./chunk-GNN4MY5X.js');
12
+ require('./chunk-HFDBZXMV.js');
12
13
  require('./chunk-OG64RBAC.js');
13
14
  require('./chunk-COGTRVWW.js');
14
15
 
@@ -126,7 +127,7 @@ function renderTable(rows, totalRows, verbose, footer = `showing ${rows.length}
126
127
  column.length,
127
128
  ...rows.map((row) => {
128
129
  const value = _nullishCoalesce(row[column], () => ( ""));
129
- return (verbose ? value : _chunkRTO5QZWTjs.clip.call(void 0, value, 42)).length;
130
+ return (verbose ? value : _chunkS22ZQZMUjs.clip.call(void 0, value, 42)).length;
130
131
  })
131
132
  )
132
133
  ])
@@ -136,7 +137,7 @@ function renderTable(rows, totalRows, verbose, footer = `showing ${rows.length}
136
137
  const body = rows.map(
137
138
  (row) => columns.map((column) => {
138
139
  const raw = _nullishCoalesce(row[column], () => ( ""));
139
- const display = verbose ? raw : _chunkRTO5QZWTjs.clip.call(void 0, raw, 42);
140
+ const display = verbose ? raw : _chunkS22ZQZMUjs.clip.call(void 0, raw, 42);
140
141
  return display.padEnd(widths[column]);
141
142
  }).join(" | ")
142
143
  );
@@ -156,7 +157,7 @@ async function handleCsvShow(path, options, command) {
156
157
  { exitCode: 2 }
157
158
  );
158
159
  }
159
- const allRows = _chunkRTO5QZWTjs.readCsvRows.call(void 0, csvPath);
160
+ const allRows = _chunkS22ZQZMUjs.readCsvRows.call(void 0, csvPath);
160
161
  const [rowStart, rowEnd] = parseRowRange(options.rows);
161
162
  const rows = options.summary && options.rows === void 0 ? allRows : selectRows(allRows, rowStart, rowEnd);
162
163
  const { rows: selected, columns } = selectColumns(
@@ -169,7 +170,7 @@ async function handleCsvShow(path, options, command) {
169
170
  if (options.summary) {
170
171
  const summaries = summarizeColumns(selected, columns);
171
172
  if (format === "json") {
172
- _chunkRTO5QZWTjs.printJson.call(void 0, {
173
+ _chunkS22ZQZMUjs.printJson.call(void 0, {
173
174
  rows: summaries,
174
175
  total_rows: selected.length,
175
176
  source_total_rows: allRows.length
@@ -178,7 +179,7 @@ async function handleCsvShow(path, options, command) {
178
179
  }
179
180
  const displayRows = summaryDisplayRows(summaries);
180
181
  if (format === "csv") {
181
- process.stdout.write(_chunkRTO5QZWTjs.csvStringFromRows.call(void 0, displayRows));
182
+ process.stdout.write(_chunkS22ZQZMUjs.csvStringFromRows.call(void 0, displayRows));
182
183
  return;
183
184
  }
184
185
  process.stdout.write(
@@ -193,7 +194,7 @@ async function handleCsvShow(path, options, command) {
193
194
  return;
194
195
  }
195
196
  if (format === "json") {
196
- _chunkRTO5QZWTjs.printJson.call(void 0, {
197
+ _chunkS22ZQZMUjs.printJson.call(void 0, {
197
198
  rows: selected.map((row, index) => ({ __row: rowStart + index, ...row }))
198
199
  });
199
200
  return;
@@ -436,7 +437,7 @@ async function handleCsvRenderStart(options) {
436
437
  if (log) {
437
438
  detail = `
438
439
  CSV render log:
439
- ${_chunkRTO5QZWTjs.clip.call(void 0, log, 2e3)}`;
440
+ ${_chunkS22ZQZMUjs.clip.call(void 0, log, 2e3)}`;
440
441
  }
441
442
  } catch (e7) {
442
443
  }
@@ -487,7 +488,7 @@ async function handleCsvRenderStatus(options) {
487
488
  if (payload.pid) lines.push(`Render PID: ${payload.pid}`);
488
489
  if (payload.url) lines.push(`Render URL: ${payload.url}`);
489
490
  lines.push(`Render Health: ${payload.health_status}`);
490
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, payload, {
491
+ _chunkS22ZQZMUjs.printCommandEnvelope.call(void 0, payload, {
491
492
  json: options.json,
492
493
  text: `${lines.join("\n")}
493
494
  `
@@ -523,7 +524,7 @@ async function handleCsvRenderStop(options) {
523
524
  };
524
525
  const text = stopped.length > 0 ? `Stopped CSV render process(es): ${stopped.join(" ")}
525
526
  ` : "No running CSV render process found.\n";
526
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0, payload, { json: options.json, text });
527
+ _chunkS22ZQZMUjs.printCommandEnvelope.call(void 0, payload, { json: options.json, text });
527
528
  }
528
529
  async function handleCsvRender(action, options) {
529
530
  const normalized = _nullishCoalesce(action, () => ( "start"));
@@ -4,11 +4,12 @@ import {
4
4
  printCommandEnvelope,
5
5
  printJson,
6
6
  readCsvRows
7
- } from "./chunk-XKZXO7D3.mjs";
8
- import "./chunk-VE3U3SQC.mjs";
7
+ } from "./chunk-CH6EFAJ3.mjs";
8
+ import "./chunk-ZJ7HLJRF.mjs";
9
+ import "./chunk-YHPYUZZX.mjs";
9
10
  import "./chunk-DLIRSHV6.mjs";
10
11
  import "./chunk-NXGCO4JB.mjs";
11
- import "./chunk-NHB5YUCS.mjs";
12
+ import "./chunk-QP2TRM7M.mjs";
12
13
  import "./chunk-WZYKRD7T.mjs";
13
14
  import "./chunk-KRD6H754.mjs";
14
15
 
@@ -4,7 +4,7 @@ var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
4
4
 
5
5
 
6
6
 
7
- var _chunkWQJJNIMQjs = require('./chunk-WQJJNIMQ.js');
7
+ var _chunkNUBIAJI2js = require('./chunk-NUBIAJI2.js');
8
8
  require('./chunk-S6R3OX7B.js');
9
9
  require('./chunk-UHNDVD3P.js');
10
10
  require('./chunk-KXMNM4AQ.js');
@@ -18,15 +18,16 @@ require('./chunk-XDVT3GOM.js');
18
18
 
19
19
 
20
20
 
21
- var _chunkRTO5QZWTjs = require('./chunk-RTO5QZWT.js');
21
+ var _chunkS22ZQZMUjs = require('./chunk-S22ZQZMU.js');
22
+ require('./chunk-JU3PF7WM.js');
22
23
 
23
24
 
24
- var _chunkV7UP2F4Ujs = require('./chunk-V7UP2F4U.js');
25
+ var _chunkQ2E4E4FJjs = require('./chunk-Q2E4E4FJ.js');
25
26
  require('./chunk-XNYIZMNQ.js');
26
27
 
27
28
 
28
29
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
29
- require('./chunk-GNN4MY5X.js');
30
+ require('./chunk-HFDBZXMV.js');
30
31
  require('./chunk-OG64RBAC.js');
31
32
  require('./chunk-COGTRVWW.js');
32
33
 
@@ -49,8 +50,8 @@ function formatCell(value) {
49
50
  return text.length > 80 ? `${text.slice(0, 77)}...` : text;
50
51
  }
51
52
  function tableLines(result) {
52
- const rows = _chunkRTO5QZWTjs.dataExportRows.call(void 0, customerDbRows(result));
53
- const responseColumns = _chunkRTO5QZWTjs.dataExportColumns.call(void 0,
53
+ const rows = _chunkS22ZQZMUjs.dataExportRows.call(void 0, customerDbRows(result));
54
+ const responseColumns = _chunkS22ZQZMUjs.dataExportColumns.call(void 0,
54
55
  rows,
55
56
  customerDbColumnNames(result)
56
57
  );
@@ -96,7 +97,7 @@ function tableLines(result) {
96
97
  return lines;
97
98
  }
98
99
  function customerDbRows(result) {
99
- return _chunkRTO5QZWTjs.recordRows.call(void 0, result.rows);
100
+ return _chunkS22ZQZMUjs.recordRows.call(void 0, result.rows);
100
101
  }
101
102
  function customerDbColumnNames(result) {
102
103
  return result.columns.map((column) => column.name).filter(Boolean);
@@ -118,15 +119,15 @@ function collectErrorText(value) {
118
119
  ].filter(Boolean).join("\n");
119
120
  }
120
121
  function formatDbQueryError(sql, error) {
121
- const text = error instanceof _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError ? collectErrorText(error.cause) : collectErrorText(error);
122
+ const text = error instanceof _chunkQ2E4E4FJjs.CustomerDbQueryOutcomeUnknownError ? collectErrorText(error.cause) : collectErrorText(error);
122
123
  const lower = text.toLowerCase();
123
124
  const referencesStorage = /"storage"\.|storage\./i.test(sql);
124
125
  const runIdColumnMissing = /column\s+"?run_id"?\s+does not exist/i.test(text) || /run_id.*does not exist/i.test(lower);
125
126
  const relationMissing = /relation\s+["']?[^"']*storage[^"']*["']?\s+does not exist/i.test(text) || /42p01/i.test(text);
126
127
  if (referencesStorage && relationMissing) {
127
128
  return [
128
- ...error instanceof _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError ? [error.message] : [],
129
- error instanceof _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError ? "The server reported that the referenced storage table does not exist." : "Customer DB query failed: the referenced storage table does not exist.",
129
+ ...error instanceof _chunkQ2E4E4FJjs.CustomerDbQueryOutcomeUnknownError ? [error.message] : [],
130
+ error instanceof _chunkQ2E4E4FJjs.CustomerDbQueryOutcomeUnknownError ? "The server reported that the referenced storage table does not exist." : "Customer DB query failed: the referenced storage table does not exist.",
130
131
  "Play dataset tables are created only when the corresponding ctx.dataset(...).run(...) call executes. Pilot branches, early returns, and runs that fail before the dataset do not create that table.",
131
132
  "Use `deepline runs get <run-id> --full` to inspect returned dataset handles, then export them with `deepline runs export <run-id> --dataset result.rows --out rows.csv`.",
132
133
  `Original error: ${errorMessage(error)}`
@@ -134,7 +135,7 @@ function formatDbQueryError(sql, error) {
134
135
  }
135
136
  if (referencesStorage && runIdColumnMissing) {
136
137
  return [
137
- ...error instanceof _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError ? [error.message] : [],
138
+ ...error instanceof _chunkQ2E4E4FJjs.CustomerDbQueryOutcomeUnknownError ? [error.message] : [],
138
139
  "Customer DB query failed: storage dataset tables use `_run_id`, not `run_id`.",
139
140
  "Prefer `deepline runs export <run-id> --dataset result.rows --out rows.csv` unless you are doing deep table debugging.",
140
141
  `Original error: ${errorMessage(error)}`
@@ -149,7 +150,7 @@ function writeCustomerDbCsv(result, outPath) {
149
150
  const resolved = _path.resolve.call(void 0, outPath);
150
151
  _fs.writeFileSync.call(void 0,
151
152
  resolved,
152
- _chunkRTO5QZWTjs.dataExportCsvString.call(void 0, customerDbRows(result), customerDbColumnNames(result)),
153
+ _chunkS22ZQZMUjs.dataExportCsvString.call(void 0, customerDbRows(result), customerDbColumnNames(result)),
153
154
  "utf-8"
154
155
  );
155
156
  return resolved;
@@ -190,7 +191,7 @@ function dbQueryExportEnvelope(input) {
190
191
  function renderDbQueryResult(result, query, options) {
191
192
  const { sql, maxRows, operationKey } = query;
192
193
  const { format, out: outPath, json: explicitJsonOutput = false } = options;
193
- const jsonOutput = explicitJsonOutput || _chunkRTO5QZWTjs.shouldEmitJson.call(void 0, );
194
+ const jsonOutput = explicitJsonOutput || _chunkS22ZQZMUjs.shouldEmitJson.call(void 0, );
194
195
  const toolPayload = JSON.stringify({
195
196
  sql,
196
197
  result_mode: "rows",
@@ -201,7 +202,7 @@ function renderDbQueryResult(result, query, options) {
201
202
  if (format === "csv") {
202
203
  if (outPath) {
203
204
  const exportedPath = writeCustomerDbCsv(result, outPath);
204
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
205
+ _chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
205
206
  dbQueryExportEnvelope({
206
207
  result,
207
208
  format,
@@ -217,7 +218,7 @@ function renderDbQueryResult(result, query, options) {
217
218
  );
218
219
  return;
219
220
  }
220
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
221
+ _chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
221
222
  dbQueryExportEnvelope({
222
223
  result,
223
224
  format,
@@ -227,7 +228,7 @@ function renderDbQueryResult(result, query, options) {
227
228
  }),
228
229
  {
229
230
  json: explicitJsonOutput,
230
- text: _chunkRTO5QZWTjs.dataExportCsvString.call(void 0,
231
+ text: _chunkS22ZQZMUjs.dataExportCsvString.call(void 0,
231
232
  customerDbRows(result),
232
233
  customerDbColumnNames(result)
233
234
  )
@@ -236,14 +237,14 @@ function renderDbQueryResult(result, query, options) {
236
237
  return;
237
238
  }
238
239
  if (format === "markdown") {
239
- const content = _chunkRTO5QZWTjs.markdownTableFromRows.call(void 0,
240
+ const content = _chunkS22ZQZMUjs.markdownTableFromRows.call(void 0,
240
241
  customerDbRows(result),
241
242
  customerDbColumnNames(result)
242
243
  );
243
244
  if (outPath) {
244
245
  const exportedPath = _path.resolve.call(void 0, outPath);
245
246
  _fs.writeFileSync.call(void 0, exportedPath, content, "utf-8");
246
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
247
+ _chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
247
248
  dbQueryExportEnvelope({
248
249
  result,
249
250
  format,
@@ -259,7 +260,7 @@ function renderDbQueryResult(result, query, options) {
259
260
  );
260
261
  return;
261
262
  }
262
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
263
+ _chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
263
264
  dbQueryExportEnvelope({
264
265
  result,
265
266
  format,
@@ -274,7 +275,7 @@ function renderDbQueryResult(result, query, options) {
274
275
  );
275
276
  return;
276
277
  }
277
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
278
+ _chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
278
279
  {
279
280
  ...result,
280
281
  next: {
@@ -348,9 +349,9 @@ async function runDbQueryCommand(options) {
348
349
  ...maxRows === void 0 ? {} : { maxRows },
349
350
  ...operationKey === void 0 ? {} : { operationKey }
350
351
  };
351
- const plan = _chunkWQJJNIMQjs.planCustomerDbQuery.call(void 0, query);
352
+ const plan = _chunkNUBIAJI2js.planCustomerDbQuery.call(void 0, query);
352
353
  if (options.dryRun) {
353
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
354
+ _chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
354
355
  {
355
356
  dryRun: true,
356
357
  ...plan,
@@ -363,11 +364,11 @@ async function runDbQueryCommand(options) {
363
364
  ...out === void 0 ? {} : { file: _path.resolve.call(void 0, out) }
364
365
  }
365
366
  },
366
- { json: options.json || _chunkRTO5QZWTjs.shouldEmitJson.call(void 0, ) }
367
+ { json: options.json || _chunkS22ZQZMUjs.shouldEmitJson.call(void 0, ) }
367
368
  );
368
369
  return 0;
369
370
  }
370
- const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
371
+ const client = new (0, _chunkNUBIAJI2js.DeeplineClient)();
371
372
  const result = await client.db.query(query);
372
373
  renderDbQueryResult(result, query, {
373
374
  format,
@@ -376,8 +377,8 @@ async function runDbQueryCommand(options) {
376
377
  });
377
378
  return 0;
378
379
  } catch (error) {
379
- if (error instanceof _chunkV7UP2F4Ujs.CustomerDbQueryOutcomeUnknownError && (options.json || _chunkRTO5QZWTjs.shouldEmitJson.call(void 0, ))) {
380
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
380
+ if (error instanceof _chunkQ2E4E4FJjs.CustomerDbQueryOutcomeUnknownError && (options.json || _chunkS22ZQZMUjs.shouldEmitJson.call(void 0, ))) {
381
+ _chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
381
382
  {
382
383
  ok: false,
383
384
  error: {
@@ -425,8 +426,8 @@ function dbRepairPlainText(result) {
425
426
  async function handleDbRepair(args) {
426
427
  const providerIndex = args.indexOf("--provider");
427
428
  const provider = providerIndex >= 0 ? _optionalChain([args, 'access', _9 => _9[providerIndex + 1], 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()]) : void 0;
428
- const jsonOutput = _chunkRTO5QZWTjs.argsWantJson.call(void 0, args);
429
- const client = new (0, _chunkWQJJNIMQjs.DeeplineClient)();
429
+ const jsonOutput = _chunkS22ZQZMUjs.argsWantJson.call(void 0, args);
430
+ const client = new (0, _chunkNUBIAJI2js.DeeplineClient)();
430
431
  let result;
431
432
  try {
432
433
  result = await client.repairIngestionStorage(
@@ -442,7 +443,7 @@ async function handleDbRepair(args) {
442
443
  console.error(errorMessage2(error));
443
444
  return 1;
444
445
  }
445
- _chunkRTO5QZWTjs.printCommandEnvelope.call(void 0,
446
+ _chunkS22ZQZMUjs.printCommandEnvelope.call(void 0,
446
447
  {
447
448
  command: "db repair",
448
449
  status: result.status,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  DeeplineClient,
6
6
  planCustomerDbQuery
7
- } from "./chunk-MR6XCBQJ.mjs";
7
+ } from "./chunk-LCRQKI7D.mjs";
8
8
  import "./chunk-6IKARAYD.mjs";
9
9
  import "./chunk-JI2B4RZP.mjs";
10
10
  import "./chunk-EIMG75BT.mjs";
@@ -18,15 +18,16 @@ import {
18
18
  printCommandEnvelope,
19
19
  recordRows,
20
20
  shouldEmitJson
21
- } from "./chunk-XKZXO7D3.mjs";
21
+ } from "./chunk-CH6EFAJ3.mjs";
22
+ import "./chunk-ZJ7HLJRF.mjs";
22
23
  import {
23
24
  CustomerDbQueryOutcomeUnknownError
24
- } from "./chunk-VE3U3SQC.mjs";
25
+ } from "./chunk-YHPYUZZX.mjs";
25
26
  import "./chunk-DLIRSHV6.mjs";
26
27
  import {
27
28
  DeeplineError
28
29
  } from "./chunk-NXGCO4JB.mjs";
29
- import "./chunk-NHB5YUCS.mjs";
30
+ import "./chunk-QP2TRM7M.mjs";
30
31
  import "./chunk-WZYKRD7T.mjs";
31
32
  import "./chunk-KRD6H754.mjs";
32
33