@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
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { Router } from 'express';
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import * as store from '../storage/database-store.js';
|
|
5
|
+
import * as databaseVector from '../services/database-vector.js';
|
|
6
|
+
import * as agentService from '../services/agent.js';
|
|
7
|
+
import * as workspaceService from '../services/workspace.js';
|
|
8
|
+
import { createDatabaseFunctionTools } from '../services/builtin-tools/index.js';
|
|
9
|
+
import { createAgentRuntime } from '../adapters/agent-runtime.js';
|
|
10
|
+
import { getThinkingRuntimeConfig } from '../services/llm-model-config.js';
|
|
11
|
+
import { getDataDir, ensureDir } from '../storage/json-store.js';
|
|
12
|
+
import { generateAgentDesign } from '../agents/agent-designer.js';
|
|
13
|
+
const router = Router({ mergeParams: true });
|
|
14
|
+
const pendingContentSaves = new Map();
|
|
15
|
+
const CONTENT_SAVE_IDLE_MS = 30_000;
|
|
16
|
+
const DATABASE_AGENT_ID = 'database-agent';
|
|
17
|
+
const DATABASE_AGENT_TOOLS = [
|
|
18
|
+
'ListDatabases',
|
|
19
|
+
'ListDatabaseNodes',
|
|
20
|
+
'SearchDatabaseNodes',
|
|
21
|
+
'QueryDatabaseVectors',
|
|
22
|
+
'ReadDatabaseNode',
|
|
23
|
+
'ListDatabaseNodeVersions',
|
|
24
|
+
'CreateDatabaseNode',
|
|
25
|
+
'WriteDatabaseNode',
|
|
26
|
+
'DeleteDatabaseNode',
|
|
27
|
+
'MoveDatabaseNode',
|
|
28
|
+
'UpdateDatabaseNodeMeta',
|
|
29
|
+
];
|
|
30
|
+
const wid = (req) => req.params.id;
|
|
31
|
+
const databaseId = (req) => req.query.databaseId || store.getDefaultDatabase(wid(req)).id;
|
|
32
|
+
router.get('/agent-presets', (req, res) => {
|
|
33
|
+
res.json([readDatabaseAgent(wid(req))]);
|
|
34
|
+
});
|
|
35
|
+
router.get('/agent-presets/:presetId', (req, res) => {
|
|
36
|
+
if (req.params.presetId !== DATABASE_AGENT_ID)
|
|
37
|
+
return res.status(404).json({ error: 'database agent not found' });
|
|
38
|
+
res.json(readDatabaseAgent(wid(req)));
|
|
39
|
+
});
|
|
40
|
+
router.put('/agent-presets/:presetId', (req, res) => {
|
|
41
|
+
if (req.params.presetId !== DATABASE_AGENT_ID)
|
|
42
|
+
return res.status(404).json({ error: 'database agent not found' });
|
|
43
|
+
res.json(writeDatabaseAgent(wid(req), req.body));
|
|
44
|
+
});
|
|
45
|
+
router.post('/agent-presets/test-connection', async (req, res) => {
|
|
46
|
+
const result = await agentService.testConnection(wid(req), req.body);
|
|
47
|
+
if (!result)
|
|
48
|
+
return res.status(404).json({ error: 'workspace not found' });
|
|
49
|
+
res.status(result.success ? 200 : 400).json(result);
|
|
50
|
+
});
|
|
51
|
+
router.post('/agent-presets/generate', async (req, res) => {
|
|
52
|
+
const { prompt } = req.body;
|
|
53
|
+
if (!prompt?.trim())
|
|
54
|
+
return res.status(400).json({ error: 'prompt is required' });
|
|
55
|
+
try {
|
|
56
|
+
res.json(await generateAgentDesign(prompt));
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
res.status(400).json({ error: err instanceof Error ? err.message : 'agent generation failed' });
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
router.post('/chat', async (req, res) => {
|
|
63
|
+
const workspaceId = wid(req);
|
|
64
|
+
const { message, history } = req.body;
|
|
65
|
+
const prompt = message?.trim();
|
|
66
|
+
if (!prompt)
|
|
67
|
+
return res.status(400).json({ error: 'message is required' });
|
|
68
|
+
const workspace = workspaceService.getById(workspaceId);
|
|
69
|
+
if (!workspace)
|
|
70
|
+
return res.status(404).json({ error: 'workspace not found' });
|
|
71
|
+
const agent = readDatabaseAgent(workspaceId);
|
|
72
|
+
if (agent.enabled === false)
|
|
73
|
+
return res.status(400).json({ error: 'database agent is disabled' });
|
|
74
|
+
const workingDir = workspace.boundDirs[0] || process.cwd();
|
|
75
|
+
const functionTools = createDatabaseFunctionTools(workspaceId, agent.tools);
|
|
76
|
+
const runtime = createAgentRuntime({
|
|
77
|
+
kind: agent.runtimeKind,
|
|
78
|
+
provider: agent.modelProvider,
|
|
79
|
+
model: agent.modelId,
|
|
80
|
+
apiKey: agent.apiKey,
|
|
81
|
+
baseURL: getRuntimeBaseURL(agent.modelProvider, agent.apiBase),
|
|
82
|
+
adapterBaseURL: agent.apiBase,
|
|
83
|
+
...getThinkingRuntimeConfig(agent),
|
|
84
|
+
});
|
|
85
|
+
const result = await runtime.execute(buildDatabaseAgentPrompt(workspaceId, agent, prompt, history ?? []), workingDir, {
|
|
86
|
+
maxTurns: 60,
|
|
87
|
+
userPrompt: prompt,
|
|
88
|
+
functionTools,
|
|
89
|
+
mcpServers: {},
|
|
90
|
+
skills: [],
|
|
91
|
+
sandboxDirs: [],
|
|
92
|
+
outputStyle: agent.outputStyle,
|
|
93
|
+
});
|
|
94
|
+
const finalMessage = result.success
|
|
95
|
+
? extractFinalMessage(result.output, result.summary)
|
|
96
|
+
: result.error || extractFinalMessage(result.output, result.summary);
|
|
97
|
+
res.status(result.success ? 200 : 400).json({ finalMessage });
|
|
98
|
+
});
|
|
99
|
+
router.get('/databases', (req, res) => {
|
|
100
|
+
const databases = store.listDatabases(wid(req));
|
|
101
|
+
res.json(databases.length > 0 ? databases : [store.getDefaultDatabase(wid(req))]);
|
|
102
|
+
});
|
|
103
|
+
router.post('/databases', (req, res) => {
|
|
104
|
+
const database = store.createDatabase(wid(req), req.body);
|
|
105
|
+
res.status(201).json(database);
|
|
106
|
+
});
|
|
107
|
+
router.put('/databases/:databaseId', (req, res) => {
|
|
108
|
+
const database = store.updateDatabase(wid(req), req.params.databaseId, req.body);
|
|
109
|
+
if (!database)
|
|
110
|
+
return res.status(404).json({ error: 'Database not found' });
|
|
111
|
+
res.json(database);
|
|
112
|
+
});
|
|
113
|
+
router.get('/databases/:databaseId/vector', (req, res) => {
|
|
114
|
+
if (!store.getDatabase(wid(req), req.params.databaseId)) {
|
|
115
|
+
return res.status(404).json({ error: 'Database not found' });
|
|
116
|
+
}
|
|
117
|
+
res.json(store.getVectorStats(wid(req), req.params.databaseId));
|
|
118
|
+
});
|
|
119
|
+
router.put('/databases/:databaseId/vector', (req, res) => {
|
|
120
|
+
const { embeddingModelId } = req.body;
|
|
121
|
+
const database = store.setDatabaseEmbeddingModel(wid(req), req.params.databaseId, embeddingModelId || null);
|
|
122
|
+
if (!database)
|
|
123
|
+
return res.status(404).json({ error: 'Database not found' });
|
|
124
|
+
res.json(store.getVectorStats(wid(req), req.params.databaseId));
|
|
125
|
+
});
|
|
126
|
+
router.post('/databases/:databaseId/vector/index', async (req, res) => {
|
|
127
|
+
try {
|
|
128
|
+
res.json(await databaseVector.indexDatabaseVectors(wid(req), req.params.databaseId));
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
console.error('[database:vector:index] failed', {
|
|
132
|
+
workspaceId: wid(req),
|
|
133
|
+
databaseId: req.params.databaseId,
|
|
134
|
+
error: error instanceof Error ? error.message : String(error),
|
|
135
|
+
debug: error instanceof databaseVector.DatabaseVectorError ? error.debug : undefined,
|
|
136
|
+
});
|
|
137
|
+
res.status(400).json({
|
|
138
|
+
error: error instanceof Error ? error.message : String(error),
|
|
139
|
+
debug: error instanceof databaseVector.DatabaseVectorError ? error.debug : undefined,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
router.delete('/databases/:databaseId', (req, res) => {
|
|
144
|
+
if (!store.deleteDatabase(wid(req), req.params.databaseId)) {
|
|
145
|
+
return res.status(404).json({ error: 'Database not found' });
|
|
146
|
+
}
|
|
147
|
+
res.json({ ok: true });
|
|
148
|
+
});
|
|
149
|
+
// List all nodes
|
|
150
|
+
router.get('/', (req, res) => {
|
|
151
|
+
res.json(store.listNodes(wid(req), databaseId(req)));
|
|
152
|
+
});
|
|
153
|
+
// Get single node
|
|
154
|
+
router.get('/:nodeId', (req, res) => {
|
|
155
|
+
const node = store.getNode(wid(req), req.params.nodeId, databaseId(req));
|
|
156
|
+
if (!node)
|
|
157
|
+
return res.status(404).json({ error: 'Node not found' });
|
|
158
|
+
res.json(node);
|
|
159
|
+
});
|
|
160
|
+
router.get('/:nodeId/versions', (req, res) => {
|
|
161
|
+
flushPendingContentSave(wid(req), databaseId(req), req.params.nodeId);
|
|
162
|
+
const limit = typeof req.query.limit === 'string' ? Number(req.query.limit) : 50;
|
|
163
|
+
const versions = store.listNodeVersions(wid(req), req.params.nodeId, databaseId(req), limit);
|
|
164
|
+
res.json(versions);
|
|
165
|
+
});
|
|
166
|
+
// Create node
|
|
167
|
+
router.post('/', (req, res) => {
|
|
168
|
+
const node = store.createNode(wid(req), { ...req.body, databaseId: databaseId(req) });
|
|
169
|
+
res.status(201).json(node);
|
|
170
|
+
});
|
|
171
|
+
// Update node
|
|
172
|
+
router.put('/:nodeId', (req, res) => {
|
|
173
|
+
const workspaceId = wid(req);
|
|
174
|
+
const activeDatabaseId = databaseId(req);
|
|
175
|
+
const nodeId = req.params.nodeId;
|
|
176
|
+
const body = req.body;
|
|
177
|
+
const { content, ...metadataUpdates } = body;
|
|
178
|
+
let node = Object.keys(metadataUpdates).length > 0
|
|
179
|
+
? store.updateNode(workspaceId, nodeId, metadataUpdates, activeDatabaseId)
|
|
180
|
+
: store.getNode(workspaceId, nodeId, activeDatabaseId);
|
|
181
|
+
if (!node)
|
|
182
|
+
return res.status(404).json({ error: 'Node not found' });
|
|
183
|
+
if (typeof content === 'string') {
|
|
184
|
+
scheduleContentSave(workspaceId, activeDatabaseId, nodeId, content);
|
|
185
|
+
node = { ...node, content, updatedAt: Date.now() };
|
|
186
|
+
}
|
|
187
|
+
res.json(node);
|
|
188
|
+
});
|
|
189
|
+
// Move node (change parent)
|
|
190
|
+
router.put('/:nodeId/move', (req, res) => {
|
|
191
|
+
const { parentId } = req.body;
|
|
192
|
+
const node = store.moveNode(wid(req), req.params.nodeId, parentId ?? null, databaseId(req));
|
|
193
|
+
if (!node)
|
|
194
|
+
return res.status(404).json({ error: 'Node not found' });
|
|
195
|
+
res.json(node);
|
|
196
|
+
});
|
|
197
|
+
// Trash node (soft delete)
|
|
198
|
+
router.put('/:nodeId/trash', (req, res) => {
|
|
199
|
+
const node = store.trashNode(wid(req), req.params.nodeId, databaseId(req));
|
|
200
|
+
if (!node)
|
|
201
|
+
return res.status(404).json({ error: 'Node not found' });
|
|
202
|
+
res.json(node);
|
|
203
|
+
});
|
|
204
|
+
// Restore node from trash
|
|
205
|
+
router.put('/:nodeId/restore', (req, res) => {
|
|
206
|
+
const node = store.restoreNode(wid(req), req.params.nodeId, databaseId(req));
|
|
207
|
+
if (!node)
|
|
208
|
+
return res.status(404).json({ error: 'Node not found' });
|
|
209
|
+
res.json(node);
|
|
210
|
+
});
|
|
211
|
+
// Delete node permanently
|
|
212
|
+
router.delete('/:nodeId', (req, res) => {
|
|
213
|
+
if (!store.deleteNode(wid(req), req.params.nodeId, databaseId(req))) {
|
|
214
|
+
return res.status(404).json({ error: 'Node not found' });
|
|
215
|
+
}
|
|
216
|
+
res.json({ ok: true });
|
|
217
|
+
});
|
|
218
|
+
function scheduleContentSave(workspaceId, activeDatabaseId, nodeId, content) {
|
|
219
|
+
const key = `${workspaceId}:${activeDatabaseId}:${nodeId}`;
|
|
220
|
+
const existing = pendingContentSaves.get(key);
|
|
221
|
+
if (existing)
|
|
222
|
+
clearTimeout(existing.timer);
|
|
223
|
+
const timer = setTimeout(() => {
|
|
224
|
+
flushPendingContentSave(workspaceId, activeDatabaseId, nodeId);
|
|
225
|
+
}, CONTENT_SAVE_IDLE_MS);
|
|
226
|
+
pendingContentSaves.set(key, { timer, content });
|
|
227
|
+
}
|
|
228
|
+
function flushPendingContentSave(workspaceId, activeDatabaseId, nodeId) {
|
|
229
|
+
const key = `${workspaceId}:${activeDatabaseId}:${nodeId}`;
|
|
230
|
+
const pending = pendingContentSaves.get(key);
|
|
231
|
+
if (!pending)
|
|
232
|
+
return;
|
|
233
|
+
clearTimeout(pending.timer);
|
|
234
|
+
pendingContentSaves.delete(key);
|
|
235
|
+
store.updateNode(workspaceId, nodeId, { content: pending.content }, activeDatabaseId);
|
|
236
|
+
}
|
|
237
|
+
function databaseAgentPath(workspaceId) {
|
|
238
|
+
return join(getDataDir(), 'workspaces', workspaceId, 'database', 'agent.json');
|
|
239
|
+
}
|
|
240
|
+
function readDatabaseAgent(workspaceId) {
|
|
241
|
+
const filePath = databaseAgentPath(workspaceId);
|
|
242
|
+
if (!existsSync(filePath))
|
|
243
|
+
return defaultDatabaseAgent();
|
|
244
|
+
try {
|
|
245
|
+
return normalizeDatabaseAgent(JSON.parse(readFileSync(filePath, 'utf-8')));
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
return defaultDatabaseAgent();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
function writeDatabaseAgent(workspaceId, input) {
|
|
252
|
+
const agent = normalizeDatabaseAgent(input);
|
|
253
|
+
ensureDir(join(getDataDir(), 'workspaces', workspaceId, 'database'));
|
|
254
|
+
writeFileSync(databaseAgentPath(workspaceId), JSON.stringify(agent, null, 2), 'utf-8');
|
|
255
|
+
return agent;
|
|
256
|
+
}
|
|
257
|
+
function defaultDatabaseAgent() {
|
|
258
|
+
return normalizeDatabaseAgent({
|
|
259
|
+
name: 'Database AI',
|
|
260
|
+
role: 'agent',
|
|
261
|
+
description: 'Knowledge base assistant for Agent Spaces database documents.',
|
|
262
|
+
runtimeKind: 'claude-code',
|
|
263
|
+
modelProvider: undefined,
|
|
264
|
+
modelId: '',
|
|
265
|
+
apiBase: '',
|
|
266
|
+
apiKey: '',
|
|
267
|
+
systemPrompt: [
|
|
268
|
+
'You are the database knowledge base assistant.',
|
|
269
|
+
'Answer from Agent Spaces database content when possible.',
|
|
270
|
+
'Use only the provided database tools for knowledge base operations.',
|
|
271
|
+
'Return only the final answer in concise Markdown.',
|
|
272
|
+
].join('\n'),
|
|
273
|
+
temperature: 0.2,
|
|
274
|
+
maxTokens: 4096,
|
|
275
|
+
enabled: true,
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
function normalizeDatabaseAgent(input) {
|
|
279
|
+
return {
|
|
280
|
+
id: DATABASE_AGENT_ID,
|
|
281
|
+
name: input.name?.trim() || 'Database AI',
|
|
282
|
+
role: 'agent',
|
|
283
|
+
description: input.description || '',
|
|
284
|
+
runtimeKind: input.runtimeKind || 'claude-code',
|
|
285
|
+
modelProvider: input.modelProvider,
|
|
286
|
+
modelId: input.modelId || '',
|
|
287
|
+
apiBase: input.apiBase || '',
|
|
288
|
+
apiKey: input.apiKey || '',
|
|
289
|
+
workingDir: '',
|
|
290
|
+
mcps: {},
|
|
291
|
+
skills: [],
|
|
292
|
+
tools: DATABASE_AGENT_TOOLS,
|
|
293
|
+
systemPrompt: input.systemPrompt || defaultDatabaseAgent().systemPrompt,
|
|
294
|
+
outputStyle: input.outputStyle,
|
|
295
|
+
temperature: input.temperature ?? 0.2,
|
|
296
|
+
maxTokens: input.maxTokens ?? 4096,
|
|
297
|
+
sandboxDirs: [],
|
|
298
|
+
maxRetries: input.maxRetries,
|
|
299
|
+
enabled: input.enabled ?? true,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function buildDatabaseAgentPrompt(workspaceId, agent, userMessage, history) {
|
|
303
|
+
const recentHistory = history
|
|
304
|
+
.slice(-12)
|
|
305
|
+
.map((item) => `${item.role === 'user' ? 'User' : 'Agent'}: ${item.content}`)
|
|
306
|
+
.join('\n\n');
|
|
307
|
+
return [
|
|
308
|
+
agent.systemPrompt?.trim(),
|
|
309
|
+
'Runtime constraints:',
|
|
310
|
+
`- Current workspace id: ${workspaceId}`,
|
|
311
|
+
'- MCP servers configured for this agent: none.',
|
|
312
|
+
`- Available database tools: ${DATABASE_AGENT_TOOLS.map((tool) => `mcp__agent-spaces__${tool}`).join(', ')}.`,
|
|
313
|
+
'- Use mcp__agent-spaces__ListDatabases when you need to know valid database IDs.',
|
|
314
|
+
'- If the user does not specify a database, omit databaseId and the first database will be used automatically.',
|
|
315
|
+
'- Never use the workspace id as databaseId.',
|
|
316
|
+
'- Do not use filesystem, command, issue, channel, web, or other non-database tools for knowledge base work.',
|
|
317
|
+
'- If you need database content, call the database tools before answering.',
|
|
318
|
+
'- Return only the final answer in Markdown. Do not include tool logs or implementation traces.',
|
|
319
|
+
recentHistory ? `Conversation history:\n${recentHistory}` : '',
|
|
320
|
+
`User message:\n${userMessage}`,
|
|
321
|
+
].filter(Boolean).join('\n\n');
|
|
322
|
+
}
|
|
323
|
+
function extractFinalMessage(output, fallback) {
|
|
324
|
+
const candidates = output
|
|
325
|
+
.map((line) => line.trim())
|
|
326
|
+
.filter((line) => {
|
|
327
|
+
if (!line)
|
|
328
|
+
return false;
|
|
329
|
+
if (/^\[Usage\]/i.test(line))
|
|
330
|
+
return false;
|
|
331
|
+
if (/^(Tool:|Todo:|Codex initialized\b|Claude Code initialized\b)/i.test(line))
|
|
332
|
+
return false;
|
|
333
|
+
if (/^\[Reasoning\]/i.test(line))
|
|
334
|
+
return false;
|
|
335
|
+
return true;
|
|
336
|
+
});
|
|
337
|
+
return candidates.at(-1) || fallback || '';
|
|
338
|
+
}
|
|
339
|
+
function getRuntimeBaseURL(provider, apiBase) {
|
|
340
|
+
if (provider === 'openai-responses-to-anthropic-messages'
|
|
341
|
+
|| provider === 'openai-chat-completions-to-anthropic-messages')
|
|
342
|
+
return undefined;
|
|
343
|
+
return apiBase;
|
|
344
|
+
}
|
|
345
|
+
export default router;
|
|
346
|
+
//# sourceMappingURL=database.js.map
|