@agent-spaces/server 0.3.64 → 0.3.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/claude-code-runtime/index.js +68 -2
- package/dist/adapters/claude-code-runtime/message-format.js +26 -0
- package/dist/adapters/claude-code-runtime/sdk-config.js +12 -0
- package/dist/adapters/git.js +13 -6
- package/dist/agents/agent-message-parts.js +1 -1
- package/dist/agents/commit-agent.js +4 -2
- package/dist/agents/issue-task-controller.js +6 -2
- package/dist/app.js +6 -68
- package/dist/routes/agent-sse.js +1 -0
- package/dist/routes/agent.js +3 -0
- package/dist/routes/database.js +1 -0
- package/dist/routes/git.js +197 -317
- package/dist/routes/robot-account.js +68 -0
- package/dist/services/agent.js +36 -2
- package/dist/services/builtin-tools/kanban-tools.js +4 -0
- package/dist/services/git-operation-log.js +40 -0
- package/dist/services/global-wechat-qr.js +72 -0
- package/dist/services/hook-engine.js +175 -17
- package/dist/services/notification-hub/bot-agent.js +3 -1
- package/dist/services/notification-hub/service.js +12 -2
- package/dist/services/robot-account.js +34 -0
- package/dist/services/workspace.js +2 -0
- package/dist/storage/robot-account-store.js +39 -0
- package/dist/web/404.html +1 -1
- package/dist/web/__next.__PAGE__.txt +4 -4
- package/dist/web/__next._full.txt +23 -25
- package/dist/web/__next._head.txt +4 -4
- package/dist/web/__next._index.txt +13 -13
- package/dist/web/__next._tree.txt +2 -2
- package/dist/web/_next/static/chunks/{04a4vsq2wknm4.js → 0-a.-hl3wv99k.js} +1 -1
- package/dist/web/_next/static/chunks/{0ctg5qmw7uu.1.js → 0-pi.67w.ymsr.js} +3 -3
- package/dist/web/_next/static/chunks/0-v_p6j5u3_9l.js +1 -0
- package/dist/web/_next/static/chunks/0.-x29t-8gk0r.js +1 -0
- package/dist/web/_next/static/chunks/0.6b64sy0g5.3.js +3 -0
- package/dist/web/_next/static/chunks/0.l5e8~r7_0~p.js +1 -0
- package/dist/web/_next/static/chunks/00-syqzi-6zxr.js +1 -0
- package/dist/web/_next/static/chunks/02802taez976w.js +67 -0
- package/dist/web/_next/static/chunks/02j4sr9psucf-.js +1 -0
- package/dist/web/_next/static/chunks/033.awk90g6eh.js +1 -0
- package/dist/web/_next/static/chunks/06.kdsa9rr2h1.js +1 -0
- package/dist/web/_next/static/chunks/06si8l0doqe8p.js +1 -0
- package/dist/web/_next/static/chunks/08ugbvzr20drp.js +2 -0
- package/dist/web/_next/static/chunks/{0n6_4so_afuwk.js → 08x85faoz58i7.js} +2 -2
- package/dist/web/_next/static/chunks/{0v3a_x4vt42kx.js → 0_cqojbge48kq.js} +1 -1
- package/dist/web/_next/static/chunks/{0a5y-vhf4i5id.js → 0d6~~lv0-6kex.js} +1 -1
- package/dist/web/_next/static/chunks/{0vbqaynjq8ga..js → 0db14450oqzhg.js} +1 -1
- package/dist/web/_next/static/chunks/0gdwop9cnpmtu.js +1 -0
- package/dist/web/_next/static/chunks/0j-l7l_k9jt45.js +1 -0
- package/dist/web/_next/static/chunks/0kbvoxla7f751.js +1 -0
- package/dist/web/_next/static/chunks/{1442stwa0gbxe.js → 0l2w0qz1ea7ql.js} +2 -2
- package/dist/web/_next/static/chunks/0p3h-h3zj5ujg.js +30 -0
- package/dist/web/_next/static/chunks/0paaat8y96ayc.js +7 -0
- package/dist/web/_next/static/chunks/0pm-un~-sy3rl.js +1 -0
- package/dist/web/_next/static/chunks/0pq318f8xgafg.js +1 -0
- package/dist/web/_next/static/chunks/0t6s8of0qr6nc.js +1 -0
- package/dist/web/_next/static/chunks/0u6h-hqc_i52e.js +1 -0
- package/dist/web/_next/static/chunks/0uxzi~9b~k4mn.js +31 -0
- package/dist/web/_next/static/chunks/{08ckpwmmwlors.js → 0vis~lx0nxgn-.js} +2 -2
- package/dist/web/_next/static/chunks/{10l-9myrdo3x9.js → 0w7.tb29958zj.js} +1 -1
- package/dist/web/_next/static/chunks/0yd.m1afqg.2t.js +3 -0
- package/dist/web/_next/static/chunks/0yhbr8hl09b-5.js +1 -0
- package/dist/web/_next/static/chunks/0zncg76rgtbm-.js +1 -0
- package/dist/web/_next/static/chunks/0~~_ltu6dx_ch.js +1 -0
- package/dist/web/_next/static/chunks/{0iuf30t0rjsjv.js → 11cchuwoupmbf.js} +1 -1
- package/dist/web/_next/static/chunks/12oxcgyhpaxw~.js +1 -0
- package/dist/web/_next/static/chunks/1452eibz62gs6.css +1 -0
- package/dist/web/_next/static/chunks/16zlreiems5cn.js +1 -0
- package/dist/web/_next/static/chunks/18awqjk9-o5m0.js +1 -0
- package/dist/web/_next/static/chunks/18c7g84y01mj0.js +1 -0
- package/dist/web/_next/static/chunks/{turbopack-0ndm2zc_pdptk.js → turbopack-11qjwlynmfc-n.js} +1 -1
- package/dist/web/_not-found/__next._full.txt +30 -29
- package/dist/web/_not-found/__next._head.txt +4 -4
- package/dist/web/_not-found/__next._index.txt +13 -13
- package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/dist/web/_not-found/__next._not-found.txt +3 -3
- package/dist/web/_not-found/__next._tree.txt +2 -2
- package/dist/web/_not-found.html +1 -1
- package/dist/web/_not-found.txt +30 -29
- package/dist/web/index.html +1 -1
- package/dist/web/index.txt +23 -25
- package/dist/web/login/__next._full.txt +28 -28
- package/dist/web/login/__next._head.txt +4 -4
- package/dist/web/login/__next._index.txt +13 -13
- package/dist/web/login/__next._tree.txt +2 -2
- package/dist/web/login/__next.login.__PAGE__.txt +4 -4
- package/dist/web/login/__next.login.txt +3 -3
- package/dist/web/login.html +1 -1
- package/dist/web/login.txt +28 -28
- package/dist/web/settings/__next._full.txt +33 -32
- package/dist/web/settings/__next._head.txt +4 -4
- package/dist/web/settings/__next._index.txt +13 -13
- package/dist/web/settings/__next._tree.txt +2 -2
- package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
- package/dist/web/settings/__next.settings.txt +5 -5
- package/dist/web/settings/agents/__next._full.txt +24 -24
- package/dist/web/settings/agents/__next._head.txt +4 -4
- package/dist/web/settings/agents/__next._index.txt +13 -13
- package/dist/web/settings/agents/__next._tree.txt +2 -2
- package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
- package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
- package/dist/web/settings/agents/__next.settings.txt +5 -5
- package/dist/web/settings/agents.html +1 -1
- package/dist/web/settings/agents.txt +24 -24
- package/dist/web/settings/mcps/__next._full.txt +24 -24
- package/dist/web/settings/mcps/__next._head.txt +4 -4
- package/dist/web/settings/mcps/__next._index.txt +13 -13
- package/dist/web/settings/mcps/__next._tree.txt +2 -2
- package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
- package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
- package/dist/web/settings/mcps/__next.settings.txt +5 -5
- package/dist/web/settings/mcps.html +1 -1
- package/dist/web/settings/mcps.txt +24 -24
- package/dist/web/settings/models/__next._full.txt +24 -24
- package/dist/web/settings/models/__next._head.txt +4 -4
- package/dist/web/settings/models/__next._index.txt +13 -13
- package/dist/web/settings/models/__next._tree.txt +2 -2
- package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
- package/dist/web/settings/models/__next.settings.models.txt +3 -3
- package/dist/web/settings/models/__next.settings.txt +5 -5
- package/dist/web/settings/models.html +1 -1
- package/dist/web/settings/models.txt +24 -24
- package/dist/web/settings/output-styles/__next._full.txt +24 -24
- package/dist/web/settings/output-styles/__next._head.txt +4 -4
- package/dist/web/settings/output-styles/__next._index.txt +13 -13
- package/dist/web/settings/output-styles/__next._tree.txt +2 -2
- package/dist/web/settings/output-styles/__next.settings.output-styles.__PAGE__.txt +4 -4
- package/dist/web/settings/output-styles/__next.settings.output-styles.txt +3 -3
- package/dist/web/settings/output-styles/__next.settings.txt +5 -5
- package/dist/web/settings/output-styles.html +1 -1
- package/dist/web/settings/output-styles.txt +24 -24
- package/dist/web/settings/prompts/__next._full.txt +24 -24
- package/dist/web/settings/prompts/__next._head.txt +4 -4
- package/dist/web/settings/prompts/__next._index.txt +13 -13
- package/dist/web/settings/prompts/__next._tree.txt +2 -2
- package/dist/web/settings/prompts/__next.settings.prompts.__PAGE__.txt +4 -4
- package/dist/web/settings/prompts/__next.settings.prompts.txt +3 -3
- package/dist/web/settings/prompts/__next.settings.txt +5 -5
- package/dist/web/settings/prompts.html +1 -1
- package/dist/web/settings/prompts.txt +24 -24
- package/dist/web/settings/providers/__next._full.txt +24 -24
- package/dist/web/settings/providers/__next._head.txt +4 -4
- package/dist/web/settings/providers/__next._index.txt +13 -13
- package/dist/web/settings/providers/__next._tree.txt +2 -2
- package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
- package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
- package/dist/web/settings/providers/__next.settings.txt +5 -5
- package/dist/web/settings/providers.html +1 -1
- package/dist/web/settings/providers.txt +24 -24
- package/dist/web/settings/skills/__next._full.txt +24 -24
- package/dist/web/settings/skills/__next._head.txt +4 -4
- package/dist/web/settings/skills/__next._index.txt +13 -13
- package/dist/web/settings/skills/__next._tree.txt +2 -2
- package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
- package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
- package/dist/web/settings/skills/__next.settings.txt +5 -5
- package/dist/web/settings/skills.html +1 -1
- package/dist/web/settings/skills.txt +24 -24
- package/dist/web/settings/tools/__next._full.txt +24 -24
- package/dist/web/settings/tools/__next._head.txt +4 -4
- package/dist/web/settings/tools/__next._index.txt +13 -13
- package/dist/web/settings/tools/__next._tree.txt +2 -2
- package/dist/web/settings/tools/__next.settings.tools.__PAGE__.txt +4 -4
- package/dist/web/settings/tools/__next.settings.tools.txt +3 -3
- package/dist/web/settings/tools/__next.settings.txt +5 -5
- package/dist/web/settings/tools.html +1 -1
- package/dist/web/settings/tools.txt +24 -24
- package/dist/web/settings.html +1 -1
- package/dist/web/settings.txt +33 -32
- package/dist/web/workflows/__next._full.txt +31 -33
- package/dist/web/workflows/__next._head.txt +4 -4
- package/dist/web/workflows/__next._index.txt +13 -13
- package/dist/web/workflows/__next._tree.txt +2 -2
- package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
- package/dist/web/workflows/__next.workflows.txt +3 -3
- package/dist/web/workflows.html +1 -1
- package/dist/web/workflows.txt +31 -33
- package/dist/web/workspace/_/__next._full.txt +28 -29
- package/dist/web/workspace/_/__next._head.txt +4 -4
- package/dist/web/workspace/_/__next._index.txt +13 -13
- package/dist/web/workspace/_/__next._tree.txt +2 -2
- package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -3
- package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
- package/dist/web/workspace/_/__next.workspace.txt +3 -3
- package/dist/web/workspace/_.html +1 -1
- package/dist/web/workspace/_.txt +28 -29
- package/dist/web/workspaces/__next._full.txt +29 -31
- package/dist/web/workspaces/__next._head.txt +4 -4
- package/dist/web/workspaces/__next._index.txt +13 -13
- package/dist/web/workspaces/__next._tree.txt +2 -2
- package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
- package/dist/web/workspaces/__next.workspaces.txt +3 -3
- package/dist/web/workspaces.html +1 -1
- package/dist/web/workspaces.txt +29 -31
- package/dist/ws/agent-runner.js +82 -6
- package/package.json +10 -11
- package/dist/web/_next/static/chunks/0-9194nbxy_6d.js +0 -1
- package/dist/web/_next/static/chunks/02mf61htij8g0.js +0 -31
- package/dist/web/_next/static/chunks/04dg4l4hv11q2.js +0 -3
- package/dist/web/_next/static/chunks/04fxddw-y20~-.js +0 -7
- package/dist/web/_next/static/chunks/04w7~5ooz_pwm.js +0 -1
- package/dist/web/_next/static/chunks/05oc21sj24wtq.js +0 -1
- package/dist/web/_next/static/chunks/08k~meqbd8d6v.js +0 -1
- package/dist/web/_next/static/chunks/099h96wjsdb25.js +0 -2
- package/dist/web/_next/static/chunks/09h23logvq65m.js +0 -1
- package/dist/web/_next/static/chunks/0ake2f3x2uan4.js +0 -24
- package/dist/web/_next/static/chunks/0ck8dw_9-1cdx.js +0 -1
- package/dist/web/_next/static/chunks/0ewceguykiut5.js +0 -1
- package/dist/web/_next/static/chunks/0f7cb9li~3jra.js +0 -67
- package/dist/web/_next/static/chunks/0ghs9on7wodrm.js +0 -1
- package/dist/web/_next/static/chunks/0h9cu-k6z5o08.js +0 -1
- package/dist/web/_next/static/chunks/0jb4~3qqkw2ps.js +0 -1
- package/dist/web/_next/static/chunks/0nb8.iteznuvx.js +0 -1
- package/dist/web/_next/static/chunks/0os58q93stt7j.js +0 -3
- package/dist/web/_next/static/chunks/0ppr271hz0xoq.js +0 -1
- package/dist/web/_next/static/chunks/0s9lmk8iauou3.js +0 -1
- package/dist/web/_next/static/chunks/0sp_zbx~w0am7.js +0 -1
- package/dist/web/_next/static/chunks/0tel~zsv4z8l_.js +0 -1
- package/dist/web/_next/static/chunks/0twamv4wr_dbv.js +0 -1
- package/dist/web/_next/static/chunks/0uhol5wafdbl~.js +0 -1
- package/dist/web/_next/static/chunks/0v7q4mys.mnm..css +0 -1
- package/dist/web/_next/static/chunks/0~3xm80~j9ddg.js +0 -1
- package/dist/web/_next/static/chunks/14s37n6h0_q3x.js +0 -16
- package/dist/web/_next/static/chunks/161ik5kfyuwtd.js +0 -1
- package/dist/web/_next/static/chunks/17k~zbv0_4rep.js +0 -1
- package/public/output-styles/carmack-mode.md +0 -381
- package/public/output-styles/codex-rigor-mode.md +0 -114
- package/public/output-styles/dhh-mode.md +0 -265
- package/public/output-styles/evan-you-mode.md +0 -539
- package/public/output-styles/index.json +0 -37
- package/public/output-styles/jobs-mode.md +0 -369
- package/public/output-styles/linus-mode.md +0 -135
- package/public/output-styles/uncle-bob-mode.md +0 -221
- package/public/prompt/andrej-karpathy-skills.md +0 -65
- package/public/prompt/claude-token-efficient-coding.md +0 -35
- package/public/prompt/index.json +0 -12
- package/public/skills/index.json +0 -92
- package/public/skills/planning-with-files/planning-with-files-zh/SKILL.md +0 -243
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.ps1 +0 -44
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.sh +0 -46
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.ps1 +0 -124
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.sh +0 -124
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/session-catchup.py +0 -438
- package/public/skills/planning-with-files/planning-with-files-zh/templates/findings.md +0 -29
- package/public/skills/planning-with-files/planning-with-files-zh/templates/progress.md +0 -40
- package/public/skills/planning-with-files/planning-with-files-zh/templates/task_plan.md +0 -58
- package/public/skills/superpowers/brainstorming/SKILL.md +0 -164
- package/public/skills/superpowers/brainstorming/scripts/frame-template.html +0 -214
- package/public/skills/superpowers/brainstorming/scripts/helper.js +0 -88
- package/public/skills/superpowers/brainstorming/scripts/server.cjs +0 -354
- package/public/skills/superpowers/brainstorming/scripts/start-server.sh +0 -148
- package/public/skills/superpowers/brainstorming/scripts/stop-server.sh +0 -56
- package/public/skills/superpowers/brainstorming/spec-document-reviewer-prompt.md +0 -49
- package/public/skills/superpowers/brainstorming/visual-companion.md +0 -287
- package/public/skills/superpowers/dispatching-parallel-agents/SKILL.md +0 -182
- package/public/skills/superpowers/executing-plans/SKILL.md +0 -70
- package/public/skills/superpowers/finishing-a-development-branch/SKILL.md +0 -251
- package/public/skills/superpowers/receiving-code-review/SKILL.md +0 -213
- package/public/skills/superpowers/requesting-code-review/SKILL.md +0 -103
- package/public/skills/superpowers/requesting-code-review/code-reviewer.md +0 -168
- package/public/skills/superpowers/subagent-driven-development/SKILL.md +0 -279
- package/public/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md +0 -25
- package/public/skills/superpowers/subagent-driven-development/implementer-prompt.md +0 -113
- package/public/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md +0 -61
- package/public/skills/superpowers/systematic-debugging/CREATION-LOG.md +0 -119
- package/public/skills/superpowers/systematic-debugging/SKILL.md +0 -296
- package/public/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +0 -158
- package/public/skills/superpowers/systematic-debugging/condition-based-waiting.md +0 -115
- package/public/skills/superpowers/systematic-debugging/defense-in-depth.md +0 -122
- package/public/skills/superpowers/systematic-debugging/find-polluter.sh +0 -63
- package/public/skills/superpowers/systematic-debugging/root-cause-tracing.md +0 -169
- package/public/skills/superpowers/systematic-debugging/test-academic.md +0 -14
- package/public/skills/superpowers/systematic-debugging/test-pressure-1.md +0 -58
- package/public/skills/superpowers/systematic-debugging/test-pressure-2.md +0 -68
- package/public/skills/superpowers/systematic-debugging/test-pressure-3.md +0 -69
- package/public/skills/superpowers/test-driven-development/SKILL.md +0 -371
- package/public/skills/superpowers/test-driven-development/testing-anti-patterns.md +0 -299
- package/public/skills/superpowers/using-git-worktrees/SKILL.md +0 -215
- package/public/skills/superpowers/using-superpowers/SKILL.md +0 -117
- package/public/skills/superpowers/using-superpowers/references/codex-tools.md +0 -59
- package/public/skills/superpowers/using-superpowers/references/copilot-tools.md +0 -42
- package/public/skills/superpowers/using-superpowers/references/gemini-tools.md +0 -51
- package/public/skills/superpowers/verification-before-completion/SKILL.md +0 -139
- package/public/skills/superpowers/writing-plans/SKILL.md +0 -152
- package/public/skills/superpowers/writing-plans/plan-document-reviewer-prompt.md +0 -49
- package/public/skills/superpowers/writing-skills/SKILL.md +0 -655
- package/public/skills/superpowers/writing-skills/anthropic-best-practices.md +0 -1150
- package/public/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
- package/public/skills/superpowers/writing-skills/graphviz-conventions.dot +0 -172
- package/public/skills/superpowers/writing-skills/persuasion-principles.md +0 -187
- package/public/skills/superpowers/writing-skills/render-graphs.js +0 -168
- package/public/skills/superpowers/writing-skills/testing-skills-with-subagents.md +0 -384
- /package/dist/web/_next/static/{e8w3vd9Eov_LDYWj_0zsE → x4-CsKe6qUQyFDWVtfvUg}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{e8w3vd9Eov_LDYWj_0zsE → x4-CsKe6qUQyFDWVtfvUg}/_clientMiddlewareManifest.js +0 -0
- /package/dist/web/_next/static/{e8w3vd9Eov_LDYWj_0zsE → x4-CsKe6qUQyFDWVtfvUg}/_ssgManifest.js +0 -0
|
@@ -4,7 +4,7 @@ import { summarizeResult } from '../agent-runtime-types.js';
|
|
|
4
4
|
import { prepareClaudeOutputStyleFile } from '../../services/output-style.js';
|
|
5
5
|
import { normalizeAdditionalDirectories, normalizePermissionMode, normalizeSkillNames, prepareConfigDir, resolveBundledClaudeExecutable, buildEnv, normalizeMcpServers } from './sdk-config.js';
|
|
6
6
|
import { startClaudeAdapterIfNeeded, getClaudeCodeModel } from './adapter-pool.js';
|
|
7
|
-
import { extractThinkingEvents, extractToolUseEvents, extractToolResultEvent, logToolDebug, formatMessage, isAskUserQuestionAutoResult, countUsageTokens, formatUsageLine, normalizeUsage } from './message-format.js';
|
|
7
|
+
import { extractClaudeHookEvents, extractThinkingEvents, extractToolUseEvents, extractToolResultEvent, logToolDebug, formatMessage, isAskUserQuestionAutoResult, countUsageTokens, formatUsageLine, normalizeUsage } from './message-format.js';
|
|
8
8
|
export class ClaudeCodeRuntime {
|
|
9
9
|
config;
|
|
10
10
|
abortController = null;
|
|
@@ -39,7 +39,33 @@ export class ClaudeCodeRuntime {
|
|
|
39
39
|
d(`prompt: ${prompt.slice(0, 300)}${prompt.length > 300 ? '...' : ''}`);
|
|
40
40
|
d(`sdk mcp servers | ${sdkMcpServerNames.join(',') || '-'}`);
|
|
41
41
|
const stderrLines = [];
|
|
42
|
+
let sessionId = options?.resumeSessionId;
|
|
43
|
+
const emitHook = (event, matcher = '*', payload) => {
|
|
44
|
+
options?.onEvent?.({ type: 'hook_event', event, matcher, payload });
|
|
45
|
+
};
|
|
42
46
|
try {
|
|
47
|
+
emitHook('SessionStart', '*', {
|
|
48
|
+
cwd,
|
|
49
|
+
model,
|
|
50
|
+
provider: this.config.provider,
|
|
51
|
+
baseURL,
|
|
52
|
+
permissionMode,
|
|
53
|
+
configDir,
|
|
54
|
+
sandboxDirs: additionalDirectories,
|
|
55
|
+
resumeSessionId: options?.resumeSessionId,
|
|
56
|
+
});
|
|
57
|
+
const hookUserPrompt = options?.userPrompt ?? prompt;
|
|
58
|
+
emitHook('UserPromptSubmit', '*', {
|
|
59
|
+
prompt: hookUserPrompt,
|
|
60
|
+
message: hookUserPrompt,
|
|
61
|
+
userMessage: hookUserPrompt,
|
|
62
|
+
fullPrompt: prompt,
|
|
63
|
+
cwd,
|
|
64
|
+
configDir,
|
|
65
|
+
});
|
|
66
|
+
if (/CLAUDE\.md|AGENTS\.md|\.claude\/rules\//.test(prompt)) {
|
|
67
|
+
emitHook('InstructionsLoaded', '*', { source: 'prompt', promptPreview: prompt.slice(0, 1000) });
|
|
68
|
+
}
|
|
43
69
|
const queryOptions = {
|
|
44
70
|
cwd,
|
|
45
71
|
model,
|
|
@@ -76,11 +102,13 @@ export class ClaudeCodeRuntime {
|
|
|
76
102
|
let usageLine = null;
|
|
77
103
|
let usage;
|
|
78
104
|
let costUsd;
|
|
79
|
-
let sessionId = options?.resumeSessionId;
|
|
80
105
|
let sawResult = false;
|
|
81
106
|
const pendingAskUserQuestionToolIds = new Set();
|
|
82
107
|
let waitingForUserAnswer = false;
|
|
83
108
|
for await (const message of this.activeQuery) {
|
|
109
|
+
for (const hookEvent of extractClaudeHookEvents(message)) {
|
|
110
|
+
emitHook(hookEvent.event, hookEvent.matcher, hookEvent.payload);
|
|
111
|
+
}
|
|
84
112
|
const nextSessionId = readSessionId(message);
|
|
85
113
|
if (nextSessionId && nextSessionId !== sessionId) {
|
|
86
114
|
sessionId = nextSessionId;
|
|
@@ -145,6 +173,17 @@ export class ClaudeCodeRuntime {
|
|
|
145
173
|
const elapsed = Date.now() - startTime;
|
|
146
174
|
if (waitingForUserAnswer) {
|
|
147
175
|
d(`waiting for user answer ${elapsed}ms | turns=${turns} tokens=${tokenCount}`);
|
|
176
|
+
const message = resultText || output.at(-1) || 'Waiting for user answer';
|
|
177
|
+
emitHook('Stop', '*', {
|
|
178
|
+
status: 'waiting_for_user_answer',
|
|
179
|
+
message,
|
|
180
|
+
finalMessage: message,
|
|
181
|
+
output,
|
|
182
|
+
elapsedMs: elapsed,
|
|
183
|
+
turns,
|
|
184
|
+
tokenCount,
|
|
185
|
+
sessionId,
|
|
186
|
+
});
|
|
148
187
|
if (usageLine)
|
|
149
188
|
output.push(usageLine);
|
|
150
189
|
return {
|
|
@@ -161,6 +200,7 @@ export class ClaudeCodeRuntime {
|
|
|
161
200
|
const runtimeError = extractRuntimeError([...stderrLines, ...output])
|
|
162
201
|
|| 'Claude Code execution stopped before reporting a final result';
|
|
163
202
|
d(`failed ${elapsed}ms | turns=${turns} tokens=${tokenCount} | ${runtimeError}`);
|
|
203
|
+
emitHook('StopFailure', '*', { error: runtimeError, elapsedMs: elapsed, turns, tokenCount, sessionId, stderr: stderrLines });
|
|
164
204
|
appendUnique(output, stderrLines);
|
|
165
205
|
appendUnique(output, [runtimeError]);
|
|
166
206
|
return {
|
|
@@ -176,6 +216,17 @@ export class ClaudeCodeRuntime {
|
|
|
176
216
|
}
|
|
177
217
|
if (waitingForUserAnswer && (!error || isAskUserQuestionAutoResult(error))) {
|
|
178
218
|
d(`waiting for user answer ${elapsed}ms | turns=${turns} tokens=${tokenCount}`);
|
|
219
|
+
const message = resultText || output.at(-1) || 'Waiting for user answer';
|
|
220
|
+
emitHook('Stop', '*', {
|
|
221
|
+
status: 'waiting_for_user_answer',
|
|
222
|
+
message,
|
|
223
|
+
finalMessage: message,
|
|
224
|
+
output,
|
|
225
|
+
elapsedMs: elapsed,
|
|
226
|
+
turns,
|
|
227
|
+
tokenCount,
|
|
228
|
+
sessionId,
|
|
229
|
+
});
|
|
179
230
|
if (usageLine)
|
|
180
231
|
output.push(usageLine);
|
|
181
232
|
return {
|
|
@@ -191,6 +242,7 @@ export class ClaudeCodeRuntime {
|
|
|
191
242
|
if (error) {
|
|
192
243
|
const runtimeError = extractRuntimeError([error, ...stderrLines, ...output]) || error;
|
|
193
244
|
d(`failed ${elapsed}ms | turns=${turns} tokens=${tokenCount} | ${runtimeError}`);
|
|
245
|
+
emitHook('StopFailure', '*', { error: runtimeError, elapsedMs: elapsed, turns, tokenCount, sessionId, stderr: stderrLines });
|
|
194
246
|
appendUnique(output, stderrLines);
|
|
195
247
|
if (usageLine)
|
|
196
248
|
output.push(usageLine);
|
|
@@ -213,6 +265,18 @@ export class ClaudeCodeRuntime {
|
|
|
213
265
|
const finalOutput = resultText && !output.includes(resultText) ? [...output, resultText] : output;
|
|
214
266
|
if (usageLine && !finalOutput.includes(usageLine))
|
|
215
267
|
finalOutput.push(usageLine);
|
|
268
|
+
emitHook('Stop', '*', {
|
|
269
|
+
status: 'success',
|
|
270
|
+
message: text,
|
|
271
|
+
finalMessage: text,
|
|
272
|
+
output: finalOutput,
|
|
273
|
+
elapsedMs: elapsed,
|
|
274
|
+
turns,
|
|
275
|
+
tokenCount,
|
|
276
|
+
sessionId,
|
|
277
|
+
usage,
|
|
278
|
+
costUsd,
|
|
279
|
+
});
|
|
216
280
|
return {
|
|
217
281
|
success: true,
|
|
218
282
|
summary: summarizeResult(text),
|
|
@@ -230,11 +294,13 @@ export class ClaudeCodeRuntime {
|
|
|
230
294
|
d(`failed ${elapsed}ms | ${runtimeError}`);
|
|
231
295
|
if (err instanceof Error && err.stack)
|
|
232
296
|
console.error(err.stack);
|
|
297
|
+
emitHook('StopFailure', '*', { error: runtimeError, elapsedMs: elapsed, stderr: stderrLines, stack: err instanceof Error ? err.stack : undefined });
|
|
233
298
|
appendUnique(output, stderrLines);
|
|
234
299
|
appendUnique(output, [runtimeError]);
|
|
235
300
|
return { success: false, summary: 'Claude Code execution failed', artifacts: [], error: runtimeError, output, sessionId: options?.resumeSessionId };
|
|
236
301
|
}
|
|
237
302
|
finally {
|
|
303
|
+
emitHook('SessionEnd', '*', { cwd, sessionId });
|
|
238
304
|
this.activeQuery?.close();
|
|
239
305
|
this.activeQuery = null;
|
|
240
306
|
await this.adapterRun?.release();
|
|
@@ -95,6 +95,32 @@ export function extractToolResultEvent(message) {
|
|
|
95
95
|
}
|
|
96
96
|
return null;
|
|
97
97
|
}
|
|
98
|
+
export function extractClaudeHookEvents(message) {
|
|
99
|
+
const events = [];
|
|
100
|
+
if (message.type === 'system') {
|
|
101
|
+
if (message.subtype === 'task_started') {
|
|
102
|
+
events.push({ event: 'SubagentStart', matcher: '*', payload: message });
|
|
103
|
+
}
|
|
104
|
+
else if (message.subtype === 'task_notification') {
|
|
105
|
+
events.push({ event: 'Notification', matcher: '*', payload: message });
|
|
106
|
+
}
|
|
107
|
+
else if (message.subtype === 'local_command_output') {
|
|
108
|
+
events.push({ event: 'Notification', matcher: 'local_command_output', payload: message });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (message.type === 'tool_use_summary') {
|
|
112
|
+
events.push({ event: 'PostToolBatch', matcher: '*', payload: message });
|
|
113
|
+
}
|
|
114
|
+
for (const toolUse of extractToolUseEvents(message)) {
|
|
115
|
+
if (toolUse.name === 'TaskCreate') {
|
|
116
|
+
events.push({ event: 'TaskCreated', matcher: toolUse.name, payload: toolUse });
|
|
117
|
+
}
|
|
118
|
+
if (toolUse.name === 'TaskCompleted') {
|
|
119
|
+
events.push({ event: 'TaskCompleted', matcher: toolUse.name, payload: toolUse });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return events;
|
|
123
|
+
}
|
|
98
124
|
export function logToolDebug(message, d, options = {}) {
|
|
99
125
|
switch (message.type) {
|
|
100
126
|
case 'assistant':
|
|
@@ -5,6 +5,7 @@ import { join } from 'node:path';
|
|
|
5
5
|
import { createSdkMcpServer, tool } from '@anthropic-ai/claude-agent-sdk';
|
|
6
6
|
import { isAnthropicBridgeProvider } from './types.js';
|
|
7
7
|
const require = createRequire(import.meta.url);
|
|
8
|
+
const CLAUDE_BUILT_IN_DIRS = ['agents', 'commands'];
|
|
8
9
|
export function buildEnv(config, configDir, override) {
|
|
9
10
|
const usesAnthropicBridge = isAnthropicBridgeProvider(config.provider);
|
|
10
11
|
return {
|
|
@@ -132,6 +133,7 @@ export function prepareConfigDir(configDir, agentDir) {
|
|
|
132
133
|
mkdirSync(configDir, { recursive: true });
|
|
133
134
|
if (!agentDir)
|
|
134
135
|
return;
|
|
136
|
+
copyClaudeBuiltInDirs(agentDir, configDir);
|
|
135
137
|
const sourceSkillsDir = join(agentDir, 'skills');
|
|
136
138
|
const targetSkillsDir = join(configDir, 'skills');
|
|
137
139
|
rmSync(targetSkillsDir, { recursive: true, force: true });
|
|
@@ -163,6 +165,16 @@ export function prepareConfigDir(configDir, agentDir) {
|
|
|
163
165
|
copyFileSync(source, join(targetSkillsDir, `${skillName}.md`));
|
|
164
166
|
}
|
|
165
167
|
}
|
|
168
|
+
function copyClaudeBuiltInDirs(agentDir, configDir) {
|
|
169
|
+
for (const dir of CLAUDE_BUILT_IN_DIRS) {
|
|
170
|
+
const sourceDir = join(agentDir, dir);
|
|
171
|
+
const targetDir = join(configDir, dir);
|
|
172
|
+
rmSync(targetDir, { recursive: true, force: true });
|
|
173
|
+
if (!existsSync(sourceDir) || !statSync(sourceDir).isDirectory())
|
|
174
|
+
continue;
|
|
175
|
+
cpSync(sourceDir, targetDir, { recursive: true, force: true });
|
|
176
|
+
}
|
|
177
|
+
}
|
|
166
178
|
function hasSkillContent(skill, configDir) {
|
|
167
179
|
if (!configDir)
|
|
168
180
|
return true;
|
package/dist/adapters/git.js
CHANGED
|
@@ -78,18 +78,20 @@ function mapStatus(raw) {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
async function getUpstreamRef(git, branch) {
|
|
81
|
+
const refExists = async (ref) => {
|
|
82
|
+
return git.raw(['rev-parse', '--verify', '--quiet', ref])
|
|
83
|
+
.then(() => true)
|
|
84
|
+
.catch(() => false);
|
|
85
|
+
};
|
|
81
86
|
const upstream = await git.raw(['rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{u}'])
|
|
82
87
|
.then(v => v.trim())
|
|
83
88
|
.catch(() => '');
|
|
84
|
-
if (upstream)
|
|
89
|
+
if (upstream && await refExists(upstream))
|
|
85
90
|
return upstream;
|
|
86
91
|
if (!branch || branch === 'HEAD')
|
|
87
92
|
return null;
|
|
88
93
|
const originBranch = `origin/${branch}`;
|
|
89
|
-
|
|
90
|
-
.then(() => true)
|
|
91
|
-
.catch(() => false);
|
|
92
|
-
return hasOriginBranch ? originBranch : null;
|
|
94
|
+
return await refExists(originBranch) ? originBranch : null;
|
|
93
95
|
}
|
|
94
96
|
function splitConflictSides(content) {
|
|
95
97
|
const left = [];
|
|
@@ -266,7 +268,12 @@ export async function gitLog(workspaceId, maxCount = 50) {
|
|
|
266
268
|
const upstream = await getUpstreamRef(git, status.current || 'HEAD');
|
|
267
269
|
const refs = upstream ? ['HEAD', upstream] : ['HEAD'];
|
|
268
270
|
const pretty = '%H%x1f%s%x1f%an%x1f%aI%x1e';
|
|
269
|
-
const
|
|
271
|
+
const logArgs = ['log', `--max-count=${maxCount}`, `--pretty=format:${pretty}`];
|
|
272
|
+
const raw = await git.raw([...logArgs, ...refs]).catch((err) => {
|
|
273
|
+
if (!upstream)
|
|
274
|
+
throw err;
|
|
275
|
+
return git.raw([...logArgs, 'HEAD']);
|
|
276
|
+
});
|
|
270
277
|
return raw.split('\x1e')
|
|
271
278
|
.map(record => record.trim())
|
|
272
279
|
.filter(Boolean)
|
|
@@ -27,13 +27,14 @@ export async function runCommitAgent(workspaceId) {
|
|
|
27
27
|
const workingDir = agentService.resolveWorkingDir(workspaceId, commitAgent);
|
|
28
28
|
const systemPrompt = commitAgent.systemPrompt?.trim() || DEFAULT_SYSTEM_PROMPT;
|
|
29
29
|
const truncatedDiff = diff.length > 8000 ? diff.substring(0, 8000) + '\n... (truncated)' : diff;
|
|
30
|
-
const
|
|
30
|
+
const userPrompt = [
|
|
31
31
|
'Generate exactly one commit message for these changes.',
|
|
32
32
|
'Do not inspect files or run commands. Use only this diff.',
|
|
33
33
|
'Output only the commit message.',
|
|
34
34
|
'',
|
|
35
35
|
truncatedDiff,
|
|
36
|
-
].join('\n')
|
|
36
|
+
].join('\n');
|
|
37
|
+
const result = await runtime.execute(prependPersistentAgentContext(userPrompt, {
|
|
37
38
|
workspaceId,
|
|
38
39
|
workingDir,
|
|
39
40
|
boundDirs: ws.boundDirs,
|
|
@@ -41,6 +42,7 @@ export async function runCommitAgent(workspaceId) {
|
|
|
41
42
|
excludeNativeClaudeMd: commitAgent.runtimeKind === 'claude-code',
|
|
42
43
|
}), workingDir, {
|
|
43
44
|
maxTurns: 1,
|
|
45
|
+
userPrompt,
|
|
44
46
|
systemPrompt,
|
|
45
47
|
outputStyle: commitAgent.outputStyle,
|
|
46
48
|
});
|
|
@@ -49,8 +49,10 @@ export async function syncIssueTasksAfterPlanning(workspaceId, issueId, input, c
|
|
|
49
49
|
},
|
|
50
50
|
});
|
|
51
51
|
const runtime = createRuntimeForPreset(taskSyncPreset);
|
|
52
|
-
const
|
|
52
|
+
const taskSyncUserPrompt = buildTaskSyncPrompt(issue, input, taskSyncWorkingDir);
|
|
53
|
+
const result = await runtime.execute(buildIssueAgentPrompt(workspaceId, taskSyncUserPrompt, taskSyncWorkingDir, taskSyncPreset), taskSyncWorkingDir, {
|
|
53
54
|
maxTurns: 20,
|
|
55
|
+
userPrompt: taskSyncUserPrompt,
|
|
54
56
|
mcpServers: undefined,
|
|
55
57
|
functionTools: createTaskSyncTools(workspaceId, issue, taskSyncPreset, ctx),
|
|
56
58
|
skills: [],
|
|
@@ -199,8 +201,10 @@ export async function runIssueTask(workspaceId, issueId, taskId, ctx) {
|
|
|
199
201
|
});
|
|
200
202
|
let result;
|
|
201
203
|
try {
|
|
202
|
-
|
|
204
|
+
const taskUserPrompt = buildTaskAgentPrompt(issue, runningTask, taskAgentPreset, agentWorkingDir);
|
|
205
|
+
result = await runtime.execute(buildIssueAgentPrompt(workspaceId, taskUserPrompt, agentWorkingDir, taskAgentPreset), agentWorkingDir, {
|
|
203
206
|
maxTurns: 100,
|
|
207
|
+
userPrompt: taskUserPrompt,
|
|
204
208
|
mcpServers: agentService.getMcpServers(taskAgentPreset.mcps),
|
|
205
209
|
functionTools: createCurrentIssueTools(workspaceId, issue, taskAgentPreset),
|
|
206
210
|
skills: agentService.getAvailableSkillNames(agentService.getAgentConfigDir(workspaceId, taskAgentPreset), taskAgentPreset.skills),
|
package/dist/app.js
CHANGED
|
@@ -5,7 +5,7 @@ import express from 'express';
|
|
|
5
5
|
import cors from 'cors';
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
7
|
import { WebSocketServer } from 'ws';
|
|
8
|
-
import { existsSync, mkdirSync,
|
|
8
|
+
import { existsSync, mkdirSync, readdirSync } from 'node:fs';
|
|
9
9
|
import { writeFile } from 'node:fs/promises';
|
|
10
10
|
import { join, dirname, extname, basename } from 'node:path';
|
|
11
11
|
import { fileURLToPath } from 'node:url';
|
|
@@ -35,6 +35,7 @@ import databaseRouter from './routes/database.js';
|
|
|
35
35
|
import kanbanRouter from './routes/kanban.js';
|
|
36
36
|
import speechRecognitionRouter, { handleSpeechStream } from './routes/speech-recognition.js';
|
|
37
37
|
import agentCommandsRouter from './routes/agent-commands.js';
|
|
38
|
+
import robotAccountRouter from './routes/robot-account.js';
|
|
38
39
|
import { getUserSettings, setUserAvatarUrl, removeUserAvatarUrl } from './storage/user-settings-store.js';
|
|
39
40
|
import { authMiddleware, verifyToken } from './middleware/auth.js';
|
|
40
41
|
import { handleConnection } from './ws/handler.js';
|
|
@@ -70,73 +71,9 @@ app.use('/api', authMiddleware);
|
|
|
70
71
|
// Serve static files from public/
|
|
71
72
|
const publicDir = resolveRuntimeDir('public');
|
|
72
73
|
app.use('/public', express.static(publicDir));
|
|
73
|
-
//
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (!existsSync(promptDir))
|
|
77
|
-
return;
|
|
78
|
-
const files = readdirSync(promptDir).filter((f) => f.endsWith('.md'));
|
|
79
|
-
const index = files.map((filename) => {
|
|
80
|
-
const id = basename(filename, '.md');
|
|
81
|
-
const content = readFileSync(join(promptDir, filename), 'utf-8');
|
|
82
|
-
const firstHeading = content.split('\n').find((l) => /^#\s+/.test(l));
|
|
83
|
-
const name = firstHeading ? firstHeading.replace(/^#\s+/, '').trim() : id.replace(/[-_]/g, ' ');
|
|
84
|
-
return { id, name, filename };
|
|
85
|
-
});
|
|
86
|
-
writeFileSync(join(promptDir, 'index.json'), JSON.stringify(index, null, 2), 'utf-8');
|
|
87
|
-
console.log(`[prompt-store] scanned ${index.length} templates`);
|
|
88
|
-
}
|
|
89
|
-
scanPromptStore();
|
|
90
|
-
// Scan public/output-styles/ and generate index.json
|
|
91
|
-
function scanOutputStyleStore() {
|
|
92
|
-
const dir = join(publicDir, 'output-styles');
|
|
93
|
-
if (!existsSync(dir))
|
|
94
|
-
return;
|
|
95
|
-
const files = readdirSync(dir).filter((f) => f.endsWith('.md'));
|
|
96
|
-
const index = files.map((filename) => {
|
|
97
|
-
const id = basename(filename, '.md');
|
|
98
|
-
const content = readFileSync(join(dir, filename), 'utf-8');
|
|
99
|
-
const firstHeading = content.split('\n').find((l) => /^#\s+/.test(l));
|
|
100
|
-
const name = firstHeading ? firstHeading.replace(/^#\s+/, '').trim() : id.replace(/[-_]/g, ' ');
|
|
101
|
-
return { id, name, filename };
|
|
102
|
-
});
|
|
103
|
-
writeFileSync(join(dir, 'index.json'), JSON.stringify(index, null, 2), 'utf-8');
|
|
104
|
-
console.log(`[output-style-store] scanned ${index.length} templates`);
|
|
105
|
-
}
|
|
106
|
-
scanOutputStyleStore();
|
|
107
|
-
// Scan public/skills/{group}/{skill-name}/SKILL.md and generate index.json
|
|
108
|
-
function scanSkillStore() {
|
|
109
|
-
const dir = join(publicDir, 'skills');
|
|
110
|
-
if (!existsSync(dir))
|
|
111
|
-
return;
|
|
112
|
-
const index = [];
|
|
113
|
-
for (const groupEntry of readdirSync(dir, { withFileTypes: true })) {
|
|
114
|
-
if (!groupEntry.isDirectory())
|
|
115
|
-
continue;
|
|
116
|
-
const group = groupEntry.name;
|
|
117
|
-
const groupDir = join(dir, group);
|
|
118
|
-
for (const skillEntry of readdirSync(groupDir, { withFileTypes: true })) {
|
|
119
|
-
if (!skillEntry.isDirectory())
|
|
120
|
-
continue;
|
|
121
|
-
const skillName = skillEntry.name;
|
|
122
|
-
const skillFile = join(groupDir, skillName, 'SKILL.md');
|
|
123
|
-
if (!existsSync(skillFile))
|
|
124
|
-
continue;
|
|
125
|
-
const content = readFileSync(skillFile, 'utf-8');
|
|
126
|
-
const fm = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
127
|
-
let name = skillName;
|
|
128
|
-
if (fm) {
|
|
129
|
-
const nameLine = fm[1].split(/\r?\n/).find((l) => /^\s*name\s*:/i.test(l));
|
|
130
|
-
if (nameLine)
|
|
131
|
-
name = nameLine.split(':', 2)[1].trim() || skillName;
|
|
132
|
-
}
|
|
133
|
-
index.push({ id: skillName, name, group, path: `${group}/${skillName}` });
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
writeFileSync(join(dir, 'index.json'), JSON.stringify(index, null, 2), 'utf-8');
|
|
137
|
-
console.log(`[skill-store] scanned ${index.length} skills`);
|
|
138
|
-
}
|
|
139
|
-
scanSkillStore();
|
|
74
|
+
// Serve agents store from packages/agents/
|
|
75
|
+
const agentsDir = resolveRuntimeDir('../agents');
|
|
76
|
+
app.use('/agents-store', express.static(agentsDir));
|
|
140
77
|
app.get('/api/health', (_req, res) => {
|
|
141
78
|
res.json({ status: 'ok', timestamp: new Date().toISOString(), platform: process.platform });
|
|
142
79
|
});
|
|
@@ -265,6 +202,7 @@ app.use('/api/mcps', mcpRouter);
|
|
|
265
202
|
app.use('/api/subscriptions', subscriptionRouter);
|
|
266
203
|
app.use('/api/speech-recognition', speechRecognitionRouter);
|
|
267
204
|
app.use('/api/agent-commands', agentCommandsRouter);
|
|
205
|
+
app.use('/api/robot-accounts', robotAccountRouter);
|
|
268
206
|
// Serve static web frontend in production (after API routes, before catch-all)
|
|
269
207
|
const webDir = resolveRuntimeDir('web');
|
|
270
208
|
if (existsSync(webDir)) {
|
package/dist/routes/agent-sse.js
CHANGED
package/dist/routes/agent.js
CHANGED
|
@@ -22,6 +22,9 @@ router.post('/presets', (req, res) => {
|
|
|
22
22
|
const preset = agentService.createPreset(req.params.id, body);
|
|
23
23
|
res.status(201).json(preset);
|
|
24
24
|
});
|
|
25
|
+
router.post('/presets/sync-workspaces', (_req, res) => {
|
|
26
|
+
res.json(agentService.syncTemplatesToAllWorkspaces());
|
|
27
|
+
});
|
|
25
28
|
router.post('/presets/generate', async (req, res) => {
|
|
26
29
|
const { prompt } = req.body;
|
|
27
30
|
if (!prompt?.trim()) {
|
package/dist/routes/database.js
CHANGED
|
@@ -84,6 +84,7 @@ router.post('/chat', async (req, res) => {
|
|
|
84
84
|
});
|
|
85
85
|
const result = await runtime.execute(buildDatabaseAgentPrompt(workspaceId, agent, prompt, history ?? []), workingDir, {
|
|
86
86
|
maxTurns: 60,
|
|
87
|
+
userPrompt: prompt,
|
|
87
88
|
functionTools,
|
|
88
89
|
mcpServers: {},
|
|
89
90
|
skills: [],
|