@shipit-ai/cli 1.164.2 → 1.165.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 (598) hide show
  1. package/README.md +3 -7
  2. package/dist/packages/core/src/application/ports/output/services/environment-detector.service.d.ts +54 -0
  3. package/dist/packages/core/src/application/ports/output/services/environment-detector.service.d.ts.map +1 -0
  4. package/dist/packages/core/src/application/ports/output/services/environment-detector.service.js +8 -0
  5. package/dist/packages/core/src/application/ports/output/services/index.d.ts +1 -0
  6. package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
  7. package/dist/packages/core/src/application/ports/output/services/tool-metadata-service.interface.d.ts +5 -1
  8. package/dist/packages/core/src/application/ports/output/services/tool-metadata-service.interface.d.ts.map +1 -1
  9. package/dist/packages/core/src/application/use-cases/agents/configure-agent.use-case.d.ts +1 -1
  10. package/dist/packages/core/src/application/use-cases/agents/configure-agent.use-case.js +1 -1
  11. package/dist/packages/core/src/application/use-cases/agents/stop-agent-run.use-case.d.ts +1 -1
  12. package/dist/packages/core/src/application/use-cases/agents/stop-agent-run.use-case.js +1 -1
  13. package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.d.ts +1 -1
  14. package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.js +1 -1
  15. package/dist/packages/core/src/application/use-cases/settings/detect-environment-defaults.use-case.d.ts +18 -0
  16. package/dist/packages/core/src/application/use-cases/settings/detect-environment-defaults.use-case.d.ts.map +1 -0
  17. package/dist/packages/core/src/application/use-cases/settings/detect-environment-defaults.use-case.js +40 -0
  18. package/dist/packages/core/src/application/use-cases/settings/index.d.ts +1 -0
  19. package/dist/packages/core/src/application/use-cases/settings/index.d.ts.map +1 -1
  20. package/dist/packages/core/src/application/use-cases/settings/index.js +1 -0
  21. package/dist/packages/core/src/application/use-cases/settings/initialize-settings.use-case.d.ts +10 -4
  22. package/dist/packages/core/src/application/use-cases/settings/initialize-settings.use-case.d.ts.map +1 -1
  23. package/dist/packages/core/src/application/use-cases/settings/initialize-settings.use-case.js +34 -7
  24. package/dist/packages/core/src/application/use-cases/tools/list-tools.use-case.d.ts +1 -1
  25. package/dist/packages/core/src/application/use-cases/tools/list-tools.use-case.d.ts.map +1 -1
  26. package/dist/packages/core/src/domain/factories/settings-defaults.factory.d.ts +18 -2
  27. package/dist/packages/core/src/domain/factories/settings-defaults.factory.d.ts.map +1 -1
  28. package/dist/packages/core/src/domain/factories/settings-defaults.factory.js +16 -5
  29. package/dist/packages/core/src/index.d.ts +2 -2
  30. package/dist/packages/core/src/index.js +2 -2
  31. package/dist/packages/core/src/infrastructure/di/modules/services.module.d.ts.map +1 -1
  32. package/dist/packages/core/src/infrastructure/di/modules/services.module.js +2 -0
  33. package/dist/packages/core/src/infrastructure/di/modules/use-cases.module.d.ts.map +1 -1
  34. package/dist/packages/core/src/infrastructure/di/modules/use-cases.module.js +2 -0
  35. package/dist/packages/core/src/infrastructure/di/modules/web-tokens.module.d.ts.map +1 -1
  36. package/dist/packages/core/src/infrastructure/di/modules/web-tokens.module.js +4 -0
  37. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/plan.fixture.d.ts +1 -1
  38. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/plan.fixture.js +1 -1
  39. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/research.fixture.d.ts +1 -1
  40. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/research.fixture.js +1 -1
  41. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/spec-analyze.fixture.d.ts +2 -2
  42. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/spec-analyze.fixture.d.ts.map +1 -1
  43. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/spec-analyze.fixture.js +5 -5
  44. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/spec-requirements.fixture.d.ts +2 -2
  45. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/spec-requirements.fixture.d.ts.map +1 -1
  46. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/spec-requirements.fixture.js +6 -6
  47. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/tasks.fixture.d.ts +1 -1
  48. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/tasks.fixture.js +1 -1
  49. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/evidence-prompts.js +1 -1
  50. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.js +1 -1
  51. package/dist/packages/core/src/infrastructure/services/environment-detector.service.d.ts +38 -0
  52. package/dist/packages/core/src/infrastructure/services/environment-detector.service.d.ts.map +1 -0
  53. package/dist/packages/core/src/infrastructure/services/environment-detector.service.js +196 -0
  54. package/dist/packages/core/src/infrastructure/services/filesystem/shipit-ai-directory.service.d.ts +2 -2
  55. package/dist/packages/core/src/infrastructure/services/filesystem/shipit-ai-directory.service.js +4 -4
  56. package/dist/packages/core/src/infrastructure/services/git/pr-branding.d.ts +4 -4
  57. package/dist/packages/core/src/infrastructure/services/git/pr-branding.js +4 -4
  58. package/dist/packages/core/src/infrastructure/services/interactive/feature-context.builder.d.ts +1 -1
  59. package/dist/packages/core/src/infrastructure/services/interactive/feature-context.builder.js +7 -7
  60. package/dist/packages/core/src/infrastructure/services/port.service.d.ts +1 -1
  61. package/dist/packages/core/src/infrastructure/services/port.service.d.ts.map +1 -1
  62. package/dist/packages/core/src/infrastructure/services/port.service.js +1 -1
  63. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-metadata.d.ts +6 -1
  64. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-metadata.d.ts.map +1 -1
  65. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-metadata.js +7 -0
  66. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-metadata.service.d.ts +1 -0
  67. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-metadata.service.d.ts.map +1 -1
  68. package/dist/packages/core/src/infrastructure/services/tool-installer/tool-metadata.service.js +4 -1
  69. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/CLAUDE.md +2 -1
  70. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/bash.json +20 -0
  71. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/codex-cli.json +31 -0
  72. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/fish.json +19 -0
  73. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/powershell.json +24 -0
  74. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/zsh.json +19 -0
  75. package/dist/src/presentation/cli/commands/agent/approve.command.d.ts +1 -1
  76. package/dist/src/presentation/cli/commands/agent/approve.command.js +1 -1
  77. package/dist/src/presentation/cli/commands/agent/delete.command.d.ts +1 -1
  78. package/dist/src/presentation/cli/commands/agent/delete.command.js +1 -1
  79. package/dist/src/presentation/cli/commands/agent/index.d.ts +6 -6
  80. package/dist/src/presentation/cli/commands/agent/index.js +6 -6
  81. package/dist/src/presentation/cli/commands/agent/logs.command.d.ts +3 -3
  82. package/dist/src/presentation/cli/commands/agent/logs.command.js +3 -3
  83. package/dist/src/presentation/cli/commands/agent/ls.command.d.ts +1 -1
  84. package/dist/src/presentation/cli/commands/agent/ls.command.js +1 -1
  85. package/dist/src/presentation/cli/commands/agent/reject.command.d.ts +1 -1
  86. package/dist/src/presentation/cli/commands/agent/reject.command.js +1 -1
  87. package/dist/src/presentation/cli/commands/agent/show.command.d.ts +1 -1
  88. package/dist/src/presentation/cli/commands/agent/show.command.js +1 -1
  89. package/dist/src/presentation/cli/commands/agent/stop.command.d.ts +1 -1
  90. package/dist/src/presentation/cli/commands/agent/stop.command.js +1 -1
  91. package/dist/src/presentation/cli/commands/daemon/start-daemon.d.ts +4 -4
  92. package/dist/src/presentation/cli/commands/daemon/start-daemon.js +4 -4
  93. package/dist/src/presentation/cli/commands/daemon/stop-daemon.d.ts +5 -5
  94. package/dist/src/presentation/cli/commands/daemon/stop-daemon.js +5 -5
  95. package/dist/src/presentation/cli/commands/feat/adopt.command.d.ts +3 -3
  96. package/dist/src/presentation/cli/commands/feat/adopt.command.js +3 -3
  97. package/dist/src/presentation/cli/commands/feat/approve.command.d.ts +1 -1
  98. package/dist/src/presentation/cli/commands/feat/approve.command.js +1 -1
  99. package/dist/src/presentation/cli/commands/feat/archive.command.d.ts +3 -3
  100. package/dist/src/presentation/cli/commands/feat/archive.command.js +3 -3
  101. package/dist/src/presentation/cli/commands/feat/del.command.d.ts +5 -5
  102. package/dist/src/presentation/cli/commands/feat/del.command.js +5 -5
  103. package/dist/src/presentation/cli/commands/feat/index.d.ts +4 -4
  104. package/dist/src/presentation/cli/commands/feat/index.js +4 -4
  105. package/dist/src/presentation/cli/commands/feat/logs.command.d.ts +3 -3
  106. package/dist/src/presentation/cli/commands/feat/logs.command.js +3 -3
  107. package/dist/src/presentation/cli/commands/feat/ls.command.d.ts +3 -3
  108. package/dist/src/presentation/cli/commands/feat/ls.command.js +3 -3
  109. package/dist/src/presentation/cli/commands/feat/new.command.d.ts +3 -3
  110. package/dist/src/presentation/cli/commands/feat/new.command.js +4 -4
  111. package/dist/src/presentation/cli/commands/feat/reject.command.d.ts +1 -1
  112. package/dist/src/presentation/cli/commands/feat/reject.command.js +1 -1
  113. package/dist/src/presentation/cli/commands/feat/resume.command.d.ts +1 -1
  114. package/dist/src/presentation/cli/commands/feat/resume.command.js +1 -1
  115. package/dist/src/presentation/cli/commands/feat/review.command.d.ts +1 -1
  116. package/dist/src/presentation/cli/commands/feat/review.command.js +1 -1
  117. package/dist/src/presentation/cli/commands/feat/show.command.d.ts +1 -1
  118. package/dist/src/presentation/cli/commands/feat/show.command.d.ts.map +1 -1
  119. package/dist/src/presentation/cli/commands/feat/show.command.js +4 -3
  120. package/dist/src/presentation/cli/commands/feat/start.command.d.ts +1 -1
  121. package/dist/src/presentation/cli/commands/feat/start.command.js +1 -1
  122. package/dist/src/presentation/cli/commands/feat/unarchive.command.d.ts +2 -2
  123. package/dist/src/presentation/cli/commands/feat/unarchive.command.js +2 -2
  124. package/dist/src/presentation/cli/commands/ide-open.command.d.ts +1 -1
  125. package/dist/src/presentation/cli/commands/ide-open.command.js +1 -1
  126. package/dist/src/presentation/cli/commands/log-viewer.d.ts +1 -1
  127. package/dist/src/presentation/cli/commands/log-viewer.js +1 -1
  128. package/dist/src/presentation/cli/commands/repo/add.command.d.ts +3 -3
  129. package/dist/src/presentation/cli/commands/repo/add.command.js +3 -3
  130. package/dist/src/presentation/cli/commands/repo/index.d.ts +4 -4
  131. package/dist/src/presentation/cli/commands/repo/index.js +4 -4
  132. package/dist/src/presentation/cli/commands/repo/ls.command.d.ts +1 -1
  133. package/dist/src/presentation/cli/commands/repo/ls.command.js +1 -1
  134. package/dist/src/presentation/cli/commands/repo/show.command.d.ts +1 -1
  135. package/dist/src/presentation/cli/commands/repo/show.command.js +1 -1
  136. package/dist/src/presentation/cli/commands/restart.command.d.ts +3 -3
  137. package/dist/src/presentation/cli/commands/restart.command.js +5 -5
  138. package/dist/src/presentation/cli/commands/run.command.d.ts +5 -5
  139. package/dist/src/presentation/cli/commands/run.command.js +5 -5
  140. package/dist/src/presentation/cli/commands/session/index.d.ts +3 -3
  141. package/dist/src/presentation/cli/commands/session/index.js +3 -3
  142. package/dist/src/presentation/cli/commands/session/ls.command.d.ts +6 -6
  143. package/dist/src/presentation/cli/commands/session/ls.command.js +6 -6
  144. package/dist/src/presentation/cli/commands/session/show.command.d.ts +3 -3
  145. package/dist/src/presentation/cli/commands/session/show.command.js +3 -3
  146. package/dist/src/presentation/cli/commands/settings/agent.command.d.ts +4 -4
  147. package/dist/src/presentation/cli/commands/settings/agent.command.js +7 -7
  148. package/dist/src/presentation/cli/commands/settings/ide.command.d.ts +3 -3
  149. package/dist/src/presentation/cli/commands/settings/ide.command.js +6 -6
  150. package/dist/src/presentation/cli/commands/settings/index.d.ts +10 -10
  151. package/dist/src/presentation/cli/commands/settings/index.js +10 -10
  152. package/dist/src/presentation/cli/commands/settings/init.command.d.ts +3 -3
  153. package/dist/src/presentation/cli/commands/settings/init.command.js +6 -6
  154. package/dist/src/presentation/cli/commands/settings/language.command.d.ts +2 -2
  155. package/dist/src/presentation/cli/commands/settings/language.command.js +3 -3
  156. package/dist/src/presentation/cli/commands/settings/model.command.d.ts +2 -2
  157. package/dist/src/presentation/cli/commands/settings/model.command.js +3 -3
  158. package/dist/src/presentation/cli/commands/settings/show.command.d.ts +4 -4
  159. package/dist/src/presentation/cli/commands/settings/show.command.js +7 -7
  160. package/dist/src/presentation/cli/commands/settings/workflow.command.d.ts +3 -3
  161. package/dist/src/presentation/cli/commands/settings/workflow.command.js +6 -6
  162. package/dist/src/presentation/cli/commands/start.command.d.ts +3 -3
  163. package/dist/src/presentation/cli/commands/start.command.js +5 -5
  164. package/dist/src/presentation/cli/commands/status.command.d.ts +4 -4
  165. package/dist/src/presentation/cli/commands/status.command.js +4 -4
  166. package/dist/src/presentation/cli/commands/stop.command.d.ts +2 -2
  167. package/dist/src/presentation/cli/commands/stop.command.js +2 -2
  168. package/dist/src/presentation/cli/commands/tools.command.d.ts +1 -1
  169. package/dist/src/presentation/cli/commands/tools.command.js +1 -1
  170. package/dist/src/presentation/cli/commands/ui.command.d.ts +4 -4
  171. package/dist/src/presentation/cli/commands/ui.command.js +7 -7
  172. package/dist/src/presentation/cli/commands/upgrade.command.d.ts +2 -2
  173. package/dist/src/presentation/cli/commands/upgrade.command.js +2 -2
  174. package/dist/src/presentation/cli/commands/version.command.d.ts +2 -2
  175. package/dist/src/presentation/cli/commands/version.command.js +2 -2
  176. package/dist/src/presentation/cli/index.d.ts +3 -3
  177. package/dist/src/presentation/cli/index.js +4 -4
  178. package/dist/src/presentation/cli/ui/index.d.ts +1 -1
  179. package/dist/src/presentation/cli/ui/index.js +1 -1
  180. package/dist/src/presentation/tui/themes/shipit-ai.theme.d.ts +4 -4
  181. package/dist/src/presentation/tui/themes/shipit-ai.theme.js +4 -4
  182. package/dist/src/presentation/web/app/actions/check-agent-auth.d.ts.map +1 -1
  183. package/dist/src/presentation/web/app/actions/check-agent-auth.js +69 -24
  184. package/dist/src/presentation/web/app/actions/deploy-feature.js +2 -2
  185. package/dist/src/presentation/web/app/actions/deploy-repository.js +2 -2
  186. package/dist/src/presentation/web/app/actions/get-all-agent-models.d.ts +1 -0
  187. package/dist/src/presentation/web/app/actions/get-all-agent-models.d.ts.map +1 -1
  188. package/dist/src/presentation/web/app/actions/get-all-agent-models.js +28 -3
  189. package/dist/src/presentation/web/app/actions/get-available-editors.d.ts +14 -0
  190. package/dist/src/presentation/web/app/actions/get-available-editors.d.ts.map +1 -0
  191. package/dist/src/presentation/web/app/actions/get-available-editors.js +24 -0
  192. package/dist/src/presentation/web/app/actions/get-available-shells.d.ts +14 -0
  193. package/dist/src/presentation/web/app/actions/get-available-shells.d.ts.map +1 -0
  194. package/dist/src/presentation/web/app/actions/get-available-shells.js +22 -0
  195. package/dist/src/presentation/web/app/actions/get-merge-review-data.js +3 -3
  196. package/dist/src/presentation/web/app/layout.d.ts.map +1 -1
  197. package/dist/src/presentation/web/app/layout.js +4 -13
  198. package/dist/src/presentation/web/app/settings/page.d.ts.map +1 -1
  199. package/dist/src/presentation/web/app/settings/page.js +6 -2
  200. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.js +1 -1
  201. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.d.ts +1 -1
  202. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.js +1 -1
  203. package/dist/src/presentation/web/components/common/control-center-drawer/global-chat-drawer-client.js +1 -1
  204. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts +1 -1
  205. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.js +1 -1
  206. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.js +2 -2
  207. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.js +8 -8
  208. package/dist/src/presentation/web/components/common/github-import-dialog/github-import-dialog.js +1 -1
  209. package/dist/src/presentation/web/components/common/inline-attachments/inline-attachments.stories.js +5 -5
  210. package/dist/src/presentation/web/components/common/merge-review/merge-review.stories.js +8 -8
  211. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.stories.js +1 -1
  212. package/dist/src/presentation/web/components/common/shipit-ai-logo/index.d.ts +2 -2
  213. package/dist/src/presentation/web/components/common/shipit-ai-logo/index.d.ts.map +1 -1
  214. package/dist/src/presentation/web/components/common/shipit-ai-logo/index.js +1 -1
  215. package/dist/src/presentation/web/components/common/shipit-ai-logo/{shep-logo.d.ts → shipit-ai-logo.d.ts} +1 -1
  216. package/dist/src/presentation/web/components/common/shipit-ai-logo/shipit-ai-logo.d.ts.map +1 -0
  217. package/dist/src/presentation/web/components/common/shipit-ai-logo/shipit-ai-logo.js +8 -0
  218. package/dist/src/presentation/web/components/common/shipit-ai-logo/{shep-logo.stories.d.ts → shipit-ai-logo.stories.d.ts} +2 -2
  219. package/dist/src/presentation/web/components/common/shipit-ai-logo/shipit-ai-logo.stories.d.ts.map +1 -0
  220. package/dist/src/presentation/web/components/common/shipit-ai-logo/{shep-logo.stories.js → shipit-ai-logo.stories.js} +1 -1
  221. package/dist/src/presentation/web/components/common/version-badge/version-badge.stories.js +2 -2
  222. package/dist/src/presentation/web/components/features/chat/ChatSheet.js +1 -1
  223. package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.js +1 -1
  224. package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.d.ts.map +1 -1
  225. package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.js +6 -1
  226. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.stories.js +19 -19
  227. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/index.d.ts.map +1 -1
  228. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/index.js +13 -2
  229. package/dist/src/presentation/web/components/features/settings/database-settings-section.js +1 -1
  230. package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts +5 -1
  231. package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
  232. package/dist/src/presentation/web/components/features/settings/settings-page-client.js +33 -27
  233. package/dist/src/presentation/web/components/features/tools/tool-card.js +1 -1
  234. package/dist/src/presentation/web/components/features/version/version-page-client.js +1 -1
  235. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.d.ts.map +1 -1
  236. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.js +3 -3
  237. package/dist/src/presentation/web/components/ui/sidebar.stories.js +1 -1
  238. package/dist/src/presentation/web/lib/session-scanner.js +2 -2
  239. package/dist/src/presentation/web/lib/version.d.ts +1 -1
  240. package/dist/src/presentation/web/lib/version.js +1 -1
  241. package/dist/src/presentation/web/{middleware.d.ts → proxy.d.ts} +4 -4
  242. package/dist/src/presentation/web/proxy.d.ts.map +1 -0
  243. package/dist/src/presentation/web/{middleware.js → proxy.js} +3 -3
  244. package/dist/src/presentation/web/types/theme.d.ts +1 -1
  245. package/dist/src/presentation/web/types/theme.js +1 -1
  246. package/dist/translations/ar/cli.json +17 -17
  247. package/dist/translations/ar/tui.json +2 -2
  248. package/dist/translations/ar/web.json +7 -5
  249. package/dist/translations/de/cli.json +17 -17
  250. package/dist/translations/de/tui.json +2 -2
  251. package/dist/translations/de/web.json +7 -5
  252. package/dist/translations/en/cli.json +17 -17
  253. package/dist/translations/en/tui.json +2 -2
  254. package/dist/translations/en/web.json +7 -5
  255. package/dist/translations/es/cli.json +17 -17
  256. package/dist/translations/es/tui.json +2 -2
  257. package/dist/translations/es/web.json +7 -5
  258. package/dist/translations/fr/cli.json +17 -17
  259. package/dist/translations/fr/tui.json +2 -2
  260. package/dist/translations/fr/web.json +7 -5
  261. package/dist/translations/he/cli.json +17 -17
  262. package/dist/translations/he/tui.json +2 -2
  263. package/dist/translations/he/web.json +7 -5
  264. package/dist/translations/pt/cli.json +17 -17
  265. package/dist/translations/pt/tui.json +2 -2
  266. package/dist/translations/pt/web.json +7 -5
  267. package/dist/translations/ru/cli.json +17 -17
  268. package/dist/translations/ru/tui.json +2 -2
  269. package/dist/translations/ru/web.json +7 -5
  270. package/dist/tsconfig.build.tsbuildinfo +1 -1
  271. package/package.json +2 -2
  272. package/web/.next/BUILD_ID +1 -1
  273. package/web/.next/build-manifest.json +5 -5
  274. package/web/.next/fallback-build-manifest.json +3 -3
  275. package/web/.next/prerender-manifest.json +3 -3
  276. package/web/.next/required-server-files.js +2 -2
  277. package/web/.next/required-server-files.json +2 -2
  278. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/build-manifest.json +2 -2
  279. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  280. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +2 -1
  281. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  282. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  283. package/web/.next/server/app/(dashboard)/@drawer/chat/page/build-manifest.json +2 -2
  284. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  285. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +2 -1
  286. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  287. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  288. package/web/.next/server/app/(dashboard)/@drawer/create/page/build-manifest.json +2 -2
  289. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  290. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -1
  291. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  292. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  293. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/build-manifest.json +2 -2
  294. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  295. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +2 -1
  296. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  297. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  298. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/build-manifest.json +2 -2
  299. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +37 -37
  300. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +2 -1
  301. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  302. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  303. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/build-manifest.json +2 -2
  304. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  305. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +2 -1
  306. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  307. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  308. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/build-manifest.json +2 -2
  309. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  310. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -1
  311. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  312. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  313. package/web/.next/server/app/(dashboard)/chat/page/build-manifest.json +2 -2
  314. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  315. package/web/.next/server/app/(dashboard)/chat/page.js +2 -1
  316. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  317. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  318. package/web/.next/server/app/(dashboard)/create/page/build-manifest.json +2 -2
  319. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  320. package/web/.next/server/app/(dashboard)/create/page.js +2 -1
  321. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  322. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  323. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/build-manifest.json +2 -2
  324. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  325. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +2 -1
  326. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  327. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  328. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/build-manifest.json +2 -2
  329. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +37 -37
  330. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +2 -1
  331. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  332. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  333. package/web/.next/server/app/(dashboard)/page/build-manifest.json +2 -2
  334. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  335. package/web/.next/server/app/(dashboard)/page.js +2 -1
  336. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  337. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  338. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/build-manifest.json +2 -2
  339. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  340. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +2 -1
  341. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  342. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  343. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/build-manifest.json +2 -2
  344. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  345. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -1
  346. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  347. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  348. package/web/.next/server/app/_global-error/page/build-manifest.json +2 -2
  349. package/web/.next/server/app/_global-error.html +1 -1
  350. package/web/.next/server/app/_global-error.rsc +1 -1
  351. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  352. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  353. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  354. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  355. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  356. package/web/.next/server/app/_not-found/page/build-manifest.json +2 -2
  357. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  358. package/web/.next/server/app/_not-found/page.js +2 -1
  359. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  360. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  361. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  362. package/web/.next/server/app/api/attachments/upload-from-path/route.js +1 -1
  363. package/web/.next/server/app/api/attachments/upload-from-path/route.js.nft.json +1 -1
  364. package/web/.next/server/app/api/dialog/pick-files/route.js.nft.json +1 -1
  365. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  366. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  367. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  368. package/web/.next/server/app/settings/page/build-manifest.json +2 -2
  369. package/web/.next/server/app/settings/page/server-reference-manifest.json +42 -18
  370. package/web/.next/server/app/settings/page.js +3 -2
  371. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  372. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  373. package/web/.next/server/app/skills/page/build-manifest.json +2 -2
  374. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  375. package/web/.next/server/app/skills/page.js +2 -2
  376. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  377. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  378. package/web/.next/server/app/tools/page/build-manifest.json +2 -2
  379. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  380. package/web/.next/server/app/tools/page.js +2 -2
  381. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  382. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  383. package/web/.next/server/app/version/page/build-manifest.json +2 -2
  384. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  385. package/web/.next/server/app/version/page.js +2 -1
  386. package/web/.next/server/app/version/page.js.nft.json +1 -1
  387. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  388. package/web/.next/server/chunks/[externals]__11vad82._.js +3 -0
  389. package/web/.next/server/chunks/[externals]__11vad82._.js.map +1 -0
  390. package/web/.next/server/chunks/[root-of-the-server]__0.2exzi._.js.map +1 -1
  391. package/web/.next/server/chunks/[root-of-the-server]__02xmnal._.js.map +1 -1
  392. package/web/.next/server/chunks/[root-of-the-server]__04jjtl_._.js.map +1 -1
  393. package/web/.next/server/chunks/[root-of-the-server]__07suer1._.js.map +1 -1
  394. package/web/.next/server/chunks/[root-of-the-server]__09118p2._.js.map +1 -1
  395. package/web/.next/server/chunks/[root-of-the-server]__0_.w-eb._.js.map +1 -1
  396. package/web/.next/server/chunks/[root-of-the-server]__0ip_e1x._.js.map +1 -1
  397. package/web/.next/server/chunks/{[root-of-the-server]__0ob3z53._.js → [root-of-the-server]__0l1p8bx._.js} +2 -2
  398. package/web/.next/server/chunks/{[root-of-the-server]__0ob3z53._.js.map → [root-of-the-server]__0l1p8bx._.js.map} +1 -1
  399. package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js +1 -1
  400. package/web/.next/server/chunks/[root-of-the-server]__13ni_ow._.js +20 -0
  401. package/web/.next/server/chunks/[root-of-the-server]__13ni_ow._.js.map +1 -0
  402. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_00~eq5i.js +3 -0
  403. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_00~eq5i.js.map +1 -0
  404. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_0979_c..js +3 -0
  405. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_0979_c..js.map +1 -0
  406. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_chat_page_actions_0dqll_1.js +3 -0
  407. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_chat_page_actions_0dqll_1.js.map +1 -0
  408. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js +1 -1
  409. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js.map +1 -1
  410. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js +2 -2
  411. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js.map +1 -1
  412. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js +1 -1
  413. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js.map +1 -1
  414. package/web/.next/server/chunks/ssr/11es_next_dist_0e36~wi._.js +1 -1
  415. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_global-chat-drawer-client_tsx_03s32.q._.js +1 -1
  416. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_global-chat-drawer-client_tsx_03s32.q._.js.map +1 -1
  417. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js +1 -1
  418. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js.map +1 -1
  419. package/web/.next/server/chunks/ssr/[root-of-the-server]__01~y8wi._.js +3 -0
  420. package/web/.next/server/chunks/ssr/[root-of-the-server]__01~y8wi._.js.map +1 -0
  421. package/web/.next/server/chunks/ssr/[root-of-the-server]__0np51e2._.js +3 -0
  422. package/web/.next/server/chunks/ssr/[root-of-the-server]__0np51e2._.js.map +1 -0
  423. package/web/.next/server/chunks/ssr/[root-of-the-server]__0qh.wn.._.js.map +1 -1
  424. package/web/.next/server/chunks/ssr/[root-of-the-server]__0rv1gci._.js +1 -1
  425. package/web/.next/server/chunks/ssr/[root-of-the-server]__0rv1gci._.js.map +1 -1
  426. package/web/.next/server/chunks/ssr/[root-of-the-server]__0uxn6-j._.js +3 -0
  427. package/web/.next/server/chunks/ssr/[root-of-the-server]__0uxn6-j._.js.map +1 -0
  428. package/web/.next/server/chunks/ssr/[root-of-the-server]__0~h382a._.js +3 -0
  429. package/web/.next/server/chunks/ssr/[root-of-the-server]__0~h382a._.js.map +1 -0
  430. package/web/.next/server/chunks/ssr/[root-of-the-server]__11-~i9u._.js +1 -1
  431. package/web/.next/server/chunks/ssr/[root-of-the-server]__11-~i9u._.js.map +1 -1
  432. package/web/.next/server/chunks/ssr/[root-of-the-server]__12g8h3_._.js +4 -0
  433. package/web/.next/server/chunks/ssr/[root-of-the-server]__12g8h3_._.js.map +1 -0
  434. package/web/.next/server/chunks/ssr/[root-of-the-server]__12qqi.~._.js +3 -0
  435. package/web/.next/server/chunks/ssr/[root-of-the-server]__12qqi.~._.js.map +1 -0
  436. package/web/.next/server/chunks/ssr/{_13e1_1b._.js → _0.gy.n8._.js} +2 -2
  437. package/web/.next/server/chunks/ssr/{_13e1_1b._.js.map → _0.gy.n8._.js.map} +1 -1
  438. package/web/.next/server/chunks/ssr/{_0sgeiju._.js → _01mq~sm._.js} +2 -2
  439. package/web/.next/server/chunks/ssr/{_0sgeiju._.js.map → _01mq~sm._.js.map} +1 -1
  440. package/web/.next/server/chunks/ssr/_0e5cv3q._.js +1 -1
  441. package/web/.next/server/chunks/ssr/_0e5cv3q._.js.map +1 -1
  442. package/web/.next/server/chunks/ssr/_0ez.1o4._.js +1 -1
  443. package/web/.next/server/chunks/ssr/_0ez.1o4._.js.map +1 -1
  444. package/web/.next/server/chunks/ssr/{_05h68we._.js → _0jk5q_z._.js} +2 -2
  445. package/web/.next/server/chunks/ssr/{_05h68we._.js.map → _0jk5q_z._.js.map} +1 -1
  446. package/web/.next/server/chunks/ssr/_0jpbsh_._.js +4 -0
  447. package/web/.next/server/chunks/ssr/_0jpbsh_._.js.map +1 -0
  448. package/web/.next/server/chunks/ssr/_0n.xy38._.js +3 -0
  449. package/web/.next/server/chunks/ssr/_0n.xy38._.js.map +1 -0
  450. package/web/.next/server/chunks/ssr/_0rvaoj4._.js +3 -0
  451. package/web/.next/server/chunks/ssr/_0rvaoj4._.js.map +1 -0
  452. package/web/.next/server/chunks/ssr/_0v.yfmg._.js +1 -1
  453. package/web/.next/server/chunks/ssr/_0v.yfmg._.js.map +1 -1
  454. package/web/.next/server/chunks/ssr/_0w-_hww._.js +1 -1
  455. package/web/.next/server/chunks/ssr/_0w-_hww._.js.map +1 -1
  456. package/web/.next/server/chunks/ssr/_11kuznh._.js +1 -1
  457. package/web/.next/server/chunks/ssr/_11kuznh._.js.map +1 -1
  458. package/web/.next/server/chunks/ssr/{_0ts70ov._.js → _13bl-l1._.js} +2 -2
  459. package/web/.next/server/chunks/ssr/{_0ts70ov._.js.map → _13bl-l1._.js.map} +1 -1
  460. package/web/.next/server/chunks/ssr/_13euo-f._.js +1 -1
  461. package/web/.next/server/chunks/ssr/_13euo-f._.js.map +1 -1
  462. package/web/.next/server/chunks/ssr/src_presentation_web_0.e4~xc._.js +3 -0
  463. package/web/.next/server/chunks/ssr/src_presentation_web_0.e4~xc._.js.map +1 -0
  464. package/web/.next/server/chunks/ssr/src_presentation_web_00dvh.m._.js +3 -0
  465. package/web/.next/server/chunks/ssr/src_presentation_web_00dvh.m._.js.map +1 -0
  466. package/web/.next/server/chunks/ssr/src_presentation_web_06b6~lt._.js +5 -0
  467. package/web/.next/server/chunks/ssr/src_presentation_web_06b6~lt._.js.map +1 -0
  468. package/web/.next/server/chunks/ssr/src_presentation_web_08fy2mf._.js +3 -0
  469. package/web/.next/server/chunks/ssr/src_presentation_web_08fy2mf._.js.map +1 -0
  470. package/web/.next/server/chunks/ssr/src_presentation_web_0f~udu1._.js +3 -0
  471. package/web/.next/server/chunks/ssr/src_presentation_web_0f~udu1._.js.map +1 -0
  472. package/web/.next/server/chunks/ssr/src_presentation_web_0qys821._.js +5 -0
  473. package/web/.next/server/chunks/ssr/src_presentation_web_0qys821._.js.map +1 -0
  474. package/web/.next/server/chunks/ssr/src_presentation_web_0q~dt0o._.js +3 -0
  475. package/web/.next/server/chunks/ssr/src_presentation_web_0q~dt0o._.js.map +1 -0
  476. package/web/.next/server/chunks/ssr/src_presentation_web_11jrkxt._.js +3 -0
  477. package/web/.next/server/chunks/ssr/src_presentation_web_11jrkxt._.js.map +1 -0
  478. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_1199d3x.js +3 -0
  479. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_1199d3x.js.map +1 -0
  480. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app__not-found_page_actions_0m2jqxx.js +3 -0
  481. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app__not-found_page_actions_0m2jqxx.js.map +1 -0
  482. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_version_page_actions_0krkh_0.js +3 -0
  483. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_version_page_actions_0krkh_0.js.map +1 -0
  484. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_load-settings_ts_0b8f3pf._.js +3 -0
  485. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_load-settings_ts_0b8f3pf._.js.map +1 -0
  486. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js +1 -1
  487. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js.map +1 -1
  488. package/web/.next/server/chunks/ssr/src_presentation_web_components_0sk2qdt._.js +1 -1
  489. package/web/.next/server/chunks/ssr/src_presentation_web_components_0sk2qdt._.js.map +1 -1
  490. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js +1 -1
  491. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js.map +1 -1
  492. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_0aji.op._.js +1 -1
  493. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_0aji.op._.js.map +1 -1
  494. package/web/.next/server/functions-config-manifest.json +11 -1
  495. package/web/.next/server/middleware/middleware-manifest.json +1 -27
  496. package/web/.next/server/middleware-build-manifest.js +5 -5
  497. package/web/.next/server/middleware-manifest.json +2 -32
  498. package/web/.next/server/middleware.js +5 -0
  499. package/web/.next/server/middleware.js.map +5 -0
  500. package/web/.next/server/middleware.js.nft.json +1 -0
  501. package/web/.next/server/pages/500.html +1 -1
  502. package/web/.next/server/server-reference-manifest.js +1 -1
  503. package/web/.next/server/server-reference-manifest.json +80 -56
  504. package/web/.next/static/chunks/00racug7sobut.js +1 -0
  505. package/web/.next/static/chunks/06sdx5zm71_u5.js +1 -0
  506. package/web/.next/static/chunks/{122mzkbtrj4-k.js → 071_2_.sfp-im.js} +2 -2
  507. package/web/.next/static/chunks/{0g-so1fagegtp.js → 08iq.j3rbmhbm.js} +1 -1
  508. package/web/.next/static/chunks/{0bdtgeoys8bq..js → 08iuksm8rvb09.js} +1 -1
  509. package/web/.next/static/chunks/{01~tm1-qp0baa.js → 08se-_opmk~.7.js} +1 -1
  510. package/web/.next/static/chunks/{17jsatqy81xc..js → 0icjwdqytqa_8.js} +2 -2
  511. package/web/.next/static/chunks/0r5dju6f1-i38.css +1 -0
  512. package/web/.next/static/chunks/{13xg0bjtuso~r.js → 0riti1bs-erm~.js} +1 -1
  513. package/web/.next/static/chunks/{0.2owry_sk_ak.js → 0s-e-ekdbgoqa.js} +1 -1
  514. package/web/.next/static/chunks/0t_48qc0x7bhs.js +3 -0
  515. package/web/.next/static/chunks/{0qz02~wj25f-f.js → 0u5.s.lv2bae5.js} +1 -1
  516. package/web/.next/static/chunks/{12pwrbjphv3z7.js → 0vgbvqu82ac1x.js} +1 -1
  517. package/web/.next/static/chunks/{0vlx6s5d1~d-w.js → 0wmckrtphfa12.js} +1 -1
  518. package/web/.next/static/chunks/0w~84g7r9307~.js +1 -0
  519. package/web/.next/static/chunks/0y1nwnouroh6k.js +1 -0
  520. package/web/.next/static/chunks/{07lrq10rx0tp1.js → 0~er~22zwvx0i.js} +1 -1
  521. package/web/.next/static/chunks/{0xs4~af3nc_15.js → 15lcx-697j_3z.js} +2 -2
  522. package/web/.next/static/chunks/{0rnvcu2blaow4.js → 15m2wfd5k_7fj.js} +1 -1
  523. package/web/.next/static/chunks/{turbopack-10upsk2jydmq4.js → turbopack-0ve8f54_veg.u.js} +1 -1
  524. package/web/.next/static/{CJ4Fr1ggL4xWEe_fapYLv → xP_-L4TLYvd3i_sEmljLs}/_clientMiddlewareManifest.js +1 -1
  525. package/web/public/apple-touch-icon.png +0 -0
  526. package/web/public/favicon-32x32.png +0 -0
  527. package/web/public/icon-192.png +0 -0
  528. package/web/public/icon-512.png +0 -0
  529. package/web/public/icons/agents/openai.svg +1 -1
  530. package/web/public/shipit-brain.png +0 -0
  531. package/web/public/shipit-icon.svg +68 -0
  532. package/web/public/shipit-logo.png +0 -0
  533. package/dist/src/presentation/web/components/common/shipit-ai-logo/shep-logo.d.ts.map +0 -1
  534. package/dist/src/presentation/web/components/common/shipit-ai-logo/shep-logo.js +0 -5
  535. package/dist/src/presentation/web/components/common/shipit-ai-logo/shep-logo.stories.d.ts.map +0 -1
  536. package/dist/src/presentation/web/middleware.d.ts.map +0 -1
  537. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.j0ktf._.js +0 -4
  538. package/web/.next/server/chunks/ssr/[root-of-the-server]__0.j0ktf._.js.map +0 -1
  539. package/web/.next/server/chunks/ssr/[root-of-the-server]__07m44ax._.js +0 -3
  540. package/web/.next/server/chunks/ssr/[root-of-the-server]__07m44ax._.js.map +0 -1
  541. package/web/.next/server/chunks/ssr/[root-of-the-server]__0frgz11._.js +0 -4
  542. package/web/.next/server/chunks/ssr/[root-of-the-server]__0frgz11._.js.map +0 -1
  543. package/web/.next/server/chunks/ssr/[root-of-the-server]__0oi7r67._.js +0 -4
  544. package/web/.next/server/chunks/ssr/[root-of-the-server]__0oi7r67._.js.map +0 -1
  545. package/web/.next/server/chunks/ssr/[root-of-the-server]__0pti1a3._.js +0 -4
  546. package/web/.next/server/chunks/ssr/[root-of-the-server]__0pti1a3._.js.map +0 -1
  547. package/web/.next/server/chunks/ssr/[root-of-the-server]__0s9k_s3._.js +0 -4
  548. package/web/.next/server/chunks/ssr/[root-of-the-server]__0s9k_s3._.js.map +0 -1
  549. package/web/.next/server/chunks/ssr/[root-of-the-server]__0v-vmgt._.js +0 -4
  550. package/web/.next/server/chunks/ssr/[root-of-the-server]__0v-vmgt._.js.map +0 -1
  551. package/web/.next/server/chunks/ssr/[root-of-the-server]__0yky~xo._.js +0 -4
  552. package/web/.next/server/chunks/ssr/[root-of-the-server]__0yky~xo._.js.map +0 -1
  553. package/web/.next/server/chunks/ssr/[root-of-the-server]__11dc42t._.js +0 -4
  554. package/web/.next/server/chunks/ssr/[root-of-the-server]__11dc42t._.js.map +0 -1
  555. package/web/.next/server/chunks/ssr/_0__4si~._.js +0 -4
  556. package/web/.next/server/chunks/ssr/_0__4si~._.js.map +0 -1
  557. package/web/.next/server/chunks/ssr/_0_m17kl._.js +0 -4
  558. package/web/.next/server/chunks/ssr/_0_m17kl._.js.map +0 -1
  559. package/web/.next/server/chunks/ssr/_0d4miu.._.js +0 -4
  560. package/web/.next/server/chunks/ssr/_0d4miu.._.js.map +0 -1
  561. package/web/.next/server/chunks/ssr/_0e8ern9._.js +0 -4
  562. package/web/.next/server/chunks/ssr/_0e8ern9._.js.map +0 -1
  563. package/web/.next/server/chunks/ssr/_0hovej-._.js +0 -6
  564. package/web/.next/server/chunks/ssr/_0hovej-._.js.map +0 -1
  565. package/web/.next/server/chunks/ssr/_0p3zs6p._.js +0 -3
  566. package/web/.next/server/chunks/ssr/_0p3zs6p._.js.map +0 -1
  567. package/web/.next/server/chunks/ssr/_0qpq3xl._.js +0 -3
  568. package/web/.next/server/chunks/ssr/_0qpq3xl._.js.map +0 -1
  569. package/web/.next/server/chunks/ssr/_0r.3n~3._.js +0 -4
  570. package/web/.next/server/chunks/ssr/_0r.3n~3._.js.map +0 -1
  571. package/web/.next/server/chunks/ssr/_0t59q8r._.js +0 -4
  572. package/web/.next/server/chunks/ssr/_0t59q8r._.js.map +0 -1
  573. package/web/.next/server/chunks/ssr/_0zk-h5w._.js +0 -4
  574. package/web/.next/server/chunks/ssr/_0zk-h5w._.js.map +0 -1
  575. package/web/.next/server/chunks/ssr/_0~ev6dw._.js +0 -6
  576. package/web/.next/server/chunks/ssr/_0~ev6dw._.js.map +0 -1
  577. package/web/.next/server/chunks/ssr/_1161g9x._.js +0 -4
  578. package/web/.next/server/chunks/ssr/_1161g9x._.js.map +0 -1
  579. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js +0 -3
  580. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js.map +0 -1
  581. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js +0 -3
  582. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js.map +0 -1
  583. package/web/.next/server/edge/chunks/0pax_next_dist_esm_build_templates_edge-wrapper_0atr6ca.js +0 -3
  584. package/web/.next/server/edge/chunks/11es_next_dist_esm_build_templates_edge-wrapper_0atr6ca.js.map +0 -1
  585. package/web/.next/server/edge/chunks/11es_next_dist_esm_build_templates_edge-wrapper_0xg0zx-.js +0 -3
  586. package/web/.next/server/edge/chunks/11es_next_dist_esm_build_templates_edge-wrapper_0xg0zx-.js.map +0 -1
  587. package/web/.next/server/edge/chunks/[root-of-the-server]__0m078x4._.js +0 -11
  588. package/web/.next/server/edge/chunks/[root-of-the-server]__0m078x4._.js.map +0 -1
  589. package/web/.next/static/chunks/0_9hv9_f66hur.js +0 -1
  590. package/web/.next/static/chunks/0dr6q94jmx86b.css +0 -1
  591. package/web/.next/static/chunks/0in40lx7y7f8o.js +0 -1
  592. package/web/.next/static/chunks/0rv6fo9ui94r9.js +0 -1
  593. package/web/.next/static/chunks/0t82zfhqgor5r.js +0 -1
  594. package/web/.next/static/chunks/0whetjaoa5y.l.js +0 -3
  595. package/web/public/favicon-dark.svg +0 -6
  596. package/web/public/favicon-light.svg +0 -6
  597. /package/web/.next/static/{CJ4Fr1ggL4xWEe_fapYLv → xP_-L4TLYvd3i_sEmljLs}/_buildManifest.js +0 -0
  598. /package/web/.next/static/{CJ4Fr1ggL4xWEe_fapYLv → xP_-L4TLYvd3i_sEmljLs}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.ts","../../../../../../packages/core/src/infrastructure/services/filesystem/shipit-ai-directory.service.ts","../../../../../../packages/core/src/infrastructure/services/folder-dialog.service.ts","../../../../../../packages/core/src/infrastructure/services/file-dialog.service.ts","../../../../../../node_modules/.pnpm/next%4016.2.2_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.59.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 * Compute Worktree Path\n *\n * Pure utility that computes the filesystem path for a feature's git worktree\n * given a repository path and branch name.\n *\n * Path format: ~/.shipit-ai/repos/<sha256-hash-prefix>/wt/<branch-slug>\n */\n\nimport { createHash } from 'node:crypto';\nimport { join } from 'node:path';\nimport { getShipitAiHomeDir } from '../filesystem/shipit-ai-directory.service';\n\n/**\n * Compute the worktree path for a given repository and branch.\n *\n * @param repoPath - Absolute path to the repository\n * @param branch - Git branch name (slashes are replaced with hyphens)\n * @returns Absolute path to the worktree directory under ~/.shipit-ai/repos/\n */\nexport function computeWorktreePath(repoPath: string, branch: string): string {\n // Normalize separators before hashing so C:\\foo and C:/foo produce the same hash\n const normalizedRepoPath = repoPath.replace(/\\\\/g, '/');\n const repoHash = createHash('sha256').update(normalizedRepoPath).digest('hex').slice(0, 16);\n const slug = branch.replace(/\\//g, '-');\n return join(getShipitAiHomeDir(), 'repos', repoHash, 'wt', slug).replace(/\\\\/g, '/');\n}\n","/**\n * Shipit AI Directory Service\n *\n * Manages the ~/.shipit-ai/ directory for global settings and data storage.\n * Ensures directory exists with correct permissions before database operations.\n *\n * Supports SHIPIT_AI_HOME env var for test isolation (overrides default ~/.shipit-ai/).\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 Shipit AI home directory.\n * Respects SHIPIT_AI_HOME env var for test isolation, falls back to ~/.shipit-ai/\n */\nfunction resolveShipitAiHomeDir(): string {\n return process.env.SHIPIT_AI_HOME ?? join(homedir(), '.shipit-ai');\n}\n\n/**\n * Gets the path to the Shipit AI home directory.\n * Uses SHIPIT_AI_HOME env var if set, otherwise ~/.shipit-ai/\n *\n * @returns Path to shipit-ai home directory\n */\nexport function getShipitAiHomeDir(): string {\n return resolveShipitAiHomeDir();\n}\n\n/**\n * Gets the path to the SQLite database file.\n *\n * @returns Path to the database file\n */\nexport function getShipitAiDbPath(): string {\n return join(resolveShipitAiHomeDir(), 'data');\n}\n\n/**\n * Gets the path to the daemon state file.\n * Uses SHIPIT_AI_HOME env var if set (for test isolation), otherwise ~/.shipit-ai/daemon.json\n *\n * @returns Path to daemon.json\n */\nexport function getDaemonStatePath(): string {\n return join(resolveShipitAiHomeDir(), 'daemon.json');\n}\n\n/**\n * Gets the path to the daemon log file.\n * Uses SHIPIT_AI_HOME env var if set (for test isolation), otherwise ~/.shipit-ai/daemon.log\n *\n * @returns Path to daemon.log\n */\nexport function getDaemonLogPath(): string {\n return join(resolveShipitAiHomeDir(), 'daemon.log');\n}\n\n/**\n * Ensures the shipit-ai 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 ensureShipitAiDirectory(): Promise<void> {\n const shipitAiDir = resolveShipitAiHomeDir();\n\n if (existsSync(shipitAiDir)) {\n return;\n }\n\n try {\n await mkdir(shipitAiDir, {\n recursive: true,\n mode: 0o700,\n });\n } catch (error) {\n throw new Error(\n `Failed to create Shipit AI directory at ${shipitAiDir}: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface FolderDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n}\n\nconst defaultDeps: FolderDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n};\n\n/**\n * Platform-specific commands that open a native OS folder picker dialog.\n * Each returns the chosen absolute folder path on stdout, or exits non-zero / returns empty on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'`,\n linux: `zenity --file-selection --directory --title=\"Select a repository folder\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\"`,\n};\n\nexport class FolderDialogService {\n private deps: FolderDialogDeps;\n\n constructor(deps: Partial<FolderDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native folder picker dialog and returns the selected absolute path.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFolder(): string | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const trimmed = result.trim();\n return trimmed.length > 0 ? trimmed : null;\n } catch (error: unknown) {\n // User cancelled the dialog — exit code 1 from osascript/zenity/powershell\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\n}\n","import { execSync } from 'node:child_process';\nimport { statSync } from 'node:fs';\n\nexport interface FileAttachment {\n path: string;\n name: string;\n size: number;\n}\n\nexport interface FileDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n stat: (filePath: string) => { size: number };\n}\n\nconst defaultDeps: FileDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n stat: (filePath) => statSync(filePath),\n};\n\n/**\n * Platform-specific commands that open a native OS file picker dialog.\n * Each returns newline-separated absolute file paths on stdout, or exits non-zero on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'set f to (choose file with prompt \"Select files\" with multiple selections allowed)' -e 'set paths to {}' -e 'repeat with i in f' -e 'copy POSIX path of i to end of paths' -e 'end repeat' -e 'set text item delimiters to \"\\n\"' -e 'paths as text'`,\n linux: `zenity --file-selection --multiple --separator=\"\\\\n\" --title=\"Select files\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $d = New-Object System.Windows.Forms.OpenFileDialog; $d.Multiselect = $true; $d.Title = 'Select files'; if ($d.ShowDialog() -eq 'OK') { $d.FileNames -join [char]10 } else { exit 1 }\"`,\n};\n\nexport class FileDialogService {\n private deps: FileDialogDeps;\n\n constructor(deps: Partial<FileDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native file picker dialog and returns metadata for each selected file.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFiles(): FileAttachment[] | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const paths = result\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n\n if (paths.length === 0) return null;\n\n return paths.map((filePath) => {\n const stats = this.deps.stat(filePath);\n return {\n path: filePath,\n name: filePath.split(/[/\\\\]/).pop()!,\n size: stats.size,\n };\n });\n } catch (error: unknown) {\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\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, setRequestMeta } 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 // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\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 (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\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.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 isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n 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 let parentSpan;\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 // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\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 (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\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), undefined, !isWrappedByNextServer);\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 { getShipitAiHomeDir } from '@/lib/core-utils';\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 SHIPIT_AI_HOME/attachments\n const attachmentsRoot = resolve(getShipitAiHomeDir(), 'attachments');\n if (!resolve(path).startsWith(attachmentsRoot)) {\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":["resolveShipitAiHomeDir","process","env","SHIPIT_AI_HOME","getShipitAiHomeDir","getShipitAiDbPath","getDaemonStatePath","getDaemonLogPath","ensureShipitAiDirectory","shipitAiDir","recursive","mode","error","Error","message","String","MIME_MAP","findAttachmentFallback","requestedPath","attachmentsRoot","filename","dirs","withFileTypes","entry","isDirectory","candidate","name","mimeTypeHint","serveFile","filePath","then","buffer","ext","toLowerCase","contentType","headers","GET","request","path","nextUrl","searchParams","get","json","status","startsWith","fallbackPath"],"mappings":"y/CASA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCDA,EAAA,CAAA,CAAA,OACA,IAAA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,MAgBO,SAASI,IACd,OAAOJ,AAVAC,QAAQC,GAAG,CAACC,cAAc,EAAI,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,CAAA,EAAA,EAAA,OAAA,AAAO,IAAI,aAWvD,oEDVO,SAAS,AAAoB,CAAgB,CAAE,CAAc,EAElE,IAAM,EAAqB,EAAS,OAAO,CAAC,MAAO,KAC7C,EAAW,CAAA,EAAA,EAAA,UAAU,AAAV,EAAW,UAAU,MAAM,CAAC,GAAoB,MAAM,CAAC,OAAO,KAAK,CAAC,EAAG,IAClF,EAAO,EAAO,OAAO,CAAC,MAAO,KACnC,MAAO,CAAA,EAAA,EAAA,IAAI,AAAJ,EAAK,IAAsB,QAAS,EAAU,KAAM,GAAM,OAAO,CAAC,MAAO,IAClF,UE1BA,IAAA,EAAA,EAAA,CAAA,CAAA,MAOsC,CAC1B,QAAQ,QAEpB,AAF4B,CCO5B,IAAM,EAA8B,CAClC,SAAU,QAAQ,QAAQ,CAC1B,KAAM,CAAC,EAAK,IAAS,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,EAAK,GACnC,KAAM,AAAC,GAAa,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,EA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L,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,CACf,wCACA,CACJ,EACJ","ignoreList":[4]}
1
+ {"version":3,"sources":["../../../../../../packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.ts","../../../../../../packages/core/src/infrastructure/services/filesystem/shipit-ai-directory.service.ts","../../../../../../packages/core/src/infrastructure/services/folder-dialog.service.ts","../../../../../../packages/core/src/infrastructure/services/file-dialog.service.ts","../../../../../../node_modules/.pnpm/next%4016.2.2_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.59.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 * Compute Worktree Path\n *\n * Pure utility that computes the filesystem path for a feature's git worktree\n * given a repository path and branch name.\n *\n * Path format: ~/.shipit-ai/repos/<sha256-hash-prefix>/wt/<branch-slug>\n */\n\nimport { createHash } from 'node:crypto';\nimport { join } from 'node:path';\nimport { getShipitAiHomeDir } from '../filesystem/shipit-ai-directory.service';\n\n/**\n * Compute the worktree path for a given repository and branch.\n *\n * @param repoPath - Absolute path to the repository\n * @param branch - Git branch name (slashes are replaced with hyphens)\n * @returns Absolute path to the worktree directory under ~/.shipit-ai/repos/\n */\nexport function computeWorktreePath(repoPath: string, branch: string): string {\n // Normalize separators before hashing so C:\\foo and C:/foo produce the same hash\n const normalizedRepoPath = repoPath.replace(/\\\\/g, '/');\n const repoHash = createHash('sha256').update(normalizedRepoPath).digest('hex').slice(0, 16);\n const slug = branch.replace(/\\//g, '-');\n return join(getShipitAiHomeDir(), 'repos', repoHash, 'wt', slug).replace(/\\\\/g, '/');\n}\n","/**\n * ShipIT AI Directory Service\n *\n * Manages the ~/.shipit-ai/ directory for global settings and data storage.\n * Ensures directory exists with correct permissions before database operations.\n *\n * Supports SHIPIT_AI_HOME env var for test isolation (overrides default ~/.shipit-ai/).\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 ShipIT AI home directory.\n * Respects SHIPIT_AI_HOME env var for test isolation, falls back to ~/.shipit-ai/\n */\nfunction resolveShipitAiHomeDir(): string {\n return process.env.SHIPIT_AI_HOME ?? join(homedir(), '.shipit-ai');\n}\n\n/**\n * Gets the path to the ShipIT AI home directory.\n * Uses SHIPIT_AI_HOME env var if set, otherwise ~/.shipit-ai/\n *\n * @returns Path to shipit-ai home directory\n */\nexport function getShipitAiHomeDir(): string {\n return resolveShipitAiHomeDir();\n}\n\n/**\n * Gets the path to the SQLite database file.\n *\n * @returns Path to the database file\n */\nexport function getShipitAiDbPath(): string {\n return join(resolveShipitAiHomeDir(), 'data');\n}\n\n/**\n * Gets the path to the daemon state file.\n * Uses SHIPIT_AI_HOME env var if set (for test isolation), otherwise ~/.shipit-ai/daemon.json\n *\n * @returns Path to daemon.json\n */\nexport function getDaemonStatePath(): string {\n return join(resolveShipitAiHomeDir(), 'daemon.json');\n}\n\n/**\n * Gets the path to the daemon log file.\n * Uses SHIPIT_AI_HOME env var if set (for test isolation), otherwise ~/.shipit-ai/daemon.log\n *\n * @returns Path to daemon.log\n */\nexport function getDaemonLogPath(): string {\n return join(resolveShipitAiHomeDir(), 'daemon.log');\n}\n\n/**\n * Ensures the shipit-ai 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 ensureShipitAiDirectory(): Promise<void> {\n const shipitAiDir = resolveShipitAiHomeDir();\n\n if (existsSync(shipitAiDir)) {\n return;\n }\n\n try {\n await mkdir(shipitAiDir, {\n recursive: true,\n mode: 0o700,\n });\n } catch (error) {\n throw new Error(\n `Failed to create ShipIT AI directory at ${shipitAiDir}: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface FolderDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n}\n\nconst defaultDeps: FolderDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n};\n\n/**\n * Platform-specific commands that open a native OS folder picker dialog.\n * Each returns the chosen absolute folder path on stdout, or exits non-zero / returns empty on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'POSIX path of (choose folder with prompt \"Select a repository folder\")'`,\n linux: `zenity --file-selection --directory --title=\"Select a repository folder\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; $f.Description = 'Select a repository folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath } else { exit 1 }\"`,\n};\n\nexport class FolderDialogService {\n private deps: FolderDialogDeps;\n\n constructor(deps: Partial<FolderDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native folder picker dialog and returns the selected absolute path.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFolder(): string | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const trimmed = result.trim();\n return trimmed.length > 0 ? trimmed : null;\n } catch (error: unknown) {\n // User cancelled the dialog — exit code 1 from osascript/zenity/powershell\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\n}\n","import { execSync } from 'node:child_process';\nimport { statSync } from 'node:fs';\n\nexport interface FileAttachment {\n path: string;\n name: string;\n size: number;\n}\n\nexport interface FileDialogDeps {\n platform: NodeJS.Platform;\n exec: (cmd: string, opts?: { encoding: BufferEncoding; timeout?: number }) => string;\n stat: (filePath: string) => { size: number };\n}\n\nconst defaultDeps: FileDialogDeps = {\n platform: process.platform,\n exec: (cmd, opts) => execSync(cmd, opts) as unknown as string,\n stat: (filePath) => statSync(filePath),\n};\n\n/**\n * Platform-specific commands that open a native OS file picker dialog.\n * Each returns newline-separated absolute file paths on stdout, or exits non-zero on cancel.\n */\nconst PLATFORM_COMMANDS: Record<string, string> = {\n darwin: `osascript -e 'set f to (choose file with prompt \"Select files\" with multiple selections allowed)' -e 'set paths to {}' -e 'repeat with i in f' -e 'copy POSIX path of i to end of paths' -e 'end repeat' -e 'set text item delimiters to \"\\n\"' -e 'paths as text'`,\n linux: `zenity --file-selection --multiple --separator=\"\\\\n\" --title=\"Select files\" 2>/dev/null`,\n win32: `powershell -NoProfile -Command \"Add-Type -AssemblyName System.Windows.Forms; $d = New-Object System.Windows.Forms.OpenFileDialog; $d.Multiselect = $true; $d.Title = 'Select files'; if ($d.ShowDialog() -eq 'OK') { $d.FileNames -join [char]10 } else { exit 1 }\"`,\n};\n\nexport class FileDialogService {\n private deps: FileDialogDeps;\n\n constructor(deps: Partial<FileDialogDeps> = {}) {\n this.deps = { ...defaultDeps, ...deps };\n }\n\n /** Returns the OS-specific command string, or null if the platform is unsupported. */\n getCommand(): string | null {\n return PLATFORM_COMMANDS[this.deps.platform] ?? null;\n }\n\n /**\n * Opens a native file picker dialog and returns metadata for each selected file.\n * Returns `null` if the user cancels the dialog.\n * Throws if the platform is unsupported or the command fails unexpectedly.\n */\n pickFiles(): FileAttachment[] | null {\n const command = this.getCommand();\n if (!command) {\n throw new Error(`Unsupported platform: ${this.deps.platform}`);\n }\n\n try {\n const result = this.deps.exec(command, { encoding: 'utf-8', timeout: 60_000 });\n const paths = result\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n\n if (paths.length === 0) return null;\n\n return paths.map((filePath) => {\n const stats = this.deps.stat(filePath);\n return {\n path: filePath,\n name: filePath.split(/[/\\\\]/).pop()!,\n size: stats.size,\n };\n });\n } catch (error: unknown) {\n if (isExecError(error) && error.status === 1) {\n return null;\n }\n throw error;\n }\n }\n}\n\nfunction isExecError(error: unknown): error is { status: number } {\n return typeof error === 'object' && error !== null && 'status' in error;\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, setRequestMeta } 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 // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\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 (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\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.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 isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n 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 let parentSpan;\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 // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\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 (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\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), undefined, !isWrappedByNextServer);\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 { getShipitAiHomeDir } from '@/lib/core-utils';\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 SHIPIT_AI_HOME/attachments\n const attachmentsRoot = resolve(getShipitAiHomeDir(), 'attachments');\n if (!resolve(path).startsWith(attachmentsRoot)) {\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":["resolveShipitAiHomeDir","process","env","SHIPIT_AI_HOME","getShipitAiHomeDir","getShipitAiDbPath","getDaemonStatePath","getDaemonLogPath","ensureShipitAiDirectory","shipitAiDir","recursive","mode","error","Error","message","String","MIME_MAP","findAttachmentFallback","requestedPath","attachmentsRoot","filename","dirs","withFileTypes","entry","isDirectory","candidate","name","mimeTypeHint","serveFile","filePath","then","buffer","ext","toLowerCase","contentType","headers","GET","request","path","nextUrl","searchParams","get","json","status","startsWith","fallbackPath"],"mappings":"y/CASA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OCDA,EAAA,CAAA,CAAA,OACA,IAAA,EAAA,EAAA,CAAA,CAAA,OAEA,EAAA,EAAA,CAAA,CAAA,MAgBO,SAASI,IACd,OAAOJ,AAVAC,QAAQC,GAAG,CAACC,cAAc,EAAI,CAAA,EAAA,EAAA,IAAA,AAAI,EAAC,CAAA,EAAA,EAAA,OAAA,AAAO,IAAI,aAWvD,oEDVO,SAAS,AAAoB,CAAgB,CAAE,CAAc,EAElE,IAAM,EAAqB,EAAS,OAAO,CAAC,MAAO,KAC7C,EAAW,CAAA,EAAA,EAAA,UAAU,AAAV,EAAW,UAAU,MAAM,CAAC,GAAoB,MAAM,CAAC,OAAO,KAAK,CAAC,EAAG,IAClF,EAAO,EAAO,OAAO,CAAC,MAAO,KACnC,MAAO,CAAA,EAAA,EAAA,IAAI,AAAJ,EAAK,IAAsB,QAAS,EAAU,KAAM,GAAM,OAAO,CAAC,MAAO,IAClF,UE1BA,IAAA,EAAA,EAAA,CAAA,CAAA,MAOsC,CAC1B,QAAQ,QAEpB,AAF4B,CCO5B,IAAM,EAA8B,CAClC,SAAU,QAAQ,QAAQ,CAC1B,KAAM,CAAC,EAAK,IAAS,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,EAAK,GACnC,KAAM,AAAC,GAAa,CAAA,EAAA,EAAA,QAAA,AAAQ,EAAC,EAC/B,EAMM,EAA4C,CAChD,OAAQ,CAAC;AAAA,qBAAiQ,CAAC,C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,EACJ","ignoreList":[4]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/presentation/web/lib/api-helpers.ts","../../../../../../src/presentation/web/lib/session-scanner.ts","../../../../../../src/presentation/web/app/api/sessions/route.ts","../../../../../../node_modules/.pnpm/next%4016.2.2_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.59.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 JSON error response. For 500-level errors, always uses a generic\n * message to prevent internal detail leakage. The actual error is logged\n * server-side for debugging.\n */\nexport function apiError(\n status: number,\n publicMessage: string,\n internalError?: unknown\n): NextResponse {\n if (internalError) {\n const detail = internalError instanceof Error ? internalError.message : String(internalError);\n // eslint-disable-next-line no-console\n console.error(`[API ${status}] ${publicMessage}: ${detail}`);\n }\n return NextResponse.json({ error: publicMessage }, { status });\n}\n\n/**\n * Validate a required query parameter. Returns the trimmed value or an\n * error response.\n */\nexport function validateParam(value: string | null, paramName: string): string | NextResponse {\n if (!value?.trim()) {\n return apiError(400, `${paramName} is required`);\n }\n return value.trim();\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 shipitAiHome = join(homedir(), '.shipit-ai').replace(/\\\\/g, '/');\n const shipitAiWorktreePrefix = claudeEncodePath(join(shipitAiHome, 'repos', repoHash));\n const shipitAiMatches = allDirs.filter(\n (d) => d.startsWith(shipitAiWorktreePrefix) && !prefixMatches.includes(d) && d !== dirName\n );\n\n const worktreeDirs = [...prefixMatches, ...shipitAiMatches];\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 { scanSessionsForPath } from '@/lib/session-scanner';\nimport { apiError } from '@/lib/api-helpers';\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(500, 'Failed to list sessions', 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, setRequestMeta } 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 // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\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 (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\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.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 isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n 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 let parentSpan;\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 // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\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 (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\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), undefined, !isWrappedByNextServer);\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":["apiError","status","publicMessage","internalError","detail","Error","message","String","console","error","json","validateParam","value","paramName","trim","claudeEncodePath","p","replace","cursorEncodePath","extractText","content","Array","isArray","block","b","type","text","PREVIEW_READ_BYTES","collectJsonlFiles","projectDir","entries","jsonlFiles","filter","e","endsWith","fileInfos","Promise","allSettled","map","name","filePath","s","mtime","getTime","r","parseClaudeSession","fileName","repositoryPath","createReadStream","id","preview","firstTimestamp","messageCount","head","resolve","chunks","size","stream","end","on","chunk","push","length","Buffer","concat","toString","lines","split","l","line","entry","JSON","parse","role","timestamp","mtimeIso","Date","toISOString","agentType","firstMessageAt","lastMessageAt","createdAt","projectPath","_mtime","scanClaudeSessions","limit","includeWorktrees","dirName","projectsRoot","primaryDir","allFiles","allDirs","prefixMatches","d","startsWith","normalizedRepoPath","repoHash","update","digest","slice","shipitAiHome","shipitAiWorktreePrefix","shipitAiMatches","includes","worktreeDirs","worktreeResults","all","files","valid","sort","a","results","fi","parseCursorSession","scanCursorSessions","transcriptsDir","entryPath","isFile","isDirectory","jsonlPath","jsonlStat","v","scanSessionsForPath","claudeSessions","cursorSessions","Math","min","dynamic","allSessions","GET","request","url","URL","searchParams","get","parseInt","sessions"],"mappings":"qxCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,yBAOO,SACLC,AADcD,CACA,CACdE,CAAqB,CACrBC,CAAuB,EAEvB,GAAIA,EAAe,CACjB,IAAMC,EAASD,aAAyBE,MAAQF,EAAcG,OAAO,CAAGC,OAAOJ,GAE/EK,QAAQC,KAAK,CAAC,CAAC,KAAK,EAAER,EAAO,EAAE,EAAEC,EAAc,EAAE,EAAEE,EAAAA,CAAQ,CAC7D,CACA,OAAO,EAAA,YAAY,CAACM,IAAI,CAAC,CAAED,MAAOP,CAAc,EAAG,QAAED,CAAO,EAC9D,4BCXA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAsBA,SAASc,EAAiBC,CAAS,EACjC,OAAOA,EAAEC,OAAO,CAAC,UAAW,IAC9B,CAaA,SAASE,EAAYC,C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EACJ","ignoreList":[3]}
1
+ {"version":3,"sources":["../../../../../../src/presentation/web/lib/api-helpers.ts","../../../../../../src/presentation/web/lib/session-scanner.ts","../../../../../../src/presentation/web/app/api/sessions/route.ts","../../../../../../node_modules/.pnpm/next%4016.2.2_%40babel%2Bcore%407.29.0_%40playwright%2Btest%401.59.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 JSON error response. For 500-level errors, always uses a generic\n * message to prevent internal detail leakage. The actual error is logged\n * server-side for debugging.\n */\nexport function apiError(\n status: number,\n publicMessage: string,\n internalError?: unknown\n): NextResponse {\n if (internalError) {\n const detail = internalError instanceof Error ? internalError.message : String(internalError);\n // eslint-disable-next-line no-console\n console.error(`[API ${status}] ${publicMessage}: ${detail}`);\n }\n return NextResponse.json({ error: publicMessage }, { status });\n}\n\n/**\n * Validate a required query parameter. Returns the trimmed value or an\n * error response.\n */\nexport function validateParam(value: string | null, paramName: string): string | NextResponse {\n if (!value?.trim()) {\n return apiError(400, `${paramName} is required`);\n }\n return value.trim();\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/.shipit-ai/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/.shipit-ai/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 shipitAiHome = join(homedir(), '.shipit-ai').replace(/\\\\/g, '/');\n const shipitAiWorktreePrefix = claudeEncodePath(join(shipitAiHome, 'repos', repoHash));\n const shipitAiMatches = allDirs.filter(\n (d) => d.startsWith(shipitAiWorktreePrefix) && !prefixMatches.includes(d) && d !== dirName\n );\n\n const worktreeDirs = [...prefixMatches, ...shipitAiMatches];\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 { scanSessionsForPath } from '@/lib/session-scanner';\nimport { apiError } from '@/lib/api-helpers';\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(500, 'Failed to list sessions', 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, setRequestMeta } 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 // The static import is used for initialization (methods, dynamic, etc.).\n userland: userland,\n // In Turbopack dev mode, also provide a getter that calls require() on every\n // request. This re-reads from devModuleCache so HMR updates are picked up,\n // and the async wrapper unwraps async-module Promises (ESM-only\n // serverExternalPackages) automatically.\n ...process.env.TURBOPACK && process.env.__NEXT_DEV_SERVER ? {\n getUserland: ()=>import(\"INNER_APP_ROUTE\")\n } : {}\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 (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\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.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 isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n 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 let parentSpan;\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 // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\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 (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\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), undefined, !isWrappedByNextServer);\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":["apiError","status","publicMessage","internalError","detail","Error","message","String","console","error","json","validateParam","value","paramName","trim","claudeEncodePath","p","replace","cursorEncodePath","extractText","content","Array","isArray","block","b","type","text","PREVIEW_READ_BYTES","collectJsonlFiles","projectDir","entries","jsonlFiles","filter","e","endsWith","fileInfos","Promise","allSettled","map","name","filePath","s","mtime","getTime","r","parseClaudeSession","fileName","repositoryPath","createReadStream","id","preview","firstTimestamp","messageCount","head","resolve","chunks","size","stream","end","on","chunk","push","length","Buffer","concat","toString","lines","split","l","line","entry","JSON","parse","role","timestamp","mtimeIso","Date","toISOString","agentType","firstMessageAt","lastMessageAt","createdAt","projectPath","_mtime","scanClaudeSessions","limit","includeWorktrees","dirName","projectsRoot","primaryDir","allFiles","allDirs","prefixMatches","d","startsWith","normalizedRepoPath","repoHash","update","digest","slice","shipitAiHome","shipitAiWorktreePrefix","shipitAiMatches","includes","worktreeDirs","worktreeResults","all","files","valid","sort","a","results","fi","parseCursorSession","scanCursorSessions","transcriptsDir","entryPath","isFile","isDirectory","jsonlPath","jsonlStat","v","scanSessionsForPath","claudeSessions","cursorSessions","Math","min","dynamic","allSessions","GET","request","url","URL","searchParams","get","parseInt","sessions"],"mappings":"qxCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,yBAOO,SACLC,AADcD,CACA,CACdE,CAAqB,CACrBC,CAAuB,EAEvB,GAAIA,EAAe,CACjB,IAAMC,EAASD,aAAyBE,MAAQF,EAAcG,OAAO,CAAGC,OAAOJ,GAE/EK,QAAQC,KAAK,CAAC,CAAC,KAAK,EAAER,EAAO,EAAE,EAAEC,EAAc,EAAE,EAAEE,EAAAA,CAAQ,CAC7D,CACA,OAAO,EAAA,YAAY,CAACM,IAAI,CAAC,CAAED,MAAOP,CAAc,EAAG,QAAED,CAAO,EAC9D,4BCXA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAsBA,SAASc,EAAiBC,CAAS,EACjC,OAAOA,EAAEC,OAAO,CAAC,UAAW,IAC9B,CAaA,SAASE,EAAYC,CAAgB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