sparkecoder 0.1.17 → 0.1.19
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/README.md +1 -1
- package/dist/agent/index.d.ts +3 -3
- package/dist/{bash-CGAqW7HR.d.ts → bash-C43A-o5X.d.ts} +4 -4
- package/dist/cli.js +24 -7
- package/dist/cli.js.map +1 -1
- package/dist/db/index.d.ts +1 -1
- package/dist/{index-BzedNBK-.d.ts → index-H2ecHywx.d.ts} +6 -6
- package/dist/index.d.ts +5 -5
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/{schema-CkrIadxa.d.ts → schema-J6qYlHtl.d.ts} +3 -3
- package/dist/server/index.js +18 -3
- package/dist/server/index.js.map +1 -1
- package/dist/tools/index.d.ts +3 -3
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/build-manifest.json +2 -2
- package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/web/.next/server/app/(main)/page.js +3 -3
- package/web/.next/standalone/web/.next/server/app/(main)/page.js.nft.json +1 -1
- package/web/.next/standalone/web/.next/server/app/(main)/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page.js +3 -3
- package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error/page.js +2 -2
- package/web/.next/standalone/web/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found/page.js +3 -3
- package/web/.next/standalone/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.rsc +13 -12
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +13 -12
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +4 -3
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/api/config/route.js +1 -1
- package/web/.next/standalone/web/.next/server/app/api/config/route.js.nft.json +1 -1
- package/web/.next/standalone/web/.next/server/app/api/health/route.js +1 -1
- package/web/.next/standalone/web/.next/server/app/api/health/route.js.nft.json +1 -1
- package/web/.next/standalone/web/.next/server/app/index.html +1 -1
- package/web/.next/standalone/web/.next/server/app/index.rsc +20 -19
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +20 -19
- package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +4 -3
- package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__36edac7c._.js +3 -0
- package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__74ebc442._.js +3 -0
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_1b669458._.js → 2374f_1d78db71._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_10a13bff._.js → 2374f_30f9df13._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_42ae2ff5._.js → 2374f_378282b1._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_21324e82._.js → 2374f_5de336d2._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_ba57e34a._.js → 2374f_8825dcc9._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_47e888fe._.js → 2374f_9bf3c7f3._.js} +2 -2
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_63823b79._.js → 2374f_bbc99511._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_9c15fcde._.js → 2374f_d94c2b70._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__0f6b5fa7._.js +3 -0
- package/web/.next/standalone/web/.next/server/chunks/ssr/{[root-of-the-server]__e1f2996b._.js → [root-of-the-server]__513c6b45._.js} +2 -2
- package/web/.next/standalone/web/.next/server/chunks/ssr/{[root-of-the-server]__da40fb08._.js → [root-of-the-server]__7f04455b._.js} +2 -2
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__be5e2967._.js +3 -0
- package/web/.next/standalone/web/.next/server/chunks/ssr/{[root-of-the-server]__10aab2ca._.js → [root-of-the-server]__c3a1e22c._.js} +2 -2
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__d2ce4b79._.js +3 -0
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__de58a952._.js +3 -0
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__f18f92f4._.js +10 -0
- package/web/.next/standalone/web/.next/server/chunks/ssr/{web_d3c9d897._.js → web_19b6934c._.js} +2 -2
- package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
- package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/standalone/web/.next/static/chunks/2110d26bc24ed542.js +1 -0
- package/web/.next/{static/chunks/c7e9604ccdb5cb09.js → standalone/web/.next/static/chunks/5ec82ce8f3aabaf0.js} +3 -3
- package/web/.next/standalone/web/.next/static/static/chunks/2110d26bc24ed542.js +1 -0
- package/web/.next/standalone/web/.next/static/{chunks/c7e9604ccdb5cb09.js → static/chunks/5ec82ce8f3aabaf0.js} +3 -3
- package/web/.next/standalone/web/README.md +63 -0
- package/web/.next/standalone/web/components.json +22 -0
- package/web/.next/standalone/web/eslint.config.mjs +18 -0
- package/web/.next/standalone/web/next.config.ts +9 -0
- package/web/.next/standalone/web/package-lock.json +15061 -0
- package/web/.next/standalone/web/postcss.config.mjs +7 -0
- package/web/.next/standalone/web/runtime-config.json +3 -0
- package/web/.next/standalone/web/src/app/(main)/layout.tsx +22 -0
- package/web/.next/standalone/web/src/app/(main)/page.tsx +230 -0
- package/web/.next/standalone/web/src/app/(main)/session/[id]/page.tsx +64 -0
- package/web/.next/standalone/web/src/app/api/config/route.ts +106 -0
- package/web/.next/standalone/web/src/app/api/health/route.ts +63 -0
- package/web/.next/standalone/web/src/app/apple-icon.png +0 -0
- package/web/.next/standalone/web/src/app/favicon.ico +0 -0
- package/web/.next/standalone/web/src/app/globals.css +311 -0
- package/web/.next/standalone/web/src/app/icon.png +0 -0
- package/web/.next/standalone/web/src/app/layout.tsx +100 -0
- package/web/.next/standalone/web/src/app/opengraph-image.png +0 -0
- package/web/.next/standalone/web/src/app/twitter-image.png +0 -0
- package/web/.next/standalone/web/src/components/ai-elements/agent.tsx +141 -0
- package/web/.next/standalone/web/src/components/ai-elements/artifact.tsx +147 -0
- package/web/.next/standalone/web/src/components/ai-elements/attachments.tsx +421 -0
- package/web/.next/standalone/web/src/components/ai-elements/audio-player.tsx +231 -0
- package/web/.next/standalone/web/src/components/ai-elements/bash-tool.tsx +299 -0
- package/web/.next/standalone/web/src/components/ai-elements/canvas.tsx +22 -0
- package/web/.next/standalone/web/src/components/ai-elements/chain-of-thought.tsx +231 -0
- package/web/.next/standalone/web/src/components/ai-elements/checkpoint.tsx +71 -0
- package/web/.next/standalone/web/src/components/ai-elements/code-block.tsx +529 -0
- package/web/.next/standalone/web/src/components/ai-elements/commit.tsx +448 -0
- package/web/.next/standalone/web/src/components/ai-elements/confirmation.tsx +176 -0
- package/web/.next/standalone/web/src/components/ai-elements/connection.tsx +28 -0
- package/web/.next/standalone/web/src/components/ai-elements/context.tsx +408 -0
- package/web/.next/standalone/web/src/components/ai-elements/controls.tsx +18 -0
- package/web/.next/standalone/web/src/components/ai-elements/conversation.tsx +104 -0
- package/web/.next/standalone/web/src/components/ai-elements/edge.tsx +140 -0
- package/web/.next/standalone/web/src/components/ai-elements/environment-variables.tsx +295 -0
- package/web/.next/standalone/web/src/components/ai-elements/file-tree.tsx +258 -0
- package/web/.next/standalone/web/src/components/ai-elements/image.tsx +24 -0
- package/web/.next/standalone/web/src/components/ai-elements/inline-citation.tsx +287 -0
- package/web/.next/standalone/web/src/components/ai-elements/linter-tool.tsx +330 -0
- package/web/.next/standalone/web/src/components/ai-elements/load-skill-tool.tsx +215 -0
- package/web/.next/standalone/web/src/components/ai-elements/loader.tsx +96 -0
- package/web/.next/standalone/web/src/components/ai-elements/message.tsx +421 -0
- package/web/.next/standalone/web/src/components/ai-elements/mic-selector.tsx +370 -0
- package/web/.next/standalone/web/src/components/ai-elements/model-selector.tsx +211 -0
- package/web/.next/standalone/web/src/components/ai-elements/node.tsx +71 -0
- package/web/.next/standalone/web/src/components/ai-elements/open-in-chat.tsx +365 -0
- package/web/.next/standalone/web/src/components/ai-elements/package-info.tsx +233 -0
- package/web/.next/standalone/web/src/components/ai-elements/panel.tsx +15 -0
- package/web/.next/standalone/web/src/components/ai-elements/persona.tsx +270 -0
- package/web/.next/standalone/web/src/components/ai-elements/plan.tsx +142 -0
- package/web/.next/standalone/web/src/components/ai-elements/prompt-input.tsx +1263 -0
- package/web/.next/standalone/web/src/components/ai-elements/queue.tsx +274 -0
- package/web/.next/standalone/web/src/components/ai-elements/read-file-tool.tsx +251 -0
- package/web/.next/standalone/web/src/components/ai-elements/reasoning.tsx +198 -0
- package/web/.next/standalone/web/src/components/ai-elements/sandbox.tsx +131 -0
- package/web/.next/standalone/web/src/components/ai-elements/schema-display.tsx +458 -0
- package/web/.next/standalone/web/src/components/ai-elements/shimmer.tsx +64 -0
- package/web/.next/standalone/web/src/components/ai-elements/snippet.tsx +139 -0
- package/web/.next/standalone/web/src/components/ai-elements/sources.tsx +77 -0
- package/web/.next/standalone/web/src/components/ai-elements/speech-input.tsx +300 -0
- package/web/.next/standalone/web/src/components/ai-elements/stack-trace.tsx +482 -0
- package/web/.next/standalone/web/src/components/ai-elements/suggestion.tsx +60 -0
- package/web/.next/standalone/web/src/components/ai-elements/task.tsx +87 -0
- package/web/.next/standalone/web/src/components/ai-elements/terminal.tsx +261 -0
- package/web/.next/standalone/web/src/components/ai-elements/test-results.tsx +485 -0
- package/web/.next/standalone/web/src/components/ai-elements/todo-panel.tsx +178 -0
- package/web/.next/standalone/web/src/components/ai-elements/todo-tool.tsx +246 -0
- package/web/.next/standalone/web/src/components/ai-elements/tool.tsx +174 -0
- package/web/.next/standalone/web/src/components/ai-elements/toolbar.tsx +16 -0
- package/web/.next/standalone/web/src/components/ai-elements/transcription.tsx +124 -0
- package/web/.next/standalone/web/src/components/ai-elements/voice-selector.tsx +479 -0
- package/web/.next/standalone/web/src/components/ai-elements/web-preview.tsx +263 -0
- package/web/.next/standalone/web/src/components/ai-elements/write-file-tool.tsx +368 -0
- package/web/.next/standalone/web/src/components/api-init.tsx +23 -0
- package/web/.next/standalone/web/src/components/chat-interface.tsx +2074 -0
- package/web/.next/standalone/web/src/components/sessions-sidebar.tsx +875 -0
- package/web/.next/standalone/web/src/components/ui/accordion.tsx +66 -0
- package/web/.next/standalone/web/src/components/ui/alert.tsx +66 -0
- package/web/.next/standalone/web/src/components/ui/avatar.tsx +109 -0
- package/web/.next/standalone/web/src/components/ui/badge.tsx +48 -0
- package/web/.next/standalone/web/src/components/ui/button-group.tsx +83 -0
- package/web/.next/standalone/web/src/components/ui/button.tsx +64 -0
- package/web/.next/standalone/web/src/components/ui/card.tsx +92 -0
- package/web/.next/standalone/web/src/components/ui/carousel.tsx +241 -0
- package/web/.next/standalone/web/src/components/ui/collapsible.tsx +33 -0
- package/web/.next/standalone/web/src/components/ui/command.tsx +184 -0
- package/web/.next/standalone/web/src/components/ui/dialog.tsx +158 -0
- package/web/.next/standalone/web/src/components/ui/dropdown-menu.tsx +257 -0
- package/web/.next/standalone/web/src/components/ui/hover-card.tsx +44 -0
- package/web/.next/standalone/web/src/components/ui/input-group.tsx +170 -0
- package/web/.next/standalone/web/src/components/ui/input.tsx +22 -0
- package/web/.next/standalone/web/src/components/ui/label.tsx +24 -0
- package/web/.next/standalone/web/src/components/ui/popover.tsx +89 -0
- package/web/.next/standalone/web/src/components/ui/progress.tsx +31 -0
- package/web/.next/standalone/web/src/components/ui/scroll-area.tsx +58 -0
- package/web/.next/standalone/web/src/components/ui/select.tsx +190 -0
- package/web/.next/standalone/web/src/components/ui/separator.tsx +28 -0
- package/web/.next/standalone/web/src/components/ui/sheet.tsx +143 -0
- package/web/.next/standalone/web/src/components/ui/sidebar.tsx +726 -0
- package/web/.next/standalone/web/src/components/ui/skeleton.tsx +13 -0
- package/web/.next/standalone/web/src/components/ui/switch.tsx +35 -0
- package/web/.next/standalone/web/src/components/ui/tabs.tsx +91 -0
- package/web/.next/standalone/web/src/components/ui/textarea.tsx +18 -0
- package/web/.next/standalone/web/src/components/ui/tooltip.tsx +61 -0
- package/web/.next/standalone/web/src/hooks/use-mobile.ts +19 -0
- package/web/.next/standalone/web/src/hooks/use-sessions.ts +28 -0
- package/web/.next/standalone/web/src/lib/api.ts +568 -0
- package/web/.next/standalone/web/src/lib/config.ts +159 -0
- package/web/.next/standalone/web/src/lib/utils.ts +6 -0
- package/web/.next/standalone/web/src/test/api.test.ts +125 -0
- package/web/.next/standalone/web/src/test/setup.ts +1 -0
- package/web/.next/standalone/web/tsconfig.json +43 -0
- package/web/.next/standalone/web/vitest.config.ts +17 -0
- package/web/.next/static/chunks/2110d26bc24ed542.js +1 -0
- package/web/.next/{standalone/web/.next/static/static/chunks/c7e9604ccdb5cb09.js → static/chunks/5ec82ce8f3aabaf0.js} +3 -3
- package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__7ba4776a._.js +0 -3
- package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__d907af4e._.js +0 -3
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__3a7ef2b7._.js +0 -3
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__5369f47d._.js +0 -3
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__c1f0d54f._.js +0 -3
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__fd3d4d25._.js +0 -10
- /package/web/.next/standalone/web/.next/static/{SrrHrAGexJF2Blp-C6YFr → OYBQUnob6zQJhwpd-v7LQ}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{SrrHrAGexJF2Blp-C6YFr → OYBQUnob6zQJhwpd-v7LQ}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{SrrHrAGexJF2Blp-C6YFr → OYBQUnob6zQJhwpd-v7LQ}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{SrrHrAGexJF2Blp-C6YFr → OYBQUnob6zQJhwpd-v7LQ}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{SrrHrAGexJF2Blp-C6YFr → OYBQUnob6zQJhwpd-v7LQ}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{SrrHrAGexJF2Blp-C6YFr → OYBQUnob6zQJhwpd-v7LQ}/_ssgManifest.js +0 -0
- /package/web/.next/static/{SrrHrAGexJF2Blp-C6YFr → OYBQUnob6zQJhwpd-v7LQ}/_buildManifest.js +0 -0
- /package/web/.next/static/{SrrHrAGexJF2Blp-C6YFr → OYBQUnob6zQJhwpd-v7LQ}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{SrrHrAGexJF2Blp-C6YFr → OYBQUnob6zQJhwpd-v7LQ}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -335,7 +335,7 @@ sparkecoder start --public-url http://your-server:3141
|
|
|
335
335
|
**Notes:**
|
|
336
336
|
- Set `host` to `0.0.0.0` to bind to all interfaces (required for Docker/remote access)
|
|
337
337
|
- Set `publicUrl` to the URL the browser will use to reach the API
|
|
338
|
-
- The web UI
|
|
338
|
+
- The web UI detects this URL automatically on first load and stores it in localStorage
|
|
339
339
|
|
|
340
340
|
## Development
|
|
341
341
|
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'ai';
|
|
2
|
-
import '../schema-
|
|
3
|
-
export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, C as ContextManager, d as buildSystemPrompt } from '../index-
|
|
4
|
-
import '../bash-
|
|
2
|
+
import '../schema-J6qYlHtl.js';
|
|
3
|
+
export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, C as ContextManager, d as buildSystemPrompt } from '../index-H2ecHywx.js';
|
|
4
|
+
import '../bash-C43A-o5X.js';
|
|
5
5
|
import 'drizzle-orm/sqlite-core';
|
|
6
6
|
import 'zod';
|
|
@@ -18,7 +18,7 @@ declare function createBashTool(options: BashToolOptions): ai.Tool<{
|
|
|
18
18
|
command?: string | undefined;
|
|
19
19
|
kill?: boolean | undefined;
|
|
20
20
|
tail?: number | undefined;
|
|
21
|
-
key?: "
|
|
21
|
+
key?: "Enter" | "Escape" | "Up" | "Down" | "Left" | "Right" | "Tab" | "C-c" | "C-d" | "y" | "n" | undefined;
|
|
22
22
|
}, {
|
|
23
23
|
success: boolean;
|
|
24
24
|
id: string;
|
|
@@ -39,7 +39,7 @@ declare function createBashTool(options: BashToolOptions): ai.Tool<{
|
|
|
39
39
|
success: boolean;
|
|
40
40
|
id: string;
|
|
41
41
|
output: string;
|
|
42
|
-
status: "
|
|
42
|
+
status: "unknown" | "running" | "stopped";
|
|
43
43
|
message: string;
|
|
44
44
|
error?: undefined;
|
|
45
45
|
exitCode?: undefined;
|
|
@@ -47,7 +47,7 @@ declare function createBashTool(options: BashToolOptions): ai.Tool<{
|
|
|
47
47
|
success: boolean;
|
|
48
48
|
id: string;
|
|
49
49
|
output: string;
|
|
50
|
-
status: "
|
|
50
|
+
status: "unknown" | "running" | "stopped";
|
|
51
51
|
message?: undefined;
|
|
52
52
|
error?: undefined;
|
|
53
53
|
exitCode?: undefined;
|
|
@@ -64,7 +64,7 @@ declare function createBashTool(options: BashToolOptions): ai.Tool<{
|
|
|
64
64
|
id: string;
|
|
65
65
|
output: string;
|
|
66
66
|
exitCode: number;
|
|
67
|
-
status: "
|
|
67
|
+
status: "completed" | "error" | "running" | "stopped";
|
|
68
68
|
message?: undefined;
|
|
69
69
|
error?: undefined;
|
|
70
70
|
} | {
|
package/dist/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ import { Hono as Hono5 } from "hono";
|
|
|
18
18
|
import { serve } from "@hono/node-server";
|
|
19
19
|
import { cors } from "hono/cors";
|
|
20
20
|
import { logger } from "hono/logger";
|
|
21
|
-
import { existsSync as existsSync10, mkdirSync as mkdirSync3 } from "fs";
|
|
21
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
22
22
|
import { resolve as resolve8, dirname as dirname6, join as join3 } from "path";
|
|
23
23
|
import { spawn as spawn2 } from "child_process";
|
|
24
24
|
import { createServer as createNetServer } from "net";
|
|
@@ -5277,9 +5277,16 @@ async function startWebUI(apiPort, webPort = DEFAULT_WEB_PORT, quiet = false, pu
|
|
|
5277
5277
|
const pkgManager = usePnpm ? "pnpm" : useNpm ? "npm" : "npx";
|
|
5278
5278
|
const { NODE_OPTIONS, TSX_TSCONFIG_PATH, ...cleanEnv } = process.env;
|
|
5279
5279
|
const apiUrl = publicUrl || `http://127.0.0.1:${apiPort}`;
|
|
5280
|
+
const runtimeConfig = { apiBaseUrl: apiUrl };
|
|
5281
|
+
const runtimeConfigPath = join3(webDir, "runtime-config.json");
|
|
5282
|
+
try {
|
|
5283
|
+
writeFileSync2(runtimeConfigPath, JSON.stringify(runtimeConfig, null, 2));
|
|
5284
|
+
if (!quiet) console.log(` \u{1F4DD} Runtime config written to ${runtimeConfigPath}`);
|
|
5285
|
+
} catch (err) {
|
|
5286
|
+
if (!quiet) console.warn(` \u26A0 Could not write runtime config: ${err}`);
|
|
5287
|
+
}
|
|
5280
5288
|
const webEnv = {
|
|
5281
5289
|
...cleanEnv,
|
|
5282
|
-
NEXT_PUBLIC_API_URL: apiUrl,
|
|
5283
5290
|
PORT: String(actualPort)
|
|
5284
5291
|
// Next.js respects PORT env var
|
|
5285
5292
|
};
|
|
@@ -5388,7 +5395,15 @@ function stopWebUI() {
|
|
|
5388
5395
|
}
|
|
5389
5396
|
async function createApp(options = {}) {
|
|
5390
5397
|
const app = new Hono5();
|
|
5391
|
-
app.use("*", cors(
|
|
5398
|
+
app.use("*", cors({
|
|
5399
|
+
origin: "*",
|
|
5400
|
+
// Allow all origins
|
|
5401
|
+
allowMethods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
|
|
5402
|
+
allowHeaders: ["Content-Type", "Authorization", "X-Requested-With"],
|
|
5403
|
+
exposeHeaders: ["X-Stream-Id", "x-stream-id"],
|
|
5404
|
+
maxAge: 86400
|
|
5405
|
+
// 24 hours
|
|
5406
|
+
}));
|
|
5392
5407
|
if (!options.quiet) {
|
|
5393
5408
|
app.use("*", logger());
|
|
5394
5409
|
}
|
|
@@ -5953,7 +5968,7 @@ function generateOpenAPISpec() {
|
|
|
5953
5968
|
}
|
|
5954
5969
|
|
|
5955
5970
|
// src/cli.ts
|
|
5956
|
-
import { writeFileSync as
|
|
5971
|
+
import { writeFileSync as writeFileSync3, existsSync as existsSync11 } from "fs";
|
|
5957
5972
|
import { resolve as resolve9, join as join4 } from "path";
|
|
5958
5973
|
async function apiRequest(baseUrl, path, options = {}) {
|
|
5959
5974
|
const url = `${baseUrl}${path}`;
|
|
@@ -6148,7 +6163,8 @@ async function runChat(options) {
|
|
|
6148
6163
|
publicUrl: options.publicUrl
|
|
6149
6164
|
});
|
|
6150
6165
|
serverStartedByUs = true;
|
|
6151
|
-
const
|
|
6166
|
+
const webPort = serverResult.webPort || options.webPort || "6969";
|
|
6167
|
+
const webUrl = options.publicUrl ? `http://localhost:${webPort}?apiUrl=${encodeURIComponent(options.publicUrl)}` : `http://localhost:${webPort}`;
|
|
6152
6168
|
if (serverResult.webStarted === false) {
|
|
6153
6169
|
spinner.warn(`Web UI failed to start at ${chalk.cyan(webUrl)}`);
|
|
6154
6170
|
} else {
|
|
@@ -6480,7 +6496,8 @@ program.command("server").description("Start the SparkECoder server (API + Web U
|
|
|
6480
6496
|
quiet: !options.verbose
|
|
6481
6497
|
});
|
|
6482
6498
|
if (webPort) {
|
|
6483
|
-
|
|
6499
|
+
const webUrl = options.publicUrl ? `http://localhost:${webPort}?apiUrl=${encodeURIComponent(options.publicUrl)}` : `http://localhost:${webPort}`;
|
|
6500
|
+
spinner.succeed(chalk.green(`SparkECoder running at ${webUrl}`));
|
|
6484
6501
|
} else {
|
|
6485
6502
|
spinner.succeed(chalk.green(`SparkECoder server running`));
|
|
6486
6503
|
}
|
|
@@ -6521,7 +6538,7 @@ program.command("init").description("Create a sparkecoder.config.json file").opt
|
|
|
6521
6538
|
return;
|
|
6522
6539
|
}
|
|
6523
6540
|
const config = createDefaultConfig();
|
|
6524
|
-
|
|
6541
|
+
writeFileSync3(configPath, JSON.stringify(config, null, 2));
|
|
6525
6542
|
console.log(chalk.green(`\u2713 Created ${configLocation} config`));
|
|
6526
6543
|
console.log(chalk.dim(` ${configPath}`));
|
|
6527
6544
|
console.log(chalk.dim("Set AI_GATEWAY_API_KEY and run sparkecoder to start"));
|