@tasselx/pi-web 1.3.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +22 -20
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/routes-manifest.json +20 -6
  8. package/.next/server/app/_global-error/page.js +2 -2
  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 +2 -2
  19. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  21. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  22. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  23. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  24. package/.next/server/app/api/agent/[id]/lease/route.js +1 -1
  25. package/.next/server/app/api/agent/[id]/route.js +1 -1
  26. package/.next/server/app/api/agent/debug/route.js +2 -2
  27. package/.next/server/app/api/agent/new/route.js +1 -1
  28. package/.next/server/app/api/agent/running/route.js +1 -1
  29. package/.next/server/app/api/app-update/route.js +1 -1
  30. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  31. package/.next/server/app/api/auth/login/[provider]/route.js +1 -1
  32. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  33. package/.next/server/app/api/auth/providers/route.js +1 -1
  34. package/.next/server/app/api/cache-miss-notices/route.js +1 -1
  35. package/.next/server/app/api/cwd/browse/route.js +1 -1
  36. package/.next/server/app/api/cwd/pick/route.js +1 -1
  37. package/.next/server/app/api/cwd/validate/route.js +1 -1
  38. package/.next/server/app/api/default-cwd/route.js +1 -1
  39. package/.next/server/app/api/file-index/route.js +1 -1
  40. package/.next/server/app/api/files/[...path]/route.js +1 -1
  41. package/.next/server/app/api/git/diff/route.js +2 -2
  42. package/.next/server/app/api/git/status/route.js +1 -1
  43. package/.next/server/app/api/home/route.js +1 -1
  44. package/.next/server/app/api/mcp/route.js +1 -1
  45. package/.next/server/app/api/mcp/sign-in/[flowId]/route.js +1 -1
  46. package/.next/server/app/api/mcp/sign-in/route.js +1 -1
  47. package/.next/server/app/api/mcp/test/route.js +1 -1
  48. package/.next/server/app/api/models/enabled/route.js +1 -1
  49. package/.next/server/app/api/models/enabled/route.js.nft.json +1 -1
  50. package/.next/server/app/api/models/refresh/route.js +1 -1
  51. package/.next/server/app/api/models/route.js +1 -1
  52. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  53. package/.next/server/app/api/models-config/discover/route.js +1 -1
  54. package/.next/server/app/api/models-config/route.js +1 -1
  55. package/.next/server/app/api/models-config/test/route.js +1 -1
  56. package/.next/server/app/api/open-in-explorer/route.js +1 -1
  57. package/.next/server/app/api/plugins/check/route.js +1 -1
  58. package/.next/server/app/api/plugins/route.js +1 -1
  59. package/.next/server/app/api/project-trust/route.js +1 -1
  60. package/.next/server/app/api/provider-usage/query/route.js +1 -1
  61. package/.next/server/app/api/push/config/route.js +1 -1
  62. package/.next/server/app/api/push/subscribe/route.js +1 -1
  63. package/.next/server/app/api/sessions/[id]/auto-name/route.js +2 -2
  64. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  65. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  66. package/.next/server/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route.js +1 -1
  67. package/.next/server/app/api/sessions/[id]/export/route.js +14 -4
  68. package/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
  69. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  70. package/.next/server/app/api/sessions/[id]/share/route.js +55 -0
  71. package/.next/server/app/api/sessions/[id]/share/route.js.nft.json +1 -0
  72. package/.next/server/app/api/sessions/[id]/share/route_client-reference-manifest.js +1 -0
  73. package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
  74. package/.next/server/app/api/sessions/delete/route.js +1 -1
  75. package/.next/server/app/api/sessions/import/pick/route.js +1 -0
  76. package/.next/server/app/api/sessions/import/pick/route.js.nft.json +1 -0
  77. package/.next/server/app/api/sessions/import/pick/route_client-reference-manifest.js +1 -0
  78. package/.next/server/app/api/sessions/import/route.js +2 -0
  79. package/.next/server/app/api/{models/default → sessions/import}/route.js.nft.json +1 -1
  80. package/.next/server/app/api/sessions/import/route_client-reference-manifest.js +1 -0
  81. package/.next/server/app/api/sessions/route.js +1 -1
  82. package/.next/server/app/api/sessions/search/route.js +1 -1
  83. package/.next/server/app/api/sessions/stats/route.js +1 -1
  84. package/.next/server/app/api/sessions/ui-state/route.js +1 -1
  85. package/.next/server/app/api/skills/check/route.js +1 -1
  86. package/.next/server/app/api/skills/content/route.js +1 -1
  87. package/.next/server/app/api/skills/install/route.js +1 -1
  88. package/.next/server/app/api/skills/route.js +1 -1
  89. package/.next/server/app/api/skills/search/route.js +1 -1
  90. package/.next/server/app/api/skills/update/route.js +1 -1
  91. package/.next/server/app/api/sleep-inhibit/route.js +1 -1
  92. package/.next/server/app/api/subagents/[id]/route.js +1 -1
  93. package/.next/server/app/api/subagents/profiles/route.js +1 -1
  94. package/.next/server/app/api/subagents/settings/route.js +1 -1
  95. package/.next/server/app/api/terminal/[id]/events/route.js +1 -1
  96. package/.next/server/app/api/terminal/[id]/route.js +1 -1
  97. package/.next/server/app/api/terminal/route.js +1 -1
  98. package/.next/server/app/api/tools/settings/route.js +1 -1
  99. package/.next/server/app/api/web-auth/route.js +1 -1
  100. package/.next/server/app/api/worktrees/route.js +1 -1
  101. package/.next/server/app/favicon.ico/route.js +1 -1
  102. package/.next/server/app/index.html +1 -1
  103. package/.next/server/app/index.rsc +5 -5
  104. package/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  105. package/.next/server/app/index.segments/_full.segment.rsc +5 -5
  106. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  107. package/.next/server/app/login/page.js +1 -1
  108. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  109. package/.next/server/app/login.html +1 -1
  110. package/.next/server/app/login.rsc +3 -3
  111. package/.next/server/app/login.segments/_full.segment.rsc +3 -3
  112. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  113. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  114. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  115. package/.next/server/app/page.js +12 -14
  116. package/.next/server/app/page_client-reference-manifest.js +1 -1
  117. package/.next/server/app-paths-manifest.json +22 -20
  118. package/.next/server/chunks/2243.js +1 -1
  119. package/.next/server/chunks/7979.js +1 -1
  120. package/.next/server/functions-config-manifest.json +1 -0
  121. package/.next/server/instrumentation.js.nft.json +1 -1
  122. package/.next/server/middleware-build-manifest.js +1 -1
  123. package/.next/server/middleware.js +2 -2
  124. package/.next/server/pages/404.html +1 -1
  125. package/.next/server/pages/500.html +1 -1
  126. package/.next/server/preview-props.json +3 -3
  127. package/.next/server/server-reference-manifest.json +1 -1
  128. package/.next/static/R5PN1Mg8bAb01xwQ2DM9k/_buildManifest.js +1 -0
  129. package/.next/static/chunks/1278-8eaba54dabdd20f4.js +1 -0
  130. package/.next/static/chunks/app/_global-error/page-372b1b76af46907f.js +1 -0
  131. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-372b1b76af46907f.js +1 -0
  132. package/.next/static/chunks/app/api/agent/[id]/events/route-372b1b76af46907f.js +1 -0
  133. package/.next/static/chunks/app/api/agent/[id]/lease/route-372b1b76af46907f.js +1 -0
  134. package/.next/static/chunks/app/api/agent/[id]/route-372b1b76af46907f.js +1 -0
  135. package/.next/static/chunks/app/api/agent/debug/route-372b1b76af46907f.js +1 -0
  136. package/.next/static/chunks/app/api/agent/new/route-372b1b76af46907f.js +1 -0
  137. package/.next/static/chunks/app/api/agent/running/route-372b1b76af46907f.js +1 -0
  138. package/.next/static/chunks/app/api/app-update/route-372b1b76af46907f.js +1 -0
  139. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-372b1b76af46907f.js +1 -0
  140. package/.next/static/chunks/app/api/auth/login/[provider]/route-372b1b76af46907f.js +1 -0
  141. package/.next/static/chunks/app/api/auth/logout/[provider]/route-372b1b76af46907f.js +1 -0
  142. package/.next/static/chunks/app/api/auth/providers/route-372b1b76af46907f.js +1 -0
  143. package/.next/static/chunks/app/api/cache-miss-notices/route-372b1b76af46907f.js +1 -0
  144. package/.next/static/chunks/app/api/cwd/browse/route-372b1b76af46907f.js +1 -0
  145. package/.next/static/chunks/app/api/cwd/pick/route-372b1b76af46907f.js +1 -0
  146. package/.next/static/chunks/app/api/cwd/validate/route-372b1b76af46907f.js +1 -0
  147. package/.next/static/chunks/app/api/default-cwd/route-372b1b76af46907f.js +1 -0
  148. package/.next/static/chunks/app/api/file-index/route-372b1b76af46907f.js +1 -0
  149. package/.next/static/chunks/app/api/files/[...path]/route-372b1b76af46907f.js +1 -0
  150. package/.next/static/chunks/app/api/git/diff/route-372b1b76af46907f.js +1 -0
  151. package/.next/static/chunks/app/api/git/status/route-372b1b76af46907f.js +1 -0
  152. package/.next/static/chunks/app/api/home/route-372b1b76af46907f.js +1 -0
  153. package/.next/static/chunks/app/api/mcp/route-372b1b76af46907f.js +1 -0
  154. package/.next/static/chunks/app/api/mcp/sign-in/[flowId]/route-372b1b76af46907f.js +1 -0
  155. package/.next/static/chunks/app/api/mcp/sign-in/route-372b1b76af46907f.js +1 -0
  156. package/.next/static/chunks/app/api/mcp/test/route-372b1b76af46907f.js +1 -0
  157. package/.next/static/chunks/app/api/models/enabled/route-372b1b76af46907f.js +1 -0
  158. package/.next/static/chunks/app/api/models/refresh/route-372b1b76af46907f.js +1 -0
  159. package/.next/static/chunks/app/api/models/route-372b1b76af46907f.js +1 -0
  160. package/.next/static/chunks/app/api/models-config/catalog/route-372b1b76af46907f.js +1 -0
  161. package/.next/static/chunks/app/api/models-config/discover/route-372b1b76af46907f.js +1 -0
  162. package/.next/static/chunks/app/api/models-config/route-372b1b76af46907f.js +1 -0
  163. package/.next/static/chunks/app/api/models-config/test/route-372b1b76af46907f.js +1 -0
  164. package/.next/static/chunks/app/api/open-in-explorer/route-372b1b76af46907f.js +1 -0
  165. package/.next/static/chunks/app/api/plugins/check/route-372b1b76af46907f.js +1 -0
  166. package/.next/static/chunks/app/api/plugins/route-372b1b76af46907f.js +1 -0
  167. package/.next/static/chunks/app/api/project-trust/route-372b1b76af46907f.js +1 -0
  168. package/.next/static/chunks/app/api/provider-usage/query/route-372b1b76af46907f.js +1 -0
  169. package/.next/static/chunks/app/api/push/config/route-372b1b76af46907f.js +1 -0
  170. package/.next/static/chunks/app/api/push/subscribe/route-372b1b76af46907f.js +1 -0
  171. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-372b1b76af46907f.js +1 -0
  172. package/.next/static/chunks/app/api/sessions/[id]/context/route-372b1b76af46907f.js +1 -0
  173. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-372b1b76af46907f.js +1 -0
  174. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-372b1b76af46907f.js +1 -0
  175. package/.next/static/chunks/app/api/sessions/[id]/export/route-372b1b76af46907f.js +1 -0
  176. package/.next/static/chunks/app/api/sessions/[id]/fork/route-372b1b76af46907f.js +1 -0
  177. package/.next/static/chunks/app/api/sessions/[id]/route-372b1b76af46907f.js +1 -0
  178. package/.next/static/chunks/app/api/sessions/[id]/share/route-372b1b76af46907f.js +1 -0
  179. package/.next/static/chunks/app/api/sessions/[id]/state/route-372b1b76af46907f.js +1 -0
  180. package/.next/static/chunks/app/api/sessions/delete/route-372b1b76af46907f.js +1 -0
  181. package/.next/static/chunks/app/api/sessions/import/pick/route-372b1b76af46907f.js +1 -0
  182. package/.next/static/chunks/app/api/sessions/import/route-372b1b76af46907f.js +1 -0
  183. package/.next/static/chunks/app/api/sessions/route-372b1b76af46907f.js +1 -0
  184. package/.next/static/chunks/app/api/sessions/search/route-372b1b76af46907f.js +1 -0
  185. package/.next/static/chunks/app/api/sessions/stats/route-372b1b76af46907f.js +1 -0
  186. package/.next/static/chunks/app/api/sessions/ui-state/route-372b1b76af46907f.js +1 -0
  187. package/.next/static/chunks/app/api/skills/check/route-372b1b76af46907f.js +1 -0
  188. package/.next/static/chunks/app/api/skills/content/route-372b1b76af46907f.js +1 -0
  189. package/.next/static/chunks/app/api/skills/install/route-372b1b76af46907f.js +1 -0
  190. package/.next/static/chunks/app/api/skills/route-372b1b76af46907f.js +1 -0
  191. package/.next/static/chunks/app/api/skills/search/route-372b1b76af46907f.js +1 -0
  192. package/.next/static/chunks/app/api/skills/update/route-372b1b76af46907f.js +1 -0
  193. package/.next/static/chunks/app/api/sleep-inhibit/route-372b1b76af46907f.js +1 -0
  194. package/.next/static/chunks/app/api/subagents/[id]/route-372b1b76af46907f.js +1 -0
  195. package/.next/static/chunks/app/api/subagents/profiles/route-372b1b76af46907f.js +1 -0
  196. package/.next/static/chunks/app/api/subagents/settings/route-372b1b76af46907f.js +1 -0
  197. package/.next/static/chunks/app/api/terminal/[id]/events/route-372b1b76af46907f.js +1 -0
  198. package/.next/static/chunks/app/api/terminal/[id]/route-372b1b76af46907f.js +1 -0
  199. package/.next/static/chunks/app/api/terminal/route-372b1b76af46907f.js +1 -0
  200. package/.next/static/chunks/app/api/tools/settings/route-372b1b76af46907f.js +1 -0
  201. package/.next/static/chunks/app/api/web-auth/route-372b1b76af46907f.js +1 -0
  202. package/.next/static/chunks/app/api/worktrees/route-372b1b76af46907f.js +1 -0
  203. package/.next/static/chunks/app/{layout-e6046f8c0bc1768d.js → layout-5f83006eeeda0674.js} +1 -1
  204. package/.next/static/chunks/app/manifest.webmanifest/route-372b1b76af46907f.js +1 -0
  205. package/.next/static/chunks/app/page-5c9e0f41ea07cfdd.js +1129 -0
  206. package/.next/static/chunks/next/dist/client/components/builtin/app-error-372b1b76af46907f.js +1 -0
  207. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-372b1b76af46907f.js +1 -0
  208. package/.next/static/chunks/next/dist/client/components/builtin/not-found-372b1b76af46907f.js +1 -0
  209. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-372b1b76af46907f.js +1 -0
  210. package/.next/trace +183 -61
  211. package/.next/trace-build +1 -1
  212. package/.next/types/app/api/sessions/[id]/share/route.ts +355 -0
  213. package/.next/types/app/api/sessions/import/pick/route.ts +355 -0
  214. package/.next/types/app/api/{models/default → sessions/import}/route.ts +3 -3
  215. package/.next/types/routes.d.ts +4 -2
  216. package/.next/types/validator.ts +30 -10
  217. package/package.json +2 -2
  218. package/.next/server/app/api/models/default/route.js +0 -1
  219. package/.next/server/app/api/models/default/route_client-reference-manifest.js +0 -1
  220. package/.next/server/chunks/27.js +0 -1
  221. package/.next/static/3au4SIYjchaubI1HowdKE/_buildManifest.js +0 -1
  222. package/.next/static/chunks/1278-7900e52add02a581.js +0 -1
  223. package/.next/static/chunks/app/_global-error/page-ff5f37ea6085322e.js +0 -1
  224. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-ff5f37ea6085322e.js +0 -1
  225. package/.next/static/chunks/app/api/agent/[id]/events/route-ff5f37ea6085322e.js +0 -1
  226. package/.next/static/chunks/app/api/agent/[id]/lease/route-ff5f37ea6085322e.js +0 -1
  227. package/.next/static/chunks/app/api/agent/[id]/route-ff5f37ea6085322e.js +0 -1
  228. package/.next/static/chunks/app/api/agent/debug/route-ff5f37ea6085322e.js +0 -1
  229. package/.next/static/chunks/app/api/agent/new/route-ff5f37ea6085322e.js +0 -1
  230. package/.next/static/chunks/app/api/agent/running/route-ff5f37ea6085322e.js +0 -1
  231. package/.next/static/chunks/app/api/app-update/route-ff5f37ea6085322e.js +0 -1
  232. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-ff5f37ea6085322e.js +0 -1
  233. package/.next/static/chunks/app/api/auth/login/[provider]/route-ff5f37ea6085322e.js +0 -1
  234. package/.next/static/chunks/app/api/auth/logout/[provider]/route-ff5f37ea6085322e.js +0 -1
  235. package/.next/static/chunks/app/api/auth/providers/route-ff5f37ea6085322e.js +0 -1
  236. package/.next/static/chunks/app/api/cache-miss-notices/route-ff5f37ea6085322e.js +0 -1
  237. package/.next/static/chunks/app/api/cwd/browse/route-ff5f37ea6085322e.js +0 -1
  238. package/.next/static/chunks/app/api/cwd/pick/route-ff5f37ea6085322e.js +0 -1
  239. package/.next/static/chunks/app/api/cwd/validate/route-ff5f37ea6085322e.js +0 -1
  240. package/.next/static/chunks/app/api/default-cwd/route-ff5f37ea6085322e.js +0 -1
  241. package/.next/static/chunks/app/api/file-index/route-ff5f37ea6085322e.js +0 -1
  242. package/.next/static/chunks/app/api/files/[...path]/route-ff5f37ea6085322e.js +0 -1
  243. package/.next/static/chunks/app/api/git/diff/route-ff5f37ea6085322e.js +0 -1
  244. package/.next/static/chunks/app/api/git/status/route-ff5f37ea6085322e.js +0 -1
  245. package/.next/static/chunks/app/api/home/route-ff5f37ea6085322e.js +0 -1
  246. package/.next/static/chunks/app/api/mcp/route-ff5f37ea6085322e.js +0 -1
  247. package/.next/static/chunks/app/api/mcp/sign-in/[flowId]/route-ff5f37ea6085322e.js +0 -1
  248. package/.next/static/chunks/app/api/mcp/sign-in/route-ff5f37ea6085322e.js +0 -1
  249. package/.next/static/chunks/app/api/mcp/test/route-ff5f37ea6085322e.js +0 -1
  250. package/.next/static/chunks/app/api/models/default/route-ff5f37ea6085322e.js +0 -1
  251. package/.next/static/chunks/app/api/models/enabled/route-ff5f37ea6085322e.js +0 -1
  252. package/.next/static/chunks/app/api/models/refresh/route-ff5f37ea6085322e.js +0 -1
  253. package/.next/static/chunks/app/api/models/route-ff5f37ea6085322e.js +0 -1
  254. package/.next/static/chunks/app/api/models-config/catalog/route-ff5f37ea6085322e.js +0 -1
  255. package/.next/static/chunks/app/api/models-config/discover/route-ff5f37ea6085322e.js +0 -1
  256. package/.next/static/chunks/app/api/models-config/route-ff5f37ea6085322e.js +0 -1
  257. package/.next/static/chunks/app/api/models-config/test/route-ff5f37ea6085322e.js +0 -1
  258. package/.next/static/chunks/app/api/open-in-explorer/route-ff5f37ea6085322e.js +0 -1
  259. package/.next/static/chunks/app/api/plugins/check/route-ff5f37ea6085322e.js +0 -1
  260. package/.next/static/chunks/app/api/plugins/route-ff5f37ea6085322e.js +0 -1
  261. package/.next/static/chunks/app/api/project-trust/route-ff5f37ea6085322e.js +0 -1
  262. package/.next/static/chunks/app/api/provider-usage/query/route-ff5f37ea6085322e.js +0 -1
  263. package/.next/static/chunks/app/api/push/config/route-ff5f37ea6085322e.js +0 -1
  264. package/.next/static/chunks/app/api/push/subscribe/route-ff5f37ea6085322e.js +0 -1
  265. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-ff5f37ea6085322e.js +0 -1
  266. package/.next/static/chunks/app/api/sessions/[id]/context/route-ff5f37ea6085322e.js +0 -1
  267. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-ff5f37ea6085322e.js +0 -1
  268. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-ff5f37ea6085322e.js +0 -1
  269. package/.next/static/chunks/app/api/sessions/[id]/export/route-ff5f37ea6085322e.js +0 -1
  270. package/.next/static/chunks/app/api/sessions/[id]/fork/route-ff5f37ea6085322e.js +0 -1
  271. package/.next/static/chunks/app/api/sessions/[id]/route-ff5f37ea6085322e.js +0 -1
  272. package/.next/static/chunks/app/api/sessions/[id]/state/route-ff5f37ea6085322e.js +0 -1
  273. package/.next/static/chunks/app/api/sessions/delete/route-ff5f37ea6085322e.js +0 -1
  274. package/.next/static/chunks/app/api/sessions/route-ff5f37ea6085322e.js +0 -1
  275. package/.next/static/chunks/app/api/sessions/search/route-ff5f37ea6085322e.js +0 -1
  276. package/.next/static/chunks/app/api/sessions/stats/route-ff5f37ea6085322e.js +0 -1
  277. package/.next/static/chunks/app/api/sessions/ui-state/route-ff5f37ea6085322e.js +0 -1
  278. package/.next/static/chunks/app/api/skills/check/route-ff5f37ea6085322e.js +0 -1
  279. package/.next/static/chunks/app/api/skills/content/route-ff5f37ea6085322e.js +0 -1
  280. package/.next/static/chunks/app/api/skills/install/route-ff5f37ea6085322e.js +0 -1
  281. package/.next/static/chunks/app/api/skills/route-ff5f37ea6085322e.js +0 -1
  282. package/.next/static/chunks/app/api/skills/search/route-ff5f37ea6085322e.js +0 -1
  283. package/.next/static/chunks/app/api/skills/update/route-ff5f37ea6085322e.js +0 -1
  284. package/.next/static/chunks/app/api/sleep-inhibit/route-ff5f37ea6085322e.js +0 -1
  285. package/.next/static/chunks/app/api/subagents/[id]/route-ff5f37ea6085322e.js +0 -1
  286. package/.next/static/chunks/app/api/subagents/profiles/route-ff5f37ea6085322e.js +0 -1
  287. package/.next/static/chunks/app/api/subagents/settings/route-ff5f37ea6085322e.js +0 -1
  288. package/.next/static/chunks/app/api/terminal/[id]/events/route-ff5f37ea6085322e.js +0 -1
  289. package/.next/static/chunks/app/api/terminal/[id]/route-ff5f37ea6085322e.js +0 -1
  290. package/.next/static/chunks/app/api/terminal/route-ff5f37ea6085322e.js +0 -1
  291. package/.next/static/chunks/app/api/tools/settings/route-ff5f37ea6085322e.js +0 -1
  292. package/.next/static/chunks/app/api/web-auth/route-ff5f37ea6085322e.js +0 -1
  293. package/.next/static/chunks/app/api/worktrees/route-ff5f37ea6085322e.js +0 -1
  294. package/.next/static/chunks/app/manifest.webmanifest/route-ff5f37ea6085322e.js +0 -1
  295. package/.next/static/chunks/app/page-203e16d5e1138523.js +0 -1131
  296. package/.next/static/chunks/next/dist/client/components/builtin/app-error-ff5f37ea6085322e.js +0 -1
  297. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-ff5f37ea6085322e.js +0 -1
  298. package/.next/static/chunks/next/dist/client/components/builtin/not-found-ff5f37ea6085322e.js +0 -1
  299. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ff5f37ea6085322e.js +0 -1
  300. /package/.next/static/{3au4SIYjchaubI1HowdKE → R5PN1Mg8bAb01xwQ2DM9k}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
1
  "use strict";(()=>{var a={};a.id=9968,a.ids=[9968],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")},3734:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{S:()=>g});var e=c(75430),f=a([e]);e=(f.then?(await f)():f)[0];let h="disable-model-invocation",i=`[ \\t]*(?:${h}|"${h}"|'${h}')[ \\t]*:`,j="\\r\\n|\\n|\\r";function g(a,b){let{frontmatter:c}=(0,e.parseFrontmatter)(a),d=Object.prototype.hasOwnProperty.call(c,h);if(!b&&!d)return a;let f=function(a){let b=RegExp(`^\\uFEFF?---[ \\t]*(${j})`).exec(a);if(!b)return;let c=a.slice(b[0].length),d=RegExp(`(^|${j})---`).exec(c);if(d)return{openingEnd:b[0].length,closingStart:b[0].length+d.index+d[1].length,newline:b[1]}}(a);if(b){if(d){if(!f)throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let b=a.slice(f.openingEnd,f.closingStart),c=RegExp(`(^|${j})(${i})[^\\r\\n]*`);if(!c.test(b))throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let d=b.replace(c,"$1$2 true");return a.slice(0,f.openingEnd)+d+a.slice(f.closingStart)}if(!f){let b;if(b=+!!a.startsWith("\uFEFF"),a.startsWith("---",b))throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let c=a.startsWith("\uFEFF")?"\uFEFF":"",d=c?a.slice(1):a;return`${c}---
2
2
  ${h}: true
3
3
  ---
4
- ${d}`}return a.slice(0,f.openingEnd)+`${h}: true${f.newline}`+a.slice(f.openingEnd)}if(!f)throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let g=a.slice(f.openingEnd,f.closingStart),k=RegExp(`(^|${j})${i}[^\\r\\n]*(?:${j}|$)`);if(!k.test(g))throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let l=g.replace(k,"$1");return a.slice(0,f.openingEnd)+l+a.slice(f.closingStart)}d()}catch(a){d(a)}})},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")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21278:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{y:()=>i});var e=c(75430),f=c(75805),g=c(72498),h=a([e,g]);async function i(a){let b=(0,e.getAgentDir)(),c=new e.DefaultResourceLoader({cwd:a,agentDir:b,noExtensions:!0});await c.reload((0,g.Fk)(a,b));let{skills:d,diagnostics:h}=c.getSkills();return{skills:(0,f._)(d,{cwd:a,agentDir:b}),diagnostics:h,projectResourcesLoaded:(0,g.Y1)(a,b).trusted}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},21820:a=>{a.exports=require("os")},24225:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/route",pathname:"/api/skills",filename:"route",bundlePath:"app/api/skills/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/skills/route.ts",nextConfigOutput:"",userland:()=>c(45403),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},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")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},45403:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>o,PATCH:()=>r,dynamic:()=>s});var e=c(23211),f=c(29021),g=c(21820),h=c(33873),i=c.n(h),j=c(75430),k=c(21278),l=c(3734),m=c(80547),n=a([j,k,l,m]);[j,k,l,m]=n.then?(await n)():n;let s="force-dynamic";async function o(a){let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});try{let a=await (0,m.mc)();if(!(0,m.B7)(c,a))return e.NextResponse.json({error:"Access denied"},{status:403});return e.NextResponse.json(await (0,k.y)(c))}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function p(){let a=new Set(await (0,m.mc)());a.add((0,j.getAgentDir)());let b=i().join((0,g.homedir)(),".agents","skills");return(0,f.existsSync)(b)&&a.add(b),a}function q(a,b,c){if(".md"!==i().extname(a).toLowerCase())return{status:400,error:"Not a skill file"};if(!(0,f.existsSync)(a))return{status:404,error:"file not found"};if(!(0,m.B7)(a,c))return{status:403,error:"Access denied"};let d=(0,f.readFileSync)(a,"utf8"),e=(0,l.S)(d,b);return e!==d&&(0,f.writeFileSync)(a,e,"utf8"),null}async function r(a){try{let{filePath:b,filePaths:c,disableModelInvocation:d}=await a.json();if(void 0!==c){if(!Array.isArray(c)||!c.every(a=>"string"==typeof a&&a))return e.NextResponse.json({error:"filePaths must be a list of paths"},{status:400});if("boolean"!=typeof d)return e.NextResponse.json({error:"disableModelInvocation must be a boolean"},{status:400});let a=await p(),b=[];for(let e of new Set(c))try{let c=q(e,d,a);b.push(c?{filePath:e,error:c.error}:{filePath:e})}catch(a){b.push({filePath:e,error:a instanceof Error?a.message:String(a)})}return e.NextResponse.json({results:b})}if(!b)return e.NextResponse.json({error:"filePath required"},{status:400});let f=q(b,d,await p());if(f)return e.NextResponse.json({error:f.error},{status:f.status});return e.NextResponse.json({success:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},75805:(a,b,c)=>{c.d(b,{_:()=>i});var d=c(29021),e=c(21820),f=c(33873);function g(a){try{let b=JSON.parse((0,d.readFileSync)(a,"utf8"));return b.skills&&"object"==typeof b.skills?b.skills:{}}catch{return{}}}function h(a,b,c){var d;let e=function(a,b){if(a[b])return a[b];let c=b.toLowerCase(),d=Object.keys(a).find(a=>a.toLowerCase()===c);return d?a[d]:void 0}(a,b);if(!e||"string"!=typeof e.source||!e.source.trim())return;let f="string"==typeof e.sourceType?e.sourceType:void 0,g=(d=e.source.trim(),"github"!==f?d.replace(/\/$/,""):d.replace(/^git\+/,"").replace(/^https?:\/\/github\.com\//,"").replace(/^git@github\.com:/,"").replace(/\.git$/,"").replace(/\/$/,""));if(!g)return;let h="string"==typeof e.skillPath?e.skillPath:void 0,i="string"==typeof e.ref?e.ref:void 0,j="global"===c?e.skillFolderHash:e.computedHash,k="string"==typeof j&&j?j:void 0,l="github"===f&&/^[\w.-]+\/[\w.-]+$/.test(g);return{package:`${g}@${b}`,scope:c,source:g,sourceType:f,skillsShUrl:"local"===f?void 0:function(a,b){if(!a||a.includes("://")||a.startsWith("git@"))return;let c=a.split("/").filter(Boolean).map(encodeURIComponent).join("/");if(c)return`https://skills.sh/${c}/${encodeURIComponent(b)}`}(g,b),...h&&{skillPath:h},...i&&{ref:i},...k&&{versionHash:k},canCheckForUpdates:!!(l&&h&&k&&("global"===c||!i))}}function i(a,{cwd:b,agentDir:c,homeDir:j=(0,e.homedir)(),globalLockPath:k=function({homeDir:a=(0,e.homedir)(),xdgStateHome:b=process.env.XDG_STATE_HOME}={}){return b?(0,f.join)(b,"skills",".skill-lock.json"):(0,f.join)(a,".agents",".skill-lock.json")}({homeDir:j}),projectLockPath:l=(0,f.join)(b,"skills-lock.json")}){let m=g(k),n=g(l),o=[(0,f.join)(c,"skills"),(0,f.join)(j,".agents","skills")],p=[(0,f.join)(b,".pi","skills"),(0,f.join)(b,".agents","skills")],q=(a,b)=>b.some(b=>{let c;return""!==(c=(0,f.relative)((0,f.resolve)(b),(0,f.resolve)(a)))&&".."!==c&&!c.startsWith(`..${f.sep}`)&&!(0,f.isAbsolute)(c)});return a.map(a=>{if(!(0,d.existsSync)(a.filePath))return a;let b=q(a.filePath,o)?h(m,a.name,"global"):q(a.filePath,p)?h(n,a.name,"project"):void 0;return b?{...a,install:b}:a})}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>k,B7:()=>l,mc:()=>j,uK:()=>h.uK,wz:()=>e.wz});var e=c(25252),f=c(82536),g=c(40402),h=c(58864),i=a([g]);async function j(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,g.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,e.Nw)(a.cwd)),a.projectRoot&&d.add((0,e.Nw)(a.projectRoot));for(let a of(0,e.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function k(a,b){return(0,f.o4)(a,b)}function l(a,b){return(0,f.xk)(a,b)}g=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,5582,2498],()=>b(b.s=24225));module.exports=c})();
4
+ ${d}`}return a.slice(0,f.openingEnd)+`${h}: true${f.newline}`+a.slice(f.openingEnd)}if(!f)throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let g=a.slice(f.openingEnd,f.closingStart),k=RegExp(`(^|${j})${i}[^\\r\\n]*(?:${j}|$)`);if(!k.test(g))throw Error(`Cannot edit ${h}: unsupported frontmatter formatting`);let l=g.replace(k,"$1");return a.slice(0,f.openingEnd)+l+a.slice(f.closingStart)}d()}catch(a){d(a)}})},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")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21278:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{y:()=>i});var e=c(75430),f=c(75805),g=c(72498),h=a([e,g]);async function i(a){let b=(0,e.getAgentDir)(),c=new e.DefaultResourceLoader({cwd:a,agentDir:b,noExtensions:!0});await c.reload((0,g.Fk)(a,b));let{skills:d,diagnostics:h}=c.getSkills();return{skills:(0,f._)(d,{cwd:a,agentDir:b}),diagnostics:h,projectResourcesLoaded:(0,g.Y1)(a,b).trusted}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},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")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},45403:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>o,PATCH:()=>r,dynamic:()=>s});var e=c(23211),f=c(29021),g=c(21820),h=c(33873),i=c.n(h),j=c(75430),k=c(21278),l=c(3734),m=c(80547),n=a([j,k,l,m]);[j,k,l,m]=n.then?(await n)():n;let s="force-dynamic";async function o(a){let{searchParams:b}=new URL(a.url),c=b.get("cwd");if(!c)return e.NextResponse.json({error:"cwd required"},{status:400});try{let a=await (0,m.mc)();if(!(0,m.B7)(c,a))return e.NextResponse.json({error:"Access denied"},{status:403});return e.NextResponse.json(await (0,k.y)(c))}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function p(){let a=new Set(await (0,m.mc)());a.add((0,j.getAgentDir)());let b=i().join((0,g.homedir)(),".agents","skills");return(0,f.existsSync)(b)&&a.add(b),a}function q(a,b,c){if(".md"!==i().extname(a).toLowerCase())return{status:400,error:"Not a skill file"};if(!(0,f.existsSync)(a))return{status:404,error:"file not found"};if(!(0,m.B7)(a,c))return{status:403,error:"Access denied"};let d=(0,f.readFileSync)(a,"utf8"),e=(0,l.S)(d,b);return e!==d&&(0,f.writeFileSync)(a,e,"utf8"),null}async function r(a){try{let{filePath:b,filePaths:c,disableModelInvocation:d}=await a.json();if(void 0!==c){if(!Array.isArray(c)||!c.every(a=>"string"==typeof a&&a))return e.NextResponse.json({error:"filePaths must be a list of paths"},{status:400});if("boolean"!=typeof d)return e.NextResponse.json({error:"disableModelInvocation must be a boolean"},{status:400});let a=await p(),b=[];for(let e of new Set(c))try{let c=q(e,d,a);b.push(c?{filePath:e,error:c.error}:{filePath:e})}catch(a){b.push({filePath:e,error:a instanceof Error?a.message:String(a)})}return e.NextResponse.json({results:b})}if(!b)return e.NextResponse.json({error:"filePath required"},{status:400});let f=q(b,d,await p());if(f)return e.NextResponse.json({error:f.error},{status:f.status});return e.NextResponse.json({success:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64962:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/route",pathname:"/api/skills",filename:"route",bundlePath:"app/api/skills/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/skills/route.ts",nextConfigOutput:"",userland:()=>c(45403),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},75805:(a,b,c)=>{c.d(b,{_:()=>i});var d=c(29021),e=c(21820),f=c(33873);function g(a){try{let b=JSON.parse((0,d.readFileSync)(a,"utf8"));return b.skills&&"object"==typeof b.skills?b.skills:{}}catch{return{}}}function h(a,b,c){var d;let e=function(a,b){if(a[b])return a[b];let c=b.toLowerCase(),d=Object.keys(a).find(a=>a.toLowerCase()===c);return d?a[d]:void 0}(a,b);if(!e||"string"!=typeof e.source||!e.source.trim())return;let f="string"==typeof e.sourceType?e.sourceType:void 0,g=(d=e.source.trim(),"github"!==f?d.replace(/\/$/,""):d.replace(/^git\+/,"").replace(/^https?:\/\/github\.com\//,"").replace(/^git@github\.com:/,"").replace(/\.git$/,"").replace(/\/$/,""));if(!g)return;let h="string"==typeof e.skillPath?e.skillPath:void 0,i="string"==typeof e.ref?e.ref:void 0,j="global"===c?e.skillFolderHash:e.computedHash,k="string"==typeof j&&j?j:void 0,l="github"===f&&/^[\w.-]+\/[\w.-]+$/.test(g);return{package:`${g}@${b}`,scope:c,source:g,sourceType:f,skillsShUrl:"local"===f?void 0:function(a,b){if(!a||a.includes("://")||a.startsWith("git@"))return;let c=a.split("/").filter(Boolean).map(encodeURIComponent).join("/");if(c)return`https://skills.sh/${c}/${encodeURIComponent(b)}`}(g,b),...h&&{skillPath:h},...i&&{ref:i},...k&&{versionHash:k},canCheckForUpdates:!!(l&&h&&k&&("global"===c||!i))}}function i(a,{cwd:b,agentDir:c,homeDir:j=(0,e.homedir)(),globalLockPath:k=function({homeDir:a=(0,e.homedir)(),xdgStateHome:b=process.env.XDG_STATE_HOME}={}){return b?(0,f.join)(b,"skills",".skill-lock.json"):(0,f.join)(a,".agents",".skill-lock.json")}({homeDir:j}),projectLockPath:l=(0,f.join)(b,"skills-lock.json")}){let m=g(k),n=g(l),o=[(0,f.join)(c,"skills"),(0,f.join)(j,".agents","skills")],p=[(0,f.join)(b,".pi","skills"),(0,f.join)(b,".agents","skills")],q=(a,b)=>b.some(b=>{let c;return""!==(c=(0,f.relative)((0,f.resolve)(b),(0,f.resolve)(a)))&&".."!==c&&!c.startsWith(`..${f.sep}`)&&!(0,f.isAbsolute)(c)});return a.map(a=>{if(!(0,d.existsSync)(a.filePath))return a;let b=q(a.filePath,o)?h(m,a.name,"global"):q(a.filePath,p)?h(n,a.name,"project"):void 0;return b?{...a,install:b}:a})}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>k,B7:()=>l,mc:()=>j,uK:()=>h.uK,wz:()=>e.wz});var e=c(25252),f=c(82536),g=c(40402),h=c(58864),i=a([g]);async function j(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,g.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,e.Nw)(a.cwd)),a.projectRoot&&d.add((0,e.Nw)(a.projectRoot));for(let a of(0,e.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function k(a,b){return(0,f.o4)(a,b)}function l(a,b){return(0,f.xk)(a,b)}g=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,5582,2498],()=>b(b.s=64962));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=3955,a.ids=[3955],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")},10595:(a,b,c)=>{"use strict";c.d(b,{f:()=>g});var d=c(29021),e=c(33873);let f=require("process");function g(a,b,c={}){let h=function(a,b={}){let c=b.nodeDir??(0,e.dirname)(f.execPath),g=b.fileExists??d.existsSync;for(let b of[(0,e.join)(c,"node_modules","npm","bin",`${a}-cli.js`),(0,e.join)(c,"..","lib","node_modules","npm","bin",`${a}-cli.js`)])try{if(g(b))return b}catch{}return null}(a,c);return h?{command:f.execPath,args:[h,...b]}:{command:a,args:b}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},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")},55511:a=>{"use strict";a.exports=require("crypto")},60537:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/search/route",pathname:"/api/skills/search",filename:"route",bundlePath:"app/api/skills/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/skills/search/route.ts",nextConfigOutput:"",userland:()=>c(78638),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/search/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},78638:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>l,dynamic:()=>f});var d=c(23211),e=c(97990);let f="force-dynamic",g=/\x1B\[[0-9;]*m/g,h=process.env.SKILLS_API_URL||"https://skills.sh";function i(a){let b=a.replace(g,""),c=[],d=b.split("\n");for(let a=0;a<d.length;a++){let b=d[a].trim().match(/^([\w.\-]+\/[\w.\-@:]+)\s+([\d.,]+[KMB]?\s+installs)$/);if(b){let e=d[a+1]?.trim().replace(/^└\s*/,"");c.push({package:b[1],installs:b[2],url:e?.startsWith("https://")?e:""})}}return c}async function j(a,b){let c=`${h}/api/search?q=${encodeURIComponent(a)}&limit=${b}`,d=await fetch(c,{cache:"no-store"});if(!d.ok)throw Error(`skills.sh search failed: HTTP ${d.status}`);return((await d.json()).skills??[]).map(a=>{var b;let c=a.name?.trim(),d=a.source?.trim(),e=a.id?.trim();return c&&(d||e)?{package:`${d||e}@${c}`,installs:(b=a.installs)&&!(b<=0)?b>=1e6?`${(b/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:b>=1e3?`${(b/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${b} install${1===b?"":"s"}`:"",url:e?`${h}/${e}`:""}:null}).filter(a=>null!==a).sort((a,b)=>k(b.installs)-k(a.installs))}function k(a){let b=a.match(/^([\d.]+)([KMB])?\s+installs?$/);if(!b)return 0;let c=Number(b[1]);return Number.isFinite(c)?c*("B"===b[2]?1e9:"M"===b[2]?1e6:"K"===b[2]?1e3:1):0}async function l(a){try{let b,{query:c,limit:f}=await a.json();if(!c?.trim())return d.NextResponse.json({error:"query required"},{status:400});let g=(b="number"==typeof f?f:Number(f),Number.isFinite(b)?Math.min(50,Math.max(1,Math.floor(b))):50);try{let a=await j(c.trim(),g);return d.NextResponse.json({results:a})}catch{let{stdout:a,stderr:b}=await (0,e.a)(["skills","find",c.trim()],{timeout:2e4,env:{...process.env,FORCE_COLOR:"0"}}),f=i(a+b).slice(0,g);return d.NextResponse.json({results:f})}}catch(c){let a=(c.stdout??"")+(c.stderr??""),b=a?i(a):[];if(b.length>0)return d.NextResponse.json({results:b});return d.NextResponse.json({error:c.message??String(c)},{status:500})}}},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},97990:(a,b,c)=>{"use strict";c.d(b,{a:()=>h});var d=c(79646),e=c(28354),f=c(10595);let g=(0,e.promisify)(d.execFile);async function h(a,b={}){let{command:c,args:d}=(0,f.f)("npx",a);return g(c,d,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813],()=>b(b.s=60537));module.exports=c})();
1
+ (()=>{var a={};a.id=3955,a.ids=[3955],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")},10595:(a,b,c)=>{"use strict";c.d(b,{f:()=>g});var d=c(29021),e=c(33873);let f=require("process");function g(a,b,c={}){let h=function(a,b={}){let c=b.nodeDir??(0,e.dirname)(f.execPath),g=b.fileExists??d.existsSync;for(let b of[(0,e.join)(c,"node_modules","npm","bin",`${a}-cli.js`),(0,e.join)(c,"..","lib","node_modules","npm","bin",`${a}-cli.js`)])try{if(g(b))return b}catch{}return null}(a,c);return h?{command:f.execPath,args:[h,...b]}:{command:a,args:b}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},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")},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")},78335:()=>{},78638:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>l,dynamic:()=>f});var d=c(23211),e=c(97990);let f="force-dynamic",g=/\x1B\[[0-9;]*m/g,h=process.env.SKILLS_API_URL||"https://skills.sh";function i(a){let b=a.replace(g,""),c=[],d=b.split("\n");for(let a=0;a<d.length;a++){let b=d[a].trim().match(/^([\w.\-]+\/[\w.\-@:]+)\s+([\d.,]+[KMB]?\s+installs)$/);if(b){let e=d[a+1]?.trim().replace(/^└\s*/,"");c.push({package:b[1],installs:b[2],url:e?.startsWith("https://")?e:""})}}return c}async function j(a,b){let c=`${h}/api/search?q=${encodeURIComponent(a)}&limit=${b}`,d=await fetch(c,{cache:"no-store"});if(!d.ok)throw Error(`skills.sh search failed: HTTP ${d.status}`);return((await d.json()).skills??[]).map(a=>{var b;let c=a.name?.trim(),d=a.source?.trim(),e=a.id?.trim();return c&&(d||e)?{package:`${d||e}@${c}`,installs:(b=a.installs)&&!(b<=0)?b>=1e6?`${(b/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:b>=1e3?`${(b/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${b} install${1===b?"":"s"}`:"",url:e?`${h}/${e}`:""}:null}).filter(a=>null!==a).sort((a,b)=>k(b.installs)-k(a.installs))}function k(a){let b=a.match(/^([\d.]+)([KMB])?\s+installs?$/);if(!b)return 0;let c=Number(b[1]);return Number.isFinite(c)?c*("B"===b[2]?1e9:"M"===b[2]?1e6:"K"===b[2]?1e3:1):0}async function l(a){try{let b,{query:c,limit:f}=await a.json();if(!c?.trim())return d.NextResponse.json({error:"query required"},{status:400});let g=(b="number"==typeof f?f:Number(f),Number.isFinite(b)?Math.min(50,Math.max(1,Math.floor(b))):50);try{let a=await j(c.trim(),g);return d.NextResponse.json({results:a})}catch{let{stdout:a,stderr:b}=await (0,e.a)(["skills","find",c.trim()],{timeout:2e4,env:{...process.env,FORCE_COLOR:"0"}}),f=i(a+b).slice(0,g);return d.NextResponse.json({results:f})}}catch(c){let a=(c.stdout??"")+(c.stderr??""),b=a?i(a):[];if(b.length>0)return d.NextResponse.json({results:b});return d.NextResponse.json({error:c.message??String(c)},{status:500})}}},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87434:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/search/route",pathname:"/api/skills/search",filename:"route",bundlePath:"app/api/skills/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/skills/search/route.ts",nextConfigOutput:"",userland:()=>c(78638),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/search/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},96487:()=>{},97990:(a,b,c)=>{"use strict";c.d(b,{a:()=>h});var d=c(79646),e=c(28354),f=c(10595);let g=(0,e.promisify)(d.execFile);async function h(a,b={}){let{command:c,args:d}=(0,f.f)("npx",a);return g(c,d,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813],()=>b(b.s=87434));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=9156,a.ids=[9156],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")},10595:(a,b,c)=>{c.d(b,{f:()=>g});var d=c(29021),e=c(33873);let f=require("process");function g(a,b,c={}){let h=function(a,b={}){let c=b.nodeDir??(0,e.dirname)(f.execPath),g=b.fileExists??d.existsSync;for(let b of[(0,e.join)(c,"node_modules","npm","bin",`${a}-cli.js`),(0,e.join)(c,"..","lib","node_modules","npm","bin",`${a}-cli.js`)])try{if(g(b))return b}catch{}return null}(a,c);return h?{command:f.execPath,args:[h,...b]}:{command:a,args:b}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19038:(a,b,c)=>{c.d(b,{CU:()=>l,S7:()=>u});var d=c(79646),e=c(79748),f=c(21820),g=c(33873),h=c(28354);let i=process.env.SKILLS_API_URL||"https://skills.sh",j=(0,h.promisify)(d.execFile);class k extends Error{constructor(a){super(`HTTP ${a}`),this.status=a}}function l(a){let b=n(a.skillPath??""),c=b?`${a.source}/${b}`:a.source,d=a.ref?`#${encodeURIComponent(a.ref)}`:"",e=["skills","add",`${c}${d}`,"--skill",m(a.package),"-y","--agent","pi"];return"global"===a.scope&&e.push("-g"),e}function m(a){let b=a.lastIndexOf("@");return b>=0?a.slice(b+1):a}function n(a){let b=a.replace(/\\/g,"/");return b.toLowerCase().endsWith("/skill.md")?b=b.slice(0,-9):b.toLowerCase().endsWith("skill.md")&&(b=b.slice(0,-8)),b.replace(/\/$/,"")}function o(a,b,c,d){return{package:a.package,scope:a.scope,state:b,currentVersion:a.versionHash,latestVersion:c,message:d}}async function p(a,b,c){let d=await b(a,{cache:"no-store",headers:c,signal:AbortSignal.timeout(15e3)});if(!d.ok)throw new k(d.status);return d.json()}async function q(a){let b=`https://github.com/${a.source}.git`,c=a.ref||"HEAD",d=n(a.skillPath),h=await (0,e.mkdtemp)((0,g.join)((0,f.tmpdir)(),"pi-web-skill-check-"));try{await j("git",["init","--bare",h],{timeout:3e4}),await j("git",[`--git-dir=${h}`,"fetch","--depth=1","--filter=blob:none","--no-tags",b,c],{timeout:3e4});let a=d?`FETCH_HEAD:${d}`:"FETCH_HEAD^{tree}",{stdout:e}=await j("git",[`--git-dir=${h}`,"rev-parse",a],{timeout:3e4}),f=e.trim();if(!/^[0-9a-f]{40}$/i.test(f))throw Error("Invalid Git tree hash");return f}finally{await (0,e.rm)(h,{recursive:!0,force:!0})}}async function r(a,b){let c,d=a.ref||"HEAD",e=`https://api.github.com/repos/${a.source}/git/trees/${encodeURIComponent(d)}?recursive=1`,f={Accept:"application/vnd.github.v3+json","User-Agent":"pi-web"};b.githubToken&&(f.Authorization=`Bearer ${b.githubToken}`);let g=n(a.skillPath);try{let a=await p(e,b.fetcher,f);if(c="string"!=typeof a.sha||g?void 0:a.sha,g&&Array.isArray(a.tree)){let b=a.tree.find(a=>"tree"===a.type&&a.path===g);b&&"string"==typeof b.sha&&(c=b.sha)}}catch(d){if(!(d instanceof k)||![401,403,429].includes(d.status))throw d;c=await b.resolveGitTreeHash(a)}return c?o(a,c===a.versionHash?"up-to-date":"update-available",c):o(a,"error",void 0,"Remote skill path was not found.")}async function s(a,b){let[c,d]=a.source.split("/"),e=m(a.package).toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),f=`${b.skillsApiBase}/api/download/${encodeURIComponent(c)}/${encodeURIComponent(d)}/${encodeURIComponent(e)}`,g=await p(f,b.fetcher),h="string"==typeof g.hash?g.hash:void 0;return h?o(a,h===a.versionHash?"up-to-date":"update-available",h):o(a,"error",void 0,"skills.sh did not return a version hash.")}async function t(a,b={}){if(!a.canCheckForUpdates||!a.versionHash||!a.skillPath)return o(a,"unsupported",void 0,"This lock entry cannot be checked automatically.");let c={...b,fetcher:b.fetcher??fetch,skillsApiBase:b.skillsApiBase??i,resolveGitTreeHash:b.resolveGitTreeHash??q};try{return"global"===a.scope?await r(a,c):await s(a,c)}catch(b){return o(a,"error",void 0,b instanceof Error?b.message:String(b))}}async function u(a,b={}){let c=b.fetcher??fetch,d=new Map,e=async(a,b)=>{let e=d.get(a);return e||(e=c(a,b),d.set(a,e)),(await e).clone()};return Promise.all(a.map(a=>t(a,{...b,fetcher:e})))}},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21278:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{y:()=>i});var e=c(75430),f=c(75805),g=c(72498),h=a([e,g]);async function i(a){let b=(0,e.getAgentDir)(),c=new e.DefaultResourceLoader({cwd:a,agentDir:b,noExtensions:!0});await c.reload((0,g.Fk)(a,b));let{skills:d,diagnostics:h}=c.getSkills();return{skills:(0,f._)(d,{cwd:a,agentDir:b}),diagnostics:h,projectResourcesLoaded:(0,g.Y1)(a,b).trusted}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},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")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},56679:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>l});var e=c(23211),f=c(97990),g=c(19038),h=c(21278),i=c(80547),j=a([h,i]);[h,i]=j.then?(await j)():j;let l="force-dynamic";async function k(a){try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd:"",d="string"==typeof b.package?b.package:"",j="global"===b.scope||"project"===b.scope?b.scope:void 0;if(!c||!d||!j)return e.NextResponse.json({error:"cwd, package, and scope are required"},{status:400});let k=await (0,i.mc)();if(!(0,i.B7)(c,k))return e.NextResponse.json({error:"Access denied"},{status:403});let{skills:l}=await (0,h.y)(c),m=l.find(a=>a.install?.package===d&&a.install.scope===j);if(!m?.install)return e.NextResponse.json({error:"Installed skill not found"},{status:404});if(!m.install.canCheckForUpdates)return e.NextResponse.json({error:"This skill cannot be updated automatically"},{status:400});let{stdout:n,stderr:o}=await (0,f.a)((0,g.CU)(m.install),{timeout:6e4,cwd:"project"===j?c:void 0,env:{...process.env,FORCE_COLOR:"0"}}),p=(await (0,h.y)(c)).skills.find(a=>a.install?.package===d&&a.install.scope===j);return e.NextResponse.json({success:!0,skill:p,output:`${n}${o}`.slice(-500)})}catch(b){let a=`${b.stdout??""}${b.stderr??""}`;return e.NextResponse.json({error:a||b.message||String(b)},{status:500})}}d()}catch(a){d(a)}})},57809:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/update/route",pathname:"/api/skills/update",filename:"route",bundlePath:"app/api/skills/update/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/skills/update/route.ts",nextConfigOutput:"",userland:()=>c(56679),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/update/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},75805:(a,b,c)=>{c.d(b,{_:()=>i});var d=c(29021),e=c(21820),f=c(33873);function g(a){try{let b=JSON.parse((0,d.readFileSync)(a,"utf8"));return b.skills&&"object"==typeof b.skills?b.skills:{}}catch{return{}}}function h(a,b,c){var d;let e=function(a,b){if(a[b])return a[b];let c=b.toLowerCase(),d=Object.keys(a).find(a=>a.toLowerCase()===c);return d?a[d]:void 0}(a,b);if(!e||"string"!=typeof e.source||!e.source.trim())return;let f="string"==typeof e.sourceType?e.sourceType:void 0,g=(d=e.source.trim(),"github"!==f?d.replace(/\/$/,""):d.replace(/^git\+/,"").replace(/^https?:\/\/github\.com\//,"").replace(/^git@github\.com:/,"").replace(/\.git$/,"").replace(/\/$/,""));if(!g)return;let h="string"==typeof e.skillPath?e.skillPath:void 0,i="string"==typeof e.ref?e.ref:void 0,j="global"===c?e.skillFolderHash:e.computedHash,k="string"==typeof j&&j?j:void 0,l="github"===f&&/^[\w.-]+\/[\w.-]+$/.test(g);return{package:`${g}@${b}`,scope:c,source:g,sourceType:f,skillsShUrl:"local"===f?void 0:function(a,b){if(!a||a.includes("://")||a.startsWith("git@"))return;let c=a.split("/").filter(Boolean).map(encodeURIComponent).join("/");if(c)return`https://skills.sh/${c}/${encodeURIComponent(b)}`}(g,b),...h&&{skillPath:h},...i&&{ref:i},...k&&{versionHash:k},canCheckForUpdates:!!(l&&h&&k&&("global"===c||!i))}}function i(a,{cwd:b,agentDir:c,homeDir:j=(0,e.homedir)(),globalLockPath:k=function({homeDir:a=(0,e.homedir)(),xdgStateHome:b=process.env.XDG_STATE_HOME}={}){return b?(0,f.join)(b,"skills",".skill-lock.json"):(0,f.join)(a,".agents",".skill-lock.json")}({homeDir:j}),projectLockPath:l=(0,f.join)(b,"skills-lock.json")}){let m=g(k),n=g(l),o=[(0,f.join)(c,"skills"),(0,f.join)(j,".agents","skills")],p=[(0,f.join)(b,".pi","skills"),(0,f.join)(b,".agents","skills")],q=(a,b)=>b.some(b=>{let c;return""!==(c=(0,f.relative)((0,f.resolve)(b),(0,f.resolve)(a)))&&".."!==c&&!c.startsWith(`..${f.sep}`)&&!(0,f.isAbsolute)(c)});return a.map(a=>{if(!(0,d.existsSync)(a.filePath))return a;let b=q(a.filePath,o)?h(m,a.name,"global"):q(a.filePath,p)?h(n,a.name,"project"):void 0;return b?{...a,install:b}:a})}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>k,B7:()=>l,mc:()=>j,uK:()=>h.uK,wz:()=>e.wz});var e=c(25252),f=c(82536),g=c(40402),h=c(58864),i=a([g]);async function j(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,g.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,e.Nw)(a.cwd)),a.projectRoot&&d.add((0,e.Nw)(a.projectRoot));for(let a of(0,e.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function k(a,b){return(0,f.o4)(a,b)}function l(a,b){return(0,f.xk)(a,b)}g=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},97990:(a,b,c)=>{c.d(b,{a:()=>h});var d=c(79646),e=c(28354),f=c(10595);let g=(0,e.promisify)(d.execFile);async function h(a,b={}){let{command:c,args:d}=(0,f.f)("npx",a);return g(c,d,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,5582,2498],()=>b(b.s=57809));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=9156,a.ids=[9156],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")},10595:(a,b,c)=>{c.d(b,{f:()=>g});var d=c(29021),e=c(33873);let f=require("process");function g(a,b,c={}){let h=function(a,b={}){let c=b.nodeDir??(0,e.dirname)(f.execPath),g=b.fileExists??d.existsSync;for(let b of[(0,e.join)(c,"node_modules","npm","bin",`${a}-cli.js`),(0,e.join)(c,"..","lib","node_modules","npm","bin",`${a}-cli.js`)])try{if(g(b))return b}catch{}return null}(a,c);return h?{command:f.execPath,args:[h,...b]}:{command:a,args:b}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19038:(a,b,c)=>{c.d(b,{CU:()=>l,S7:()=>u});var d=c(79646),e=c(79748),f=c(21820),g=c(33873),h=c(28354);let i=process.env.SKILLS_API_URL||"https://skills.sh",j=(0,h.promisify)(d.execFile);class k extends Error{constructor(a){super(`HTTP ${a}`),this.status=a}}function l(a){let b=n(a.skillPath??""),c=b?`${a.source}/${b}`:a.source,d=a.ref?`#${encodeURIComponent(a.ref)}`:"",e=["skills","add",`${c}${d}`,"--skill",m(a.package),"-y","--agent","pi"];return"global"===a.scope&&e.push("-g"),e}function m(a){let b=a.lastIndexOf("@");return b>=0?a.slice(b+1):a}function n(a){let b=a.replace(/\\/g,"/");return b.toLowerCase().endsWith("/skill.md")?b=b.slice(0,-9):b.toLowerCase().endsWith("skill.md")&&(b=b.slice(0,-8)),b.replace(/\/$/,"")}function o(a,b,c,d){return{package:a.package,scope:a.scope,state:b,currentVersion:a.versionHash,latestVersion:c,message:d}}async function p(a,b,c){let d=await b(a,{cache:"no-store",headers:c,signal:AbortSignal.timeout(15e3)});if(!d.ok)throw new k(d.status);return d.json()}async function q(a){let b=`https://github.com/${a.source}.git`,c=a.ref||"HEAD",d=n(a.skillPath),h=await (0,e.mkdtemp)((0,g.join)((0,f.tmpdir)(),"pi-web-skill-check-"));try{await j("git",["init","--bare",h],{timeout:3e4}),await j("git",[`--git-dir=${h}`,"fetch","--depth=1","--filter=blob:none","--no-tags",b,c],{timeout:3e4});let a=d?`FETCH_HEAD:${d}`:"FETCH_HEAD^{tree}",{stdout:e}=await j("git",[`--git-dir=${h}`,"rev-parse",a],{timeout:3e4}),f=e.trim();if(!/^[0-9a-f]{40}$/i.test(f))throw Error("Invalid Git tree hash");return f}finally{await (0,e.rm)(h,{recursive:!0,force:!0})}}async function r(a,b){let c,d=a.ref||"HEAD",e=`https://api.github.com/repos/${a.source}/git/trees/${encodeURIComponent(d)}?recursive=1`,f={Accept:"application/vnd.github.v3+json","User-Agent":"pi-web"};b.githubToken&&(f.Authorization=`Bearer ${b.githubToken}`);let g=n(a.skillPath);try{let a=await p(e,b.fetcher,f);if(c="string"!=typeof a.sha||g?void 0:a.sha,g&&Array.isArray(a.tree)){let b=a.tree.find(a=>"tree"===a.type&&a.path===g);b&&"string"==typeof b.sha&&(c=b.sha)}}catch(d){if(!(d instanceof k)||![401,403,429].includes(d.status))throw d;c=await b.resolveGitTreeHash(a)}return c?o(a,c===a.versionHash?"up-to-date":"update-available",c):o(a,"error",void 0,"Remote skill path was not found.")}async function s(a,b){let[c,d]=a.source.split("/"),e=m(a.package).toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,""),f=`${b.skillsApiBase}/api/download/${encodeURIComponent(c)}/${encodeURIComponent(d)}/${encodeURIComponent(e)}`,g=await p(f,b.fetcher),h="string"==typeof g.hash?g.hash:void 0;return h?o(a,h===a.versionHash?"up-to-date":"update-available",h):o(a,"error",void 0,"skills.sh did not return a version hash.")}async function t(a,b={}){if(!a.canCheckForUpdates||!a.versionHash||!a.skillPath)return o(a,"unsupported",void 0,"This lock entry cannot be checked automatically.");let c={...b,fetcher:b.fetcher??fetch,skillsApiBase:b.skillsApiBase??i,resolveGitTreeHash:b.resolveGitTreeHash??q};try{return"global"===a.scope?await r(a,c):await s(a,c)}catch(b){return o(a,"error",void 0,b instanceof Error?b.message:String(b))}}async function u(a,b={}){let c=b.fetcher??fetch,d=new Map,e=async(a,b)=>{let e=d.get(a);return e||(e=c(a,b),d.set(a,e)),(await e).clone()};return Promise.all(a.map(a=>t(a,{...b,fetcher:e})))}},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21278:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{y:()=>i});var e=c(75430),f=c(75805),g=c(72498),h=a([e,g]);async function i(a){let b=(0,e.getAgentDir)(),c=new e.DefaultResourceLoader({cwd:a,agentDir:b,noExtensions:!0});await c.reload((0,g.Fk)(a,b));let{skills:d,diagnostics:h}=c.getSkills();return{skills:(0,f._)(d,{cwd:a,agentDir:b}),diagnostics:h,projectResourcesLoaded:(0,g.Y1)(a,b).trusted}}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},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")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},56679:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>l});var e=c(23211),f=c(97990),g=c(19038),h=c(21278),i=c(80547),j=a([h,i]);[h,i]=j.then?(await j)():j;let l="force-dynamic";async function k(a){try{let b=await a.json(),c="string"==typeof b.cwd?b.cwd:"",d="string"==typeof b.package?b.package:"",j="global"===b.scope||"project"===b.scope?b.scope:void 0;if(!c||!d||!j)return e.NextResponse.json({error:"cwd, package, and scope are required"},{status:400});let k=await (0,i.mc)();if(!(0,i.B7)(c,k))return e.NextResponse.json({error:"Access denied"},{status:403});let{skills:l}=await (0,h.y)(c),m=l.find(a=>a.install?.package===d&&a.install.scope===j);if(!m?.install)return e.NextResponse.json({error:"Installed skill not found"},{status:404});if(!m.install.canCheckForUpdates)return e.NextResponse.json({error:"This skill cannot be updated automatically"},{status:400});let{stdout:n,stderr:o}=await (0,f.a)((0,g.CU)(m.install),{timeout:6e4,cwd:"project"===j?c:void 0,env:{...process.env,FORCE_COLOR:"0"}}),p=(await (0,h.y)(c)).skills.find(a=>a.install?.package===d&&a.install.scope===j);return e.NextResponse.json({success:!0,skill:p,output:`${n}${o}`.slice(-500)})}catch(b){let a=`${b.stdout??""}${b.stderr??""}`;return e.NextResponse.json({error:a||b.message||String(b)},{status:500})}}d()}catch(a){d(a)}})},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63378:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/skills/update/route",pathname:"/api/skills/update",filename:"route",bundlePath:"app/api/skills/update/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/skills/update/route.ts",nextConfigOutput:"",userland:()=>c(56679),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/update/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},75805:(a,b,c)=>{c.d(b,{_:()=>i});var d=c(29021),e=c(21820),f=c(33873);function g(a){try{let b=JSON.parse((0,d.readFileSync)(a,"utf8"));return b.skills&&"object"==typeof b.skills?b.skills:{}}catch{return{}}}function h(a,b,c){var d;let e=function(a,b){if(a[b])return a[b];let c=b.toLowerCase(),d=Object.keys(a).find(a=>a.toLowerCase()===c);return d?a[d]:void 0}(a,b);if(!e||"string"!=typeof e.source||!e.source.trim())return;let f="string"==typeof e.sourceType?e.sourceType:void 0,g=(d=e.source.trim(),"github"!==f?d.replace(/\/$/,""):d.replace(/^git\+/,"").replace(/^https?:\/\/github\.com\//,"").replace(/^git@github\.com:/,"").replace(/\.git$/,"").replace(/\/$/,""));if(!g)return;let h="string"==typeof e.skillPath?e.skillPath:void 0,i="string"==typeof e.ref?e.ref:void 0,j="global"===c?e.skillFolderHash:e.computedHash,k="string"==typeof j&&j?j:void 0,l="github"===f&&/^[\w.-]+\/[\w.-]+$/.test(g);return{package:`${g}@${b}`,scope:c,source:g,sourceType:f,skillsShUrl:"local"===f?void 0:function(a,b){if(!a||a.includes("://")||a.startsWith("git@"))return;let c=a.split("/").filter(Boolean).map(encodeURIComponent).join("/");if(c)return`https://skills.sh/${c}/${encodeURIComponent(b)}`}(g,b),...h&&{skillPath:h},...i&&{ref:i},...k&&{versionHash:k},canCheckForUpdates:!!(l&&h&&k&&("global"===c||!i))}}function i(a,{cwd:b,agentDir:c,homeDir:j=(0,e.homedir)(),globalLockPath:k=function({homeDir:a=(0,e.homedir)(),xdgStateHome:b=process.env.XDG_STATE_HOME}={}){return b?(0,f.join)(b,"skills",".skill-lock.json"):(0,f.join)(a,".agents",".skill-lock.json")}({homeDir:j}),projectLockPath:l=(0,f.join)(b,"skills-lock.json")}){let m=g(k),n=g(l),o=[(0,f.join)(c,"skills"),(0,f.join)(j,".agents","skills")],p=[(0,f.join)(b,".pi","skills"),(0,f.join)(b,".agents","skills")],q=(a,b)=>b.some(b=>{let c;return""!==(c=(0,f.relative)((0,f.resolve)(b),(0,f.resolve)(a)))&&".."!==c&&!c.startsWith(`..${f.sep}`)&&!(0,f.isAbsolute)(c)});return a.map(a=>{if(!(0,d.existsSync)(a.filePath))return a;let b=q(a.filePath,o)?h(m,a.name,"global"):q(a.filePath,p)?h(n,a.name,"project"):void 0;return b?{...a,install:b}:a})}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>k,B7:()=>l,mc:()=>j,uK:()=>h.uK,wz:()=>e.wz});var e=c(25252),f=c(82536),g=c(40402),h=c(58864),i=a([g]);async function j(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,g.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,e.Nw)(a.cwd)),a.projectRoot&&d.add((0,e.Nw)(a.projectRoot));for(let a of(0,e.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function k(a,b){return(0,f.o4)(a,b)}function l(a,b){return(0,f.xk)(a,b)}g=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},97990:(a,b,c)=>{c.d(b,{a:()=>h});var d=c(79646),e=c(28354),f=c(10595);let g=(0,e.promisify)(d.execFile);async function h(a,b={}){let{command:c,args:d}=(0,f.f)("npx",a);return g(c,d,{timeout:b.timeout,cwd:b.cwd,env:b.env})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,5582,2498],()=>b(b.s=63378));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=2305,a.ids=[2305],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")},12412:a=>{"use strict";a.exports=require("assert")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21653:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sleep-inhibit/route",pathname:"/api/sleep-inhibit",filename:"route",bundlePath:"app/api/sleep-inhibit/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/sleep-inhibit/route.ts",nextConfigOutput:"",userland:()=>c(52028),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sleep-inhibit/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},27910:a=>{"use strict";a.exports=require("stream")},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")},31421:a=>{"use strict";a.exports=require("node:child_process")},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")},52028:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j,PUT:()=>k,dynamic:()=>l});var e=c(23211),f=c(66544),g=c(16216),h=c(48571),i=a([g,h]);[g,h]=i.then?(await i)():i;let l="force-dynamic";async function j(){let a=(0,g.O_)();return await a.ready(),e.NextResponse.json(a.status())}async function k(a){let b;if(!(0,f.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,f.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{b=await a.json()}catch{return e.NextResponse.json({error:"Invalid JSON body"},{status:400})}let c=b?.enabled;if("boolean"!=typeof c)return e.NextResponse.json({error:"enabled must be a boolean"},{status:400});let d=(0,g.O_)();await d.ready();let i=d.status();if(c&&!i.supported)return e.NextResponse.json({...i,error:i.unsupportedReason??"Preventing system sleep is not supported here."},{status:409});try{return await (0,h.PN)(c),e.NextResponse.json(await d.setEnabled(c))}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},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")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>k,EN:()=>j});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}function j(a,b=h()){return!!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{let b=new URL(a.url);return/^\/api\/sessions\/[^/]+\/export$/.test(b.pathname)||function(a){if(!a.pathname.startsWith("/api/files/")||"read"!==a.searchParams.get("type"))return!1;let b=a.pathname.slice(a.pathname.lastIndexOf("/")+1);try{return decodeURIComponent(b).toLowerCase().endsWith(".pdf")}catch{return!1}}(b)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d,e=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&i(e)===f)return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,974,6216],()=>b(b.s=21653));module.exports=c})();
1
+ (()=>{var a={};a.id=2305,a.ids=[2305],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")},12412:a=>{"use strict";a.exports=require("assert")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{"use strict";a.exports=require("stream")},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")},31421:a=>{"use strict";a.exports=require("node:child_process")},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")},52028:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j,PUT:()=>k,dynamic:()=>l});var e=c(23211),f=c(66544),g=c(16216),h=c(48571),i=a([g,h]);[g,h]=i.then?(await i)():i;let l="force-dynamic";async function j(){let a=(0,g.O_)();return await a.ready(),e.NextResponse.json(a.status())}async function k(a){let b;if(!(0,f.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,f.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{b=await a.json()}catch{return e.NextResponse.json({error:"Invalid JSON body"},{status:400})}let c=b?.enabled;if("boolean"!=typeof c)return e.NextResponse.json({error:"enabled must be a boolean"},{status:400});let d=(0,g.O_)();await d.ready();let i=d.status();if(c&&!i.supported)return e.NextResponse.json({...i,error:i.unsupportedReason??"Preventing system sleep is not supported here."},{status:409});try{return await (0,h.PN)(c),e.NextResponse.json(await d.setEnabled(c))}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},55511:a=>{"use strict";a.exports=require("crypto")},56158:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/sleep-inhibit/route",pathname:"/api/sleep-inhibit",filename:"route",bundlePath:"app/api/sleep-inhibit/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/sleep-inhibit/route.ts",nextConfigOutput:"",userland:()=>c(52028),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sleep-inhibit/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>k,EN:()=>j});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}function j(a,b=h()){return!!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{let b=new URL(a.url);return/^\/api\/sessions\/[^/]+\/export$/.test(b.pathname)||function(a){if(!a.pathname.startsWith("/api/files/")||"read"!==a.searchParams.get("type"))return!1;let b=a.pathname.slice(a.pathname.lastIndexOf("/")+1);try{return decodeURIComponent(b).toLowerCase().endsWith(".pdf")}catch{return!1}}(b)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d,e=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&i(e)===f)return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,974,6216],()=>b(b.s=56158));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=5640,a.ids=[5640],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")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},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")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},41657:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/subagents/[id]/route",pathname:"/api/subagents/[id]",filename:"route",bundlePath:"app/api/subagents/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/subagents/[id]/route.ts",nextConfigOutput:"",userland:()=>c(47611),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/subagents/[id]/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47611:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,POST:()=>i,dynamic:()=>j});var e=c(23211),f=c(56429),g=a([f]);f=(g.then?(await g)():g)[0];let j="force-dynamic";async function h(a,{params:b}){let{id:c}=await b;try{let a=await (0,f.d_)(c);if(!a)return e.NextResponse.json({error:"Subagent not found"},{status:404});return e.NextResponse.json({run:a})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function i(a,{params:b}){let{id:c}=await b;try{let b=await a.json();if("steer"===b.action){if("string"!=typeof b.message||!b.message.trim())return e.NextResponse.json({error:"message required"},{status:400});await (0,f.Zo)(c,b.message)}else{if("abort"!==b.action)return e.NextResponse.json({error:"action must be steer or abort"},{status:400});await (0,f.wW)(c)}return e.NextResponse.json({ok:!0,run:await (0,f.d_)(c)})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:a.includes("not running")?409:500})}}d()}catch(a){d(a)}})},48161:a=>{a.exports=require("node:os")},51181:a=>{a.exports=require("web-push")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")},98995:a=>{a.exports=require("node:module")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,974,5582,2498,3757,2650,2243,6216,6429],()=>b(b.s=41657));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=5640,a.ids=[5640],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")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20490:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/subagents/[id]/route",pathname:"/api/subagents/[id]",filename:"route",bundlePath:"app/api/subagents/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/subagents/[id]/route.ts",nextConfigOutput:"",userland:()=>c(47611),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/subagents/[id]/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},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")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47611:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,POST:()=>i,dynamic:()=>j});var e=c(23211),f=c(56429),g=a([f]);f=(g.then?(await g)():g)[0];let j="force-dynamic";async function h(a,{params:b}){let{id:c}=await b;try{let a=await (0,f.d_)(c);if(!a)return e.NextResponse.json({error:"Subagent not found"},{status:404});return e.NextResponse.json({run:a})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function i(a,{params:b}){let{id:c}=await b;try{let b=await a.json();if("steer"===b.action){if("string"!=typeof b.message||!b.message.trim())return e.NextResponse.json({error:"message required"},{status:400});await (0,f.Zo)(c,b.message)}else{if("abort"!==b.action)return e.NextResponse.json({error:"action must be steer or abort"},{status:400});await (0,f.wW)(c)}return e.NextResponse.json({ok:!0,run:await (0,f.d_)(c)})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:a.includes("not running")?409:500})}}d()}catch(a){d(a)}})},48161:a=>{a.exports=require("node:os")},51181:a=>{a.exports=require("web-push")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")},98995:a=>{a.exports=require("node:module")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,974,5582,2498,3757,2650,2243,6216,6429],()=>b(b.s=20490));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=6324,a.ids=[6324],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")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},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")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},45177:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/subagents/profiles/route",pathname:"/api/subagents/profiles",filename:"route",bundlePath:"app/api/subagents/profiles/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/subagents/profiles/route.ts",nextConfigOutput:"",userland:()=>c(83570),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/subagents/profiles/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>k,B7:()=>l,mc:()=>j,uK:()=>h.uK,wz:()=>e.wz});var e=c(25252),f=c(82536),g=c(40402),h=c(58864),i=a([g]);async function j(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,g.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,e.Nw)(a.cwd)),a.projectRoot&&d.add((0,e.Nw)(a.projectRoot));for(let a of(0,e.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function k(a,b){return(0,f.o4)(a,b)}function l(a,b){return(0,f.xk)(a,b)}g=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},83570:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>p,GET:()=>m,PATCH:()=>o,PUT:()=>n,dynamic:()=>q});var e=c(23211),f=c(29021),g=c(80547),h=c(7048),i=c(27367),j=a([g,h,i]);[g,h,i]=j.then?(await j)():j;let q="force-dynamic";async function k(a){if("string"!=typeof a||!a||!(0,f.existsSync)(a))throw Error("Valid cwd required");if(!(0,g.B7)(a,await (0,g.mc)()))throw Error("Access denied");return a}function l(a){if("global"!==a&&"project"!==a)throw Error("scope must be global or project");return a}async function m(a){try{let b=await k(new URL(a.url).searchParams.get("cwd"));return e.NextResponse.json({profiles:(0,h.fw)(b)})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Access denied"===a?403:400})}}async function n(a){try{let b=await a.json(),c=await k(b.cwd),d=l(b.scope);if(!b.profile||"string"!=typeof b.profile.name)return e.NextResponse.json({error:"profile required"},{status:400});return e.NextResponse.json({profile:(0,h.kj)(c,d,b.profile)})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Access denied"===a?403:400})}}async function o(a){try{let b=await a.json(),c=await k(b.cwd),d=function(a){if("builtin"===a)return a;if("global"!==a&&"project"!==a)throw Error("scope must be global, project, or builtin");return a}(b.scope);if("string"!=typeof b.name)return e.NextResponse.json({error:"name required"},{status:400});if("boolean"!=typeof b.enabled)return e.NextResponse.json({error:"enabled required"},{status:400});let f=b.name,g=(0,h.fw)(c).find(a=>a.scope===d&&a.name.toLowerCase()===f.toLowerCase());if(!g)return e.NextResponse.json({error:"Agent profile not found"},{status:404});if("builtin"===d)return(0,i.o9)(g.name,!b.enabled),e.NextResponse.json({profile:{...g,enabled:b.enabled}});let j={name:g.name,displayName:g.displayName,description:g.description,systemPrompt:g.systemPrompt,tools:g.tools,...void 0!==g.extensionTools?{extensionTools:[...g.extensionTools]}:{},...void 0!==g.disallowedExtensionTools?{disallowedExtensionTools:[...g.disallowedExtensionTools]}:{},loadSkills:g.loadSkills,...void 0!==g.skills?{skills:[...g.skills]}:{},loadExtensions:g.loadExtensions,...void 0!==g.extensions?{extensions:[...g.extensions]}:{},codemode:g.codemode,mcp:g.mcp,promptMode:g.promptMode,model:g.model,thinking:g.thinking,maxTurns:g.maxTurns,inheritContext:g.inheritContext,runInBackground:g.runInBackground,color:g.color,isolation:g.isolation,persistSession:g.persistSession,enabled:g.enabled};return e.NextResponse.json({profile:(0,h.kj)(c,d,{...j,enabled:b.enabled})})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Access denied"===a?403:400})}}async function p(a){try{let b=await a.json(),c=await k(b.cwd),d=l(b.scope);if("string"!=typeof b.name)return e.NextResponse.json({error:"name required"},{status:400});return(0,h.q9)(c,d,b.name),e.NextResponse.json({ok:!0})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Access denied"===a?403:400})}}d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,5582],()=>b(b.s=45177));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=6324,a.ids=[6324],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")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},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")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80547:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>k,B7:()=>l,mc:()=>j,uK:()=>h.uK,wz:()=>e.wz});var e=c(25252),f=c(82536),g=c(40402),h=c(58864),i=a([g]);async function j(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,g.dQ)(),d=new Set;for(let a of c)a.cwd&&d.add((0,e.Nw)(a.cwd)),a.projectRoot&&d.add((0,e.Nw)(a.projectRoot));for(let a of(0,e.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function k(a,b){return(0,f.o4)(a,b)}function l(a,b){return(0,f.xk)(a,b)}g=(i.then?(await i)():i)[0],d()}catch(a){d(a)}})},83570:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>p,GET:()=>m,PATCH:()=>o,PUT:()=>n,dynamic:()=>q});var e=c(23211),f=c(29021),g=c(80547),h=c(7048),i=c(27367),j=a([g,h,i]);[g,h,i]=j.then?(await j)():j;let q="force-dynamic";async function k(a){if("string"!=typeof a||!a||!(0,f.existsSync)(a))throw Error("Valid cwd required");if(!(0,g.B7)(a,await (0,g.mc)()))throw Error("Access denied");return a}function l(a){if("global"!==a&&"project"!==a)throw Error("scope must be global or project");return a}async function m(a){try{let b=await k(new URL(a.url).searchParams.get("cwd"));return e.NextResponse.json({profiles:(0,h.fw)(b)})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Access denied"===a?403:400})}}async function n(a){try{let b=await a.json(),c=await k(b.cwd),d=l(b.scope);if(!b.profile||"string"!=typeof b.profile.name)return e.NextResponse.json({error:"profile required"},{status:400});return e.NextResponse.json({profile:(0,h.kj)(c,d,b.profile)})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Access denied"===a?403:400})}}async function o(a){try{let b=await a.json(),c=await k(b.cwd),d=function(a){if("builtin"===a)return a;if("global"!==a&&"project"!==a)throw Error("scope must be global, project, or builtin");return a}(b.scope);if("string"!=typeof b.name)return e.NextResponse.json({error:"name required"},{status:400});if("boolean"!=typeof b.enabled)return e.NextResponse.json({error:"enabled required"},{status:400});let f=b.name,g=(0,h.fw)(c).find(a=>a.scope===d&&a.name.toLowerCase()===f.toLowerCase());if(!g)return e.NextResponse.json({error:"Agent profile not found"},{status:404});if("builtin"===d)return(0,i.o9)(g.name,!b.enabled),e.NextResponse.json({profile:{...g,enabled:b.enabled}});let j={name:g.name,displayName:g.displayName,description:g.description,systemPrompt:g.systemPrompt,tools:g.tools,...void 0!==g.extensionTools?{extensionTools:[...g.extensionTools]}:{},...void 0!==g.disallowedExtensionTools?{disallowedExtensionTools:[...g.disallowedExtensionTools]}:{},loadSkills:g.loadSkills,...void 0!==g.skills?{skills:[...g.skills]}:{},loadExtensions:g.loadExtensions,...void 0!==g.extensions?{extensions:[...g.extensions]}:{},codemode:g.codemode,mcp:g.mcp,promptMode:g.promptMode,model:g.model,thinking:g.thinking,maxTurns:g.maxTurns,inheritContext:g.inheritContext,runInBackground:g.runInBackground,color:g.color,isolation:g.isolation,persistSession:g.persistSession,enabled:g.enabled};return e.NextResponse.json({profile:(0,h.kj)(c,d,{...j,enabled:b.enabled})})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Access denied"===a?403:400})}}async function p(a){try{let b=await a.json(),c=await k(b.cwd),d=l(b.scope);if("string"!=typeof b.name)return e.NextResponse.json({error:"name required"},{status:400});return(0,h.q9)(c,d,b.name),e.NextResponse.json({ok:!0})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Access denied"===a?403:400})}}d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90122:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/subagents/profiles/route",pathname:"/api/subagents/profiles",filename:"route",bundlePath:"app/api/subagents/profiles/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/subagents/profiles/route.ts",nextConfigOutput:"",userland:()=>c(83570),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/subagents/profiles/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1813,426,5582],()=>b(b.s=90122));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=4306,a.ids=[4306],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},2449:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/subagents/settings/route",pathname:"/api/subagents/settings",filename:"route",bundlePath:"app/api/subagents/settings/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/subagents/settings/route.ts",nextConfigOutput:"",userland:()=>c(39881),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/subagents/settings/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8102:(a,b,c)=>{"use strict";c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},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")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27367:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{N:()=>o,Q$:()=>n,UF:()=>s,UM:()=>r,ef:()=>p,hd:()=>m,o9:()=>q});var e=c(73024),f=c(76760),g=c(75430),h=c(8102),i=a([g]);g=(i.then?(await i)():i)[0];let s=32;function j(a){if(!Array.isArray(a))return[];let b=[],c=new Set;for(let d of a){if("string"!=typeof d)continue;let a=d.trim(),e=a.toLowerCase();!a||c.has(e)||(c.add(e),b.push(a))}return b}function k(a=(0,g.getAgentDir)()){return(0,f.join)(a,"agents","settings.json")}function l(a){if(!(0,e.existsSync)(a))return{};let b=JSON.parse((0,e.readFileSync)(a,"utf8"));if(null===b||"object"!=typeof b||Array.isArray(b))throw Error("Invalid subagent settings: expected an object");return b}function m(a=k()){var b,c,d;let e=l(a);return c=!0===e.builtInEnabled,d="number"==typeof(b=e.maxConcurrent)&&Number.isInteger(b)&&b>=1&&b<=s?b:10,Object.defineProperty({builtInEnabled:c,disabledBuiltIns:j(e.disabledBuiltIns)},"maxConcurrent",{value:d,enumerable:!1,configurable:!0})}function n(a=k()){try{return new Set(m(a).disabledBuiltIns.map(a=>a.toLowerCase()))}catch{return new Set}}function o(a=k()){try{return m(a).builtInEnabled}catch{return!1}}function p(a,b=k()){let c=l(b);return(0,e.mkdirSync)((0,f.dirname)(b),{recursive:!0}),(0,h.$)(b,JSON.stringify({...c,version:1,builtInEnabled:a},null,2)),m(b)}function q(a,b,c=k()){let d=a.trim();if(!d)throw Error("Sub-agent name is required");let g=l(c),i=j(g.disabledBuiltIns),n=d.toLowerCase(),o=i.some(a=>a.toLowerCase()===n);if(b===o)return m(c);let p=b?o?i:[...i,d]:i.filter(a=>a.toLowerCase()!==n);return(0,e.mkdirSync)((0,f.dirname)(c),{recursive:!0}),(0,h.$)(c,JSON.stringify({...g,version:1,disabledBuiltIns:p},null,2)),m(c)}function r(a,b=k()){if(!Number.isInteger(a)||a<1||a>s)throw Error(`maxConcurrent must be an integer between 1 and ${s}`);let c=l(b);return(0,e.mkdirSync)((0,f.dirname)(b),{recursive:!0}),(0,h.$)(b,JSON.stringify({...c,version:1,maxConcurrent:a},null,2)),m(b)}d()}catch(a){d(a)}})},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")},39881:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,PUT:()=>j,dynamic:()=>k});var e=c(23211),f=c(66544),g=c(27367),h=a([g]);g=(h.then?(await h)():h)[0];let k="force-dynamic";async function i(){try{let a=(0,g.hd)();return e.NextResponse.json({enabled:a.builtInEnabled,maxConcurrent:a.maxConcurrent})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function j(a){if(!(0,f.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,f.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json();if(void 0===b.enabled&&void 0===b.maxConcurrent)return e.NextResponse.json({error:"enabled or maxConcurrent is required"},{status:400});if(void 0!==b.enabled&&"boolean"!=typeof b.enabled)return e.NextResponse.json({error:"enabled must be a boolean"},{status:400});if(void 0!==b.maxConcurrent&&("number"!=typeof b.maxConcurrent||!Number.isInteger(b.maxConcurrent)||b.maxConcurrent<1||b.maxConcurrent>g.UF))return e.NextResponse.json({error:`maxConcurrent must be an integer between 1 and ${g.UF}`},{status:400});let c=(0,g.hd)();return void 0!==b.enabled&&(c=(0,g.ef)(b.enabled)),void 0!==b.maxConcurrent&&(c=(0,g.UM)(b.maxConcurrent)),e.NextResponse.json({enabled:c.builtInEnabled,maxConcurrent:c.maxConcurrent})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message: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")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>k,EN:()=>j});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}function j(a,b=h()){return!!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{let b=new URL(a.url);return/^\/api\/sessions\/[^/]+\/export$/.test(b.pathname)||function(a){if(!a.pathname.startsWith("/api/files/")||"read"!==a.searchParams.get("type"))return!1;let b=a.pathname.slice(a.pathname.lastIndexOf("/")+1);try{return decodeURIComponent(b).toLowerCase().endsWith(".pdf")}catch{return!1}}(b)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d,e=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&i(e)===f)return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},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,[2970,1813],()=>b(b.s=2449));module.exports=c})();
1
+ (()=>{var a={};a.id=4306,a.ids=[4306],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")},8102:(a,b,c)=>{"use strict";c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},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")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27367:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{N:()=>o,Q$:()=>n,UF:()=>s,UM:()=>r,ef:()=>p,hd:()=>m,o9:()=>q});var e=c(73024),f=c(76760),g=c(75430),h=c(8102),i=a([g]);g=(i.then?(await i)():i)[0];let s=32;function j(a){if(!Array.isArray(a))return[];let b=[],c=new Set;for(let d of a){if("string"!=typeof d)continue;let a=d.trim(),e=a.toLowerCase();!a||c.has(e)||(c.add(e),b.push(a))}return b}function k(a=(0,g.getAgentDir)()){return(0,f.join)(a,"agents","settings.json")}function l(a){if(!(0,e.existsSync)(a))return{};let b=JSON.parse((0,e.readFileSync)(a,"utf8"));if(null===b||"object"!=typeof b||Array.isArray(b))throw Error("Invalid subagent settings: expected an object");return b}function m(a=k()){var b,c,d;let e=l(a);return c=!0===e.builtInEnabled,d="number"==typeof(b=e.maxConcurrent)&&Number.isInteger(b)&&b>=1&&b<=s?b:10,Object.defineProperty({builtInEnabled:c,disabledBuiltIns:j(e.disabledBuiltIns)},"maxConcurrent",{value:d,enumerable:!1,configurable:!0})}function n(a=k()){try{return new Set(m(a).disabledBuiltIns.map(a=>a.toLowerCase()))}catch{return new Set}}function o(a=k()){try{return m(a).builtInEnabled}catch{return!1}}function p(a,b=k()){let c=l(b);return(0,e.mkdirSync)((0,f.dirname)(b),{recursive:!0}),(0,h.$)(b,JSON.stringify({...c,version:1,builtInEnabled:a},null,2)),m(b)}function q(a,b,c=k()){let d=a.trim();if(!d)throw Error("Sub-agent name is required");let g=l(c),i=j(g.disabledBuiltIns),n=d.toLowerCase(),o=i.some(a=>a.toLowerCase()===n);if(b===o)return m(c);let p=b?o?i:[...i,d]:i.filter(a=>a.toLowerCase()!==n);return(0,e.mkdirSync)((0,f.dirname)(c),{recursive:!0}),(0,h.$)(c,JSON.stringify({...g,version:1,disabledBuiltIns:p},null,2)),m(c)}function r(a,b=k()){if(!Number.isInteger(a)||a<1||a>s)throw Error(`maxConcurrent must be an integer between 1 and ${s}`);let c=l(b);return(0,e.mkdirSync)((0,f.dirname)(b),{recursive:!0}),(0,h.$)(b,JSON.stringify({...c,version:1,maxConcurrent:a},null,2)),m(b)}d()}catch(a){d(a)}})},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")},38130:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>A,patchFetch:()=>z,routeModule:()=>v,serverHooks:()=>y,workAsyncStorage:()=>w,workUnitAsyncStorage:()=>x});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(10246),u=c(37527);let v=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/subagents/settings/route",pathname:"/api/subagents/settings",filename:"route",bundlePath:"app/api/subagents/settings/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/tassel/pi-web/app/api/subagents/settings/route.ts",nextConfigOutput:"",userland:()=>c(39881),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:x,serverHooks:y}=v;function z(){return(0,f.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:x})}async function A(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),v.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/subagents/settings/route";"/index"===d&&(d="/");let{instrumentation:e}=await v.ensureInstrumentation(a,{deferSpans:!0});return v.traceRequest(a,{tracer:(0,h.getTracer)(),spanName:`${a.method||"GET"} ${d}`,httpTarget:a.url,instrumentation:e},(e,f)=>B(a,b,c,d,!1,e,f))}async function B(a,b,c,d,f,w,x){let y=await v.prepare(a,b,{srcPage:d,multiZoneDraftMode:f});if(!y)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:z,deploymentId:A,params:B,nextConfig:C,parsedUrl:D,isDraftMode:E,prerenderManifest:F,routerServerContext:G,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,resolvedPathname:J,clientReferenceManifest:K,serverActionsManifest:L,previewProps:M}=y,N=(0,j.normalizeAppPath)(d),O=!!F.routes[J]&&(v.isDev||(0,t.isRouteCacheOwner)(J,v.cacheOwner,F.routes[J])),P=!!(F.dynamicRoutes[N]||O),Q=async()=>((null==G?void 0:G.render404)?await G.render404(a,b,D,!1):b.end("This page could not be found"),null);if(P&&!E){let a=F.dynamicRoutes[N];if(a&&!1===a.fallback&&!O){if(C.adapterPath)return await Q();throw new s.NoFallbackError}}let R=null;!P||v.isDev||E||(R="/index"===(R=J)?"/":R),L&&K&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:K,serverActionsManifest:L});let S=a.method||"GET",T=(0,h.getTracer)(),U=!!(null==G?void 0:G.isWrappedByNextServer),V=!!(0,g.getRequestMeta)(a,"minimalMode"),W=(0,g.getRequestMeta)(a,"incrementalCache")||await v.getIncrementalCache(a,C,M,F,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let X={params:B,previewProps:M,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout,durableUseCacheEntries:!!C.experimental.durableUseCacheEntries},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:E,incrementalCache:W,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0},sharedContext:{buildId:z,deploymentId:A}},Y=new k.NodeNextRequest(a),Z=new k.NodeNextResponse(b),$=l.NextRequestAdapter.fromNodeNextRequest(Y,(0,l.signalFromNodeResponse)(b)),_=async({previousCacheEntry:e})=>{try{if(!V&&H&&I&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=null===R?await v.handle($,X):await v.prerender($,X);a.fetchMetrics=X.renderOpts.fetchMetrics;let f=X.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=X.renderOpts.collectedTags;if(!P)return await (0,o.I)(Y,Z,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!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,e=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?C.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:u.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 v.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),b}},aa=async d=>{try{var f,g;let d=await v.handleResponse({req:a,nextConfig:C,cacheKey:R,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:F,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:I,responseGenerator:_,waitUntil:c.waitUntil,isMinimalMode:V});if(null!==d&&"error"in d)throw d.error;if(!P)return;if((null==d||null==(f=d.value)?void 0:f.kind)!==u.CachedRouteKind.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==d||null==(g=d.value)?void 0:g.kind}`);V||b.setHeader("x-nextjs-cache",H?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);V&&P||h.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(Y,Z,new Response(d.value.body,{headers:h,status:d.value.status||200}));return}catch(c){if(c instanceof s.NoFallbackError||await v.onRequestError(a,c,{routerKind:"App Router",routePath:N,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:null!==R,isOnDemandRevalidate:H})},!1,G),P)throw c;if(b.headersSent){if(d){let a=c instanceof Error?c:Error("Unknown app route error");d.recordException(a),d.setStatus({code:h.SpanStatusCode.ERROR,message:a.message}),d.setAttribute("error.type",a.name)}b.writableEnded||b.destroyed||b.end()}else await (0,o.I)(Y,Z,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=T.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")||N,f=`${S} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":f}),d.updateName(f),x&&x!==d&&(x.setAttribute("http.route",e),x.updateName(f))})()}};U||void 0===a.url||null==w||w.setAttribute("http.target",a.url),await aa(w)}},39881:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,PUT:()=>j,dynamic:()=>k});var e=c(23211),f=c(66544),g=c(27367),h=a([g]);g=(h.then?(await h)():h)[0];let k="force-dynamic";async function i(){try{let a=(0,g.hd)();return e.NextResponse.json({enabled:a.builtInEnabled,maxConcurrent:a.maxConcurrent})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function j(a){if(!(0,f.EN)(a))return e.NextResponse.json({error:"Untrusted API request"},{status:403});if(!(0,f.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json();if(void 0===b.enabled&&void 0===b.maxConcurrent)return e.NextResponse.json({error:"enabled or maxConcurrent is required"},{status:400});if(void 0!==b.enabled&&"boolean"!=typeof b.enabled)return e.NextResponse.json({error:"enabled must be a boolean"},{status:400});if(void 0!==b.maxConcurrent&&("number"!=typeof b.maxConcurrent||!Number.isInteger(b.maxConcurrent)||b.maxConcurrent<1||b.maxConcurrent>g.UF))return e.NextResponse.json({error:`maxConcurrent must be an integer between 1 and ${g.UF}`},{status:400});let c=(0,g.hd)();return void 0!==b.enabled&&(c=(0,g.ef)(b.enabled)),void 0!==b.maxConcurrent&&(c=(0,g.UM)(b.maxConcurrent)),e.NextResponse.json({enabled:c.builtInEnabled,maxConcurrent:c.maxConcurrent})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message: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")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>k,EN:()=>j});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}function j(a,b=h()){return!!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b)&&(!!function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{let b=new URL(a.url);return/^\/api\/sessions\/[^/]+\/export$/.test(b.pathname)||function(a){if(!a.pathname.startsWith("/api/files/")||"read"!==a.searchParams.get("type"))return!1;let b=a.pathname.slice(a.pathname.lastIndexOf("/")+1);try{return decodeURIComponent(b).toLowerCase().endsWith(".pdf")}catch{return!1}}(b)}catch{return!1}}(a)||!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))||function(a){let b,c,d,e=a.headers.get("origin");if("cross-site"===a.headers.get("sec-fetch-site"))return!1;if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&i(e)===f)return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a))}function k(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},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,[2970,1813],()=>b(b.s=38130));module.exports=c})();