@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.js CHANGED
@@ -11,7 +11,7 @@ import fs, { existsSync } from "node:fs";
11
11
  import path from "node:path";
12
12
  import process$1 from "node:process";
13
13
  //#region package.json
14
- var version = "5.0.0-beta.100";
14
+ var version = "5.0.0-beta.102";
15
15
  //#endregion
16
16
  //#region src/schemas/generateSchema.ts
17
17
  const generateSchema = v.object({
@@ -6175,6 +6175,13 @@ const generateTool = defineTool({
6175
6175
  hooks.hook("kubb:generation:start", async () => {
6176
6176
  await notify("GENERATION_START", "Generation started");
6177
6177
  });
6178
+ hooks.hook("kubb:setup:start", async () => {
6179
+ await notify("SETUP_START", "Setting up Kubb");
6180
+ });
6181
+ hooks.hook("kubb:setup:end", async () => {
6182
+ await notify("SETUP_END", "Kubb setup complete");
6183
+ await notify("BUILD_START", "Starting build");
6184
+ });
6178
6185
  hooks.hook("kubb:generation:end", async () => {
6179
6186
  await notify("GENERATION_END", "Generation ended");
6180
6187
  });
@@ -6203,22 +6210,17 @@ const generateTool = defineTool({
6203
6210
  } : userConfig.output
6204
6211
  };
6205
6212
  await notify("CONFIG_READY", "Configuration ready");
6206
- await notify("SETUP_START", "Setting up Kubb");
6207
- const kubb = createKubb(config, { hooks });
6208
- await kubb.setup();
6209
- await notify("SETUP_END", "Kubb setup complete");
6210
- await notify("BUILD_START", "Starting build");
6211
- const { files, diagnostics } = await kubb.safeBuild();
6212
- await notify("BUILD_END", `Build complete - Generated ${files.length} files`);
6213
- const problems = diagnostics.filter(Diagnostics.isProblem);
6213
+ const result = await createKubb(config, { hooks }).generate();
6214
+ await notify("BUILD_END", `Build complete - Generated ${result.files.length} files`);
6215
+ const problems = result.diagnostics.filter(Diagnostics.isProblem);
6214
6216
  const errors = problems.filter((diagnostic) => diagnostic.severity === "error");
6215
6217
  if (errors.length > 0) {
6216
6218
  await notify("BUILD_FAILED", `Build failed with ${errors.length} diagnostic(s)`);
6217
6219
  const serialized = problems.map((diagnostic) => Diagnostics.serialize(diagnostic));
6218
6220
  return tool.error(`Build failed:\n${formatDiagnostics(serialized)}\n\n\`\`\`json\n${JSON.stringify(serialized, null, 2)}\n\`\`\``);
6219
6221
  }
6220
- await notify("BUILD_SUCCESS", `Build completed successfully - Generated ${files.length} files`);
6221
- return tool.text(`Build completed successfully!\n\nGenerated ${files.length} files\n\n${messages.join("\n")}`);
6222
+ await notify("BUILD_SUCCESS", `Build completed successfully - Generated ${result.files.length} files`);
6223
+ return tool.text(`Build completed successfully!\n\nGenerated ${result.files.length} files\n\n${messages.join("\n")}`);
6222
6224
  } catch (caughtError) {
6223
6225
  const serialized = Diagnostics.serialize(Diagnostics.from(caughtError));
6224
6226
  return tool.error(`Build error:\n${formatDiagnostics([serialized])}\n\n\`\`\`json\n${JSON.stringify(serialized, null, 2)}\n\`\`\``);