theokit 0.52.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-AHGYRVQX.js → agent-GX4RIRRX.js} +2 -2
- package/dist/{app-typed-client-FQVMEG4Z.js → app-typed-client-DFRID25X.js} +18 -27
- package/dist/app-typed-client-DFRID25X.js.map +1 -0
- package/dist/{app-typed-client-ZZIASI4A.js → app-typed-client-IPWJWM2E.js} +18 -27
- package/dist/app-typed-client-IPWJWM2E.js.map +1 -0
- package/dist/{build-3AYYQZGQ.js → build-IVLQ5TUQ.js} +2 -2
- package/dist/{chunk-I4ELCXNV.js → chunk-67DBYOXI.js} +2 -2
- package/dist/{chunk-SAFGDIPQ.js → chunk-BZF76LFM.js} +18 -7
- package/dist/chunk-BZF76LFM.js.map +1 -0
- package/dist/{chunk-DHAD2O3S.js → chunk-KHBSMLYU.js} +2 -2
- package/dist/{chunk-MBFD6NHB.js → chunk-LPNSZK3A.js} +2 -2
- package/dist/{chunk-PFAVZL4F.js → chunk-Y5E7VFNJ.js} +2 -2
- package/dist/{chunk-7ZOQN7UH.js → chunk-ZQO37YQJ.js} +2 -2
- package/dist/cli/index.js +5 -5
- package/dist/client/index.d.ts +31 -1
- package/dist/client/index.js +17 -0
- package/dist/client/index.js.map +1 -1
- package/dist/{define-agent-tool-cRuSpidb.d.ts → define-agent-tool-CizaYZwU.d.ts} +9 -4
- package/dist/{dev-W7OXHMSP.js → dev-TLVSKNSH.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{mcp-7BXBN7PD.js → mcp-OZACRG7O.js} +2 -2
- package/dist/{preview-4ZTFJG2D.js → preview-DCJPTZVW.js} +2 -2
- package/dist/server/agent/index.d.ts +1 -1
- package/dist/server/agent/index.js +2 -2
- package/dist/server/define/index.d.ts +2 -2
- package/dist/server/define/index.js +2 -2
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +3 -3
- package/dist/vite-plugin/index.js +1 -1
- package/dist/{vite-plugin-2XM35VNV.js → vite-plugin-KIBK7OYL.js} +2 -2
- package/package.json +1 -1
- package/dist/app-typed-client-FQVMEG4Z.js.map +0 -1
- package/dist/app-typed-client-ZZIASI4A.js.map +0 -1
- package/dist/chunk-SAFGDIPQ.js.map +0 -1
- /package/dist/{agent-AHGYRVQX.js.map → agent-GX4RIRRX.js.map} +0 -0
- /package/dist/{build-3AYYQZGQ.js.map → build-IVLQ5TUQ.js.map} +0 -0
- /package/dist/{chunk-I4ELCXNV.js.map → chunk-67DBYOXI.js.map} +0 -0
- /package/dist/{chunk-DHAD2O3S.js.map → chunk-KHBSMLYU.js.map} +0 -0
- /package/dist/{chunk-MBFD6NHB.js.map → chunk-LPNSZK3A.js.map} +0 -0
- /package/dist/{chunk-PFAVZL4F.js.map → chunk-Y5E7VFNJ.js.map} +0 -0
- /package/dist/{chunk-7ZOQN7UH.js.map → chunk-ZQO37YQJ.js.map} +0 -0
- /package/dist/{dev-W7OXHMSP.js.map → dev-TLVSKNSH.js.map} +0 -0
- /package/dist/{mcp-7BXBN7PD.js.map → mcp-OZACRG7O.js.map} +0 -0
- /package/dist/{preview-4ZTFJG2D.js.map → preview-DCJPTZVW.js.map} +0 -0
- /package/dist/{vite-plugin-2XM35VNV.js.map → vite-plugin-KIBK7OYL.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import "tsx/esm";
|
|
|
3
3
|
import {
|
|
4
4
|
agentCommand,
|
|
5
5
|
createAgentSsrLoader
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y5E7VFNJ.js";
|
|
7
7
|
import "./chunk-5YPXXSYY.js";
|
|
8
8
|
import "./chunk-6AM7HIRM.js";
|
|
9
9
|
import "./chunk-Z7CJHDLS.js";
|
|
@@ -12,4 +12,4 @@ export {
|
|
|
12
12
|
agentCommand,
|
|
13
13
|
createAgentSsrLoader
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=agent-
|
|
15
|
+
//# sourceMappingURL=agent-GX4RIRRX.js.map
|
|
@@ -80,9 +80,8 @@ function normalizeSegment(raw) {
|
|
|
80
80
|
let s = raw;
|
|
81
81
|
if (s.startsWith(":...")) s = s.slice(4);
|
|
82
82
|
else if (s.startsWith(":")) s = s.slice(1);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return { identifier: camel, bracket: false };
|
|
83
|
+
if (/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s)) {
|
|
84
|
+
return { identifier: s, bracket: false };
|
|
86
85
|
}
|
|
87
86
|
return { identifier: s, bracket: true };
|
|
88
87
|
}
|
|
@@ -114,13 +113,10 @@ function paramNamesFromRoute(routePath) {
|
|
|
114
113
|
}
|
|
115
114
|
function buildOneRoute(route, ctx) {
|
|
116
115
|
if (!route.methods || route.methods.length === 0) return;
|
|
117
|
-
const idx = ctx.aliasCounter.value++;
|
|
118
116
|
const absRouteFile = isAbsolute(route.filePath) ? route.filePath : resolve(ctx.serverDir, route.filePath);
|
|
119
117
|
const importPath = importPathFor(ctx.dtsOutPath, absRouteFile);
|
|
120
|
-
const aliases = route.methods.filter((m) => HTTP_METHODS.includes(m)).map((method) => ({ method
|
|
118
|
+
const aliases = route.methods.filter((m) => HTTP_METHODS.includes(m)).map((method) => ({ method }));
|
|
121
119
|
if (aliases.length === 0) return;
|
|
122
|
-
const importClause = aliases.map((a) => `${a.method} as ${a.alias}`).join(", ");
|
|
123
|
-
ctx.importLines.push(` import type { ${importClause} } from '${importPath}'`);
|
|
124
120
|
const segments = routePathSegments(route.routePath);
|
|
125
121
|
let node = ctx.root;
|
|
126
122
|
for (const seg of segments) {
|
|
@@ -133,16 +129,16 @@ function buildOneRoute(route, ctx) {
|
|
|
133
129
|
node = child;
|
|
134
130
|
}
|
|
135
131
|
node.paramNamesAccumulated = paramNamesFromRoute(route.routePath);
|
|
136
|
-
for (const { method
|
|
132
|
+
for (const { method } of aliases) {
|
|
137
133
|
if (node.methods.has(method)) {
|
|
138
134
|
ctx.warnings.push(
|
|
139
135
|
`// WARNING: duplicate ${method} export at /${segments.join("/")} (route file declared twice). Keeping last definition.`
|
|
140
136
|
);
|
|
141
137
|
}
|
|
142
|
-
node.methods.set(method,
|
|
138
|
+
node.methods.set(method, { importPath, exportName: method });
|
|
143
139
|
}
|
|
144
140
|
}
|
|
145
|
-
function buildOneController(cr,
|
|
141
|
+
function buildOneController(cr, classSource, ctx) {
|
|
146
142
|
const verb = cr.verb.toUpperCase();
|
|
147
143
|
if (!HTTP_METHODS.includes(verb)) return;
|
|
148
144
|
const method = verb;
|
|
@@ -169,7 +165,7 @@ function buildOneController(cr, classAlias, ctx) {
|
|
|
169
165
|
if (!ctx.warnings.includes(note)) ctx.warnings.push(note);
|
|
170
166
|
}
|
|
171
167
|
node.controllerMethods.set(method, {
|
|
172
|
-
|
|
168
|
+
classSource,
|
|
173
169
|
methodName: cr.methodName,
|
|
174
170
|
// theokit#124 — an EXPORTED schema is referenceable from the emitted `.d.ts`; an inline one is
|
|
175
171
|
// not, and falls through to the documented `unknown`.
|
|
@@ -217,13 +213,14 @@ function resolveCollisions(node, pathPrefix, warnings) {
|
|
|
217
213
|
}
|
|
218
214
|
function renderTreeNode(node, indent, _isRoot) {
|
|
219
215
|
const lines = ["{"];
|
|
220
|
-
for (const [method,
|
|
216
|
+
for (const [method, source] of node.methods) {
|
|
221
217
|
const lower = method.toLowerCase();
|
|
222
218
|
const paramsList = node.paramNamesAccumulated.map((p) => `${p}: string`).join("; ");
|
|
223
219
|
const paramsField = node.paramNamesAccumulated.length > 0 ? `{ params: { ${paramsList} } } & ` : "";
|
|
224
220
|
const optionalMark = node.paramNamesAccumulated.length === 0 ? "?" : "";
|
|
221
|
+
const routeType = `typeof import('${source.importPath}').${source.exportName}`;
|
|
225
222
|
lines.push(
|
|
226
|
-
`${indent} ${lower}: (opts${optionalMark}: ${paramsField}import('theokit/client').TheoFetchOptions
|
|
223
|
+
`${indent} ${lower}: (opts${optionalMark}: ${paramsField}import('theokit/client').TheoFetchOptions<${routeType}>) => Promise<import('theokit/client').InferResponse<${routeType}>>`
|
|
227
224
|
);
|
|
228
225
|
}
|
|
229
226
|
for (const [method, leaf] of node.controllerMethods) {
|
|
@@ -234,7 +231,7 @@ function renderTreeNode(node, indent, _isRoot) {
|
|
|
234
231
|
const bodyType = leaf.bodySchema === void 0 ? "body?: unknown" : `body: import('zod').infer<typeof import('${leaf.bodySchema.importPath}').${leaf.bodySchema.exportName}>`;
|
|
235
232
|
const queryType = leaf.querySchema === void 0 ? "query?: Record<string, string>" : `query: import('zod').infer<typeof import('${leaf.querySchema.importPath}').${leaf.querySchema.exportName}>`;
|
|
236
233
|
lines.push(
|
|
237
|
-
`${indent} ${lower}: (opts${optionalMark}: ${paramsField}{ ${bodyType}; ${queryType} }) => Promise<Awaited<ReturnType<InstanceType<typeof ${leaf.
|
|
234
|
+
`${indent} ${lower}: (opts${optionalMark}: ${paramsField}{ ${bodyType}; ${queryType} }) => Promise<Awaited<ReturnType<InstanceType<typeof import('${leaf.classSource.importPath}').${leaf.classSource.className}>['${leaf.methodName}']>>>`
|
|
238
235
|
);
|
|
239
236
|
}
|
|
240
237
|
for (const [name, child] of node.children) {
|
|
@@ -252,8 +249,6 @@ function generateClientDts({
|
|
|
252
249
|
}) {
|
|
253
250
|
const ctx = {
|
|
254
251
|
root: makeNode(),
|
|
255
|
-
aliasCounter: { value: 0 },
|
|
256
|
-
importLines: [],
|
|
257
252
|
warnings: [],
|
|
258
253
|
dtsOutPath,
|
|
259
254
|
serverDir
|
|
@@ -262,20 +257,16 @@ function generateClientDts({
|
|
|
262
257
|
buildOneRoute(route, ctx);
|
|
263
258
|
}
|
|
264
259
|
if (controllerRoutes?.length) {
|
|
265
|
-
const classAliases = /* @__PURE__ */ new Map();
|
|
266
260
|
for (const cr of controllerRoutes) {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
ctx.importLines.push(` import type { ${cr.className} as ${alias} } from '${importPath}'`);
|
|
273
|
-
}
|
|
274
|
-
buildOneController(cr, alias, ctx);
|
|
261
|
+
buildOneController(
|
|
262
|
+
cr,
|
|
263
|
+
{ importPath: importPathFor(dtsOutPath, cr.filePath), className: cr.className },
|
|
264
|
+
ctx
|
|
265
|
+
);
|
|
275
266
|
}
|
|
276
267
|
}
|
|
277
268
|
resolveCollisions(ctx.root, "", ctx.warnings);
|
|
278
|
-
const importsBlock =
|
|
269
|
+
const importsBlock = "\n";
|
|
279
270
|
const warningsBlock = ctx.warnings.length > 0 ? " // " + ctx.warnings.join("\n // ") + "\n\n" : "";
|
|
280
271
|
const treeBody = ctx.root.children.size === 0 && ctx.root.methods.size === 0 && ctx.root.controllerMethods.size === 0 ? "{\n // No routes detected \u2014 add `server/routes/*.ts` to populate this client.\n }" : renderTreeNode(
|
|
281
272
|
ctx.root,
|
|
@@ -420,4 +411,4 @@ export {
|
|
|
420
411
|
generateClientDts,
|
|
421
412
|
shouldReemitForFile
|
|
422
413
|
};
|
|
423
|
-
//# sourceMappingURL=app-typed-client-
|
|
414
|
+
//# sourceMappingURL=app-typed-client-DFRID25X.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/vite-plugin/app-typed-client.ts","../src/vite-plugin/controller-client-emit.ts"],"sourcesContent":["/* eslint-disable security/detect-non-literal-fs-filename --\n * Codegen-time fs ops: all paths derive from `opts.serverDir` / `opts.distDir`\n * (vite plugin opts — trusted, set by the framework's CLI). The plugin only\n * runs at dev/build time, never serves user HTTP input. No path traversal\n * surface here.\n */\n/**\n * Phase 2 + Phase 4 of G1 (g1-client-codegen-plan.md):\n *\n * 1. `generateClientDts(manifest, dtsOutPath)` — pure function emitting the\n * `.theokit/client.d.ts` shape (declared module `@theo/client`).\n * 2. `appTypedClientPlugin(opts)` — Vite plugin wrapper that calls (1),\n * writes the file atomically, and rewrites on route file changes.\n *\n * Implementation notes:\n * - Pure (1) is unit-testable without Vite or a filesystem (see G1-P2 tests).\n * - EC-2: segments are kept literal; anything not a valid identifier is a bracket key (#470).\n * - EC-3: collision between HTTP method name and sub-segment name → method\n * wins; a sub-segment gets a `_` suffix + a warning comment.\n * - EC-6: the write is `writeFileSync(tmp) + renameSync(tmp, final)` (POSIX atomic).\n * - EC-8: imports normalize `\\\\` → `/`.\n */\n\nimport { mkdirSync, readFileSync, renameSync, writeFileSync, existsSync } from 'node:fs'\nimport { dirname, isAbsolute, posix, relative, resolve } from 'node:path'\n\nimport type { Plugin, ViteDevServer } from 'vite'\n\nimport { HTTP_METHODS, type HttpMethod } from '../core/contracts/http-methods.js'\nimport { generateManifest, type ManifestRoute, type TheoManifest } from '../server/internal-api.js'\n\nimport { collectControllerRouteData, type ControllerRouteData } from './controller-client-emit.js'\n\nconst FILE_HEADER = `// AUTO-GENERATED by theokit — do not edit.\n// Source: theokit/packages/theo/src/vite-plugin/app-typed-client.ts (G1 plan).\n// To refresh: \\`pnpm dev\\` or \\`pnpm build\\` regenerates this file on every route change.\n\n/* eslint-disable */\n`\n\ninterface ControllerLeaf {\n /**\n * Where the controller class lives, named inline like the route exports beside it (#469). The\n * alias form it replaced is fragile in a way that is hard to characterise: measured, the same\n * aliased class resolved correctly in one `declare module` block and to `any` in another, with\n * nothing in the file to say which. Inline resolves relative to the file and always survived, so\n * no aliased relative import is left in the generated output at all.\n */\n classSource: { importPath: string; className: string }\n /** Controller method name backing the route (`findById`). */\n methodName: string\n /**\n * theokit#124 — module specifier + exported name of the `@Body` schema, when it has one, so the\n * emitted signature can say `z.infer<typeof import('...').zCreate>` instead of `unknown`.\n */\n bodySchema?: { importPath: string; exportName: string }\n /** theokit#124 — same for `@Query`. */\n querySchema?: { importPath: string; exportName: string }\n}\n\ninterface TreeNode {\n /** sub-namespaces — keyed by segment name (already normalized). */\n children: Map<string, TreeNode>\n /**\n * File-based routes: HTTP method → where the route export lives, so the signature can name it\n * INLINE as `typeof import('...').GET`.\n *\n * It used to hold an import alias, declared once at the top of the `declare module` block. That\n * alias silently resolves to `any` when fed to an external package's conditional type — measured\n * in #469, with no error at all, so every call through the generated client returned `any` while\n * the app compiled. The controller path beside this one already emits schemas inline for the same\n * reason; this brings routes onto the shape that works.\n */\n methods: Map<HttpMethod, { importPath: string; exportName: HttpMethod }>\n /** Decorator controllers: HTTP method → class alias + method (`Awaited<ReturnType<...>>`). */\n controllerMethods: Map<HttpMethod, ControllerLeaf>\n /** Whether any descendant declares dynamic params (for params type construction). */\n paramNamesAccumulated: string[]\n}\n\nfunction makeNode(): TreeNode {\n return {\n children: new Map(),\n methods: new Map(),\n controllerMethods: new Map(),\n paramNamesAccumulated: [],\n }\n}\n\n/**\n * Normalize a path segment to a valid TS identifier when possible.\n * EC-2: the segment is kept literal; pure dynamic (`:name`) → identifier `name`;\n * starts with digit or unsafe char → emit as bracket-access key.\n */\nfunction normalizeSegment(raw: string): { identifier: string; bracket: boolean } {\n // Dynamic segment: leading `:` (e.g. `:id` or `:...slug`).\n let s = raw\n if (s.startsWith(':...')) s = s.slice(4)\n else if (s.startsWith(':')) s = s.slice(1)\n\n // The segment is kept LITERAL (#470). It used to be camelCased — `agents-config` became\n // `agentsConfig` — while the runtime Proxy builds the URL from the key it was handed and knows\n // nothing of the transformation. So the type offered `client.agentsConfig.get()`, the request\n // went to `/api/agentsConfig`, and the route served at `/api/agents-config` answered 404. The\n // call compiled; the failure arrived at runtime.\n //\n // Translating back in the Proxy would have kept the prettier key, at the cost of a second source\n // of truth for every segment name. A generated client is worth more as a faithful mirror of the\n // URLs: bracket access for a hyphenated segment is the honest cost, and the machinery for it was\n // already here for segments that cannot be identifiers at all (`2fa`).\n if (/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s)) {\n return { identifier: s, bracket: false }\n }\n return { identifier: s, bracket: true }\n}\n\nfunction importPathFor(dtsOutPath: string, routeFileAbs: string): string {\n let rel = relative(dirname(dtsOutPath), routeFileAbs)\n // EC-8: normalize Windows path separators.\n rel = rel.replace(/\\\\/g, '/')\n // Strip extension (`.ts` / `.tsx`); TS module resolution likes extensionless.\n rel = rel.replace(/\\.[jt]sx?$/, '')\n if (!rel.startsWith('.') && !rel.startsWith('/')) {\n rel = './' + rel\n }\n return rel\n}\n\n/**\n * Convert a route path (e.g. `/api/users/:id/posts`) into the tree segments\n * we want under the `client` root. Strips the `/api/` prefix and splits.\n */\nfunction routePathSegments(routePath: string): string[] {\n let p = routePath\n if (p.startsWith('/api/')) p = p.slice(5)\n else if (p.startsWith('/api')) p = p.slice(4)\n if (p.startsWith('/')) p = p.slice(1)\n if (p === '') return []\n return p.split('/').filter(Boolean)\n}\n\nfunction paramNamesFromRoute(routePath: string): string[] {\n const out: string[] = []\n const re = /:(?:\\.\\.\\.)?([^/]+)/g\n let m: RegExpExecArray | null\n while ((m = re.exec(routePath)) !== null) {\n out.push(m[1])\n }\n return out\n}\n\ninterface BuildContext {\n root: TreeNode\n /** Lines emitted at the top of the declared module (one per route file). */\n /** Diagnostic warnings rendered as block comments inside the declared module. */\n warnings: string[]\n dtsOutPath: string\n serverDir: string\n}\n\nfunction buildOneRoute(route: ManifestRoute, ctx: BuildContext): void {\n if (!route.methods || route.methods.length === 0) return\n // Resolve absolute path for the route file (manifest stores it relative to serverDir).\n const absRouteFile = isAbsolute(route.filePath)\n ? route.filePath\n : resolve(ctx.serverDir, route.filePath)\n const importPath = importPathFor(ctx.dtsOutPath, absRouteFile)\n const aliases = route.methods\n .filter((m): m is HttpMethod => (HTTP_METHODS as readonly string[]).includes(m))\n .map((method) => ({ method }))\n if (aliases.length === 0) return\n // No import line: the method signatures name the export inline (see `TreeNode.methods`).\n\n // Walk segments + register methods at the leaf node.\n const segments = routePathSegments(route.routePath)\n let node = ctx.root\n for (const seg of segments) {\n const norm = normalizeSegment(seg)\n let child = node.children.get(norm.identifier)\n if (child === undefined) {\n child = makeNode()\n node.children.set(norm.identifier, child)\n }\n node = child\n }\n // Accumulated param names for typed params (e.g. `{ id: string }`).\n node.paramNamesAccumulated = paramNamesFromRoute(route.routePath)\n\n // Register each HTTP method (collision detection runs in a post-pass).\n for (const { method } of aliases) {\n if (node.methods.has(method)) {\n ctx.warnings.push(\n `// WARNING: duplicate ${method} export at /${segments.join('/')} (route file declared twice). Keeping last definition.`,\n )\n }\n node.methods.set(method, { importPath, exportName: method })\n }\n}\n\n/**\n * #122 (T2.1) — register one decorator-controller route into the tree. The class\n * import alias is shared across the class's methods (resolved by the caller). A\n * file-based route at the same node+verb WINS (file routes are the default); the\n * controller entry is skipped with a warning to keep the emitted `.d.ts` valid.\n */\nfunction buildOneController(\n cr: ControllerRouteData,\n classSource: { importPath: string; className: string },\n ctx: BuildContext,\n): void {\n const verb = cr.verb.toUpperCase()\n if (!(HTTP_METHODS as readonly string[]).includes(verb)) return\n const method = verb as HttpMethod\n\n const segments = routePathSegments(cr.fullPath)\n let node = ctx.root\n for (const seg of segments) {\n const norm = normalizeSegment(seg)\n let child = node.children.get(norm.identifier)\n if (child === undefined) {\n child = makeNode()\n node.children.set(norm.identifier, child)\n }\n node = child\n }\n node.paramNamesAccumulated = paramNamesFromRoute(cr.fullPath)\n\n if (node.methods.has(method)) {\n ctx.warnings.push(\n `WARNING (#122): controller ${cr.className}.${cr.methodName} (${method} /${segments.join('/')}) collides with a file-based route at the same path; file route wins.`,\n )\n return\n }\n if (cr.schemaNotExported === true) {\n // theokit#124 — a note, not a warning: the author did nothing wrong, and the emitted file is\n // valid. It exists so a reader who sees one typed method beside an untyped one knows the reason\n // is reachability, and knows the one-word fix.\n const note = `NOTE (#124): ${cr.className}.${cr.methodName} validates with a schema that is not exported, so its request type falls back to \\`unknown\\`. To get the type, export the schema (\\`export const zX = z.object({...})\\`).`\n if (!ctx.warnings.includes(note)) ctx.warnings.push(note)\n }\n node.controllerMethods.set(method, {\n classSource,\n methodName: cr.methodName,\n // theokit#124 — an EXPORTED schema is referenceable from the emitted `.d.ts`; an inline one is\n // not, and falls through to the documented `unknown`.\n ...(cr.bodySchemaExport !== undefined\n ? {\n bodySchema: {\n importPath: importPathFor(ctx.dtsOutPath, cr.filePath),\n exportName: cr.bodySchemaExport,\n },\n }\n : {}),\n ...(cr.querySchemaExport !== undefined\n ? {\n querySchema: {\n importPath: importPathFor(ctx.dtsOutPath, cr.filePath),\n exportName: cr.querySchemaExport,\n },\n }\n : {}),\n })\n}\n\n/**\n * EC-3: walk the tree post-build and resolve any node where a method's\n * lowercase name clashes with a child segment. HTTP method wins (more common);\n * the offending child gets a `_` suffix + a warning entry.\n */\nfunction resolveCollisions(node: TreeNode, pathPrefix: string, warnings: string[]): void {\n const methodLowerNames = new Set<string>()\n for (const method of node.methods.keys()) {\n methodLowerNames.add(method.toLowerCase())\n }\n for (const method of node.controllerMethods.keys()) {\n methodLowerNames.add(method.toLowerCase())\n }\n const renames: { from: string; to: string }[] = []\n for (const childName of node.children.keys()) {\n if (methodLowerNames.has(childName)) {\n renames.push({ from: childName, to: `${childName}_` })\n }\n }\n for (const { from, to } of renames) {\n const old = node.children.get(from)\n if (old !== undefined) {\n node.children.delete(from)\n node.children.set(to, old)\n warnings.push(\n `WARNING (EC-3): path collision — method '${from}' clashed with sub-namespace at ${pathPrefix}/${from}; sub-namespace renamed to '${to}'.`,\n )\n }\n }\n // Recurse into all children (including the renamed ones).\n for (const [name, child] of node.children) {\n resolveCollisions(child, `${pathPrefix}/${name}`, warnings)\n }\n}\n\nfunction renderTreeNode(node: TreeNode, indent: string, _isRoot: boolean): string {\n // _isRoot is reserved for callers; current rendering is uniform across roots\n // and children (both open with `{`). Kept in the signature for future overrides.\n const lines: string[] = ['{']\n // Methods first\n for (const [method, source] of node.methods) {\n const lower = method.toLowerCase()\n // Routes with path params (`:id`, `:name`) emit a `{ params: {...} }` object\n // intersected with TheoFetchOptions. Without the outer `{...}` wrap the\n // generated signature `(opts: params: {...} & ...)` is invalid TS syntax\n // (parser reads `params:` as a parameter label, then `{...}` as type — invalid).\n const paramsList = node.paramNamesAccumulated.map((p) => `${p}: string`).join('; ')\n const paramsField =\n node.paramNamesAccumulated.length > 0 ? `{ params: { ${paramsList} } } & ` : ''\n const optionalMark = node.paramNamesAccumulated.length === 0 ? '?' : ''\n // Inline, not an alias declared at the top of the block: an aliased relative `import type`\n // inside `declare module` collapses to `any` once an external package's conditional type is\n // applied to it, with no error (#469).\n const routeType = `typeof import('${source.importPath}').${source.exportName}`\n lines.push(\n `${indent} ${lower}: (opts${optionalMark}: ${paramsField}import('theokit/client').TheoFetchOptions<${routeType}>) => Promise<import('theokit/client').InferResponse<${routeType}>>`,\n )\n }\n // #122 (T2.1) — decorator-controller methods. Response inferred via\n // `Awaited<ReturnType<...>>`; params typed from the route pattern.\n //\n // theokit#124 — the request side too, when the `@Body`/`@Query` schema is EXPORTED. The ADR-2\n // checkpoint was right that the type cannot come from the class (parameter decorators erase to\n // runtime metadata, so `Parameters<...>[N]` is positional-only), and right that the runtime schema\n // carries no source identifier. What it missed is that the codegen LOADS the module, so the schema\n // object can be matched back to an export by reference identity — see `exportedNameOf`. An inline\n // schema has no name to reference and keeps the documented `unknown`.\n for (const [method, leaf] of node.controllerMethods) {\n const lower = method.toLowerCase()\n const paramsList = node.paramNamesAccumulated.map((p) => `${p}: string`).join('; ')\n const paramsField =\n node.paramNamesAccumulated.length > 0 ? `{ params: { ${paramsList} } } & ` : ''\n const optionalMark = node.paramNamesAccumulated.length === 0 ? '?' : ''\n const bodyType =\n leaf.bodySchema === undefined\n ? 'body?: unknown'\n : `body: import('zod').infer<typeof import('${leaf.bodySchema.importPath}').${leaf.bodySchema.exportName}>`\n const queryType =\n leaf.querySchema === undefined\n ? 'query?: Record<string, string>'\n : `query: import('zod').infer<typeof import('${leaf.querySchema.importPath}').${leaf.querySchema.exportName}>`\n lines.push(\n `${indent} ${lower}: (opts${optionalMark}: ${paramsField}{ ${bodyType}; ${queryType} }) => Promise<Awaited<ReturnType<InstanceType<typeof import('${leaf.classSource.importPath}').${leaf.classSource.className}>['${leaf.methodName}']>>>`,\n )\n }\n // Children\n for (const [name, child] of node.children) {\n // Backslash first, then the quote: escaping the quote while leaving the escape character\n // untouched means `back\\` emits as `'back\\'`, whose trailing backslash escapes the closing\n // quote and swallows the rest of the line. A backslash is a legal POSIX filename character, so\n // it reaches here from `server/routes/`.\n const propKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name)\n ? name\n : `'${name.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`\n lines.push(`${indent} ${propKey}: ${renderTreeNode(child, indent + ' ', false)}`)\n }\n lines.push(`${indent}}`)\n return lines.join('\\n')\n}\n\ninterface GenerateClientDtsOptions {\n manifest: TheoManifest\n /** Absolute path to the .d.ts that will be emitted. Used to compute import paths. */\n dtsOutPath: string\n /** Absolute serverDir; manifest's filePath entries are relative to this. */\n serverDir: string\n /**\n * #122 (T2.1) — decorator-controller routes (from `collectControllerRouteData`),\n * merged into the same `client.<ns>.<method>()` tree as file routes. Absent/empty\n * → zero controller output (ADR-5 routes-only byte-identity).\n */\n controllerRoutes?: ControllerRouteData[]\n}\n\nexport function generateClientDts({\n manifest,\n dtsOutPath,\n serverDir,\n controllerRoutes,\n}: GenerateClientDtsOptions): string {\n const ctx: BuildContext = {\n root: makeNode(),\n warnings: [],\n dtsOutPath,\n serverDir,\n }\n for (const route of manifest.routes) {\n buildOneRoute(route, ctx)\n }\n // #122 (T2.1) — merge decorator controllers into the same tree. One import\n // alias per class (shared across its methods), keyed by source file.\n if (controllerRoutes?.length) {\n for (const cr of controllerRoutes) {\n buildOneController(\n cr,\n { importPath: importPathFor(dtsOutPath, cr.filePath), className: cr.className },\n ctx,\n )\n }\n }\n // EC-3: resolve collisions in a post-build pass (collisions materialize\n // when two routes are both processed, not during a single route's build).\n resolveCollisions(ctx.root, '', ctx.warnings)\n\n // No import block at all since #469: every type is named inline as `typeof import('...')`, which\n // is the only form measured to survive inside `declare module`. Nothing pushes here any more, so\n // the seam is gone rather than left empty — an empty seam invites the next author to use it.\n const importsBlock = '\\n'\n const warningsBlock =\n ctx.warnings.length > 0 ? ' // ' + ctx.warnings.join('\\n // ') + '\\n\\n' : ''\n\n // Empty manifest (no routes with methods) → emit a stub interface so consumers\n // still get `client.X` autocomplete-friendly errors instead of \"Module not found\".\n const treeBody =\n ctx.root.children.size === 0 &&\n ctx.root.methods.size === 0 &&\n ctx.root.controllerMethods.size === 0\n ? '{\\n // No routes detected — add `server/routes/*.ts` to populate this client.\\n }'\n : renderTreeNode(ctx.root, ' ', /* isRoot */ true)\n\n return `${FILE_HEADER}\ndeclare module '@theo/client' {\n${importsBlock}${warningsBlock} export interface AppClient ${treeBody}\n export const client: AppClient\n}\n`\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Phase 4 — Vite plugin\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface AppTypedClientPluginOptions {\n /** Project root (cwd). */\n cwd: string\n /** Absolute path to the user's `server/` dir. */\n serverDir: string\n /** Absolute path to the `.theokit/` output dir (where `client.d.ts` lands). */\n distDir: string\n /**\n * Additional routes to merge into the typed client alongside file-system routes.\n * Each entry follows ManifestRoute shape (filePath, routePath, methods, paramNames).\n *\n * Used by `@theokit/http` `httpDecoratorsPlugin` to inject\n * decorator-defined routes — zero coupling between theokit core and the\n * decorator package (the walk happens in http-decorators; only data arrives here).\n */\n extraRoutes?: ManifestRoute[]\n}\n\nconst VIRTUAL_APP_CLIENT_ID = '@theo/client'\nconst RESOLVED_APP_CLIENT_ID = '\\0@theo/client'\n\n/**\n * Should a watcher file event under `routes/` or `controllers/` trigger a client\n * re-emit? Ignores the `.__decorated__.mjs` temp files that `loadControllerWithSwc`\n * writes+unlinks during controller codegen — reacting to them would create a\n * perpetual emit→temp-write→watcher→emit loop (#122 T2.1).\n */\nexport function shouldReemitForFile(\n file: string,\n routesGlob: string,\n controllersGlob: string,\n): boolean {\n const normalized = file.replace(/\\\\/g, '/')\n if (normalized.includes('.__decorated__.')) return false\n return normalized.startsWith(routesGlob) || normalized.startsWith(controllersGlob)\n}\n\n/** Atomic write via tmp + rename (EC-6). Skips when content is unchanged. */\nfunction writeFileIfChanged(filePath: string, content: string): { changed: boolean } {\n if (existsSync(filePath)) {\n try {\n const current = readFileSync(filePath, 'utf-8')\n if (current === content) return { changed: false }\n } catch {\n // fall through to write\n }\n }\n mkdirSync(dirname(filePath), { recursive: true })\n const tmp = `${filePath}.${process.pid}.tmp`\n writeFileSync(tmp, content)\n renameSync(tmp, filePath)\n return { changed: true }\n}\n\nasync function emitClientDts(\n opts: AppTypedClientPluginOptions,\n): Promise<{ changed: boolean; path: string }> {\n if (!existsSync(opts.serverDir)) {\n // No server dir — emit empty stub to avoid \"module not found\".\n const stubPath = posix.join(opts.distDir.replace(/\\\\/g, '/'), 'client.d.ts')\n return {\n changed: writeFileIfChanged(\n stubPath,\n generateClientDts({\n manifest: {\n version: 1,\n generatedAt: new Date().toISOString(),\n routes: [],\n actions: [],\n websockets: [],\n },\n dtsOutPath: stubPath,\n serverDir: opts.serverDir,\n }),\n ).changed,\n path: stubPath,\n }\n }\n const manifest = generateManifest(opts.serverDir)\n\n // Decorator-client-bridge: merge extra routes (from @theokit/http\n // or any other source) into the manifest so generateClientDts() produces a\n // SINGLE typed client covering both file-system routes AND injected routes.\n if (opts.extraRoutes?.length) {\n manifest.routes.push(...opts.extraRoutes)\n }\n\n // #122 (T2.1) — merge decorator controllers under `<serverDir>/controllers/`\n // into the same typed client. Zero output when the dir is absent/empty (ADR-5).\n const controllersDir = resolve(opts.serverDir, 'controllers')\n const controllerRoutes = existsSync(controllersDir)\n ? await collectControllerRouteData({ controllersDir })\n : []\n\n const dtsOutPath = posix.join(opts.distDir.replace(/\\\\/g, '/'), 'client.d.ts')\n const content = generateClientDts({\n manifest,\n dtsOutPath,\n serverDir: opts.serverDir,\n controllerRoutes,\n })\n const { changed } = writeFileIfChanged(dtsOutPath, content)\n return { changed, path: dtsOutPath }\n}\n\nexport function appTypedClientPlugin(opts: AppTypedClientPluginOptions): Plugin {\n let debounceTimer: NodeJS.Timeout | undefined\n let viteServer: ViteDevServer | undefined\n\n function scheduleEmit(): void {\n if (debounceTimer) clearTimeout(debounceTimer)\n debounceTimer = setTimeout(() => {\n void (async () => {\n try {\n await emitClientDts(opts)\n // Invalidate the virtual module so re-imports pick up potential new shape.\n if (viteServer) {\n const mod = viteServer.moduleGraph.getModuleById(RESOLVED_APP_CLIENT_ID)\n if (mod) viteServer.moduleGraph.invalidateModule(mod)\n }\n } catch (err) {\n // Surface but don't crash dev server.\n console.error('[theokit:app-typed-client] codegen error:', err)\n }\n })()\n }, 100)\n }\n\n return {\n name: 'theokit:app-typed-client',\n enforce: 'post',\n async configResolved() {\n try {\n await emitClientDts(opts)\n } catch (err) {\n console.error('[theokit:app-typed-client] initial codegen error:', err)\n }\n },\n async buildEnd() {\n try {\n await emitClientDts(opts)\n } catch (err) {\n console.error('[theokit:app-typed-client] buildEnd codegen error:', err)\n }\n },\n configureServer(server) {\n viteServer = server\n const routesGlob = posix.join(opts.serverDir.replace(/\\\\/g, '/'), 'routes')\n const controllersGlob = posix.join(opts.serverDir.replace(/\\\\/g, '/'), 'controllers')\n const onFile = (file: string): void => {\n if (shouldReemitForFile(file, routesGlob, controllersGlob)) scheduleEmit()\n }\n server.watcher.on('add', onFile)\n server.watcher.on('change', onFile)\n server.watcher.on('unlink', onFile)\n },\n resolveId(id) {\n if (id === VIRTUAL_APP_CLIENT_ID) return RESOLVED_APP_CLIENT_ID\n return null\n },\n load(id) {\n if (id === RESOLVED_APP_CLIENT_ID) {\n return [\n `import { createAppClient } from 'theokit/client'`,\n `export const client = createAppClient()`,\n `export default client`,\n ``,\n ].join('\\n')\n }\n return null\n },\n }\n}\n\nexport { VIRTUAL_APP_CLIENT_ID, RESOLVED_APP_CLIENT_ID, emitClientDts }\n","/**\n * #122 (T2.1) — typed-client codegen for decorator controllers.\n *\n * Collects the routing metadata of every `@Controller` under `controllersDir`\n * so the app-typed-client codegen can emit `client.<ns>.<method>()` entries.\n * Codegen loads controllers via `loadControllerWithSwc` (swc-compile + import,\n * no Vite dev server needed) — distinct from the dev SERVING path, which loads\n * through Vite's `ssrLoadModule`.\n *\n * ADR-2 checkpoint (LOCKED — see the plan's Unresolved Questions): only the\n * RESPONSE type is inferred, via `Awaited<ReturnType<InstanceType<typeof C>['m']>>`.\n * Request `@Body` types are NOT inferred from the class — parameter decorators are\n * erased runtime metadata, invisible to the type system, so `Parameters<...>[N]` is\n * positional-only and cannot tell body from param from query. Body falls back to\n * `unknown` (runtime `@Body` Zod validation from Phase 1 still applies). Full body\n * inference is tracked in the follow-up issue.\n */\nimport { loadControllerWithSwc, walkControllerMetadata } from '@theokit/http'\n\nimport {\n scanControllerModules,\n type ControllerModuleLoader,\n} from '../server/http/controller-dispatch.js'\n\n/** One controller route, flattened for the client codegen. */\nexport interface ControllerRouteData {\n /** Absolute path to the `*.controller.ts` source (for the `import type` line). */\n filePath: string\n /** The exported class name (e.g. `TasksController`). */\n className: string\n /** Full route path, e.g. `/api/v2/tasks/:id`. */\n fullPath: string\n /** HTTP verb (`GET`, `POST`, …). */\n verb: string\n /** The controller method name backing this route (e.g. `findById`). */\n methodName: string\n /**\n * theokit#124 — the EXPORTED name of the `@Body(schema)` Zod schema, when it has one.\n *\n * Absent when the schema is declared inline or otherwise not exported: there is then no\n * identifier the emitted `.d.ts` could reference, and the body stays `unknown`.\n */\n bodySchemaExport?: string\n /** theokit#124 — same for `@Query(schema)`. */\n querySchemaExport?: string\n /**\n * theokit#124 — a `@Body`/`@Query` schema EXISTS on this route but is not exported, so no name\n * could be referenced and the type degraded to `unknown`.\n *\n * Distinct from \"there is no schema at all\": that route was never going to be typed and needs no\n * explanation, while this one looks arbitrarily untyped next to a typed neighbour. The codegen\n * turns this into a note in the emitted file so the difference is legible.\n */\n schemaNotExported?: boolean\n}\n\n/**\n * Recover the EXPORTED name of a runtime schema object — theokit#124.\n *\n * `WalkResult.bodySchema` is a `z.ZodType` instance with no source identifier, which is why #122's\n * ADR-2 checkpoint concluded the request type was unrecoverable. It is recoverable, just not from\n * the metadata: the codegen already imports the module, so this object IS the one the module\n * exported, and reference identity gives back its name. No parsing, no heuristics — either some\n * export is the same object or none is.\n *\n * Returns `undefined` for an inline schema, which is a real limit rather than a bug: an unexported\n * value has no name a `.d.ts` can import.\n */\nfunction exportedNameOf(\n schema: unknown,\n moduleExports: Readonly<Record<string, unknown>>,\n): string | undefined {\n if (schema === undefined || schema === null) return undefined\n for (const [name, value] of Object.entries(moduleExports)) {\n // Reference identity, never structural comparison: two distinct schemas can be deeply equal,\n // and emitting the wrong name would type the client against the wrong contract silently.\n if (value === schema) return name\n }\n return undefined\n}\n\n/**\n * Scan `controllersDir` and flatten every controller's routes into\n * {@link ControllerRouteData}. Returns `[]` when the directory has no controllers\n * (so the codegen contributes zero bytes — ADR-5 routes-only byte-identity).\n */\nexport async function collectControllerRouteData(opts: {\n controllersDir: string\n loadModule?: ControllerModuleLoader\n}): Promise<ControllerRouteData[]> {\n const loader = opts.loadModule ?? loadControllerWithSwc\n const modules = await scanControllerModules(opts.controllersDir, loader)\n const out: ControllerRouteData[] = []\n for (const { filePath, cls, exports } of modules) {\n const className = (cls as { name: string }).name\n for (const walk of walkControllerMetadata(cls)) {\n const bodySchemaExport = exportedNameOf(walk.bodySchema, exports)\n // `walk.querySchema` is DECLARED on `WalkResult` and never populated — `walkControllerMetadata`\n // resolves a body schema and has no query counterpart, so the field always reads `undefined`\n // (grep: the only occurrence in `@theokit/http` is its own declaration). Reading the entry\n // directly is therefore not a shortcut around an API; it is the only place the schema exists.\n //\n // Deliberately NOT fixed by populating `querySchema` here: that field feeds runtime validation\n // for `@Body`, so filling the query one would start VALIDATING query strings that are not\n // validated today. This issue is about editor types; silently turning on runtime rejection\n // under it would be a behaviour change nobody asked for. Filed separately.\n const queryEntry = walk.paramEntries.find(\n (e) => e.source === 'query' && e.schema !== undefined,\n )\n const querySchemaExport = exportedNameOf(queryEntry?.schema, exports)\n out.push({\n filePath,\n className,\n fullPath: walk.fullPath,\n verb: walk.verb,\n methodName: String(walk.propertyKey),\n ...(bodySchemaExport !== undefined ? { bodySchemaExport } : {}),\n ...(querySchemaExport !== undefined ? { querySchemaExport } : {}),\n ...((walk.bodySchema !== undefined && bodySchemaExport === undefined) ||\n (queryEntry?.schema !== undefined && querySchemaExport === undefined)\n ? { schemaNotExported: true }\n : {}),\n })\n }\n }\n return out\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,WAAW,cAAc,YAAY,eAAe,kBAAkB;AAC/E,SAAS,SAAS,YAAY,OAAO,UAAU,eAAe;;;ACP9D,SAAS,uBAAuB,8BAA8B;AAmD9D,SAAS,eACP,QACA,eACoB;AACpB,MAAI,WAAW,UAAa,WAAW,KAAM,QAAO;AACpD,aAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,aAAa,GAAG;AAGzD,QAAI,UAAU,OAAQ,QAAO;AAAA,EAC/B;AACA,SAAO;AACT;AAOA,eAAsB,2BAA2B,MAGd;AACjC,QAAM,SAAS,KAAK,cAAc;AAClC,QAAM,UAAU,MAAM,sBAAsB,KAAK,gBAAgB,MAAM;AACvE,QAAM,MAA6B,CAAC;AACpC,aAAW,EAAE,UAAU,KAAK,QAAQ,KAAK,SAAS;AAChD,UAAM,YAAa,IAAyB;AAC5C,eAAW,QAAQ,uBAAuB,GAAG,GAAG;AAC9C,YAAM,mBAAmB,eAAe,KAAK,YAAY,OAAO;AAUhE,YAAM,aAAa,KAAK,aAAa;AAAA,QACnC,CAAC,MAAM,EAAE,WAAW,WAAW,EAAE,WAAW;AAAA,MAC9C;AACA,YAAM,oBAAoB,eAAe,YAAY,QAAQ,OAAO;AACpE,UAAI,KAAK;AAAA,QACP;AAAA,QACA;AAAA,QACA,UAAU,KAAK;AAAA,QACf,MAAM,KAAK;AAAA,QACX,YAAY,OAAO,KAAK,WAAW;AAAA,QACnC,GAAI,qBAAqB,SAAY,EAAE,iBAAiB,IAAI,CAAC;AAAA,QAC7D,GAAI,sBAAsB,SAAY,EAAE,kBAAkB,IAAI,CAAC;AAAA,QAC/D,GAAK,KAAK,eAAe,U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O,wBAAwB;AACjC,eAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF,EAAE,KAAK,IAAI;AAAA,MACb;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
|
|
@@ -96,9 +96,8 @@ function normalizeSegment(raw) {
|
|
|
96
96
|
let s = raw;
|
|
97
97
|
if (s.startsWith(":...")) s = s.slice(4);
|
|
98
98
|
else if (s.startsWith(":")) s = s.slice(1);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return { identifier: camel, bracket: false };
|
|
99
|
+
if (/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s)) {
|
|
100
|
+
return { identifier: s, bracket: false };
|
|
102
101
|
}
|
|
103
102
|
return { identifier: s, bracket: true };
|
|
104
103
|
}
|
|
@@ -130,13 +129,10 @@ function paramNamesFromRoute(routePath) {
|
|
|
130
129
|
}
|
|
131
130
|
function buildOneRoute(route, ctx) {
|
|
132
131
|
if (!route.methods || route.methods.length === 0) return;
|
|
133
|
-
const idx = ctx.aliasCounter.value++;
|
|
134
132
|
const absRouteFile = isAbsolute(route.filePath) ? route.filePath : resolve(ctx.serverDir, route.filePath);
|
|
135
133
|
const importPath = importPathFor(ctx.dtsOutPath, absRouteFile);
|
|
136
|
-
const aliases = route.methods.filter((m) => HTTP_METHODS.includes(m)).map((method) => ({ method
|
|
134
|
+
const aliases = route.methods.filter((m) => HTTP_METHODS.includes(m)).map((method) => ({ method }));
|
|
137
135
|
if (aliases.length === 0) return;
|
|
138
|
-
const importClause = aliases.map((a) => `${a.method} as ${a.alias}`).join(", ");
|
|
139
|
-
ctx.importLines.push(` import type { ${importClause} } from '${importPath}'`);
|
|
140
136
|
const segments = routePathSegments(route.routePath);
|
|
141
137
|
let node = ctx.root;
|
|
142
138
|
for (const seg of segments) {
|
|
@@ -149,16 +145,16 @@ function buildOneRoute(route, ctx) {
|
|
|
149
145
|
node = child;
|
|
150
146
|
}
|
|
151
147
|
node.paramNamesAccumulated = paramNamesFromRoute(route.routePath);
|
|
152
|
-
for (const { method
|
|
148
|
+
for (const { method } of aliases) {
|
|
153
149
|
if (node.methods.has(method)) {
|
|
154
150
|
ctx.warnings.push(
|
|
155
151
|
`// WARNING: duplicate ${method} export at /${segments.join("/")} (route file declared twice). Keeping last definition.`
|
|
156
152
|
);
|
|
157
153
|
}
|
|
158
|
-
node.methods.set(method,
|
|
154
|
+
node.methods.set(method, { importPath, exportName: method });
|
|
159
155
|
}
|
|
160
156
|
}
|
|
161
|
-
function buildOneController(cr,
|
|
157
|
+
function buildOneController(cr, classSource, ctx) {
|
|
162
158
|
const verb = cr.verb.toUpperCase();
|
|
163
159
|
if (!HTTP_METHODS.includes(verb)) return;
|
|
164
160
|
const method = verb;
|
|
@@ -185,7 +181,7 @@ function buildOneController(cr, classAlias, ctx) {
|
|
|
185
181
|
if (!ctx.warnings.includes(note)) ctx.warnings.push(note);
|
|
186
182
|
}
|
|
187
183
|
node.controllerMethods.set(method, {
|
|
188
|
-
|
|
184
|
+
classSource,
|
|
189
185
|
methodName: cr.methodName,
|
|
190
186
|
// theokit#124 — an EXPORTED schema is referenceable from the emitted `.d.ts`; an inline one is
|
|
191
187
|
// not, and falls through to the documented `unknown`.
|
|
@@ -233,13 +229,14 @@ function resolveCollisions(node, pathPrefix, warnings) {
|
|
|
233
229
|
}
|
|
234
230
|
function renderTreeNode(node, indent, _isRoot) {
|
|
235
231
|
const lines = ["{"];
|
|
236
|
-
for (const [method,
|
|
232
|
+
for (const [method, source] of node.methods) {
|
|
237
233
|
const lower = method.toLowerCase();
|
|
238
234
|
const paramsList = node.paramNamesAccumulated.map((p) => `${p}: string`).join("; ");
|
|
239
235
|
const paramsField = node.paramNamesAccumulated.length > 0 ? `{ params: { ${paramsList} } } & ` : "";
|
|
240
236
|
const optionalMark = node.paramNamesAccumulated.length === 0 ? "?" : "";
|
|
237
|
+
const routeType = `typeof import('${source.importPath}').${source.exportName}`;
|
|
241
238
|
lines.push(
|
|
242
|
-
`${indent} ${lower}: (opts${optionalMark}: ${paramsField}import('theokit/client').TheoFetchOptions
|
|
239
|
+
`${indent} ${lower}: (opts${optionalMark}: ${paramsField}import('theokit/client').TheoFetchOptions<${routeType}>) => Promise<import('theokit/client').InferResponse<${routeType}>>`
|
|
243
240
|
);
|
|
244
241
|
}
|
|
245
242
|
for (const [method, leaf] of node.controllerMethods) {
|
|
@@ -250,7 +247,7 @@ function renderTreeNode(node, indent, _isRoot) {
|
|
|
250
247
|
const bodyType = leaf.bodySchema === void 0 ? "body?: unknown" : `body: import('zod').infer<typeof import('${leaf.bodySchema.importPath}').${leaf.bodySchema.exportName}>`;
|
|
251
248
|
const queryType = leaf.querySchema === void 0 ? "query?: Record<string, string>" : `query: import('zod').infer<typeof import('${leaf.querySchema.importPath}').${leaf.querySchema.exportName}>`;
|
|
252
249
|
lines.push(
|
|
253
|
-
`${indent} ${lower}: (opts${optionalMark}: ${paramsField}{ ${bodyType}; ${queryType} }) => Promise<Awaited<ReturnType<InstanceType<typeof ${leaf.
|
|
250
|
+
`${indent} ${lower}: (opts${optionalMark}: ${paramsField}{ ${bodyType}; ${queryType} }) => Promise<Awaited<ReturnType<InstanceType<typeof import('${leaf.classSource.importPath}').${leaf.classSource.className}>['${leaf.methodName}']>>>`
|
|
254
251
|
);
|
|
255
252
|
}
|
|
256
253
|
for (const [name, child] of node.children) {
|
|
@@ -268,8 +265,6 @@ function generateClientDts({
|
|
|
268
265
|
}) {
|
|
269
266
|
const ctx = {
|
|
270
267
|
root: makeNode(),
|
|
271
|
-
aliasCounter: { value: 0 },
|
|
272
|
-
importLines: [],
|
|
273
268
|
warnings: [],
|
|
274
269
|
dtsOutPath,
|
|
275
270
|
serverDir
|
|
@@ -278,20 +273,16 @@ function generateClientDts({
|
|
|
278
273
|
buildOneRoute(route, ctx);
|
|
279
274
|
}
|
|
280
275
|
if (controllerRoutes?.length) {
|
|
281
|
-
const classAliases = /* @__PURE__ */ new Map();
|
|
282
276
|
for (const cr of controllerRoutes) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
ctx.importLines.push(` import type { ${cr.className} as ${alias} } from '${importPath}'`);
|
|
289
|
-
}
|
|
290
|
-
buildOneController(cr, alias, ctx);
|
|
277
|
+
buildOneController(
|
|
278
|
+
cr,
|
|
279
|
+
{ importPath: importPathFor(dtsOutPath, cr.filePath), className: cr.className },
|
|
280
|
+
ctx
|
|
281
|
+
);
|
|
291
282
|
}
|
|
292
283
|
}
|
|
293
284
|
resolveCollisions(ctx.root, "", ctx.warnings);
|
|
294
|
-
const importsBlock =
|
|
285
|
+
const importsBlock = "\n";
|
|
295
286
|
const warningsBlock = ctx.warnings.length > 0 ? " // " + ctx.warnings.join("\n // ") + "\n\n" : "";
|
|
296
287
|
const treeBody = ctx.root.children.size === 0 && ctx.root.methods.size === 0 && ctx.root.controllerMethods.size === 0 ? "{\n // No routes detected \u2014 add `server/routes/*.ts` to populate this client.\n }" : renderTreeNode(
|
|
297
288
|
ctx.root,
|
|
@@ -436,4 +427,4 @@ export {
|
|
|
436
427
|
generateClientDts,
|
|
437
428
|
shouldReemitForFile
|
|
438
429
|
};
|
|
439
|
-
//# sourceMappingURL=app-typed-client-
|
|
430
|
+
//# sourceMappingURL=app-typed-client-IPWJWM2E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/vite-plugin/app-typed-client.ts","../src/vite-plugin/controller-client-emit.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,WAAW,cAAc,YAAY,eAAe,kBAAkB;AAC/E,SAAS,SAAS,YAAY,OAAO,UAAU,eAAe;;;ACP9D,SAAS,uBAAuB,8BAA8B;AAmD9D,SAAS,eACP,QACA,eACoB;AACpB,MAAI,WAAW,UAAa,WAAW,KAAM,QAAO;AACpD,aAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,aAAa,GAAG;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AI;AACF,cAAM,cAAc,IAAI;AAAA,MAC1B,SAAS,KAAK;AACZ,gBAAQ,MAAM,qDAAqD,GAAG;AAAA,MACxE;AAAA,IACF;AAAA,IACA,MAAM,WAAW;AACf,UAAI;AACF,cAAM,cAAc,IAAI;AAAA,MAC1B,SAAS,KAAK;AACZ,gBAAQ,MAAM,sDAAsD,GAAG;AAAA,MACzE;AAAA,IACF;AAAA,IACA,gBAAgB,QAAQ;AACtB,mBAAa;AACb,YAAM,aAAa,MAAM,KAAK,KAAK,UAAU,QAAQ,OAAO,GAAG,GAAG,QAAQ;AAC1E,YAAM,kBAAkB,MAAM,KAAK,KAAK,UAAU,QAAQ,OAAO,GAAG,GAAG,aAAa;AACpF,YAAM,SAAS,CAAC,SAAuB;AACrC,YAAI,oBAAoB,MAAM,YAAY,eAAe,EAAG,cAAa;AAAA,MAC3E;AACA,aAAO,QAAQ,GAAG,OAAO,MAAM;AAC/B,aAAO,QAAQ,GAAG,UAAU,MAAM;AAClC,aAAO,QAAQ,GAAG,UAAU,MAAM;AAAA,IACpC;AAAA,IACA,UAAU,IAAI;AACZ,UAAI,OAAO,sBAAuB,QAAO;AACzC,aAAO;AAAA,IACT;AAAA,IACA,KAAK,IAAI;AACP,UAAI,OAAO,wBAAwB;AACjC,eAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF,EAAE,KAAK,IAAI;AAAA,MACb;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
|
|
@@ -554,7 +554,7 @@ async function buildCommand(options) {
|
|
|
554
554
|
`);
|
|
555
555
|
}
|
|
556
556
|
async function runAdapterBuild(target, config, cwd) {
|
|
557
|
-
const { theoPluginAsync } = await import("./vite-plugin-
|
|
557
|
+
const { theoPluginAsync } = await import("./vite-plugin-KIBK7OYL.js");
|
|
558
558
|
const { default: react } = await import("@vitejs/plugin-react");
|
|
559
559
|
const ctx = {
|
|
560
560
|
// `react()` may return Plugin or Plugin[] depending on version; spread the
|
|
@@ -675,4 +675,4 @@ function relativize3(absPath, root) {
|
|
|
675
675
|
export {
|
|
676
676
|
buildCommand
|
|
677
677
|
};
|
|
678
|
-
//# sourceMappingURL=build-
|
|
678
|
+
//# sourceMappingURL=build-IVLQ5TUQ.js.map
|
|
@@ -3476,7 +3476,7 @@ async function theoPluginAsync(rootOrOptions) {
|
|
|
3476
3476
|
})
|
|
3477
3477
|
);
|
|
3478
3478
|
}
|
|
3479
|
-
const { appTypedClientPlugin } = await import("./app-typed-client-
|
|
3479
|
+
const { appTypedClientPlugin } = await import("./app-typed-client-IPWJWM2E.js");
|
|
3480
3480
|
const appClientPlugin = appTypedClientPlugin({
|
|
3481
3481
|
cwd: projectRoot,
|
|
3482
3482
|
serverDir: serverDirAbs,
|
|
@@ -3688,4 +3688,4 @@ export {
|
|
|
3688
3688
|
theoPluginAsync,
|
|
3689
3689
|
theoPlugin
|
|
3690
3690
|
};
|
|
3691
|
-
//# sourceMappingURL=chunk-
|
|
3691
|
+
//# sourceMappingURL=chunk-67DBYOXI.js.map
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
// src/server/define/define-agent-tool.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
function toModelString(toolName, result) {
|
|
4
|
+
if (typeof result === "string") return result;
|
|
5
|
+
if (result === void 0 || typeof result === "function" || typeof result === "symbol") {
|
|
6
|
+
throw new Error(
|
|
7
|
+
`defineAgentTool(${JSON.stringify(toolName)}): the handler result could not be serialized for the model \u2014 JSON has no representation for ${typeof result}. Return a string, or add toModelOutput to map it.`
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
return JSON.stringify(result);
|
|
12
|
+
} catch (cause) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
`defineAgentTool(${JSON.stringify(toolName)}): the handler result could not be serialized for the model (${cause instanceof Error ? cause.message : String(cause)}). Return a string, or add toModelOutput to map it.`,
|
|
15
|
+
{ cause }
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
3
19
|
var TOOL_NAME_REGEX = /^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/;
|
|
4
20
|
function isZodObject(schema) {
|
|
5
21
|
let current = schema;
|
|
@@ -41,12 +57,7 @@ function defineAgentTool(spec) {
|
|
|
41
57
|
const parsed = spec.inputSchema.parse(input);
|
|
42
58
|
const result = await spec.handler(parsed, ctx);
|
|
43
59
|
if (spec.toModelOutput) return spec.toModelOutput(result);
|
|
44
|
-
|
|
45
|
-
throw new Error(
|
|
46
|
-
`defineAgentTool(${JSON.stringify(spec.name)}): handler returned a non-string; provide toModelOutput to map it to a string for the model.`
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
return result;
|
|
60
|
+
return toModelString(spec.name, result);
|
|
50
61
|
},
|
|
51
62
|
// M18 — carry the per-target formatters for the app (ignored by the SDK wire).
|
|
52
63
|
...spec.transform !== void 0 ? { transform: spec.transform } : {}
|
|
@@ -61,4 +72,4 @@ export {
|
|
|
61
72
|
defineAgentTool,
|
|
62
73
|
applyTransform
|
|
63
74
|
};
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
75
|
+
//# sourceMappingURL=chunk-BZF76LFM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server/define/define-agent-tool.ts"],"mappings":";AAAA,SAAS,SAAS;AAiIlB,SAAS,cAAc,UAAkB,QAAyB;AAChE,MAAI,OAAO,WAAW,SAAU,QAAO;AAOvC,MAAI,WAAW,UAAa,OAAO,WAAW,cAAc,OAAO,WAAW,UAAU;AACtF,UAAM,IAAI;AAAA,MACR,mBAAmB,KAAK,UAAU,QAAQ,CAAC,qGAAgG,OAAO,MAAM;AAAA,IAC1J;AAAA,EACF;AAEA,MAAI;AACF,WAAO,KAAK,UAAU,MAAM;AAAA,EAC9B,SAAS,OAAO;AAEd,UAAM,IAAI;AAAA,MACR,mBAAmB,KAAK,UAAU,QAAQ,CAAC,gEAAgE,iBAAiB,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,aAAO,cAAc,KAAK,MAAM,MAAM;AAAA,IACxC;AAAA;AAAA,IAEA,GAAI,KAAK,cAAc,SAAY,EAAE,WAAW,KAAK,UAA2B,IAAI,CAAC;AAAA,EACvF;AACF;AAMO,SAAS,eACd,MACA,QACA,QACS;AACT,QAAM,KAAK,KAAK,YAAY,MAAM;AAClC,SAAO,KAAK,GAAG,MAAM,IAAI;AAC3B;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-D4VP2QPR.js";
|
|
4
4
|
import {
|
|
5
5
|
defineAgentTool
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BZF76LFM.js";
|
|
7
7
|
|
|
8
8
|
// src/server/define/define-route.ts
|
|
9
9
|
function defineRoute(config) {
|
|
@@ -232,4 +232,4 @@ export {
|
|
|
232
232
|
defineChannel,
|
|
233
233
|
defineWebChannel
|
|
234
234
|
};
|
|
235
|
-
//# sourceMappingURL=chunk-
|
|
235
|
+
//# sourceMappingURL=chunk-KHBSMLYU.js.map
|
|
@@ -2179,7 +2179,7 @@ async function theoPluginAsync(rootOrOptions) {
|
|
|
2179
2179
|
})
|
|
2180
2180
|
);
|
|
2181
2181
|
}
|
|
2182
|
-
const { appTypedClientPlugin } = await import("./app-typed-client-
|
|
2182
|
+
const { appTypedClientPlugin } = await import("./app-typed-client-DFRID25X.js");
|
|
2183
2183
|
const appClientPlugin = appTypedClientPlugin({
|
|
2184
2184
|
cwd: projectRoot,
|
|
2185
2185
|
serverDir: serverDirAbs,
|
|
@@ -2383,4 +2383,4 @@ export {
|
|
|
2383
2383
|
theoPluginAsync,
|
|
2384
2384
|
theoPlugin
|
|
2385
2385
|
};
|
|
2386
|
-
//# sourceMappingURL=chunk-
|
|
2386
|
+
//# sourceMappingURL=chunk-LPNSZK3A.js.map
|
|
@@ -178,7 +178,7 @@ async function agentCommand(name, message, deps = {}) {
|
|
|
178
178
|
async function createAgentSsrLoader(projectRoot) {
|
|
179
179
|
const { createServer } = await import("vite");
|
|
180
180
|
const react = (await import("@vitejs/plugin-react")).default;
|
|
181
|
-
const { theoPluginAsync } = await import("./vite-plugin-
|
|
181
|
+
const { theoPluginAsync } = await import("./vite-plugin-KIBK7OYL.js");
|
|
182
182
|
const { loadConfig } = await import("./load-config-4ATXQUN3.js");
|
|
183
183
|
const config = await loadConfig(projectRoot);
|
|
184
184
|
const theoPlugins = await theoPluginAsync({
|
|
@@ -212,4 +212,4 @@ export {
|
|
|
212
212
|
agentCommand,
|
|
213
213
|
createAgentSsrLoader
|
|
214
214
|
};
|
|
215
|
-
//# sourceMappingURL=chunk-
|
|
215
|
+
//# sourceMappingURL=chunk-Y5E7VFNJ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-YOIVCCZT.js";
|
|
4
4
|
import {
|
|
5
5
|
defineAgentTool
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BZF76LFM.js";
|
|
7
7
|
|
|
8
8
|
// src/server/agent/workflow-tool.ts
|
|
9
9
|
import { z } from "zod";
|
|
@@ -289,4 +289,4 @@ export {
|
|
|
289
289
|
streamAgentTurnInProcess,
|
|
290
290
|
InProcessApprovalRequiredError
|
|
291
291
|
};
|
|
292
|
-
//# sourceMappingURL=chunk-
|
|
292
|
+
//# sourceMappingURL=chunk-ZQO37YQJ.js.map
|
package/dist/cli/index.js
CHANGED
|
@@ -15,12 +15,12 @@ function cliVersion() {
|
|
|
15
15
|
// src/cli/index.ts
|
|
16
16
|
var cli = cac("theokit");
|
|
17
17
|
cli.command("dev", "Start development server").option("--port <port>", "Port number").action(async (options) => {
|
|
18
|
-
const { devCommand } = await import("../dev-
|
|
18
|
+
const { devCommand } = await import("../dev-TLVSKNSH.js");
|
|
19
19
|
await devCommand({ port: options.port ? Number(options.port) : void 0 });
|
|
20
20
|
});
|
|
21
21
|
cli.command("build", "Build for production").option("--target <target>", "Deploy target (node, vercel, cloudflare)").action(async (options) => {
|
|
22
22
|
try {
|
|
23
|
-
const { buildCommand } = await import("../build-
|
|
23
|
+
const { buildCommand } = await import("../build-IVLQ5TUQ.js");
|
|
24
24
|
await buildCommand({ target: options.target });
|
|
25
25
|
} catch (err) {
|
|
26
26
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -44,7 +44,7 @@ cli.command("start", "Start production server").option("--port <port>", "Port nu
|
|
|
44
44
|
});
|
|
45
45
|
cli.command("preview", "Build for production, then serve it \u2014 one step (B-030)").option("--port <port>", "Port number").option("--target <target>", "Deploy target (node, vercel, cloudflare)").action(async (options) => {
|
|
46
46
|
try {
|
|
47
|
-
const { previewCommand } = await import("../preview-
|
|
47
|
+
const { previewCommand } = await import("../preview-DCJPTZVW.js");
|
|
48
48
|
await previewCommand({
|
|
49
49
|
port: options.port ? Number(options.port) : void 0,
|
|
50
50
|
target: options.target
|
|
@@ -77,7 +77,7 @@ cli.command(
|
|
|
77
77
|
"Run an agent in the terminal (stream + tool calls + approval)"
|
|
78
78
|
).action(async (name, message) => {
|
|
79
79
|
try {
|
|
80
|
-
const { agentCommand } = await import("../agent-
|
|
80
|
+
const { agentCommand } = await import("../agent-GX4RIRRX.js");
|
|
81
81
|
const { sawError } = await agentCommand(name, message);
|
|
82
82
|
if (sawError) process.exit(1);
|
|
83
83
|
} catch (err) {
|
|
@@ -108,7 +108,7 @@ cli.command("agent sessions gc", "Collect old transcripts for this project (dry
|
|
|
108
108
|
});
|
|
109
109
|
cli.command("mcp <agent>", "Serve an agent as an MCP server over stdio (for desktop MCP clients)").action(async (agent) => {
|
|
110
110
|
try {
|
|
111
|
-
const { mcpCommand } = await import("../mcp-
|
|
111
|
+
const { mcpCommand } = await import("../mcp-OZACRG7O.js");
|
|
112
112
|
await mcpCommand(agent);
|
|
113
113
|
} catch (err) {
|
|
114
114
|
const msg = err instanceof Error ? err.message : String(err);
|
package/dist/client/index.d.ts
CHANGED
|
@@ -10,6 +10,18 @@ import * as react from 'react';
|
|
|
10
10
|
import { LinkProps as LinkProps$1 } from 'react-router';
|
|
11
11
|
export { WireMessage as UIMessage, WireChunk as UIMessageChunk, WireMessagePart as UIMessagePart } from '@theokit/presenter/wire';
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Canonical HTTP method set used by the typed client codegen + Proxy runtime.
|
|
15
|
+
* Kept here (under `server/scan/`) because the SCAN is the first consumer —
|
|
16
|
+
* `vite-plugin/app-typed-client.ts` (Phase 2) and `client/app-client.ts` (Phase 3)
|
|
17
|
+
* import from here to ensure a single source of truth.
|
|
18
|
+
*
|
|
19
|
+
* Lowercase variants are derived via `.toLowerCase()` at call sites; we do not
|
|
20
|
+
* export them separately to avoid drift between the two lists.
|
|
21
|
+
*/
|
|
22
|
+
declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"];
|
|
23
|
+
type HttpMethod = (typeof HTTP_METHODS)[number];
|
|
24
|
+
|
|
13
25
|
/** Infer the response type from a route's handler return */
|
|
14
26
|
type InferResponse<T> = T extends {
|
|
15
27
|
handler: (...args: never[]) => infer R;
|
|
@@ -26,15 +38,33 @@ type ExtractBody<T> = T extends {
|
|
|
26
38
|
type InferQuery<T> = [ExtractQuery<T>] extends [never] ? undefined : ExtractQuery<T> extends z.ZodUndefined ? undefined : z.infer<ExtractQuery<T>>;
|
|
27
39
|
/** Infer body type from a route's body Zod schema */
|
|
28
40
|
type InferBody<T> = [ExtractBody<T>] extends [never] ? undefined : ExtractBody<T> extends z.ZodUndefined ? undefined : z.infer<ExtractBody<T>>;
|
|
29
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* The methods that carry a body — the complement of the safe set `buildRequestInit` deliberately
|
|
43
|
+
* skips the `X-Theo-Action` header for, because those are the ones that stay cacheable.
|
|
44
|
+
*/
|
|
45
|
+
type MutatingHttpMethod = Exclude<HttpMethod, 'GET' | 'HEAD' | 'OPTIONS'>;
|
|
46
|
+
/**
|
|
47
|
+
* Build the options type based on what schemas the route has.
|
|
48
|
+
*
|
|
49
|
+
* `method` is part of it (usetheokit/theokit#465). It used to be omitted while `buildRequestInit`
|
|
50
|
+
* read `opts.method` and defaulted to `'GET'`, which made the two available calls both wrong: the
|
|
51
|
+
* documented POST did not compile, and the one that did compile went out as a GET carrying a JSON
|
|
52
|
+
* body and no `X-Theo-Action` header — so the POST route was never reached and nothing said so.
|
|
53
|
+
*
|
|
54
|
+
* It is REQUIRED when the route declares a body, and narrowed to the mutating set there. A route
|
|
55
|
+
* with a body schema is not a GET, so the type can say that instead of letting the request say it
|
|
56
|
+
* silently at runtime.
|
|
57
|
+
*/
|
|
30
58
|
type TheoFetchOptions<T> = Omit<RequestInit, 'body' | 'method'> & (InferQuery<T> extends undefined ? {
|
|
31
59
|
query?: never;
|
|
32
60
|
} : {
|
|
33
61
|
query: InferQuery<T>;
|
|
34
62
|
}) & (InferBody<T> extends undefined ? {
|
|
35
63
|
body?: never;
|
|
64
|
+
method?: HttpMethod;
|
|
36
65
|
} : {
|
|
37
66
|
body: InferBody<T>;
|
|
67
|
+
method: MutatingHttpMethod;
|
|
38
68
|
});
|
|
39
69
|
declare class TheoFetchError extends Error {
|
|
40
70
|
status: number;
|
package/dist/client/index.js
CHANGED
|
@@ -423,12 +423,29 @@ function toActionError(raw) {
|
|
|
423
423
|
return new ActionError({ code: "INTERNAL_SERVER_ERROR", message: String(raw) });
|
|
424
424
|
}
|
|
425
425
|
const obj = raw;
|
|
426
|
+
if (obj.type === "TheoActionInputError" && !Array.isArray(obj.issues)) {
|
|
427
|
+
const rebuilt = issuesFromFields(obj.fields);
|
|
428
|
+
if (rebuilt !== void 0) return new ActionInputError(rebuilt);
|
|
429
|
+
}
|
|
426
430
|
if (obj.type === "TheoActionInputError" || obj.type === "TheoActionError") {
|
|
427
431
|
return ActionError.fromJson(raw);
|
|
428
432
|
}
|
|
429
433
|
const message = typeof obj.message === "string" ? obj.message : void 0;
|
|
430
434
|
return new ActionError({ code: "INTERNAL_SERVER_ERROR", message });
|
|
431
435
|
}
|
|
436
|
+
function issuesFromFields(raw) {
|
|
437
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return void 0;
|
|
438
|
+
const issues = [];
|
|
439
|
+
for (const [key, messages] of Object.entries(raw)) {
|
|
440
|
+
if (!Array.isArray(messages)) return void 0;
|
|
441
|
+
const path = key === "" ? [] : key.split(".");
|
|
442
|
+
for (const message of messages) {
|
|
443
|
+
if (typeof message !== "string") return void 0;
|
|
444
|
+
issues.push({ path, message });
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
return issues.length > 0 ? issues : void 0;
|
|
448
|
+
}
|
|
432
449
|
function isEnvelope(raw) {
|
|
433
450
|
return typeof raw === "object" && raw !== null && "data" in raw && "error" in raw;
|
|
434
451
|
}
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/client/theo-fetch.ts","../../src/client/batch.ts","../../src/client/batch-transport.ts","../../src/client/app-client.ts","../../src/client/index.ts","../../src/client/use-action.ts","../../src/client/action-client.ts","../../src/client/link.tsx","../../src/client/metadata.tsx","../../src/client/image.tsx","../../src/client/mcp-app-host.ts"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAO,eAAe;;;AC2Cf,SAAS,cAAc,SAAkC;AAC9D,QAAM,MAAM,QAAQ,OAAO;AAC3B,MAAI,QAAuB,CAAC;AAC5B,MAAI,iBAAiB;AAErB,WAAS,QAAc;AACrB,qBAAiB;AACjB,UAAM,UAAU;AAChB,YAAQ,CAAC;AACT,QAAI,QAAQ,WAAW,EAAG;AAG1B,UAAM,SAA0B,CAAC;AACjC,aAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK,KAAK;AAC5C,aAAO,KAAK,QAAQ,MAAM,GAAG,IAAI,GAAG,CAAC;AAAA,IACvC;AAEA,eAAW,SAAS,QAAQ;AAC1B,YAAM,UAA0B,MAAM,IAAI,CAAC,MAAM,EAAE,GAAG;AACtD,cACG,UAAU,OAAO,EACjB,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kB;AAMxB,SAAS,YACd,WACA,UACA,MACc;AACd,QAAM,SAAS,UAAU,cAAc,cAAc,QAAQ;AAE7D,SAAO,aAAa,WAAW,eAAe;AAC9C,SAAO,SAAS,SAAS;AACzB,YAAU,YAAY,MAAM;AAE5B,QAAM,OAAO,CAAC,YAA2B;AAMvC,WAAO,eAAe,YAAY,SAAS,GAAG;AAAA,EAChD;AACA,QAAM,SAAS,0BAA0B,MAAM,IAAI;AAEnD,QAAM,YAAY,CAAC,UAA8B;AAE/C,QAAI,MAAM,WAAW,OAAO,cAAe;AAC3C,SAAK,OAAO,MAAM,IAAI;AAAA,EACxB;AACA,QAAM,OAAO,UAAU,cAAc;AACrC,QAAM,iBAAiB,WAAW,SAAS;AAE3C,SAAO;AAAA,IACL;AAAA,IACA,SAAS,MAAM;AACb,YAAM,oBAAoB,WAAW,SAAS;AAC9C,aAAO,OAAO;AAAA,IAChB;AAAA,EACF;AACF;","names":["useRef","useEffect","jsx","jsx"]}
|
|
1
|
+
{"version":3,"sources":["../../src/client/theo-fetch.ts","../../src/client/batch.ts","../../src/client/batch-transport.ts","../../src/client/app-client.ts","../../src/client/index.ts","../../src/client/use-action.ts","../../src/client/action-client.ts","../../src/client/link.tsx","../../src/client/metadata.tsx","../../src/client/image.tsx","../../src/client/mcp-app-host.ts"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAO,eAAe;;;AC2Cf,SAAS,cAAc,SAAkC;AAC9D,QAAM,MAAM,QAAQ,OAAO;AAC3B,MAAI,QAAuB,CAAC;AAC5B,MAAI,iBAAiB;AAErB,WAAS,QAAc;AACrB,qBAAiB;AACjB,UAAM,UAAU;AAChB,YAAQ,CAAC;AACT,QAAI,QAAQ,WAAW,EAAG;AAG1B,UAAM,SAA0B,CAAC;AACjC,aAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK,KAAK;AAC5C,aAAO,KAAK,QAAQ,MAAM,GAAG,IAAI,GAAG,CAAC;AAAA,IACvC;AAEA,eAAW,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IACA,SAAS,MAAM;AACb,YAAM,oBAAoB,WAAW,SAAS;AAC9C,aAAO,OAAO;AAAA,IAChB;AAAA,EACF;AACF;","names":["useRef","useEffect","jsx","jsx"]}
|
|
@@ -87,13 +87,18 @@ interface DefineAgentToolSpec<T extends z.ZodType, R = string> {
|
|
|
87
87
|
* read it for shared config like `projectRoot` instead of baking it into the factory.
|
|
88
88
|
* `ctx.signal` is the abort signal. Optional so existing one-arg handlers keep working.
|
|
89
89
|
*
|
|
90
|
-
* M18 — the handler may return RICH data `R
|
|
91
|
-
*
|
|
90
|
+
* M18 — the handler may return RICH data `R`, not just a string. Without a `toModelOutput` the
|
|
91
|
+
* result is JSON-serialized for the model (#464); provide one when the model should see a
|
|
92
|
+
* different shape than the app does.
|
|
92
93
|
*/
|
|
93
94
|
handler: (input: z.infer<T>, ctx?: ToolHandlerContext) => R | Promise<R>;
|
|
94
95
|
/**
|
|
95
|
-
* M18 — map the rich handler result `R` to the string the model sees.
|
|
96
|
-
*
|
|
96
|
+
* M18 — map the rich handler result `R` to the string the model sees.
|
|
97
|
+
*
|
|
98
|
+
* Optional. Without it a non-string result is JSON-serialized (#464); this is for when the shape
|
|
99
|
+
* the model should see differs from the shape the app wants — a summary line instead of the whole
|
|
100
|
+
* record. The docblock said "required (in practice)" and that parenthesis was the defect: the
|
|
101
|
+
* type never said it, only the first live tool call did.
|
|
97
102
|
*/
|
|
98
103
|
toModelOutput?: (result: R) => string;
|
|
99
104
|
/** M18 — per-target formatters (`display` / `transcript`) for the app, applied by {@link applyTransform}. */
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-KTMQUYED.js";
|
|
12
12
|
import {
|
|
13
13
|
theoPluginAsync
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LPNSZK3A.js";
|
|
15
15
|
import "./chunk-2E7JLV7L.js";
|
|
16
16
|
import "./chunk-2CVV6CNN.js";
|
|
17
17
|
import "./chunk-3PWQQWT6.js";
|
|
@@ -123,4 +123,4 @@ export {
|
|
|
123
123
|
devCommand,
|
|
124
124
|
startDevServer
|
|
125
125
|
};
|
|
126
|
-
//# sourceMappingURL=dev-
|
|
126
|
+
//# sourceMappingURL=dev-TLVSKNSH.js.map
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "tsx/esm";
|
|
3
3
|
import {
|
|
4
4
|
createAgentSsrLoader
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Y5E7VFNJ.js";
|
|
6
6
|
import {
|
|
7
7
|
extractAppResources,
|
|
8
8
|
handleMcpJsonRpc
|
|
@@ -75,4 +75,4 @@ async function mcpCommand(name, deps = {}) {
|
|
|
75
75
|
export {
|
|
76
76
|
mcpCommand
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=mcp-
|
|
78
|
+
//# sourceMappingURL=mcp-OZACRG7O.js.map
|
|
@@ -4,7 +4,7 @@ import "tsx/esm";
|
|
|
4
4
|
// src/cli/commands/preview.ts
|
|
5
5
|
async function defaultSteps() {
|
|
6
6
|
const [{ buildCommand }, { startCommand }] = await Promise.all([
|
|
7
|
-
import("./build-
|
|
7
|
+
import("./build-IVLQ5TUQ.js"),
|
|
8
8
|
import("./start-WILEDDW2.js")
|
|
9
9
|
]);
|
|
10
10
|
return {
|
|
@@ -20,4 +20,4 @@ async function previewCommand(options = {}, steps) {
|
|
|
20
20
|
export {
|
|
21
21
|
previewCommand
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=preview-
|
|
23
|
+
//# sourceMappingURL=preview-DCJPTZVW.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { C as CustomTool } from '../../define-agent-tool-
|
|
2
|
+
import { C as CustomTool } from '../../define-agent-tool-CizaYZwU.js';
|
|
3
3
|
import { AcpTransport } from '@theokit/agents';
|
|
4
4
|
export { InProcessApprovalRequest, InProcessApprovalRequiredError, InProcessAwaitApproval, StreamAgentTurnDeps, StreamAgentTurnInProcessInput, streamAgentTurnInProcess } from '@theokit/agents';
|
|
5
5
|
import { CustomTool as CustomTool$1 } from '@theokit/sdk';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
parseChannelPath,
|
|
13
13
|
serveMcpStdio,
|
|
14
14
|
streamAgentTurnInProcess
|
|
15
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-ZQO37YQJ.js";
|
|
16
16
|
import {
|
|
17
17
|
buildResourceDescriptors,
|
|
18
18
|
defineAppResource,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
resolveProvider,
|
|
27
27
|
tryResolveProvider
|
|
28
28
|
} from "../../chunk-3PBAN2YE.js";
|
|
29
|
-
import "../../chunk-
|
|
29
|
+
import "../../chunk-BZF76LFM.js";
|
|
30
30
|
import "../../chunk-XTHN6JBX.js";
|
|
31
31
|
export {
|
|
32
32
|
CodeModePermissionDeniedError,
|
|
@@ -2,8 +2,8 @@ import { R as RouteConfig } from '../../route-config-Cm_ZMA1C.js';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { W as WebSocketHandler, b as WebSocketLike } from '../../define-websocket-DzPn1sR6.js';
|
|
4
4
|
export { a as WebSocketHandlerWeb } from '../../define-websocket-DzPn1sR6.js';
|
|
5
|
-
import { b as ToolTransform, C as CustomTool } from '../../define-agent-tool-
|
|
6
|
-
export { D as DefineAgentToolSpec, T as ToolContextMessage, a as ToolHandlerContext, c as applyTransform } from '../../define-agent-tool-
|
|
5
|
+
import { b as ToolTransform, C as CustomTool } from '../../define-agent-tool-CizaYZwU.js';
|
|
6
|
+
export { D as DefineAgentToolSpec, T as ToolContextMessage, a as ToolHandlerContext, c as applyTransform } from '../../define-agent-tool-CizaYZwU.js';
|
|
7
7
|
import { R as RoutePolicy } from '../../route-policy-BxOycCDq.js';
|
|
8
8
|
export { A as AccessDecision, b as RoutePolicyInput, a as RouteSubject, e as evaluateRoutePolicy, r as requireOwner, s as subjectFromContext } from '../../route-policy-BxOycCDq.js';
|
|
9
9
|
import { c as OnRequestHook, f as PreHandlerHook, d as OnResponseHook, O as OnErrorHook, T as TheoPlugin } from '../../plugin-types-BUVfUQ0V.js';
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
tool,
|
|
9
9
|
uiMessageStreamResponse,
|
|
10
10
|
websocket
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-KHBSMLYU.js";
|
|
12
12
|
import "../../chunk-D4VP2QPR.js";
|
|
13
13
|
import {
|
|
14
14
|
evaluateRoutePolicy,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "../../chunk-GAPBPRPP.js";
|
|
25
25
|
import {
|
|
26
26
|
applyTransform
|
|
27
|
-
} from "../../chunk-
|
|
27
|
+
} from "../../chunk-BZF76LFM.js";
|
|
28
28
|
import "../../chunk-XTHN6JBX.js";
|
|
29
29
|
export {
|
|
30
30
|
HEALTH_PATH,
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { R as RouteConfig } from '../route-config-Cm_ZMA1C.js';
|
|
2
2
|
export { ActionAccept, ActionBuilder, ActionConfig, ChannelHandler, MiddlewareBuilder, MiddlewareHandler, PluginBuilder, RouteBuilder, ToolBuilder, WebChannelHandler, WebSocketBuilder, action, defineChannel, defineWebChannel, middleware, plugin, route, tool, uiMessageStreamResponse, websocket } from './define/index.js';
|
|
3
3
|
export { W as WebSocketHandler, a as WebSocketHandlerWeb, b as WebSocketLike } from '../define-websocket-DzPn1sR6.js';
|
|
4
|
-
export { C as CustomTool, D as DefineAgentToolSpec, T as ToolContextMessage, a as ToolHandlerContext, b as ToolTransform, c as applyTransform } from '../define-agent-tool-
|
|
4
|
+
export { C as CustomTool, D as DefineAgentToolSpec, T as ToolContextMessage, a as ToolHandlerContext, b as ToolTransform, c as applyTransform } from '../define-agent-tool-CizaYZwU.js';
|
|
5
5
|
export { A as AccessDecision, R as RoutePolicy, b as RoutePolicyInput, a as RouteSubject, e as evaluateRoutePolicy, r as requireOwner, s as subjectFromContext } from '../route-policy-BxOycCDq.js';
|
|
6
6
|
export { H as HEALTH_PATH, a as HealthRouteConfig, b as READY_PATH, c as ReadyRouteConfig, d as ReservedResponse, R as ReservedRoutes, e as defineHealthRoute, f as defineReadyRoute, s as serveReservedRoute } from '../health-route-C0hk64_U.js';
|
|
7
7
|
export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as BatchPayload, d as BatchRequestItem, e as BatchResponse, f as BatchResultItem, g as BodyParserOptions, C as CookieOptions, h as CorsConfig, i as CorsHandler, j as CorsOrigin, k as CorsWebHandler, l as CustomErrorPages, E as ExecuteActionOptions, m as ExecuteRouteContext, F as FileTooLargeError, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, n as MiddlewareResult, N as NotFoundError, O as OpenApiDocsOptions, P as ParsedBody, o as ProcedureInput, p as ProcedureInputError, q as ProcedureOutputError, R as RawRouteInput, r as RouteInputChannel, s as RouteInputSchemas, t as RouteInputValidation, S as STRIPPED_HEADERS, u as SendErrorInput, v as SendErrorOptions, T as TRACE_HEADER, w as TRACE_PARENT_HEADER, x as TheoError, y as TheoTransformer, U as UploadedFile, W as W3CTraceContext, _ as _resetMiddlewareCacheForTests, z as appendCookieToHeaders, A as appendDeleteCookieToHeaders, D as callProcedure, G as createCorsHandler, I as createCorsWebHandler, J as createOpenApiHandler, K as createServerContext, L as deleteCookie, Q as envelopeCodeToStatus, V as executeAction, X as executeRoute, Y as executeWebRequest, Z as extractTraceId, $ as extractTraceIdFromRequest, a0 as extractW3CTraceContext, a1 as fromUnknown, a2 as getCookie, a3 as getCookieFromRequest, a4 as handleBatchRequest, a5 as handleRequestError, a6 as handleWebRequestError, a7 as jsonTransformer, a8 as loadCustomErrorPages, a9 as matchesOrigin, aa as parseCookieHeader, ab as parseRequestBody, ac as parseTraceparent, ad as parseTraceparentContext, ae as resolveTransformer, af as runMiddlewareAndContext, ag as sendError, ah as sendJson, ai as serializeCookie, aj as serveStaticFile, ak as serverErrorToEnvelope, al as setCookie, am as superjsonTransformer, an as validateRouteInput } from '../index-C8YN9dpF.js';
|
package/dist/server/index.js
CHANGED
|
@@ -220,7 +220,7 @@ import {
|
|
|
220
220
|
parseChannelPath,
|
|
221
221
|
serveMcpStdio,
|
|
222
222
|
streamAgentTurnInProcess
|
|
223
|
-
} from "../chunk-
|
|
223
|
+
} from "../chunk-ZQO37YQJ.js";
|
|
224
224
|
import {
|
|
225
225
|
buildResourceDescriptors,
|
|
226
226
|
defineAppResource,
|
|
@@ -312,7 +312,7 @@ import {
|
|
|
312
312
|
tool,
|
|
313
313
|
uiMessageStreamResponse,
|
|
314
314
|
websocket
|
|
315
|
-
} from "../chunk-
|
|
315
|
+
} from "../chunk-KHBSMLYU.js";
|
|
316
316
|
import "../chunk-D4VP2QPR.js";
|
|
317
317
|
import {
|
|
318
318
|
evaluateRoutePolicy,
|
|
@@ -328,7 +328,7 @@ import {
|
|
|
328
328
|
} from "../chunk-GAPBPRPP.js";
|
|
329
329
|
import {
|
|
330
330
|
applyTransform
|
|
331
|
-
} from "../chunk-
|
|
331
|
+
} from "../chunk-BZF76LFM.js";
|
|
332
332
|
import "../chunk-XTHN6JBX.js";
|
|
333
333
|
|
|
334
334
|
// src/cache/constants.ts
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
defineTheoIntegration,
|
|
8
8
|
theoPlugin,
|
|
9
9
|
theoPluginAsync
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LPNSZK3A.js";
|
|
11
11
|
import "./chunk-2E7JLV7L.js";
|
|
12
12
|
import "./chunk-2CVV6CNN.js";
|
|
13
13
|
import "./chunk-3PWQQWT6.js";
|
|
@@ -40,4 +40,4 @@ export {
|
|
|
40
40
|
theoPlugin,
|
|
41
41
|
theoPluginAsync
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=vite-plugin-
|
|
43
|
+
//# sourceMappingURL=vite-plugin-KIBK7OYL.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "theokit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"description": "The TheoKit web framework — file-based routing, typed server surfaces, the Vite plugin, the CLI and the deploy adapters, around agents served from agents/*.ts.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vite-plugin/app-typed-client.ts","../src/vite-plugin/controller-client-emit.ts"],"sourcesContent":["/* eslint-disable security/detect-non-literal-fs-filename --\n * Codegen-time fs ops: all paths derive from `opts.serverDir` / `opts.distDir`\n * (vite plugin opts — trusted, set by the framework's CLI). The plugin only\n * runs at dev/build time, never serves user HTTP input. No path traversal\n * surface here.\n */\n/**\n * Phase 2 + Phase 4 of G1 (g1-client-codegen-plan.md):\n *\n * 1. `generateClientDts(manifest, dtsOutPath)` — pure function emitting the\n * `.theokit/client.d.ts` shape (declared module `@theo/client`).\n * 2. `appTypedClientPlugin(opts)` — Vite plugin wrapper that calls (1),\n * writes the file atomically, and rewrites on route file changes.\n *\n * Implementation notes:\n * - Pure (1) is unit-testable without Vite or a filesystem (see G1-P2 tests).\n * - EC-2: kebab-case segments → camelCase; unsafe chars → bracket-access.\n * - EC-3: collision between HTTP method name and sub-segment name → method\n * wins; a sub-segment gets a `_` suffix + a warning comment.\n * - EC-6: the write is `writeFileSync(tmp) + renameSync(tmp, final)` (POSIX atomic).\n * - EC-8: imports normalize `\\\\` → `/`.\n */\n\nimport { mkdirSync, readFileSync, renameSync, writeFileSync, existsSync } from 'node:fs'\nimport { dirname, isAbsolute, posix, relative, resolve } from 'node:path'\n\nimport type { Plugin, ViteDevServer } from 'vite'\n\nimport { HTTP_METHODS, type HttpMethod } from '../core/contracts/http-methods.js'\nimport { generateManifest, type ManifestRoute, type TheoManifest } from '../server/internal-api.js'\n\nimport { collectControllerRouteData, type ControllerRouteData } from './controller-client-emit.js'\n\nconst FILE_HEADER = `// AUTO-GENERATED by theokit — do not edit.\n// Source: theokit/packages/theo/src/vite-plugin/app-typed-client.ts (G1 plan).\n// To refresh: \\`pnpm dev\\` or \\`pnpm build\\` regenerates this file on every route change.\n\n/* eslint-disable */\n`\n\ninterface ControllerLeaf {\n /** Import alias of the controller class (`_c0`). */\n classAlias: string\n /** Controller method name backing the route (`findById`). */\n methodName: string\n /**\n * theokit#124 — module specifier + exported name of the `@Body` schema, when it has one, so the\n * emitted signature can say `z.infer<typeof import('...').zCreate>` instead of `unknown`.\n */\n bodySchema?: { importPath: string; exportName: string }\n /** theokit#124 — same for `@Query`. */\n querySchema?: { importPath: string; exportName: string }\n}\n\ninterface TreeNode {\n /** sub-namespaces — keyed by segment name (already normalized). */\n children: Map<string, TreeNode>\n /** File-based routes: HTTP method → import alias (`InferResponse<typeof alias>`). */\n methods: Map<HttpMethod, string>\n /** Decorator controllers: HTTP method → class alias + method (`Awaited<ReturnType<...>>`). */\n controllerMethods: Map<HttpMethod, ControllerLeaf>\n /** Whether any descendant declares dynamic params (for params type construction). */\n paramNamesAccumulated: string[]\n}\n\nfunction makeNode(): TreeNode {\n return {\n children: new Map(),\n methods: new Map(),\n controllerMethods: new Map(),\n paramNamesAccumulated: [],\n }\n}\n\n/**\n * Normalize a path segment to a valid TS identifier when possible.\n * EC-2: kebab-case → camelCase; pure dynamic (`:name`) → identifier `name`;\n * starts with digit or unsafe char → emit as bracket-access key.\n */\nfunction normalizeSegment(raw: string): { identifier: string; bracket: boolean } {\n // Dynamic segment: leading `:` (e.g. `:id` or `:...slug`).\n let s = raw\n if (s.startsWith(':...')) s = s.slice(4)\n else if (s.startsWith(':')) s = s.slice(1)\n\n // kebab → camel\n const camel = s.replace(/-([a-z0-9])/gi, (_, c: string) => c.toUpperCase())\n\n // Valid TS identifier (cannot start with digit, must be [a-zA-Z_$][a-zA-Z0-9_$]*)\n if (/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(camel)) {\n return { identifier: camel, bracket: false }\n }\n // Fallback: bracket-access (keep raw form intact for JSON-string key)\n return { identifier: s, bracket: true }\n}\n\nfunction importPathFor(dtsOutPath: string, routeFileAbs: string): string {\n let rel = relative(dirname(dtsOutPath), routeFileAbs)\n // EC-8: normalize Windows path separators.\n rel = rel.replace(/\\\\/g, '/')\n // Strip extension (`.ts` / `.tsx`); TS module resolution likes extensionless.\n rel = rel.replace(/\\.[jt]sx?$/, '')\n if (!rel.startsWith('.') && !rel.startsWith('/')) {\n rel = './' + rel\n }\n return rel\n}\n\n/**\n * Convert a route path (e.g. `/api/users/:id/posts`) into the tree segments\n * we want under the `client` root. Strips the `/api/` prefix and splits.\n */\nfunction routePathSegments(routePath: string): string[] {\n let p = routePath\n if (p.startsWith('/api/')) p = p.slice(5)\n else if (p.startsWith('/api')) p = p.slice(4)\n if (p.startsWith('/')) p = p.slice(1)\n if (p === '') return []\n return p.split('/').filter(Boolean)\n}\n\nfunction paramNamesFromRoute(routePath: string): string[] {\n const out: string[] = []\n const re = /:(?:\\.\\.\\.)?([^/]+)/g\n let m: RegExpExecArray | null\n while ((m = re.exec(routePath)) !== null) {\n out.push(m[1])\n }\n return out\n}\n\ninterface BuildContext {\n root: TreeNode\n /** Sequential index per route file for aliasing imports. */\n aliasCounter: { value: number }\n /** Lines emitted at the top of the declared module (one per route file). */\n importLines: string[]\n /** Diagnostic warnings rendered as block comments inside the declared module. */\n warnings: string[]\n dtsOutPath: string\n serverDir: string\n}\n\nfunction buildOneRoute(route: ManifestRoute, ctx: BuildContext): void {\n if (!route.methods || route.methods.length === 0) return\n // Build alias prefix once per route file (`_r0`, `_r1`, ...).\n const idx = ctx.aliasCounter.value++\n // Resolve absolute path for the route file (manifest stores it relative to serverDir).\n const absRouteFile = isAbsolute(route.filePath)\n ? route.filePath\n : resolve(ctx.serverDir, route.filePath)\n const importPath = importPathFor(ctx.dtsOutPath, absRouteFile)\n const aliases = route.methods\n .filter((m): m is HttpMethod => (HTTP_METHODS as readonly string[]).includes(m))\n .map((method) => ({ method, alias: `_r${idx}_${method}` }))\n if (aliases.length === 0) return\n const importClause = aliases.map((a) => `${a.method} as ${a.alias}`).join(', ')\n ctx.importLines.push(` import type { ${importClause} } from '${importPath}'`)\n\n // Walk segments + register methods at the leaf node.\n const segments = routePathSegments(route.routePath)\n let node = ctx.root\n for (const seg of segments) {\n const norm = normalizeSegment(seg)\n let child = node.children.get(norm.identifier)\n if (child === undefined) {\n child = makeNode()\n node.children.set(norm.identifier, child)\n }\n node = child\n }\n // Accumulated param names for typed params (e.g. `{ id: string }`).\n node.paramNamesAccumulated = paramNamesFromRoute(route.routePath)\n\n // Register each HTTP method (collision detection runs in a post-pass).\n for (const { method, alias } of aliases) {\n if (node.methods.has(method)) {\n ctx.warnings.push(\n `// WARNING: duplicate ${method} export at /${segments.join('/')} (route file declared twice). Keeping last definition.`,\n )\n }\n node.methods.set(method, alias)\n }\n}\n\n/**\n * #122 (T2.1) — register one decorator-controller route into the tree. The class\n * import alias is shared across the class's methods (resolved by the caller). A\n * file-based route at the same node+verb WINS (file routes are the default); the\n * controller entry is skipped with a warning to keep the emitted `.d.ts` valid.\n */\nfunction buildOneController(cr: ControllerRouteData, classAlias: string, ctx: BuildContext): void {\n const verb = cr.verb.toUpperCase()\n if (!(HTTP_METHODS as readonly string[]).includes(verb)) return\n const method = verb as HttpMethod\n\n const segments = routePathSegments(cr.fullPath)\n let node = ctx.root\n for (const seg of segments) {\n const norm = normalizeSegment(seg)\n let child = node.children.get(norm.identifier)\n if (child === undefined) {\n child = makeNode()\n node.children.set(norm.identifier, child)\n }\n node = child\n }\n node.paramNamesAccumulated = paramNamesFromRoute(cr.fullPath)\n\n if (node.methods.has(method)) {\n ctx.warnings.push(\n `WARNING (#122): controller ${cr.className}.${cr.methodName} (${method} /${segments.join('/')}) collides with a file-based route at the same path; file route wins.`,\n )\n return\n }\n if (cr.schemaNotExported === true) {\n // theokit#124 — a note, not a warning: the author did nothing wrong, and the emitted file is\n // valid. It exists so a reader who sees one typed method beside an untyped one knows the reason\n // is reachability, and knows the one-word fix.\n const note = `NOTE (#124): ${cr.className}.${cr.methodName} validates with a schema that is not exported, so its request type falls back to \\`unknown\\`. To get the type, export the schema (\\`export const zX = z.object({...})\\`).`\n if (!ctx.warnings.includes(note)) ctx.warnings.push(note)\n }\n node.controllerMethods.set(method, {\n classAlias,\n methodName: cr.methodName,\n // theokit#124 — an EXPORTED schema is referenceable from the emitted `.d.ts`; an inline one is\n // not, and falls through to the documented `unknown`.\n ...(cr.bodySchemaExport !== undefined\n ? {\n bodySchema: {\n importPath: importPathFor(ctx.dtsOutPath, cr.filePath),\n exportName: cr.bodySchemaExport,\n },\n }\n : {}),\n ...(cr.querySchemaExport !== undefined\n ? {\n querySchema: {\n importPath: importPathFor(ctx.dtsOutPath, cr.filePath),\n exportName: cr.querySchemaExport,\n },\n }\n : {}),\n })\n}\n\n/**\n * EC-3: walk the tree post-build and resolve any node where a method's\n * lowercase name clashes with a child segment. HTTP method wins (more common);\n * the offending child gets a `_` suffix + a warning entry.\n */\nfunction resolveCollisions(node: TreeNode, pathPrefix: string, warnings: string[]): void {\n const methodLowerNames = new Set<string>()\n for (const method of node.methods.keys()) {\n methodLowerNames.add(method.toLowerCase())\n }\n for (const method of node.controllerMethods.keys()) {\n methodLowerNames.add(method.toLowerCase())\n }\n const renames: { from: string; to: string }[] = []\n for (const childName of node.children.keys()) {\n if (methodLowerNames.has(childName)) {\n renames.push({ from: childName, to: `${childName}_` })\n }\n }\n for (const { from, to } of renames) {\n const old = node.children.get(from)\n if (old !== undefined) {\n node.children.delete(from)\n node.children.set(to, old)\n warnings.push(\n `WARNING (EC-3): path collision — method '${from}' clashed with sub-namespace at ${pathPrefix}/${from}; sub-namespace renamed to '${to}'.`,\n )\n }\n }\n // Recurse into all children (including the renamed ones).\n for (const [name, child] of node.children) {\n resolveCollisions(child, `${pathPrefix}/${name}`, warnings)\n }\n}\n\nfunction renderTreeNode(node: TreeNode, indent: string, _isRoot: boolean): string {\n // _isRoot is reserved for callers; current rendering is uniform across roots\n // and children (both open with `{`). Kept in the signature for future overrides.\n const lines: string[] = ['{']\n // Methods first\n for (const [method, alias] of node.methods) {\n const lower = method.toLowerCase()\n // Routes with path params (`:id`, `:name`) emit a `{ params: {...} }` object\n // intersected with TheoFetchOptions. Without the outer `{...}` wrap the\n // generated signature `(opts: params: {...} & ...)` is invalid TS syntax\n // (parser reads `params:` as a parameter label, then `{...}` as type — invalid).\n const paramsList = node.paramNamesAccumulated.map((p) => `${p}: string`).join('; ')\n const paramsField =\n node.paramNamesAccumulated.length > 0 ? `{ params: { ${paramsList} } } & ` : ''\n const optionalMark = node.paramNamesAccumulated.length === 0 ? '?' : ''\n lines.push(\n `${indent} ${lower}: (opts${optionalMark}: ${paramsField}import('theokit/client').TheoFetchOptions<typeof ${alias}>) => Promise<import('theokit/client').InferResponse<typeof ${alias}>>`,\n )\n }\n // #122 (T2.1) — decorator-controller methods. Response inferred via\n // `Awaited<ReturnType<...>>`; params typed from the route pattern.\n //\n // theokit#124 — the request side too, when the `@Body`/`@Query` schema is EXPORTED. The ADR-2\n // checkpoint was right that the type cannot come from the class (parameter decorators erase to\n // runtime metadata, so `Parameters<...>[N]` is positional-only), and right that the runtime schema\n // carries no source identifier. What it missed is that the codegen LOADS the module, so the schema\n // object can be matched back to an export by reference identity — see `exportedNameOf`. An inline\n // schema has no name to reference and keeps the documented `unknown`.\n for (const [method, leaf] of node.controllerMethods) {\n const lower = method.toLowerCase()\n const paramsList = node.paramNamesAccumulated.map((p) => `${p}: string`).join('; ')\n const paramsField =\n node.paramNamesAccumulated.length > 0 ? `{ params: { ${paramsList} } } & ` : ''\n const optionalMark = node.paramNamesAccumulated.length === 0 ? '?' : ''\n const bodyType =\n leaf.bodySchema === undefined\n ? 'body?: unknown'\n : `body: import('zod').infer<typeof import('${leaf.bodySchema.importPath}').${leaf.bodySchema.exportName}>`\n const queryType =\n leaf.querySchema === undefined\n ? 'query?: Record<string, string>'\n : `query: import('zod').infer<typeof import('${leaf.querySchema.importPath}').${leaf.querySchema.exportName}>`\n lines.push(\n `${indent} ${lower}: (opts${optionalMark}: ${paramsField}{ ${bodyType}; ${queryType} }) => Promise<Awaited<ReturnType<InstanceType<typeof ${leaf.classAlias}>['${leaf.methodName}']>>>`,\n )\n }\n // Children\n for (const [name, child] of node.children) {\n // Backslash first, then the quote: escaping the quote while leaving the escape character\n // untouched means `back\\` emits as `'back\\'`, whose trailing backslash escapes the closing\n // quote and swallows the rest of the line. A backslash is a legal POSIX filename character, so\n // it reaches here from `server/routes/`.\n const propKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name)\n ? name\n : `'${name.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`\n lines.push(`${indent} ${propKey}: ${renderTreeNode(child, indent + ' ', false)}`)\n }\n lines.push(`${indent}}`)\n return lines.join('\\n')\n}\n\ninterface GenerateClientDtsOptions {\n manifest: TheoManifest\n /** Absolute path to the .d.ts that will be emitted. Used to compute import paths. */\n dtsOutPath: string\n /** Absolute serverDir; manifest's filePath entries are relative to this. */\n serverDir: string\n /**\n * #122 (T2.1) — decorator-controller routes (from `collectControllerRouteData`),\n * merged into the same `client.<ns>.<method>()` tree as file routes. Absent/empty\n * → zero controller output (ADR-5 routes-only byte-identity).\n */\n controllerRoutes?: ControllerRouteData[]\n}\n\nexport function generateClientDts({\n manifest,\n dtsOutPath,\n serverDir,\n controllerRoutes,\n}: GenerateClientDtsOptions): string {\n const ctx: BuildContext = {\n root: makeNode(),\n aliasCounter: { value: 0 },\n importLines: [],\n warnings: [],\n dtsOutPath,\n serverDir,\n }\n for (const route of manifest.routes) {\n buildOneRoute(route, ctx)\n }\n // #122 (T2.1) — merge decorator controllers into the same tree. One import\n // alias per class (shared across its methods), keyed by source file.\n if (controllerRoutes?.length) {\n const classAliases = new Map<string, string>()\n for (const cr of controllerRoutes) {\n let alias = classAliases.get(cr.filePath)\n if (alias === undefined) {\n alias = `_c${classAliases.size}`\n classAliases.set(cr.filePath, alias)\n const importPath = importPathFor(dtsOutPath, cr.filePath)\n ctx.importLines.push(` import type { ${cr.className} as ${alias} } from '${importPath}'`)\n }\n buildOneController(cr, alias, ctx)\n }\n }\n // EC-3: resolve collisions in a post-build pass (collisions materialize\n // when two routes are both processed, not during a single route's build).\n resolveCollisions(ctx.root, '', ctx.warnings)\n\n const importsBlock = ctx.importLines.length > 0 ? ctx.importLines.join('\\n') + '\\n\\n' : '\\n'\n const warningsBlock =\n ctx.warnings.length > 0 ? ' // ' + ctx.warnings.join('\\n // ') + '\\n\\n' : ''\n\n // Empty manifest (no routes with methods) → emit a stub interface so consumers\n // still get `client.X` autocomplete-friendly errors instead of \"Module not found\".\n const treeBody =\n ctx.root.children.size === 0 &&\n ctx.root.methods.size === 0 &&\n ctx.root.controllerMethods.size === 0\n ? '{\\n // No routes detected — add `server/routes/*.ts` to populate this client.\\n }'\n : renderTreeNode(ctx.root, ' ', /* isRoot */ true)\n\n return `${FILE_HEADER}\ndeclare module '@theo/client' {\n${importsBlock}${warningsBlock} export interface AppClient ${treeBody}\n export const client: AppClient\n}\n`\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Phase 4 — Vite plugin\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface AppTypedClientPluginOptions {\n /** Project root (cwd). */\n cwd: string\n /** Absolute path to the user's `server/` dir. */\n serverDir: string\n /** Absolute path to the `.theokit/` output dir (where `client.d.ts` lands). */\n distDir: string\n /**\n * Additional routes to merge into the typed client alongside file-system routes.\n * Each entry follows ManifestRoute shape (filePath, routePath, methods, paramNames).\n *\n * Used by `@theokit/http` `httpDecoratorsPlugin` to inject\n * decorator-defined routes — zero coupling between theokit core and the\n * decorator package (the walk happens in http-decorators; only data arrives here).\n */\n extraRoutes?: ManifestRoute[]\n}\n\nconst VIRTUAL_APP_CLIENT_ID = '@theo/client'\nconst RESOLVED_APP_CLIENT_ID = '\\0@theo/client'\n\n/**\n * Should a watcher file event under `routes/` or `controllers/` trigger a client\n * re-emit? Ignores the `.__decorated__.mjs` temp files that `loadControllerWithSwc`\n * writes+unlinks during controller codegen — reacting to them would create a\n * perpetual emit→temp-write→watcher→emit loop (#122 T2.1).\n */\nexport function shouldReemitForFile(\n file: string,\n routesGlob: string,\n controllersGlob: string,\n): boolean {\n const normalized = file.replace(/\\\\/g, '/')\n if (normalized.includes('.__decorated__.')) return false\n return normalized.startsWith(routesGlob) || normalized.startsWith(controllersGlob)\n}\n\n/** Atomic write via tmp + rename (EC-6). Skips when content is unchanged. */\nfunction writeFileIfChanged(filePath: string, content: string): { changed: boolean } {\n if (existsSync(filePath)) {\n try {\n const current = readFileSync(filePath, 'utf-8')\n if (current === content) return { changed: false }\n } catch {\n // fall through to write\n }\n }\n mkdirSync(dirname(filePath), { recursive: true })\n const tmp = `${filePath}.${process.pid}.tmp`\n writeFileSync(tmp, content)\n renameSync(tmp, filePath)\n return { changed: true }\n}\n\nasync function emitClientDts(\n opts: AppTypedClientPluginOptions,\n): Promise<{ changed: boolean; path: string }> {\n if (!existsSync(opts.serverDir)) {\n // No server dir — emit empty stub to avoid \"module not found\".\n const stubPath = posix.join(opts.distDir.replace(/\\\\/g, '/'), 'client.d.ts')\n return {\n changed: writeFileIfChanged(\n stubPath,\n generateClientDts({\n manifest: {\n version: 1,\n generatedAt: new Date().toISOString(),\n routes: [],\n actions: [],\n websockets: [],\n },\n dtsOutPath: stubPath,\n serverDir: opts.serverDir,\n }),\n ).changed,\n path: stubPath,\n }\n }\n const manifest = generateManifest(opts.serverDir)\n\n // Decorator-client-bridge: merge extra routes (from @theokit/http\n // or any other source) into the manifest so generateClientDts() produces a\n // SINGLE typed client covering both file-system routes AND injected routes.\n if (opts.extraRoutes?.length) {\n manifest.routes.push(...opts.extraRoutes)\n }\n\n // #122 (T2.1) — merge decorator controllers under `<serverDir>/controllers/`\n // into the same typed client. Zero output when the dir is absent/empty (ADR-5).\n const controllersDir = resolve(opts.serverDir, 'controllers')\n const controllerRoutes = existsSync(controllersDir)\n ? await collectControllerRouteData({ controllersDir })\n : []\n\n const dtsOutPath = posix.join(opts.distDir.replace(/\\\\/g, '/'), 'client.d.ts')\n const content = generateClientDts({\n manifest,\n dtsOutPath,\n serverDir: opts.serverDir,\n controllerRoutes,\n })\n const { changed } = writeFileIfChanged(dtsOutPath, content)\n return { changed, path: dtsOutPath }\n}\n\nexport function appTypedClientPlugin(opts: AppTypedClientPluginOptions): Plugin {\n let debounceTimer: NodeJS.Timeout | undefined\n let viteServer: ViteDevServer | undefined\n\n function scheduleEmit(): void {\n if (debounceTimer) clearTimeout(debounceTimer)\n debounceTimer = setTimeout(() => {\n void (async () => {\n try {\n await emitClientDts(opts)\n // Invalidate the virtual module so re-imports pick up potential new shape.\n if (viteServer) {\n const mod = viteServer.moduleGraph.getModuleById(RESOLVED_APP_CLIENT_ID)\n if (mod) viteServer.moduleGraph.invalidateModule(mod)\n }\n } catch (err) {\n // Surface but don't crash dev server.\n console.error('[theokit:app-typed-client] codegen error:', err)\n }\n })()\n }, 100)\n }\n\n return {\n name: 'theokit:app-typed-client',\n enforce: 'post',\n async configResolved() {\n try {\n await emitClientDts(opts)\n } catch (err) {\n console.error('[theokit:app-typed-client] initial codegen error:', err)\n }\n },\n async buildEnd() {\n try {\n await emitClientDts(opts)\n } catch (err) {\n console.error('[theokit:app-typed-client] buildEnd codegen error:', err)\n }\n },\n configureServer(server) {\n viteServer = server\n const routesGlob = posix.join(opts.serverDir.replace(/\\\\/g, '/'), 'routes')\n const controllersGlob = posix.join(opts.serverDir.replace(/\\\\/g, '/'), 'controllers')\n const onFile = (file: string): void => {\n if (shouldReemitForFile(file, routesGlob, controllersGlob)) scheduleEmit()\n }\n server.watcher.on('add', onFile)\n server.watcher.on('change', onFile)\n server.watcher.on('unlink', onFile)\n },\n resolveId(id) {\n if (id === VIRTUAL_APP_CLIENT_ID) return RESOLVED_APP_CLIENT_ID\n return null\n },\n load(id) {\n if (id === RESOLVED_APP_CLIENT_ID) {\n return [\n `import { createAppClient } from 'theokit/client'`,\n `export const client = createAppClient()`,\n `export default client`,\n ``,\n ].join('\\n')\n }\n return null\n },\n }\n}\n\nexport { VIRTUAL_APP_CLIENT_ID, RESOLVED_APP_CLIENT_ID, emitClientDts }\n","/**\n * #122 (T2.1) — typed-client codegen for decorator controllers.\n *\n * Collects the routing metadata of every `@Controller` under `controllersDir`\n * so the app-typed-client codegen can emit `client.<ns>.<method>()` entries.\n * Codegen loads controllers via `loadControllerWithSwc` (swc-compile + import,\n * no Vite dev server needed) — distinct from the dev SERVING path, which loads\n * through Vite's `ssrLoadModule`.\n *\n * ADR-2 checkpoint (LOCKED — see the plan's Unresolved Questions): only the\n * RESPONSE type is inferred, via `Awaited<ReturnType<InstanceType<typeof C>['m']>>`.\n * Request `@Body` types are NOT inferred from the class — parameter decorators are\n * erased runtime metadata, invisible to the type system, so `Parameters<...>[N]` is\n * positional-only and cannot tell body from param from query. Body falls back to\n * `unknown` (runtime `@Body` Zod validation from Phase 1 still applies). Full body\n * inference is tracked in the follow-up issue.\n */\nimport { loadControllerWithSwc, walkControllerMetadata } from '@theokit/http'\n\nimport {\n scanControllerModules,\n type ControllerModuleLoader,\n} from '../server/http/controller-dispatch.js'\n\n/** One controller route, flattened for the client codegen. */\nexport interface ControllerRouteData {\n /** Absolute path to the `*.controller.ts` source (for the `import type` line). */\n filePath: string\n /** The exported class name (e.g. `TasksController`). */\n className: string\n /** Full route path, e.g. `/api/v2/tasks/:id`. */\n fullPath: string\n /** HTTP verb (`GET`, `POST`, …). */\n verb: string\n /** The controller method name backing this route (e.g. `findById`). */\n methodName: string\n /**\n * theokit#124 — the EXPORTED name of the `@Body(schema)` Zod schema, when it has one.\n *\n * Absent when the schema is declared inline or otherwise not exported: there is then no\n * identifier the emitted `.d.ts` could reference, and the body stays `unknown`.\n */\n bodySchemaExport?: string\n /** theokit#124 — same for `@Query(schema)`. */\n querySchemaExport?: string\n /**\n * theokit#124 — a `@Body`/`@Query` schema EXISTS on this route but is not exported, so no name\n * could be referenced and the type degraded to `unknown`.\n *\n * Distinct from \"there is no schema at all\": that route was never going to be typed and needs no\n * explanation, while this one looks arbitrarily untyped next to a typed neighbour. The codegen\n * turns this into a note in the emitted file so the difference is legible.\n */\n schemaNotExported?: boolean\n}\n\n/**\n * Recover the EXPORTED name of a runtime schema object — theokit#124.\n *\n * `WalkResult.bodySchema` is a `z.ZodType` instance with no source identifier, which is why #122's\n * ADR-2 checkpoint concluded the request type was unrecoverable. It is recoverable, just not from\n * the metadata: the codegen already imports the module, so this object IS the one the module\n * exported, and reference identity gives back its name. No parsing, no heuristics — either some\n * export is the same object or none is.\n *\n * Returns `undefined` for an inline schema, which is a real limit rather than a bug: an unexported\n * value has no name a `.d.ts` can import.\n */\nfunction exportedNameOf(\n schema: unknown,\n moduleExports: Readonly<Record<string, unknown>>,\n): string | undefined {\n if (schema === undefined || schema === null) return undefined\n for (const [name, value] of Object.entries(moduleExports)) {\n // Reference identity, never structural comparison: two distinct schemas can be deeply equal,\n // and emitting the wrong name would type the client against the wrong contract silently.\n if (value === schema) return name\n }\n return undefined\n}\n\n/**\n * Scan `controllersDir` and flatten every controller's routes into\n * {@link ControllerRouteData}. Returns `[]` when the directory has no controllers\n * (so the codegen contributes zero bytes — ADR-5 routes-only byte-identity).\n */\nexport async function collectControllerRouteData(opts: {\n controllersDir: string\n loadModule?: ControllerModuleLoader\n}): Promise<ControllerRouteData[]> {\n const loader = opts.loadModule ?? loadControllerWithSwc\n const modules = await scanControllerModules(opts.controllersDir, loader)\n const out: ControllerRouteData[] = []\n for (const { filePath, cls, exports } of modules) {\n const className = (cls as { name: string }).name\n for (const walk of walkControllerMetadata(cls)) {\n const bodySchemaExport = exportedNameOf(walk.bodySchema, exports)\n // `walk.querySchema` is DECLARED on `WalkResult` and never populated — `walkControllerMetadata`\n // resolves a body schema and has no query counterpart, so the field always reads `undefined`\n // (grep: the only occurrence in `@theokit/http` is its own declaration). Reading the entry\n // directly is therefore not a shortcut around an API; it is the only place the schema exists.\n //\n // Deliberately NOT fixed by populating `querySchema` here: that field feeds runtime validation\n // for `@Body`, so filling the query one would start VALIDATING query strings that are not\n // validated today. This issue is about editor types; silently turning on runtime rejection\n // under it would be a behaviour change nobody asked for. Filed separately.\n const queryEntry = walk.paramEntries.find(\n (e) => e.source === 'query' && e.schema !== undefined,\n )\n const querySchemaExport = exportedNameOf(queryEntry?.schema, exports)\n out.push({\n filePath,\n className,\n fullPath: walk.fullPath,\n verb: walk.verb,\n methodName: String(walk.propertyKey),\n ...(bodySchemaExport !== undefined ? { bodySchemaExport } : {}),\n ...(querySchemaExport !== undefined ? { querySchemaExport } : {}),\n ...((walk.bodySchema !== undefined && bodySchemaExport === undefined) ||\n (queryEntry?.schema !== undefined && querySchemaExport === undefined)\n ? { schemaNotExported: true }\n : {}),\n })\n }\n }\n return out\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,WAAW,cAAc,YAAY,eAAe,kBAAkB;AAC/E,SAAS,SAAS,YAAY,OAAO,UAAU,eAAe;;;ACP9D,SAAS,uBAAuB,8BAA8B;AAmD9D,SAAS,eACP,QACA,eACoB;AACpB,MAAI,WAAW,UAAa,WAAW,KAAM,QAAO;AACpD,aAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,aAAa,GAAG;AAGzD,QAAI,UAAU,OAAQ,QAAO;AAAA,EAC/B;AACA,SAAO;AACT;AAOA,eAAsB,2BAA2B,MAGd;AACjC,QAAM,SAAS,KAAK,cAAc;AAClC,QAAM,UAAU,MAAM,sBAAsB,KAAK,gBAAgB,MAAM;AACvE,QAAM,MAA6B,CAAC;AACpC,aAAW,EAAE,UAAU,KAAK,QAAQ,KAAK,SAAS;AAChD,UAAM,YAAa,IAAyB;AAC5C,eAAW,QAAQ,uBAAuB,GAAG,GAAG;AAC9C,YAAM,mBAAmB,eAAe,KAAK,YAAY,OAAO;AAUhE,Y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F,SAAS,KAAK;AAEZ,kBAAQ,MAAM,6CAA6C,GAAG;AAAA,QAChE;AAAA,MACF,GAAG;AAAA,IACL,GAAG,GAAG;AAAA,EACR;AAEA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,iBAAiB;AACrB,UAAI;AACF,cAAM,cAAc,IAAI;AAAA,MAC1B,SAAS,KAAK;AACZ,gBAAQ,MAAM,qDAAqD,GAAG;AAAA,MACxE;AAAA,IACF;AAAA,IACA,MAAM,WAAW;AACf,UAAI;AACF,cAAM,cAAc,IAAI;AAAA,MAC1B,SAAS,KAAK;AACZ,gBAAQ,MAAM,sDAAsD,GAAG;AAAA,MACzE;AAAA,IACF;AAAA,IACA,gBAAgB,QAAQ;AACtB,mBAAa;AACb,YAAM,aAAa,MAAM,KAAK,KAAK,UAAU,QAAQ,OAAO,GAAG,GAAG,QAAQ;AAC1E,YAAM,kBAAkB,MAAM,KAAK,KAAK,UAAU,QAAQ,OAAO,GAAG,GAAG,aAAa;AACpF,YAAM,SAAS,CAAC,SAAuB;AACrC,YAAI,oBAAoB,MAAM,YAAY,eAAe,EAAG,cAAa;AAAA,MAC3E;AACA,aAAO,QAAQ,GAAG,OAAO,MAAM;AAC/B,aAAO,QAAQ,GAAG,UAAU,MAAM;AAClC,aAAO,QAAQ,GAAG,UAAU,MAAM;AAAA,IACpC;AAAA,IACA,UAAU,IAAI;AACZ,UAAI,OAAO,sBAAuB,QAAO;AACzC,aAAO;AAAA,IACT;AAAA,IACA,KAAK,IAAI;AACP,UAAI,OAAO,wBAAwB;AACjC,eAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF,EAAE,KAAK,IAAI;AAAA,MACb;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vite-plugin/app-typed-client.ts","../src/vite-plugin/controller-client-emit.ts"],"mappings":";;;;;;;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AAA,IAC/F;AAAA,EACF;AACA,MAAI,CAAC,YAAY,KAAK,WAAW,GAAG;AAClC,UAAM,IAAI,MAAM,oEAAoE;AAAA,EACtF;AACA,MAAI,KAAK,YAAY,WAAW,GAAG;AACjC,YAAQ;AAAA,MACN,mBAAmB,KAAK,UAAU,KAAK,IAAI,CAAC;AAAA,IAC9C;AAAA,EACF;AAIA,QAAM,EAAE,SAAS,UAAU,GAAG,YAAY,IAAI,EAAE,aAAa,KAAK,WAAW;AAO7E,SAAO;AAAA,IACL,MAAM,KAAK;AAAA,IACX,aAAa,KAAK;AAAA,IAClB;AAAA,IACA,SAAS,OAAO,OAAgC,QAA8C;AAC5F,YAAM,SAAS,KAAK,YAAY,MAAM,KAAK;AAE3C,YAAM,SAAS,MAAM,KAAK,QAAQ,QAAQ,GAAG;AAE7C,UAAI,KAAK,cAAe,QAAO,KAAK,cAAc,MAAM;AACxD,UAAI,OAAO,WAAW,UAAU;AAC9B,cAAM,IAAI;AAAA,UACR,mBAAmB,KAAK,UAAU,KAAK,IAAI,CAAC;AAAA,QAC9C;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA;AAAA,IAEA,GAAI,KAAK,cAAc,SAAY,EAAE,WAAW,KAAK,UAA2B,IAAI,CAAC;AAAA,EACvF;AACF;AAMO,SAAS,eACd,MACA,QACA,QACS;AACT,QAAM,KAAK,KAAK,YAAY,MAAM;AAClC,SAAO,KAAK,GAAG,MAAM,IAAI;AAC3B;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|