@shepai/cli 1.151.2 → 1.152.0-pr476.5b101f5

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 (727) hide show
  1. package/apis/json-schema/InteractiveAgentConfig.yaml +25 -0
  2. package/apis/json-schema/InteractiveMessage.yaml +23 -0
  3. package/apis/json-schema/InteractiveMessageRole.yaml +7 -0
  4. package/apis/json-schema/InteractiveSession.yaml +30 -0
  5. package/apis/json-schema/InteractiveSessionStatus.yaml +9 -0
  6. package/apis/json-schema/Settings.yaml +3 -0
  7. package/dist/packages/core/src/application/ports/output/agents/agent-executor-factory.interface.d.ts +17 -0
  8. package/dist/packages/core/src/application/ports/output/agents/agent-executor-factory.interface.d.ts.map +1 -1
  9. package/dist/packages/core/src/application/ports/output/agents/index.d.ts +1 -0
  10. package/dist/packages/core/src/application/ports/output/agents/index.d.ts.map +1 -1
  11. package/dist/packages/core/src/application/ports/output/agents/interactive-agent-executor.interface.d.ts +53 -0
  12. package/dist/packages/core/src/application/ports/output/agents/interactive-agent-executor.interface.d.ts.map +1 -0
  13. package/dist/packages/core/src/application/ports/output/agents/interactive-agent-executor.interface.js +13 -0
  14. package/dist/packages/core/src/application/ports/output/repositories/index.d.ts +2 -0
  15. package/dist/packages/core/src/application/ports/output/repositories/index.d.ts.map +1 -1
  16. package/dist/packages/core/src/application/ports/output/repositories/interactive-message-repository.interface.d.ts +37 -0
  17. package/dist/packages/core/src/application/ports/output/repositories/interactive-message-repository.interface.d.ts.map +1 -0
  18. package/dist/packages/core/src/application/ports/output/repositories/interactive-message-repository.interface.js +10 -0
  19. package/dist/packages/core/src/application/ports/output/repositories/interactive-session-repository.interface.d.ts +78 -0
  20. package/dist/packages/core/src/application/ports/output/repositories/interactive-session-repository.interface.d.ts.map +1 -0
  21. package/dist/packages/core/src/application/ports/output/repositories/interactive-session-repository.interface.js +10 -0
  22. package/dist/packages/core/src/application/ports/output/services/index.d.ts +1 -0
  23. package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
  24. package/dist/packages/core/src/application/ports/output/services/interactive-session-service.interface.d.ts +187 -0
  25. package/dist/packages/core/src/application/ports/output/services/interactive-session-service.interface.d.ts.map +1 -0
  26. package/dist/packages/core/src/application/ports/output/services/interactive-session-service.interface.js +12 -0
  27. package/dist/packages/core/src/application/use-cases/interactive/get-interactive-chat-state.use-case.d.ts +26 -0
  28. package/dist/packages/core/src/application/use-cases/interactive/get-interactive-chat-state.use-case.d.ts.map +1 -0
  29. package/dist/packages/core/src/application/use-cases/interactive/get-interactive-chat-state.use-case.js +41 -0
  30. package/dist/packages/core/src/application/use-cases/interactive/index.d.ts +14 -0
  31. package/dist/packages/core/src/application/use-cases/interactive/index.d.ts.map +1 -0
  32. package/dist/packages/core/src/application/use-cases/interactive/index.js +9 -0
  33. package/dist/packages/core/src/application/use-cases/interactive/send-interactive-message.use-case.d.ts +31 -0
  34. package/dist/packages/core/src/application/use-cases/interactive/send-interactive-message.use-case.d.ts.map +1 -0
  35. package/dist/packages/core/src/application/use-cases/interactive/send-interactive-message.use-case.js +43 -0
  36. package/dist/packages/core/src/application/use-cases/interactive/start-interactive-session.use-case.d.ts +34 -0
  37. package/dist/packages/core/src/application/use-cases/interactive/start-interactive-session.use-case.d.ts.map +1 -0
  38. package/dist/packages/core/src/application/use-cases/interactive/start-interactive-session.use-case.js +43 -0
  39. package/dist/packages/core/src/application/use-cases/interactive/stop-interactive-session.use-case.d.ts +27 -0
  40. package/dist/packages/core/src/application/use-cases/interactive/stop-interactive-session.use-case.d.ts.map +1 -0
  41. package/dist/packages/core/src/application/use-cases/interactive/stop-interactive-session.use-case.js +42 -0
  42. package/dist/packages/core/src/domain/errors/concurrent-session-limit.error.d.ts +13 -0
  43. package/dist/packages/core/src/domain/errors/concurrent-session-limit.error.d.ts.map +1 -0
  44. package/dist/packages/core/src/domain/errors/concurrent-session-limit.error.js +19 -0
  45. package/dist/packages/core/src/domain/generated/output.d.ts +77 -0
  46. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  47. package/dist/packages/core/src/domain/generated/output.js +12 -0
  48. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  49. package/dist/packages/core/src/infrastructure/di/container.js +47 -0
  50. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/interactive-message.mapper.d.ts +36 -0
  51. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/interactive-message.mapper.d.ts.map +1 -0
  52. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/interactive-message.mapper.js +41 -0
  53. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/interactive-session.mapper.d.ts +39 -0
  54. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/interactive-session.mapper.d.ts.map +1 -0
  55. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/interactive-session.mapper.js +47 -0
  56. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +3 -0
  57. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
  58. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +10 -0
  59. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/045-create-interactive-tables.d.ts +22 -0
  60. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/045-create-interactive-tables.d.ts.map +1 -0
  61. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/045-create-interactive-tables.js +52 -0
  62. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/046-add-interactive-agent-settings.d.ts +16 -0
  63. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/046-add-interactive-agent-settings.d.ts.map +1 -0
  64. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/046-add-interactive-agent-settings.js +27 -0
  65. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/047-add-agent-session-id.d.ts +15 -0
  66. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/047-add-agent-session-id.d.ts.map +1 -0
  67. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/047-add-agent-session-id.js +27 -0
  68. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/048-add-turn-status.d.ts +15 -0
  69. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/048-add-turn-status.d.ts.map +1 -0
  70. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/048-add-turn-status.js +20 -0
  71. package/dist/packages/core/src/infrastructure/repositories/sqlite-interactive-message.repository.d.ts +18 -0
  72. package/dist/packages/core/src/infrastructure/repositories/sqlite-interactive-message.repository.d.ts.map +1 -0
  73. package/dist/packages/core/src/infrastructure/repositories/sqlite-interactive-message.repository.js +58 -0
  74. package/dist/packages/core/src/infrastructure/repositories/sqlite-interactive-session.repository.d.ts +28 -0
  75. package/dist/packages/core/src/infrastructure/repositories/sqlite-interactive-session.repository.d.ts.map +1 -0
  76. package/dist/packages/core/src/infrastructure/repositories/sqlite-interactive-session.repository.js +137 -0
  77. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
  78. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +10 -3
  79. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts +18 -0
  80. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts.map +1 -1
  81. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.js +27 -0
  82. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.d.ts +43 -0
  83. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.d.ts.map +1 -0
  84. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.js +288 -0
  85. package/dist/packages/core/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.d.ts +3 -0
  86. package/dist/packages/core/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.d.ts.map +1 -1
  87. package/dist/packages/core/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.js +6 -0
  88. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +1 -1
  89. package/dist/packages/core/src/infrastructure/services/interactive/feature-context.builder.d.ts +26 -0
  90. package/dist/packages/core/src/infrastructure/services/interactive/feature-context.builder.d.ts.map +1 -0
  91. package/dist/packages/core/src/infrastructure/services/interactive/feature-context.builder.js +140 -0
  92. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.d.ts +90 -0
  93. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.d.ts.map +1 -0
  94. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.js +889 -0
  95. package/dist/src/presentation/web/app/(dashboard)/@drawer/chat/page.d.ts +3 -0
  96. package/dist/src/presentation/web/app/(dashboard)/@drawer/chat/page.d.ts.map +1 -0
  97. package/dist/src/presentation/web/app/(dashboard)/@drawer/chat/page.js +6 -0
  98. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.d.ts.map +1 -1
  99. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +2 -2
  100. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/page.d.ts.map +1 -1
  101. package/dist/src/presentation/web/app/(dashboard)/@drawer/feature/[featureId]/page.js +2 -2
  102. package/dist/src/presentation/web/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.d.ts +11 -0
  103. package/dist/src/presentation/web/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.d.ts.map +1 -0
  104. package/dist/src/presentation/web/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +18 -0
  105. package/dist/src/presentation/web/app/(dashboard)/chat/page.d.ts +3 -0
  106. package/dist/src/presentation/web/app/(dashboard)/chat/page.d.ts.map +1 -0
  107. package/dist/src/presentation/web/app/(dashboard)/chat/page.js +4 -0
  108. package/dist/src/presentation/web/app/(dashboard)/repository/[repositoryId]/[tab]/page.d.ts +3 -0
  109. package/dist/src/presentation/web/app/(dashboard)/repository/[repositoryId]/[tab]/page.d.ts.map +1 -0
  110. package/dist/src/presentation/web/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +4 -0
  111. package/dist/src/presentation/web/app/api/agent-events/route.d.ts +6 -0
  112. package/dist/src/presentation/web/app/api/agent-events/route.d.ts.map +1 -1
  113. package/dist/src/presentation/web/app/api/agent-events/route.js +54 -1
  114. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/mark-read/route.d.ts +19 -0
  115. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/mark-read/route.d.ts.map +1 -0
  116. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/mark-read/route.js +24 -0
  117. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/messages/route.d.ts +24 -0
  118. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/messages/route.d.ts.map +1 -0
  119. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/messages/route.js +76 -0
  120. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stop/route.d.ts +16 -0
  121. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stop/route.d.ts.map +1 -0
  122. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stop/route.js +21 -0
  123. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.d.ts +21 -0
  124. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.d.ts.map +1 -0
  125. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.js +87 -0
  126. package/dist/src/presentation/web/app/api/interactive/chat/turn-statuses/route.d.ts +12 -0
  127. package/dist/src/presentation/web/app/api/interactive/chat/turn-statuses/route.d.ts.map +1 -0
  128. package/dist/src/presentation/web/app/api/interactive/chat/turn-statuses/route.js +28 -0
  129. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/messages/route.d.ts +19 -0
  130. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/messages/route.d.ts.map +1 -0
  131. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/messages/route.js +78 -0
  132. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/route.d.ts +18 -0
  133. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/route.d.ts.map +1 -0
  134. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/route.js +43 -0
  135. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/stream/route.d.ts +19 -0
  136. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/stream/route.d.ts.map +1 -0
  137. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/stream/route.js +92 -0
  138. package/dist/src/presentation/web/app/api/interactive/sessions/route.d.ts +12 -0
  139. package/dist/src/presentation/web/app/api/interactive/sessions/route.d.ts.map +1 -0
  140. package/dist/src/presentation/web/app/api/interactive/sessions/route.js +37 -0
  141. package/dist/src/presentation/web/app/layout.d.ts.map +1 -1
  142. package/dist/src/presentation/web/app/layout.js +2 -1
  143. package/dist/src/presentation/web/components/assistant-ui/thread.d.ts +6 -0
  144. package/dist/src/presentation/web/components/assistant-ui/thread.d.ts.map +1 -0
  145. package/dist/src/presentation/web/components/assistant-ui/thread.js +192 -0
  146. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.d.ts +1 -1
  147. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.d.ts.map +1 -1
  148. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.js +1 -0
  149. package/dist/src/presentation/web/components/common/control-center-drawer/drawer-view.d.ts +1 -1
  150. package/dist/src/presentation/web/components/common/control-center-drawer/drawer-view.d.ts.map +1 -1
  151. package/dist/src/presentation/web/components/common/control-center-drawer/drawer-view.js +1 -0
  152. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts +3 -1
  153. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  154. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +5 -6
  155. package/dist/src/presentation/web/components/common/control-center-drawer/global-chat-drawer-client.d.ts +2 -0
  156. package/dist/src/presentation/web/components/common/control-center-drawer/global-chat-drawer-client.d.ts.map +1 -0
  157. package/dist/src/presentation/web/components/common/control-center-drawer/global-chat-drawer-client.js +17 -0
  158. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.d.ts +3 -1
  159. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.d.ts.map +1 -1
  160. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.js +15 -8
  161. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts +7 -1
  162. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
  163. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +11 -4
  164. package/dist/src/presentation/web/components/common/feature-node/feature-node.d.ts.map +1 -1
  165. package/dist/src/presentation/web/components/common/feature-node/feature-node.js +10 -2
  166. package/dist/src/presentation/web/components/common/floating-action-button/floating-action-button.d.ts +9 -2
  167. package/dist/src/presentation/web/components/common/floating-action-button/floating-action-button.d.ts.map +1 -1
  168. package/dist/src/presentation/web/components/common/floating-action-button/floating-action-button.js +11 -16
  169. package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
  170. package/dist/src/presentation/web/components/common/repository-node/repository-node.js +10 -2
  171. package/dist/src/presentation/web/components/features/chat/AgentStatusBadge.d.ts +21 -0
  172. package/dist/src/presentation/web/components/features/chat/AgentStatusBadge.d.ts.map +1 -0
  173. package/dist/src/presentation/web/components/features/chat/AgentStatusBadge.js +46 -0
  174. package/dist/src/presentation/web/components/features/chat/AgentStatusBadge.stories.d.ts +20 -0
  175. package/dist/src/presentation/web/components/features/chat/AgentStatusBadge.stories.d.ts.map +1 -0
  176. package/dist/src/presentation/web/components/features/chat/AgentStatusBadge.stories.js +52 -0
  177. package/dist/src/presentation/web/components/features/chat/ChatComposer.d.ts +18 -0
  178. package/dist/src/presentation/web/components/features/chat/ChatComposer.d.ts.map +1 -0
  179. package/dist/src/presentation/web/components/features/chat/ChatComposer.js +16 -0
  180. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.d.ts +14 -0
  181. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.d.ts.map +1 -0
  182. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.js +13 -0
  183. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.stories.d.ts +9 -0
  184. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.stories.d.ts.map +1 -0
  185. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.stories.js +19 -0
  186. package/dist/src/presentation/web/components/features/chat/ChatInput.d.ts +19 -0
  187. package/dist/src/presentation/web/components/features/chat/ChatInput.d.ts.map +1 -0
  188. package/dist/src/presentation/web/components/features/chat/ChatInput.js +42 -0
  189. package/dist/src/presentation/web/components/features/chat/ChatInput.stories.d.ts +14 -0
  190. package/dist/src/presentation/web/components/features/chat/ChatInput.stories.d.ts.map +1 -0
  191. package/dist/src/presentation/web/components/features/chat/ChatInput.stories.js +56 -0
  192. package/dist/src/presentation/web/components/features/chat/ChatMessageBubble.d.ts +21 -0
  193. package/dist/src/presentation/web/components/features/chat/ChatMessageBubble.d.ts.map +1 -0
  194. package/dist/src/presentation/web/components/features/chat/ChatMessageBubble.js +43 -0
  195. package/dist/src/presentation/web/components/features/chat/ChatMessageBubble.stories.d.ts +24 -0
  196. package/dist/src/presentation/web/components/features/chat/ChatMessageBubble.stories.d.ts.map +1 -0
  197. package/dist/src/presentation/web/components/features/chat/ChatMessageBubble.stories.js +84 -0
  198. package/dist/src/presentation/web/components/features/chat/ChatMessageList.d.ts +25 -0
  199. package/dist/src/presentation/web/components/features/chat/ChatMessageList.d.ts.map +1 -0
  200. package/dist/src/presentation/web/components/features/chat/ChatMessageList.js +36 -0
  201. package/dist/src/presentation/web/components/features/chat/ChatSheet.d.ts +2 -0
  202. package/dist/src/presentation/web/components/features/chat/ChatSheet.d.ts.map +1 -0
  203. package/dist/src/presentation/web/components/features/chat/ChatSheet.js +259 -0
  204. package/dist/src/presentation/web/components/features/chat/ChatTab.d.ts +6 -0
  205. package/dist/src/presentation/web/components/features/chat/ChatTab.d.ts.map +1 -0
  206. package/dist/src/presentation/web/components/features/chat/ChatTab.js +67 -0
  207. package/dist/src/presentation/web/components/features/chat/ChatTab.stories.d.ts +25 -0
  208. package/dist/src/presentation/web/components/features/chat/ChatTab.stories.d.ts.map +1 -0
  209. package/dist/src/presentation/web/components/features/chat/ChatTab.stories.js +237 -0
  210. package/dist/src/presentation/web/components/features/chat/useChatRuntime.d.ts +34 -0
  211. package/dist/src/presentation/web/components/features/chat/useChatRuntime.d.ts.map +1 -0
  212. package/dist/src/presentation/web/components/features/chat/useChatRuntime.js +272 -0
  213. package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
  214. package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +71 -8
  215. package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.d.ts +8 -0
  216. package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.d.ts.map +1 -0
  217. package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.js +29 -0
  218. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.d.ts +1 -2
  219. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.d.ts.map +1 -1
  220. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.js +5 -13
  221. package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
  222. package/dist/src/presentation/web/components/features/settings/settings-page-client.js +45 -2
  223. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.d.ts.map +1 -1
  224. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.js +25 -66
  225. package/dist/src/presentation/web/components/providers/query-provider.d.ts +4 -0
  226. package/dist/src/presentation/web/components/providers/query-provider.d.ts.map +1 -0
  227. package/dist/src/presentation/web/components/providers/query-provider.js +16 -0
  228. package/dist/src/presentation/web/hooks/turn-statuses-provider.d.ts +15 -0
  229. package/dist/src/presentation/web/hooks/turn-statuses-provider.d.ts.map +1 -0
  230. package/dist/src/presentation/web/hooks/turn-statuses-provider.js +26 -0
  231. package/dist/src/presentation/web/hooks/use-attachments.d.ts +26 -0
  232. package/dist/src/presentation/web/hooks/use-attachments.d.ts.map +1 -0
  233. package/dist/src/presentation/web/hooks/use-attachments.js +227 -0
  234. package/dist/src/presentation/web/hooks/use-turn-statuses.d.ts +12 -0
  235. package/dist/src/presentation/web/hooks/use-turn-statuses.d.ts.map +1 -0
  236. package/dist/src/presentation/web/hooks/use-turn-statuses.js +26 -0
  237. package/dist/tsconfig.build.tsbuildinfo +1 -1
  238. package/package.json +3 -1
  239. package/web/.next/BUILD_ID +1 -1
  240. package/web/.next/app-path-routes-manifest.json +13 -0
  241. package/web/.next/build-manifest.json +5 -5
  242. package/web/.next/fallback-build-manifest.json +2 -2
  243. package/web/.next/prerender-manifest.json +3 -3
  244. package/web/.next/required-server-files.js +3 -3
  245. package/web/.next/required-server-files.json +3 -3
  246. package/web/.next/routes-manifest.json +83 -0
  247. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/build-manifest.json +3 -3
  248. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +82 -82
  249. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +2 -2
  250. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  251. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  252. package/web/.next/server/app/(dashboard)/@drawer/chat/page/app-paths-manifest.json +3 -0
  253. package/web/.next/server/app/(dashboard)/@drawer/chat/page/build-manifest.json +18 -0
  254. package/web/.next/server/app/(dashboard)/@drawer/chat/page/next-font-manifest.json +6 -0
  255. package/web/.next/server/app/(dashboard)/@drawer/chat/page/react-loadable-manifest.json +8 -0
  256. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +395 -0
  257. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +22 -0
  258. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.map +5 -0
  259. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -0
  260. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +2 -0
  261. package/web/.next/server/app/(dashboard)/@drawer/create/page/build-manifest.json +3 -3
  262. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +84 -84
  263. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -2
  264. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  265. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  266. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/build-manifest.json +3 -3
  267. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +98 -98
  268. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +2 -2
  269. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  270. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  271. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/build-manifest.json +3 -3
  272. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +98 -98
  273. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +2 -2
  274. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  275. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  276. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/app-paths-manifest.json +3 -0
  277. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/build-manifest.json +18 -0
  278. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/next-font-manifest.json +6 -0
  279. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/react-loadable-manifest.json +8 -0
  280. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +395 -0
  281. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +22 -0
  282. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.map +5 -0
  283. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -0
  284. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +2 -0
  285. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/build-manifest.json +3 -3
  286. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +78 -78
  287. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -2
  288. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  289. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  290. package/web/.next/server/app/(dashboard)/chat/page/app-paths-manifest.json +3 -0
  291. package/web/.next/server/app/(dashboard)/chat/page/build-manifest.json +18 -0
  292. package/web/.next/server/app/(dashboard)/chat/page/next-font-manifest.json +6 -0
  293. package/web/.next/server/app/(dashboard)/chat/page/react-loadable-manifest.json +8 -0
  294. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +395 -0
  295. package/web/.next/server/app/(dashboard)/chat/page.js +22 -0
  296. package/web/.next/server/app/(dashboard)/chat/page.js.map +5 -0
  297. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -0
  298. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +2 -0
  299. package/web/.next/server/app/(dashboard)/create/page/build-manifest.json +3 -3
  300. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +84 -84
  301. package/web/.next/server/app/(dashboard)/create/page.js +2 -2
  302. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  303. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  304. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/build-manifest.json +3 -3
  305. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +98 -98
  306. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +2 -2
  307. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  308. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  309. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/build-manifest.json +3 -3
  310. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +98 -98
  311. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +2 -2
  312. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  313. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  314. package/web/.next/server/app/(dashboard)/page/build-manifest.json +3 -3
  315. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +78 -78
  316. package/web/.next/server/app/(dashboard)/page.js +2 -2
  317. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  318. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  319. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/app-paths-manifest.json +3 -0
  320. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/build-manifest.json +18 -0
  321. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/next-font-manifest.json +6 -0
  322. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/react-loadable-manifest.json +8 -0
  323. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +395 -0
  324. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +22 -0
  325. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.map +5 -0
  326. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -0
  327. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +2 -0
  328. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/build-manifest.json +3 -3
  329. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +78 -78
  330. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -2
  331. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  332. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  333. package/web/.next/server/app/_global-error/page/build-manifest.json +3 -3
  334. package/web/.next/server/app/_global-error.html +2 -2
  335. package/web/.next/server/app/_global-error.rsc +1 -1
  336. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  337. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  338. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  339. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  340. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  341. package/web/.next/server/app/_not-found/page/build-manifest.json +3 -3
  342. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +36 -6
  343. package/web/.next/server/app/_not-found/page.js +2 -2
  344. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  345. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  346. package/web/.next/server/app/api/attachments/preview/route.js +1 -1
  347. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  348. package/web/.next/server/app/api/attachments/upload-from-path/route.js +1 -1
  349. package/web/.next/server/app/api/attachments/upload-from-path/route.js.nft.json +1 -1
  350. package/web/.next/server/app/api/evidence/route.js +1 -1
  351. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  352. package/web/.next/server/app/api/graph-data/route.js +1 -1
  353. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  354. package/web/.next/server/app/api/interactive/chat/[featureId]/mark-read/route/app-paths-manifest.json +3 -0
  355. package/web/.next/server/app/api/interactive/chat/[featureId]/mark-read/route/build-manifest.json +11 -0
  356. package/web/.next/server/app/api/interactive/chat/[featureId]/mark-read/route/server-reference-manifest.json +4 -0
  357. package/web/.next/server/app/api/interactive/chat/[featureId]/mark-read/route.js +7 -0
  358. package/web/.next/server/app/api/interactive/chat/[featureId]/mark-read/route.js.map +5 -0
  359. package/web/.next/server/app/api/interactive/chat/[featureId]/mark-read/route.js.nft.json +1 -0
  360. package/web/.next/server/app/api/interactive/chat/[featureId]/mark-read/route_client-reference-manifest.js +2 -0
  361. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route/app-paths-manifest.json +3 -0
  362. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route/build-manifest.json +11 -0
  363. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route/server-reference-manifest.json +4 -0
  364. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js +7 -0
  365. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.map +5 -0
  366. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -0
  367. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route_client-reference-manifest.js +2 -0
  368. package/web/.next/server/app/api/interactive/chat/[featureId]/stop/route/app-paths-manifest.json +3 -0
  369. package/web/.next/server/app/api/interactive/chat/[featureId]/stop/route/build-manifest.json +11 -0
  370. package/web/.next/server/app/api/interactive/chat/[featureId]/stop/route/server-reference-manifest.json +4 -0
  371. package/web/.next/server/app/api/interactive/chat/[featureId]/stop/route.js +7 -0
  372. package/web/.next/server/app/api/interactive/chat/[featureId]/stop/route.js.map +5 -0
  373. package/web/.next/server/app/api/interactive/chat/[featureId]/stop/route.js.nft.json +1 -0
  374. package/web/.next/server/app/api/interactive/chat/[featureId]/stop/route_client-reference-manifest.js +2 -0
  375. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route/app-paths-manifest.json +3 -0
  376. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route/build-manifest.json +11 -0
  377. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route/server-reference-manifest.json +4 -0
  378. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route.js +6 -0
  379. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route.js.map +5 -0
  380. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route.js.nft.json +1 -0
  381. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route_client-reference-manifest.js +2 -0
  382. package/web/.next/server/app/api/interactive/chat/turn-statuses/route/app-paths-manifest.json +3 -0
  383. package/web/.next/server/app/api/interactive/chat/turn-statuses/route/build-manifest.json +11 -0
  384. package/web/.next/server/app/api/interactive/chat/turn-statuses/route/server-reference-manifest.json +4 -0
  385. package/web/.next/server/app/api/interactive/chat/turn-statuses/route.js +7 -0
  386. package/web/.next/server/app/api/interactive/chat/turn-statuses/route.js.map +5 -0
  387. package/web/.next/server/app/api/interactive/chat/turn-statuses/route.js.nft.json +1 -0
  388. package/web/.next/server/app/api/interactive/chat/turn-statuses/route_client-reference-manifest.js +2 -0
  389. package/web/.next/server/app/api/interactive/sessions/[id]/messages/route/app-paths-manifest.json +3 -0
  390. package/web/.next/server/app/api/interactive/sessions/[id]/messages/route/build-manifest.json +11 -0
  391. package/web/.next/server/app/api/interactive/sessions/[id]/messages/route/server-reference-manifest.json +4 -0
  392. package/web/.next/server/app/api/interactive/sessions/[id]/messages/route.js +7 -0
  393. package/web/.next/server/app/api/interactive/sessions/[id]/messages/route.js.map +5 -0
  394. package/web/.next/server/app/api/interactive/sessions/[id]/messages/route.js.nft.json +1 -0
  395. package/web/.next/server/app/api/interactive/sessions/[id]/messages/route_client-reference-manifest.js +2 -0
  396. package/web/.next/server/app/api/interactive/sessions/[id]/route/app-paths-manifest.json +3 -0
  397. package/web/.next/server/app/api/interactive/sessions/[id]/route/build-manifest.json +11 -0
  398. package/web/.next/server/app/api/interactive/sessions/[id]/route/server-reference-manifest.json +4 -0
  399. package/web/.next/server/app/api/interactive/sessions/[id]/route.js +7 -0
  400. package/web/.next/server/app/api/interactive/sessions/[id]/route.js.map +5 -0
  401. package/web/.next/server/app/api/interactive/sessions/[id]/route.js.nft.json +1 -0
  402. package/web/.next/server/app/api/interactive/sessions/[id]/route_client-reference-manifest.js +2 -0
  403. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route/app-paths-manifest.json +3 -0
  404. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route/build-manifest.json +11 -0
  405. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route/server-reference-manifest.json +4 -0
  406. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route.js +6 -0
  407. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route.js.map +5 -0
  408. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route.js.nft.json +1 -0
  409. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route_client-reference-manifest.js +2 -0
  410. package/web/.next/server/app/api/interactive/sessions/route/app-paths-manifest.json +3 -0
  411. package/web/.next/server/app/api/interactive/sessions/route/build-manifest.json +11 -0
  412. package/web/.next/server/app/api/interactive/sessions/route/server-reference-manifest.json +4 -0
  413. package/web/.next/server/app/api/interactive/sessions/route.js +7 -0
  414. package/web/.next/server/app/api/interactive/sessions/route.js.map +5 -0
  415. package/web/.next/server/app/api/interactive/sessions/route.js.nft.json +1 -0
  416. package/web/.next/server/app/api/interactive/sessions/route_client-reference-manifest.js +2 -0
  417. package/web/.next/server/app/api/sessions/route.js.nft.json +1 -1
  418. package/web/.next/server/app/api/sessions-batch/route.js +1 -1
  419. package/web/.next/server/app/api/sessions-batch/route.js.nft.json +1 -1
  420. package/web/.next/server/app/api/tools/route.js +2 -2
  421. package/web/.next/server/app/settings/page/build-manifest.json +3 -3
  422. package/web/.next/server/app/settings/page/server-reference-manifest.json +42 -42
  423. package/web/.next/server/app/settings/page.js +3 -3
  424. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  425. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  426. package/web/.next/server/app/skills/page/build-manifest.json +3 -3
  427. package/web/.next/server/app/skills/page/server-reference-manifest.json +46 -16
  428. package/web/.next/server/app/skills/page.js +3 -3
  429. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  430. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  431. package/web/.next/server/app/tools/page/build-manifest.json +3 -3
  432. package/web/.next/server/app/tools/page/server-reference-manifest.json +46 -16
  433. package/web/.next/server/app/tools/page.js +3 -3
  434. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  435. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  436. package/web/.next/server/app/version/page/build-manifest.json +3 -3
  437. package/web/.next/server/app/version/page/server-reference-manifest.json +36 -6
  438. package/web/.next/server/app/version/page.js +2 -2
  439. package/web/.next/server/app/version/page.js.nft.json +1 -1
  440. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  441. package/web/.next/server/app-paths-manifest.json +13 -0
  442. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js +8 -2
  443. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js.map +1 -1
  444. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_interactive_sessions_route_actions_f2e7447f.js +3 -0
  445. package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_interactive_sessions_route_actions_f2e7447f.js.map +1 -0
  446. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_[featureId]_mark-read_route_actions_ce79c730.js +3 -0
  447. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_[featureId]_mark-read_route_actions_ce79c730.js.map +1 -0
  448. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_[featureId]_messages_route_actions_f98e5802.js +3 -0
  449. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_[featureId]_messages_route_actions_f98e5802.js.map +1 -0
  450. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_[featureId]_stop_route_actions_36518d35.js +3 -0
  451. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_[featureId]_stop_route_actions_36518d35.js.map +1 -0
  452. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_[featureId]_stream_route_actions_e6210931.js +3 -0
  453. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_[featureId]_stream_route_actions_e6210931.js.map +1 -0
  454. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_turn-statuses_route_actions_f97e4de7.js +3 -0
  455. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_chat_turn-statuses_route_actions_f97e4de7.js.map +1 -0
  456. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_sessions_[id]_messages_route_actions_be179971.js +3 -0
  457. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_sessions_[id]_messages_route_actions_be179971.js.map +1 -0
  458. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_sessions_[id]_stream_route_actions_58ab2b5b.js +3 -0
  459. package/web/.next/server/chunks/8ba4b_server_app_api_interactive_sessions_[id]_stream_route_actions_58ab2b5b.js.map +1 -0
  460. package/web/.next/server/chunks/[root-of-the-server]__10852c5c._.js +3 -0
  461. package/web/.next/server/chunks/[root-of-the-server]__10852c5c._.js.map +1 -0
  462. package/web/.next/server/chunks/[root-of-the-server]__2b71641f._.js +3 -0
  463. package/web/.next/server/chunks/[root-of-the-server]__2b71641f._.js.map +1 -0
  464. package/web/.next/server/chunks/[root-of-the-server]__2bb675ff._.js +3 -0
  465. package/web/.next/server/chunks/[root-of-the-server]__2bb675ff._.js.map +1 -0
  466. package/web/.next/server/chunks/{[root-of-the-server]__0d33c29e._.js → [root-of-the-server]__31598852._.js} +2 -2
  467. package/web/.next/server/chunks/{[root-of-the-server]__0d33c29e._.js.map → [root-of-the-server]__31598852._.js.map} +1 -1
  468. package/web/.next/server/chunks/[root-of-the-server]__32b04219._.js +3 -0
  469. package/web/.next/server/chunks/[root-of-the-server]__32b04219._.js.map +1 -0
  470. package/web/.next/server/chunks/[root-of-the-server]__4408a5ba._.js +12 -0
  471. package/web/.next/server/chunks/[root-of-the-server]__4408a5ba._.js.map +1 -0
  472. package/web/.next/server/chunks/[root-of-the-server]__6565a045._.js +3 -0
  473. package/web/.next/server/chunks/[root-of-the-server]__6565a045._.js.map +1 -0
  474. package/web/.next/server/chunks/[root-of-the-server]__8a281f8d._.js +18 -0
  475. package/web/.next/server/chunks/[root-of-the-server]__8a281f8d._.js.map +1 -0
  476. package/web/.next/server/chunks/[root-of-the-server]__8f8d6afe._.js +3 -0
  477. package/web/.next/server/chunks/[root-of-the-server]__8f8d6afe._.js.map +1 -0
  478. package/web/.next/server/chunks/[root-of-the-server]__9191749c._.js +1 -1
  479. package/web/.next/server/chunks/[root-of-the-server]__9191749c._.js.map +1 -1
  480. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  481. package/web/.next/server/chunks/[root-of-the-server]__ab4951b1._.js +3 -0
  482. package/web/.next/server/chunks/[root-of-the-server]__ab4951b1._.js.map +1 -0
  483. package/web/.next/server/chunks/{[root-of-the-server]__26565141._.js → [root-of-the-server]__acea6565._.js} +2 -2
  484. package/web/.next/server/chunks/{[root-of-the-server]__26565141._.js.map → [root-of-the-server]__acea6565._.js.map} +1 -1
  485. package/web/.next/server/chunks/[root-of-the-server]__beda892a._.js +3 -0
  486. package/web/.next/server/chunks/[root-of-the-server]__beda892a._.js.map +1 -0
  487. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +1 -1
  488. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
  489. package/web/.next/server/chunks/{[root-of-the-server]__25f23d5d._.js → [root-of-the-server]__e3692208._.js} +2 -2
  490. package/web/.next/server/chunks/{[root-of-the-server]__25f23d5d._.js.map → [root-of-the-server]__e3692208._.js.map} +1 -1
  491. package/web/.next/server/chunks/{[root-of-the-server]__a5879003._.js → [root-of-the-server]__ea653642._.js} +2 -2
  492. package/web/.next/server/chunks/{[root-of-the-server]__a5879003._.js.map → [root-of-the-server]__ea653642._.js.map} +1 -1
  493. package/web/.next/server/chunks/f3a1f__next-internal_server_app_api_interactive_sessions_[id]_route_actions_a4ea4d16.js +3 -0
  494. package/web/.next/server/chunks/f3a1f__next-internal_server_app_api_interactive_sessions_[id]_route_actions_a4ea4d16.js.map +1 -0
  495. package/web/.next/server/chunks/ssr/403f9_next_dist_c9d9b4d7._.js +1 -1
  496. package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_2c44200f.js +4 -0
  497. package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_2c44200f.js.map +1 -0
  498. package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_56f4f121.js +4 -0
  499. package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_56f4f121.js.map +1 -0
  500. package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_77436e06.js +4 -0
  501. package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_77436e06.js.map +1 -0
  502. package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_b9bb0443.js +4 -0
  503. package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_b9bb0443.js.map +1 -0
  504. package/web/.next/server/chunks/ssr/744ca_web_app_(dashboard)_repository_[repositoryId]_[tab]_page_tsx_2e9a3025._.js +3 -0
  505. package/web/.next/server/chunks/ssr/744ca_web_app_(dashboard)_repository_[repositoryId]_[tab]_page_tsx_2e9a3025._.js.map +1 -0
  506. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  507. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  508. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +7 -0
  509. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -0
  510. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_4b319ae6._.js +3 -0
  511. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_4b319ae6._.js.map +1 -0
  512. package/web/.next/server/chunks/ssr/[root-of-the-server]__0b150ddf._.js +1 -1
  513. package/web/.next/server/chunks/ssr/[root-of-the-server]__0b150ddf._.js.map +1 -1
  514. package/web/.next/server/chunks/ssr/[root-of-the-server]__17ed7ed1._.js +4 -0
  515. package/web/.next/server/chunks/ssr/[root-of-the-server]__17ed7ed1._.js.map +1 -0
  516. package/web/.next/server/chunks/ssr/[root-of-the-server]__28d0d265._.js +4 -0
  517. package/web/.next/server/chunks/ssr/[root-of-the-server]__28d0d265._.js.map +1 -0
  518. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  519. package/web/.next/server/chunks/ssr/[root-of-the-server]__42bf1807._.js +4 -0
  520. package/web/.next/server/chunks/ssr/[root-of-the-server]__42bf1807._.js.map +1 -0
  521. package/web/.next/server/chunks/ssr/[root-of-the-server]__56b70465._.js +4 -0
  522. package/web/.next/server/chunks/ssr/[root-of-the-server]__56b70465._.js.map +1 -0
  523. package/web/.next/server/chunks/ssr/[root-of-the-server]__684a868c._.js +1 -1
  524. package/web/.next/server/chunks/ssr/[root-of-the-server]__684a868c._.js.map +1 -1
  525. package/web/.next/server/chunks/ssr/[root-of-the-server]__7528eb6f._.js +3 -0
  526. package/web/.next/server/chunks/ssr/[root-of-the-server]__7528eb6f._.js.map +1 -0
  527. package/web/.next/server/chunks/ssr/[root-of-the-server]__88f7e8e6._.js +4 -0
  528. package/web/.next/server/chunks/ssr/[root-of-the-server]__88f7e8e6._.js.map +1 -0
  529. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js +4 -0
  530. package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js.map +1 -0
  531. package/web/.next/server/chunks/ssr/[root-of-the-server]__b14946f5._.js +2 -2
  532. package/web/.next/server/chunks/ssr/[root-of-the-server]__b8d4bd27._.js +3 -0
  533. package/web/.next/server/chunks/ssr/[root-of-the-server]__b8d4bd27._.js.map +1 -0
  534. package/web/.next/server/chunks/ssr/[root-of-the-server]__c16bf5de._.js +1 -1
  535. package/web/.next/server/chunks/ssr/[root-of-the-server]__c16bf5de._.js.map +1 -1
  536. package/web/.next/server/chunks/ssr/[root-of-the-server]__c30f1f82._.js +4 -0
  537. package/web/.next/server/chunks/ssr/[root-of-the-server]__c30f1f82._.js.map +1 -0
  538. package/web/.next/server/chunks/ssr/[root-of-the-server]__e91ffd5e._.js +7 -0
  539. package/web/.next/server/chunks/ssr/[root-of-the-server]__e91ffd5e._.js.map +1 -0
  540. package/web/.next/server/chunks/ssr/[root-of-the-server]__f80bfc75._.js +4 -0
  541. package/web/.next/server/chunks/ssr/[root-of-the-server]__f80bfc75._.js.map +1 -0
  542. package/web/.next/server/chunks/ssr/[root-of-the-server]__f8dd4422._.js +3 -0
  543. package/web/.next/server/chunks/ssr/[root-of-the-server]__f8dd4422._.js.map +1 -0
  544. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  545. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  546. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  547. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  548. package/web/.next/server/chunks/ssr/{_2aa1f61e._.js → _245b6623._.js} +3 -3
  549. package/web/.next/server/chunks/ssr/_245b6623._.js.map +1 -0
  550. package/web/.next/server/chunks/ssr/_3a0b989f._.js +6 -0
  551. package/web/.next/server/chunks/ssr/_3a0b989f._.js.map +1 -0
  552. package/web/.next/server/chunks/ssr/{_6c7faa01._.js → _507a8382._.js} +2 -2
  553. package/web/.next/server/chunks/ssr/_507a8382._.js.map +1 -0
  554. package/web/.next/server/chunks/ssr/_51af0bf4._.js +3 -0
  555. package/web/.next/server/chunks/ssr/_51af0bf4._.js.map +1 -0
  556. package/web/.next/server/chunks/ssr/_56b9d60f._.js +3 -0
  557. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -0
  558. package/web/.next/server/chunks/ssr/_5f69c13f._.js +4 -0
  559. package/web/.next/server/chunks/ssr/_5f69c13f._.js.map +1 -0
  560. package/web/.next/server/chunks/ssr/_78ff6f1d._.js +3 -0
  561. package/web/.next/server/chunks/ssr/_78ff6f1d._.js.map +1 -0
  562. package/web/.next/server/chunks/ssr/_7c5b97c6._.js +4 -0
  563. package/web/.next/server/chunks/ssr/_7c5b97c6._.js.map +1 -0
  564. package/web/.next/server/chunks/ssr/_8219712a._.js +3 -0
  565. package/web/.next/server/chunks/ssr/_8219712a._.js.map +1 -0
  566. package/web/.next/server/chunks/ssr/_82c57f10._.js +4 -0
  567. package/web/.next/server/chunks/ssr/_82c57f10._.js.map +1 -0
  568. package/web/.next/server/chunks/ssr/{_0020fddd._.js → _8b57edb8._.js} +2 -2
  569. package/web/.next/server/chunks/ssr/_8b57edb8._.js.map +1 -0
  570. package/web/.next/server/chunks/ssr/_8d733ce4._.js +3 -0
  571. package/web/.next/server/chunks/ssr/_8d733ce4._.js.map +1 -0
  572. package/web/.next/server/chunks/ssr/{_6256a985._.js → _9495d50b._.js} +3 -3
  573. package/web/.next/server/chunks/ssr/{_6256a985._.js.map → _9495d50b._.js.map} +1 -1
  574. package/web/.next/server/chunks/ssr/_a0e3f7e4._.js +4 -0
  575. package/web/.next/server/chunks/ssr/_a0e3f7e4._.js.map +1 -0
  576. package/web/.next/server/chunks/ssr/_ac4a3873._.js +3 -0
  577. package/web/.next/server/chunks/ssr/_ac4a3873._.js.map +1 -0
  578. package/web/.next/server/chunks/ssr/_ca0aa7f0._.js +4 -0
  579. package/web/.next/server/chunks/ssr/_ca0aa7f0._.js.map +1 -0
  580. package/web/.next/server/chunks/ssr/_cb5a021e._.js +4 -0
  581. package/web/.next/server/chunks/ssr/_cb5a021e._.js.map +1 -0
  582. package/web/.next/server/chunks/ssr/_cfbd1d7e._.js +1 -1
  583. package/web/.next/server/chunks/ssr/_cfbd1d7e._.js.map +1 -1
  584. package/web/.next/server/chunks/ssr/_d4b20e29._.js +1 -1
  585. package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +1 -1
  586. package/web/.next/server/chunks/ssr/_d86175ae._.js +4 -0
  587. package/web/.next/server/chunks/ssr/_d86175ae._.js.map +1 -0
  588. package/web/.next/server/chunks/ssr/_d8bedf13._.js +4 -0
  589. package/web/.next/server/chunks/ssr/_d8bedf13._.js.map +1 -0
  590. package/web/.next/server/chunks/ssr/_e9a73a63._.js +9 -0
  591. package/web/.next/server/chunks/ssr/_e9a73a63._.js.map +1 -0
  592. package/web/.next/server/chunks/ssr/{_4093a637._.js → _fa0acc22._.js} +2 -2
  593. package/web/.next/server/chunks/ssr/_fa0acc22._.js.map +1 -0
  594. package/web/.next/server/chunks/ssr/_fa7efce3._.js +6 -0
  595. package/web/.next/server/chunks/ssr/_fa7efce3._.js.map +1 -0
  596. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  597. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  598. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_global-chat-drawer-client_tsx_158c4b12._.js +3 -0
  599. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_global-chat-drawer-client_tsx_158c4b12._.js.map +1 -0
  600. package/web/.next/server/chunks/ssr/node_modules__pnpm_8ec2c790._.js +3 -0
  601. package/web/.next/server/chunks/ssr/node_modules__pnpm_8ec2c790._.js.map +1 -0
  602. package/web/.next/server/chunks/ssr/node_modules__pnpm_ef15a0bd._.js +3 -0
  603. package/web/.next/server/chunks/ssr/node_modules__pnpm_ef15a0bd._.js.map +1 -0
  604. package/web/.next/server/chunks/ssr/src_presentation_web_324a47da._.js +3 -0
  605. package/web/.next/server/chunks/ssr/src_presentation_web_324a47da._.js.map +1 -0
  606. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_cdc632e3.js +3 -0
  607. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_cdc632e3.js.map +1 -0
  608. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_39ca0924.js +3 -0
  609. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_39ca0924.js.map +1 -0
  610. package/web/.next/server/chunks/ssr/src_presentation_web_app_(dashboard)_chat_page_tsx_85327270._.js +3 -0
  611. package/web/.next/server/chunks/ssr/src_presentation_web_app_(dashboard)_chat_page_tsx_85327270._.js.map +1 -0
  612. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  613. package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
  614. package/web/.next/server/chunks/ssr/src_presentation_web_components_357e3eb0._.js +3 -0
  615. package/web/.next/server/chunks/ssr/src_presentation_web_components_357e3eb0._.js.map +1 -0
  616. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  617. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  618. package/web/.next/server/middleware-build-manifest.js +3 -3
  619. package/web/.next/server/pages/500.html +2 -2
  620. package/web/.next/server/server-reference-manifest.js +1 -1
  621. package/web/.next/server/server-reference-manifest.json +1346 -562
  622. package/web/.next/static/chunks/0aa0c51000c61a82.js +5 -0
  623. package/web/.next/static/chunks/0bb071bc5f7487be.js +1 -0
  624. package/web/.next/static/chunks/0c38793438b8c038.js +1 -0
  625. package/web/.next/static/chunks/0df0e1499e672836.js +3 -0
  626. package/web/.next/static/chunks/11091b676d1b3bd4.js +1 -0
  627. package/web/.next/static/chunks/19e9b142ad142695.js +7 -0
  628. package/web/.next/static/chunks/22c459f1877b1e4f.js +1 -0
  629. package/web/.next/static/chunks/2354d39c63978576.js +1 -0
  630. package/web/.next/static/chunks/29f375627d0eccca.js +1 -0
  631. package/web/.next/static/chunks/2ea8e9030cd5ab2b.js +1 -0
  632. package/web/.next/static/chunks/40b6bcf1a2de4a0f.js +1 -0
  633. package/web/.next/static/chunks/4b2c4a5c35ebb70d.js +1 -0
  634. package/web/.next/static/chunks/5ae60a052ab5f437.js +5 -0
  635. package/web/.next/static/chunks/811d8a0007da9137.js +1 -0
  636. package/web/.next/static/chunks/8a83eca1de6a4ed0.js +1 -0
  637. package/web/.next/static/chunks/8ba1c07ef18b15a9.js +1 -0
  638. package/web/.next/static/chunks/9033e51dfc21b48d.js +1 -0
  639. package/web/.next/static/chunks/{4b013b6f4afce0a6.js → a36ca50cbdfb3ffe.js} +1 -1
  640. package/web/.next/static/chunks/b4cde06eff374c59.js +5 -0
  641. package/web/.next/static/chunks/be7d8a4fee3b9860.js +1 -0
  642. package/web/.next/static/chunks/c86594475dcb03d5.css +1 -0
  643. package/web/.next/static/chunks/cd54b758f58061d0.js +1 -0
  644. package/web/.next/static/chunks/{cfe4dc9904fcfddb.js → d0e04c4bd51d2553.js} +1 -1
  645. package/web/.next/static/chunks/{1ba116f1756fed5e.js → fab1eb6312340c1b.js} +2 -2
  646. package/web/.next/static/chunks/{turbopack-c2d183e05f30c7dc.js → turbopack-432ef324fc27240c.js} +1 -1
  647. package/web/package.json +7 -2
  648. package/web/.next/server/chunks/[root-of-the-server]__c6e32a23._.js +0 -3
  649. package/web/.next/server/chunks/[root-of-the-server]__c6e32a23._.js.map +0 -1
  650. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_8b618f7d._.js +0 -3
  651. package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_8b618f7d._.js.map +0 -1
  652. package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js +0 -4
  653. package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js.map +0 -1
  654. package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js +0 -4
  655. package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js.map +0 -1
  656. package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +0 -4
  657. package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js.map +0 -1
  658. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +0 -4
  659. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +0 -1
  660. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +0 -4
  661. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +0 -1
  662. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +0 -7
  663. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +0 -1
  664. package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js +0 -4
  665. package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js.map +0 -1
  666. package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js +0 -3
  667. package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js.map +0 -1
  668. package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js +0 -4
  669. package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js.map +0 -1
  670. package/web/.next/server/chunks/ssr/[root-of-the-server]__df7c1cd3._.js +0 -3
  671. package/web/.next/server/chunks/ssr/[root-of-the-server]__df7c1cd3._.js.map +0 -1
  672. package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js +0 -4
  673. package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js.map +0 -1
  674. package/web/.next/server/chunks/ssr/_0020fddd._.js.map +0 -1
  675. package/web/.next/server/chunks/ssr/_01046927._.js +0 -9
  676. package/web/.next/server/chunks/ssr/_01046927._.js.map +0 -1
  677. package/web/.next/server/chunks/ssr/_0b2cac86._.js +0 -3
  678. package/web/.next/server/chunks/ssr/_0b2cac86._.js.map +0 -1
  679. package/web/.next/server/chunks/ssr/_0c473fef._.js +0 -6
  680. package/web/.next/server/chunks/ssr/_0c473fef._.js.map +0 -1
  681. package/web/.next/server/chunks/ssr/_1b719e7f._.js +0 -4
  682. package/web/.next/server/chunks/ssr/_1b719e7f._.js.map +0 -1
  683. package/web/.next/server/chunks/ssr/_2aa1f61e._.js.map +0 -1
  684. package/web/.next/server/chunks/ssr/_37e8548b._.js +0 -4
  685. package/web/.next/server/chunks/ssr/_37e8548b._.js.map +0 -1
  686. package/web/.next/server/chunks/ssr/_4093a637._.js.map +0 -1
  687. package/web/.next/server/chunks/ssr/_55d763e2._.js +0 -4
  688. package/web/.next/server/chunks/ssr/_55d763e2._.js.map +0 -1
  689. package/web/.next/server/chunks/ssr/_6c7faa01._.js.map +0 -1
  690. package/web/.next/server/chunks/ssr/_8fcc39d4._.js +0 -3
  691. package/web/.next/server/chunks/ssr/_8fcc39d4._.js.map +0 -1
  692. package/web/.next/server/chunks/ssr/_b71645b4._.js +0 -4
  693. package/web/.next/server/chunks/ssr/_b71645b4._.js.map +0 -1
  694. package/web/.next/server/chunks/ssr/_d8575088._.js +0 -3
  695. package/web/.next/server/chunks/ssr/_d8575088._.js.map +0 -1
  696. package/web/.next/server/chunks/ssr/_e9e9ed20._.js +0 -6
  697. package/web/.next/server/chunks/ssr/_e9e9ed20._.js.map +0 -1
  698. package/web/.next/server/chunks/ssr/node_modules__pnpm_55c7a131._.js +0 -3
  699. package/web/.next/server/chunks/ssr/node_modules__pnpm_55c7a131._.js.map +0 -1
  700. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +0 -3
  701. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +0 -1
  702. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +0 -3
  703. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +0 -1
  704. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +0 -3
  705. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +0 -1
  706. package/web/.next/server/chunks/ssr/src_presentation_web_f6e481b8._.js +0 -3
  707. package/web/.next/server/chunks/ssr/src_presentation_web_f6e481b8._.js.map +0 -1
  708. package/web/.next/static/chunks/08baac5434d9528e.js +0 -13
  709. package/web/.next/static/chunks/16966906cfa77db6.js +0 -5
  710. package/web/.next/static/chunks/24da1cc4c8a65e26.js +0 -1
  711. package/web/.next/static/chunks/36d9607f2209cd84.js +0 -1
  712. package/web/.next/static/chunks/46117e4b43552316.js +0 -1
  713. package/web/.next/static/chunks/49057cf8cd37e262.js +0 -1
  714. package/web/.next/static/chunks/4cec255f2754e5ec.js +0 -1
  715. package/web/.next/static/chunks/530d578f066ee9ad.js +0 -1
  716. package/web/.next/static/chunks/5ff8cd236a52ed3d.js +0 -1
  717. package/web/.next/static/chunks/601d93593f5f664f.js +0 -1
  718. package/web/.next/static/chunks/7089c5c993a8debb.js +0 -1
  719. package/web/.next/static/chunks/7a0118240b58924a.js +0 -1
  720. package/web/.next/static/chunks/903d3357abf9b52c.js +0 -1
  721. package/web/.next/static/chunks/9b8678597fa1db84.css +0 -1
  722. package/web/.next/static/chunks/b70dd4985a814b27.js +0 -1
  723. package/web/.next/static/chunks/e4a7c6ef8a3e6fa0.js +0 -1
  724. package/web/.next/static/chunks/f66c996402a430f5.js +0 -1
  725. /package/web/.next/static/{RCXQqSnwzdmA7_70mFW0K → vc6t9IqXHzQXsbrkf5_dt}/_buildManifest.js +0 -0
  726. /package/web/.next/static/{RCXQqSnwzdmA7_70mFW0K → vc6t9IqXHzQXsbrkf5_dt}/_clientMiddlewareManifest.json +0 -0
  727. /package/web/.next/static/{RCXQqSnwzdmA7_70mFW0K → vc6t9IqXHzQXsbrkf5_dt}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/lib/session-scanner.ts","../../../../../../src/presentation/web/app/api/sessions-batch/route.ts","../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","/**\n * Shared session scanning logic used by both /api/sessions and /api/sessions-batch.\n *\n * Scans Claude Code and Cursor session directories for JSONL session files,\n * parsing headers to extract preview, message count, and timestamps.\n */\n\nimport { createHash } from 'node:crypto';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { readdir, stat } from 'node:fs/promises';\n\nexport interface SessionResult {\n id: string;\n agentType: string;\n preview: string | null;\n messageCount: number;\n firstMessageAt: string | null;\n lastMessageAt: string | null;\n createdAt: string | null;\n projectPath: string;\n filePath: string;\n /** mtime for sorting — not sent to client */\n _mtime: number;\n}\n\n// ── Path encoding helpers ─────────────────────────────────────────────\n\n/**\n * Claude Code encodes paths by replacing '/', '\\', '.' with '-'.\n * e.g. /home/user/.shep/repos/abc → -home-user--shep-repos-abc\n */\nfunction claudeEncodePath(p: string): string {\n return p.replace(/[/\\\\.]/g, '-');\n}\n\n/**\n * Cursor encodes paths by stripping the leading '/', removing dots,\n * and replacing '/' and '\\' with '-'.\n * e.g. /home/user/.shep/repos/abc → home-user-shep-repos-abc\n */\nfunction cursorEncodePath(p: string): string {\n return p.replace(/^\\//, '').replace(/\\./g, '').replace(/[/\\\\]/g, '-');\n}\n\n// ── Shared helpers ────────────────────────────────────────────────────\n\nfunction extractText(content: unknown): string | null {\n if (typeof content === 'string') return content;\n if (Array.isArray(content)) {\n for (const block of content) {\n if (typeof block === 'object' && block !== null) {\n const b = block as Record<string, unknown>;\n if (b.type === 'text' && typeof b.text === 'string') return b.text;\n }\n }\n }\n return null;\n}\n\nconst PREVIEW_READ_BYTES = 8_192; // 8KB is enough for first few messages\n\n// ── Claude Code session scanner ───────────────────────────────────────\n\nasync function collectJsonlFiles(\n projectDir: string\n): Promise<{ name: string; filePath: string; mtime: number }[]> {\n let entries: string[];\n try {\n entries = await readdir(projectDir);\n } catch {\n return [];\n }\n const jsonlFiles = entries.filter((e) => e.endsWith('.jsonl'));\n const fileInfos = await Promise.allSettled(\n jsonlFiles.map(async (name) => {\n const filePath = join(projectDir, name);\n const s = await stat(filePath);\n return { name, filePath, mtime: s.mtime.getTime() };\n })\n );\n return fileInfos\n .filter(\n (r): r is PromiseFulfilledResult<{ name: string; filePath: string; mtime: number }> =>\n r.status === 'fulfilled'\n )\n .map((r) => r.value);\n}\n\nasync function parseClaudeSession(\n filePath: string,\n fileName: string,\n mtime: number,\n repositoryPath: string\n): Promise<SessionResult | null> {\n const { createReadStream } = await import('node:fs');\n const id = fileName.replace('.jsonl', '');\n\n let preview: string | null = null;\n let firstTimestamp: string | null = null;\n let messageCount = 0;\n\n const head = await new Promise<string>((resolve) => {\n const chunks: Buffer[] = [];\n let size = 0;\n const stream = createReadStream(filePath, { end: PREVIEW_READ_BYTES - 1 });\n stream.on('data', (chunk: Buffer) => {\n chunks.push(chunk);\n size += chunk.length;\n });\n stream.on('end', () => resolve(Buffer.concat(chunks, size).toString('utf-8')));\n stream.on('error', () => resolve(''));\n });\n\n if (!head) return null;\n\n const lines = head.split('\\n').filter((l) => l.trim());\n for (const line of lines) {\n try {\n const entry = JSON.parse(line) as {\n type?: string;\n timestamp?: string;\n message?: { role?: string; content?: unknown };\n };\n if (entry.type === 'user' || entry.type === 'assistant') {\n const role = entry.message?.role;\n if (role === 'user' || role === 'assistant') {\n messageCount++;\n if (entry.timestamp) {\n firstTimestamp ??= entry.timestamp;\n }\n if (role === 'user' && preview === null) {\n preview = extractText(entry.message?.content);\n }\n }\n }\n } catch {\n break;\n }\n }\n\n if (messageCount === 0) return null;\n\n const mtimeIso = new Date(mtime).toISOString();\n return {\n id,\n agentType: 'claude-code',\n preview,\n messageCount,\n firstMessageAt: firstTimestamp,\n lastMessageAt: mtimeIso,\n createdAt: firstTimestamp ?? mtimeIso,\n projectPath: repositoryPath,\n filePath,\n _mtime: mtime,\n };\n}\n\nexport async function scanClaudeSessions(\n repositoryPath: string,\n limit: number,\n includeWorktrees = false\n): Promise<SessionResult[]> {\n const dirName = claudeEncodePath(repositoryPath);\n const projectsRoot = join(homedir(), '.claude', 'projects');\n\n const primaryDir = join(projectsRoot, dirName);\n let allFiles = await collectJsonlFiles(primaryDir);\n\n if (includeWorktrees) {\n try {\n const allDirs = await readdir(projectsRoot);\n\n const prefixMatches = allDirs.filter((d) => d !== dirName && d.startsWith(dirName));\n\n const normalizedRepoPath = repositoryPath.replace(/\\\\/g, '/');\n const repoHash = createHash('sha256').update(normalizedRepoPath).digest('hex').slice(0, 16);\n const shepHome = join(homedir(), '.shep').replace(/\\\\/g, '/');\n const shepWorktreePrefix = claudeEncodePath(join(shepHome, 'repos', repoHash));\n const shepMatches = allDirs.filter(\n (d) => d.startsWith(shepWorktreePrefix) && !prefixMatches.includes(d) && d !== dirName\n );\n\n const worktreeDirs = [...prefixMatches, ...shepMatches];\n const worktreeResults = await Promise.all(\n worktreeDirs.map((d) => collectJsonlFiles(join(projectsRoot, d)))\n );\n for (const files of worktreeResults) {\n allFiles = allFiles.concat(files);\n }\n } catch {\n // projectsRoot doesn't exist — no sessions at all\n }\n }\n\n const valid = allFiles.sort((a, b) => b.mtime - a.mtime).slice(0, limit);\n\n const results = await Promise.allSettled(\n valid.map(async (fi) => parseClaudeSession(fi.filePath, fi.name, fi.mtime, repositoryPath))\n );\n\n return results\n .filter((r): r is PromiseFulfilledResult<SessionResult | null> => r.status === 'fulfilled')\n .map((r) => r.value)\n .filter((s): s is SessionResult => s !== null);\n}\n\n// ── Cursor session scanner ────────────────────────────────────────────\n\nasync function parseCursorSession(\n filePath: string,\n fileName: string,\n mtime: number,\n repositoryPath: string\n): Promise<SessionResult | null> {\n const { createReadStream } = await import('node:fs');\n const id = fileName.replace('.jsonl', '');\n\n const head = await new Promise<string>((resolve) => {\n const chunks: Buffer[] = [];\n let size = 0;\n const stream = createReadStream(filePath, { end: PREVIEW_READ_BYTES - 1 });\n stream.on('data', (chunk: Buffer) => {\n chunks.push(chunk);\n size += chunk.length;\n });\n stream.on('end', () => resolve(Buffer.concat(chunks, size).toString('utf-8')));\n stream.on('error', () => resolve(''));\n });\n\n if (!head) return null;\n\n let preview: string | null = null;\n let messageCount = 0;\n\n const lines = head.split('\\n').filter((l) => l.trim());\n for (const line of lines) {\n try {\n const entry = JSON.parse(line) as {\n role?: string;\n message?: { content?: unknown };\n };\n if (entry.role === 'user' || entry.role === 'assistant') {\n messageCount++;\n if (entry.role === 'user' && preview === null) {\n preview = extractText(entry.message?.content);\n }\n }\n } catch {\n break;\n }\n }\n\n if (messageCount === 0) return null;\n\n const mtimeIso = new Date(mtime).toISOString();\n return {\n id,\n agentType: 'cursor',\n preview,\n messageCount,\n firstMessageAt: mtimeIso,\n lastMessageAt: mtimeIso,\n createdAt: mtimeIso,\n projectPath: repositoryPath,\n filePath,\n _mtime: mtime,\n };\n}\n\nexport async function scanCursorSessions(\n repositoryPath: string,\n limit: number\n): Promise<SessionResult[]> {\n const dirName = cursorEncodePath(repositoryPath);\n const transcriptsDir = join(homedir(), '.cursor', 'projects', dirName, 'agent-transcripts');\n\n let entries: string[];\n try {\n entries = await readdir(transcriptsDir);\n } catch {\n return [];\n }\n\n const fileInfos = await Promise.allSettled(\n entries.map(async (entry) => {\n const entryPath = join(transcriptsDir, entry);\n const s = await stat(entryPath);\n\n if (s.isFile() && entry.endsWith('.jsonl')) {\n return { name: entry, filePath: entryPath, mtime: s.mtime.getTime() };\n }\n\n if (s.isDirectory()) {\n const jsonlPath = join(entryPath, `${entry}.jsonl`);\n try {\n const jsonlStat = await stat(jsonlPath);\n return {\n name: `${entry}.jsonl`,\n filePath: jsonlPath,\n mtime: jsonlStat.mtime.getTime(),\n };\n } catch {\n return null;\n }\n }\n\n return null;\n })\n );\n\n const valid = fileInfos\n .filter(\n (\n r\n ): r is PromiseFulfilledResult<{\n name: string;\n filePath: string;\n mtime: number;\n } | null> => r.status === 'fulfilled'\n )\n .map((r) => r.value)\n .filter((v): v is { name: string; filePath: string; mtime: number } => v !== null)\n .sort((a, b) => b.mtime - a.mtime)\n .slice(0, limit);\n\n const results = await Promise.allSettled(\n valid.map(async (fi) => parseCursorSession(fi.filePath, fi.name, fi.mtime, repositoryPath))\n );\n\n return results\n .filter((r): r is PromiseFulfilledResult<SessionResult | null> => r.status === 'fulfilled')\n .map((r) => r.value)\n .filter((s): s is SessionResult => s !== null);\n}\n\n/**\n * Scan sessions for a single repository path from all providers.\n * Merges and sorts by recency.\n */\nexport async function scanSessionsForPath(\n repositoryPath: string,\n limit: number,\n includeWorktrees = false\n): Promise<SessionResult[]> {\n const [claudeSessions, cursorSessions] = await Promise.all([\n scanClaudeSessions(repositoryPath, limit, includeWorktrees),\n scanCursorSessions(repositoryPath, limit),\n ]);\n\n return [...claudeSessions, ...cursorSessions]\n .sort((a, b) => b._mtime - a._mtime)\n .slice(0, Math.min(limit, 50));\n}\n","import { NextResponse } from 'next/server';\nimport { resolve } from '@/lib/server-container';\nimport type { ListRepositoriesUseCase } from '@shepai/core/application/use-cases/repositories/list-repositories.use-case';\nimport type { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\nimport { scanSessionsForPath, type SessionResult } from '@/lib/session-scanner';\n\nexport const dynamic = 'force-dynamic';\n\ntype SessionSummaryFromBatch = Omit<SessionResult, '_mtime'>;\n\nconst SESSIONS_PER_PATH = 5;\n\n// ── Server-side cache ─────────────────────────────────────────────────\n\nconst CACHE_TTL_MS = 30_000;\nlet cache: { data: Record<string, SessionSummaryFromBatch[]>; createdAt: number } | null = null;\n\n// ── Route handler ─────────────────────────────────────────────────────\n\n/**\n * GET /api/sessions-batch\n *\n * No parameters needed — resolves all repos and features from the DI container,\n * scans sessions for each, and returns { sessionsByPath: Record<string, SessionSummary[]> }.\n */\nexport async function GET() {\n // Return cache if fresh\n if (cache && Date.now() - cache.createdAt < CACHE_TTL_MS) {\n return NextResponse.json({ sessionsByPath: cache.data });\n }\n\n try {\n const listRepos = resolve<ListRepositoriesUseCase>('ListRepositoriesUseCase');\n const listFeatures = resolve<ListFeaturesUseCase>('ListFeaturesUseCase');\n\n const [repositories, features] = await Promise.all([\n listRepos.execute(),\n listFeatures.execute({ includeArchived: false }),\n ]);\n\n // Build unique path specs: repos with includeWorktrees, features with their worktree path\n const pathSpecs: { path: string; includeWorktrees: boolean }[] = [];\n const seen = new Set<string>();\n\n for (const repo of repositories) {\n if (repo.path && !seen.has(repo.path)) {\n seen.add(repo.path);\n pathSpecs.push({ path: repo.path, includeWorktrees: true });\n }\n }\n\n for (const feature of features) {\n const sessionPath = feature.worktreePath ?? feature.repositoryPath;\n if (sessionPath && !seen.has(sessionPath)) {\n seen.add(sessionPath);\n pathSpecs.push({ path: sessionPath, includeWorktrees: false });\n }\n }\n\n // Scan all paths in parallel\n const results = await Promise.all(\n pathSpecs.map(async ({ path, includeWorktrees }) => {\n const sessions = await scanSessionsForPath(path, SESSIONS_PER_PATH, includeWorktrees);\n return { path, sessions: sessions.map(({ _mtime, ...s }) => s) };\n })\n );\n\n const sessionsByPath: Record<string, SessionSummaryFromBatch[]> = {};\n for (const { path, sessions } of results) {\n sessionsByPath[path] = sessions;\n }\n\n cache = { data: sessionsByPath, createdAt: Date.now() };\n return NextResponse.json({ sessionsByPath });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[API] GET /api/sessions-batch error:', error);\n return NextResponse.json({ error: String(error) }, { status: 500 });\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/sessions-batch/route\",\n pathname: \"/api/sessions-batch\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/presentation/web/app/api/sessions-batch/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/sessions-batch/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":[],"mappings":"qxCAuBO,SAAS,EAAW,CAAwB,EACjD,IAAM,EAAa,UAAsC,CAAC,AAdtC,eAcoD,CAIxE,GAAI,CAAC,EACH,MAAM,AAAI,GADI,GAEZ,0FAIJ,OAAO,EAAU,OAAO,CAAC,EAC3B,gDC5BA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAsBA,SAAS,EAAiB,CAAS,EACjC,OAAO,EAAE,OAAO,CAAC,UAAW,IAC9B,CAaA,SAAS,EAAY,CAAgB,EACnC,GAAuB,UAA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,qBAAA,AAAqB,EAAC,EAAW,YAAY,GAE9E,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,EACA,MAAM,EAAe,EADT,CAGZ,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAEf,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[3]}
1
+ {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/lib/session-scanner.ts","../../../../../../src/presentation/web/app/api/sessions-batch/route.ts","../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","/**\n * Shared session scanning logic used by both /api/sessions and /api/sessions-batch.\n *\n * Scans Claude Code and Cursor session directories for JSONL session files,\n * parsing headers to extract preview, message count, and timestamps.\n */\n\nimport { createHash } from 'node:crypto';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { readdir, stat } from 'node:fs/promises';\n\nexport interface SessionResult {\n id: string;\n agentType: string;\n preview: string | null;\n messageCount: number;\n firstMessageAt: string | null;\n lastMessageAt: string | null;\n createdAt: string | null;\n projectPath: string;\n filePath: string;\n /** mtime for sorting — not sent to client */\n _mtime: number;\n}\n\n// ── Path encoding helpers ─────────────────────────────────────────────\n\n/**\n * Claude Code encodes paths by replacing '/', '\\', '.' with '-'.\n * e.g. /home/user/.shep/repos/abc → -home-user--shep-repos-abc\n */\nfunction claudeEncodePath(p: string): string {\n return p.replace(/[/\\\\.]/g, '-');\n}\n\n/**\n * Cursor encodes paths by stripping the leading '/', removing dots,\n * and replacing '/' and '\\' with '-'.\n * e.g. /home/user/.shep/repos/abc → home-user-shep-repos-abc\n */\nfunction cursorEncodePath(p: string): string {\n return p.replace(/^\\//, '').replace(/\\./g, '').replace(/[/\\\\]/g, '-');\n}\n\n// ── Shared helpers ────────────────────────────────────────────────────\n\nfunction extractText(content: unknown): string | null {\n if (typeof content === 'string') return content;\n if (Array.isArray(content)) {\n for (const block of content) {\n if (typeof block === 'object' && block !== null) {\n const b = block as Record<string, unknown>;\n if (b.type === 'text' && typeof b.text === 'string') return b.text;\n }\n }\n }\n return null;\n}\n\nconst PREVIEW_READ_BYTES = 8_192; // 8KB is enough for first few messages\n\n// ── Claude Code session scanner ───────────────────────────────────────\n\nasync function collectJsonlFiles(\n projectDir: string\n): Promise<{ name: string; filePath: string; mtime: number }[]> {\n let entries: string[];\n try {\n entries = await readdir(projectDir);\n } catch {\n return [];\n }\n const jsonlFiles = entries.filter((e) => e.endsWith('.jsonl'));\n const fileInfos = await Promise.allSettled(\n jsonlFiles.map(async (name) => {\n const filePath = join(projectDir, name);\n const s = await stat(filePath);\n return { name, filePath, mtime: s.mtime.getTime() };\n })\n );\n return fileInfos\n .filter(\n (r): r is PromiseFulfilledResult<{ name: string; filePath: string; mtime: number }> =>\n r.status === 'fulfilled'\n )\n .map((r) => r.value);\n}\n\nasync function parseClaudeSession(\n filePath: string,\n fileName: string,\n mtime: number,\n repositoryPath: string\n): Promise<SessionResult | null> {\n const { createReadStream } = await import('node:fs');\n const id = fileName.replace('.jsonl', '');\n\n let preview: string | null = null;\n let firstTimestamp: string | null = null;\n let messageCount = 0;\n\n const head = await new Promise<string>((resolve) => {\n const chunks: Buffer[] = [];\n let size = 0;\n const stream = createReadStream(filePath, { end: PREVIEW_READ_BYTES - 1 });\n stream.on('data', (chunk: Buffer) => {\n chunks.push(chunk);\n size += chunk.length;\n });\n stream.on('end', () => resolve(Buffer.concat(chunks, size).toString('utf-8')));\n stream.on('error', () => resolve(''));\n });\n\n if (!head) return null;\n\n const lines = head.split('\\n').filter((l) => l.trim());\n for (const line of lines) {\n try {\n const entry = JSON.parse(line) as {\n type?: string;\n timestamp?: string;\n message?: { role?: string; content?: unknown };\n };\n if (entry.type === 'user' || entry.type === 'assistant') {\n const role = entry.message?.role;\n if (role === 'user' || role === 'assistant') {\n messageCount++;\n if (entry.timestamp) {\n firstTimestamp ??= entry.timestamp;\n }\n if (role === 'user' && preview === null) {\n preview = extractText(entry.message?.content);\n }\n }\n }\n } catch {\n break;\n }\n }\n\n if (messageCount === 0) return null;\n\n const mtimeIso = new Date(mtime).toISOString();\n return {\n id,\n agentType: 'claude-code',\n preview,\n messageCount,\n firstMessageAt: firstTimestamp,\n lastMessageAt: mtimeIso,\n createdAt: firstTimestamp ?? mtimeIso,\n projectPath: repositoryPath,\n filePath,\n _mtime: mtime,\n };\n}\n\nexport async function scanClaudeSessions(\n repositoryPath: string,\n limit: number,\n includeWorktrees = false\n): Promise<SessionResult[]> {\n const dirName = claudeEncodePath(repositoryPath);\n const projectsRoot = join(homedir(), '.claude', 'projects');\n\n const primaryDir = join(projectsRoot, dirName);\n let allFiles = await collectJsonlFiles(primaryDir);\n\n if (includeWorktrees) {\n try {\n const allDirs = await readdir(projectsRoot);\n\n const prefixMatches = allDirs.filter((d) => d !== dirName && d.startsWith(dirName));\n\n const normalizedRepoPath = repositoryPath.replace(/\\\\/g, '/');\n const repoHash = createHash('sha256').update(normalizedRepoPath).digest('hex').slice(0, 16);\n const shepHome = join(homedir(), '.shep').replace(/\\\\/g, '/');\n const shepWorktreePrefix = claudeEncodePath(join(shepHome, 'repos', repoHash));\n const shepMatches = allDirs.filter(\n (d) => d.startsWith(shepWorktreePrefix) && !prefixMatches.includes(d) && d !== dirName\n );\n\n const worktreeDirs = [...prefixMatches, ...shepMatches];\n const worktreeResults = await Promise.all(\n worktreeDirs.map((d) => collectJsonlFiles(join(projectsRoot, d)))\n );\n for (const files of worktreeResults) {\n allFiles = allFiles.concat(files);\n }\n } catch {\n // projectsRoot doesn't exist — no sessions at all\n }\n }\n\n const valid = allFiles.sort((a, b) => b.mtime - a.mtime).slice(0, limit);\n\n const results = await Promise.allSettled(\n valid.map(async (fi) => parseClaudeSession(fi.filePath, fi.name, fi.mtime, repositoryPath))\n );\n\n return results\n .filter((r): r is PromiseFulfilledResult<SessionResult | null> => r.status === 'fulfilled')\n .map((r) => r.value)\n .filter((s): s is SessionResult => s !== null);\n}\n\n// ── Cursor session scanner ────────────────────────────────────────────\n\nasync function parseCursorSession(\n filePath: string,\n fileName: string,\n mtime: number,\n repositoryPath: string\n): Promise<SessionResult | null> {\n const { createReadStream } = await import('node:fs');\n const id = fileName.replace('.jsonl', '');\n\n const head = await new Promise<string>((resolve) => {\n const chunks: Buffer[] = [];\n let size = 0;\n const stream = createReadStream(filePath, { end: PREVIEW_READ_BYTES - 1 });\n stream.on('data', (chunk: Buffer) => {\n chunks.push(chunk);\n size += chunk.length;\n });\n stream.on('end', () => resolve(Buffer.concat(chunks, size).toString('utf-8')));\n stream.on('error', () => resolve(''));\n });\n\n if (!head) return null;\n\n let preview: string | null = null;\n let messageCount = 0;\n\n const lines = head.split('\\n').filter((l) => l.trim());\n for (const line of lines) {\n try {\n const entry = JSON.parse(line) as {\n role?: string;\n message?: { content?: unknown };\n };\n if (entry.role === 'user' || entry.role === 'assistant') {\n messageCount++;\n if (entry.role === 'user' && preview === null) {\n preview = extractText(entry.message?.content);\n }\n }\n } catch {\n break;\n }\n }\n\n if (messageCount === 0) return null;\n\n const mtimeIso = new Date(mtime).toISOString();\n return {\n id,\n agentType: 'cursor',\n preview,\n messageCount,\n firstMessageAt: mtimeIso,\n lastMessageAt: mtimeIso,\n createdAt: mtimeIso,\n projectPath: repositoryPath,\n filePath,\n _mtime: mtime,\n };\n}\n\nexport async function scanCursorSessions(\n repositoryPath: string,\n limit: number\n): Promise<SessionResult[]> {\n const dirName = cursorEncodePath(repositoryPath);\n const transcriptsDir = join(homedir(), '.cursor', 'projects', dirName, 'agent-transcripts');\n\n let entries: string[];\n try {\n entries = await readdir(transcriptsDir);\n } catch {\n return [];\n }\n\n const fileInfos = await Promise.allSettled(\n entries.map(async (entry) => {\n const entryPath = join(transcriptsDir, entry);\n const s = await stat(entryPath);\n\n if (s.isFile() && entry.endsWith('.jsonl')) {\n return { name: entry, filePath: entryPath, mtime: s.mtime.getTime() };\n }\n\n if (s.isDirectory()) {\n const jsonlPath = join(entryPath, `${entry}.jsonl`);\n try {\n const jsonlStat = await stat(jsonlPath);\n return {\n name: `${entry}.jsonl`,\n filePath: jsonlPath,\n mtime: jsonlStat.mtime.getTime(),\n };\n } catch {\n return null;\n }\n }\n\n return null;\n })\n );\n\n const valid = fileInfos\n .filter(\n (\n r\n ): r is PromiseFulfilledResult<{\n name: string;\n filePath: string;\n mtime: number;\n } | null> => r.status === 'fulfilled'\n )\n .map((r) => r.value)\n .filter((v): v is { name: string; filePath: string; mtime: number } => v !== null)\n .sort((a, b) => b.mtime - a.mtime)\n .slice(0, limit);\n\n const results = await Promise.allSettled(\n valid.map(async (fi) => parseCursorSession(fi.filePath, fi.name, fi.mtime, repositoryPath))\n );\n\n return results\n .filter((r): r is PromiseFulfilledResult<SessionResult | null> => r.status === 'fulfilled')\n .map((r) => r.value)\n .filter((s): s is SessionResult => s !== null);\n}\n\n/**\n * Scan sessions for a single repository path from all providers.\n * Merges and sorts by recency.\n */\nexport async function scanSessionsForPath(\n repositoryPath: string,\n limit: number,\n includeWorktrees = false\n): Promise<SessionResult[]> {\n const [claudeSessions, cursorSessions] = await Promise.all([\n scanClaudeSessions(repositoryPath, limit, includeWorktrees),\n scanCursorSessions(repositoryPath, limit),\n ]);\n\n return [...claudeSessions, ...cursorSessions]\n .sort((a, b) => b._mtime - a._mtime)\n .slice(0, Math.min(limit, 50));\n}\n","import { NextResponse } from 'next/server';\nimport { resolve } from '@/lib/server-container';\nimport type { ListRepositoriesUseCase } from '@shepai/core/application/use-cases/repositories/list-repositories.use-case';\nimport type { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\nimport { scanSessionsForPath, type SessionResult } from '@/lib/session-scanner';\n\nexport const dynamic = 'force-dynamic';\n\ntype SessionSummaryFromBatch = Omit<SessionResult, '_mtime'>;\n\nconst SESSIONS_PER_PATH = 5;\n\n// ── Server-side cache ─────────────────────────────────────────────────\n\nconst CACHE_TTL_MS = 30_000;\nlet cache: { data: Record<string, SessionSummaryFromBatch[]>; createdAt: number } | null = null;\n\n// ── Route handler ─────────────────────────────────────────────────────\n\n/**\n * GET /api/sessions-batch\n *\n * No parameters needed — resolves all repos and features from the DI container,\n * scans sessions for each, and returns { sessionsByPath: Record<string, SessionSummary[]> }.\n */\nexport async function GET() {\n // Return cache if fresh\n if (cache && Date.now() - cache.createdAt < CACHE_TTL_MS) {\n return NextResponse.json({ sessionsByPath: cache.data });\n }\n\n try {\n const listRepos = resolve<ListRepositoriesUseCase>('ListRepositoriesUseCase');\n const listFeatures = resolve<ListFeaturesUseCase>('ListFeaturesUseCase');\n\n const [repositories, features] = await Promise.all([\n listRepos.execute(),\n listFeatures.execute({ includeArchived: false }),\n ]);\n\n // Build unique path specs: repos with includeWorktrees, features with their worktree path\n const pathSpecs: { path: string; includeWorktrees: boolean }[] = [];\n const seen = new Set<string>();\n\n for (const repo of repositories) {\n if (repo.path && !seen.has(repo.path)) {\n seen.add(repo.path);\n pathSpecs.push({ path: repo.path, includeWorktrees: true });\n }\n }\n\n for (const feature of features) {\n const sessionPath = feature.worktreePath ?? feature.repositoryPath;\n if (sessionPath && !seen.has(sessionPath)) {\n seen.add(sessionPath);\n pathSpecs.push({ path: sessionPath, includeWorktrees: false });\n }\n }\n\n // Scan all paths in parallel\n const results = await Promise.all(\n pathSpecs.map(async ({ path, includeWorktrees }) => {\n const sessions = await scanSessionsForPath(path, SESSIONS_PER_PATH, includeWorktrees);\n return { path, sessions: sessions.map(({ _mtime, ...s }) => s) };\n })\n );\n\n const sessionsByPath: Record<string, SessionSummaryFromBatch[]> = {};\n for (const { path, sessions } of results) {\n sessionsByPath[path] = sessions;\n }\n\n cache = { data: sessionsByPath, createdAt: Date.now() };\n return NextResponse.json({ sessionsByPath });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[API] GET /api/sessions-batch error:', error);\n return NextResponse.json({ error: String(error) }, { status: 500 });\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/sessions-batch/route\",\n pathname: \"/api/sessions-batch\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/presentation/web/app/api/sessions-batch/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/sessions-batch/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":[],"mappings":"m/BAuBO,SAAS,E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IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[3]}
@@ -0,0 +1,3 @@
1
+ module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},40060,e=>{"use strict";function t(e){let t=globalThis.__shepContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}e.s(["resolve",()=>t])},61127,e=>{"use strict";var t=e.i(22925),r=e.i(62995),a=e.i(14112),n=e.i(31716),i=e.i(16340),s=e.i(40522),o=e.i(21994),l=e.i(5802),d=e.i(17171),u=e.i(177),p=e.i(43685),c=e.i(84832),h=e.i(92435),v=e.i(41260),x=e.i(80556),R=e.i(93695);e.i(97230);var f=e.i(35162),m=e.i(27980),g=e.i(40060);async function w(e,{params:t}){try{let{featureId:e}=await t,r=(0,g.resolve)("IInteractiveSessionService");return await r.markRead(e),m.NextResponse.json({ok:!0})}catch(e){return console.error("[POST /api/interactive/chat/:featureId/mark-read]",e),m.NextResponse.json({error:e instanceof Error?e.message:"Internal server error"},{status:500})}}e.s(["POST",()=>w,"dynamic",0,"force-dynamic"],93591);var E=e.i(93591);let y=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/interactive/chat/[featureId]/mark-read/route",pathname:"/api/interactive/chat/[featureId]/mark-read",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/interactive/chat/[featureId]/mark-read/route.ts",nextConfigOutput:"",userland:E}),{workAsyncStorage:C,workUnitAsyncStorage:b,serverHooks:A}=y;function k(){return(0,a.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:b})}async function T(e,t,a){y.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/interactive/chat/[featureId]/mark-read/route";m=m.replace(/\/index$/,"")||"/";let g=await y.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!g)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:w,params:E,nextConfig:C,parsedUrl:b,isDraftMode:A,prerenderManifest:k,routerServerContext:T,isOnDemandRevalidate:I,revalidateOnlyGenerated:N,resolvedPathname:P,clientReferenceManifest:O,serverActionsManifest:S}=g,_=(0,o.normalizeAppPath)(m),q=!!(k.dynamicRoutes[_]||k.routes[P]),j=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,b,!1):t.end("This page could not be found"),null);if(q&&!A){let e=!!k.routes[P],t=k.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(C.experimental.adapterPath)return await j();throw new R.NoFallbackError}}let H=null;!q||y.isDev||A||(H="/index"===(H=P)?"/":H);let U=!0===y.isDev||!q,D=q&&!U;S&&O&&(0,s.setManifestsSingleton)({page:m,clientReferenceManifest:O,serverActionsManifest:S});let M=e.method||"GET",$=(0,i.getTracer)(),F=$.getActiveScopeSpan(),K={params:E,prerenderManifest:k,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:C.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>y.onRequestError(e,t,a,n,T)},sharedContext:{buildId:w}},L=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),G=d.NextRequestAdapter.fromNodeNextRequest(L,(0,d.signalFromNodeResponse)(t));try{let s=async e=>y.handle(G,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${M} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${m}`)}),o=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var i,l;let d=async({previousCacheEntry:r})=>{try{if(!o&&I&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(n);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let d=K.renderOpts.collectedTags;if(!q)return await (0,c.sendResponse)(L,B,i,K.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);d&&(t[x.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=x.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await y.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:I})},!1,T),t}},u=await y.handleResponse({req:e,nextConfig:C,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:N,responseGenerator:d,waitUntil:a.waitUntil,isMinimalMode:o});if(!q)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});o||t.setHeader("x-nextjs-cache",I?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let R=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return o&&q||R.delete(x.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||R.get("Cache-Control")||R.set("Cache-Control",(0,v.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(L,B,new Response(u.value.body,{headers:R,status:u.value.status||200})),null};F?await l(F):await $.withPropagatedContext(e.headers,()=>$.trace(u.BaseServerSpan.handleRequest,{spanName:`${M} ${m}`,kind:i.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof R.NoFallbackError||await y.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:I})},!1,T),q)throw t;return await (0,c.sendResponse)(L,B,new Response(null,{status:500})),null}}e.s(["handler",()=>T,"patchFetch",()=>k,"routeModule",()=>y,"serverHooks",()=>A,"workAsyncStorage",()=>C,"workUnitAsyncStorage",()=>b],61127)}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__32b04219._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js","../../../../../../src/presentation/web/app/api/interactive/chat/%5BfeatureId%5D/mark-read/route.ts"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/interactive/chat/[featureId]/mark-read/route\",\n pathname: \"/api/interactive/chat/[featureId]/mark-read\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/presentation/web/app/api/interactive/chat/[featureId]/mark-read/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/interactive/chat/[featureId]/mark-read/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","/**\n * Mark chat as read API.\n *\n * POST /api/interactive/chat/[featureId]/mark-read\n *\n * Clears the 'unread' turn status to 'idle'. Called when the user\n * opens/views the chat tab for a feature.\n */\n\nimport type { NextRequest } from 'next/server';\nimport { NextResponse } from 'next/server';\nimport { resolve } from '@/lib/server-container';\nimport type { IInteractiveSessionService } from '@shepai/core/application/ports/output/services/interactive-session-service.interface';\n\nexport const dynamic = 'force-dynamic';\n\ninterface RouteParams {\n params: Promise<{ featureId: string }>;\n}\n\nexport async function POST(_request: NextRequest, { params }: RouteParams): Promise<NextResponse> {\n try {\n const { featureId } = await params;\n const service = resolve<IInteractiveSessionService>('IInteractiveSessionService');\n await service.markRead(featureId);\n return NextResponse.json({ ok: true });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[POST /api/interactive/chat/:featureId/mark-read]', error);\n return NextResponse.json(\n { error: error instanceof Error ? error.message : 'Internal server error' },\n { status: 500 }\n );\n }\n}\n"],"names":[],"mappings":"m/BAuBO,SAAS,EAAW,CAAwB,EACjD,IAAM,EAAa,UAAsC,CAAC,AAdtC,eAcoD,CAIxE,GAAI,CAAC,EACH,MAAM,AAAI,GADI,GAEZ,0FAIJ,OAAO,EAAU,OAAO,CAAC,EAC3B,gDCnCA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,KACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OCNA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OASO,eAAe,EAAK,CAAqB,CAAE,QAAE,CAAM,CAAe,EACvE,GAAI,CACF,GAAM,WAAE,CAAS,CAAE,CAAG,MAAM,EACtB,EAAU,CAAA,EAAA,EAAA,OAAA,AAAO,EAA6B,8BAEpD,OADA,MAA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ist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},40060,e=>{"use strict";function t(e){let t=globalThis.__shepContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}e.s(["resolve",()=>t])},94947,e=>{"use strict";var t=e.i(22925),r=e.i(62995),n=e.i(14112),a=e.i(31716),i=e.i(16340),s=e.i(40522),o=e.i(21994),l=e.i(5802),d=e.i(17171),u=e.i(177),c=e.i(43685),p=e.i(84832),h=e.i(92435),v=e.i(41260),x=e.i(80556),R=e.i(93695);e.i(97230);var f=e.i(35162),g=e.i(40060);async function m(e,{params:t}){let{id:r}=await t;try{let t=(0,g.resolve)("IInteractiveSessionService");if(!await t.getSession(r))return new Response(JSON.stringify({error:"Session not found"}),{status:404,headers:{"Content-Type":"application/json"}});let n=new TextEncoder,a=new ReadableStream({start(a){let i=!1;function s(e){if(!i)try{a.enqueue(n.encode(e))}catch{}}s(": connected\n\n");let o=setInterval(()=>{s(": heartbeat\n\n")},15e3),l=t.subscribe(r,e=>{if(e.done)s(`event: done
2
+ data: ${JSON.stringify({done:!0,sessionId:r})}
3
+
4
+ `);else if(e.log){let t={log:e.log,sessionId:r};s(`event: log
5
+ data: ${JSON.stringify(t)}
6
+
7
+ `)}else if(e.delta){let t={delta:e.delta,sessionId:r};s(`event: delta
8
+ data: ${JSON.stringify(t)}
9
+
10
+ `)}});e.signal.addEventListener("abort",function(){if(!i){i=!0,clearInterval(o),l();try{a.close()}catch{}}},{once:!0})}});return new Response(a,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(e){return console.error("[GET /api/interactive/sessions/:id/stream]",e),new Response(JSON.stringify({error:String(e)}),{status:500,headers:{"Content-Type":"application/json"}})}}e.s(["GET",()=>m,"dynamic",0,"force-dynamic"],95949);var w=e.i(95949);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/interactive/sessions/[id]/stream/route",pathname:"/api/interactive/sessions/[id]/stream",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/interactive/sessions/[id]/stream/route.ts",nextConfigOutput:"",userland:w}),{workAsyncStorage:y,workUnitAsyncStorage:C,serverHooks:b}=E;function T(){return(0,n.patchFetch)({workAsyncStorage:y,workUnitAsyncStorage:C})}async function S(e,t,n){E.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/interactive/sessions/[id]/stream/route";g=g.replace(/\/index$/,"")||"/";let m=await E.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:w,params:y,nextConfig:C,parsedUrl:b,isDraftMode:T,prerenderManifest:S,routerServerContext:A,isOnDemandRevalidate:N,revalidateOnlyGenerated:O,resolvedPathname:P,clientReferenceManifest:_,serverActionsManifest:I}=m,k=(0,o.normalizeAppPath)(g),q=!!(S.dynamicRoutes[k]||S.routes[P]),j=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,b,!1):t.end("This page could not be found"),null);if(q&&!T){let e=!!S.routes[P],t=S.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(C.experimental.adapterPath)return await j();throw new R.NoFallbackError}}let H=null;!q||E.isDev||T||(H="/index"===(H=P)?"/":H);let U=!0===E.isDev||!q,D=q&&!U;I&&_&&(0,s.setManifestsSingleton)({page:g,clientReferenceManifest:_,serverActionsManifest:I});let M=e.method||"GET",$=(0,i.getTracer)(),F=$.getActiveScopeSpan(),K={params:y,prerenderManifest:S,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:C.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>E.onRequestError(e,t,n,a,A)},sharedContext:{buildId:w}},L=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),G=d.NextRequestAdapter.fromNodeNextRequest(L,(0,d.signalFromNodeResponse)(t));try{let s=async e=>E.handle(G,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${M} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${g}`)}),o=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var i,l;let d=async({previousCacheEntry:r})=>{try{if(!o&&N&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(a);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let d=K.renderOpts.collectedTags;if(!q)return await (0,p.sendResponse)(L,B,i,K.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);d&&(t[x.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,n=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=x.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:N})},!1,A),t}},u=await E.handleResponse({req:e,nextConfig:C,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:O,responseGenerator:d,waitUntil:n.waitUntil,isMinimalMode:o});if(!q)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});o||t.setHeader("x-nextjs-cache",N?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let R=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return o&&q||R.delete(x.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||R.get("Cache-Control")||R.set("Cache-Control",(0,v.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(L,B,new Response(u.value.body,{headers:R,status:u.value.status||200})),null};F?await l(F):await $.withPropagatedContext(e.headers,()=>$.trace(u.BaseServerSpan.handleRequest,{spanName:`${M} ${g}`,kind:i.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof R.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:N})},!1,A),q)throw t;return await (0,p.sendResponse)(L,B,new Response(null,{status:500})),null}}e.s(["handler",()=>S,"patchFetch",()=>T,"routeModule",()=>E,"serverHooks",()=>b,"workAsyncStorage",()=>y,"workUnitAsyncStorage",()=>C],94947)}];
11
+
12
+ //# sourceMappingURL=%5Broot-of-the-server%5D__4408a5ba._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js","../../../../../../src/presentation/web/app/api/interactive/sessions/%5Bid%5D/stream/route.ts"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/interactive/sessions/[id]/stream/route\",\n pathname: \"/api/interactive/sessions/[id]/stream\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/presentation/web/app/api/interactive/sessions/[id]/stream/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/interactive/sessions/[id]/stream/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","/**\n * GET /api/interactive/sessions/[id]/stream\n *\n * Per-session SSE stream delivering real-time agent stdout chunks to the browser.\n * - Subscribes to InteractiveSessionService stdout events\n * - Emits `delta` events with each token chunk\n * - Emits `done` events at end-of-turn\n * - Cleans up listener when the client disconnects\n */\n\nimport type { NextRequest } from 'next/server';\nimport { resolve } from '@/lib/server-container';\nimport type { IInteractiveSessionService } from '@shepai/core/application/ports/output/services/interactive-session-service.interface';\n\nexport const dynamic = 'force-dynamic';\n\ninterface RouteParams {\n params: Promise<{ id: string }>;\n}\n\nexport async function GET(request: NextRequest, { params }: RouteParams): Promise<Response> {\n const { id: sessionId } = await params;\n\n try {\n const service = resolve<IInteractiveSessionService>('IInteractiveSessionService');\n\n // Verify session exists\n const session = await service.getSession(sessionId);\n if (!session) {\n return new Response(JSON.stringify({ error: 'Session not found' }), {\n status: 404,\n headers: { 'Content-Type': 'application/json' },\n });\n }\n\n const encoder = new TextEncoder();\n\n const stream = new ReadableStream<Uint8Array>({\n start(controller) {\n let closed = false;\n\n function enqueue(text: string) {\n if (closed) return;\n try {\n controller.enqueue(encoder.encode(text));\n } catch {\n // Stream may already be closed\n }\n }\n\n // Send initial comment so the browser knows the stream is alive\n enqueue(': connected\\n\\n');\n\n // Keep-alive heartbeat every 15s to prevent browser/proxy timeouts\n const heartbeat = setInterval(() => {\n enqueue(': heartbeat\\n\\n');\n }, 15_000);\n\n // Subscribe to real-time stdout chunks from the session service\n const unsubscribe = service.subscribe(sessionId, (chunk) => {\n if (chunk.done) {\n const payload = { done: true, sessionId };\n enqueue(`event: done\\ndata: ${JSON.stringify(payload)}\\n\\n`);\n } else if (chunk.log) {\n const payload = { log: chunk.log, sessionId };\n enqueue(`event: log\\ndata: ${JSON.stringify(payload)}\\n\\n`);\n } else if (chunk.delta) {\n const payload = { delta: chunk.delta, sessionId };\n enqueue(`event: delta\\ndata: ${JSON.stringify(payload)}\\n\\n`);\n }\n });\n\n // Cleanup on client disconnect\n function cleanup() {\n if (closed) return;\n closed = true;\n clearInterval(heartbeat);\n unsubscribe();\n try {\n controller.close();\n } catch {\n // Stream may already be closed\n }\n }\n\n request.signal.addEventListener('abort', cleanup, { once: true });\n },\n });\n\n return new Response(stream, {\n headers: {\n 'Content-Type': 'text/event-stream',\n 'Cache-Control': 'no-cache',\n Connection: 'keep-alive',\n },\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[GET /api/interactive/sessions/:id/stream]', error);\n return new Response(JSON.stringify({ error: String(error) }), {\n status: 500,\n headers: { 'Content-Type': 'application/json' },\n });\n }\n}\n"],"names":[],"mappings":"g0BAuBO,SAAS,EAAW,CAAwB,EACjD,IAAM,EAAa,UAAsC,CAAC,AAdtC,eAcoD,CAIxE,GAAI,CAAC,EACH,MAAM,AAAI,GADI,GAEZ,0FAIJ,OAAO,EAAU,OAAO,CAAC,EAC3B,gDCnCA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,KACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OCLA,EAAA,EAAA,CAAA,CAAA,OASO,eAAe,EAAI,CAAoB,CAAE,QAAE,CAAM,CAAe,EACrE,GAAM,CAAE,GAAI,CAAS,CAAE,CAAG,MAAM,EAEhC,GAAI,CACF,IAAM,EAAU,CAAA,EAAA,EAAA,OAAA,AAAO,EAA6B,8BAIpD,GAAI,CADY,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kB,GACnB,EADwB,AAChB,GADmB,GACb,CAAC,EAAA,sBAAsB,GAIrC,EAAW,YAAY,EAAK,EAAD,AAAK,SAAS,CAAC,kBAAqB,EAAD,AAAS,GAAG,CAAC,kBAC3E,AAD6F,EACrF,GAAG,CAAC,gBAAiB,CAAA,EAAA,EAAA,qBAAA,AAAqB,EAAC,EAAW,YAAY,GAE9E,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,EACA,MAAM,EAAe,EADT,CAGZ,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAEf,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[1]}
@@ -0,0 +1,3 @@
1
+ module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},40060,e=>{"use strict";function t(e){let t=globalThis.__shepContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}e.s(["resolve",()=>t])},60313,e=>{"use strict";var t=e.i(22925),r=e.i(62995),n=e.i(14112),s=e.i(31716),a=e.i(16340),o=e.i(40522),i=e.i(21994),l=e.i(5802),d=e.i(17171),u=e.i(177),p=e.i(43685),c=e.i(84832),h=e.i(92435),x=e.i(41260),v=e.i(80556),R=e.i(93695);e.i(97230);var f=e.i(35162),g=e.i(27980),m=e.i(40060);class w extends Error{activeSessions;cap;constructor(e,t){super(`Cannot start a new session: ${e} of ${t} allowed concurrent sessions are active. Stop an existing session first.`),this.activeSessions=e,this.cap=t,this.name="ConcurrentSessionLimitError",Object.setPrototypeOf(this,new.target.prototype)}}async function E(e){try{let{featureId:t,worktreePath:r,agentType:n,model:s}=await e.json();if(!t||"string"!=typeof t)return g.NextResponse.json({error:"featureId is required"},{status:400});if(!r||"string"!=typeof r)return g.NextResponse.json({error:"worktreePath is required"},{status:400});let a=(0,m.resolve)("StartInteractiveSessionUseCase"),o=await a.execute({featureId:t,worktreePath:r,agentType:n,model:s});return g.NextResponse.json({sessionId:o.id,status:o.status},{status:201})}catch(e){if(e instanceof w)return g.NextResponse.json({error:e.message,code:"CONCURRENT_SESSION_LIMIT"},{status:429});return console.error("[POST /api/interactive/sessions]",e),g.NextResponse.json({error:e instanceof Error?e.message:"Internal server error"},{status:500})}}e.s(["POST",()=>E,"dynamic",0,"force-dynamic"],61261);var y=e.i(61261);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/interactive/sessions/route",pathname:"/api/interactive/sessions",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/interactive/sessions/route.ts",nextConfigOutput:"",userland:y}),{workAsyncStorage:b,workUnitAsyncStorage:N,serverHooks:S}=C;function A(){return(0,n.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:N})}async function T(e,t,n){C.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/interactive/sessions/route";g=g.replace(/\/index$/,"")||"/";let m=await C.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:w,params:E,nextConfig:y,parsedUrl:b,isDraftMode:N,prerenderManifest:S,routerServerContext:A,isOnDemandRevalidate:T,revalidateOnlyGenerated:O,resolvedPathname:P,clientReferenceManifest:j,serverActionsManifest:I}=m,_=(0,i.normalizeAppPath)(g),k=!!(S.dynamicRoutes[_]||S.routes[P]),q=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,b,!1):t.end("This page could not be found"),null);if(k&&!N){let e=!!S.routes[P],t=S.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(y.experimental.adapterPath)return await q();throw new R.NoFallbackError}}let U=null;!k||C.isDev||N||(U="/index"===(U=P)?"/":U);let H=!0===C.isDev||!k,D=k&&!H;I&&j&&(0,o.setManifestsSingleton)({page:g,clientReferenceManifest:j,serverActionsManifest:I});let M=e.method||"GET",$=(0,a.getTracer)(),F=$.getActiveScopeSpan(),K={params:E,prerenderManifest:S,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,s.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:y.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,s)=>C.onRequestError(e,t,n,s,A)},sharedContext:{buildId:w}},L=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),G=d.NextRequestAdapter.fromNodeNextRequest(L,(0,d.signalFromNodeResponse)(t));try{let o=async e=>C.handle(G,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${M} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t)}else e.updateName(`${M} ${g}`)}),i=!!(0,s.getRequestMeta)(e,"minimalMode"),l=async s=>{var a,l;let d=async({previousCacheEntry:r})=>{try{if(!i&&T&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await o(s);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let d=K.renderOpts.collectedTags;if(!k)return await (0,c.sendResponse)(L,B,a,K.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);d&&(t[v.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,n=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,A),t}},u=await C.handleResponse({req:e,nextConfig:y,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:O,responseGenerator:d,waitUntil:n.waitUntil,isMinimalMode:i});if(!k)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});i||t.setHeader("x-nextjs-cache",T?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let R=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return i&&k||R.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||R.get("Cache-Control")||R.set("Cache-Control",(0,x.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(L,B,new Response(u.value.body,{headers:R,status:u.value.status||200})),null};F?await l(F):await $.withPropagatedContext(e.headers,()=>$.trace(u.BaseServerSpan.handleRequest,{spanName:`${M} ${g}`,kind:a.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof R.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:T})},!1,A),k)throw t;return await (0,c.sendResponse)(L,B,new Response(null,{status:500})),null}}e.s(["handler",()=>T,"patchFetch",()=>A,"routeModule",()=>C,"serverHooks",()=>S,"workAsyncStorage",()=>b,"workUnitAsyncStorage",()=>N],60313)}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__6565a045._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../node_modules/.pnpm/next%4016.1.6_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.58.1_react-dom%4019.2.4_react%4019.2.4__react%4019.2.4/node_modules/next/dist/esm/build/templates/app-route.js","../../../../../../packages/core/src/domain/errors/concurrent-session-limit.error.ts","../../../../../../src/presentation/web/app/api/interactive/sessions/route.ts"],"sourcesContent":["/**\n * Server Container Accessor\n *\n * Provides a `resolve()` helper for server components and API routes to\n * obtain DI-managed instances. The tsyringe container is placed on globalThis\n * by the CLI bootstrap (`shep ui`) or the dev-server (`pnpm dev:web`).\n */\n\nimport type { DependencyContainer, InjectionToken } from 'tsyringe';\n\nconst CONTAINER_KEY = '__shepContainer';\n\n/**\n * Resolve a dependency from the DI container.\n *\n * Usage in server components / API routes:\n * ```ts\n * import { resolve } from '@/lib/server-container';\n * import { ListFeaturesUseCase } from '@shepai/core/application/use-cases/features/list-features.use-case';\n *\n * const features = await resolve(ListFeaturesUseCase).execute();\n * ```\n */\nexport function resolve<T>(token: InjectionToken<T>): T {\n const container = (globalThis as Record<string, unknown>)[CONTAINER_KEY] as\n | DependencyContainer\n | undefined;\n\n if (!container) {\n throw new Error(\n 'DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.'\n );\n }\n\n return container.resolve(token);\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/interactive/sessions/route\",\n pathname: \"/api/interactive/sessions\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/presentation/web/app/api/interactive/sessions/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/interactive/sessions/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.experimental.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const context = {\n params,\n prerenderManifest,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache: getRequestMeta(req, 'incrementalCache'),\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const isMinimalMode = Boolean(process.env.MINIMAL_MODE || getRequestMeta(req, 'minimalMode'));\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (activeSpan) {\n await handleResponse(activeSpan);\n } else {\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse));\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","/**\n * Concurrent Session Limit Error\n *\n * Thrown by InteractiveSessionService.startSession() when the number of\n * active sessions (status 'booting' or 'ready') has reached the configured\n * maximum. The API route translates this to HTTP 429.\n */\nexport class ConcurrentSessionLimitError extends Error {\n constructor(\n public readonly activeSessions: number,\n public readonly cap: number\n ) {\n super(\n `Cannot start a new session: ${activeSessions} of ${cap} allowed concurrent sessions are active. Stop an existing session first.`\n );\n this.name = 'ConcurrentSessionLimitError';\n // Maintain proper prototype chain in TypeScript/ES5 targets\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n","/**\n * POST /api/interactive/sessions\n *\n * Start a new interactive agent session for a feature.\n * Returns 201 with { sessionId, status } on success.\n * Returns 429 when the concurrent session cap is reached.\n */\n\nimport type { NextRequest } from 'next/server';\nimport { NextResponse } from 'next/server';\nimport { resolve } from '@/lib/server-container';\nimport type { StartInteractiveSessionUseCase } from '@shepai/core/application/use-cases/interactive/start-interactive-session.use-case';\nimport { ConcurrentSessionLimitError } from '@shepai/core/domain/errors/concurrent-session-limit.error';\n\nexport const dynamic = 'force-dynamic';\n\nexport async function POST(request: NextRequest): Promise<NextResponse> {\n try {\n const body = (await request.json()) as {\n featureId?: string;\n worktreePath?: string;\n agentType?: string;\n model?: string;\n };\n const { featureId, worktreePath, agentType, model } = body;\n\n if (!featureId || typeof featureId !== 'string') {\n return NextResponse.json({ error: 'featureId is required' }, { status: 400 });\n }\n if (!worktreePath || typeof worktreePath !== 'string') {\n return NextResponse.json({ error: 'worktreePath is required' }, { status: 400 });\n }\n\n const useCase = resolve<StartInteractiveSessionUseCase>('StartInteractiveSessionUseCase');\n const session = await useCase.execute({ featureId, worktreePath, agentType, model });\n\n return NextResponse.json({ sessionId: session.id, status: session.status }, { status: 201 });\n } catch (error) {\n if (error instanceof ConcurrentSessionLimitError) {\n return NextResponse.json(\n {\n error: error.message,\n code: 'CONCURRENT_SESSION_LIMIT',\n },\n { status: 429 }\n );\n }\n // eslint-disable-next-line no-console\n console.error('[POST /api/interactive/sessions]', error);\n return NextResponse.json(\n { error: error instanceof Error ? error.message : 'Internal server error' },\n { status: 500 }\n );\n }\n}\n"],"names":[],"mappings":"m/BAuBO,SAAS,EAAW,CAAwB,EACjD,IAAM,EAAa,UAAsC,CAAC,AAdtC,eAcoD,C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AAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[1]}
@@ -0,0 +1,18 @@
1
+ module.exports=[18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},40060,e=>{"use strict";function t(e){let t=globalThis.__shepContainer;if(!t)throw Error("DI container not available. Ensure the CLI bootstrap or dev-server has initialized it.");return t.resolve(e)}e.s(["resolve",()=>t])},34335,e=>{"use strict";var t=e.i(22925),r=e.i(62995),a=e.i(14112),n=e.i(31716),i=e.i(16340),o=e.i(40522),s=e.i(21994),l=e.i(5802),d=e.i(17171),c=e.i(177),u=e.i(43685),p=e.i(84832),h=e.i(92435),v=e.i(41260),f=e.i(80556),x=e.i(93695);e.i(97230);var g=e.i(35162),R=e.i(40060);async function m(e,{params:t}){let{featureId:r}=await t;try{let t=(0,R.resolve)("IInteractiveSessionService"),a=new TextEncoder,n=new ReadableStream({start(n){let i=!1;function o(e){if(!i)try{n.enqueue(a.encode(e))}catch{}}o(": connected\n\n");let s=setInterval(()=>{o(": heartbeat\n\n")},15e3),l=t.subscribeByFeature(r,e=>{e.done?o(`event: done
2
+ data: ${JSON.stringify({done:!0,featureId:r})}
3
+
4
+ `):e.activity?(o(`event: activity
5
+ data: ${JSON.stringify({activity:e.activity,featureId:r})}
6
+
7
+ `),e.log&&o(`event: log
8
+ data: ${JSON.stringify({log:e.log,featureId:r})}
9
+
10
+ `)):e.log?o(`event: log
11
+ data: ${JSON.stringify({log:e.log,featureId:r})}
12
+
13
+ `):e.delta&&o(`event: delta
14
+ data: ${JSON.stringify({delta:e.delta,featureId:r})}
15
+
16
+ `)});e.signal.addEventListener("abort",function(){if(!i){i=!0,clearInterval(s),l();try{n.close()}catch{}}},{once:!0})}});return new Response(n,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(e){return console.error("[GET /api/interactive/chat/:featureId/stream]",e),new Response(JSON.stringify({error:String(e)}),{status:500,headers:{"Content-Type":"application/json"}})}}e.s(["GET",()=>m,"dynamic",0,"force-dynamic"],37267);var y=e.i(37267);let w=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/interactive/chat/[featureId]/stream/route",pathname:"/api/interactive/chat/[featureId]/stream",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.ts",nextConfigOutput:"",userland:y}),{workAsyncStorage:E,workUnitAsyncStorage:C,serverHooks:b}=w;function T(){return(0,a.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:C})}async function A(e,t,a){w.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let R="/api/interactive/chat/[featureId]/stream/route";R=R.replace(/\/index$/,"")||"/";let m=await w.prepare(e,t,{srcPage:R,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,params:E,nextConfig:C,parsedUrl:b,isDraftMode:T,prerenderManifest:A,routerServerContext:N,isOnDemandRevalidate:S,revalidateOnlyGenerated:O,resolvedPathname:I,clientReferenceManifest:P,serverActionsManifest:_}=m,k=(0,s.normalizeAppPath)(R),q=!!(A.dynamicRoutes[k]||A.routes[I]),H=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,b,!1):t.end("This page could not be found"),null);if(q&&!T){let e=!!A.routes[I],t=A.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(C.experimental.adapterPath)return await H();throw new x.NoFallbackError}}let j=null;!q||w.isDev||T||(j="/index"===(j=I)?"/":j);let U=!0===w.isDev||!q,D=q&&!U;_&&P&&(0,o.setManifestsSingleton)({page:R,clientReferenceManifest:P,serverActionsManifest:_});let $=e.method||"GET",M=(0,i.getTracer)(),F=M.getActiveScopeSpan(),K={params:E,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:C.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>w.onRequestError(e,t,a,n,N)},sharedContext:{buildId:y}},L=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),J=d.NextRequestAdapter.fromNodeNextRequest(L,(0,d.signalFromNodeResponse)(t));try{let o=async e=>w.handle(J,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${$} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${$} ${R}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var i,l;let d=async({previousCacheEntry:r})=>{try{if(!s&&S&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await o(n);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let d=K.renderOpts.collectedTags;if(!q)return await (0,p.sendResponse)(L,B,i,K.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);d&&(t[f.NEXT_CACHE_TAGS_HEADER]=d),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await w.onRequestError(e,t,{routerKind:"App Router",routePath:R,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:S})},!1,N),t}},c=await w.handleResponse({req:e,nextConfig:C,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:O,responseGenerator:d,waitUntil:a.waitUntil,isMinimalMode:s});if(!q)return null;if((null==c||null==(i=c.value)?void 0:i.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(l=c.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",S?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let x=(0,h.fromNodeOutgoingHttpHeaders)(c.value.headers);return s&&q||x.delete(f.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||x.get("Cache-Control")||x.set("Cache-Control",(0,v.getCacheControlHeader)(c.cacheControl)),await (0,p.sendResponse)(L,B,new Response(c.value.body,{headers:x,status:c.value.status||200})),null};F?await l(F):await M.withPropagatedContext(e.headers,()=>M.trace(c.BaseServerSpan.handleRequest,{spanName:`${$} ${R}`,kind:i.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},l))}catch(t){if(t instanceof x.NoFallbackError||await w.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:S})},!1,N),q)throw t;return await (0,p.sendResponse)(L,B,new Response(null,{status:500})),null}}e.s(["handler",()=>A,"patchFetch",()=>T,"routeModule",()=>w,"serverHooks",()=>b,"workAsyncStorage",()=>E,"workUnitAsyncStorage",()=>C],34335)}];
17
+
18
+ //# sourceMappingURL=%5Broot-of-the-server%5D__8a281f8d._.js.map