@kubb/agent 5.0.0-alpha.69 → 5.0.0-alpha.70

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "date": "2026-04-24T21:46:36.835Z",
2
+ "date": "2026-04-26T17:18:01.844Z",
3
3
  "preset": "node-server",
4
4
  "framework": {
5
5
  "name": "nitro",
@@ -5335,6 +5335,8 @@ async function openInStudio(input, studioUrl, options = {}) {
5335
5335
  function mergeFile(a, b) {
5336
5336
  return {
5337
5337
  ...a,
5338
+ banner: b.banner,
5339
+ footer: b.footer,
5338
5340
  sources: [...a.sources || [], ...b.sources || []],
5339
5341
  imports: [...a.imports || [], ...b.imports || []],
5340
5342
  exports: [...a.exports || [], ...b.exports || []]
@@ -5522,13 +5524,8 @@ var PluginDriver = (_b$1 = class {
5522
5524
  ...opts
5523
5525
  };
5524
5526
  },
5525
- injectFile: ({ sources = [], ...rest }) => {
5526
- this.fileManager.add(createFile({
5527
- imports: [],
5528
- exports: [],
5529
- sources,
5530
- ...rest
5531
- }));
5527
+ injectFile: (userFileNode) => {
5528
+ this.fileManager.add(createFile(userFileNode));
5532
5529
  }
5533
5530
  };
5534
5531
  return hooks["kubb:plugin:setup"](pluginCtx);
@@ -6282,7 +6279,7 @@ const fsStorage = createStorage(() => ({
6282
6279
  await clean(resolve(base));
6283
6280
  }
6284
6281
  }));
6285
- var version$1 = "5.0.0-alpha.69";
6282
+ var version$1 = "5.0.0-alpha.70";
6286
6283
  function getDiagnosticInfo() {
6287
6284
  return {
6288
6285
  nodeVersion: version$2,
@@ -6296,7 +6293,7 @@ function isInputPath(config) {
6296
6293
  return typeof (config == null ? void 0 : config.input) === "object" && config.input !== null && "path" in config.input;
6297
6294
  }
6298
6295
  async function setup(userConfig, options = {}) {
6299
- var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j;
6296
+ var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i;
6300
6297
  const hooks = (_a2 = options.hooks) != null ? _a2 : new AsyncEventEmitter();
6301
6298
  const sources = /* @__PURE__ */ new Map();
6302
6299
  const diagnosticInfo = getDiagnosticInfo();
@@ -6310,9 +6307,9 @@ async function setup(userConfig, options = {}) {
6310
6307
  ` \u2022 Output: ${((_b2 = userConfig.output) == null ? void 0 : _b2.path) || "not specified"}`,
6311
6308
  ` \u2022 Plugins: ${((_c2 = userConfig.plugins) == null ? void 0 : _c2.length) || 0}`,
6312
6309
  "Output Settings:",
6313
- ` \u2022 Storage: ${((_d2 = userConfig.output) == null ? void 0 : _d2.storage) ? `custom(${userConfig.output.storage.name})` : ((_e2 = userConfig.output) == null ? void 0 : _e2.write) === false ? "disabled" : "filesystem (default)"}`,
6314
- ` \u2022 Formatter: ${((_f = userConfig.output) == null ? void 0 : _f.format) || "none"}`,
6315
- ` \u2022 Linter: ${((_g = userConfig.output) == null ? void 0 : _g.lint) || "none"}`,
6310
+ ` \u2022 Storage: ${userConfig.storage ? `custom(${userConfig.storage.name})` : ((_d2 = userConfig.output) == null ? void 0 : _d2.write) === false ? "disabled" : "filesystem (default)"}`,
6311
+ ` \u2022 Formatter: ${((_e2 = userConfig.output) == null ? void 0 : _e2.format) || "none"}`,
6312
+ ` \u2022 Linter: ${((_f = userConfig.output) == null ? void 0 : _f.lint) || "none"}`,
6316
6313
  "Environment:",
6317
6314
  Object.entries(diagnosticInfo).map(([key, value]) => ` \u2022 ${key}: ${value}`).join("\n")
6318
6315
  ]
@@ -6335,7 +6332,7 @@ async function setup(userConfig, options = {}) {
6335
6332
  const config = {
6336
6333
  ...userConfig,
6337
6334
  root: userConfig.root || process.cwd(),
6338
- parsers: (_h = userConfig.parsers) != null ? _h : [],
6335
+ parsers: (_g = userConfig.parsers) != null ? _g : [],
6339
6336
  adapter: userConfig.adapter,
6340
6337
  output: {
6341
6338
  write: true,
@@ -6349,7 +6346,7 @@ async function setup(userConfig, options = {}) {
6349
6346
  } : void 0,
6350
6347
  plugins: userConfig.plugins
6351
6348
  };
6352
- const storage = config.output.write === false ? null : (_i = config.output.storage) != null ? _i : fsStorage();
6349
+ const storage = config.output.write === false ? null : (_h = config.storage) != null ? _h : fsStorage();
6353
6350
  if (config.output.clean) {
6354
6351
  await hooks.emit("kubb:debug", {
6355
6352
  date: /* @__PURE__ */ new Date(),
@@ -6358,7 +6355,11 @@ async function setup(userConfig, options = {}) {
6358
6355
  await (storage == null ? void 0 : storage.clear(resolve(config.root, config.output.path)));
6359
6356
  }
6360
6357
  const driver = new PluginDriver(config, { hooks });
6361
- for (const middleware of (_j = config.middleware) != null ? _j : []) middleware.install(hooks);
6358
+ function registerMiddlewareHook(event, middlewareHooks) {
6359
+ const handler = middlewareHooks[event];
6360
+ if (handler) hooks.on(event, handler);
6361
+ }
6362
+ for (const middleware of (_i = config.middleware) != null ? _i : []) for (const event of Object.keys(middleware.hooks)) registerMiddlewareHook(event, middleware.hooks);
6362
6363
  const adapter = config.adapter;
6363
6364
  if (!adapter) throw new Error("No adapter configured. Please provide an adapter in your kubb.config.ts.");
6364
6365
  const source = inputToAdapterSource(config);
@@ -6488,7 +6489,12 @@ async function safeBuild(setupResult) {
6488
6489
  await hooks.emit("kubb:plugin:end", {
6489
6490
  plugin,
6490
6491
  duration,
6491
- success: true
6492
+ success: true,
6493
+ config,
6494
+ get files() {
6495
+ return driver.fileManager.files;
6496
+ },
6497
+ upsertFile: (...files2) => driver.fileManager.upsert(...files2)
6492
6498
  });
6493
6499
  await hooks.emit("kubb:debug", {
6494
6500
  date: /* @__PURE__ */ new Date(),
@@ -6502,7 +6508,12 @@ async function safeBuild(setupResult) {
6502
6508
  plugin,
6503
6509
  duration,
6504
6510
  success: false,
6505
- error
6511
+ error,
6512
+ config,
6513
+ get files() {
6514
+ return driver.fileManager.files;
6515
+ },
6516
+ upsertFile: (...files2) => driver.fileManager.upsert(...files2)
6506
6517
  });
6507
6518
  await hooks.emit("kubb:debug", {
6508
6519
  date: errorTimestamp,
@@ -6685,7 +6696,7 @@ const memoryStorage = createStorage(() => {
6685
6696
  };
6686
6697
  });
6687
6698
 
6688
- var version = "5.0.0-alpha.69";
6699
+ var version = "5.0.0-alpha.70";
6689
6700
 
6690
6701
  function isCommandMessage(msg) {
6691
6702
  return msg.type === "command";
@@ -7271,9 +7282,9 @@ async function connectToStudio(options) {
7271
7282
  ...config,
7272
7283
  root,
7273
7284
  input: inputOverride != null ? inputOverride : config.input,
7285
+ storage: effectiveWrite ? fsStorage() : memoryStorage(),
7274
7286
  output: {
7275
- ...config.output,
7276
- storage: effectiveWrite ? fsStorage() : memoryStorage()
7287
+ ...config.output
7277
7288
  },
7278
7289
  plugins
7279
7290
  },
@@ -1 +1 @@
1
- {"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.11/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../../../internals/utils/dist/index.js","../../../../server/plugins/heartbeat.ts","../../../../server/utils/token.ts","../../../../server/utils/api.ts","../../../../../core/dist/chunk--u3MIqq1.js","../../../../../ast/dist/index.js","../../../../../core/dist/PluginDriver-Bc0HQM8V.js","../../../../../core/dist/index.js","../../../../server/types/agent.ts","../../../../server/utils/agentCache.ts","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../server/utils/loadConfig.ts","../../../../server/utils/resolvePlugins.ts","../../../../server/utils/mergePlugins.ts","../../../../server/utils/publish.ts","../../../../server/utils/setupHookListener.ts","../../../../server/constants.ts","../../../../server/utils/ws.ts","../../../../server/utils/connectStudio.ts","../../../../server/utils/runtimeConfig.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"names":["createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","normalizeKey","defineDriver","DRIVER_NAME","createStorage","fsPromises","PATH_TRAVERSE_RE","fsp","_inlineAppConfig","createRadixRouter","formatMs","resolve","_a","process","__defProp","path","exports","_b","extname","__privateAdd","__privateMethod","__privateGet","__privateSet","__publicField","readFile","writeFile","build","walk","readdir","version","_c","_d","_e","files","error","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,56,57,58,59]}
1
+ {"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.11/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../../../internals/utils/dist/index.js","../../../../server/plugins/heartbeat.ts","../../../../server/utils/token.ts","../../../../server/utils/api.ts","../../../../../core/dist/chunk--u3MIqq1.js","../../../../../ast/dist/index.js","../../../../../core/dist/PluginDriver-DV3p2Hky.js","../../../../../core/dist/index.js","../../../../server/types/agent.ts","../../../../server/utils/agentCache.ts","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../server/utils/loadConfig.ts","../../../../server/utils/resolvePlugins.ts","../../../../server/utils/mergePlugins.ts","../../../../server/utils/publish.ts","../../../../server/utils/setupHookListener.ts","../../../../server/constants.ts","../../../../server/utils/ws.ts","../../../../server/utils/connectStudio.ts","../../../../server/utils/runtimeConfig.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"names":["createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","normalizeKey","defineDriver","DRIVER_NAME","createStorage","fsPromises","PATH_TRAVERSE_RE","fsp","_inlineAppConfig","createRadixRouter","formatMs","resolve","_a","process","__defProp","path","exports","_b","extname","__privateAdd","__privateMethod","__privateGet","__privateSet","__publicField","readFile","writeFile","build","walk","readdir","version","_c","_d","_e","files","error","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,56,57,58,59]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent-prod",
3
- "version": "5.0.0-alpha.69",
3
+ "version": "5.0.0-alpha.70",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent",
3
- "version": "5.0.0-alpha.69",
3
+ "version": "5.0.0-alpha.70",
4
4
  "description": "Agent server for Kubb, enabling HTTP-based access to code generation capabilities.",
5
5
  "keywords": [
6
6
  "agent",
@@ -43,17 +43,17 @@
43
43
  "tinyexec": "^1.1.1",
44
44
  "unstorage": "^1.17.5",
45
45
  "ws": "^8.20.0",
46
- "@kubb/ast": "5.0.0-alpha.69",
47
- "@kubb/core": "5.0.0-alpha.69"
46
+ "@kubb/ast": "5.0.0-alpha.70",
47
+ "@kubb/core": "5.0.0-alpha.70"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/ws": "^8.18.1",
51
- "msw": "^2.13.5",
51
+ "msw": "^2.13.6",
52
52
  "nitropack": "^2.13.3",
53
53
  "vite": "^8.0.10",
54
54
  "@internals/utils": "0.0.0",
55
- "@kubb/adapter-oas": "5.0.0-alpha.69",
56
- "@kubb/parser-ts": "5.0.0-alpha.69"
55
+ "@kubb/adapter-oas": "5.0.0-alpha.70",
56
+ "@kubb/parser-ts": "5.0.0-alpha.70"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=22"