@kubb/cli 5.0.0-alpha.6 → 5.0.0-alpha.60

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/README.md +4 -2
  2. package/bin/kubb.js +6 -0
  3. package/dist/{agent-CCb1mJmy.cjs → agent-9Xq6jMhS.cjs} +5 -5
  4. package/dist/agent-9Xq6jMhS.cjs.map +1 -0
  5. package/dist/agent-CouS-H2S.js +112 -0
  6. package/dist/agent-CouS-H2S.js.map +1 -0
  7. package/dist/{agent-Dq1OWkeN.js → agent-NodblB-8.js} +5 -5
  8. package/dist/agent-NodblB-8.js.map +1 -0
  9. package/dist/agent-Zo8CQwxZ.cjs +116 -0
  10. package/dist/agent-Zo8CQwxZ.cjs.map +1 -0
  11. package/dist/{constants-BTUap0zs.cjs → constants-BgLUQ1nx.cjs} +50 -9
  12. package/dist/constants-BgLUQ1nx.cjs.map +1 -0
  13. package/dist/{constants-CM3dJzjK.js → constants-mIdg9ls2.js} +39 -10
  14. package/dist/constants-mIdg9ls2.js.map +1 -0
  15. package/dist/define-Bdn8j5VM.cjs +54 -0
  16. package/dist/define-Bdn8j5VM.cjs.map +1 -0
  17. package/dist/define-Ctii4bel.js +43 -0
  18. package/dist/define-Ctii4bel.js.map +1 -0
  19. package/dist/{errors-DBW0N9w4.cjs → errors-CLCjoSg0.cjs} +22 -6
  20. package/dist/errors-CLCjoSg0.cjs.map +1 -0
  21. package/dist/errors-CjPmyZHy.js +43 -0
  22. package/dist/errors-CjPmyZHy.js.map +1 -0
  23. package/dist/{generate-CH1EAyW4.cjs → generate-BbtShu-5.cjs} +3 -3
  24. package/dist/generate-BbtShu-5.cjs.map +1 -0
  25. package/dist/{generate-B9sA0jDk.js → generate-CIDU9zdG.js} +3 -3
  26. package/dist/generate-CIDU9zdG.js.map +1 -0
  27. package/dist/{generate-DM1NsxI1.cjs → generate-DDVnxPVr.cjs} +555 -262
  28. package/dist/generate-DDVnxPVr.cjs.map +1 -0
  29. package/dist/{generate-D2nVnbYA.js → generate-DvxkzxAz.js} +548 -255
  30. package/dist/generate-DvxkzxAz.js.map +1 -0
  31. package/dist/index.cjs +49 -21
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js +49 -21
  35. package/dist/index.js.map +1 -1
  36. package/dist/{init-hmolV6B4.cjs → init-CmrUd26x.cjs} +31 -21
  37. package/dist/init-CmrUd26x.cjs.map +1 -0
  38. package/dist/{init-Dpm2lzZO.js → init-D6yLHBUa.js} +4 -4
  39. package/dist/init-D6yLHBUa.js.map +1 -0
  40. package/dist/{init-C-InrmSY.js → init-DEC1gCsk.js} +27 -17
  41. package/dist/init-DEC1gCsk.js.map +1 -0
  42. package/dist/{init-B80nQshO.cjs → init-LU4o4mUD.cjs} +4 -4
  43. package/dist/init-LU4o4mUD.cjs.map +1 -0
  44. package/dist/{mcp-ChHFPRzD.cjs → mcp-BCLUiocM.cjs} +12 -6
  45. package/dist/mcp-BCLUiocM.cjs.map +1 -0
  46. package/dist/{mcp-BDZI-Jjk.js → mcp-BYPRrpmX.js} +4 -4
  47. package/dist/{mcp-BDZI-Jjk.js.map → mcp-BYPRrpmX.js.map} +1 -1
  48. package/dist/{mcp-D2SHEg_d.js → mcp-C-HbwyVA.js} +11 -4
  49. package/dist/mcp-C-HbwyVA.js.map +1 -0
  50. package/dist/{mcp-gFMKRdfg.cjs → mcp-f5A7Ujp8.cjs} +4 -4
  51. package/dist/{mcp-gFMKRdfg.cjs.map → mcp-f5A7Ujp8.cjs.map} +1 -1
  52. package/dist/{package-BTEeDglN.cjs → package-8UFu3zi8.cjs} +2 -2
  53. package/dist/package-8UFu3zi8.cjs.map +1 -0
  54. package/dist/package-CI2GGuZk.js +6 -0
  55. package/dist/package-CI2GGuZk.js.map +1 -0
  56. package/dist/{shell-7HPrTCJ5.cjs → shell-475fQKaX.cjs} +8 -3
  57. package/dist/shell-475fQKaX.cjs.map +1 -0
  58. package/dist/{shell-DqqWsHCD.js → shell-DLzN4fRo.js} +8 -3
  59. package/dist/shell-DLzN4fRo.js.map +1 -0
  60. package/dist/{telemetry-DxiR7clS.js → telemetry-CS5ZE0cN.js} +48 -6
  61. package/dist/telemetry-CS5ZE0cN.js.map +1 -0
  62. package/dist/{telemetry-Cn9X1I5B.cjs → telemetry-kmnc5OAT.cjs} +50 -8
  63. package/dist/telemetry-kmnc5OAT.cjs.map +1 -0
  64. package/dist/{validate-l8vLmwKA.js → validate-BR_0eveE.js} +5 -13
  65. package/dist/validate-BR_0eveE.js.map +1 -0
  66. package/dist/{validate-BYzj0qVB.cjs → validate-CQIfScXY.cjs} +4 -4
  67. package/dist/validate-CQIfScXY.cjs.map +1 -0
  68. package/dist/{validate-Bbrn3Q-A.cjs → validate-Db7vfaU9.cjs} +6 -14
  69. package/dist/validate-Db7vfaU9.cjs.map +1 -0
  70. package/dist/{validate-PAYtxnS6.js → validate-vlhkev2W.js} +4 -4
  71. package/dist/validate-vlhkev2W.js.map +1 -0
  72. package/package.json +47 -46
  73. package/src/commands/agent/start.ts +20 -4
  74. package/src/commands/generate.ts +35 -6
  75. package/src/commands/init.ts +6 -1
  76. package/src/commands/validate.ts +6 -1
  77. package/src/constants.ts +40 -11
  78. package/src/index.ts +10 -12
  79. package/src/loggers/clackLogger.ts +54 -46
  80. package/src/loggers/fileSystemLogger.ts +13 -11
  81. package/src/loggers/githubActionsLogger.ts +22 -22
  82. package/src/loggers/plainLogger.ts +21 -21
  83. package/src/runners/agent.ts +81 -34
  84. package/src/runners/generate.ts +98 -116
  85. package/src/runners/init.ts +9 -9
  86. package/src/runners/mcp.ts +19 -3
  87. package/src/runners/validate.ts +19 -15
  88. package/src/types.ts +11 -0
  89. package/src/utils/executeHooks.ts +15 -15
  90. package/src/utils/flags.ts +10 -0
  91. package/src/utils/getConfig.ts +10 -0
  92. package/src/utils/getCosmiConfig.ts +9 -3
  93. package/src/utils/getSummary.ts +1 -1
  94. package/src/utils/runHook.ts +27 -9
  95. package/src/utils/telemetry.ts +16 -3
  96. package/bin/kubb.cjs +0 -18
  97. package/dist/agent-C6o_6GSJ.cjs +0 -92
  98. package/dist/agent-C6o_6GSJ.cjs.map +0 -1
  99. package/dist/agent-CCb1mJmy.cjs.map +0 -1
  100. package/dist/agent-Dq1OWkeN.js.map +0 -1
  101. package/dist/agent-L50VNhXv.js +0 -88
  102. package/dist/agent-L50VNhXv.js.map +0 -1
  103. package/dist/constants-BTUap0zs.cjs.map +0 -1
  104. package/dist/constants-CM3dJzjK.js.map +0 -1
  105. package/dist/define--M_JMcDC.js +0 -25
  106. package/dist/define--M_JMcDC.js.map +0 -1
  107. package/dist/define-D6Kfm7-Z.cjs +0 -36
  108. package/dist/define-D6Kfm7-Z.cjs.map +0 -1
  109. package/dist/errors-6mF_WKxg.js +0 -27
  110. package/dist/errors-6mF_WKxg.js.map +0 -1
  111. package/dist/errors-DBW0N9w4.cjs.map +0 -1
  112. package/dist/generate-B9sA0jDk.js.map +0 -1
  113. package/dist/generate-CH1EAyW4.cjs.map +0 -1
  114. package/dist/generate-D2nVnbYA.js.map +0 -1
  115. package/dist/generate-DM1NsxI1.cjs.map +0 -1
  116. package/dist/init-B80nQshO.cjs.map +0 -1
  117. package/dist/init-C-InrmSY.js.map +0 -1
  118. package/dist/init-Dpm2lzZO.js.map +0 -1
  119. package/dist/init-hmolV6B4.cjs.map +0 -1
  120. package/dist/jiti-Cd3S0xwr.cjs +0 -16
  121. package/dist/jiti-Cd3S0xwr.cjs.map +0 -1
  122. package/dist/jiti-e08mD2Ph.js +0 -11
  123. package/dist/jiti-e08mD2Ph.js.map +0 -1
  124. package/dist/mcp-ChHFPRzD.cjs.map +0 -1
  125. package/dist/mcp-D2SHEg_d.js.map +0 -1
  126. package/dist/package-BTEeDglN.cjs.map +0 -1
  127. package/dist/package-BZMTT_6s.js +0 -6
  128. package/dist/package-BZMTT_6s.js.map +0 -1
  129. package/dist/shell-7HPrTCJ5.cjs.map +0 -1
  130. package/dist/shell-DqqWsHCD.js.map +0 -1
  131. package/dist/telemetry-Cn9X1I5B.cjs.map +0 -1
  132. package/dist/telemetry-DxiR7clS.js.map +0 -1
  133. package/dist/validate-BYzj0qVB.cjs.map +0 -1
  134. package/dist/validate-Bbrn3Q-A.cjs.map +0 -1
  135. package/dist/validate-PAYtxnS6.js.map +0 -1
  136. package/dist/validate-l8vLmwKA.js.map +0 -1
  137. package/src/utils/getIntro.ts +0 -1
@@ -1,17 +1,17 @@
1
- import type { defineConfig, UserConfig } from '@kubb/core'
1
+ import type { Config } from '@kubb/core'
2
2
  import { cosmiconfig } from 'cosmiconfig'
3
3
  import { createJiti } from 'jiti'
4
4
 
5
5
  type CosmiconfigResult = {
6
6
  filepath: string
7
7
  isEmpty?: boolean
8
- config: ReturnType<typeof defineConfig> | UserConfig
8
+ config: Config
9
9
  }
10
10
 
11
11
  const jiti = createJiti(import.meta.url, {
12
12
  jsx: {
13
13
  runtime: 'automatic',
14
- importSource: '@kubb/react-fabric',
14
+ importSource: '@kubb/renderer-jsx',
15
15
  },
16
16
  sourceMaps: true,
17
17
  interopDefault: true,
@@ -32,11 +32,15 @@ export async function getCosmiConfig(moduleName: string, config?: string): Promi
32
32
  `.${moduleName}rc.yml`,
33
33
 
34
34
  `.${moduleName}rc.ts`,
35
+ `.${moduleName}rc.mts`,
36
+ `.${moduleName}rc.cts`,
35
37
  `.${moduleName}rc.js`,
36
38
  `.${moduleName}rc.mjs`,
37
39
  `.${moduleName}rc.cjs`,
38
40
 
39
41
  `${moduleName}.config.ts`,
42
+ `${moduleName}.config.mts`,
43
+ `${moduleName}.config.cts`,
40
44
  `${moduleName}.config.js`,
41
45
  `${moduleName}.config.mjs`,
42
46
  `${moduleName}.config.cjs`,
@@ -54,6 +58,8 @@ export async function getCosmiConfig(moduleName: string, config?: string): Promi
54
58
  ],
55
59
  loaders: {
56
60
  '.ts': tsLoader,
61
+ '.mts': tsLoader,
62
+ '.cts': tsLoader,
57
63
  },
58
64
  })
59
65
 
@@ -27,7 +27,7 @@ export function getSummary({ failedPlugins, filesCreated, status, hrStart, confi
27
27
  pluginsFailed: status === 'failed' ? [...failedPlugins].map(({ plugin }) => randomCliColor(plugin.name)).join(', ') : undefined,
28
28
  filesCreated,
29
29
  time: styleText('green', duration),
30
- output: path.isAbsolute(config.root) ? path.resolve(config.root, config.output.path) : config.root,
30
+ output: path.resolve(config.root, config.output.path),
31
31
  } as const
32
32
 
33
33
  const labels = {
@@ -1,6 +1,6 @@
1
1
  import type { AsyncEventEmitter } from '@internals/utils'
2
2
  import { toError } from '@internals/utils'
3
- import type { KubbEvents } from '@kubb/core'
3
+ import type { KubbHooks } from '@kubb/core'
4
4
  import { NonZeroExitError, x } from 'tinyexec'
5
5
 
6
6
  type HookOutputSink = {
@@ -17,7 +17,7 @@ type RunHookOptions = {
17
17
  command: string
18
18
  args?: readonly string[]
19
19
  commandWithArgs: string
20
- context: AsyncEventEmitter<KubbEvents>
20
+ context: AsyncEventEmitter<KubbHooks>
21
21
  /** When true the process output is streamed line-by-line via onLine. */
22
22
  stream?: boolean
23
23
  sink?: HookOutputSink
@@ -43,23 +43,35 @@ export async function runHook({ id, command, args, commandWithArgs, context, str
43
43
 
44
44
  const result = await proc
45
45
 
46
- await context.emit('debug', {
46
+ await context.emit('kubb:debug', {
47
47
  date: new Date(),
48
48
  logs: [result.stdout.trimEnd()],
49
49
  })
50
50
 
51
- await context.emit('hook:end', { command, args, id, success: true, error: null })
51
+ await context.emit('kubb:hook:end', {
52
+ command,
53
+ args,
54
+ id,
55
+ success: true,
56
+ error: null,
57
+ })
52
58
  } catch (err) {
53
59
  if (!(err instanceof NonZeroExitError)) {
54
- await context.emit('hook:end', { command, args, id, success: false, error: toError(err) })
55
- await context.emit('error', toError(err))
60
+ await context.emit('kubb:hook:end', {
61
+ command,
62
+ args,
63
+ id,
64
+ success: false,
65
+ error: toError(err),
66
+ })
67
+ await context.emit('kubb:error', { error: toError(err) })
56
68
  return
57
69
  }
58
70
 
59
71
  const stderr = err.output?.stderr ?? ''
60
72
  const stdout = err.output?.stdout ?? ''
61
73
 
62
- await context.emit('debug', {
74
+ await context.emit('kubb:debug', {
63
75
  date: new Date(),
64
76
  logs: [stdout, stderr].filter(Boolean),
65
77
  })
@@ -69,7 +81,13 @@ export async function runHook({ id, command, args, commandWithArgs, context, str
69
81
 
70
82
  const errorMessage = new Error(`Hook execute failed: ${commandWithArgs}`)
71
83
 
72
- await context.emit('hook:end', { command, args, id, success: false, error: errorMessage })
73
- await context.emit('error', errorMessage)
84
+ await context.emit('kubb:hook:end', {
85
+ command,
86
+ args,
87
+ id,
88
+ success: false,
89
+ error: errorMessage,
90
+ })
91
+ await context.emit('kubb:error', { error: errorMessage })
74
92
  }
75
93
  }
@@ -161,7 +161,15 @@ export function buildOtlpPayload(event: TelemetryEvent): OtlpExportTraceServiceR
161
161
  kvlistValue: {
162
162
  values: [
163
163
  { key: 'name', value: { stringValue: p.name } },
164
- { key: 'options', value: { stringValue: JSON.stringify({ ...p.options, usedEnumNames: undefined }) } },
164
+ {
165
+ key: 'options',
166
+ value: {
167
+ stringValue: JSON.stringify({
168
+ ...p.options,
169
+ usedEnumNames: undefined,
170
+ }),
171
+ },
172
+ },
165
173
  ],
166
174
  },
167
175
  }),
@@ -177,7 +185,10 @@ export function buildOtlpPayload(event: TelemetryEvent): OtlpExportTraceServiceR
177
185
  resource: {
178
186
  attributes: [
179
187
  { key: 'service.name', value: { stringValue: 'kubb-cli' } },
180
- { key: 'service.version', value: { stringValue: event.kubbVersion } },
188
+ {
189
+ key: 'service.version',
190
+ value: { stringValue: event.kubbVersion },
191
+ },
181
192
  { key: 'telemetry.sdk.language', value: { stringValue: 'nodejs' } },
182
193
  ],
183
194
  },
@@ -193,7 +204,9 @@ export function buildOtlpPayload(event: TelemetryEvent): OtlpExportTraceServiceR
193
204
  startTimeUnixNano: String(startTimeNs),
194
205
  endTimeUnixNano: String(endTimeNs),
195
206
  attributes,
196
- status: { code: (event.status === 'success' ? 1 : 2) satisfies OtlpStatusCode },
207
+ status: {
208
+ code: (event.status === 'success' ? 1 : 2) satisfies OtlpStatusCode,
209
+ },
197
210
  },
198
211
  ],
199
212
  },
package/bin/kubb.cjs DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- try {
3
- const cachedSourceMaps = new Map()
4
-
5
- require('source-map-support').install({
6
- retrieveSourceMap(source) {
7
- if (cachedSourceMaps.has(source)) {
8
- return cachedSourceMaps.get(source)
9
- }
10
- return null
11
- },
12
- })
13
- } catch (_err) {}
14
-
15
- import('../dist/index.js').then(({ run }) => {
16
- process.title = 'Kubb'
17
- run(process.argv)
18
- })
@@ -1,92 +0,0 @@
1
- const require_chunk = require("./chunk-ByKO4r7w.cjs");
2
- const require_telemetry = require("./telemetry-Cn9X1I5B.cjs");
3
- const require_shell = require("./shell-7HPrTCJ5.cjs");
4
- const require_constants = require("./constants-BTUap0zs.cjs");
5
- let node_util = require("node:util");
6
- let node_path = require("node:path");
7
- node_path = require_chunk.__toESM(node_path);
8
- let node_process = require("node:process");
9
- node_process = require_chunk.__toESM(node_process);
10
- let node_net = require("node:net");
11
- node_net = require_chunk.__toESM(node_net);
12
- let node_url = require("node:url");
13
- let _clack_prompts = require("@clack/prompts");
14
- _clack_prompts = require_chunk.__toESM(_clack_prompts);
15
- //#region src/runners/agent.ts
16
- function isPortAvailable(port, host) {
17
- return new Promise((resolve) => {
18
- const server = node_net.default.createServer();
19
- server.once("error", () => resolve(false));
20
- server.once("listening", () => {
21
- server.close();
22
- resolve(true);
23
- });
24
- server.listen(port, host);
25
- });
26
- }
27
- async function runAgentStart({ port, host, configPath, allowWrite, allowAll, version }) {
28
- const hrStart = node_process.hrtime();
29
- try {
30
- try {
31
- node_process.loadEnvFile();
32
- } catch {}
33
- const agentPkgPath = (0, node_url.fileURLToPath)({}.resolve("@kubb/agent/package.json"));
34
- const agentDir = node_path.default.dirname(agentPkgPath);
35
- const serverPath = node_path.default.join(agentDir, require_constants.agentDefaults.serverEntryPath);
36
- const PORT = port !== void 0 ? port : node_process.env.PORT ?? require_constants.agentDefaults.port;
37
- const HOST = host !== require_constants.agentDefaults.host ? host : node_process.env.HOST ?? require_constants.agentDefaults.host;
38
- const KUBB_AGENT_ROOT = node_process.env.KUBB_AGENT_ROOT ?? node_process.cwd();
39
- const KUBB_AGENT_CONFIG = node_path.default.resolve(node_process.cwd(), configPath || node_process.env.KUBB_AGENT_CONFIG || require_constants.agentDefaults.configFile);
40
- const KUBB_AGENT_ALLOW_WRITE = allowAll || allowWrite ? "true" : node_process.env.KUBB_AGENT_ALLOW_WRITE ?? "false";
41
- const KUBB_AGENT_ALLOW_ALL = allowAll ? "true" : node_process.env.KUBB_AGENT_ALLOW_ALL ?? "false";
42
- const KUBB_AGENT_TOKEN = node_process.env.KUBB_AGENT_TOKEN;
43
- const KUBB_AGENT_RETRY_TIMEOUT = node_process.env.KUBB_AGENT_RETRY_TIMEOUT ?? require_constants.agentDefaults.retryTimeout;
44
- const KUBB_STUDIO_URL = node_process.env.KUBB_STUDIO_URL ?? require_constants.agentDefaults.studioUrl;
45
- const env = {
46
- ...node_process.env,
47
- PORT,
48
- HOST,
49
- KUBB_AGENT_ROOT,
50
- KUBB_AGENT_CONFIG,
51
- KUBB_AGENT_ALLOW_WRITE,
52
- KUBB_AGENT_ALLOW_ALL,
53
- KUBB_AGENT_TOKEN,
54
- KUBB_AGENT_RETRY_TIMEOUT,
55
- KUBB_STUDIO_URL
56
- };
57
- _clack_prompts.log.step((0, node_util.styleText)("cyan", "Starting agent server..."));
58
- _clack_prompts.log.info((0, node_util.styleText)("dim", `Config: ${KUBB_AGENT_CONFIG}`));
59
- _clack_prompts.log.info((0, node_util.styleText)("dim", `Host: ${HOST}`));
60
- _clack_prompts.log.info((0, node_util.styleText)("dim", `Port: ${PORT}`));
61
- if (!KUBB_AGENT_ALLOW_WRITE && !KUBB_AGENT_ALLOW_ALL) _clack_prompts.log.warn((0, node_util.styleText)("yellow", "Filesystem writes disabled. Use --allow-write or --allow-all to enable."));
62
- if (!await isPortAvailable(Number(PORT), HOST)) {
63
- _clack_prompts.log.error((0, node_util.styleText)("red", `Port ${PORT} is already in use. Stop the existing process or choose a different port with --port.`));
64
- node_process.exit(1);
65
- }
66
- console.log(env);
67
- await require_shell.spawnAsync("node", [serverPath], {
68
- env,
69
- cwd: node_process.cwd()
70
- });
71
- await require_telemetry.sendTelemetry(require_telemetry.buildTelemetryEvent({
72
- command: "agent",
73
- kubbVersion: version,
74
- hrStart,
75
- status: "success"
76
- }));
77
- } catch (error) {
78
- await require_telemetry.sendTelemetry(require_telemetry.buildTelemetryEvent({
79
- command: "agent",
80
- kubbVersion: version,
81
- hrStart,
82
- status: "failed"
83
- }));
84
- _clack_prompts.log.error((0, node_util.styleText)("red", "Failed to start agent server"));
85
- console.error(error);
86
- node_process.exit(1);
87
- }
88
- }
89
- //#endregion
90
- exports.runAgentStart = runAgentStart;
91
-
92
- //# sourceMappingURL=agent-C6o_6GSJ.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-C6o_6GSJ.cjs","names":["net","process","path","agentDefaults","spawnAsync","sendTelemetry","buildTelemetryEvent"],"sources":["../src/runners/agent.ts"],"sourcesContent":["import net from 'node:net'\nimport path from 'node:path'\nimport * as process from 'node:process'\nimport { fileURLToPath } from 'node:url'\nimport { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport { spawnAsync } from '@internals/utils'\nimport { agentDefaults } from '../constants.ts'\nimport { buildTelemetryEvent, sendTelemetry } from '../utils/telemetry.ts'\n\ntype AgentStartOptions = {\n port: string | undefined\n host: string\n configPath: string | undefined\n allowWrite: boolean\n allowAll: boolean\n version: string\n}\n\nfunction isPortAvailable(port: number, host: string): Promise<boolean> {\n return new Promise((resolve) => {\n const server = net.createServer()\n server.once('error', () => resolve(false))\n server.once('listening', () => {\n server.close()\n resolve(true)\n })\n server.listen(port, host)\n })\n}\n\nexport async function runAgentStart({ port, host, configPath, allowWrite, allowAll, version }: AgentStartOptions): Promise<void> {\n const hrStart = process.hrtime()\n\n try {\n // Load .env file into process.env using Node.js built-in (v20.12.0+)\n try {\n process.loadEnvFile()\n } catch {\n // .env file may not exist; ignore\n }\n\n // Resolve the @kubb/agent package path\n const agentPkgUrl = import.meta.resolve('@kubb/agent/package.json')\n const agentPkgPath = fileURLToPath(agentPkgUrl)\n const agentDir = path.dirname(agentPkgPath)\n const serverPath = path.join(agentDir, agentDefaults.serverEntryPath)\n\n // CLI params take priority over process.env; process.env fills in what the CLI didn't specify;\n // agentDefaults are the last resort. Build env as: defaults ← process.env ← CLI.\n const PORT = port !== undefined ? port : (process.env.PORT ?? agentDefaults.port)\n const HOST = host !== agentDefaults.host ? host : (process.env.HOST ?? agentDefaults.host)\n const KUBB_AGENT_ROOT = process.env.KUBB_AGENT_ROOT ?? process.cwd()\n const KUBB_AGENT_CONFIG = path.resolve(process.cwd(), configPath || process.env.KUBB_AGENT_CONFIG || agentDefaults.configFile)\n const KUBB_AGENT_ALLOW_WRITE = allowAll || allowWrite ? 'true' : (process.env.KUBB_AGENT_ALLOW_WRITE ?? 'false')\n const KUBB_AGENT_ALLOW_ALL = allowAll ? 'true' : (process.env.KUBB_AGENT_ALLOW_ALL ?? 'false')\n const KUBB_AGENT_TOKEN = process.env.KUBB_AGENT_TOKEN\n const KUBB_AGENT_RETRY_TIMEOUT = process.env.KUBB_AGENT_RETRY_TIMEOUT ?? agentDefaults.retryTimeout\n const KUBB_STUDIO_URL = process.env.KUBB_STUDIO_URL ?? agentDefaults.studioUrl\n\n const env = {\n ...process.env,\n PORT,\n HOST,\n KUBB_AGENT_ROOT,\n KUBB_AGENT_CONFIG,\n KUBB_AGENT_ALLOW_WRITE,\n KUBB_AGENT_ALLOW_ALL,\n KUBB_AGENT_TOKEN,\n KUBB_AGENT_RETRY_TIMEOUT,\n KUBB_STUDIO_URL,\n }\n\n clack.log.step(styleText('cyan', 'Starting agent server...'))\n clack.log.info(styleText('dim', `Config: ${KUBB_AGENT_CONFIG}`))\n clack.log.info(styleText('dim', `Host: ${HOST}`))\n clack.log.info(styleText('dim', `Port: ${PORT}`))\n if (!KUBB_AGENT_ALLOW_WRITE && !KUBB_AGENT_ALLOW_ALL) {\n clack.log.warn(styleText('yellow', 'Filesystem writes disabled. Use --allow-write or --allow-all to enable.'))\n }\n\n if (!(await isPortAvailable(Number(PORT), HOST))) {\n clack.log.error(styleText('red', `Port ${PORT} is already in use. Stop the existing process or choose a different port with --port.`))\n process.exit(1)\n }\n\n console.log(env)\n\n // Spawns the server as a detached background process so the CLI can exit independently.\n await spawnAsync('node', [serverPath], {\n env,\n cwd: process.cwd(),\n })\n\n await sendTelemetry(buildTelemetryEvent({ command: 'agent', kubbVersion: version, hrStart, status: 'success' }))\n } catch (error) {\n await sendTelemetry(buildTelemetryEvent({ command: 'agent', kubbVersion: version, hrStart, status: 'failed' }))\n clack.log.error(styleText('red', 'Failed to start agent server'))\n console.error(error)\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAS,gBAAgB,MAAc,MAAgC;AACrE,QAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,SAASA,SAAAA,QAAI,cAAc;AACjC,SAAO,KAAK,eAAe,QAAQ,MAAM,CAAC;AAC1C,SAAO,KAAK,mBAAmB;AAC7B,UAAO,OAAO;AACd,WAAQ,KAAK;IACb;AACF,SAAO,OAAO,MAAM,KAAK;GACzB;;AAGJ,eAAsB,cAAc,EAAE,MAAM,MAAM,YAAY,YAAY,UAAU,WAA6C;CAC/H,MAAM,UAAUC,aAAQ,QAAQ;AAEhC,KAAI;AAEF,MAAI;AACF,gBAAQ,aAAa;UACf;EAMR,MAAM,gBAAA,GAAA,SAAA,eAAA,EAAA,CAD0B,QAAQ,2BAA2B,CACpB;EAC/C,MAAM,WAAWC,UAAAA,QAAK,QAAQ,aAAa;EAC3C,MAAM,aAAaA,UAAAA,QAAK,KAAK,UAAUC,kBAAAA,cAAc,gBAAgB;EAIrE,MAAM,OAAO,SAAS,KAAA,IAAY,OAAQF,aAAQ,IAAI,QAAQE,kBAAAA,cAAc;EAC5E,MAAM,OAAO,SAASA,kBAAAA,cAAc,OAAO,OAAQF,aAAQ,IAAI,QAAQE,kBAAAA,cAAc;EACrF,MAAM,kBAAkBF,aAAQ,IAAI,mBAAmBA,aAAQ,KAAK;EACpE,MAAM,oBAAoBC,UAAAA,QAAK,QAAQD,aAAQ,KAAK,EAAE,cAAcA,aAAQ,IAAI,qBAAqBE,kBAAAA,cAAc,WAAW;EAC9H,MAAM,yBAAyB,YAAY,aAAa,SAAUF,aAAQ,IAAI,0BAA0B;EACxG,MAAM,uBAAuB,WAAW,SAAUA,aAAQ,IAAI,wBAAwB;EACtF,MAAM,mBAAmBA,aAAQ,IAAI;EACrC,MAAM,2BAA2BA,aAAQ,IAAI,4BAA4BE,kBAAAA,cAAc;EACvF,MAAM,kBAAkBF,aAAQ,IAAI,mBAAmBE,kBAAAA,cAAc;EAErE,MAAM,MAAM;GACV,GAAGF,aAAQ;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;AAED,iBAAM,IAAI,MAAA,GAAA,UAAA,WAAe,QAAQ,2BAA2B,CAAC;AAC7D,iBAAM,IAAI,MAAA,GAAA,UAAA,WAAe,OAAO,WAAW,oBAAoB,CAAC;AAChE,iBAAM,IAAI,MAAA,GAAA,UAAA,WAAe,OAAO,SAAS,OAAO,CAAC;AACjD,iBAAM,IAAI,MAAA,GAAA,UAAA,WAAe,OAAO,SAAS,OAAO,CAAC;AACjD,MAAI,CAAC,0BAA0B,CAAC,qBAC9B,gBAAM,IAAI,MAAA,GAAA,UAAA,WAAe,UAAU,0EAA0E,CAAC;AAGhH,MAAI,CAAE,MAAM,gBAAgB,OAAO,KAAK,EAAE,KAAK,EAAG;AAChD,kBAAM,IAAI,OAAA,GAAA,UAAA,WAAgB,OAAO,QAAQ,KAAK,uFAAuF,CAAC;AACtI,gBAAQ,KAAK,EAAE;;AAGjB,UAAQ,IAAI,IAAI;AAGhB,QAAMG,cAAAA,WAAW,QAAQ,CAAC,WAAW,EAAE;GACrC;GACA,KAAKH,aAAQ,KAAK;GACnB,CAAC;AAEF,QAAMI,kBAAAA,cAAcC,kBAAAA,oBAAoB;GAAE,SAAS;GAAS,aAAa;GAAS;GAAS,QAAQ;GAAW,CAAC,CAAC;UACzG,OAAO;AACd,QAAMD,kBAAAA,cAAcC,kBAAAA,oBAAoB;GAAE,SAAS;GAAS,aAAa;GAAS;GAAS,QAAQ;GAAU,CAAC,CAAC;AAC/G,iBAAM,IAAI,OAAA,GAAA,UAAA,WAAgB,OAAO,+BAA+B,CAAC;AACjE,UAAQ,MAAM,MAAM;AACpB,eAAQ,KAAK,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-CCb1mJmy.cjs","names":["command","defineCommand","agentDefaults","defineCommand","startCommand"],"sources":["../src/commands/agent/start.ts","../src/commands/agent.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../../package.json'\nimport { agentDefaults } from '../../constants.ts'\n\nexport const command = defineCommand({\n name: 'start',\n description: 'Start the Agent server',\n options: {\n config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },\n port: { type: 'string', description: `Port for the server (default: ${agentDefaults.port})`, short: 'p' },\n host: { type: 'string', description: 'Host for the server', default: agentDefaults.host },\n 'allow-write': {\n type: 'boolean',\n description: 'Allow writing generated files to the filesystem. When not set, no files are written and the config patch is not persisted.',\n default: false,\n },\n 'allow-all': { type: 'boolean', description: 'Grant all permissions (implies --allow-write).', default: false },\n },\n async run({ values }) {\n const { runAgentStart } = await import('../../runners/agent.ts')\n\n await runAgentStart({\n port: values.port !== undefined ? values.port : undefined,\n host: values.host,\n configPath: values.config,\n allowWrite: values['allow-write'],\n allowAll: values['allow-all'],\n version,\n })\n },\n})\n","import { defineCommand } from '@internals/utils'\nimport { command as startCommand } from './agent/start.ts'\n\nexport const command = defineCommand({\n name: 'agent',\n description: 'Manage the Kubb Agent server',\n subCommands: [startCommand],\n})\n"],"mappings":";;;;;AAIA,MAAaA,YAAUC,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,SAAS;EACP,QAAQ;GAAE,MAAM;GAAU,aAAa;GAA2B,OAAO;GAAK;EAC9E,MAAM;GAAE,MAAM;GAAU,aAAa,iCAAiCC,kBAAAA,cAAc,KAAK;GAAI,OAAO;GAAK;EACzG,MAAM;GAAE,MAAM;GAAU,aAAa;GAAuB,SAASA,kBAAAA,cAAc;GAAM;EACzF,eAAe;GACb,MAAM;GACN,aAAa;GACb,SAAS;GACV;EACD,aAAa;GAAE,MAAM;GAAW,aAAa;GAAkD,SAAS;GAAO;EAChH;CACD,MAAM,IAAI,EAAE,UAAU;EACpB,MAAM,EAAE,kBAAkB,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,uBAAA,CAAA;AAEhC,QAAM,cAAc;GAClB,MAAM,OAAO,SAAS,KAAA,IAAY,OAAO,OAAO,KAAA;GAChD,MAAM,OAAO;GACb,YAAY,OAAO;GACnB,YAAY,OAAO;GACnB,UAAU,OAAO;GACjB,SAAA,gBAAA;GACD,CAAC;;CAEL,CAAC;;;AC3BF,MAAa,UAAUC,eAAAA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,aAAa,CAACC,UAAa;CAC5B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-Dq1OWkeN.js","names":["command","startCommand"],"sources":["../src/commands/agent/start.ts","../src/commands/agent.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../../package.json'\nimport { agentDefaults } from '../../constants.ts'\n\nexport const command = defineCommand({\n name: 'start',\n description: 'Start the Agent server',\n options: {\n config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },\n port: { type: 'string', description: `Port for the server (default: ${agentDefaults.port})`, short: 'p' },\n host: { type: 'string', description: 'Host for the server', default: agentDefaults.host },\n 'allow-write': {\n type: 'boolean',\n description: 'Allow writing generated files to the filesystem. When not set, no files are written and the config patch is not persisted.',\n default: false,\n },\n 'allow-all': { type: 'boolean', description: 'Grant all permissions (implies --allow-write).', default: false },\n },\n async run({ values }) {\n const { runAgentStart } = await import('../../runners/agent.ts')\n\n await runAgentStart({\n port: values.port !== undefined ? values.port : undefined,\n host: values.host,\n configPath: values.config,\n allowWrite: values['allow-write'],\n allowAll: values['allow-all'],\n version,\n })\n },\n})\n","import { defineCommand } from '@internals/utils'\nimport { command as startCommand } from './agent/start.ts'\n\nexport const command = defineCommand({\n name: 'agent',\n description: 'Manage the Kubb Agent server',\n subCommands: [startCommand],\n})\n"],"mappings":";;;;;;ACGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,aAAa,CDFQ,cAAc;EACnC,MAAM;EACN,aAAa;EACb,SAAS;GACP,QAAQ;IAAE,MAAM;IAAU,aAAa;IAA2B,OAAO;IAAK;GAC9E,MAAM;IAAE,MAAM;IAAU,aAAa,iCAAiC,cAAc,KAAK;IAAI,OAAO;IAAK;GACzG,MAAM;IAAE,MAAM;IAAU,aAAa;IAAuB,SAAS,cAAc;IAAM;GACzF,eAAe;IACb,MAAM;IACN,aAAa;IACb,SAAS;IACV;GACD,aAAa;IAAE,MAAM;IAAW,aAAa;IAAkD,SAAS;IAAO;GAChH;EACD,MAAM,IAAI,EAAE,UAAU;GACpB,MAAM,EAAE,kBAAkB,MAAM,OAAO;AAEvC,SAAM,cAAc;IAClB,MAAM,OAAO,SAAS,KAAA,IAAY,OAAO,OAAO,KAAA;IAChD,MAAM,OAAO;IACb,YAAY,OAAO;IACnB,YAAY,OAAO;IACnB,UAAU,OAAO;IACjB;IACD,CAAC;;EAEL,CAAC,CCxB2B;CAC5B,CAAC"}
@@ -1,88 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- import { r as sendTelemetry, t as buildTelemetryEvent } from "./telemetry-DxiR7clS.js";
3
- import { t as spawnAsync } from "./shell-DqqWsHCD.js";
4
- import { a as agentDefaults } from "./constants-CM3dJzjK.js";
5
- import { styleText } from "node:util";
6
- import path from "node:path";
7
- import * as process$1 from "node:process";
8
- import net from "node:net";
9
- import { fileURLToPath } from "node:url";
10
- import * as clack from "@clack/prompts";
11
- //#region src/runners/agent.ts
12
- function isPortAvailable(port, host) {
13
- return new Promise((resolve) => {
14
- const server = net.createServer();
15
- server.once("error", () => resolve(false));
16
- server.once("listening", () => {
17
- server.close();
18
- resolve(true);
19
- });
20
- server.listen(port, host);
21
- });
22
- }
23
- async function runAgentStart({ port, host, configPath, allowWrite, allowAll, version }) {
24
- const hrStart = process$1.hrtime();
25
- try {
26
- try {
27
- process$1.loadEnvFile();
28
- } catch {}
29
- const agentPkgPath = fileURLToPath(import.meta.resolve("@kubb/agent/package.json"));
30
- const agentDir = path.dirname(agentPkgPath);
31
- const serverPath = path.join(agentDir, agentDefaults.serverEntryPath);
32
- const PORT = port !== void 0 ? port : process$1.env.PORT ?? agentDefaults.port;
33
- const HOST = host !== agentDefaults.host ? host : process$1.env.HOST ?? agentDefaults.host;
34
- const KUBB_AGENT_ROOT = process$1.env.KUBB_AGENT_ROOT ?? process$1.cwd();
35
- const KUBB_AGENT_CONFIG = path.resolve(process$1.cwd(), configPath || process$1.env.KUBB_AGENT_CONFIG || agentDefaults.configFile);
36
- const KUBB_AGENT_ALLOW_WRITE = allowAll || allowWrite ? "true" : process$1.env.KUBB_AGENT_ALLOW_WRITE ?? "false";
37
- const KUBB_AGENT_ALLOW_ALL = allowAll ? "true" : process$1.env.KUBB_AGENT_ALLOW_ALL ?? "false";
38
- const KUBB_AGENT_TOKEN = process$1.env.KUBB_AGENT_TOKEN;
39
- const KUBB_AGENT_RETRY_TIMEOUT = process$1.env.KUBB_AGENT_RETRY_TIMEOUT ?? agentDefaults.retryTimeout;
40
- const KUBB_STUDIO_URL = process$1.env.KUBB_STUDIO_URL ?? agentDefaults.studioUrl;
41
- const env = {
42
- ...process$1.env,
43
- PORT,
44
- HOST,
45
- KUBB_AGENT_ROOT,
46
- KUBB_AGENT_CONFIG,
47
- KUBB_AGENT_ALLOW_WRITE,
48
- KUBB_AGENT_ALLOW_ALL,
49
- KUBB_AGENT_TOKEN,
50
- KUBB_AGENT_RETRY_TIMEOUT,
51
- KUBB_STUDIO_URL
52
- };
53
- clack.log.step(styleText("cyan", "Starting agent server..."));
54
- clack.log.info(styleText("dim", `Config: ${KUBB_AGENT_CONFIG}`));
55
- clack.log.info(styleText("dim", `Host: ${HOST}`));
56
- clack.log.info(styleText("dim", `Port: ${PORT}`));
57
- if (!KUBB_AGENT_ALLOW_WRITE && !KUBB_AGENT_ALLOW_ALL) clack.log.warn(styleText("yellow", "Filesystem writes disabled. Use --allow-write or --allow-all to enable."));
58
- if (!await isPortAvailable(Number(PORT), HOST)) {
59
- clack.log.error(styleText("red", `Port ${PORT} is already in use. Stop the existing process or choose a different port with --port.`));
60
- process$1.exit(1);
61
- }
62
- console.log(env);
63
- await spawnAsync("node", [serverPath], {
64
- env,
65
- cwd: process$1.cwd()
66
- });
67
- await sendTelemetry(buildTelemetryEvent({
68
- command: "agent",
69
- kubbVersion: version,
70
- hrStart,
71
- status: "success"
72
- }));
73
- } catch (error) {
74
- await sendTelemetry(buildTelemetryEvent({
75
- command: "agent",
76
- kubbVersion: version,
77
- hrStart,
78
- status: "failed"
79
- }));
80
- clack.log.error(styleText("red", "Failed to start agent server"));
81
- console.error(error);
82
- process$1.exit(1);
83
- }
84
- }
85
- //#endregion
86
- export { runAgentStart };
87
-
88
- //# sourceMappingURL=agent-L50VNhXv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-L50VNhXv.js","names":["process"],"sources":["../src/runners/agent.ts"],"sourcesContent":["import net from 'node:net'\nimport path from 'node:path'\nimport * as process from 'node:process'\nimport { fileURLToPath } from 'node:url'\nimport { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport { spawnAsync } from '@internals/utils'\nimport { agentDefaults } from '../constants.ts'\nimport { buildTelemetryEvent, sendTelemetry } from '../utils/telemetry.ts'\n\ntype AgentStartOptions = {\n port: string | undefined\n host: string\n configPath: string | undefined\n allowWrite: boolean\n allowAll: boolean\n version: string\n}\n\nfunction isPortAvailable(port: number, host: string): Promise<boolean> {\n return new Promise((resolve) => {\n const server = net.createServer()\n server.once('error', () => resolve(false))\n server.once('listening', () => {\n server.close()\n resolve(true)\n })\n server.listen(port, host)\n })\n}\n\nexport async function runAgentStart({ port, host, configPath, allowWrite, allowAll, version }: AgentStartOptions): Promise<void> {\n const hrStart = process.hrtime()\n\n try {\n // Load .env file into process.env using Node.js built-in (v20.12.0+)\n try {\n process.loadEnvFile()\n } catch {\n // .env file may not exist; ignore\n }\n\n // Resolve the @kubb/agent package path\n const agentPkgUrl = import.meta.resolve('@kubb/agent/package.json')\n const agentPkgPath = fileURLToPath(agentPkgUrl)\n const agentDir = path.dirname(agentPkgPath)\n const serverPath = path.join(agentDir, agentDefaults.serverEntryPath)\n\n // CLI params take priority over process.env; process.env fills in what the CLI didn't specify;\n // agentDefaults are the last resort. Build env as: defaults ← process.env ← CLI.\n const PORT = port !== undefined ? port : (process.env.PORT ?? agentDefaults.port)\n const HOST = host !== agentDefaults.host ? host : (process.env.HOST ?? agentDefaults.host)\n const KUBB_AGENT_ROOT = process.env.KUBB_AGENT_ROOT ?? process.cwd()\n const KUBB_AGENT_CONFIG = path.resolve(process.cwd(), configPath || process.env.KUBB_AGENT_CONFIG || agentDefaults.configFile)\n const KUBB_AGENT_ALLOW_WRITE = allowAll || allowWrite ? 'true' : (process.env.KUBB_AGENT_ALLOW_WRITE ?? 'false')\n const KUBB_AGENT_ALLOW_ALL = allowAll ? 'true' : (process.env.KUBB_AGENT_ALLOW_ALL ?? 'false')\n const KUBB_AGENT_TOKEN = process.env.KUBB_AGENT_TOKEN\n const KUBB_AGENT_RETRY_TIMEOUT = process.env.KUBB_AGENT_RETRY_TIMEOUT ?? agentDefaults.retryTimeout\n const KUBB_STUDIO_URL = process.env.KUBB_STUDIO_URL ?? agentDefaults.studioUrl\n\n const env = {\n ...process.env,\n PORT,\n HOST,\n KUBB_AGENT_ROOT,\n KUBB_AGENT_CONFIG,\n KUBB_AGENT_ALLOW_WRITE,\n KUBB_AGENT_ALLOW_ALL,\n KUBB_AGENT_TOKEN,\n KUBB_AGENT_RETRY_TIMEOUT,\n KUBB_STUDIO_URL,\n }\n\n clack.log.step(styleText('cyan', 'Starting agent server...'))\n clack.log.info(styleText('dim', `Config: ${KUBB_AGENT_CONFIG}`))\n clack.log.info(styleText('dim', `Host: ${HOST}`))\n clack.log.info(styleText('dim', `Port: ${PORT}`))\n if (!KUBB_AGENT_ALLOW_WRITE && !KUBB_AGENT_ALLOW_ALL) {\n clack.log.warn(styleText('yellow', 'Filesystem writes disabled. Use --allow-write or --allow-all to enable.'))\n }\n\n if (!(await isPortAvailable(Number(PORT), HOST))) {\n clack.log.error(styleText('red', `Port ${PORT} is already in use. Stop the existing process or choose a different port with --port.`))\n process.exit(1)\n }\n\n console.log(env)\n\n // Spawns the server as a detached background process so the CLI can exit independently.\n await spawnAsync('node', [serverPath], {\n env,\n cwd: process.cwd(),\n })\n\n await sendTelemetry(buildTelemetryEvent({ command: 'agent', kubbVersion: version, hrStart, status: 'success' }))\n } catch (error) {\n await sendTelemetry(buildTelemetryEvent({ command: 'agent', kubbVersion: version, hrStart, status: 'failed' }))\n clack.log.error(styleText('red', 'Failed to start agent server'))\n console.error(error)\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;AAmBA,SAAS,gBAAgB,MAAc,MAAgC;AACrE,QAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,SAAS,IAAI,cAAc;AACjC,SAAO,KAAK,eAAe,QAAQ,MAAM,CAAC;AAC1C,SAAO,KAAK,mBAAmB;AAC7B,UAAO,OAAO;AACd,WAAQ,KAAK;IACb;AACF,SAAO,OAAO,MAAM,KAAK;GACzB;;AAGJ,eAAsB,cAAc,EAAE,MAAM,MAAM,YAAY,YAAY,UAAU,WAA6C;CAC/H,MAAM,UAAUA,UAAQ,QAAQ;AAEhC,KAAI;AAEF,MAAI;AACF,aAAQ,aAAa;UACf;EAMR,MAAM,eAAe,cADD,OAAO,KAAK,QAAQ,2BAA2B,CACpB;EAC/C,MAAM,WAAW,KAAK,QAAQ,aAAa;EAC3C,MAAM,aAAa,KAAK,KAAK,UAAU,cAAc,gBAAgB;EAIrE,MAAM,OAAO,SAAS,KAAA,IAAY,OAAQA,UAAQ,IAAI,QAAQ,cAAc;EAC5E,MAAM,OAAO,SAAS,cAAc,OAAO,OAAQA,UAAQ,IAAI,QAAQ,cAAc;EACrF,MAAM,kBAAkBA,UAAQ,IAAI,mBAAmBA,UAAQ,KAAK;EACpE,MAAM,oBAAoB,KAAK,QAAQA,UAAQ,KAAK,EAAE,cAAcA,UAAQ,IAAI,qBAAqB,cAAc,WAAW;EAC9H,MAAM,yBAAyB,YAAY,aAAa,SAAUA,UAAQ,IAAI,0BAA0B;EACxG,MAAM,uBAAuB,WAAW,SAAUA,UAAQ,IAAI,wBAAwB;EACtF,MAAM,mBAAmBA,UAAQ,IAAI;EACrC,MAAM,2BAA2BA,UAAQ,IAAI,4BAA4B,cAAc;EACvF,MAAM,kBAAkBA,UAAQ,IAAI,mBAAmB,cAAc;EAErE,MAAM,MAAM;GACV,GAAGA,UAAQ;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;AAED,QAAM,IAAI,KAAK,UAAU,QAAQ,2BAA2B,CAAC;AAC7D,QAAM,IAAI,KAAK,UAAU,OAAO,WAAW,oBAAoB,CAAC;AAChE,QAAM,IAAI,KAAK,UAAU,OAAO,SAAS,OAAO,CAAC;AACjD,QAAM,IAAI,KAAK,UAAU,OAAO,SAAS,OAAO,CAAC;AACjD,MAAI,CAAC,0BAA0B,CAAC,qBAC9B,OAAM,IAAI,KAAK,UAAU,UAAU,0EAA0E,CAAC;AAGhH,MAAI,CAAE,MAAM,gBAAgB,OAAO,KAAK,EAAE,KAAK,EAAG;AAChD,SAAM,IAAI,MAAM,UAAU,OAAO,QAAQ,KAAK,uFAAuF,CAAC;AACtI,aAAQ,KAAK,EAAE;;AAGjB,UAAQ,IAAI,IAAI;AAGhB,QAAM,WAAW,QAAQ,CAAC,WAAW,EAAE;GACrC;GACA,KAAKA,UAAQ,KAAK;GACnB,CAAC;AAEF,QAAM,cAAc,oBAAoB;GAAE,SAAS;GAAS,aAAa;GAAS;GAAS,QAAQ;GAAW,CAAC,CAAC;UACzG,OAAO;AACd,QAAM,cAAc,oBAAoB;GAAE,SAAS;GAAS,aAAa;GAAS;GAAS,QAAQ;GAAU,CAAC,CAAC;AAC/G,QAAM,IAAI,MAAM,UAAU,OAAO,+BAA+B,CAAC;AACjE,UAAQ,MAAM,MAAM;AACpB,YAAQ,KAAK,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-BTUap0zs.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["/** NPM registry endpoint used to check for @kubb/cli updates. */\nexport const KUBB_NPM_PACKAGE_URL = 'https://registry.npmjs.org/@kubb/cli/latest' as const\n\n/** OpenTelemetry ingestion endpoint for anonymous usage telemetry. */\nexport const OTLP_ENDPOINT = 'https://otlp.kubb.dev' as const\n\n/** Horizontal rule rendered above/below the plain-logger generation summary. */\nexport const SUMMARY_SEPARATOR = '─'.repeat(27)\n\n/** Maximum number of █ characters in a plugin timing bar. */\nexport const SUMMARY_MAX_BAR_LENGTH = 10 as const\n\n/** Divides elapsed milliseconds into bar-length units (1 block per 100 ms). */\nexport const SUMMARY_TIME_SCALE_DIVISOR = 100 as const\n\n/** Glob pattern for paths the file watcher ignores. */\nexport const WATCHER_IGNORED_PATHS = '**/{.git,node_modules}/**' as const\n\n/** Default runtime values for the `agent start` command. */\nexport const agentDefaults = {\n port: '3000',\n host: 'localhost',\n configFile: 'kubb.config.ts',\n retryTimeout: '30000',\n studioUrl: 'https://studio.kubb.dev',\n /** Relative path from the @kubb/agent package root to the server entry. */\n serverEntryPath: '.output/server/index.mjs',\n} as const\n\n/** Default values used during interactive `init` scaffolding. */\nexport const initDefaults = {\n inputPath: './openapi.yaml',\n outputPath: './src/gen',\n plugins: ['plugin-oas', 'plugin-ts'],\n} as const\n\n/**\n * Maps each plugin value to the default config snippet inserted by `init`.\n * The `satisfies` constraint ensures all values remain plain strings while\n * `as const` keeps the object deeply immutable.\n */\nexport const pluginDefaultConfigs = {\n 'plugin-oas': 'pluginOas()',\n 'plugin-ts': `pluginTs({\n output: { path: 'models' },\n })`,\n 'plugin-client': `pluginClient({\n output: { path: 'clients' },\n })`,\n 'plugin-react-query': `pluginReactQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-solid-query': `pluginSolidQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-svelte-query': `pluginSvelteQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-vue-query': `pluginVueQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-swr': `pluginSwr({\n output: { path: 'hooks' },\n })`,\n 'plugin-zod': `pluginZod({\n output: { path: 'zod' },\n })`,\n 'plugin-faker': `pluginFaker({\n output: { path: 'mocks' },\n })`,\n 'plugin-msw': `pluginMsw({\n output: { path: 'msw' },\n })`,\n} as const satisfies Record<string, string>\n\n/** Color palette used by randomCliColor() for deterministic plugin name coloring. */\n"],"mappings":";;AACA,MAAa,uBAAuB;;AAGpC,MAAa,gBAAgB;;AAG7B,MAAa,oBAAoB,IAAI,OAAO,GAAG;;AAS/C,MAAa,wBAAwB;;AAGrC,MAAa,gBAAgB;CAC3B,MAAM;CACN,MAAM;CACN,YAAY;CACZ,cAAc;CACd,WAAW;CAEX,iBAAiB;CAClB;;AAGD,MAAa,eAAe;CAC1B,WAAW;CACX,YAAY;CACZ,SAAS,CAAC,cAAc,YAAY;CACrC;;;;;;AAOD,MAAa,uBAAuB;CAClC,cAAc;CACd,aAAa;;;CAGb,iBAAiB;;;CAGjB,sBAAsB;;;CAGtB,sBAAsB;;;CAGtB,uBAAuB;;;CAGvB,oBAAoB;;;CAGpB,cAAc;;;CAGd,cAAc;;;CAGd,gBAAgB;;;CAGhB,cAAc;;;CAGf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-CM3dJzjK.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["/** NPM registry endpoint used to check for @kubb/cli updates. */\nexport const KUBB_NPM_PACKAGE_URL = 'https://registry.npmjs.org/@kubb/cli/latest' as const\n\n/** OpenTelemetry ingestion endpoint for anonymous usage telemetry. */\nexport const OTLP_ENDPOINT = 'https://otlp.kubb.dev' as const\n\n/** Horizontal rule rendered above/below the plain-logger generation summary. */\nexport const SUMMARY_SEPARATOR = '─'.repeat(27)\n\n/** Maximum number of █ characters in a plugin timing bar. */\nexport const SUMMARY_MAX_BAR_LENGTH = 10 as const\n\n/** Divides elapsed milliseconds into bar-length units (1 block per 100 ms). */\nexport const SUMMARY_TIME_SCALE_DIVISOR = 100 as const\n\n/** Glob pattern for paths the file watcher ignores. */\nexport const WATCHER_IGNORED_PATHS = '**/{.git,node_modules}/**' as const\n\n/** Default runtime values for the `agent start` command. */\nexport const agentDefaults = {\n port: '3000',\n host: 'localhost',\n configFile: 'kubb.config.ts',\n retryTimeout: '30000',\n studioUrl: 'https://studio.kubb.dev',\n /** Relative path from the @kubb/agent package root to the server entry. */\n serverEntryPath: '.output/server/index.mjs',\n} as const\n\n/** Default values used during interactive `init` scaffolding. */\nexport const initDefaults = {\n inputPath: './openapi.yaml',\n outputPath: './src/gen',\n plugins: ['plugin-oas', 'plugin-ts'],\n} as const\n\n/**\n * Maps each plugin value to the default config snippet inserted by `init`.\n * The `satisfies` constraint ensures all values remain plain strings while\n * `as const` keeps the object deeply immutable.\n */\nexport const pluginDefaultConfigs = {\n 'plugin-oas': 'pluginOas()',\n 'plugin-ts': `pluginTs({\n output: { path: 'models' },\n })`,\n 'plugin-client': `pluginClient({\n output: { path: 'clients' },\n })`,\n 'plugin-react-query': `pluginReactQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-solid-query': `pluginSolidQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-svelte-query': `pluginSvelteQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-vue-query': `pluginVueQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-swr': `pluginSwr({\n output: { path: 'hooks' },\n })`,\n 'plugin-zod': `pluginZod({\n output: { path: 'zod' },\n })`,\n 'plugin-faker': `pluginFaker({\n output: { path: 'mocks' },\n })`,\n 'plugin-msw': `pluginMsw({\n output: { path: 'msw' },\n })`,\n} as const satisfies Record<string, string>\n\n/** Color palette used by randomCliColor() for deterministic plugin name coloring. */\n"],"mappings":";;AACA,MAAa,uBAAuB;;AAGpC,MAAa,gBAAgB;;AAG7B,MAAa,oBAAoB,IAAI,OAAO,GAAG;;AAS/C,MAAa,wBAAwB;;AAGrC,MAAa,gBAAgB;CAC3B,MAAM;CACN,MAAM;CACN,YAAY;CACZ,cAAc;CACd,WAAW;CAEX,iBAAiB;CAClB;;AAGD,MAAa,eAAe;CAC1B,WAAW;CACX,YAAY;CACZ,SAAS,CAAC,cAAc,YAAY;CACrC;;;;;;AAOD,MAAa,uBAAuB;CAClC,cAAc;CACd,aAAa;;;CAGb,iBAAiB;;;CAGjB,sBAAsB;;;CAGtB,sBAAsB;;;CAGtB,uBAAuB;;;CAGvB,oBAAoB;;;CAGpB,cAAc;;;CAGd,cAAc;;;CAGd,gBAAgB;;;CAGhB,cAAc;;;CAGf"}
@@ -1,25 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- //#region ../../internals/utils/src/cli/define.ts
3
- /** Returns a `CLIAdapter` with type inference. Pass a different adapter to `createCLI` to swap the CLI engine. */
4
- function defineCLIAdapter(adapter) {
5
- return adapter;
6
- }
7
- /**
8
- * Returns a `CommandDefinition` with typed `values` in `run()`.
9
- * The callback receives `values` typed from the declared options — no casts needed.
10
- */
11
- function defineCommand(def) {
12
- const { run, ...rest } = def;
13
- if (!run) return rest;
14
- return {
15
- ...rest,
16
- run: (args) => run({
17
- values: args.values,
18
- positionals: args.positionals
19
- })
20
- };
21
- }
22
- //#endregion
23
- export { defineCommand as n, defineCLIAdapter as t };
24
-
25
- //# sourceMappingURL=define--M_JMcDC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"define--M_JMcDC.js","names":[],"sources":["../../../internals/utils/src/cli/define.ts"],"sourcesContent":["import type { CLIAdapter, CommandDefinition, OptionDefinition } from './types.ts'\n\ntype OptionTypeMap = { string: string; boolean: boolean }\n\ntype IsRequired<O extends OptionDefinition> = O['default'] extends string | boolean ? true : O['required'] extends true ? true : false\n\n/** Infers typed values from an options record. Options with a `default` or `required: true` are always defined. */\ntype InferValues<O extends Record<string, OptionDefinition>> = {\n [K in keyof O as IsRequired<O[K]> extends true ? K : never]: OptionTypeMap[O[K]['type']]\n} & {\n [K in keyof O as IsRequired<O[K]> extends true ? never : K]?: OptionTypeMap[O[K]['type']]\n}\n\n/** Returns a `CLIAdapter` with type inference. Pass a different adapter to `createCLI` to swap the CLI engine. */\nexport function defineCLIAdapter(adapter: CLIAdapter): CLIAdapter {\n return adapter\n}\n\n/**\n * Returns a `CommandDefinition` with typed `values` in `run()`.\n * The callback receives `values` typed from the declared options — no casts needed.\n */\nexport function defineCommand<O extends Record<string, OptionDefinition>>(def: {\n name: string\n description: string\n arguments?: string[]\n options?: O\n subCommands?: CommandDefinition[]\n run?: (args: { values: InferValues<O>; positionals: string[] }) => Promise<void>\n}): CommandDefinition {\n const { run, ...rest } = def\n if (!run) return rest\n return {\n ...rest,\n run: (args) => run({ values: args.values as InferValues<O>, positionals: args.positionals }),\n }\n}\n"],"mappings":";;;AAcA,SAAgB,iBAAiB,SAAiC;AAChE,QAAO;;;;;;AAOT,SAAgB,cAA0D,KAOpD;CACpB,MAAM,EAAE,KAAK,GAAG,SAAS;AACzB,KAAI,CAAC,IAAK,QAAO;AACjB,QAAO;EACL,GAAG;EACH,MAAM,SAAS,IAAI;GAAE,QAAQ,KAAK;GAA0B,aAAa,KAAK;GAAa,CAAC;EAC7F"}
@@ -1,36 +0,0 @@
1
- require("./chunk-ByKO4r7w.cjs");
2
- //#region ../../internals/utils/src/cli/define.ts
3
- /** Returns a `CLIAdapter` with type inference. Pass a different adapter to `createCLI` to swap the CLI engine. */
4
- function defineCLIAdapter(adapter) {
5
- return adapter;
6
- }
7
- /**
8
- * Returns a `CommandDefinition` with typed `values` in `run()`.
9
- * The callback receives `values` typed from the declared options — no casts needed.
10
- */
11
- function defineCommand(def) {
12
- const { run, ...rest } = def;
13
- if (!run) return rest;
14
- return {
15
- ...rest,
16
- run: (args) => run({
17
- values: args.values,
18
- positionals: args.positionals
19
- })
20
- };
21
- }
22
- //#endregion
23
- Object.defineProperty(exports, "defineCLIAdapter", {
24
- enumerable: true,
25
- get: function() {
26
- return defineCLIAdapter;
27
- }
28
- });
29
- Object.defineProperty(exports, "defineCommand", {
30
- enumerable: true,
31
- get: function() {
32
- return defineCommand;
33
- }
34
- });
35
-
36
- //# sourceMappingURL=define-D6Kfm7-Z.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"define-D6Kfm7-Z.cjs","names":[],"sources":["../../../internals/utils/src/cli/define.ts"],"sourcesContent":["import type { CLIAdapter, CommandDefinition, OptionDefinition } from './types.ts'\n\ntype OptionTypeMap = { string: string; boolean: boolean }\n\ntype IsRequired<O extends OptionDefinition> = O['default'] extends string | boolean ? true : O['required'] extends true ? true : false\n\n/** Infers typed values from an options record. Options with a `default` or `required: true` are always defined. */\ntype InferValues<O extends Record<string, OptionDefinition>> = {\n [K in keyof O as IsRequired<O[K]> extends true ? K : never]: OptionTypeMap[O[K]['type']]\n} & {\n [K in keyof O as IsRequired<O[K]> extends true ? never : K]?: OptionTypeMap[O[K]['type']]\n}\n\n/** Returns a `CLIAdapter` with type inference. Pass a different adapter to `createCLI` to swap the CLI engine. */\nexport function defineCLIAdapter(adapter: CLIAdapter): CLIAdapter {\n return adapter\n}\n\n/**\n * Returns a `CommandDefinition` with typed `values` in `run()`.\n * The callback receives `values` typed from the declared options — no casts needed.\n */\nexport function defineCommand<O extends Record<string, OptionDefinition>>(def: {\n name: string\n description: string\n arguments?: string[]\n options?: O\n subCommands?: CommandDefinition[]\n run?: (args: { values: InferValues<O>; positionals: string[] }) => Promise<void>\n}): CommandDefinition {\n const { run, ...rest } = def\n if (!run) return rest\n return {\n ...rest,\n run: (args) => run({ values: args.values as InferValues<O>, positionals: args.positionals }),\n }\n}\n"],"mappings":";;;AAcA,SAAgB,iBAAiB,SAAiC;AAChE,QAAO;;;;;;AAOT,SAAgB,cAA0D,KAOpD;CACpB,MAAM,EAAE,KAAK,GAAG,SAAS;AACzB,KAAI,CAAC,IAAK,QAAO;AACjB,QAAO;EACL,GAAG;EACH,MAAM,SAAS,IAAI;GAAE,QAAQ,KAAK;GAA0B,aAAa,KAAK;GAAa,CAAC;EAC7F"}
@@ -1,27 +0,0 @@
1
- import "./chunk--u3MIqq1.js";
2
- //#region ../../internals/utils/src/errors.ts
3
- /**
4
- * Coerces an unknown thrown value to an `Error` instance.
5
- * When the value is already an `Error` it is returned as-is;
6
- * otherwise a new `Error` is created whose message is `String(value)`.
7
- */
8
- function toError(value) {
9
- return value instanceof Error ? value : new Error(String(value));
10
- }
11
- /**
12
- * Safely extracts a human-readable message from any thrown value.
13
- */
14
- function getErrorMessage(value) {
15
- return value instanceof Error ? value.message : String(value);
16
- }
17
- /**
18
- * Extracts the `.cause` of an `Error` as an `Error | undefined`.
19
- * Returns `undefined` when the cause is absent or is not an `Error`.
20
- */
21
- function toCause(error) {
22
- return error.cause instanceof Error ? error.cause : void 0;
23
- }
24
- //#endregion
25
- export { toCause as n, toError as r, getErrorMessage as t };
26
-
27
- //# sourceMappingURL=errors-6mF_WKxg.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors-6mF_WKxg.js","names":[],"sources":["../../../internals/utils/src/errors.ts"],"sourcesContent":["/** Thrown when a plugin's configuration or input fails validation. */\nexport class ValidationPluginError extends Error {}\n\n/**\n * Thrown when one or more errors occur during a Kubb build.\n * Carries the full list of underlying errors on `errors`.\n */\nexport class BuildError extends Error {\n errors: Array<Error>\n\n constructor(message: string, options: { cause?: Error; errors: Array<Error> }) {\n super(message, { cause: options.cause })\n this.name = 'BuildError'\n this.errors = options.errors\n }\n}\n\n/**\n * Coerces an unknown thrown value to an `Error` instance.\n * When the value is already an `Error` it is returned as-is;\n * otherwise a new `Error` is created whose message is `String(value)`.\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Safely extracts a human-readable message from any thrown value.\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Extracts the `.cause` of an `Error` as an `Error | undefined`.\n * Returns `undefined` when the cause is absent or is not an `Error`.\n */\nexport function toCause(error: Error): Error | undefined {\n return error.cause instanceof Error ? error.cause : undefined\n}\n"],"mappings":";;;;;;;AAsBA,SAAgB,QAAQ,OAAuB;AAC7C,QAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC;;;;;AAMlE,SAAgB,gBAAgB,OAAwB;AACtD,QAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;;;;;;AAO/D,SAAgB,QAAQ,OAAiC;AACvD,QAAO,MAAM,iBAAiB,QAAQ,MAAM,QAAQ,KAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors-DBW0N9w4.cjs","names":[],"sources":["../../../internals/utils/src/errors.ts"],"sourcesContent":["/** Thrown when a plugin's configuration or input fails validation. */\nexport class ValidationPluginError extends Error {}\n\n/**\n * Thrown when one or more errors occur during a Kubb build.\n * Carries the full list of underlying errors on `errors`.\n */\nexport class BuildError extends Error {\n errors: Array<Error>\n\n constructor(message: string, options: { cause?: Error; errors: Array<Error> }) {\n super(message, { cause: options.cause })\n this.name = 'BuildError'\n this.errors = options.errors\n }\n}\n\n/**\n * Coerces an unknown thrown value to an `Error` instance.\n * When the value is already an `Error` it is returned as-is;\n * otherwise a new `Error` is created whose message is `String(value)`.\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Safely extracts a human-readable message from any thrown value.\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Extracts the `.cause` of an `Error` as an `Error | undefined`.\n * Returns `undefined` when the cause is absent or is not an `Error`.\n */\nexport function toCause(error: Error): Error | undefined {\n return error.cause instanceof Error ? error.cause : undefined\n}\n"],"mappings":";;;;;;;AAsBA,SAAgB,QAAQ,OAAuB;AAC7C,QAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC;;;;;AAMlE,SAAgB,gBAAgB,OAAwB;AACtD,QAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;;;;;;AAO/D,SAAgB,QAAQ,OAAiC;AACvD,QAAO,MAAM,iBAAiB,QAAQ,MAAM,QAAQ,KAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-B9sA0jDk.js","names":[],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\n\nexport const command = defineCommand({\n name: 'generate',\n description: \"[input] Generate files based on a 'kubb.config.ts' file\",\n arguments: ['[input]'],\n options: {\n config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },\n logLevel: {\n type: 'string',\n description: 'Info, silent, verbose or debug',\n short: 'l',\n default: 'info',\n hint: 'silent|info|verbose|debug',\n enum: ['silent', 'info', 'verbose', 'debug'],\n },\n watch: { type: 'boolean', description: 'Watch mode based on the input file', short: 'w', default: false },\n debug: { type: 'boolean', description: 'Override logLevel to debug', short: 'd', default: false },\n verbose: { type: 'boolean', description: 'Override logLevel to verbose', short: 'v', default: false },\n silent: { type: 'boolean', description: 'Override logLevel to silent', short: 's', default: false },\n },\n async run({ values, positionals }) {\n const logLevel = values.debug ? 'debug' : values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const { runGenerateCommand } = await import('../runners/generate.ts')\n\n await runGenerateCommand({ input: positionals[0], configPath: values.config, logLevel, watch: values.watch })\n },\n})\n"],"mappings":";;;AAEA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aAAa;CACb,WAAW,CAAC,UAAU;CACtB,SAAS;EACP,QAAQ;GAAE,MAAM;GAAU,aAAa;GAA2B,OAAO;GAAK;EAC9E,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;IAAW;IAAQ;GAC7C;EACD,OAAO;GAAE,MAAM;GAAW,aAAa;GAAsC,OAAO;GAAK,SAAS;GAAO;EACzG,OAAO;GAAE,MAAM;GAAW,aAAa;GAA8B,OAAO;GAAK,SAAS;GAAO;EACjG,SAAS;GAAE,MAAM;GAAW,aAAa;GAAgC,OAAO;GAAK,SAAS;GAAO;EACrG,QAAQ;GAAE,MAAM;GAAW,aAAa;GAA+B,OAAO;GAAK,SAAS;GAAO;EACpG;CACD,MAAM,IAAI,EAAE,QAAQ,eAAe;EACjC,MAAM,WAAW,OAAO,QAAQ,UAAU,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EACzG,MAAM,EAAE,uBAAuB,MAAM,OAAO;AAE5C,QAAM,mBAAmB;GAAE,OAAO,YAAY;GAAI,YAAY,OAAO;GAAQ;GAAU,OAAO,OAAO;GAAO,CAAC;;CAEhH,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-CH1EAyW4.cjs","names":["defineCommand"],"sources":["../src/commands/generate.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\n\nexport const command = defineCommand({\n name: 'generate',\n description: \"[input] Generate files based on a 'kubb.config.ts' file\",\n arguments: ['[input]'],\n options: {\n config: { type: 'string', description: 'Path to the Kubb config', short: 'c' },\n logLevel: {\n type: 'string',\n description: 'Info, silent, verbose or debug',\n short: 'l',\n default: 'info',\n hint: 'silent|info|verbose|debug',\n enum: ['silent', 'info', 'verbose', 'debug'],\n },\n watch: { type: 'boolean', description: 'Watch mode based on the input file', short: 'w', default: false },\n debug: { type: 'boolean', description: 'Override logLevel to debug', short: 'd', default: false },\n verbose: { type: 'boolean', description: 'Override logLevel to verbose', short: 'v', default: false },\n silent: { type: 'boolean', description: 'Override logLevel to silent', short: 's', default: false },\n },\n async run({ values, positionals }) {\n const logLevel = values.debug ? 'debug' : values.verbose ? 'verbose' : values.silent ? 'silent' : values.logLevel\n const { runGenerateCommand } = await import('../runners/generate.ts')\n\n await runGenerateCommand({ input: positionals[0], configPath: values.config, logLevel, watch: values.watch })\n },\n})\n"],"mappings":";;AAEA,MAAa,2CAAUA,cAAc;CACnC,MAAM;CACN,aAAa;CACb,WAAW,CAAC,UAAU;CACtB,SAAS;EACP,QAAQ;GAAE,MAAM;GAAU,aAAa;GAA2B,OAAO;GAAK;EAC9E,UAAU;GACR,MAAM;GACN,aAAa;GACb,OAAO;GACP,SAAS;GACT,MAAM;GACN,MAAM;IAAC;IAAU;IAAQ;IAAW;IAAQ;GAC7C;EACD,OAAO;GAAE,MAAM;GAAW,aAAa;GAAsC,OAAO;GAAK,SAAS;GAAO;EACzG,OAAO;GAAE,MAAM;GAAW,aAAa;GAA8B,OAAO;GAAK,SAAS;GAAO;EACjG,SAAS;GAAE,MAAM;GAAW,aAAa;GAAgC,OAAO;GAAK,SAAS;GAAO;EACrG,QAAQ;GAAE,MAAM;GAAW,aAAa;GAA+B,OAAO;GAAK,SAAS;GAAO;EACpG;CACD,MAAM,IAAI,EAAE,QAAQ,eAAe;EACjC,MAAM,WAAW,OAAO,QAAQ,UAAU,OAAO,UAAU,YAAY,OAAO,SAAS,WAAW,OAAO;EACzG,MAAM,EAAE,uBAAuB,MAAA,QAAA,SAAA,CAAA,WAAA,QAAM,0BAAA,CAAA;AAErC,QAAM,mBAAmB;GAAE,OAAO,YAAY;GAAI,YAAY,OAAO;GAAQ;GAAU,OAAO,OAAO;GAAO,CAAC;;CAEhH,CAAC"}