vibedoc 1.5.0 → 1.6.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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +4 -4
- package/.next/prerender-manifest.json +11 -11
- package/.next/required-server-files.json +0 -4
- package/.next/server/app/(app)/activity/page/build-manifest.json +1 -1
- package/.next/server/app/(app)/activity/page.js.nft.json +1 -1
- package/.next/server/app/(app)/activity/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/board/page/build-manifest.json +1 -1
- package/.next/server/app/(app)/board/page.js.nft.json +1 -1
- package/.next/server/app/(app)/board/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/docs/page/build-manifest.json +1 -1
- package/.next/server/app/(app)/docs/page.js.nft.json +1 -1
- package/.next/server/app/(app)/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/explorer/page/build-manifest.json +1 -1
- package/.next/server/app/(app)/explorer/page.js.nft.json +1 -1
- package/.next/server/app/(app)/explorer/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/memory/page/build-manifest.json +1 -1
- package/.next/server/app/(app)/memory/page.js.nft.json +1 -1
- package/.next/server/app/(app)/memory/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/roadmap/page/build-manifest.json +1 -1
- package/.next/server/app/(app)/roadmap/page.js.nft.json +1 -1
- package/.next/server/app/(app)/roadmap/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/settings/page/build-manifest.json +1 -1
- package/.next/server/app/(app)/settings/page.js.nft.json +1 -1
- package/.next/server/app/(app)/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/setup/page/build-manifest.json +1 -1
- package/.next/server/app/(app)/setup/page.js.nft.json +1 -1
- package/.next/server/app/(app)/setup/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error/page/build-manifest.json +1 -1
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/build-manifest.json +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/activity.html +1 -1
- package/.next/server/app/activity.rsc +23 -22
- package/.next/server/app/activity.segments/!KGFwcCk/activity/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/activity.segments/_full.segment.rsc +23 -22
- package/.next/server/app/activity.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/activity/route.js +3 -3
- package/.next/server/app/api/activity/route.js.nft.json +1 -1
- package/.next/server/app/api/backlinks/route.js +3 -3
- package/.next/server/app/api/backlinks/route.js.nft.json +1 -1
- package/.next/server/app/api/chat/route.js +3 -3
- package/.next/server/app/api/chat/route.js.nft.json +1 -1
- package/.next/server/app/api/context/route.js +3 -3
- package/.next/server/app/api/context/route.js.nft.json +1 -1
- package/.next/server/app/api/decisions/route.js +3 -3
- package/.next/server/app/api/decisions/route.js.nft.json +1 -1
- package/.next/server/app/api/docs/route.js +3 -3
- package/.next/server/app/api/docs/route.js.nft.json +1 -1
- package/.next/server/app/api/events/route.js.nft.json +1 -1
- package/.next/server/app/api/explorer/route.js +4 -3
- package/.next/server/app/api/explorer/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route.js +4 -4
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/route.js +3 -3
- package/.next/server/app/api/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/apply/route.js +4 -4
- package/.next/server/app/api/plan/apply/route.js.nft.json +1 -1
- package/.next/server/app/api/projects/route.js +3 -3
- package/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/.next/server/app/api/registry/route.js +3 -3
- package/.next/server/app/api/registry/route.js.nft.json +1 -1
- package/.next/server/app/api/roadmap/create/route.js +4 -4
- package/.next/server/app/api/roadmap/create/route.js.nft.json +1 -1
- package/.next/server/app/api/roadmap/delete/route.js +4 -4
- package/.next/server/app/api/roadmap/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/roadmap/generate/route.js +4 -4
- package/.next/server/app/api/roadmap/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/roadmap/layout/route.js +4 -4
- package/.next/server/app/api/roadmap/layout/route.js.nft.json +1 -1
- package/.next/server/app/api/roadmap/route.js +3 -3
- package/.next/server/app/api/roadmap/route.js.nft.json +1 -1
- package/.next/server/app/api/roadmap/update/route.js +4 -4
- package/.next/server/app/api/roadmap/update/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/route.js +3 -3
- package/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +4 -4
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/generate/route.js +2 -2
- package/.next/server/app/api/setup/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/write/route.js +3 -3
- package/.next/server/app/api/setup/write/route.js.nft.json +1 -1
- package/.next/server/app/api/summary/route.js +3 -3
- package/.next/server/app/api/summary/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/create/route.js +3 -3
- package/.next/server/app/api/tasks/create/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js +3 -3
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/board.html +1 -1
- package/.next/server/app/board.rsc +23 -21
- package/.next/server/app/board.segments/!KGFwcCk/board/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/board.segments/_full.segment.rsc +23 -21
- package/.next/server/app/board.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +27 -25
- package/.next/server/app/docs.segments/!KGFwcCk/docs/__PAGE__.segment.rsc +9 -10
- package/.next/server/app/docs.segments/_full.segment.rsc +27 -25
- package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/explorer.html +1 -1
- package/.next/server/app/explorer.rsc +23 -22
- package/.next/server/app/explorer.segments/!KGFwcCk/explorer/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/explorer.segments/_full.segment.rsc +23 -22
- package/.next/server/app/explorer.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/memory.html +1 -1
- package/.next/server/app/memory.rsc +23 -22
- package/.next/server/app/memory.segments/!KGFwcCk/memory/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/memory.segments/_full.segment.rsc +23 -22
- package/.next/server/app/memory.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/page/build-manifest.json +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roadmap.html +1 -1
- package/.next/server/app/roadmap.rsc +26 -25
- package/.next/server/app/roadmap.segments/!KGFwcCk/roadmap/__PAGE__.segment.rsc +11 -9
- package/.next/server/app/roadmap.segments/_full.segment.rsc +26 -25
- package/.next/server/app/roadmap.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +23 -22
- package/.next/server/app/settings.segments/!KGFwcCk/settings/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/settings.segments/_full.segment.rsc +23 -22
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/setup.html +1 -1
- package/.next/server/app/setup.rsc +23 -21
- package/.next/server/app/setup.segments/!KGFwcCk/setup/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/setup.segments/_full.segment.rsc +23 -21
- package/.next/server/app/setup.segments/_tree.segment.rsc +2 -2
- package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0-q4v32._.js → 11mp_@anthropic-ai_sdk_0-5bkpj._.js} +2 -2
- package/.next/server/chunks/{11mp_@anthropic-ai_sdk_05hfnhc._.js → 11mp_@anthropic-ai_sdk_00psb_y._.js} +2 -2
- package/.next/server/chunks/{11mp_@anthropic-ai_sdk_05dmim9._.js → 11mp_@anthropic-ai_sdk_01l5h3i._.js} +2 -2
- package/.next/server/chunks/{11mp_@anthropic-ai_sdk_07xtb0h._.js → 11mp_@anthropic-ai_sdk_072r2bd._.js} +2 -2
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0am8bw2._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0enefn6._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0k3n_5f._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0lcfjm4._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0lfx9av._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0qau3qw._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0r1pmvm._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_11t-z2t._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_15hyn79._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1_qk07x._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1b2929e._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1e72c89._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1eq7asn._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1fhdojs._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1lh_vwq._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1ludf-o._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1m3luz3._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1x1iz3d._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1xsmwlh._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_202spah._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_215hw9u._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0n-i0pd._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_13pos4j._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_17b4pqr._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1bkcmom._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1hlj_3l._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1ip-sor._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1pex5o1._.js +3 -0
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1s8lc8_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__03upgv8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__03upgv8._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__05l6129._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0u2rl0m._.js.map → [root-of-the-server]__05l6129._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__06zf_sh._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__01yk8oi._.js.map → [root-of-the-server]__06zf_sh._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__093hlkh._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1337jpl._.js.map → [root-of-the-server]__093hlkh._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0aynzrb._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0b49g9i._.js.map → [root-of-the-server]__0aynzrb._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0e59y5j._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0eqd-tw._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0yd6wlm._.js.map → [root-of-the-server]__0eqd-tw._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0nfvvy9._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0j-xjbf._.js.map → [root-of-the-server]__0nfvvy9._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__03t5uqz._.js → [root-of-the-server]__0qac4k0._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__03t5uqz._.js.map → [root-of-the-server]__0qac4k0._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__106gpvh._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0kaegk7._.js.map → [root-of-the-server]__106gpvh._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__11s-8eg._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__02k1gkk._.js.map → [root-of-the-server]__11s-8eg._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__11s76m8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__11s76m8._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__142icjb._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1yow6hw._.js.map → [root-of-the-server]__142icjb._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__14aeqoi._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__14aeqoi._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__1613hjb._.js +88 -0
- package/.next/server/chunks/[root-of-the-server]__1613hjb._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__169hmq_._.js +10 -0
- package/.next/server/chunks/{[root-of-the-server]__0d4jkve._.js.map → [root-of-the-server]__169hmq_._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__17p0rkn._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0v8x64y._.js.map → [root-of-the-server]__17p0rkn._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__17xb02p._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0zybyuh._.js.map → [root-of-the-server]__17xb02p._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__18kxo4a._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1znbm9i._.js.map → [root-of-the-server]__18kxo4a._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1c55c2q._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0l3voov._.js.map → [root-of-the-server]__1c55c2q._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1j0rrps._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0635d15._.js.map → [root-of-the-server]__1j0rrps._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1lj_2cv._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0qsx33x._.js.map → [root-of-the-server]__1lj_2cv._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1o4a-4j._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1vaownn._.js.map → [root-of-the-server]__1o4a-4j._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1q4ahvz._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1hsybai._.js.map → [root-of-the-server]__1q4ahvz._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1337jpl._.js → [root-of-the-server]__1u_q61h._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0kkefbq._.js.map → [root-of-the-server]__1u_q61h._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1wr0m-s._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0-rjzmv._.js.map → [root-of-the-server]__1wr0m-s._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1xb0fmp._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__15suc44._.js.map → [root-of-the-server]__1xb0fmp._.js.map} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1hsybai._.js → [root-of-the-server]__1y-tt29._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0af0ma6._.js.map → [root-of-the-server]__1y-tt29._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1y3u5ud._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0xqsv4h._.js.map → [root-of-the-server]__1y3u5ud._.js.map} +1 -1
- package/.next/server/chunks/[turbopack]_runtime.js +0 -132
- package/.next/server/chunks/[turbopack]_runtime.js.map +4 -5
- package/.next/server/chunks/_04byth9._.js +34 -0
- package/.next/server/chunks/_04byth9._.js.map +1 -0
- package/.next/server/chunks/_1au4syj._.js +1 -1
- package/.next/server/chunks/_1au4syj._.js.map +1 -1
- package/.next/server/chunks/_1b5fqxy._.js +3 -0
- package/.next/server/chunks/_1b5fqxy._.js.map +1 -0
- package/.next/server/chunks/_1si7nb_._.js +8 -8
- package/.next/server/chunks/_1si7nb_._.js.map +1 -1
- package/.next/server/chunks/ssr/1x05_lucide-react_dist_esm_icons_08ca0b4._.js +3 -0
- package/.next/server/chunks/ssr/1x05_lucide-react_dist_esm_icons_08ca0b4._.js.map +1 -0
- package/.next/server/chunks/ssr/[turbopack]_runtime.js +0 -132
- package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +4 -5
- package/.next/server/chunks/ssr/_01suk2m._.js +3 -0
- package/.next/server/chunks/ssr/_01suk2m._.js.map +1 -0
- package/.next/server/chunks/ssr/_04xff_2._.js +1 -1
- package/.next/server/chunks/ssr/_04xff_2._.js.map +1 -1
- package/.next/server/chunks/ssr/_0qyglif._.js +2 -2
- package/.next/server/chunks/ssr/_0qyglif._.js.map +1 -1
- package/.next/server/chunks/ssr/_0skuoxv._.js +3 -1
- package/.next/server/chunks/ssr/_0skuoxv._.js.map +1 -1
- package/.next/server/chunks/ssr/{_1alz6n5._.js → _14i_6yb._.js} +2 -2
- package/.next/server/chunks/ssr/_14i_6yb._.js.map +1 -0
- package/.next/server/chunks/ssr/{_1s08bv8._.js → _1cbhuz4._.js} +2 -2
- package/.next/server/chunks/ssr/_1cbhuz4._.js.map +1 -0
- package/.next/server/chunks/ssr/_1ewk_mn._.js +3 -0
- package/.next/server/chunks/ssr/_1ewk_mn._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules__pnpm_1dcmsrg._.js +3 -0
- package/.next/server/chunks/ssr/node_modules__pnpm_1dcmsrg._.js.map +1 -0
- package/.next/server/chunks/ssr/src_components_008q3v8._.js +3 -0
- package/.next/server/chunks/ssr/src_components_008q3v8._.js.map +1 -0
- package/.next/server/middleware-build-manifest.js +4 -4
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0eggcu0ovk8sd.js +68 -0
- package/.next/static/chunks/{145g20k60txhc.js → 0iva6rdtfqpbz.js} +1 -1
- package/.next/static/chunks/0qm101bdsxdyh.css +10 -0
- package/.next/static/chunks/0wg9n5zb8mo2p.js +1 -0
- package/.next/static/chunks/{2-faknwci76np.js → 0wjw1laqwg-cr.js} +1 -1
- package/.next/static/chunks/0z_y7el6m76yk.js +1 -0
- package/.next/static/chunks/1-ekntoveuxzd.js +4 -0
- package/.next/static/chunks/1r7z33e9jk3vp.js +1 -0
- package/.next/static/chunks/{2f7yju8yks2m9.js → 1xyepk9227yej.js} +6 -73
- package/.next/static/chunks/{1lfr973ckp6by.js → 1ytqu-ra-fylk.js} +2 -2
- package/.next/static/chunks/3dlnlsyyysw5m.js +1 -0
- package/.next/static/chunks/{0aiy7o5bsiixt.js → 3kkg030rcpz7l.js} +1 -1
- package/.next/static/chunks/3pf_4ye6ju8gt.js +1 -0
- package/.next/static/chunks/turbopack-2qsbj8zx38t0j.js +1 -0
- package/README.md +2 -0
- package/next.config.js +4 -7
- package/package.json +1 -1
- package/skills/epic-breakdown/SKILL.md +11 -1
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0fw_tls._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0q6tm_c._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0qyh79u._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0rfkb6q._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0x1yqfb._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_0yt3ewg._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1-kttjy._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_12h8gza._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_18c2w1i._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_18fnlqa._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_19on0yg._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1alh48t._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1ck56ir._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1daia98._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1f6snvo._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1p6s626._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1ps921l._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1rqxfdf._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1s7maye._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1vuy6_x._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_1xv39eu._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_078qkb6._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_0q7-hjh._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_165bzk6._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1hfbfb5._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1sa-8tw._.js +0 -3
- package/.next/server/chunks/11mp_@anthropic-ai_sdk_index_mjs_1xq_gof._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0-rjzmv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__01yk8oi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__02k1gkk._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0635d15._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0af0ma6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0b49g9i._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0d4jkve._.js +0 -10
- package/.next/server/chunks/[root-of-the-server]__0j-xjbf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0kaegk7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0kkefbq._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0l3voov._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0qsx33x._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0sc44r6._.js +0 -86
- package/.next/server/chunks/[root-of-the-server]__0sc44r6._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__0u2rl0m._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0uk0tga._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0v8x64y._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0xqsv4h._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0yd6wlm._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zybyuh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__134sb3d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__134sb3d._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__15suc44._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1jeqjz6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1kfohrq._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1mz21a2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1mz21a2._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__1vaownn._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1yow6hw._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1znbm9i._.js +0 -3
- package/.next/server/chunks/_0csymdc._.js +0 -34
- package/.next/server/chunks/_0csymdc._.js.map +0 -1
- package/.next/server/chunks/_1f1rssd._.js +0 -3
- package/.next/server/chunks/_1f1rssd._.js.map +0 -1
- package/.next/server/chunks/ssr/1x05_lucide-react_dist_esm_icons_1v0h3_3._.js +0 -3
- package/.next/server/chunks/ssr/1x05_lucide-react_dist_esm_icons_1v0h3_3._.js.map +0 -1
- package/.next/server/chunks/ssr/_0v7muti._.js +0 -3
- package/.next/server/chunks/ssr/_0v7muti._.js.map +0 -1
- package/.next/server/chunks/ssr/_1a9mqm1._.js +0 -3
- package/.next/server/chunks/ssr/_1a9mqm1._.js.map +0 -1
- package/.next/server/chunks/ssr/_1alz6n5._.js.map +0 -1
- package/.next/server/chunks/ssr/_1s08bv8._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules__pnpm_051nq8c._.js +0 -3
- package/.next/server/chunks/ssr/node_modules__pnpm_051nq8c._.js.map +0 -1
- package/.next/server/chunks/ssr/src_components_0wg3bi2._.js +0 -3
- package/.next/server/chunks/ssr/src_components_0wg3bi2._.js.map +0 -1
- package/.next/static/chunks/05qw7-fs1exlt.js +0 -1
- package/.next/static/chunks/0_vu3y1bvg843.js +0 -1
- package/.next/static/chunks/0fvzbdfwiu4a2.js +0 -1
- package/.next/static/chunks/14ewdzt8piprq.js +0 -1
- package/.next/static/chunks/2g08tblvdp0t_.js +0 -2
- package/.next/static/chunks/2gdlf-xhbpc75.css +0 -10
- package/.next/static/chunks/2xu8bb_0152j-.js +0 -1
- package/.next/static/chunks/turbopack-181pehyg9iyaw.js +0 -1
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0-q4v32._.js.map → 11mp_@anthropic-ai_sdk_0-5bkpj._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_05dmim9._.js.map → 11mp_@anthropic-ai_sdk_00psb_y._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_05hfnhc._.js.map → 11mp_@anthropic-ai_sdk_01l5h3i._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_07xtb0h._.js.map → 11mp_@anthropic-ai_sdk_072r2bd._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0fw_tls._.js.map → 11mp_@anthropic-ai_sdk_0am8bw2._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0q6tm_c._.js.map → 11mp_@anthropic-ai_sdk_0enefn6._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0qyh79u._.js.map → 11mp_@anthropic-ai_sdk_0k3n_5f._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0rfkb6q._.js.map → 11mp_@anthropic-ai_sdk_0lcfjm4._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0x1yqfb._.js.map → 11mp_@anthropic-ai_sdk_0lfx9av._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_0yt3ewg._.js.map → 11mp_@anthropic-ai_sdk_0qau3qw._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1-kttjy._.js.map → 11mp_@anthropic-ai_sdk_0r1pmvm._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_12h8gza._.js.map → 11mp_@anthropic-ai_sdk_11t-z2t._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_18c2w1i._.js.map → 11mp_@anthropic-ai_sdk_15hyn79._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_18fnlqa._.js.map → 11mp_@anthropic-ai_sdk_1_qk07x._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_19on0yg._.js.map → 11mp_@anthropic-ai_sdk_1b2929e._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1alh48t._.js.map → 11mp_@anthropic-ai_sdk_1e72c89._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1ck56ir._.js.map → 11mp_@anthropic-ai_sdk_1eq7asn._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1daia98._.js.map → 11mp_@anthropic-ai_sdk_1fhdojs._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1f6snvo._.js.map → 11mp_@anthropic-ai_sdk_1lh_vwq._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1p6s626._.js.map → 11mp_@anthropic-ai_sdk_1ludf-o._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1ps921l._.js.map → 11mp_@anthropic-ai_sdk_1m3luz3._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1rqxfdf._.js.map → 11mp_@anthropic-ai_sdk_1x1iz3d._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1s7maye._.js.map → 11mp_@anthropic-ai_sdk_1xsmwlh._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1vuy6_x._.js.map → 11mp_@anthropic-ai_sdk_202spah._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_1xv39eu._.js.map → 11mp_@anthropic-ai_sdk_215hw9u._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_078qkb6._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_0n-i0pd._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_0q7-hjh._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_13pos4j._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_165bzk6._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_17b4pqr._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1hfbfb5._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1bkcmom._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1sa-8tw._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1hlj_3l._.js.map} +0 -0
- /package/.next/server/chunks/{11mp_@anthropic-ai_sdk_index_mjs_1xq_gof._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1ip-sor._.js.map} +0 -0
- /package/.next/server/chunks/{[root-of-the-server]__0uk0tga._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1pex5o1._.js.map} +0 -0
- /package/.next/server/chunks/{[root-of-the-server]__1jeqjz6._.js.map → 11mp_@anthropic-ai_sdk_index_mjs_1s8lc8_._.js.map} +0 -0
- /package/.next/server/chunks/{[root-of-the-server]__1kfohrq._.js.map → [root-of-the-server]__0e59y5j._.js.map} +0 -0
- /package/.next/static/{cmDLf8WOU5PVmUOcSPh2H → ICaoXcRMmgrIFWk8C_Z6D}/_buildManifest.js +0 -0
- /package/.next/static/{cmDLf8WOU5PVmUOcSPh2H → ICaoXcRMmgrIFWk8C_Z6D}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{cmDLf8WOU5PVmUOcSPh2H → ICaoXcRMmgrIFWk8C_Z6D}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/diff.ts","../../../src/lib/roadmap-import.ts","../../../src/lib/work-queue.ts","../../../src/lib/core.ts","../../../src/lib/plan.ts","../../../src/lib/sessions.ts"],"sourcesContent":["export type DiffLine = { op: \" \" | \"+\" | \"-\"; text: string }\n\n// ponytail: O(n·m) LCS on the changed middle; fine for docs, swap for Myers if huge files show up.\nexport function lineDiff(before: string, after: string): DiffLine[] {\n const a = before.split(\"\\n\")\n const b = after.split(\"\\n\")\n let start = 0\n while (start < a.length && start < b.length && a[start] === b[start]) start++\n let endA = a.length\n let endB = b.length\n while (endA > start && endB > start && a[endA - 1] === b[endB - 1]) { endA--; endB-- }\n\n const x = a.slice(start, endA)\n const y = b.slice(start, endB)\n // lcs[i][j] = LCS length of x[i..] and y[j..]\n const lcs = Array.from({ length: x.length + 1 }, () => new Array<number>(y.length + 1).fill(0))\n for (let i = x.length - 1; i >= 0; i--) {\n for (let j = y.length - 1; j >= 0; j--) {\n lcs[i][j] = x[i] === y[j] ? lcs[i + 1][j + 1] + 1 : Math.max(lcs[i + 1][j], lcs[i][j + 1])\n }\n }\n\n const middle: DiffLine[] = []\n let i = 0\n let j = 0\n while (i < x.length || j < y.length) {\n if (i < x.length && j < y.length && x[i] === y[j]) { middle.push({ op: \" \", text: x[i] }); i++; j++ }\n else if (i < x.length && (j === y.length || lcs[i + 1][j] >= lcs[i][j + 1])) { middle.push({ op: \"-\", text: x[i] }); i++ }\n else { middle.push({ op: \"+\", text: y[j] }); j++ }\n }\n\n return [\n ...a.slice(0, start).map((text) => ({ op: \" \" as const, text })),\n ...middle,\n ...a.slice(endA).map((text) => ({ op: \" \" as const, text })),\n ]\n}\n\nexport type TextEdit = { old_string: string; new_string: string }\n\n// Same contract as Claude Code's Edit tool: each old_string must match exactly once, applied in order.\n// An empty old_string is only allowed on an empty/new file (write the first content).\nexport function applyEdits(text: string, edits: TextEdit[]): { content: string } | { error: string } {\n let content = text\n for (const [i, e] of edits.entries()) {\n if (typeof e?.old_string !== \"string\" || typeof e?.new_string !== \"string\") {\n return { error: `Edit ${i + 1}: old_string and new_string must be strings` }\n }\n if (e.old_string === \"\") {\n if (content !== \"\") return { error: `Edit ${i + 1}: empty old_string is only allowed for a new, empty doc` }\n content = e.new_string\n continue\n }\n const at = content.indexOf(e.old_string)\n if (at === -1) return { error: `Edit ${i + 1}: old_string not found in the doc` }\n if (content.indexOf(e.old_string, at + 1) !== -1) {\n return { error: `Edit ${i + 1}: old_string matches more than once; include more surrounding text` }\n }\n content = content.slice(0, at) + e.new_string + content.slice(at + e.old_string.length)\n }\n return { content }\n}\n","/**\n * src/lib/roadmap-import.ts\n * Pure (no fs): draft a roadmap for a project that has none, from ROADMAP.md, from its tasks, or a starter.\n * core.ts `generateRoadmap()` assigns ids and writes the files.\n */\n\nimport type { RoadmapStatus, Task } from './core'\n\nexport interface RoadmapDraft {\n key: string\n title: string\n parent: string | null // key of the parent draft; null = horizon\n status: RoadmapStatus\n tasks: string[]\n body: string\n}\n\nexport type RoadmapSource = 'roadmap-md' | 'tasks' | 'starter'\n\nconst SHIPPED = /\\b(shipped|done|released|complete[d]?)\\b/i\nconst MAX_TITLE = 80\n\nfunction plain(s: string): string {\n return s\n .replace(/\\[([^\\]]+)\\]\\([^)]*\\)/g, '$1') // links\n .replace(/[*_`]/g, '')\n .replace(/\\s+/g, ' ')\n .trim()\n}\n\nfunction clip(s: string): string {\n return s.length > MAX_TITLE ? `${s.slice(0, MAX_TITLE - 1).trimEnd()}…` : s\n}\n\nfunction rollUp(statuses: RoadmapStatus[]): RoadmapStatus {\n if (statuses.length && statuses.every(s => s === 'done')) return 'done'\n if (statuses.some(s => s !== 'planned')) return 'in-progress'\n return 'planned'\n}\n\n/** `## Section` with top-level bullets → horizon + features. Sections without bullets are skipped. */\nexport function roadmapFromMarkdown(md: string): RoadmapDraft[] {\n const out: RoadmapDraft[] = []\n let horizon: RoadmapDraft | null = null\n let intro: string[] = []\n let feature: RoadmapDraft | null = null\n let kids = 0\n\n const closeHorizon = () => {\n if (horizon && kids > 0) {\n horizon.body = intro.join(' ').trim()\n const own = out.filter(d => d.parent === horizon?.key).map(d => d.status)\n if (horizon.status !== 'done') horizon.status = rollUp(own)\n } else if (horizon) {\n // no bullets: drop the heading\n out.splice(out.indexOf(horizon), 1)\n }\n horizon = null\n feature = null\n intro = []\n kids = 0\n }\n\n for (const line of md.split('\\n')) {\n const h2 = line.match(/^##\\s+(.+?)\\s*#*\\s*$/)\n if (h2) {\n closeHorizon()\n const title = clip(plain(h2[1]))\n horizon = { key: `h${out.length}`, title, parent: null, status: SHIPPED.test(title) ? 'done' : 'planned', tasks: [], body: '' }\n out.push(horizon)\n continue\n }\n if (!horizon) continue\n if (/^#/.test(line)) { closeHorizon(); continue } // H1 / H3+ ends the section\n\n const bullet = line.match(/^[-*]\\s+(?:\\[([ xX])\\]\\s+)?(.*)$/)\n if (bullet) {\n const text = bullet[2]\n const named = text.match(/^\\*\\*(.+?)\\*\\*\\s*(?:[—–:-]\\s*)?(.*)$/)\n const title = clip(plain(named ? named[1] : text))\n if (!title) continue\n const status: RoadmapStatus = bullet[1]\n ? (bullet[1].toLowerCase() === 'x' ? 'done' : 'planned')\n : horizon.status === 'done' ? 'done' : 'planned'\n feature = { key: `f${out.length}`, title, parent: horizon.key, status, tasks: [], body: named ? named[2].trim() : '' }\n out.push(feature)\n kids++\n continue\n }\n\n const cont = line.match(/^\\s+(\\S.*)$/)\n if (feature && cont) {\n feature.body = [feature.body, cont[1].replace(/^[-*]\\s+/, '- ')].filter(Boolean).join('\\n')\n } else if (!feature && line.trim() && !/^-{3,}$/.test(line.trim())) {\n intro.push(line.trim())\n }\n }\n closeHorizon()\n return out\n}\n\nconst phaseRank = (p: string) => {\n const n = parseFloat(p)\n return Number.isFinite(n) ? n : Infinity\n}\n\n/** One horizon per task phase, one feature per (non-cancelled) task. */\nexport function roadmapFromTasks(tasks: Pick<Task, 'id' | 'title' | 'status' | 'phase'>[]): RoadmapDraft[] {\n const groups = new Map<string, typeof tasks>()\n for (const t of tasks) {\n if (t.status === 'cancelled') continue\n const phase = plain(t.phase || '').replace(/^—$/, '') || 'Unphased'\n groups.set(phase, [...(groups.get(phase) ?? []), t])\n }\n const phases = [...groups.keys()].sort((a, b) => phaseRank(a) - phaseRank(b) || a.localeCompare(b))\n\n const out: RoadmapDraft[] = []\n for (const phase of phases) {\n const key = `h${out.length}`\n const features = (groups.get(phase) ?? []).map((t): RoadmapDraft => ({\n key: `f${t.id}`,\n title: clip(t.title),\n parent: key,\n status: t.status === 'done' ? 'done' : t.status === 'in-progress' ? 'in-progress' : 'planned',\n tasks: [t.id],\n body: '',\n }))\n out.push({ key, title: clip(phase), parent: null, status: rollUp(features.map(f => f.status)), tasks: [], body: '' }, ...features)\n }\n return out\n}\n\nexport function starterRoadmap(): RoadmapDraft[] {\n const h = (key: string, title: string, status: RoadmapStatus, body: string): RoadmapDraft =>\n ({ key, title, parent: null, status, tasks: [], body })\n return [\n h('shipped', 'Shipped', 'done', 'What is already live.'),\n h('now', 'Now', 'planned', 'What we are building right now.'),\n h('next', 'Next', 'planned', 'Planned once the current work ships.'),\n h('later', 'Later', 'planned', 'Ideas — not committed.'),\n ]\n}\n","// Pure next-task picker for an epic's work queue (no fs). Self-check: node src/lib/work-queue.check.mts\nimport type { RoadmapItem, Task } from './core'\n\nexport type QueueTask = Pick<Task, 'id' | 'status' | 'dependsOn'>\nexport type QueueResult =\n | { kind: 'ready'; taskId: string }\n | { kind: 'finished' }\n // needsHuman: no remaining task can move without someone unblocking or creating a task\n | { kind: 'waiting'; waiting: { taskId: string; reason: string }[]; needsHuman: boolean }\n\n/** Every `T\\d+` in a free-text \"Depends on\" line: \"T008, T009 (x)\" → [\"T008\",\"T009\"]. */\nexport function depIds(dependsOn: string): string[] {\n return [...new Set((dependsOn.match(/\\bT\\d+\\b/gi) ?? []).map(d => d.toUpperCase()))]\n}\n\nconst settled = (s: Task['status']) => s === 'done' || s === 'cancelled'\n\nexport function pickNextTask(epic: RoadmapItem, tasks: QueueTask[]): QueueResult {\n const byId = new Map(tasks.map(t => [t.id, t]))\n const linked = epic.tasks.map(id => byId.get(id)).filter((t): t is QueueTask => !!t)\n const unmet = (t: QueueTask) => depIds(t.dependsOn).filter(d => {\n const dep = byId.get(d)\n return !dep || !settled(dep.status)\n })\n\n for (const t of linked) {\n if (t.status === 'todo' && !unmet(t).length) return { kind: 'ready', taskId: t.id }\n }\n if (linked.every(t => settled(t.status))) return { kind: 'finished' }\n\n // Can this task still move without a human? in-progress/settled yes; blocked/missing no;\n // todo only if it's in this epic (the queue never hands out outside tasks) and every unmet dep can.\n // Cycles count as stuck.\n const inEpic = new Set(epic.tasks)\n const memo = new Map<string, boolean>()\n const canMove = (id: string): boolean => {\n if (memo.has(id)) return memo.get(id) ?? false\n memo.set(id, false)\n const t = byId.get(id)\n const ok = !!t && t.status !== 'blocked' && (t.status !== 'todo' || (inEpic.has(id) && unmet(t).every(canMove)))\n memo.set(id, ok)\n return ok\n }\n\n const waiting: { taskId: string; reason: string }[] = []\n for (const id of epic.tasks) {\n const t = byId.get(id)\n if (!t) waiting.push({ taskId: id, reason: `${id} has no task file` })\n else if (t.status === 'in-progress') waiting.push({ taskId: id, reason: `${id} is in progress (claimed)` })\n else if (t.status === 'blocked') waiting.push({ taskId: id, reason: `${id} is blocked` })\n else if (t.status === 'todo') {\n const deps = unmet(t).map(d => `${d} (${byId.get(d)?.status ?? 'missing'})`)\n waiting.push({ taskId: id, reason: `${id} waits on ${deps.join(', ')}` })\n }\n }\n return { kind: 'waiting', waiting, needsHuman: waiting.every(w => !canMove(w.taskId)) }\n}\n","/**\n * src/lib/core.ts\n * All file-system operations. Used by API routes, MCP handler, and SSR.\n * Runs server-side only.\n */\n\nimport fs from 'fs/promises'\nimport path from 'path'\nimport { glob } from 'glob'\nimport { applyEdits, type TextEdit } from './diff'\nimport { roadmapFromMarkdown, roadmapFromTasks, starterRoadmap, type RoadmapDraft, type RoadmapSource } from './roadmap-import'\nimport { pickNextTask, type QueueResult } from './work-queue'\nimport { selectPlan, validatePlan, type Plan } from './plan'\nimport { SESSION_GAP_MS } from './sessions'\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\nexport type TaskStatus = 'todo' | 'in-progress' | 'blocked' | 'done' | 'cancelled'\n\nexport interface Task {\n id: string\n title: string\n status: TaskStatus\n size: string\n phase: string\n dependsOn: string\n /** Optional `**Due:** YYYY-MM-DD` (local calendar date, compare as string). */\n due: string | null\n file: string\n raw?: string\n}\n\nexport interface TaskBoard {\n todo: Task[]\n 'in-progress': Task[]\n blocked: Task[]\n done: Task[]\n cancelled: Task[]\n}\n\nexport interface DocFile {\n path: string\n section: string\n name: string\n}\n\nexport interface DescriptionCache {\n [path: string]: {\n description: string\n source: 'extracted' | 'ai'\n updatedAt: string\n }\n}\n\nexport interface ExplorerFile {\n path: string\n name: string\n section: string\n description: string\n source: 'extracted' | 'ai'\n updatedAt: string\n mtime: string\n}\n\nexport interface SearchResult {\n file: string\n hits: { line: number; text: string }[]\n totalHits: number\n}\n\nexport interface ActivityEvent {\n id: string\n timestamp: string\n type: 'task_updated' | 'decision_logged' | 'memory_updated' | 'doc_read' | 'session_start' | 'doc_created' | 'doc_deleted' | 'doc_renamed' | 'registry_rebuilt' | 'roadmap_updated'\n actor: 'ai' | 'human'\n title: string\n detail?: string\n taskId?: string\n taskStatus?: TaskStatus\n sessionId?: string\n}\n\nexport interface Project {\n id: string\n name: string\n root: string\n hasVibedoc: boolean\n}\n\n// ─── Constants ────────────────────────────────────────────────────────────────\n\nexport const STATUS_ICONS: Record<TaskStatus, string> = {\n 'todo': '📋',\n 'in-progress': '🔨',\n 'blocked': '🚫',\n 'done': '✅',\n 'cancelled': '❌',\n}\n\nconst STATUS_ALIASES: Record<string, TaskStatus> = {\n ready: 'todo', planned: 'todo', 'not started': 'todo',\n wip: 'in-progress', doing: 'in-progress', active: 'in-progress', start: 'in-progress', started: 'in-progress',\n complete: 'done', completed: 'done', finished: 'done', finish: 'done',\n block: 'blocked',\n cancel: 'cancelled', skip: 'cancelled',\n}\n\nexport function normalizeStatus(raw: string): TaskStatus {\n const s = raw.toLowerCase().trim().replace(/[📋🔨✅🚫❌\\s]+$/, '').trim()\n return (STATUS_ALIASES[s] || s) as TaskStatus\n}\n\n// ─── Project detection ────────────────────────────────────────────────────────\n\nexport async function findRoot(startDir = process.cwd()): Promise<string> {\n let dir = path.resolve(startDir)\n for (let i = 0; i < 12; i++) {\n for (const marker of ['CLAUDE.md', 'AGENTS.md', 'docs/architecture', '.vibedoc']) {\n try { await fs.access(path.join(dir, marker)); return dir } catch {}\n }\n const parent = path.dirname(dir)\n if (parent === dir) break\n dir = parent\n }\n return path.resolve(startDir)\n}\n\nexport function getConfiguredRoot(): string {\n return process.env.VIBEDOC_ROOT || process.cwd()\n}\n\n// ─── Multi-project: scan parent directories ───────────────────────────────────\n\nexport async function discoverProjects(searchBase?: string): Promise<Project[]> {\n const base = searchBase || path.dirname(getConfiguredRoot())\n const projects: Project[] = []\n\n try {\n const entries = await fs.readdir(base, { withFileTypes: true })\n for (const entry of entries) {\n if (!entry.isDirectory()) continue\n const dir = path.join(base, entry.name)\n let hasVibedoc = false\n for (const marker of ['CLAUDE.md', 'AGENTS.md', 'docs/architecture', '.vibedoc']) {\n try { await fs.access(path.join(dir, marker)); hasVibedoc = true; break } catch {}\n }\n if (hasVibedoc) {\n projects.push({ id: entry.name, name: entry.name, root: dir, hasVibedoc: true })\n }\n }\n } catch {}\n\n // Always ensure configured root is first\n const root = getConfiguredRoot()\n const name = path.basename(root)\n const existingIdx = projects.findIndex(p => p.root === root)\n if (existingIdx > 0) {\n const [existing] = projects.splice(existingIdx, 1)\n projects.unshift(existing)\n } else if (existingIdx === -1) {\n projects.unshift({ id: name, name, root, hasVibedoc: true })\n }\n\n return projects\n}\n\n// ─── Docs ─────────────────────────────────────────────────────────────────────\n\nexport async function listDocs(root: string): Promise<DocFile[]> {\n const files = await glob('**/*.md', {\n cwd: root,\n ignore: ['node_modules/**', '.git/**', '.next/**'],\n nodir: true,\n })\n\n return files.sort().map(f => ({\n path: f,\n section: inferSection(f),\n name: path.basename(f, '.md'),\n }))\n}\n\nfunction inferSection(f: string): string {\n if (!f.includes('/')) return 'root'\n if (f.startsWith('memory/')) return 'memory'\n if (f.startsWith('plans/')) return 'plans'\n if (f.includes('01-overview')) return 'overview'\n if (f.includes('02-high-level') || f.includes('high-level-design')) return 'high-level-design'\n if (f.includes('03-services') || f.includes('/services/')) return 'services'\n if (f.includes('04-data') || f.includes('/data/')) return 'data'\n if (f.includes('05-infra') || f.includes('/infrastructure/')) return 'infrastructure'\n if (f.includes('06-security') || f.includes('/security/')) return 'security'\n if (f.includes('07-observ') || f.includes('/observability/')) return 'observability'\n if (f.includes('08-resil') || f.includes('/resilience/')) return 'resilience'\n if (f.includes('decisions/') || f.includes('ADR')) return 'decisions'\n return 'other'\n}\n\nexport async function readDoc(query: string, root: string): Promise<{ path: string; content: string }> {\n const candidates = [\n path.join(root, query),\n path.join(root, `${query}.md`),\n path.join(root, 'docs', query),\n path.join(root, 'docs', `${query}.md`),\n path.join(root, 'docs', 'architecture', query),\n path.join(root, 'docs', 'architecture', `${query}.md`),\n path.join(root, 'memory', query),\n path.join(root, 'memory', `${query}.md`),\n path.join(root, 'plans', query),\n path.join(root, 'plans', `${query}.md`),\n ]\n\n for (const c of candidates) {\n try {\n const content = await fs.readFile(c, 'utf8')\n return { path: path.relative(root, c), content }\n } catch {}\n }\n\n // Glob fallback\n for (const pattern of [`**/${query}.md`, `**/${query}*.md`, `**/*${query}*.md`]) {\n const matches = await glob(pattern, {\n cwd: root,\n ignore: ['node_modules/**', '.git/**', '.next/**'],\n nodir: true,\n nocase: true,\n })\n if (matches.length > 0) {\n const content = await fs.readFile(path.join(root, matches[0]), 'utf8')\n return { path: matches[0], content }\n }\n }\n\n throw new Error(`Doc not found: \"${query}\"`)\n}\n\nexport async function writeDoc(docPath: string, content: string, root: string): Promise<void> {\n const resolvedRoot = path.resolve(root)\n const fullPath = path.resolve(root, docPath)\n if (!fullPath.startsWith(resolvedRoot + path.sep) && fullPath !== resolvedRoot) {\n throw new Error('Path outside root')\n }\n await fs.mkdir(path.dirname(fullPath), { recursive: true })\n await fs.writeFile(fullPath, content, 'utf8')\n}\n\n// Reads the doc at an exact path ('' if missing) and applies old_string→new_string edits.\n// dryRun validates without writing (used to check a proposal before the user sees it).\nexport async function editDoc(\n docPath: string,\n edits: TextEdit[],\n root: string,\n dryRun = false,\n): Promise<{ before: string; content: string }> {\n const resolvedRoot = path.resolve(root)\n const fullPath = path.resolve(root, docPath)\n if (!fullPath.startsWith(resolvedRoot + path.sep)) throw new Error('Path outside root')\n const before = await fs.readFile(fullPath, 'utf8').catch((e: NodeJS.ErrnoException) => {\n if (e.code === 'ENOENT') return ''\n throw e\n })\n const result = applyEdits(before, edits)\n if ('error' in result) throw new Error(result.error)\n if (!dryRun) {\n await fs.mkdir(path.dirname(fullPath), { recursive: true })\n await fs.writeFile(fullPath, result.content, 'utf8')\n }\n return { before, content: result.content }\n}\n\nexport async function getContext(paths: string[], root: string): Promise<string> {\n const parts: string[] = []\n for (const p of paths) {\n try {\n const { content } = await readDoc(p, root)\n parts.push(`--- FILE: ${p} ---\\n\\n${content.trim()}`)\n } catch {\n // skip missing or unreadable files\n }\n }\n return parts.join('\\n\\n---\\n\\n')\n}\n\nexport async function createDoc(docPath: string, content: string, root: string): Promise<void> {\n const resolvedRoot = path.resolve(root)\n const fullPath = path.resolve(root, docPath)\n if (!fullPath.startsWith(resolvedRoot + path.sep) && fullPath !== resolvedRoot) {\n throw new Error('Path outside root')\n }\n try {\n await fs.access(fullPath)\n const err = new Error(`File already exists: ${docPath}`) as NodeJS.ErrnoException\n err.code = 'EEXIST'\n throw err\n } catch (e) {\n const nodeErr = e as NodeJS.ErrnoException\n if (nodeErr.code !== 'ENOENT') throw e\n }\n await fs.mkdir(path.dirname(fullPath), { recursive: true })\n await fs.writeFile(fullPath, content, 'utf8')\n await appendActivity(root, { type: 'doc_created', actor: 'human', title: `Created: ${docPath}`, detail: docPath })\n try { const { exists } = await readRegistry(root); if (exists) await rebuildRegistry(root) } catch {}\n}\n\nexport async function searchDocs(query: string, root: string): Promise<SearchResult[]> {\n const files = await glob('**/*.md', {\n cwd: root,\n ignore: ['node_modules/**', '.git/**', '.next/**'],\n nodir: true,\n })\n const qLower = query.toLowerCase()\n const results: SearchResult[] = []\n\n for (const f of files) {\n try {\n const content = await fs.readFile(path.join(root, f), 'utf8')\n const lines = content.split('\\n')\n const hits = lines\n .map((line, i) => ({ line: i + 1, text: line.trim().slice(0, 120) }))\n .filter(h => h.text.toLowerCase().includes(qLower))\n if (hits.length > 0) results.push({ file: f, hits: hits.slice(0, 4), totalHits: hits.length })\n } catch {}\n }\n\n return results.sort((a, b) => b.totalHits - a.totalHits).slice(0, 20)\n}\n\n// ─── Tasks ────────────────────────────────────────────────────────────────────\n\nfunction parseTaskFile(filePath: string, content: string): Task {\n const lines = content.split('\\n')\n const filename = path.basename(filePath, '.md')\n const titleLine = lines.find(l => l.startsWith('# '))\n const title = (titleLine || '').replace(/^#+\\s*/, '').replace(/^T\\d+\\s*[:—–-]\\s*/i, '').trim() || filename\n\n // Only the head block under the H1 counts, so a `**Depends on:**` quoted in the body can't override it.\n const meta: Record<string, string> = {}\n for (const line of lines.slice(0, roadmapMetaEnd(lines))) {\n const m = line.match(/\\*\\*([^*]+):\\*\\*\\s*(.+)/)\n if (m) meta[m[1].toLowerCase().trim()] = m[2].trim()\n }\n\n const rawStatus = (meta['status'] || 'todo').replace(/[📋🔨✅🚫❌]/g, '').trim()\n const status = normalizeStatus(rawStatus)\n const idM = filename.match(/^(T\\d+)/i)\n const id = idM ? idM[1].toUpperCase() : filename.toUpperCase()\n\n return { id, title, status, size: meta['size'] || '', phase: meta['phase'] || '', dependsOn: meta['depends on'] || '', due: parseDue(meta['due'] || ''), file: filePath, raw: content }\n}\n\nexport async function listTasks(root: string): Promise<{ tasks: Task[]; board: TaskBoard }> {\n let files = await glob('plans/tasks/T*.md', { cwd: root, nodir: true })\n if (files.length === 0) files = await glob('plans/T*.md', { cwd: root, nodir: true })\n\n const tasks: Task[] = []\n for (const f of files.sort()) {\n try {\n const content = await fs.readFile(path.join(root, f), 'utf8')\n tasks.push(parseTaskFile(f, content))\n } catch {}\n }\n\n const board: TaskBoard = { todo: [], 'in-progress': [], blocked: [], done: [], cancelled: [] }\n for (const t of tasks) {\n const col = (board[t.status] ? t.status : 'todo') as TaskStatus\n board[col].push(t)\n }\n return { tasks, board }\n}\n\nexport async function getTask(taskId: string, root: string): Promise<Task> {\n const id = taskId.toUpperCase().startsWith('T') ? taskId.toUpperCase() : `T${taskId}`\n for (const pattern of [`plans/tasks/${id}*.md`, `plans/${id}*.md`]) {\n const matches = await glob(pattern, { cwd: root, nodir: true })\n if (matches.length > 0) {\n const content = await fs.readFile(path.join(root, matches[0]), 'utf8')\n return parseTaskFile(matches[0], content)\n }\n }\n throw new Error(`Task not found: ${taskId}`)\n}\n\nexport async function updateTaskStatus(\n taskId: string, newStatus: TaskStatus, root: string, actor: 'ai' | 'human' = 'human'\n): Promise<{ task: Task; previousStatus: TaskStatus }> {\n const task = await getTask(taskId, root)\n const previousStatus = task.status\n const icon = STATUS_ICONS[newStatus]\n\n let content = task.raw!\n const statusPattern = /(\\*\\*Status:\\*\\*\\s*).+/\n if (statusPattern.test(content)) {\n content = content.replace(statusPattern, `$1${icon} ${capitalize(newStatus)}`)\n } else {\n content = content.replace(/^(#[^\\n]+\\n)/, `$1**Status:** ${icon} ${capitalize(newStatus)}\\n`)\n }\n\n await fs.writeFile(path.join(root, task.file), content, 'utf8')\n\n // Append to activity log\n await appendActivity(root, {\n type: 'task_updated', actor,\n title: `${task.id} moved to ${newStatus}`,\n detail: task.title,\n taskId: task.id,\n taskStatus: newStatus,\n })\n\n return { task: { ...task, status: newStatus, raw: content }, previousStatus }\n}\n\n// ponytail: in-process mutex so two agents never claim the same task; separate from the roadmap lock.\n// Doesn't cover a second VibeDoc process on the same root.\nlet taskClaimLock: Promise<unknown> = Promise.resolve()\nfunction withTaskClaimLock<T>(fn: () => Promise<T>): Promise<T> {\n const run = taskClaimLock.then(fn, fn)\n taskClaimLock = run.catch(() => {})\n return run\n}\n\n/** Atomically pick the next ready task of an epic and move it to in-progress. */\nexport function claimNextTask(\n epicId: string, root: string\n): Promise<{ result: QueueResult; task?: Task; previousStatus?: TaskStatus }> {\n return withTaskClaimLock(async () => {\n const epic = await getRoadmapItem(epicId, root)\n if (!epic.parent) throw new Error(`${epic.id} is a horizon; pass an epic id`)\n const { tasks } = await listTasks(root)\n const result = pickNextTask(epic, tasks)\n if (result.kind !== 'ready') return { result }\n const { task, previousStatus } = await updateTaskStatus(result.taskId, 'in-progress', root, 'ai')\n return { result, task, previousStatus }\n })\n}\n\nexport interface CreateTaskParams {\n title: string\n phase?: string\n size?: string\n description?: string\n dependsOn?: string\n due?: string\n body?: string // replaces the template sections below the meta block\n}\n\n/** Serialized with next_task claims and plan applies, so concurrent creates never pick the same id. */\nexport function createTask(params: CreateTaskParams, root: string): Promise<Task> {\n return withTaskClaimLock(() => createTaskUnlocked(params, root))\n}\n\n/** Caller must hold withTaskClaimLock (applyPlan does). */\nasync function createTaskUnlocked(params: CreateTaskParams, root: string): Promise<Task> {\n const { tasks } = await listTasks(root)\n // One line only: a newline in the title would inject **Key:** lines into the meta block\n const title = params.title.replace(/\\s+/g, ' ').trim()\n\n const ids = tasks\n .map(t => parseInt(t.id.replace(/^T/i, ''), 10))\n .filter(n => !isNaN(n))\n const nextNum = ids.length > 0 ? Math.max(...ids) + 1 : 1\n const id = `T${String(nextNum).padStart(3, '0')}`\n\n const slug = title\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-|-$/g, '')\n .slice(0, 40) || 'task'\n\n const filename = `${id}-${slug}.md`\n const tasksDir = path.join(root, 'plans', 'tasks')\n await fs.mkdir(tasksDir, { recursive: true })\n const filePath = path.join(tasksDir, filename)\n\n const due = params.due ? parseDue(params.due) : null\n if (params.due && !due) throw new RoadmapError(`due must be a date YYYY-MM-DD (got ${JSON.stringify(params.due)})`)\n\n const meta = `# ${id}: ${title}\n**Status:** 📋 Ready\n**Phase:** ${params.phase || '—'}\n**Size:** ${params.size || '—'}\n**Depends on:** ${params.dependsOn || '—'}\n${due ? `**Due:** ${due}\\n` : ''}`\n const content = params.body !== undefined ? `${meta}\\n${params.body.trim()}\\n` : `${meta}\n## What to build\n${params.description || '—'}\n\n## Scope\n- [ ]\n\n## Acceptance criteria\n- [ ]\n\n## Definition of done\n—\n`\n\n await fs.writeFile(filePath, content, { flag: 'wx', encoding: 'utf8' })\n return getTask(id, root)\n}\n\n/** Validate against the current files, then keep the selected keys. Throws RoadmapError on any problem. */\nfunction checkPlan(plan: unknown, selected: unknown, items: RoadmapItem[], taskIds: string[]): Plan {\n const errors = validatePlan(plan, { roadmap: items, taskIds })\n if (errors.length > 0) throw new RoadmapError(errors.join('\\n'))\n if (!Array.isArray(selected)) throw new RoadmapError('selected must be an array of plan keys')\n const { plan: sel, errors: selErrors } = selectPlan(plan as Plan, selected.map(String))\n if (selErrors.length > 0) throw new RoadmapError(selErrors.join('\\n'))\n return sel\n}\n\n/**\n * Write the selected items of a plan. Validates again against the current files.\n * breakdown: plan keys become real T ids in order (so `dependsOn` keys are written as those ids) and are\n * linked to the epic; runs under the task-claim lock so ids can't collide with next_task or another apply.\n * roadmap: horizons first (keys → R ids), then epics under their resolved parent; order and status use\n * createRoadmapItem's defaults (after the last sibling, step 10; planned). Runs under the roadmap lock.\n * `epic` is the breakdown's epic, null for a roadmap plan.\n */\nexport function applyPlan(\n plan: unknown, selected: unknown, root: string, actor: 'ai' | 'human' = 'human'\n): Promise<{ created: { key: string; id: string; file: string }[]; epic: RoadmapItem | null }> {\n if ((plan as { kind?: unknown } | null)?.kind === 'roadmap') {\n return withRoadmapLock(async () => {\n const [items, { tasks }] = await Promise.all([readRoadmapFiles(root), listTasks(root)])\n const sel = checkPlan(plan, selected, items.map(f => f.item), tasks.map(t => t.id))\n if (sel.kind !== 'roadmap') throw new RoadmapError('expected a roadmap plan')\n const ids = new Map<string, string>()\n const created: { key: string; id: string; file: string }[] = []\n // ponytail: not atomic; a failure mid-way leaves the items written so far (each is a valid item).\n for (const h of sel.horizons) {\n const item = await createRoadmapItemUnlocked({ title: h.title.trim(), body: h.body }, root, actor)\n ids.set(h.key.trim(), item.id)\n created.push({ key: h.key, id: item.id, file: item.file })\n }\n for (const e of sel.epics) {\n const parent = ids.get(e.parent.trim()) ?? e.parent.trim().toUpperCase()\n const item = await createRoadmapItemUnlocked({ title: e.title.trim(), parent, status: e.status, body: e.body }, root, actor)\n created.push({ key: e.key, id: item.id, file: item.file })\n }\n return { created, epic: null }\n })\n }\n return withTaskClaimLock(async () => {\n const [{ items }, { tasks }] = await Promise.all([listRoadmap(root), listTasks(root)])\n const sel = checkPlan(plan, selected, items, tasks.map(t => t.id))\n if (sel.kind !== 'breakdown') throw new RoadmapError('expected a breakdown plan')\n\n const epic = await getRoadmapItem(sel.epic, root)\n const ids = new Map<string, string>()\n const created: { key: string; id: string; file: string }[] = []\n for (const t of sel.tasks) {\n const deps = (t.dependsOn ?? []).map(d => ids.get(d.trim()) ?? d.trim().toUpperCase())\n const task = await createTaskUnlocked({\n title: t.title.trim(),\n phase: `${epic.id} — ${epic.title}`,\n size: t.size,\n dependsOn: deps.join(', ') || undefined,\n due: t.due,\n body: t.body,\n }, root)\n ids.set(t.key.trim(), task.id)\n created.push({ key: t.key, id: task.id, file: task.file })\n }\n\n const fresh = await getRoadmapItem(epic.id, root)\n const updated = await updateRoadmapItem(epic.id, { tasks: [...fresh.tasks, ...created.map(c => c.id)] }, root, actor)\n return { created, epic: updated }\n })\n}\n\nfunction capitalize(s: string) { return s.charAt(0).toUpperCase() + s.slice(1) }\n\n// ─── Decisions (ADRs) ─────────────────────────────────────────────────────────\n\nexport interface ADRParams {\n title: string\n context: string\n decision: string\n rationale?: string\n alternatives?: { option: string; reason: string }[]\n consequences?: string\n}\n\nexport async function logDecision(params: ADRParams, root: string, actor: 'ai' | 'human' = 'human'): Promise<{ adrNumber: string; path: string }> {\n const { title, context, decision, rationale, alternatives = [], consequences } = params\n const existing = await glob('docs/architecture/decisions/ADR-*.md', { cwd: root, nodir: true })\n const nums = existing.map(f => parseInt(path.basename(f).match(/ADR-(\\d+)/)?.[1] || '0')).filter(n => !isNaN(n))\n const nextNum = nums.length > 0 ? Math.max(...nums) + 1 : 1\n const numStr = String(nextNum).padStart(3, '0')\n const slug = title.toLowerCase().replace(/[^a-z0-9\\s-]/g, '').replace(/\\s+/g, '-').slice(0, 50)\n const filename = `ADR-${numStr}-${slug}.md`\n const today = new Date().toISOString().split('T')[0]\n const altsTable = alternatives.length > 0\n ? alternatives.map(a => `| ${a.option} | ${a.reason} |`).join('\\n')\n : '| (none) | — |'\n\n const content = `# ADR-${numStr}: ${title}\\n\\n**Status:** ✅ Accepted\\n**Date:** ${today}\\n\\n## Context\\n${context}\\n\\n## Decision\\n${decision}\\n\\n## Rationale\\n${rationale || ''}\\n\\n## Alternatives considered\\n| Option | Why rejected |\\n|--------|-------------|\\n${altsTable}\\n\\n## Consequences\\n${consequences || ''}\\n`\n\n const filePath = path.join(root, 'docs/architecture/decisions', filename)\n await fs.mkdir(path.dirname(filePath), { recursive: true })\n await fs.writeFile(filePath, content, 'utf8')\n\n // Update index\n const indexPath = path.join(root, 'docs/architecture/decisions/_INDEX.md')\n try {\n let idx = await fs.readFile(indexPath, 'utf8')\n idx = idx.trimEnd() + `\\n| ADR-${numStr} | ${title} | ✅ Accepted | ${today} |\\n`\n await fs.writeFile(indexPath, idx, 'utf8')\n } catch {\n await fs.writeFile(indexPath, `# ADR Index\\n\\n| ADR | Title | Status | Date |\\n|-----|-------|--------|------|\\n| ADR-${numStr} | ${title} | ✅ Accepted | ${today} |\\n`, 'utf8')\n }\n\n await appendActivity(root, {\n type: 'decision_logged', actor,\n title: `ADR-${numStr}: ${title}`,\n detail: decision.slice(0, 100),\n })\n\n return { adrNumber: `ADR-${numStr}`, path: `docs/architecture/decisions/${filename}` }\n}\n\n// ─── Memory ───────────────────────────────────────────────────────────────────\n\nexport interface MemoryParams {\n currentState: string\n justCompleted?: string[]\n workingOn?: string\n upNext?: string[]\n issues?: (string | { issue: string; severity?: string; status?: string })[]\n decisions?: string[]\n techDebt?: string[]\n handoff: string\n}\n\nexport async function readMemory(root: string): Promise<{ content: string; exists: boolean }> {\n try {\n const content = await fs.readFile(path.join(root, 'memory', 'MEMORY.md'), 'utf8')\n return { content, exists: true }\n } catch {\n return { content: '*(No MEMORY.md found — AI will create one at end of session)*', exists: false }\n }\n}\n\nexport async function updateMemory(params: MemoryParams, root: string, actor: 'ai' | 'human' = 'human'): Promise<void> {\n const { currentState, justCompleted = [], workingOn = '', upNext = [], issues = [], decisions = [], techDebt = [], handoff } = params\n const now = new Date()\n const today = now.toISOString().split('T')[0]\n const time = now.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })\n\n const content = `# Project Memory\\n**Last updated:** ${today} at ${time}\\n\\n## Current state\\n${currentState}\\n\\n## Just completed\\n${justCompleted.map(i => `- ${i}`).join('\\n') || '- (nothing this session)'}\\n\\n## Working on now\\n${workingOn || '(nothing active)'}\\n\\n## Up next\\n${upNext.map((item, i) => `${i + 1}. ${item}`).join('\\n') || '1. (define next steps)'}\\n\\n## Active issues\\n| Issue | Severity | Status |\\n|-------|----------|--------|\\n${issues.map(i => typeof i === 'string' ? `| ${i} | medium | open |` : `| ${i.issue} | ${i.severity || 'medium'} | ${i.status || 'open'} |`).join('\\n') || '| None | — | — |'}\\n\\n## Recent decisions\\n${decisions.map(d => `- ${d}`).join('\\n') || '- (none this session)'}\\n\\n## Tech debt\\n${techDebt.map(d => `- ${d}`).join('\\n') || '- (none noted)'}\\n\\n## Handoff for next session\\n${handoff}\\n`\n\n await fs.mkdir(path.join(root, 'memory'), { recursive: true })\n await fs.writeFile(path.join(root, 'memory', 'MEMORY.md'), content, 'utf8')\n\n await appendActivity(root, {\n type: 'memory_updated', actor,\n title: 'Session memory updated',\n detail: handoff.slice(0, 120),\n })\n}\n\n// ─── Activity log ─────────────────────────────────────────────────────────────\n\nconst ACTIVITY_FILE = '.vibedoc-activity.json'\nconst ACTIVITY_CAP = 2000\n\n// ─── Description cache ────────────────────────────────────────────────────────\n\nconst DESCRIPTIONS_FILE = '.vibedoc-descriptions.json'\n\nexport async function readDescriptions(root: string): Promise<DescriptionCache> {\n try {\n const raw = await fs.readFile(path.join(root, DESCRIPTIONS_FILE), 'utf8')\n return JSON.parse(raw) as DescriptionCache\n } catch {\n return {}\n }\n}\n\nexport async function writeDescriptions(root: string, cache: DescriptionCache): Promise<void> {\n const filePath = path.join(root, DESCRIPTIONS_FILE)\n await fs.mkdir(path.dirname(filePath), { recursive: true })\n await fs.writeFile(filePath, JSON.stringify(cache, null, 2), 'utf8')\n}\n\nexport async function writeDescriptionEntry(\n root: string,\n filePath: string,\n entry: DescriptionCache[string]\n): Promise<void> {\n const normalizedKey = path.normalize(filePath).replace(/\\\\/g, '/')\n const cache = await readDescriptions(root)\n cache[normalizedKey] = entry\n await writeDescriptions(root, cache)\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet _anthropic: any = null\n\nasync function getAnthropicClient(): Promise<any> {\n if (!_anthropic) {\n const { default: Anthropic } = await import('@anthropic-ai/sdk')\n _anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY })\n }\n return _anthropic\n}\n\nexport function extractDescription(content: string): string {\n const lines = content.split('\\n')\n let heading = ''\n\n for (const line of lines) {\n const m = line.match(/^#{1,3}\\s+(.+)/)\n if (m && !heading) {\n heading = m[1].trim().slice(0, 120)\n continue\n }\n const t = line.trim()\n if (\n t &&\n !t.startsWith('#') &&\n !t.startsWith('```') &&\n !t.startsWith('|') &&\n !t.startsWith('-') &&\n !t.startsWith('*') &&\n t.length > 20\n ) {\n return t.slice(0, 120)\n }\n }\n return heading\n}\n\nexport async function enrichDescription(filePath: string, root: string): Promise<string> {\n const resolvedRoot = path.resolve(root)\n const fullPath = path.resolve(root, filePath)\n if (!fullPath.startsWith(resolvedRoot + path.sep) && fullPath !== resolvedRoot) {\n throw new Error('Path outside root')\n }\n\n const client = await getAnthropicClient()\n const content = await fs.readFile(fullPath, 'utf8')\n\n const message = await client.messages.create({\n model: 'claude-haiku-4-5-20251001',\n max_tokens: 100,\n messages: [{\n role: 'user',\n content: `Write a single sentence (max 120 characters) describing what this file is about. Output ONLY the sentence, nothing else.\\n\\n${content.slice(0, 2000)}`,\n }],\n })\n\n const textBlock = message.content.find((b: { type: string }) => b.type === 'text') as { type: 'text'; text: string } | undefined\n if (!textBlock) throw new Error('No text block in Anthropic response')\n const description = textBlock.text.trim().slice(0, 120)\n\n await writeDescriptionEntry(root, filePath, { description, source: 'ai', updatedAt: new Date().toISOString() })\n\n return description\n}\n\nexport async function listExplorerFiles(root: string): Promise<ExplorerFile[]> {\n const docs = await listDocs(root)\n const cache = await readDescriptions(root)\n\n return Promise.all(docs.map(async (doc) => {\n const cached = cache[doc.path]\n let description = cached?.description ?? ''\n const source: 'extracted' | 'ai' = cached?.source ?? 'extracted'\n\n // Get mtime first so we can use it as updatedAt fallback\n let mtime = new Date().toISOString()\n try {\n const stat = await fs.stat(path.join(root, doc.path))\n mtime = stat.mtime.toISOString()\n } catch { /* ignore */ }\n\n const updatedAt = cached?.updatedAt ?? mtime\n\n if (!cached) {\n try {\n const content = await fs.readFile(path.join(root, doc.path), 'utf8')\n description = extractDescription(content)\n } catch { /* ignore */ }\n }\n\n return { path: doc.path, name: doc.name, section: doc.section, description, source, updatedAt, mtime }\n }))\n}\n\n// ponytail: current session per root+actor lives in memory (on globalThis so dev HMR keeps it); a server restart starts a new session.\nconst globalForSessions = globalThis as unknown as { vibedocSessions?: Map<string, { id: string; lastAt: number }> }\nconst currentSessions = globalForSessions.vibedocSessions ?? (globalForSessions.vibedocSessions = new Map())\n\nfunction stampSession(root: string, event: Omit<ActivityEvent, 'id' | 'timestamp'>, now: number): string {\n const key = `${root}\\0${event.actor}`\n let cur = currentSessions.get(key)\n if (!cur || event.type === 'session_start' || now - cur.lastAt > SESSION_GAP_MS) {\n cur = { id: `ses_${now}_${Math.random().toString(36).slice(2, 7)}`, lastAt: now }\n currentSessions.set(key, cur)\n }\n cur.lastAt = now\n return cur.id\n}\n\nasync function appendActivity(root: string, event: Omit<ActivityEvent, 'id' | 'timestamp'>): Promise<void> {\n const now = Date.now()\n const full: ActivityEvent = {\n id: `evt_${now}_${Math.random().toString(36).slice(2, 7)}`,\n timestamp: new Date(now).toISOString(),\n ...event,\n sessionId: stampSession(root, event, now),\n }\n\n const file = path.join(root, ACTIVITY_FILE)\n let events: ActivityEvent[] = []\n try {\n const raw = await fs.readFile(file, 'utf8')\n events = JSON.parse(raw)\n } catch {}\n\n events.unshift(full)\n if (events.length > ACTIVITY_CAP) events = events.slice(0, ACTIVITY_CAP)\n await fs.writeFile(file, JSON.stringify(events, null, 2), 'utf8')\n}\n\nexport async function readActivity(root: string, limit = 50): Promise<ActivityEvent[]> {\n try {\n const raw = await fs.readFile(path.join(root, ACTIVITY_FILE), 'utf8')\n const events: ActivityEvent[] = JSON.parse(raw)\n return events.slice(0, limit)\n } catch {\n return []\n }\n}\n\nexport async function logSessionStart(root: string, actor: 'ai' | 'human' = 'ai'): Promise<void> {\n await appendActivity(root, { type: 'session_start', actor, title: 'Session started', detail: 'Agent connected' })\n}\n\n// ─── Status summary ───────────────────────────────────────────────────────────\n\n// ─── Doc operations (append, rename, delete) ──────────────────────────────────\n\nexport async function appendDoc(docPath: string, content: string, root: string): Promise<void> {\n const resolvedRoot = path.resolve(root)\n const fullPath = path.resolve(root, docPath)\n if (!fullPath.startsWith(resolvedRoot + path.sep) && fullPath !== resolvedRoot) {\n throw new Error('Path outside root')\n }\n let existing: string\n try {\n existing = await fs.readFile(fullPath, 'utf8')\n } catch {\n throw new Error(`Doc not found: ${docPath}`)\n }\n await fs.writeFile(fullPath, existing.trimEnd() + '\\n\\n' + content, 'utf8')\n}\n\nexport async function renameDoc(oldPath: string, newPath: string, root: string): Promise<void> {\n const resolvedRoot = path.resolve(root)\n const fullOld = path.resolve(root, oldPath)\n const fullNew = path.resolve(root, newPath)\n if (!fullOld.startsWith(resolvedRoot + path.sep) && fullOld !== resolvedRoot) {\n throw new Error('Path outside root')\n }\n if (!fullNew.startsWith(resolvedRoot + path.sep) && fullNew !== resolvedRoot) {\n throw new Error('Path outside root')\n }\n await fs.mkdir(path.dirname(fullNew), { recursive: true })\n try {\n await fs.rename(fullOld, fullNew)\n } catch (e) {\n if ((e as NodeJS.ErrnoException).code === 'EXDEV') {\n await fs.copyFile(fullOld, fullNew)\n await fs.unlink(fullOld)\n } else throw e\n }\n await appendActivity(root, { type: 'doc_renamed', actor: 'human', title: `Renamed ${oldPath} → ${newPath}` })\n try { const { exists } = await readRegistry(root); if (exists) await rebuildRegistry(root) } catch {}\n}\n\nexport async function deleteDoc(docPath: string, root: string): Promise<void> {\n const resolvedRoot = path.resolve(root)\n const fullPath = path.resolve(root, docPath)\n if (!fullPath.startsWith(resolvedRoot + path.sep) && fullPath !== resolvedRoot) {\n throw new Error('Path outside root')\n }\n await fs.unlink(fullPath)\n await appendActivity(root, { type: 'doc_deleted', actor: 'human', title: `Deleted ${docPath}` })\n try { const { exists } = await readRegistry(root); if (exists) await rebuildRegistry(root) } catch {}\n}\n\n// ─── Document Registry ────────────────────────────────────────────────────────\n\nconst REGISTRY_PATH = 'docs/REGISTRY.md'\nconst ANNOTATIONS_START = '<!-- REGISTRY_ANNOTATIONS_START -->'\nconst ANNOTATIONS_END = '<!-- REGISTRY_ANNOTATIONS_END -->'\n\nfunction buildDocTree(files: string[]): string {\n // Build a map of directories and files\n const tree: Map<string, string[]> = new Map()\n for (const f of files) {\n const dir = path.dirname(f)\n if (!tree.has(dir)) tree.set(dir, [])\n tree.get(dir)!.push(path.basename(f))\n }\n\n const lines: string[] = []\n const dirs = Array.from(tree.keys()).sort()\n\n // Build indented tree\n const rendered = new Set<string>()\n function renderDir(dir: string, indent: number) {\n if (rendered.has(dir)) return\n rendered.add(dir)\n const prefix = ' '.repeat(indent)\n if (dir !== '.') {\n const parts = dir.split('/')\n lines.push(`${prefix}${parts[parts.length - 1]}/`)\n }\n const childIndent = dir === '.' ? 0 : indent + 1\n const childPrefix = ' '.repeat(childIndent)\n // Files directly in this dir\n const dirFiles = tree.get(dir) || []\n for (const f of dirFiles.sort()) {\n lines.push(`${childPrefix}${f}`)\n }\n // Subdirs\n for (const d of dirs) {\n if (d !== dir && path.dirname(d) === dir) {\n renderDir(d, childIndent)\n }\n }\n }\n\n renderDir('.', 0)\n return lines.join('\\n')\n}\n\nfunction parseAnnotations(content: string): Map<string, { description: string; keywords: string }> {\n const map = new Map<string, { description: string; keywords: string }>()\n const start = content.indexOf(ANNOTATIONS_START)\n const end = content.indexOf(ANNOTATIONS_END)\n if (start === -1 || end === -1) return map\n\n const section = content.slice(start + ANNOTATIONS_START.length, end)\n const rows = section.split('\\n').filter(l => l.startsWith('|') && !l.includes('---') && !l.includes('Path'))\n for (const row of rows) {\n const cols = row.split('|').map(c => c.trim()).filter(Boolean)\n if (cols.length >= 3) {\n map.set(cols[0], { description: cols[1], keywords: cols[2] })\n }\n }\n return map\n}\n\nexport async function readRegistry(root: string): Promise<{ content: string; exists: boolean }> {\n try {\n const content = await fs.readFile(path.join(root, REGISTRY_PATH), 'utf8')\n return { content, exists: true }\n } catch {\n return { content: '*(No REGISTRY.md found — call vibedoc_rebuild_registry to generate it)*', exists: false }\n }\n}\n\nexport async function rebuildRegistry(root: string, actor: 'ai' | 'human' = 'human'): Promise<{ path: string; totalFiles: number }> {\n const docs = await listDocs(root)\n const files = docs.map(d => d.path)\n\n // Parse existing annotations\n let existing = ''\n try {\n existing = await fs.readFile(path.join(root, REGISTRY_PATH), 'utf8')\n } catch {}\n const savedAnnotations = parseAnnotations(existing)\n\n // Build tree\n const tree = buildDocTree(files)\n\n // Build annotations table — preserve existing, stub new files\n const rows: string[] = []\n for (const f of files) {\n const saved = savedAnnotations.get(f)\n rows.push(`| ${f} | ${saved?.description ?? ''} | ${saved?.keywords ?? ''} |`)\n }\n\n const now = new Date().toISOString()\n const content = [\n `# Document Registry`,\n `**Generated:** ${now} **Total:** ${files.length} files`,\n ``,\n `> Edit the Annotations table — it survives rebuilds.`,\n `> Run \\`vibedoc_rebuild_registry\\` after adding/removing docs.`,\n ``,\n `## File Tree`,\n `\\`\\`\\``,\n tree,\n `\\`\\`\\``,\n ``,\n `## Annotations`,\n ``,\n ANNOTATIONS_START,\n `| Path | Description | Keywords |`,\n `|------|-------------|----------|`,\n ...rows,\n ANNOTATIONS_END,\n ``,\n ].join('\\n')\n\n await writeDoc(REGISTRY_PATH, content, root)\n await appendActivity(root, {\n type: 'registry_rebuilt',\n actor,\n title: 'Document registry rebuilt',\n detail: `${files.length} files indexed`,\n })\n\n return { path: REGISTRY_PATH, totalFiles: files.length }\n}\n\nexport async function updateRegistryAnnotation(\n docPath: string, description: string, keywords: string, root: string\n): Promise<void> {\n const { content, exists } = await readRegistry(root)\n if (!exists) throw new Error('Registry not found — call vibedoc_rebuild_registry first')\n\n const annotations = parseAnnotations(content)\n annotations.set(docPath, { description, keywords })\n\n // Rebuild the annotations block with updated data\n const start = content.indexOf(ANNOTATIONS_START)\n const end = content.indexOf(ANNOTATIONS_END)\n if (start === -1 || end === -1) throw new Error('Registry format invalid — rebuild first')\n\n const rows = Array.from(annotations.entries())\n .map(([p, a]) => `| ${p} | ${a.description} | ${a.keywords} |`)\n\n const newAnnotationsBlock = [\n ANNOTATIONS_START,\n `| Path | Description | Keywords |`,\n `|------|-------------|----------|`,\n ...rows,\n ANNOTATIONS_END,\n ].join('\\n')\n\n const newContent = content.slice(0, start) + newAnnotationsBlock + content.slice(end + ANNOTATIONS_END.length)\n await writeDoc(REGISTRY_PATH, newContent, root)\n}\n\n// ─── Backlinks ─────────────────────────────────────────────────────────────────\n\nexport async function findBacklinks(\n targetPath: string,\n root: string\n): Promise<{ file: string; line: number; text: string }[]> {\n const files = await glob('**/*.md', {\n cwd: root,\n ignore: ['node_modules/**', '.git/**', '.next/**'],\n nodir: true,\n })\n const normalTarget = targetPath.replace(/\\\\/g, '/')\n const basename = path.basename(normalTarget)\n const results: { file: string; line: number; text: string }[] = []\n\n for (const f of files) {\n if (f.replace(/\\\\/g, '/') === normalTarget) continue\n try {\n const content = await fs.readFile(path.join(root, f), 'utf8')\n const lines = content.split('\\n')\n lines.forEach((line, i) => {\n if (/\\[.*\\]\\(.*\\)/.test(line) &&\n (line.includes(basename) || line.includes(normalTarget))) {\n results.push({ file: f, line: i + 1, text: line.trim().slice(0, 120) })\n }\n })\n } catch { /* skip unreadable */ }\n }\n return results\n}\n\n// ─── Status summary ───────────────────────────────────────────────────────────\n\nexport async function getProjectSummary(root: string) {\n const [{ tasks, board }, docs, memory, activity] = await Promise.all([\n listTasks(root),\n listDocs(root),\n readMemory(root),\n readActivity(root, 10),\n ])\n\n return {\n root,\n name: path.basename(root),\n tasks: {\n total: tasks.length,\n board: { todo: board.todo.length, 'in-progress': board['in-progress'].length, blocked: board.blocked.length, done: board.done.length, cancelled: board.cancelled.length },\n active: board['in-progress'],\n blocked: board.blocked,\n },\n docs: { total: docs.length },\n memory,\n activity,\n }\n}\n\n\n// ─── Roadmap ──────────────────────────────────────────────────────────────────\n// Items: plans/roadmap/R*.md (content + Parent/Status/Order/Tasks).\n// Positions: plans/roadmap/layout.json (presentation only, never in R*.md).\n\nexport type RoadmapStatus = 'planned' | 'in-progress' | 'done'\n\nexport interface RoadmapItem {\n id: string // \"R004\"\n title: string\n parent: string | null // null = horizon on the spine\n status: RoadmapStatus\n order: number\n tasks: string[] // [\"T001\", \"T012\"]\n due: string | null // \"2026-10-15\" — a calendar date, not an instant; compare as strings\n body: string // markdown after the metadata block\n file: string // path relative to root\n}\n\nexport type RoadmapLayout = Record<string, { x: number; y: number }>\n\nexport interface CreateRoadmapItemParams {\n title: string\n parent?: string | null\n status?: RoadmapStatus\n order?: number\n tasks?: string[]\n due?: string | null\n body?: string\n}\n\nexport type UpdateRoadmapItemPatch = Partial<Omit<CreateRoadmapItemParams, 'title'> & { title: string }>\n\n\n/** Validation / not-found error from the roadmap API. `status` maps straight to an HTTP code. */\nexport class RoadmapError extends Error {\n constructor(message: string, public status: 400 | 404 = 400) {\n super(message)\n this.name = 'RoadmapError'\n }\n}\n\nconst ROADMAP_DIR = path.join('plans', 'roadmap')\nconst ROADMAP_LAYOUT = path.join(ROADMAP_DIR, 'layout.json')\nconst ROADMAP_STATUSES: RoadmapStatus[] = ['planned', 'in-progress', 'done']\nconst META_LINE = /^\\*\\*([^*]+):\\*\\*/\n\nfunction normalizeRoadmapId(id: unknown): string {\n const s = String(id ?? '').trim().toUpperCase()\n if (!/^R\\d+$/.test(s)) throw new RoadmapError(`Invalid roadmap id: ${String(id)}`)\n return s\n}\n\nfunction roadmapIdOf(file: string): string | null {\n const m = path.basename(file).match(/^(R\\d+)(?:-|\\.md$)/i)\n return m ? m[1].toUpperCase() : null\n}\n\nfunction parseRoadmapStatus(raw: unknown): RoadmapStatus {\n const s = String(raw ?? '').toLowerCase().trim().replace(/\\s+/g, '-')\n if (!ROADMAP_STATUSES.includes(s as RoadmapStatus)) {\n throw new RoadmapError(`Invalid status \"${String(raw)}\" (expected ${ROADMAP_STATUSES.join(' | ')})`)\n }\n return s as RoadmapStatus\n}\n\nfunction parseTaskIds(tasks: unknown): string[] {\n if (!Array.isArray(tasks)) throw new RoadmapError('tasks must be an array of task ids')\n return tasks.map(t => {\n const s = String(t).trim().toUpperCase()\n if (!/^T\\d+$/.test(s)) throw new RoadmapError(`Invalid task id: ${String(t)}`)\n return s\n })\n}\n\nfunction cleanTitle(title: unknown): string {\n const t = String(title ?? '').replace(/\\s+/g, ' ').trim()\n if (!t) throw new RoadmapError('Title is required')\n return t\n}\n\n/** A real calendar date \"YYYY-MM-DD\" (rejects 2026-02-30), else null. */\nfunction parseDue(raw: string): string | null {\n const m = raw.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/)\n if (!m) return null\n const d = new Date(Date.UTC(+m[1], +m[2] - 1, +m[3]))\n return d.toISOString().slice(0, 10) === raw ? raw : null\n}\n\nfunction cleanDue(due: unknown): string | null {\n if (due === null || due === '') return null\n const d = typeof due === 'string' ? parseDue(due.trim()) : null\n if (!d) throw new RoadmapError(`due must be a date YYYY-MM-DD (got ${JSON.stringify(due)})`)\n return d\n}\n\nfunction cleanOrder(order: unknown): number {\n const n = Number(order)\n if (typeof order !== 'number' || !Number.isFinite(n)) throw new RoadmapError('order must be a finite number')\n return n\n}\n\n/** Index of the first line after the H1 + contiguous `**Key:** Value` block. */\nfunction roadmapMetaEnd(lines: string[]): number {\n let i = lines.findIndex(l => l.startsWith('# '))\n i = i < 0 ? 0 : i + 1\n // Tolerate blank lines between the H1 and the meta block (common in hand-written files).\n let j = i\n while (j < lines.length && lines[j].trim() === '') j++\n if (j < lines.length && META_LINE.test(lines[j])) i = j\n while (i < lines.length && META_LINE.test(lines[i])) i++\n return i\n}\n\nfunction parseRoadmapFile(file: string, content: string): RoadmapItem {\n const lines = content.split('\\n')\n const titleLine = lines.find(l => l.startsWith('# '))\n const id = roadmapIdOf(file) ?? path.basename(file, '.md').toUpperCase()\n const title = (titleLine || '').replace(/^#+\\s*/, '').replace(/^R\\d+:\\s*/i, '').trim() || id\n\n // Only the head block counts, so a `**Status:**` inside the body can't override the item's meta.\n const metaEnd = roadmapMetaEnd(lines)\n const meta: Record<string, string> = {}\n for (const line of lines.slice(0, Math.min(metaEnd, 30))) {\n const m = line.match(/\\*\\*([^*]+):\\*\\*\\s*(.+)/)\n if (m) meta[m[1].toLowerCase().trim()] = m[2].trim()\n }\n\n const rawParent = (meta['parent'] || '').toUpperCase()\n let status: RoadmapStatus = 'planned'\n try { status = parseRoadmapStatus((meta['status'] || '').replace(/[^a-z\\s-]/gi, '')) } catch {}\n const order = parseFloat(meta['order'] || '')\n\n return {\n id,\n title,\n parent: /^R\\d+$/.test(rawParent) ? rawParent : null,\n status,\n order: Number.isFinite(order) ? order : 0,\n tasks: (meta['tasks'] || '').split(/[,\\s]+/).map(t => t.toUpperCase()).filter(t => /^T\\d+$/.test(t)),\n due: parseDue(meta['due'] || ''),\n body: lines.slice(metaEnd).join('\\n').trim(),\n file,\n }\n}\n\nasync function readRoadmapFiles(root: string): Promise<{ item: RoadmapItem; raw: string }[]> {\n const files = await glob('plans/roadmap/R*.md', { cwd: root, nodir: true })\n const out: { item: RoadmapItem; raw: string }[] = []\n for (const f of files) {\n if (!roadmapIdOf(f)) continue\n try {\n const raw = await fs.readFile(path.join(root, f), 'utf8')\n out.push({ item: parseRoadmapFile(f, raw), raw })\n } catch {}\n }\n return out\n}\n\nasync function findRoadmapFile(id: string, root: string): Promise<{ item: RoadmapItem; raw: string }> {\n const rid = normalizeRoadmapId(id)\n const matches = (await glob(`plans/roadmap/${rid}*.md`, { cwd: root, nodir: true }))\n .filter(f => roadmapIdOf(f) === rid)\n .sort()\n if (matches.length === 0) throw new RoadmapError(`Roadmap item not found: ${rid}`, 404)\n const raw = await fs.readFile(path.join(root, matches[0]), 'utf8')\n return { item: parseRoadmapFile(matches[0], raw), raw }\n}\n\nfunction sortRoadmap(items: RoadmapItem[]): RoadmapItem[] {\n const num = (id: string) => parseInt(id.slice(1), 10)\n return items.sort((a, b) => a.order - b.order || num(a.id) - num(b.id))\n}\n\n/** A parent must be an existing horizon (parent null) and not the item itself. */\nfunction validateParent(parent: string, selfId: string | null, items: RoadmapItem[]): void {\n if (parent === selfId) throw new RoadmapError('An item cannot be its own parent')\n const p = items.find(i => i.id === parent)\n if (!p) throw new RoadmapError(`Parent not found: ${parent}`)\n if (p.parent !== null) throw new RoadmapError(`Parent ${parent} is not a horizon (max depth is 2)`)\n}\n\nfunction cleanBody(body: unknown): string {\n if (typeof body !== 'string') throw new RoadmapError('body must be a string')\n return body.trim()\n}\n\n// ponytail: in-process mutex serialising all roadmap writes (id allocation, layout merge).\n// Doesn't cover a second VibeDoc process on the same root; add a lockfile if that ever matters.\nlet roadmapLock: Promise<unknown> = Promise.resolve()\nfunction withRoadmapLock<T>(fn: () => Promise<T>): Promise<T> {\n const run = roadmapLock.then(fn, fn)\n roadmapLock = run.catch(() => {})\n return run\n}\n\nfunction formatTasks(tasks: string[]): string {\n return tasks.length > 0 ? tasks.join(', ') : '—'\n}\n\nexport async function listRoadmap(root: string): Promise<{ items: RoadmapItem[]; layout: RoadmapLayout }> {\n const [files, layout] = await Promise.all([readRoadmapFiles(root), readRoadmapLayout(root)])\n return { items: sortRoadmap(files.map(f => f.item)), layout }\n}\n\nexport async function getRoadmapItem(id: string, root: string): Promise<RoadmapItem> {\n return (await findRoadmapFile(id, root)).item\n}\n\nexport function createRoadmapItem(\n params: CreateRoadmapItemParams, root: string, actor: 'ai' | 'human' = 'human'\n): Promise<RoadmapItem> {\n return withRoadmapLock(() => createRoadmapItemUnlocked(params ?? ({} as CreateRoadmapItemParams), root, actor))\n}\n\nconst roadmapId = (n: number) => `R${String(n).padStart(3, '0')}`\n\n/** Write a new R*.md (flag 'wx': never overwrites). Callers validate fields and mkdir first. */\nasync function writeRoadmapFile(root: string, f: Omit<RoadmapItem, 'file'>): Promise<void> {\n const slug = f.title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').slice(0, 40)\n const filename = slug ? `${f.id}-${slug}.md` : `${f.id}.md`\n const lines = [\n `# ${f.id}: ${f.title}`,\n ...(f.parent ? [`**Parent:** ${f.parent}`] : []),\n `**Status:** ${f.status}`,\n `**Order:** ${f.order}`,\n `**Tasks:** ${formatTasks(f.tasks)}`,\n ...(f.due ? [`**Due:** ${f.due}`] : []),\n '',\n ]\n const content = lines.join('\\n') + (f.body ? `\\n${f.body}\\n` : '')\n await fs.writeFile(path.join(root, ROADMAP_DIR, filename), content, { flag: 'wx', encoding: 'utf8' })\n}\n\n/** Where \"Generate roadmap\" would take its content from: ROADMAP.md, then tasks, then a starter. */\nexport async function detectRoadmapSource(root: string): Promise<RoadmapSource> {\n return (await roadmapDrafts(root)).source\n}\n\nasync function roadmapDrafts(root: string): Promise<{ source: RoadmapSource; drafts: RoadmapDraft[] }> {\n try {\n const drafts = roadmapFromMarkdown(await fs.readFile(path.join(root, 'ROADMAP.md'), 'utf8'))\n if (drafts.length > 0) return { source: 'roadmap-md', drafts }\n } catch {\n // no ROADMAP.md — fall through\n }\n const { tasks } = await listTasks(root)\n const fromTasks = roadmapFromTasks(tasks)\n if (fromTasks.length > 0) return { source: 'tasks', drafts: fromTasks }\n return { source: 'starter', drafts: starterRoadmap() }\n}\n\n/**\n * Build plans/roadmap/ for a project that has none. Never touches ROADMAP.md or tasks.\n * Refuses when any R*.md exists. One activity entry for the whole generation.\n */\nexport function generateRoadmap(\n root: string, actor: 'ai' | 'human' = 'human'\n): Promise<{ items: RoadmapItem[]; source: RoadmapSource }> {\n return withRoadmapLock(async () => {\n if ((await readRoadmapFiles(root)).length > 0) throw new RoadmapError('Roadmap already exists')\n const { source, drafts } = await roadmapDrafts(root)\n\n const ids = new Map(drafts.map((d, i) => [d.key, roadmapId(i + 1)]))\n const siblingCount = new Map<string | null, number>()\n await fs.mkdir(path.join(root, ROADMAP_DIR), { recursive: true })\n for (const d of drafts) {\n const n = (siblingCount.get(d.parent) ?? 0) + 1\n siblingCount.set(d.parent, n)\n await writeRoadmapFile(root, {\n id: ids.get(d.key) as string,\n title: d.title,\n parent: d.parent === null ? null : (ids.get(d.parent) ?? null),\n status: d.status,\n order: n * 10,\n tasks: d.tasks,\n due: null,\n body: d.body,\n })\n }\n\n await appendActivity(root, {\n type: 'roadmap_updated', actor,\n title: `Roadmap generated (${drafts.length} items)`,\n detail: `from ${source}`,\n })\n const { items } = await listRoadmap(root)\n return { items, source }\n })\n}\n\nasync function createRoadmapItemUnlocked(\n params: CreateRoadmapItemParams, root: string, actor: 'ai' | 'human'\n): Promise<RoadmapItem> {\n const title = cleanTitle(params.title)\n const status = params.status === undefined ? 'planned' : parseRoadmapStatus(params.status)\n const tasks = params.tasks === undefined ? [] : parseTaskIds(params.tasks)\n const body = params.body === undefined ? '' : cleanBody(params.body)\n const due = params.due === undefined ? null : cleanDue(params.due)\n const items = (await readRoadmapFiles(root)).map(f => f.item)\n\n const parent = params.parent == null || params.parent === '' ? null : normalizeRoadmapId(params.parent)\n if (parent) validateParent(parent, null, items)\n\n const siblingOrders = items.filter(i => i.parent === parent).map(i => i.order)\n const order = params.order === undefined\n ? (siblingOrders.length > 0 ? Math.max(...siblingOrders) : 0) + 10\n : cleanOrder(params.order)\n\n const nums = items.map(i => parseInt(i.id.slice(1), 10)).filter(n => !isNaN(n))\n const id = roadmapId(nums.length > 0 ? Math.max(...nums) + 1 : 1)\n\n await fs.mkdir(path.join(root, ROADMAP_DIR), { recursive: true })\n await writeRoadmapFile(root, { id, title, parent, status, order, tasks, due, body })\n\n await appendActivity(root, { type: 'roadmap_updated', actor, title: `${id} created`, detail: title })\n return getRoadmapItem(id, root)\n}\n\nexport function updateRoadmapItem(\n id: string, patch: UpdateRoadmapItemPatch, root: string, actor: 'ai' | 'human' = 'human'\n): Promise<RoadmapItem> {\n return withRoadmapLock(() => updateRoadmapItemUnlocked(id, patch, root, actor))\n}\n\nasync function updateRoadmapItemUnlocked(\n id: string, patch: UpdateRoadmapItemPatch, root: string, actor: 'ai' | 'human'\n): Promise<RoadmapItem> {\n const { item, raw } = await findRoadmapFile(id, root)\n const p = patch ?? {}\n\n // Validate everything before touching the file.\n const title = p.title === undefined ? undefined : cleanTitle(p.title)\n const status = p.status === undefined ? undefined : parseRoadmapStatus(p.status)\n const order = p.order === undefined ? undefined : cleanOrder(p.order)\n const tasks = p.tasks === undefined ? undefined : parseTaskIds(p.tasks)\n const body = p.body === undefined ? undefined : cleanBody(p.body)\n const due = p.due === undefined ? undefined : cleanDue(p.due)\n let parent: string | null | undefined\n if (p.parent !== undefined) {\n parent = p.parent === null || p.parent === '' ? null : normalizeRoadmapId(p.parent)\n if (parent !== null) {\n const items = (await readRoadmapFiles(root)).map(f => f.item)\n validateParent(parent, item.id, items)\n if (items.some(i => i.parent === item.id)) {\n throw new RoadmapError(`${item.id} has children and cannot be given a parent`)\n }\n }\n }\n\n const lines = raw.split('\\n')\n if (title !== undefined) {\n const h1 = lines.findIndex(l => l.startsWith('# '))\n if (h1 >= 0) lines[h1] = `# ${item.id}: ${title}`\n else lines.unshift(`# ${item.id}: ${title}`)\n }\n\n const end = roadmapMetaEnd(lines)\n const head = lines.slice(0, end)\n let rest = lines.slice(end)\n\n // Replace-or-insert (or remove, for value null) a meta line inside the head block only.\n const setMeta = (key: string, value: string | null) => {\n const idx = head.findIndex(l => l.match(META_LINE)?.[1].trim().toLowerCase() === key.toLowerCase())\n if (value === null) { if (idx >= 0) head.splice(idx, 1); return }\n const line = `**${key}:** ${value}`\n if (idx >= 0) head[idx] = line\n else head.push(line)\n }\n\n if (parent !== undefined) setMeta('Parent', parent)\n if (status !== undefined) setMeta('Status', status)\n if (order !== undefined) setMeta('Order', String(order))\n if (tasks !== undefined) setMeta('Tasks', formatTasks(tasks))\n if (due !== undefined) setMeta('Due', due)\n if (body !== undefined) {\n rest = body ? ['', body, ''] : ['']\n }\n\n await fs.writeFile(path.join(root, item.file), [...head, ...rest].join('\\n'), 'utf8')\n const updated = await getRoadmapItem(item.id, root)\n await appendActivity(root, { type: 'roadmap_updated', actor, title: `${item.id} updated`, detail: updated.title })\n return updated\n}\n\nexport function deleteRoadmapItem(id: string, root: string, actor: 'ai' | 'human' = 'human'): Promise<void> {\n return withRoadmapLock(() => deleteRoadmapItemUnlocked(id, root, actor))\n}\n\nasync function deleteRoadmapItemUnlocked(id: string, root: string, actor: 'ai' | 'human'): Promise<void> {\n const { item } = await findRoadmapFile(id, root)\n const items = (await readRoadmapFiles(root)).map(f => f.item)\n const children = items.filter(i => i.parent === item.id).map(i => i.id)\n if (children.length > 0) {\n throw new RoadmapError(`${item.id} still has children (${children.join(', ')}); move or delete them first`)\n }\n await fs.unlink(path.join(root, item.file))\n // Prune now so a later create reusing this id doesn't inherit the old position.\n await writeRoadmapLayoutUnlocked({}, root)\n await appendActivity(root, { type: 'roadmap_updated', actor, title: `${item.id} deleted`, detail: item.title })\n}\n\nexport async function readRoadmapLayout(root: string): Promise<RoadmapLayout> {\n try {\n const parsed = JSON.parse(await fs.readFile(path.join(root, ROADMAP_LAYOUT), 'utf8'))\n if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return {}\n const out: RoadmapLayout = {}\n for (const [k, v] of Object.entries(parsed as Record<string, { x?: unknown; y?: unknown }>)) {\n if (v && Number.isFinite(v.x) && Number.isFinite(v.y)) out[k] = { x: v.x as number, y: v.y as number }\n }\n return out\n } catch {\n return {}\n }\n}\n\n/** Merge `positions` into layout.json and drop ids with no matching R*.md. Returns the saved layout. */\nexport function writeRoadmapLayout(positions: RoadmapLayout, root: string): Promise<RoadmapLayout> {\n return withRoadmapLock(() => writeRoadmapLayoutUnlocked(positions, root))\n}\n\nasync function writeRoadmapLayoutUnlocked(positions: RoadmapLayout, root: string): Promise<RoadmapLayout> {\n const clean: RoadmapLayout = {}\n for (const [k, v] of Object.entries(positions ?? {})) {\n const key = k.trim().toUpperCase()\n const ok = /^R\\d+$/.test(key) && v && typeof v === 'object'\n && typeof v.x === 'number' && typeof v.y === 'number' && Number.isFinite(v.x) && Number.isFinite(v.y)\n if (!ok) throw new RoadmapError(`Invalid position for ${k}`)\n clean[key] = { x: v.x, y: v.y }\n }\n const merged = { ...(await readRoadmapLayout(root)), ...clean }\n\n const existing = new Set((await readRoadmapFiles(root)).map(f => f.item.id))\n const layout: RoadmapLayout = {}\n for (const key of Object.keys(merged).sort()) {\n if (existing.has(key)) layout[key] = merged[key]\n }\n\n await fs.mkdir(path.join(root, ROADMAP_DIR), { recursive: true })\n await fs.writeFile(path.join(root, ROADMAP_LAYOUT), JSON.stringify(layout, null, 2) + '\\n', 'utf8')\n return layout\n}\n\n// ─── Planning skills ──────────────────────────────────────────────────────────\n\nconst PLANNING_SKILLS = { roadmap: 'roadmap-planner', breakdown: 'epic-breakdown' } as const\nexport type PlanningKind = keyof typeof PLANNING_SKILLS\n\n/** Bundled skill body (frontmatter stripped). Read from the VibeDoc package (cwd), not the target project. */\nexport async function readPlanningSkill(kind: PlanningKind): Promise<string> {\n if (!Object.hasOwn(PLANNING_SKILLS, kind)) throw new Error(`Unknown planning kind \"${kind}\" (expected: ${Object.keys(PLANNING_SKILLS).join(', ')})`)\n const text = await fs.readFile(path.join(process.cwd(), 'skills', PLANNING_SKILLS[kind], 'SKILL.md'), 'utf-8')\n return text.replace(/^---\\r?\\n[\\s\\S]*?\\r?\\n---\\r?\\n/, '').trimStart()\n}\n","// Pure plan model for \"plan from the chat\": the agent proposes, the user reviews, the server applies.\n// No fs here; core.applyPlan() does the writing. Self-check: node src/lib/plan.check.mts\nimport type { RoadmapItem, RoadmapStatus } from './core'\n\nexport interface PlanTask {\n key: string // stable within the plan, e.g. \"t1\"; becomes a T id on apply\n title: string\n size?: string // \"S (~1 hr)\" | \"M (2–3 hrs)\" | \"L (half day)\"\n dependsOn?: string[] // keys in this plan, or existing task ids (\"T030\")\n due?: string // YYYY-MM-DD\n body: string // full markdown below the meta block: Goal, Context, Scope, Files, …\n}\nexport interface PlanHorizon { key: string; title: string; body?: string }\nexport interface PlanEpic { key: string; title: string; parent: string; status?: RoadmapStatus; body: string } // parent: existing horizon id or a horizon key\nexport type Plan =\n | { kind: 'breakdown'; epic: string; tasks: PlanTask[] }\n | { kind: 'roadmap'; horizons: PlanHorizon[]; epics: PlanEpic[] }\n\nexport interface PlanContext { roadmap: RoadmapItem[]; taskIds: string[] }\n\n/** A real calendar date \"YYYY-MM-DD\" (rejects 2026-02-30), else null. Same rule as core's parseDue. */\nfunction isDate(raw: string): boolean {\n const m = raw.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/)\n if (!m) return false\n return new Date(Date.UTC(+m[1], +m[2] - 1, +m[3])).toISOString().slice(0, 10) === raw\n}\n\nconst isObj = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object' && !Array.isArray(v)\nconst str = (v: unknown) => (typeof v === 'string' ? v.trim() : '')\n\n/**\n * Just enough shape for the chat UI to render a proposal before the server has validated it\n * (the tool_use streams in before its tool_result). Returns null for anything a card can't draw.\n */\nexport function asRenderablePlan(p: unknown): Plan | null {\n if (!isObj(p)) return null\n const items = (v: unknown, need: string[]) => Array.isArray(v) && v.every(x =>\n isObj(x) && need.every(k => typeof x[k] === 'string') && (x.dependsOn === undefined || Array.isArray(x.dependsOn)))\n if (p.kind === 'breakdown') {\n return typeof p.epic === 'string' && items(p.tasks, ['key', 'title']) && (p.tasks as unknown[]).length > 0\n ? (p as unknown as Plan) : null\n }\n if (p.kind === 'roadmap') {\n const horizons = p.horizons ?? [], epics = p.epics ?? []\n return items(horizons, ['key', 'title']) && items(epics, ['key', 'title', 'parent'])\n ? ({ kind: 'roadmap', horizons, epics } as Plan) : null\n }\n return null\n}\n\n/** Every problem with the plan against the current files; [] = valid. */\nexport function validatePlan(plan: unknown, ctx: PlanContext): string[] {\n if (!isObj(plan)) return ['plan must be an object']\n if (plan.kind === 'roadmap') return validateRoadmapPlan(plan, ctx)\n if (plan.kind !== 'breakdown') return [`plan.kind must be \"breakdown\" or \"roadmap\" (got ${JSON.stringify(plan.kind)})`]\n\n const errors: string[] = []\n const epicId = str(plan.epic).toUpperCase()\n const epic = ctx.roadmap.find(i => i.id === epicId)\n if (!epic) errors.push(`Epic ${JSON.stringify(plan.epic)} not found`)\n else if (!epic.parent) errors.push(`${epic.id} is a horizon, not an epic; pass an epic id`)\n\n if (!Array.isArray(plan.tasks) || plan.tasks.length === 0) {\n errors.push('tasks must be a non-empty array')\n return errors\n }\n const tasks = plan.tasks as unknown[]\n const existing = new Set(ctx.taskIds.map(t => t.toUpperCase()))\n\n const index = new Map<string, number>()\n tasks.forEach((t, i) => {\n const key = isObj(t) ? str(t.key) : ''\n if (!key) errors.push(`task #${i + 1}: key is required`)\n else if (index.has(key)) errors.push(`duplicate key \"${key}\"`)\n else index.set(key, i)\n })\n\n const deps = new Map<string, string[]>() // key → plan keys it depends on\n tasks.forEach((t, i) => {\n if (!isObj(t)) { errors.push(`task #${i + 1} must be an object`); return }\n const label = str(t.key) || `task #${i + 1}`\n if (!str(t.title)) errors.push(`${label}: title is required`)\n if (typeof t.body !== 'string') errors.push(`${label}: body must be a markdown string`)\n if (t.size !== undefined && typeof t.size !== 'string') errors.push(`${label}: size must be a string`)\n if (t.due !== undefined && !(typeof t.due === 'string' && isDate(t.due))) {\n errors.push(`${label}: due must be a date YYYY-MM-DD (got ${JSON.stringify(t.due)})`)\n }\n if (t.dependsOn === undefined) return\n if (!Array.isArray(t.dependsOn)) { errors.push(`${label}: dependsOn must be an array`); return }\n const own: string[] = []\n for (const d of t.dependsOn) {\n const dep = str(d)\n if (index.has(dep)) own.push(dep)\n else if (!existing.has(dep.toUpperCase())) {\n errors.push(`${label}: dependsOn \"${String(d)}\" is neither a key in this plan nor an existing task`)\n }\n }\n if (str(t.key)) deps.set(str(t.key), own)\n })\n\n // Cycles (DFS, report each once), then forward references: apply creates in order,\n // so a dependency must come earlier in the list to already have its T id.\n const state = new Map<string, 'open' | 'done'>()\n const cyclic = new Set<string>()\n const visit = (k: string, stack: string[]) => {\n if (state.get(k) === 'done') return\n if (state.get(k) === 'open') {\n const cycle = [...stack.slice(stack.indexOf(k)), k]\n if (!cycle.some(c => cyclic.has(c))) errors.push(`dependency cycle: ${cycle.join(' → ')}`)\n cycle.forEach(c => cyclic.add(c))\n return\n }\n state.set(k, 'open')\n for (const d of deps.get(k) ?? []) visit(d, [...stack, k])\n state.set(k, 'done')\n }\n for (const k of deps.keys()) visit(k, [])\n for (const [k, ds] of deps) {\n if (cyclic.has(k)) continue\n for (const d of ds) {\n if ((index.get(d) ?? 0) > (index.get(k) ?? 0)) errors.push(`${k} depends on ${d}, which comes later; list ${d} first`)\n }\n }\n return errors\n}\n\nconst STATUSES = ['planned', 'in-progress', 'done']\n\nfunction validateRoadmapPlan(plan: Record<string, unknown>, ctx: PlanContext): string[] {\n const errors: string[] = []\n const horizons = plan.horizons ?? []\n const epics = plan.epics ?? []\n if (!Array.isArray(horizons)) errors.push('horizons must be an array')\n if (!Array.isArray(epics)) errors.push('epics must be an array')\n if (errors.length > 0) return errors\n const hs = horizons as unknown[]\n const es = epics as unknown[]\n if (hs.length + es.length === 0) return ['a roadmap plan needs at least one horizon or epic']\n\n const keys = new Set<string>()\n const horizonKeys = new Set<string>()\n const checkKey = (v: unknown, label: string, isHorizon: boolean) => {\n const key = isObj(v) ? str(v.key) : ''\n if (!key) errors.push(`${label}: key is required`)\n else if (keys.has(key)) errors.push(`duplicate key \"${key}\"`)\n else { keys.add(key); if (isHorizon) horizonKeys.add(key) }\n }\n hs.forEach((h, i) => checkKey(h, `horizon #${i + 1}`, true))\n es.forEach((e, i) => checkKey(e, `epic #${i + 1}`, false))\n\n // Titles are unique per level (spine, or one horizon), against existing items and within the plan.\n const seen = new Map<string, string>() // \"parent\\0title\" → who has it\n for (const i of ctx.roadmap) seen.set(`${i.parent ?? ''}\\0${i.title.trim().toLowerCase()}`, i.id)\n const claimTitle = (parent: string, title: string, label: string) => {\n const k = `${parent}\\0${title.toLowerCase()}`\n const other = seen.get(k)\n if (other) errors.push(`${label}: \"${title}\" already exists ${parent ? `under ${parent}` : 'as a horizon'} (${other})`)\n else seen.set(k, label)\n }\n\n hs.forEach((h, i) => {\n if (!isObj(h)) { errors.push(`horizon #${i + 1} must be an object`); return }\n const label = str(h.key) || `horizon #${i + 1}`\n const title = str(h.title)\n if (!title) errors.push(`${label}: title is required`)\n else claimTitle('', title, label)\n if (h.body !== undefined && typeof h.body !== 'string') errors.push(`${label}: body must be a markdown string`)\n })\n\n es.forEach((e, i) => {\n if (!isObj(e)) { errors.push(`epic #${i + 1} must be an object`); return }\n const label = str(e.key) || `epic #${i + 1}`\n const title = str(e.title)\n if (!title) errors.push(`${label}: title is required`)\n if (typeof e.body !== 'string') errors.push(`${label}: body must be a markdown string`)\n if (e.status !== undefined && !STATUSES.includes(e.status as string)) {\n errors.push(`${label}: status must be one of ${STATUSES.join(', ')} (got ${JSON.stringify(e.status)})`)\n }\n const parent = str(e.parent)\n let parentId = ''\n if (!parent) errors.push(`${label}: parent is required (an existing horizon id or a horizon key in this plan)`)\n else if (horizonKeys.has(parent)) parentId = parent\n else if (keys.has(parent)) errors.push(`${label}: parent \"${parent}\" is an epic in this plan; an epic's parent must be a horizon`)\n else {\n const p = ctx.roadmap.find(r => r.id === parent.toUpperCase())\n if (!p) errors.push(`${label}: parent \"${parent}\" is neither a horizon key in this plan nor an existing roadmap item`)\n else if (p.parent !== null) errors.push(`${label}: parent ${p.id} is an epic, not a horizon (max depth is 2)`)\n else parentId = p.id\n }\n if (title && parentId) claimTitle(parentId, title, label)\n })\n return errors\n}\n\n/** Keep only the selected items. A kept item depending on an unchecked one is an error. */\nexport function selectPlan(plan: Plan, selected: string[]): { plan: Plan; errors: string[] } {\n if (plan.kind === 'roadmap') return selectRoadmapPlan(plan, selected)\n const errors: string[] = []\n // Trim like validatePlan/applyPlan do, or \" t1 \" vs \"t1\" slips past the unchecked-dependency check\n const keys = new Set(plan.tasks.map(t => t.key.trim()))\n const sel = new Set(selected.map(k => k.trim()))\n for (const k of sel) if (!keys.has(k)) errors.push(`unknown key \"${k}\"`)\n const tasks = plan.tasks.filter(t => sel.has(t.key.trim()))\n if (tasks.length === 0) errors.push('nothing selected')\n for (const t of tasks) {\n for (const d of (t.dependsOn ?? []).map(d => d.trim())) {\n if (keys.has(d) && !sel.has(d)) errors.push(`${t.key.trim()} depends on ${d}, which you unchecked`)\n }\n }\n return { plan: { ...plan, tasks }, errors }\n}\n\nfunction selectRoadmapPlan(plan: Extract<Plan, { kind: 'roadmap' }>, selected: string[]): { plan: Plan; errors: string[] } {\n const errors: string[] = []\n const horizons = plan.horizons ?? []\n const epics = plan.epics ?? []\n const hKeys = new Set(horizons.map(h => h.key))\n const keys = new Set([...hKeys, ...epics.map(e => e.key)])\n const sel = new Set(selected)\n for (const k of sel) if (!keys.has(k)) errors.push(`unknown key \"${k}\"`)\n const keptH = horizons.filter(h => sel.has(h.key))\n const keptE = epics.filter(e => sel.has(e.key))\n if (keptH.length + keptE.length === 0) errors.push('nothing selected')\n for (const e of keptE) {\n const p = e.parent.trim()\n if (hKeys.has(p) && !sel.has(p)) errors.push(`${e.key} is under ${p}, which you unchecked; check ${p} or uncheck ${e.key}`)\n }\n return { plan: { ...plan, horizons: keptH, epics: keptE }, errors }\n}\n","/**\n * src/lib/sessions.ts\n * Pure grouping of the activity log into agent/human sessions (no fs). Used by /api/sessions and /api/mcp.\n * Stamped events group by `sessionId`; legacy events (no sessionId) split on a per-actor idle gap or `session_start`.\n */\nimport type { ActivityEvent, TaskStatus } from './core'\n\nexport const SESSION_GAP_MS = 30 * 60 * 1000\n\nexport interface Session {\n id: string\n actor: ActivityEvent['actor']\n start: string\n end: string\n eventCount: number\n eventIds: string[]\n tasks: { id: string; lastStatus: TaskStatus }[]\n docs: string[]\n decisions: string[]\n memoryUpdated: boolean\n headline: string\n}\n\n// Doc path a change event carries; null for events that don't change a doc (doc_read included).\nfunction changedDoc(e: ActivityEvent): string | null {\n switch (e.type) {\n case 'doc_created': return e.detail ?? e.title.replace(/^Created: /, '')\n case 'doc_deleted': return e.title.replace(/^Deleted /, '')\n case 'doc_renamed': return e.title.split(' → ')[1] ?? null\n default: return null\n }\n}\n\nconst plural = (n: number, word: string) => `${n} ${word}${n === 1 ? '' : 's'}`\n\nfunction summarize(id: string, events: ActivityEvent[]): Session {\n const tasks = new Map<string, TaskStatus>()\n const docs = new Set<string>()\n const decisions: string[] = []\n let memoryUpdated = false\n let roadmapEdits = 0\n for (const e of events) {\n if (e.type === 'task_updated' && e.taskId && e.taskStatus) tasks.set(e.taskId, e.taskStatus)\n const doc = changedDoc(e)\n if (doc) docs.add(doc)\n if (e.type === 'decision_logged') decisions.push(e.title)\n if (e.type === 'memory_updated') memoryUpdated = true\n if (e.type === 'roadmap_updated') roadmapEdits++\n }\n const taskList = [...tasks].map(([tid, lastStatus]) => ({ id: tid, lastStatus }))\n const done = taskList.filter(t => t.lastStatus === 'done').length\n const parts = [\n taskList.length ? `${plural(taskList.length, 'task')} moved${done ? ` (${done} done)` : ''}` : '',\n docs.size ? `${plural(docs.size, 'doc')} changed` : '',\n decisions.length ? plural(decisions.length, 'ADR') : '',\n roadmapEdits ? plural(roadmapEdits, 'roadmap edit') : '',\n memoryUpdated ? 'memory updated' : '',\n ].filter(Boolean)\n return {\n id,\n actor: events[0].actor,\n start: events[0].timestamp,\n end: events[events.length - 1].timestamp,\n eventCount: events.length,\n eventIds: events.map(e => e.id),\n tasks: taskList,\n docs: [...docs],\n decisions,\n memoryUpdated,\n headline: parts.join(' · ') || plural(events.length, 'event'),\n }\n}\n\n/** Events may come in any order (the log is newest-first). Returns sessions newest first. */\nexport function groupSessions(events: ActivityEvent[], opts: { gapMs?: number } = {}): Session[] {\n const gapMs = opts.gapMs ?? SESSION_GAP_MS\n const chrono = [...events].sort((a, b) => a.timestamp.localeCompare(b.timestamp))\n const groups = new Map<string, ActivityEvent[]>()\n const legacy = new Map<string, { id: string; lastAt: number }>() // per actor\n for (const e of chrono) {\n let id = e.sessionId\n if (!id) {\n const at = Date.parse(e.timestamp)\n let cur = legacy.get(e.actor)\n if (!cur || e.type === 'session_start' || at - cur.lastAt > gapMs) {\n cur = { id: `legacy_${e.id}`, lastAt: at }\n legacy.set(e.actor, cur)\n }\n cur.lastAt = at\n id = cur.id\n }\n const g = groups.get(id)\n if (g) g.push(e)\n else groups.set(id, [e])\n }\n return [...groups]\n .map(([id, evs]) => summarize(id, evs))\n .sort((a, b) => b.start.localeCompare(a.start))\n}\n\nexport function sessionDuration(s: Pick<Session, 'start' | 'end'>): string {\n const min = Math.round((Date.parse(s.end) - Date.parse(s.start)) / 60_000)\n if (min < 1) return '<1m'\n return min < 60 ? `${min}m` : `${Math.floor(min / 60)}h ${min % 60}m`\n}\n\n/** A session still receiving events (last one within `windowMs`). */\nexport function isLive(s: Pick<Session, 'end'>, now = Date.now(), windowMs = 5 * 60 * 1000): boolean {\n return now - Date.parse(s.end) < windowMs\n}\n\n/** Totals for the \"catch up\" strip: sessions that ended at or after `sinceMs`. */\nexport function catchUp(sessions: Session[], sinceMs: number) {\n const recent = sessions.filter(s => Date.parse(s.end) >= sinceMs)\n return {\n sessions: recent.length,\n tasksDone: new Set(recent.flatMap(s => s.tasks.filter(t => t.lastStatus === 'done').map(t => t.id))).size,\n docs: new Set(recent.flatMap(s => s.docs)).size,\n decisions: recent.reduce((n, s) => n + s.decisions.length, 0),\n }\n}\n\nexport function sessionsForTask(sessions: Session[], taskId: string): Session[] {\n return sessions.filter(s => s.tasks.some(t => t.id === taskId))\n}\n"],"names":["lineDiff","before","after","a","split","b","start","length","endA","endB","x","slice","y","lcs","Array","from","fill","i","j","Math","max","middle","push","op","text","map","applyEdits","edits","content","e","entries","old_string","new_string","error","at","indexOf","SHIPPED","MAX_TITLE","plain","s","replace","trim","clip","trimEnd","rollUp","statuses","every","some","roadmapFromMarkdown","md","out","horizon","intro","feature","kids","closeHorizon","body","join","own","filter","d","parent","key","status","splice","line","h2","match","title","test","tasks","bullet","named","toLowerCase","cont","Boolean","phaseRank","p","n","parseFloat","Number","isFinite","Infinity","roadmapFromTasks","groups","Map","t","phase","set","get","phases","keys","sort","localeCompare","features","id","f","starterRoadmap","h","depIds","dependsOn","Set","toUpperCase","settled","pickNextTask","epic","byId","linked","unmet","dep","kind","taskId","inEpic","memo","canMove","has","ok","waiting","reason","deps","needsHuman","w","STATUS_ICONS","STATUS_ALIASES","ready","planned","wip","doing","active","started","complete","completed","finished","finish","block","cancel","skip","normalizeStatus","raw","findRoot","startDir","process","cwd","dir","resolve","marker","access","dirname","getConfiguredRoot","env","VIBEDOC_ROOT","discoverProjects","searchBase","base","projects","readdir","withFileTypes","entry","isDirectory","name","hasVibedoc","root","basename","existingIdx","findIndex","existing","unshift","listDocs","files","ignore","nodir","path","section","inferSection","includes","startsWith","readDoc","query","candidates","c","readFile","relative","pattern","matches","nocase","Error","writeDoc","docPath","resolvedRoot","fullPath","sep","mkdir","recursive","writeFile","editDoc","dryRun","catch","code","result","getContext","paths","parts","createDoc","err","nodeErr","appendActivity","type","actor","detail","exists","readRegistry","rebuildRegistry","searchDocs","qLower","results","lines","hits","file","totalHits","parseTaskFile","filePath","filename","titleLine","find","l","meta","roadmapMetaEnd","m","rawStatus","idM","size","due","parseDue","listTasks","board","todo","blocked","done","cancelled","col","getTask","updateTaskStatus","newStatus","task","previousStatus","icon","statusPattern","capitalize","taskStatus","taskClaimLock","Promise","withTaskClaimLock","fn","run","then","claimNextTask","epicId","getRoadmapItem","createTask","params","createTaskUnlocked","ids","parseInt","isNaN","nextNum","String","padStart","slug","tasksDir","RoadmapError","JSON","stringify","undefined","description","flag","encoding","checkPlan","plan","selected","items","taskIds","errors","roadmap","isArray","sel","selErrors","applyPlan","withRoadmapLock","all","readRoadmapFiles","item","created","horizons","createRoadmapItemUnlocked","epics","listRoadmap","fresh","updated","updateRoadmapItem","charAt","logDecision","context","decision","rationale","alternatives","consequences","nums","numStr","today","Date","toISOString","altsTable","option","indexPath","idx","adrNumber","readMemory","updateMemory","currentState","justCompleted","workingOn","upNext","issues","decisions","techDebt","handoff","now","time","toLocaleTimeString","hour","minute","issue","severity","ACTIVITY_FILE","ACTIVITY_CAP","DESCRIPTIONS_FILE","readDescriptions","parse","writeDescriptions","cache","writeDescriptionEntry","normalizedKey","normalize","_anthropic","getAnthropicClient","default","Anthropic","apiKey","ANTHROPIC_API_KEY","extractDescription","heading","enrichDescription","client","message","messages","create","model","max_tokens","role","textBlock","source","updatedAt","listExplorerFiles","docs","doc","cached","mtime","stat","globalForSessions","globalThis","currentSessions","vibedocSessions","stampSession","event","cur","lastAt","random","toString","full","timestamp","sessionId","events","readActivity","limit","logSessionStart","appendDoc","renameDoc","oldPath","newPath","fullOld","fullNew","rename","copyFile","unlink","deleteDoc","REGISTRY_PATH","ANNOTATIONS_START","ANNOTATIONS_END","buildDocTree","tree","dirs","rendered","renderDir","indent","add","prefix","repeat","childIndent","childPrefix","dirFiles","parseAnnotations","end","rows","row","cols","keywords","savedAnnotations","saved","totalFiles","updateRegistryAnnotation","annotations","newAnnotationsBlock","newContent","findBacklinks","targetPath","normalTarget","forEach","getProjectSummary","memory","activity","total","ROADMAP_DIR","ROADMAP_LAYOUT","ROADMAP_STATUSES","META_LINE","normalizeRoadmapId","roadmapIdOf","parseRoadmapStatus","parseTaskIds","cleanTitle","UTC","cleanDue","cleanOrder","order","parseRoadmapFile","metaEnd","min","rawParent","findRoadmapFile","rid","sortRoadmap","num","validateParent","selfId","cleanBody","roadmapLock","formatTasks","layout","readRoadmapLayout","createRoadmapItem","roadmapId","writeRoadmapFile","detectRoadmapSource","roadmapDrafts","drafts","fromTasks","generateRoadmap","siblingCount","siblingOrders","patch","updateRoadmapItemUnlocked","h1","head","rest","setMeta","value","deleteRoadmapItem","deleteRoadmapItemUnlocked","children","writeRoadmapLayoutUnlocked","parsed","k","v","Object","writeRoadmapLayout","positions","clean","merged","PLANNING_SKILLS","breakdown","readPlanningSkill","hasOwn","trimStart","isDate","isObj","str","asRenderablePlan","need","validatePlan","ctx","validateRoadmapPlan","index","label","state","cyclic","visit","stack","cycle","ds","STATUSES","hs","es","horizonKeys","checkKey","isHorizon","seen","claimTitle","other","parentId","r","selectPlan","selectRoadmapPlan","hKeys","keptH","keptE","SESSION_GAP_MS","changedDoc","plural","word","summarize","memoryUpdated","roadmapEdits","taskList","tid","lastStatus","eventCount","eventIds","headline","groupSessions","opts","gapMs","chrono","legacy","g","evs","sessionDuration","round","floor","isLive","windowMs","catchUp","sessions","sinceMs","recent","tasksDone","flatMap","reduce","sessionsForTask"],"mappings":"6OA0CO,SAAoBwB,AAAXE,CAAuB,CAAEC,CAAiB,EACxD,IAAIC,EAAUJ,EACd,IAAK,GAAM,CAACP,EAAGY,EAAE,GAAIF,EAAMG,OAAO,GAAI,CACpC,GAA6B,AAAzB,iBAAOD,GAAGE,YAAoD,UAAzB,AAAmC,OAA5BF,GAAGG,WACjD,MAAO,CAAEC,MAAO,CAAC,KAAK,EAAEhB,EAAI,EAAE,2CAA2C,CAAC,AAAC,EAE7E,GAAqB,KAAjBY,EAAEE,UAAU,CAAS,CACvB,GAAgB,KAAZH,EAAgB,MAAO,CAAEK,MAAO,CAAC,KAAK,EAAEhB,EAAI,EAAE,uDAAuD,CAAC,AAAC,EAC3GW,EAAUC,EAAEG,UAAU,CACtB,QACF,CACA,IAAME,EAAKN,EAAQO,OAAO,CAACN,EAAEE,UAAU,EACvC,GAAW,CAAC,IAARG,EAAW,MAAO,CAAED,MAAO,CAAC,KAAK,EAAEhB,EAAI,EAAE,iCAAiC,CAAC,AAAC,EAChF,GAAIW,AAA0C,CAAC,GAAG,GAAtCO,OAAO,CAACN,EAAEE,UAAU,CAAEG,EAAK,GACrC,MAAO,CAAED,MAAO,CAAC,KAAK,EAAEhB,EAAI,EAAE,kEAAkE,CAAC,AAAC,EAEpGW,EAAUA,EAAQjB,KAAK,CAAC,EAAGuB,GAAML,EAAEG,UAAU,CAAGJ,EAAQjB,KAAK,CAACuB,EAAKL,EAAEE,UAAU,CAACxB,MAAM,CACxF,CACA,MAAO,CAAEqB,SAAQ,CACnB,6BC1CA,IAAMQ,EAAU,4CAGhB,SAASE,EAAMC,CAAS,EACtB,OAAOA,EACJC,OAAO,CAAC,yBAA0B,MAAM,AACxCA,OAAO,CAAC,AADwC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MAAO,IACLoB,EACAgH,MAAO8K,CAAM,CAAC,EAAE,CAAC9K,KAAK,CACtBzM,MAAOuX,CAAM,CAAC,EAAE,CAACF,SAAS,CAC1BgC,IAAK9B,CAAM,CAACA,EAAOtX,MAAM,CAAG,EAAE,CAACoX,SAAS,CACxC4J,WAAY1J,EAAOtX,MAAM,CACzBihB,SAAU3J,EAAOpW,GAAG,CAACI,GAAKA,EAAEkE,EAAE,EAC9BzB,MAAO8c,EACPzK,KAAM,IAAIA,EAAK,WACfxC,gBACA+M,EACAO,SAAUhV,EAAMhJ,IAAI,CAAC,QAAUsd,EAAOlJ,EAAOtX,MAAM,CAAE,QACvD,EACF,EAyBkCwF,EAAIic,IACjCpc,IAAI,CAAC,CAACzF,EAAGE,IAAMA,EAAEC,KAAK,CAACuF,aAAa,CAAC1F,EAAEG,KAAK,EACjD,sBAEO,SAAS2hB,AAAgB1f,CAAiC,EAC/D,IAAMuZ,EAAM3a,KAAK+gB,KAAK,CAAC,CAAC7O,KAAK4B,KAAK,CAAC1S,EAAEoX,GAAG,EAAItG,KAAK4B,KAAK,CAAC1S,EAAEjC,MAAK,CAAC,CAAI,YACnE,AAAIwb,EAAM,EAAU,CAAP,KACNA,EAAM,GAAK,CAAA,EAAGA,EAAI,CAAC,CAAC,CAAG,CAAA,EAAG3a,KAAKghB,KAAK,CAACrG,EAAM,IAAI,EAAE,EAAEA,EAAM,GAAG,CAAC,CAAC,AACvE,sBAkBO,SAAS+G,AAAgBN,CAAmB,CAAExb,CAAc,EACjE,OAAOwb,EAAS5e,MAAM,CAACpB,GAAKA,EAAE+B,KAAK,CAACvB,IAAI,CAACuC,GAAKA,EAAES,EAAE,GAAKgB,GACzD"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},120635,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},559043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},915069,e=>e.a(async(t,r)=>{try{var a=e.i(192258),n=e.i(799501),s=t([n]);async function o(e){let t;try{t=await e.json()}catch{throw new n.RoadmapError("Invalid JSON body")}if(!t||"object"!=typeof t||Array.isArray(t))throw new n.RoadmapError("Body must be a JSON object");return t}[n]=s.then?(await s)():s,e.s(["errorResponse",0,function(e){let t=e instanceof n.RoadmapError?e.status:500;return a.NextResponse.json({error:e instanceof Error?e.message:String(e)},{status:t})},"jsonBody",0,o,"rootOf",0,function(e){return e.nextUrl.searchParams.get("root")||(0,n.getConfiguredRoot)()}]),r()}catch(e){r(e)}},!1),235476,e=>e.a(async(t,r)=>{try{var a=e.i(192258),n=e.i(799501),s=e.i(498768),o=e.i(915069),i=t([n,o]);async function l(e){try{let t=await (0,n.generateRoadmap)((0,o.rootOf)(e));return(0,s.emitUpdate)("roadmap_updated",{kind:"generate",source:t.source}),a.NextResponse.json(t,{status:201})}catch(e){return(0,o.errorResponse)(e)}}[n,o]=i.then?(await i)():i,e.s(["POST",0,l]),r()}catch(e){r(e)}},!1),965477,e=>{"use strict";var t=e.i(440807),r=e.i(381144),a=e.i(522639),n=e.i(165892),s=e.i(781831),o=e.i(740095),i=e.i(931106),l=e.i(253258),d=e.i(488026),u=e.i(571998),p=e.i(666314),c=e.i(598783),h=e.i(759703),x=e.i(163677),R=e.i(450859),m=e.i(193695);e.i(582432);var v=e.i(274687);let g=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/roadmap/generate/route",pathname:"/api/roadmap/generate",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/roadmap/generate/route.ts",nextConfigOutput:"",userland:()=>e.r(235476),...{}}),{workAsyncStorage:f,workUnitAsyncStorage:w,serverHooks:y}=g;async function E(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),g.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/roadmap/generate/route";f=f.replace(/\/index$/,"")||"/";let w=await g.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,deploymentId:E,params:C,nextConfig:b,parsedUrl:A,isDraftMode:S,prerenderManifest:T,routerServerContext:q,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,resolvedPathname:j,clientReferenceManifest:O,serverActionsManifest:_}=w,k=(0,i.normalizeAppPath)(f),H=!!(T.dynamicRoutes[k]||T.routes[j]),I=async()=>((null==q?void 0:q.render404)?await q.render404(e,t,A,!1):t.end("This page could not be found"),null);if(H&&!S){let e=!!T.routes[j],t=T.dynamicRoutes[k];if(t&&!1===t.fallback&&!e){if(b.adapterPath)return await I();throw new m.NoFallbackError}}let U=null;!H||g.isDev||S||(U="/index"===(U=j)?"/":U);let M=!0===g.isDev||!H,D=H&&!M;_&&O&&(0,o.setManifestsSingleton)({page:f,clientReferenceManifest:O,serverActionsManifest:_});let B=e.method||"GET",F=(0,s.getTracer)(),K=F.getActiveScopeSpan(),L=!!(null==q?void 0:q.isWrappedByNextServer),$=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await g.getIncrementalCache(e,b,T,$);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:C,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts,useCacheTimeout:b.experimental.useCacheTimeout},cacheComponents:!!b.cacheComponents,validationLevel:b.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:G,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:b.cacheLife,staticPageGenerationTimeout:b.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>g.onRequestError(e,t,a,n,q)},sharedContext:{buildId:y,deploymentId:E}},X=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(X,(0,d.signalFromNodeResponse)(t)),z=async({previousCacheEntry:r})=>{try{if(!$&&N&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await g.handle(W,V);e.fetchMetrics=V.renderOpts.fetchMetrics;let s=V.renderOpts.pendingWaitUntil;s&&a.waitUntil&&(a.waitUntil(s),s=void 0);let o=V.renderOpts.collectedTags;if(!H)return await (0,c.sendResponse)(X,J,n,s),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);o&&(t[R.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,a=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=R.INFINITE_CACHE?!1!==r&&r>0?b.expireTime:void 0:V.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await g.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:N})},!1,q),t}},Z=async(n,o)=>{try{var i,l;let n=await g.handleResponse({req:e,nextConfig:b,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,responseGenerator:z,waitUntil:a.waitUntil,isMinimalMode:$});if(!H)return;if((null==n||null==(i=n.value)?void 0:i.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});$||t.setHeader("x-nextjs-cache",N?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let s=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);$&&H||s.delete(R.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",(0,x.getCacheControlHeader)(n.cacheControl)),await (0,c.sendResponse)(X,J,new Response(n.value.body,{headers:s,status:n.value.status||200}));return}catch(t){if(t instanceof m.NoFallbackError||await g.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:N})},!1,q),H)throw t;await (0,c.sendResponse)(X,J,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:s.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||k,i=`${B} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":i}),n.updateName(i),o&&o!==n&&(o.setAttribute("http.route",a),o.updateName(i))})()}};if(L&&K)await Z(K,void 0);else{let t=F.getActiveScopeSpan();await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${B} ${f}`,kind:s.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},e=>Z(e,t)),void 0,!L)}}e.s(["handler",0,E,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:f,workUnitAsyncStorage:w})},"routeModule",0,g,"serverHooks",0,y,"workAsyncStorage",0,f,"workUnitAsyncStorage",0,w])},498768,e=>{"use strict";class t{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}emit(e){this.listeners.forEach(t=>{try{t(e)}catch{}})}}let r=globalThis,a=r.vibedocBus??(r.vibedocBus=new t);e.s(["bus",0,a,"emitUpdate",0,function(e,t){a.emit({type:e,payload:t,ts:new Date().toISOString()})}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0u2rl0m._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[270406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},918622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},120635,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},324725,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},556704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},559043,(e,r,t)=>{r.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},193695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},81111,(e,r,t)=>{r.exports=e.x("node:stream",()=>require("node:stream"))},814747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},400829,e=>{e.v(r=>Promise.all(["server/chunks/11mp_@anthropic-ai_sdk_05hfnhc._.js","server/chunks/node_modules__pnpm_01mvudn._.js"].map(r=>e.l(r))).then(()=>r(292987)))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0uk0tga._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[270406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},918622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},120635,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},324725,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},556704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},559043,(e,r,t)=>{r.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},193695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},81111,(e,r,t)=>{r.exports=e.x("node:stream",()=>require("node:stream"))},814747,(e,r,t)=>{r.exports=e.x("path",()=>require("path"))},400829,e=>{e.v(r=>Promise.all(["server/chunks/11mp_@anthropic-ai_sdk_1daia98._.js","server/chunks/node_modules__pnpm_01mvudn._.js"].map(r=>e.l(r))).then(()=>r(292987)))},498768,e=>{"use strict";class r{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}emit(e){this.listeners.forEach(r=>{try{r(e)}catch{}})}}let t=globalThis,s=t.vibedocBus??(t.vibedocBus=new r);e.s(["bus",0,s,"emitUpdate",0,function(e,r){s.emit({type:e,payload:r,ts:new Date().toISOString()})}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0v8x64y._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},120635,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},559043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},400829,e=>{e.v(t=>Promise.all(["server/chunks/11mp_@anthropic-ai_sdk_0qyh79u._.js","server/chunks/node_modules__pnpm_01mvudn._.js"].map(t=>e.l(t))).then(()=>t(292987)))},747685,e=>e.a(async(t,r)=>{try{var a=e.i(192258),s=e.i(799501),n=e.i(498768),i=t([s]);async function o(e){let t=e.nextUrl.searchParams.get("root")||(0,s.getConfiguredRoot)(),r=await e.json();if(!r.title?.trim())return a.NextResponse.json({error:"Title is required"},{status:400});try{let e=await (0,s.createTask)(r,t);return(0,n.emitUpdate)("task_created",{task:e}),a.NextResponse.json({task:e},{status:201})}catch(e){return a.NextResponse.json({error:e.message},{status:500})}}[s]=i.then?(await i)():i,e.s(["POST",0,o]),r()}catch(e){r(e)}},!1),4144,e=>{"use strict";var t=e.i(440807),r=e.i(381144),a=e.i(522639),s=e.i(165892),n=e.i(781831),i=e.i(740095),o=e.i(931106),l=e.i(253258),u=e.i(488026),d=e.i(571998),p=e.i(666314),c=e.i(598783),h=e.i(759703),x=e.i(163677),v=e.i(450859),R=e.i(193695);e.i(582432);var m=e.i(274687);let g=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/create/route",pathname:"/api/tasks/create",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/tasks/create/route.ts",nextConfigOutput:"",userland:()=>e.r(747685),...{}}),{workAsyncStorage:f,workUnitAsyncStorage:w,serverHooks:y}=g;async function E(e,t,a){a.requestMeta&&(0,s.setRequestMeta)(e,a.requestMeta),g.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/tasks/create/route";f=f.replace(/\/index$/,"")||"/";let w=await g.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,deploymentId:E,params:C,nextConfig:b,parsedUrl:T,isDraftMode:A,prerenderManifest:_,routerServerContext:q,isOnDemandRevalidate:k,revalidateOnlyGenerated:S,resolvedPathname:P,clientReferenceManifest:j,serverActionsManifest:N}=w,O=(0,o.normalizeAppPath)(f),H=!!(_.dynamicRoutes[O]||_.routes[P]),I=async()=>((null==q?void 0:q.render404)?await q.render404(e,t,T,!1):t.end("This page could not be found"),null);if(H&&!A){let e=!!_.routes[P],t=_.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(b.adapterPath)return await I();throw new R.NoFallbackError}}let U=null;!H||g.isDev||A||(U="/index"===(U=P)?"/":U);let M=!0===g.isDev||!H,D=H&&!M;N&&j&&(0,i.setManifestsSingleton)({page:f,clientReferenceManifest:j,serverActionsManifest:N});let B=e.method||"GET",F=(0,n.getTracer)(),K=F.getActiveScopeSpan(),L=!!(null==q?void 0:q.isWrappedByNextServer),$=!!(0,s.getRequestMeta)(e,"minimalMode"),G=(0,s.getRequestMeta)(e,"incrementalCache")||await g.getIncrementalCache(e,b,_,$);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:C,previewProps:_.preview,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts,useCacheTimeout:b.experimental.useCacheTimeout},cacheComponents:!!b.cacheComponents,validationLevel:b.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:G,hmrRefreshHash:(0,s.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:b.cacheLife,staticPageGenerationTimeout:b.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,s)=>g.onRequestError(e,t,a,s,q)},sharedContext:{buildId:y,deploymentId:E}},X=new l.NodeNextRequest(e),W=new l.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(X,(0,u.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:r})=>{try{if(!$&&k&&S&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await g.handle(z,V);e.fetchMetrics=V.renderOpts.fetchMetrics;let n=V.renderOpts.pendingWaitUntil;n&&a.waitUntil&&(a.waitUntil(n),n=void 0);let i=V.renderOpts.collectedTags;if(!H)return await (0,c.sendResponse)(X,W,s,n),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);i&&(t[v.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,a=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=v.INFINITE_CACHE?!1!==r&&r>0?b.expireTime:void 0:V.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await g.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:k})},!1,q),t}},J=async(s,i)=>{try{var o,l;let s=await g.handleResponse({req:e,nextConfig:b,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:_,isRoutePPREnabled:!1,isOnDemandRevalidate:k,revalidateOnlyGenerated:S,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:$});if(!H)return;if((null==s||null==(o=s.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==s||null==(l=s.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});$||t.setHeader("x-nextjs-cache",k?"REVALIDATED":s.isMiss?"MISS":s.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let n=(0,h.fromNodeOutgoingHttpHeaders)(s.value.headers);$&&H||n.delete(v.NEXT_CACHE_TAGS_HEADER),!s.cacheControl||t.getHeader("Cache-Control")||n.get("Cache-Control")||n.set("Cache-Control",(0,x.getCacheControlHeader)(s.cacheControl)),await (0,c.sendResponse)(X,W,new Response(s.value.body,{headers:n,status:s.value.status||200}));return}catch(t){if(t instanceof R.NoFallbackError||await g.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:k})},!1,q),H)throw t;await (0,c.sendResponse)(X,W,new Response(null,{status:500}));return}finally{(()=>{if(!s)return;let e=t.statusCode;s.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(s.setStatus({code:n.SpanStatusCode.ERROR}),s.setAttribute("error.type",e.toString()));let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||O,o=`${B} ${a}`;s.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),s.updateName(o),i&&i!==s&&(i.setAttribute("http.route",a),i.updateName(o))})()}};if(L&&K)await J(K,void 0);else{let t=F.getActiveScopeSpan();await F.withPropagatedContext(e.headers,()=>F.trace(d.BaseServerSpan.handleRequest,{spanName:`${B} ${f}`,kind:n.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},e=>J(e,t)),void 0,!L)}}e.s(["handler",0,E,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:f,workUnitAsyncStorage:w})},"routeModule",0,g,"serverHooks",0,y,"workAsyncStorage",0,f,"workUnitAsyncStorage",0,w])},498768,e=>{"use strict";class t{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}emit(e){this.listeners.forEach(t=>{try{t(e)}catch{}})}}let r=globalThis,a=r.vibedocBus??(r.vibedocBus=new t);e.s(["bus",0,a,"emitUpdate",0,function(e,t){a.emit({type:e,payload:t,ts:new Date().toISOString()})}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0xqsv4h._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},120635,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},559043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},400829,e=>{e.v(t=>Promise.all(["server/chunks/11mp_@anthropic-ai_sdk_05dmim9._.js","server/chunks/node_modules__pnpm_01mvudn._.js"].map(t=>e.l(t))).then(()=>t(292987)))},650364,e=>e.a(async(t,r)=>{try{var a=e.i(192258),n=e.i(799501),s=t([n]);async function i(){let e=await (0,n.discoverProjects)();return a.NextResponse.json(e)}[n]=s.then?(await s)():s,e.s(["GET",0,i]),r()}catch(e){r(e)}},!1),305065,e=>{"use strict";var t=e.i(440807),r=e.i(381144),a=e.i(522639),n=e.i(165892),s=e.i(781831),i=e.i(740095),o=e.i(931106),l=e.i(253258),d=e.i(488026),u=e.i(571998),p=e.i(666314),c=e.i(598783),h=e.i(759703),x=e.i(163677),v=e.i(450859),R=e.i(193695);e.i(582432);var m=e.i(274687);let g=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/projects/route",pathname:"/api/projects",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/projects/route.ts",nextConfigOutput:"",userland:()=>e.r(650364),...{}}),{workAsyncStorage:f,workUnitAsyncStorage:w,serverHooks:E}=g;async function y(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),g.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/projects/route";f=f.replace(/\/index$/,"")||"/";let w=await g.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:E,deploymentId:y,params:C,nextConfig:A,parsedUrl:T,isDraftMode:_,prerenderManifest:b,routerServerContext:j,isOnDemandRevalidate:q,revalidateOnlyGenerated:P,resolvedPathname:S,clientReferenceManifest:N,serverActionsManifest:k}=w,O=(0,o.normalizeAppPath)(f),H=!!(b.dynamicRoutes[O]||b.routes[S]),I=async()=>((null==j?void 0:j.render404)?await j.render404(e,t,T,!1):t.end("This page could not be found"),null);if(H&&!_){let e=!!b.routes[S],t=b.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(A.adapterPath)return await I();throw new R.NoFallbackError}}let M=null;!H||g.isDev||_||(M="/index"===(M=S)?"/":M);let U=!0===g.isDev||!H,D=H&&!U;k&&N&&(0,i.setManifestsSingleton)({page:f,clientReferenceManifest:N,serverActionsManifest:k});let F=e.method||"GET",K=(0,s.getTracer)(),L=K.getActiveScopeSpan(),$=!!(null==j?void 0:j.isWrappedByNextServer),B=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await g.getIncrementalCache(e,A,b,B);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:C,previewProps:b.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts,useCacheTimeout:A.experimental.useCacheTimeout},cacheComponents:!!A.cacheComponents,validationLevel:A.experimental.instantInsights.validationLevel,supportsDynamicResponse:U,incrementalCache:G,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:A.cacheLife,staticPageGenerationTimeout:A.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>g.onRequestError(e,t,a,n,j)},sharedContext:{buildId:E,deploymentId:y}},X=new l.NodeNextRequest(e),W=new l.NodeNextResponse(t),z=d.NextRequestAdapter.fromNodeNextRequest(X,(0,d.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:r})=>{try{if(!B&&q&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await g.handle(z,V);e.fetchMetrics=V.renderOpts.fetchMetrics;let s=V.renderOpts.pendingWaitUntil;s&&a.waitUntil&&(a.waitUntil(s),s=void 0);let i=V.renderOpts.collectedTags;if(!H)return await (0,c.sendResponse)(X,W,n,s),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);i&&(t[v.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,a=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=v.INFINITE_CACHE?!1!==r&&r>0?A.expireTime:void 0:V.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await g.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:q})},!1,j),t}},J=async(n,i)=>{try{var o,l;let n=await g.handleResponse({req:e,nextConfig:A,cacheKey:M,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:P,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:B});if(!H)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",q?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),_&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let s=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);B&&H||s.delete(v.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",(0,x.getCacheControlHeader)(n.cacheControl)),await (0,c.sendResponse)(X,W,new Response(n.value.body,{headers:s,status:n.value.status||200}));return}catch(t){if(t instanceof R.NoFallbackError||await g.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:q})},!1,j),H)throw t;await (0,c.sendResponse)(X,W,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:s.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let r=K.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||O,o=`${F} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),n.updateName(o),i&&i!==n&&(i.setAttribute("http.route",a),i.updateName(o))})()}};if($&&L)await J(L,void 0);else{let t=K.getActiveScopeSpan();await K.withPropagatedContext(e.headers,()=>K.trace(u.BaseServerSpan.handleRequest,{spanName:`${F} ${f}`,kind:s.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},e=>J(e,t)),void 0,!$)}}e.s(["handler",0,y,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:f,workUnitAsyncStorage:w})},"routeModule",0,g,"serverHooks",0,E,"workAsyncStorage",0,f,"workUnitAsyncStorage",0,w])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0yd6wlm._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},120635,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},559043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},400829,e=>{e.v(t=>Promise.all(["server/chunks/11mp_@anthropic-ai_sdk_0x1yqfb._.js","server/chunks/node_modules__pnpm_01mvudn._.js"].map(t=>e.l(t))).then(()=>t(292987)))},509318,e=>e.a(async(t,r)=>{try{var a=e.i(192258),s=e.i(799501),n=e.i(498768),i=t([s]);async function o(e){try{let t=e.nextUrl.searchParams.get("root")||(0,s.getConfiguredRoot)(),{files:r}=await e.json(),i=[];for(let e of r)if(!e.skipped)try{await (0,s.createDoc)(e.path,e.content,t),(0,n.emitUpdate)("doc_created",{path:e.path}),i.push({path:e.path,success:!0})}catch(t){"EEXIST"===t.code?i.push({path:e.path,success:!1,error:"already exists"}):i.push({path:e.path,success:!1,error:t.message})}return a.NextResponse.json({results:i})}catch(e){return a.NextResponse.json({error:e.message},{status:500})}}[s]=i.then?(await i)():i,e.s(["POST",0,o]),r()}catch(e){r(e)}},!1),683651,e=>{"use strict";var t=e.i(440807),r=e.i(381144),a=e.i(522639),s=e.i(165892),n=e.i(781831),i=e.i(740095),o=e.i(931106),l=e.i(253258),u=e.i(488026),d=e.i(571998),p=e.i(666314),c=e.i(598783),h=e.i(759703),x=e.i(163677),v=e.i(450859),m=e.i(193695);e.i(582432);var R=e.i(274687);let g=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/setup/write/route",pathname:"/api/setup/write",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/setup/write/route.ts",nextConfigOutput:"",userland:()=>e.r(509318),...{}}),{workAsyncStorage:f,workUnitAsyncStorage:w,serverHooks:y}=g;async function E(e,t,a){a.requestMeta&&(0,s.setRequestMeta)(e,a.requestMeta),g.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/setup/write/route";f=f.replace(/\/index$/,"")||"/";let w=await g.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,deploymentId:E,params:C,nextConfig:b,parsedUrl:T,isDraftMode:A,prerenderManifest:_,routerServerContext:S,isOnDemandRevalidate:q,revalidateOnlyGenerated:P,resolvedPathname:j,clientReferenceManifest:N,serverActionsManifest:k}=w,O=(0,o.normalizeAppPath)(f),H=!!(_.dynamicRoutes[O]||_.routes[j]),I=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,T,!1):t.end("This page could not be found"),null);if(H&&!A){let e=!!_.routes[j],t=_.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(b.adapterPath)return await I();throw new m.NoFallbackError}}let U=null;!H||g.isDev||A||(U="/index"===(U=j)?"/":U);let M=!0===g.isDev||!H,D=H&&!M;k&&N&&(0,i.setManifestsSingleton)({page:f,clientReferenceManifest:N,serverActionsManifest:k});let B=e.method||"GET",F=(0,n.getTracer)(),K=F.getActiveScopeSpan(),L=!!(null==S?void 0:S.isWrappedByNextServer),$=!!(0,s.getRequestMeta)(e,"minimalMode"),G=(0,s.getRequestMeta)(e,"incrementalCache")||await g.getIncrementalCache(e,b,_,$);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let X={params:C,previewProps:_.preview,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts,useCacheTimeout:b.experimental.useCacheTimeout},cacheComponents:!!b.cacheComponents,validationLevel:b.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:G,hmrRefreshHash:(0,s.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:b.cacheLife,staticPageGenerationTimeout:b.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,s)=>g.onRequestError(e,t,a,s,S)},sharedContext:{buildId:y,deploymentId:E}},V=new l.NodeNextRequest(e),W=new l.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(V,(0,u.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:r})=>{try{if(!$&&q&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await g.handle(z,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let n=X.renderOpts.pendingWaitUntil;n&&a.waitUntil&&(a.waitUntil(n),n=void 0);let i=X.renderOpts.collectedTags;if(!H)return await (0,c.sendResponse)(V,W,s,n),null;{let e=await s.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(s.headers);i&&(t[v.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,a=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=v.INFINITE_CACHE?!1!==r&&r>0?b.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:R.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await g.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:q})},!1,S),t}},J=async(s,i)=>{try{var o,l;let s=await g.handleResponse({req:e,nextConfig:b,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:_,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:P,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:$});if(!H)return;if((null==s||null==(o=s.value)?void 0:o.kind)!==R.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==s||null==(l=s.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});$||t.setHeader("x-nextjs-cache",q?"REVALIDATED":s.isMiss?"MISS":s.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let n=(0,h.fromNodeOutgoingHttpHeaders)(s.value.headers);$&&H||n.delete(v.NEXT_CACHE_TAGS_HEADER),!s.cacheControl||t.getHeader("Cache-Control")||n.get("Cache-Control")||n.set("Cache-Control",(0,x.getCacheControlHeader)(s.cacheControl)),await (0,c.sendResponse)(V,W,new Response(s.value.body,{headers:n,status:s.value.status||200}));return}catch(t){if(t instanceof m.NoFallbackError||await g.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:q})},!1,S),H)throw t;await (0,c.sendResponse)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!s)return;let e=t.statusCode;s.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(s.setStatus({code:n.SpanStatusCode.ERROR}),s.setAttribute("error.type",e.toString()));let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||O,o=`${B} ${a}`;s.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),s.updateName(o),i&&i!==s&&(i.setAttribute("http.route",a),i.updateName(o))})()}};if(L&&K)await J(K,void 0);else{let t=F.getActiveScopeSpan();await F.withPropagatedContext(e.headers,()=>F.trace(d.BaseServerSpan.handleRequest,{spanName:`${B} ${f}`,kind:n.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},e=>J(e,t)),void 0,!L)}}e.s(["handler",0,E,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:f,workUnitAsyncStorage:w})},"routeModule",0,g,"serverHooks",0,y,"workAsyncStorage",0,f,"workUnitAsyncStorage",0,w])},498768,e=>{"use strict";class t{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}emit(e){this.listeners.forEach(t=>{try{t(e)}catch{}})}}let r=globalThis,a=r.vibedocBus??(r.vibedocBus=new t);e.s(["bus",0,a,"emitUpdate",0,function(e,t){a.emit({type:e,payload:t,ts:new Date().toISOString()})}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0zybyuh._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},120635,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},559043,(e,t,r)=>{t.exports=e.x("next/dist/server/runtime-reacts.external.js",()=>require("next/dist/server/runtime-reacts.external.js"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},669369,e=>e.a(async(t,r)=>{try{var a=e.i(192258),n=e.i(799501),s=e.i(498768),i=e.i(915069),o=t([n,i]);async function l(e){try{let{plan:t,selected:r}=await (0,i.jsonBody)(e),o=(0,i.rootOf)(e),{created:l,epic:d}=await (0,n.applyPlan)(t,r,o);if(d){for(let e of l)(0,s.emitUpdate)("task_created",{task:await (0,n.getTask)(e.id,o)});(0,s.emitUpdate)("roadmap_updated",{kind:"update",id:d.id})}else(0,s.emitUpdate)("roadmap_updated",{kind:"create",ids:l.map(e=>e.id)});return a.NextResponse.json({created:l})}catch(e){return(0,i.errorResponse)(e)}}[n,i]=o.then?(await o)():o,e.s(["POST",0,l]),r()}catch(e){r(e)}},!1),775708,e=>{"use strict";var t=e.i(440807),r=e.i(381144),a=e.i(522639),n=e.i(165892),s=e.i(781831),i=e.i(740095),o=e.i(931106),l=e.i(253258),d=e.i(488026),p=e.i(571998),u=e.i(666314),c=e.i(598783),h=e.i(759703),x=e.i(163677),R=e.i(450859),v=e.i(193695);e.i(582432);var m=e.i(274687);let f=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/plan/apply/route",pathname:"/api/plan/apply",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/plan/apply/route.ts",nextConfigOutput:"",userland:()=>e.r(669369),...{}}),{workAsyncStorage:g,workUnitAsyncStorage:y,serverHooks:w}=f;async function E(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),f.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/plan/apply/route";g=g.replace(/\/index$/,"")||"/";let y=await f.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:w,deploymentId:E,params:C,nextConfig:b,parsedUrl:A,isDraftMode:S,prerenderManifest:T,routerServerContext:q,isOnDemandRevalidate:P,revalidateOnlyGenerated:j,resolvedPathname:N,clientReferenceManifest:O,serverActionsManifest:k}=y,_=(0,o.normalizeAppPath)(g),U=!!(T.dynamicRoutes[_]||T.routes[N]),H=async()=>((null==q?void 0:q.render404)?await q.render404(e,t,A,!1):t.end("This page could not be found"),null);if(U&&!S){let e=!!T.routes[N],t=T.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(b.adapterPath)return await H();throw new v.NoFallbackError}}let I=null;!U||f.isDev||S||(I="/index"===(I=N)?"/":I);let M=!0===f.isDev||!U,D=U&&!M;k&&O&&(0,i.setManifestsSingleton)({page:g,clientReferenceManifest:O,serverActionsManifest:k});let B=e.method||"GET",F=(0,s.getTracer)(),K=F.getActiveScopeSpan(),L=!!(null==q?void 0:q.isWrappedByNextServer),$=!!(0,n.getRequestMeta)(e,"minimalMode"),G=(0,n.getRequestMeta)(e,"incrementalCache")||await f.getIncrementalCache(e,b,T,$);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let V={params:C,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts,useCacheTimeout:b.experimental.useCacheTimeout},cacheComponents:!!b.cacheComponents,validationLevel:b.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:G,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:b.cacheLife,staticPageGenerationTimeout:b.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>f.onRequestError(e,t,a,n,q)},sharedContext:{buildId:w,deploymentId:E}},X=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),W=d.NextRequestAdapter.fromNodeNextRequest(X,(0,d.signalFromNodeResponse)(t)),z=async({previousCacheEntry:r})=>{try{if(!$&&P&&j&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await f.handle(W,V);e.fetchMetrics=V.renderOpts.fetchMetrics;let s=V.renderOpts.pendingWaitUntil;s&&a.waitUntil&&(a.waitUntil(s),s=void 0);let i=V.renderOpts.collectedTags;if(!U)return await (0,c.sendResponse)(X,J,n,s),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);i&&(t[R.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==V.renderOpts.collectedRevalidate&&!(V.renderOpts.collectedRevalidate>=R.INFINITE_CACHE)&&V.renderOpts.collectedRevalidate,a=void 0===V.renderOpts.collectedExpire||V.renderOpts.collectedExpire>=R.INFINITE_CACHE?!1!==r&&r>0?b.expireTime:void 0:V.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await f.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:P})},!1,q),t}},Z=async(n,i)=>{try{var o,l;let n=await f.handleResponse({req:e,nextConfig:b,cacheKey:I,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:j,responseGenerator:z,waitUntil:a.waitUntil,isMinimalMode:$});if(!U)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});$||t.setHeader("x-nextjs-cache",P?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let s=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);$&&U||s.delete(R.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",(0,x.getCacheControlHeader)(n.cacheControl)),await (0,c.sendResponse)(X,J,new Response(n.value.body,{headers:s,status:n.value.status||200}));return}catch(t){if(t instanceof v.NoFallbackError||await f.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:P})},!1,q),U)throw t;await (0,c.sendResponse)(X,J,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:s.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||_,o=`${B} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),n.updateName(o),i&&i!==n&&(i.setAttribute("http.route",a),i.updateName(o))})()}};if(L&&K)await Z(K,void 0);else{let t=F.getActiveScopeSpan();await F.withPropagatedContext(e.headers,()=>F.trace(p.BaseServerSpan.handleRequest,{spanName:`${B} ${g}`,kind:s.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},e=>Z(e,t)),void 0,!L)}}e.s(["handler",0,E,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:g,workUnitAsyncStorage:y})},"routeModule",0,f,"serverHooks",0,w,"workAsyncStorage",0,g,"workUnitAsyncStorage",0,y])},915069,e=>e.a(async(t,r)=>{try{var a=e.i(192258),n=e.i(799501),s=t([n]);async function i(e){let t;try{t=await e.json()}catch{throw new n.RoadmapError("Invalid JSON body")}if(!t||"object"!=typeof t||Array.isArray(t))throw new n.RoadmapError("Body must be a JSON object");return t}[n]=s.then?(await s)():s,e.s(["errorResponse",0,function(e){let t=e instanceof n.RoadmapError?e.status:500;return a.NextResponse.json({error:e instanceof Error?e.message:String(e)},{status:t})},"jsonBody",0,i,"rootOf",0,function(e){return e.nextUrl.searchParams.get("root")||(0,n.getConfiguredRoot)()}]),r()}catch(e){r(e)}},!1),498768,e=>{"use strict";class t{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}emit(e){this.listeners.forEach(t=>{try{t(e)}catch{}})}}let r=globalThis,a=r.vibedocBus??(r.vibedocBus=new t);e.s(["bus",0,a,"emitUpdate",0,function(e,t){a.emit({type:e,payload:t,ts:new Date().toISOString()})}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__134sb3d._.js.map
|