@shepai/cli 1.166.1-pr521.4139df8 → 1.167.0-pr478.acc6626

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 (357) hide show
  1. package/dist/packages/core/src/application/ports/output/agents/interactive-agent-executor.interface.d.ts +38 -2
  2. package/dist/packages/core/src/application/ports/output/agents/interactive-agent-executor.interface.d.ts.map +1 -1
  3. package/dist/packages/core/src/application/ports/output/services/interactive-session-service.interface.d.ts +16 -1
  4. package/dist/packages/core/src/application/ports/output/services/interactive-session-service.interface.d.ts.map +1 -1
  5. package/dist/packages/core/src/application/use-cases/interactive/index.d.ts +2 -0
  6. package/dist/packages/core/src/application/use-cases/interactive/index.d.ts.map +1 -1
  7. package/dist/packages/core/src/application/use-cases/interactive/index.js +1 -0
  8. package/dist/packages/core/src/application/use-cases/interactive/respond-to-interaction.use-case.d.ts +17 -0
  9. package/dist/packages/core/src/application/use-cases/interactive/respond-to-interaction.use-case.d.ts.map +1 -0
  10. package/dist/packages/core/src/application/use-cases/interactive/respond-to-interaction.use-case.js +34 -0
  11. package/dist/packages/core/src/application/use-cases/repositories/delete-repository.use-case.d.ts.map +1 -1
  12. package/dist/packages/core/src/application/use-cases/repositories/delete-repository.use-case.js +6 -2
  13. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  14. package/dist/packages/core/src/infrastructure/di/container.js +5 -0
  15. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.d.ts +3 -0
  16. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.d.ts.map +1 -1
  17. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.js +59 -6
  18. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.d.ts +7 -0
  19. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.d.ts.map +1 -1
  20. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.js +101 -1
  21. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/respond/route.d.ts +19 -0
  22. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/respond/route.d.ts.map +1 -0
  23. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/respond/route.js +33 -0
  24. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.d.ts.map +1 -1
  25. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.js +7 -0
  26. package/dist/src/presentation/web/app/layout.d.ts +0 -1
  27. package/dist/src/presentation/web/app/layout.d.ts.map +1 -1
  28. package/dist/src/presentation/web/app/layout.js +0 -1
  29. package/dist/src/presentation/web/components/assistant-ui/thread.d.ts +3 -2
  30. package/dist/src/presentation/web/components/assistant-ui/thread.d.ts.map +1 -1
  31. package/dist/src/presentation/web/components/assistant-ui/thread.js +26 -3
  32. package/dist/src/presentation/web/components/common/react-file-manager-dialog/react-file-manager-dialog.d.ts.map +1 -1
  33. package/dist/src/presentation/web/components/common/react-file-manager-dialog/react-file-manager-dialog.js +68 -56
  34. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.d.ts +1 -0
  35. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.d.ts.map +1 -1
  36. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.js +7 -1
  37. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.stories.d.ts +1 -0
  38. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.stories.d.ts.map +1 -1
  39. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.stories.js +3 -0
  40. package/dist/src/presentation/web/components/features/chat/ChatSheet.d.ts.map +1 -1
  41. package/dist/src/presentation/web/components/features/chat/ChatSheet.js +3 -1
  42. package/dist/src/presentation/web/components/features/chat/ChatTab.d.ts.map +1 -1
  43. package/dist/src/presentation/web/components/features/chat/ChatTab.js +3 -2
  44. package/dist/src/presentation/web/components/features/chat/InteractionBubble.d.ts +33 -0
  45. package/dist/src/presentation/web/components/features/chat/InteractionBubble.d.ts.map +1 -0
  46. package/dist/src/presentation/web/components/features/chat/InteractionBubble.js +155 -0
  47. package/dist/src/presentation/web/components/features/chat/InteractionBubble.stories.d.ts +22 -0
  48. package/dist/src/presentation/web/components/features/chat/InteractionBubble.stories.d.ts.map +1 -0
  49. package/dist/src/presentation/web/components/features/chat/InteractionBubble.stories.js +107 -0
  50. package/dist/src/presentation/web/components/features/chat/useChatRuntime.d.ts +16 -0
  51. package/dist/src/presentation/web/components/features/chat/useChatRuntime.d.ts.map +1 -1
  52. package/dist/src/presentation/web/components/features/chat/useChatRuntime.js +62 -1
  53. package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
  54. package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +18 -3
  55. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts +1 -0
  56. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts.map +1 -1
  57. package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js +1 -1
  58. package/dist/src/presentation/web/hooks/use-graph-state.d.ts.map +1 -1
  59. package/dist/src/presentation/web/hooks/use-graph-state.js +16 -0
  60. package/dist/src/presentation/web/hooks/use-turn-statuses.d.ts +1 -1
  61. package/dist/src/presentation/web/hooks/use-turn-statuses.d.ts.map +1 -1
  62. package/dist/src/presentation/web/hooks/use-turn-statuses.js +1 -1
  63. package/dist/tsconfig.build.tsbuildinfo +1 -1
  64. package/package.json +1 -1
  65. package/web/.next/BUILD_ID +1 -1
  66. package/web/.next/app-path-routes-manifest.json +1 -0
  67. package/web/.next/build-manifest.json +7 -7
  68. package/web/.next/fallback-build-manifest.json +2 -2
  69. package/web/.next/prerender-manifest.json +3 -3
  70. package/web/.next/required-server-files.js +2 -2
  71. package/web/.next/required-server-files.json +2 -2
  72. package/web/.next/routes-manifest.json +8 -0
  73. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/build-manifest.json +5 -5
  74. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/react-loadable-manifest.json +1 -8
  75. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  76. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -1
  77. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  78. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  79. package/web/.next/server/app/(dashboard)/@drawer/chat/page/build-manifest.json +5 -5
  80. package/web/.next/server/app/(dashboard)/@drawer/chat/page/react-loadable-manifest.json +1 -8
  81. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  82. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +1 -1
  83. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  84. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  85. package/web/.next/server/app/(dashboard)/@drawer/create/page/build-manifest.json +5 -5
  86. package/web/.next/server/app/(dashboard)/@drawer/create/page/react-loadable-manifest.json +1 -8
  87. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  88. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
  89. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  90. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  91. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/build-manifest.json +5 -5
  92. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/react-loadable-manifest.json +1 -8
  93. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
  94. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
  95. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  96. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  97. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/build-manifest.json +5 -5
  98. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/react-loadable-manifest.json +1 -8
  99. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +38 -38
  100. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
  101. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  102. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  103. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/build-manifest.json +5 -5
  104. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/react-loadable-manifest.json +1 -8
  105. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  106. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +1 -1
  107. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  108. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  109. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/build-manifest.json +5 -5
  110. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/react-loadable-manifest.json +1 -8
  111. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  112. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
  113. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  114. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  115. package/web/.next/server/app/(dashboard)/chat/page/build-manifest.json +5 -5
  116. package/web/.next/server/app/(dashboard)/chat/page/react-loadable-manifest.json +1 -8
  117. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  118. package/web/.next/server/app/(dashboard)/chat/page.js +1 -1
  119. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  120. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  121. package/web/.next/server/app/(dashboard)/create/page/build-manifest.json +5 -5
  122. package/web/.next/server/app/(dashboard)/create/page/react-loadable-manifest.json +1 -8
  123. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  124. package/web/.next/server/app/(dashboard)/create/page.js +1 -1
  125. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  126. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  127. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/build-manifest.json +5 -5
  128. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/react-loadable-manifest.json +1 -8
  129. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
  130. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
  131. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  132. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  133. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/build-manifest.json +5 -5
  134. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/react-loadable-manifest.json +1 -8
  135. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +38 -38
  136. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
  137. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  138. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  139. package/web/.next/server/app/(dashboard)/page/build-manifest.json +5 -5
  140. package/web/.next/server/app/(dashboard)/page/react-loadable-manifest.json +1 -8
  141. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  142. package/web/.next/server/app/(dashboard)/page.js +1 -1
  143. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  144. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  145. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/build-manifest.json +5 -5
  146. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/react-loadable-manifest.json +1 -8
  147. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  148. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +1 -1
  149. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  150. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  151. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/build-manifest.json +5 -5
  152. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/react-loadable-manifest.json +1 -8
  153. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  154. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
  155. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  156. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  157. package/web/.next/server/app/_global-error/page/build-manifest.json +5 -5
  158. package/web/.next/server/app/_global-error/page.js +1 -1
  159. package/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  160. package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  161. package/web/.next/server/app/_global-error.html +2 -2
  162. package/web/.next/server/app/_global-error.rsc +7 -7
  163. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  164. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  165. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  166. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  167. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  168. package/web/.next/server/app/_not-found/page/build-manifest.json +5 -5
  169. package/web/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -8
  170. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  171. package/web/.next/server/app/_not-found/page.js +1 -1
  172. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  173. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  174. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  175. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  176. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  177. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  178. package/web/.next/server/app/api/interactive/chat/[featureId]/respond/route/app-paths-manifest.json +3 -0
  179. package/web/.next/server/app/api/interactive/chat/[featureId]/respond/route/build-manifest.json +11 -0
  180. package/web/.next/server/app/api/interactive/chat/[featureId]/respond/route/server-reference-manifest.json +4 -0
  181. package/web/.next/server/app/api/interactive/chat/[featureId]/respond/route.js +7 -0
  182. package/web/.next/server/app/api/interactive/chat/[featureId]/respond/route.js.map +5 -0
  183. package/web/.next/server/app/api/interactive/chat/[featureId]/respond/route.js.nft.json +1 -0
  184. package/web/.next/server/app/api/interactive/chat/[featureId]/respond/route_client-reference-manifest.js +2 -0
  185. package/web/.next/server/app/settings/page/build-manifest.json +5 -5
  186. package/web/.next/server/app/settings/page/react-loadable-manifest.json +1 -8
  187. package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
  188. package/web/.next/server/app/settings/page.js +1 -1
  189. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  190. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  191. package/web/.next/server/app/skills/page/build-manifest.json +5 -5
  192. package/web/.next/server/app/skills/page/react-loadable-manifest.json +1 -8
  193. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  194. package/web/.next/server/app/skills/page.js +1 -1
  195. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  196. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  197. package/web/.next/server/app/tools/page/build-manifest.json +5 -5
  198. package/web/.next/server/app/tools/page/react-loadable-manifest.json +1 -8
  199. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  200. package/web/.next/server/app/tools/page.js +1 -1
  201. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  202. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  203. package/web/.next/server/app/version/page/build-manifest.json +5 -5
  204. package/web/.next/server/app/version/page/react-loadable-manifest.json +1 -8
  205. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  206. package/web/.next/server/app/version/page.js +1 -1
  207. package/web/.next/server/app/version/page.js.nft.json +1 -1
  208. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  209. package/web/.next/server/app-paths-manifest.json +1 -0
  210. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_[featureId]_respond_route_actions_990d51bd.js +3 -0
  211. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_[featureId]_respond_route_actions_990d51bd.js.map +1 -0
  212. package/web/.next/server/chunks/[root-of-the-server]__31944fa2._.js +3 -0
  213. package/web/.next/server/chunks/[root-of-the-server]__31944fa2._.js.map +1 -0
  214. package/web/.next/server/chunks/[root-of-the-server]__8a281f8d._.js +9 -3
  215. package/web/.next/server/chunks/[root-of-the-server]__8a281f8d._.js.map +1 -1
  216. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  217. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  218. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  219. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
  220. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  221. package/web/.next/server/chunks/ssr/[root-of-the-server]__1abe77bb._.js +2 -2
  222. package/web/.next/server/chunks/ssr/[root-of-the-server]__1abe77bb._.js.map +1 -1
  223. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
  224. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
  225. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  226. package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js +1 -1
  227. package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js.map +1 -1
  228. package/web/.next/server/chunks/ssr/[root-of-the-server]__7562afc6._.js +2 -2
  229. package/web/.next/server/chunks/ssr/[root-of-the-server]__7562afc6._.js.map +1 -1
  230. package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js +1 -1
  231. package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js.map +1 -1
  232. package/web/.next/server/chunks/ssr/[root-of-the-server]__86ff0bc5._.js +2 -2
  233. package/web/.next/server/chunks/ssr/[root-of-the-server]__86ff0bc5._.js.map +1 -1
  234. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js +1 -1
  235. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
  236. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
  237. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js +1 -1
  238. package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js.map +1 -1
  239. package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js +1 -1
  240. package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js.map +1 -1
  241. package/web/.next/server/chunks/ssr/[root-of-the-server]__d5e22d1a._.js +3 -0
  242. package/web/.next/server/chunks/ssr/{[root-of-the-server]__efeeaed4._.js.map → [root-of-the-server]__d5e22d1a._.js.map} +1 -1
  243. package/web/.next/server/chunks/ssr/[root-of-the-server]__f2acfd0e._.js +3 -0
  244. package/web/.next/server/chunks/ssr/[root-of-the-server]__f2acfd0e._.js.map +1 -0
  245. package/web/.next/server/chunks/ssr/[root-of-the-server]__f5614810._.js +3 -0
  246. package/web/.next/server/chunks/ssr/{[root-of-the-server]__d1040bd1._.js.map → [root-of-the-server]__f5614810._.js.map} +1 -1
  247. package/web/.next/server/chunks/ssr/_02e01240._.js +1 -1
  248. package/web/.next/server/chunks/ssr/_02e01240._.js.map +1 -1
  249. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  250. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  251. package/web/.next/server/chunks/ssr/_0727935d._.js +1 -1
  252. package/web/.next/server/chunks/ssr/_0727935d._.js.map +1 -1
  253. package/web/.next/server/chunks/ssr/_0d2aa969._.js +3 -0
  254. package/web/.next/server/chunks/ssr/_0d2aa969._.js.map +1 -0
  255. package/web/.next/server/chunks/ssr/_0edaf547._.js +3 -0
  256. package/web/.next/server/chunks/ssr/_0edaf547._.js.map +1 -0
  257. package/web/.next/server/chunks/ssr/{_cb46c553._.js → _10216838._.js} +2 -2
  258. package/web/.next/server/chunks/ssr/{_cb46c553._.js.map → _10216838._.js.map} +1 -1
  259. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  260. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  261. package/web/.next/server/chunks/ssr/_18886033._.js +1 -1
  262. package/web/.next/server/chunks/ssr/_18886033._.js.map +1 -1
  263. package/web/.next/server/chunks/ssr/_1e08a336._.js.map +1 -1
  264. package/web/.next/server/chunks/ssr/_22e00a14._.js +1 -1
  265. package/web/.next/server/chunks/ssr/_22e00a14._.js.map +1 -1
  266. package/web/.next/server/chunks/ssr/_4cbb7f95._.js +3 -0
  267. package/web/.next/server/chunks/ssr/_4cbb7f95._.js.map +1 -0
  268. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  269. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  270. package/web/.next/server/chunks/ssr/{_506a3bc3._.js → _682fc996._.js} +2 -2
  271. package/web/.next/server/chunks/ssr/_682fc996._.js.map +1 -0
  272. package/web/.next/server/chunks/ssr/_a1068852._.js +3 -0
  273. package/web/.next/server/chunks/ssr/_a1068852._.js.map +1 -0
  274. package/web/.next/server/chunks/ssr/_a5a5901d._.js +1 -1
  275. package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +1 -1
  276. package/web/.next/server/chunks/ssr/_ad09f271._.js +1 -1
  277. package/web/.next/server/chunks/ssr/_ad09f271._.js.map +1 -1
  278. package/web/.next/server/chunks/ssr/_c3f595c6._.js +1 -1
  279. package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +1 -1
  280. package/web/.next/server/chunks/ssr/_ea9e1556._.js +1 -1
  281. package/web/.next/server/chunks/ssr/_ea9e1556._.js.map +1 -1
  282. package/web/.next/server/chunks/ssr/_f1ba9be6._.js +2 -2
  283. package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +1 -1
  284. package/web/.next/server/chunks/ssr/{_ad1e8df0._.js → _f25dbb08._.js} +2 -2
  285. package/web/.next/server/chunks/ssr/{_ad1e8df0._.js.map → _f25dbb08._.js.map} +1 -1
  286. package/web/.next/server/chunks/ssr/_f33cd07e._.js +2 -2
  287. package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +1 -1
  288. package/web/.next/server/chunks/ssr/_f8b45233._.js +1 -1
  289. package/web/.next/server/chunks/ssr/_f8b45233._.js.map +1 -1
  290. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  291. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  292. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  293. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
  294. package/web/.next/server/chunks/ssr/node_modules__pnpm_12a7ede0._.js +3 -0
  295. package/web/.next/server/chunks/ssr/node_modules__pnpm_12a7ede0._.js.map +1 -0
  296. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  297. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
  298. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
  299. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  300. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  301. package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_select_tsx_45d6b8ae._.js +1 -1
  302. package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_select_tsx_45d6b8ae._.js.map +1 -1
  303. package/web/.next/server/middleware-build-manifest.js +5 -5
  304. package/web/.next/server/pages/500.html +2 -2
  305. package/web/.next/server/server-reference-manifest.js +1 -1
  306. package/web/.next/server/server-reference-manifest.json +48 -48
  307. package/web/.next/static/chunks/{902840b67efbdd64.js → 0286f25e23d42f0c.js} +1 -1
  308. package/web/.next/static/chunks/{ed4aa2bcbf8b63e2.js → 03900be2b55b7375.js} +1 -1
  309. package/web/.next/static/chunks/{fe70e73feb07bcfd.js → 08ec4c9ab61717aa.js} +1 -1
  310. package/web/.next/static/chunks/{dedf6ca63c5468fa.js → 09edd35d194bec06.js} +3 -3
  311. package/web/.next/static/chunks/{d4d8f0a137bd2eb4.js → 12803afee7d0afc8.js} +2 -2
  312. package/web/.next/static/chunks/{b2ea14e7d98ca3e8.js → 186ae7bb70982cc7.js} +1 -1
  313. package/web/.next/static/chunks/197ab40a6e4be037.js +7 -0
  314. package/web/.next/static/chunks/1fe75f9dd488d557.css +1 -0
  315. package/web/.next/static/chunks/{c26529d3615ad0a3.js → 4b6b80d73048899b.js} +3 -3
  316. package/web/.next/static/chunks/5e044b1f966ab2f5.js +1 -0
  317. package/web/.next/static/chunks/{017b47553231a823.js → 7ab475ef5d67af41.js} +1 -1
  318. package/web/.next/static/chunks/84a181ff3270fd9f.js +1 -0
  319. package/web/.next/static/chunks/87a50da22a604a84.js +1 -0
  320. package/web/.next/static/chunks/{7324fbbe1b204722.js → 9375a48c30b82a74.js} +1 -1
  321. package/web/.next/static/chunks/9531dfbcff94c28b.js +1 -0
  322. package/web/.next/static/chunks/{bd4204d2d43217b4.js → a36af696cef18a2a.js} +1 -1
  323. package/web/.next/static/chunks/{39f6493901c3eea0.js → a7d8ed763d7bbe63.js} +2 -2
  324. package/web/.next/static/chunks/aea0279ddefd5f75.js +1 -0
  325. package/web/.next/static/chunks/{0b5d6a720a7881a9.js → bf4eca879dc0c77a.js} +1 -1
  326. package/web/.next/static/chunks/ed3a602003bcb31b.js +1 -0
  327. package/web/.next/static/chunks/fa024fa35b1b47ff.js +1 -0
  328. package/web/.next/static/chunks/{turbopack-432ef324fc27240c.js → turbopack-8a46f5841d1dbe2e.js} +1 -1
  329. package/web/.next/server/chunks/ssr/[root-of-the-server]__2d0c3840._.js +0 -3
  330. package/web/.next/server/chunks/ssr/[root-of-the-server]__2d0c3840._.js.map +0 -1
  331. package/web/.next/server/chunks/ssr/[root-of-the-server]__d1040bd1._.js +0 -3
  332. package/web/.next/server/chunks/ssr/[root-of-the-server]__efeeaed4._.js +0 -3
  333. package/web/.next/server/chunks/ssr/_3bcda5d7._.js +0 -3
  334. package/web/.next/server/chunks/ssr/_3bcda5d7._.js.map +0 -1
  335. package/web/.next/server/chunks/ssr/_4d49a312._.js +0 -3
  336. package/web/.next/server/chunks/ssr/_4d49a312._.js.map +0 -1
  337. package/web/.next/server/chunks/ssr/_506a3bc3._.js.map +0 -1
  338. package/web/.next/server/chunks/ssr/_80eef198._.js +0 -3
  339. package/web/.next/server/chunks/ssr/_80eef198._.js.map +0 -1
  340. package/web/.next/server/chunks/ssr/_9215e9ec._.js +0 -3
  341. package/web/.next/server/chunks/ssr/_9215e9ec._.js.map +0 -1
  342. package/web/.next/server/chunks/ssr/node_modules__pnpm_1300ae39._.js +0 -3
  343. package/web/.next/server/chunks/ssr/node_modules__pnpm_1300ae39._.js.map +0 -1
  344. package/web/.next/static/chunks/1d29dba973313f02.js +0 -1
  345. package/web/.next/static/chunks/3208dc997aaee4d3.css +0 -1
  346. package/web/.next/static/chunks/3c1fa8ca0fd213dd.js +0 -1
  347. package/web/.next/static/chunks/3deefc76ea55047c.js +0 -1
  348. package/web/.next/static/chunks/40b6bcf1a2de4a0f.js +0 -1
  349. package/web/.next/static/chunks/5afbcdb3d1de34c9.js +0 -7
  350. package/web/.next/static/chunks/65440524d7ee7d13.js +0 -1
  351. package/web/.next/static/chunks/6d7b999c99d6d175.js +0 -9
  352. package/web/.next/static/chunks/8180973e9cd6a99e.css +0 -1
  353. package/web/.next/static/chunks/a260c71a30c63952.js +0 -1
  354. package/web/.next/static/chunks/c7e793951b20a67f.js +0 -1
  355. /package/web/.next/static/{WC6AP64Gn0KyMqwIy1VjS → jJMYzVAvBKZm_zDnl0h7J}/_buildManifest.js +0 -0
  356. /package/web/.next/static/{WC6AP64Gn0KyMqwIy1VjS → jJMYzVAvBKZm_zDnl0h7J}/_clientMiddlewareManifest.json +0 -0
  357. /package/web/.next/static/{WC6AP64Gn0KyMqwIy1VjS → jJMYzVAvBKZm_zDnl0h7J}/_ssgManifest.js +0 -0
@@ -10,6 +10,11 @@
10
10
  * - Infrastructure layer provides concrete implementations
11
11
  * - No SDK types leak through this boundary
12
12
  */
13
+ /**
14
+ * Callback invoked when the agent calls AskUserQuestion.
15
+ * The SDK stream is PAUSED until this resolves — the agent waits for the user's answers.
16
+ */
17
+ export type OnUserQuestionCallback = (interaction: UserInteractionData) => Promise<Record<string, string>>;
13
18
  /** Options for creating/resuming an interactive agent session. */
14
19
  export interface InteractiveAgentOptions {
15
20
  /** Absolute worktree path (CWD for agent) */
@@ -18,10 +23,32 @@ export interface InteractiveAgentOptions {
18
23
  model?: string;
19
24
  /** Feature context string to append to system prompt */
20
25
  systemPrompt?: string;
26
+ /**
27
+ * Called when agent uses AskUserQuestion. Must return user's answers keyed by question text.
28
+ * The SDK stream pauses until this resolves — the agent cannot continue without answers.
29
+ */
30
+ onUserQuestion?: OnUserQuestionCallback;
31
+ }
32
+ /** A single question within an AskUserQuestion tool call. */
33
+ export interface UserQuestionOption {
34
+ label: string;
35
+ description: string;
36
+ preview?: string;
37
+ }
38
+ export interface UserQuestion {
39
+ question: string;
40
+ header: string;
41
+ options: UserQuestionOption[];
42
+ multiSelect: boolean;
43
+ }
44
+ /** Data for a pending user interaction (AskUserQuestion). */
45
+ export interface UserInteractionData {
46
+ toolCallId: string;
47
+ questions: UserQuestion[];
21
48
  }
22
49
  /** Event emitted by an interactive agent session stream. */
23
50
  export interface InteractiveAgentEvent {
24
- type: 'delta' | 'tool_use' | 'tool_result' | 'status' | 'done' | 'error' | 'init' | 'api_retry' | 'rate_limit' | 'task_started' | 'task_progress' | 'task_done';
51
+ type: 'delta' | 'tool_use' | 'tool_result' | 'status' | 'done' | 'error' | 'init' | 'api_retry' | 'rate_limit' | 'task_started' | 'task_progress' | 'task_done' | 'user_question';
25
52
  content?: string;
26
53
  label?: string;
27
54
  detail?: string;
@@ -33,13 +60,22 @@ export interface InteractiveAgentEvent {
33
60
  numTurns?: number;
34
61
  durationMs?: number;
35
62
  };
63
+ /** Interaction data (attached to 'user_question' events) */
64
+ interaction?: UserInteractionData;
65
+ }
66
+ /** Structured tool result message sent back to the agent. */
67
+ export interface ToolResultMessage {
68
+ toolCallId: string;
69
+ result: unknown;
36
70
  }
37
71
  /** Handle to a live interactive agent session. */
38
72
  export interface InteractiveAgentSessionHandle {
39
73
  /** The agent's session ID (used for resumption) */
40
74
  readonly sessionId: string;
41
- /** Send a user message to the agent */
75
+ /** Send a user text message to the agent */
42
76
  send(message: string): Promise<void>;
77
+ /** Send a tool result back to the agent (e.g. AskUserQuestion response) */
78
+ sendToolResult(toolResult: ToolResultMessage): Promise<void>;
43
79
  /** Iterate response events from the agent */
44
80
  stream(): AsyncIterable<InteractiveAgentEvent>;
45
81
  /** Terminate the session gracefully */
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-agent-executor.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/agents/interactive-agent-executor.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,kEAAkE;AAClE,MAAM,WAAW,uBAAuB;IACtC,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,4DAA4D;AAC5D,MAAM,WAAW,qBAAqB;IACpC,IAAI,EACA,OAAO,GACP,UAAU,GACV,aAAa,GACb,QAAQ,GACR,MAAM,GACN,OAAO,GACP,MAAM,GACN,WAAW,GACX,YAAY,GACZ,cAAc,GACd,eAAe,GACf,WAAW,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,KAAK,CAAC,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,6CAA6C;IAC7C,MAAM,IAAI,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC/C,uCAAuC;IACvC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,wEAAwE;IACxE,KAAK,IAAI,IAAI,CAAC;CACf;AAED,yDAAyD;AACzD,MAAM,WAAW,yBAAyB;IACxC,aAAa,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACxF,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,6BAA6B,CAAC,CAAC;CAC3C"}
1
+ {"version":3,"file":"interactive-agent-executor.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/agents/interactive-agent-executor.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACnC,WAAW,EAAE,mBAAmB,KAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAErC,kEAAkE;AAClE,MAAM,WAAW,uBAAuB;IACtC,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC;CACzC;AAED,6DAA6D;AAC7D,MAAM,WAAW,kB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,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,2EAA2E;IAC3E,cAAc,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,6CAA6C;IAC7C,MAAM,IAAI,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC/C,uCAAuC;IACvC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,wEAAwE;IACxE,KAAK,IAAI,IAAI,CAAC;CACf;AAED,yDAAyD;AACzD,MAAM,WAAW,yBAAyB;IACxC,aAAa,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACxF,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,6BAA6B,CAAC,CAAC;CAC3C"}
@@ -10,6 +10,7 @@
10
10
  * - Infrastructure layer provides the concrete implementation (singleton)
11
11
  */
12
12
  import type { InteractiveSession, InteractiveMessage } from '../../../../domain/generated/output.js';
13
+ import type { UserInteractionData } from '../agents/interactive-agent-executor.interface.js';
13
14
  /**
14
15
  * A single streaming chunk forwarded from agent stdout to an SSE consumer.
15
16
  */
@@ -22,6 +23,8 @@ export interface StreamChunk {
22
23
  log?: string;
23
24
  /** Structured activity event for rich rendering in the thread */
24
25
  activity?: StreamActivity;
26
+ /** Pending user interaction (AskUserQuestion) — agent is waiting for user response */
27
+ interaction?: UserInteractionData;
25
28
  }
26
29
  /**
27
30
  * A structured activity event emitted during agent execution.
@@ -50,8 +53,10 @@ export interface ChatState {
50
53
  streamingText: string | null;
51
54
  /** Session info for the toolbar (null if no active session) */
52
55
  sessionInfo: SessionInfo | null;
53
- /** Turn activity status: 'idle' | 'processing' | 'unread' (for dot indicators) */
56
+ /** Turn activity status: 'idle' | 'processing' | 'unread' | 'awaiting_input' (for dot indicators) */
54
57
  turnStatus: string;
58
+ /** Pending user interaction — agent is waiting for user response (null when no interaction pending) */
59
+ pendingInteraction: UserInteractionData | null;
55
60
  }
56
61
  /** Live session metadata for the frontend toolbar. */
57
62
  export interface SessionInfo {
@@ -189,5 +194,15 @@ export interface IInteractiveSessionService {
189
194
  * active session's status ('processing' | 'unread').
190
195
  */
191
196
  getAllActiveTurnStatuses(): Promise<Map<string, string>>;
197
+ /**
198
+ * Respond to a pending user interaction (AskUserQuestion).
199
+ * Sends the user's answers back to the agent as a tool result,
200
+ * clears the pending interaction, and resumes the agent's turn.
201
+ *
202
+ * @param featureId - The feature scope key
203
+ * @param answers - Map of question text → selected answer(s)
204
+ * @param annotations - Optional per-question annotations (notes, preview)
205
+ */
206
+ respondToInteraction(featureId: string, answers: Record<string, string>): Promise<void>;
192
207
  }
193
208
  //# sourceMappingURL=interactive-session-service.interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-session-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/interactive-session-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,wCAAwC,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,IAAI,EAAE,OAAO,CAAC;IACd,oFAAoF;IACpF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,GAAG,aAAa,GAAG,UAAU,GAAG,QAAQ,CAAC;IACzD,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC;AAEvC;;GAEG;AAC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interactive-session-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/interactive-session-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,IAAI,EAAE,OAAO,CAAC;IACd,oFAAoF;IACpF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,sFAAsF;IACtF,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,GAAG,aAAa,GAAG,UAAU,GAAG,QAAQ,CAAC;IACzD,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,wEAAwE;IACxE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,+DAA+D;IAC/D,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iEAAiE;IACjE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,+DAA+D;IAC/D,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,qGAAqG;IACrG,UAAU,EAAE,MAAM,CAAC;IACnB,uGAAuG;IACvG,kBAAkB,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAChD;AAED,sDAAsD;AACtD,MAAM,WAAW,WAAW;IAC1B,GAAG,E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,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,aAAa,CAAC;IAInF;;;;;;;;OAQG;IACH,eAAe,CACb,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE/B;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAEpD;;;OAGG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,aAAa,CAAC;IAE5F;;;OAGG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C;;;;OAIG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAEpE;;;OAGG;IACH,wBAAwB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAEzD;;;;;;;;OAQG;IACH,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzF"}
@@ -11,4 +11,6 @@ export { StopInteractiveSessionUseCase } from './stop-interactive-session.use-ca
11
11
  export type { StopInteractiveSessionInput } from './stop-interactive-session.use-case.js';
12
12
  export { GetInteractiveChatStateUseCase } from './get-interactive-chat-state.use-case.js';
13
13
  export type { GetInteractiveChatStateInput } from './get-interactive-chat-state.use-case.js';
14
+ export { RespondToInteractionUseCase } from './respond-to-interaction.use-case.js';
15
+ export type { RespondToInteractionInput } from './respond-to-interaction.use-case.js';
14
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/interactive/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,YAAY,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,YAAY,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/interactive/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,YAAY,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,YAAY,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAC7F,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,YAAY,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC"}
@@ -7,3 +7,4 @@ export { StartInteractiveSessionUseCase } from './start-interactive-session.use-
7
7
  export { SendInteractiveMessageUseCase } from './send-interactive-message.use-case.js';
8
8
  export { StopInteractiveSessionUseCase } from './stop-interactive-session.use-case.js';
9
9
  export { GetInteractiveChatStateUseCase } from './get-interactive-chat-state.use-case.js';
10
+ export { RespondToInteractionUseCase } from './respond-to-interaction.use-case.js';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Respond To Interaction Use Case
3
+ *
4
+ * Sends the user's response to a pending AskUserQuestion interaction
5
+ * back to the agent. The agent's turn resumes after receiving the response.
6
+ */
7
+ import type { IInteractiveSessionService } from '../../ports/output/services/interactive-session-service.interface.js';
8
+ export interface RespondToInteractionInput {
9
+ featureId: string;
10
+ answers: Record<string, string>;
11
+ }
12
+ export declare class RespondToInteractionUseCase {
13
+ private readonly service;
14
+ constructor(service: IInteractiveSessionService);
15
+ execute(input: RespondToInteractionInput): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=respond-to-interaction.use-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"respond-to-interaction.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/interactive/respond-to-interaction.use-case.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sEAAsE,CAAC;AAEvH,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,qBACa,2BAA2B;IAGpC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,0BAA0B;IAGhD,OAAO,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/D"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Respond To Interaction Use Case
3
+ *
4
+ * Sends the user's response to a pending AskUserQuestion interaction
5
+ * back to the agent. The agent's turn resumes after receiving the response.
6
+ */
7
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
11
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
12
+ };
13
+ var __metadata = (this && this.__metadata) || function (k, v) {
14
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
+ };
16
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
17
+ return function (target, key) { decorator(target, key, paramIndex); }
18
+ };
19
+ import { injectable, inject } from 'tsyringe';
20
+ let RespondToInteractionUseCase = class RespondToInteractionUseCase {
21
+ service;
22
+ constructor(service) {
23
+ this.service = service;
24
+ }
25
+ async execute(input) {
26
+ return this.service.respondToInteraction(input.featureId, input.answers);
27
+ }
28
+ };
29
+ RespondToInteractionUseCase = __decorate([
30
+ injectable(),
31
+ __param(0, inject('IInteractiveSessionService')),
32
+ __metadata("design:paramtypes", [Object])
33
+ ], RespondToInteractionUseCase);
34
+ export { RespondToInteractionUseCase };
@@ -1 +1 @@
1
- {"version":3,"file":"delete-repository.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/repositories/delete-repository.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oEAAoE,CAAC;AAChH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,qBACa,uBAAuB;IAGhC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAJb,cAAc,EAAE,qBAAqB,EAErC,WAAW,EAAE,kBAAkB,EAE/B,aAAa,EAAE,oBAAoB;IAGhD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAczC"}
1
+ {"version":3,"file":"delete-repository.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/repositories/delete-repository.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oEAAoE,CAAC;AAChH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,qBACa,uBAAuB;IAGhC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAJb,cAAc,EAAE,qBAAqB,EAErC,WAAW,EAAE,kBAAkB,EAE/B,aAAa,EAAE,oBAAoB;IAGhD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAkBzC"}
@@ -33,8 +33,12 @@ let DeleteRepositoryUseCase = class DeleteRepositoryUseCase {
33
33
  if (!repository) {
34
34
  throw new Error(`Repository not found: "${id}"`);
35
35
  }
36
- // Delete all child features (cancels agent runs, removes worktrees)
37
- const features = await this.featureRepo.list({ repositoryPath: repository.path });
36
+ // Delete all child features (cancels agent runs, removes worktrees).
37
+ // Include archived features so they don't survive as orphans.
38
+ const features = await this.featureRepo.list({
39
+ repositoryPath: repository.path,
40
+ includeArchived: true,
41
+ });
38
42
  for (const feature of features) {
39
43
  await this.deleteFeature.execute(feature.id);
40
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAoJrC;;;;;;GAMG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC,CAubrE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAqJrC;;;;;;GAMG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC,CA2brE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -99,6 +99,7 @@ import { StartInteractiveSessionUseCase } from '../../application/use-cases/inte
99
99
  import { SendInteractiveMessageUseCase } from '../../application/use-cases/interactive/send-interactive-message.use-case.js';
100
100
  import { StopInteractiveSessionUseCase } from '../../application/use-cases/interactive/stop-interactive-session.use-case.js';
101
101
  import { GetInteractiveChatStateUseCase } from '../../application/use-cases/interactive/get-interactive-chat-state.use-case.js';
102
+ import { RespondToInteractionUseCase } from '../../application/use-cases/interactive/respond-to-interaction.use-case.js';
102
103
  // Session listing
103
104
  import { ClaudeCodeSessionRepository } from '../services/agents/sessions/claude-code-session.repository.js';
104
105
  import { CodexCliSessionRepository } from '../services/agents/sessions/codex-cli-session.repository.js';
@@ -489,6 +490,7 @@ export async function initializeContainer() {
489
490
  container.registerSingleton(SendInteractiveMessageUseCase);
490
491
  container.registerSingleton(StopInteractiveSessionUseCase);
491
492
  container.registerSingleton(GetInteractiveChatStateUseCase);
493
+ container.registerSingleton(RespondToInteractionUseCase);
492
494
  // String-token aliases for web routes (Turbopack can't resolve .js→.ts
493
495
  // imports inside @shepai/core, so routes use string tokens instead of class refs)
494
496
  container.register('StartInteractiveSessionUseCase', {
@@ -503,6 +505,9 @@ export async function initializeContainer() {
503
505
  container.register('GetInteractiveChatStateUseCase', {
504
506
  useFactory: (c) => c.resolve(GetInteractiveChatStateUseCase),
505
507
  });
508
+ container.register('RespondToInteractionUseCase', {
509
+ useFactory: (c) => c.resolve(RespondToInteractionUseCase),
510
+ });
506
511
  // Startup cleanup: mark any zombie sessions (booting/ready from a prior server run) as stopped
507
512
  await interactiveSessionRepo.markAllActiveStopped();
508
513
  _initialized = true;
@@ -32,6 +32,9 @@
32
32
  * errors when shep itself is running inside a Claude Code session.
33
33
  * - SDK message types are mapped to our own InteractiveAgentEvent to
34
34
  * keep the application layer decoupled from SDK specifics.
35
+ * - AskUserQuestion is intercepted via the SDK's `canUseTool` callback,
36
+ * which pauses the stream until the user responds. The callback delegates
37
+ * to the `onUserQuestion` option provided by the session service.
35
38
  */
36
39
  import type { IInteractiveAgentExecutor, InteractiveAgentOptions, InteractiveAgentSessionHandle } from '../../../../../application/ports/output/agents/interactive-agent-executor.interface.js';
37
40
  export declare class ClaudeCodeInteractiveExecutor implements IInteractiveAgentExecutor {
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code-interactive-executor.service.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAOH,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAE9B,MAAM,wFAAwF,CAAC;AAgBhG,qBAAa,6BAA8B,YAAW,yBAAyB;IACvE,aAAa,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAOvF,aAAa,CACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,6BAA6B,CAAC;IAOzC;;;;;;OAMG;IACH,OAAO,CAAC,OAAO;IAmBf,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,WAAW;IAoBnB;;;;;;OAMG;YACY,SAAS;IA6BxB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,aAAa;CAuPtB"}
1
+ {"version":3,"file":"claude-code-interactive-executor.service.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAOH,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAI9B,MAAM,wFAAwF,CAAC;AAgBhG,qBAAa,6BAA8B,YAAW,yBAAyB;IACvE,aAAa,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAOvF,aAAa,CACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,6BAA6B,CAAC;IAOzC;;;;;;OAMG;IACH,OAAO,CAAC,OAAO;IAmBf,OAAO,CAAC,eAAe;IAgDvB,OAAO,CAAC,WAAW;IAqCnB;;;;;;OAMG;YACY,SAAS;IA6BxB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,aAAa;CA4PtB"}
@@ -32,6 +32,9 @@
32
32
  * errors when shep itself is running inside a Claude Code session.
33
33
  * - SDK message types are mapped to our own InteractiveAgentEvent to
34
34
  * keep the application layer decoupled from SDK specifics.
35
+ * - AskUserQuestion is intercepted via the SDK's `canUseTool` callback,
36
+ * which pauses the stream until the user responds. The callback delegates
37
+ * to the `onUserQuestion` option provided by the session service.
35
38
  */
36
39
  import { unstable_v2_createSession, unstable_v2_resumeSession, } from '@anthropic-ai/claude-agent-sdk';
37
40
  /** Default model used when options.model is not specified. */
@@ -83,9 +86,37 @@ export class ClaudeCodeInteractiveExecutor {
83
86
  buildSdkOptions(options) {
84
87
  // Strip CLAUDECODE env var to prevent nested-session detection errors.
85
88
  const { CLAUDECODE: _, ...cleanEnv } = process.env;
89
+ // Build the canUseTool callback that intercepts AskUserQuestion.
90
+ // When the agent calls AskUserQuestion, this callback:
91
+ // 1. Delegates to onUserQuestion (which notifies the UI and waits for user response)
92
+ // 2. Returns { behavior: 'allow', updatedInput } with the user's answers injected
93
+ // 3. The SDK passes the updated input to AskUserQuestion, which sees pre-filled answers
94
+ //
95
+ // For ALL other tools: auto-allow (same effect as bypassPermissions).
96
+ const canUseTool = options.onUserQuestion
97
+ ? async (toolName, input, opts) => {
98
+ if (toolName === 'AskUserQuestion') {
99
+ const questions = input.questions ?? [];
100
+ const answers = await options.onUserQuestion({
101
+ toolCallId: opts.toolUseID,
102
+ questions,
103
+ });
104
+ // Inject answers into the tool input so the SDK treats it as already answered
105
+ return {
106
+ behavior: 'allow',
107
+ updatedInput: { ...input, answers },
108
+ };
109
+ }
110
+ // Auto-allow all other tools
111
+ return { behavior: 'allow' };
112
+ }
113
+ : undefined;
86
114
  return {
87
115
  model: options.model ?? DEFAULT_MODEL,
88
- permissionMode: 'bypassPermissions',
116
+ // When onUserQuestion is provided, use canUseTool to intercept AskUserQuestion
117
+ // while auto-allowing everything else (replaces bypassPermissions).
118
+ // When not provided, use bypassPermissions for backward compatibility.
119
+ ...(canUseTool ? { canUseTool } : { permissionMode: 'bypassPermissions' }),
89
120
  env: cleanEnv,
90
121
  // Forward system prompt using preset+append pattern
91
122
  ...(options.systemPrompt && {
@@ -106,6 +137,22 @@ export class ClaudeCodeInteractiveExecutor {
106
137
  return resolvedSessionId;
107
138
  },
108
139
  send: (message) => sdkSession.send(message),
140
+ sendToolResult: (toolResult) => sdkSession.send({
141
+ type: 'user',
142
+ session_id: sdkSession.sessionId,
143
+ parent_tool_use_id: toolResult.toolCallId,
144
+ tool_use_result: toolResult.result,
145
+ message: {
146
+ role: 'user',
147
+ content: [
148
+ {
149
+ type: 'tool_result',
150
+ tool_use_id: toolResult.toolCallId,
151
+ content: JSON.stringify(toolResult.result),
152
+ },
153
+ ],
154
+ },
155
+ }),
109
156
  stream: () => this.mapStream(sdkSession, (id) => (resolvedSessionId = id)),
110
157
  close: async () => sdkSession.close(),
111
158
  abort: () => {
@@ -189,11 +236,17 @@ export class ClaudeCodeInteractiveExecutor {
189
236
  }
190
237
  }
191
238
  else if (block.type === 'tool_use') {
192
- events.push({
193
- type: 'tool_use',
194
- label: block.name,
195
- detail: JSON.stringify(block.input ?? {}),
196
- });
239
+ // AskUserQuestion is handled by canUseTool callback — don't emit as tool_use
240
+ if (block.name === 'AskUserQuestion') {
241
+ // Silently skip — the canUseTool callback already handled this
242
+ }
243
+ else {
244
+ events.push({
245
+ type: 'tool_use',
246
+ label: block.name,
247
+ detail: JSON.stringify(block.input ?? {}),
248
+ });
249
+ }
197
250
  }
198
251
  }
199
252
  }
@@ -75,6 +75,13 @@ export declare class InteractiveSessionService implements IInteractiveSessionSer
75
75
  markRead(featureId: string): Promise<void>;
76
76
  getTurnStatuses(featureIds: string[]): Promise<Map<string, string>>;
77
77
  getAllActiveTurnStatuses(): Promise<Map<string, string>>;
78
+ respondToInteraction(featureId: string, answers: Record<string, string>): Promise<void>;
79
+ /**
80
+ * Build the onUserQuestion callback for a session.
81
+ * Called by the SDK's canUseTool when the agent invokes AskUserQuestion.
82
+ * Returns a Promise that doesn't resolve until the user submits their answers.
83
+ */
84
+ private buildOnUserQuestionCallback;
78
85
  /** Find the in-memory state for an active session for a feature. */
79
86
  private findActiveStateForFeature;
80
87
  /** Resolve the agent type from an explicit override or settings. */
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-session.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/interactive/interactive-session.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EACV,0BAA0B,EAC1B,WAAW,EACX,aAAa,EACb,SAAS,EACV,MAAM,qFAAqF,CAAC;AAC7F,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4FAA4F,CAAC;AAChJ,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4FAA4F,CAAC;AAChJ,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8EAA8E,CAAC;AAE1H,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gFAAgF,CAAC;AACzH,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AASlG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AA0C1E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,yBAA0B,YAAW,0BAA0B;IAexE,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAlBjC,0CAA0C;IAC1C,OAAO,CAAC,QAAQ,CAAmC;IACnD,wEAAwE;IACxE,OAAO,CAAC,sBAAsB,CAA6B;IAC3D;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB,CAAwD;gBAG/D,WAAW,EAAE,6BAA6B,EAC1C,WAAW,EAAE,6BAA6B,EAC1C,eAAe,EAAE,qBAAqB,EACtC,WAAW,EAAE,kBAAkB,EAC/B,cAAc,EAAE,qBAAqB;IAOlD,YAAY,CAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,EACd,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IAInE,wBAAwB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAI9D,oEAAoE;IACpE,OAAO,CAAC,yBAAyB;IAWjC,oEAAoE;IACpE,OAAO,CAAC,gBAAgB;IAUxB,mEAAmE;IACnE,OAAO,CAAC,iBAAiB;IAezB;;;OAGG;YACW,gBAAgB;IA0B9B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM;IAYd,6DAA6D;IAC7D,OAAO,CAAC,UAAU;IAQlB,2CAA2C;IAC3C,OAAO,CAAC,UAAU;IAOlB,mEAAmE;IACnE,OAAO,CAAC,YAAY;IAOpB,6EAA6E;IAC7E,OAAO,CAAC,MAAM;CAKf"}
1
+ {"version":3,"file":"interactive-session.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/interactive/interactive-session.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EACV,0BAA0B,EAC1B,WAAW,EACX,aAAa,EACb,SAAS,EACV,MAAM,qFAAqF,CAAC;AAC7F,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4FAA4F,CAAC;AAChJ,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4FAA4F,CAAC;AAChJ,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8EAA8E,CAAC;AAK1H,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gFAAgF,CAAC;AACzH,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AASlG,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AA8C1E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,yBAA0B,YAAW,0BAA0B;IAexE,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC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B,OAAO,CAAC,kBAAkB,CAAC;IA2ExB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAsFzD,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,aAAa;IAkBrF,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM/C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAc1C,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAInE,wBAAwB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAIxD,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA2C7F;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;IAiDnC,oEAAoE;IACpE,OAAO,CAAC,yBAAyB;IAWjC,oEAAoE;IACpE,OAAO,CAAC,gBAAgB;IAUxB,mEAAmE;IACnE,OAAO,CAAC,iBAAiB;IAezB;;;OAGG;YACW,gBAAgB;IA0B9B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM;IAYd,6DAA6D;IAC7D,OAAO,CAAC,UAAU;IAQlB,2CAA2C;IAC3C,OAAO,CAAC,UAAU;IAOlB,mEAAmE;IACnE,OAAO,CAAC,YAAY;IAOpB,6EAA6E;IAC7E,OAAO,CAAC,MAAM;CAKf"}
@@ -80,6 +80,8 @@ export class InteractiveSessionService {
80
80
  updatedAt: now,
81
81
  };
82
82
  await this.sessionRepo.create(session);
83
+ // Mark as processing immediately so the FAB shows the spinner during boot
84
+ void this.sessionRepo.updateTurnStatus(session.id, 'processing');
83
85
  // Carry over agentSessionId from previous session so resumption works
84
86
  let previousAgentSessionId;
85
87
  for (const [, s] of this.sessions) {
@@ -113,6 +115,8 @@ export class InteractiveSessionService {
113
115
  subscribers: new Set(),
114
116
  turnInProgress: false,
115
117
  turnQueue: [],
118
+ pendingInteraction: null,
119
+ pendingInteractionResolver: null,
116
120
  };
117
121
  this.sessions.set(session.id, state);
118
122
  // Fire-and-forget the async boot sequence. The API returns the session
@@ -189,6 +193,9 @@ export class InteractiveSessionService {
189
193
  // Create the interactive executor and session
190
194
  const executor = this.executorFactory.createInteractiveExecutor(resolvedAgentType, authConfig);
191
195
  let handle;
196
+ // Build the onUserQuestion callback that pauses the SDK stream
197
+ // and waits for user input via the UI.
198
+ const onUserQuestion = this.buildOnUserQuestionCallback(state);
192
199
  const previousAgentSessionId = state.agentSessionId;
193
200
  if (previousAgentSessionId) {
194
201
  // Resume existing SDK session
@@ -196,6 +203,7 @@ export class InteractiveSessionService {
196
203
  cwd: worktreePath,
197
204
  model: state.model,
198
205
  systemPrompt: context,
206
+ onUserQuestion,
199
207
  });
200
208
  }
201
209
  else {
@@ -204,6 +212,7 @@ export class InteractiveSessionService {
204
212
  cwd: worktreePath,
205
213
  model: state.model,
206
214
  systemPrompt: context,
215
+ onUserQuestion,
207
216
  });
208
217
  }
209
218
  state.handle = handle;
@@ -585,6 +594,12 @@ export class InteractiveSessionService {
585
594
  });
586
595
  }
587
596
  break;
597
+ case 'user_question':
598
+ // AskUserQuestion is now handled by the canUseTool callback
599
+ // (buildOnUserQuestionCallback) which pauses the SDK stream.
600
+ // This event should not appear in the stream anymore, but if it
601
+ // does (e.g. from a different code path), ignore it here.
602
+ break;
588
603
  }
589
604
  }
590
605
  }
@@ -819,7 +834,9 @@ export class InteractiveSessionService {
819
834
  turnStatus = statuses.get(featureId) ?? 'idle';
820
835
  }
821
836
  }
822
- return { messages, sessionStatus, streamingText, sessionInfo, turnStatus };
837
+ // Include pending interaction if one exists
838
+ const pendingInteraction = state?.pendingInteraction ?? null;
839
+ return { messages, sessionStatus, streamingText, sessionInfo, turnStatus, pendingInteraction };
823
840
  }
824
841
  subscribeByFeature(featureId, onChunk) {
825
842
  // Subscribe at the feature level so the callback survives session restarts.
@@ -863,6 +880,89 @@ export class InteractiveSessionService {
863
880
  async getAllActiveTurnStatuses() {
864
881
  return this.sessionRepo.getAllActiveTurnStatuses();
865
882
  }
883
+ async respondToInteraction(featureId, answers) {
884
+ const state = this.findActiveStateForFeature(featureId);
885
+ if (!state?.pendingInteraction || !state.pendingInteractionResolver) {
886
+ throw new Error(`No pending interaction for feature ${featureId}`);
887
+ }
888
+ // Persist the user's answers as a structured user message.
889
+ // The {{interaction}} prefix lets the frontend detect and render it
890
+ // as a compact green bubble instead of a regular text message.
891
+ const interactionPayload = {
892
+ questions: state.pendingInteraction.questions.map((q) => ({
893
+ header: q.header,
894
+ question: q.question,
895
+ })),
896
+ answers,
897
+ };
898
+ const now = new Date();
899
+ const userMsg = {
900
+ id: crypto.randomUUID(),
901
+ featureId: state.featureId,
902
+ sessionId: state.sessionId,
903
+ role: InteractiveMessageRole.user,
904
+ content: `{{interaction}}${JSON.stringify(interactionPayload)}`,
905
+ createdAt: now,
906
+ updatedAt: now,
907
+ };
908
+ await this.messageRepo.create(userMsg);
909
+ // Resolve the Promise that the canUseTool callback is awaiting.
910
+ // This unblocks the SDK stream — the agent resumes with the user's answers.
911
+ state.pendingInteractionResolver(answers);
912
+ // Clear pending interaction state
913
+ state.pendingInteraction = null;
914
+ state.pendingInteractionResolver = null;
915
+ // Update turn status back to processing
916
+ void this.sessionRepo.updateTurnStatus(state.sessionId, 'processing');
917
+ // Clear the "Waiting for your response..." log
918
+ state.subscribers.forEach((sub) => sub({ delta: '', done: false }));
919
+ }
920
+ /**
921
+ * Build the onUserQuestion callback for a session.
922
+ * Called by the SDK's canUseTool when the agent invokes AskUserQuestion.
923
+ * Returns a Promise that doesn't resolve until the user submits their answers.
924
+ */
925
+ buildOnUserQuestionCallback(state) {
926
+ return async (interaction) => {
927
+ // Flush any accumulated assistant text as a separate message BEFORE
928
+ // the interaction. This ensures the agent's question text appears
929
+ // above the green answer bubble in the conversation history.
930
+ if (state.currentAssistantBuffer.trim()) {
931
+ const now = new Date();
932
+ const msg = {
933
+ id: crypto.randomUUID(),
934
+ featureId: state.featureId,
935
+ sessionId: state.sessionId,
936
+ role: InteractiveMessageRole.assistant,
937
+ content: state.currentAssistantBuffer,
938
+ createdAt: now,
939
+ updatedAt: now,
940
+ };
941
+ await this.messageRepo.create(msg);
942
+ state.currentAssistantBuffer = '';
943
+ state.toolEventsLog = [];
944
+ // Notify subscribers so the frontend picks up the new message
945
+ state.subscribers.forEach((sub) => sub({ delta: '', done: true }));
946
+ // Small delay so the refetch completes before the interaction appears
947
+ await new Promise((r) => setTimeout(r, 100));
948
+ }
949
+ // Store the interaction data for the frontend
950
+ state.pendingInteraction = interaction;
951
+ // Update turn status so the dot indicator shows amber
952
+ void this.sessionRepo.updateTurnStatus(state.sessionId, 'awaiting_input');
953
+ // Notify subscribers so SSE pushes the interaction to the frontend
954
+ state.subscribers.forEach((sub) => sub({
955
+ delta: '',
956
+ done: false,
957
+ log: 'Waiting for your response...',
958
+ interaction,
959
+ }));
960
+ // Create a Promise that will be resolved when the user calls respondToInteraction
961
+ return new Promise((resolve) => {
962
+ state.pendingInteractionResolver = resolve;
963
+ });
964
+ };
965
+ }
866
966
  /** Find the in-memory state for an active session for a feature. */
867
967
  findActiveStateForFeature(featureId) {
868
968
  for (const state of this.sessions.values()) {
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Respond to a pending agent interaction (AskUserQuestion).
3
+ *
4
+ * POST - Submit user's answers to the pending interaction.
5
+ * The agent resumes processing after receiving the response.
6
+ *
7
+ * `featureId` is a polymorphic scope key: a feature UUID, "repo-<id>", or "global".
8
+ */
9
+ import type { NextRequest } from 'next/server';
10
+ import { NextResponse } from 'next/server';
11
+ export declare const dynamic = "force-dynamic";
12
+ interface RouteParams {
13
+ params: Promise<{
14
+ featureId: string;
15
+ }>;
16
+ }
17
+ export declare function POST(request: NextRequest, { params }: RouteParams): Promise<NextResponse>;
18
+ export {};
19
+ //# sourceMappingURL=route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/presentation/web/app/api/interactive/chat/[featureId]/respond/route.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,eAAO,MAAM,OAAO,kBAAkB,CAAC;AAEvC,UAAU,WAAW;IACnB,MAAM,EAAE,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxC;AAED,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAyB/F"}