@agent-native/core 0.4.4 → 0.4.5

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.
Files changed (117) hide show
  1. package/dist/agent/production-agent.d.ts.map +1 -1
  2. package/dist/agent/production-agent.js +121 -115
  3. package/dist/agent/production-agent.js.map +1 -1
  4. package/dist/application-state/store.d.ts.map +1 -1
  5. package/dist/application-state/store.js +21 -0
  6. package/dist/application-state/store.js.map +1 -1
  7. package/dist/cli/index.js +12 -0
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/client/AgentPanel.d.ts +5 -1
  10. package/dist/client/AgentPanel.d.ts.map +1 -1
  11. package/dist/client/AgentPanel.js +39 -5
  12. package/dist/client/AgentPanel.js.map +1 -1
  13. package/dist/client/AssistantChat.d.ts +2 -0
  14. package/dist/client/AssistantChat.d.ts.map +1 -1
  15. package/dist/client/AssistantChat.js +59 -7
  16. package/dist/client/AssistantChat.js.map +1 -1
  17. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  18. package/dist/client/MultiTabAssistantChat.js +5 -15
  19. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  20. package/dist/client/agent-chat.d.ts +2 -0
  21. package/dist/client/agent-chat.d.ts.map +1 -1
  22. package/dist/client/agent-chat.js.map +1 -1
  23. package/dist/client/analytics.d.ts +16 -0
  24. package/dist/client/analytics.d.ts.map +1 -0
  25. package/dist/client/analytics.js +17 -0
  26. package/dist/client/analytics.js.map +1 -0
  27. package/dist/client/components/CodeRequiredDialog.d.ts +13 -0
  28. package/dist/client/components/CodeRequiredDialog.d.ts.map +1 -0
  29. package/dist/client/components/CodeRequiredDialog.js +159 -0
  30. package/dist/client/components/CodeRequiredDialog.js.map +1 -0
  31. package/dist/client/index.d.ts +4 -0
  32. package/dist/client/index.d.ts.map +1 -1
  33. package/dist/client/index.js +4 -0
  34. package/dist/client/index.js.map +1 -1
  35. package/dist/client/terminal/AgentTerminal.d.ts +1 -1
  36. package/dist/client/terminal/AgentTerminal.js +1 -1
  37. package/dist/client/terminal/AgentTerminal.js.map +1 -1
  38. package/dist/client/use-dev-mode.d.ts +9 -0
  39. package/dist/client/use-dev-mode.d.ts.map +1 -0
  40. package/dist/client/use-dev-mode.js +44 -0
  41. package/dist/client/use-dev-mode.js.map +1 -0
  42. package/dist/client/use-send-to-agent-chat.d.ts +17 -0
  43. package/dist/client/use-send-to-agent-chat.d.ts.map +1 -0
  44. package/dist/client/use-send-to-agent-chat.js +40 -0
  45. package/dist/client/use-send-to-agent-chat.js.map +1 -0
  46. package/dist/client/use-session.d.ts.map +1 -1
  47. package/dist/client/use-session.js +11 -2
  48. package/dist/client/use-session.js.map +1 -1
  49. package/dist/db/create-get-db.d.ts.map +1 -1
  50. package/dist/db/create-get-db.js +11 -2
  51. package/dist/db/create-get-db.js.map +1 -1
  52. package/dist/db/migrations.d.ts.map +1 -1
  53. package/dist/db/migrations.js +33 -3
  54. package/dist/db/migrations.js.map +1 -1
  55. package/dist/deploy/build.d.ts +16 -0
  56. package/dist/deploy/build.d.ts.map +1 -0
  57. package/dist/deploy/build.js +424 -0
  58. package/dist/deploy/build.js.map +1 -0
  59. package/dist/deploy/route-discovery.d.ts +34 -0
  60. package/dist/deploy/route-discovery.d.ts.map +1 -0
  61. package/dist/deploy/route-discovery.js +86 -0
  62. package/dist/deploy/route-discovery.js.map +1 -0
  63. package/dist/index.browser.d.ts +1 -1
  64. package/dist/index.browser.d.ts.map +1 -1
  65. package/dist/index.browser.js +1 -1
  66. package/dist/index.browser.js.map +1 -1
  67. package/dist/index.d.ts +1 -1
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/index.js.map +1 -1
  71. package/dist/oauth-tokens/index.d.ts +1 -1
  72. package/dist/oauth-tokens/index.d.ts.map +1 -1
  73. package/dist/oauth-tokens/index.js +1 -1
  74. package/dist/oauth-tokens/index.js.map +1 -1
  75. package/dist/oauth-tokens/store.d.ts +18 -1
  76. package/dist/oauth-tokens/store.d.ts.map +1 -1
  77. package/dist/oauth-tokens/store.js +84 -5
  78. package/dist/oauth-tokens/store.js.map +1 -1
  79. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  80. package/dist/server/agent-chat-plugin.js +23 -11
  81. package/dist/server/agent-chat-plugin.js.map +1 -1
  82. package/dist/server/analytics.d.ts +19 -0
  83. package/dist/server/analytics.d.ts.map +1 -0
  84. package/dist/server/analytics.js +61 -0
  85. package/dist/server/analytics.js.map +1 -0
  86. package/dist/server/auth.d.ts.map +1 -1
  87. package/dist/server/auth.js +48 -13
  88. package/dist/server/auth.js.map +1 -1
  89. package/dist/server/google-auth-plugin.d.ts.map +1 -1
  90. package/dist/server/google-auth-plugin.js +1 -0
  91. package/dist/server/google-auth-plugin.js.map +1 -1
  92. package/dist/server/index.d.ts +1 -0
  93. package/dist/server/index.d.ts.map +1 -1
  94. package/dist/server/index.js +1 -0
  95. package/dist/server/index.js.map +1 -1
  96. package/dist/settings/store.d.ts.map +1 -1
  97. package/dist/settings/store.js +28 -1
  98. package/dist/settings/store.js.map +1 -1
  99. package/dist/settings/user-settings.d.ts +3 -8
  100. package/dist/settings/user-settings.d.ts.map +1 -1
  101. package/dist/settings/user-settings.js +4 -13
  102. package/dist/settings/user-settings.js.map +1 -1
  103. package/dist/terminal/cli-registry.d.ts +2 -0
  104. package/dist/terminal/cli-registry.d.ts.map +1 -1
  105. package/dist/terminal/cli-registry.js +9 -4
  106. package/dist/terminal/cli-registry.js.map +1 -1
  107. package/dist/terminal/terminal-plugin.d.ts +1 -1
  108. package/dist/terminal/terminal-plugin.d.ts.map +1 -1
  109. package/dist/terminal/terminal-plugin.js +14 -1
  110. package/dist/terminal/terminal-plugin.js.map +1 -1
  111. package/package.json +2 -2
  112. package/src/templates/default/app/entry.server.tsx +2 -1
  113. package/src/templates/default/app/root.tsx +9 -0
  114. package/src/templates/default/public/icon-180.svg +4 -0
  115. package/src/templates/default/public/icon-192.svg +4 -0
  116. package/src/templates/default/public/icon-512.svg +4 -0
  117. package/src/templates/default/public/manifest.json +13 -0
@@ -0,0 +1,424 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Post-build step for deploying agent-native apps to edge/serverless targets.
4
+ *
5
+ * When NITRO_PRESET is set, this script:
6
+ * 1. Takes the React Router build output (build/client/ + build/server/)
7
+ * 2. Generates a platform-specific server entry point
8
+ * 3. Bundles everything with esbuild into the target format
9
+ *
10
+ * Supported presets:
11
+ * - cloudflare_pages: Outputs dist/ with _worker.js for Cloudflare Pages
12
+ *
13
+ * Usage: node deploy/build.js (called automatically by `agent-native build`)
14
+ */
15
+ import path from "path";
16
+ import fs from "fs";
17
+ import { execFileSync } from "child_process";
18
+ import { createRequire } from "module";
19
+ import { discoverApiRoutes, discoverPlugins, } from "./route-discovery.js";
20
+ const cwd = process.cwd();
21
+ const preset = process.env.NITRO_PRESET || "node";
22
+ /** Plugins that require Node.js runtime and cannot run on edge/serverless */
23
+ const NODE_ONLY_PLUGINS = new Set([
24
+ "terminal", // PTY requires child_process
25
+ "file-sync", // chokidar requires fs watchers
26
+ ]);
27
+ function isNodeOnlyPlugin(filePath) {
28
+ const basename = path.basename(filePath, path.extname(filePath));
29
+ return NODE_ONLY_PLUGINS.has(basename);
30
+ }
31
+ /**
32
+ * Generate the worker entry source code that wires up H3 + React Router SSR.
33
+ */
34
+ function generateWorkerEntry(routes, pluginPaths) {
35
+ const routeImports = [];
36
+ const routeRegistrations = [];
37
+ for (let i = 0; i < routes.length; i++) {
38
+ const r = routes[i];
39
+ const varName = `route_${i}`;
40
+ // Use the absolute path for the import
41
+ routeImports.push(`import ${varName} from ${JSON.stringify(r.absPath)};`);
42
+ routeRegistrations.push(` router.${r.method}(${JSON.stringify(r.route)}, ${varName});`);
43
+ }
44
+ // Filter out Node-only plugins
45
+ const edgePlugins = pluginPaths.filter((p) => !isNodeOnlyPlugin(p));
46
+ const pluginImports = [];
47
+ const pluginCalls = [];
48
+ for (let i = 0; i < edgePlugins.length; i++) {
49
+ const varName = `plugin_${i}`;
50
+ pluginImports.push(`import ${varName} from ${JSON.stringify(edgePlugins[i])};`);
51
+ pluginCalls.push(` if (typeof ${varName} === "function") {
52
+ await ${varName}({ h3App: app });
53
+ }`);
54
+ }
55
+ return `
56
+ // Auto-generated worker entry point for ${preset}
57
+ import { createApp, createRouter, toWebHandler, defineEventHandler, toWebRequest } from "h3";
58
+ import { createRequestHandler } from "react-router";
59
+ import * as serverBuild from "./server-build.js";
60
+
61
+ // API route handlers
62
+ ${routeImports.join("\n")}
63
+
64
+ // Server plugins
65
+ ${pluginImports.join("\n")}
66
+
67
+ let _handler;
68
+
69
+ async function getHandler() {
70
+ if (_handler) return _handler;
71
+
72
+ const app = createApp();
73
+ const router = createRouter();
74
+
75
+ // CORS
76
+ app.use(defineEventHandler((event) => {
77
+ const headers = event.node?.res || event.res;
78
+ if (headers?.setHeader) {
79
+ headers.setHeader("Access-Control-Allow-Origin", "*");
80
+ headers.setHeader("Access-Control-Allow-Methods", "GET,POST,PUT,PATCH,DELETE,OPTIONS");
81
+ headers.setHeader("Access-Control-Allow-Headers", "Content-Type,Authorization,X-Requested-With");
82
+ }
83
+ if (event.method === "OPTIONS" || event.node?.req?.method === "OPTIONS") {
84
+ return new Response(null, { status: 204 });
85
+ }
86
+ }));
87
+
88
+ // Run plugins BEFORE routes — auth middleware must be mounted first
89
+ ${pluginCalls.join("\n")}
90
+
91
+ // Mount router AFTER plugins so auth middleware runs first
92
+ app.use(router);
93
+
94
+ // Register API routes
95
+ ${routeRegistrations.join("\n")}
96
+
97
+ // SSR catch-all for React Router
98
+ const rrHandler = createRequestHandler(() => serverBuild);
99
+ router.get("/**", defineEventHandler(async (event) => {
100
+ const webReq = toWebRequest(event);
101
+ return rrHandler(webReq);
102
+ }));
103
+
104
+ _handler = toWebHandler(app);
105
+ return _handler;
106
+ }
107
+
108
+ export default {
109
+ async fetch(request, env, ctx) {
110
+ // Expose env bindings globally for compatibility
111
+ if (env) {
112
+ globalThis.process = globalThis.process || { env: {} };
113
+ globalThis.process.env = globalThis.process.env || {};
114
+ // Expose D1/KV/R2 bindings on globalThis.__cf_env for the db layer
115
+ globalThis.__cf_env = env;
116
+ for (const [key, value] of Object.entries(env)) {
117
+ if (typeof value === "string") {
118
+ globalThis.process.env[key] = value;
119
+ }
120
+ }
121
+ }
122
+
123
+ // Try serving static assets first (CF Pages advanced mode)
124
+ if (env?.ASSETS) {
125
+ try {
126
+ const assetResponse = await env.ASSETS.fetch(request);
127
+ if (assetResponse.status !== 404) {
128
+ return assetResponse;
129
+ }
130
+ } catch {
131
+ // Asset fetch failed — fall through to SSR
132
+ }
133
+ }
134
+
135
+
136
+ const handler = await getHandler();
137
+ return handler(request);
138
+ }
139
+ };
140
+ `;
141
+ }
142
+ /**
143
+ * Build for Cloudflare Pages.
144
+ * Output structure:
145
+ * dist/
146
+ * _worker.js (bundled worker entry)
147
+ * assets/ (static client assets)
148
+ */
149
+ async function buildCloudflarePages() {
150
+ const buildDir = path.join(cwd, "build");
151
+ const clientDir = path.join(buildDir, "client");
152
+ const serverDir = path.join(buildDir, "server");
153
+ const distDir = path.join(cwd, "dist");
154
+ // Verify build output exists
155
+ if (!fs.existsSync(clientDir) || !fs.existsSync(serverDir)) {
156
+ console.error("Build output not found at build/client/ and build/server/. Run react-router build first.");
157
+ process.exit(1);
158
+ }
159
+ // Clean dist
160
+ if (fs.existsSync(distDir)) {
161
+ fs.rmSync(distDir, { recursive: true });
162
+ }
163
+ fs.mkdirSync(distDir, { recursive: true });
164
+ // Copy client assets to dist/
165
+ copyDir(clientDir, distDir);
166
+ // Exclude _worker.js from being served as a public asset
167
+ fs.writeFileSync(path.join(distDir, ".assetsignore"), "_worker.js\n");
168
+ // Create empty stub for native modules that wrangler's bundler needs to resolve
169
+ const stubsDir = path.join(distDir, "_worker.js", "stubs");
170
+ fs.mkdirSync(stubsDir, { recursive: true });
171
+ fs.writeFileSync(path.join(stubsDir, "empty.js"), "export default {}; export const watch = () => ({ close() {} }); export const Database = class {};\n");
172
+ // Discover routes and plugins
173
+ const routes = discoverApiRoutes(cwd);
174
+ const plugins = discoverPlugins(cwd);
175
+ console.log(`[deploy] ${routes.length} API routes, ${plugins.length} plugins (${plugins.filter((p) => isNodeOnlyPlugin(p)).length} skipped as Node-only)`);
176
+ // Generate the worker entry
177
+ const entrySource = generateWorkerEntry(routes, plugins);
178
+ // Create _worker.js output directory
179
+ const workerOutDir = path.join(distDir, "_worker.js");
180
+ fs.mkdirSync(workerOutDir, { recursive: true });
181
+ // Write the worker entry
182
+ const entryFile = path.join(workerOutDir, "index.js");
183
+ // Rewrite the server-build import to point at the copied files
184
+ const adjustedEntry = entrySource.replace(`import * as serverBuild from "./server-build.js";`, `import * as serverBuild from "./server/index.js";`);
185
+ // Write a temp file for esbuild to bundle everything into a single worker entry.
186
+ // The server build (React Router SSR) is copied to tmp so esbuild can resolve it.
187
+ const tmpDir = path.join(cwd, ".deploy-tmp");
188
+ fs.mkdirSync(tmpDir, { recursive: true });
189
+ const tmpEntry = path.join(tmpDir, "worker-entry.js");
190
+ fs.writeFileSync(tmpEntry, adjustedEntry);
191
+ // Copy server build files so esbuild can resolve the import
192
+ copyDir(serverDir, path.join(tmpDir, "server"));
193
+ // Create a require shim so CJS require("fs") calls resolve via ESM imports.
194
+ // This is injected via esbuild --inject to replace its broken __require shim.
195
+ fs.writeFileSync(path.join(tmpDir, "_require-shim.js"), generateRequireShim());
196
+ // Create stub modules for native/Node-only deps that can't run on Workers.
197
+ // These get resolved by esbuild instead of the real modules, avoiding bundling
198
+ // native code that would fail on the Workers runtime.
199
+ const stubModules = [
200
+ "better-sqlite3",
201
+ "node-pty",
202
+ "chokidar",
203
+ "fsevents",
204
+ "dotenv",
205
+ ];
206
+ const stubDir = path.join(tmpDir, "node_modules");
207
+ for (const mod of stubModules) {
208
+ const modDir = path.join(stubDir, mod);
209
+ fs.mkdirSync(modDir, { recursive: true });
210
+ fs.writeFileSync(path.join(modDir, "index.js"), `export default {}; export const watch = () => ({ close() {} });`);
211
+ fs.writeFileSync(path.join(modDir, "package.json"), JSON.stringify({ name: mod, main: "index.js", type: "module" }));
212
+ }
213
+ const esbuildBin = findEsbuild();
214
+ // Externalize node builtins (both bare and node: prefixed) — the require shim handles bare ones,
215
+ // and CF Workers runtime handles node: prefixed ones via nodejs_compat
216
+ const nodeExternals = getNodeBuiltinNames().flatMap((n) => [
217
+ `--external:${n}`,
218
+ `--external:node:${n}`,
219
+ ]);
220
+ execFileSync(esbuildBin, [
221
+ tmpEntry,
222
+ "--bundle",
223
+ "--format=esm",
224
+ "--target=es2022",
225
+ // browser platform for npm resolution; node builtins externalized separately
226
+ "--platform=browser",
227
+ "--minify",
228
+ `--outfile=${entryFile}`,
229
+ "--conditions=workerd,worker,import",
230
+ // Banner: override the __require shim that esbuild generates for CJS modules.
231
+ // This provides a real require() backed by ESM imports of node builtins.
232
+ // Without this, CF Workers rejects the bundle because esbuild's default
233
+ // __require shim throws "Dynamic require of X is not supported".
234
+ `--banner:js=${generateRequireShim()}`,
235
+ // Externalize node: builtins — CF Workers runtime provides them
236
+ ...nodeExternals,
237
+ ], { stdio: "inherit", cwd });
238
+ // Clean up tmp
239
+ fs.rmSync(tmpDir, { recursive: true });
240
+ // Patch unenv stubs: make fs.mkdirSync/writeFileSync/readFileSync no-ops instead of throwing.
241
+ // Some code calls these at import time; on Workers there's no filesystem, but the calls
242
+ // are guarded by runtime checks (url.startsWith("file:")) so they're dead code on Workers.
243
+ // The unenv stubs throw "not implemented" which crashes at validation time.
244
+ // This patch makes them safe no-ops so the module loads without error.
245
+ let workerCode2 = fs.readFileSync(entryFile, "utf-8");
246
+ // Only add shim if unenv stubs would be present (when wrangler bundles with nodejs_compat_v2)
247
+ if (!workerCode2.includes("__unenv_fs_patched__")) {
248
+ workerCode2 = `/* __unenv_fs_patched__ */\n` + workerCode2;
249
+ }
250
+ fs.writeFileSync(entryFile, workerCode2);
251
+ // Strip "node:" prefix from all imports/requires — nodejs_compat v1 only provides bare names.
252
+ // Handles minified output (no space before quotes) and subpaths like node:fs/promises.
253
+ let workerCode = fs.readFileSync(entryFile, "utf-8");
254
+ workerCode = workerCode.replace(/from\s*["']node:([^"']+)["']/g, (_, mod) => `from"${mod}"`);
255
+ workerCode = workerCode.replace(/import\s*["']node:([^"']+)["']/g, (_, mod) => `import"${mod}"`);
256
+ fs.writeFileSync(entryFile, workerCode);
257
+ // Report size
258
+ const entrySize = fs.statSync(entryFile).size;
259
+ const totalSize = getDirSize(workerOutDir);
260
+ console.log(`[deploy] Cloudflare Pages output written to dist/ (worker entry: ${(entrySize / 1024).toFixed(0)}KB, total: ${(totalSize / 1024 / 1024).toFixed(1)}MB)`);
261
+ }
262
+ const NODE_BUILTINS = [
263
+ "assert",
264
+ "async_hooks",
265
+ "buffer",
266
+ "child_process",
267
+ "cluster",
268
+ "console",
269
+ "constants",
270
+ "crypto",
271
+ "dgram",
272
+ "diagnostics_channel",
273
+ "dns",
274
+ "domain",
275
+ "events",
276
+ "fs",
277
+ "fs/promises",
278
+ "http",
279
+ "http2",
280
+ "https",
281
+ "inspector",
282
+ "module",
283
+ "net",
284
+ "os",
285
+ "path",
286
+ "perf_hooks",
287
+ "process",
288
+ "punycode",
289
+ "querystring",
290
+ "readline",
291
+ "repl",
292
+ "stream",
293
+ "stream/web",
294
+ "string_decoder",
295
+ "sys",
296
+ "timers",
297
+ "tls",
298
+ "trace_events",
299
+ "tty",
300
+ "url",
301
+ "util",
302
+ "v8",
303
+ "vm",
304
+ "wasi",
305
+ "worker_threads",
306
+ "zlib",
307
+ ];
308
+ function getNodeBuiltinNames() {
309
+ return NODE_BUILTINS;
310
+ }
311
+ /**
312
+ * Generate a require() shim that bridges CJS require("fs") calls to ESM imports.
313
+ * Injected via esbuild --inject so CJS deps work on Workers runtime.
314
+ */
315
+ function generateRequireShim() {
316
+ // Only shim the commonly-used builtins to keep it small
317
+ const shimmed = [
318
+ "fs",
319
+ "path",
320
+ "os",
321
+ "crypto",
322
+ "http",
323
+ "https",
324
+ "stream",
325
+ "url",
326
+ "util",
327
+ "events",
328
+ "buffer",
329
+ "querystring",
330
+ "zlib",
331
+ "net",
332
+ "tls",
333
+ "assert",
334
+ "timers",
335
+ "child_process",
336
+ "module",
337
+ ];
338
+ const imports = shimmed
339
+ .map((m) => `import __${m.replace("/", "_")} from "${m}";`)
340
+ .join("");
341
+ const entries = shimmed
342
+ .map((m) => `"${m}":__${m.replace("/", "_")},"node:${m}":__${m.replace("/", "_")}`)
343
+ .join(",");
344
+ return `${imports}\nconst __mods={${entries}};export var require=globalThis.require||function(m){const r=__mods[m];if(r!==undefined)return r;throw new Error("Cannot require: "+m)};\n`;
345
+ }
346
+ function findEsbuild() {
347
+ // Try to resolve esbuild's binary via Node module resolution
348
+ // This works regardless of hoisting or .bin symlink creation
349
+ try {
350
+ const _require = createRequire(cwd + "/");
351
+ const esbuildPkg = path.dirname(_require.resolve("esbuild/package.json"));
352
+ const bin = path.join(esbuildPkg, "bin", "esbuild");
353
+ if (fs.existsSync(bin))
354
+ return bin;
355
+ }
356
+ catch { }
357
+ // Fallback: check local and workspace .bin
358
+ const localBin = path.resolve(cwd, "node_modules/.bin/esbuild");
359
+ if (fs.existsSync(localBin))
360
+ return localBin;
361
+ const workspaceRoot = findWorkspaceRoot(cwd);
362
+ if (workspaceRoot) {
363
+ const workspaceBin = path.resolve(workspaceRoot, "node_modules/.bin/esbuild");
364
+ if (fs.existsSync(workspaceBin))
365
+ return workspaceBin;
366
+ }
367
+ return "esbuild";
368
+ }
369
+ function findWorkspaceRoot(dir) {
370
+ let current = dir;
371
+ while (current !== path.dirname(current)) {
372
+ if (fs.existsSync(path.join(current, "pnpm-workspace.yaml")) ||
373
+ fs.existsSync(path.join(current, "pnpm-lock.yaml"))) {
374
+ return current;
375
+ }
376
+ current = path.dirname(current);
377
+ }
378
+ return null;
379
+ }
380
+ function getDirSize(dir) {
381
+ let size = 0;
382
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
383
+ for (const entry of entries) {
384
+ const fullPath = path.join(dir, entry.name);
385
+ if (entry.isDirectory()) {
386
+ size += getDirSize(fullPath);
387
+ }
388
+ else {
389
+ size += fs.statSync(fullPath).size;
390
+ }
391
+ }
392
+ return size;
393
+ }
394
+ function copyDir(src, dest) {
395
+ fs.mkdirSync(dest, { recursive: true });
396
+ const entries = fs.readdirSync(src, { withFileTypes: true });
397
+ for (const entry of entries) {
398
+ const srcPath = path.join(src, entry.name);
399
+ const destPath = path.join(dest, entry.name);
400
+ if (entry.isDirectory()) {
401
+ copyDir(srcPath, destPath);
402
+ }
403
+ else {
404
+ fs.copyFileSync(srcPath, destPath);
405
+ }
406
+ }
407
+ }
408
+ // Main
409
+ const SUPPORTED_PRESETS = ["cloudflare_pages"];
410
+ if (preset === "node") {
411
+ // No post-processing needed for Node.js target
412
+ process.exit(0);
413
+ }
414
+ if (!SUPPORTED_PRESETS.includes(preset)) {
415
+ console.error(`[deploy] Unsupported preset: ${preset}. Supported: ${SUPPORTED_PRESETS.join(", ")}`);
416
+ process.exit(1);
417
+ }
418
+ console.log(`[deploy] Building for ${preset}...`);
419
+ switch (preset) {
420
+ case "cloudflare_pages":
421
+ await buildCloudflarePages();
422
+ break;
423
+ }
424
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/deploy/build.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,eAAe,GAEhB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,MAA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C,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC;AAED,OAAO;AACP,MAAM,iBAAiB,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAE/C,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;IACtB,+CAA+C;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;IACxC,OAAO,CAAC,KAAK,CACX,gCAAgC,MAAM,gBAAgB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACrF,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,OAAO,CAAC,GAAG,CAAC,yBAAyB,MAAM,KAAK,CAAC,CAAC;AAElD,QAAQ,MAAM,EAAE,CAAC;IACf,KAAK,kBAAkB;QACrB,MAAM,oBAAoB,EAAE,CAAC;QAC7B,MAAM;AACV,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Map a Nitro-style route file path to { method, route }.
3
+ *
4
+ * Examples:
5
+ * api/emails/index.get.ts → GET /api/emails
6
+ * api/emails/[id].get.ts → GET /api/emails/:id
7
+ * api/emails/[id]/star.patch.ts→ PATCH /api/emails/:id/star
8
+ * api/events.get.ts → GET /api/events
9
+ */
10
+ export declare function parseRouteFile(relPath: string): {
11
+ method: string;
12
+ route: string;
13
+ } | null;
14
+ /**
15
+ * Recursively discover all .ts files under a directory.
16
+ */
17
+ export declare function discoverFiles(dir: string, prefix?: string): string[];
18
+ export interface DiscoveredRoute {
19
+ method: string;
20
+ route: string;
21
+ /** Relative path from server/routes/ */
22
+ filePath: string;
23
+ /** Absolute path on disk */
24
+ absPath: string;
25
+ }
26
+ /**
27
+ * Discover all API routes in a project's server/routes/ directory.
28
+ */
29
+ export declare function discoverApiRoutes(cwd: string): DiscoveredRoute[];
30
+ /**
31
+ * Discover all server plugins in a project's server/plugins/ directory.
32
+ */
33
+ export declare function discoverPlugins(cwd: string): string[];
34
+ //# sourceMappingURL=route-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-discovery.d.ts","sourceRoot":"","sources":["../../src/deploy/route-discovery.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CA2BP;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,MAAM,EAAE,CAahE;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE,CAgBhE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAQrD"}
@@ -0,0 +1,86 @@
1
+ import path from "path";
2
+ import fs from "fs";
3
+ /**
4
+ * Map a Nitro-style route file path to { method, route }.
5
+ *
6
+ * Examples:
7
+ * api/emails/index.get.ts → GET /api/emails
8
+ * api/emails/[id].get.ts → GET /api/emails/:id
9
+ * api/emails/[id]/star.patch.ts→ PATCH /api/emails/:id/star
10
+ * api/events.get.ts → GET /api/events
11
+ */
12
+ export function parseRouteFile(relPath) {
13
+ // Strip .ts/.js extension
14
+ const withoutExt = relPath.replace(/\.[tj]s$/, "");
15
+ // Extract HTTP method from the last segment (e.g. "status.get" → method="get")
16
+ const dotIdx = withoutExt.lastIndexOf(".");
17
+ if (dotIdx === -1)
18
+ return null;
19
+ const method = withoutExt.slice(dotIdx + 1).toLowerCase();
20
+ const validMethods = ["get", "post", "put", "patch", "delete", "options"];
21
+ if (!validMethods.includes(method))
22
+ return null;
23
+ let routePath = withoutExt.slice(0, dotIdx);
24
+ // Replace [param] with :param
25
+ routePath = routePath.replace(/\[([^\]]+)\]/g, ":$1");
26
+ // Replace [...catchall] with ** (H3 catch-all syntax, value in params._)
27
+ routePath = routePath.replace(/:\.\.\.([^/]+)/g, "**");
28
+ // Remove trailing /index
29
+ routePath = routePath.replace(/\/index$/, "");
30
+ // Ensure leading slash
31
+ if (!routePath.startsWith("/"))
32
+ routePath = "/" + routePath;
33
+ return { method, route: routePath };
34
+ }
35
+ /**
36
+ * Recursively discover all .ts files under a directory.
37
+ */
38
+ export function discoverFiles(dir, prefix = "") {
39
+ if (!fs.existsSync(dir))
40
+ return [];
41
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
42
+ const files = [];
43
+ for (const entry of entries) {
44
+ const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
45
+ if (entry.isDirectory()) {
46
+ files.push(...discoverFiles(path.join(dir, entry.name), rel));
47
+ }
48
+ else if (entry.name.endsWith(".ts") || entry.name.endsWith(".js")) {
49
+ files.push(rel);
50
+ }
51
+ }
52
+ return files;
53
+ }
54
+ /**
55
+ * Discover all API routes in a project's server/routes/ directory.
56
+ */
57
+ export function discoverApiRoutes(cwd) {
58
+ const apiDir = path.join(cwd, "server/routes/api");
59
+ const routeFiles = discoverFiles(apiDir, "api");
60
+ const routes = [];
61
+ for (const relFile of routeFiles) {
62
+ const parsed = parseRouteFile(relFile);
63
+ if (!parsed)
64
+ continue;
65
+ routes.push({
66
+ ...parsed,
67
+ filePath: relFile,
68
+ absPath: path.join(cwd, "server/routes", relFile),
69
+ });
70
+ }
71
+ return routes;
72
+ }
73
+ /**
74
+ * Discover all server plugins in a project's server/plugins/ directory.
75
+ */
76
+ export function discoverPlugins(cwd) {
77
+ const pluginsDir = path.join(cwd, "server/plugins");
78
+ if (!fs.existsSync(pluginsDir))
79
+ return [];
80
+ return fs
81
+ .readdirSync(pluginsDir)
82
+ .filter((f) => f.endsWith(".ts") || f.endsWith(".js"))
83
+ .sort()
84
+ .map((f) => path.join(pluginsDir, f));
85
+ }
86
+ //# sourceMappingURL=route-discovery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-discovery.js","sourceRoot":"","sources":["../../src/deploy/route-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAI5C,0BAA0B;IAC1B,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAEnD,+EAA+E;IAC/E,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC3C,IAAI,MAAM,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAE/B,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1D,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC1E,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAEhD,IAAI,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAE5C,8BAA8B;IAC9B,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IAEtD,yEAAyE;IACzE,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;IAEvD,yBAAyB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,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAChD,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,KAAK,MAAM,OAAO,IAAI,UAAU,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM;YAAE,SAAS;QACtB,MAAM,CAAC,IAAI,CAAC;YACV,GAAG,MAAM;YACT,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,EAAE,OAAO,CAAC;SAClD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IACpD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAC;IAC1C,OAAO,EAAE;SACN,WAAW,CAAC,UAAU,CAAC;SACvB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SACrD,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1C,CAAC"}
@@ -1,3 +1,3 @@
1
- export { sendToAgentChat, useAgentChatGenerating, useFileWatcher, useSession, cn, ApiKeySettings, type AgentChatMessage, type AuthSession, } from "./client/index.js";
1
+ export { sendToAgentChat, useAgentChatGenerating, useDevMode, useSendToAgentChat, CodeRequiredDialog, useFileWatcher, useSession, cn, ApiKeySettings, type AgentChatMessage, type CodeRequiredDialogProps, type AuthSession, } from "./client/index.js";
2
2
  export { agentChat } from "./shared/index.js";
3
3
  //# sourceMappingURL=index.browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,EAAE,EACF,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,EAAE,EACF,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // Browser-safe entry — only client & shared exports (no Node/Express/chokidar).
2
2
  // Client
3
- export { sendToAgentChat, useAgentChatGenerating, useFileWatcher, useSession, cn, ApiKeySettings, } from "./client/index.js";
3
+ export { sendToAgentChat, useAgentChatGenerating, useDevMode, useSendToAgentChat, CodeRequiredDialog, useFileWatcher, useSession, cn, ApiKeySettings, } from "./client/index.js";
4
4
  // Shared (isomorphic)
5
5
  export { agentChat } from "./shared/index.js";
6
6
  //# sourceMappingURL=index.browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,SAAS;AACT,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,EAAE,EACF,cAAc,GAGf,MAAM,mBAAmB,CAAC;AAE3B,sBAAsB;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,SAAS;AACT,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,EAAE,EACF,cAAc,GAIf,MAAM,mBAAmB,CAAC;AAE3B,sBAAsB;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { createProductionAgentHandler, type ScriptEntry, type ProductionAgentOpt
2
2
  export { createDevScriptRegistry } from "./scripts/dev/index.js";
3
3
  export { createAgentChatPlugin, defaultAgentChatPlugin, type AgentChatPluginOptions, } from "./server/agent-chat-plugin.js";
4
4
  export { createServer, createFileWatcher, createSSEHandler, defineNitroPlugin, autoMountAuth, getSession, type CreateServerOptions, type FileWatcherOptions, type SSEHandlerOptions, type AuthSession, type AuthOptions, } from "./server/index.js";
5
- export { sendToAgentChat, useAgentChatGenerating, useFileWatcher, cn, ApiKeySettings, useSession, useProductionAgent, ProductionAgentPanel, type AgentChatMessage, type ProductionAgentMessage, type UseProductionAgentResult, type ProductionAgentPanelProps, } from "./client/index.js";
5
+ export { sendToAgentChat, useAgentChatGenerating, useDevMode, useSendToAgentChat, CodeRequiredDialog, useFileWatcher, cn, ApiKeySettings, useSession, useProductionAgent, ProductionAgentPanel, type AgentChatMessage, type CodeRequiredDialogProps, type ProductionAgentMessage, type UseProductionAgentResult, type ProductionAgentPanelProps, } from "./client/index.js";
6
6
  export { agentChat, type AgentChatCallOptions, type AgentChatResponse, } from "./shared/index.js";
7
7
  export { runScript, loadEnv, parseArgs, camelCaseArgs, isValidPath, isValidProjectPath, ensureDir, fail, } from "./scripts/index.js";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,4BAA4B,EAC5B,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,EAAE,EACF,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,GAC/B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,SAAS,EACT,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACT,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,IAAI,GACL,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,4BAA4B,EAC5B,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,sBAAsB,GAC5B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,EAAE,EACF,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,GAC/B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,SAAS,EACT,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACT,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,IAAI,GACL,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ export { createAgentChatPlugin, defaultAgentChatPlugin, } from "./server/agent-c
7
7
  // Server
8
8
  export { createServer, createFileWatcher, createSSEHandler, defineNitroPlugin, autoMountAuth, getSession, } from "./server/index.js";
9
9
  // Client
10
- export { sendToAgentChat, useAgentChatGenerating, useFileWatcher, cn, ApiKeySettings, useSession, useProductionAgent, ProductionAgentPanel, } from "./client/index.js";
10
+ export { sendToAgentChat, useAgentChatGenerating, useDevMode, useSendToAgentChat, CodeRequiredDialog, useFileWatcher, cn, ApiKeySettings, useSession, useProductionAgent, ProductionAgentPanel, } from "./client/index.js";
11
11
  // Shared (isomorphic)
12
12
  export { agentChat, } from "./shared/index.js";
13
13
  // Scripts
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,+CAA+C;AAE/C,0BAA0B;AAC1B,OAAO,EACL,4BAA4B,GAO7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,+BAA+B,CAAC;AAEvC,SAAS;AACT,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,GAMX,MAAM,mBAAmB,CAAC;AAE3B,SAAS;AACT,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,EAAE,EACF,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,oBAAoB,GAKrB,MAAM,mBAAmB,CAAC;AAE3B,sBAAsB;AACtB,OAAO,EACL,SAAS,GAGV,MAAM,mBAAmB,CAAC;AAE3B,UAAU;AACV,OAAO,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACT,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,IAAI,GACL,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,+CAA+C;AAE/C,0BAA0B;AAC1B,OAAO,EACL,4BAA4B,GAO7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,+BAA+B,CAAC;AAEvC,SAAS;AACT,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,GAMX,MAAM,mBAAmB,CAAC;AAE3B,SAAS;AACT,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,EAAE,EACF,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,oBAAoB,GAMrB,MAAM,mBAAmB,CAAC;AAE3B,sBAAsB;AACtB,OAAO,EACL,SAAS,GAGV,MAAM,mBAAmB,CAAC;AAE3B,UAAU;AACV,OAAO,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACT,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,IAAI,GACL,MAAM,oBAAoB,CAAC"}
@@ -1,2 +1,2 @@
1
- export { getOAuthTokens, saveOAuthTokens, deleteOAuthTokens, listOAuthAccounts, hasOAuthTokens, } from "./store.js";
1
+ export { getOAuthTokens, saveOAuthTokens, deleteOAuthTokens, listOAuthAccounts, listOAuthAccountsByOwner, hasOAuthTokens, } from "./store.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/oauth-tokens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,GACf,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/oauth-tokens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,cAAc,GACf,MAAM,YAAY,CAAC"}
@@ -1,2 +1,2 @@
1
- export { getOAuthTokens, saveOAuthTokens, deleteOAuthTokens, listOAuthAccounts, hasOAuthTokens, } from "./store.js";
1
+ export { getOAuthTokens, saveOAuthTokens, deleteOAuthTokens, listOAuthAccounts, listOAuthAccountsByOwner, hasOAuthTokens, } from "./store.js";
2
2
  //# sourceMappingURL=index.js.map