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

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-24T11:29:42.944Z",
2
+ "date": "2026-04-24T21:46:36.835Z",
3
3
  "preset": "node-server",
4
4
  "framework": {
5
5
  "name": "nitro",
@@ -4703,184 +4703,6 @@ function isKind(kind) {
4703
4703
  }
4704
4704
  const isOperationNode = isKind("Operation");
4705
4705
  const isSchemaNode = isKind("Schema");
4706
- function sourceKey(source) {
4707
- var _a, _b, _c;
4708
- return `${(_a = source.name) != null ? _a : extractStringsFromNodes(source.nodes)}:${(_b = source.isExportable) != null ? _b : false}:${(_c = source.isTypeOnly) != null ? _c : false}`;
4709
- }
4710
- function pathTypeKey(path2, isTypeOnly) {
4711
- return `${path2}:${isTypeOnly != null ? isTypeOnly : false}`;
4712
- }
4713
- function exportKey(path2, name, isTypeOnly, asAlias) {
4714
- return `${path2}:${name != null ? name : ""}:${isTypeOnly != null ? isTypeOnly : false}:${asAlias != null ? asAlias : ""}`;
4715
- }
4716
- function importKey(path2, name, isTypeOnly) {
4717
- return `${path2}:${name != null ? name : ""}:${isTypeOnly != null ? isTypeOnly : false}`;
4718
- }
4719
- function sortKey(node) {
4720
- var _a;
4721
- const isArray = Array.isArray(node.name) ? "1" : "0";
4722
- const typeOnly = node.isTypeOnly ? "0" : "1";
4723
- const hasName = node.name != null ? "1" : "0";
4724
- const name = Array.isArray(node.name) ? [...node.name].sort().join("\0") : (_a = node.name) != null ? _a : "";
4725
- return `${isArray}:${typeOnly}:${node.path}:${hasName}:${name}`;
4726
- }
4727
- function combineSources(sources) {
4728
- const seen = /* @__PURE__ */ new Map();
4729
- for (const source of sources) {
4730
- const key = sourceKey(source);
4731
- if (!seen.has(key)) seen.set(key, source);
4732
- }
4733
- return [...seen.values()];
4734
- }
4735
- function combineExports(exports$1) {
4736
- const result = [];
4737
- const namedByPath = /* @__PURE__ */ new Map();
4738
- const seen = /* @__PURE__ */ new Set();
4739
- const keyed = exports$1.map((node) => ({
4740
- node,
4741
- key: sortKey(node)
4742
- }));
4743
- keyed.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0);
4744
- for (const { node: curr } of keyed) {
4745
- const { name, path: path2, isTypeOnly, asAlias } = curr;
4746
- if (Array.isArray(name)) {
4747
- if (!name.length) continue;
4748
- const key = pathTypeKey(path2, isTypeOnly);
4749
- const existing = namedByPath.get(key);
4750
- if (existing && Array.isArray(existing.name)) {
4751
- const merged = new Set(existing.name);
4752
- for (const n of name) merged.add(n);
4753
- existing.name = [...merged];
4754
- } else {
4755
- const newItem = {
4756
- ...curr,
4757
- name: [...new Set(name)]
4758
- };
4759
- result.push(newItem);
4760
- namedByPath.set(key, newItem);
4761
- }
4762
- } else {
4763
- const key = exportKey(path2, name, isTypeOnly, asAlias);
4764
- if (!seen.has(key)) {
4765
- result.push(curr);
4766
- seen.add(key);
4767
- }
4768
- }
4769
- }
4770
- return result;
4771
- }
4772
- function combineImports(imports, exports$1, source) {
4773
- const exportedNames = new Set(exports$1.flatMap((e) => Array.isArray(e.name) ? e.name : e.name ? [e.name] : []));
4774
- const isUsed = (importName) => !source || source.includes(importName) || exportedNames.has(importName);
4775
- const result = [];
4776
- const namedByPath = /* @__PURE__ */ new Map();
4777
- const seen = /* @__PURE__ */ new Set();
4778
- const keyed = imports.map((node) => ({
4779
- node,
4780
- key: sortKey(node)
4781
- }));
4782
- keyed.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0);
4783
- for (const { node: curr } of keyed) {
4784
- if (curr.path === curr.root) continue;
4785
- const { path: path2, isTypeOnly } = curr;
4786
- let { name } = curr;
4787
- if (Array.isArray(name)) {
4788
- name = [...new Set(name)].filter((item) => typeof item === "string" ? isUsed(item) : isUsed(item.propertyName));
4789
- if (!name.length) continue;
4790
- const key = pathTypeKey(path2, isTypeOnly);
4791
- const existing = namedByPath.get(key);
4792
- if (existing && Array.isArray(existing.name)) {
4793
- const merged = new Set(existing.name);
4794
- for (const n of name) merged.add(n);
4795
- existing.name = [...merged];
4796
- } else {
4797
- const newItem = {
4798
- ...curr,
4799
- name
4800
- };
4801
- result.push(newItem);
4802
- namedByPath.set(key, newItem);
4803
- }
4804
- } else {
4805
- if (name && !isUsed(name)) continue;
4806
- const key = importKey(path2, name, isTypeOnly);
4807
- if (!seen.has(key)) {
4808
- result.push(curr);
4809
- seen.add(key);
4810
- }
4811
- }
4812
- }
4813
- return result;
4814
- }
4815
- function extractStringsFromNodes(nodes) {
4816
- if (!(nodes == null ? void 0 : nodes.length)) return "";
4817
- return nodes.map((node) => {
4818
- if (typeof node === "string") return node;
4819
- if (node.kind === "Text") return node.value;
4820
- if (node.kind === "Break") return "";
4821
- if (node.kind === "Jsx") return node.value;
4822
- const parts = [];
4823
- if ("params" in node && node.params) parts.push(node.params);
4824
- if ("generics" in node && node.generics) parts.push(Array.isArray(node.generics) ? node.generics.join(", ") : node.generics);
4825
- if ("returnType" in node && node.returnType) parts.push(node.returnType);
4826
- if ("type" in node && typeof node.type === "string") parts.push(node.type);
4827
- const nested = extractStringsFromNodes(node.nodes);
4828
- if (nested) parts.push(nested);
4829
- return parts.join("\n");
4830
- }).filter(Boolean).join("\n");
4831
- }
4832
- function syncOptionality(schema, required) {
4833
- var _a;
4834
- const nullable = (_a = schema.nullable) != null ? _a : false;
4835
- return {
4836
- ...schema,
4837
- optional: !required && !nullable ? true : void 0,
4838
- nullish: !required && nullable ? true : void 0
4839
- };
4840
- }
4841
- function createProperty(props) {
4842
- var _a;
4843
- const required = (_a = props.required) != null ? _a : false;
4844
- return {
4845
- ...props,
4846
- kind: "Property",
4847
- required,
4848
- schema: syncOptionality(props.schema, required)
4849
- };
4850
- }
4851
- function createParameter(props) {
4852
- var _a;
4853
- const required = (_a = props.required) != null ? _a : false;
4854
- return {
4855
- ...props,
4856
- kind: "Parameter",
4857
- required,
4858
- schema: syncOptionality(props.schema, required)
4859
- };
4860
- }
4861
- function createFile(input) {
4862
- var _a, _b, _c, _d, _e;
4863
- const extname = path$1.extname(input.baseName) || (input.baseName.startsWith(".") ? input.baseName : "");
4864
- if (!extname) throw new Error(`No extname found for ${input.baseName}`);
4865
- const source = ((_a = input.sources) != null ? _a : []).flatMap((item) => {
4866
- var _a2;
4867
- return (_a2 = item.nodes) != null ? _a2 : [];
4868
- }).map((node) => extractStringsFromNodes([node])).filter(Boolean).join("\n\n");
4869
- const resolvedExports = ((_b = input.exports) == null ? void 0 : _b.length) ? combineExports(input.exports) : [];
4870
- const resolvedImports = ((_c = input.imports) == null ? void 0 : _c.length) ? combineImports(input.imports, resolvedExports, source || void 0) : [];
4871
- const resolvedSources = ((_d = input.sources) == null ? void 0 : _d.length) ? combineSources(input.sources) : [];
4872
- return {
4873
- kind: "File",
4874
- ...input,
4875
- id: createHash("sha256").update(input.path).digest("hex"),
4876
- name: trimExtName(input.baseName),
4877
- extname,
4878
- imports: resolvedImports,
4879
- exports: resolvedExports,
4880
- sources: resolvedSources,
4881
- meta: (_e = input.meta) != null ? _e : {}
4882
- };
4883
- }
4884
4706
  function createLimit(concurrency) {
4885
4707
  let active = 0;
4886
4708
  const queue = [];
@@ -5105,6 +4927,184 @@ function transform(node, options) {
5105
4927
  return node;
5106
4928
  }
5107
4929
  }
4930
+ function sourceKey(source) {
4931
+ var _a, _b, _c;
4932
+ return `${(_a = source.name) != null ? _a : extractStringsFromNodes(source.nodes)}:${(_b = source.isExportable) != null ? _b : false}:${(_c = source.isTypeOnly) != null ? _c : false}`;
4933
+ }
4934
+ function pathTypeKey(path2, isTypeOnly) {
4935
+ return `${path2}:${isTypeOnly != null ? isTypeOnly : false}`;
4936
+ }
4937
+ function exportKey(path2, name, isTypeOnly, asAlias) {
4938
+ return `${path2}:${name != null ? name : ""}:${isTypeOnly != null ? isTypeOnly : false}:${asAlias != null ? asAlias : ""}`;
4939
+ }
4940
+ function importKey(path2, name, isTypeOnly) {
4941
+ return `${path2}:${name != null ? name : ""}:${isTypeOnly != null ? isTypeOnly : false}`;
4942
+ }
4943
+ function sortKey(node) {
4944
+ var _a;
4945
+ const isArray = Array.isArray(node.name) ? "1" : "0";
4946
+ const typeOnly = node.isTypeOnly ? "0" : "1";
4947
+ const hasName = node.name != null ? "1" : "0";
4948
+ const name = Array.isArray(node.name) ? [...node.name].sort().join("\0") : (_a = node.name) != null ? _a : "";
4949
+ return `${isArray}:${typeOnly}:${node.path}:${hasName}:${name}`;
4950
+ }
4951
+ function combineSources(sources) {
4952
+ const seen = /* @__PURE__ */ new Map();
4953
+ for (const source of sources) {
4954
+ const key = sourceKey(source);
4955
+ if (!seen.has(key)) seen.set(key, source);
4956
+ }
4957
+ return [...seen.values()];
4958
+ }
4959
+ function combineExports(exports$1) {
4960
+ const result = [];
4961
+ const namedByPath = /* @__PURE__ */ new Map();
4962
+ const seen = /* @__PURE__ */ new Set();
4963
+ const keyed = exports$1.map((node) => ({
4964
+ node,
4965
+ key: sortKey(node)
4966
+ }));
4967
+ keyed.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0);
4968
+ for (const { node: curr } of keyed) {
4969
+ const { name, path: path2, isTypeOnly, asAlias } = curr;
4970
+ if (Array.isArray(name)) {
4971
+ if (!name.length) continue;
4972
+ const key = pathTypeKey(path2, isTypeOnly);
4973
+ const existing = namedByPath.get(key);
4974
+ if (existing && Array.isArray(existing.name)) {
4975
+ const merged = new Set(existing.name);
4976
+ for (const n of name) merged.add(n);
4977
+ existing.name = [...merged];
4978
+ } else {
4979
+ const newItem = {
4980
+ ...curr,
4981
+ name: [...new Set(name)]
4982
+ };
4983
+ result.push(newItem);
4984
+ namedByPath.set(key, newItem);
4985
+ }
4986
+ } else {
4987
+ const key = exportKey(path2, name, isTypeOnly, asAlias);
4988
+ if (!seen.has(key)) {
4989
+ result.push(curr);
4990
+ seen.add(key);
4991
+ }
4992
+ }
4993
+ }
4994
+ return result;
4995
+ }
4996
+ function combineImports(imports, exports$1, source) {
4997
+ const exportedNames = new Set(exports$1.flatMap((e) => Array.isArray(e.name) ? e.name : e.name ? [e.name] : []));
4998
+ const isUsed = (importName) => !source || source.includes(importName) || exportedNames.has(importName);
4999
+ const result = [];
5000
+ const namedByPath = /* @__PURE__ */ new Map();
5001
+ const seen = /* @__PURE__ */ new Set();
5002
+ const keyed = imports.map((node) => ({
5003
+ node,
5004
+ key: sortKey(node)
5005
+ }));
5006
+ keyed.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0);
5007
+ for (const { node: curr } of keyed) {
5008
+ if (curr.path === curr.root) continue;
5009
+ const { path: path2, isTypeOnly } = curr;
5010
+ let { name } = curr;
5011
+ if (Array.isArray(name)) {
5012
+ name = [...new Set(name)].filter((item) => typeof item === "string" ? isUsed(item) : isUsed(item.propertyName));
5013
+ if (!name.length) continue;
5014
+ const key = pathTypeKey(path2, isTypeOnly);
5015
+ const existing = namedByPath.get(key);
5016
+ if (existing && Array.isArray(existing.name)) {
5017
+ const merged = new Set(existing.name);
5018
+ for (const n of name) merged.add(n);
5019
+ existing.name = [...merged];
5020
+ } else {
5021
+ const newItem = {
5022
+ ...curr,
5023
+ name
5024
+ };
5025
+ result.push(newItem);
5026
+ namedByPath.set(key, newItem);
5027
+ }
5028
+ } else {
5029
+ if (name && !isUsed(name)) continue;
5030
+ const key = importKey(path2, name, isTypeOnly);
5031
+ if (!seen.has(key)) {
5032
+ result.push(curr);
5033
+ seen.add(key);
5034
+ }
5035
+ }
5036
+ }
5037
+ return result;
5038
+ }
5039
+ function extractStringsFromNodes(nodes) {
5040
+ if (!(nodes == null ? void 0 : nodes.length)) return "";
5041
+ return nodes.map((node) => {
5042
+ if (typeof node === "string") return node;
5043
+ if (node.kind === "Text") return node.value;
5044
+ if (node.kind === "Break") return "";
5045
+ if (node.kind === "Jsx") return node.value;
5046
+ const parts = [];
5047
+ if ("params" in node && node.params) parts.push(node.params);
5048
+ if ("generics" in node && node.generics) parts.push(Array.isArray(node.generics) ? node.generics.join(", ") : node.generics);
5049
+ if ("returnType" in node && node.returnType) parts.push(node.returnType);
5050
+ if ("type" in node && typeof node.type === "string") parts.push(node.type);
5051
+ const nested = extractStringsFromNodes(node.nodes);
5052
+ if (nested) parts.push(nested);
5053
+ return parts.join("\n");
5054
+ }).filter(Boolean).join("\n");
5055
+ }
5056
+ function syncOptionality(schema, required) {
5057
+ var _a;
5058
+ const nullable = (_a = schema.nullable) != null ? _a : false;
5059
+ return {
5060
+ ...schema,
5061
+ optional: !required && !nullable ? true : void 0,
5062
+ nullish: !required && nullable ? true : void 0
5063
+ };
5064
+ }
5065
+ function createProperty(props) {
5066
+ var _a;
5067
+ const required = (_a = props.required) != null ? _a : false;
5068
+ return {
5069
+ ...props,
5070
+ kind: "Property",
5071
+ required,
5072
+ schema: syncOptionality(props.schema, required)
5073
+ };
5074
+ }
5075
+ function createParameter(props) {
5076
+ var _a;
5077
+ const required = (_a = props.required) != null ? _a : false;
5078
+ return {
5079
+ ...props,
5080
+ kind: "Parameter",
5081
+ required,
5082
+ schema: syncOptionality(props.schema, required)
5083
+ };
5084
+ }
5085
+ function createFile(input) {
5086
+ var _a, _b, _c, _d, _e;
5087
+ const extname = path$1.extname(input.baseName) || (input.baseName.startsWith(".") ? input.baseName : "");
5088
+ if (!extname) throw new Error(`No extname found for ${input.baseName}`);
5089
+ const source = ((_a = input.sources) != null ? _a : []).flatMap((item) => {
5090
+ var _a2;
5091
+ return (_a2 = item.nodes) != null ? _a2 : [];
5092
+ }).map((node) => extractStringsFromNodes([node])).filter(Boolean).join("\n\n");
5093
+ const resolvedExports = ((_b = input.exports) == null ? void 0 : _b.length) ? combineExports(input.exports) : [];
5094
+ const resolvedImports = ((_c = input.imports) == null ? void 0 : _c.length) ? combineImports(input.imports, resolvedExports, source || void 0) : [];
5095
+ const resolvedSources = ((_d = input.sources) == null ? void 0 : _d.length) ? combineSources(input.sources) : [];
5096
+ return {
5097
+ kind: "File",
5098
+ ...input,
5099
+ id: createHash("sha256").update(input.path).digest("hex"),
5100
+ name: trimExtName(input.baseName),
5101
+ extname,
5102
+ imports: resolvedImports,
5103
+ exports: resolvedExports,
5104
+ sources: resolvedSources,
5105
+ meta: (_e = input.meta) != null ? _e : {}
5106
+ };
5107
+ }
5108
5108
 
5109
5109
  var __defProp$1 = Object.defineProperty;
5110
5110
  var __typeError$1 = (msg) => {
@@ -6282,7 +6282,7 @@ const fsStorage = createStorage(() => ({
6282
6282
  await clean(resolve(base));
6283
6283
  }
6284
6284
  }));
6285
- var version$1 = "5.0.0-alpha.66";
6285
+ var version$1 = "5.0.0-alpha.69";
6286
6286
  function getDiagnosticInfo() {
6287
6287
  return {
6288
6288
  nodeVersion: version$2,
@@ -6685,7 +6685,7 @@ const memoryStorage = createStorage(() => {
6685
6685
  };
6686
6686
  });
6687
6687
 
6688
- var version = "5.0.0-alpha.66";
6688
+ var version = "5.0.0-alpha.69";
6689
6689
 
6690
6690
  function isCommandMessage(msg) {
6691
6691
  return msg.type === "command";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent-prod",
3
- "version": "5.0.0-alpha.66",
3
+ "version": "5.0.0-alpha.69",
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.66",
3
+ "version": "5.0.0-alpha.69",
4
4
  "description": "Agent server for Kubb, enabling HTTP-based access to code generation capabilities.",
5
5
  "keywords": [
6
6
  "agent",
@@ -43,8 +43,8 @@
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.66",
47
- "@kubb/core": "5.0.0-alpha.66"
46
+ "@kubb/ast": "5.0.0-alpha.69",
47
+ "@kubb/core": "5.0.0-alpha.69"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/ws": "^8.18.1",
@@ -52,8 +52,8 @@
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.66",
56
- "@kubb/parser-ts": "5.0.0-alpha.66"
55
+ "@kubb/adapter-oas": "5.0.0-alpha.69",
56
+ "@kubb/parser-ts": "5.0.0-alpha.69"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=22"