sparkecoder 0.1.99 โ 0.1.102
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 +41 -41
- package/dist/agent/index.js +17 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +224 -44
- package/dist/cli.js.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/server/index.js +17 -1
- package/dist/server/index.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/package.json +16 -15
- 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)/agents/page_client-reference-manifest.js +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.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/(main)/settings/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_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 +2 -2
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- 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 +2 -2
- 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/agents.html +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.rsc +4 -4
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/agents.segments/_full.segment.rsc +4 -4
- package/web/.next/standalone/web/.next/server/app/agents.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/index.html +1 -1
- package/web/.next/standalone/web/.next/server/app/index.rsc +4 -4
- 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 +4 -4
- 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 +2 -2
- package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.html +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.rsc +4 -4
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings/__PAGE__.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/settings.segments/_full.segment.rsc +4 -4
- package/web/.next/standalone/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_b57914d2._.js โ 2374f_1f3f2d00._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_3b04c7b5._.js โ 2374f_38945fd9._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_e6dbbf5d._.js โ 2374f_570c34dc._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_db1d6704._.js โ 2374f_9c560f3a._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_9e444fb0._.js โ 2374f_a0d5caeb._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_7b7dd4c7._.js โ 2374f_c87abaf4._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_5ee1ee50._.js โ 2374f_d8122230._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__6097da17._.js +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__be5e2967._.js +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_c2c47039._.js โ web_3b9a2423._.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/4239395558fab3ef.js +1 -0
- package/web/.next/standalone/web/.next/static/chunks/{f50a66c24c564585.js โ ae4bb24474ff1ed0.js} +1 -1
- package/web/.next/standalone/web/.next/static/chunks/{545725e4c1237026.js โ fbdcbd65f9a38f4b.js} +1 -1
- package/web/.next/standalone/web/.next/static/static/chunks/4239395558fab3ef.js +1 -0
- package/web/.next/standalone/web/.next/static/static/chunks/{f50a66c24c564585.js โ ae4bb24474ff1ed0.js} +1 -1
- package/web/.next/standalone/web/.next/static/static/chunks/{545725e4c1237026.js โ fbdcbd65f9a38f4b.js} +1 -1
- package/web/.next/standalone/web/package-lock.json +7 -7
- package/web/.next/standalone/web/src/components/ai-elements/mention-input.tsx +125 -17
- package/web/.next/static/chunks/4239395558fab3ef.js +1 -0
- package/web/.next/static/chunks/{f50a66c24c564585.js โ ae4bb24474ff1ed0.js} +1 -1
- package/web/.next/static/chunks/{545725e4c1237026.js โ fbdcbd65f9a38f4b.js} +1 -1
- package/web/.next/standalone/web/.next/static/chunks/9fce2ce79c4c834e.js +0 -1
- package/web/.next/standalone/web/.next/static/static/chunks/9fce2ce79c4c834e.js +0 -1
- package/web/.next/static/chunks/9fce2ce79c4c834e.js +0 -1
- /package/web/.next/standalone/web/.next/static/static/{yyzMTo2RYusiXE0e1_kdc โ wV0cf4IbCdyxPIPIWZqMD}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{yyzMTo2RYusiXE0e1_kdc โ wV0cf4IbCdyxPIPIWZqMD}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{yyzMTo2RYusiXE0e1_kdc โ wV0cf4IbCdyxPIPIWZqMD}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ wV0cf4IbCdyxPIPIWZqMD}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ wV0cf4IbCdyxPIPIWZqMD}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ wV0cf4IbCdyxPIPIWZqMD}/_ssgManifest.js +0 -0
- /package/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ wV0cf4IbCdyxPIPIWZqMD}/_buildManifest.js +0 -0
- /package/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ wV0cf4IbCdyxPIPIWZqMD}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ wV0cf4IbCdyxPIPIWZqMD}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -5,75 +5,72 @@ A powerful coding agent CLI with HTTP API. Built with the [Vercel AI SDK](https:
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- ๐ค **Multi-Agent Sessions** - Run multiple agents simultaneously with isolated contexts
|
|
8
|
+
- ๐งญ **Personal Orchestrator** - Built-in supervisor agent that spawns workers, posts to Slack, fires on cron schedules, accepts webhooks, and edits its own config. See **[docs/ORCHESTRATOR.md](docs/ORCHESTRATOR.md)**.
|
|
9
|
+
- ๐ **MCP support** - Add Model Context Protocol servers via the Settings UI or by editing the config file. Hot-reloads on next agent turn.
|
|
10
|
+
- ๐ฌ **Slack integration** - Signed events, per-user/per-channel allowlist, canned denied-reply, in-thread responses. Setup wizard with copy-paste manifest in the Settings UI.
|
|
11
|
+
- ๐ช **Inbound webhooks** - Token-protected URLs (`/api/inbox/<token>`) so external services can ping the orchestrator. Templated formatting.
|
|
12
|
+
- โฐ **Cron schedules** - Recurring prompts that wake the orchestrator with catch-up window.
|
|
13
|
+
- ๐ง **Long-term memory** - Every turn mirrored to local JSONL files; orchestrator can `grep` across sessions via the `search-conversations` skill.
|
|
8
14
|
- ๐ **Streaming Responses** - Real-time SSE streaming following Vercel AI SDK data stream protocol
|
|
9
15
|
- ๐ง **Powerful Tools** - Bash execution, file operations, planning, and skill loading
|
|
10
16
|
- โ
**Tool Approvals** - Configurable approval requirements for dangerous operations
|
|
11
17
|
- ๐ **Skills System** - Load specialized knowledge documents into context
|
|
12
|
-
- ๐พ **
|
|
13
|
-
- ๐ **HTTP API** - RESTful API with auto-generated OpenAPI specification
|
|
18
|
+
- ๐พ **Persistence** - Full session and message history storage (remote MongoDB by default)
|
|
19
|
+
- ๐ **HTTP API** - RESTful API with auto-generated OpenAPI specification
|
|
14
20
|
- ๐ฏ **Context Management** - Automatic summarization for long conversations
|
|
15
21
|
|
|
16
22
|
## Installation
|
|
17
23
|
|
|
18
|
-
### From GitHub Packages
|
|
19
|
-
|
|
20
24
|
```bash
|
|
21
|
-
#
|
|
22
|
-
npm
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
npm install @gostudyfetchgo/sparkecoder
|
|
26
|
-
|
|
27
|
-
# Or with pnpm
|
|
28
|
-
pnpm add @gostudyfetchgo/sparkecoder
|
|
25
|
+
# Global install (recommended)
|
|
26
|
+
npm install -g sparkecoder
|
|
27
|
+
# or
|
|
28
|
+
pnpm add -g sparkecoder
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
### From Source
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
# Clone the repository
|
|
35
34
|
git clone https://github.com/gostudyfetchgo/sparkecoder.git
|
|
36
35
|
cd sparkecoder
|
|
37
|
-
|
|
38
|
-
# Install dependencies
|
|
39
36
|
pnpm install
|
|
40
|
-
|
|
41
|
-
# Set up environment variables
|
|
42
|
-
export AI_GATEWAY_API_KEY=your_api_key_here
|
|
43
|
-
|
|
44
|
-
# Start the server
|
|
45
37
|
pnpm dev
|
|
46
38
|
```
|
|
47
39
|
|
|
48
|
-
|
|
40
|
+
## Quick Start (Personal Orchestrator)
|
|
49
41
|
|
|
50
42
|
```bash
|
|
51
|
-
|
|
52
|
-
sparkecoder start
|
|
43
|
+
sparkecoder server
|
|
53
44
|
```
|
|
54
45
|
|
|
55
|
-
|
|
46
|
+
That's it โ **no API key to configure**. On first boot sparkecoder auto-registers with the remote inference server. The first boot also:
|
|
56
47
|
|
|
57
|
-
|
|
48
|
+
- Starts the API at `http://127.0.0.1:3141` and the web UI at `http://localhost:6969`
|
|
49
|
+
- Auto-creates the orchestrator session (always visible in the left sidebar)
|
|
50
|
+
- Starts the per-orchestrator inbox, the daemon that drains it, the cron scheduler, and the MCP client pool
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
Open `http://localhost:6969` and you'll see:
|
|
53
|
+
- **Orchestrator** in the sidebar โ your long-lived supervisor chat
|
|
54
|
+
- **Agents** โ kanban of worker agents the orchestrator spawns
|
|
55
|
+
- **Settings** โ 6 tabs (General ยท Integrations ยท MCP ยท Schedules ยท Webhooks ยท Models ยท API Keys)
|
|
56
|
+
|
|
57
|
+
**For end-to-end setup (Slack, cloudflared, MCP, schedules, webhooks, personality, long-term memory):** see **[docs/ORCHESTRATOR.md](docs/ORCHESTRATOR.md)**.
|
|
62
58
|
|
|
63
|
-
|
|
59
|
+
### One-off task mode (no orchestrator)
|
|
64
60
|
|
|
65
|
-
|
|
61
|
+
If you just want a one-shot autonomous task:
|
|
66
62
|
|
|
67
63
|
```bash
|
|
68
|
-
sparkecoder
|
|
64
|
+
sparkecoder task --prompt "Refactor src/foo.ts to use async/await" \
|
|
65
|
+
--schema '{"type":"object","properties":{"summary":{"type":"string"}},"required":["summary"]}' \
|
|
66
|
+
--wait
|
|
69
67
|
```
|
|
70
68
|
|
|
71
|
-
|
|
69
|
+
See [docs/TASK-MODE.md](docs/TASK-MODE.md).
|
|
72
70
|
|
|
73
|
-
###
|
|
71
|
+
### Direct API call
|
|
74
72
|
|
|
75
73
|
```bash
|
|
76
|
-
# Create a session and run a prompt
|
|
77
74
|
curl -X POST http://localhost:3141/agents/quick \
|
|
78
75
|
-H "Content-Type: application/json" \
|
|
79
76
|
-d '{"prompt": "List the files in the current directory"}'
|
|
@@ -239,13 +236,16 @@ Built-in skills:
|
|
|
239
236
|
## CLI Commands
|
|
240
237
|
|
|
241
238
|
```bash
|
|
242
|
-
sparkecoder
|
|
243
|
-
sparkecoder chat
|
|
244
|
-
sparkecoder
|
|
245
|
-
sparkecoder
|
|
246
|
-
sparkecoder
|
|
247
|
-
sparkecoder
|
|
248
|
-
sparkecoder
|
|
239
|
+
sparkecoder server # Start the API + Web UI + orchestrator daemon + scheduler
|
|
240
|
+
sparkecoder chat # Interactive REPL chat with an agent
|
|
241
|
+
sparkecoder task --prompt ... --schema ... # Run a one-off autonomous task
|
|
242
|
+
sparkecoder init # Create a sparkecoder.config.json in cwd
|
|
243
|
+
sparkecoder slack-setup # Interactively configure Slack creds
|
|
244
|
+
sparkecoder cloudflared-setup --hostname X --team Y # Print public-tunnel + CF Access recipe
|
|
245
|
+
sparkecoder sessions # List all sessions on the running server
|
|
246
|
+
sparkecoder status # Check if the server is running
|
|
247
|
+
sparkecoder config # Show resolved configuration
|
|
248
|
+
sparkecoder info # Show version and environment
|
|
249
249
|
```
|
|
250
250
|
|
|
251
251
|
### Interactive Chat
|
package/dist/agent/index.js
CHANGED
|
@@ -7064,7 +7064,7 @@ You ALSO have the regular agent toolset (\`bash\`, \`read_file\`, \`write_file\`
|
|
|
7064
7064
|
|
|
7065
7065
|
You manage your own configuration by editing files. Load the relevant skill first to get the file path and schema:
|
|
7066
7066
|
|
|
7067
|
-
- **MCP integrations** \u2014 load the \`manage-mcp\` skill. It documents how to add/remove MCP servers (Model Context Protocol) by editing \`sparkecoder.config.json\`. Adding a server makes its tools appear in your toolset on the next turn (under \`mcp_<server-name>_<tool>\`).
|
|
7067
|
+
- **MCP integrations** \u2014 load the \`manage-mcp\` skill. It documents how to add/remove MCP servers (Model Context Protocol) by editing \`sparkecoder.config.json\`. Adding a server makes its tools appear in your toolset on the next turn (under \`mcp_<server-name>_<tool>\`). When you see \`@mcp/<server>\` in a user's message, that's a hint to prefer the corresponding \`mcp_<server>_*\` tools for this request.
|
|
7068
7068
|
- **Conversation history / long-term memory** \u2014 load the \`search-conversations\` skill. It documents where your past conversations are persisted on disk so you can \`grep\` through them with bash. Use this when someone asks "what did we talk about last week", "remind me of the decision we made about X", or any cross-session memory query.
|
|
7069
7069
|
|
|
7070
7070
|
If the user asks "add the GitHub MCP" or "remember that I prefer Python", load the right skill first, then act on the documented file paths with bash/read_file/write_file.
|
|
@@ -7497,6 +7497,22 @@ ${summaryContent}`
|
|
|
7497
7497
|
content
|
|
7498
7498
|
};
|
|
7499
7499
|
await messageQueries.create(this.sessionId, userMessage);
|
|
7500
|
+
try {
|
|
7501
|
+
const { appendTurn: appendTurn2, flattenContent: flattenContent2 } = await Promise.resolve().then(() => (init_conversation_archive(), conversation_archive_exports));
|
|
7502
|
+
const { sessionQueries: sessionQueries2 } = await Promise.resolve().then(() => (init_db(), db_exports));
|
|
7503
|
+
const session = await sessionQueries2.getById(this.sessionId).catch(() => void 0);
|
|
7504
|
+
const text = flattenContent2(content).trim();
|
|
7505
|
+
if (!text) return;
|
|
7506
|
+
const channelMatch = text.match(/^\[([A-Z]+)/);
|
|
7507
|
+
appendTurn2({
|
|
7508
|
+
sessionId: this.sessionId,
|
|
7509
|
+
sessionName: session?.name ?? void 0,
|
|
7510
|
+
role: "user",
|
|
7511
|
+
content: text,
|
|
7512
|
+
channel: channelMatch ? channelMatch[1].toLowerCase() : void 0
|
|
7513
|
+
});
|
|
7514
|
+
} catch {
|
|
7515
|
+
}
|
|
7500
7516
|
}
|
|
7501
7517
|
async addResponseMessages(messages) {
|
|
7502
7518
|
await messageQueries.addMany(this.sessionId, messages);
|