@agent-spaces/server 0.3.62 → 0.3.64
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/agent-runtime-types.js +12 -0
- package/dist/adapters/claude-code-runtime/index.js +3 -0
- package/dist/adapters/claude-code-runtime/message-format.js +1 -1
- package/dist/adapters/codex-runtime.js +2 -2
- package/dist/adapters/git.js +161 -57
- package/dist/adapters/langchain-runtime.js +2 -2
- package/dist/adapters/open-agent-sdk-runtime.js +2 -2
- package/dist/agents/agent-designer.js +66 -12
- package/dist/agents/commit-agent.js +1 -0
- package/dist/agents/issue-agent-progress.js +4 -2
- package/dist/agents/issue-agent-runner.js +5 -5
- package/dist/agents/issue-task-controller.js +96 -15
- package/dist/app.js +123 -5
- package/dist/package.json +1 -1
- package/dist/routes/agent-commands.js +72 -0
- package/dist/routes/agent-sse.js +10 -2
- package/dist/routes/agent.js +15 -1
- package/dist/routes/database.js +345 -0
- package/dist/routes/git.js +52 -1
- package/dist/routes/hooks.js +88 -0
- package/dist/routes/issue.js +59 -1
- package/dist/routes/kanban.js +39 -0
- package/dist/routes/output-style.js +48 -0
- package/dist/routes/prompt-template.js +2 -2
- package/dist/routes/skill.js +86 -15
- package/dist/routes/task.js +13 -1
- package/dist/services/agent-commands.js +168 -0
- 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 +277 -0
- package/dist/services/database-vector.js +244 -0
- package/dist/services/hook-engine.js +118 -0
- package/dist/services/issue.js +6 -0
- package/dist/services/kanban.js +50 -0
- package/dist/services/notification-hub/bot-agent.js +1 -0
- package/dist/services/output-style.js +134 -0
- package/dist/services/prompt-template.js +2 -2
- package/dist/services/skill.js +148 -35
- package/dist/storage/database-store.js +365 -0
- package/dist/storage/hook-store.js +55 -0
- package/dist/storage/kanban-store.js +142 -0
- package/dist/web/404.html +1 -1
- package/dist/web/__next.__PAGE__.txt +4 -4
- package/dist/web/__next._full.txt +26 -30
- 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-9194nbxy_6d.js +1 -0
- package/dist/web/_next/static/chunks/0-f~0xmwl__u5.js +1 -0
- package/dist/web/_next/static/chunks/0.n~yfwf4~6w-.js +1 -0
- package/dist/web/_next/static/chunks/002_j970b9gdx.js +1 -0
- package/dist/web/_next/static/chunks/01iqv28_snwus.js +1 -0
- package/dist/web/_next/static/chunks/01~quun6sefgl.js +1 -0
- package/dist/web/_next/static/chunks/02mf61htij8g0.js +31 -0
- package/dist/web/_next/static/chunks/03scq1-0ykve3.js +1 -0
- package/dist/web/_next/static/chunks/04a4vsq2wknm4.js +1 -0
- package/dist/web/_next/static/chunks/04dg4l4hv11q2.js +3 -0
- package/dist/web/_next/static/chunks/04fxddw-y20~-.js +7 -0
- package/dist/web/_next/static/chunks/04w7~5ooz_pwm.js +1 -0
- package/dist/web/_next/static/chunks/05oc21sj24wtq.js +1 -0
- package/dist/web/_next/static/chunks/{0zd1o3u04~qvo.js → 05psi2gtx~bev.js} +7 -7
- package/dist/web/_next/static/chunks/{0-oog4zg4_m~m.css → 062f9zqctzg.b.css} +0 -3
- package/dist/web/_next/static/chunks/{12odetnu-lyrr.js → 06whz1~s_7pva.js} +12 -12
- package/dist/web/_next/static/chunks/08ckpwmmwlors.js +3 -0
- package/dist/web/_next/static/chunks/08k~meqbd8d6v.js +1 -0
- package/dist/web/_next/static/chunks/099h96wjsdb25.js +2 -0
- package/dist/web/_next/static/chunks/09h23logvq65m.js +1 -0
- package/dist/web/_next/static/chunks/{0njy89g5coeyi.js → 0_8dm7bxp18xo.js} +6 -6
- package/dist/web/_next/static/chunks/0_mvduwjsm35w.js +1 -0
- package/dist/web/_next/static/chunks/0_vi1a~g4wx46.js +3 -0
- package/dist/web/_next/static/chunks/0a5y-vhf4i5id.js +3 -0
- package/dist/web/_next/static/chunks/0ake2f3x2uan4.js +24 -0
- package/dist/web/_next/static/chunks/{0tvd~rxgf0oh_.js → 0bbmx45w_h5np.js} +1 -1
- package/dist/web/_next/static/chunks/0ck8dw_9-1cdx.js +1 -0
- package/dist/web/_next/static/chunks/{07a0rktf_nr5h.js → 0ctg5qmw7uu.1.js} +2 -2
- package/dist/web/_next/static/chunks/0ewceguykiut5.js +1 -0
- package/dist/web/_next/static/chunks/0f7cb9li~3jra.js +67 -0
- package/dist/web/_next/static/chunks/0fttswpzu69qx.js +1 -0
- package/dist/web/_next/static/chunks/0ghs9on7wodrm.js +1 -0
- package/dist/web/_next/static/chunks/0ghx3j_.-gdyd.js +1 -0
- package/dist/web/_next/static/chunks/{0202ia13sijwb.js → 0h18ej5yf974e.js} +1 -1
- package/dist/web/_next/static/chunks/0h9cu-k6z5o08.js +1 -0
- package/dist/web/_next/static/chunks/0i39jifmxla7q.js +1 -0
- package/dist/web/_next/static/chunks/0iuf30t0rjsjv.js +19 -0
- package/dist/web/_next/static/chunks/0jb4~3qqkw2ps.js +1 -0
- package/dist/web/_next/static/chunks/0k4zdm72k_bfy.js +1 -0
- package/dist/web/_next/static/chunks/{08o-zmr-40r5g.js → 0m11vvph7q94-.js} +1 -1
- package/dist/web/_next/static/chunks/0n6_4so_afuwk.js +71 -0
- package/dist/web/_next/static/chunks/0nb8.iteznuvx.js +1 -0
- package/dist/web/_next/static/chunks/0np.d~hc1-pmh.js +4 -0
- package/dist/web/_next/static/chunks/{0qpq0~_58fe9a.js → 0oaq67r7ix.vg.js} +1 -1
- package/dist/web/_next/static/chunks/{0d_dp_4ofz0l3.css → 0ojcao3hdm36s.css} +0 -1
- package/dist/web/_next/static/chunks/0os58q93stt7j.js +3 -0
- package/dist/web/_next/static/chunks/{0gig.k.rq8d0x.js → 0ppr271hz0xoq.js} +1 -1
- package/dist/web/_next/static/chunks/0s9lmk8iauou3.js +1 -0
- package/dist/web/_next/static/chunks/0sp_zbx~w0am7.js +1 -0
- package/dist/web/_next/static/chunks/0tel~zsv4z8l_.js +1 -0
- package/dist/web/_next/static/chunks/0twamv4wr_dbv.js +1 -0
- package/dist/web/_next/static/chunks/0uhol5wafdbl~.js +1 -0
- package/dist/web/_next/static/chunks/0v3a_x4vt42kx.js +5 -0
- package/dist/web/_next/static/chunks/{002-dxhags4dj.js → 0v6hte2z-32ca.js} +2 -2
- package/dist/web/_next/static/chunks/0v7q4mys.mnm..css +1 -0
- package/dist/web/_next/static/chunks/0vbqaynjq8ga..js +3 -0
- package/dist/web/_next/static/chunks/0xbaakj0dfc0..js +1 -0
- package/dist/web/_next/static/chunks/{0..g0jl-8qup7.js → 0xoo17yef_b8g.js} +1 -1
- package/dist/web/_next/static/chunks/0xt-8wk21gs7g.js +1 -0
- package/dist/web/_next/static/chunks/0za1r07-6az6w.js +1 -0
- package/dist/web/_next/static/chunks/0z~vqzbm_q371.js +1 -0
- package/dist/web/_next/static/chunks/0~3xm80~j9ddg.js +1 -0
- package/dist/web/_next/static/chunks/0~u.5r3-t7179.js +1 -0
- package/dist/web/_next/static/chunks/10l-9myrdo3x9.js +1 -0
- package/dist/web/_next/static/chunks/11-czmcci_55y.js +1 -0
- package/dist/web/_next/static/chunks/11k-.49r~1mfm.js +1 -0
- package/dist/web/_next/static/chunks/{0k.8qdk7oi_os.js → 128ugqd34tr_-.js} +1 -1
- package/dist/web/_next/static/chunks/12jm4gwmvq-0q.js +90 -0
- package/dist/web/_next/static/chunks/{0rke_patcovgr.js → 1442stwa0gbxe.js} +1 -1
- package/dist/web/_next/static/chunks/{0jokpgh485~28.js → 14hqmid8q4apf.js} +11 -11
- package/dist/web/_next/static/chunks/14s37n6h0_q3x.js +16 -0
- package/dist/web/_next/static/chunks/161ik5kfyuwtd.js +1 -0
- package/dist/web/_next/static/chunks/16sg-lflc8csx.js +1 -0
- package/dist/web/_next/static/chunks/17k~zbv0_4rep.js +1 -0
- package/dist/web/_next/static/chunks/17oc2l.ekcs8b.css +1 -0
- package/dist/web/_next/static/chunks/{turbopack-0lrdxynxb9-1t.js → turbopack-0ndm2zc_pdptk.js} +1 -1
- package/dist/web/_not-found/__next._full.txt +30 -31
- 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 +30 -31
- package/dist/web/index.html +1 -1
- package/dist/web/index.txt +26 -30
- 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 +29 -34
- 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 +38 -0
- package/dist/web/settings/output-styles/__next._head.txt +6 -0
- package/dist/web/settings/output-styles/__next._index.txt +15 -0
- package/dist/web/settings/output-styles/__next._tree.txt +3 -0
- package/dist/web/settings/output-styles/__next.settings.output-styles.__PAGE__.txt +9 -0
- package/dist/web/settings/output-styles/__next.settings.output-styles.txt +5 -0
- package/dist/web/settings/output-styles/__next.settings.txt +7 -0
- package/dist/web/settings/output-styles.html +1 -0
- package/dist/web/settings/output-styles.txt +38 -0
- 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 +29 -34
- package/dist/web/workflows/__next._full.txt +34 -37
- 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 +34 -37
- package/dist/web/workspace/_/__next._full.txt +32 -77
- 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 -23
- package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -18
- 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 +32 -77
- package/dist/web/workspaces/__next._full.txt +32 -38
- 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 +32 -38
- package/dist/ws/agent-prompt.js +45 -8
- package/dist/ws/agent-runner.js +10 -6
- package/package.json +11 -10
- package/public/output-styles/carmack-mode.md +381 -0
- package/public/output-styles/codex-rigor-mode.md +114 -0
- package/public/output-styles/dhh-mode.md +265 -0
- package/public/output-styles/evan-you-mode.md +539 -0
- package/public/output-styles/index.json +37 -0
- package/public/output-styles/jobs-mode.md +369 -0
- package/public/output-styles/linus-mode.md +135 -0
- package/public/output-styles/uncle-bob-mode.md +221 -0
- package/public/prompt/andrej-karpathy-skills.md +65 -0
- package/public/prompt/claude-token-efficient-coding.md +35 -0
- package/public/prompt/index.json +12 -0
- package/public/skills/index.json +92 -0
- package/public/skills/planning-with-files/planning-with-files-zh/SKILL.md +243 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.ps1 +44 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.sh +46 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.ps1 +124 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.sh +124 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/session-catchup.py +438 -0
- package/public/skills/planning-with-files/planning-with-files-zh/templates/findings.md +29 -0
- package/public/skills/planning-with-files/planning-with-files-zh/templates/progress.md +40 -0
- package/public/skills/planning-with-files/planning-with-files-zh/templates/task_plan.md +58 -0
- package/public/skills/superpowers/brainstorming/SKILL.md +164 -0
- package/public/skills/superpowers/brainstorming/scripts/frame-template.html +214 -0
- package/public/skills/superpowers/brainstorming/scripts/helper.js +88 -0
- package/public/skills/superpowers/brainstorming/scripts/server.cjs +354 -0
- package/public/skills/superpowers/brainstorming/scripts/start-server.sh +148 -0
- package/public/skills/superpowers/brainstorming/scripts/stop-server.sh +56 -0
- package/public/skills/superpowers/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/public/skills/superpowers/brainstorming/visual-companion.md +287 -0
- package/public/skills/superpowers/dispatching-parallel-agents/SKILL.md +182 -0
- package/public/skills/superpowers/executing-plans/SKILL.md +70 -0
- package/public/skills/superpowers/finishing-a-development-branch/SKILL.md +251 -0
- package/public/skills/superpowers/receiving-code-review/SKILL.md +213 -0
- package/public/skills/superpowers/requesting-code-review/SKILL.md +103 -0
- package/public/skills/superpowers/requesting-code-review/code-reviewer.md +168 -0
- package/public/skills/superpowers/subagent-driven-development/SKILL.md +279 -0
- package/public/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md +25 -0
- package/public/skills/superpowers/subagent-driven-development/implementer-prompt.md +113 -0
- package/public/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/public/skills/superpowers/systematic-debugging/CREATION-LOG.md +119 -0
- package/public/skills/superpowers/systematic-debugging/SKILL.md +296 -0
- package/public/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/public/skills/superpowers/systematic-debugging/condition-based-waiting.md +115 -0
- package/public/skills/superpowers/systematic-debugging/defense-in-depth.md +122 -0
- package/public/skills/superpowers/systematic-debugging/find-polluter.sh +63 -0
- package/public/skills/superpowers/systematic-debugging/root-cause-tracing.md +169 -0
- package/public/skills/superpowers/systematic-debugging/test-academic.md +14 -0
- package/public/skills/superpowers/systematic-debugging/test-pressure-1.md +58 -0
- package/public/skills/superpowers/systematic-debugging/test-pressure-2.md +68 -0
- package/public/skills/superpowers/systematic-debugging/test-pressure-3.md +69 -0
- package/public/skills/superpowers/test-driven-development/SKILL.md +371 -0
- package/public/skills/superpowers/test-driven-development/testing-anti-patterns.md +299 -0
- package/public/skills/superpowers/using-git-worktrees/SKILL.md +215 -0
- package/public/skills/superpowers/using-superpowers/SKILL.md +117 -0
- package/public/skills/superpowers/using-superpowers/references/codex-tools.md +59 -0
- package/public/skills/superpowers/using-superpowers/references/copilot-tools.md +42 -0
- package/public/skills/superpowers/using-superpowers/references/gemini-tools.md +51 -0
- package/public/skills/superpowers/verification-before-completion/SKILL.md +139 -0
- package/public/skills/superpowers/writing-plans/SKILL.md +152 -0
- package/public/skills/superpowers/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/public/skills/superpowers/writing-skills/SKILL.md +655 -0
- package/public/skills/superpowers/writing-skills/anthropic-best-practices.md +1150 -0
- package/public/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/public/skills/superpowers/writing-skills/graphviz-conventions.dot +172 -0
- package/public/skills/superpowers/writing-skills/persuasion-principles.md +187 -0
- package/public/skills/superpowers/writing-skills/render-graphs.js +168 -0
- package/public/skills/superpowers/writing-skills/testing-skills-with-subagents.md +384 -0
- package/dist/web/_next/static/chunks/0-81wi7xr2nd-.js +0 -270
- package/dist/web/_next/static/chunks/00lca9lsasdm7.js +0 -1
- package/dist/web/_next/static/chunks/01gi~q0c6ez6..js +0 -1
- package/dist/web/_next/static/chunks/02shswpmybici.js +0 -1
- package/dist/web/_next/static/chunks/05tx6hzdtkgi9.js +0 -2
- package/dist/web/_next/static/chunks/07nbyndvzftr1.js +0 -3
- package/dist/web/_next/static/chunks/0bn~onkv~9xza.js +0 -1
- package/dist/web/_next/static/chunks/0g-0n6glz_z6w.js +0 -1
- package/dist/web/_next/static/chunks/0gyede80jpy3n.js +0 -4
- package/dist/web/_next/static/chunks/0hrbuvzuxrjfl.js +0 -1
- package/dist/web/_next/static/chunks/0i51q.5s_-.vh.css +0 -1
- package/dist/web/_next/static/chunks/0qf163pbrwy4z.js +0 -1
- package/dist/web/_next/static/chunks/0rnt-f3pjxb-d.js +0 -5
- package/dist/web/_next/static/chunks/0tgbcgsca9mrg.js +0 -1
- package/dist/web/_next/static/chunks/0tyhv6.y7~yxd.js +0 -1
- package/dist/web/_next/static/chunks/0u7_qd9hzqwac.js +0 -1
- package/dist/web/_next/static/chunks/0vuvql8rloda5.js +0 -1
- package/dist/web/_next/static/chunks/0wv0h27jafag4.js +0 -1
- package/dist/web/_next/static/chunks/0wwvc4zc2q6bn.js +0 -1
- package/dist/web/_next/static/chunks/0xmmk3vebw8xs.js +0 -1
- package/dist/web/_next/static/chunks/0xwqf.llmm_u2.js +0 -31
- package/dist/web/_next/static/chunks/0yo22_w53mo~5.js +0 -1
- package/dist/web/_next/static/chunks/12c0jp0qvlr1t.js +0 -1
- package/dist/web/_next/static/chunks/12pg1nn3v~~5k.js +0 -1
- package/dist/web/_next/static/chunks/16cyr8ilpx1nn.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/avatars/1777813826407-bea0ja-minimax.svg +0 -1
- package/public/avatars/1777813967088-3xlvd0-minimax.svg +0 -1
- package/public/avatars/1777814041714-yp0qeq-minimax.svg +0 -1
- package/public/avatars/1777904986095-rg26je-icon.png +0 -0
- package/public/avatars/1778953228323-5je54x-user.jpg +0 -0
- package/public/avatars/1778954057880-g01q6y-user.jpg +0 -0
- /package/dist/web/_next/static/{GS3b40oeaeLxm7i9-ibaj → e8w3vd9Eov_LDYWj_0zsE}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{GS3b40oeaeLxm7i9-ibaj → e8w3vd9Eov_LDYWj_0zsE}/_clientMiddlewareManifest.js +0 -0
- /package/dist/web/_next/static/{GS3b40oeaeLxm7i9-ibaj → e8w3vd9Eov_LDYWj_0zsE}/_ssgManifest.js +0 -0
- /package/public/avatars/{1777815865622-08wp9m-user.jpg → user.jpg} +0 -0
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
import { resolveOutputStyleContent } from '../services/output-style.js';
|
|
1
2
|
export function summarizeResult(text) {
|
|
2
3
|
const normalized = text.trim().replace(/\s+/g, ' ');
|
|
3
4
|
if (!normalized)
|
|
4
5
|
return 'Completed agent execution';
|
|
5
6
|
return normalized.length > 160 ? `${normalized.slice(0, 157)}...` : normalized;
|
|
6
7
|
}
|
|
8
|
+
export function appendOutputStyleToPrompt(prompt, outputStyle) {
|
|
9
|
+
const style = resolveOutputStyleContent(outputStyle)?.trim();
|
|
10
|
+
if (!style)
|
|
11
|
+
return prompt;
|
|
12
|
+
return [
|
|
13
|
+
prompt.trimEnd(),
|
|
14
|
+
'',
|
|
15
|
+
'Output style instructions:',
|
|
16
|
+
style,
|
|
17
|
+
].join('\n');
|
|
18
|
+
}
|
|
7
19
|
//# sourceMappingURL=agent-runtime-types.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import { query } from '@anthropic-ai/claude-agent-sdk';
|
|
3
3
|
import { summarizeResult } from '../agent-runtime-types.js';
|
|
4
|
+
import { prepareClaudeOutputStyleFile } from '../../services/output-style.js';
|
|
4
5
|
import { normalizeAdditionalDirectories, normalizePermissionMode, normalizeSkillNames, prepareConfigDir, resolveBundledClaudeExecutable, buildEnv, normalizeMcpServers } from './sdk-config.js';
|
|
5
6
|
import { startClaudeAdapterIfNeeded, getClaudeCodeModel } from './adapter-pool.js';
|
|
6
7
|
import { extractThinkingEvents, extractToolUseEvents, extractToolResultEvent, logToolDebug, formatMessage, isAskUserQuestionAutoResult, countUsageTokens, formatUsageLine, normalizeUsage } from './message-format.js';
|
|
@@ -25,6 +26,7 @@ export class ClaudeCodeRuntime {
|
|
|
25
26
|
if (configDir)
|
|
26
27
|
prepareConfigDir(configDir, agentDir);
|
|
27
28
|
const skillNames = normalizeSkillNames(options?.skills, configDir);
|
|
29
|
+
const outputStyleFile = configDir ? prepareClaudeOutputStyleFile(configDir, options?.outputStyle) : undefined;
|
|
28
30
|
const claudeExecutable = resolveBundledClaudeExecutable();
|
|
29
31
|
this.adapterRun = await startClaudeAdapterIfNeeded(this.config);
|
|
30
32
|
const baseURL = this.adapterRun?.url ?? this.config.baseURL;
|
|
@@ -46,6 +48,7 @@ export class ClaudeCodeRuntime {
|
|
|
46
48
|
tools: { type: 'preset', preset: 'claude_code' },
|
|
47
49
|
mcpServers: sdkMcpServers,
|
|
48
50
|
skills: skillNames,
|
|
51
|
+
outputStyle: outputStyleFile,
|
|
49
52
|
managedSettings: {
|
|
50
53
|
strictPluginOnlyCustomization: ['mcp'],
|
|
51
54
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { basename, extname, join } from 'node:path';
|
|
3
3
|
import { Codex } from '@openai/codex-sdk';
|
|
4
|
-
import { summarizeResult } from './agent-runtime-types.js';
|
|
4
|
+
import { appendOutputStyleToPrompt, summarizeResult } from './agent-runtime-types.js';
|
|
5
5
|
/**
|
|
6
6
|
* Runtime backed by OpenAI's Codex SDK.
|
|
7
7
|
* Spawns the bundled Codex CLI and consumes its structured JSONL event stream.
|
|
@@ -48,7 +48,7 @@ export class CodexRuntime {
|
|
|
48
48
|
const thread = options?.resumeSessionId
|
|
49
49
|
? codex.resumeThread(options.resumeSessionId, threadOptions)
|
|
50
50
|
: codex.startThread(threadOptions);
|
|
51
|
-
const { events } = await thread.runStreamed(prompt, {
|
|
51
|
+
const { events } = await thread.runStreamed(appendOutputStyleToPrompt(prompt, options?.outputStyle), {
|
|
52
52
|
signal: this.abortController.signal,
|
|
53
53
|
});
|
|
54
54
|
let resultText = '';
|
package/dist/adapters/git.js
CHANGED
|
@@ -36,26 +36,36 @@ function getGit(workspace) {
|
|
|
36
36
|
}
|
|
37
37
|
function mapStatus(raw) {
|
|
38
38
|
const files = [];
|
|
39
|
+
const addOrUpdate = (file) => {
|
|
40
|
+
const existing = files.find(x => x.path === file.path);
|
|
41
|
+
if (existing) {
|
|
42
|
+
Object.assign(existing, file, {
|
|
43
|
+
staged: existing.staged || file.staged,
|
|
44
|
+
conflicted: existing.conflicted || file.conflicted,
|
|
45
|
+
status: file.conflicted ? 'conflicted' : existing.status,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
files.push(file);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
39
52
|
for (const f of raw.staged) {
|
|
40
|
-
|
|
53
|
+
addOrUpdate({ path: f, status: mapStatusCode(raw.files.find(r => r.path === f)?.index), staged: true });
|
|
41
54
|
}
|
|
42
55
|
for (const f of raw.modified) {
|
|
43
|
-
|
|
44
|
-
files.push({ path: f, status: 'modified' });
|
|
45
|
-
}
|
|
56
|
+
addOrUpdate({ path: f, status: 'modified' });
|
|
46
57
|
}
|
|
47
58
|
for (const f of raw.not_added) {
|
|
48
|
-
|
|
59
|
+
addOrUpdate({ path: f, status: 'untracked' });
|
|
49
60
|
}
|
|
50
61
|
for (const f of raw.deleted) {
|
|
51
|
-
|
|
52
|
-
files.push({ path: f, status: 'deleted' });
|
|
53
|
-
}
|
|
62
|
+
addOrUpdate({ path: f, status: 'deleted' });
|
|
54
63
|
}
|
|
55
64
|
for (const f of raw.created) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
addOrUpdate({ path: f, status: 'added', staged: raw.staged.includes(f) });
|
|
66
|
+
}
|
|
67
|
+
for (const f of raw.conflicted) {
|
|
68
|
+
addOrUpdate({ path: f, status: 'conflicted', conflicted: true });
|
|
59
69
|
}
|
|
60
70
|
return {
|
|
61
71
|
branch: raw.current || 'HEAD',
|
|
@@ -67,6 +77,73 @@ function mapStatus(raw) {
|
|
|
67
77
|
deletions: 0,
|
|
68
78
|
};
|
|
69
79
|
}
|
|
80
|
+
async function getUpstreamRef(git, branch) {
|
|
81
|
+
const upstream = await git.raw(['rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{u}'])
|
|
82
|
+
.then(v => v.trim())
|
|
83
|
+
.catch(() => '');
|
|
84
|
+
if (upstream)
|
|
85
|
+
return upstream;
|
|
86
|
+
if (!branch || branch === 'HEAD')
|
|
87
|
+
return null;
|
|
88
|
+
const originBranch = `origin/${branch}`;
|
|
89
|
+
const hasOriginBranch = await git.raw(['rev-parse', '--verify', '--quiet', originBranch])
|
|
90
|
+
.then(() => true)
|
|
91
|
+
.catch(() => false);
|
|
92
|
+
return hasOriginBranch ? originBranch : null;
|
|
93
|
+
}
|
|
94
|
+
function splitConflictSides(content) {
|
|
95
|
+
const left = [];
|
|
96
|
+
const right = [];
|
|
97
|
+
let mode = 'both';
|
|
98
|
+
let hasConflict = false;
|
|
99
|
+
for (const line of content.split('\n')) {
|
|
100
|
+
if (line.startsWith('<<<<<<< ')) {
|
|
101
|
+
hasConflict = true;
|
|
102
|
+
mode = 'left';
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (line.startsWith('=======')) {
|
|
106
|
+
mode = 'right';
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (line.startsWith('>>>>>>> ')) {
|
|
110
|
+
mode = 'both';
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (mode === 'both' || mode === 'left')
|
|
114
|
+
left.push(line);
|
|
115
|
+
if (mode === 'both' || mode === 'right')
|
|
116
|
+
right.push(line);
|
|
117
|
+
}
|
|
118
|
+
return { left: left.join('\n'), right: right.join('\n'), hasConflict };
|
|
119
|
+
}
|
|
120
|
+
async function buildWorkingDiff(git, rootDir, filePath, conflicted = false) {
|
|
121
|
+
const binary = isBinaryPath(filePath);
|
|
122
|
+
const workingContent = binary ? '' : await readFile(join(rootDir, filePath), 'utf-8').catch(() => '');
|
|
123
|
+
if (!binary && conflicted) {
|
|
124
|
+
const conflict = splitConflictSides(workingContent);
|
|
125
|
+
if (conflict.hasConflict) {
|
|
126
|
+
return {
|
|
127
|
+
path: filePath,
|
|
128
|
+
oldContent: conflict.left,
|
|
129
|
+
newContent: conflict.right,
|
|
130
|
+
isBinary: false,
|
|
131
|
+
isNew: false,
|
|
132
|
+
isDeleted: false,
|
|
133
|
+
isConflict: true,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const oldContent = binary ? '' : await git.show([`HEAD:${filePath}`]).catch(() => '');
|
|
138
|
+
return {
|
|
139
|
+
path: filePath,
|
|
140
|
+
oldContent,
|
|
141
|
+
newContent: workingContent,
|
|
142
|
+
isBinary: binary,
|
|
143
|
+
isNew: !oldContent,
|
|
144
|
+
isDeleted: !workingContent,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
70
147
|
function mapStatusCode(code) {
|
|
71
148
|
switch (code) {
|
|
72
149
|
case 'A': return 'added';
|
|
@@ -83,6 +160,19 @@ export async function gitStatus(workspaceId) {
|
|
|
83
160
|
const git = getGit(ws);
|
|
84
161
|
const raw = await git.status();
|
|
85
162
|
const result = mapStatus(raw);
|
|
163
|
+
try {
|
|
164
|
+
const headHash = await git.revparse(['--short', 'HEAD']);
|
|
165
|
+
result.headHash = headHash.trim();
|
|
166
|
+
}
|
|
167
|
+
catch { }
|
|
168
|
+
try {
|
|
169
|
+
const upstream = await getUpstreamRef(git, result.branch);
|
|
170
|
+
if (upstream) {
|
|
171
|
+
const remoteHeadHash = await git.revparse(['--short', upstream]);
|
|
172
|
+
result.remoteHeadHash = remoteHeadHash.trim();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch { }
|
|
86
176
|
if (!result.clean) {
|
|
87
177
|
try {
|
|
88
178
|
// Tracked changes: modified/deleted/renamed
|
|
@@ -122,66 +212,73 @@ export async function gitDiff(workspaceId, filePath) {
|
|
|
122
212
|
throw new Error('Workspace not found');
|
|
123
213
|
const git = getGit(ws);
|
|
124
214
|
const diffs = [];
|
|
215
|
+
const status = await git.status();
|
|
216
|
+
const conflicted = new Set(status.conflicted);
|
|
125
217
|
if (filePath) {
|
|
126
|
-
|
|
127
|
-
const oldContent = await git.show([`HEAD:${filePath}`]).catch(() => '');
|
|
128
|
-
const newContent = await import('node:fs/promises').then(fs => fs.readFile(`${ws.boundDirs[0]}/${filePath}`, 'utf-8')).catch(() => '');
|
|
129
|
-
diffs.push({
|
|
130
|
-
path: filePath,
|
|
131
|
-
oldContent: isBinaryPath(filePath) ? '' : oldContent,
|
|
132
|
-
newContent: isBinaryPath(filePath) ? '' : newContent,
|
|
133
|
-
isBinary: isBinaryPath(filePath),
|
|
134
|
-
isNew: !oldContent,
|
|
135
|
-
isDeleted: !newContent,
|
|
136
|
-
});
|
|
218
|
+
diffs.push(await buildWorkingDiff(git, ws.boundDirs[0], filePath, conflicted.has(filePath)));
|
|
137
219
|
}
|
|
138
220
|
else {
|
|
139
221
|
const raw = await git.diff(['--name-only']);
|
|
140
|
-
const
|
|
222
|
+
const cachedRaw = await git.diff(['--cached', '--name-only']);
|
|
223
|
+
const files = Array.from(new Set([
|
|
224
|
+
...raw.split('\n').filter(Boolean),
|
|
225
|
+
...cachedRaw.split('\n').filter(Boolean),
|
|
226
|
+
...status.not_added,
|
|
227
|
+
...status.conflicted,
|
|
228
|
+
]));
|
|
141
229
|
for (const f of files) {
|
|
142
|
-
|
|
143
|
-
const oldContent = binary ? '' : await git.show([`HEAD:${f}`]).catch(() => '');
|
|
144
|
-
const newContent = binary ? '' : await import('node:fs/promises').then(fs => fs.readFile(`${ws.boundDirs[0]}/${f}`, 'utf-8')).catch(() => '');
|
|
145
|
-
diffs.push({
|
|
146
|
-
path: f,
|
|
147
|
-
oldContent,
|
|
148
|
-
newContent,
|
|
149
|
-
isBinary: binary,
|
|
150
|
-
isNew: !oldContent,
|
|
151
|
-
isDeleted: !newContent,
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
// Also check untracked (staged new files)
|
|
155
|
-
const status = await git.status();
|
|
156
|
-
for (const f of status.not_added) {
|
|
157
|
-
const binary = isBinaryPath(f);
|
|
158
|
-
const newContent = binary ? '' : await import('node:fs/promises').then(fs => fs.readFile(`${ws.boundDirs[0]}/${f}`, 'utf-8')).catch(() => '');
|
|
159
|
-
if (newContent || binary) {
|
|
160
|
-
diffs.push({
|
|
161
|
-
path: f,
|
|
162
|
-
oldContent: '',
|
|
163
|
-
newContent: binary ? '' : newContent,
|
|
164
|
-
isBinary: binary,
|
|
165
|
-
isNew: true,
|
|
166
|
-
isDeleted: false,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
230
|
+
diffs.push(await buildWorkingDiff(git, ws.boundDirs[0], f, conflicted.has(f)));
|
|
169
231
|
}
|
|
170
232
|
}
|
|
171
233
|
return diffs;
|
|
172
234
|
}
|
|
235
|
+
export async function gitStage(workspaceId, filePath) {
|
|
236
|
+
const ws = getWorkspace(workspaceId);
|
|
237
|
+
if (!ws)
|
|
238
|
+
throw new Error('Workspace not found');
|
|
239
|
+
const git = getGit(ws);
|
|
240
|
+
await git.add(filePath);
|
|
241
|
+
}
|
|
242
|
+
export async function gitUnstage(workspaceId, filePath) {
|
|
243
|
+
const ws = getWorkspace(workspaceId);
|
|
244
|
+
if (!ws)
|
|
245
|
+
throw new Error('Workspace not found');
|
|
246
|
+
const git = getGit(ws);
|
|
247
|
+
await git.raw(['restore', '--staged', '--', filePath]).catch(async () => {
|
|
248
|
+
await git.raw(['reset', 'HEAD', '--', filePath]);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
export async function gitResolveFile(workspaceId, filePath, content, stage = true) {
|
|
252
|
+
const ws = getWorkspace(workspaceId);
|
|
253
|
+
if (!ws)
|
|
254
|
+
throw new Error('Workspace not found');
|
|
255
|
+
const git = getGit(ws);
|
|
256
|
+
await writeFile(join(ws.boundDirs[0], filePath), content, 'utf-8');
|
|
257
|
+
if (stage)
|
|
258
|
+
await git.add(filePath);
|
|
259
|
+
}
|
|
173
260
|
export async function gitLog(workspaceId, maxCount = 50) {
|
|
174
261
|
const ws = getWorkspace(workspaceId);
|
|
175
262
|
if (!ws)
|
|
176
263
|
throw new Error('Workspace not found');
|
|
177
264
|
const git = getGit(ws);
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
265
|
+
const status = await git.status();
|
|
266
|
+
const upstream = await getUpstreamRef(git, status.current || 'HEAD');
|
|
267
|
+
const refs = upstream ? ['HEAD', upstream] : ['HEAD'];
|
|
268
|
+
const pretty = '%H%x1f%s%x1f%an%x1f%aI%x1e';
|
|
269
|
+
const raw = await git.raw(['log', `--max-count=${maxCount}`, `--pretty=format:${pretty}`, ...refs]);
|
|
270
|
+
return raw.split('\x1e')
|
|
271
|
+
.map(record => record.trim())
|
|
272
|
+
.filter(Boolean)
|
|
273
|
+
.map(record => {
|
|
274
|
+
const [hash = '', message = '', author = '', date = ''] = record.split('\x1f');
|
|
275
|
+
return {
|
|
276
|
+
hash: hash.substring(0, 7),
|
|
277
|
+
message,
|
|
278
|
+
author,
|
|
279
|
+
date,
|
|
280
|
+
};
|
|
281
|
+
});
|
|
185
282
|
}
|
|
186
283
|
export async function gitCommit(workspaceId, message) {
|
|
187
284
|
const ws = getWorkspace(workspaceId);
|
|
@@ -274,6 +371,13 @@ export async function gitPush(workspaceId) {
|
|
|
274
371
|
throw new Error('No remote repository configured. Please add a remote first.');
|
|
275
372
|
await git.push('origin', branch);
|
|
276
373
|
}
|
|
374
|
+
export async function gitFetch(workspaceId) {
|
|
375
|
+
const ws = getWorkspace(workspaceId);
|
|
376
|
+
if (!ws)
|
|
377
|
+
throw new Error('Workspace not found');
|
|
378
|
+
const git = getGit(ws);
|
|
379
|
+
await git.fetch('origin');
|
|
380
|
+
}
|
|
277
381
|
export async function gitPull(workspaceId) {
|
|
278
382
|
const ws = getWorkspace(workspaceId);
|
|
279
383
|
if (!ws)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAgent, initChatModel, tool } from 'langchain';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { summarizeResult } from './agent-runtime-types.js';
|
|
3
|
+
import { appendOutputStyleToPrompt, summarizeResult } from './agent-runtime-types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Runtime backed by LangChain.js.
|
|
6
6
|
* Uses LangChain's provider-neutral createAgent API and adapts Agent Spaces tools.
|
|
@@ -27,7 +27,7 @@ export class LangChainRuntime {
|
|
|
27
27
|
tools: buildLangChainTools(options?.functionTools, output, options),
|
|
28
28
|
systemPrompt: options?.systemPrompt,
|
|
29
29
|
});
|
|
30
|
-
const result = await agent.invoke({ messages: [{ role: 'user', content: prompt }] }, {
|
|
30
|
+
const result = await agent.invoke({ messages: [{ role: 'user', content: appendOutputStyleToPrompt(prompt, options?.outputStyle) }] }, {
|
|
31
31
|
signal: this.abortController?.signal,
|
|
32
32
|
recursionLimit: options?.maxTurns ? Math.max(2, options.maxTurns * 2 + 1) : undefined,
|
|
33
33
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createAgent } from '@codeany/open-agent-sdk';
|
|
2
|
-
import { summarizeResult } from './agent-runtime-types.js';
|
|
2
|
+
import { appendOutputStyleToPrompt, summarizeResult } from './agent-runtime-types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Runtime backed by @codeany/open-agent-sdk.
|
|
5
5
|
* Runs the agent loop in-process with the SDK's built-in tools.
|
|
@@ -35,7 +35,7 @@ export class OpenAgentSdkRuntime {
|
|
|
35
35
|
});
|
|
36
36
|
d('agent created, sending prompt...');
|
|
37
37
|
d('tool debug | open-agent-sdk runtime does not expose per-tool stream events through prompt(); only final text/usage is available here');
|
|
38
|
-
const result = await this.agent.prompt(prompt);
|
|
38
|
+
const result = await this.agent.prompt(appendOutputStyleToPrompt(prompt, options?.outputStyle));
|
|
39
39
|
const elapsed = Date.now() - startTime;
|
|
40
40
|
const inputTokens = result.usage.input_tokens;
|
|
41
41
|
const outputTokens = result.usage.output_tokens;
|
|
@@ -28,13 +28,36 @@ export async function generateAgentDesign(userPrompt) {
|
|
|
28
28
|
apiBase: maskUrl(config.apiBase),
|
|
29
29
|
promptLength: prompt.length,
|
|
30
30
|
});
|
|
31
|
-
const content = await
|
|
31
|
+
const content = await requestText(config, buildDesignSystemPrompt(config), prompt);
|
|
32
32
|
console.info('[agent-designer] model text extracted', {
|
|
33
33
|
length: content.length,
|
|
34
34
|
preview: content.slice(0, 500),
|
|
35
35
|
});
|
|
36
36
|
return normalizeDesign(parseJsonObject(content));
|
|
37
37
|
}
|
|
38
|
+
export async function optimizeAgentPrompt(userPrompt, currentPrompt) {
|
|
39
|
+
const prompt = userPrompt.trim();
|
|
40
|
+
if (!prompt)
|
|
41
|
+
throw new Error('prompt is required');
|
|
42
|
+
const config = resolveModelConfig();
|
|
43
|
+
if (!config) {
|
|
44
|
+
throw new Error(`Configure model settings for ${AGENT_GENERATOR_PRESET_ID} before optimizing prompts.`);
|
|
45
|
+
}
|
|
46
|
+
console.info('[agent-designer] optimizing agent prompt', {
|
|
47
|
+
agentId: AGENT_GENERATOR_PRESET_ID,
|
|
48
|
+
provider: config.modelProvider ?? inferProvider(config.apiBase),
|
|
49
|
+
modelId: config.modelId,
|
|
50
|
+
apiBase: maskUrl(config.apiBase),
|
|
51
|
+
promptLength: prompt.length,
|
|
52
|
+
currentPromptLength: currentPrompt.trim().length,
|
|
53
|
+
});
|
|
54
|
+
const content = await requestText(config, buildOptimizationSystemPrompt(config), buildPromptOptimizationUserPrompt(prompt, currentPrompt));
|
|
55
|
+
console.info('[agent-designer] optimized prompt received', {
|
|
56
|
+
length: content.length,
|
|
57
|
+
preview: content.slice(0, 500),
|
|
58
|
+
});
|
|
59
|
+
return { systemPrompt: normalizePrompt(content) };
|
|
60
|
+
}
|
|
38
61
|
function resolveModelConfig() {
|
|
39
62
|
const preset = readAgentTemplate(AGENT_GENERATOR_PRESET_ID);
|
|
40
63
|
if (preset?.apiBase && preset.apiKey && preset.modelId) {
|
|
@@ -51,14 +74,17 @@ function resolveModelConfig() {
|
|
|
51
74
|
return null;
|
|
52
75
|
}
|
|
53
76
|
async function requestDesign(config, userPrompt) {
|
|
77
|
+
return requestText(config, buildDesignSystemPrompt(config), userPrompt);
|
|
78
|
+
}
|
|
79
|
+
async function requestText(config, systemPrompt, userPrompt) {
|
|
54
80
|
const provider = config.modelProvider ?? inferProvider(config.apiBase);
|
|
55
81
|
if (provider === 'anthropic-messages')
|
|
56
|
-
return requestAnthropic(config, userPrompt);
|
|
82
|
+
return requestAnthropic(config, systemPrompt, userPrompt);
|
|
57
83
|
if (provider === 'gemini-generate-content')
|
|
58
|
-
return requestGemini(config, userPrompt);
|
|
59
|
-
return requestOpenAICompatible(config, userPrompt, provider === 'openai-responses' || provider === 'openai-responses-to-anthropic-messages');
|
|
84
|
+
return requestGemini(config, systemPrompt, userPrompt);
|
|
85
|
+
return requestOpenAICompatible(config, systemPrompt, userPrompt, provider === 'openai-responses' || provider === 'openai-responses-to-anthropic-messages');
|
|
60
86
|
}
|
|
61
|
-
async function requestOpenAICompatible(config, userPrompt, useResponsesApi) {
|
|
87
|
+
async function requestOpenAICompatible(config, systemPrompt, userPrompt, useResponsesApi) {
|
|
62
88
|
const url = joinUrl(config.apiBase, useResponsesApi ? '/responses' : '/chat/completions');
|
|
63
89
|
const response = await fetch(url, {
|
|
64
90
|
method: 'POST',
|
|
@@ -69,14 +95,14 @@ async function requestOpenAICompatible(config, userPrompt, useResponsesApi) {
|
|
|
69
95
|
body: JSON.stringify(useResponsesApi
|
|
70
96
|
? {
|
|
71
97
|
model: config.modelId,
|
|
72
|
-
input: `${
|
|
98
|
+
input: `${systemPrompt}\n\nUser request:\n${userPrompt}`,
|
|
73
99
|
temperature: config.temperature ?? 0.2,
|
|
74
100
|
max_output_tokens: config.maxTokens,
|
|
75
101
|
}
|
|
76
102
|
: {
|
|
77
103
|
model: config.modelId,
|
|
78
104
|
messages: [
|
|
79
|
-
{ role: 'system', content:
|
|
105
|
+
{ role: 'system', content: systemPrompt },
|
|
80
106
|
{ role: 'user', content: userPrompt },
|
|
81
107
|
],
|
|
82
108
|
temperature: config.temperature ?? 0.2,
|
|
@@ -88,7 +114,7 @@ async function requestOpenAICompatible(config, userPrompt, useResponsesApi) {
|
|
|
88
114
|
throw new Error(body.error || `Agent design generation failed with status ${response.status}`);
|
|
89
115
|
return body.text;
|
|
90
116
|
}
|
|
91
|
-
async function requestAnthropic(config, userPrompt) {
|
|
117
|
+
async function requestAnthropic(config, systemPrompt, userPrompt) {
|
|
92
118
|
const response = await fetch(getAnthropicMessagesUrl(config.apiBase), {
|
|
93
119
|
method: 'POST',
|
|
94
120
|
headers: {
|
|
@@ -98,7 +124,7 @@ async function requestAnthropic(config, userPrompt) {
|
|
|
98
124
|
},
|
|
99
125
|
body: JSON.stringify({
|
|
100
126
|
model: config.modelId,
|
|
101
|
-
system:
|
|
127
|
+
system: systemPrompt,
|
|
102
128
|
messages: [{ role: 'user', content: userPrompt }],
|
|
103
129
|
max_tokens: config.maxTokens ?? 4096,
|
|
104
130
|
temperature: config.temperature ?? 0.2,
|
|
@@ -109,7 +135,7 @@ async function requestAnthropic(config, userPrompt) {
|
|
|
109
135
|
throw new Error(body.error || `Agent design generation failed with status ${response.status}`);
|
|
110
136
|
return body.text;
|
|
111
137
|
}
|
|
112
|
-
async function requestGemini(config, userPrompt) {
|
|
138
|
+
async function requestGemini(config, systemPrompt, userPrompt) {
|
|
113
139
|
const response = await fetch(joinUrl(config.apiBase, `/models/${encodeURIComponent(config.modelId)}:generateContent`), {
|
|
114
140
|
method: 'POST',
|
|
115
141
|
headers: {
|
|
@@ -117,7 +143,7 @@ async function requestGemini(config, userPrompt) {
|
|
|
117
143
|
'Content-Type': 'application/json',
|
|
118
144
|
},
|
|
119
145
|
body: JSON.stringify({
|
|
120
|
-
systemInstruction: { parts: [{ text:
|
|
146
|
+
systemInstruction: { parts: [{ text: systemPrompt }] },
|
|
121
147
|
contents: [{ role: 'user', parts: [{ text: userPrompt }] }],
|
|
122
148
|
generationConfig: {
|
|
123
149
|
temperature: config.temperature ?? 0.2,
|
|
@@ -130,12 +156,40 @@ async function requestGemini(config, userPrompt) {
|
|
|
130
156
|
throw new Error(body.error || `Agent design generation failed with status ${response.status}`);
|
|
131
157
|
return body.text;
|
|
132
158
|
}
|
|
133
|
-
function
|
|
159
|
+
function buildDesignSystemPrompt(config) {
|
|
134
160
|
const custom = config.systemPrompt?.trim();
|
|
135
161
|
if (!custom)
|
|
136
162
|
return SYSTEM_PROMPT;
|
|
137
163
|
return `${custom}\n\n${SYSTEM_PROMPT}`;
|
|
138
164
|
}
|
|
165
|
+
function buildOptimizationSystemPrompt(config) {
|
|
166
|
+
const custom = config.systemPrompt?.trim();
|
|
167
|
+
const base = [
|
|
168
|
+
'You optimize agent system prompts.',
|
|
169
|
+
'Return only the rewritten prompt text.',
|
|
170
|
+
'Do not wrap the result in markdown fences.',
|
|
171
|
+
'Do not add commentary, bullets about the process, or any explanation outside the prompt.',
|
|
172
|
+
'Keep the prompt actionable, concise, and directly usable as a system prompt.',
|
|
173
|
+
'Preserve important constraints from the current prompt unless the user request clearly asks to change them.',
|
|
174
|
+
].join('\n');
|
|
175
|
+
if (!custom)
|
|
176
|
+
return base;
|
|
177
|
+
return `${custom}\n\n${base}`;
|
|
178
|
+
}
|
|
179
|
+
function buildPromptOptimizationUserPrompt(userRequest, currentPrompt) {
|
|
180
|
+
return [
|
|
181
|
+
'User request:',
|
|
182
|
+
userRequest,
|
|
183
|
+
'',
|
|
184
|
+
'Current system prompt:',
|
|
185
|
+
currentPrompt.trim() || '(empty)',
|
|
186
|
+
'',
|
|
187
|
+
'Rewrite the current system prompt according to the user request. Return only the final prompt text.',
|
|
188
|
+
].join('\n');
|
|
189
|
+
}
|
|
190
|
+
function normalizePrompt(text) {
|
|
191
|
+
return text.trim().replace(/^```(?:markdown|md)?\s*/i, '').replace(/\s*```$/i, '');
|
|
192
|
+
}
|
|
139
193
|
async function readResponseBody(response) {
|
|
140
194
|
const raw = await response.text();
|
|
141
195
|
if (!raw)
|
|
@@ -42,6 +42,7 @@ export async function runCommitAgent(workspaceId) {
|
|
|
42
42
|
}), workingDir, {
|
|
43
43
|
maxTurns: 1,
|
|
44
44
|
systemPrompt,
|
|
45
|
+
outputStyle: commitAgent.outputStyle,
|
|
45
46
|
});
|
|
46
47
|
agentService.complete(workspaceId, session.id, result.success ? undefined : result.error, {
|
|
47
48
|
runtime: commitAgent.runtimeKind,
|
|
@@ -74,7 +74,9 @@ export function createIssueAgentProgress(workspaceId, issue, preset, agentSessio
|
|
|
74
74
|
return { message, comment };
|
|
75
75
|
}
|
|
76
76
|
export function completeIssueAgentProgress(workspaceId, issue, progress, summary, output, metadata) {
|
|
77
|
-
const
|
|
77
|
+
const parts = metadata.parts;
|
|
78
|
+
const finalText = [...(parts ?? [])].reverse().find((part) => part.type === 'text')?.text.trim();
|
|
79
|
+
const content = finalText || summary.trim() || output.join('\n').trim();
|
|
78
80
|
if (!content.trim())
|
|
79
81
|
return;
|
|
80
82
|
const message = messageService.updateMessage(workspaceId, issue.channelId, progress.message.id, {
|
|
@@ -88,7 +90,7 @@ export function completeIssueAgentProgress(workspaceId, issue, progress, summary
|
|
|
88
90
|
summary,
|
|
89
91
|
duration: metadata.duration,
|
|
90
92
|
},
|
|
91
|
-
parts
|
|
93
|
+
parts,
|
|
92
94
|
});
|
|
93
95
|
if (message)
|
|
94
96
|
broadcastToWorkspace(workspaceId, 'channel.message.updated', message);
|
|
@@ -9,6 +9,11 @@ export async function runIssueAutomation(workspaceId, issueId, ctx) {
|
|
|
9
9
|
console.warn(`[issue-runner] issue not found workspaceId=${workspaceId} issueId=${issueId}`);
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
|
+
const tasks = taskService.list(workspaceId, issueId);
|
|
13
|
+
if (tasks.length > 0) {
|
|
14
|
+
await scheduleRunnableIssueTasks(workspaceId, issueId, ctx);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
12
17
|
// Workflow template branch
|
|
13
18
|
if (issue.workflowId) {
|
|
14
19
|
const template = workflowService.getWorkflow(issue.workflowId);
|
|
@@ -29,11 +34,6 @@ export async function runIssueAutomation(workspaceId, issueId, ctx) {
|
|
|
29
34
|
return;
|
|
30
35
|
}
|
|
31
36
|
}
|
|
32
|
-
const tasks = taskService.list(workspaceId, issueId);
|
|
33
|
-
if (tasks.length > 0) {
|
|
34
|
-
await scheduleRunnableIssueTasks(workspaceId, issueId, ctx);
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
37
|
console.warn(`[issue-runner] no workflow configured for issue workspaceId=${workspaceId} issueId=${issueId}`);
|
|
38
38
|
}
|
|
39
39
|
export function hasActiveIssueAutomation(workspaceId) {
|