sparkecoder 0.1.99 โ†’ 0.1.100

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 (137) hide show
  1. package/README.md +41 -41
  2. package/dist/agent/index.js +17 -1
  3. package/dist/agent/index.js.map +1 -1
  4. package/dist/cli.js +17 -1
  5. package/dist/cli.js.map +1 -1
  6. package/dist/index.js +17 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/server/index.js +17 -1
  9. package/dist/server/index.js.map +1 -1
  10. package/package.json +1 -1
  11. package/web/.next/BUILD_ID +1 -1
  12. package/web/.next/standalone/web/.next/BUILD_ID +1 -1
  13. package/web/.next/standalone/web/.next/build-manifest.json +2 -2
  14. package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
  15. package/web/.next/standalone/web/.next/server/app/(main)/agents/page_client-reference-manifest.js +1 -1
  16. package/web/.next/standalone/web/.next/server/app/(main)/page_client-reference-manifest.js +1 -1
  17. package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page.js.nft.json +1 -1
  18. package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
  19. package/web/.next/standalone/web/.next/server/app/(main)/settings/page_client-reference-manifest.js +1 -1
  20. package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
  21. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
  22. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  23. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  24. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  25. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  26. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  27. package/web/.next/standalone/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  28. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
  29. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +2 -2
  30. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  31. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  32. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  33. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  34. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  35. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  36. package/web/.next/standalone/web/.next/server/app/agents.html +1 -1
  37. package/web/.next/standalone/web/.next/server/app/agents.rsc +4 -4
  38. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +2 -2
  39. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents.segment.rsc +1 -1
  40. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p.segment.rsc +2 -2
  41. package/web/.next/standalone/web/.next/server/app/agents.segments/_full.segment.rsc +4 -4
  42. package/web/.next/standalone/web/.next/server/app/agents.segments/_head.segment.rsc +1 -1
  43. package/web/.next/standalone/web/.next/server/app/agents.segments/_index.segment.rsc +2 -2
  44. package/web/.next/standalone/web/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
  45. package/web/.next/standalone/web/.next/server/app/docs/installation/page_client-reference-manifest.js +1 -1
  46. package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
  47. package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +3 -3
  48. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +3 -3
  49. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
  50. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +2 -2
  51. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
  52. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +2 -2
  53. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
  54. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +2 -2
  55. package/web/.next/standalone/web/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  56. package/web/.next/standalone/web/.next/server/app/docs/skills/page_client-reference-manifest.js +1 -1
  57. package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
  58. package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +3 -3
  59. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +3 -3
  60. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
  61. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +2 -2
  62. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
  63. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
  64. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
  65. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +2 -2
  66. package/web/.next/standalone/web/.next/server/app/docs/tools/page_client-reference-manifest.js +1 -1
  67. package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
  68. package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +3 -3
  69. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +3 -3
  70. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
  71. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +2 -2
  72. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
  73. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +2 -2
  74. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
  75. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +2 -2
  76. package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
  77. package/web/.next/standalone/web/.next/server/app/docs.rsc +3 -3
  78. package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +3 -3
  79. package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  80. package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +2 -2
  81. package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  82. package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
  83. package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +2 -2
  84. package/web/.next/standalone/web/.next/server/app/index.html +1 -1
  85. package/web/.next/standalone/web/.next/server/app/index.rsc +4 -4
  86. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +2 -2
  87. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +2 -2
  88. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +4 -4
  89. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  90. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +2 -2
  91. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  92. package/web/.next/standalone/web/.next/server/app/settings.html +1 -1
  93. package/web/.next/standalone/web/.next/server/app/settings.rsc +4 -4
  94. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings/__PAGE__.segment.rsc +2 -2
  95. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings.segment.rsc +1 -1
  96. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p.segment.rsc +2 -2
  97. package/web/.next/standalone/web/.next/server/app/settings.segments/_full.segment.rsc +4 -4
  98. package/web/.next/standalone/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  99. package/web/.next/standalone/web/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  100. package/web/.next/standalone/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  101. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_b57914d2._.js โ†’ 2374f_1f3f2d00._.js} +1 -1
  102. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_3b04c7b5._.js โ†’ 2374f_38945fd9._.js} +1 -1
  103. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_e6dbbf5d._.js โ†’ 2374f_570c34dc._.js} +1 -1
  104. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_db1d6704._.js โ†’ 2374f_9c560f3a._.js} +1 -1
  105. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_9e444fb0._.js โ†’ 2374f_a0d5caeb._.js} +1 -1
  106. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_7b7dd4c7._.js โ†’ 2374f_c87abaf4._.js} +1 -1
  107. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_5ee1ee50._.js โ†’ 2374f_d8122230._.js} +1 -1
  108. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__6097da17._.js +1 -1
  109. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__be5e2967._.js +1 -1
  110. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_c2c47039._.js โ†’ web_3b9a2423._.js} +2 -2
  111. package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
  112. package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
  113. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
  114. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
  115. package/web/.next/standalone/web/.next/static/chunks/4239395558fab3ef.js +1 -0
  116. package/web/.next/standalone/web/.next/static/chunks/{f50a66c24c564585.js โ†’ ae4bb24474ff1ed0.js} +1 -1
  117. package/web/.next/standalone/web/.next/static/chunks/{545725e4c1237026.js โ†’ fbdcbd65f9a38f4b.js} +1 -1
  118. package/web/.next/standalone/web/.next/static/static/chunks/4239395558fab3ef.js +1 -0
  119. package/web/.next/standalone/web/.next/static/static/chunks/{f50a66c24c564585.js โ†’ ae4bb24474ff1ed0.js} +1 -1
  120. package/web/.next/standalone/web/.next/static/static/chunks/{545725e4c1237026.js โ†’ fbdcbd65f9a38f4b.js} +1 -1
  121. package/web/.next/standalone/web/package-lock.json +7 -7
  122. package/web/.next/standalone/web/src/components/ai-elements/mention-input.tsx +125 -17
  123. package/web/.next/static/chunks/4239395558fab3ef.js +1 -0
  124. package/web/.next/static/chunks/{f50a66c24c564585.js โ†’ ae4bb24474ff1ed0.js} +1 -1
  125. package/web/.next/static/chunks/{545725e4c1237026.js โ†’ fbdcbd65f9a38f4b.js} +1 -1
  126. package/web/.next/standalone/web/.next/static/chunks/9fce2ce79c4c834e.js +0 -1
  127. package/web/.next/standalone/web/.next/static/static/chunks/9fce2ce79c4c834e.js +0 -1
  128. package/web/.next/static/chunks/9fce2ce79c4c834e.js +0 -1
  129. /package/web/.next/standalone/web/.next/static/{static/yyzMTo2RYusiXE0e1_kdc โ†’ eyxBRyMA8Zq36Pfen3Ylj}/_buildManifest.js +0 -0
  130. /package/web/.next/standalone/web/.next/static/{static/yyzMTo2RYusiXE0e1_kdc โ†’ eyxBRyMA8Zq36Pfen3Ylj}/_clientMiddlewareManifest.json +0 -0
  131. /package/web/.next/standalone/web/.next/static/{static/yyzMTo2RYusiXE0e1_kdc โ†’ eyxBRyMA8Zq36Pfen3Ylj}/_ssgManifest.js +0 -0
  132. /package/web/.next/standalone/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ†’ static/eyxBRyMA8Zq36Pfen3Ylj}/_buildManifest.js +0 -0
  133. /package/web/.next/standalone/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ†’ static/eyxBRyMA8Zq36Pfen3Ylj}/_clientMiddlewareManifest.json +0 -0
  134. /package/web/.next/standalone/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ†’ static/eyxBRyMA8Zq36Pfen3Ylj}/_ssgManifest.js +0 -0
  135. /package/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ†’ eyxBRyMA8Zq36Pfen3Ylj}/_buildManifest.js +0 -0
  136. /package/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ†’ eyxBRyMA8Zq36Pfen3Ylj}/_clientMiddlewareManifest.json +0 -0
  137. /package/web/.next/static/{yyzMTo2RYusiXE0e1_kdc โ†’ eyxBRyMA8Zq36Pfen3Ylj}/_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
- - ๐Ÿ’พ **SQLite Persistence** - Full session and message history storage
13
- - ๐ŸŒ **HTTP API** - RESTful API with auto-generated OpenAPI specification via hono-openapi
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
- # Configure npm to use GitHub Packages for @gostudyfetchgo scope
22
- npm config set @gostudyfetchgo:registry https://npm.pkg.github.com
23
-
24
- # Install the package (no auth required - it's public!)
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
- ### Global CLI Installation
40
+ ## Quick Start (Personal Orchestrator)
49
41
 
50
42
  ```bash
51
- npm install -g @gostudyfetchgo/sparkecoder
52
- sparkecoder start
43
+ sparkecoder server
53
44
  ```
54
45
 
55
- ## Quick Start
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
- ### Initialize Configuration
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
- ```bash
60
- sparkecoder init
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
- This creates a `sparkecoder.config.json` file with default settings.
59
+ ### One-off task mode (no orchestrator)
64
60
 
65
- ### Start the Server
61
+ If you just want a one-shot autonomous task:
66
62
 
67
63
  ```bash
68
- sparkecoder start
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
- The server runs at `http://localhost:3141` by default.
69
+ See [docs/TASK-MODE.md](docs/TASK-MODE.md).
72
70
 
73
- ### Make Your First Request
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 start # Start the HTTP server
243
- sparkecoder chat # Interactive chat with the agent
244
- sparkecoder init # Create config file
245
- sparkecoder sessions # List all sessions
246
- sparkecoder status # Check if server is running
247
- sparkecoder config # Show current configuration
248
- sparkecoder info # Show version and environment
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
@@ -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);