@kubb/cli 5.0.0-beta.6 → 5.0.0-beta.61

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 (142) hide show
  1. package/LICENSE +17 -10
  2. package/README.md +170 -51
  3. package/dist/Telemetry-CVdyJarO.js +283 -0
  4. package/dist/Telemetry-CVdyJarO.js.map +1 -0
  5. package/dist/Telemetry-DrppRqqW.cjs +320 -0
  6. package/dist/Telemetry-DrppRqqW.cjs.map +1 -0
  7. package/dist/{define-Bdn8j5VM.cjs → define-C4AB3POr.cjs} +2 -2
  8. package/dist/{define-Bdn8j5VM.cjs.map → define-C4AB3POr.cjs.map} +1 -1
  9. package/dist/{define-Ctii4bel.js → define-C63T4jp6.js} +2 -2
  10. package/dist/{define-Ctii4bel.js.map → define-C63T4jp6.js.map} +1 -1
  11. package/dist/{errors-CjPmyZHy.js → errors-BsemQCMn.js} +2 -2
  12. package/dist/{errors-CjPmyZHy.js.map → errors-BsemQCMn.js.map} +1 -1
  13. package/dist/{errors-CLCjoSg0.cjs → errors-DykI11xo.cjs} +2 -2
  14. package/dist/{errors-CLCjoSg0.cjs.map → errors-DykI11xo.cjs.map} +1 -1
  15. package/dist/{generate-BB2Q7I9s.cjs → generate-CJuBlTeJ.cjs} +22 -17
  16. package/dist/generate-CJuBlTeJ.cjs.map +1 -0
  17. package/dist/{generate-BmulGxIM.js → generate-DAePC4G2.js} +22 -17
  18. package/dist/generate-DAePC4G2.js.map +1 -0
  19. package/dist/index.cjs +10 -27
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +10 -27
  23. package/dist/index.js.map +1 -1
  24. package/dist/{init-BTp9if7K.js → init-C8m7Z_W8.js} +6 -6
  25. package/dist/{init-BTp9if7K.js.map → init-C8m7Z_W8.js.map} +1 -1
  26. package/dist/{init-Dpg8e1HN.cjs → init-T1DC44PT.cjs} +6 -6
  27. package/dist/{init-Dpg8e1HN.cjs.map → init-T1DC44PT.cjs.map} +1 -1
  28. package/dist/{mcp-wpl6sYYR.cjs → mcp-B60MeTmD.cjs} +6 -6
  29. package/dist/{mcp-wpl6sYYR.cjs.map → mcp-B60MeTmD.cjs.map} +1 -1
  30. package/dist/{mcp-C9RoU-Dg.js → mcp-lEYflz1a.js} +6 -6
  31. package/dist/{mcp-C9RoU-Dg.js.map → mcp-lEYflz1a.js.map} +1 -1
  32. package/dist/package-BynuV_3t.js +6 -0
  33. package/dist/package-BynuV_3t.js.map +1 -0
  34. package/dist/{package-iheSdfas.cjs → package-QUV6JOtx.cjs} +2 -2
  35. package/dist/package-QUV6JOtx.cjs.map +1 -0
  36. package/dist/run-9ZhHuNZQ.cjs +33 -0
  37. package/dist/run-9ZhHuNZQ.cjs.map +1 -0
  38. package/dist/run-BG7Giryi.js +296 -0
  39. package/dist/run-BG7Giryi.js.map +1 -0
  40. package/dist/{validate-BU4fPTMc.cjs → run-BQO_tPlc.cjs} +25 -20
  41. package/dist/run-BQO_tPlc.cjs.map +1 -0
  42. package/dist/run-C-5oRB_f.cjs +1380 -0
  43. package/dist/run-C-5oRB_f.cjs.map +1 -0
  44. package/dist/run-CYnDu3ch.js +51 -0
  45. package/dist/run-CYnDu3ch.js.map +1 -0
  46. package/dist/run-Da0AZlgo.js +1377 -0
  47. package/dist/run-Da0AZlgo.js.map +1 -0
  48. package/dist/run-DpKny2hT.cjs +300 -0
  49. package/dist/run-DpKny2hT.cjs.map +1 -0
  50. package/dist/run-h8NTawHO.js +32 -0
  51. package/dist/run-h8NTawHO.js.map +1 -0
  52. package/dist/tools-BU99bhi8.js +152 -0
  53. package/dist/tools-BU99bhi8.js.map +1 -0
  54. package/dist/tools-_Xp8-_zy.cjs +175 -0
  55. package/dist/tools-_Xp8-_zy.cjs.map +1 -0
  56. package/dist/{validate-BfJoCxrC.js → validate-BhDi3x5e.js} +6 -6
  57. package/dist/{validate-BfJoCxrC.js.map → validate-BhDi3x5e.js.map} +1 -1
  58. package/dist/{validate-DIDBROB2.cjs → validate-CUEvWAyG.cjs} +6 -6
  59. package/dist/{validate-DIDBROB2.cjs.map → validate-CUEvWAyG.cjs.map} +1 -1
  60. package/package.json +12 -27
  61. package/src/Telemetry.ts +297 -0
  62. package/src/commands/generate.ts +18 -12
  63. package/src/commands/init.ts +2 -2
  64. package/src/commands/mcp.ts +2 -2
  65. package/src/commands/validate.ts +2 -2
  66. package/src/constants.ts +2 -35
  67. package/src/index.ts +5 -21
  68. package/src/loggers/clackLogger.ts +136 -202
  69. package/src/loggers/defineLogger.ts +59 -0
  70. package/src/loggers/plainLogger.ts +48 -103
  71. package/src/loggers/types.ts +6 -1
  72. package/src/loggers/utils.ts +167 -24
  73. package/src/runners/generate/run.ts +399 -0
  74. package/src/runners/generate/utils.ts +229 -0
  75. package/src/runners/{init.ts → init/run.ts} +81 -78
  76. package/src/runners/init/utils.ts +39 -0
  77. package/src/runners/mcp/run.ts +37 -0
  78. package/src/runners/{validate.ts → validate/run.ts} +25 -20
  79. package/dist/agent-BJEvbSiP.js +0 -68
  80. package/dist/agent-BJEvbSiP.js.map +0 -1
  81. package/dist/agent-CXNO6dgj.cjs +0 -70
  82. package/dist/agent-CXNO6dgj.cjs.map +0 -1
  83. package/dist/agent-D9CKYh4K.cjs +0 -122
  84. package/dist/agent-D9CKYh4K.cjs.map +0 -1
  85. package/dist/agent-VXKxLCho.js +0 -118
  86. package/dist/agent-VXKxLCho.js.map +0 -1
  87. package/dist/constants-BPJBMT_6.js +0 -45
  88. package/dist/constants-BPJBMT_6.js.map +0 -1
  89. package/dist/constants-BYGmiFs0.cjs +0 -139
  90. package/dist/constants-BYGmiFs0.cjs.map +0 -1
  91. package/dist/constants-DSJ-Xrbv.js +0 -116
  92. package/dist/constants-DSJ-Xrbv.js.map +0 -1
  93. package/dist/constants-Rcaqzyd-.cjs +0 -80
  94. package/dist/constants-Rcaqzyd-.cjs.map +0 -1
  95. package/dist/generate-BB2Q7I9s.cjs.map +0 -1
  96. package/dist/generate-B_p5dl68.cjs +0 -1755
  97. package/dist/generate-B_p5dl68.cjs.map +0 -1
  98. package/dist/generate-BmulGxIM.js.map +0 -1
  99. package/dist/generate-DAsdUw3z.js +0 -1752
  100. package/dist/generate-DAsdUw3z.js.map +0 -1
  101. package/dist/init-CJ80lKSP.cjs +0 -239
  102. package/dist/init-CJ80lKSP.cjs.map +0 -1
  103. package/dist/init-DCqcEq86.js +0 -235
  104. package/dist/init-DCqcEq86.js.map +0 -1
  105. package/dist/mcp-D1llTaRM.cjs +0 -50
  106. package/dist/mcp-D1llTaRM.cjs.map +0 -1
  107. package/dist/mcp-DNUw8nqb.js +0 -49
  108. package/dist/mcp-DNUw8nqb.js.map +0 -1
  109. package/dist/package-iheSdfas.cjs.map +0 -1
  110. package/dist/package-vLafMWCe.js +0 -6
  111. package/dist/package-vLafMWCe.js.map +0 -1
  112. package/dist/shell-475fQKaX.cjs +0 -62
  113. package/dist/shell-475fQKaX.cjs.map +0 -1
  114. package/dist/shell-DLzN4fRo.js +0 -51
  115. package/dist/shell-DLzN4fRo.js.map +0 -1
  116. package/dist/telemetry-BLX0NzRk.cjs +0 -282
  117. package/dist/telemetry-BLX0NzRk.cjs.map +0 -1
  118. package/dist/telemetry-juq4QBf7.js +0 -245
  119. package/dist/telemetry-juq4QBf7.js.map +0 -1
  120. package/dist/validate-BU4fPTMc.cjs.map +0 -1
  121. package/dist/validate-k9s_hFah.js +0 -46
  122. package/dist/validate-k9s_hFah.js.map +0 -1
  123. package/src/commands/agent/start.ts +0 -50
  124. package/src/commands/agent.ts +0 -10
  125. package/src/loggers/fileSystemLogger.ts +0 -138
  126. package/src/loggers/githubActionsLogger.ts +0 -379
  127. package/src/runners/agent.ts +0 -155
  128. package/src/runners/generate.ts +0 -333
  129. package/src/runners/mcp.ts +0 -56
  130. package/src/types.ts +0 -11
  131. package/src/utils/Writables.ts +0 -17
  132. package/src/utils/executeHooks.ts +0 -45
  133. package/src/utils/flags.ts +0 -9
  134. package/src/utils/getConfig.ts +0 -10
  135. package/src/utils/getCosmiConfig.ts +0 -75
  136. package/src/utils/getSummary.ts +0 -68
  137. package/src/utils/packageManager.ts +0 -23
  138. package/src/utils/runHook.ts +0 -91
  139. package/src/utils/telemetry.ts +0 -273
  140. package/src/utils/watcher.ts +0 -19
  141. /package/dist/{chunk-ByKO4r7w.cjs → chunk-Bx3C2hgW.cjs} +0 -0
  142. /package/dist/{chunk--u3MIqq1.js → chunk-C0LytTxp.js} +0 -0
@@ -1,282 +0,0 @@
1
- const require_chunk = require("./chunk-ByKO4r7w.cjs");
2
- const require_constants = require("./constants-Rcaqzyd-.cjs");
3
- let node_crypto = require("node:crypto");
4
- let node_dns = require("node:dns");
5
- let node_os = require("node:os");
6
- node_os = require_chunk.__toESM(node_os, 1);
7
- let node_process = require("node:process");
8
- node_process = require_chunk.__toESM(node_process, 1);
9
- //#region ../../internals/utils/src/env.ts
10
- /**
11
- * Returns `true` when running inside a GitHub Actions workflow.
12
- *
13
- * @example
14
- * ```ts
15
- * if (isGitHubActions()) {
16
- * core.setOutput('result', 'ok')
17
- * }
18
- * ```
19
- */
20
- function isGitHubActions() {
21
- return !!process.env.GITHUB_ACTIONS;
22
- }
23
- /**
24
- * Returns `true` when the process is running in a CI environment.
25
- * Covers GitHub Actions, GitLab CI, CircleCI, Travis CI, Jenkins, Bitbucket,
26
- * TeamCity, Buildkite, and Azure Pipelines.
27
- *
28
- * @example
29
- * ```ts
30
- * if (isCIEnvironment()) {
31
- * logger.level = 'error'
32
- * }
33
- * ```
34
- */
35
- function isCIEnvironment() {
36
- return !!(process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || process.env.BITBUCKET_BUILD_NUMBER || process.env.JENKINS_URL || process.env.CIRCLECI || process.env.TRAVIS || process.env.TEAMCITY_VERSION || process.env.BUILDKITE || process.env.TF_BUILD);
37
- }
38
- /**
39
- * Returns `true` when the process has an interactive TTY with a valid terminal
40
- * width and is not running in CI.
41
- *
42
- * Some IDE-embedded terminals report `isTTY = true` but set `columns` to `0`,
43
- * which breaks clack's box-drawing helpers (they call `String.prototype.repeat`
44
- * with a negative count and throw a `RangeError`). We therefore require a
45
- * positive column count before declaring the TTY usable.
46
- *
47
- * @example
48
- * ```ts
49
- * if (canUseTTY()) {
50
- * renderProgressBar()
51
- * }
52
- * ```
53
- */
54
- function canUseTTY() {
55
- return !!process.stdout.isTTY && (process.stdout.columns ?? 0) > 0 && !isCIEnvironment();
56
- }
57
- //#endregion
58
- //#region ../../internals/utils/src/network.ts
59
- /**
60
- * Well-known stable domains used as DNS probes to check internet connectivity.
61
- */
62
- const TEST_DOMAINS = [
63
- "dns.google.com",
64
- "cloudflare.com",
65
- "one.one.one.one"
66
- ];
67
- /**
68
- * Returns `true` when the system has internet connectivity.
69
- * Probes DNS resolution against well-known stable domains.
70
- *
71
- * @example
72
- * ```ts
73
- * if (await isOnline()) {
74
- * await fetchLatestVersion()
75
- * }
76
- * ```
77
- */
78
- async function isOnline() {
79
- for (const domain of TEST_DOMAINS) try {
80
- await node_dns.promises.resolve(domain);
81
- return true;
82
- } catch {}
83
- return false;
84
- }
85
- /**
86
- * Executes `fn` only when the system is online. Returns `null` when offline or on error.
87
- *
88
- * @example
89
- * ```ts
90
- * const version = await executeIfOnline(() => fetchLatestVersion('kubb'))
91
- * // null when offline
92
- * ```
93
- */
94
- async function executeIfOnline(fn) {
95
- if (!await isOnline()) return null;
96
- try {
97
- return await fn();
98
- } catch {
99
- return null;
100
- }
101
- }
102
- //#endregion
103
- //#region src/utils/telemetry.ts
104
- /**
105
- * Detect whether the current process is running inside a CI environment.
106
- * Delegates to the canonical isCIEnvironment() from envDetection.
107
- */
108
- function isCi() {
109
- return isCIEnvironment();
110
- }
111
- /**
112
- * Check if telemetry is disabled via DO_NOT_TRACK or KUBB_DISABLE_TELEMETRY.
113
- * Respects the standard DO_NOT_TRACK convention used across development tools.
114
- */
115
- function isTelemetryDisabled() {
116
- return node_process.default.env["DO_NOT_TRACK"] === "1" || node_process.default.env["DO_NOT_TRACK"] === "true" || node_process.default.env["KUBB_DISABLE_TELEMETRY"] === "1" || node_process.default.env["KUBB_DISABLE_TELEMETRY"] === "true";
117
- }
118
- /**
119
- * Convert a TelemetryEvent into an OTLP-compatible JSON trace payload.
120
- * See https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/
121
- */
122
- function buildOtlpPayload(event) {
123
- const traceId = (0, node_crypto.randomBytes)(16).toString("hex");
124
- const spanId = (0, node_crypto.randomBytes)(8).toString("hex");
125
- const endTimeNs = BigInt(Date.now()) * 1000000n;
126
- const startTimeNs = endTimeNs - BigInt(event.duration) * 1000000n;
127
- const attributes = [
128
- {
129
- key: "kubb.command",
130
- value: { stringValue: event.command }
131
- },
132
- {
133
- key: "kubb.version",
134
- value: { stringValue: event.kubbVersion }
135
- },
136
- {
137
- key: "kubb.node_version",
138
- value: { stringValue: event.nodeVersion }
139
- },
140
- {
141
- key: "kubb.platform",
142
- value: { stringValue: event.platform }
143
- },
144
- {
145
- key: "kubb.ci",
146
- value: { boolValue: event.ci }
147
- },
148
- {
149
- key: "kubb.files_created",
150
- value: { intValue: event.filesCreated }
151
- },
152
- {
153
- key: "kubb.status",
154
- value: { stringValue: event.status }
155
- },
156
- {
157
- key: "kubb.plugins",
158
- value: { arrayValue: { values: event.plugins.map((p) => ({ kvlistValue: { values: [{
159
- key: "name",
160
- value: { stringValue: p.name }
161
- }, {
162
- key: "options",
163
- value: { stringValue: JSON.stringify({
164
- ...p.options,
165
- usedEnumNames: void 0
166
- }) }
167
- }] } })) } }
168
- }
169
- ];
170
- return { resourceSpans: [{
171
- resource: { attributes: [
172
- {
173
- key: "service.name",
174
- value: { stringValue: "kubb-cli" }
175
- },
176
- {
177
- key: "service.version",
178
- value: { stringValue: event.kubbVersion }
179
- },
180
- {
181
- key: "telemetry.sdk.language",
182
- value: { stringValue: "nodejs" }
183
- }
184
- ] },
185
- scopeSpans: [{
186
- scope: {
187
- name: "kubb-cli",
188
- version: event.kubbVersion
189
- },
190
- spans: [{
191
- traceId,
192
- spanId,
193
- name: event.command,
194
- kind: 1,
195
- startTimeUnixNano: String(startTimeNs),
196
- endTimeUnixNano: String(endTimeNs),
197
- attributes,
198
- status: { code: event.status === "success" ? 1 : 2 }
199
- }]
200
- }]
201
- }] };
202
- }
203
- /**
204
- * Send an anonymous telemetry event to the Kubb OTLP endpoint.
205
- * Respects DO_NOT_TRACK and KUBB_DISABLE_TELEMETRY environment variables.
206
- * Fails silently to never interrupt the generation process.
207
- */
208
- async function sendTelemetry(event) {
209
- if (isTelemetryDisabled()) return;
210
- await executeIfOnline(async () => {
211
- try {
212
- await fetch(`${require_constants.OTLP_ENDPOINT}/v1/traces`, {
213
- method: "POST",
214
- headers: {
215
- "Content-Type": "application/json",
216
- "Kubb-Telemetry-Version": "1",
217
- "Kubb-Telemetry-Source": "kubb-cli"
218
- },
219
- body: JSON.stringify(buildOtlpPayload(event)),
220
- signal: AbortSignal.timeout(5e3)
221
- });
222
- } catch (_e) {}
223
- });
224
- }
225
- /**
226
- * Build an anonymous telemetry payload from a completed generation run.
227
- * No file paths, OpenAPI specs, or secrets are included.
228
- */
229
- function buildTelemetryEvent(options) {
230
- const [seconds, nanoseconds] = node_process.default.hrtime(options.hrStart);
231
- const duration = Math.round(seconds * 1e3 + nanoseconds / 1e6);
232
- return {
233
- command: options.command,
234
- kubbVersion: options.kubbVersion,
235
- nodeVersion: node_process.default.versions.node.split(".")[0],
236
- platform: node_os.default.platform(),
237
- ci: isCi(),
238
- plugins: options.plugins ?? [],
239
- duration,
240
- filesCreated: options.filesCreated ?? 0,
241
- status: options.status
242
- };
243
- }
244
- //#endregion
245
- Object.defineProperty(exports, "buildTelemetryEvent", {
246
- enumerable: true,
247
- get: function() {
248
- return buildTelemetryEvent;
249
- }
250
- });
251
- Object.defineProperty(exports, "canUseTTY", {
252
- enumerable: true,
253
- get: function() {
254
- return canUseTTY;
255
- }
256
- });
257
- Object.defineProperty(exports, "executeIfOnline", {
258
- enumerable: true,
259
- get: function() {
260
- return executeIfOnline;
261
- }
262
- });
263
- Object.defineProperty(exports, "isGitHubActions", {
264
- enumerable: true,
265
- get: function() {
266
- return isGitHubActions;
267
- }
268
- });
269
- Object.defineProperty(exports, "isTelemetryDisabled", {
270
- enumerable: true,
271
- get: function() {
272
- return isTelemetryDisabled;
273
- }
274
- });
275
- Object.defineProperty(exports, "sendTelemetry", {
276
- enumerable: true,
277
- get: function() {
278
- return sendTelemetry;
279
- }
280
- });
281
-
282
- //# sourceMappingURL=telemetry-BLX0NzRk.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"telemetry-BLX0NzRk.cjs","names":["dnsPromises","process","OTLP_ENDPOINT","os"],"sources":["../../../internals/utils/src/env.ts","../../../internals/utils/src/network.ts","../src/utils/telemetry.ts"],"sourcesContent":["/**\n * Returns `true` when running inside a GitHub Actions workflow.\n *\n * @example\n * ```ts\n * if (isGitHubActions()) {\n * core.setOutput('result', 'ok')\n * }\n * ```\n */\nexport function isGitHubActions(): boolean {\n return !!process.env.GITHUB_ACTIONS\n}\n\n/**\n * Returns `true` when the process is running in a CI environment.\n * Covers GitHub Actions, GitLab CI, CircleCI, Travis CI, Jenkins, Bitbucket,\n * TeamCity, Buildkite, and Azure Pipelines.\n *\n * @example\n * ```ts\n * if (isCIEnvironment()) {\n * logger.level = 'error'\n * }\n * ```\n */\nexport function isCIEnvironment(): boolean {\n return !!(\n process.env.CI ||\n process.env.GITHUB_ACTIONS ||\n process.env.GITLAB_CI ||\n process.env.BITBUCKET_BUILD_NUMBER ||\n process.env.JENKINS_URL ||\n process.env.CIRCLECI ||\n process.env.TRAVIS ||\n process.env.TEAMCITY_VERSION ||\n process.env.BUILDKITE ||\n process.env.TF_BUILD\n )\n}\n\n/**\n * Returns `true` when the process has an interactive TTY with a valid terminal\n * width and is not running in CI.\n *\n * Some IDE-embedded terminals report `isTTY = true` but set `columns` to `0`,\n * which breaks clack's box-drawing helpers (they call `String.prototype.repeat`\n * with a negative count and throw a `RangeError`). We therefore require a\n * positive column count before declaring the TTY usable.\n *\n * @example\n * ```ts\n * if (canUseTTY()) {\n * renderProgressBar()\n * }\n * ```\n */\nexport function canUseTTY(): boolean {\n return !!process.stdout.isTTY && (process.stdout.columns ?? 0) > 0 && !isCIEnvironment()\n}\n","import { promises as dnsPromises } from 'node:dns'\n\n/**\n * Well-known stable domains used as DNS probes to check internet connectivity.\n */\nconst TEST_DOMAINS = ['dns.google.com', 'cloudflare.com', 'one.one.one.one'] as const\n\n/**\n * Returns `true` when the system has internet connectivity.\n * Probes DNS resolution against well-known stable domains.\n *\n * @example\n * ```ts\n * if (await isOnline()) {\n * await fetchLatestVersion()\n * }\n * ```\n */\nexport async function isOnline(): Promise<boolean> {\n for (const domain of TEST_DOMAINS) {\n try {\n await dnsPromises.resolve(domain)\n return true\n } catch {\n // Try next domain\n }\n }\n\n return false\n}\n\n/**\n * Executes `fn` only when the system is online. Returns `null` when offline or on error.\n *\n * @example\n * ```ts\n * const version = await executeIfOnline(() => fetchLatestVersion('kubb'))\n * // null when offline\n * ```\n */\nexport async function executeIfOnline<T>(fn: () => Promise<T>): Promise<T | null> {\n if (!(await isOnline())) return null\n\n try {\n return await fn()\n } catch {\n return null\n }\n}\n","import { randomBytes } from 'node:crypto'\nimport os from 'node:os'\nimport process from 'node:process'\nimport { executeIfOnline, isCIEnvironment } from '@internals/utils'\nimport { OTLP_ENDPOINT } from '../constants.ts'\n\n// OpenTelemetry OTLP JSON types\n// https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto\n// https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/common/v1/common.proto\n\ntype OtlpStringValue = { stringValue: string }\ntype OtlpBoolValue = { boolValue: boolean }\ntype OtlpIntValue = { intValue: number }\ntype OtlpDoubleValue = { doubleValue: number }\ntype OtlpBytesValue = { bytesValue: string }\ntype OtlpArrayValue = { arrayValue: { values: OtlpAnyValue[] } }\ntype OtlpKvListValue = { kvlistValue: { values: OtlpKeyValue[] } }\n\ntype OtlpAnyValue = OtlpStringValue | OtlpBoolValue | OtlpIntValue | OtlpDoubleValue | OtlpBytesValue | OtlpArrayValue | OtlpKvListValue\n\ntype OtlpKeyValue = {\n key: string\n value: OtlpAnyValue\n}\n\ntype OtlpResource = {\n attributes: OtlpKeyValue[]\n droppedAttributesCount?: number\n}\n\ntype OtlpInstrumentationScope = {\n name: string\n version?: string\n attributes?: OtlpKeyValue[]\n droppedAttributesCount?: number\n}\n\n/** https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto#L103 */\ntype OtlpSpanKind = 0 | 1 | 2 | 3 | 4 | 5\n\n/** 0 = STATUS_CODE_UNSET, 1 = STATUS_CODE_OK, 2 = STATUS_CODE_ERROR */\ntype OtlpStatusCode = 0 | 1 | 2\n\ntype OtlpStatus = {\n code: OtlpStatusCode\n message?: string\n}\n\ntype OtlpSpan = {\n traceId: string\n spanId: string\n traceState?: string\n parentSpanId?: string\n name: string\n kind: OtlpSpanKind\n startTimeUnixNano: string\n endTimeUnixNano: string\n attributes?: OtlpKeyValue[]\n droppedAttributesCount?: number\n events?: OtlpSpanEvent[]\n droppedEventsCount?: number\n links?: OtlpSpanLink[]\n droppedLinksCount?: number\n status?: OtlpStatus\n}\n\ntype OtlpSpanEvent = {\n timeUnixNano: string\n name: string\n attributes?: OtlpKeyValue[]\n droppedAttributesCount?: number\n}\n\ntype OtlpSpanLink = {\n traceId: string\n spanId: string\n traceState?: string\n attributes?: OtlpKeyValue[]\n droppedAttributesCount?: number\n}\n\ntype OtlpScopeSpans = {\n scope: OtlpInstrumentationScope\n spans: OtlpSpan[]\n schemaUrl?: string\n}\n\ntype OtlpResourceSpans = {\n resource: OtlpResource\n scopeSpans: OtlpScopeSpans[]\n schemaUrl?: string\n}\n\n/** Root payload sent to POST /v1/traces */\ntype OtlpExportTraceServiceRequest = {\n resourceSpans: OtlpResourceSpans[]\n}\n\nexport type TelemetryPlugin = {\n name: string\n options: Record<string, unknown>\n}\n\ntype TelemetryEvent = {\n command: string\n kubbVersion: string\n nodeVersion: string\n platform: string\n ci: boolean\n plugins: TelemetryPlugin[]\n duration: number\n filesCreated: number\n status: 'success' | 'failed'\n}\n\n/**\n * Detect whether the current process is running inside a CI environment.\n * Delegates to the canonical isCIEnvironment() from envDetection.\n */\nexport function isCi(): boolean {\n return isCIEnvironment()\n}\n\n/**\n * Check if telemetry is disabled via DO_NOT_TRACK or KUBB_DISABLE_TELEMETRY.\n * Respects the standard DO_NOT_TRACK convention used across development tools.\n */\nexport function isTelemetryDisabled(): boolean {\n return (\n process.env['DO_NOT_TRACK'] === '1' ||\n process.env['DO_NOT_TRACK'] === 'true' ||\n process.env['KUBB_DISABLE_TELEMETRY'] === '1' ||\n process.env['KUBB_DISABLE_TELEMETRY'] === 'true'\n )\n}\n\n/**\n * Convert a TelemetryEvent into an OTLP-compatible JSON trace payload.\n * See https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/\n */\nexport function buildOtlpPayload(event: TelemetryEvent): OtlpExportTraceServiceRequest {\n const traceId = randomBytes(16).toString('hex')\n const spanId = randomBytes(8).toString('hex')\n const endTimeNs = BigInt(Date.now()) * 1_000_000n\n const startTimeNs = endTimeNs - BigInt(event.duration) * 1_000_000n\n\n const attributes: OtlpKeyValue[] = [\n { key: 'kubb.command', value: { stringValue: event.command } },\n { key: 'kubb.version', value: { stringValue: event.kubbVersion } },\n { key: 'kubb.node_version', value: { stringValue: event.nodeVersion } },\n { key: 'kubb.platform', value: { stringValue: event.platform } },\n { key: 'kubb.ci', value: { boolValue: event.ci } },\n { key: 'kubb.files_created', value: { intValue: event.filesCreated } },\n { key: 'kubb.status', value: { stringValue: event.status } },\n {\n key: 'kubb.plugins',\n value: {\n arrayValue: {\n values: event.plugins.map(\n (p): OtlpKvListValue => ({\n kvlistValue: {\n values: [\n { key: 'name', value: { stringValue: p.name } },\n {\n key: 'options',\n value: {\n stringValue: JSON.stringify({\n ...p.options,\n usedEnumNames: undefined,\n }),\n },\n },\n ],\n },\n }),\n ),\n },\n },\n },\n ]\n\n return {\n resourceSpans: [\n {\n resource: {\n attributes: [\n { key: 'service.name', value: { stringValue: 'kubb-cli' } },\n {\n key: 'service.version',\n value: { stringValue: event.kubbVersion },\n },\n { key: 'telemetry.sdk.language', value: { stringValue: 'nodejs' } },\n ],\n },\n scopeSpans: [\n {\n scope: { name: 'kubb-cli', version: event.kubbVersion },\n spans: [\n {\n traceId,\n spanId,\n name: event.command,\n kind: 1 satisfies OtlpSpanKind,\n startTimeUnixNano: String(startTimeNs),\n endTimeUnixNano: String(endTimeNs),\n attributes,\n status: {\n code: (event.status === 'success' ? 1 : 2) satisfies OtlpStatusCode,\n },\n },\n ],\n },\n ],\n },\n ],\n }\n}\n\n/**\n * Send an anonymous telemetry event to the Kubb OTLP endpoint.\n * Respects DO_NOT_TRACK and KUBB_DISABLE_TELEMETRY environment variables.\n * Fails silently to never interrupt the generation process.\n */\nexport async function sendTelemetry(event: TelemetryEvent): Promise<void> {\n if (isTelemetryDisabled()) {\n return\n }\n\n await executeIfOnline(async () => {\n try {\n await fetch(`${OTLP_ENDPOINT}/v1/traces`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Kubb-Telemetry-Version': '1',\n 'Kubb-Telemetry-Source': 'kubb-cli',\n },\n body: JSON.stringify(buildOtlpPayload(event)),\n signal: AbortSignal.timeout(5_000),\n })\n } catch (_e) {\n // Fail silently – telemetry must never break the CLI\n }\n })\n}\n\n/**\n * Build an anonymous telemetry payload from a completed generation run.\n * No file paths, OpenAPI specs, or secrets are included.\n */\nexport function buildTelemetryEvent(options: {\n command: 'generate' | 'mcp' | 'validate' | 'agent'\n kubbVersion: string\n plugins?: TelemetryPlugin[]\n hrStart: [number, number]\n filesCreated?: number\n status: 'success' | 'failed'\n}): TelemetryEvent {\n const [seconds, nanoseconds] = process.hrtime(options.hrStart)\n const duration = Math.round(seconds * 1000 + nanoseconds / 1e6)\n\n return {\n command: options.command,\n kubbVersion: options.kubbVersion,\n nodeVersion: process.versions.node.split('.')[0] as string,\n platform: os.platform(),\n ci: isCi(),\n plugins: options.plugins ?? [],\n duration,\n filesCreated: options.filesCreated ?? 0,\n status: options.status,\n }\n}\n"],"mappings":"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"}
@@ -1,245 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- import { n as OTLP_ENDPOINT } from "./constants-BPJBMT_6.js";
3
- import { randomBytes } from "node:crypto";
4
- import { promises } from "node:dns";
5
- import os from "node:os";
6
- import process$1 from "node:process";
7
- //#region ../../internals/utils/src/env.ts
8
- /**
9
- * Returns `true` when running inside a GitHub Actions workflow.
10
- *
11
- * @example
12
- * ```ts
13
- * if (isGitHubActions()) {
14
- * core.setOutput('result', 'ok')
15
- * }
16
- * ```
17
- */
18
- function isGitHubActions() {
19
- return !!process.env.GITHUB_ACTIONS;
20
- }
21
- /**
22
- * Returns `true` when the process is running in a CI environment.
23
- * Covers GitHub Actions, GitLab CI, CircleCI, Travis CI, Jenkins, Bitbucket,
24
- * TeamCity, Buildkite, and Azure Pipelines.
25
- *
26
- * @example
27
- * ```ts
28
- * if (isCIEnvironment()) {
29
- * logger.level = 'error'
30
- * }
31
- * ```
32
- */
33
- function isCIEnvironment() {
34
- return !!(process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || process.env.BITBUCKET_BUILD_NUMBER || process.env.JENKINS_URL || process.env.CIRCLECI || process.env.TRAVIS || process.env.TEAMCITY_VERSION || process.env.BUILDKITE || process.env.TF_BUILD);
35
- }
36
- /**
37
- * Returns `true` when the process has an interactive TTY with a valid terminal
38
- * width and is not running in CI.
39
- *
40
- * Some IDE-embedded terminals report `isTTY = true` but set `columns` to `0`,
41
- * which breaks clack's box-drawing helpers (they call `String.prototype.repeat`
42
- * with a negative count and throw a `RangeError`). We therefore require a
43
- * positive column count before declaring the TTY usable.
44
- *
45
- * @example
46
- * ```ts
47
- * if (canUseTTY()) {
48
- * renderProgressBar()
49
- * }
50
- * ```
51
- */
52
- function canUseTTY() {
53
- return !!process.stdout.isTTY && (process.stdout.columns ?? 0) > 0 && !isCIEnvironment();
54
- }
55
- //#endregion
56
- //#region ../../internals/utils/src/network.ts
57
- /**
58
- * Well-known stable domains used as DNS probes to check internet connectivity.
59
- */
60
- const TEST_DOMAINS = [
61
- "dns.google.com",
62
- "cloudflare.com",
63
- "one.one.one.one"
64
- ];
65
- /**
66
- * Returns `true` when the system has internet connectivity.
67
- * Probes DNS resolution against well-known stable domains.
68
- *
69
- * @example
70
- * ```ts
71
- * if (await isOnline()) {
72
- * await fetchLatestVersion()
73
- * }
74
- * ```
75
- */
76
- async function isOnline() {
77
- for (const domain of TEST_DOMAINS) try {
78
- await promises.resolve(domain);
79
- return true;
80
- } catch {}
81
- return false;
82
- }
83
- /**
84
- * Executes `fn` only when the system is online. Returns `null` when offline or on error.
85
- *
86
- * @example
87
- * ```ts
88
- * const version = await executeIfOnline(() => fetchLatestVersion('kubb'))
89
- * // null when offline
90
- * ```
91
- */
92
- async function executeIfOnline(fn) {
93
- if (!await isOnline()) return null;
94
- try {
95
- return await fn();
96
- } catch {
97
- return null;
98
- }
99
- }
100
- //#endregion
101
- //#region src/utils/telemetry.ts
102
- /**
103
- * Detect whether the current process is running inside a CI environment.
104
- * Delegates to the canonical isCIEnvironment() from envDetection.
105
- */
106
- function isCi() {
107
- return isCIEnvironment();
108
- }
109
- /**
110
- * Check if telemetry is disabled via DO_NOT_TRACK or KUBB_DISABLE_TELEMETRY.
111
- * Respects the standard DO_NOT_TRACK convention used across development tools.
112
- */
113
- function isTelemetryDisabled() {
114
- return process$1.env["DO_NOT_TRACK"] === "1" || process$1.env["DO_NOT_TRACK"] === "true" || process$1.env["KUBB_DISABLE_TELEMETRY"] === "1" || process$1.env["KUBB_DISABLE_TELEMETRY"] === "true";
115
- }
116
- /**
117
- * Convert a TelemetryEvent into an OTLP-compatible JSON trace payload.
118
- * See https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/
119
- */
120
- function buildOtlpPayload(event) {
121
- const traceId = randomBytes(16).toString("hex");
122
- const spanId = randomBytes(8).toString("hex");
123
- const endTimeNs = BigInt(Date.now()) * 1000000n;
124
- const startTimeNs = endTimeNs - BigInt(event.duration) * 1000000n;
125
- const attributes = [
126
- {
127
- key: "kubb.command",
128
- value: { stringValue: event.command }
129
- },
130
- {
131
- key: "kubb.version",
132
- value: { stringValue: event.kubbVersion }
133
- },
134
- {
135
- key: "kubb.node_version",
136
- value: { stringValue: event.nodeVersion }
137
- },
138
- {
139
- key: "kubb.platform",
140
- value: { stringValue: event.platform }
141
- },
142
- {
143
- key: "kubb.ci",
144
- value: { boolValue: event.ci }
145
- },
146
- {
147
- key: "kubb.files_created",
148
- value: { intValue: event.filesCreated }
149
- },
150
- {
151
- key: "kubb.status",
152
- value: { stringValue: event.status }
153
- },
154
- {
155
- key: "kubb.plugins",
156
- value: { arrayValue: { values: event.plugins.map((p) => ({ kvlistValue: { values: [{
157
- key: "name",
158
- value: { stringValue: p.name }
159
- }, {
160
- key: "options",
161
- value: { stringValue: JSON.stringify({
162
- ...p.options,
163
- usedEnumNames: void 0
164
- }) }
165
- }] } })) } }
166
- }
167
- ];
168
- return { resourceSpans: [{
169
- resource: { attributes: [
170
- {
171
- key: "service.name",
172
- value: { stringValue: "kubb-cli" }
173
- },
174
- {
175
- key: "service.version",
176
- value: { stringValue: event.kubbVersion }
177
- },
178
- {
179
- key: "telemetry.sdk.language",
180
- value: { stringValue: "nodejs" }
181
- }
182
- ] },
183
- scopeSpans: [{
184
- scope: {
185
- name: "kubb-cli",
186
- version: event.kubbVersion
187
- },
188
- spans: [{
189
- traceId,
190
- spanId,
191
- name: event.command,
192
- kind: 1,
193
- startTimeUnixNano: String(startTimeNs),
194
- endTimeUnixNano: String(endTimeNs),
195
- attributes,
196
- status: { code: event.status === "success" ? 1 : 2 }
197
- }]
198
- }]
199
- }] };
200
- }
201
- /**
202
- * Send an anonymous telemetry event to the Kubb OTLP endpoint.
203
- * Respects DO_NOT_TRACK and KUBB_DISABLE_TELEMETRY environment variables.
204
- * Fails silently to never interrupt the generation process.
205
- */
206
- async function sendTelemetry(event) {
207
- if (isTelemetryDisabled()) return;
208
- await executeIfOnline(async () => {
209
- try {
210
- await fetch(`${OTLP_ENDPOINT}/v1/traces`, {
211
- method: "POST",
212
- headers: {
213
- "Content-Type": "application/json",
214
- "Kubb-Telemetry-Version": "1",
215
- "Kubb-Telemetry-Source": "kubb-cli"
216
- },
217
- body: JSON.stringify(buildOtlpPayload(event)),
218
- signal: AbortSignal.timeout(5e3)
219
- });
220
- } catch (_e) {}
221
- });
222
- }
223
- /**
224
- * Build an anonymous telemetry payload from a completed generation run.
225
- * No file paths, OpenAPI specs, or secrets are included.
226
- */
227
- function buildTelemetryEvent(options) {
228
- const [seconds, nanoseconds] = process$1.hrtime(options.hrStart);
229
- const duration = Math.round(seconds * 1e3 + nanoseconds / 1e6);
230
- return {
231
- command: options.command,
232
- kubbVersion: options.kubbVersion,
233
- nodeVersion: process$1.versions.node.split(".")[0],
234
- platform: os.platform(),
235
- ci: isCi(),
236
- plugins: options.plugins ?? [],
237
- duration,
238
- filesCreated: options.filesCreated ?? 0,
239
- status: options.status
240
- };
241
- }
242
- //#endregion
243
- export { canUseTTY as a, executeIfOnline as i, isTelemetryDisabled as n, isGitHubActions as o, sendTelemetry as r, buildTelemetryEvent as t };
244
-
245
- //# sourceMappingURL=telemetry-juq4QBf7.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"telemetry-juq4QBf7.js","names":["dnsPromises","process"],"sources":["../../../internals/utils/src/env.ts","../../../internals/utils/src/network.ts","../src/utils/telemetry.ts"],"sourcesContent":["/**\n * Returns `true` when running inside a GitHub Actions workflow.\n *\n * @example\n * ```ts\n * if (isGitHubActions()) {\n * core.setOutput('result', 'ok')\n * }\n * ```\n */\nexport function isGitHubActions(): boolean {\n return !!process.env.GITHUB_ACTIONS\n}\n\n/**\n * Returns `true` when the process is running in a CI environment.\n * Covers GitHub Actions, GitLab CI, CircleCI, Travis CI, Jenkins, Bitbucket,\n * TeamCity, Buildkite, and Azure Pipelines.\n *\n * @example\n * ```ts\n * if (isCIEnvironment()) {\n * logger.level = 'error'\n * }\n * ```\n */\nexport function isCIEnvironment(): boolean {\n return !!(\n process.env.CI ||\n process.env.GITHUB_ACTIONS ||\n process.env.GITLAB_CI ||\n process.env.BITBUCKET_BUILD_NUMBER ||\n process.env.JENKINS_URL ||\n process.env.CIRCLECI ||\n process.env.TRAVIS ||\n process.env.TEAMCITY_VERSION ||\n process.env.BUILDKITE ||\n process.env.TF_BUILD\n )\n}\n\n/**\n * Returns `true` when the process has an interactive TTY with a valid terminal\n * width and is not running in CI.\n *\n * Some IDE-embedded terminals report `isTTY = true` but set `columns` to `0`,\n * which breaks clack's box-drawing helpers (they call `String.prototype.repeat`\n * with a negative count and throw a `RangeError`). We therefore require a\n * positive column count before declaring the TTY usable.\n *\n * @example\n * ```ts\n * if (canUseTTY()) {\n * renderProgressBar()\n * }\n * ```\n */\nexport function canUseTTY(): boolean {\n return !!process.stdout.isTTY && (process.stdout.columns ?? 0) > 0 && !isCIEnvironment()\n}\n","import { promises as dnsPromises } from 'node:dns'\n\n/**\n * Well-known stable domains used as DNS probes to check internet connectivity.\n */\nconst TEST_DOMAINS = ['dns.google.com', 'cloudflare.com', 'one.one.one.one'] as const\n\n/**\n * Returns `true` when the system has internet connectivity.\n * Probes DNS resolution against well-known stable domains.\n *\n * @example\n * ```ts\n * if (await isOnline()) {\n * await fetchLatestVersion()\n * }\n * ```\n */\nexport async function isOnline(): Promise<boolean> {\n for (const domain of TEST_DOMAINS) {\n try {\n await dnsPromises.resolve(domain)\n return true\n } catch {\n // Try next domain\n }\n }\n\n return false\n}\n\n/**\n * Executes `fn` only when the system is online. Returns `null` when offline or on error.\n *\n * @example\n * ```ts\n * const version = await executeIfOnline(() => fetchLatestVersion('kubb'))\n * // null when offline\n * ```\n */\nexport async function executeIfOnline<T>(fn: () => Promise<T>): Promise<T | null> {\n if (!(await isOnline())) return null\n\n try {\n return await fn()\n } catch {\n return null\n }\n}\n","import { randomBytes } from 'node:crypto'\nimport os from 'node:os'\nimport process from 'node:process'\nimport { executeIfOnline, isCIEnvironment } from '@internals/utils'\nimport { OTLP_ENDPOINT } from '../constants.ts'\n\n// OpenTelemetry OTLP JSON types\n// https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto\n// https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/common/v1/common.proto\n\ntype OtlpStringValue = { stringValue: string }\ntype OtlpBoolValue = { boolValue: boolean }\ntype OtlpIntValue = { intValue: number }\ntype OtlpDoubleValue = { doubleValue: number }\ntype OtlpBytesValue = { bytesValue: string }\ntype OtlpArrayValue = { arrayValue: { values: OtlpAnyValue[] } }\ntype OtlpKvListValue = { kvlistValue: { values: OtlpKeyValue[] } }\n\ntype OtlpAnyValue = OtlpStringValue | OtlpBoolValue | OtlpIntValue | OtlpDoubleValue | OtlpBytesValue | OtlpArrayValue | OtlpKvListValue\n\ntype OtlpKeyValue = {\n key: string\n value: OtlpAnyValue\n}\n\ntype OtlpResource = {\n attributes: OtlpKeyValue[]\n droppedAttributesCount?: number\n}\n\ntype OtlpInstrumentationScope = {\n name: string\n version?: string\n attributes?: OtlpKeyValue[]\n droppedAttributesCount?: number\n}\n\n/** https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto#L103 */\ntype OtlpSpanKind = 0 | 1 | 2 | 3 | 4 | 5\n\n/** 0 = STATUS_CODE_UNSET, 1 = STATUS_CODE_OK, 2 = STATUS_CODE_ERROR */\ntype OtlpStatusCode = 0 | 1 | 2\n\ntype OtlpStatus = {\n code: OtlpStatusCode\n message?: string\n}\n\ntype OtlpSpan = {\n traceId: string\n spanId: string\n traceState?: string\n parentSpanId?: string\n name: string\n kind: OtlpSpanKind\n startTimeUnixNano: string\n endTimeUnixNano: string\n attributes?: OtlpKeyValue[]\n droppedAttributesCount?: number\n events?: OtlpSpanEvent[]\n droppedEventsCount?: number\n links?: OtlpSpanLink[]\n droppedLinksCount?: number\n status?: OtlpStatus\n}\n\ntype OtlpSpanEvent = {\n timeUnixNano: string\n name: string\n attributes?: OtlpKeyValue[]\n droppedAttributesCount?: number\n}\n\ntype OtlpSpanLink = {\n traceId: string\n spanId: string\n traceState?: string\n attributes?: OtlpKeyValue[]\n droppedAttributesCount?: number\n}\n\ntype OtlpScopeSpans = {\n scope: OtlpInstrumentationScope\n spans: OtlpSpan[]\n schemaUrl?: string\n}\n\ntype OtlpResourceSpans = {\n resource: OtlpResource\n scopeSpans: OtlpScopeSpans[]\n schemaUrl?: string\n}\n\n/** Root payload sent to POST /v1/traces */\ntype OtlpExportTraceServiceRequest = {\n resourceSpans: OtlpResourceSpans[]\n}\n\nexport type TelemetryPlugin = {\n name: string\n options: Record<string, unknown>\n}\n\ntype TelemetryEvent = {\n command: string\n kubbVersion: string\n nodeVersion: string\n platform: string\n ci: boolean\n plugins: TelemetryPlugin[]\n duration: number\n filesCreated: number\n status: 'success' | 'failed'\n}\n\n/**\n * Detect whether the current process is running inside a CI environment.\n * Delegates to the canonical isCIEnvironment() from envDetection.\n */\nexport function isCi(): boolean {\n return isCIEnvironment()\n}\n\n/**\n * Check if telemetry is disabled via DO_NOT_TRACK or KUBB_DISABLE_TELEMETRY.\n * Respects the standard DO_NOT_TRACK convention used across development tools.\n */\nexport function isTelemetryDisabled(): boolean {\n return (\n process.env['DO_NOT_TRACK'] === '1' ||\n process.env['DO_NOT_TRACK'] === 'true' ||\n process.env['KUBB_DISABLE_TELEMETRY'] === '1' ||\n process.env['KUBB_DISABLE_TELEMETRY'] === 'true'\n )\n}\n\n/**\n * Convert a TelemetryEvent into an OTLP-compatible JSON trace payload.\n * See https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/\n */\nexport function buildOtlpPayload(event: TelemetryEvent): OtlpExportTraceServiceRequest {\n const traceId = randomBytes(16).toString('hex')\n const spanId = randomBytes(8).toString('hex')\n const endTimeNs = BigInt(Date.now()) * 1_000_000n\n const startTimeNs = endTimeNs - BigInt(event.duration) * 1_000_000n\n\n const attributes: OtlpKeyValue[] = [\n { key: 'kubb.command', value: { stringValue: event.command } },\n { key: 'kubb.version', value: { stringValue: event.kubbVersion } },\n { key: 'kubb.node_version', value: { stringValue: event.nodeVersion } },\n { key: 'kubb.platform', value: { stringValue: event.platform } },\n { key: 'kubb.ci', value: { boolValue: event.ci } },\n { key: 'kubb.files_created', value: { intValue: event.filesCreated } },\n { key: 'kubb.status', value: { stringValue: event.status } },\n {\n key: 'kubb.plugins',\n value: {\n arrayValue: {\n values: event.plugins.map(\n (p): OtlpKvListValue => ({\n kvlistValue: {\n values: [\n { key: 'name', value: { stringValue: p.name } },\n {\n key: 'options',\n value: {\n stringValue: JSON.stringify({\n ...p.options,\n usedEnumNames: undefined,\n }),\n },\n },\n ],\n },\n }),\n ),\n },\n },\n },\n ]\n\n return {\n resourceSpans: [\n {\n resource: {\n attributes: [\n { key: 'service.name', value: { stringValue: 'kubb-cli' } },\n {\n key: 'service.version',\n value: { stringValue: event.kubbVersion },\n },\n { key: 'telemetry.sdk.language', value: { stringValue: 'nodejs' } },\n ],\n },\n scopeSpans: [\n {\n scope: { name: 'kubb-cli', version: event.kubbVersion },\n spans: [\n {\n traceId,\n spanId,\n name: event.command,\n kind: 1 satisfies OtlpSpanKind,\n startTimeUnixNano: String(startTimeNs),\n endTimeUnixNano: String(endTimeNs),\n attributes,\n status: {\n code: (event.status === 'success' ? 1 : 2) satisfies OtlpStatusCode,\n },\n },\n ],\n },\n ],\n },\n ],\n }\n}\n\n/**\n * Send an anonymous telemetry event to the Kubb OTLP endpoint.\n * Respects DO_NOT_TRACK and KUBB_DISABLE_TELEMETRY environment variables.\n * Fails silently to never interrupt the generation process.\n */\nexport async function sendTelemetry(event: TelemetryEvent): Promise<void> {\n if (isTelemetryDisabled()) {\n return\n }\n\n await executeIfOnline(async () => {\n try {\n await fetch(`${OTLP_ENDPOINT}/v1/traces`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Kubb-Telemetry-Version': '1',\n 'Kubb-Telemetry-Source': 'kubb-cli',\n },\n body: JSON.stringify(buildOtlpPayload(event)),\n signal: AbortSignal.timeout(5_000),\n })\n } catch (_e) {\n // Fail silently – telemetry must never break the CLI\n }\n })\n}\n\n/**\n * Build an anonymous telemetry payload from a completed generation run.\n * No file paths, OpenAPI specs, or secrets are included.\n */\nexport function buildTelemetryEvent(options: {\n command: 'generate' | 'mcp' | 'validate' | 'agent'\n kubbVersion: string\n plugins?: TelemetryPlugin[]\n hrStart: [number, number]\n filesCreated?: number\n status: 'success' | 'failed'\n}): TelemetryEvent {\n const [seconds, nanoseconds] = process.hrtime(options.hrStart)\n const duration = Math.round(seconds * 1000 + nanoseconds / 1e6)\n\n return {\n command: options.command,\n kubbVersion: options.kubbVersion,\n nodeVersion: process.versions.node.split('.')[0] as string,\n platform: os.platform(),\n ci: isCi(),\n plugins: options.plugins ?? [],\n duration,\n filesCreated: options.filesCreated ?? 0,\n status: options.status,\n }\n}\n"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate-BU4fPTMc.cjs","names":["process","sendTelemetry","buildTelemetryEvent","getErrorMessage"],"sources":["../src/runners/validate.ts"],"sourcesContent":["import process from 'node:process'\nimport { styleText } from 'node:util'\nimport { getErrorMessage } from '@internals/utils'\nimport { buildTelemetryEvent, sendTelemetry } from '../utils/telemetry.ts'\n\ntype ValidateOptions = {\n input: string\n version: string\n}\n\ntype ValidateModule = typeof import('@kubb/adapter-oas')\ntype ValidateDependencies = {\n loadValidateModule: () => Promise<ValidateModule>\n}\n\nexport function loadValidateModule(): Promise<ValidateModule> {\n return import('@kubb/adapter-oas') as Promise<ValidateModule>\n}\n\nexport async function runValidate({ input, version }: ValidateOptions, dependencies: ValidateDependencies = { loadValidateModule }): Promise<void> {\n const hrStart = process.hrtime()\n try {\n const { adapterOas } = await dependencies.loadValidateModule()\n const adapter = adapterOas()\n await adapter.validate!(input, { throwOnError: true })\n\n await sendTelemetry(\n buildTelemetryEvent({\n command: 'validate',\n kubbVersion: version,\n hrStart,\n status: 'success',\n }),\n )\n console.log('✅ Validation success')\n } catch (error) {\n await sendTelemetry(\n buildTelemetryEvent({\n command: 'validate',\n kubbVersion: version,\n hrStart,\n status: 'failed',\n }),\n )\n if (error instanceof Error && /@kubb\\/adapter-oas/.test(error.message)) {\n console.error(styleText('red', 'The @kubb/adapter-oas package is not installed.'))\n console.error('')\n console.error('Install it with:')\n console.error(styleText('cyan', ' npm install @kubb/adapter-oas'))\n console.error(styleText('cyan', ' # or'))\n console.error(styleText('cyan', ' pnpm install @kubb/adapter-oas'))\n console.error('')\n }\n console.error('❌ Validation failed')\n console.error(getErrorMessage(error))\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;AAeA,SAAgB,qBAA8C;CAC5D,OAAO,OAAO;;AAGhB,eAAsB,YAAY,EAAE,OAAO,WAA4B,eAAqC,EAAE,oBAAoB,EAAiB;CACjJ,MAAM,UAAUA,aAAAA,QAAQ,QAAQ;CAChC,IAAI;EACF,MAAM,EAAE,eAAe,MAAM,aAAa,oBAAoB;EAE9D,MADgB,YACH,CAAC,SAAU,OAAO,EAAE,cAAc,MAAM,CAAC;EAEtD,MAAMC,kBAAAA,cACJC,kBAAAA,oBAAoB;GAClB,SAAS;GACT,aAAa;GACb;GACA,QAAQ;GACT,CAAC,CACH;EACD,QAAQ,IAAI,uBAAuB;UAC5B,OAAO;EACd,MAAMD,kBAAAA,cACJC,kBAAAA,oBAAoB;GAClB,SAAS;GACT,aAAa;GACb;GACA,QAAQ;GACT,CAAC,CACH;EACD,IAAI,iBAAiB,SAAS,qBAAqB,KAAK,MAAM,QAAQ,EAAE;GACtE,QAAQ,OAAA,GAAA,UAAA,WAAgB,OAAO,kDAAkD,CAAC;GAClF,QAAQ,MAAM,GAAG;GACjB,QAAQ,MAAM,mBAAmB;GACjC,QAAQ,OAAA,GAAA,UAAA,WAAgB,QAAQ,kCAAkC,CAAC;GACnE,QAAQ,OAAA,GAAA,UAAA,WAAgB,QAAQ,SAAS,CAAC;GAC1C,QAAQ,OAAA,GAAA,UAAA,WAAgB,QAAQ,mCAAmC,CAAC;GACpE,QAAQ,MAAM,GAAG;;EAEnB,QAAQ,MAAM,sBAAsB;EACpC,QAAQ,MAAMC,eAAAA,gBAAgB,MAAM,CAAC;EACrC,aAAA,QAAQ,KAAK,EAAE"}
@@ -1,46 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- import { t as getErrorMessage } from "./errors-CjPmyZHy.js";
3
- import { r as sendTelemetry, t as buildTelemetryEvent } from "./telemetry-juq4QBf7.js";
4
- import { styleText } from "node:util";
5
- import process from "node:process";
6
- //#region src/runners/validate.ts
7
- function loadValidateModule() {
8
- return import("@kubb/adapter-oas");
9
- }
10
- async function runValidate({ input, version }, dependencies = { loadValidateModule }) {
11
- const hrStart = process.hrtime();
12
- try {
13
- const { adapterOas } = await dependencies.loadValidateModule();
14
- await adapterOas().validate(input, { throwOnError: true });
15
- await sendTelemetry(buildTelemetryEvent({
16
- command: "validate",
17
- kubbVersion: version,
18
- hrStart,
19
- status: "success"
20
- }));
21
- console.log("✅ Validation success");
22
- } catch (error) {
23
- await sendTelemetry(buildTelemetryEvent({
24
- command: "validate",
25
- kubbVersion: version,
26
- hrStart,
27
- status: "failed"
28
- }));
29
- if (error instanceof Error && /@kubb\/adapter-oas/.test(error.message)) {
30
- console.error(styleText("red", "The @kubb/adapter-oas package is not installed."));
31
- console.error("");
32
- console.error("Install it with:");
33
- console.error(styleText("cyan", " npm install @kubb/adapter-oas"));
34
- console.error(styleText("cyan", " # or"));
35
- console.error(styleText("cyan", " pnpm install @kubb/adapter-oas"));
36
- console.error("");
37
- }
38
- console.error("❌ Validation failed");
39
- console.error(getErrorMessage(error));
40
- process.exit(1);
41
- }
42
- }
43
- //#endregion
44
- export { runValidate };
45
-
46
- //# sourceMappingURL=validate-k9s_hFah.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate-k9s_hFah.js","names":[],"sources":["../src/runners/validate.ts"],"sourcesContent":["import process from 'node:process'\nimport { styleText } from 'node:util'\nimport { getErrorMessage } from '@internals/utils'\nimport { buildTelemetryEvent, sendTelemetry } from '../utils/telemetry.ts'\n\ntype ValidateOptions = {\n input: string\n version: string\n}\n\ntype ValidateModule = typeof import('@kubb/adapter-oas')\ntype ValidateDependencies = {\n loadValidateModule: () => Promise<ValidateModule>\n}\n\nexport function loadValidateModule(): Promise<ValidateModule> {\n return import('@kubb/adapter-oas') as Promise<ValidateModule>\n}\n\nexport async function runValidate({ input, version }: ValidateOptions, dependencies: ValidateDependencies = { loadValidateModule }): Promise<void> {\n const hrStart = process.hrtime()\n try {\n const { adapterOas } = await dependencies.loadValidateModule()\n const adapter = adapterOas()\n await adapter.validate!(input, { throwOnError: true })\n\n await sendTelemetry(\n buildTelemetryEvent({\n command: 'validate',\n kubbVersion: version,\n hrStart,\n status: 'success',\n }),\n )\n console.log('✅ Validation success')\n } catch (error) {\n await sendTelemetry(\n buildTelemetryEvent({\n command: 'validate',\n kubbVersion: version,\n hrStart,\n status: 'failed',\n }),\n )\n if (error instanceof Error && /@kubb\\/adapter-oas/.test(error.message)) {\n console.error(styleText('red', 'The @kubb/adapter-oas package is not installed.'))\n console.error('')\n console.error('Install it with:')\n console.error(styleText('cyan', ' npm install @kubb/adapter-oas'))\n console.error(styleText('cyan', ' # or'))\n console.error(styleText('cyan', ' pnpm install @kubb/adapter-oas'))\n console.error('')\n }\n console.error('❌ Validation failed')\n console.error(getErrorMessage(error))\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;AAeA,SAAgB,qBAA8C;CAC5D,OAAO,OAAO;;AAGhB,eAAsB,YAAY,EAAE,OAAO,WAA4B,eAAqC,EAAE,oBAAoB,EAAiB;CACjJ,MAAM,UAAU,QAAQ,QAAQ;CAChC,IAAI;EACF,MAAM,EAAE,eAAe,MAAM,aAAa,oBAAoB;EAE9D,MADgB,YACH,CAAC,SAAU,OAAO,EAAE,cAAc,MAAM,CAAC;EAEtD,MAAM,cACJ,oBAAoB;GAClB,SAAS;GACT,aAAa;GACb;GACA,QAAQ;GACT,CAAC,CACH;EACD,QAAQ,IAAI,uBAAuB;UAC5B,OAAO;EACd,MAAM,cACJ,oBAAoB;GAClB,SAAS;GACT,aAAa;GACb;GACA,QAAQ;GACT,CAAC,CACH;EACD,IAAI,iBAAiB,SAAS,qBAAqB,KAAK,MAAM,QAAQ,EAAE;GACtE,QAAQ,MAAM,UAAU,OAAO,kDAAkD,CAAC;GAClF,QAAQ,MAAM,GAAG;GACjB,QAAQ,MAAM,mBAAmB;GACjC,QAAQ,MAAM,UAAU,QAAQ,kCAAkC,CAAC;GACnE,QAAQ,MAAM,UAAU,QAAQ,SAAS,CAAC;GAC1C,QAAQ,MAAM,UAAU,QAAQ,mCAAmC,CAAC;GACpE,QAAQ,MAAM,GAAG;;EAEnB,QAAQ,MAAM,sBAAsB;EACpC,QAAQ,MAAM,gBAAgB,MAAM,CAAC;EACrC,QAAQ,KAAK,EAAE"}