theokit 0.36.1 → 0.38.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/{actions-virtual-module-SYGQE6JQ.js → actions-virtual-module-H3LY5Q22.js} +3 -3
- package/dist/{actions-virtual-module-3KSP3WPJ.js → actions-virtual-module-WLOT2SPR.js} +3 -3
- package/dist/{agent-DX5LHD6X.js → agent-VQMWM5BK.js} +2 -2
- package/dist/{app-typed-client-N4TRX5FI.js → app-typed-client-67GBLYD6.js} +113 -24
- package/dist/app-typed-client-67GBLYD6.js.map +1 -0
- package/dist/{app-typed-client-ESMMLPYK.js → app-typed-client-SPFNGVZL.js} +113 -24
- package/dist/app-typed-client-SPFNGVZL.js.map +1 -0
- package/dist/{build-3C2KQPME.js → build-3BFIACHN.js} +6 -6
- package/dist/{chunk-RVJAM77M.js → chunk-2HKRQUWU.js} +2 -2
- package/dist/{chunk-3KD2O6DC.js → chunk-BKYFOEBK.js} +58 -54
- package/dist/chunk-BKYFOEBK.js.map +1 -0
- package/dist/{chunk-V3X5FWJA.js → chunk-EV33DOG6.js} +1 -1
- package/dist/{chunk-V3X5FWJA.js.map → chunk-EV33DOG6.js.map} +1 -1
- package/dist/{chunk-UDG6JPVP.js → chunk-GW5H4KB4.js} +2 -2
- package/dist/{chunk-DISADTFZ.js → chunk-IPSFSNEJ.js} +2 -2
- package/dist/{chunk-RPMKF6BC.js → chunk-OLZLYLOE.js} +109 -7
- package/dist/chunk-OLZLYLOE.js.map +1 -0
- package/dist/{chunk-CEHXC5NI.js → chunk-Q3C3KH3C.js} +24 -5
- package/dist/chunk-Q3C3KH3C.js.map +1 -0
- package/dist/{chunk-MNQC5XEJ.js → chunk-QCB7ZNR2.js} +94 -37
- package/dist/chunk-QCB7ZNR2.js.map +1 -0
- package/dist/{chunk-T4TCLEFB.js → chunk-QMV3R6D5.js} +91 -36
- package/dist/chunk-QMV3R6D5.js.map +1 -0
- package/dist/chunk-QNFVYST4.js +110 -0
- package/dist/chunk-QNFVYST4.js.map +1 -0
- package/dist/{chunk-WL4AX5FI.js → chunk-QWBXUZAX.js} +57 -54
- package/dist/chunk-QWBXUZAX.js.map +1 -0
- package/dist/cli/index.js +5 -5
- package/dist/client/core.d.ts +12 -1
- package/dist/client/core.js +1 -1
- package/dist/client/index.d.ts +7 -1
- package/dist/client/index.js +2 -1
- package/dist/client/index.js.map +1 -1
- package/dist/controller-swc-transform-URELVCBM.js +27 -0
- package/dist/controller-swc-transform-URELVCBM.js.map +1 -0
- package/dist/controller-swc-transform-XV3ETSE3.js +28 -0
- package/dist/controller-swc-transform-XV3ETSE3.js.map +1 -0
- package/dist/{dev-CNPT7COE.js → dev-IBCZYFZZ.js} +8 -8
- package/dist/{index-C3ged4mn.d.ts → index-BeAsvfPr.d.ts} +2 -2
- package/dist/index.js +4 -4
- package/dist/{internal-api-4IXBITVV.js → internal-api-MDCX7A7H.js} +10 -3
- package/dist/{internal-api-5JKDYRGM.js → internal-api-OLNM25HS.js} +9 -3
- package/dist/{mcp-INKDONQS.js → mcp-DKRODZAL.js} +2 -2
- package/dist/{plugin-runner-CMprWWHZ.d.ts → plugin-runner-BFEcgtmJ.d.ts} +1 -1
- package/dist/{plugin-types-L49QYMb5.d.ts → plugin-types-D69-lJZ9.d.ts} +9 -2
- package/dist/{registry-3NB7KOUI.js → registry-FKPH7XEL.js} +1 -1
- package/dist/server/define/index.d.ts +1 -1
- package/dist/server/define/index.js +1 -1
- package/dist/server/http/index.d.ts +3 -3
- package/dist/server/http/index.js +1 -1
- package/dist/server/index.d.ts +4 -4
- package/dist/server/index.js +3 -3
- package/dist/server/plugins/index.d.ts +3 -3
- package/dist/{start-LNJZNKF6.js → start-WB7GYXEW.js} +3 -3
- package/dist/vite-plugin/index.js +4 -4
- package/dist/{vite-plugin-NC5ETNMV.js → vite-plugin-5Y3LDTXI.js} +5 -5
- package/package.json +2 -2
- package/dist/app-typed-client-ESMMLPYK.js.map +0 -1
- package/dist/app-typed-client-N4TRX5FI.js.map +0 -1
- package/dist/chunk-3KD2O6DC.js.map +0 -1
- package/dist/chunk-CEHXC5NI.js.map +0 -1
- package/dist/chunk-MNQC5XEJ.js.map +0 -1
- package/dist/chunk-RPMKF6BC.js.map +0 -1
- package/dist/chunk-RSVN727G.js +0 -1
- package/dist/chunk-T4TCLEFB.js.map +0 -1
- package/dist/chunk-WL4AX5FI.js.map +0 -1
- package/dist/vite-plugin-NC5ETNMV.js.map +0 -1
- /package/dist/{actions-virtual-module-SYGQE6JQ.js.map → actions-virtual-module-H3LY5Q22.js.map} +0 -0
- /package/dist/{actions-virtual-module-3KSP3WPJ.js.map → actions-virtual-module-WLOT2SPR.js.map} +0 -0
- /package/dist/{agent-DX5LHD6X.js.map → agent-VQMWM5BK.js.map} +0 -0
- /package/dist/{build-3C2KQPME.js.map → build-3BFIACHN.js.map} +0 -0
- /package/dist/{chunk-RVJAM77M.js.map → chunk-2HKRQUWU.js.map} +0 -0
- /package/dist/{chunk-UDG6JPVP.js.map → chunk-GW5H4KB4.js.map} +0 -0
- /package/dist/{chunk-DISADTFZ.js.map → chunk-IPSFSNEJ.js.map} +0 -0
- /package/dist/{dev-CNPT7COE.js.map → dev-IBCZYFZZ.js.map} +0 -0
- /package/dist/{chunk-RSVN727G.js.map → internal-api-MDCX7A7H.js.map} +0 -0
- /package/dist/{internal-api-4IXBITVV.js.map → internal-api-OLNM25HS.js.map} +0 -0
- /package/dist/{mcp-INKDONQS.js.map → mcp-DKRODZAL.js.map} +0 -0
- /package/dist/{registry-3NB7KOUI.js.map → registry-FKPH7XEL.js.map} +0 -0
- /package/dist/{start-LNJZNKF6.js.map → start-WB7GYXEW.js.map} +0 -0
- /package/dist/{internal-api-5JKDYRGM.js.map → vite-plugin-5Y3LDTXI.js.map} +0 -0
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveTransformer,
|
|
10
10
|
serveAgentAuxRoute,
|
|
11
11
|
writeWebResponseToServerResponse
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2HKRQUWU.js";
|
|
13
13
|
import {
|
|
14
14
|
isMcpPath
|
|
15
15
|
} from "./chunk-2CVV6CNN.js";
|
|
@@ -36,11 +36,12 @@ import {
|
|
|
36
36
|
CsrfReadinessStore,
|
|
37
37
|
TRACE_HEADER,
|
|
38
38
|
createCorsHandler,
|
|
39
|
+
dispatchControllerRequest,
|
|
39
40
|
extractTraceId,
|
|
40
41
|
handleBatchRequest,
|
|
41
42
|
handleCspReport,
|
|
42
43
|
handleCsrfReadiness
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-OLZLYLOE.js";
|
|
44
45
|
import {
|
|
45
46
|
applySecurityHeaders,
|
|
46
47
|
createPluginRunnerFromConfig,
|
|
@@ -50,10 +51,11 @@ import {
|
|
|
50
51
|
executeRoute,
|
|
51
52
|
findSuggestion,
|
|
52
53
|
generateNonce,
|
|
54
|
+
incomingMessageToHandlerRequest,
|
|
53
55
|
incomingMessageToWebRequest,
|
|
54
56
|
logRequest,
|
|
55
57
|
sendError
|
|
56
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-BKYFOEBK.js";
|
|
57
59
|
import {
|
|
58
60
|
scanAgents
|
|
59
61
|
} from "./chunk-L4GCEMNW.js";
|
|
@@ -66,7 +68,7 @@ import {
|
|
|
66
68
|
|
|
67
69
|
// src/vite-plugin/index.ts
|
|
68
70
|
import { existsSync as existsSync7 } from "fs";
|
|
69
|
-
import { resolve as
|
|
71
|
+
import { resolve as resolve8, dirname as dirname4 } from "path";
|
|
70
72
|
import { fileURLToPath } from "url";
|
|
71
73
|
|
|
72
74
|
// src/vite-plugin/config-hook.ts
|
|
@@ -89,15 +91,23 @@ function runConfigHook(ctx) {
|
|
|
89
91
|
server: {
|
|
90
92
|
...warmupClientFiles.length > 0 ? { warmup: { clientFiles: warmupClientFiles } } : {},
|
|
91
93
|
...servicesProxy !== void 0 ? { proxy: servicesProxy } : {},
|
|
92
|
-
// Skip watching gitignored heavy dirs to avoid
|
|
93
|
-
//
|
|
94
|
+
// Skip watching gitignored heavy dirs to avoid ENOSPC (inotify watcher
|
|
95
|
+
// exhaustion), theokit's own generated output, and local SQLite data.
|
|
96
|
+
// #121: a DB write (`.data/app.db` + `-wal`/`-shm`) on every agent turn /
|
|
97
|
+
// request must NOT trigger a full page reload — that "blinks" the screen
|
|
98
|
+
// and tears down the in-flight agent stream.
|
|
94
99
|
watch: {
|
|
95
100
|
ignored: [
|
|
96
101
|
"**/referencias/**",
|
|
97
102
|
"**/.theokit/**",
|
|
98
|
-
"**/.theokit/**",
|
|
99
103
|
"**/dist/**",
|
|
100
|
-
"**/node_modules/**"
|
|
104
|
+
"**/node_modules/**",
|
|
105
|
+
"**/.data/**",
|
|
106
|
+
"**/*.db",
|
|
107
|
+
"**/*.db-wal",
|
|
108
|
+
"**/*.db-shm",
|
|
109
|
+
"**/*.sqlite",
|
|
110
|
+
"**/*.sqlite-journal"
|
|
101
111
|
]
|
|
102
112
|
}
|
|
103
113
|
},
|
|
@@ -277,7 +287,7 @@ async function resolvePluginConfig(projectRoot) {
|
|
|
277
287
|
}
|
|
278
288
|
|
|
279
289
|
// src/vite-plugin/configure-server-hook.ts
|
|
280
|
-
import { resolve as
|
|
290
|
+
import { resolve as resolve5, basename } from "path";
|
|
281
291
|
|
|
282
292
|
// src/devtools/server-side/route-manifest.ts
|
|
283
293
|
function buildPath(parents, segment) {
|
|
@@ -553,6 +563,7 @@ function createAgentMiddleware(vite, projectRoot, csrfMode = "strict", agentsDir
|
|
|
553
563
|
}
|
|
554
564
|
|
|
555
565
|
// src/vite-plugin/api-middleware.ts
|
|
566
|
+
import { resolve as resolve2 } from "path";
|
|
556
567
|
function shouldBypassApiMiddleware(url, prefixes) {
|
|
557
568
|
if (!url.startsWith("/api/")) return true;
|
|
558
569
|
if (prefixes.length === 0) return false;
|
|
@@ -600,10 +611,10 @@ async function handleBatchIfMatch(req, res, ctx) {
|
|
|
600
611
|
async function handleBatchInline(req, res, batching, requestId) {
|
|
601
612
|
try {
|
|
602
613
|
const chunks = [];
|
|
603
|
-
await new Promise((
|
|
614
|
+
await new Promise((resolve9, reject) => {
|
|
604
615
|
req.on("data", (c) => chunks.push(c));
|
|
605
616
|
req.on("end", () => {
|
|
606
|
-
|
|
617
|
+
resolve9();
|
|
607
618
|
});
|
|
608
619
|
req.on("error", reject);
|
|
609
620
|
});
|
|
@@ -631,7 +642,8 @@ async function runPluginsBeforeRouteMatch(pluginRunner, reqCtx) {
|
|
|
631
642
|
const { req, res, requestId, start, url } = reqCtx;
|
|
632
643
|
try {
|
|
633
644
|
const hookResult = await pluginRunner.runOnRequest({
|
|
634
|
-
|
|
645
|
+
// #119 — plugin hooks see a Web `Request` in every runtime (ADR-0028 R3a).
|
|
646
|
+
request: incomingMessageToHandlerRequest(req),
|
|
635
647
|
response: res,
|
|
636
648
|
ctx: {},
|
|
637
649
|
requestId
|
|
@@ -656,6 +668,30 @@ async function runPluginsBeforeRouteMatch(pluginRunner, reqCtx) {
|
|
|
656
668
|
}
|
|
657
669
|
return false;
|
|
658
670
|
}
|
|
671
|
+
async function tryControllerFallthrough(ctx) {
|
|
672
|
+
const handled = await dispatchControllerRequest({
|
|
673
|
+
controllersDir: resolve2(ctx.serverDir, "controllers"),
|
|
674
|
+
loadModule: ctx.loadModule,
|
|
675
|
+
req: ctx.req,
|
|
676
|
+
res: ctx.res,
|
|
677
|
+
csrfMode: ctx.csrfMode,
|
|
678
|
+
disallowed: ctx.disallowed,
|
|
679
|
+
requestId: ctx.requestId
|
|
680
|
+
});
|
|
681
|
+
if (!handled) return false;
|
|
682
|
+
logRequest(
|
|
683
|
+
{
|
|
684
|
+
method: (ctx.req.method ?? "GET").toUpperCase(),
|
|
685
|
+
url: ctx.url,
|
|
686
|
+
status: ctx.res.statusCode,
|
|
687
|
+
duration: Date.now() - ctx.start,
|
|
688
|
+
requestId: ctx.requestId
|
|
689
|
+
},
|
|
690
|
+
void 0,
|
|
691
|
+
ctx.req
|
|
692
|
+
);
|
|
693
|
+
return true;
|
|
694
|
+
}
|
|
659
695
|
function createApiMiddleware(vite, serverDir, rateLimitConfigOrOptions) {
|
|
660
696
|
const opts = rateLimitConfigOrOptions && "windowMs" in rateLimitConfigOrOptions ? { rateLimitConfig: rateLimitConfigOrOptions } : rateLimitConfigOrOptions ?? {};
|
|
661
697
|
const loadModule = createViteLoader(vite);
|
|
@@ -706,6 +742,19 @@ function createApiMiddleware(vite, serverDir, rateLimitConfigOrOptions) {
|
|
|
706
742
|
const routes = scanServerRoutes(serverDir);
|
|
707
743
|
const match = matchRoute(url, routes);
|
|
708
744
|
if (!match) {
|
|
745
|
+
if (await tryControllerFallthrough({
|
|
746
|
+
req,
|
|
747
|
+
res,
|
|
748
|
+
serverDir,
|
|
749
|
+
loadModule,
|
|
750
|
+
csrfMode,
|
|
751
|
+
disallowed,
|
|
752
|
+
requestId,
|
|
753
|
+
url,
|
|
754
|
+
start
|
|
755
|
+
})) {
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
709
758
|
const urlPath = url.split("?")[0];
|
|
710
759
|
const routePaths = routes.map((r) => r.routePath);
|
|
711
760
|
const suggestion = findSuggestion(urlPath, routePaths);
|
|
@@ -751,7 +800,7 @@ function createApiMiddleware(vite, serverDir, rateLimitConfigOrOptions) {
|
|
|
751
800
|
|
|
752
801
|
// src/vite-plugin/ssr-dev-middleware.ts
|
|
753
802
|
import { readFileSync as readFileSync2 } from "fs";
|
|
754
|
-
import { resolve as
|
|
803
|
+
import { resolve as resolve3 } from "path";
|
|
755
804
|
function isSsrRenderResult(value) {
|
|
756
805
|
if (typeof value !== "object" || value === null) return false;
|
|
757
806
|
if (!("html" in value)) return false;
|
|
@@ -766,7 +815,7 @@ function setupSsrDevMiddleware(server, opts) {
|
|
|
766
815
|
return;
|
|
767
816
|
}
|
|
768
817
|
try {
|
|
769
|
-
const indexPath =
|
|
818
|
+
const indexPath = resolve3(opts.projectRoot, "index.html");
|
|
770
819
|
let template = readFileSync2(indexPath, "utf-8");
|
|
771
820
|
template = await server.transformIndexHtml(url, template);
|
|
772
821
|
const nonce = generateNonce();
|
|
@@ -817,9 +866,9 @@ function setupSsrDevMiddleware(server, opts) {
|
|
|
817
866
|
}
|
|
818
867
|
|
|
819
868
|
// src/vite-plugin/ws-upgrade.ts
|
|
820
|
-
import { resolve as
|
|
869
|
+
import { resolve as resolve4 } from "path";
|
|
821
870
|
function setupWsUpgrade(server, projectRoot) {
|
|
822
|
-
const wsRoutes = scanWebSocketRoutes(
|
|
871
|
+
const wsRoutes = scanWebSocketRoutes(resolve4(projectRoot, "server"));
|
|
823
872
|
if (wsRoutes.length === 0) return;
|
|
824
873
|
const wsHttpServer = server.httpServer;
|
|
825
874
|
if (!wsHttpServer) return;
|
|
@@ -901,7 +950,7 @@ async function runConfigureServer(server, ctx) {
|
|
|
901
950
|
csrfReadinessStore
|
|
902
951
|
})
|
|
903
952
|
);
|
|
904
|
-
const configPath =
|
|
953
|
+
const configPath = resolve5(ctx.projectRoot, "theo.config.ts");
|
|
905
954
|
server.watcher.on("change", (file) => {
|
|
906
955
|
if (file === configPath) {
|
|
907
956
|
console.warn(
|
|
@@ -931,7 +980,7 @@ async function runConfigureServer(server, ctx) {
|
|
|
931
980
|
const openApiCfg = ctx.resolvedOpenApi;
|
|
932
981
|
const { reEmitOpenApi } = await import("./dev-emit-XVTJXZGA.js");
|
|
933
982
|
const openApiServerDir = ctx.serverDir;
|
|
934
|
-
const openApiDistDir =
|
|
983
|
+
const openApiDistDir = resolve5(ctx.projectRoot, ctx.resolvedDistDir);
|
|
935
984
|
const isRouteFileForOpenApi = (file) => file.startsWith(openApiServerDir) && /\.(ts|tsx|js|mjs)$/.test(file);
|
|
936
985
|
void reEmitOpenApi(openApiServerDir, openApiDistDir, openApiCfg);
|
|
937
986
|
server.watcher.on("change", (file) => {
|
|
@@ -1217,17 +1266,17 @@ async function integrateUseTheoUI(cwd, opts) {
|
|
|
1217
1266
|
|
|
1218
1267
|
// src/vite-plugin/resolve-theo-root.ts
|
|
1219
1268
|
import { existsSync as existsSync5 } from "fs";
|
|
1220
|
-
import { resolve as
|
|
1269
|
+
import { resolve as resolve6 } from "path";
|
|
1221
1270
|
function resolveTheoRootDir(currentDir) {
|
|
1222
|
-
if (existsSync5(
|
|
1271
|
+
if (existsSync5(resolve6(currentDir, "client"))) {
|
|
1223
1272
|
return currentDir;
|
|
1224
1273
|
}
|
|
1225
|
-
return
|
|
1274
|
+
return resolve6(currentDir, "..");
|
|
1226
1275
|
}
|
|
1227
1276
|
|
|
1228
1277
|
// src/vite-plugin/transform-html-hook.ts
|
|
1229
1278
|
import { existsSync as existsSync6 } from "fs";
|
|
1230
|
-
import { resolve as
|
|
1279
|
+
import { resolve as resolve7 } from "path";
|
|
1231
1280
|
|
|
1232
1281
|
// src/vite-plugin/inject-devtools.ts
|
|
1233
1282
|
var DEVTOOLS_VIRTUAL_ID = "/@theo/devtools/entry.js";
|
|
@@ -1327,7 +1376,7 @@ function runTransformIndexHtml(html, ctx) {
|
|
|
1327
1376
|
next = devtools.html;
|
|
1328
1377
|
const styles = injectStylesheets(next, {
|
|
1329
1378
|
isDev: ctx.isDevMode.value,
|
|
1330
|
-
hasPackage: (name) => existsSync6(
|
|
1379
|
+
hasPackage: (name) => existsSync6(resolve7(ctx.projectRoot, "node_modules", ...name.split("/")))
|
|
1331
1380
|
});
|
|
1332
1381
|
next = styles.html;
|
|
1333
1382
|
return next;
|
|
@@ -1887,7 +1936,7 @@ function findConsumerConfig(projectRoot, basename2) {
|
|
|
1887
1936
|
let dir = projectRoot;
|
|
1888
1937
|
for (let level = 0; level < 3; level++) {
|
|
1889
1938
|
for (const ext of extensions) {
|
|
1890
|
-
const candidate =
|
|
1939
|
+
const candidate = resolve8(dir, `${basename2}${ext}`);
|
|
1891
1940
|
if (existsSync7(candidate)) return candidate;
|
|
1892
1941
|
}
|
|
1893
1942
|
const parent = dirname4(dir);
|
|
@@ -1899,7 +1948,7 @@ function findConsumerConfig(projectRoot, basename2) {
|
|
|
1899
1948
|
async function theoPluginAsync(rootOrOptions) {
|
|
1900
1949
|
const options = typeof rootOrOptions === "string" ? { root: rootOrOptions } : rootOrOptions ?? {};
|
|
1901
1950
|
const projectRoot = options.root ?? process.cwd();
|
|
1902
|
-
const serverDirAbs =
|
|
1951
|
+
const serverDirAbs = resolve8(projectRoot, options.serverDir ?? "server");
|
|
1903
1952
|
const agentsDirName = options.agentsDir ?? "agents";
|
|
1904
1953
|
const consumerTailwindConfig = findConsumerConfig(projectRoot, "tailwind.config");
|
|
1905
1954
|
const consumerPostcssConfig = findConsumerConfig(projectRoot, "postcss.config");
|
|
@@ -1917,23 +1966,23 @@ async function theoPluginAsync(rootOrOptions) {
|
|
|
1917
1966
|
})
|
|
1918
1967
|
);
|
|
1919
1968
|
}
|
|
1920
|
-
const { appTypedClientPlugin } = await import("./app-typed-client-
|
|
1969
|
+
const { appTypedClientPlugin } = await import("./app-typed-client-67GBLYD6.js");
|
|
1921
1970
|
const appClientPlugin = appTypedClientPlugin({
|
|
1922
1971
|
cwd: projectRoot,
|
|
1923
1972
|
serverDir: serverDirAbs,
|
|
1924
|
-
distDir:
|
|
1973
|
+
distDir: resolve8(projectRoot, ".theokit")
|
|
1925
1974
|
});
|
|
1926
|
-
const { actionsVirtualModule } = await import("./actions-virtual-module-
|
|
1975
|
+
const { actionsVirtualModule } = await import("./actions-virtual-module-WLOT2SPR.js");
|
|
1927
1976
|
const actionsPlugin = actionsVirtualModule({
|
|
1928
1977
|
serverDir: serverDirAbs,
|
|
1929
|
-
distDir:
|
|
1978
|
+
distDir: resolve8(projectRoot, ".theokit")
|
|
1930
1979
|
});
|
|
1931
1980
|
const { agentsTypedClientPlugin } = await import("./agents-typed-client-5DCGDWFZ.js");
|
|
1932
|
-
const { generateManifest } = await import("./internal-api-
|
|
1981
|
+
const { generateManifest } = await import("./internal-api-OLNM25HS.js");
|
|
1933
1982
|
const agentsClientPlugin = agentsTypedClientPlugin({
|
|
1934
1983
|
projectRoot,
|
|
1935
1984
|
agentsDir: agentsDirName,
|
|
1936
|
-
distDir:
|
|
1985
|
+
distDir: resolve8(projectRoot, ".theokit"),
|
|
1937
1986
|
// Agents live at <projectRoot>/<agentsDir>; generateManifest scans them via the server dir's
|
|
1938
1987
|
// parent (projectRoot for the canonical layout) + the agents dir name (#95 follow-up).
|
|
1939
1988
|
scanManifest: () => generateManifest(serverDirAbs, projectRoot, agentsDirName)
|
|
@@ -1942,10 +1991,16 @@ async function theoPluginAsync(rootOrOptions) {
|
|
|
1942
1991
|
const routesHmrPlugin = serverRoutesHmrPlugin({
|
|
1943
1992
|
serverDir: serverDirAbs
|
|
1944
1993
|
});
|
|
1994
|
+
const { controllerSwcTransformPlugin } = await import("./controller-swc-transform-XV3ETSE3.js");
|
|
1995
|
+
const controllerTransformPlugin = controllerSwcTransformPlugin({
|
|
1996
|
+
serverDir: serverDirAbs
|
|
1997
|
+
});
|
|
1945
1998
|
return [
|
|
1946
1999
|
theoPlugin(rootOrOptions),
|
|
1947
2000
|
...uiPlugins,
|
|
1948
2001
|
...servicesPlugins,
|
|
2002
|
+
// #122 — swc-compile controllers/** (enforce:'pre'; order-independent).
|
|
2003
|
+
controllerTransformPlugin,
|
|
1949
2004
|
appClientPlugin,
|
|
1950
2005
|
actionsPlugin,
|
|
1951
2006
|
agentsClientPlugin,
|
|
@@ -1954,10 +2009,10 @@ async function theoPluginAsync(rootOrOptions) {
|
|
|
1954
2009
|
}
|
|
1955
2010
|
function buildOptimizeDepsInclude(projectRoot, viteOptimizeDeps) {
|
|
1956
2011
|
const include = [];
|
|
1957
|
-
if (existsSync7(
|
|
2012
|
+
if (existsSync7(resolve8(projectRoot, "node_modules", "@theokit", "ui"))) {
|
|
1958
2013
|
include.push("@theokit/ui");
|
|
1959
2014
|
}
|
|
1960
|
-
if (existsSync7(
|
|
2015
|
+
if (existsSync7(resolve8(projectRoot, "node_modules", "lucide-react"))) {
|
|
1961
2016
|
include.push("lucide-react");
|
|
1962
2017
|
}
|
|
1963
2018
|
include.push("devalue");
|
|
@@ -1983,8 +2038,8 @@ var VIRTUAL_MODULE_IDS = {
|
|
|
1983
2038
|
function theoPlugin(rootOrOptions) {
|
|
1984
2039
|
const options = typeof rootOrOptions === "string" ? { root: rootOrOptions } : rootOrOptions ?? {};
|
|
1985
2040
|
const projectRoot = options.root ?? process.cwd();
|
|
1986
|
-
const appDir =
|
|
1987
|
-
const serverDir =
|
|
2041
|
+
const appDir = resolve8(projectRoot, options.appDir ?? "app");
|
|
2042
|
+
const serverDir = resolve8(projectRoot, options.serverDir ?? "server");
|
|
1988
2043
|
const agentsDir = options.agentsDir ?? "agents";
|
|
1989
2044
|
const ssrEnabled = options.ssr ?? false;
|
|
1990
2045
|
const currentDir = dirname4(fileURLToPath(import.meta.url));
|
|
@@ -2104,4 +2159,4 @@ export {
|
|
|
2104
2159
|
theoPluginAsync,
|
|
2105
2160
|
theoPlugin
|
|
2106
2161
|
};
|
|
2107
|
-
//# sourceMappingURL=chunk-
|
|
2162
|
+
//# sourceMappingURL=chunk-QMV3R6D5.js.map
|