@shepai/cli 1.175.1-pr537.fc6a92c → 1.176.0

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 (764) hide show
  1. package/apis/json-schema/AgentConfig.yaml +0 -3
  2. package/apis/json-schema/AgentType.yaml +0 -1
  3. package/dist/packages/core/src/application/ports/output/agents/agent-executor.interface.d.ts +1 -3
  4. package/dist/packages/core/src/application/ports/output/agents/agent-executor.interface.d.ts.map +1 -1
  5. package/dist/packages/core/src/application/ports/output/agents/agent-run-repository.interface.d.ts +0 -7
  6. package/dist/packages/core/src/application/ports/output/agents/agent-run-repository.interface.d.ts.map +1 -1
  7. package/dist/packages/core/src/application/ports/output/agents/phase-timing-repository.interface.d.ts +0 -7
  8. package/dist/packages/core/src/application/ports/output/agents/phase-timing-repository.interface.d.ts.map +1 -1
  9. package/dist/packages/core/src/application/ports/output/services/index.d.ts +0 -3
  10. package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
  11. package/dist/packages/core/src/application/use-cases/agents/get-agent-session.use-case.d.ts +1 -3
  12. package/dist/packages/core/src/application/use-cases/agents/get-agent-session.use-case.d.ts.map +1 -1
  13. package/dist/packages/core/src/application/use-cases/agents/get-agent-session.use-case.js +4 -6
  14. package/dist/packages/core/src/application/use-cases/agents/list-agent-sessions.use-case.d.ts +1 -3
  15. package/dist/packages/core/src/application/use-cases/agents/list-agent-sessions.use-case.d.ts.map +1 -1
  16. package/dist/packages/core/src/application/use-cases/agents/list-agent-sessions.use-case.js +4 -6
  17. package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.js +1 -1
  18. package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts +1 -3
  19. package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts.map +1 -1
  20. package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.js +7 -9
  21. package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.js +2 -2
  22. package/dist/packages/core/src/application/use-cases/settings/check-onboarding-status.use-case.d.ts +2 -5
  23. package/dist/packages/core/src/application/use-cases/settings/check-onboarding-status.use-case.d.ts.map +1 -1
  24. package/dist/packages/core/src/application/use-cases/settings/check-onboarding-status.use-case.js +6 -28
  25. package/dist/packages/core/src/domain/generated/output.d.ts +35 -42
  26. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  27. package/dist/packages/core/src/domain/generated/output.js +1 -7
  28. package/dist/packages/core/src/infrastructure/di/container.d.ts +0 -3
  29. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  30. package/dist/packages/core/src/infrastructure/di/container.js +501 -27
  31. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.d.ts.map +1 -1
  32. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.js +2 -2
  33. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +0 -1
  34. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
  35. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +2 -6
  36. package/dist/packages/core/src/infrastructure/repositories/agent-run.repository.d.ts +0 -1
  37. package/dist/packages/core/src/infrastructure/repositories/agent-run.repository.d.ts.map +1 -1
  38. package/dist/packages/core/src/infrastructure/repositories/agent-run.repository.js +0 -8
  39. package/dist/packages/core/src/infrastructure/repositories/sqlite-phase-timing.repository.d.ts +0 -1
  40. package/dist/packages/core/src/infrastructure/repositories/sqlite-phase-timing.repository.d.ts.map +1 -1
  41. package/dist/packages/core/src/infrastructure/repositories/sqlite-phase-timing.repository.js +3 -11
  42. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
  43. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +2 -3
  44. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts.map +1 -1
  45. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.js +0 -10
  46. package/dist/packages/core/src/infrastructure/services/agents/common/agent-runner.service.d.ts.map +1 -1
  47. package/dist/packages/core/src/infrastructure/services/agents/common/agent-runner.service.js +4 -4
  48. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts +7 -3
  49. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts.map +1 -1
  50. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.js +35 -19
  51. package/dist/packages/core/src/infrastructure/services/agents/common/executors/codex-cli-executor.service.d.ts +7 -3
  52. package/dist/packages/core/src/infrastructure/services/agents/common/executors/codex-cli-executor.service.d.ts.map +1 -1
  53. package/dist/packages/core/src/infrastructure/services/agents/common/executors/codex-cli-executor.service.js +30 -17
  54. package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.d.ts +7 -3
  55. package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.d.ts.map +1 -1
  56. package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.js +34 -23
  57. package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.d.ts +7 -3
  58. package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.d.ts.map +1 -1
  59. package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.js +16 -21
  60. package/dist/packages/core/src/infrastructure/services/agents/common/executors/gemini-cli-executor.service.d.ts +7 -3
  61. package/dist/packages/core/src/infrastructure/services/agents/common/executors/gemini-cli-executor.service.d.ts.map +1 -1
  62. package/dist/packages/core/src/infrastructure/services/agents/common/executors/gemini-cli-executor.service.js +33 -21
  63. package/dist/packages/core/src/infrastructure/services/agents/common/types.d.ts +0 -5
  64. package/dist/packages/core/src/infrastructure/services/agents/common/types.d.ts.map +1 -1
  65. package/dist/packages/core/src/infrastructure/services/agents/common/types.js +1 -5
  66. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +1 -1
  67. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.js +1 -1
  68. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts.map +1 -1
  69. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.js +7 -16
  70. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +47 -44
  71. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  72. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +853 -121
  73. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.d.ts +70 -19
  74. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.d.ts.map +1 -1
  75. package/dist/packages/core/src/infrastructure/services/interactive/interactive-session.service.js +991 -44
  76. package/dist/packages/core/src/infrastructure/services/notifications/notification-watcher.service.js +3 -3
  77. package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.js +1 -1
  78. package/dist/src/presentation/cli/commands/agent/show.command.js +2 -3
  79. package/dist/src/presentation/cli/commands/feat/new.command.js +1 -1
  80. package/dist/src/presentation/cli/commands/feat/show.command.js +1 -1
  81. package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts.map +1 -1
  82. package/dist/src/presentation/tui/prompts/agent-select.prompt.js +0 -5
  83. package/dist/src/presentation/web/app/actions/agent-setup-flag.d.ts.map +1 -1
  84. package/dist/src/presentation/web/app/actions/agent-setup-flag.js +2 -3
  85. package/dist/src/presentation/web/app/actions/check-agent-auth.d.ts.map +1 -1
  86. package/dist/src/presentation/web/app/actions/check-agent-auth.js +2 -18
  87. package/dist/src/presentation/web/app/actions/get-all-agent-models.d.ts.map +1 -1
  88. package/dist/src/presentation/web/app/actions/get-all-agent-models.js +0 -2
  89. package/dist/src/presentation/web/app/actions/get-feature-phase-timings.d.ts.map +1 -1
  90. package/dist/src/presentation/web/app/actions/get-feature-phase-timings.js +3 -4
  91. package/dist/src/presentation/web/app/actions/get-supported-models.js +3 -2
  92. package/dist/src/presentation/web/app/actions/get-workflow-defaults.d.ts.map +1 -1
  93. package/dist/src/presentation/web/app/actions/get-workflow-defaults.js +2 -3
  94. package/dist/src/presentation/web/app/actions/open-ide.js +3 -2
  95. package/dist/src/presentation/web/app/actions/open-shell.d.ts.map +1 -1
  96. package/dist/src/presentation/web/app/actions/open-shell.js +0 -15
  97. package/dist/src/presentation/web/app/actions/update-model.d.ts.map +1 -1
  98. package/dist/src/presentation/web/app/actions/update-model.js +2 -3
  99. package/dist/src/presentation/web/app/api/agent-events/health/route.d.ts.map +1 -1
  100. package/dist/src/presentation/web/app/api/agent-events/health/route.js +12 -9
  101. package/dist/src/presentation/web/app/api/agent-events/route.d.ts +14 -7
  102. package/dist/src/presentation/web/app/api/agent-events/route.d.ts.map +1 -1
  103. package/dist/src/presentation/web/app/api/agent-events/route.js +301 -20
  104. package/dist/src/presentation/web/app/api/attachments/preview/route.d.ts.map +1 -1
  105. package/dist/src/presentation/web/app/api/attachments/preview/route.js +1 -5
  106. package/dist/src/presentation/web/app/api/attachments/upload/route.d.ts.map +1 -1
  107. package/dist/src/presentation/web/app/api/attachments/upload/route.js +2 -2
  108. package/dist/src/presentation/web/app/api/attachments/upload-from-path/route.d.ts.map +1 -1
  109. package/dist/src/presentation/web/app/api/attachments/upload-from-path/route.js +2 -2
  110. package/dist/src/presentation/web/app/api/cli-upgrade/route.d.ts.map +1 -1
  111. package/dist/src/presentation/web/app/api/cli-upgrade/route.js +1 -3
  112. package/dist/src/presentation/web/app/api/deployment-logs/route.d.ts.map +1 -1
  113. package/dist/src/presentation/web/app/api/deployment-logs/route.js +6 -2
  114. package/dist/src/presentation/web/app/api/dialog/pick-files/route.d.ts.map +1 -1
  115. package/dist/src/presentation/web/app/api/dialog/pick-files/route.js +2 -3
  116. package/dist/src/presentation/web/app/api/directory/list/route.d.ts.map +1 -1
  117. package/dist/src/presentation/web/app/api/directory/list/route.js +5 -8
  118. package/dist/src/presentation/web/app/api/feature-logs/route.d.ts.map +1 -1
  119. package/dist/src/presentation/web/app/api/feature-logs/route.js +6 -2
  120. package/dist/src/presentation/web/app/api/graph-data/route.d.ts +4 -1
  121. package/dist/src/presentation/web/app/api/graph-data/route.d.ts.map +1 -1
  122. package/dist/src/presentation/web/app/api/graph-data/route.js +2 -8
  123. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/mark-read/route.d.ts.map +1 -1
  124. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/mark-read/route.js +3 -2
  125. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/messages/route.d.ts.map +1 -1
  126. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/messages/route.js +10 -5
  127. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/respond/route.d.ts.map +1 -1
  128. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/respond/route.js +5 -5
  129. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stop/route.d.ts.map +1 -1
  130. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stop/route.js +3 -2
  131. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.d.ts.map +1 -1
  132. package/dist/src/presentation/web/app/api/interactive/chat/[featureId]/stream/route.js +6 -2
  133. package/dist/src/presentation/web/app/api/interactive/chat/turn-statuses/route.d.ts.map +1 -1
  134. package/dist/src/presentation/web/app/api/interactive/chat/turn-statuses/route.js +3 -2
  135. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/messages/route.d.ts.map +1 -1
  136. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/messages/route.js +10 -5
  137. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/route.d.ts.map +1 -1
  138. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/route.js +6 -3
  139. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/stream/route.d.ts.map +1 -1
  140. package/dist/src/presentation/web/app/api/interactive/sessions/[id]/stream/route.js +6 -2
  141. package/dist/src/presentation/web/app/api/interactive/sessions/route.d.ts.map +1 -1
  142. package/dist/src/presentation/web/app/api/interactive/sessions/route.js +3 -2
  143. package/dist/src/presentation/web/app/api/npm-version/route.d.ts.map +1 -1
  144. package/dist/src/presentation/web/app/api/npm-version/route.js +2 -2
  145. package/dist/src/presentation/web/app/api/sessions/route.d.ts +15 -1
  146. package/dist/src/presentation/web/app/api/sessions/route.d.ts.map +1 -1
  147. package/dist/src/presentation/web/app/api/sessions/route.js +3 -2
  148. package/dist/src/presentation/web/app/api/sessions-batch/route.d.ts +8 -1
  149. package/dist/src/presentation/web/app/api/sessions-batch/route.d.ts.map +1 -1
  150. package/dist/src/presentation/web/app/api/sessions-batch/route.js +3 -2
  151. package/dist/src/presentation/web/app/api/tools/[id]/install/route.d.ts.map +1 -1
  152. package/dist/src/presentation/web/app/api/tools/[id]/install/route.js +2 -2
  153. package/dist/src/presentation/web/app/api/tools/[id]/install/stream/route.d.ts.map +1 -1
  154. package/dist/src/presentation/web/app/api/tools/[id]/install/stream/route.js +1 -3
  155. package/dist/src/presentation/web/app/api/tools/[id]/launch/route.d.ts.map +1 -1
  156. package/dist/src/presentation/web/app/api/tools/[id]/launch/route.js +2 -2
  157. package/dist/src/presentation/web/app/api/tools/route.d.ts.map +1 -1
  158. package/dist/src/presentation/web/app/api/tools/route.js +2 -2
  159. package/dist/src/presentation/web/app/layout.d.ts.map +1 -1
  160. package/dist/src/presentation/web/app/layout.js +1 -2
  161. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.d.ts.map +1 -1
  162. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.js +0 -12
  163. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.d.ts.map +1 -1
  164. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.js +2 -2
  165. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.d.ts.map +1 -1
  166. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.js +1 -1
  167. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
  168. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +1 -1
  169. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.d.ts +1 -1
  170. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.d.ts.map +1 -1
  171. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.js +0 -2
  172. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.stories.d.ts.map +1 -1
  173. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.stories.js +0 -1
  174. package/dist/src/presentation/web/components/features/chat/ChatSheet.d.ts.map +1 -1
  175. package/dist/src/presentation/web/components/features/chat/ChatSheet.js +1 -1
  176. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/index.d.ts.map +1 -1
  177. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/index.js +3 -7
  178. package/dist/src/presentation/web/components/features/settings/ModelPicker/index.d.ts.map +1 -1
  179. package/dist/src/presentation/web/components/features/settings/ModelPicker/index.js +2 -2
  180. package/dist/src/presentation/web/components/features/settings/agent-settings-section.d.ts.map +1 -1
  181. package/dist/src/presentation/web/components/features/settings/agent-settings-section.js +0 -1
  182. package/dist/src/presentation/web/hooks/use-agent-events.js +1 -5
  183. package/dist/src/presentation/web/lib/is-same-shep-instance.d.ts.map +1 -1
  184. package/dist/src/presentation/web/lib/is-same-shep-instance.js +5 -2
  185. package/dist/translations/ar/common.json +1 -0
  186. package/dist/translations/ar/tui.json +0 -4
  187. package/dist/translations/ar/web.json +0 -1
  188. package/dist/translations/de/common.json +1 -0
  189. package/dist/translations/de/tui.json +0 -1
  190. package/dist/translations/de/web.json +0 -1
  191. package/dist/translations/en/common.json +1 -0
  192. package/dist/translations/en/tui.json +0 -4
  193. package/dist/translations/en/web.json +0 -1
  194. package/dist/translations/es/common.json +1 -0
  195. package/dist/translations/es/tui.json +0 -4
  196. package/dist/translations/es/web.json +0 -1
  197. package/dist/translations/fr/common.json +1 -0
  198. package/dist/translations/fr/tui.json +0 -4
  199. package/dist/translations/fr/web.json +0 -1
  200. package/dist/translations/he/common.json +1 -0
  201. package/dist/translations/he/tui.json +0 -4
  202. package/dist/translations/he/web.json +0 -1
  203. package/dist/translations/pt/common.json +1 -0
  204. package/dist/translations/pt/tui.json +0 -4
  205. package/dist/translations/pt/web.json +0 -1
  206. package/dist/translations/ru/common.json +1 -0
  207. package/dist/translations/ru/tui.json +0 -4
  208. package/dist/translations/ru/web.json +0 -1
  209. package/dist/translations/uk/cli.json +631 -0
  210. package/dist/translations/uk/common.json +56 -0
  211. package/dist/translations/uk/tui.json +134 -0
  212. package/dist/translations/uk/web.json +615 -0
  213. package/dist/tsconfig.build.tsbuildinfo +1 -1
  214. package/package.json +3 -7
  215. package/web/.next/BUILD_ID +1 -1
  216. package/web/.next/build-manifest.json +2 -2
  217. package/web/.next/fallback-build-manifest.json +2 -2
  218. package/web/.next/prerender-manifest.json +3 -3
  219. package/web/.next/required-server-files.js +2 -2
  220. package/web/.next/required-server-files.json +2 -2
  221. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +58 -73
  222. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +5 -5
  223. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  224. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  225. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +54 -69
  226. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +5 -5
  227. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  228. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  229. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +60 -75
  230. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +5 -5
  231. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  232. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  233. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +76 -91
  234. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +5 -5
  235. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  236. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  237. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +76 -91
  238. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +5 -5
  239. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  240. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  241. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +56 -71
  242. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +5 -5
  243. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  244. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  245. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +56 -71
  246. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +5 -5
  247. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  248. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  249. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +54 -69
  250. package/web/.next/server/app/(dashboard)/chat/page.js +5 -5
  251. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  252. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  253. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +60 -75
  254. package/web/.next/server/app/(dashboard)/create/page.js +5 -5
  255. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  256. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  257. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +76 -91
  258. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +5 -5
  259. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  260. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  261. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +76 -91
  262. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +5 -5
  263. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  264. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  265. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +54 -69
  266. package/web/.next/server/app/(dashboard)/page.js +5 -5
  267. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  268. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  269. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +56 -71
  270. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +5 -5
  271. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  272. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  273. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +56 -71
  274. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +5 -5
  275. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  276. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  277. package/web/.next/server/app/_global-error/page.js +1 -1
  278. package/web/.next/server/app/_global-error/page.js.nft.json +1 -1
  279. package/web/.next/server/app/_global-error.html +2 -2
  280. package/web/.next/server/app/_global-error.rsc +1 -1
  281. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  282. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  283. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  284. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  285. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  286. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +12 -27
  287. package/web/.next/server/app/_not-found/page.js +3 -3
  288. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  289. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  290. package/web/.next/server/app/api/agent-events/route.js +2 -2
  291. package/web/.next/server/app/api/agent-events/route.js.nft.json +1 -1
  292. package/web/.next/server/app/api/attachments/preview/route.js +1 -1
  293. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  294. package/web/.next/server/app/api/attachments/upload/route.js +1 -1
  295. package/web/.next/server/app/api/attachments/upload/route.js.nft.json +1 -1
  296. package/web/.next/server/app/api/attachments/upload-from-path/route.js +1 -1
  297. package/web/.next/server/app/api/attachments/upload-from-path/route.js.nft.json +1 -1
  298. package/web/.next/server/app/api/deployment-logs/route.js +1 -2
  299. package/web/.next/server/app/api/deployment-logs/route.js.nft.json +1 -1
  300. package/web/.next/server/app/api/directory/list/route.js +1 -1
  301. package/web/.next/server/app/api/directory/list/route.js.nft.json +1 -1
  302. package/web/.next/server/app/api/evidence/route.js +1 -1
  303. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  304. package/web/.next/server/app/api/feature-logs/route.js +1 -2
  305. package/web/.next/server/app/api/feature-logs/route.js.nft.json +1 -1
  306. package/web/.next/server/app/api/graph-data/route.js +1 -1
  307. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  308. package/web/.next/server/app/api/interactive/chat/[featureId]/mark-read/route.js +1 -1
  309. package/web/.next/server/app/api/interactive/chat/[featureId]/mark-read/route.js.nft.json +1 -1
  310. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js +1 -1
  311. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  312. package/web/.next/server/app/api/interactive/chat/[featureId]/respond/route.js +1 -1
  313. package/web/.next/server/app/api/interactive/chat/[featureId]/respond/route.js.nft.json +1 -1
  314. package/web/.next/server/app/api/interactive/chat/[featureId]/stop/route.js +1 -1
  315. package/web/.next/server/app/api/interactive/chat/[featureId]/stop/route.js.nft.json +1 -1
  316. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route.js +1 -2
  317. package/web/.next/server/app/api/interactive/chat/[featureId]/stream/route.js.nft.json +1 -1
  318. package/web/.next/server/app/api/interactive/chat/turn-statuses/route.js +1 -1
  319. package/web/.next/server/app/api/interactive/chat/turn-statuses/route.js.nft.json +1 -1
  320. package/web/.next/server/app/api/interactive/sessions/[id]/messages/route.js +1 -1
  321. package/web/.next/server/app/api/interactive/sessions/[id]/messages/route.js.nft.json +1 -1
  322. package/web/.next/server/app/api/interactive/sessions/[id]/route.js +1 -1
  323. package/web/.next/server/app/api/interactive/sessions/[id]/route.js.nft.json +1 -1
  324. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route.js +1 -2
  325. package/web/.next/server/app/api/interactive/sessions/[id]/stream/route.js.nft.json +1 -1
  326. package/web/.next/server/app/api/interactive/sessions/route.js +1 -1
  327. package/web/.next/server/app/api/interactive/sessions/route.js.nft.json +1 -1
  328. package/web/.next/server/app/api/npm-version/route.js +1 -1
  329. package/web/.next/server/app/api/npm-version/route.js.nft.json +1 -1
  330. package/web/.next/server/app/api/sessions/route.js +1 -1
  331. package/web/.next/server/app/api/sessions/route.js.nft.json +1 -1
  332. package/web/.next/server/app/api/sessions-batch/route.js +1 -1
  333. package/web/.next/server/app/api/sessions-batch/route.js.nft.json +1 -1
  334. package/web/.next/server/app/api/tools/[id]/install/route.js +1 -1
  335. package/web/.next/server/app/api/tools/[id]/install/route.js.nft.json +1 -1
  336. package/web/.next/server/app/api/tools/[id]/launch/route.js +1 -1
  337. package/web/.next/server/app/api/tools/[id]/launch/route.js.nft.json +1 -1
  338. package/web/.next/server/app/api/tools/route.js +1 -1
  339. package/web/.next/server/app/api/tools/route.js.nft.json +1 -1
  340. package/web/.next/server/app/features/page/server-reference-manifest.json +12 -27
  341. package/web/.next/server/app/features/page.js +3 -3
  342. package/web/.next/server/app/features/page.js.nft.json +1 -1
  343. package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
  344. package/web/.next/server/app/settings/page/server-reference-manifest.json +18 -33
  345. package/web/.next/server/app/settings/page.js +3 -4
  346. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  347. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  348. package/web/.next/server/app/skills/page/server-reference-manifest.json +26 -41
  349. package/web/.next/server/app/skills/page.js +4 -4
  350. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  351. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  352. package/web/.next/server/app/tools/page/server-reference-manifest.json +22 -37
  353. package/web/.next/server/app/tools/page.js +4 -4
  354. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  355. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  356. package/web/.next/server/app/version/page/server-reference-manifest.json +12 -27
  357. package/web/.next/server/app/version/page.js +4 -4
  358. package/web/.next/server/app/version/page.js.nft.json +1 -1
  359. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  360. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
  361. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
  362. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js +12 -0
  363. package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js.map +1 -0
  364. package/web/.next/server/chunks/[root-of-the-server]__0866d2b5._.js +3 -0
  365. package/web/.next/server/chunks/[root-of-the-server]__0866d2b5._.js.map +1 -0
  366. package/web/.next/server/chunks/[root-of-the-server]__10852c5c._.js +3 -0
  367. package/web/.next/server/chunks/[root-of-the-server]__10852c5c._.js.map +1 -0
  368. package/web/.next/server/chunks/[root-of-the-server]__2b1074db._.js +12 -0
  369. package/web/.next/server/chunks/[root-of-the-server]__2b1074db._.js.map +1 -0
  370. package/web/.next/server/chunks/[root-of-the-server]__2b71641f._.js +3 -0
  371. package/web/.next/server/chunks/[root-of-the-server]__2b71641f._.js.map +1 -0
  372. package/web/.next/server/chunks/[root-of-the-server]__2bb675ff._.js +3 -0
  373. package/web/.next/server/chunks/[root-of-the-server]__2bb675ff._.js.map +1 -0
  374. package/web/.next/server/chunks/[root-of-the-server]__2f61738a._.js +3 -0
  375. package/web/.next/server/chunks/[root-of-the-server]__2f61738a._.js.map +1 -0
  376. package/web/.next/server/chunks/[root-of-the-server]__31598852._.js +3 -0
  377. package/web/.next/server/chunks/[root-of-the-server]__31598852._.js.map +1 -0
  378. package/web/.next/server/chunks/[root-of-the-server]__31944fa2._.js +3 -0
  379. package/web/.next/server/chunks/[root-of-the-server]__31944fa2._.js.map +1 -0
  380. package/web/.next/server/chunks/[root-of-the-server]__32b04219._.js +3 -0
  381. package/web/.next/server/chunks/[root-of-the-server]__32b04219._.js.map +1 -0
  382. package/web/.next/server/chunks/[root-of-the-server]__332c8d91._.js +1 -1
  383. package/web/.next/server/chunks/[root-of-the-server]__332c8d91._.js.map +1 -1
  384. package/web/.next/server/chunks/[root-of-the-server]__3b72e8b0._.js +3 -0
  385. package/web/.next/server/chunks/[root-of-the-server]__3b72e8b0._.js.map +1 -0
  386. package/web/.next/server/chunks/[root-of-the-server]__4408a5ba._.js +12 -0
  387. package/web/.next/server/chunks/[root-of-the-server]__4408a5ba._.js.map +1 -0
  388. package/web/.next/server/chunks/[root-of-the-server]__6565a045._.js +3 -0
  389. package/web/.next/server/chunks/[root-of-the-server]__6565a045._.js.map +1 -0
  390. package/web/.next/server/chunks/[root-of-the-server]__8a281f8d._.js +24 -0
  391. package/web/.next/server/chunks/[root-of-the-server]__8a281f8d._.js.map +1 -0
  392. package/web/.next/server/chunks/[root-of-the-server]__8f8d6afe._.js +3 -0
  393. package/web/.next/server/chunks/[root-of-the-server]__8f8d6afe._.js.map +1 -0
  394. package/web/.next/server/chunks/[root-of-the-server]__9191749c._.js +3 -0
  395. package/web/.next/server/chunks/[root-of-the-server]__9191749c._.js.map +1 -0
  396. package/web/.next/server/chunks/[root-of-the-server]__9a136c79._.js +9 -0
  397. package/web/.next/server/chunks/[root-of-the-server]__9a136c79._.js.map +1 -0
  398. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  399. package/web/.next/server/chunks/[root-of-the-server]__ab4951b1._.js +3 -0
  400. package/web/.next/server/chunks/[root-of-the-server]__ab4951b1._.js.map +1 -0
  401. package/web/.next/server/chunks/[root-of-the-server]__acea6565._.js +3 -0
  402. package/web/.next/server/chunks/[root-of-the-server]__acea6565._.js.map +1 -0
  403. package/web/.next/server/chunks/[root-of-the-server]__b2f9a412._.js +3 -0
  404. package/web/.next/server/chunks/{[root-of-the-server]__f1aeae12._.js.map → [root-of-the-server]__b2f9a412._.js.map} +1 -1
  405. package/web/.next/server/chunks/[root-of-the-server]__b4102cc7._.js +3 -0
  406. package/web/.next/server/chunks/[root-of-the-server]__b4102cc7._.js.map +1 -0
  407. package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js +3 -0
  408. package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js.map +1 -0
  409. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +3 -0
  410. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -0
  411. package/web/.next/server/chunks/[root-of-the-server]__d2c18946._.js +3 -3
  412. package/web/.next/server/chunks/[root-of-the-server]__d2c18946._.js.map +1 -1
  413. package/web/.next/server/chunks/[root-of-the-server]__d9d410a8._.js +1 -1
  414. package/web/.next/server/chunks/[root-of-the-server]__d9d410a8._.js.map +1 -1
  415. package/web/.next/server/chunks/[root-of-the-server]__e247a485._.js +3 -3
  416. package/web/.next/server/chunks/[root-of-the-server]__e247a485._.js.map +1 -1
  417. package/web/.next/server/chunks/{[root-of-the-server]__937ba94e._.js → [root-of-the-server]__e3692208._.js} +2 -2
  418. package/web/.next/server/chunks/[root-of-the-server]__ea653642._.js +3 -0
  419. package/web/.next/server/chunks/[root-of-the-server]__ea653642._.js.map +1 -0
  420. package/web/.next/server/chunks/[root-of-the-server]__fc6fd958._.js +3 -0
  421. package/web/.next/server/chunks/[root-of-the-server]__fc6fd958._.js.map +1 -0
  422. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_ad0071c9.js +3 -0
  423. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_ad0071c9.js.map +1 -0
  424. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_90d98b2b.js +3 -0
  425. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_90d98b2b.js.map +1 -0
  426. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_d3828105.js +3 -0
  427. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_d3828105.js.map +1 -0
  428. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  429. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  430. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
  431. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  432. package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js +4 -0
  433. package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js.map +1 -0
  434. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +4 -0
  435. package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -0
  436. package/web/.next/server/chunks/ssr/{[root-of-the-server]__08e7a080._.js → [root-of-the-server]__22d17c66._.js} +2 -2
  437. package/web/.next/server/chunks/ssr/{[root-of-the-server]__08e7a080._.js.map → [root-of-the-server]__22d17c66._.js.map} +1 -1
  438. package/web/.next/server/chunks/ssr/[root-of-the-server]__23b5ca2c._.js +1 -1
  439. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +3 -0
  440. package/web/.next/server/chunks/ssr/{[root-of-the-server]__ff332bfb._.js.map → [root-of-the-server]__357d99f9._.js.map} +1 -1
  441. package/web/.next/server/chunks/ssr/[root-of-the-server]__51ec77a8._.js +3 -0
  442. package/web/.next/server/chunks/ssr/[root-of-the-server]__51ec77a8._.js.map +1 -0
  443. package/web/.next/server/chunks/ssr/[root-of-the-server]__540c615f._.js +4 -0
  444. package/web/.next/server/chunks/ssr/[root-of-the-server]__540c615f._.js.map +1 -0
  445. package/web/.next/server/chunks/ssr/[root-of-the-server]__66047a1b._.js +3 -0
  446. package/web/.next/server/chunks/ssr/[root-of-the-server]__66047a1b._.js.map +1 -0
  447. package/web/.next/server/chunks/ssr/{[root-of-the-server]__16c1388b._.js → [root-of-the-server]__69dd3217._.js} +2 -2
  448. package/web/.next/server/chunks/ssr/{[root-of-the-server]__16c1388b._.js.map → [root-of-the-server]__69dd3217._.js.map} +1 -1
  449. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js +4 -0
  450. package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js.map +1 -0
  451. package/web/.next/server/chunks/ssr/[root-of-the-server]__7528eb6f._.js +1 -1
  452. package/web/.next/server/chunks/ssr/[root-of-the-server]__a932cd3a._.js +3 -0
  453. package/web/.next/server/chunks/ssr/[root-of-the-server]__a932cd3a._.js.map +1 -0
  454. package/web/.next/server/chunks/ssr/[root-of-the-server]__aa72e794._.js +3 -0
  455. package/web/.next/server/chunks/ssr/[root-of-the-server]__aa72e794._.js.map +1 -0
  456. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +4 -0
  457. package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -0
  458. package/web/.next/server/chunks/ssr/[root-of-the-server]__d1040bd1._.js +3 -0
  459. package/web/.next/server/chunks/ssr/{[root-of-the-server]__f5614810._.js.map → [root-of-the-server]__d1040bd1._.js.map} +1 -1
  460. package/web/.next/server/chunks/ssr/[root-of-the-server]__efeeaed4._.js +3 -0
  461. package/web/.next/server/chunks/ssr/{[root-of-the-server]__d5e22d1a._.js.map → [root-of-the-server]__efeeaed4._.js.map} +1 -1
  462. package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
  463. package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
  464. package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
  465. package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
  466. package/web/.next/server/chunks/ssr/{_5747febb._.js → _1e08a336._.js} +2 -2
  467. package/web/.next/server/chunks/ssr/_1e08a336._.js.map +1 -0
  468. package/web/.next/server/chunks/ssr/{_ed2f2799._.js → _295fffde._.js} +2 -2
  469. package/web/.next/server/chunks/ssr/_295fffde._.js.map +1 -0
  470. package/web/.next/server/chunks/ssr/{_4db4ac1e._.js → _388d1127._.js} +2 -2
  471. package/web/.next/server/chunks/ssr/{_4db4ac1e._.js.map → _388d1127._.js.map} +1 -1
  472. package/web/.next/server/chunks/ssr/_45496654._.js +1 -1
  473. package/web/.next/server/chunks/ssr/_45496654._.js.map +1 -1
  474. package/web/.next/server/chunks/ssr/_4cbb7f95._.js +1 -1
  475. package/web/.next/server/chunks/ssr/_4cbb7f95._.js.map +1 -1
  476. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  477. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  478. package/web/.next/server/chunks/ssr/_6abfa39e._.js +1 -1
  479. package/web/.next/server/chunks/ssr/_6abfa39e._.js.map +1 -1
  480. package/web/.next/server/chunks/ssr/{_080b0309._.js → _8f0d3f07._.js} +2 -2
  481. package/web/.next/server/chunks/ssr/{_080b0309._.js.map → _8f0d3f07._.js.map} +1 -1
  482. package/web/.next/server/chunks/ssr/{_31b68712._.js → _98d94927._.js} +2 -2
  483. package/web/.next/server/chunks/ssr/{_31b68712._.js.map → _98d94927._.js.map} +1 -1
  484. package/web/.next/server/chunks/ssr/{_819f193a._.js → _d9c0a97a._.js} +2 -2
  485. package/web/.next/server/chunks/ssr/_d9c0a97a._.js.map +1 -0
  486. package/web/.next/server/chunks/ssr/_e680c57c._.js.map +1 -1
  487. package/web/.next/server/chunks/ssr/_f8c55130._.js +1 -1
  488. package/web/.next/server/chunks/ssr/_f8c55130._.js.map +1 -1
  489. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  490. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  491. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  492. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
  493. package/web/.next/server/chunks/ssr/src_presentation_web_17d39233._.js +3 -0
  494. package/web/.next/server/chunks/ssr/src_presentation_web_17d39233._.js.map +1 -0
  495. package/web/.next/server/chunks/ssr/src_presentation_web_54b02639._.js +5 -0
  496. package/web/.next/server/chunks/ssr/src_presentation_web_54b02639._.js.map +1 -0
  497. package/web/.next/server/chunks/ssr/src_presentation_web_7b7b9e3b._.js +5 -0
  498. package/web/.next/server/chunks/ssr/src_presentation_web_7b7b9e3b._.js.map +1 -0
  499. package/web/.next/server/chunks/ssr/src_presentation_web_807cba76._.js +3 -0
  500. package/web/.next/server/chunks/ssr/src_presentation_web_807cba76._.js.map +1 -0
  501. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_90b5e66e.js +3 -0
  502. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_90b5e66e.js.map +1 -0
  503. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_4ce30db7.js +3 -0
  504. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_4ce30db7.js.map +1 -0
  505. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_e4032193.js +3 -0
  506. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_e4032193.js.map +1 -0
  507. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
  508. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js.map +1 -1
  509. package/web/.next/server/chunks/ssr/{src_presentation_web_components_349d9f24._.js → src_presentation_web_components_895e5bfa._.js} +2 -2
  510. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -0
  511. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  512. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  513. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
  514. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
  515. package/web/.next/server/chunks/ssr/src_presentation_web_e1cd1869._.js +3 -0
  516. package/web/.next/server/chunks/ssr/src_presentation_web_e1cd1869._.js.map +1 -0
  517. package/web/.next/server/chunks/ssr/src_presentation_web_e3a30e30._.js +3 -0
  518. package/web/.next/server/chunks/ssr/src_presentation_web_e3a30e30._.js.map +1 -0
  519. package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js +1 -1
  520. package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js.map +1 -1
  521. package/web/.next/server/pages/500.html +2 -2
  522. package/web/.next/server/server-reference-manifest.js +1 -1
  523. package/web/.next/server/server-reference-manifest.json +535 -683
  524. package/web/.next/static/chunks/{10383f321355e09b.js → 0ffb3738269e15c3.js} +1 -1
  525. package/web/.next/static/chunks/236744ff71b1aadf.js +1 -0
  526. package/web/.next/static/chunks/{05c0a8ed7621ea2a.js → 2cfc6022d74e2716.js} +3 -3
  527. package/web/.next/static/chunks/302f474e4978cc80.js +3 -0
  528. package/web/.next/static/chunks/{316b0e4597f2083d.js → 46e2693dbc9262fd.js} +2 -2
  529. package/web/.next/static/chunks/{6853929058e53d1a.js → 476873a9bac35ec8.js} +1 -1
  530. package/web/.next/static/chunks/{81347e69998eef38.js → 4ff21d16947ec853.js} +1 -1
  531. package/web/.next/static/chunks/626277ca9a4cc477.js +1 -0
  532. package/web/.next/static/chunks/{a1ad19e21b6ad1ad.js → 6304540c7cf2b46a.js} +2 -2
  533. package/web/.next/static/chunks/{fd319c0e5f3cc20a.js → 71a07df9dcb42227.js} +1 -1
  534. package/web/.next/static/chunks/{71ad5a4155ddd207.js → 885bb8fc631bf477.js} +1 -1
  535. package/web/.next/static/chunks/a20f2d6f76f469b7.css +1 -0
  536. package/web/.next/static/chunks/{8bf91dcd1b3077d7.js → afa7e5d2a48cabc7.js} +1 -1
  537. package/web/.next/static/chunks/c10c0d6d458453bc.js +1 -0
  538. package/web/.next/static/chunks/{8a68402c32c6a206.js → e8444bf5f6c35f8b.js} +1 -1
  539. package/web/.next/static/chunks/eab3d361f7a24510.js +1 -0
  540. package/web/.next/static/chunks/{6bfcb5d1b3eafd81.js → eda9ee3c22b71a69.js} +1 -1
  541. package/web/.next/static/chunks/{e610f5d703696b34.js → f17d2d0279b8db35.js} +1 -1
  542. package/web/.next/static/chunks/f9d948464ed409cb.js +1 -0
  543. package/apis/json-schema/PermissionMode.yaml +0 -8
  544. package/dist/packages/core/src/application/ports/output/services/file-system.interface.d.ts +0 -68
  545. package/dist/packages/core/src/application/ports/output/services/file-system.interface.d.ts.map +0 -1
  546. package/dist/packages/core/src/application/ports/output/services/file-system.interface.js +0 -12
  547. package/dist/packages/core/src/application/ports/output/services/process-monitor.interface.d.ts +0 -29
  548. package/dist/packages/core/src/application/ports/output/services/process-monitor.interface.d.ts.map +0 -1
  549. package/dist/packages/core/src/application/ports/output/services/process-monitor.interface.js +0 -12
  550. package/dist/packages/core/src/application/ports/output/services/settings-reader.interface.d.ts +0 -35
  551. package/dist/packages/core/src/application/ports/output/services/settings-reader.interface.d.ts.map +0 -1
  552. package/dist/packages/core/src/application/ports/output/services/settings-reader.interface.js +0 -12
  553. package/dist/packages/core/src/application/use-cases/notifications/poll-agent-events.use-case.d.ts +0 -61
  554. package/dist/packages/core/src/application/use-cases/notifications/poll-agent-events.use-case.d.ts.map +0 -1
  555. package/dist/packages/core/src/application/use-cases/notifications/poll-agent-events.use-case.js +0 -381
  556. package/dist/packages/core/src/infrastructure/di/modules/agent-infrastructure.module.d.ts +0 -7
  557. package/dist/packages/core/src/infrastructure/di/modules/agent-infrastructure.module.d.ts.map +0 -1
  558. package/dist/packages/core/src/infrastructure/di/modules/agent-infrastructure.module.js +0 -83
  559. package/dist/packages/core/src/infrastructure/di/modules/database.module.d.ts +0 -12
  560. package/dist/packages/core/src/infrastructure/di/modules/database.module.d.ts.map +0 -1
  561. package/dist/packages/core/src/infrastructure/di/modules/database.module.js +0 -16
  562. package/dist/packages/core/src/infrastructure/di/modules/interactive.module.d.ts +0 -10
  563. package/dist/packages/core/src/infrastructure/di/modules/interactive.module.d.ts.map +0 -1
  564. package/dist/packages/core/src/infrastructure/di/modules/interactive.module.js +0 -43
  565. package/dist/packages/core/src/infrastructure/di/modules/notifications.module.d.ts +0 -6
  566. package/dist/packages/core/src/infrastructure/di/modules/notifications.module.d.ts.map +0 -1
  567. package/dist/packages/core/src/infrastructure/di/modules/notifications.module.js +0 -20
  568. package/dist/packages/core/src/infrastructure/di/modules/repositories.module.d.ts +0 -6
  569. package/dist/packages/core/src/infrastructure/di/modules/repositories.module.d.ts.map +0 -1
  570. package/dist/packages/core/src/infrastructure/di/modules/repositories.module.js +0 -26
  571. package/dist/packages/core/src/infrastructure/di/modules/services.module.d.ts +0 -8
  572. package/dist/packages/core/src/infrastructure/di/modules/services.module.d.ts.map +0 -1
  573. package/dist/packages/core/src/infrastructure/di/modules/services.module.js +0 -93
  574. package/dist/packages/core/src/infrastructure/di/modules/use-cases.module.d.ts +0 -6
  575. package/dist/packages/core/src/infrastructure/di/modules/use-cases.module.d.ts.map +0 -1
  576. package/dist/packages/core/src/infrastructure/di/modules/use-cases.module.js +0 -164
  577. package/dist/packages/core/src/infrastructure/di/modules/web-tokens.module.d.ts +0 -10
  578. package/dist/packages/core/src/infrastructure/di/modules/web-tokens.module.d.ts.map +0 -1
  579. package/dist/packages/core/src/infrastructure/di/modules/web-tokens.module.js +0 -200
  580. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-agent-permission-mode.d.ts +0 -14
  581. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-agent-permission-mode.d.ts.map +0 -1
  582. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-agent-permission-mode.js +0 -19
  583. package/dist/packages/core/src/infrastructure/services/agents/common/executors/abstract-agent-executor.d.ts +0 -37
  584. package/dist/packages/core/src/infrastructure/services/agents/common/executors/abstract-agent-executor.d.ts.map +0 -1
  585. package/dist/packages/core/src/infrastructure/services/agents/common/executors/abstract-agent-executor.js +0 -59
  586. package/dist/packages/core/src/infrastructure/services/agents/common/executors/rovo-dev-executor.service.d.ts +0 -52
  587. package/dist/packages/core/src/infrastructure/services/agents/common/executors/rovo-dev-executor.service.d.ts.map +0 -1
  588. package/dist/packages/core/src/infrastructure/services/agents/common/executors/rovo-dev-executor.service.js +0 -350
  589. package/dist/packages/core/src/infrastructure/services/filesystem/file-system.service.d.ts +0 -26
  590. package/dist/packages/core/src/infrastructure/services/filesystem/file-system.service.d.ts.map +0 -1
  591. package/dist/packages/core/src/infrastructure/services/filesystem/file-system.service.js +0 -47
  592. package/dist/packages/core/src/infrastructure/services/filesystem/path-sanitizers.d.ts +0 -19
  593. package/dist/packages/core/src/infrastructure/services/filesystem/path-sanitizers.d.ts.map +0 -1
  594. package/dist/packages/core/src/infrastructure/services/filesystem/path-sanitizers.js +0 -38
  595. package/dist/packages/core/src/infrastructure/services/git/branch-discovery.service.d.ts +0 -23
  596. package/dist/packages/core/src/infrastructure/services/git/branch-discovery.service.d.ts.map +0 -1
  597. package/dist/packages/core/src/infrastructure/services/git/branch-discovery.service.js +0 -185
  598. package/dist/packages/core/src/infrastructure/services/git/ci-status.service.d.ts +0 -24
  599. package/dist/packages/core/src/infrastructure/services/git/ci-status.service.d.ts.map +0 -1
  600. package/dist/packages/core/src/infrastructure/services/git/ci-status.service.js +0 -202
  601. package/dist/packages/core/src/infrastructure/services/git/diff-analyzer.service.d.ts +0 -19
  602. package/dist/packages/core/src/infrastructure/services/git/diff-analyzer.service.d.ts.map +0 -1
  603. package/dist/packages/core/src/infrastructure/services/git/diff-analyzer.service.js +0 -173
  604. package/dist/packages/core/src/infrastructure/services/git/merge-strategy.service.d.ts +0 -30
  605. package/dist/packages/core/src/infrastructure/services/git/merge-strategy.service.d.ts.map +0 -1
  606. package/dist/packages/core/src/infrastructure/services/git/merge-strategy.service.js +0 -341
  607. package/dist/packages/core/src/infrastructure/services/git/pr-creation.service.d.ts +0 -34
  608. package/dist/packages/core/src/infrastructure/services/git/pr-creation.service.d.ts.map +0 -1
  609. package/dist/packages/core/src/infrastructure/services/git/pr-creation.service.js +0 -180
  610. package/dist/packages/core/src/infrastructure/services/interactive/chat-state-builder.d.ts +0 -21
  611. package/dist/packages/core/src/infrastructure/services/interactive/chat-state-builder.d.ts.map +0 -1
  612. package/dist/packages/core/src/infrastructure/services/interactive/chat-state-builder.js +0 -112
  613. package/dist/packages/core/src/infrastructure/services/interactive/session-boot-sequence.d.ts +0 -47
  614. package/dist/packages/core/src/infrastructure/services/interactive/session-boot-sequence.d.ts.map +0 -1
  615. package/dist/packages/core/src/infrastructure/services/interactive/session-boot-sequence.js +0 -381
  616. package/dist/packages/core/src/infrastructure/services/interactive/session-state-manager.d.ts +0 -28
  617. package/dist/packages/core/src/infrastructure/services/interactive/session-state-manager.d.ts.map +0 -1
  618. package/dist/packages/core/src/infrastructure/services/interactive/session-state-manager.js +0 -105
  619. package/dist/packages/core/src/infrastructure/services/interactive/session-state.d.ts +0 -46
  620. package/dist/packages/core/src/infrastructure/services/interactive/session-state.d.ts.map +0 -1
  621. package/dist/packages/core/src/infrastructure/services/interactive/session-state.js +0 -10
  622. package/dist/packages/core/src/infrastructure/services/interactive/subscriber-notifier.d.ts +0 -36
  623. package/dist/packages/core/src/infrastructure/services/interactive/subscriber-notifier.d.ts.map +0 -1
  624. package/dist/packages/core/src/infrastructure/services/interactive/subscriber-notifier.js +0 -60
  625. package/dist/packages/core/src/infrastructure/services/interactive/turn-executor.d.ts +0 -57
  626. package/dist/packages/core/src/infrastructure/services/interactive/turn-executor.d.ts.map +0 -1
  627. package/dist/packages/core/src/infrastructure/services/interactive/turn-executor.js +0 -503
  628. package/dist/packages/core/src/infrastructure/services/process/process-monitor.service.d.ts +0 -25
  629. package/dist/packages/core/src/infrastructure/services/process/process-monitor.service.d.ts.map +0 -1
  630. package/dist/packages/core/src/infrastructure/services/process/process-monitor.service.js +0 -45
  631. package/dist/packages/core/src/infrastructure/services/settings-reader.adapter.d.ts +0 -15
  632. package/dist/packages/core/src/infrastructure/services/settings-reader.adapter.d.ts.map +0 -1
  633. package/dist/packages/core/src/infrastructure/services/settings-reader.adapter.js +0 -28
  634. package/dist/src/presentation/web/app/actions/check-agent-auth-for-type.d.ts +0 -11
  635. package/dist/src/presentation/web/app/actions/check-agent-auth-for-type.d.ts.map +0 -1
  636. package/dist/src/presentation/web/app/actions/check-agent-auth-for-type.js +0 -147
  637. package/dist/src/presentation/web/components/common/route-announcer.d.ts +0 -2
  638. package/dist/src/presentation/web/components/common/route-announcer.d.ts.map +0 -1
  639. package/dist/src/presentation/web/components/common/route-announcer.js +0 -7
  640. package/dist/src/presentation/web/components/features/settings/AgentAvailabilityBadge.d.ts +0 -7
  641. package/dist/src/presentation/web/components/features/settings/AgentAvailabilityBadge.d.ts.map +0 -1
  642. package/dist/src/presentation/web/components/features/settings/AgentAvailabilityBadge.js +0 -26
  643. package/dist/src/presentation/web/components/features/settings/AgentAvailabilityBadge.stories.d.ts +0 -11
  644. package/dist/src/presentation/web/components/features/settings/AgentAvailabilityBadge.stories.d.ts.map +0 -1
  645. package/dist/src/presentation/web/components/features/settings/AgentAvailabilityBadge.stories.js +0 -24
  646. package/dist/src/presentation/web/hooks/use-agent-availability.d.ts +0 -13
  647. package/dist/src/presentation/web/hooks/use-agent-availability.d.ts.map +0 -1
  648. package/dist/src/presentation/web/hooks/use-agent-availability.js +0 -75
  649. package/dist/src/presentation/web/hooks/use-route-announcer.d.ts +0 -2
  650. package/dist/src/presentation/web/hooks/use-route-announcer.d.ts.map +0 -1
  651. package/dist/src/presentation/web/hooks/use-route-announcer.js +0 -16
  652. package/dist/src/presentation/web/lib/api-error.d.ts +0 -7
  653. package/dist/src/presentation/web/lib/api-error.d.ts.map +0 -1
  654. package/dist/src/presentation/web/lib/api-error.js +0 -11
  655. package/web/.next/server/chunks/[root-of-the-server]__0b88f5f0._.js +0 -3
  656. package/web/.next/server/chunks/[root-of-the-server]__0b88f5f0._.js.map +0 -1
  657. package/web/.next/server/chunks/[root-of-the-server]__0d0a9973._.js +0 -3
  658. package/web/.next/server/chunks/[root-of-the-server]__0d0a9973._.js.map +0 -1
  659. package/web/.next/server/chunks/[root-of-the-server]__1f18a881._.js +0 -3
  660. package/web/.next/server/chunks/[root-of-the-server]__1f18a881._.js.map +0 -1
  661. package/web/.next/server/chunks/[root-of-the-server]__3d08be55._.js +0 -9
  662. package/web/.next/server/chunks/[root-of-the-server]__3d08be55._.js.map +0 -1
  663. package/web/.next/server/chunks/[root-of-the-server]__419be0d1._.js +0 -3
  664. package/web/.next/server/chunks/[root-of-the-server]__419be0d1._.js.map +0 -1
  665. package/web/.next/server/chunks/[root-of-the-server]__4747e669._.js +0 -3
  666. package/web/.next/server/chunks/[root-of-the-server]__4747e669._.js.map +0 -1
  667. package/web/.next/server/chunks/[root-of-the-server]__475afd97._.js +0 -3
  668. package/web/.next/server/chunks/[root-of-the-server]__475afd97._.js.map +0 -1
  669. package/web/.next/server/chunks/[root-of-the-server]__483ccc90._.js +0 -9
  670. package/web/.next/server/chunks/[root-of-the-server]__483ccc90._.js.map +0 -1
  671. package/web/.next/server/chunks/[root-of-the-server]__5e90f1e9._.js +0 -3
  672. package/web/.next/server/chunks/[root-of-the-server]__5e90f1e9._.js.map +0 -1
  673. package/web/.next/server/chunks/[root-of-the-server]__62634db9._.js +0 -12
  674. package/web/.next/server/chunks/[root-of-the-server]__62634db9._.js.map +0 -1
  675. package/web/.next/server/chunks/[root-of-the-server]__645a6d08._.js +0 -12
  676. package/web/.next/server/chunks/[root-of-the-server]__645a6d08._.js.map +0 -1
  677. package/web/.next/server/chunks/[root-of-the-server]__74f3dc5c._.js +0 -3
  678. package/web/.next/server/chunks/[root-of-the-server]__74f3dc5c._.js.map +0 -1
  679. package/web/.next/server/chunks/[root-of-the-server]__810add7c._.js +0 -3
  680. package/web/.next/server/chunks/[root-of-the-server]__810add7c._.js.map +0 -1
  681. package/web/.next/server/chunks/[root-of-the-server]__8cfd9f70._.js +0 -24
  682. package/web/.next/server/chunks/[root-of-the-server]__8cfd9f70._.js.map +0 -1
  683. package/web/.next/server/chunks/[root-of-the-server]__8ec23770._.js +0 -3
  684. package/web/.next/server/chunks/[root-of-the-server]__8ec23770._.js.map +0 -1
  685. package/web/.next/server/chunks/[root-of-the-server]__93c391fe._.js +0 -3
  686. package/web/.next/server/chunks/[root-of-the-server]__93c391fe._.js.map +0 -1
  687. package/web/.next/server/chunks/[root-of-the-server]__9e8fc40c._.js +0 -3
  688. package/web/.next/server/chunks/[root-of-the-server]__9e8fc40c._.js.map +0 -1
  689. package/web/.next/server/chunks/[root-of-the-server]__a2426aa4._.js +0 -3
  690. package/web/.next/server/chunks/[root-of-the-server]__a2426aa4._.js.map +0 -1
  691. package/web/.next/server/chunks/[root-of-the-server]__a96ee39d._.js +0 -3
  692. package/web/.next/server/chunks/[root-of-the-server]__a96ee39d._.js.map +0 -1
  693. package/web/.next/server/chunks/[root-of-the-server]__e10befc1._.js +0 -3
  694. package/web/.next/server/chunks/[root-of-the-server]__e10befc1._.js.map +0 -1
  695. package/web/.next/server/chunks/[root-of-the-server]__e94a4a75._.js +0 -3
  696. package/web/.next/server/chunks/[root-of-the-server]__e94a4a75._.js.map +0 -1
  697. package/web/.next/server/chunks/[root-of-the-server]__ea7e9dc2._.js +0 -3
  698. package/web/.next/server/chunks/[root-of-the-server]__ea7e9dc2._.js.map +0 -1
  699. package/web/.next/server/chunks/[root-of-the-server]__f1aeae12._.js +0 -3
  700. package/web/.next/server/chunks/[root-of-the-server]__f7b38c05._.js +0 -3
  701. package/web/.next/server/chunks/[root-of-the-server]__f7b38c05._.js.map +0 -1
  702. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_f57e8323.js +0 -3
  703. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_f57e8323.js.map +0 -1
  704. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_c2027d57.js +0 -3
  705. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_c2027d57.js.map +0 -1
  706. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_f70a6774.js +0 -3
  707. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_f70a6774.js.map +0 -1
  708. package/web/.next/server/chunks/ssr/[root-of-the-server]__0e34e896._.js +0 -4
  709. package/web/.next/server/chunks/ssr/[root-of-the-server]__0e34e896._.js.map +0 -1
  710. package/web/.next/server/chunks/ssr/[root-of-the-server]__1eb031d8._.js +0 -3
  711. package/web/.next/server/chunks/ssr/[root-of-the-server]__1eb031d8._.js.map +0 -1
  712. package/web/.next/server/chunks/ssr/[root-of-the-server]__35e7da6b._.js +0 -4
  713. package/web/.next/server/chunks/ssr/[root-of-the-server]__35e7da6b._.js.map +0 -1
  714. package/web/.next/server/chunks/ssr/[root-of-the-server]__36eb7673._.js +0 -3
  715. package/web/.next/server/chunks/ssr/[root-of-the-server]__36eb7673._.js.map +0 -1
  716. package/web/.next/server/chunks/ssr/[root-of-the-server]__4576a805._.js +0 -4
  717. package/web/.next/server/chunks/ssr/[root-of-the-server]__4576a805._.js.map +0 -1
  718. package/web/.next/server/chunks/ssr/[root-of-the-server]__b51b0071._.js +0 -4
  719. package/web/.next/server/chunks/ssr/[root-of-the-server]__b51b0071._.js.map +0 -1
  720. package/web/.next/server/chunks/ssr/[root-of-the-server]__bd113e97._.js +0 -4
  721. package/web/.next/server/chunks/ssr/[root-of-the-server]__bd113e97._.js.map +0 -1
  722. package/web/.next/server/chunks/ssr/[root-of-the-server]__c6f02c81._.js +0 -3
  723. package/web/.next/server/chunks/ssr/[root-of-the-server]__c6f02c81._.js.map +0 -1
  724. package/web/.next/server/chunks/ssr/[root-of-the-server]__d5e22d1a._.js +0 -3
  725. package/web/.next/server/chunks/ssr/[root-of-the-server]__f13f6a81._.js +0 -3
  726. package/web/.next/server/chunks/ssr/[root-of-the-server]__f13f6a81._.js.map +0 -1
  727. package/web/.next/server/chunks/ssr/[root-of-the-server]__f5614810._.js +0 -3
  728. package/web/.next/server/chunks/ssr/[root-of-the-server]__ff332bfb._.js +0 -3
  729. package/web/.next/server/chunks/ssr/_5747febb._.js.map +0 -1
  730. package/web/.next/server/chunks/ssr/_819f193a._.js.map +0 -1
  731. package/web/.next/server/chunks/ssr/_ed2f2799._.js.map +0 -1
  732. package/web/.next/server/chunks/ssr/src_presentation_web_064c7e73._.js +0 -3
  733. package/web/.next/server/chunks/ssr/src_presentation_web_064c7e73._.js.map +0 -1
  734. package/web/.next/server/chunks/ssr/src_presentation_web_1726dc84._.js +0 -5
  735. package/web/.next/server/chunks/ssr/src_presentation_web_1726dc84._.js.map +0 -1
  736. package/web/.next/server/chunks/ssr/src_presentation_web_28c682ee._.js +0 -3
  737. package/web/.next/server/chunks/ssr/src_presentation_web_28c682ee._.js.map +0 -1
  738. package/web/.next/server/chunks/ssr/src_presentation_web_2d7b0e7b._.js +0 -5
  739. package/web/.next/server/chunks/ssr/src_presentation_web_2d7b0e7b._.js.map +0 -1
  740. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_bcef11e0.js +0 -3
  741. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_bcef11e0.js.map +0 -1
  742. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_02d5029f.js +0 -3
  743. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_02d5029f.js.map +0 -1
  744. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_67ca1f81.js +0 -3
  745. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_67ca1f81.js.map +0 -1
  746. package/web/.next/server/chunks/ssr/src_presentation_web_b1110b54._.js +0 -3
  747. package/web/.next/server/chunks/ssr/src_presentation_web_b1110b54._.js.map +0 -1
  748. package/web/.next/server/chunks/ssr/src_presentation_web_components_349d9f24._.js.map +0 -1
  749. package/web/.next/server/chunks/ssr/src_presentation_web_d388fcb0._.js +0 -3
  750. package/web/.next/server/chunks/ssr/src_presentation_web_d388fcb0._.js.map +0 -1
  751. package/web/.next/server/chunks/ssr/src_presentation_web_da61a4f3._.js +0 -3
  752. package/web/.next/server/chunks/ssr/src_presentation_web_da61a4f3._.js.map +0 -1
  753. package/web/.next/static/chunks/1f232a3618b82ac1.css +0 -1
  754. package/web/.next/static/chunks/2621b35c0c9da177.js +0 -1
  755. package/web/.next/static/chunks/2a3edcf98f609bb7.js +0 -1
  756. package/web/.next/static/chunks/3370f8dc24c64ce4.js +0 -1
  757. package/web/.next/static/chunks/47ed89fae0f1542e.js +0 -1
  758. package/web/.next/static/chunks/6c1664f584f34e6f.js +0 -1
  759. package/web/.next/static/chunks/f952f152ac0a4abe.js +0 -3
  760. package/web/public/icons/agents/rovo-dev.svg +0 -6
  761. /package/web/.next/server/chunks/{[root-of-the-server]__937ba94e._.js.map → [root-of-the-server]__e3692208._.js.map} +0 -0
  762. /package/web/.next/static/{8CNKMABoDvNDVQD3DEuB4 → 36ONyC02R4wfFe7iWMQLU}/_buildManifest.js +0 -0
  763. /package/web/.next/static/{8CNKMABoDvNDVQD3DEuB4 → 36ONyC02R4wfFe7iWMQLU}/_clientMiddlewareManifest.json +0 -0
  764. /package/web/.next/static/{8CNKMABoDvNDVQD3DEuB4 → 36ONyC02R4wfFe7iWMQLU}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/lib/api-error.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/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 { NextResponse } from 'next/server';\n\n/**\n * Create a sanitized error response. Logs full error server-side,\n * returns only a safe message to the client.\n */\nexport function apiError(error: unknown, status = 500, publicMessage?: string): NextResponse {\n // eslint-disable-next-line no-console\n console.error('[API Error]', error);\n\n const message =\n publicMessage ?? (error instanceof Error ? error.message : 'Internal server error');\n\n return NextResponse.json({ error: message }, { status });\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]/stream/route\",\n pathname: \"/api/interactive/chat/[featureId]/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/chat/[featureId]/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/chat/[featureId]/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 * Feature-scoped SSE stream for real-time chat updates.\n *\n * Resolves the active session for the feature internally.\n * Emits:\n * - `delta` events with token chunks\n * - `log` events for tool use / thinking\n * - `done` events at end-of-turn\n *\n * `featureId` is a polymorphic scope key: a feature UUID, \"repo-<id>\", or \"global\".\n */\n\nimport type { NextRequest } from 'next/server';\nimport { apiError } from '@/lib/api-error';\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 GET(request: NextRequest, { params }: RouteParams): Promise<Response> {\n const { featureId } = await params;\n\n try {\n // SSE streams use service directly for subscribe pattern\n const service = resolve<IInteractiveSessionService>('IInteractiveSessionService');\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 enqueue(': connected\\n\\n');\n\n const heartbeat = setInterval(() => {\n enqueue(': heartbeat\\n\\n');\n }, 15_000);\n\n const unsubscribe = service.subscribeByFeature(featureId, (chunk) => {\n if (chunk.done) {\n enqueue(`event: done\\ndata: ${JSON.stringify({ done: true, featureId })}\\n\\n`);\n } else if (chunk.interaction) {\n // Agent is asking the user a question — emit interaction event\n enqueue(\n `event: interaction\\ndata: ${JSON.stringify({ interaction: chunk.interaction, featureId })}\\n\\n`\n );\n if (chunk.log) {\n enqueue(`event: log\\ndata: ${JSON.stringify({ log: chunk.log, featureId })}\\n\\n`);\n }\n } else if (chunk.activity) {\n enqueue(\n `event: activity\\ndata: ${JSON.stringify({ activity: chunk.activity, featureId })}\\n\\n`\n );\n // Also send log for the status indicator\n if (chunk.log) {\n enqueue(`event: log\\ndata: ${JSON.stringify({ log: chunk.log, featureId })}\\n\\n`);\n }\n } else if (chunk.log) {\n enqueue(`event: log\\ndata: ${JSON.stringify({ log: chunk.log, featureId })}\\n\\n`);\n } else if (chunk.delta) {\n enqueue(`event: delta\\ndata: ${JSON.stringify({ delta: chunk.delta, featureId })}\\n\\n`);\n }\n });\n\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 return apiError(error);\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,OAMO,SAAS,EAAS,CAAc,CAAE,EAAS,GAAG,CAAE,CAAsB,EAE3E,QAAQ,KAAK,CAAC,cAAe,GAE7B,IAAM,EACJ,IAAkB,aAAD,AAAkB,MAAQ,EAAM,OAAO,CAAG,uBAAA,CAAuB,CAEpF,OAAO,EAAA,YAAY,CAAC,IAAI,CAAC,CAAE,MAAO,CAAQ,EAAG,QAAE,CAAO,EACxD,iDCdA,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,OCHA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OASO,eAAe,EAAI,CAAoB,CAAE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J,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":[2]}
@@ -1,3 +0,0 @@
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"))},51374,e=>{"use strict";var t=e.i(27980);function r(e,a=500,n){console.error("[API Error]",e);let s=n??(e instanceof Error?e.message:"Internal server error");return t.NextResponse.json({error:s},{status:a})}e.s(["apiError",()=>r])},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},66680,(e,t,r)=>{t.exports=e.x("node:crypto",()=>require("node:crypto"))},55042,e=>{"use strict";var t=e.i(66680),r=e.i(60526),a=e.i(50227),n=e.i(12714);function s(e){return e.replace(/[/\\.]/g,"-")}function i(e){if("string"==typeof e)return e;if(Array.isArray(e)){for(let t of e)if("object"==typeof t&&null!==t&&"text"===t.type&&"string"==typeof t.text)return t.text}return null}async function o(e){let t;try{t=await (0,n.readdir)(e)}catch{return[]}let r=t.filter(e=>e.endsWith(".jsonl"));return(await Promise.allSettled(r.map(async t=>{let r=(0,a.join)(e,t),s=await (0,n.stat)(r);return{name:t,filePath:r,mtime:s.mtime.getTime()}}))).filter(e=>"fulfilled"===e.status).map(e=>e.value)}async function l(t,r,a,n){let{createReadStream:s}=await e.A(6714),o=r.replace(".jsonl",""),l=null,u=null,c=0,d=await new Promise(e=>{let r=[],a=0,n=s(t,{end:8191});n.on("data",e=>{r.push(e),a+=e.length}),n.on("end",()=>e(Buffer.concat(r,a).toString("utf-8"))),n.on("error",()=>e(""))});if(!d)return null;for(let e of d.split("\n").filter(e=>e.trim()))try{let t=JSON.parse(e);if("user"===t.type||"assistant"===t.type){let e=t.message?.role;("user"===e||"assistant"===e)&&(c++,t.timestamp&&(u??=t.timestamp),"user"===e&&null===l&&(l=i(t.message?.content)))}}catch{break}if(0===c)return null;let p=new Date(a).toISOString();return{id:o,agentType:"claude-code",preview:l,messageCount:c,firstMessageAt:u,lastMessageAt:p,createdAt:u??p,projectPath:n,filePath:t,_mtime:a}}async function u(e,i,c=!1){let d=s(e),p=(0,a.join)((0,r.homedir)(),".claude","projects"),m=(0,a.join)(p,d),f=await o(m);if(c)try{let i=await (0,n.readdir)(p),l=i.filter(e=>e!==d&&e.startsWith(d)),u=e.replace(/\\/g,"/"),c=(0,t.createHash)("sha256").update(u).digest("hex").slice(0,16),m=(0,a.join)((0,r.homedir)(),".shep").replace(/\\/g,"/"),h=s((0,a.join)(m,"repos",c)),x=i.filter(e=>e.startsWith(h)&&!l.includes(e)&&e!==d),g=[...l,...x];for(let e of(await Promise.all(g.map(e=>o((0,a.join)(p,e))))))f=f.concat(e)}catch{}let h=f.sort((e,t)=>t.mtime-e.mtime).slice(0,i);return(await Promise.allSettled(h.map(async t=>l(t.filePath,t.name,t.mtime,e)))).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e)}async function c(t,r,a,n){let{createReadStream:s}=await e.A(6714),o=r.replace(".jsonl",""),l=await new Promise(e=>{let r=[],a=0,n=s(t,{end:8191});n.on("data",e=>{r.push(e),a+=e.length}),n.on("end",()=>e(Buffer.concat(r,a).toString("utf-8"))),n.on("error",()=>e(""))});if(!l)return null;let u=null,c=0;for(let e of l.split("\n").filter(e=>e.trim()))try{let t=JSON.parse(e);("user"===t.role||"assistant"===t.role)&&(c++,"user"===t.role&&null===u&&(u=i(t.message?.content)))}catch{break}if(0===c)return null;let d=new Date(a).toISOString();return{id:o,agentType:"cursor",preview:u,messageCount:c,firstMessageAt:d,lastMessageAt:d,createdAt:d,projectPath:n,filePath:t,_mtime:a}}async function d(e,t){let s,i=e.replace(/^\//,"").replace(/\./g,"").replace(/[/\\]/g,"-"),o=(0,a.join)((0,r.homedir)(),".cursor","projects",i,"agent-transcripts");try{s=await (0,n.readdir)(o)}catch{return[]}let l=(await Promise.allSettled(s.map(async e=>{let t=(0,a.join)(o,e),r=await (0,n.stat)(t);if(r.isFile()&&e.endsWith(".jsonl"))return{name:e,filePath:t,mtime:r.mtime.getTime()};if(r.isDirectory()){let r=(0,a.join)(t,`${e}.jsonl`);try{let t=await (0,n.stat)(r);return{name:`${e}.jsonl`,filePath:r,mtime:t.mtime.getTime()}}catch{}}return null}))).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e).sort((e,t)=>t.mtime-e.mtime).slice(0,t);return(await Promise.allSettled(l.map(async t=>c(t.filePath,t.name,t.mtime,e)))).filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>null!==e)}async function p(e,t,r=!1){let[a,n]=await Promise.all([u(e,t,r),d(e,t)]);return[...a,...n].sort((e,t)=>t._mtime-e._mtime).slice(0,Math.min(t,50))}e.s(["scanSessionsForPath",()=>p])},87913,e=>{"use strict";var t=e.i(22925),r=e.i(62995),a=e.i(14112),n=e.i(31716),s=e.i(16340),i=e.i(40522),o=e.i(21994),l=e.i(5802),u=e.i(17171),c=e.i(177),d=e.i(43685),p=e.i(84832),m=e.i(92435),f=e.i(41260),h=e.i(80556),x=e.i(93695);e.i(97230);var g=e.i(35162),y=e.i(27980),w=e.i(51374),v=e.i(55042);async function R(e){let t=new URL(e.url),r=t.searchParams.get("repositoryPath"),a=parseInt(t.searchParams.get("limit")??"10",10),n="true"===t.searchParams.get("includeWorktrees");if(!r?.trim())return y.NextResponse.json({error:"repositoryPath is required"},{status:400});try{let e=await (0,v.scanSessionsForPath)(r,a,n);return y.NextResponse.json({sessions:e.map(({_mtime:e,...t})=>t)})}catch(e){return(0,w.apiError)(e)}}e.s(["GET",()=>R,"dynamic",0,"force-dynamic"],17276);var E=e.i(17276);let P=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/sessions/route",pathname:"/api/sessions",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/sessions/route.ts",nextConfigOutput:"",userland:E}),{workAsyncStorage:j,workUnitAsyncStorage:A,serverHooks:C}=P;function S(){return(0,a.patchFetch)({workAsyncStorage:j,workUnitAsyncStorage:A})}async function b(e,t,a){P.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let y="/api/sessions/route";y=y.replace(/\/index$/,"")||"/";let w=await P.prepare(e,t,{srcPage:y,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:v,params:R,nextConfig:E,parsedUrl:j,isDraftMode:A,prerenderManifest:C,routerServerContext:S,isOnDemandRevalidate:b,revalidateOnlyGenerated:T,resolvedPathname:N,clientReferenceManifest:_,serverActionsManifest:k}=w,q=(0,o.normalizeAppPath)(y),O=!!(C.dynamicRoutes[q]||C.routes[N]),I=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,j,!1):t.end("This page could not be found"),null);if(O&&!A){let e=!!C.routes[N],t=C.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await I();throw new x.NoFallbackError}}let H=null;!O||P.isDev||A||(H="/index"===(H=N)?"/":H);let M=!0===P.isDev||!O,U=O&&!M;k&&_&&(0,i.setManifestsSingleton)({page:y,clientReferenceManifest:_,serverActionsManifest:k});let D=e.method||"GET",F=(0,s.getTracer)(),$=F.getActiveScopeSpan(),K={params:R,prerenderManifest:C,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:M,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>P.onRequestError(e,t,a,n,S)},sharedContext:{buildId:v}},B=new l.NodeNextRequest(e),W=new l.NodeNextResponse(t),L=u.NextRequestAdapter.fromNodeNextRequest(B,(0,u.signalFromNodeResponse)(t));try{let i=async e=>P.handle(L,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.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=`${D} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${D} ${y}`)}),o=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var s,l;let u=async({previousCacheEntry:r})=>{try{if(!o&&b&&T&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await i(n);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let u=K.renderOpts.collectedTags;if(!O)return await (0,p.sendResponse)(B,W,s,K.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(s.headers);u&&(t[h.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await P.onRequestError(e,t,{routerKind:"App Router",routePath:y,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:b})},!1,S),t}},c=await P.handleResponse({req:e,nextConfig:E,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:b,revalidateOnlyGenerated:T,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:o});if(!O)return null;if((null==c||null==(s=c.value)?void 0:s.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});o||t.setHeader("x-nextjs-cache",b?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let x=(0,m.fromNodeOutgoingHttpHeaders)(c.value.headers);return o&&O||x.delete(h.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||x.get("Cache-Control")||x.set("Cache-Control",(0,f.getCacheControlHeader)(c.cacheControl)),await (0,p.sendResponse)(B,W,new Response(c.value.body,{headers:x,status:c.value.status||200})),null};$?await l($):await F.withPropagatedContext(e.headers,()=>F.trace(c.BaseServerSpan.handleRequest,{spanName:`${D} ${y}`,kind:s.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},l))}catch(t){if(t instanceof x.NoFallbackError||await P.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:b})},!1,S),O)throw t;return await (0,p.sendResponse)(B,W,new Response(null,{status:500})),null}}e.s(["handler",()=>b,"patchFetch",()=>S,"routeModule",()=>P,"serverHooks",()=>C,"workAsyncStorage",()=>j,"workUnitAsyncStorage",()=>A],87913)},6714,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_node:fs_ddf6f167._.js"].map(t=>e.l(t))).then(()=>t(2157)))}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__8ec23770._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/api-error.ts","../../../../../../src/presentation/web/lib/session-scanner.ts","../../../../../../src/presentation/web/app/api/sessions/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":["import { NextResponse } from 'next/server';\n\n/**\n * Create a sanitized error response. Logs full error server-side,\n * returns only a safe message to the client.\n */\nexport function apiError(error: unknown, status = 500, publicMessage?: string): NextResponse {\n // eslint-disable-next-line no-console\n console.error('[API Error]', error);\n\n const message =\n publicMessage ?? (error instanceof Error ? error.message : 'Internal server error');\n\n return NextResponse.json({ error: message }, { status });\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 { apiError } from '@/lib/api-error';\nimport { scanSessionsForPath } from '@/lib/session-scanner';\n\nexport const dynamic = 'force-dynamic';\n\n/**\n * GET /api/sessions?repositoryPath=<path>&limit=<n>\n *\n * Returns agent sessions from all supported providers (Claude Code, Cursor)\n * filtered by repository path, merged and sorted by recency.\n */\nexport async function GET(request: Request) {\n const url = new URL(request.url);\n const repositoryPath = url.searchParams.get('repositoryPath');\n const limit = parseInt(url.searchParams.get('limit') ?? '10', 10);\n const includeWorktrees = url.searchParams.get('includeWorktrees') === 'true';\n\n if (!repositoryPath?.trim()) {\n return NextResponse.json({ error: 'repositoryPath is required' }, { status: 400 });\n }\n\n try {\n const allSessions = await scanSessionsForPath(repositoryPath, limit, includeWorktrees);\n\n return NextResponse.json({\n sessions: allSessions.map(({ _mtime, ...s }) => s),\n });\n } catch (error) {\n return apiError(error);\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/route\",\n pathname: \"/api/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/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/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"],"names":[],"mappings":"m/BAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OAMO,SAAS,EAAS,CAAc,CAAE,EAAS,GAAG,CAAE,CAAsB,EAE3E,QAAQ,KAAK,CAAC,cAAe,GAE7B,IAAM,EACJ,GAAkB,cAAD,AAAkB,MAAQ,EAAM,OAAO,CAAG,uBAAA,CAAuB,CAEpF,OAAO,EAAA,YAAY,CAAC,IAAI,CAAC,CAAE,MAAO,CAAQ,EAAG,CAAE,QAAO,EACxD,mVCPA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA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AC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,EAEA,qCAAqC","ignoreList":[3]}
@@ -1,3 +0,0 @@
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"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},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])},51374,e=>{"use strict";var t=e.i(27980);function r(e,n=500,a){console.error("[API Error]",e);let s=a??(e instanceof Error?e.message:"Internal server error");return t.NextResponse.json({error:s},{status:n})}e.s(["apiError",()=>r])},32828,e=>{"use strict";e.i(12714);var t=e.i(60526),r=e.i(50227);function n(){return process.env.SHEP_HOME??(0,r.join)((0,t.homedir)(),".shep")}e.i(2157),e.s(["getShepHomeDir",()=>n])},24183,e=>{"use strict";var t=e.i(22925),r=e.i(62995),n=e.i(14112),a=e.i(31716),s=e.i(16340),o=e.i(40522),i=e.i(21994),l=e.i(5802),u=e.i(17171),d=e.i(177),p=e.i(43685),c=e.i(84832),h=e.i(92435),x=e.i(41260),v=e.i(80556),f=e.i(93695);e.i(97230);var g=e.i(35162),m=e.i(27980),R=e.i(51374),E=e.i(40060),w=e.i(32828);async function y(e,{params:t}){try{let{featureId:r}=await t,{content:n,worktreePath:a,model:s,agentType:o}=await e.json();if(!n||"string"!=typeof n||0===n.trim().length)return m.NextResponse.json({error:"content must be a non-empty string"},{status:400});if(Buffer.byteLength(n,"utf8")>32768)return m.NextResponse.json({error:"content exceeds maximum size of 32 KB"},{status:400});let i=a;i&&"string"==typeof i||(i=(0,w.getShepHomeDir)());let l=(0,E.resolve)("SendInteractiveMessageUseCase"),u=await l.execute({featureId:r,content:n,worktreePath:i,model:"string"==typeof s?s:void 0,agentType:"string"==typeof o?o:void 0});return m.NextResponse.json({message:u},{status:201})}catch(e){if(e instanceof Error&&e.message.includes("concurrent session limit"))return(0,R.apiError)(e,429,"Concurrent session limit reached");return(0,R.apiError)(e)}}async function C(e,{params:t}){try{let{featureId:e}=await t,r=(0,E.resolve)("IInteractiveSessionService");return await r.clearMessages(e),m.NextResponse.json({ok:!0})}catch(e){return(0,R.apiError)(e)}}async function b(e,{params:t}){try{let{featureId:e}=await t,r=(0,E.resolve)("GetInteractiveChatStateUseCase"),n=await r.execute({featureId:e});return m.NextResponse.json(n)}catch(e){return(0,R.apiError)(e)}}e.s(["DELETE",()=>C,"GET",()=>b,"POST",()=>y,"dynamic",0,"force-dynamic"],45502);var A=e.i(45502);let N=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/interactive/chat/[featureId]/messages/route",pathname:"/api/interactive/chat/[featureId]/messages",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/interactive/chat/[featureId]/messages/route.ts",nextConfigOutput:"",userland:A}),{workAsyncStorage:T,workUnitAsyncStorage:I,serverHooks:P}=N;function S(){return(0,n.patchFetch)({workAsyncStorage:T,workUnitAsyncStorage:I})}async function j(e,t,n){N.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/interactive/chat/[featureId]/messages/route";m=m.replace(/\/index$/,"")||"/";let R=await N.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:E,params:w,nextConfig:y,parsedUrl:C,isDraftMode:b,prerenderManifest:A,routerServerContext:T,isOnDemandRevalidate:I,revalidateOnlyGenerated:P,resolvedPathname:S,clientReferenceManifest:j,serverActionsManifest:q}=R,k=(0,i.normalizeAppPath)(m),O=!!(A.dynamicRoutes[k]||A.routes[S]),_=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,C,!1):t.end("This page could not be found"),null);if(O&&!b){let e=!!A.routes[S],t=A.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(y.experimental.adapterPath)return await _();throw new f.NoFallbackError}}let H=null;!O||N.isDev||b||(H="/index"===(H=S)?"/":H);let U=!0===N.isDev||!O,D=O&&!U;q&&j&&(0,o.setManifestsSingleton)({page:m,clientReferenceManifest:j,serverActionsManifest:q});let M=e.method||"GET",K=(0,s.getTracer)(),$=K.getActiveScopeSpan(),F={params:w,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:y.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>N.onRequestError(e,t,n,a,T)},sharedContext:{buildId:E}},L=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),G=u.NextRequestAdapter.fromNodeNextRequest(L,(0,u.signalFromNodeResponse)(t));try{let o=async e=>N.handle(G,F).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=K.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.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} ${m}`)}),i=!!(0,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var s,l;let u=async({previousCacheEntry:r})=>{try{if(!i&&I&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(a);e.fetchMetrics=F.renderOpts.fetchMetrics;let l=F.renderOpts.pendingWaitUntil;l&&n.waitUntil&&(n.waitUntil(l),l=void 0);let u=F.renderOpts.collectedTags;if(!O)return await (0,c.sendResponse)(L,B,s,F.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);u&&(t[v.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==F.renderOpts.collectedRevalidate&&!(F.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&F.renderOpts.collectedRevalidate,n=void 0===F.renderOpts.collectedExpire||F.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:F.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:I})},!1,T),t}},d=await N.handleResponse({req:e,nextConfig:y,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:P,responseGenerator:u,waitUntil:n.waitUntil,isMinimalMode:i});if(!O)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});i||t.setHeader("x-nextjs-cache",I?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return i&&O||f.delete(v.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,x.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(L,B,new Response(d.value.body,{headers:f,status:d.value.status||200})),null};$?await l($):await K.withPropagatedContext(e.headers,()=>K.trace(d.BaseServerSpan.handleRequest,{spanName:`${M} ${m}`,kind:s.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof f.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:I})},!1,T),O)throw t;return await (0,c.sendResponse)(L,B,new Response(null,{status:500})),null}}e.s(["handler",()=>j,"patchFetch",()=>S,"routeModule",()=>N,"serverHooks",()=>P,"workAsyncStorage",()=>T,"workUnitAsyncStorage",()=>I],24183)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__93c391fe._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/lib/api-error.ts","../../../../../../packages/core/src/infrastructure/services/filesystem/shep-directory.service.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/messages/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 { NextResponse } from 'next/server';\n\n/**\n * Create a sanitized error response. Logs full error server-side,\n * returns only a safe message to the client.\n */\nexport function apiError(error: unknown, status = 500, publicMessage?: string): NextResponse {\n // eslint-disable-next-line no-console\n console.error('[API Error]', error);\n\n const message =\n publicMessage ?? (error instanceof Error ? error.message : 'Internal server error');\n\n return NextResponse.json({ error: message }, { status });\n}\n","/**\n * Shep Directory Service\n *\n * Manages the ~/.shep/ directory for global settings and data storage.\n * Ensures directory exists with correct permissions before database operations.\n *\n * Supports SHEP_HOME env var for test isolation (overrides default ~/.shep/).\n */\n\nimport { mkdir } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { existsSync } from 'node:fs';\n\n/**\n * Resolves the Shep home directory.\n * Respects SHEP_HOME env var for test isolation, falls back to ~/.shep/\n */\nfunction resolveShepHomeDir(): string {\n return process.env.SHEP_HOME ?? join(homedir(), '.shep');\n}\n\n/**\n * Gets the path to the Shep home directory.\n * Uses SHEP_HOME env var if set, otherwise ~/.shep/\n *\n * @returns Path to shep home directory\n */\nexport function getShepHomeDir(): string {\n return resolveShepHomeDir();\n}\n\n/**\n * Gets the path to the SQLite database file.\n *\n * @returns Path to the database file\n */\nexport function getShepDbPath(): string {\n return join(resolveShepHomeDir(), 'data');\n}\n\n/**\n * Gets the path to the daemon state file.\n * Uses SHEP_HOME env var if set (for test isolation), otherwise ~/.shep/daemon.json\n *\n * @returns Path to daemon.json\n */\nexport function getDaemonStatePath(): string {\n return join(resolveShepHomeDir(), 'daemon.json');\n}\n\n/**\n * Gets the path to the daemon log file.\n * Uses SHEP_HOME env var if set (for test isolation), otherwise ~/.shep/daemon.log\n *\n * @returns Path to daemon.log\n */\nexport function getDaemonLogPath(): string {\n return join(resolveShepHomeDir(), 'daemon.log');\n}\n\n/**\n * Ensures the shep home directory exists with correct permissions.\n * Creates the directory if it doesn't exist.\n * Safe to call multiple times (idempotent).\n *\n * Permissions: 700 (rwx------) - only owner can read/write/execute\n *\n * @throws Error if directory cannot be created (permissions, disk space, etc.)\n */\nexport async function ensureShepDirectory(): Promise<void> {\n const shepDir = resolveShepHomeDir();\n\n if (existsSync(shepDir)) {\n return;\n }\n\n try {\n await mkdir(shepDir, {\n recursive: true,\n mode: 0o700,\n });\n } catch (error) {\n throw new Error(\n `Failed to create Shep directory at ${shepDir}: ${error instanceof Error ? error.message : String(error)}`\n );\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/interactive/chat/[featureId]/messages/route\",\n pathname: \"/api/interactive/chat/[featureId]/messages\",\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]/messages/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]/messages/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 * Feature-scoped chat messages API.\n *\n * POST - Send a user message. Backend handles session lifecycle.\n * GET - Get chat state: messages + session status + streaming text.\n * DELETE - Clear chat message history for the feature.\n *\n * The frontend never manages sessions — it just sends messages for a feature.\n *\n * `featureId` is a polymorphic scope key: a feature UUID, \"repo-<id>\", or \"global\".\n */\n\nimport type { NextRequest } from 'next/server';\nimport { NextResponse } from 'next/server';\nimport { apiError } from '@/lib/api-error';\nimport { resolve } from '@/lib/server-container';\nimport type { SendInteractiveMessageUseCase } from '@shepai/core/application/use-cases/interactive/send-interactive-message.use-case';\nimport type { GetInteractiveChatStateUseCase } from '@shepai/core/application/use-cases/interactive/get-interactive-chat-state.use-case';\nimport type { IInteractiveSessionService } from '@shepai/core/application/ports/output/services/interactive-session-service.interface';\nimport { getShepHomeDir } from '@shepai/core/infrastructure/services/filesystem/shep-directory.service';\n\nexport const dynamic = 'force-dynamic';\n\nconst MAX_CONTENT_BYTES = 32 * 1024;\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 body = (await request.json()) as {\n content?: string;\n worktreePath?: string;\n model?: string;\n agentType?: string;\n };\n const { content, worktreePath, model, agentType } = body;\n\n if (!content || typeof content !== 'string' || content.trim().length === 0) {\n return NextResponse.json({ error: 'content must be a non-empty string' }, { status: 400 });\n }\n\n if (Buffer.byteLength(content, 'utf8') > MAX_CONTENT_BYTES) {\n return NextResponse.json({ error: 'content exceeds maximum size of 32 KB' }, { status: 400 });\n }\n\n // worktreePath is optional — defaults to SHEP_HOME for global/repo sessions\n let resolvedWorktreePath = worktreePath;\n if (!resolvedWorktreePath || typeof resolvedWorktreePath !== 'string') {\n resolvedWorktreePath = getShepHomeDir();\n }\n\n const useCase = resolve<SendInteractiveMessageUseCase>('SendInteractiveMessageUseCase');\n const message = await useCase.execute({\n featureId,\n content,\n worktreePath: resolvedWorktreePath,\n model: typeof model === 'string' ? model : undefined,\n agentType: typeof agentType === 'string' ? agentType : undefined,\n });\n\n return NextResponse.json({ message }, { status: 201 });\n } catch (error) {\n if (error instanceof Error && error.message.includes('concurrent session limit')) {\n return apiError(error, 429, 'Concurrent session limit reached');\n }\n return apiError(error);\n }\n}\n\nexport async function DELETE(\n _request: NextRequest,\n { params }: RouteParams\n): Promise<NextResponse> {\n try {\n const { featureId } = await params;\n // clearMessages is not yet exposed as a use case — use service directly\n const service = resolve<IInteractiveSessionService>('IInteractiveSessionService');\n await service.clearMessages(featureId);\n\n return NextResponse.json({ ok: true });\n } catch (error) {\n return apiError(error);\n }\n}\n\nexport async function GET(_request: NextRequest, { params }: RouteParams): Promise<NextResponse> {\n try {\n const { featureId } = await params;\n const useCase = resolve<GetInteractiveChatStateUseCase>('GetInteractiveChatStateUseCase');\n const chatState = await useCase.execute({ featureId });\n\n return NextResponse.json(chatState);\n } catch (error) {\n return apiError(error);\n }\n}\n"],"names":[],"mappings":"4wCAuBO,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,OAMO,SAAS,EAAS,CAAc,CAAE,EAAS,GAAG,CAAE,CAAsB,EAE3E,QAAQ,KAAK,CAAC,cAAe,GAE7B,IAAM,EACJ,IAAkB,aAAD,AAAkB,MAAQ,EAAM,OAAO,CAAG,uBAAA,CAAuB,CAEpF,OAAO,EAAA,YAAY,CAAC,IAAI,CAAC,CAAE,MAAO,CAAQ,EAAG,QAAE,CAAO,EACxD,iDCLA,EAAA,CAAA,CAAA,OACA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAiBO,SAAS,IACd,OAVO,AAUA,QAVQ,GAAG,CAAC,SAAS,EAAI,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,CAAA,EAAA,EAAA,OAAA,AAAO,IAAI,QAWlD,CAlBA,EAAA,CAAA,CAAA,4DCZA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA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AAI,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,mBAAmB,AAAnB,EAAoB,CAClC,qBACA,sBACJ,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,3 +0,0 @@
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])},51374,e=>{"use strict";var t=e.i(27980);function r(e,n=500,a){console.error("[API Error]",e);let s=a??(e instanceof Error?e.message:"Internal server error");return t.NextResponse.json({error:s},{status:n})}e.s(["apiError",()=>r])},50664,e=>{"use strict";var t=e.i(22925),r=e.i(62995),n=e.i(14112),a=e.i(31716),s=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),w=e.i(51374),E=e.i(40060);async function m(e,{params:t}){try{let{featureId:r}=await t,n=await e.json();if(!n.answers||"object"!=typeof n.answers)return g.NextResponse.json({error:"answers must be a non-empty object"},{status:400});let a=(0,E.resolve)("RespondToInteractionUseCase");return await a.execute({featureId:r,answers:n.answers}),g.NextResponse.json({ok:!0})}catch(e){if(e instanceof Error&&e.message.includes("No pending interaction"))return(0,w.apiError)(e,409,"No pending interaction");return(0,w.apiError)(e)}}e.s(["POST",()=>m,"dynamic",0,"force-dynamic"],97166);var y=e.i(97166);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/interactive/chat/[featureId]/respond/route",pathname:"/api/interactive/chat/[featureId]/respond",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/interactive/chat/[featureId]/respond/route.ts",nextConfigOutput:"",userland:y}),{workAsyncStorage:b,workUnitAsyncStorage:A,serverHooks:N}=C;function T(){return(0,n.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:A})}async function P(e,t,n){C.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/interactive/chat/[featureId]/respond/route";g=g.replace(/\/index$/,"")||"/";let w=await C.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:E,params:m,nextConfig:y,parsedUrl:b,isDraftMode:A,prerenderManifest:N,routerServerContext:T,isOnDemandRevalidate:P,revalidateOnlyGenerated:I,resolvedPathname:j,clientReferenceManifest:k,serverActionsManifest:O}=w,_=(0,i.normalizeAppPath)(g),q=!!(N.dynamicRoutes[_]||N.routes[j]),S=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=!!N.routes[j],t=N.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(y.experimental.adapterPath)return await S();throw new R.NoFallbackError}}let H=null;!q||C.isDev||A||(H="/index"===(H=j)?"/":H);let U=!0===C.isDev||!q,D=q&&!U;O&&k&&(0,o.setManifestsSingleton)({page:g,clientReferenceManifest:k,serverActionsManifest:O});let M=e.method||"GET",$=(0,s.getTracer)(),F=$.getActiveScopeSpan(),K={params:m,prerenderManifest:N,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:y.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>C.onRequestError(e,t,n,a,T)},sharedContext:{buildId:E}},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,a.getRequestMeta)(e,"minimalMode"),l=async a=>{var s,l;let d=async({previousCacheEntry:r})=>{try{if(!i&&P&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(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,c.sendResponse)(L,B,s,K.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.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:s.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:P})},!1,T),t}},u=await C.handleResponse({req:e,nextConfig:y,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:I,responseGenerator:d,waitUntil:n.waitUntil,isMinimalMode:i});if(!q)return null;if((null==u||null==(s=u.value)?void 0:s.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",P?"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 i&&q||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:s.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:P})},!1,T),q)throw t;return await (0,c.sendResponse)(L,B,new Response(null,{status:500})),null}}e.s(["handler",()=>P,"patchFetch",()=>T,"routeModule",()=>C,"serverHooks",()=>N,"workAsyncStorage",()=>b,"workUnitAsyncStorage",()=>A],50664)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__9e8fc40c._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/server-container.ts","../../../../../../src/presentation/web/lib/api-error.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/respond/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 { NextResponse } from 'next/server';\n\n/**\n * Create a sanitized error response. Logs full error server-side,\n * returns only a safe message to the client.\n */\nexport function apiError(error: unknown, status = 500, publicMessage?: string): NextResponse {\n // eslint-disable-next-line no-console\n console.error('[API Error]', error);\n\n const message =\n publicMessage ?? (error instanceof Error ? error.message : 'Internal server error');\n\n return NextResponse.json({ error: message }, { status });\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]/respond/route\",\n pathname: \"/api/interactive/chat/[featureId]/respond\",\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]/respond/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]/respond/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 * Respond to a pending agent interaction (AskUserQuestion).\n *\n * POST - Submit user's answers to the pending interaction.\n * The agent resumes processing after receiving the response.\n *\n * `featureId` is a polymorphic scope key: a feature UUID, \"repo-<id>\", or \"global\".\n */\n\nimport type { NextRequest } from 'next/server';\nimport { NextResponse } from 'next/server';\nimport { apiError } from '@/lib/api-error';\nimport { resolve } from '@/lib/server-container';\nimport type { RespondToInteractionUseCase } from '@shepai/core/application/use-cases/interactive/respond-to-interaction.use-case';\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 body = (await request.json()) as {\n answers?: Record<string, string>;\n };\n\n if (!body.answers || typeof body.answers !== 'object') {\n return NextResponse.json({ error: 'answers must be a non-empty object' }, { status: 400 });\n }\n\n const useCase = resolve<RespondToInteractionUseCase>('RespondToInteractionUseCase');\n await useCase.execute({\n featureId,\n answers: body.answers,\n });\n\n return NextResponse.json({ ok: true });\n } catch (error) {\n if (error instanceof Error && error.message.includes('No pending interaction')) {\n return apiError(error, 409, 'No pending interaction');\n }\n return apiError(error);\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,OAMO,SAAS,EAAS,CAAc,CAAE,EAAS,GAAG,CAAE,CAAsB,EAE3E,QAAQ,KAAK,CAAC,cAAe,GAE7B,IAAM,EACJ,IAAkB,aAAD,AAAkB,MAAQ,EAAM,OAAO,CAAG,uBAAA,CAAuB,CAEpF,OAAO,EAAA,YAAY,CAAC,IAAI,CAAC,CAAE,MAAO,CAAQ,EAAG,QAAE,CAAO,EACxD,iDCdA,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,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AC,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":[2]}
@@ -1,3 +0,0 @@
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"))},12714,(e,t,r)=>{t.exports=e.x("node:fs/promises",()=>require("node:fs/promises"))},50227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},32828,e=>{"use strict";e.i(12714);var t=e.i(60526),r=e.i(50227);function a(){return process.env.SHEP_HOME??(0,r.join)((0,t.homedir)(),".shep")}e.i(2157),e.s(["getShepHomeDir",()=>a])},24868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},70390,e=>{"use strict";var t=e.i(2157),r=e.i(50227);function a(e){let a=(0,r.resolve)(e);try{return(0,t.realpathSync)(a)}catch{return(0,r.normalize)(a)}}function n(e,t){let n=a(e),s=a(t);if(n!==s&&!n.startsWith(s+r.sep))throw Error(`Path traversal detected: ${e} is outside ${t}`);return n}e.s(["ensureContainedPath",()=>n])},18095,e=>{"use strict";var t=e.i(22925),r=e.i(62995),a=e.i(14112),n=e.i(31716),s=e.i(16340),i=e.i(40522),o=e.i(21994),l=e.i(5802),p=e.i(17171),d=e.i(177),u=e.i(43685),c=e.i(84832),h=e.i(92435),x=e.i(41260),m=e.i(80556),g=e.i(93695);e.i(97230);var f=e.i(35162),v=e.i(27980),R=e.i(24868),w=e.i(14747),y=e.i(32828),E=e.i(70390);let C={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".bmp":"image/bmp",".ico":"image/x-icon",".pdf":"application/pdf",".txt":"text/plain",".md":"text/markdown",".json":"application/json",".yaml":"text/yaml",".yml":"text/yaml"};async function b(e,t){let r=(0,w.basename)(e);try{for(let e of(await (0,R.readdir)(t,{withFileTypes:!0}))){if(!e.isDirectory())continue;let a=(0,w.join)(t,e.name,r);try{return await (0,R.stat)(a),a}catch{}}}catch{}return null}function A(e,t){return(0,R.readFile)(e).then(r=>{let a=C[(0,w.extname)(e).toLowerCase()]??t??"application/octet-stream";return new v.NextResponse(r,{headers:{"Content-Type":a,"Cache-Control":"private, max-age=3600"}})})}async function P(e){let t=e.nextUrl.searchParams.get("path"),r=e.nextUrl.searchParams.get("mimeType");if(!t)return v.NextResponse.json({error:"Missing path parameter"},{status:400});let a=(0,w.resolve)((0,y.getShepHomeDir)(),"attachments");try{(0,E.ensureContainedPath)(t,a)}catch{return v.NextResponse.json({error:"Access denied"},{status:403})}try{return await (0,R.stat)(t),await A(t,r)}catch{let e=await b(t,a);if(e)return await A(e,r);return v.NextResponse.json({error:"File not found"},{status:404})}}e.s(["GET",()=>P],1195);var j=e.i(1195);let T=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/attachments/preview/route",pathname:"/api/attachments/preview",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/presentation/web/app/api/attachments/preview/route.ts",nextConfigOutput:"",userland:j}),{workAsyncStorage:N,workUnitAsyncStorage:q,serverHooks:S}=T;function k(){return(0,a.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:q})}async function O(e,t,a){T.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/attachments/preview/route";v=v.replace(/\/index$/,"")||"/";let R=await T.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:w,params:y,nextConfig:E,parsedUrl:C,isDraftMode:b,prerenderManifest:A,routerServerContext:P,isOnDemandRevalidate:j,revalidateOnlyGenerated:N,resolvedPathname:q,clientReferenceManifest:S,serverActionsManifest:k}=R,O=(0,o.normalizeAppPath)(v),H=!!(A.dynamicRoutes[O]||A.routes[q]),_=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,C,!1):t.end("This page could not be found"),null);if(H&&!b){let e=!!A.routes[q],t=A.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(E.experimental.adapterPath)return await _();throw new g.NoFallbackError}}let U=null;!H||T.isDev||b||(U="/index"===(U=q)?"/":U);let D=!0===T.isDev||!H,I=H&&!D;k&&S&&(0,i.setManifestsSingleton)({page:v,clientReferenceManifest:S,serverActionsManifest:k});let M=e.method||"GET",F=(0,s.getTracer)(),$=F.getActiveScopeSpan(),K={params:y,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:D,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:E.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>T.onRequestError(e,t,a,n,P)},sharedContext:{buildId:w}},L=new l.NodeNextRequest(e),B=new l.NodeNextResponse(t),G=p.NextRequestAdapter.fromNodeNextRequest(L,(0,p.signalFromNodeResponse)(t));try{let i=async e=>T.handle(G,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.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} ${v}`)}),o=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var s,l;let p=async({previousCacheEntry:r})=>{try{if(!o&&j&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await i(n);e.fetchMetrics=K.renderOpts.fetchMetrics;let l=K.renderOpts.pendingWaitUntil;l&&a.waitUntil&&(a.waitUntil(l),l=void 0);let p=K.renderOpts.collectedTags;if(!H)return await (0,c.sendResponse)(L,B,s,K.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);p&&(t[m.NEXT_CACHE_TAGS_HEADER]=p),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await T.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:I,isOnDemandRevalidate:j})},!1,P),t}},d=await T.handleResponse({req:e,nextConfig:E,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:j,revalidateOnlyGenerated:N,responseGenerator:p,waitUntil:a.waitUntil,isMinimalMode:o});if(!H)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(l=d.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});o||t.setHeader("x-nextjs-cache",j?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),b&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let g=(0,h.fromNodeOutgoingHttpHeaders)(d.value.headers);return o&&H||g.delete(m.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||g.get("Cache-Control")||g.set("Cache-Control",(0,x.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(L,B,new Response(d.value.body,{headers:g,status:d.value.status||200})),null};$?await l($):await F.withPropagatedContext(e.headers,()=>F.trace(d.BaseServerSpan.handleRequest,{spanName:`${M} ${v}`,kind:s.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},l))}catch(t){if(t instanceof g.NoFallbackError||await T.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:I,isOnDemandRevalidate:j})},!1,P),H)throw t;return await (0,c.sendResponse)(L,B,new Response(null,{status:500})),null}}e.s(["handler",()=>O,"patchFetch",()=>k,"routeModule",()=>T,"serverHooks",()=>S,"workAsyncStorage",()=>N,"workUnitAsyncStorage",()=>q],18095)}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__a2426aa4._.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/core/src/infrastructure/services/filesystem/shep-directory.service.ts","../../../../../../packages/core/src/infrastructure/services/filesystem/path-sanitizers.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/attachments/preview/route.ts"],"sourcesContent":["/**\n * Shep Directory Service\n *\n * Manages the ~/.shep/ directory for global settings and data storage.\n * Ensures directory exists with correct permissions before database operations.\n *\n * Supports SHEP_HOME env var for test isolation (overrides default ~/.shep/).\n */\n\nimport { mkdir } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport { existsSync } from 'node:fs';\n\n/**\n * Resolves the Shep home directory.\n * Respects SHEP_HOME env var for test isolation, falls back to ~/.shep/\n */\nfunction resolveShepHomeDir(): string {\n return process.env.SHEP_HOME ?? join(homedir(), '.shep');\n}\n\n/**\n * Gets the path to the Shep home directory.\n * Uses SHEP_HOME env var if set, otherwise ~/.shep/\n *\n * @returns Path to shep home directory\n */\nexport function getShepHomeDir(): string {\n return resolveShepHomeDir();\n}\n\n/**\n * Gets the path to the SQLite database file.\n *\n * @returns Path to the database file\n */\nexport function getShepDbPath(): string {\n return join(resolveShepHomeDir(), 'data');\n}\n\n/**\n * Gets the path to the daemon state file.\n * Uses SHEP_HOME env var if set (for test isolation), otherwise ~/.shep/daemon.json\n *\n * @returns Path to daemon.json\n */\nexport function getDaemonStatePath(): string {\n return join(resolveShepHomeDir(), 'daemon.json');\n}\n\n/**\n * Gets the path to the daemon log file.\n * Uses SHEP_HOME env var if set (for test isolation), otherwise ~/.shep/daemon.log\n *\n * @returns Path to daemon.log\n */\nexport function getDaemonLogPath(): string {\n return join(resolveShepHomeDir(), 'daemon.log');\n}\n\n/**\n * Ensures the shep home directory exists with correct permissions.\n * Creates the directory if it doesn't exist.\n * Safe to call multiple times (idempotent).\n *\n * Permissions: 700 (rwx------) - only owner can read/write/execute\n *\n * @throws Error if directory cannot be created (permissions, disk space, etc.)\n */\nexport async function ensureShepDirectory(): Promise<void> {\n const shepDir = resolveShepHomeDir();\n\n if (existsSync(shepDir)) {\n return;\n }\n\n try {\n await mkdir(shepDir, {\n recursive: true,\n mode: 0o700,\n });\n } catch (error) {\n throw new Error(\n `Failed to create Shep directory at ${shepDir}: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n}\n","import { realpathSync } from 'node:fs';\nimport { resolve, sep, normalize } from 'node:path';\n\n/**\n * Resolve a path to its canonical form (symlinks resolved, normalized).\n * Falls back to normalize(resolve()) if realpath fails (path doesn't exist yet).\n */\nexport function normalizePath(filePath: string): string {\n const resolved = resolve(filePath);\n try {\n return realpathSync(resolved);\n } catch {\n return normalize(resolved);\n }\n}\n\n/**\n * Verify that targetPath is contained within containerPath.\n * Returns the normalized target path if contained.\n * Throws if the target escapes the container (path traversal).\n * Uses realpath to defeat symlink attacks and trailing-separator\n * comparison to prevent prefix attacks (/foo vs /foobar).\n */\nexport function ensureContainedPath(targetPath: string, containerPath: string): string {\n const normalizedTarget = normalizePath(targetPath);\n const normalizedContainer = normalizePath(containerPath);\n\n if (\n normalizedTarget !== normalizedContainer &&\n !normalizedTarget.startsWith(normalizedContainer + sep)\n ) {\n throw new Error(`Path traversal detected: ${targetPath} is outside ${containerPath}`);\n }\n\n return normalizedTarget;\n}\n\n/**\n * Compare two paths for equality after normalization.\n * Handles symlinks, trailing slashes, and platform separator differences.\n */\nexport function isSamePath(a: string, b: string): boolean {\n return normalizePath(a) === normalizePath(b);\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/attachments/preview/route\",\n pathname: \"/api/attachments/preview\",\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/attachments/preview/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/attachments/preview/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","import type { NextRequest } from 'next/server';\nimport { NextResponse } from 'next/server';\nimport { readFile, stat, readdir } from 'fs/promises';\nimport { basename, extname, join, resolve } from 'path';\nimport { getShepHomeDir } from '@shepai/core/infrastructure/services/filesystem/shep-directory.service';\nimport { ensureContainedPath } from '@shepai/core/infrastructure/services/filesystem/path-sanitizers';\n\nconst MIME_MAP: Record<string, string> = {\n '.png': 'image/png',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.gif': 'image/gif',\n '.webp': 'image/webp',\n '.svg': 'image/svg+xml',\n '.bmp': 'image/bmp',\n '.ico': 'image/x-icon',\n '.pdf': 'application/pdf',\n '.txt': 'text/plain',\n '.md': 'text/markdown',\n '.json': 'application/json',\n '.yaml': 'text/yaml',\n '.yml': 'text/yaml',\n};\n\n/**\n * When the exact path doesn't exist (e.g. pending-<id> was renamed to <slug>),\n * search all sibling attachment directories for the same filename.\n */\nasync function findAttachmentFallback(\n requestedPath: string,\n attachmentsRoot: string\n): Promise<string | null> {\n const filename = basename(requestedPath);\n try {\n const dirs = await readdir(attachmentsRoot, { withFileTypes: true });\n for (const entry of dirs) {\n if (!entry.isDirectory()) continue;\n const candidate = join(attachmentsRoot, entry.name, filename);\n try {\n await stat(candidate);\n return candidate;\n } catch {\n // not in this directory\n }\n }\n } catch {\n // attachments root doesn't exist\n }\n return null;\n}\n\nfunction serveFile(filePath: string, mimeTypeHint: string | null) {\n return readFile(filePath).then((buffer) => {\n const ext = extname(filePath).toLowerCase();\n const contentType = MIME_MAP[ext] ?? mimeTypeHint ?? 'application/octet-stream';\n return new NextResponse(buffer, {\n headers: {\n 'Content-Type': contentType,\n 'Cache-Control': 'private, max-age=3600',\n },\n });\n });\n}\n\nexport async function GET(request: NextRequest): Promise<NextResponse> {\n const path = request.nextUrl.searchParams.get('path');\n const mimeTypeHint = request.nextUrl.searchParams.get('mimeType');\n\n if (!path) {\n return NextResponse.json({ error: 'Missing path parameter' }, { status: 400 });\n }\n\n // Security: only allow paths within SHEP_HOME/attachments\n const attachmentsRoot = resolve(getShepHomeDir(), 'attachments');\n try {\n ensureContainedPath(path, attachmentsRoot);\n } catch {\n return NextResponse.json({ error: 'Access denied' }, { status: 403 });\n }\n\n try {\n await stat(path);\n return await serveFile(path, mimeTypeHint);\n } catch {\n // File not found at exact path — try fallback search\n // This handles the case where pending-<sessionId>/ was renamed to <featureSlug>/\n const fallbackPath = await findAttachmentFallback(path, attachmentsRoot);\n if (fallbackPath) {\n return await serveFile(fallbackPath, mimeTypeHint);\n }\n return NextResponse.json({ error: 'File not found' }, { status: 404 });\n }\n}\n"],"names":[],"mappings":"u0CASA,EAAA,CAAA,CAAA,OACA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAiBO,SAAS,IACd,OAAO,AAVA,QAAQ,GAAG,CAAC,SAAS,EAAI,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,CAAA,EAAA,EAAA,OAAA,AAAO,IAAI,QAWlD,CAlBA,EAAA,CAAA,CAAA,qICZA,IAAA,EAAA,EAAA,CAAA,CAAA,MACA,EAAA,EAAA,CAAA,CAAA,OAMO,SAAS,EAAc,CAAgB,EAC5C,IAAM,EAAW,CAAA,EAAA,EAAA,OAAA,AAAO,EAAC,GACzB,GAAI,CACF,MAAO,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EACtB,CAAE,KAAM,CACN,MAAO,CAAA,EAAA,EAAA,SAAA,AAAS,EAAC,EACnB,CACF,CASO,SAAS,EAAoB,CAAkB,CAAE,CAAqB,EAC3E,IAAM,EAAmB,EAAc,GACjC,EAAsB,EAAc,GAE1C,GACE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