@adhd/apigen-core-client 0.2.0 → 0.2.2

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/index.mjs CHANGED
@@ -1,230 +1,258 @@
1
- import { Project as te, Scope as _ } from "ts-morph";
2
- import $e from "node:fs";
3
- import * as Ae from "node:path";
4
- import X from "node:path";
5
- import { createParser as Pe, createFormatter as Ne, SchemaGenerator as Oe, AnnotatedType as ne, StringType as re } from "ts-json-schema-generator";
6
- const fe = Symbol.for("adhd.apigen.extraction-session");
7
- function pe(e, t) {
8
- const r = [
1
+ import { Project as te, Scope as L } from "ts-morph";
2
+ import Ne from "node:fs";
3
+ import * as Oe from "node:path";
4
+ import Y from "node:path";
5
+ import { createParser as ke, createFormatter as Ee, SchemaGenerator as Ce, AnnotatedType as ne, StringType as re } from "ts-json-schema-generator";
6
+ function oe(e) {
7
+ return {
8
+ raw: e,
9
+ words: e.split(/(?=[A-Z])|[-_]/).map((t) => t.toLowerCase()).filter(Boolean)
10
+ };
11
+ }
12
+ function Ie(e, t, n = {}) {
13
+ const o = e.split("/");
14
+ if (o.length < 2 || o.some((l) => l.length === 0))
15
+ throw new Error(
16
+ `syntheticOp: id "${e}" must be "<namespace>/<path...>" with non-empty segments`
17
+ );
18
+ const [r, ...i] = o, s = r.replace(/^_+/, ""), a = n.kind ?? "action", c = {
19
+ id: e,
20
+ host: t.host,
21
+ namespace: oe(s),
22
+ path: i.map(oe),
23
+ kind: a,
24
+ async: n.async ?? !1,
25
+ streaming: n.streaming ?? !1,
26
+ safe: n.safe ?? a === "query",
27
+ input: n.input ?? {},
28
+ output: n.output ?? {},
29
+ envelope: n.envelope ?? {},
30
+ typeText: n.typeText ?? null
31
+ };
32
+ return n.hasCtx !== void 0 && (c.hasCtx = n.hasCtx), n.transports !== void 0 && (c.transports = n.transports), c;
33
+ }
34
+ const ge = Symbol.for("adhd.apigen.extraction-session");
35
+ function de(e, t) {
36
+ const n = [
9
37
  ...e.getImportDeclarations().map((o) => o.getModuleSpecifierSourceFile()),
10
38
  ...e.getExportDeclarations().map((o) => o.getModuleSpecifierSourceFile())
11
39
  ];
12
- for (const o of r) {
40
+ for (const o of n) {
13
41
  if (!o)
14
42
  continue;
15
- const n = o.getFilePath();
16
- if (!n.includes("/node_modules/") && !t.has(n)) {
17
- t.add(n);
43
+ const r = o.getFilePath();
44
+ if (!r.includes("/node_modules/") && !t.has(r)) {
45
+ t.add(r);
18
46
  try {
19
47
  o.refreshFromFileSystemSync();
20
48
  } catch {
21
49
  }
22
- pe(o, t);
50
+ de(o, t);
23
51
  }
24
52
  }
25
53
  }
26
- function me(e) {
54
+ function ye(e) {
27
55
  try {
28
- const t = $e.statSync(e);
56
+ const t = Ne.statSync(e);
29
57
  return `${t.mtimeMs}:${t.size}`;
30
58
  } catch {
31
59
  return "nostat";
32
60
  }
33
61
  }
34
- const F = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map();
35
- function ke(e, t, r) {
36
- const o = t ?? "", n = F.get(o);
37
- let i = r;
38
- if (n && n.fileVersions.size > 0) {
39
- const c = [r], f = [...n.fileVersions.entries()].sort(
40
- ([u], [l]) => u.localeCompare(l)
62
+ const F = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map();
63
+ function Fe(e, t, n) {
64
+ const o = t ?? "", r = F.get(o);
65
+ let i = n;
66
+ if (r && r.fileVersions.size > 0) {
67
+ const c = [n], l = [...r.fileVersions.entries()].sort(
68
+ ([u], [f]) => u.localeCompare(f)
41
69
  );
42
- for (const [u, l] of f)
43
- u !== e && c.push(`${u}:${l}`);
70
+ for (const [u, f] of l)
71
+ u !== e && c.push(`${u}:${f}`);
44
72
  i = c.join("|");
45
73
  }
46
74
  const s = `${e}\0${t ?? ""}`;
47
- let a = G.get(s);
48
- return (!a || a.version !== i) && (a = { version: i, schemas: /* @__PURE__ */ new Map() }, G.set(s, a)), a.schemas;
75
+ let a = Z.get(s);
76
+ return (!a || a.version !== i) && (a = { version: i, schemas: /* @__PURE__ */ new Map() }, Z.set(s, a)), a.schemas;
49
77
  }
50
- function At() {
51
- F.clear(), G.clear();
78
+ function Ft() {
79
+ F.clear(), Z.clear();
52
80
  }
53
- function ge() {
81
+ function he() {
54
82
  const e = {
55
83
  projectsBuilt: 0,
56
84
  generatorsBuilt: 0,
57
85
  schemaCacheHits: 0,
58
86
  schemaCacheMisses: 0
59
87
  }, t = /* @__PURE__ */ new Map();
60
- let r = !1;
88
+ let n = !1;
61
89
  return {
62
- [fe]: !0,
90
+ [ge]: !0,
63
91
  stats: e,
64
92
  schemaCache: /* @__PURE__ */ new Map(),
65
93
  aliasCache: /* @__PURE__ */ new WeakMap(),
66
94
  zodImportCache: /* @__PURE__ */ new WeakMap(),
67
95
  generatorCache: /* @__PURE__ */ new Map(),
68
- projectFor(n) {
69
- if (r)
96
+ projectFor(r) {
97
+ if (n)
70
98
  throw new Error("apigen-core: ExtractionSession used after dispose()");
71
- const i = n ?? "", s = n ? this.statVersion(n) : "";
99
+ const i = r ?? "", s = r ? this.statVersion(r) : "";
72
100
  let a = F.get(i);
73
- return a && a.tsconfigVersion !== s && (a = void 0), a || (a = { project: n ? new te({
74
- tsConfigFilePath: n,
101
+ return a && a.tsconfigVersion !== s && (a = void 0), a || (a = { project: r ? new te({
102
+ tsConfigFilePath: r,
75
103
  skipAddingFilesFromTsConfig: !0
76
104
  }) : new te({ skipAddingFilesFromTsConfig: !0 }), tsconfigVersion: s, fileVersions: /* @__PURE__ */ new Map() }, F.set(i, a), e.projectsBuilt++), a.project;
77
105
  },
78
- sourceFileFor(n, i) {
79
- const s = this.projectFor(i), a = F.get(i ?? ""), c = this.statVersion(n);
80
- let f = s.getSourceFile(n);
81
- if (f === void 0 ? f = s.addSourceFileAtPath(n) : a && a.fileVersions.get(n) !== c && f.refreshFromFileSystemSync(), a == null || a.fileVersions.set(n, c), a) {
82
- const u = /* @__PURE__ */ new Set([n]);
83
- pe(f, u);
84
- for (const l of u)
85
- l !== n && a.fileVersions.set(l, this.statVersion(l));
106
+ sourceFileFor(r, i) {
107
+ const s = this.projectFor(i), a = F.get(i ?? ""), c = this.statVersion(r);
108
+ let l = s.getSourceFile(r);
109
+ if (l === void 0 ? l = s.addSourceFileAtPath(r) : a && a.fileVersions.get(r) !== c && l.refreshFromFileSystemSync(), a == null || a.fileVersions.set(r, c), a) {
110
+ const u = /* @__PURE__ */ new Set([r]);
111
+ de(l, u);
112
+ for (const f of u)
113
+ f !== r && a.fileVersions.set(f, this.statVersion(f));
86
114
  }
87
- return f;
115
+ return l;
88
116
  },
89
- statVersion(n) {
90
- let i = t.get(n);
91
- return i === void 0 && (i = me(n), t.set(n, i)), i;
117
+ statVersion(r) {
118
+ let i = t.get(r);
119
+ return i === void 0 && (i = ye(r), t.set(r, i)), i;
92
120
  },
93
121
  dispose() {
94
- r = !0, this.schemaCache.clear(), this.generatorCache.clear(), t.clear();
122
+ n = !0, this.schemaCache.clear(), this.generatorCache.clear(), t.clear();
95
123
  }
96
124
  };
97
125
  }
98
- function de(e) {
126
+ function Te(e) {
99
127
  const t = e;
100
- if (t[fe] !== !0)
128
+ if (t[ge] !== !0)
101
129
  throw new Error(
102
130
  "apigen-core: unknown ExtractionSession implementation — create sessions with createExtractionSession()"
103
131
  );
104
132
  return t;
105
133
  }
106
- const q = "x-apigen-logical";
107
- function oe(e, t) {
108
- const r = /* @__PURE__ */ new Set(), o = [e];
134
+ const K = "x-apigen-logical";
135
+ function ie(e, t) {
136
+ const n = /* @__PURE__ */ new Set(), o = [e];
109
137
  for (; o.length > 0; ) {
110
- const n = o.pop();
111
- if (!n || r.has(n))
138
+ const r = o.pop();
139
+ if (!r || n.has(r))
112
140
  continue;
113
- r.add(n);
114
- const i = n.$ref;
141
+ n.add(r);
142
+ const i = r.$ref;
115
143
  if (typeof i == "string") {
116
144
  if (t) {
117
- const l = t[i];
118
- if (!l) {
145
+ const f = t[i];
146
+ if (!f) {
119
147
  const p = Object.keys(t).join(", ") || "(none)";
120
148
  throw new Error(
121
149
  `[apigen-logical] $ref "${i}" cannot be resolved. Available $defs: ${p}`
122
150
  );
123
151
  }
124
- o.push(l);
152
+ o.push(f);
125
153
  }
126
154
  continue;
127
155
  }
128
- const s = n.oneOf;
156
+ const s = r.oneOf;
129
157
  if (Array.isArray(s))
130
- for (const l of s)
131
- typeof l == "object" && l !== null && o.push(l);
132
- const a = n.properties;
158
+ for (const f of s)
159
+ typeof f == "object" && f !== null && o.push(f);
160
+ const a = r.properties;
133
161
  if (a)
134
- for (const l of Object.values(a))
135
- o.push(l);
136
- const c = n.items;
162
+ for (const f of Object.values(a))
163
+ o.push(f);
164
+ const c = r.items;
137
165
  if (Array.isArray(c))
138
- for (const l of c)
139
- typeof l == "object" && l !== null && o.push(l);
166
+ for (const f of c)
167
+ typeof f == "object" && f !== null && o.push(f);
140
168
  else
141
169
  typeof c == "object" && c !== null && o.push(c);
142
- const f = n.additionalProperties;
143
- typeof f == "object" && f !== null && o.push(f);
144
- const u = n.propertyNames;
170
+ const l = r.additionalProperties;
171
+ typeof l == "object" && l !== null && o.push(l);
172
+ const u = r.propertyNames;
145
173
  typeof u == "object" && u !== null && o.push(u);
146
174
  }
147
175
  }
148
- const ie = /* @__PURE__ */ new Set(["string", "number", "boolean", "integer"]);
149
- function Ee(e) {
176
+ const se = /* @__PURE__ */ new Set(["string", "number", "boolean", "integer"]);
177
+ function Re(e) {
150
178
  if (typeof e != "object" || e === null)
151
179
  return !1;
152
180
  const t = e;
153
181
  if (t.$ref !== void 0 || t.oneOf || t.anyOf || t.allOf)
154
182
  return !1;
155
- const { type: r } = t;
156
- return typeof r == "string" ? ie.has(r) : Array.isArray(r) ? r.every((o) => ie.has(o) || o === "null") : Array.isArray(t.enum) && t.enum.length > 0 ? t.enum.every((o) => ["string", "number", "boolean"].includes(typeof o)) : !1;
183
+ const { type: n } = t;
184
+ return typeof n == "string" ? se.has(n) : Array.isArray(n) ? n.every((o) => se.has(o) || o === "null") : Array.isArray(t.enum) && t.enum.length > 0 ? t.enum.every((o) => ["string", "number", "boolean"].includes(typeof o)) : !1;
157
185
  }
158
- function Ie(e) {
186
+ function _e(e) {
159
187
  if (!e || typeof e != "object")
160
188
  return !1;
161
189
  const t = e.properties;
162
190
  return t === void 0 || typeof t != "object" || t === null ? !1 : Object.values(t).every(
163
- Ee
191
+ Re
164
192
  );
165
193
  }
166
- function Pt(e) {
167
- var r, o;
194
+ function Rt(e) {
195
+ var n, o;
168
196
  const t = [];
169
- for (const n of e) {
197
+ for (const r of e) {
170
198
  const i = {
171
- ...(r = n.capabilities.layer) == null ? void 0 : r.envelopeFields,
172
- ...(o = n.capabilities.envelope) == null ? void 0 : o.request
199
+ ...(n = r.capabilities.layer) == null ? void 0 : n.envelopeFields,
200
+ ...(o = r.capabilities.envelope) == null ? void 0 : o.request
173
201
  };
174
- Object.keys(i).length > 0 && t.push({ id: n.id, envelope: i });
202
+ Object.keys(i).length > 0 && t.push({ id: r.id, envelope: i });
175
203
  }
176
204
  return t;
177
205
  }
178
- function Ce(e) {
179
- const t = {}, r = (o) => {
180
- for (const n of ["definitions", "$defs"]) {
181
- const i = o[n];
206
+ function Le(e) {
207
+ const t = {}, n = (o) => {
208
+ for (const r of ["definitions", "$defs"]) {
209
+ const i = o[r];
182
210
  if (i)
183
211
  for (const [s, a] of Object.entries(i)) {
184
- const c = s.startsWith("#/") ? s : `#/${n}/${s}`;
212
+ const c = s.startsWith("#/") ? s : `#/${r}/${s}`;
185
213
  t[c] = a;
186
214
  }
187
215
  }
188
216
  };
189
217
  for (const o of Object.values(e.schemas))
190
- r(o.input), r(o.output);
218
+ n(o.input), n(o.output);
191
219
  if (Object.keys(t).length !== 0)
192
- for (const [o, n] of Object.entries(e.schemas))
220
+ for (const [o, r] of Object.entries(e.schemas))
193
221
  try {
194
- oe(n.input, t), oe(n.output, t);
222
+ ie(r.input, t), ie(r.output, t);
195
223
  } catch (i) {
196
224
  throw new Error(
197
225
  `[apigen-core-client] Schema validation failed for function "${o}": ${i.message}`
198
226
  );
199
227
  }
200
228
  }
201
- function Fe(e, t) {
202
- const r = [
229
+ function Me(e, t) {
230
+ const n = [
203
231
  'apigen calling convention: all domain parameters go inside a "data" envelope — e.g. { "data": { ... } }' + (t ? "." : " (an empty object for this zero-parameter tool).")
204
232
  ];
205
- return e.length > 0 && r.push(
233
+ return e.length > 0 && n.push(
206
234
  `Field(s) ${e.map((o) => `"${o}"`).join(", ")} are transport-level envelope metadata, NOT domain data — do not nest them under "data". Over MCP they are read from arguments._meta["x-<pluginId>-<field>"] (default pluginId "adhd"); see @adhd/apigen-engine-naming's envelopeMetaKey/envelopeCliFlag/envelopeEnvVar for the HTTP-header / CLI-flag / env-var equivalents.`
207
- ), r.join(" ");
235
+ ), n.join(" ");
208
236
  }
209
- function Nt(e, t, r) {
210
- Ce(e);
237
+ function _t(e, t, n) {
238
+ Le(e);
211
239
  const o = {};
212
- for (const [n, i] of Object.entries(e.schemas)) {
213
- const s = (r == null ? void 0 : r[n]) ?? {}, a = i.input.properties ?? {}, c = i.input.required ?? [], f = {}, u = [], l = {};
214
- for (const T of t)
215
- if (T.envelope && s[T.id] !== !1)
216
- for (const [d, y] of Object.entries(T.envelope))
217
- f[d] = y, l[d] = T.id, u.includes(d) || u.push(d);
240
+ for (const [r, i] of Object.entries(e.schemas)) {
241
+ const s = (n == null ? void 0 : n[r]) ?? {}, a = i.input.properties ?? {}, c = i.input.required ?? [], l = {}, u = [], f = {};
242
+ for (const b of t)
243
+ if (b.envelope && s[b.id] !== !1)
244
+ for (const [y, h] of Object.entries(b.envelope))
245
+ l[y] = h, f[y] = b.id, u.includes(y) || u.push(y);
218
246
  const p = {
219
247
  type: "object",
220
248
  properties: a,
221
249
  additionalProperties: !1,
222
250
  ...c.length > 0 ? { required: c } : {}
223
- }, S = i.safe === !0 || Ie(i.input), h = i.input.definitions, m = i.input.$defs;
224
- o[n] = {
251
+ }, T = i.safe === !0 || _e(i.input), d = i.input.definitions, m = i.input.$defs;
252
+ o[r] = {
225
253
  input: {
226
254
  type: "object",
227
- properties: { ...f, data: p },
255
+ properties: { ...l, data: p },
228
256
  required: [
229
257
  ...u,
230
258
  ...c.length > 0 ? ["data"] : []
@@ -233,28 +261,28 @@ function Nt(e, t, r) {
233
261
  // field or the "data" wrapper — no silently-ignored junk params.
234
262
  additionalProperties: !1,
235
263
  // BUG-APIGEN-020: document the envelope/data calling convention inline.
236
- description: Fe(
237
- Object.keys(f),
264
+ description: Me(
265
+ Object.keys(l),
238
266
  Object.keys(a).length > 0
239
267
  ),
240
- ...h ? { definitions: h } : {},
268
+ ...d ? { definitions: d } : {},
241
269
  ...m ? { $defs: m } : {}
242
270
  },
243
271
  output: i.output,
244
272
  // Carry the ctx-param flag through to dispatch (BUG-APIGEN-001).
245
273
  ...i.hasCtx ? { hasCtx: !0 } : {},
246
- "x-apigen-safe": S,
274
+ "x-apigen-safe": T,
247
275
  // DEBT-APIGEN-ENVELOPE-CAPABILITY-UNWIRED-001: field → pluginId map,
248
276
  // read by `op-plan.ts`'s `computeEnvelopeFields`. Omitted (not an empty
249
277
  // object) when no middleware contributed an envelope field, matching
250
278
  // `x-apigen-safe`'s own "absent means nothing to report" convention.
251
- ...Object.keys(l).length > 0 ? { "x-apigen-envelope": l } : {}
279
+ ...Object.keys(f).length > 0 ? { "x-apigen-envelope": f } : {}
252
280
  };
253
281
  }
254
282
  return o;
255
283
  }
256
- const Re = 8;
257
- function Le(e, t) {
284
+ const Ve = 8;
285
+ function qe(e, t) {
258
286
  try {
259
287
  return t ? e.getText(t) : e.getText();
260
288
  } catch {
@@ -265,12 +293,12 @@ function Le(e, t) {
265
293
  }
266
294
  }
267
295
  }
268
- let _e = 0;
269
- async function Me(e, t, r, o) {
270
- const n = `__ApigenProbe_${process.pid}_${_e++}`;
296
+ let ze = 0;
297
+ async function Ke(e, t, n, o) {
298
+ const r = `__ApigenProbe_${process.pid}_${ze++}`;
271
299
  let i;
272
300
  try {
273
- i = t.addTypeAlias({ name: n, type: r });
301
+ i = t.addTypeAlias({ name: r, type: n });
274
302
  const s = i.getType();
275
303
  return await o(s);
276
304
  } catch {
@@ -282,8 +310,8 @@ async function Me(e, t, r, o) {
282
310
  }
283
311
  }
284
312
  }
285
- async function ye(e, t, r) {
286
- if (r > Re)
313
+ async function be(e, t, n) {
314
+ if (n > Ve)
287
315
  return {};
288
316
  if (e.isString() || e.isStringLiteral())
289
317
  return e.isStringLiteral() ? { type: "string", enum: [e.getLiteralValue()] } : { type: "string" };
@@ -308,12 +336,12 @@ async function ye(e, t, r) {
308
336
  enum: o.map((c) => c.getLiteralValue())
309
337
  };
310
338
  const s = await Promise.all(
311
- o.map((c) => ye(c, t, r + 1))
312
- ), a = Y(s);
339
+ o.map((c) => be(c, t, n + 1))
340
+ ), a = D(s);
313
341
  return {
314
342
  oneOf: s,
315
343
  ...a ? { discriminator: a } : {},
316
- [q]: "union"
344
+ [K]: "union"
317
345
  };
318
346
  }
319
347
  if (e.isArray()) {
@@ -321,74 +349,80 @@ async function ye(e, t, r) {
321
349
  return { type: "array", items: o ? await t(o.getText()) : {} };
322
350
  }
323
351
  if (e.isTuple()) {
324
- const o = e.getTupleElements(), n = await Promise.all(
352
+ const o = e.getTupleElements(), r = await Promise.all(
325
353
  o.map((i) => t(i.getText()))
326
354
  );
327
355
  return {
328
356
  type: "array",
329
- items: n,
330
- minItems: n.length,
331
- maxItems: n.length
357
+ items: r,
358
+ minItems: r.length,
359
+ maxItems: r.length
332
360
  };
333
361
  }
334
362
  if (e.isObject()) {
335
- const o = e.getStringIndexType(), n = e.getNumberIndexType(), i = o ?? n, s = e.getProperties();
363
+ const o = e.getStringIndexType(), r = e.getNumberIndexType(), i = o ?? r, s = e.getProperties();
336
364
  if (i && s.length === 0)
337
365
  return { type: "object", additionalProperties: await t(i.getText()) };
338
- const a = {};
339
- for (const c of s) {
340
- const f = c.getName(), l = c.getDeclarations()[0];
341
- let p;
342
- if (l)
366
+ const a = {}, c = [];
367
+ for (const l of s) {
368
+ const u = l.getName(), p = l.getDeclarations()[0];
369
+ let T;
370
+ if (p)
343
371
  try {
344
- p = c.getTypeAtLocation(l);
372
+ T = l.getTypeAtLocation(p);
345
373
  } catch {
346
- p = void 0;
374
+ T = void 0;
347
375
  }
348
- if (p !== void 0 && p.getCallSignatures().length > 0)
376
+ if (T !== void 0 && T.getCallSignatures().length > 0)
349
377
  continue;
350
- const S = p !== void 0 ? Le(p, l) : void 0;
351
- a[f] = S !== void 0 ? await t(S) : {};
378
+ const d = T !== void 0 ? qe(T, p) : void 0;
379
+ a[u] = d !== void 0 ? await t(d) : {}, l.isOptional() || c.push(u);
352
380
  }
353
- return Object.keys(a).length > 0 ? { type: "object", properties: a } : {};
381
+ return Object.keys(a).length > 0 ? {
382
+ type: "object",
383
+ properties: a,
384
+ // Match ts-json-schema-generator's own convention: omit `required`
385
+ // entirely when no property is required, rather than emitting `[]`.
386
+ ...c.length > 0 ? { required: c } : {}
387
+ } : {};
354
388
  }
355
389
  return {};
356
390
  }
357
- function Y(e) {
391
+ function D(e) {
358
392
  if (e.length < 2)
359
393
  return;
360
394
  const t = [];
361
395
  for (const o of e) {
362
396
  if (o.type !== "object")
363
397
  return;
364
- const n = o.properties;
365
- if (!n || typeof n != "object")
398
+ const r = o.properties;
399
+ if (!r || typeof r != "object")
366
400
  return;
367
- t.push(n);
401
+ t.push(r);
368
402
  }
369
- const r = Object.keys(t[0]).filter(
370
- (o) => t.every((n) => Object.prototype.hasOwnProperty.call(n, o))
403
+ const n = Object.keys(t[0]).filter(
404
+ (o) => t.every((r) => Object.prototype.hasOwnProperty.call(r, o))
371
405
  );
372
- for (const o of r) {
373
- const n = [];
406
+ for (const o of n) {
407
+ const r = [];
374
408
  let i = !0;
375
409
  for (const a of t) {
376
- const c = a[o], f = c && (c.type === "string" || c.type === "number"), u = c == null ? void 0 : c.enum;
377
- if (!f || !Array.isArray(u) || u.length !== 1) {
410
+ const c = a[o], l = c && (c.type === "string" || c.type === "number"), u = c == null ? void 0 : c.enum;
411
+ if (!l || !Array.isArray(u) || u.length !== 1) {
378
412
  i = !1;
379
413
  break;
380
414
  }
381
- n.push(String(u[0]));
415
+ r.push(String(u[0]));
382
416
  }
383
- if (!i || new Set(n).size !== n.length)
417
+ if (!i || new Set(r).size !== r.length)
384
418
  continue;
385
419
  const s = {};
386
- return n.forEach((a, c) => {
420
+ return r.forEach((a, c) => {
387
421
  s[a] = `#/oneOf/${c}`;
388
422
  }), { propertyName: o, mapping: s };
389
423
  }
390
424
  }
391
- function z(e, t, r) {
425
+ function q(e, t, n) {
392
426
  if (t > 6)
393
427
  return {};
394
428
  const o = e.trim();
@@ -402,11 +436,11 @@ function z(e, t, r) {
402
436
  return { type: "null" };
403
437
  if (o === "undefined")
404
438
  return { type: "null" };
405
- const n = H[o];
406
- if (n !== void 0)
407
- return n;
408
- if (r != null && r.size) {
409
- const i = r.get(o);
439
+ const r = H[o];
440
+ if (r !== void 0)
441
+ return r;
442
+ if (n != null && n.size) {
443
+ const i = n.get(o);
410
444
  if (i !== void 0) {
411
445
  const s = H[i];
412
446
  if (s !== void 0)
@@ -416,59 +450,59 @@ function z(e, t, r) {
416
450
  if (o.endsWith("[]"))
417
451
  return {
418
452
  type: "array",
419
- items: z(o.slice(0, -2), t + 1, r)
453
+ items: q(o.slice(0, -2), t + 1, n)
420
454
  };
421
455
  if (o.includes("|")) {
422
456
  const i = o.split("|").map((c) => c.trim());
423
457
  if (i.every((c) => c.startsWith("'")))
424
458
  return { type: "string", enum: i.map((c) => c.replace(/'/g, "")) };
425
- const s = i.map((c) => z(c, t + 1, r)), a = Y(s);
459
+ const s = i.map((c) => q(c, t + 1, n)), a = D(s);
426
460
  return {
427
461
  oneOf: s,
428
462
  ...a ? { discriminator: a } : {},
429
- [q]: "union"
463
+ [K]: "union"
430
464
  };
431
465
  }
432
466
  if (o.startsWith("{") && o.endsWith("}")) {
433
467
  const i = o.slice(1, -1).trim(), s = {};
434
468
  for (const a of i.split(";").filter(Boolean)) {
435
- const [c, f] = a.split(":").map((u) => u.trim());
436
- c && f && (s[c.replace("?", "")] = z(f, t + 1, r));
469
+ const [c, l] = a.split(":").map((u) => u.trim());
470
+ c && l && (s[c.replace("?", "")] = q(l, t + 1, n));
437
471
  }
438
472
  return { type: "object", properties: s };
439
473
  }
440
474
  return {};
441
475
  }
442
- function he(e) {
476
+ function Se(e) {
443
477
  const t = [];
444
- let r = 0, o = 0;
478
+ let n = 0, o = 0;
445
479
  for (let i = 0; i < e.length; i++) {
446
480
  const s = e[i];
447
- s === "<" || s === "[" || s === "{" || s === "(" ? r++ : s === ">" || s === "]" || s === "}" || s === ")" ? r-- : s === "," && r === 0 && (t.push(e.slice(o, i).trim()), o = i + 1);
481
+ s === "<" || s === "[" || s === "{" || s === "(" ? n++ : s === ">" || s === "]" || s === "}" || s === ")" ? n-- : s === "," && n === 0 && (t.push(e.slice(o, i).trim()), o = i + 1);
448
482
  }
449
- const n = e.slice(o).trim();
450
- return n.length > 0 && t.push(n), t;
483
+ const r = e.slice(o).trim();
484
+ return r.length > 0 && t.push(r), t;
451
485
  }
452
- function Ve(e) {
486
+ function De(e) {
453
487
  const t = /^(?:Readonly)?Map<(.+)>$/.exec(e);
454
488
  return t ? t[1] : void 0;
455
489
  }
456
- function ze(e) {
490
+ function Be(e) {
457
491
  const t = /^(?:Readonly)?Set<(.+)>$/.exec(e);
458
492
  return t ? t[1] : void 0;
459
493
  }
460
- function Ke(e) {
494
+ function We(e) {
461
495
  let t = e.trim();
462
496
  if (t.startsWith("readonly ") && (t = t.slice(9).trim()), !t.startsWith("[") || !t.endsWith("]"))
463
497
  return;
464
- const r = t.slice(1, -1).trim();
465
- if (r.length !== 0)
466
- return he(r);
498
+ const n = t.slice(1, -1).trim();
499
+ if (n.length !== 0)
500
+ return Se(n);
467
501
  }
468
- async function qe(e, t) {
469
- const r = e.trim(), o = Ve(r);
502
+ async function Ue(e, t) {
503
+ const n = e.trim(), o = De(n);
470
504
  if (o !== void 0) {
471
- const s = he(o);
505
+ const s = Se(o);
472
506
  if (s.length === 2) {
473
507
  const [a, c] = await Promise.all([
474
508
  t(s[0]),
@@ -485,10 +519,10 @@ async function qe(e, t) {
485
519
  };
486
520
  }
487
521
  }
488
- const n = ze(r);
489
- if (n !== void 0)
490
- return { type: "array", items: await t(n), uniqueItems: !0 };
491
- const i = Ke(r);
522
+ const r = Be(n);
523
+ if (r !== void 0)
524
+ return { type: "array", items: await t(r), uniqueItems: !0 };
525
+ const i = We(n);
492
526
  if (i !== void 0) {
493
527
  const s = await Promise.all(i.map((a) => t(a)));
494
528
  return {
@@ -499,7 +533,7 @@ async function qe(e, t) {
499
533
  };
500
534
  }
501
535
  }
502
- const Te = {
536
+ const xe = {
503
537
  "decimal.js": "Decimal"
504
538
  }, H = {
505
539
  Date: { type: "string", format: "date-time" },
@@ -509,16 +543,16 @@ const Te = {
509
543
  URL: { type: "string", format: "uri" },
510
544
  RegExp: { type: "string", format: "regex" },
511
545
  Decimal: { type: "string", format: "decimal" }
512
- }, se = {
546
+ }, ae = {
513
547
  Uint8Array: "byte",
514
548
  Buffer: "byte",
515
549
  Decimal: "decimal"
516
550
  };
517
- function ae(e) {
518
- var r;
551
+ function ce(e) {
552
+ var n;
519
553
  const t = /* @__PURE__ */ new Map();
520
554
  for (const o of e.getImportDeclarations()) {
521
- const n = o.getModuleSpecifierValue(), i = Te[n];
555
+ const r = o.getModuleSpecifierValue(), i = xe[r];
522
556
  if (!i)
523
557
  continue;
524
558
  const s = o.getDefaultImport();
@@ -527,32 +561,32 @@ function ae(e) {
527
561
  a !== i && t.set(a, i);
528
562
  }
529
563
  for (const a of o.getNamedImports()) {
530
- const c = ((r = a.getAliasNode()) == null ? void 0 : r.getText()) ?? a.getName();
564
+ const c = ((n = a.getAliasNode()) == null ? void 0 : n.getText()) ?? a.getName();
531
565
  c !== i && t.set(c, i);
532
566
  }
533
567
  }
534
568
  return t;
535
569
  }
536
- function De(e, t) {
537
- return (r) => {
538
- r.addNodeParser({
570
+ function Ge(e, t) {
571
+ return (n) => {
572
+ n.addNodeParser({
539
573
  supportsNode(o) {
540
574
  var i, s, a;
541
575
  if (o.kind !== t)
542
576
  return !1;
543
- const n = ((i = o.typeName) == null ? void 0 : i.escapedText) ?? ((a = (s = o.typeName) == null ? void 0 : s.right) == null ? void 0 : a.escapedText);
544
- return n !== void 0 && Object.prototype.hasOwnProperty.call(se, n);
577
+ const r = ((i = o.typeName) == null ? void 0 : i.escapedText) ?? ((a = (s = o.typeName) == null ? void 0 : s.right) == null ? void 0 : a.escapedText);
578
+ return r !== void 0 && Object.prototype.hasOwnProperty.call(ae, r);
545
579
  },
546
580
  createType(o) {
547
581
  var i, s, a;
548
- const n = ((i = o.typeName) == null ? void 0 : i.escapedText) ?? ((a = (s = o.typeName) == null ? void 0 : s.right) == null ? void 0 : a.escapedText);
582
+ const r = ((i = o.typeName) == null ? void 0 : i.escapedText) ?? ((a = (s = o.typeName) == null ? void 0 : s.right) == null ? void 0 : a.escapedText);
549
583
  return new ne(
550
584
  new re(),
551
- { format: se[n] },
585
+ { format: ae[r] },
552
586
  !1
553
587
  );
554
588
  }
555
- }), r.addNodeParser({
589
+ }), n.addNodeParser({
556
590
  supportsNode(o) {
557
591
  return o.kind === e;
558
592
  },
@@ -562,194 +596,194 @@ function De(e, t) {
562
596
  });
563
597
  };
564
598
  }
565
- let I;
566
- function We() {
567
- if (I)
568
- return I;
599
+ let C;
600
+ function Ze() {
601
+ if (C)
602
+ return C;
569
603
  try {
570
- const e = X.dirname(
604
+ const e = Y.dirname(
571
605
  require.resolve("ts-json-schema-generator/package.json")
572
606
  );
573
- I = require(require.resolve("typescript", {
607
+ C = require(require.resolve("typescript", {
574
608
  paths: [e]
575
609
  }));
576
610
  } catch {
577
- I = require("typescript");
611
+ C = require("typescript");
578
612
  }
579
- return I;
613
+ return C;
580
614
  }
581
615
  const k = /* @__PURE__ */ new Map();
582
- function Be() {
616
+ function He() {
583
617
  const e = process.env.APIGEN_PROGRAM_CACHE, t = e === void 0 ? NaN : Number(e);
584
618
  return Number.isFinite(t) && t >= 0 ? t : 8;
585
619
  }
586
- function Ue(e) {
620
+ function Qe(e) {
587
621
  const t = k.get(e);
588
622
  return t && (k.delete(e), k.set(e, t)), t;
589
623
  }
590
- function Ge(e, t) {
591
- const r = Be();
592
- if (r !== 0)
593
- for (k.delete(e), k.set(e, t); k.size > r; ) {
624
+ function Je(e, t) {
625
+ const n = He();
626
+ if (n !== 0)
627
+ for (k.delete(e), k.set(e, t); k.size > n; ) {
594
628
  const o = k.keys().next().value;
595
629
  k.delete(o);
596
630
  }
597
631
  }
598
- function He(e, t) {
632
+ function Xe(e, t) {
599
633
  return `${e}\0${t ?? ""}`;
600
634
  }
601
- const Ze = /* @__PURE__ */ new Set(["zod", /^zod\/./]);
602
- function Qe(e) {
635
+ const Ye = /* @__PURE__ */ new Set(["zod", /^zod\/./]);
636
+ function et(e) {
603
637
  for (const t of e.getImportDeclarations()) {
604
- const r = t.getModuleSpecifierValue();
605
- for (const o of Ze)
638
+ const n = t.getModuleSpecifierValue();
639
+ for (const o of Ye)
606
640
  if (typeof o == "string") {
607
- if (r === o)
641
+ if (n === o)
608
642
  return !0;
609
- } else if (o.test(r))
643
+ } else if (o.test(n))
610
644
  return !0;
611
645
  }
612
646
  return !1;
613
647
  }
614
- function Je(e) {
648
+ function tt(e) {
615
649
  for (const t of ["$defs", "definitions"]) {
616
- const r = e[t];
617
- if (!r || typeof r != "object")
650
+ const n = e[t];
651
+ if (!n || typeof n != "object")
618
652
  continue;
619
- const o = Object.keys(r);
653
+ const o = Object.keys(n);
620
654
  if (o.length === 0)
621
655
  continue;
622
- const n = new Set(o.filter((i) => /zod/i.test(i)));
623
- for (const [i, s] of Object.entries(r)) {
624
- if (n.has(i) || typeof s != "object" || s === null)
656
+ const r = new Set(o.filter((i) => /zod/i.test(i)));
657
+ for (const [i, s] of Object.entries(n)) {
658
+ if (r.has(i) || typeof s != "object" || s === null)
625
659
  continue;
626
660
  const a = s, c = typeof a.$ref == "string" ? a.$ref : "";
627
661
  if (c) {
628
- for (const f of n)
629
- if (c.includes(f)) {
630
- n.add(i);
662
+ for (const l of r)
663
+ if (c.includes(l)) {
664
+ r.add(i);
631
665
  break;
632
666
  }
633
667
  }
634
668
  }
635
- for (const i of n)
636
- delete r[i];
669
+ for (const i of r)
670
+ delete n[i];
637
671
  }
638
- Z(e);
672
+ Q(e);
639
673
  }
640
- function Z(e, t) {
674
+ function Q(e, t) {
641
675
  if (!e || typeof e != "object")
642
676
  return;
643
- const r = t ?? /* @__PURE__ */ new WeakSet();
644
- if (!r.has(e)) {
645
- r.add(e);
677
+ const n = t ?? /* @__PURE__ */ new WeakSet();
678
+ if (!n.has(e)) {
679
+ n.add(e);
646
680
  for (const o of Object.keys(e))
647
681
  if (o === "$ref" && typeof e[o] == "string") {
648
- const n = e[o];
649
- /zod/i.test(n) && delete e[o];
682
+ const r = e[o];
683
+ /zod/i.test(r) && delete e[o];
650
684
  }
651
685
  for (const [, o] of Object.entries(e))
652
686
  if (typeof o == "object" && o !== null)
653
687
  if (Array.isArray(o))
654
- for (const n of o)
655
- typeof n == "object" && n !== null && Z(n, r);
688
+ for (const r of o)
689
+ typeof r == "object" && r !== null && Q(r, n);
656
690
  else
657
- Z(o, r);
691
+ Q(o, n);
658
692
  }
659
693
  }
660
- function Xe(e) {
694
+ function nt(e) {
661
695
  const t = /* @__PURE__ */ new Set();
662
696
  for (const o of ["$defs", "definitions"]) {
663
- const n = e[o];
664
- if (n && typeof n == "object")
665
- for (const i of Object.keys(n))
697
+ const r = e[o];
698
+ if (r && typeof r == "object")
699
+ for (const i of Object.keys(r))
666
700
  t.add(i);
667
701
  }
668
- const r = Q(e, t);
669
- if (r.length > 0)
702
+ const n = J(e, t);
703
+ if (n.length > 0)
670
704
  throw new Error(
671
- `[apigen-core-client] Generated schema contains ${r.length} unresolvable $ref(s): ${r.join(", ")}. This usually means zod-internal definitions were stripped but $ref references to them remain. Check the source file's imports or the ts-json-schema-generator output.`
705
+ `[apigen-core-client] Generated schema contains ${n.length} unresolvable $ref(s): ${n.join(", ")}. This usually means zod-internal definitions were stripped but $ref references to them remain. Check the source file's imports or the ts-json-schema-generator output.`
672
706
  );
673
707
  }
674
- function Q(e, t) {
708
+ function J(e, t) {
675
709
  if (!e || typeof e != "object")
676
710
  return [];
677
- const r = [];
678
- for (const [o, n] of Object.entries(e))
679
- if (o === "$ref" && typeof n == "string") {
680
- const i = n.match(/#\/(?:\$defs|definitions)\/(.+)$/);
681
- i && !t.has(i[1]) && r.push(n);
682
- } else if (typeof n == "object" && n !== null)
683
- if (Array.isArray(n))
684
- for (const i of n)
685
- typeof i == "object" && i !== null && r.push(
686
- ...Q(i, t)
711
+ const n = [];
712
+ for (const [o, r] of Object.entries(e))
713
+ if (o === "$ref" && typeof r == "string") {
714
+ const i = r.match(/#\/(?:\$defs|definitions)\/(.+)$/);
715
+ i && !t.has(i[1]) && n.push(r);
716
+ } else if (typeof r == "object" && r !== null)
717
+ if (Array.isArray(r))
718
+ for (const i of r)
719
+ typeof i == "object" && i !== null && n.push(
720
+ ...J(i, t)
687
721
  );
688
722
  else
689
- r.push(
690
- ...Q(n, t)
723
+ n.push(
724
+ ...J(r, t)
691
725
  );
692
- return r;
726
+ return n;
693
727
  }
694
- function Ye(e) {
728
+ function rt(e) {
695
729
  const t = e.anyOf;
696
730
  if (!Array.isArray(t) || t.length < 2)
697
731
  return e;
698
- const r = t, o = Y(r), n = { ...e };
699
- return delete n.anyOf, {
700
- ...n,
701
- oneOf: r,
732
+ const n = t, o = D(n), r = { ...e };
733
+ return delete r.anyOf, {
734
+ ...r,
735
+ oneOf: n,
702
736
  ...o ? { discriminator: o } : {},
703
- [q]: n[q] ?? "union"
737
+ [K]: r[K] ?? "union"
704
738
  };
705
739
  }
706
- function et(e, t, r) {
707
- const { DEFAULT_CONFIG: o } = require("ts-json-schema-generator/dist/src/Config.js"), n = { ...o, ...e }, i = n.path, s = He(i, n.tsconfig);
740
+ function ot(e, t, n) {
741
+ const { DEFAULT_CONFIG: o } = require("ts-json-schema-generator/dist/src/Config.js"), r = { ...o, ...e }, i = r.path, s = Xe(i, r.tsconfig);
708
742
  let a;
709
- a = r ? r.statVersion(i) : me(i);
743
+ a = n ? n.statVersion(i) : ye(i);
710
744
  let c;
711
745
  if (s !== void 0) {
712
- const u = (r == null ? void 0 : r.generatorCache.get(s)) ?? Ue(s);
746
+ const u = (n == null ? void 0 : n.generatorCache.get(s)) ?? Qe(s);
713
747
  u && u.version === a && (c = u.gen);
714
748
  }
715
749
  if (!c) {
716
- const { createProgram: u } = require("ts-json-schema-generator/dist/factory/program.js"), l = We(), p = De(
717
- l.SyntaxKind.BigIntKeyword,
718
- l.SyntaxKind.TypeReference
719
- ), S = u(n), h = Pe(
720
- S,
721
- n,
750
+ const { createProgram: u } = require("ts-json-schema-generator/dist/factory/program.js"), f = Ze(), p = Ge(
751
+ f.SyntaxKind.BigIntKeyword,
752
+ f.SyntaxKind.TypeReference
753
+ ), T = u(r), d = ke(
754
+ T,
755
+ r,
722
756
  p
723
- ), m = Ne(n);
724
- if (c = new Oe(
725
- S,
726
- h,
757
+ ), m = Ee(r);
758
+ if (c = new Ce(
759
+ T,
760
+ d,
727
761
  m,
728
- n
729
- ), r && r.stats.generatorsBuilt++, s !== void 0 && a !== void 0) {
730
- const T = { version: a, gen: c };
731
- Ge(s, T), r == null || r.generatorCache.set(s, T);
762
+ r
763
+ ), n && n.stats.generatorsBuilt++, s !== void 0 && a !== void 0) {
764
+ const b = { version: a, gen: c };
765
+ Je(s, b), n == null || n.generatorCache.set(s, b);
732
766
  }
733
767
  }
734
- const f = c.createSchema(n.type);
735
- return Je(f), Xe(f), f;
736
- }
737
- function tt(e, t) {
738
- let r = e.trim();
739
- if (r = be(r), t != null && t.size) {
740
- const n = t.get(r);
741
- if (n !== void 0)
742
- return n;
768
+ const l = c.createSchema(r.type);
769
+ return tt(l), nt(l), l;
770
+ }
771
+ function it(e, t) {
772
+ let n = e.trim();
773
+ if (n = we(n), t != null && t.size) {
774
+ const r = t.get(n);
775
+ if (r !== void 0)
776
+ return r;
743
777
  }
744
- const o = r.match(/^ReadonlyArray<(.+)>$/);
745
- for (o && (r = `${o[1].trim()}[]`); r.startsWith("readonly "); )
746
- r = r.slice(9).trim();
747
- return r;
778
+ const o = n.match(/^ReadonlyArray<(.+)>$/);
779
+ for (o && (n = `${o[1].trim()}[]`); n.startsWith("readonly "); )
780
+ n = n.slice(9).trim();
781
+ return n;
748
782
  }
749
- function Se(e) {
783
+ function ve(e) {
750
784
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
751
785
  }
752
- const nt = Object.entries(Te).map(([e, t]) => ({
786
+ const st = Object.entries(xe).map(([e, t]) => ({
753
787
  // Matches: import("...{modSpec}...").<anyMemberName> (single or double quotes)
754
788
  // The module specifier appears inside an absolute path, so we allow any
755
789
  // characters between the quote and the specifier, and between the specifier
@@ -757,86 +791,86 @@ const nt = Object.entries(Te).map(([e, t]) => ({
757
791
  // …) is matched generically (`\w+`) rather than anchored to one spelling —
758
792
  // see the doc comment above for why.
759
793
  pattern: new RegExp(
760
- `import\\(["'][^"']*${Se(e)}[^"']*["']\\)\\.\\w+`,
794
+ `import\\(["'][^"']*${ve(e)}[^"']*["']\\)\\.\\w+`,
761
795
  "g"
762
796
  ),
763
797
  key: t
764
798
  }));
765
- function be(e) {
799
+ function we(e) {
766
800
  let t = e;
767
- for (const { pattern: r, key: o } of nt)
768
- t = t.replace(r, o);
801
+ for (const { pattern: n, key: o } of st)
802
+ t = t.replace(n, o);
769
803
  return t;
770
804
  }
771
- function rt(e, t) {
772
- let r = be(e);
773
- for (const [o, n] of t)
774
- r = r.replace(
775
- new RegExp(`\\b${Se(o)}\\b`, "g"),
776
- n
805
+ function at(e, t) {
806
+ let n = we(e);
807
+ for (const [o, r] of t)
808
+ n = n.replace(
809
+ new RegExp(`\\b${ve(o)}\\b`, "g"),
810
+ r
777
811
  );
778
- return r;
812
+ return n;
779
813
  }
780
- async function A(e, t, r, o, n, i) {
781
- const s = t.getFilePath(), a = `${s}\0${o ?? ""}\0${r}`, c = i ?? /* @__PURE__ */ new Set();
814
+ async function A(e, t, n, o, r, i) {
815
+ const s = t.getFilePath(), a = `${s}\0${o ?? ""}\0${n}`, c = i ?? /* @__PURE__ */ new Set();
782
816
  if (c.has(a))
783
817
  return {};
784
- if (!n) {
785
- const h = new Set(c);
786
- return h.add(a), ce(
818
+ if (!r) {
819
+ const d = new Set(c);
820
+ return d.add(a), ue(
787
821
  e,
788
822
  t,
789
- r,
823
+ n,
790
824
  o,
791
825
  void 0,
792
- h
826
+ d
793
827
  );
794
828
  }
795
- const f = n.schemaCache.get(a);
796
- if (f !== void 0)
797
- return n.stats.schemaCacheHits++, f;
798
- const u = ke(
829
+ const l = r.schemaCache.get(a);
830
+ if (l !== void 0)
831
+ return r.stats.schemaCacheHits++, l;
832
+ const u = Fe(
799
833
  s,
800
834
  o,
801
- n.statVersion(s)
802
- ), l = u.get(r);
803
- if (l !== void 0)
804
- return n.stats.schemaCacheHits++, n.schemaCache.set(a, Promise.resolve(l)), l;
805
- n.stats.schemaCacheMisses++;
835
+ r.statVersion(s)
836
+ ), f = u.get(n);
837
+ if (f !== void 0)
838
+ return r.stats.schemaCacheHits++, r.schemaCache.set(a, Promise.resolve(f)), f;
839
+ r.stats.schemaCacheMisses++;
806
840
  const p = new Set(c);
807
841
  p.add(a);
808
- const S = ce(
842
+ const T = ue(
809
843
  e,
810
844
  t,
811
- r,
812
- o,
813
845
  n,
846
+ o,
847
+ r,
814
848
  p
815
- ).then((h) => (u.set(r, h), h)).catch((h) => {
816
- throw n.schemaCache.delete(a), h;
849
+ ).then((d) => (u.set(n, d), d)).catch((d) => {
850
+ throw r.schemaCache.delete(a), d;
817
851
  });
818
- return n.schemaCache.set(a, S), S;
852
+ return r.schemaCache.set(a, T), T;
819
853
  }
820
- async function ce(e, t, r, o, n, i) {
821
- if (["void", "undefined", "null", "Promise<void>"].includes(r))
854
+ async function ue(e, t, n, o, r, i) {
855
+ if (["void", "undefined", "null", "Promise<void>"].includes(n))
822
856
  return { type: "null" };
823
857
  let s;
824
- if (n) {
825
- const p = n.aliasCache.get(t);
826
- s = p ?? ae(t), p || n.aliasCache.set(t, s);
858
+ if (r) {
859
+ const p = r.aliasCache.get(t);
860
+ s = p ?? ce(t), p || r.aliasCache.set(t, s);
827
861
  } else
828
- s = ae(t);
829
- const a = tt(r, s), c = H[a];
862
+ s = ce(t);
863
+ const a = it(n, s), c = H[a];
830
864
  if (c !== void 0)
831
865
  return c;
832
- const f = await qe(
866
+ const l = await Ue(
833
867
  a,
834
- (p) => A(e, t, p, o, n, i)
868
+ (p) => A(e, t, p, o, r, i)
835
869
  );
836
- if (f !== void 0)
837
- return f;
838
- const u = (n == null ? void 0 : n.zodImportCache.get(t)) ?? Qe(t);
839
- if (n && n.zodImportCache.set(t, u), !u)
870
+ if (l !== void 0)
871
+ return l;
872
+ const u = (r == null ? void 0 : r.zodImportCache.get(t)) ?? et(t);
873
+ if (r && r.zodImportCache.set(t, u), !u)
840
874
  try {
841
875
  const p = {
842
876
  path: t.getFilePath(),
@@ -865,18 +899,18 @@ async function ce(e, t, r, o, n, i) {
865
899
  // dereference/hoist pass and is tracked separately, unresolved, in
866
900
  // BUG-APIGEN-026's BACKLOG entry.
867
901
  topRef: !1
868
- }, S = et(p, !0, n);
869
- return Ye(S);
902
+ }, T = ot(p, !0, r);
903
+ return rt(T);
870
904
  } catch {
871
905
  }
872
906
  try {
873
- const p = await Me(
907
+ const p = await Ke(
874
908
  e,
875
909
  t,
876
910
  a,
877
- (S) => ye(
878
- S,
879
- (h) => A(e, t, h, o, n, i),
911
+ (T) => be(
912
+ T,
913
+ (d) => A(e, t, d, o, r, i),
880
914
  0
881
915
  )
882
916
  );
@@ -884,33 +918,33 @@ async function ce(e, t, r, o, n, i) {
884
918
  return p;
885
919
  } catch {
886
920
  }
887
- const l = rt(a, s);
888
- return z(l, 0, s);
921
+ const f = at(a, s);
922
+ return q(f, 0, s);
889
923
  }
890
- function ee(e, t, r) {
924
+ function ee(e, t, n) {
891
925
  if (e != null && e.hasInitializer()) {
892
926
  const o = e.getInitializer();
893
927
  if (o)
894
928
  return o.getText();
895
929
  }
896
- return ot(r, t);
930
+ return ct(n, t);
897
931
  }
898
- function ot(e, t) {
932
+ function ct(e, t) {
899
933
  var s;
900
- const r = e, o = ((s = r == null ? void 0 : r.getJsDocs) == null ? void 0 : s.call(r)) ?? [], n = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), i = new RegExp(`\\[\\s*${n}\\s*=\\s*([^\\]]+)\\]`);
934
+ const n = e, o = ((s = n == null ? void 0 : n.getJsDocs) == null ? void 0 : s.call(n)) ?? [], r = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), i = new RegExp(`\\[\\s*${r}\\s*=\\s*([^\\]]+)\\]`);
901
935
  for (const a of o)
902
936
  for (const c of a.getTags()) {
903
937
  if (c.getTagName() !== "param")
904
938
  continue;
905
- const f = c.getText().match(i);
906
- if (f)
907
- return f[1].trim();
939
+ const l = c.getText().match(i);
940
+ if (l)
941
+ return l[1].trim();
908
942
  }
909
943
  }
910
- function it(e) {
911
- const t = e.trim(), r = t.match(/^(['"`])([\s\S]*)\1$/);
912
- if (r)
913
- return r[2];
944
+ function ut(e) {
945
+ const t = e.trim(), n = t.match(/^(['"`])([\s\S]*)\1$/);
946
+ if (n)
947
+ return n[2];
914
948
  if (t === "true")
915
949
  return !0;
916
950
  if (t === "false")
@@ -927,71 +961,71 @@ function it(e) {
927
961
  }
928
962
  }
929
963
  }
930
- function st(e, t) {
931
- const r = it(t);
932
- if (r === void 0)
964
+ function lt(e, t) {
965
+ const n = ut(t);
966
+ if (n === void 0)
933
967
  return;
934
- e.default = r;
935
- const o = typeof r == "string" ? r : JSON.stringify(r), n = typeof e.description == "string" ? e.description : void 0;
936
- e.description = n ? `${n} (default: ${o})` : `(default: ${o})`;
968
+ e.default = n;
969
+ const o = typeof n == "string" ? n : JSON.stringify(n), r = typeof e.description == "string" ? e.description : void 0;
970
+ e.description = r ? `${r} (default: ${o})` : `(default: ${o})`;
937
971
  }
938
- async function Ot(e) {
939
- const t = e.session === void 0, r = de(e.session ?? ge());
972
+ async function Lt(e) {
973
+ const t = e.session === void 0, n = Te(e.session ?? he());
940
974
  try {
941
- return await at(e, r);
975
+ return await ft(e, n);
942
976
  } finally {
943
- t && r.dispose();
977
+ t && n.dispose();
944
978
  }
945
979
  }
946
- async function at(e, t) {
980
+ async function ft(e, t) {
947
981
  const {
948
- sourceFile: r,
982
+ sourceFile: n,
949
983
  namespace: o = "",
950
- dropFileSegment: n = !1,
984
+ dropFileSegment: r = !1,
951
985
  tsconfig: i
952
- } = e, s = t.projectFor(i), a = t.sourceFileFor(r, i), c = X.basename(r), f = N(lt(c)), u = n ? null : f, l = N(o), p = [];
953
- for (const [m, T] of a.getExportedDeclarations()) {
986
+ } = e, s = t.projectFor(i), a = t.sourceFileFor(n, i), c = Y.basename(n), l = N(gt(c)), u = r ? null : l, f = N(o), p = [];
987
+ for (const [m, b] of a.getExportedDeclarations()) {
954
988
  if (m === "default" || V(m))
955
989
  continue;
956
- const d = pt(T);
957
- if (d) {
958
- const b = d.getSignature(), x = ue(b, d), w = b.getReturnType().getText();
990
+ const y = yt(b);
991
+ if (y) {
992
+ const S = y.getSignature(), v = le(S, y), w = S.getReturnType().getText();
959
993
  p.push(
960
994
  await M(
961
995
  s,
962
996
  a,
963
- l,
997
+ f,
964
998
  u,
965
999
  m,
966
- x,
1000
+ v,
967
1001
  w,
968
- d.isAsync(),
1002
+ y.isAsync(),
969
1003
  i,
970
1004
  t
971
1005
  )
972
1006
  );
973
1007
  continue;
974
1008
  }
975
- const y = T.find(
976
- (b) => b.getKindName() === "VariableDeclaration"
1009
+ const h = b.find(
1010
+ (S) => S.getKindName() === "VariableDeclaration"
977
1011
  );
978
- if (!y)
1012
+ if (!h)
979
1013
  continue;
980
- const g = y.getInitializer(), v = g == null ? void 0 : g.getKindName();
981
- if (g && ["ArrowFunction", "FunctionExpression"].includes(v ?? "")) {
982
- const x = y.getType().getCallSignatures();
983
- if (x.length === 0)
1014
+ const g = h.getInitializer(), x = g == null ? void 0 : g.getKindName();
1015
+ if (g && ["ArrowFunction", "FunctionExpression"].includes(x ?? "")) {
1016
+ const v = h.getType().getCallSignatures();
1017
+ if (v.length === 0)
984
1018
  continue;
985
- const w = x[0], $ = le(
1019
+ const w = v[0], $ = fe(
986
1020
  w,
987
- y,
988
- y.getVariableStatement()
1021
+ h,
1022
+ h.getVariableStatement()
989
1023
  ), j = w.getReturnType().getText(), P = g.isAsync();
990
1024
  p.push(
991
1025
  await M(
992
1026
  s,
993
1027
  a,
994
- l,
1028
+ f,
995
1029
  u,
996
1030
  m,
997
1031
  $,
@@ -1001,32 +1035,32 @@ async function at(e, t) {
1001
1035
  t
1002
1036
  )
1003
1037
  );
1004
- } else if (v === "ObjectLiteralExpression") {
1005
- const b = y.getType();
1006
- for (const x of b.getProperties()) {
1007
- const w = x.getName();
1038
+ } else if (x === "ObjectLiteralExpression") {
1039
+ const S = h.getType();
1040
+ for (const v of S.getProperties()) {
1041
+ const w = v.getName();
1008
1042
  if (V(w))
1009
1043
  continue;
1010
- const j = x.getTypeAtLocation(y).getCallSignatures();
1044
+ const j = v.getTypeAtLocation(h).getCallSignatures();
1011
1045
  if (j.length === 0)
1012
1046
  continue;
1013
- const P = j[0], D = le(
1047
+ const P = j[0], B = fe(
1014
1048
  P,
1015
- y,
1016
- y.getVariableStatement()
1017
- ), R = P.getReturnType().getText(), L = [
1049
+ h,
1050
+ h.getVariableStatement()
1051
+ ), R = P.getReturnType().getText(), _ = [
1018
1052
  ...u ? [u] : [],
1019
1053
  N(m),
1020
1054
  N(w)
1021
1055
  ];
1022
1056
  p.push(
1023
- await K(
1057
+ await z(
1024
1058
  s,
1025
1059
  a,
1026
- l,
1027
- L,
1060
+ f,
1061
+ _,
1028
1062
  w,
1029
- D,
1063
+ B,
1030
1064
  R,
1031
1065
  !1,
1032
1066
  i,
@@ -1035,17 +1069,17 @@ async function at(e, t) {
1035
1069
  );
1036
1070
  }
1037
1071
  } else {
1038
- const b = y.getType(), x = b.getText();
1039
- if (E(b, y)) {
1072
+ const S = h.getType(), v = S.getText();
1073
+ if (E(S, h)) {
1040
1074
  const w = await A(
1041
1075
  s,
1042
1076
  a,
1043
- x,
1077
+ v,
1044
1078
  i,
1045
1079
  t
1046
1080
  );
1047
1081
  p.push(
1048
- ut(l, u, m, w)
1082
+ mt(f, u, m, w)
1049
1083
  );
1050
1084
  } else
1051
1085
  console.warn(
@@ -1053,24 +1087,24 @@ async function at(e, t) {
1053
1087
  );
1054
1088
  }
1055
1089
  }
1056
- const S = a.getDefaultExportSymbol();
1057
- if (S) {
1058
- const m = a.getExportAssignment((T) => !T.isExportEquals());
1090
+ const T = a.getDefaultExportSymbol();
1091
+ if (T) {
1092
+ const m = a.getExportAssignment((b) => !b.isExportEquals());
1059
1093
  if (m) {
1060
- const T = m.getExpression(), d = T.getKindName();
1061
- if (["ArrowFunction", "FunctionExpression"].includes(d)) {
1062
- const g = T.getType().getCallSignatures();
1094
+ const b = m.getExpression(), y = b.getKindName();
1095
+ if (["ArrowFunction", "FunctionExpression"].includes(y)) {
1096
+ const g = b.getType().getCallSignatures();
1063
1097
  if (g.length > 0) {
1064
- const v = g[0], b = W(v, m), x = v.getReturnType().getText(), w = T.isAsync();
1098
+ const x = g[0], S = W(x, m), v = x.getReturnType().getText(), w = b.isAsync();
1065
1099
  p.push(
1066
1100
  await M(
1067
1101
  s,
1068
1102
  a,
1069
- l,
1103
+ f,
1070
1104
  u,
1071
1105
  "default",
1072
- b,
1073
- x,
1106
+ S,
1107
+ v,
1074
1108
  w,
1075
1109
  i,
1076
1110
  t
@@ -1078,26 +1112,26 @@ async function at(e, t) {
1078
1112
  );
1079
1113
  }
1080
1114
  } else {
1081
- const y = T.getType();
1082
- for (const g of y.getProperties()) {
1083
- const v = g.getName();
1084
- if (V(v))
1115
+ const h = b.getType();
1116
+ for (const g of h.getProperties()) {
1117
+ const x = g.getName();
1118
+ if (V(x))
1085
1119
  continue;
1086
- const x = g.getTypeAtLocation(m).getCallSignatures();
1087
- if (x.length === 0)
1120
+ const v = g.getTypeAtLocation(m).getCallSignatures();
1121
+ if (v.length === 0)
1088
1122
  continue;
1089
- const w = x[0], $ = W(w, m), j = w.getReturnType().getText(), P = [
1123
+ const w = v[0], $ = W(w, m), j = w.getReturnType().getText(), P = [
1090
1124
  ...u ? [u] : [],
1091
1125
  N("default"),
1092
- N(v)
1126
+ N(x)
1093
1127
  ];
1094
1128
  p.push(
1095
- await K(
1129
+ await z(
1096
1130
  s,
1097
1131
  a,
1098
- l,
1132
+ f,
1099
1133
  P,
1100
- v,
1134
+ x,
1101
1135
  $,
1102
1136
  j,
1103
1137
  !1,
@@ -1108,21 +1142,21 @@ async function at(e, t) {
1108
1142
  }
1109
1143
  }
1110
1144
  } else {
1111
- const T = S.getDeclarations();
1112
- for (const d of T) {
1113
- if (d.getKindName() !== "FunctionDeclaration")
1145
+ const b = T.getDeclarations();
1146
+ for (const y of b) {
1147
+ if (y.getKindName() !== "FunctionDeclaration")
1114
1148
  continue;
1115
- const y = d, g = y.getName(), v = g && g.length > 0 ? g : "default", b = y.getSignature(), x = ue(b, y), w = b.getReturnType().getText();
1149
+ const h = y, g = h.getName(), x = g && g.length > 0 ? g : "default", S = h.getSignature(), v = le(S, h), w = S.getReturnType().getText();
1116
1150
  p.push(
1117
1151
  await M(
1118
1152
  s,
1119
1153
  a,
1120
- l,
1154
+ f,
1121
1155
  u,
1122
- v,
1123
1156
  x,
1157
+ v,
1124
1158
  w,
1125
- y.isAsync(),
1159
+ h.isAsync(),
1126
1160
  i,
1127
1161
  t
1128
1162
  )
@@ -1130,24 +1164,24 @@ async function at(e, t) {
1130
1164
  }
1131
1165
  }
1132
1166
  }
1133
- const h = ft(a);
1134
- if (h.length > 0)
1135
- for (const { name: m, sig: T } of h) {
1167
+ const d = dt(a);
1168
+ if (d.length > 0)
1169
+ for (const { name: m, sig: b } of d) {
1136
1170
  if (V(m))
1137
1171
  continue;
1138
- const d = W(T), y = T.getReturnType().getText(), g = [
1172
+ const y = W(b), h = b.getReturnType().getText(), g = [
1139
1173
  ...u ? [u] : [],
1140
1174
  N(m)
1141
1175
  ];
1142
1176
  p.push(
1143
- await K(
1177
+ await z(
1144
1178
  s,
1145
1179
  a,
1146
- l,
1180
+ f,
1147
1181
  g,
1148
1182
  m,
1149
- d,
1150
1183
  y,
1184
+ h,
1151
1185
  !1,
1152
1186
  i,
1153
1187
  t
@@ -1156,104 +1190,104 @@ async function at(e, t) {
1156
1190
  }
1157
1191
  return p;
1158
1192
  }
1159
- function ct(e, t, r, o) {
1160
- const n = /* @__PURE__ */ new Set(), i = (s) => {
1193
+ function pt(e, t, n, o) {
1194
+ const r = /* @__PURE__ */ new Set(), i = (s) => {
1161
1195
  if (Array.isArray(s))
1162
1196
  return s.map(i);
1163
- if (!s || typeof s != "object" || n.has(s))
1197
+ if (!s || typeof s != "object" || r.has(s))
1164
1198
  return s;
1165
- n.add(s);
1199
+ r.add(s);
1166
1200
  try {
1167
1201
  const a = s, c = {};
1168
- for (const [f, u] of Object.entries(a)) {
1169
- if (f === "definitions" || f === "$defs") {
1170
- const l = f, p = t[l];
1171
- for (const [S, h] of Object.entries(
1202
+ for (const [l, u] of Object.entries(a)) {
1203
+ if (l === "definitions" || l === "$defs") {
1204
+ const f = l, p = t[f];
1205
+ for (const [T, d] of Object.entries(
1172
1206
  u
1173
1207
  )) {
1174
- const m = i(h), T = p[S];
1175
- if (T !== void 0 && JSON.stringify(T) !== JSON.stringify(m))
1208
+ const m = i(d), b = p[T];
1209
+ if (b !== void 0 && JSON.stringify(b) !== JSON.stringify(m))
1176
1210
  throw new Error(
1177
- `[apigen-core-client] Function "${r}": param "${o}" contributes a "${l}.${S}" definition that conflicts with an identically-named definition already hoisted from another param/output in the same function. Two structurally different types share the same generated definition key, so apigen cannot safely merge them into one function-level schema.`
1211
+ `[apigen-core-client] Function "${n}": param "${o}" contributes a "${f}.${T}" definition that conflicts with an identically-named definition already hoisted from another param/output in the same function. Two structurally different types share the same generated definition key, so apigen cannot safely merge them into one function-level schema.`
1178
1212
  );
1179
- p[S] = m;
1213
+ p[T] = m;
1180
1214
  }
1181
1215
  continue;
1182
1216
  }
1183
- c[f] = i(u);
1217
+ c[l] = i(u);
1184
1218
  }
1185
1219
  return c;
1186
1220
  } finally {
1187
- n.delete(s);
1221
+ r.delete(s);
1188
1222
  }
1189
1223
  };
1190
1224
  return i(e);
1191
1225
  }
1192
- async function M(e, t, r, o, n, i, s, a, c, f) {
1193
- const u = N(n);
1194
- return K(
1226
+ async function M(e, t, n, o, r, i, s, a, c, l) {
1227
+ const u = N(r);
1228
+ return z(
1195
1229
  e,
1196
1230
  t,
1197
- r,
1198
- o ? [o, u] : [u],
1199
1231
  n,
1232
+ o ? [o, u] : [u],
1233
+ r,
1200
1234
  i,
1201
1235
  s,
1202
1236
  a,
1203
1237
  c,
1204
- f
1238
+ l
1205
1239
  );
1206
1240
  }
1207
- async function K(e, t, r, o, n, i, s, a, c, f) {
1208
- const u = i.length > 0 && i[0].name === "ctx", l = i.filter((g) => g.name !== "ctx"), p = l.filter((g) => !g.optional).map((g) => g.name), S = {}, h = {
1241
+ async function z(e, t, n, o, r, i, s, a, c, l) {
1242
+ const u = i.length > 0 && i[0].name === "ctx", f = i.filter((g) => g.name !== "ctx"), p = f.filter((g) => !g.optional).map((g) => g.name), T = {}, d = {
1209
1243
  definitions: {},
1210
1244
  $defs: {}
1211
1245
  };
1212
- for (const g of l) {
1213
- const v = await A(e, t, g.type, c, f), b = ct(v, h, n, g.name);
1214
- g.defaultValue !== void 0 && st(b, g.defaultValue), S[g.name] = b;
1246
+ for (const g of f) {
1247
+ const x = await A(e, t, g.type, c, l), S = pt(x, d, r, g.name);
1248
+ g.defaultValue !== void 0 && lt(S, g.defaultValue), T[g.name] = S;
1215
1249
  }
1216
- const m = s.replace(/^Promise<(.+)>$/, "$1").trim(), T = await A(
1250
+ const m = s.replace(/^Promise<(.+)>$/, "$1").trim(), b = await A(
1217
1251
  e,
1218
1252
  t,
1219
1253
  m,
1220
1254
  c,
1221
- f
1222
- ), d = {
1255
+ l
1256
+ ), y = {
1223
1257
  type: "object",
1224
- properties: S,
1258
+ properties: T,
1225
1259
  required: p,
1226
1260
  // BUG-APIGEN-029: hoisted definitions from param fragments — see
1227
1261
  // hoistNestedDefs. Only attached when non-empty so the common
1228
1262
  // (no-recursive-type) case's schema shape is unchanged.
1229
- ...Object.keys(h.definitions).length > 0 ? { definitions: h.definitions } : {},
1230
- ...Object.keys(h.$defs).length > 0 ? { $defs: h.$defs } : {}
1263
+ ...Object.keys(d.definitions).length > 0 ? { definitions: d.definitions } : {},
1264
+ ...Object.keys(d.$defs).length > 0 ? { $defs: d.$defs } : {}
1231
1265
  };
1232
1266
  return {
1233
- id: ve(r, o),
1267
+ id: je(n, o),
1234
1268
  host: "ts",
1235
- namespace: r,
1269
+ namespace: n,
1236
1270
  path: o,
1237
1271
  kind: "action",
1238
1272
  async: a,
1239
1273
  streaming: !1,
1240
1274
  safe: !1,
1241
1275
  // action → false per §4
1242
- input: d,
1243
- output: T,
1276
+ input: y,
1277
+ output: b,
1244
1278
  envelope: {},
1245
1279
  typeText: {
1246
1280
  lang: "ts",
1247
- input: mt(i),
1281
+ input: ht(i),
1248
1282
  output: m
1249
1283
  },
1250
1284
  ...u ? { hasCtx: !0 } : {}
1251
1285
  };
1252
1286
  }
1253
- function ut(e, t, r, o) {
1254
- const n = N(r), i = t ? [t, n] : [n];
1287
+ function mt(e, t, n, o) {
1288
+ const r = N(n), i = t ? [t, r] : [r];
1255
1289
  return {
1256
- id: ve(e, i),
1290
+ id: je(e, i),
1257
1291
  host: "ts",
1258
1292
  namespace: e,
1259
1293
  path: i,
@@ -1268,10 +1302,10 @@ function ut(e, t, r, o) {
1268
1302
  typeText: null
1269
1303
  };
1270
1304
  }
1271
- function ve(e, t) {
1305
+ function je(e, t) {
1272
1306
  return (e.raw ? [e, ...t] : t).map((o) => o.words.join("-")).join("/");
1273
1307
  }
1274
- function xe(e) {
1308
+ function $e(e) {
1275
1309
  return e.split(/[-_.]+/).flatMap(
1276
1310
  (t) => (
1277
1311
  // Then split PascalCase / camelCase transitions
@@ -1280,23 +1314,23 @@ function xe(e) {
1280
1314
  ).map((t) => t.toLowerCase()).filter(Boolean);
1281
1315
  }
1282
1316
  function N(e) {
1283
- return { raw: e, words: xe(e) };
1317
+ return { raw: e, words: $e(e) };
1284
1318
  }
1285
- function lt(e) {
1319
+ function gt(e) {
1286
1320
  return e.replace(/\.[^.]+$/, "").replace(/[._]+/g, "-");
1287
1321
  }
1288
- function ft(e) {
1322
+ function dt(e) {
1289
1323
  const t = [];
1290
- for (const r of e.getStatements()) {
1291
- if (r.getKindName() !== "ExpressionStatement")
1324
+ for (const n of e.getStatements()) {
1325
+ if (n.getKindName() !== "ExpressionStatement")
1292
1326
  continue;
1293
- const o = r.getExpression();
1327
+ const o = n.getExpression();
1294
1328
  if (o.getKindName() !== "BinaryExpression")
1295
1329
  continue;
1296
- const n = o;
1297
- if (n.getLeft().getText().trim() !== "module.exports" || n.getOperatorToken().getKindName() !== "EqualsToken")
1330
+ const r = o;
1331
+ if (r.getLeft().getText().trim() !== "module.exports" || r.getOperatorToken().getKindName() !== "EqualsToken")
1298
1332
  continue;
1299
- const s = n.getRight(), a = s.getType();
1333
+ const s = r.getRight(), a = s.getType();
1300
1334
  for (const c of a.getProperties()) {
1301
1335
  const u = c.getTypeAtLocation(s).getCallSignatures();
1302
1336
  u.length !== 0 && t.push({ name: c.getName(), sig: u[0] });
@@ -1304,33 +1338,33 @@ function ft(e) {
1304
1338
  }
1305
1339
  return t;
1306
1340
  }
1307
- function pt(e) {
1341
+ function yt(e) {
1308
1342
  let t;
1309
- for (const r of e) {
1310
- if (r.getKindName() !== "FunctionDeclaration")
1343
+ for (const n of e) {
1344
+ if (n.getKindName() !== "FunctionDeclaration")
1311
1345
  continue;
1312
- const o = r;
1346
+ const o = n;
1313
1347
  if (t || (t = o), o.getBody())
1314
1348
  return o;
1315
1349
  }
1316
1350
  return t;
1317
1351
  }
1318
- function ue(e, t) {
1319
- return e.getParameters().map((r) => {
1352
+ function le(e, t) {
1353
+ return e.getParameters().map((n) => {
1320
1354
  var s;
1321
- const o = r.getDeclarations(), n = o.length > 0 && o[0].getKindName() === "Parameter" ? o[0] : null, i = r.isOptional() || ((n == null ? void 0 : n.hasInitializer()) ?? !1) || (((s = n == null ? void 0 : n.hasQuestionToken) == null ? void 0 : s.call(n)) ?? !1);
1355
+ const o = n.getDeclarations(), r = o.length > 0 && o[0].getKindName() === "Parameter" ? o[0] : null, i = n.isOptional() || ((r == null ? void 0 : r.hasInitializer()) ?? !1) || (((s = r == null ? void 0 : r.hasQuestionToken) == null ? void 0 : s.call(r)) ?? !1);
1322
1356
  return {
1323
- name: r.getName(),
1324
- type: r.getTypeAtLocation(e.getDeclaration()).getText(),
1357
+ name: n.getName(),
1358
+ type: n.getTypeAtLocation(e.getDeclaration()).getText(),
1325
1359
  optional: i,
1326
- defaultValue: ee(n, r.getName(), t)
1360
+ defaultValue: ee(r, n.getName(), t)
1327
1361
  };
1328
1362
  });
1329
1363
  }
1330
- function le(e, t, r) {
1364
+ function fe(e, t, n) {
1331
1365
  return e.getParameters().map((o) => {
1332
1366
  var a;
1333
- const n = o.getDeclarations(), i = n.length > 0 && n[0].getKindName() === "Parameter" ? n[0] : null, s = o.isOptional() || ((i == null ? void 0 : i.hasInitializer()) ?? !1) || (((a = i == null ? void 0 : i.hasQuestionToken) == null ? void 0 : a.call(i)) ?? !1);
1367
+ const r = o.getDeclarations(), i = r.length > 0 && r[0].getKindName() === "Parameter" ? r[0] : null, s = o.isOptional() || ((i == null ? void 0 : i.hasInitializer()) ?? !1) || (((a = i == null ? void 0 : i.hasQuestionToken) == null ? void 0 : a.call(i)) ?? !1);
1334
1368
  return {
1335
1369
  name: o.getName(),
1336
1370
  type: o.getTypeAtLocation(t).getText(),
@@ -1338,132 +1372,132 @@ function le(e, t, r) {
1338
1372
  defaultValue: ee(
1339
1373
  i,
1340
1374
  o.getName(),
1341
- r ?? t
1375
+ n ?? t
1342
1376
  )
1343
1377
  };
1344
1378
  });
1345
1379
  }
1346
1380
  function W(e, t) {
1347
- return e.getParameters().map((r) => {
1381
+ return e.getParameters().map((n) => {
1348
1382
  var s, a, c;
1349
- const o = r.getDeclarations(), n = o.length > 0 && o[0].getKindName() === "Parameter" ? o[0] : null, i = r.isOptional() || ((n == null ? void 0 : n.hasInitializer()) ?? !1) || (((s = n == null ? void 0 : n.hasQuestionToken) == null ? void 0 : s.call(n)) ?? !1);
1383
+ const o = n.getDeclarations(), r = o.length > 0 && o[0].getKindName() === "Parameter" ? o[0] : null, i = n.isOptional() || ((r == null ? void 0 : r.hasInitializer()) ?? !1) || (((s = r == null ? void 0 : r.hasQuestionToken) == null ? void 0 : s.call(r)) ?? !1);
1350
1384
  return {
1351
- name: r.getName(),
1352
- type: n ? n.getType().getText() : ((c = (a = r.getValueDeclaration()) == null ? void 0 : a.getType()) == null ? void 0 : c.getText()) ?? "unknown",
1385
+ name: n.getName(),
1386
+ type: r ? r.getType().getText() : ((c = (a = n.getValueDeclaration()) == null ? void 0 : a.getType()) == null ? void 0 : c.getText()) ?? "unknown",
1353
1387
  optional: i,
1354
- defaultValue: ee(n, r.getName(), t)
1388
+ defaultValue: ee(r, n.getName(), t)
1355
1389
  };
1356
1390
  });
1357
1391
  }
1358
- function mt(e) {
1359
- const t = e.filter((r) => r.name !== "ctx");
1360
- return t.length === 0 ? "()" : "(" + t.map((r) => `${r.name}${r.optional ? "?" : ""}: ${r.type}`).join(", ") + ")";
1392
+ function ht(e) {
1393
+ const t = e.filter((n) => n.name !== "ctx");
1394
+ return t.length === 0 ? "()" : "(" + t.map((n) => `${n.name}${n.optional ? "?" : ""}: ${n.type}`).join(", ") + ")";
1361
1395
  }
1362
1396
  function V(e) {
1363
1397
  return !!(e === "__samples__" || e.startsWith("__"));
1364
1398
  }
1365
- function E(e, t, r = /* @__PURE__ */ new Set()) {
1399
+ function E(e, t, n = /* @__PURE__ */ new Set()) {
1366
1400
  if (e.getCallSignatures().length > 0 || e.getConstructSignatures().length > 0)
1367
1401
  return !1;
1368
1402
  if (e.isString() || e.isNumber() || e.isBoolean() || e.isNull() || e.isUndefined() || e.isStringLiteral() || e.isNumberLiteral() || e.isBooleanLiteral() || e.isEnumLiteral())
1369
1403
  return !0;
1370
1404
  if (e.isArray() || e.isReadonlyArray()) {
1371
1405
  const o = e.getArrayElementType();
1372
- return o ? E(o, t, r) : !1;
1406
+ return o ? E(o, t, n) : !1;
1373
1407
  }
1374
1408
  if (e.isTuple())
1375
- return e.getTupleElements().every((o) => E(o, t, r));
1409
+ return e.getTupleElements().every((o) => E(o, t, n));
1376
1410
  if (e.isUnion())
1377
- return e.getUnionTypes().every((o) => E(o, t, r));
1411
+ return e.getUnionTypes().every((o) => E(o, t, n));
1378
1412
  if (e.isIntersection())
1379
- return e.getIntersectionTypes().every((o) => E(o, t, r));
1413
+ return e.getIntersectionTypes().every((o) => E(o, t, n));
1380
1414
  if (e.isObject()) {
1381
1415
  const o = e.getText(t);
1382
- if (r.has(o))
1416
+ if (n.has(o))
1383
1417
  return !0;
1384
- r.add(o);
1385
- const n = e.getStringIndexType(), i = e.getNumberIndexType();
1386
- if (n || i)
1387
- return [n, i].every(
1388
- (a) => !a || E(a, t, r)
1418
+ n.add(o);
1419
+ const r = e.getStringIndexType(), i = e.getNumberIndexType();
1420
+ if (r || i)
1421
+ return [r, i].every(
1422
+ (a) => !a || E(a, t, n)
1389
1423
  );
1390
1424
  const s = e.getProperties();
1391
1425
  return s.length === 0 ? !0 : s.every((a) => {
1392
1426
  const c = a.getTypeAtLocation(t);
1393
- return E(c, t, r);
1427
+ return E(c, t, n);
1394
1428
  });
1395
1429
  }
1396
1430
  return !1;
1397
1431
  }
1398
- async function kt(e) {
1399
- const t = e.session === void 0, r = de(e.session ?? ge());
1432
+ async function Mt(e) {
1433
+ const t = e.session === void 0, n = Te(e.session ?? he());
1400
1434
  try {
1401
- return await gt(e, r);
1435
+ return await Tt(e, n);
1402
1436
  } finally {
1403
- t && r.dispose();
1437
+ t && n.dispose();
1404
1438
  }
1405
1439
  }
1406
- async function gt(e, t) {
1440
+ async function Tt(e, t) {
1407
1441
  const {
1408
- sourceFile: r,
1442
+ sourceFile: n,
1409
1443
  namespace: o = "",
1410
- tsconfig: n,
1444
+ tsconfig: r,
1411
1445
  includeInstances: i = !1
1412
- } = e, s = t.projectFor(n), a = t.sourceFileFor(r, n), c = X.basename(r), f = C(yt(c)), u = C(o), l = [];
1413
- for (const [p, S] of a.getExportedDeclarations()) {
1414
- const h = S.find(
1415
- (d) => d.getKindName() === "ClassDeclaration"
1446
+ } = e, s = t.projectFor(r), a = t.sourceFileFor(n, r), c = Y.basename(n), l = I(St(c)), u = I(o), f = [];
1447
+ for (const [p, T] of a.getExportedDeclarations()) {
1448
+ const d = T.find(
1449
+ (y) => y.getKindName() === "ClassDeclaration"
1416
1450
  );
1417
- if (!h)
1451
+ if (!d)
1418
1452
  continue;
1419
- const m = p === "default" ? h.getName() : p;
1420
- if (!m || U(m))
1453
+ const m = p === "default" ? d.getName() : p;
1454
+ if (!m || G(m))
1421
1455
  continue;
1422
- const T = C(m);
1423
- for (const d of h.getStaticMethods()) {
1424
- const y = d.getName();
1425
- if (U(y))
1456
+ const b = I(m);
1457
+ for (const y of d.getStaticMethods()) {
1458
+ const h = y.getName();
1459
+ if (G(h))
1426
1460
  continue;
1427
- const g = d.getScope();
1428
- if (g === _.Private || g === _.Protected)
1461
+ const g = y.getScope();
1462
+ if (g === L.Private || g === L.Protected)
1429
1463
  continue;
1430
- const v = d.getSignature(), b = B(v, d), x = v.getReturnType().getText(), w = d.isAsync(), $ = [f, T, C(y)];
1431
- l.push(
1432
- await dt(
1464
+ const x = y.getSignature(), S = U(x, y), v = x.getReturnType().getText(), w = y.isAsync(), $ = [l, b, I(h)];
1465
+ f.push(
1466
+ await bt(
1433
1467
  s,
1434
1468
  a,
1435
1469
  u,
1436
1470
  $,
1437
- b,
1438
- x,
1471
+ S,
1472
+ v,
1439
1473
  w,
1440
- n,
1474
+ r,
1441
1475
  t
1442
1476
  )
1443
1477
  );
1444
1478
  }
1445
1479
  if (i) {
1446
1480
  {
1447
- const y = h.getConstructors()[0] ?? null;
1481
+ const h = d.getConstructors()[0] ?? null;
1448
1482
  let g = [];
1449
- if (y) {
1450
- const j = y.getSignature();
1451
- g = B(j, y);
1483
+ if (h) {
1484
+ const j = h.getSignature();
1485
+ g = U(j, h);
1452
1486
  }
1453
- const v = [f, T], b = J(u, v), x = g.filter((j) => j.name !== "ctx"), w = x.filter((j) => !j.optional).map((j) => j.name), $ = {};
1454
- for (const j of x)
1487
+ const x = [l, b], S = X(u, x), v = g.filter((j) => j.name !== "ctx"), w = v.filter((j) => !j.optional).map((j) => j.name), $ = {};
1488
+ for (const j of v)
1455
1489
  $[j.name] = await A(
1456
1490
  s,
1457
1491
  a,
1458
1492
  j.type,
1459
- n,
1493
+ r,
1460
1494
  t
1461
1495
  );
1462
- l.push({
1463
- id: b,
1496
+ f.push({
1497
+ id: S,
1464
1498
  host: "ts",
1465
1499
  namespace: u,
1466
- path: v,
1500
+ path: x,
1467
1501
  kind: "constructor",
1468
1502
  async: !1,
1469
1503
  streaming: !1,
@@ -1477,35 +1511,35 @@ async function gt(e, t) {
1477
1511
  envelope: {},
1478
1512
  typeText: {
1479
1513
  lang: "ts",
1480
- input: ht(g),
1514
+ input: xt(g),
1481
1515
  output: "{ instanceId: string }"
1482
1516
  }
1483
1517
  });
1484
1518
  }
1485
- for (const d of h.getInstanceMethods()) {
1486
- const y = d.getName();
1487
- if (U(y))
1519
+ for (const y of d.getInstanceMethods()) {
1520
+ const h = y.getName();
1521
+ if (G(h))
1488
1522
  continue;
1489
- const g = d.getScope();
1490
- if (g === _.Private || g === _.Protected)
1523
+ const g = y.getScope();
1524
+ if (g === L.Private || g === L.Protected)
1491
1525
  continue;
1492
- const v = d.getSignature(), b = B(v, d), x = v.getReturnType().getText(), w = d.isAsync(), $ = [f, T, C(y)], j = J(u, $), P = b.filter((O) => O.name !== "ctx"), D = P.filter((O) => !O.optional).map((O) => O.name), R = {};
1526
+ const x = y.getSignature(), S = U(x, y), v = x.getReturnType().getText(), w = y.isAsync(), $ = [l, b, I(h)], j = X(u, $), P = S.filter((O) => O.name !== "ctx"), B = P.filter((O) => !O.optional).map((O) => O.name), R = {};
1493
1527
  for (const O of P)
1494
1528
  R[O.name] = await A(
1495
1529
  s,
1496
1530
  a,
1497
1531
  O.type,
1498
- n,
1532
+ r,
1499
1533
  t
1500
1534
  );
1501
- const L = x.replace(/^Promise<(.+)>$/, "$1").trim(), je = await A(
1535
+ const _ = v.replace(/^Promise<(.+)>$/, "$1").trim(), Pe = await A(
1502
1536
  s,
1503
1537
  a,
1504
- L,
1505
- n,
1538
+ _,
1539
+ r,
1506
1540
  t
1507
1541
  );
1508
- l.push({
1542
+ f.push({
1509
1543
  id: j,
1510
1544
  host: "ts",
1511
1545
  namespace: u,
@@ -1514,8 +1548,8 @@ async function gt(e, t) {
1514
1548
  async: w,
1515
1549
  streaming: !1,
1516
1550
  safe: !1,
1517
- input: { type: "object", properties: R, required: D },
1518
- output: je,
1551
+ input: { type: "object", properties: R, required: B },
1552
+ output: Pe,
1519
1553
  envelope: {
1520
1554
  type: "object",
1521
1555
  properties: { instanceId: { type: "string" } },
@@ -1523,26 +1557,26 @@ async function gt(e, t) {
1523
1557
  },
1524
1558
  typeText: {
1525
1559
  lang: "ts",
1526
- input: we(b),
1527
- output: L
1560
+ input: Ae(S),
1561
+ output: _
1528
1562
  }
1529
1563
  });
1530
1564
  }
1531
1565
  }
1532
1566
  }
1533
- return l;
1567
+ return f;
1534
1568
  }
1535
- async function dt(e, t, r, o, n, i, s, a, c) {
1536
- const f = n.filter((m) => m.name !== "ctx"), u = f.filter((m) => !m.optional).map((m) => m.name), l = {};
1537
- for (const m of f)
1538
- l[m.name] = await A(
1569
+ async function bt(e, t, n, o, r, i, s, a, c) {
1570
+ const l = r.filter((m) => m.name !== "ctx"), u = l.filter((m) => !m.optional).map((m) => m.name), f = {};
1571
+ for (const m of l)
1572
+ f[m.name] = await A(
1539
1573
  e,
1540
1574
  t,
1541
1575
  m.type,
1542
1576
  a,
1543
1577
  c
1544
1578
  );
1545
- const p = i.replace(/^Promise<(.+)>$/, "$1").trim(), S = await A(
1579
+ const p = i.replace(/^Promise<(.+)>$/, "$1").trim(), T = await A(
1546
1580
  e,
1547
1581
  t,
1548
1582
  p,
@@ -1550,56 +1584,56 @@ async function dt(e, t, r, o, n, i, s, a, c) {
1550
1584
  c
1551
1585
  );
1552
1586
  return {
1553
- id: J(r, o),
1587
+ id: X(n, o),
1554
1588
  host: "ts",
1555
- namespace: r,
1589
+ namespace: n,
1556
1590
  path: o,
1557
1591
  kind: "action",
1558
1592
  async: s,
1559
1593
  streaming: !1,
1560
1594
  safe: !1,
1561
1595
  // action → false per §4
1562
- input: { type: "object", properties: l, required: u },
1563
- output: S,
1596
+ input: { type: "object", properties: f, required: u },
1597
+ output: T,
1564
1598
  envelope: {},
1565
1599
  typeText: {
1566
1600
  lang: "ts",
1567
- input: we(n),
1601
+ input: Ae(r),
1568
1602
  output: p
1569
1603
  }
1570
1604
  };
1571
1605
  }
1572
- function J(e, t) {
1606
+ function X(e, t) {
1573
1607
  return (e.raw ? [e, ...t] : t).map((o) => o.words.join("-")).join("/");
1574
1608
  }
1575
- function C(e) {
1576
- return { raw: e, words: xe(e) };
1609
+ function I(e) {
1610
+ return { raw: e, words: $e(e) };
1577
1611
  }
1578
- function yt(e) {
1612
+ function St(e) {
1579
1613
  return e.replace(/\.[^.]+$/, "").replace(/[._]+/g, "-");
1580
1614
  }
1581
- function B(e, t) {
1582
- return e.getParameters().map((r) => {
1615
+ function U(e, t) {
1616
+ return e.getParameters().map((n) => {
1583
1617
  var s;
1584
- const o = r.getDeclarations(), n = o.length > 0 && o[0].getKindName() === "Parameter" ? o[0] : null, i = r.isOptional() || ((n == null ? void 0 : n.hasInitializer()) ?? !1) || (((s = n == null ? void 0 : n.hasQuestionToken) == null ? void 0 : s.call(n)) ?? !1);
1618
+ const o = n.getDeclarations(), r = o.length > 0 && o[0].getKindName() === "Parameter" ? o[0] : null, i = n.isOptional() || ((r == null ? void 0 : r.hasInitializer()) ?? !1) || (((s = r == null ? void 0 : r.hasQuestionToken) == null ? void 0 : s.call(r)) ?? !1);
1585
1619
  return {
1586
- name: r.getName(),
1587
- type: r.getTypeAtLocation(t).getText(),
1620
+ name: n.getName(),
1621
+ type: n.getTypeAtLocation(t).getText(),
1588
1622
  optional: i
1589
1623
  };
1590
1624
  });
1591
1625
  }
1592
- function we(e) {
1593
- const t = e.filter((r) => r.name !== "ctx");
1594
- return t.length === 0 ? "()" : "(" + t.map((r) => `${r.name}${r.optional ? "?" : ""}: ${r.type}`).join(", ") + ")";
1626
+ function Ae(e) {
1627
+ const t = e.filter((n) => n.name !== "ctx");
1628
+ return t.length === 0 ? "()" : "(" + t.map((n) => `${n.name}${n.optional ? "?" : ""}: ${n.type}`).join(", ") + ")";
1595
1629
  }
1596
- function ht(e) {
1630
+ function xt(e) {
1597
1631
  return e.length === 0 ? "()" : "(" + e.map((t) => `${t.name}${t.optional ? "?" : ""}: ${t.type}`).join(", ") + ")";
1598
1632
  }
1599
- function U(e) {
1633
+ function G(e) {
1600
1634
  return !!(e === "__samples__" || e.startsWith("__") || e.startsWith("_"));
1601
1635
  }
1602
- const Tt = /* @__PURE__ */ new Map([
1636
+ const vt = /* @__PURE__ */ new Map([
1603
1637
  // TypeScript variants
1604
1638
  [".ts", "ts"],
1605
1639
  [".tsx", "ts"],
@@ -1614,31 +1648,151 @@ const Tt = /* @__PURE__ */ new Map([
1614
1648
  // Java / Kotlin (both are JVM host languages for the purposes of routing)
1615
1649
  [".java", "java"]
1616
1650
  ]);
1617
- function St(e) {
1618
- const t = Ae.extname(e).toLowerCase();
1619
- return Tt.get(t);
1651
+ function wt(e) {
1652
+ const t = Oe.extname(e).toLowerCase();
1653
+ return vt.get(t);
1620
1654
  }
1621
- function bt(e) {
1655
+ function jt(e) {
1622
1656
  return e.language ?? "ts";
1623
1657
  }
1624
- function vt(e, t) {
1625
- const r = St(t);
1626
- return r === void 0 ? !1 : r === bt(e);
1658
+ function $t(e, t) {
1659
+ const n = wt(t);
1660
+ return n === void 0 ? !1 : n === jt(e);
1661
+ }
1662
+ function Vt(e, t) {
1663
+ return t.filter((n) => $t(e, n));
1664
+ }
1665
+ function At(e) {
1666
+ return {
1667
+ oneOf: [
1668
+ {
1669
+ type: "object",
1670
+ required: ["index", "status", "value"],
1671
+ properties: {
1672
+ index: { type: "integer" },
1673
+ status: { type: "string", enum: ["fulfilled"] },
1674
+ value: e
1675
+ }
1676
+ },
1677
+ {
1678
+ type: "object",
1679
+ required: ["index", "status", "chunks"],
1680
+ properties: {
1681
+ index: { type: "integer" },
1682
+ status: { type: "string", enum: ["fulfilled"] },
1683
+ chunks: { type: "array" }
1684
+ }
1685
+ },
1686
+ {
1687
+ type: "object",
1688
+ required: ["index", "status", "reason"],
1689
+ properties: {
1690
+ index: { type: "integer" },
1691
+ status: { type: "string", enum: ["rejected"] },
1692
+ reason: {},
1693
+ chunksDelivered: { type: "integer" }
1694
+ }
1695
+ }
1696
+ ]
1697
+ };
1698
+ }
1699
+ function Pt(e) {
1700
+ return {
1701
+ operationConst: e.id,
1702
+ itemsSchema: e.input,
1703
+ resultSchema: At(e.output)
1704
+ };
1705
+ }
1706
+ function Nt(e, t = {}) {
1707
+ const n = new Set(t.exclude ?? []), o = /* @__PURE__ */ new Map();
1708
+ for (const r of e) {
1709
+ if (n.has(r.id))
1710
+ continue;
1711
+ const i = o.get(r.kind);
1712
+ i ? i.push(r) : o.set(r.kind, [r]);
1713
+ }
1714
+ return o;
1715
+ }
1716
+ function pe(e) {
1717
+ return { type: "string", enum: [e] };
1718
+ }
1719
+ function me(e, t) {
1720
+ return {
1721
+ type: "object",
1722
+ required: ["operation", "items"],
1723
+ properties: {
1724
+ operation: t,
1725
+ items: { type: "array", items: e.itemsSchema },
1726
+ concurrency: { type: "number" },
1727
+ mode: { type: "string", enum: ["parallel", "serial", "chained"] },
1728
+ onItemError: { type: "string", enum: ["continue", "abort"] },
1729
+ itemTimeoutMs: { type: "number" }
1730
+ },
1731
+ // Additive-forward-compat (§7 open-question 3): a future `batchId`
1732
+ // control-plane field must be addable without a breaking change, so this
1733
+ // branch object must never be a closed schema.
1734
+ additionalProperties: !0
1735
+ };
1736
+ }
1737
+ function Ot(e) {
1738
+ if (e.length === 0)
1739
+ throw new Error("buildBatchKindSchema: at least one operation is required");
1740
+ const t = e.map(Pt);
1741
+ if (e.length === 1) {
1742
+ const [r] = e, [i] = t;
1743
+ return {
1744
+ input: me(i, pe(r.id)),
1745
+ output: { type: "array", items: i.resultSchema }
1746
+ };
1747
+ }
1748
+ const n = e.map(
1749
+ (r, i) => me(t[i], pe(r.id))
1750
+ ), o = D(
1751
+ n
1752
+ );
1753
+ return {
1754
+ input: {
1755
+ oneOf: n,
1756
+ ...o ? { discriminator: o } : {}
1757
+ },
1758
+ output: {
1759
+ oneOf: t.map((r) => ({ type: "array", items: r.resultSchema }))
1760
+ },
1761
+ ...o ? { discriminator: o } : {}
1762
+ };
1627
1763
  }
1628
- function Et(e, t) {
1629
- return t.filter((r) => vt(e, r));
1764
+ function qt(e, t = {}) {
1765
+ const n = Nt(e.operations, t), o = [];
1766
+ for (const [r, i] of n) {
1767
+ const { input: s, output: a } = Ot(i), c = Ie(`_batch/${r}`, e, {
1768
+ kind: r,
1769
+ safe: r === "query",
1770
+ input: s,
1771
+ output: a
1772
+ });
1773
+ o.push({
1774
+ ...c,
1775
+ operationIds: i.map((l) => l.id)
1776
+ });
1777
+ }
1778
+ return o;
1630
1779
  }
1631
1780
  export {
1632
- At as clearPersistentProjectCache,
1633
- Nt as composeSchemas,
1634
- ge as createExtractionSession,
1635
- bt as effectiveLanguage,
1636
- Ot as extract,
1637
- kt as extractClasses,
1638
- Ie as isPrimitiveOnlyInputSchema,
1639
- St as languageOfSource,
1640
- vt as pluginConsumesSource,
1641
- Pt as pluginsToEnvelopeMiddlewares,
1642
- Et as sourcesForPlugin,
1643
- xe as tokenize
1781
+ Ot as buildBatchKindSchema,
1782
+ qt as buildBatchMountedOperations,
1783
+ Ft as clearPersistentProjectCache,
1784
+ _t as composeSchemas,
1785
+ he as createExtractionSession,
1786
+ Pt as deriveBatchOperationBranch,
1787
+ jt as effectiveLanguage,
1788
+ Lt as extract,
1789
+ Mt as extractClasses,
1790
+ Nt as groupBatchableOperationsByKind,
1791
+ _e as isPrimitiveOnlyInputSchema,
1792
+ wt as languageOfSource,
1793
+ $t as pluginConsumesSource,
1794
+ Rt as pluginsToEnvelopeMiddlewares,
1795
+ Vt as sourcesForPlugin,
1796
+ Ie as syntheticOp,
1797
+ $e as tokenize
1644
1798
  };