@agent-spaces/server 0.3.61 → 0.3.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/dist/adapters/agent-runtime-types.js +12 -0
  2. package/dist/adapters/claude-code-runtime/index.js +22 -0
  3. package/dist/adapters/claude-code-runtime/sdk-config.js +34 -10
  4. package/dist/adapters/codex-runtime.js +2 -2
  5. package/dist/adapters/git.js +29 -13
  6. package/dist/adapters/langchain-runtime.js +2 -2
  7. package/dist/adapters/open-agent-sdk-runtime.js +2 -2
  8. package/dist/agents/agent-message-parts.js +27 -3
  9. package/dist/agents/commit-agent.js +1 -0
  10. package/dist/agents/issue-agent-progress.js +4 -2
  11. package/dist/agents/issue-agent-runner.js +5 -5
  12. package/dist/agents/issue-task-controller.js +95 -14
  13. package/dist/app.js +74 -5
  14. package/dist/package.json +1 -1
  15. package/dist/routes/agent-sse.js +4 -2
  16. package/dist/routes/channel.js +21 -4
  17. package/dist/routes/file.js +87 -1
  18. package/dist/routes/hooks.js +88 -0
  19. package/dist/routes/issue.js +59 -1
  20. package/dist/routes/output-style.js +48 -0
  21. package/dist/routes/prompt-template.js +2 -2
  22. package/dist/routes/skill.js +97 -3
  23. package/dist/routes/task.js +13 -1
  24. package/dist/services/agent.js +45 -16
  25. package/dist/services/hook-engine.js +118 -0
  26. package/dist/services/issue.js +6 -0
  27. package/dist/services/notification-hub/bot-agent.js +1 -0
  28. package/dist/services/output-style.js +134 -0
  29. package/dist/services/persistent-agent-context.js +37 -4
  30. package/dist/services/prompt-template.js +2 -2
  31. package/dist/services/skill.js +275 -40
  32. package/dist/storage/hook-store.js +55 -0
  33. package/dist/web/404.html +1 -1
  34. package/dist/web/__next.__PAGE__.txt +4 -4
  35. package/dist/web/__next._full.txt +25 -23
  36. package/dist/web/__next._head.txt +4 -4
  37. package/dist/web/__next._index.txt +13 -13
  38. package/dist/web/__next._tree.txt +2 -2
  39. package/dist/web/_next/static/chunks/0-1bfvfwifh-m.js +1 -0
  40. package/dist/web/_next/static/chunks/0-f~0xmwl__u5.js +1 -0
  41. package/dist/web/_next/static/chunks/0.n~yfwf4~6w-.js +1 -0
  42. package/dist/web/_next/static/chunks/002_j970b9gdx.js +1 -0
  43. package/dist/web/_next/static/chunks/014x2qbuiszni.js +3 -0
  44. package/dist/web/_next/static/chunks/01iqv28_snwus.js +1 -0
  45. package/dist/web/_next/static/chunks/02c22g~xd-y30.js +19 -0
  46. package/dist/web/_next/static/chunks/02mf61htij8g0.js +31 -0
  47. package/dist/web/_next/static/chunks/03scq1-0ykve3.js +1 -0
  48. package/dist/web/_next/static/chunks/046me66nilkff.js +1 -0
  49. package/dist/web/_next/static/chunks/04v-pqqs-2lvp.css +1 -0
  50. package/dist/web/_next/static/chunks/05f8cnmzqd5wb.js +1 -0
  51. package/dist/web/_next/static/chunks/{0zd1o3u04~qvo.js → 05psi2gtx~bev.js} +7 -7
  52. package/dist/web/_next/static/chunks/{12odetnu-lyrr.js → 06whz1~s_7pva.js} +12 -12
  53. package/dist/web/_next/static/chunks/06w~.izyfylap.js +1 -0
  54. package/dist/web/_next/static/chunks/08kfx8on9oty~.js +1 -0
  55. package/dist/web/_next/static/chunks/09t62a89~jesc.js +3 -0
  56. package/dist/web/_next/static/chunks/09y_3krccdd~u.js +1 -0
  57. package/dist/web/_next/static/chunks/{0njy89g5coeyi.js → 0_8dm7bxp18xo.js} +6 -6
  58. package/dist/web/_next/static/chunks/0_e~hmntdfop9.js +1 -0
  59. package/dist/web/_next/static/chunks/0_udc.6.tueey.js +1 -0
  60. package/dist/web/_next/static/chunks/0_vi1a~g4wx46.js +3 -0
  61. package/dist/web/_next/static/chunks/{05iy4.c-1cfhd.js → 0aa6bcdmtpekn.js} +1 -1
  62. package/dist/web/_next/static/chunks/{0tvd~rxgf0oh_.js → 0bbmx45w_h5np.js} +1 -1
  63. package/dist/web/_next/static/chunks/0cke33d38fnby.js +90 -0
  64. package/dist/web/_next/static/chunks/{0w1iudd1d46sw.js → 0ctg5qmw7uu.1.js} +2 -2
  65. package/dist/web/_next/static/chunks/0cyq~8xb~r5fc.js +1 -0
  66. package/dist/web/_next/static/chunks/0ewceguykiut5.js +1 -0
  67. package/dist/web/_next/static/chunks/0fxa1edqr7dve.js +1 -0
  68. package/dist/web/_next/static/chunks/{0202ia13sijwb.js → 0h18ej5yf974e.js} +1 -1
  69. package/dist/web/_next/static/chunks/0hra80eyuu37u.js +1 -0
  70. package/dist/web/_next/static/chunks/0i39jifmxla7q.js +1 -0
  71. package/dist/web/_next/static/chunks/0ie7y4k2ncvnn.js +1 -0
  72. package/dist/web/_next/static/chunks/0igc~uli58ncw.js +2 -0
  73. package/dist/web/_next/static/chunks/0kof5qdg8c2-k.js +71 -0
  74. package/dist/web/_next/static/chunks/{08o-zmr-40r5g.js → 0m11vvph7q94-.js} +1 -1
  75. package/dist/web/_next/static/chunks/0msb2mi3hiu5_.js +67 -0
  76. package/dist/web/_next/static/chunks/0np.d~hc1-pmh.js +4 -0
  77. package/dist/web/_next/static/chunks/{0qpq0~_58fe9a.js → 0oaq67r7ix.vg.js} +1 -1
  78. package/dist/web/_next/static/chunks/0ogpc3f3keopc.js +3 -0
  79. package/dist/web/_next/static/chunks/{0d_dp_4ofz0l3.css → 0ojcao3hdm36s.css} +0 -1
  80. package/dist/web/_next/static/chunks/0p1n8bvfnpl41.js +1 -0
  81. package/dist/web/_next/static/chunks/{0gig.k.rq8d0x.js → 0ppr271hz0xoq.js} +1 -1
  82. package/dist/web/_next/static/chunks/0s_dva~eh2yhi.js +3 -0
  83. package/dist/web/_next/static/chunks/0typj55ox8d5i.js +1 -0
  84. package/dist/web/_next/static/chunks/0w2p4ldi2aymp.js +1 -0
  85. package/dist/web/_next/static/chunks/{0..g0jl-8qup7.js → 0xoo17yef_b8g.js} +1 -1
  86. package/dist/web/_next/static/chunks/0xt-8wk21gs7g.js +1 -0
  87. package/dist/web/_next/static/chunks/0y09i51u6ixq5.js +1 -0
  88. package/dist/web/_next/static/chunks/0za1r07-6az6w.js +1 -0
  89. package/dist/web/_next/static/chunks/0zc0xgp5ourcn.js +1 -0
  90. package/dist/web/_next/static/chunks/0zmhdridea1s5.js +90 -0
  91. package/dist/web/_next/static/chunks/0~u.5r3-t7179.js +1 -0
  92. package/dist/web/_next/static/chunks/10.alq.6stmld.js +1 -0
  93. package/dist/web/_next/static/chunks/11-czmcci_55y.js +1 -0
  94. package/dist/web/_next/static/chunks/11b3zgk1etlkw.js +7 -0
  95. package/dist/web/_next/static/chunks/11k-.49r~1mfm.js +1 -0
  96. package/dist/web/_next/static/chunks/11qp8r5dotf7d.js +1 -0
  97. package/dist/web/_next/static/chunks/128ugqd34tr_-.js +1 -0
  98. package/dist/web/_next/static/chunks/12mxlicp247c8.js +1 -0
  99. package/dist/web/_next/static/chunks/135w27dd8c19s.js +5 -0
  100. package/dist/web/_next/static/chunks/13~y-b.b9rrw4.js +1 -0
  101. package/dist/web/_next/static/chunks/{0jokpgh485~28.js → 14hqmid8q4apf.js} +11 -11
  102. package/dist/web/_next/static/chunks/16sg-lflc8csx.js +1 -0
  103. package/dist/web/_next/static/chunks/176dc-dtokxxi.js +16 -0
  104. package/dist/web/_next/static/chunks/17g-0pqre.anw.js +1 -0
  105. package/dist/web/_next/static/chunks/17oc2l.ekcs8b.css +1 -0
  106. package/dist/web/_next/static/chunks/{turbopack-0lrdxynxb9-1t.js → turbopack-0ndm2zc_pdptk.js} +1 -1
  107. package/dist/web/_not-found/__next._full.txt +29 -30
  108. package/dist/web/_not-found/__next._head.txt +4 -4
  109. package/dist/web/_not-found/__next._index.txt +13 -13
  110. package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
  111. package/dist/web/_not-found/__next._not-found.txt +3 -3
  112. package/dist/web/_not-found/__next._tree.txt +2 -2
  113. package/dist/web/_not-found.html +1 -1
  114. package/dist/web/_not-found.txt +29 -30
  115. package/dist/web/icons/file_type_audio.svg +3 -1
  116. package/dist/web/icons/file_type_video.svg +10 -1
  117. package/dist/web/index.html +1 -1
  118. package/dist/web/index.txt +25 -23
  119. package/dist/web/login/__next._full.txt +30 -28
  120. package/dist/web/login/__next._head.txt +4 -4
  121. package/dist/web/login/__next._index.txt +13 -13
  122. package/dist/web/login/__next._tree.txt +2 -2
  123. package/dist/web/login/__next.login.__PAGE__.txt +4 -4
  124. package/dist/web/login/__next.login.txt +3 -3
  125. package/dist/web/login.html +1 -1
  126. package/dist/web/login.txt +30 -28
  127. package/dist/web/settings/__next._full.txt +32 -31
  128. package/dist/web/settings/__next._head.txt +4 -4
  129. package/dist/web/settings/__next._index.txt +13 -13
  130. package/dist/web/settings/__next._tree.txt +2 -2
  131. package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
  132. package/dist/web/settings/__next.settings.txt +5 -5
  133. package/dist/web/settings/agents/__next._full.txt +35 -34
  134. package/dist/web/settings/agents/__next._head.txt +4 -4
  135. package/dist/web/settings/agents/__next._index.txt +13 -13
  136. package/dist/web/settings/agents/__next._tree.txt +2 -2
  137. package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
  138. package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
  139. package/dist/web/settings/agents/__next.settings.txt +5 -5
  140. package/dist/web/settings/agents.html +1 -1
  141. package/dist/web/settings/agents.txt +35 -34
  142. package/dist/web/settings/mcps/__next._full.txt +35 -34
  143. package/dist/web/settings/mcps/__next._head.txt +4 -4
  144. package/dist/web/settings/mcps/__next._index.txt +13 -13
  145. package/dist/web/settings/mcps/__next._tree.txt +2 -2
  146. package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
  147. package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
  148. package/dist/web/settings/mcps/__next.settings.txt +5 -5
  149. package/dist/web/settings/mcps.html +1 -1
  150. package/dist/web/settings/mcps.txt +35 -34
  151. package/dist/web/settings/models/__next._full.txt +35 -34
  152. package/dist/web/settings/models/__next._head.txt +4 -4
  153. package/dist/web/settings/models/__next._index.txt +13 -13
  154. package/dist/web/settings/models/__next._tree.txt +2 -2
  155. package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
  156. package/dist/web/settings/models/__next.settings.models.txt +3 -3
  157. package/dist/web/settings/models/__next.settings.txt +5 -5
  158. package/dist/web/settings/models.html +1 -1
  159. package/dist/web/settings/models.txt +35 -34
  160. package/dist/web/settings/output-styles/__next._full.txt +43 -0
  161. package/dist/web/settings/output-styles/__next._head.txt +6 -0
  162. package/dist/web/settings/output-styles/__next._index.txt +15 -0
  163. package/dist/web/settings/output-styles/__next._tree.txt +8 -0
  164. package/dist/web/settings/output-styles/__next.settings.output-styles.__PAGE__.txt +9 -0
  165. package/dist/web/settings/output-styles/__next.settings.output-styles.txt +5 -0
  166. package/dist/web/settings/output-styles/__next.settings.txt +7 -0
  167. package/dist/web/settings/output-styles.html +1 -0
  168. package/dist/web/settings/output-styles.txt +43 -0
  169. package/dist/web/settings/prompts/__next._full.txt +35 -34
  170. package/dist/web/settings/prompts/__next._head.txt +4 -4
  171. package/dist/web/settings/prompts/__next._index.txt +13 -13
  172. package/dist/web/settings/prompts/__next._tree.txt +2 -2
  173. package/dist/web/settings/prompts/__next.settings.prompts.__PAGE__.txt +4 -4
  174. package/dist/web/settings/prompts/__next.settings.prompts.txt +3 -3
  175. package/dist/web/settings/prompts/__next.settings.txt +5 -5
  176. package/dist/web/settings/prompts.html +1 -1
  177. package/dist/web/settings/prompts.txt +35 -34
  178. package/dist/web/settings/providers/__next._full.txt +35 -34
  179. package/dist/web/settings/providers/__next._head.txt +4 -4
  180. package/dist/web/settings/providers/__next._index.txt +13 -13
  181. package/dist/web/settings/providers/__next._tree.txt +2 -2
  182. package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
  183. package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
  184. package/dist/web/settings/providers/__next.settings.txt +5 -5
  185. package/dist/web/settings/providers.html +1 -1
  186. package/dist/web/settings/providers.txt +35 -34
  187. package/dist/web/settings/skills/__next._full.txt +35 -34
  188. package/dist/web/settings/skills/__next._head.txt +4 -4
  189. package/dist/web/settings/skills/__next._index.txt +13 -13
  190. package/dist/web/settings/skills/__next._tree.txt +2 -2
  191. package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
  192. package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
  193. package/dist/web/settings/skills/__next.settings.txt +5 -5
  194. package/dist/web/settings/skills.html +1 -1
  195. package/dist/web/settings/skills.txt +35 -34
  196. package/dist/web/settings.html +1 -1
  197. package/dist/web/settings.txt +32 -31
  198. package/dist/web/workflows/__next._full.txt +32 -30
  199. package/dist/web/workflows/__next._head.txt +4 -4
  200. package/dist/web/workflows/__next._index.txt +13 -13
  201. package/dist/web/workflows/__next._tree.txt +2 -2
  202. package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
  203. package/dist/web/workflows/__next.workflows.txt +3 -3
  204. package/dist/web/workflows.html +1 -1
  205. package/dist/web/workflows.txt +32 -30
  206. package/dist/web/workspace/_/__next._full.txt +30 -70
  207. package/dist/web/workspace/_/__next._head.txt +4 -4
  208. package/dist/web/workspace/_/__next._index.txt +13 -13
  209. package/dist/web/workspace/_/__next._tree.txt +2 -17
  210. package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -18
  211. package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
  212. package/dist/web/workspace/_/__next.workspace.txt +3 -3
  213. package/dist/web/workspace/_.html +1 -1
  214. package/dist/web/workspace/_.txt +30 -70
  215. package/dist/web/workspaces/__next._full.txt +31 -29
  216. package/dist/web/workspaces/__next._head.txt +4 -4
  217. package/dist/web/workspaces/__next._index.txt +13 -13
  218. package/dist/web/workspaces/__next._tree.txt +2 -2
  219. package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
  220. package/dist/web/workspaces/__next.workspaces.txt +3 -3
  221. package/dist/web/workspaces.html +1 -1
  222. package/dist/web/workspaces.txt +31 -29
  223. package/dist/ws/agent-runner.js +55 -33
  224. package/dist/ws/message-parts.js +61 -2
  225. package/package.json +1 -1
  226. package/public/output-styles/carmack-mode.md +381 -0
  227. package/public/output-styles/codex-rigor-mode.md +114 -0
  228. package/public/output-styles/dhh-mode.md +265 -0
  229. package/public/output-styles/evan-you-mode.md +539 -0
  230. package/public/output-styles/index.json +37 -0
  231. package/public/output-styles/jobs-mode.md +369 -0
  232. package/public/output-styles/linus-mode.md +135 -0
  233. package/public/output-styles/uncle-bob-mode.md +221 -0
  234. package/public/prompt/andrej-karpathy-skills.md +65 -0
  235. package/public/prompt/claude-token-efficient-coding.md +35 -0
  236. package/public/prompt/index.json +12 -0
  237. package/public/skills/index.json +92 -0
  238. package/public/skills/planning-with-files/planning-with-files-zh/SKILL.md +243 -0
  239. package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.ps1 +44 -0
  240. package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.sh +46 -0
  241. package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.ps1 +124 -0
  242. package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.sh +124 -0
  243. package/public/skills/planning-with-files/planning-with-files-zh/scripts/session-catchup.py +438 -0
  244. package/public/skills/planning-with-files/planning-with-files-zh/templates/findings.md +29 -0
  245. package/public/skills/planning-with-files/planning-with-files-zh/templates/progress.md +40 -0
  246. package/public/skills/planning-with-files/planning-with-files-zh/templates/task_plan.md +58 -0
  247. package/public/skills/superpowers/brainstorming/SKILL.md +164 -0
  248. package/public/skills/superpowers/brainstorming/scripts/frame-template.html +214 -0
  249. package/public/skills/superpowers/brainstorming/scripts/helper.js +88 -0
  250. package/public/skills/superpowers/brainstorming/scripts/server.cjs +354 -0
  251. package/public/skills/superpowers/brainstorming/scripts/start-server.sh +148 -0
  252. package/public/skills/superpowers/brainstorming/scripts/stop-server.sh +56 -0
  253. package/public/skills/superpowers/brainstorming/spec-document-reviewer-prompt.md +49 -0
  254. package/public/skills/superpowers/brainstorming/visual-companion.md +287 -0
  255. package/public/skills/superpowers/dispatching-parallel-agents/SKILL.md +182 -0
  256. package/public/skills/superpowers/executing-plans/SKILL.md +70 -0
  257. package/public/skills/superpowers/finishing-a-development-branch/SKILL.md +251 -0
  258. package/public/skills/superpowers/receiving-code-review/SKILL.md +213 -0
  259. package/public/skills/superpowers/requesting-code-review/SKILL.md +103 -0
  260. package/public/skills/superpowers/requesting-code-review/code-reviewer.md +168 -0
  261. package/public/skills/superpowers/subagent-driven-development/SKILL.md +279 -0
  262. package/public/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md +25 -0
  263. package/public/skills/superpowers/subagent-driven-development/implementer-prompt.md +113 -0
  264. package/public/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  265. package/public/skills/superpowers/systematic-debugging/CREATION-LOG.md +119 -0
  266. package/public/skills/superpowers/systematic-debugging/SKILL.md +296 -0
  267. package/public/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +158 -0
  268. package/public/skills/superpowers/systematic-debugging/condition-based-waiting.md +115 -0
  269. package/public/skills/superpowers/systematic-debugging/defense-in-depth.md +122 -0
  270. package/public/skills/superpowers/systematic-debugging/find-polluter.sh +63 -0
  271. package/public/skills/superpowers/systematic-debugging/root-cause-tracing.md +169 -0
  272. package/public/skills/superpowers/systematic-debugging/test-academic.md +14 -0
  273. package/public/skills/superpowers/systematic-debugging/test-pressure-1.md +58 -0
  274. package/public/skills/superpowers/systematic-debugging/test-pressure-2.md +68 -0
  275. package/public/skills/superpowers/systematic-debugging/test-pressure-3.md +69 -0
  276. package/public/skills/superpowers/test-driven-development/SKILL.md +371 -0
  277. package/public/skills/superpowers/test-driven-development/testing-anti-patterns.md +299 -0
  278. package/public/skills/superpowers/using-git-worktrees/SKILL.md +215 -0
  279. package/public/skills/superpowers/using-superpowers/SKILL.md +117 -0
  280. package/public/skills/superpowers/using-superpowers/references/codex-tools.md +59 -0
  281. package/public/skills/superpowers/using-superpowers/references/copilot-tools.md +42 -0
  282. package/public/skills/superpowers/using-superpowers/references/gemini-tools.md +51 -0
  283. package/public/skills/superpowers/verification-before-completion/SKILL.md +139 -0
  284. package/public/skills/superpowers/writing-plans/SKILL.md +152 -0
  285. package/public/skills/superpowers/writing-plans/plan-document-reviewer-prompt.md +49 -0
  286. package/public/skills/superpowers/writing-skills/SKILL.md +655 -0
  287. package/public/skills/superpowers/writing-skills/anthropic-best-practices.md +1150 -0
  288. package/public/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  289. package/public/skills/superpowers/writing-skills/graphviz-conventions.dot +172 -0
  290. package/public/skills/superpowers/writing-skills/persuasion-principles.md +187 -0
  291. package/public/skills/superpowers/writing-skills/render-graphs.js +168 -0
  292. package/public/skills/superpowers/writing-skills/testing-skills-with-subagents.md +384 -0
  293. package/dist/web/_next/static/chunks/0-1pn22sg~67u.js +0 -2
  294. package/dist/web/_next/static/chunks/01gi~q0c6ez6..js +0 -1
  295. package/dist/web/_next/static/chunks/03me5_ir..2ix.js +0 -1
  296. package/dist/web/_next/static/chunks/05eu2fdixf7c9.js +0 -1
  297. package/dist/web/_next/static/chunks/0_-c.y2qq4ax4.js +0 -270
  298. package/dist/web/_next/static/chunks/0_g3irbniww6d.js +0 -3
  299. package/dist/web/_next/static/chunks/0cs830n97dgjy.js +0 -1
  300. package/dist/web/_next/static/chunks/0g-0n6glz_z6w.js +0 -1
  301. package/dist/web/_next/static/chunks/0gyede80jpy3n.js +0 -4
  302. package/dist/web/_next/static/chunks/0hrbuvzuxrjfl.js +0 -1
  303. package/dist/web/_next/static/chunks/0ju52ko_nh7gi.js +0 -1
  304. package/dist/web/_next/static/chunks/0mny8i81aenx3.js +0 -1
  305. package/dist/web/_next/static/chunks/0nsu~f3voe~0i.js +0 -5
  306. package/dist/web/_next/static/chunks/0sz8_nijfiz0p.js +0 -1
  307. package/dist/web/_next/static/chunks/0u7_qd9hzqwac.js +0 -1
  308. package/dist/web/_next/static/chunks/0w3o.7vi.dlm6.js +0 -1
  309. package/dist/web/_next/static/chunks/0wv0h27jafag4.js +0 -1
  310. package/dist/web/_next/static/chunks/0wwvc4zc2q6bn.js +0 -1
  311. package/dist/web/_next/static/chunks/0x4b-a2ixww6m.js +0 -1
  312. package/dist/web/_next/static/chunks/0xwqf.llmm_u2.js +0 -31
  313. package/dist/web/_next/static/chunks/0~w6ugk9s5p-h.css +0 -1
  314. package/dist/web/_next/static/chunks/125nunjfj2fj0.js +0 -1
  315. package/dist/web/_next/static/chunks/1285yqy_oirb-.js +0 -1
  316. package/dist/web/_next/static/chunks/13ess~4pdmxma.js +0 -1
  317. package/dist/web/_next/static/chunks/14n8i2xz4_y-e.js +0 -1
  318. package/public/avatars/1777813826407-bea0ja-minimax.svg +0 -1
  319. package/public/avatars/1777813967088-3xlvd0-minimax.svg +0 -1
  320. package/public/avatars/1777814041714-yp0qeq-minimax.svg +0 -1
  321. package/public/avatars/1777904986095-rg26je-icon.png +0 -0
  322. package/public/avatars/1778953228323-5je54x-user.jpg +0 -0
  323. package/public/avatars/1778954057880-g01q6y-user.jpg +0 -0
  324. /package/dist/web/_next/static/{HUlYEknPhyW7dRmJ5mFdG → OoXAsPtrUWjC1l898FSvI}/_buildManifest.js +0 -0
  325. /package/dist/web/_next/static/{HUlYEknPhyW7dRmJ5mFdG → OoXAsPtrUWjC1l898FSvI}/_clientMiddlewareManifest.js +0 -0
  326. /package/dist/web/_next/static/{HUlYEknPhyW7dRmJ5mFdG → OoXAsPtrUWjC1l898FSvI}/_ssgManifest.js +0 -0
  327. /package/public/avatars/{1777815865622-08wp9m-user.jpg → user.jpg} +0 -0
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 } from 'node:fs';
8
+ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
9
9
  import { writeFile } from 'node:fs/promises';
10
- import { join, dirname } from 'node:path';
10
+ import { join, dirname, 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';
@@ -22,8 +22,10 @@ import authRouter from './routes/auth.js';
22
22
  import folderRouter from './routes/folder.js';
23
23
  import commandRouter from './routes/command.js';
24
24
  import codeFavoritesRouter from './routes/code-favorites.js';
25
+ import hooksRouter from './routes/hooks.js';
25
26
  import skillRouter from './routes/skill.js';
26
27
  import promptTemplateRouter from './routes/prompt-template.js';
28
+ import outputStyleRouter from './routes/output-style.js';
27
29
  import mcpRouter from './routes/mcp.js';
28
30
  import subscriptionRouter from './routes/subscription.js';
29
31
  import agentSseRouter from './routes/agent-sse.js';
@@ -65,6 +67,73 @@ app.use('/api', authMiddleware);
65
67
  // Serve static files from public/
66
68
  const publicDir = resolveRuntimeDir('public');
67
69
  app.use('/public', express.static(publicDir));
70
+ // Scan public/prompt/ and generate index.json for the prompt store
71
+ function scanPromptStore() {
72
+ const promptDir = join(publicDir, 'prompt');
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();
68
137
  app.get('/api/health', (_req, res) => {
69
138
  res.json({ status: 'ok', timestamp: new Date().toISOString(), platform: process.platform });
70
139
  });
@@ -82,9 +151,7 @@ app.post('/api/upload/avatar', async (req, res) => {
82
151
  return;
83
152
  }
84
153
  const [, mime, base64] = match;
85
- const ext = mime === 'image/png' ? 'png' : mime === 'image/webp' ? 'webp' : 'jpg';
86
- const id = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
87
- const name = filename ? `${id}-${filename.replace(/[^a-zA-Z0-9._-]/g, '_')}` : `${id}.${ext}`;
154
+ const name = 'user.jpg';
88
155
  const avatarsDir = join(publicDir, 'avatars');
89
156
  if (!existsSync(avatarsDir))
90
157
  mkdirSync(avatarsDir, { recursive: true });
@@ -113,6 +180,7 @@ app.use('/api/workspaces/:id/issues', issueRouter);
113
180
  app.use('/api/workflows', workflowRouter);
114
181
  app.use('/api/workspaces/:id/commands', commandRouter);
115
182
  app.use('/api/workspaces/:id/code-favorites', codeFavoritesRouter);
183
+ app.use('/api/workspaces/:id/hooks', hooksRouter);
116
184
  app.use('/api/workspaces/:id/agents', agentRouter);
117
185
  app.use('/api/workspaces/:id/tasks', taskRouter);
118
186
  app.use('/api/workspaces/:id/git', gitRouter);
@@ -144,6 +212,7 @@ app.use('/api', llmRouter);
144
212
  app.use('/api/folder', folderRouter);
145
213
  app.use('/api/skills', skillRouter);
146
214
  app.use('/api/prompt-templates', promptTemplateRouter);
215
+ app.use('/api/output-styles', outputStyleRouter);
147
216
  app.use('/api/mcps', mcpRouter);
148
217
  app.use('/api/subscriptions', subscriptionRouter);
149
218
  app.use('/api/speech-recognition', speechRecognitionRouter);
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-spaces/server",
3
- "version": "0.3.5",
3
+ "version": "0.3.63",
4
4
  "type": "module",
5
5
  "main": "app.js",
6
6
  "packageManager": "pnpm@10.17.1",
@@ -5,6 +5,7 @@ import * as agentService from '../services/agent.js';
5
5
  import * as workspaceService from '../services/workspace.js';
6
6
  import { getThinkingRuntimeConfig } from '../services/llm-model-config.js';
7
7
  import { buildAgentPrompt } from '../ws/agent-prompt.js';
8
+ import { wrapOnEventWithHooks } from '../services/hook-engine.js';
8
9
  const router = Router();
9
10
  router.post('/run', async (req, res) => {
10
11
  const body = req.body;
@@ -78,11 +79,12 @@ router.post('/run', async (req, res) => {
78
79
  skills,
79
80
  configDir,
80
81
  sandboxDirs: preset.sandboxDirs,
81
- onEvent: (event) => {
82
+ outputStyle: body.outputStyle ?? preset.outputStyle,
83
+ onEvent: wrapOnEventWithHooks((event) => {
82
84
  if (event.type === 'output')
83
85
  output.push(event.line);
84
86
  writeSse(res, event.type, serializeRuntimeEvent(event));
85
- },
87
+ }, workspaceId, workspace?.hooksEnabled),
86
88
  });
87
89
  completed = true;
88
90
  const displayOutput = output.length ? output : result.output;
@@ -2,7 +2,7 @@ import { Router } from 'express';
2
2
  import { listChannels, createChannel, getChannel, updateChannel, deleteChannel } from '../services/channel.js';
3
3
  import { listMessages, createMessage, updateMessage, deleteMessage, clearMessages } from '../services/message.js';
4
4
  import { broadcastToWorkspace } from '../ws/connection-manager.js';
5
- import { hasActiveChannelRuns, markInactiveChannelRunsStopped, stopChannelRuns } from '../ws/agent-runner.js';
5
+ import { hasActiveChannelRuns, stopChannelRuns } from '../ws/agent-runner.js';
6
6
  import { getToolDetail } from '../services/tool-detail.js';
7
7
  import * as issueService from '../services/issue.js';
8
8
  const router = Router({ mergeParams: true });
@@ -69,11 +69,28 @@ router.get('/:channelId/messages', (req, res) => {
69
69
  res.status(404).json({ error: 'channel not found' });
70
70
  return;
71
71
  }
72
- if (!hasActiveChannelRuns(id, channelId)) {
73
- markInactiveChannelRunsStopped(id, channelId);
74
- }
75
72
  res.json(listMessages(id, channelId, { limit: limit ? Number(limit) : undefined, before: before }));
76
73
  });
74
+ // GET /api/workspaces/:id/channels/:channelId/state
75
+ router.get('/:channelId/state', (req, res) => {
76
+ const { id, channelId } = req.params;
77
+ if (!getChannel(id, channelId)) {
78
+ res.status(404).json({ error: 'channel not found' });
79
+ return;
80
+ }
81
+ const messages = listMessages(id, channelId, { limit: 1 });
82
+ const lastMessage = messages.at(-1);
83
+ res.json({
84
+ channelId,
85
+ active: hasActiveChannelRuns(id, channelId),
86
+ lastMessage: lastMessage ? {
87
+ id: lastMessage.id,
88
+ status: lastMessage.status,
89
+ metadata: lastMessage.metadata,
90
+ hasPendingQuestion: Boolean(lastMessage.parts?.some((part) => (part.type === 'ask_user_question' && part.status !== 'answered' && !part.answer))),
91
+ } : null,
92
+ });
93
+ });
77
94
  // GET /api/workspaces/:id/channels/:channelId/messages/:messageId/tool-details/:detailId
78
95
  router.get('/:channelId/messages/:messageId/tool-details/:detailId', (req, res) => {
79
96
  const { id, channelId, messageId, detailId } = req.params;
@@ -1,6 +1,7 @@
1
1
  import { Router } from 'express';
2
2
  import { exec } from 'child_process';
3
- import { resolve, join } from 'path';
3
+ import { resolve, join, extname } from 'path';
4
+ import { existsSync, createReadStream, statSync } from 'node:fs';
4
5
  import * as fileService from '../services/file.js';
5
6
  import { getDataDir } from '../storage/json-store.js';
6
7
  const EDITOR_STATE_PATH = '.agentspace/editor-state.json';
@@ -16,6 +17,13 @@ router.get('/tree', async (req, res) => {
16
17
  const tree = await fileService.readTree(ws, path, depth);
17
18
  res.json(tree);
18
19
  });
20
+ const MIME_MAP = {
21
+ '.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.gif': 'image/gif',
22
+ '.webp': 'image/webp', '.svg': 'image/svg+xml', '.bmp': 'image/bmp', '.ico': 'image/x-icon',
23
+ '.mp4': 'video/mp4', '.webm': 'video/webm', '.ogg': 'video/ogg', '.mov': 'video/quicktime',
24
+ '.mp3': 'audio/mpeg', '.wav': 'audio/wav', '.flac': 'audio/flac', '.aac': 'audio/aac',
25
+ '.m4a': 'audio/mp4', '.opus': 'audio/opus',
26
+ };
19
27
  router.get('/content', async (req, res) => {
20
28
  const ws = fileService.getWorkspace(req.params.id);
21
29
  if (!ws) {
@@ -27,6 +35,38 @@ router.get('/content', async (req, res) => {
27
35
  res.status(400).json({ error: 'path is required' });
28
36
  return;
29
37
  }
38
+ const raw = req.query.raw === 'true';
39
+ if (raw) {
40
+ const abs = fileService.resolvePath(ws, path);
41
+ if (!abs || !existsSync(abs)) {
42
+ res.status(404).json({ error: 'File not found' });
43
+ return;
44
+ }
45
+ const ext = extname(path).toLowerCase();
46
+ const mime = MIME_MAP[ext] || 'application/octet-stream';
47
+ const stat = statSync(abs);
48
+ const fileSize = stat.size;
49
+ // Handle Range requests for video/audio seeking
50
+ const range = req.headers.range;
51
+ if (range) {
52
+ const parts = range.replace(/bytes=/, '').split('-');
53
+ const start = parseInt(parts[0], 10);
54
+ const end = parts[1] ? parseInt(parts[1], 10) : fileSize - 1;
55
+ const chunkSize = end - start + 1;
56
+ res.status(206);
57
+ res.setHeader('Content-Range', `bytes ${start}-${end}/${fileSize}`);
58
+ res.setHeader('Accept-Ranges', 'bytes');
59
+ res.setHeader('Content-Length', chunkSize);
60
+ res.setHeader('Content-Type', mime);
61
+ createReadStream(abs, { start, end }).pipe(res);
62
+ return;
63
+ }
64
+ res.setHeader('Content-Type', mime);
65
+ res.setHeader('Accept-Ranges', 'bytes');
66
+ res.setHeader('Content-Length', fileSize);
67
+ createReadStream(abs).pipe(res);
68
+ return;
69
+ }
30
70
  const result = await fileService.readFileContent(ws, path);
31
71
  if (!result) {
32
72
  res.status(404).json({ error: 'File not found' });
@@ -253,5 +293,51 @@ router.post('/upload', async (req, res) => {
253
293
  }
254
294
  res.json({ ok: true, paths: results });
255
295
  });
296
+ router.get('/download', async (req, res) => {
297
+ const ws = fileService.getWorkspace(req.params.id);
298
+ if (!ws) {
299
+ res.status(404).json({ error: 'Workspace not found' });
300
+ return;
301
+ }
302
+ const path = req.query.path;
303
+ if (!path) {
304
+ res.status(400).json({ error: 'path is required' });
305
+ return;
306
+ }
307
+ const abs = fileService.resolvePath(ws, path);
308
+ if (!abs || !existsSync(abs)) {
309
+ res.status(404).json({ error: 'File not found' });
310
+ return;
311
+ }
312
+ const stat = statSync(abs);
313
+ if (stat.isDirectory()) {
314
+ res.status(400).json({ error: 'Cannot download a directory' });
315
+ return;
316
+ }
317
+ const ext = extname(path).toLowerCase();
318
+ const mime = MIME_MAP[ext] || 'application/octet-stream';
319
+ const fileName = path.split('/').pop() || 'download';
320
+ // Handle Range requests for large files
321
+ const range = req.headers.range;
322
+ if (range) {
323
+ const parts = range.replace(/bytes=/, '').split('-');
324
+ const start = parseInt(parts[0], 10);
325
+ const end = parts[1] ? parseInt(parts[1], 10) : stat.size - 1;
326
+ const chunkSize = end - start + 1;
327
+ res.status(206);
328
+ res.setHeader('Content-Range', `bytes ${start}-${end}/${stat.size}`);
329
+ res.setHeader('Accept-Ranges', 'bytes');
330
+ res.setHeader('Content-Length', chunkSize);
331
+ res.setHeader('Content-Type', mime);
332
+ res.setHeader('Content-Disposition', `attachment; filename="${encodeURIComponent(fileName)}"`);
333
+ createReadStream(abs, { start, end }).pipe(res);
334
+ return;
335
+ }
336
+ res.setHeader('Content-Type', mime);
337
+ res.setHeader('Content-Length', stat.size);
338
+ res.setHeader('Content-Disposition', `attachment; filename="${encodeURIComponent(fileName)}"`);
339
+ res.setHeader('Accept-Ranges', 'bytes');
340
+ createReadStream(abs).pipe(res);
341
+ });
256
342
  export default router;
257
343
  //# sourceMappingURL=file.js.map
@@ -0,0 +1,88 @@
1
+ import { Router } from 'express';
2
+ import * as store from '../storage/hook-store.js';
3
+ const router = Router({ mergeParams: true });
4
+ router.get('/', (req, res) => {
5
+ try {
6
+ res.json(store.listHooks(req.params.id));
7
+ }
8
+ catch (error) {
9
+ res.status(500).json({ error: error.message });
10
+ }
11
+ });
12
+ router.get('/:name', (req, res) => {
13
+ try {
14
+ const hook = store.getHook(req.params.id, req.params.name);
15
+ if (!hook) {
16
+ res.status(404).json({ error: 'Hook not found' });
17
+ return;
18
+ }
19
+ res.json(hook);
20
+ }
21
+ catch (error) {
22
+ res.status(500).json({ error: error.message });
23
+ }
24
+ });
25
+ router.post('/', (req, res) => {
26
+ try {
27
+ const config = req.body;
28
+ if (!config.name) {
29
+ res.status(400).json({ error: 'name required' });
30
+ return;
31
+ }
32
+ store.saveHook(req.params.id, config);
33
+ res.status(201).json(config);
34
+ }
35
+ catch (error) {
36
+ res.status(400).json({ error: error.message });
37
+ }
38
+ });
39
+ router.put('/:name', (req, res) => {
40
+ try {
41
+ const config = req.body;
42
+ config.name = req.params.name;
43
+ store.saveHook(req.params.id, config);
44
+ res.json(config);
45
+ }
46
+ catch (error) {
47
+ res.status(400).json({ error: error.message });
48
+ }
49
+ });
50
+ router.delete('/:name', (req, res) => {
51
+ try {
52
+ store.deleteHook(req.params.id, req.params.name);
53
+ res.status(204).send();
54
+ }
55
+ catch (error) {
56
+ res.status(400).json({ error: error.message });
57
+ }
58
+ });
59
+ router.post('/upload', (req, res) => {
60
+ try {
61
+ const { content } = req.body;
62
+ if (!content || typeof content !== 'string') {
63
+ res.status(400).json({ error: 'content (string) required' });
64
+ return;
65
+ }
66
+ const config = store.uploadHook(req.params.id, content);
67
+ res.status(201).json(config);
68
+ }
69
+ catch (error) {
70
+ res.status(400).json({ error: error.message });
71
+ }
72
+ });
73
+ router.post('/:name/apply', (req, res) => {
74
+ try {
75
+ const { targetWorkspaceId } = req.body;
76
+ if (!targetWorkspaceId) {
77
+ res.status(400).json({ error: 'targetWorkspaceId required' });
78
+ return;
79
+ }
80
+ store.applyToWorkspace(req.params.id, req.params.name, targetWorkspaceId);
81
+ res.json({ ok: true });
82
+ }
83
+ catch (error) {
84
+ res.status(400).json({ error: error.message });
85
+ }
86
+ });
87
+ export default router;
88
+ //# sourceMappingURL=hooks.js.map
@@ -8,6 +8,7 @@ import * as agentService from '../services/agent.js';
8
8
  import * as taskService from '../services/task.js';
9
9
  import { retryIssue } from '../services/issue-retry.js';
10
10
  import { hasActiveIssueAutomation, runIssueAutomation } from '../agents/issue-agent-runner.js';
11
+ import { continueIssueTaskScheduling, stopIssueAutomation } from '../agents/issue-task-controller.js';
11
12
  import * as workflowService from '../services/workflow.js';
12
13
  const router = Router({ mergeParams: true });
13
14
  router.get('/', (req, res) => {
@@ -48,13 +49,15 @@ router.put('/:issueId', (req, res) => {
48
49
  return;
49
50
  }
50
51
  const previousStatus = issue.status;
51
- const { title, description, status, members, workflowId } = req.body;
52
+ const { title, description, status, members, workflowId, continuousRun } = req.body;
52
53
  if (title)
53
54
  issue.title = title;
54
55
  if (description !== undefined)
55
56
  issue.description = description;
56
57
  if (workflowId !== undefined)
57
58
  issue.workflowId = workflowId || undefined;
59
+ if (continuousRun !== undefined)
60
+ issue.continuousRun = continuousRun !== false;
58
61
  if (members !== undefined) {
59
62
  issue.members = normalizeIssueMembers(req.params.id, mergeWorkflowMembers(members, issue.workflowId));
60
63
  }
@@ -142,6 +145,61 @@ router.post('/:issueId/resume', async (req, res) => {
142
145
  }
143
146
  res.json(result.issue);
144
147
  });
148
+ router.post('/:issueId/continue', (req, res) => {
149
+ const workspaceId = req.params.id;
150
+ const { issueId } = req.params;
151
+ const before = issueService.getById(workspaceId, issueId);
152
+ if (!before) {
153
+ res.status(404).json({ error: 'issue not found' });
154
+ return;
155
+ }
156
+ const issue = before.status === 'draft' || before.status === 'planned'
157
+ ? issueService.updateStatus(workspaceId, issueId, 'in_progress')
158
+ : before;
159
+ if (!issue) {
160
+ res.status(404).json({ error: 'issue not found' });
161
+ return;
162
+ }
163
+ if (issue.status !== before.status) {
164
+ broadcastToWorkspace(workspaceId, 'issue.status_changed', { issueId, from: before.status, to: issue.status });
165
+ }
166
+ broadcastToWorkspace(workspaceId, 'issue.updated', issue);
167
+ res.json(issue);
168
+ const ctx = {
169
+ workspaceId,
170
+ broadcast: (event, data) => broadcastToWorkspace(workspaceId, event, data),
171
+ getSession: (sessionId) => agentService.getById(workspaceId, sessionId),
172
+ updateSessionStatus: (sessionId, status, extra) => agentService.updateStatus(workspaceId, sessionId, status, extra),
173
+ };
174
+ continueIssueTaskScheduling(workspaceId, issueId, ctx).catch((err) => {
175
+ console.error(`[issue-continue] scheduling error for issue ${issueId}:`, err);
176
+ });
177
+ });
178
+ router.post('/:issueId/interrupt', (req, res) => {
179
+ const workspaceId = req.params.id;
180
+ const { issueId } = req.params;
181
+ const before = issueService.getById(workspaceId, issueId);
182
+ if (!before) {
183
+ res.status(404).json({ error: 'issue not found' });
184
+ return;
185
+ }
186
+ const reason = 'Interrupted by user';
187
+ const failedTasks = stopIssueAutomation(workspaceId, issueId, reason);
188
+ for (const { task, from } of failedTasks) {
189
+ broadcastToWorkspace(workspaceId, 'task.status_changed', { taskId: task.id, from, to: task.status });
190
+ broadcastToWorkspace(workspaceId, 'task.updated', task);
191
+ }
192
+ if (before.channelId)
193
+ stopChannelRuns(workspaceId, before.channelId);
194
+ const issue = issueService.markError(workspaceId, issueId, reason);
195
+ if (!issue) {
196
+ res.status(404).json({ error: 'issue not found' });
197
+ return;
198
+ }
199
+ broadcastToWorkspace(workspaceId, 'issue.status_changed', { issueId, from: before.status, to: 'error' });
200
+ broadcastToWorkspace(workspaceId, 'issue.updated', issue);
201
+ res.json(issue);
202
+ });
145
203
  router.delete('/:issueId', (req, res) => {
146
204
  const { id, issueId } = req.params;
147
205
  const issue = issueService.getById(id, issueId);
@@ -0,0 +1,48 @@
1
+ import { Router } from 'express';
2
+ import { listOutputStyles, createOutputStyle, updateOutputStyle, deleteOutputStyle, applyOutputStyleToAgents, listOutputStyleAgentCandidates, } from '../services/output-style.js';
3
+ const router = Router();
4
+ router.get('/', (_req, res) => {
5
+ res.json(listOutputStyles());
6
+ });
7
+ router.get('/agents', (_req, res) => {
8
+ res.json(listOutputStyleAgentCandidates());
9
+ });
10
+ router.post('/', (req, res) => {
11
+ const { name, content, storeId, description } = req.body;
12
+ if (!name || !content) {
13
+ res.status(400).json({ error: 'name and content required' });
14
+ return;
15
+ }
16
+ res.json(createOutputStyle(name, content, storeId, description));
17
+ });
18
+ router.put('/:id', (req, res) => {
19
+ const id = typeof req.params.id === 'string' ? req.params.id : req.params.id[0];
20
+ const data = req.body;
21
+ const tmpl = updateOutputStyle(id, data);
22
+ if (!tmpl) {
23
+ res.status(404).json({ error: 'Not found' });
24
+ return;
25
+ }
26
+ res.json(tmpl);
27
+ });
28
+ router.delete('/:id', (req, res) => {
29
+ const id = typeof req.params.id === 'string' ? req.params.id : req.params.id[0];
30
+ const ok = deleteOutputStyle(id);
31
+ if (!ok) {
32
+ res.status(404).json({ error: 'Not found' });
33
+ return;
34
+ }
35
+ res.json({ success: true });
36
+ });
37
+ router.post('/:id/apply', (req, res) => {
38
+ const id = typeof req.params.id === 'string' ? req.params.id : req.params.id[0];
39
+ const { agentIds } = req.body;
40
+ if (!agentIds?.length) {
41
+ res.status(400).json({ error: 'agentIds required' });
42
+ return;
43
+ }
44
+ const applied = applyOutputStyleToAgents(id, agentIds);
45
+ res.json({ applied });
46
+ });
47
+ export default router;
48
+ //# sourceMappingURL=output-style.js.map
@@ -5,12 +5,12 @@ router.get('/', (_req, res) => {
5
5
  res.json(listPromptTemplates());
6
6
  });
7
7
  router.post('/', (req, res) => {
8
- const { name, content } = req.body;
8
+ const { name, content, storeId } = req.body;
9
9
  if (!name || !content) {
10
10
  res.status(400).json({ error: 'name and content required' });
11
11
  return;
12
12
  }
13
- res.json(createPromptTemplate(name, content));
13
+ res.json(createPromptTemplate(name, content, storeId));
14
14
  });
15
15
  router.put('/:id', (req, res) => {
16
16
  const id = typeof req.params.id === 'string' ? req.params.id : req.params.id[0];
@@ -1,5 +1,9 @@
1
1
  import { Router } from 'express';
2
- import { listSkills, importSkill, toggleFavorite, updateSkillContent, deleteSkill, checkSkillSync, syncSkills } from '../services/skill.js';
2
+ import { exec } from 'node:child_process';
3
+ import { join } from 'node:path';
4
+ import { existsSync } from 'node:fs';
5
+ import { listSkills, importSkill, importSkillsBatch, importSkillFromStore, toggleFavorite, updateSkillContent, deleteSkill, checkSkillSync, syncSkills, importSkillsFromGit, listSkillFiles, readSkillFile, writeSkillFile } from '../services/skill.js';
6
+ import { getDataDir } from '../storage/json-store.js';
3
7
  const router = Router();
4
8
  router.get('/', (_req, res) => {
5
9
  res.json(listSkills());
@@ -17,14 +21,50 @@ router.post('/sync', (req, res) => {
17
21
  res.json({ synced });
18
22
  });
19
23
  router.post('/import', (req, res) => {
20
- const { filename, content } = req.body;
24
+ const { filename, content, group } = req.body;
21
25
  if (!filename || !content) {
22
26
  res.status(400).json({ error: 'filename and content required' });
23
27
  return;
24
28
  }
25
- const skill = importSkill(filename, content);
29
+ const skill = importSkill(filename, content, group);
26
30
  res.json(skill);
27
31
  });
32
+ router.post('/import-batch', (req, res) => {
33
+ const { items } = req.body;
34
+ if (!Array.isArray(items) || items.length === 0) {
35
+ res.status(400).json({ error: 'items required' });
36
+ return;
37
+ }
38
+ const skills = importSkillsBatch(items);
39
+ res.json(skills);
40
+ });
41
+ router.post('/import-store', (req, res) => {
42
+ const { path, group } = req.body;
43
+ if (!path) {
44
+ res.status(400).json({ error: 'path required' });
45
+ return;
46
+ }
47
+ const skill = importSkillFromStore(path, group || '');
48
+ if (!skill) {
49
+ res.status(404).json({ error: 'Store skill not found' });
50
+ return;
51
+ }
52
+ res.json(skill);
53
+ });
54
+ router.post('/import-git', (req, res) => {
55
+ const { url } = req.body;
56
+ if (!url) {
57
+ res.status(400).json({ error: 'url required' });
58
+ return;
59
+ }
60
+ try {
61
+ const skills = importSkillsFromGit(url);
62
+ res.json(skills);
63
+ }
64
+ catch (err) {
65
+ res.status(500).json({ error: err.message || 'Git clone failed' });
66
+ }
67
+ });
28
68
  router.post('/:name/favorite', (req, res) => {
29
69
  const name = typeof req.params.name === 'string' ? req.params.name : req.params.name[0];
30
70
  const favorited = toggleFavorite(name);
@@ -44,6 +84,60 @@ router.put('/:name', (req, res) => {
44
84
  }
45
85
  res.json({ success: true });
46
86
  });
87
+ router.get('/:name/files', (req, res) => {
88
+ const name = typeof req.params.name === 'string' ? req.params.name : req.params.name[0];
89
+ const files = listSkillFiles(name);
90
+ res.json(files);
91
+ });
92
+ router.get('/:name/files/{*filePath}', (req, res) => {
93
+ const name = typeof req.params.name === 'string' ? req.params.name : req.params.name[0];
94
+ const filePath = Array.isArray(req.params.filePath) ? req.params.filePath.join('/') : req.params.filePath;
95
+ if (!filePath) {
96
+ res.status(400).json({ error: 'file path required' });
97
+ return;
98
+ }
99
+ const content = readSkillFile(name, filePath);
100
+ if (content === null) {
101
+ res.status(404).json({ error: 'File not found' });
102
+ return;
103
+ }
104
+ res.json({ content });
105
+ });
106
+ router.put('/:name/files/{*filePath}', (req, res) => {
107
+ const name = typeof req.params.name === 'string' ? req.params.name : req.params.name[0];
108
+ const filePath = Array.isArray(req.params.filePath) ? req.params.filePath.join('/') : req.params.filePath;
109
+ const { content } = req.body;
110
+ if (!filePath || content === undefined) {
111
+ res.status(400).json({ error: 'file path and content required' });
112
+ return;
113
+ }
114
+ const ok = writeSkillFile(name, filePath, content);
115
+ if (!ok) {
116
+ res.status(400).json({ error: 'Failed to write file' });
117
+ return;
118
+ }
119
+ res.json({ success: true });
120
+ });
121
+ router.post('/:name/reveal', (req, res) => {
122
+ const name = typeof req.params.name === 'string' ? req.params.name : req.params.name[0];
123
+ const skillDir = join(getDataDir(), 'skills', name);
124
+ if (!existsSync(skillDir)) {
125
+ res.status(404).json({ error: 'Skill folder not found' });
126
+ return;
127
+ }
128
+ const cmd = process.platform === 'darwin'
129
+ ? `open "${skillDir}"`
130
+ : process.platform === 'win32'
131
+ ? `explorer "${skillDir}"`
132
+ : `xdg-open "${skillDir}"`;
133
+ exec(cmd, (err) => {
134
+ if (err) {
135
+ res.status(500).json({ error: 'Failed to reveal', detail: err.message });
136
+ return;
137
+ }
138
+ res.json({ ok: true, path: skillDir });
139
+ });
140
+ });
47
141
  router.delete('/:name', (req, res) => {
48
142
  const name = typeof req.params.name === 'string' ? req.params.name : req.params.name[0];
49
143
  const ok = deleteSkill(name);