@baique/pi-web-sky 0.1.33 → 0.1.34

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 (297) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +19 -10
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/react-loadable-manifest.json +27 -6
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/routes-manifest.json +70 -0
  8. package/.next/server/app/_global-error/page.js +1 -1
  9. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/_global-error.html +1 -1
  11. package/.next/server/app/_global-error.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found/page.js +1 -1
  16. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/_not-found.html +1 -1
  18. package/.next/server/app/_not-found.rsc +3 -3
  19. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  21. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  22. package/.next/server/app/api/agent/[id]/bash-output/route.js +2 -2
  23. package/.next/server/app/api/agent/[id]/events/route.js +31 -2
  24. package/.next/server/app/api/agent/[id]/events/route.js.nft.json +1 -1
  25. package/.next/server/app/api/agent/[id]/route.js +30 -1
  26. package/.next/server/app/api/agent/[id]/route.js.nft.json +1 -1
  27. package/.next/server/app/api/agent/new/route.js +1 -1
  28. package/.next/server/app/api/agent/new/route.js.nft.json +1 -1
  29. package/.next/server/app/api/agent/running/route.js +30 -1
  30. package/.next/server/app/api/agent/running/route.js.nft.json +1 -1
  31. package/.next/server/app/api/app-update/route.js +1 -1
  32. package/.next/server/app/api/auth/all-providers/route.js +1 -1
  33. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -30
  34. package/.next/server/app/api/auth/api-key/[provider]/route.js.nft.json +1 -1
  35. package/.next/server/app/api/auth/login/[provider]/route.js +3 -3
  36. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -30
  37. package/.next/server/app/api/auth/logout/[provider]/route.js.nft.json +1 -1
  38. package/.next/server/app/api/auth/providers/route.js +1 -1
  39. package/.next/server/app/api/boards/[id]/canvas/route.js +1 -0
  40. package/.next/server/app/api/boards/[id]/canvas/route.js.nft.json +1 -0
  41. package/.next/server/app/api/boards/[id]/canvas/route_client-reference-manifest.js +1 -0
  42. package/.next/server/app/api/boards/[id]/edges/[eid]/route.js +1 -0
  43. package/.next/server/app/api/boards/[id]/edges/[eid]/route.js.nft.json +1 -0
  44. package/.next/server/app/api/boards/[id]/edges/[eid]/route_client-reference-manifest.js +1 -0
  45. package/.next/server/app/api/boards/[id]/edges/route.js +1 -0
  46. package/.next/server/app/api/boards/[id]/edges/route.js.nft.json +1 -0
  47. package/.next/server/app/api/boards/[id]/edges/route_client-reference-manifest.js +1 -0
  48. package/.next/server/app/api/boards/[id]/nodes/[nid]/route.js +1 -0
  49. package/.next/server/app/api/boards/[id]/nodes/[nid]/route.js.nft.json +1 -0
  50. package/.next/server/app/api/boards/[id]/nodes/[nid]/route_client-reference-manifest.js +1 -0
  51. package/.next/server/app/api/boards/[id]/nodes/route.js +1 -0
  52. package/.next/server/app/api/boards/[id]/nodes/route.js.nft.json +1 -0
  53. package/.next/server/app/api/boards/[id]/nodes/route_client-reference-manifest.js +1 -0
  54. package/.next/server/app/api/boards/[id]/route.js +1 -0
  55. package/.next/server/app/api/boards/[id]/route.js.nft.json +1 -0
  56. package/.next/server/app/api/boards/[id]/route_client-reference-manifest.js +1 -0
  57. package/.next/server/app/api/boards/reorder/route.js +1 -0
  58. package/.next/server/app/api/boards/reorder/route.js.nft.json +1 -0
  59. package/.next/server/app/api/boards/reorder/route_client-reference-manifest.js +1 -0
  60. package/.next/server/app/api/boards/route.js +1 -0
  61. package/.next/server/app/api/boards/route.js.nft.json +1 -0
  62. package/.next/server/app/api/boards/route_client-reference-manifest.js +1 -0
  63. package/.next/server/app/api/cwd/browse/route.js +1 -1
  64. package/.next/server/app/api/cwd/validate/route.js +2 -2
  65. package/.next/server/app/api/default-cwd/route.js +2 -2
  66. package/.next/server/app/api/file-index/route.js +2 -2
  67. package/.next/server/app/api/files/[...path]/route.js +3 -3
  68. package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -1
  69. package/.next/server/app/api/git/diff/route.js +1 -35
  70. package/.next/server/app/api/git/diff/route.js.nft.json +1 -1
  71. package/.next/server/app/api/git/status/route.js +1 -35
  72. package/.next/server/app/api/git/status/route.js.nft.json +1 -1
  73. package/.next/server/app/api/home/route.js +1 -1
  74. package/.next/server/app/api/mcp/route.js +2 -2
  75. package/.next/server/app/api/models/route.js +2 -2
  76. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  77. package/.next/server/app/api/models-config/discover/route.js +1 -1
  78. package/.next/server/app/api/models-config/route.js +1 -1
  79. package/.next/server/app/api/models-config/test/route.js +1 -1
  80. package/.next/server/app/api/plugins/route.js +2 -2
  81. package/.next/server/app/api/project-trust/route.js +30 -1
  82. package/.next/server/app/api/project-trust/route.js.nft.json +1 -1
  83. package/.next/server/app/api/quota/route.js +1 -1
  84. package/.next/server/app/api/search/route.js +2 -2
  85. package/.next/server/app/api/sessions/[id]/auto-name/route.js +31 -2
  86. package/.next/server/app/api/sessions/[id]/auto-name/route.js.nft.json +1 -1
  87. package/.next/server/app/api/sessions/[id]/context/route.js +30 -1
  88. package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +1 -1
  89. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +2 -2
  90. package/.next/server/app/api/sessions/[id]/export/route.js +2 -2
  91. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  92. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  93. package/.next/server/app/api/sessions/[id]/state/route.js +30 -1
  94. package/.next/server/app/api/sessions/[id]/state/route.js.nft.json +1 -1
  95. package/.next/server/app/api/sessions/[id]/todos/route.js +30 -1
  96. package/.next/server/app/api/sessions/[id]/todos/route.js.nft.json +1 -1
  97. package/.next/server/app/api/sessions/route.js +30 -1
  98. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  99. package/.next/server/app/api/skills/check/route.js +1 -1
  100. package/.next/server/app/api/skills/install/route.js +2 -2
  101. package/.next/server/app/api/skills/route.js +2 -2
  102. package/.next/server/app/api/skills/search/route.js +1 -1
  103. package/.next/server/app/api/skills/update/route.js +1 -1
  104. package/.next/server/app/api/tasks/[id]/board/route.js +1 -0
  105. package/.next/server/app/api/tasks/[id]/board/route.js.nft.json +1 -0
  106. package/.next/server/app/api/tasks/[id]/board/route_client-reference-manifest.js +1 -0
  107. package/.next/server/app/api/tasks/[id]/route.js +1 -1
  108. package/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
  109. package/.next/server/app/api/tasks/reorder/route.js +1 -30
  110. package/.next/server/app/api/tasks/reorder/route.js.nft.json +1 -1
  111. package/.next/server/app/api/tasks/route.js +1 -30
  112. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  113. package/.next/server/app/api/terminal/[id]/events/route.js +3 -3
  114. package/.next/server/app/api/terminal/[id]/route.js +2 -2
  115. package/.next/server/app/api/terminal/route.js +2 -2
  116. package/.next/server/app/api/worktrees/route.js +2 -2
  117. package/.next/server/app/favicon.ico/route.js +1 -1
  118. package/.next/server/app/index.html +1 -1
  119. package/.next/server/app/index.rsc +6 -6
  120. package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -6
  121. package/.next/server/app/index.segments/_full.segment.rsc +6 -6
  122. package/.next/server/app/index.segments/_tree.segment.rsc +3 -3
  123. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  124. package/.next/server/app/page.js +8 -8
  125. package/.next/server/app/page_client-reference-manifest.js +1 -1
  126. package/.next/server/app-paths-manifest.json +19 -10
  127. package/.next/server/chunks/2092.js +30 -0
  128. package/.next/server/chunks/2404.js +1 -1
  129. package/.next/server/chunks/402.js +1 -1
  130. package/.next/server/chunks/{3379.js → 5760.js} +1 -1
  131. package/.next/server/chunks/5794.js +35 -0
  132. package/.next/server/chunks/6429.js +1 -0
  133. package/.next/server/chunks/7513.js +1 -1
  134. package/.next/server/chunks/898.js +30 -0
  135. package/.next/server/middleware-build-manifest.js +1 -1
  136. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  137. package/.next/server/pages/404.html +1 -1
  138. package/.next/server/pages/500.html +1 -1
  139. package/.next/static/chunks/3178.73f47c1845fe51df.js +259 -0
  140. package/.next/static/chunks/3266.a491c09b3f6b57e6.js +1 -0
  141. package/.next/static/chunks/{3308.be8762955e7155d1.js → 3308.857c554428b3294e.js} +1 -1
  142. package/.next/static/chunks/3744.d362159c4d7b91f4.js +1 -0
  143. package/.next/static/chunks/54a60aa6.0e43cde7298ebcb7.js +78 -0
  144. package/.next/static/chunks/5518.79782f5b65bbefd6.js +1 -0
  145. package/.next/static/chunks/70e0d97a.337966195abe6fe0.js +1 -0
  146. package/.next/static/chunks/7268.7bf6d531e3905a52.js +1 -0
  147. package/.next/static/chunks/app/_global-error/page-9cbffd52890a7ee2.js +1 -0
  148. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-9cbffd52890a7ee2.js +1 -0
  149. package/.next/static/chunks/app/api/agent/[id]/events/route-9cbffd52890a7ee2.js +1 -0
  150. package/.next/static/chunks/app/api/agent/[id]/route-9cbffd52890a7ee2.js +1 -0
  151. package/.next/static/chunks/app/api/agent/new/route-9cbffd52890a7ee2.js +1 -0
  152. package/.next/static/chunks/app/api/agent/running/route-9cbffd52890a7ee2.js +1 -0
  153. package/.next/static/chunks/app/api/app-update/route-9cbffd52890a7ee2.js +1 -0
  154. package/.next/static/chunks/app/api/auth/all-providers/route-9cbffd52890a7ee2.js +1 -0
  155. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-9cbffd52890a7ee2.js +1 -0
  156. package/.next/static/chunks/app/api/auth/login/[provider]/route-9cbffd52890a7ee2.js +1 -0
  157. package/.next/static/chunks/app/api/auth/logout/[provider]/route-9cbffd52890a7ee2.js +1 -0
  158. package/.next/static/chunks/app/api/auth/providers/route-9cbffd52890a7ee2.js +1 -0
  159. package/.next/static/chunks/app/api/boards/[id]/canvas/route-9cbffd52890a7ee2.js +1 -0
  160. package/.next/static/chunks/app/api/boards/[id]/edges/[eid]/route-9cbffd52890a7ee2.js +1 -0
  161. package/.next/static/chunks/app/api/boards/[id]/edges/route-9cbffd52890a7ee2.js +1 -0
  162. package/.next/static/chunks/app/api/boards/[id]/nodes/[nid]/route-9cbffd52890a7ee2.js +1 -0
  163. package/.next/static/chunks/app/api/boards/[id]/nodes/route-9cbffd52890a7ee2.js +1 -0
  164. package/.next/static/chunks/app/api/boards/[id]/route-9cbffd52890a7ee2.js +1 -0
  165. package/.next/static/chunks/app/api/boards/reorder/route-9cbffd52890a7ee2.js +1 -0
  166. package/.next/static/chunks/app/api/boards/route-9cbffd52890a7ee2.js +1 -0
  167. package/.next/static/chunks/app/api/cwd/browse/route-9cbffd52890a7ee2.js +1 -0
  168. package/.next/static/chunks/app/api/cwd/validate/route-9cbffd52890a7ee2.js +1 -0
  169. package/.next/static/chunks/app/api/default-cwd/route-9cbffd52890a7ee2.js +1 -0
  170. package/.next/static/chunks/app/api/file-index/route-9cbffd52890a7ee2.js +1 -0
  171. package/.next/static/chunks/app/api/files/[...path]/route-9cbffd52890a7ee2.js +1 -0
  172. package/.next/static/chunks/app/api/git/diff/route-9cbffd52890a7ee2.js +1 -0
  173. package/.next/static/chunks/app/api/git/status/route-9cbffd52890a7ee2.js +1 -0
  174. package/.next/static/chunks/app/api/home/route-9cbffd52890a7ee2.js +1 -0
  175. package/.next/static/chunks/app/api/mcp/route-9cbffd52890a7ee2.js +1 -0
  176. package/.next/static/chunks/app/api/models/route-9cbffd52890a7ee2.js +1 -0
  177. package/.next/static/chunks/app/api/models-config/catalog/route-9cbffd52890a7ee2.js +1 -0
  178. package/.next/static/chunks/app/api/models-config/discover/route-9cbffd52890a7ee2.js +1 -0
  179. package/.next/static/chunks/app/api/models-config/route-9cbffd52890a7ee2.js +1 -0
  180. package/.next/static/chunks/app/api/models-config/test/route-9cbffd52890a7ee2.js +1 -0
  181. package/.next/static/chunks/app/api/plugins/route-9cbffd52890a7ee2.js +1 -0
  182. package/.next/static/chunks/app/api/project-trust/route-9cbffd52890a7ee2.js +1 -0
  183. package/.next/static/chunks/app/api/quota/route-9cbffd52890a7ee2.js +1 -0
  184. package/.next/static/chunks/app/api/search/route-9cbffd52890a7ee2.js +1 -0
  185. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-9cbffd52890a7ee2.js +1 -0
  186. package/.next/static/chunks/app/api/sessions/[id]/context/route-9cbffd52890a7ee2.js +1 -0
  187. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-9cbffd52890a7ee2.js +1 -0
  188. package/.next/static/chunks/app/api/sessions/[id]/export/route-9cbffd52890a7ee2.js +1 -0
  189. package/.next/static/chunks/app/api/sessions/[id]/route-9cbffd52890a7ee2.js +1 -0
  190. package/.next/static/chunks/app/api/sessions/[id]/state/route-9cbffd52890a7ee2.js +1 -0
  191. package/.next/static/chunks/app/api/sessions/[id]/todos/route-9cbffd52890a7ee2.js +1 -0
  192. package/.next/static/chunks/app/api/sessions/route-9cbffd52890a7ee2.js +1 -0
  193. package/.next/static/chunks/app/api/skills/check/route-9cbffd52890a7ee2.js +1 -0
  194. package/.next/static/chunks/app/api/skills/install/route-9cbffd52890a7ee2.js +1 -0
  195. package/.next/static/chunks/app/api/skills/route-9cbffd52890a7ee2.js +1 -0
  196. package/.next/static/chunks/app/api/skills/search/route-9cbffd52890a7ee2.js +1 -0
  197. package/.next/static/chunks/app/api/skills/update/route-9cbffd52890a7ee2.js +1 -0
  198. package/.next/static/chunks/app/api/tasks/[id]/board/route-9cbffd52890a7ee2.js +1 -0
  199. package/.next/static/chunks/app/api/tasks/[id]/route-9cbffd52890a7ee2.js +1 -0
  200. package/.next/static/chunks/app/api/tasks/reorder/route-9cbffd52890a7ee2.js +1 -0
  201. package/.next/static/chunks/app/api/tasks/route-9cbffd52890a7ee2.js +1 -0
  202. package/.next/static/chunks/app/api/terminal/[id]/events/route-9cbffd52890a7ee2.js +1 -0
  203. package/.next/static/chunks/app/api/terminal/[id]/route-9cbffd52890a7ee2.js +1 -0
  204. package/.next/static/chunks/app/api/terminal/route-9cbffd52890a7ee2.js +1 -0
  205. package/.next/static/chunks/app/api/worktrees/route-9cbffd52890a7ee2.js +1 -0
  206. package/.next/static/chunks/app/{layout-ce121c3d1df5b8e6.js → layout-629d926928cb5e43.js} +1 -1
  207. package/.next/static/chunks/app/manifest.webmanifest/route-9cbffd52890a7ee2.js +1 -0
  208. package/.next/static/chunks/app/page-fca5ee35186517d3.js +89 -0
  209. package/.next/static/chunks/e3e7ddb2.a35db430b3564999.js +1 -0
  210. package/.next/static/chunks/next/dist/client/components/builtin/app-error-9cbffd52890a7ee2.js +1 -0
  211. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-9cbffd52890a7ee2.js +1 -0
  212. package/.next/static/chunks/next/dist/client/components/builtin/not-found-9cbffd52890a7ee2.js +1 -0
  213. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-9cbffd52890a7ee2.js +1 -0
  214. package/.next/static/chunks/webpack-a0d987c4f912a15f.js +1 -0
  215. package/.next/static/css/46396d55066d14af.css +1 -0
  216. package/.next/static/css/77c5948f82acf3c3.css +1 -0
  217. package/.next/static/css/80c818c5781fbadc.css +4 -0
  218. package/.next/static/rGUWWAqLz0cYSW8-IDVSA/_buildManifest.js +1 -0
  219. package/.next/trace +7 -7
  220. package/.next/trace-build +1 -1
  221. package/.next/types/app/api/boards/[id]/canvas/route.ts +353 -0
  222. package/.next/types/app/api/boards/[id]/edges/[eid]/route.ts +353 -0
  223. package/.next/types/app/api/boards/[id]/edges/route.ts +353 -0
  224. package/.next/types/app/api/boards/[id]/nodes/[nid]/route.ts +353 -0
  225. package/.next/types/app/api/boards/[id]/nodes/route.ts +353 -0
  226. package/.next/types/app/api/boards/[id]/route.ts +353 -0
  227. package/.next/types/app/api/boards/reorder/route.ts +353 -0
  228. package/.next/types/app/api/boards/route.ts +353 -0
  229. package/.next/types/app/api/tasks/[id]/board/route.ts +353 -0
  230. package/.next/types/routes.d.ts +10 -1
  231. package/.next/types/validator.ts +81 -0
  232. package/README.md +11 -0
  233. package/package.json +2 -1
  234. package/.next/server/chunks/1457.js +0 -30
  235. package/.next/static/chunks/3266.4c7192f2067645eb.js +0 -1
  236. package/.next/static/chunks/7268.236544be8e242c16.js +0 -1
  237. package/.next/static/chunks/app/_global-error/page-11d96eed20d5efa5.js +0 -1
  238. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-11d96eed20d5efa5.js +0 -1
  239. package/.next/static/chunks/app/api/agent/[id]/events/route-11d96eed20d5efa5.js +0 -1
  240. package/.next/static/chunks/app/api/agent/[id]/route-11d96eed20d5efa5.js +0 -1
  241. package/.next/static/chunks/app/api/agent/new/route-11d96eed20d5efa5.js +0 -1
  242. package/.next/static/chunks/app/api/agent/running/route-11d96eed20d5efa5.js +0 -1
  243. package/.next/static/chunks/app/api/app-update/route-11d96eed20d5efa5.js +0 -1
  244. package/.next/static/chunks/app/api/auth/all-providers/route-11d96eed20d5efa5.js +0 -1
  245. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-11d96eed20d5efa5.js +0 -1
  246. package/.next/static/chunks/app/api/auth/login/[provider]/route-11d96eed20d5efa5.js +0 -1
  247. package/.next/static/chunks/app/api/auth/logout/[provider]/route-11d96eed20d5efa5.js +0 -1
  248. package/.next/static/chunks/app/api/auth/providers/route-11d96eed20d5efa5.js +0 -1
  249. package/.next/static/chunks/app/api/cwd/browse/route-11d96eed20d5efa5.js +0 -1
  250. package/.next/static/chunks/app/api/cwd/validate/route-11d96eed20d5efa5.js +0 -1
  251. package/.next/static/chunks/app/api/default-cwd/route-11d96eed20d5efa5.js +0 -1
  252. package/.next/static/chunks/app/api/file-index/route-11d96eed20d5efa5.js +0 -1
  253. package/.next/static/chunks/app/api/files/[...path]/route-11d96eed20d5efa5.js +0 -1
  254. package/.next/static/chunks/app/api/git/diff/route-11d96eed20d5efa5.js +0 -1
  255. package/.next/static/chunks/app/api/git/status/route-11d96eed20d5efa5.js +0 -1
  256. package/.next/static/chunks/app/api/home/route-11d96eed20d5efa5.js +0 -1
  257. package/.next/static/chunks/app/api/mcp/route-11d96eed20d5efa5.js +0 -1
  258. package/.next/static/chunks/app/api/models/route-11d96eed20d5efa5.js +0 -1
  259. package/.next/static/chunks/app/api/models-config/catalog/route-11d96eed20d5efa5.js +0 -1
  260. package/.next/static/chunks/app/api/models-config/discover/route-11d96eed20d5efa5.js +0 -1
  261. package/.next/static/chunks/app/api/models-config/route-11d96eed20d5efa5.js +0 -1
  262. package/.next/static/chunks/app/api/models-config/test/route-11d96eed20d5efa5.js +0 -1
  263. package/.next/static/chunks/app/api/plugins/route-11d96eed20d5efa5.js +0 -1
  264. package/.next/static/chunks/app/api/project-trust/route-11d96eed20d5efa5.js +0 -1
  265. package/.next/static/chunks/app/api/quota/route-11d96eed20d5efa5.js +0 -1
  266. package/.next/static/chunks/app/api/search/route-11d96eed20d5efa5.js +0 -1
  267. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-11d96eed20d5efa5.js +0 -1
  268. package/.next/static/chunks/app/api/sessions/[id]/context/route-11d96eed20d5efa5.js +0 -1
  269. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-11d96eed20d5efa5.js +0 -1
  270. package/.next/static/chunks/app/api/sessions/[id]/export/route-11d96eed20d5efa5.js +0 -1
  271. package/.next/static/chunks/app/api/sessions/[id]/route-11d96eed20d5efa5.js +0 -1
  272. package/.next/static/chunks/app/api/sessions/[id]/state/route-11d96eed20d5efa5.js +0 -1
  273. package/.next/static/chunks/app/api/sessions/[id]/todos/route-11d96eed20d5efa5.js +0 -1
  274. package/.next/static/chunks/app/api/sessions/route-11d96eed20d5efa5.js +0 -1
  275. package/.next/static/chunks/app/api/skills/check/route-11d96eed20d5efa5.js +0 -1
  276. package/.next/static/chunks/app/api/skills/install/route-11d96eed20d5efa5.js +0 -1
  277. package/.next/static/chunks/app/api/skills/route-11d96eed20d5efa5.js +0 -1
  278. package/.next/static/chunks/app/api/skills/search/route-11d96eed20d5efa5.js +0 -1
  279. package/.next/static/chunks/app/api/skills/update/route-11d96eed20d5efa5.js +0 -1
  280. package/.next/static/chunks/app/api/tasks/[id]/route-11d96eed20d5efa5.js +0 -1
  281. package/.next/static/chunks/app/api/tasks/reorder/route-11d96eed20d5efa5.js +0 -1
  282. package/.next/static/chunks/app/api/tasks/route-11d96eed20d5efa5.js +0 -1
  283. package/.next/static/chunks/app/api/terminal/[id]/events/route-11d96eed20d5efa5.js +0 -1
  284. package/.next/static/chunks/app/api/terminal/[id]/route-11d96eed20d5efa5.js +0 -1
  285. package/.next/static/chunks/app/api/terminal/route-11d96eed20d5efa5.js +0 -1
  286. package/.next/static/chunks/app/api/worktrees/route-11d96eed20d5efa5.js +0 -1
  287. package/.next/static/chunks/app/manifest.webmanifest/route-11d96eed20d5efa5.js +0 -1
  288. package/.next/static/chunks/app/page-86bf4dcd36af7be9.js +0 -89
  289. package/.next/static/chunks/next/dist/client/components/builtin/app-error-11d96eed20d5efa5.js +0 -1
  290. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-11d96eed20d5efa5.js +0 -1
  291. package/.next/static/chunks/next/dist/client/components/builtin/not-found-11d96eed20d5efa5.js +0 -1
  292. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-11d96eed20d5efa5.js +0 -1
  293. package/.next/static/chunks/webpack-09241b8782696d25.js +0 -1
  294. package/.next/static/css/ad030894558ed286.css +0 -1
  295. package/.next/static/css/de7b7ffe9688501b.css +0 -1
  296. package/.next/static/pM8HrLzSQRHKnzSBCbOSm/_buildManifest.js +0 -1
  297. /package/.next/static/{pM8HrLzSQRHKnzSBCbOSm → rGUWWAqLz0cYSW8-IDVSA}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (()=>{var a={};a.id=8429,a.ids=[8429],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12180:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h});var e=c(23211),f=c(40402),g=a([f]);async function h(a,{params:b}){let{id:c,entryId:d}=await b,g=new URL(a.url).searchParams.get("blockIndex"),i=null===g?NaN:Number(g);if(!Number.isSafeInteger(i)||i<0)return e.NextResponse.json({error:"Valid blockIndex is required"},{status:400});try{let a=await (0,f.os)(c);if(!a)return e.NextResponse.json({error:"Session not found"},{status:404});let b=(0,f.DK)(a).find(a=>a.id===d);if(!b||"message"!==b.type||"assistant"!==b.message.role)return e.NextResponse.json({error:"Assistant message not found"},{status:404});let g=b.message.content[i];if(!g||"thinking"!==g.type)return e.NextResponse.json({error:"Thinking block not found"},{status:404});return e.NextResponse.json({thinking:g.thinking})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66737:(a,b,c)=>{"use strict";c.d(b,{Lf:()=>g});var d=c(80099),e=c(21820),f=c(33873);function g(){var a;if(globalThis.__piWebDb)return globalThis.__piWebDb;let b=new d.DatabaseSync((0,f.join)(function(){let a=process.env.PI_CODING_AGENT_DIR;if(a){let b=a.startsWith("~")?(0,f.join)((0,e.homedir)(),a.slice(1)):a;return(0,f.normalize)(b)}return(0,f.join)((0,e.homedir)(),".pi","agent")}(),"pi-web.db"));return b.exec("PRAGMA journal_mode = WAL;"),b.exec("PRAGMA foreign_keys = ON;"),(a=b).exec(`
1
+ (()=>{var a={};a.id=8429,a.ids=[8429],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12180:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h});var e=c(23211),f=c(40402),g=a([f]);async function h(a,{params:b}){let{id:c,entryId:d}=await b,g=new URL(a.url).searchParams.get("blockIndex"),i=null===g?NaN:Number(g);if(!Number.isSafeInteger(i)||i<0)return e.NextResponse.json({error:"Valid blockIndex is required"},{status:400});try{let a=await (0,f.os)(c);if(!a)return e.NextResponse.json({error:"Session not found"},{status:404});let b=(0,f.DK)(a).find(a=>a.id===d);if(!b||"message"!==b.type||"assistant"!==b.message.role)return e.NextResponse.json({error:"Assistant message not found"},{status:404});let g=b.message.content[i];if(!g||"thinking"!==g.type)return e.NextResponse.json({error:"Thinking block not found"},{status:404});return e.NextResponse.json({thinking:g.thinking})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32146:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/entries/[entryId]/thinking/route",pathname:"/api/sessions/[id]/entries/[entryId]/thinking",filename:"route",bundlePath:"app/api/sessions/[id]/entries/[entryId]/thinking/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/sessions/[id]/entries/[entryId]/thinking/route.ts",nextConfigOutput:"",userland:()=>c(12180),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/entries/[entryId]/thinking/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66737:(a,b,c)=>{"use strict";c.d(b,{Lf:()=>g});var d=c(80099),e=c(21820),f=c(33873);function g(){var a;if(globalThis.__piWebDb)return globalThis.__piWebDb;let b=new d.DatabaseSync((0,f.join)(function(){let a=process.env.PI_CODING_AGENT_DIR;if(a){let b=a.startsWith("~")?(0,f.join)((0,e.homedir)(),a.slice(1)):a;return(0,f.normalize)(b)}return(0,f.join)((0,e.homedir)(),".pi","agent")}(),"pi-web.db"));return b.exec("PRAGMA journal_mode = WAL;"),b.exec("PRAGMA foreign_keys = ON;"),(a=b).exec(`
2
2
  CREATE TABLE IF NOT EXISTS tasks (
3
3
  id TEXT PRIMARY KEY,
4
4
  project_key TEXT NOT NULL,
@@ -27,4 +27,4 @@
27
27
  body,
28
28
  tokenize = 'trigram'
29
29
  );
30
- `),function(a){let b=a.prepare("PRAGMA user_version").get().user_version;for(let c of h)if(!(c.version<=b)){a.exec("BEGIN");try{for(let b of c.statements)try{a.exec(b)}catch(b){let a=b instanceof Error?b.message:String(b);if(!/duplicate column name/i.test(a))throw b}a.exec(`PRAGMA user_version = ${c.version}`),a.exec("COMMIT"),b=c.version}catch(b){throw a.exec("ROLLBACK"),b}}}(a),globalThis.__piWebDb=b,b}let h=[{version:1,name:"pinned columns",statements:["ALTER TABLE tasks ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;","ALTER TABLE session_meta ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;"]},{version:2,name:"tasks.sort_order",statements:["ALTER TABLE tasks ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0;"]}]},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},80099:a=>{"use strict";a.exports=require("node:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92377:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/entries/[entryId]/thinking/route",pathname:"/api/sessions/[id]/entries/[entryId]/thinking",filename:"route",bundlePath:"app/api/sessions/[id]/entries/[entryId]/thinking/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/sessions/[id]/entries/[entryId]/thinking/route.ts",nextConfigOutput:"",userland:()=>c(12180),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/entries/[entryId]/thinking/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},96487:()=>{}};var b=require("../../../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,402],()=>b(b.s=92377));module.exports=c})();
30
+ `),function(a){let b=a.prepare("PRAGMA user_version").get().user_version;for(let c of h)if(!(c.version<=b)){a.exec("BEGIN");try{for(let b of c.statements)try{a.exec(b)}catch(b){let a=b instanceof Error?b.message:String(b);if(!/duplicate column name/i.test(a))throw b}a.exec(`PRAGMA user_version = ${c.version}`),a.exec("COMMIT"),b=c.version}catch(b){throw a.exec("ROLLBACK"),b}}}(a),globalThis.__piWebDb=b,b}let h=[{version:1,name:"pinned columns",statements:["ALTER TABLE tasks ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;","ALTER TABLE session_meta ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;"]},{version:2,name:"tasks.sort_order",statements:["ALTER TABLE tasks ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0;"]},{version:3,name:"session boards",statements:["CREATE TABLE IF NOT EXISTS boards (\n id TEXT PRIMARY KEY,\n project_key TEXT NOT NULL,\n name TEXT NOT NULL,\n is_system INTEGER NOT NULL DEFAULT 0,\n created INTEGER NOT NULL,\n updated INTEGER NOT NULL\n);","CREATE INDEX IF NOT EXISTS idx_boards_project ON boards(project_key);","CREATE TABLE IF NOT EXISTS board_nodes (\n id TEXT PRIMARY KEY,\n board_id TEXT NOT NULL,\n kind TEXT NOT NULL,\n ref_id TEXT,\n x REAL NOT NULL,\n y REAL NOT NULL,\n w REAL NOT NULL DEFAULT 0,\n h REAL NOT NULL DEFAULT 0,\n expanded INTEGER NOT NULL DEFAULT 0,\n props TEXT NOT NULL DEFAULT '{}',\n created INTEGER NOT NULL,\n updated INTEGER NOT NULL\n);","CREATE INDEX IF NOT EXISTS idx_board_nodes_board ON board_nodes(board_id);","CREATE TABLE IF NOT EXISTS board_edges (\n id TEXT PRIMARY KEY,\n board_id TEXT NOT NULL,\n from_id TEXT NOT NULL,\n to_id TEXT NOT NULL,\n label TEXT,\n color TEXT,\n dashed INTEGER NOT NULL DEFAULT 0,\n created INTEGER NOT NULL,\n updated INTEGER NOT NULL\n);","CREATE INDEX IF NOT EXISTS idx_board_edges_board ON board_edges(board_id);","CREATE TABLE IF NOT EXISTS board_view (\n board_id TEXT PRIMARY KEY,\n camera_x REAL NOT NULL DEFAULT 0,\n camera_y REAL NOT NULL DEFAULT 0,\n camera_z REAL NOT NULL DEFAULT 1,\n updated INTEGER NOT NULL\n);"]},{version:4,name:"boards.sort_order",statements:["ALTER TABLE boards ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0;"]},{version:5,name:"boards.task_id",statements:["ALTER TABLE boards ADD COLUMN task_id TEXT NULL;","CREATE INDEX IF NOT EXISTS idx_boards_task ON boards(task_id);"]}]},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},80099:a=>{"use strict";a.exports=require("node:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,402],()=>b(b.s=32146));module.exports=c})();
@@ -51,7 +51,7 @@
51
51
  }
52
52
  containsActive.set(node, has);
53
53
  }
54
- }`));return new Response(e,{headers:{"Content-Type":"text/html; charset=utf-8","Content-Disposition":(b=k.replace(/[^\x20-\x7E]|["\\;\r\n]/g,"_")||"session.html",`${d?"inline":"attachment"}; filename="${b}"; filename*=UTF-8''${encodeURIComponent(k).replace(/[!'()*]/g,a=>`%${a.charCodeAt(0).toString(16).toUpperCase()}`)}`),"Cache-Control":"no-cache","Content-Security-Policy":"frame-ancestors 'none'","X-Content-Type-Options":"nosniff","X-Frame-Options":"DENY"}})}finally{(0,g.rmSync)(n,{force:!0})}}catch(a){return l.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66737:(a,b,c)=>{"use strict";c.d(b,{Lf:()=>g});var d=c(80099),e=c(21820),f=c(33873);function g(){var a;if(globalThis.__piWebDb)return globalThis.__piWebDb;let b=new d.DatabaseSync((0,f.join)(function(){let a=process.env.PI_CODING_AGENT_DIR;if(a){let b=a.startsWith("~")?(0,f.join)((0,e.homedir)(),a.slice(1)):a;return(0,f.normalize)(b)}return(0,f.join)((0,e.homedir)(),".pi","agent")}(),"pi-web.db"));return b.exec("PRAGMA journal_mode = WAL;"),b.exec("PRAGMA foreign_keys = ON;"),(a=b).exec(`
54
+ }`));return new Response(e,{headers:{"Content-Type":"text/html; charset=utf-8","Content-Disposition":(b=k.replace(/[^\x20-\x7E]|["\\;\r\n]/g,"_")||"session.html",`${d?"inline":"attachment"}; filename="${b}"; filename*=UTF-8''${encodeURIComponent(k).replace(/[!'()*]/g,a=>`%${a.charCodeAt(0).toString(16).toUpperCase()}`)}`),"Cache-Control":"no-cache","Content-Security-Policy":"frame-ancestors 'none'","X-Content-Type-Options":"nosniff","X-Frame-Options":"DENY"}})}finally{(0,g.rmSync)(n,{force:!0})}}catch(a){return l.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},59772:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/export/route",pathname:"/api/sessions/[id]/export",filename:"route",bundlePath:"app/api/sessions/[id]/export/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/sessions/[id]/export/route.ts",nextConfigOutput:"",userland:()=>c(39421),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/export/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66737:(a,b,c)=>{"use strict";c.d(b,{Lf:()=>g});var d=c(80099),e=c(21820),f=c(33873);function g(){var a;if(globalThis.__piWebDb)return globalThis.__piWebDb;let b=new d.DatabaseSync((0,f.join)(function(){let a=process.env.PI_CODING_AGENT_DIR;if(a){let b=a.startsWith("~")?(0,f.join)((0,e.homedir)(),a.slice(1)):a;return(0,f.normalize)(b)}return(0,f.join)((0,e.homedir)(),".pi","agent")}(),"pi-web.db"));return b.exec("PRAGMA journal_mode = WAL;"),b.exec("PRAGMA foreign_keys = ON;"),(a=b).exec(`
55
55
  CREATE TABLE IF NOT EXISTS tasks (
56
56
  id TEXT PRIMARY KEY,
57
57
  project_key TEXT NOT NULL,
@@ -80,4 +80,4 @@
80
80
  body,
81
81
  tokenize = 'trigram'
82
82
  );
83
- `),function(a){let b=a.prepare("PRAGMA user_version").get().user_version;for(let c of h)if(!(c.version<=b)){a.exec("BEGIN");try{for(let b of c.statements)try{a.exec(b)}catch(b){let a=b instanceof Error?b.message:String(b);if(!/duplicate column name/i.test(a))throw b}a.exec(`PRAGMA user_version = ${c.version}`),a.exec("COMMIT"),b=c.version}catch(b){throw a.exec("ROLLBACK"),b}}}(a),globalThis.__piWebDb=b,b}let h=[{version:1,name:"pinned columns",statements:["ALTER TABLE tasks ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;","ALTER TABLE session_meta ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;"]},{version:2,name:"tasks.sort_order",statements:["ALTER TABLE tasks ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0;"]}]},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},78335:()=>{},79405:a=>{function b(a){return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b})}b.keys=()=>[],b.resolve=b,b.id=79405,a.exports=b},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},80099:a=>{"use strict";a.exports=require("node:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87711:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/export/route",pathname:"/api/sessions/[id]/export",filename:"route",bundlePath:"app/api/sessions/[id]/export/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/sessions/[id]/export/route.ts",nextConfigOutput:"",userland:()=>c(39421),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/export/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,402],()=>b(b.s=87711));module.exports=c})();
83
+ `),function(a){let b=a.prepare("PRAGMA user_version").get().user_version;for(let c of h)if(!(c.version<=b)){a.exec("BEGIN");try{for(let b of c.statements)try{a.exec(b)}catch(b){let a=b instanceof Error?b.message:String(b);if(!/duplicate column name/i.test(a))throw b}a.exec(`PRAGMA user_version = ${c.version}`),a.exec("COMMIT"),b=c.version}catch(b){throw a.exec("ROLLBACK"),b}}}(a),globalThis.__piWebDb=b,b}let h=[{version:1,name:"pinned columns",statements:["ALTER TABLE tasks ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;","ALTER TABLE session_meta ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;"]},{version:2,name:"tasks.sort_order",statements:["ALTER TABLE tasks ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0;"]},{version:3,name:"session boards",statements:["CREATE TABLE IF NOT EXISTS boards (\n id TEXT PRIMARY KEY,\n project_key TEXT NOT NULL,\n name TEXT NOT NULL,\n is_system INTEGER NOT NULL DEFAULT 0,\n created INTEGER NOT NULL,\n updated INTEGER NOT NULL\n);","CREATE INDEX IF NOT EXISTS idx_boards_project ON boards(project_key);","CREATE TABLE IF NOT EXISTS board_nodes (\n id TEXT PRIMARY KEY,\n board_id TEXT NOT NULL,\n kind TEXT NOT NULL,\n ref_id TEXT,\n x REAL NOT NULL,\n y REAL NOT NULL,\n w REAL NOT NULL DEFAULT 0,\n h REAL NOT NULL DEFAULT 0,\n expanded INTEGER NOT NULL DEFAULT 0,\n props TEXT NOT NULL DEFAULT '{}',\n created INTEGER NOT NULL,\n updated INTEGER NOT NULL\n);","CREATE INDEX IF NOT EXISTS idx_board_nodes_board ON board_nodes(board_id);","CREATE TABLE IF NOT EXISTS board_edges (\n id TEXT PRIMARY KEY,\n board_id TEXT NOT NULL,\n from_id TEXT NOT NULL,\n to_id TEXT NOT NULL,\n label TEXT,\n color TEXT,\n dashed INTEGER NOT NULL DEFAULT 0,\n created INTEGER NOT NULL,\n updated INTEGER NOT NULL\n);","CREATE INDEX IF NOT EXISTS idx_board_edges_board ON board_edges(board_id);","CREATE TABLE IF NOT EXISTS board_view (\n board_id TEXT PRIMARY KEY,\n camera_x REAL NOT NULL DEFAULT 0,\n camera_y REAL NOT NULL DEFAULT 0,\n camera_z REAL NOT NULL DEFAULT 1,\n updated INTEGER NOT NULL\n);"]},{version:4,name:"boards.sort_order",statements:["ALTER TABLE boards ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0;"]},{version:5,name:"boards.task_id",statements:["ALTER TABLE boards ADD COLUMN task_id TEXT NULL;","CREATE INDEX IF NOT EXISTS idx_boards_task ON boards(task_id);"]}]},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},78335:()=>{},79405:a=>{function b(a){return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b})}b.keys=()=>[],b.resolve=b,b.id=79405,a.exports=b},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},80099:a=>{"use strict";a.exports=require("node:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,402],()=>b(b.s=59772));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=6849,a.ids=[6849],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14858:(a,b,c)=>{function d(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function e(a,b){if("string"!=typeof b||a.length>40)return a;let c=b.replace(/\s+/g," ").trim();if(!c)return a;let d=a?" ":"",e=a+d;if(e.length>=41)return e.slice(0,41);let f=41-e.length;return e+c.slice(0,f)}function f(a){if("message"!==a.type||!d(a.message)||"string"!=typeof a.message.role)return;let b=a.message.content,c="",f=!1;if("string"==typeof b)c=e(c,b);else if(Array.isArray(b)){for(let a of b)if(d(a)&&("image"===a.type&&(f=!0),"text"===a.type&&(c=e(c,a.text)),c.length>40))break}c.length>40?c=c.slice(0,40)+"…":c||(c=f?"[image]":"assistant"===a.message.role?"[assistant]":"message");let g="user"===a.message.role||"assistant"===a.message.role?a.message.role:void 0;return{...g?{role:g}:{},text:c}}function g(a){let b=new Set,c=new Set(a),d=new Set,e=[...a];for(;e.length>0;){let a=e.pop();if(!d.has(a))for(let f of(d.add(a),(c.has(a)||1!==a.children.length)&&b.add(a),a.children))e.push(f)}let g=(a,b,c)=>({...a,children:[],...b?.length?{compressedEntryIds:b}:{},...c?{branchPreview:c}:{}}),h=a.map(a=>g(a,void 0,f(a.entry))),i=a.map((a,b)=>({source:a,projected:h[b],depth:1})),j=(a,c)=>{let d=[{node:a,compressedEntryIds:[],branchPreview:void 0}],e=new Set;for(;d.length>0;){let{node:a,compressedEntryIds:h,branchPreview:i}=d.pop();if(e.has(a))continue;e.add(a);let j=i??f(a.entry);b.has(a)&&c.children.push(g(a,h,j));for(let c=a.children.length-1;c>=0;c--)d.push({node:a.children[c],compressedEntryIds:b.has(a)?[]:[...h,a.entry.id],branchPreview:b.has(a)?void 0:j})}};for(;i.length>0;){let{source:a,projected:c,depth:d}=i.pop();for(let e of a.children){let a=e;if(d>=200){j(a,c);continue}let h=[],k=f(a.entry);for(;!b.has(a)&&1===a.children.length;)h.push(a.entry.id),a=a.children[0],k??=f(a.entry);if(!b.has(a))continue;let l=g(a,h,k);c.children.push(l),i.push({source:a,projected:l,depth:d+1})}}return h}c.d(b,{y:()=>g})},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},62471:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/route",pathname:"/api/sessions/[id]",filename:"route",bundlePath:"app/api/sessions/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/sessions/[id]/route.ts",nextConfigOutput:"",userland:()=>c(98192),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},68964:(a,b,c)=>{c.d(b,{Me:()=>m,Q8:()=>o,R6:()=>r,UT:()=>k,Vk:()=>j,fi:()=>q,gQ:()=>f,gg:()=>i,lC:()=>l,mE:()=>p,vq:()=>n});var d=c(55511),e=c(66737);function f(a){return(0,e.Lf)().prepare("SELECT session_id FROM session_meta WHERE task_id = ? ORDER BY pinned DESC, updated DESC, rowid DESC").all(a).map(a=>a.session_id)}function g(a){return(0,e.Lf)().prepare("SELECT id, project_key AS projectKey, name, created, updated, pinned, sort_order AS sortOrder FROM tasks WHERE id = ?").get(a)}function h(a){var b;return{...a,pinned:1===a.pinned,sessionIds:f(a.id),pinnedSessionIds:(b=a.id,(0,e.Lf)().prepare("SELECT session_id FROM session_meta WHERE task_id = ? AND pinned = 1").all(b).map(a=>a.session_id))}}function i(a){let b=g(a);return b?h(b):void 0}function j(a){return(0,e.Lf)().prepare("SELECT id, project_key AS projectKey, name, created, updated, pinned, sort_order AS sortOrder FROM tasks WHERE project_key = ? ORDER BY pinned DESC, sort_order, created, rowid").all(a).map(h)}function k(a,b){let c=b.trim();if(!a)throw Error("projectKey is required");if(!c)throw Error("name must not be empty");let f=(0,d.randomUUID)(),g=Date.now();return(0,e.Lf)().prepare("INSERT INTO tasks (id, project_key, name, created, updated, sort_order) VALUES (?, ?, ?, ?, ?, ?)").run(f,a,c,g,g,g),{id:f,projectKey:a,name:c,created:g,updated:g,pinned:!1,sortOrder:g,sessionIds:[],pinnedSessionIds:[]}}function l(a,b){let c=(0,e.Lf)();if(!g(a))return null;c.exec("BEGIN");try{if(void 0!==b.name){let d=b.name.trim();if(!d)throw Error("name must not be empty");c.prepare("UPDATE tasks SET name = ?, updated = ? WHERE id = ?").run(d,Date.now(),a)}if(void 0!==b.pinned&&c.prepare("UPDATE tasks SET pinned = ?, updated = ? WHERE id = ?").run(+!!b.pinned,Date.now(),a),void 0!==b.sortOrder&&c.prepare("UPDATE tasks SET sort_order = ?, updated = ? WHERE id = ?").run(b.sortOrder,Date.now(),a),void 0!==b.sessionIds){let d=new Set(f(a)),e=new Set(b.sessionIds),g=Date.now(),h=c.prepare("INSERT INTO session_meta (session_id, task_id, updated) VALUES (?, ?, ?) ON CONFLICT(session_id) DO UPDATE SET task_id = excluded.task_id, updated = excluded.updated"),i=c.prepare("UPDATE session_meta SET task_id = NULL, updated = ? WHERE session_id = ?");for(let c of b.sessionIds)d.has(c)||h.run(c,a,g);for(let a of d)e.has(a)||i.run(g,a);c.prepare("UPDATE tasks SET updated = ? WHERE id = ?").run(g,a)}c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return h(g(a))}function m(a,b){let c=(0,e.Lf)();if(0===b.length)return j(a);c.exec("BEGIN");try{let d=c.prepare("UPDATE tasks SET sort_order = ?, updated = ? WHERE id = ? AND project_key = ?");b.forEach((b,c)=>{let e=d.run(c,Date.now(),b,a);if(0===e.changes)throw Error(`task ${b} does not belong to project ${a}`)}),c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return j(a)}function n(a){let b=(0,e.Lf)();b.exec("BEGIN");try{b.prepare("UPDATE session_meta SET task_id = NULL, updated = ? WHERE task_id = ?").run(Date.now(),a),b.prepare("DELETE FROM tasks WHERE id = ?").run(a),b.exec("COMMIT")}catch(a){throw b.exec("ROLLBACK"),a}}function o(a){let b=(0,e.Lf)().prepare("SELECT t.name FROM session_meta m JOIN tasks t ON t.id = m.task_id WHERE m.session_id = ?").get(a);return b?.name??null}function p(a,b){let c=(0,e.Lf)();if(!g(b))return!1;let d=Date.now();c.exec("BEGIN");try{c.prepare("INSERT INTO session_meta (session_id, task_id, updated) VALUES (?, ?, ?) ON CONFLICT(session_id) DO UPDATE SET task_id = excluded.task_id, updated = excluded.updated").run(a,b,d),c.prepare("UPDATE tasks SET updated = ? WHERE id = ?").run(d,b),c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return!0}function q(a,b){(0,e.Lf)().prepare("INSERT INTO session_meta (session_id, task_id, updated, pinned) VALUES (?, NULL, ?, ?) ON CONFLICT(session_id) DO UPDATE SET pinned = excluded.pinned").run(a,Date.now(),+!!b)}function r(a){(0,e.Lf)().prepare("DELETE FROM session_meta WHERE session_id = ?").run(a)}},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80099:a=>{a.exports=require("node:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89691:(a,b,c)=>{function d(a){let b,c=0;for(let e of a){var d;if("message"!==(d=e.type)&&"compaction"!==d&&"branch_summary"!==d&&"custom_message"!==d)continue;let a=Date.parse(e.timestamp);if(!Number.isFinite(a))continue;let f="message"===e.type?e.message?.role:void 0;if("user"===f||"bashExecution"===f){b=a;continue}void 0!==b&&a>b&&(c+=a-b),b=a}return c}c.d(b,{c:()=>d})},98192:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>r,GET:()=>p,PATCH:()=>q});var e=c(23211),f=c(29021),g=c(33873),h=c(75430),i=c(40402),j=c(45902),k=c(56429),l=c(14858),m=c(89691),n=c(68964),o=a([h,i,k]);async function p(a,{params:b}){let{id:c}=await b;try{let b,d=(0,k.A4)(c),g=d?.isAlive()?d:void 0,j=g?null:await (0,i.os)(c);if(!g&&!j)return e.NextResponse.json({error:"Session not found"},{status:404});let o=g?.inner.sessionManager??h.SessionManager.open(j),p=g?.sessionFile||o.getSessionFile()||j||"",q=o.getEntries(),r=o.getLeafId(),s=(0,l.y)(o.getTree()),t=new URL(a.url).searchParams,u=t.has("deferThinking"),v=t.has("deferMedia"),w=Number(t.get("tail")),x=Number.isFinite(w)&&w>0?Math.min(w,1e3):50,y=(0,i.Uv)(q,r,{deferThinking:u,deferToolResultImages:v,tail:x}),z=(0,i.B6)(q,r,x),A=(0,m.c)(q),B=o.getHeader(),C=B?.timestamp??new Date().toISOString();try{C=(0,f.statSync)(p).mtime.toISOString()}catch{}let D=B?.parentSession?await (0,i.u1)(B.parentSession):void 0,E=B?{path:p,id:B.id,cwd:B.cwd??"",name:o.getSessionName(),created:B.timestamp,modified:C,messageCount:y.messages.length,firstMessage:y.messages.find(a=>"user"===a.role)?(b=y.messages.find(a=>"user"===a.role).content,"string"==typeof b?b:(Array.isArray(b)?b.find(a=>"text"===a.type)?.text??"":"")||"(no messages)"):"(no messages)",parentSessionId:D,transient:!p||!(0,f.existsSync)(p),taskName:(0,n.Q8)(c)??void 0}:null;return e.NextResponse.json({sessionId:c,filePath:p,info:E,leafId:r,tree:s,context:y,totalActiveMs:A,hasMore:z})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function q(a,{params:b}){let{id:c}=await b;try{let b=await a.json().catch(()=>({})),d=await (0,i.os)(c);if(!d)return e.NextResponse.json({error:"Session not found"},{status:404});if(void 0!==b.name){if("string"!=typeof b.name)return e.NextResponse.json({error:"name must be a string"},{status:400});return h.SessionManager.open(d).appendSessionInfo(b.name.trim()),(0,i.mD)(),e.NextResponse.json({ok:!0})}if(void 0!==b.pinned){if("boolean"!=typeof b.pinned)return e.NextResponse.json({error:"pinned must be a boolean"},{status:400});return(0,n.fi)(c,b.pinned),(0,i.mD)(),e.NextResponse.json({ok:!0})}return e.NextResponse.json({error:"name or pinned is required"},{status:400})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function r(a,{params:b}){let{id:c}=await b;try{let a=await (0,i.os)(c);if(!a)return e.NextResponse.json({error:"Session not found"},{status:404});let b=(0,i.eP)(a)?.parentSession,d=(0,j.$)(a),h=(0,g.dirname)(a);try{for(let a of(0,f.readdirSync)(h).filter(a=>a.endsWith(".jsonl")&&(0,j.$)((0,g.join)(h,a))!==d)){let c=(0,g.join)(h,a);try{let a=(0,f.readFileSync)(c,"utf8").split("\n"),e=JSON.parse(a[0]);"session"===e.type&&e.parentSession&&(0,j.$)(e.parentSession)===d&&(e.parentSession=b,a[0]=JSON.stringify(e),(0,f.writeFileSync)(c,a.join("\n")))}catch{}}}catch{}return await (0,k.A4)(c)?.shutdown(),(0,f.unlinkSync)(a),(0,i.BR)(c),(0,i.mD)(),(0,n.R6)(c),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[h,i,k]=o.then?(await o)():o,d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,402,1457],()=>b(b.s=62471));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=6849,a.ids=[6849],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14858:(a,b,c)=>{function d(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function e(a,b){if("string"!=typeof b||a.length>40)return a;let c=b.replace(/\s+/g," ").trim();if(!c)return a;let d=a?" ":"",e=a+d;if(e.length>=41)return e.slice(0,41);let f=41-e.length;return e+c.slice(0,f)}function f(a){if("message"!==a.type||!d(a.message)||"string"!=typeof a.message.role)return;let b=a.message.content,c="",f=!1;if("string"==typeof b)c=e(c,b);else if(Array.isArray(b)){for(let a of b)if(d(a)&&("image"===a.type&&(f=!0),"text"===a.type&&(c=e(c,a.text)),c.length>40))break}c.length>40?c=c.slice(0,40)+"…":c||(c=f?"[image]":"assistant"===a.message.role?"[assistant]":"message");let g="user"===a.message.role||"assistant"===a.message.role?a.message.role:void 0;return{...g?{role:g}:{},text:c}}function g(a){let b=new Set,c=new Set(a),d=new Set,e=[...a];for(;e.length>0;){let a=e.pop();if(!d.has(a))for(let f of(d.add(a),(c.has(a)||1!==a.children.length)&&b.add(a),a.children))e.push(f)}let g=(a,b,c)=>({...a,children:[],...b?.length?{compressedEntryIds:b}:{},...c?{branchPreview:c}:{}}),h=a.map(a=>g(a,void 0,f(a.entry))),i=a.map((a,b)=>({source:a,projected:h[b],depth:1})),j=(a,c)=>{let d=[{node:a,compressedEntryIds:[],branchPreview:void 0}],e=new Set;for(;d.length>0;){let{node:a,compressedEntryIds:h,branchPreview:i}=d.pop();if(e.has(a))continue;e.add(a);let j=i??f(a.entry);b.has(a)&&c.children.push(g(a,h,j));for(let c=a.children.length-1;c>=0;c--)d.push({node:a.children[c],compressedEntryIds:b.has(a)?[]:[...h,a.entry.id],branchPreview:b.has(a)?void 0:j})}};for(;i.length>0;){let{source:a,projected:c,depth:d}=i.pop();for(let e of a.children){let a=e;if(d>=200){j(a,c);continue}let h=[],k=f(a.entry);for(;!b.has(a)&&1===a.children.length;)h.push(a.entry.id),a=a.children[0],k??=f(a.entry);if(!b.has(a))continue;let l=g(a,h,k);c.children.push(l),i.push({source:a,projected:l,depth:d+1})}}return h}c.d(b,{y:()=>g})},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},68964:(a,b,c)=>{c.d(b,{Me:()=>n,Q8:()=>p,R6:()=>s,UT:()=>l,Vk:()=>k,fi:()=>r,gQ:()=>g,gg:()=>j,lC:()=>m,mE:()=>q,vq:()=>o});var d=c(55511),e=c(66737),f=c(6288);function g(a){return(0,e.Lf)().prepare("SELECT session_id FROM session_meta WHERE task_id = ? ORDER BY pinned DESC, updated DESC, rowid DESC").all(a).map(a=>a.session_id)}function h(a){return(0,e.Lf)().prepare("SELECT id, project_key AS projectKey, name, created, updated, pinned, sort_order AS sortOrder FROM tasks WHERE id = ?").get(a)}function i(a){var b;return{...a,pinned:1===a.pinned,sessionIds:g(a.id),pinnedSessionIds:(b=a.id,(0,e.Lf)().prepare("SELECT session_id FROM session_meta WHERE task_id = ? AND pinned = 1").all(b).map(a=>a.session_id))}}function j(a){let b=h(a);return b?i(b):void 0}function k(a){return(0,e.Lf)().prepare("SELECT id, project_key AS projectKey, name, created, updated, pinned, sort_order AS sortOrder FROM tasks WHERE project_key = ? ORDER BY pinned DESC, sort_order, created, rowid").all(a).map(i)}function l(a,b){let c=b.trim();if(!a)throw Error("projectKey is required");if(!c)throw Error("name must not be empty");let f=(0,d.randomUUID)(),g=Date.now(),h=(0,e.Lf)().prepare("SELECT MIN(sort_order) AS minOrder FROM tasks WHERE project_key = ?").get(a),i=null===h.minOrder?0:h.minOrder-1;return(0,e.Lf)().prepare("INSERT INTO tasks (id, project_key, name, created, updated, sort_order) VALUES (?, ?, ?, ?, ?, ?)").run(f,a,c,g,g,i),{id:f,projectKey:a,name:c,created:g,updated:g,pinned:!1,sortOrder:i,sessionIds:[],pinnedSessionIds:[]}}function m(a,b){let c=(0,e.Lf)();if(!h(a))return null;c.exec("BEGIN");try{if(void 0!==b.name){let d=b.name.trim();if(!d)throw Error("name must not be empty");c.prepare("UPDATE tasks SET name = ?, updated = ? WHERE id = ?").run(d,Date.now(),a),(0,f.y1)(a,d)}if(void 0!==b.pinned&&c.prepare("UPDATE tasks SET pinned = ?, updated = ? WHERE id = ?").run(+!!b.pinned,Date.now(),a),void 0!==b.sortOrder&&c.prepare("UPDATE tasks SET sort_order = ?, updated = ? WHERE id = ?").run(b.sortOrder,Date.now(),a),void 0!==b.sessionIds){let d=new Set(g(a)),e=new Set(b.sessionIds),f=Date.now(),h=c.prepare("INSERT INTO session_meta (session_id, task_id, updated) VALUES (?, ?, ?) ON CONFLICT(session_id) DO UPDATE SET task_id = excluded.task_id, updated = excluded.updated"),i=c.prepare("UPDATE session_meta SET task_id = NULL, updated = ? WHERE session_id = ?");for(let c of b.sessionIds)d.has(c)||h.run(c,a,f);for(let a of d)e.has(a)||i.run(f,a);c.prepare("UPDATE tasks SET updated = ? WHERE id = ?").run(f,a)}c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return i(h(a))}function n(a,b){let c=(0,e.Lf)();if(0===b.length)return k(a);c.exec("BEGIN");try{let d=c.prepare("UPDATE tasks SET sort_order = ?, updated = ? WHERE id = ? AND project_key = ?");b.forEach((b,c)=>{let e=d.run(c,Date.now(),b,a);if(0===e.changes)throw Error(`task ${b} does not belong to project ${a}`)}),c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return k(a)}function o(a){let b=(0,e.Lf)();b.exec("BEGIN");try{b.prepare("UPDATE session_meta SET task_id = NULL, updated = ? WHERE task_id = ?").run(Date.now(),a),b.prepare("DELETE FROM tasks WHERE id = ?").run(a),(0,f.cV)(a),b.exec("COMMIT")}catch(a){throw b.exec("ROLLBACK"),a}}function p(a){let b=(0,e.Lf)().prepare("SELECT t.name FROM session_meta m JOIN tasks t ON t.id = m.task_id WHERE m.session_id = ?").get(a);return b?.name??null}function q(a,b){let c=(0,e.Lf)();if(!h(b))return!1;let d=Date.now();c.exec("BEGIN");try{c.prepare("INSERT INTO session_meta (session_id, task_id, updated) VALUES (?, ?, ?) ON CONFLICT(session_id) DO UPDATE SET task_id = excluded.task_id, updated = excluded.updated").run(a,b,d),c.prepare("UPDATE tasks SET updated = ? WHERE id = ?").run(d,b),c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return!0}function r(a,b){(0,e.Lf)().prepare("INSERT INTO session_meta (session_id, task_id, updated, pinned) VALUES (?, NULL, ?, ?) ON CONFLICT(session_id) DO UPDATE SET pinned = excluded.pinned").run(a,Date.now(),+!!b)}function s(a){(0,e.Lf)().prepare("DELETE FROM session_meta WHERE session_id = ?").run(a)}},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80099:a=>{a.exports=require("node:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89691:(a,b,c)=>{function d(a){let b,c=0;for(let e of a){var d;if("message"!==(d=e.type)&&"compaction"!==d&&"branch_summary"!==d&&"custom_message"!==d)continue;let a=Date.parse(e.timestamp);if(!Number.isFinite(a))continue;let f="message"===e.type?e.message?.role:void 0;if("user"===f||"bashExecution"===f){b=a;continue}void 0!==b&&a>b&&(c+=a-b),b=a}return c}c.d(b,{c:()=>d})},95524:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/route",pathname:"/api/sessions/[id]",filename:"route",bundlePath:"app/api/sessions/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/sessions/[id]/route.ts",nextConfigOutput:"",userland:()=>c(98192),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},98192:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>r,GET:()=>p,PATCH:()=>q});var e=c(23211),f=c(29021),g=c(33873),h=c(75430),i=c(40402),j=c(45902),k=c(56429),l=c(14858),m=c(89691),n=c(68964),o=a([h,i,k]);async function p(a,{params:b}){let{id:c}=await b;try{let b,d=(0,k.A4)(c),g=d?.isAlive()?d:void 0,j=g?null:await (0,i.os)(c);if(!g&&!j)return e.NextResponse.json({error:"Session not found"},{status:404});let o=g?.inner.sessionManager??h.SessionManager.open(j),p=g?.sessionFile||o.getSessionFile()||j||"",q=o.getEntries(),r=o.getLeafId(),s=(0,l.y)(o.getTree()),t=new URL(a.url).searchParams,u=t.has("deferThinking"),v=t.has("deferMedia"),w=Number(t.get("tail")),x=Number.isFinite(w)&&w>0?Math.min(w,1e3):50,y=(0,i.Uv)(q,r,{deferThinking:u,deferToolResultImages:v,tail:x}),z=(0,i.B6)(q,r,x),A=(0,m.c)(q),B=o.getHeader(),C=B?.timestamp??new Date().toISOString();try{C=(0,f.statSync)(p).mtime.toISOString()}catch{}let D=B?.parentSession?await (0,i.u1)(B.parentSession):void 0,E=B?(await (0,i.zH)([{path:p,id:B.id,cwd:B.cwd??"",name:o.getSessionName(),created:B.timestamp,modified:C,messageCount:y.messages.length,firstMessage:y.messages.find(a=>"user"===a.role)?(b=y.messages.find(a=>"user"===a.role).content,"string"==typeof b?b:(Array.isArray(b)?b.find(a=>"text"===a.type)?.text??"":"")||"(no messages)"):"(no messages)",parentSessionId:D,transient:!p||!(0,f.existsSync)(p),taskName:(0,n.Q8)(c)??void 0}]))[0]:null;return e.NextResponse.json({sessionId:c,filePath:p,info:E,leafId:r,tree:s,context:y,totalActiveMs:A,hasMore:z})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function q(a,{params:b}){let{id:c}=await b;try{let b=await a.json().catch(()=>({})),d=await (0,i.os)(c);if(!d)return e.NextResponse.json({error:"Session not found"},{status:404});if(void 0!==b.name){if("string"!=typeof b.name)return e.NextResponse.json({error:"name must be a string"},{status:400});return h.SessionManager.open(d).appendSessionInfo(b.name.trim()),(0,i.mD)(),e.NextResponse.json({ok:!0})}if(void 0!==b.pinned){if("boolean"!=typeof b.pinned)return e.NextResponse.json({error:"pinned must be a boolean"},{status:400});return(0,n.fi)(c,b.pinned),(0,i.mD)(),e.NextResponse.json({ok:!0})}return e.NextResponse.json({error:"name or pinned is required"},{status:400})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function r(a,{params:b}){let{id:c}=await b;try{let a=await (0,i.os)(c);if(!a)return e.NextResponse.json({error:"Session not found"},{status:404});let b=(0,i.eP)(a)?.parentSession,d=(0,j.$)(a),h=(0,g.dirname)(a);try{for(let a of(0,f.readdirSync)(h).filter(a=>a.endsWith(".jsonl")&&(0,j.$)((0,g.join)(h,a))!==d)){let c=(0,g.join)(h,a);try{let a=(0,f.readFileSync)(c,"utf8").split("\n"),e=JSON.parse(a[0]);"session"===e.type&&e.parentSession&&(0,j.$)(e.parentSession)===d&&(e.parentSession=b,a[0]=JSON.stringify(e),(0,f.writeFileSync)(c,a.join("\n")))}catch{}}}catch{}return await (0,k.A4)(c)?.shutdown(),(0,f.unlinkSync)(a),(0,i.BR)(c),(0,i.mD)(),(0,n.R6)(c),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[h,i,k]=o.then?(await o)():o,d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,402,2092,6429],()=>b(b.s=95524));module.exports=c})();