@kubb/mcp 5.0.0-beta.100 → 5.0.0-beta.102

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.
package/dist/index.cjs CHANGED
@@ -38,7 +38,7 @@ let node_module = require("node:module");
38
38
  let node_process = require("node:process");
39
39
  node_process = __toESM(node_process, 1);
40
40
  //#region package.json
41
- var version = "5.0.0-beta.100";
41
+ var version = "5.0.0-beta.102";
42
42
  //#endregion
43
43
  //#region src/schemas/generateSchema.ts
44
44
  const generateSchema = valibot.object({
@@ -6202,6 +6202,13 @@ const generateTool = (0, tmcp_tool.defineTool)({
6202
6202
  hooks.hook("kubb:generation:start", async () => {
6203
6203
  await notify("GENERATION_START", "Generation started");
6204
6204
  });
6205
+ hooks.hook("kubb:setup:start", async () => {
6206
+ await notify("SETUP_START", "Setting up Kubb");
6207
+ });
6208
+ hooks.hook("kubb:setup:end", async () => {
6209
+ await notify("SETUP_END", "Kubb setup complete");
6210
+ await notify("BUILD_START", "Starting build");
6211
+ });
6205
6212
  hooks.hook("kubb:generation:end", async () => {
6206
6213
  await notify("GENERATION_END", "Generation ended");
6207
6214
  });
@@ -6230,22 +6237,17 @@ const generateTool = (0, tmcp_tool.defineTool)({
6230
6237
  } : userConfig.output
6231
6238
  };
6232
6239
  await notify("CONFIG_READY", "Configuration ready");
6233
- await notify("SETUP_START", "Setting up Kubb");
6234
- const kubb = (0, _kubb_core.createKubb)(config, { hooks });
6235
- await kubb.setup();
6236
- await notify("SETUP_END", "Kubb setup complete");
6237
- await notify("BUILD_START", "Starting build");
6238
- const { files, diagnostics } = await kubb.safeBuild();
6239
- await notify("BUILD_END", `Build complete - Generated ${files.length} files`);
6240
- const problems = diagnostics.filter(_kubb_core.Diagnostics.isProblem);
6240
+ const result = await (0, _kubb_core.createKubb)(config, { hooks }).generate();
6241
+ await notify("BUILD_END", `Build complete - Generated ${result.files.length} files`);
6242
+ const problems = result.diagnostics.filter(_kubb_core.Diagnostics.isProblem);
6241
6243
  const errors = problems.filter((diagnostic) => diagnostic.severity === "error");
6242
6244
  if (errors.length > 0) {
6243
6245
  await notify("BUILD_FAILED", `Build failed with ${errors.length} diagnostic(s)`);
6244
6246
  const serialized = problems.map((diagnostic) => _kubb_core.Diagnostics.serialize(diagnostic));
6245
6247
  return tmcp_utils.tool.error(`Build failed:\n${formatDiagnostics(serialized)}\n\n\`\`\`json\n${JSON.stringify(serialized, null, 2)}\n\`\`\``);
6246
6248
  }
6247
- await notify("BUILD_SUCCESS", `Build completed successfully - Generated ${files.length} files`);
6248
- return tmcp_utils.tool.text(`Build completed successfully!\n\nGenerated ${files.length} files\n\n${messages.join("\n")}`);
6249
+ await notify("BUILD_SUCCESS", `Build completed successfully - Generated ${result.files.length} files`);
6250
+ return tmcp_utils.tool.text(`Build completed successfully!\n\nGenerated ${result.files.length} files\n\n${messages.join("\n")}`);
6249
6251
  } catch (caughtError) {
6250
6252
  const serialized = _kubb_core.Diagnostics.serialize(_kubb_core.Diagnostics.from(caughtError));
6251
6253
  return tmcp_utils.tool.error(`Build error:\n${formatDiagnostics([serialized])}\n\n\`\`\`json\n${JSON.stringify(serialized, null, 2)}\n\`\`\``);