@kubb/cli 4.33.0 → 4.33.2

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 (137) hide show
  1. package/dist/{agent-D0A3RQho.js → agent-BGWY8Iow.js} +5 -5
  2. package/dist/agent-BGWY8Iow.js.map +1 -0
  3. package/dist/{agent-CduUX7Ye.cjs → agent-Bd1QdPVV.cjs} +7 -7
  4. package/dist/agent-Bd1QdPVV.cjs.map +1 -0
  5. package/dist/{agent-DrnwQBZf.cjs → agent-CmQJU9h7.cjs} +7 -7
  6. package/dist/agent-CmQJU9h7.cjs.map +1 -0
  7. package/dist/{agent-CJ69TqoO.js → agent-u_Ehwz6r.js} +5 -5
  8. package/dist/agent-u_Ehwz6r.js.map +1 -0
  9. package/dist/{constants-CnPOlsJq.cjs → constants-BTUap0zs.cjs} +1 -19
  10. package/dist/{constants-CnPOlsJq.cjs.map → constants-BTUap0zs.cjs.map} +1 -1
  11. package/dist/{constants-CEKRremI.js → constants-CM3dJzjK.js} +2 -14
  12. package/dist/{constants-CEKRremI.js.map → constants-CM3dJzjK.js.map} +1 -1
  13. package/dist/{types-CLtz0jem.js → define--M_JMcDC.js} +6 -6
  14. package/dist/define--M_JMcDC.js.map +1 -0
  15. package/dist/{types-Ck2lzFON.cjs → define-D6Kfm7-Z.cjs} +6 -6
  16. package/dist/define-D6Kfm7-Z.cjs.map +1 -0
  17. package/dist/{errors-bSLTEh4e.js → errors-6mF_WKxg.js} +5 -5
  18. package/dist/errors-6mF_WKxg.js.map +1 -0
  19. package/dist/{errors-BUjJsNoe.cjs → errors-DBW0N9w4.cjs} +5 -5
  20. package/dist/errors-DBW0N9w4.cjs.map +1 -0
  21. package/dist/{generate-ByMgAV76.cjs → generate-6Cm1AK2n.cjs} +275 -153
  22. package/dist/generate-6Cm1AK2n.cjs.map +1 -0
  23. package/dist/{generate-HP5ySfjV.js → generate-DcNp9Owd.js} +271 -149
  24. package/dist/generate-DcNp9Owd.js.map +1 -0
  25. package/dist/{generate-CiUPO5ds.cjs → generate-DqmjK5Lc.cjs} +3 -3
  26. package/dist/generate-DqmjK5Lc.cjs.map +1 -0
  27. package/dist/{generate-DIIxtkWT.js → generate-rtsmgWhO.js} +3 -3
  28. package/dist/generate-rtsmgWhO.js.map +1 -0
  29. package/dist/index.cjs +13 -13
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.js +12 -12
  32. package/dist/index.js.map +1 -1
  33. package/dist/{init-DLNrkDF4.js → init--9nMhvx6.js} +4 -4
  34. package/dist/init--9nMhvx6.js.map +1 -0
  35. package/dist/{init-Df_aXezV.cjs → init-BvjtU-sC.cjs} +5 -4
  36. package/dist/init-BvjtU-sC.cjs.map +1 -0
  37. package/dist/{init-DyKK2fTp.js → init-C-InrmSY.js} +42 -31
  38. package/dist/init-C-InrmSY.js.map +1 -0
  39. package/dist/{init-Cd1hCb7q.cjs → init-hmolV6B4.cjs} +47 -37
  40. package/dist/init-hmolV6B4.cjs.map +1 -0
  41. package/dist/{jiti-BdskUHhD.cjs → jiti-Cd3S0xwr.cjs} +1 -1
  42. package/dist/{jiti-BdskUHhD.cjs.map → jiti-Cd3S0xwr.cjs.map} +1 -1
  43. package/dist/{jiti-Cl7t20dO.js → jiti-e08mD2Ph.js} +1 -1
  44. package/dist/{jiti-Cl7t20dO.js.map → jiti-e08mD2Ph.js.map} +1 -1
  45. package/dist/{mcp-Clg-Qnkr.cjs → mcp-Bd-DXHWV.cjs} +5 -4
  46. package/dist/mcp-Bd-DXHWV.cjs.map +1 -0
  47. package/dist/{mcp-Bd9LITaI.js → mcp-CZzxfbHW.js} +4 -4
  48. package/dist/mcp-CZzxfbHW.js.map +1 -0
  49. package/dist/{mcp-B73FC8dF.cjs → mcp-ChHFPRzD.cjs} +4 -4
  50. package/dist/mcp-ChHFPRzD.cjs.map +1 -0
  51. package/dist/{mcp-Cf-1dsB-.js → mcp-D2SHEg_d.js} +4 -4
  52. package/dist/mcp-D2SHEg_d.js.map +1 -0
  53. package/dist/{package-aKgzEJtp.cjs → package-BXijqaX5.cjs} +2 -2
  54. package/dist/package-BXijqaX5.cjs.map +1 -0
  55. package/dist/package-DeOlqJ31.js +6 -0
  56. package/dist/package-DeOlqJ31.js.map +1 -0
  57. package/dist/shell-7HPrTCJ5.cjs +57 -0
  58. package/dist/shell-7HPrTCJ5.cjs.map +1 -0
  59. package/dist/shell-DqqWsHCD.js +46 -0
  60. package/dist/shell-DqqWsHCD.js.map +1 -0
  61. package/dist/{telemetry-T5IA2dWA.cjs → telemetry-Cn9X1I5B.cjs} +46 -9
  62. package/dist/telemetry-Cn9X1I5B.cjs.map +1 -0
  63. package/dist/{telemetry-C4gOKX2x.js → telemetry-DxiR7clS.js} +40 -9
  64. package/dist/telemetry-DxiR7clS.js.map +1 -0
  65. package/dist/{validate-Cr26q5xX.js → validate-BH2Ysgxr.js} +4 -4
  66. package/dist/validate-BH2Ysgxr.js.map +1 -0
  67. package/dist/{validate-DURmg-2Q.cjs → validate-BQvsoQz-.cjs} +5 -4
  68. package/dist/validate-BQvsoQz-.cjs.map +1 -0
  69. package/dist/{validate-Dqi9T_c4.cjs → validate-Bbrn3Q-A.cjs} +4 -4
  70. package/dist/validate-Bbrn3Q-A.cjs.map +1 -0
  71. package/dist/{validate-Chjg23AE.js → validate-l8vLmwKA.js} +4 -4
  72. package/dist/validate-l8vLmwKA.js.map +1 -0
  73. package/package.json +6 -5
  74. package/src/commands/agent/start.ts +1 -1
  75. package/src/commands/agent.ts +1 -1
  76. package/src/commands/generate.ts +1 -1
  77. package/src/commands/init.ts +1 -1
  78. package/src/commands/mcp.ts +1 -1
  79. package/src/commands/validate.ts +1 -1
  80. package/src/constants.ts +0 -1
  81. package/src/index.ts +1 -1
  82. package/src/loggers/clackLogger.ts +26 -28
  83. package/src/loggers/fileSystemLogger.ts +1 -2
  84. package/src/loggers/githubActionsLogger.ts +26 -28
  85. package/src/loggers/plainLogger.ts +25 -26
  86. package/src/loggers/utils.ts +4 -5
  87. package/src/runners/agent.ts +1 -1
  88. package/src/runners/generate.ts +20 -7
  89. package/src/runners/init.ts +2 -1
  90. package/src/runners/mcp.ts +1 -1
  91. package/src/runners/validate.ts +1 -1
  92. package/src/utils/executeHooks.ts +2 -2
  93. package/src/utils/getIntro.ts +1 -80
  94. package/src/utils/getSummary.ts +1 -2
  95. package/src/utils/packageManager.ts +2 -2
  96. package/src/utils/runHook.ts +2 -2
  97. package/src/utils/telemetry.ts +1 -2
  98. package/dist/agent-CJ69TqoO.js.map +0 -1
  99. package/dist/agent-CduUX7Ye.cjs.map +0 -1
  100. package/dist/agent-D0A3RQho.js.map +0 -1
  101. package/dist/agent-DrnwQBZf.cjs.map +0 -1
  102. package/dist/errors-BUjJsNoe.cjs.map +0 -1
  103. package/dist/errors-bSLTEh4e.js.map +0 -1
  104. package/dist/generate-ByMgAV76.cjs.map +0 -1
  105. package/dist/generate-CiUPO5ds.cjs.map +0 -1
  106. package/dist/generate-DIIxtkWT.js.map +0 -1
  107. package/dist/generate-HP5ySfjV.js.map +0 -1
  108. package/dist/init-Cd1hCb7q.cjs.map +0 -1
  109. package/dist/init-DLNrkDF4.js.map +0 -1
  110. package/dist/init-Df_aXezV.cjs.map +0 -1
  111. package/dist/init-DyKK2fTp.js.map +0 -1
  112. package/dist/mcp-B73FC8dF.cjs.map +0 -1
  113. package/dist/mcp-Bd9LITaI.js.map +0 -1
  114. package/dist/mcp-Cf-1dsB-.js.map +0 -1
  115. package/dist/mcp-Clg-Qnkr.cjs.map +0 -1
  116. package/dist/package-681jTtCk.js +0 -6
  117. package/dist/package-681jTtCk.js.map +0 -1
  118. package/dist/package-aKgzEJtp.cjs.map +0 -1
  119. package/dist/telemetry-C4gOKX2x.js.map +0 -1
  120. package/dist/telemetry-T5IA2dWA.cjs.map +0 -1
  121. package/dist/types-CLtz0jem.js.map +0 -1
  122. package/dist/types-Ck2lzFON.cjs.map +0 -1
  123. package/dist/validate-Chjg23AE.js.map +0 -1
  124. package/dist/validate-Cr26q5xX.js.map +0 -1
  125. package/dist/validate-DURmg-2Q.cjs.map +0 -1
  126. package/dist/validate-Dqi9T_c4.cjs.map +0 -1
  127. package/src/cli/adapters/nodeAdapter.ts +0 -159
  128. package/src/cli/help.ts +0 -36
  129. package/src/cli/index.ts +0 -16
  130. package/src/cli/parse.ts +0 -18
  131. package/src/cli/schema.ts +0 -38
  132. package/src/cli/types.ts +0 -95
  133. package/src/utils/envDetection.ts +0 -34
  134. package/src/utils/errors.ts +0 -23
  135. package/src/utils/formatMsWithColor.ts +0 -22
  136. package/src/utils/randomColor.ts +0 -14
  137. package/src/utils/spawnAsync.ts +0 -47
@@ -0,0 +1,46 @@
1
+ import "./chunk--u3MIqq1.js";
2
+ import { spawn } from "node:child_process";
3
+ //#region ../../internals/utils/src/shell.ts
4
+ /**
5
+ * Tokenizes a shell command string, respecting single and double quotes.
6
+ *
7
+ * @example
8
+ * tokenize('git commit -m "initial commit"')
9
+ * // → ['git', 'commit', '-m', 'initial commit']
10
+ */
11
+ function tokenize(command) {
12
+ return (command.match(/[^\s"']+|"([^"]*)"|'([^']*)'/g) ?? []).map((token) => token.replace(/^["']|["']$/g, ""));
13
+ }
14
+ /**
15
+ * Spawns `cmd` with `args` and returns a promise that settles when the child process finishes.
16
+ *
17
+ * Foreground mode (default) inherits the parent's stdio and rejects on non-zero exit or signal.
18
+ * Detached mode spawns the child in its own process group, unref's it, and resolves immediately —
19
+ * the parent can exit without waiting for the child.
20
+ */
21
+ function spawnAsync(cmd, args, options = {}) {
22
+ const { cwd = process.cwd(), env, detached = false } = options;
23
+ return new Promise((resolve, reject) => {
24
+ const child = spawn(cmd, args, {
25
+ stdio: detached ? "ignore" : "inherit",
26
+ cwd,
27
+ env,
28
+ detached
29
+ });
30
+ if (detached) {
31
+ child.unref();
32
+ resolve();
33
+ return;
34
+ }
35
+ child.on("close", (code, signal) => {
36
+ if (code === 0) resolve();
37
+ else if (signal !== null) reject(/* @__PURE__ */ new Error(`"${cmd} ${args.join(" ")}" was terminated by signal ${signal}`));
38
+ else reject(/* @__PURE__ */ new Error(`"${cmd} ${args.join(" ")}" exited with code ${code}`));
39
+ });
40
+ child.on("error", reject);
41
+ });
42
+ }
43
+ //#endregion
44
+ export { tokenize as n, spawnAsync as t };
45
+
46
+ //# sourceMappingURL=shell-DqqWsHCD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-DqqWsHCD.js","names":[],"sources":["../../../internals/utils/src/shell.ts"],"sourcesContent":["import { spawn } from 'node:child_process'\n\n/**\n * Tokenizes a shell command string, respecting single and double quotes.\n *\n * @example\n * tokenize('git commit -m \"initial commit\"')\n * // → ['git', 'commit', '-m', 'initial commit']\n */\nexport function tokenize(command: string): string[] {\n return (command.match(/[^\\s\"']+|\"([^\"]*)\"|'([^']*)'/g) ?? []).map((token) => token.replace(/^[\"']|[\"']$/g, ''))\n}\n\ntype SpawnOptions = {\n /** Working directory for the child process. Defaults to `process.cwd()`. */\n cwd?: string\n /** Environment variables passed to the child process. Defaults to the parent's `process.env`. */\n env?: NodeJS.ProcessEnv\n /**\n * When `true`, spawns a detached background process and resolves immediately.\n * The child is unref'd so the parent process can exit independently.\n * Defaults to `false` (foreground — inherits stdio and waits for exit).\n */\n detached?: boolean\n}\n\n/**\n * Spawns `cmd` with `args` and returns a promise that settles when the child process finishes.\n *\n * Foreground mode (default) inherits the parent's stdio and rejects on non-zero exit or signal.\n * Detached mode spawns the child in its own process group, unref's it, and resolves immediately —\n * the parent can exit without waiting for the child.\n */\nexport function spawnAsync(cmd: string, args: string[], options: SpawnOptions = {}): Promise<void> {\n const { cwd = process.cwd(), env, detached = false } = options\n\n return new Promise((resolve, reject) => {\n const child = spawn(cmd, args, {\n stdio: detached ? 'ignore' : 'inherit',\n cwd,\n env,\n detached,\n })\n\n if (detached) {\n child.unref()\n resolve()\n return\n }\n\n child.on('close', (code, signal) => {\n if (code === 0) {\n resolve()\n } else if (signal !== null) {\n reject(new Error(`\"${cmd} ${args.join(' ')}\" was terminated by signal ${signal}`))\n } else {\n reject(new Error(`\"${cmd} ${args.join(' ')}\" exited with code ${code}`))\n }\n })\n child.on('error', reject)\n })\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,SAAS,SAA2B;AAClD,SAAQ,QAAQ,MAAM,gCAAgC,IAAI,EAAE,EAAE,KAAK,UAAU,MAAM,QAAQ,gBAAgB,GAAG,CAAC;;;;;;;;;AAuBjH,SAAgB,WAAW,KAAa,MAAgB,UAAwB,EAAE,EAAiB;CACjG,MAAM,EAAE,MAAM,QAAQ,KAAK,EAAE,KAAK,WAAW,UAAU;AAEvD,QAAO,IAAI,SAAS,SAAS,WAAW;EACtC,MAAM,QAAQ,MAAM,KAAK,MAAM;GAC7B,OAAO,WAAW,WAAW;GAC7B;GACA;GACA;GACD,CAAC;AAEF,MAAI,UAAU;AACZ,SAAM,OAAO;AACb,YAAS;AACT;;AAGF,QAAM,GAAG,UAAU,MAAM,WAAW;AAClC,OAAI,SAAS,EACX,UAAS;YACA,WAAW,KACpB,wBAAO,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,KAAK,IAAI,CAAC,6BAA6B,SAAS,CAAC;OAElF,wBAAO,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,KAAK,IAAI,CAAC,qBAAqB,OAAO,CAAC;IAE1E;AACF,QAAM,GAAG,SAAS,OAAO;GACzB"}
@@ -1,32 +1,63 @@
1
1
  const require_chunk = require("./chunk-ByKO4r7w.cjs");
2
- const require_constants = require("./constants-CnPOlsJq.cjs");
2
+ const require_constants = require("./constants-BTUap0zs.cjs");
3
3
  let node_crypto = require("node:crypto");
4
+ let node_dns = require("node:dns");
4
5
  let node_os = require("node:os");
5
6
  node_os = require_chunk.__toESM(node_os);
6
7
  let node_process = require("node:process");
7
8
  node_process = require_chunk.__toESM(node_process);
8
- let _kubb_core_utils = require("@kubb/core/utils");
9
- //#region src/utils/envDetection.ts
9
+ //#region ../../internals/utils/src/env.ts
10
10
  /**
11
- * Check if running in GitHub Actions environment
11
+ * Returns `true` when running inside a GitHub Actions workflow.
12
12
  */
13
13
  function isGitHubActions() {
14
14
  return !!process.env.GITHUB_ACTIONS;
15
15
  }
16
16
  /**
17
- * Check if running in any CI environment.
18
- * Covers all major CI systems via their well-known environment variables.
17
+ * Returns `true` when the process is running in a CI environment.
18
+ * Covers GitHub Actions, GitLab CI, CircleCI, Travis CI, Jenkins, Bitbucket,
19
+ * TeamCity, Buildkite, and Azure Pipelines.
19
20
  */
20
21
  function isCIEnvironment() {
21
22
  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);
22
23
  }
23
24
  /**
24
- * Check if TTY is available for interactive output
25
+ * Returns `true` when the process has an interactive TTY and is not running in CI.
25
26
  */
26
27
  function canUseTTY() {
27
28
  return !!process.stdout.isTTY && !isCIEnvironment();
28
29
  }
29
30
  //#endregion
31
+ //#region ../../internals/utils/src/network.ts
32
+ /** Well-known stable domains used as DNS probes to check internet connectivity. */
33
+ const TEST_DOMAINS = [
34
+ "dns.google.com",
35
+ "cloudflare.com",
36
+ "one.one.one.one"
37
+ ];
38
+ /**
39
+ * Returns `true` when the system has internet connectivity.
40
+ * Uses DNS resolution against well-known stable domains as a lightweight probe.
41
+ */
42
+ async function isOnline() {
43
+ for (const domain of TEST_DOMAINS) try {
44
+ await node_dns.promises.resolve(domain);
45
+ return true;
46
+ } catch {}
47
+ return false;
48
+ }
49
+ /**
50
+ * Executes `fn` only when the system is online. Returns `null` when offline or on error.
51
+ */
52
+ async function executeIfOnline(fn) {
53
+ if (!await isOnline()) return null;
54
+ try {
55
+ return await fn();
56
+ } catch {
57
+ return null;
58
+ }
59
+ }
60
+ //#endregion
30
61
  //#region src/utils/telemetry.ts
31
62
  /**
32
63
  * Detect whether the current process is running inside a CI environment.
@@ -134,7 +165,7 @@ function buildOtlpPayload(event) {
134
165
  */
135
166
  async function sendTelemetry(event) {
136
167
  if (isTelemetryDisabled()) return;
137
- await (0, _kubb_core_utils.executeIfOnline)(async () => {
168
+ await executeIfOnline(async () => {
138
169
  try {
139
170
  await fetch(`${require_constants.OTLP_ENDPOINT}/v1/traces`, {
140
171
  method: "POST",
@@ -181,6 +212,12 @@ Object.defineProperty(exports, "canUseTTY", {
181
212
  return canUseTTY;
182
213
  }
183
214
  });
215
+ Object.defineProperty(exports, "executeIfOnline", {
216
+ enumerable: true,
217
+ get: function() {
218
+ return executeIfOnline;
219
+ }
220
+ });
184
221
  Object.defineProperty(exports, "isGitHubActions", {
185
222
  enumerable: true,
186
223
  get: function() {
@@ -200,4 +237,4 @@ Object.defineProperty(exports, "sendTelemetry", {
200
237
  }
201
238
  });
202
239
 
203
- //# sourceMappingURL=telemetry-T5IA2dWA.cjs.map
240
+ //# sourceMappingURL=telemetry-Cn9X1I5B.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-Cn9X1I5B.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 */\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 */\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 and is not running in CI.\n */\nexport function canUseTTY(): boolean {\n return !!process.stdout.isTTY && !isCIEnvironment()\n}\n","import { promises as dnsPromises } from 'node:dns'\n\n/** Well-known stable domains used as DNS probes to check internet connectivity. */\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 * Uses DNS resolution against well-known stable domains as a lightweight probe.\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 */\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 { key: 'options', value: { stringValue: JSON.stringify({ ...p.options, usedEnumNames: undefined }) } },\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 { key: 'service.version', value: { stringValue: event.kubbVersion } },\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: { code: (event.status === 'success' ? 1 : 2) satisfies OtlpStatusCode },\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":";;;;;;;;;;;;AAGA,SAAgB,kBAA2B;AACzC,QAAO,CAAC,CAAC,QAAQ,IAAI;;;;;;;AAQvB,SAA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AChC,MAAI;AACF,SAAM,MAAM,GAAGC,kBAAAA,cAAc,aAAa;IACxC,QAAQ;IACR,SAAS;KACP,gBAAgB;KAChB,0BAA0B;KAC1B,yBAAyB;KAC1B;IACD,MAAM,KAAK,UAAU,iBAAiB,MAAM,CAAC;IAC7C,QAAQ,YAAY,QAAQ,IAAM;IACnC,CAAC;WACK,IAAI;GAGb;;;;;;AAOJ,SAAgB,oBAAoB,SAOjB;CACjB,MAAM,CAAC,SAAS,eAAeD,aAAAA,QAAQ,OAAO,QAAQ,QAAQ;CAC9D,MAAM,WAAW,KAAK,MAAM,UAAU,MAAO,cAAc,IAAI;AAE/D,QAAO;EACL,SAAS,QAAQ;EACjB,aAAa,QAAQ;EACrB,aAAaA,aAAAA,QAAQ,SAAS,KAAK,MAAM,IAAI,CAAC;EAC9C,UAAUE,QAAAA,QAAG,UAAU;EACvB,IAAI,MAAM;EACV,SAAS,QAAQ,WAAW,EAAE;EAC9B;EACA,cAAc,QAAQ,gBAAgB;EACtC,QAAQ,QAAQ;EACjB"}
@@ -1,30 +1,61 @@
1
1
  import "./chunk--u3MIqq1.js";
2
- import { n as OTLP_ENDPOINT } from "./constants-CEKRremI.js";
2
+ import { n as OTLP_ENDPOINT } from "./constants-CM3dJzjK.js";
3
3
  import { randomBytes } from "node:crypto";
4
+ import { promises } from "node:dns";
4
5
  import os from "node:os";
5
6
  import process$1 from "node:process";
6
- import { executeIfOnline } from "@kubb/core/utils";
7
- //#region src/utils/envDetection.ts
7
+ //#region ../../internals/utils/src/env.ts
8
8
  /**
9
- * Check if running in GitHub Actions environment
9
+ * Returns `true` when running inside a GitHub Actions workflow.
10
10
  */
11
11
  function isGitHubActions() {
12
12
  return !!process.env.GITHUB_ACTIONS;
13
13
  }
14
14
  /**
15
- * Check if running in any CI environment.
16
- * Covers all major CI systems via their well-known environment variables.
15
+ * Returns `true` when the process is running in a CI environment.
16
+ * Covers GitHub Actions, GitLab CI, CircleCI, Travis CI, Jenkins, Bitbucket,
17
+ * TeamCity, Buildkite, and Azure Pipelines.
17
18
  */
18
19
  function isCIEnvironment() {
19
20
  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);
20
21
  }
21
22
  /**
22
- * Check if TTY is available for interactive output
23
+ * Returns `true` when the process has an interactive TTY and is not running in CI.
23
24
  */
24
25
  function canUseTTY() {
25
26
  return !!process.stdout.isTTY && !isCIEnvironment();
26
27
  }
27
28
  //#endregion
29
+ //#region ../../internals/utils/src/network.ts
30
+ /** Well-known stable domains used as DNS probes to check internet connectivity. */
31
+ const TEST_DOMAINS = [
32
+ "dns.google.com",
33
+ "cloudflare.com",
34
+ "one.one.one.one"
35
+ ];
36
+ /**
37
+ * Returns `true` when the system has internet connectivity.
38
+ * Uses DNS resolution against well-known stable domains as a lightweight probe.
39
+ */
40
+ async function isOnline() {
41
+ for (const domain of TEST_DOMAINS) try {
42
+ await promises.resolve(domain);
43
+ return true;
44
+ } catch {}
45
+ return false;
46
+ }
47
+ /**
48
+ * Executes `fn` only when the system is online. Returns `null` when offline or on error.
49
+ */
50
+ async function executeIfOnline(fn) {
51
+ if (!await isOnline()) return null;
52
+ try {
53
+ return await fn();
54
+ } catch {
55
+ return null;
56
+ }
57
+ }
58
+ //#endregion
28
59
  //#region src/utils/telemetry.ts
29
60
  /**
30
61
  * Detect whether the current process is running inside a CI environment.
@@ -167,6 +198,6 @@ function buildTelemetryEvent(options) {
167
198
  };
168
199
  }
169
200
  //#endregion
170
- export { isGitHubActions as a, canUseTTY as i, isTelemetryDisabled as n, sendTelemetry as r, buildTelemetryEvent as t };
201
+ export { canUseTTY as a, executeIfOnline as i, isTelemetryDisabled as n, isGitHubActions as o, sendTelemetry as r, buildTelemetryEvent as t };
171
202
 
172
- //# sourceMappingURL=telemetry-C4gOKX2x.js.map
203
+ //# sourceMappingURL=telemetry-DxiR7clS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-DxiR7clS.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 */\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 */\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 and is not running in CI.\n */\nexport function canUseTTY(): boolean {\n return !!process.stdout.isTTY && !isCIEnvironment()\n}\n","import { promises as dnsPromises } from 'node:dns'\n\n/** Well-known stable domains used as DNS probes to check internet connectivity. */\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 * Uses DNS resolution against well-known stable domains as a lightweight probe.\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 */\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 { key: 'options', value: { stringValue: JSON.stringify({ ...p.options, usedEnumNames: undefined }) } },\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 { key: 'service.version', value: { stringValue: event.kubbVersion } },\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: { code: (event.status === 'success' ? 1 : 2) satisfies OtlpStatusCode },\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":";;;;;;;;;;AAGA,SAAgB,kBAA2B;AACzC,QAAO,CAAC,CAAC,QAAQ,IAAI;;;;;;;AAQvB,SAAgB,kBAA2B;AACzC,QAAO,CAAC,EACN,QAAQ,IAAI,MACZ,QAAQ,IAAI,kBACZ,QAAQ,IAAI,aACZ,QAAQ,IAAI,0BACZ,QAAQ,IAAI,eACZ,QAAQ,IAAI,YACZ,QAAQ,IAAI,UACZ,QAAQ,IAAI,oBACZ,QAAQ,IAAI,aACZ,QAAQ,IAAI;;;;;AAOhB,SAAgB,YAAqB;AACnC,QAAO,CAAC,CAAC,QAAQ,OAAO,SAAS,CAAC,iBAAiB;;;;;AC5BrD,MAAM,eAAe;CAAC;CAAkB;CAAkB;CAAkB;;;;;AAM5E,eAAsB,WAA6B;AACjD,MAAK,MAAM,UAAU,aACnB,KAAI;AACF,QAAMA,SAAY,QAAQ,OAAO;AACjC,SAAO;SACD;AAKV,QAAO;;;;;AAMT,eAAsB,gBAAmB,IAAyC;AAChF,KAAI,CAAE,MAAM,UAAU,CAAG,QAAO;AAEhC,KAAI;AACF,SAAO,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u3MIqq1.js";
2
- import { t as version } from "./package-681jTtCk.js";
3
- import { n as defineCommand } from "./types-CLtz0jem.js";
2
+ import { n as defineCommand } from "./define--M_JMcDC.js";
3
+ import { t as version } from "./package-DeOlqJ31.js";
4
4
  //#region src/commands/validate.ts
5
5
  const command = defineCommand({
6
6
  name: "validate",
@@ -12,7 +12,7 @@ const command = defineCommand({
12
12
  required: true
13
13
  } },
14
14
  async run({ values }) {
15
- const { runValidate } = await import("./validate-Chjg23AE.js");
15
+ const { runValidate } = await import("./validate-l8vLmwKA.js");
16
16
  await runValidate({
17
17
  input: values.input,
18
18
  version
@@ -22,4 +22,4 @@ const command = defineCommand({
22
22
  //#endregion
23
23
  export { command };
24
24
 
25
- //# sourceMappingURL=validate-Cr26q5xX.js.map
25
+ //# sourceMappingURL=validate-BH2Ysgxr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-BH2Ysgxr.js","names":[],"sources":["../src/commands/validate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'validate',\n description: 'Validate a Swagger/OpenAPI file',\n options: {\n input: { type: 'string', description: 'Path to Swagger/OpenAPI file', short: 'i', required: true },\n },\n async run({ values }) {\n const { runValidate } = await import('../runners/validate.ts')\n\n await runValidate({ input: values.input, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS,EACP,OAAO;EAAE,MAAM;EAAU,aAAa;EAAgC,OAAO;EAAK,UAAU;EAAM,EACnG;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,gBAAgB,MAAM,OAAO;AAErC,QAAM,YAAY;GAAE,OAAO,OAAO;GAAO;GAAS,CAAC;;CAEtD,CAAC"}
@@ -1,7 +1,8 @@
1
1
  require("./chunk-ByKO4r7w.cjs");
2
- const require_package = require("./package-aKgzEJtp.cjs");
2
+ const require_define = require("./define-D6Kfm7-Z.cjs");
3
+ const require_package = require("./package-BXijqaX5.cjs");
3
4
  //#region src/commands/validate.ts
4
- const command = require("./types-Ck2lzFON.cjs").defineCommand({
5
+ const command = require_define.defineCommand({
5
6
  name: "validate",
6
7
  description: "Validate a Swagger/OpenAPI file",
7
8
  options: { input: {
@@ -11,7 +12,7 @@ const command = require("./types-Ck2lzFON.cjs").defineCommand({
11
12
  required: true
12
13
  } },
13
14
  async run({ values }) {
14
- const { runValidate } = await Promise.resolve().then(() => require("./validate-Dqi9T_c4.cjs"));
15
+ const { runValidate } = await Promise.resolve().then(() => require("./validate-Bbrn3Q-A.cjs"));
15
16
  await runValidate({
16
17
  input: values.input,
17
18
  version: require_package.version
@@ -21,4 +22,4 @@ const command = require("./types-Ck2lzFON.cjs").defineCommand({
21
22
  //#endregion
22
23
  exports.command = command;
23
24
 
24
- //# sourceMappingURL=validate-DURmg-2Q.cjs.map
25
+ //# sourceMappingURL=validate-BQvsoQz-.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-BQvsoQz-.cjs","names":["defineCommand"],"sources":["../src/commands/validate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'validate',\n description: 'Validate a Swagger/OpenAPI file',\n options: {\n input: { type: 'string', description: 'Path to Swagger/OpenAPI file', short: 'i', required: true },\n },\n async run({ values }) {\n const { runValidate } = await import('../runners/validate.ts')\n\n await runValidate({ input: values.input, version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS,EACP,OAAO;EAAE,MAAM;EAAU,aAAa;EAAgC,OAAO;EAAK,UAAU;EAAM,EACnG;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,gBAAgB,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,0BAAA,CAAA;AAE9B,QAAM,YAAY;GAAE,OAAO,OAAO;GAAO,SAAA,gBAAA;GAAS,CAAC;;CAEtD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-ByKO4r7w.cjs");
2
- const require_telemetry = require("./telemetry-T5IA2dWA.cjs");
3
- const require_errors = require("./errors-BUjJsNoe.cjs");
4
- const require_jiti = require("./jiti-BdskUHhD.cjs");
2
+ const require_errors = require("./errors-DBW0N9w4.cjs");
3
+ const require_telemetry = require("./telemetry-Cn9X1I5B.cjs");
4
+ const require_jiti = require("./jiti-Cd3S0xwr.cjs");
5
5
  let node_process = require("node:process");
6
6
  node_process = require_chunk.__toESM(node_process);
7
7
  //#region src/runners/validate.ts
@@ -39,4 +39,4 @@ async function runValidate({ input, version }) {
39
39
  //#endregion
40
40
  exports.runValidate = runValidate;
41
41
 
42
- //# sourceMappingURL=validate-Dqi9T_c4.cjs.map
42
+ //# sourceMappingURL=validate-Bbrn3Q-A.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-Bbrn3Q-A.cjs","names":["jiti","process","sendTelemetry","buildTelemetryEvent","getErrorMessage"],"sources":["../src/runners/validate.ts"],"sourcesContent":["import process from 'node:process'\nimport { getErrorMessage } from '@internals/utils'\nimport type * as OasModule from '@kubb/oas'\nimport { jiti } from '../utils/jiti.ts'\nimport { buildTelemetryEvent, sendTelemetry } from '../utils/telemetry.ts'\n\ntype ValidateOptions = {\n input: string\n version: string\n}\n\nexport async function runValidate({ input, version }: ValidateOptions): Promise<void> {\n let mod: typeof OasModule\n try {\n mod = (await jiti.import('@kubb/oas', { default: true })) as typeof OasModule\n } catch (_e) {\n console.error(`Import of '@kubb/oas' is required to do validation`)\n process.exit(1)\n }\n\n const { parse } = mod\n const hrStart = process.hrtime()\n try {\n const oas = await parse(input)\n await oas.validate()\n\n await sendTelemetry(buildTelemetryEvent({ command: 'validate', kubbVersion: version, hrStart, status: 'success' }))\n console.log('✅ Validation success')\n } catch (error) {\n await sendTelemetry(buildTelemetryEvent({ command: 'validate', kubbVersion: version, hrStart, status: 'failed' }))\n console.error('❌ Validation failed')\n console.error(getErrorMessage(error))\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;AAWA,eAAsB,YAAY,EAAE,OAAO,WAA2C;CACpF,IAAI;AACJ,KAAI;AACF,QAAO,MAAMA,aAAAA,KAAK,OAAO,aAAa,EAAE,SAAS,MAAM,CAAC;UACjD,IAAI;AACX,UAAQ,MAAM,qDAAqD;AACnE,eAAA,QAAQ,KAAK,EAAE;;CAGjB,MAAM,EAAE,UAAU;CAClB,MAAM,UAAUC,aAAAA,QAAQ,QAAQ;AAChC,KAAI;AAEF,SADY,MAAM,MAAM,MAAM,EACpB,UAAU;AAEpB,QAAMC,kBAAAA,cAAcC,kBAAAA,oBAAoB;GAAE,SAAS;GAAY,aAAa;GAAS;GAAS,QAAQ;GAAW,CAAC,CAAC;AACnH,UAAQ,IAAI,uBAAuB;UAC5B,OAAO;AACd,QAAMD,kBAAAA,cAAcC,kBAAAA,oBAAoB;GAAE,SAAS;GAAY,aAAa;GAAS;GAAS,QAAQ;GAAU,CAAC,CAAC;AAClH,UAAQ,MAAM,sBAAsB;AACpC,UAAQ,MAAMC,eAAAA,gBAAgB,MAAM,CAAC;AACrC,eAAA,QAAQ,KAAK,EAAE"}
@@ -1,7 +1,7 @@
1
1
  import "./chunk--u3MIqq1.js";
2
- import { r as sendTelemetry, t as buildTelemetryEvent } from "./telemetry-C4gOKX2x.js";
3
- import { t as getErrorMessage } from "./errors-bSLTEh4e.js";
4
- import { t as jiti } from "./jiti-Cl7t20dO.js";
2
+ import { t as getErrorMessage } from "./errors-6mF_WKxg.js";
3
+ import { r as sendTelemetry, t as buildTelemetryEvent } from "./telemetry-DxiR7clS.js";
4
+ import { t as jiti } from "./jiti-e08mD2Ph.js";
5
5
  import process from "node:process";
6
6
  //#region src/runners/validate.ts
7
7
  async function runValidate({ input, version }) {
@@ -38,4 +38,4 @@ async function runValidate({ input, version }) {
38
38
  //#endregion
39
39
  export { runValidate };
40
40
 
41
- //# sourceMappingURL=validate-Chjg23AE.js.map
41
+ //# sourceMappingURL=validate-l8vLmwKA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-l8vLmwKA.js","names":[],"sources":["../src/runners/validate.ts"],"sourcesContent":["import process from 'node:process'\nimport { getErrorMessage } from '@internals/utils'\nimport type * as OasModule from '@kubb/oas'\nimport { jiti } from '../utils/jiti.ts'\nimport { buildTelemetryEvent, sendTelemetry } from '../utils/telemetry.ts'\n\ntype ValidateOptions = {\n input: string\n version: string\n}\n\nexport async function runValidate({ input, version }: ValidateOptions): Promise<void> {\n let mod: typeof OasModule\n try {\n mod = (await jiti.import('@kubb/oas', { default: true })) as typeof OasModule\n } catch (_e) {\n console.error(`Import of '@kubb/oas' is required to do validation`)\n process.exit(1)\n }\n\n const { parse } = mod\n const hrStart = process.hrtime()\n try {\n const oas = await parse(input)\n await oas.validate()\n\n await sendTelemetry(buildTelemetryEvent({ command: 'validate', kubbVersion: version, hrStart, status: 'success' }))\n console.log('✅ Validation success')\n } catch (error) {\n await sendTelemetry(buildTelemetryEvent({ command: 'validate', kubbVersion: version, hrStart, status: 'failed' }))\n console.error('❌ Validation failed')\n console.error(getErrorMessage(error))\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;AAWA,eAAsB,YAAY,EAAE,OAAO,WAA2C;CACpF,IAAI;AACJ,KAAI;AACF,QAAO,MAAM,KAAK,OAAO,aAAa,EAAE,SAAS,MAAM,CAAC;UACjD,IAAI;AACX,UAAQ,MAAM,qDAAqD;AACnE,UAAQ,KAAK,EAAE;;CAGjB,MAAM,EAAE,UAAU;CAClB,MAAM,UAAU,QAAQ,QAAQ;AAChC,KAAI;AAEF,SADY,MAAM,MAAM,MAAM,EACpB,UAAU;AAEpB,QAAM,cAAc,oBAAoB;GAAE,SAAS;GAAY,aAAa;GAAS;GAAS,QAAQ;GAAW,CAAC,CAAC;AACnH,UAAQ,IAAI,uBAAuB;UAC5B,OAAO;AACd,QAAM,cAAc,oBAAoB;GAAE,SAAS;GAAY,aAAa;GAAS;GAAS,QAAQ;GAAU,CAAC,CAAC;AAClH,UAAQ,MAAM,sBAAsB;AACpC,UAAQ,MAAM,gBAAgB,MAAM,CAAC;AACrC,UAAQ,KAAK,EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/cli",
3
- "version": "4.33.0",
3
+ "version": "4.33.2",
4
4
  "description": "Command-line interface for Kubb, enabling easy generation of TypeScript, React-Query, Zod, and other code from OpenAPI specifications.",
5
5
  "keywords": [
6
6
  "cli",
@@ -58,13 +58,14 @@
58
58
  "cosmiconfig": "^9.0.1",
59
59
  "jiti": "2.5.1",
60
60
  "tinyexec": "^1.0.2",
61
- "@kubb/core": "4.33.0"
61
+ "@kubb/core": "4.33.2"
62
62
  },
63
63
  "devDependencies": {
64
64
  "source-map-support": "^0.5.21",
65
- "@kubb/agent": "4.33.0",
66
- "@kubb/mcp": "4.33.0",
67
- "@kubb/oas": "4.33.0"
65
+ "@internals/utils": "0.0.0",
66
+ "@kubb/agent": "4.33.2",
67
+ "@kubb/mcp": "4.33.2",
68
+ "@kubb/oas": "4.33.2"
68
69
  },
69
70
  "engines": {
70
71
  "node": ">=20"
@@ -1,6 +1,6 @@
1
1
  import path from 'node:path'
2
+ import { defineCommand } from '@internals/utils'
2
3
  import { version } from '../../../package.json'
3
- import { defineCommand } from '../../cli/index.ts'
4
4
  import { agentDefaults } from '../../constants.ts'
5
5
 
6
6
  export const command = defineCommand({
@@ -1,4 +1,4 @@
1
- import { defineCommand } from '../cli/index.ts'
1
+ import { defineCommand } from '@internals/utils'
2
2
  import { command as startCommand } from './agent/start.ts'
3
3
 
4
4
  export const command = defineCommand({
@@ -1,4 +1,4 @@
1
- import { defineCommand } from '../cli/index.ts'
1
+ import { defineCommand } from '@internals/utils'
2
2
 
3
3
  export const command = defineCommand({
4
4
  name: 'generate',
@@ -1,5 +1,5 @@
1
+ import { defineCommand } from '@internals/utils'
1
2
  import { version } from '../../package.json'
2
- import { defineCommand } from '../cli/index.ts'
3
3
 
4
4
  export const command = defineCommand({
5
5
  name: 'init',
@@ -1,5 +1,5 @@
1
+ import { defineCommand } from '@internals/utils'
1
2
  import { version } from '../../package.json'
2
- import { defineCommand } from '../cli/index.ts'
3
3
 
4
4
  export const command = defineCommand({
5
5
  name: 'mcp',
@@ -1,5 +1,5 @@
1
+ import { defineCommand } from '@internals/utils'
1
2
  import { version } from '../../package.json'
2
- import { defineCommand } from '../cli/index.ts'
3
3
 
4
4
  export const command = defineCommand({
5
5
  name: 'validate',
package/src/constants.ts CHANGED
@@ -74,4 +74,3 @@ export const pluginDefaultConfigs = {
74
74
  } as const satisfies Record<string, string>
75
75
 
76
76
  /** Color palette used by randomCliColor() for deterministic plugin name coloring. */
77
- export const randomColors = ['black', 'red', 'green', 'yellow', 'blue', 'white', 'magenta', 'cyan', 'gray', 'blue'] as const
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { styleText } from 'node:util'
2
+ import { createCLI } from '@internals/utils'
2
3
  import { version } from '../package.json'
3
- import { createCLI } from './cli/index.ts'
4
4
  import { isTelemetryDisabled } from './utils/telemetry.ts'
5
5
 
6
6
  const cli = createCLI()