@agent-spaces/server 0.3.63 → 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 +27 -1
- package/dist/adapters/claude-code-runtime/sdk-config.js +12 -0
- package/dist/adapters/git.js +168 -57
- package/dist/agents/agent-designer.js +66 -12
- package/dist/agents/agent-message-parts.js +1 -1
- package/dist/agents/commit-agent.js +4 -2
- package/dist/agents/issue-task-controller.js +7 -3
- package/dist/app.js +56 -69
- package/dist/package.json +1 -1
- package/dist/routes/agent-commands.js +72 -0
- package/dist/routes/agent-sse.js +7 -0
- package/dist/routes/agent.js +18 -1
- package/dist/routes/database.js +346 -0
- package/dist/routes/git.js +198 -267
- package/dist/routes/kanban.js +39 -0
- package/dist/routes/robot-account.js +68 -0
- package/dist/services/agent-commands.js +168 -0
- package/dist/services/agent.js +36 -2
- package/dist/services/builtin-tools/command-tools.js +117 -0
- package/dist/services/builtin-tools/database-tools.js +578 -0
- package/dist/services/builtin-tools/index.js +5 -0
- package/dist/services/builtin-tools/input-helpers.js +26 -0
- package/dist/services/builtin-tools/issue-tools.js +209 -0
- package/dist/services/builtin-tools/kanban-tools.js +281 -0
- package/dist/services/database-vector.js +244 -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/kanban.js +50 -0
- 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/database-store.js +365 -0
- package/dist/storage/kanban-store.js +142 -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 +24 -31
- package/dist/web/__next._head.txt +4 -4
- package/dist/web/__next._index.txt +14 -14
- package/dist/web/__next._tree.txt +3 -8
- package/dist/web/_next/static/chunks/0-a.-hl3wv99k.js +1 -0
- 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/{13~y-b.b9rrw4.js → 01~quun6sefgl.js} +1 -1
- 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/{0-oog4zg4_m~m.css → 062f9zqctzg.b.css} +0 -3
- 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/{0kof5qdg8c2-k.js → 08x85faoz58i7.js} +37 -37
- package/dist/web/_next/static/chunks/0_cqojbge48kq.js +5 -0
- package/dist/web/_next/static/chunks/0_mvduwjsm35w.js +1 -0
- package/dist/web/_next/static/chunks/0d6~~lv0-6kex.js +3 -0
- package/dist/web/_next/static/chunks/{0ogpc3f3keopc.js → 0db14450oqzhg.js} +2 -2
- package/dist/web/_next/static/chunks/0fttswpzu69qx.js +1 -0
- package/dist/web/_next/static/chunks/0gdwop9cnpmtu.js +1 -0
- package/dist/web/_next/static/chunks/0ghx3j_.-gdyd.js +1 -0
- package/dist/web/_next/static/chunks/0j-l7l_k9jt45.js +1 -0
- package/dist/web/_next/static/chunks/0k4zdm72k_bfy.js +1 -0
- package/dist/web/_next/static/chunks/0kbvoxla7f751.js +1 -0
- package/dist/web/_next/static/chunks/{0aa6bcdmtpekn.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/{002-dxhags4dj.js → 0v6hte2z-32ca.js} +2 -2
- package/dist/web/_next/static/chunks/{014x2qbuiszni.js → 0vis~lx0nxgn-.js} +3 -3
- package/dist/web/_next/static/chunks/{0y09i51u6ixq5.js → 0w7.tb29958zj.js} +1 -1
- package/dist/web/_next/static/chunks/0xbaakj0dfc0..js +1 -0
- 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/0z~vqzbm_q371.js +1 -0
- package/dist/web/_next/static/chunks/0~~_ltu6dx_ch.js +1 -0
- package/dist/web/_next/static/chunks/{02c22g~xd-y30.js → 11cchuwoupmbf.js} +2 -2
- package/dist/web/_next/static/chunks/12jm4gwmvq-0q.js +90 -0
- 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 +31 -30
- package/dist/web/_not-found/__next._head.txt +4 -4
- package/dist/web/_not-found/__next._index.txt +14 -14
- 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 +3 -3
- package/dist/web/_not-found.html +1 -1
- package/dist/web/_not-found.txt +31 -30
- package/dist/web/index.html +1 -1
- package/dist/web/index.txt +24 -31
- package/dist/web/login/__next._full.txt +32 -36
- package/dist/web/login/__next._head.txt +4 -4
- package/dist/web/login/__next._index.txt +14 -14
- package/dist/web/login/__next._tree.txt +3 -8
- 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 +32 -36
- package/dist/web/settings/__next._full.txt +34 -38
- package/dist/web/settings/__next._head.txt +4 -4
- package/dist/web/settings/__next._index.txt +14 -14
- package/dist/web/settings/__next._tree.txt +3 -8
- 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 +27 -32
- package/dist/web/settings/agents/__next._head.txt +4 -4
- package/dist/web/settings/agents/__next._index.txt +14 -14
- package/dist/web/settings/agents/__next._tree.txt +3 -8
- 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 +27 -32
- package/dist/web/settings/mcps/__next._full.txt +27 -32
- package/dist/web/settings/mcps/__next._head.txt +4 -4
- package/dist/web/settings/mcps/__next._index.txt +14 -14
- package/dist/web/settings/mcps/__next._tree.txt +3 -8
- 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 +27 -32
- package/dist/web/settings/models/__next._full.txt +27 -32
- package/dist/web/settings/models/__next._head.txt +4 -4
- package/dist/web/settings/models/__next._index.txt +14 -14
- package/dist/web/settings/models/__next._tree.txt +3 -8
- 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 +27 -32
- package/dist/web/settings/output-styles/__next._full.txt +27 -32
- package/dist/web/settings/output-styles/__next._head.txt +4 -4
- package/dist/web/settings/output-styles/__next._index.txt +14 -14
- package/dist/web/settings/output-styles/__next._tree.txt +3 -8
- 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 +27 -32
- package/dist/web/settings/prompts/__next._full.txt +27 -32
- package/dist/web/settings/prompts/__next._head.txt +4 -4
- package/dist/web/settings/prompts/__next._index.txt +14 -14
- package/dist/web/settings/prompts/__next._tree.txt +3 -8
- 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 +27 -32
- package/dist/web/settings/providers/__next._full.txt +27 -32
- package/dist/web/settings/providers/__next._head.txt +4 -4
- package/dist/web/settings/providers/__next._index.txt +14 -14
- package/dist/web/settings/providers/__next._tree.txt +3 -8
- 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 +27 -32
- package/dist/web/settings/skills/__next._full.txt +27 -32
- package/dist/web/settings/skills/__next._head.txt +4 -4
- package/dist/web/settings/skills/__next._index.txt +14 -14
- package/dist/web/settings/skills/__next._tree.txt +3 -8
- 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 +27 -32
- package/dist/web/settings/tools/__next._full.txt +38 -0
- package/dist/web/settings/tools/__next._head.txt +6 -0
- package/dist/web/settings/tools/__next._index.txt +15 -0
- package/dist/web/settings/tools/__next._tree.txt +3 -0
- package/dist/web/settings/tools/__next.settings.tools.__PAGE__.txt +9 -0
- package/dist/web/settings/tools/__next.settings.tools.txt +5 -0
- package/dist/web/settings/tools/__next.settings.txt +7 -0
- package/dist/web/settings/tools.html +1 -0
- package/dist/web/settings/tools.txt +38 -0
- package/dist/web/settings.html +1 -1
- package/dist/web/settings.txt +34 -38
- package/dist/web/workflows/__next._full.txt +32 -38
- package/dist/web/workflows/__next._head.txt +4 -4
- package/dist/web/workflows/__next._index.txt +14 -14
- package/dist/web/workflows/__next._tree.txt +3 -8
- 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 +32 -38
- package/dist/web/workspace/_/__next._full.txt +31 -36
- package/dist/web/workspace/_/__next._head.txt +4 -4
- package/dist/web/workspace/_/__next._index.txt +14 -14
- package/dist/web/workspace/_/__next._tree.txt +4 -8
- 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 +31 -36
- package/dist/web/workspaces/__next._full.txt +30 -37
- package/dist/web/workspaces/__next._head.txt +4 -4
- package/dist/web/workspaces/__next._index.txt +14 -14
- package/dist/web/workspaces/__next._tree.txt +3 -8
- 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 +30 -37
- package/dist/ws/agent-prompt.js +45 -8
- package/dist/ws/agent-runner.js +88 -10
- package/package.json +1 -1
- package/dist/web/_next/static/chunks/0-1bfvfwifh-m.js +0 -1
- package/dist/web/_next/static/chunks/02mf61htij8g0.js +0 -31
- package/dist/web/_next/static/chunks/046me66nilkff.js +0 -1
- package/dist/web/_next/static/chunks/04v-pqqs-2lvp.css +0 -1
- package/dist/web/_next/static/chunks/06w~.izyfylap.js +0 -1
- package/dist/web/_next/static/chunks/09t62a89~jesc.js +0 -3
- package/dist/web/_next/static/chunks/09y_3krccdd~u.js +0 -1
- package/dist/web/_next/static/chunks/0_e~hmntdfop9.js +0 -1
- package/dist/web/_next/static/chunks/0_udc.6.tueey.js +0 -1
- package/dist/web/_next/static/chunks/0cke33d38fnby.js +0 -90
- package/dist/web/_next/static/chunks/0cyq~8xb~r5fc.js +0 -1
- package/dist/web/_next/static/chunks/0ewceguykiut5.js +0 -1
- package/dist/web/_next/static/chunks/0fxa1edqr7dve.js +0 -1
- package/dist/web/_next/static/chunks/0hra80eyuu37u.js +0 -1
- package/dist/web/_next/static/chunks/0ie7y4k2ncvnn.js +0 -1
- package/dist/web/_next/static/chunks/0igc~uli58ncw.js +0 -2
- package/dist/web/_next/static/chunks/0msb2mi3hiu5_.js +0 -67
- package/dist/web/_next/static/chunks/0p1n8bvfnpl41.js +0 -1
- package/dist/web/_next/static/chunks/0ppr271hz0xoq.js +0 -1
- package/dist/web/_next/static/chunks/0s_dva~eh2yhi.js +0 -3
- package/dist/web/_next/static/chunks/0typj55ox8d5i.js +0 -1
- package/dist/web/_next/static/chunks/0w2p4ldi2aymp.js +0 -1
- package/dist/web/_next/static/chunks/0zc0xgp5ourcn.js +0 -1
- package/dist/web/_next/static/chunks/0zmhdridea1s5.js +0 -90
- package/dist/web/_next/static/chunks/10.alq.6stmld.js +0 -1
- package/dist/web/_next/static/chunks/11b3zgk1etlkw.js +0 -7
- package/dist/web/_next/static/chunks/11qp8r5dotf7d.js +0 -1
- package/dist/web/_next/static/chunks/12mxlicp247c8.js +0 -1
- package/dist/web/_next/static/chunks/135w27dd8c19s.js +0 -5
- package/dist/web/_next/static/chunks/176dc-dtokxxi.js +0 -16
- package/dist/web/_next/static/chunks/17g-0pqre.anw.js +0 -1
- package/dist/web/_next/static/media/0a7740363b4d4863-s.1110aazvokzp..woff2 +0 -0
- package/dist/web/_next/static/media/0da9c7f357bd9d4d-s.0ek5sshv8wk3m.woff2 +0 -0
- package/dist/web/_next/static/media/1b99372b3eaef0c8-s.p.0gx2haw2tmll8.woff2 +0 -0
- package/dist/web/_next/static/media/41e95f694c5c4549-s.0r1jrq7neqdsq.woff2 +0 -0
- package/dist/web/_next/static/media/5c285b27cdda1fe8-s.p.0yo6-5yoeeudq.woff2 +0 -0
- package/dist/web/_next/static/media/5f9d24ebef5d5292-s.0esuu2f5si~v8.woff2 +0 -0
- package/dist/web/_next/static/media/6c55a692938ebbbc-s.0g6rbszwfgn9y.woff2 +0 -0
- package/dist/web/_next/static/media/8e6fa89aa22d24ec-s.p.0uvzar8hswo3p.woff2 +0 -0
- package/dist/web/_next/static/media/a218039a3287bcfd-s.p.17-1enzs_j91b.woff2 +0 -0
- package/dist/web/_next/static/media/b2ea385cb5ae8625-s.0kjod.kaq1k69.woff2 +0 -0
- package/dist/web/_next/static/media/bdc7e24a509eb931-s.0apt5mko2.qn3.woff2 +0 -0
- package/dist/web/_next/static/media/c3cb240f9c892514-s.163v2i5cux7-c.woff2 +0 -0
- package/dist/web/_next/static/media/e2334d715941921e-s.p.12skym0rqknxy.woff2 +0 -0
- 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/{OoXAsPtrUWjC1l898FSvI → x4-CsKe6qUQyFDWVtfvUg}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{OoXAsPtrUWjC1l898FSvI → x4-CsKe6qUQyFDWVtfvUg}/_clientMiddlewareManifest.js +0 -0
- /package/dist/web/_next/static/{OoXAsPtrUWjC1l898FSvI → x4-CsKe6qUQyFDWVtfvUg}/_ssgManifest.js +0 -0
|
@@ -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
|
});
|
|
@@ -5,7 +5,7 @@ import * as issueService from '../services/issue.js';
|
|
|
5
5
|
import * as taskService from '../services/task.js';
|
|
6
6
|
import * as workspaceService from '../services/workspace.js';
|
|
7
7
|
import { mapWorkflowToTaskDrafts, validateWorkflowForRun } from '../services/workflow.js';
|
|
8
|
-
import { createIssueFunctionTools } from '../services/builtin-tools.js';
|
|
8
|
+
import { createIssueFunctionTools } from '../services/builtin-tools/index.js';
|
|
9
9
|
import { getThinkingRuntimeConfig } from '../services/llm-model-config.js';
|
|
10
10
|
import { prependPersistentAgentContext } from '../services/persistent-agent-context.js';
|
|
11
11
|
import { completeIssueAgentProgress, createIssueAgentProgress, createIssueAgentProgressTracker } from './issue-agent-progress.js';
|
|
@@ -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,9 +5,9 @@ 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
|
-
import { join, dirname, basename } from 'node:path';
|
|
10
|
+
import { join, dirname, extname, basename } from 'node:path';
|
|
11
11
|
import { fileURLToPath } from 'node:url';
|
|
12
12
|
import workspaceRouter from './routes/workspace.js';
|
|
13
13
|
import fileRouter from './routes/file.js';
|
|
@@ -31,7 +31,11 @@ import subscriptionRouter from './routes/subscription.js';
|
|
|
31
31
|
import agentSseRouter from './routes/agent-sse.js';
|
|
32
32
|
import searchRouter from './routes/search.js';
|
|
33
33
|
import notificationRouter from './routes/notification.js';
|
|
34
|
+
import databaseRouter from './routes/database.js';
|
|
35
|
+
import kanbanRouter from './routes/kanban.js';
|
|
34
36
|
import speechRecognitionRouter, { handleSpeechStream } from './routes/speech-recognition.js';
|
|
37
|
+
import agentCommandsRouter from './routes/agent-commands.js';
|
|
38
|
+
import robotAccountRouter from './routes/robot-account.js';
|
|
35
39
|
import { getUserSettings, setUserAvatarUrl, removeUserAvatarUrl } from './storage/user-settings-store.js';
|
|
36
40
|
import { authMiddleware, verifyToken } from './middleware/auth.js';
|
|
37
41
|
import { handleConnection } from './ws/handler.js';
|
|
@@ -67,73 +71,9 @@ app.use('/api', authMiddleware);
|
|
|
67
71
|
// Serve static files from public/
|
|
68
72
|
const publicDir = resolveRuntimeDir('public');
|
|
69
73
|
app.use('/public', express.static(publicDir));
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (!existsSync(promptDir))
|
|
74
|
-
return;
|
|
75
|
-
const files = readdirSync(promptDir).filter((f) => f.endsWith('.md'));
|
|
76
|
-
const index = files.map((filename) => {
|
|
77
|
-
const id = basename(filename, '.md');
|
|
78
|
-
const content = readFileSync(join(promptDir, filename), 'utf-8');
|
|
79
|
-
const firstHeading = content.split('\n').find((l) => /^#\s+/.test(l));
|
|
80
|
-
const name = firstHeading ? firstHeading.replace(/^#\s+/, '').trim() : id.replace(/[-_]/g, ' ');
|
|
81
|
-
return { id, name, filename };
|
|
82
|
-
});
|
|
83
|
-
writeFileSync(join(promptDir, 'index.json'), JSON.stringify(index, null, 2), 'utf-8');
|
|
84
|
-
console.log(`[prompt-store] scanned ${index.length} templates`);
|
|
85
|
-
}
|
|
86
|
-
scanPromptStore();
|
|
87
|
-
// Scan public/output-styles/ and generate index.json
|
|
88
|
-
function scanOutputStyleStore() {
|
|
89
|
-
const dir = join(publicDir, 'output-styles');
|
|
90
|
-
if (!existsSync(dir))
|
|
91
|
-
return;
|
|
92
|
-
const files = readdirSync(dir).filter((f) => f.endsWith('.md'));
|
|
93
|
-
const index = files.map((filename) => {
|
|
94
|
-
const id = basename(filename, '.md');
|
|
95
|
-
const content = readFileSync(join(dir, filename), 'utf-8');
|
|
96
|
-
const firstHeading = content.split('\n').find((l) => /^#\s+/.test(l));
|
|
97
|
-
const name = firstHeading ? firstHeading.replace(/^#\s+/, '').trim() : id.replace(/[-_]/g, ' ');
|
|
98
|
-
return { id, name, filename };
|
|
99
|
-
});
|
|
100
|
-
writeFileSync(join(dir, 'index.json'), JSON.stringify(index, null, 2), 'utf-8');
|
|
101
|
-
console.log(`[output-style-store] scanned ${index.length} templates`);
|
|
102
|
-
}
|
|
103
|
-
scanOutputStyleStore();
|
|
104
|
-
// Scan public/skills/{group}/{skill-name}/SKILL.md and generate index.json
|
|
105
|
-
function scanSkillStore() {
|
|
106
|
-
const dir = join(publicDir, 'skills');
|
|
107
|
-
if (!existsSync(dir))
|
|
108
|
-
return;
|
|
109
|
-
const index = [];
|
|
110
|
-
for (const groupEntry of readdirSync(dir, { withFileTypes: true })) {
|
|
111
|
-
if (!groupEntry.isDirectory())
|
|
112
|
-
continue;
|
|
113
|
-
const group = groupEntry.name;
|
|
114
|
-
const groupDir = join(dir, group);
|
|
115
|
-
for (const skillEntry of readdirSync(groupDir, { withFileTypes: true })) {
|
|
116
|
-
if (!skillEntry.isDirectory())
|
|
117
|
-
continue;
|
|
118
|
-
const skillName = skillEntry.name;
|
|
119
|
-
const skillFile = join(groupDir, skillName, 'SKILL.md');
|
|
120
|
-
if (!existsSync(skillFile))
|
|
121
|
-
continue;
|
|
122
|
-
const content = readFileSync(skillFile, 'utf-8');
|
|
123
|
-
const fm = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
124
|
-
let name = skillName;
|
|
125
|
-
if (fm) {
|
|
126
|
-
const nameLine = fm[1].split(/\r?\n/).find((l) => /^\s*name\s*:/i.test(l));
|
|
127
|
-
if (nameLine)
|
|
128
|
-
name = nameLine.split(':', 2)[1].trim() || skillName;
|
|
129
|
-
}
|
|
130
|
-
index.push({ id: skillName, name, group, path: `${group}/${skillName}` });
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
writeFileSync(join(dir, 'index.json'), JSON.stringify(index, null, 2), 'utf-8');
|
|
134
|
-
console.log(`[skill-store] scanned ${index.length} skills`);
|
|
135
|
-
}
|
|
136
|
-
scanSkillStore();
|
|
74
|
+
// Serve agents store from packages/agents/
|
|
75
|
+
const agentsDir = resolveRuntimeDir('../agents');
|
|
76
|
+
app.use('/agents-store', express.static(agentsDir));
|
|
137
77
|
app.get('/api/health', (_req, res) => {
|
|
138
78
|
res.json({ status: 'ok', timestamp: new Date().toISOString(), platform: process.platform });
|
|
139
79
|
});
|
|
@@ -158,6 +98,49 @@ app.post('/api/upload/avatar', async (req, res) => {
|
|
|
158
98
|
await writeFile(join(avatarsDir, name), Buffer.from(base64, 'base64'));
|
|
159
99
|
res.json({ url: `/static/avatars/${name}` });
|
|
160
100
|
});
|
|
101
|
+
// Font upload
|
|
102
|
+
const FONT_EXTS = new Set(['.ttf', '.otf', '.woff', '.woff2']);
|
|
103
|
+
const fontsDir = join(publicDir, 'fonts');
|
|
104
|
+
if (!existsSync(fontsDir))
|
|
105
|
+
mkdirSync(fontsDir, { recursive: true });
|
|
106
|
+
app.get('/api/fonts', (_req, res) => {
|
|
107
|
+
if (!existsSync(fontsDir)) {
|
|
108
|
+
res.json([]);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const fonts = readdirSync(fontsDir).filter(f => FONT_EXTS.has(extname(f).toLowerCase()));
|
|
112
|
+
res.json(fonts.map(f => ({ name: f, url: `/static/fonts/${f}` })));
|
|
113
|
+
});
|
|
114
|
+
app.post('/api/fonts/upload', async (req, res) => {
|
|
115
|
+
const { name, content } = req.body;
|
|
116
|
+
if (!name || !content) {
|
|
117
|
+
res.status(400).json({ error: 'name and content are required' });
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const ext = extname(name).toLowerCase();
|
|
121
|
+
if (!FONT_EXTS.has(ext)) {
|
|
122
|
+
res.status(400).json({ error: 'Unsupported font format' });
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const safeName = basename(name).replace(/[^a-zA-Z0-9._-]/g, '_');
|
|
126
|
+
await writeFile(join(fontsDir, safeName), Buffer.from(content, 'base64'));
|
|
127
|
+
res.json({ name: safeName, url: `/static/fonts/${safeName}` });
|
|
128
|
+
});
|
|
129
|
+
app.delete('/api/fonts/:name', (req, res) => {
|
|
130
|
+
const name = basename(req.params.name);
|
|
131
|
+
const ext = extname(name).toLowerCase();
|
|
132
|
+
if (!FONT_EXTS.has(ext)) {
|
|
133
|
+
res.status(400).json({ error: 'Invalid font file' });
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const filePath = join(fontsDir, name);
|
|
137
|
+
if (!existsSync(filePath)) {
|
|
138
|
+
res.status(404).json({ error: 'Font not found' });
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
import('node:fs').then(fs => fs.unlinkSync(filePath));
|
|
142
|
+
res.json({ ok: true });
|
|
143
|
+
});
|
|
161
144
|
// User settings
|
|
162
145
|
app.get('/api/user/settings', (_req, res) => {
|
|
163
146
|
const settings = getUserSettings();
|
|
@@ -206,6 +189,8 @@ app.post('/api/git-config', async (req, res) => {
|
|
|
206
189
|
}
|
|
207
190
|
});
|
|
208
191
|
app.use('/api/workspaces/:id/search', searchRouter);
|
|
192
|
+
app.use('/api/workspaces/:id/database', databaseRouter);
|
|
193
|
+
app.use('/api/workspaces/:id/kanban', kanbanRouter);
|
|
209
194
|
app.use('/api/workspaces/:id/notifications', notificationRouter);
|
|
210
195
|
app.use('/api/agents', agentRouter);
|
|
211
196
|
app.use('/api', llmRouter);
|
|
@@ -216,6 +201,8 @@ app.use('/api/output-styles', outputStyleRouter);
|
|
|
216
201
|
app.use('/api/mcps', mcpRouter);
|
|
217
202
|
app.use('/api/subscriptions', subscriptionRouter);
|
|
218
203
|
app.use('/api/speech-recognition', speechRecognitionRouter);
|
|
204
|
+
app.use('/api/agent-commands', agentCommandsRouter);
|
|
205
|
+
app.use('/api/robot-accounts', robotAccountRouter);
|
|
219
206
|
// Serve static web frontend in production (after API routes, before catch-all)
|
|
220
207
|
const webDir = resolveRuntimeDir('web');
|
|
221
208
|
if (existsSync(webDir)) {
|
package/dist/package.json
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Router } from 'express';
|
|
2
|
+
import { listAgentsWithCommands, listAllCommands, listCommands, getCommand, createCommand, updateCommand, deleteCommand, applyCommandToAgents, } from '../services/agent-commands.js';
|
|
3
|
+
const router = Router();
|
|
4
|
+
router.get('/agents', (_req, res) => {
|
|
5
|
+
res.json(listAgentsWithCommands());
|
|
6
|
+
});
|
|
7
|
+
router.get('/all', (_req, res) => {
|
|
8
|
+
res.json(listAllCommands());
|
|
9
|
+
});
|
|
10
|
+
router.get('/:agentId', (req, res) => {
|
|
11
|
+
const agentId = typeof req.params.agentId === 'string' ? req.params.agentId : req.params.agentId[0];
|
|
12
|
+
res.json(listCommands(agentId));
|
|
13
|
+
});
|
|
14
|
+
router.get('/:agentId/:name', (req, res) => {
|
|
15
|
+
const agentId = typeof req.params.agentId === 'string' ? req.params.agentId : req.params.agentId[0];
|
|
16
|
+
const name = typeof req.params.name === 'string' ? req.params.name : req.params.name[0];
|
|
17
|
+
const group = req.query.group;
|
|
18
|
+
const cmd = getCommand(agentId, name, group);
|
|
19
|
+
if (!cmd) {
|
|
20
|
+
res.status(404).json({ error: 'Command not found' });
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
res.json(cmd);
|
|
24
|
+
});
|
|
25
|
+
router.post('/:agentId', (req, res) => {
|
|
26
|
+
const agentId = typeof req.params.agentId === 'string' ? req.params.agentId : req.params.agentId[0];
|
|
27
|
+
const { name, content, group } = req.body;
|
|
28
|
+
if (!name || !content) {
|
|
29
|
+
res.status(400).json({ error: 'name and content required' });
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
res.json(createCommand(agentId, name, content, group));
|
|
33
|
+
});
|
|
34
|
+
router.put('/:agentId/:name', (req, res) => {
|
|
35
|
+
const agentId = typeof req.params.agentId === 'string' ? req.params.agentId : req.params.agentId[0];
|
|
36
|
+
const name = typeof req.params.name === 'string' ? req.params.name : req.params.name[0];
|
|
37
|
+
const { content, group } = req.body;
|
|
38
|
+
if (!content) {
|
|
39
|
+
res.status(400).json({ error: 'content required' });
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const cmd = updateCommand(agentId, name, content, group);
|
|
43
|
+
if (!cmd) {
|
|
44
|
+
res.status(404).json({ error: 'Command not found' });
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
res.json(cmd);
|
|
48
|
+
});
|
|
49
|
+
router.delete('/:agentId/:name', (req, res) => {
|
|
50
|
+
const agentId = typeof req.params.agentId === 'string' ? req.params.agentId : req.params.agentId[0];
|
|
51
|
+
const name = typeof req.params.name === 'string' ? req.params.name : req.params.name[0];
|
|
52
|
+
const group = req.query.group;
|
|
53
|
+
const ok = deleteCommand(agentId, name, group);
|
|
54
|
+
if (!ok) {
|
|
55
|
+
res.status(404).json({ error: 'Command not found' });
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
res.json({ success: true });
|
|
59
|
+
});
|
|
60
|
+
router.post('/:agentId/:name/apply', (req, res) => {
|
|
61
|
+
const agentId = typeof req.params.agentId === 'string' ? req.params.agentId : req.params.agentId[0];
|
|
62
|
+
const name = typeof req.params.name === 'string' ? req.params.name : req.params.name[0];
|
|
63
|
+
const { group, agentIds } = req.body;
|
|
64
|
+
if (!Array.isArray(agentIds) || agentIds.length === 0) {
|
|
65
|
+
res.status(400).json({ error: 'agentIds required' });
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const applied = applyCommandToAgents(agentId, name, group || '', agentIds);
|
|
69
|
+
res.json({ applied });
|
|
70
|
+
});
|
|
71
|
+
export default router;
|
|
72
|
+
//# sourceMappingURL=agent-commands.js.map
|
package/dist/routes/agent-sse.js
CHANGED
|
@@ -79,6 +79,7 @@ router.post('/run', async (req, res) => {
|
|
|
79
79
|
skills,
|
|
80
80
|
configDir,
|
|
81
81
|
sandboxDirs: preset.sandboxDirs,
|
|
82
|
+
userPrompt,
|
|
82
83
|
outputStyle: body.outputStyle ?? preset.outputStyle,
|
|
83
84
|
onEvent: wrapOnEventWithHooks((event) => {
|
|
84
85
|
if (event.type === 'output')
|
|
@@ -143,11 +144,17 @@ function prepareSse(res) {
|
|
|
143
144
|
res.setHeader('Content-Type', 'text/event-stream; charset=utf-8');
|
|
144
145
|
res.setHeader('Cache-Control', 'no-cache, no-transform');
|
|
145
146
|
res.setHeader('Connection', 'keep-alive');
|
|
147
|
+
res.setHeader('X-Accel-Buffering', 'no');
|
|
146
148
|
res.flushHeaders?.();
|
|
149
|
+
res.socket?.setNoDelay?.(true);
|
|
147
150
|
}
|
|
148
151
|
function writeSse(res, event, data) {
|
|
149
152
|
res.write(`event: ${event}\n`);
|
|
150
153
|
res.write(`data: ${JSON.stringify(data)}\n\n`);
|
|
154
|
+
// Force flush — compression middleware and some proxies buffer small writes
|
|
155
|
+
const flushable = res;
|
|
156
|
+
if (typeof flushable.flush === 'function')
|
|
157
|
+
flushable.flush();
|
|
151
158
|
}
|
|
152
159
|
function resolveUserPrompt(body) {
|
|
153
160
|
const direct = body.prompt ?? body.message;
|
package/dist/routes/agent.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
2
|
import * as agentService from '../services/agent.js';
|
|
3
|
-
import { generateAgentDesign } from '../agents/agent-designer.js';
|
|
3
|
+
import { generateAgentDesign, optimizeAgentPrompt } from '../agents/agent-designer.js';
|
|
4
4
|
const router = Router({ mergeParams: true });
|
|
5
5
|
router.get('/usage/dashboard', (req, res) => {
|
|
6
6
|
const days = Number(req.query.days ?? 30);
|
|
@@ -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()) {
|
|
@@ -36,6 +39,20 @@ router.post('/presets/generate', async (req, res) => {
|
|
|
36
39
|
res.status(400).json({ error: err instanceof Error ? err.message : 'agent generation failed' });
|
|
37
40
|
}
|
|
38
41
|
});
|
|
42
|
+
router.post('/presets/optimize-prompt', async (req, res) => {
|
|
43
|
+
const { prompt, currentPrompt } = req.body;
|
|
44
|
+
if (!prompt?.trim()) {
|
|
45
|
+
res.status(400).json({ error: 'prompt is required' });
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
res.json(await optimizeAgentPrompt(prompt, currentPrompt ?? ''));
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
console.error('[agent-designer] optimize failed', err);
|
|
53
|
+
res.status(400).json({ error: err instanceof Error ? err.message : 'prompt optimization failed' });
|
|
54
|
+
}
|
|
55
|
+
});
|
|
39
56
|
router.post('/presets/test-connection', async (req, res) => {
|
|
40
57
|
const workspaceId = req.params.id;
|
|
41
58
|
const data = req.body;
|