reflex-agent 0.17.1 → 0.18.1
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/app-build-manifest.json +102 -102
- package/.next/app-path-routes-manifest.json +10 -10
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/agents/[agentId]/page.js +1 -1
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/install-archive/route_client-reference-manifest.js +1 -1
- package/.next/server/app/audit/page.js +2 -2
- package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/dispatcher/page.js +1 -1
- package/.next/server/app/dispatcher/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page.js +2 -2
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- 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/roots/[id]/chat/[topicId]/page.js +2 -2
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/memory/page.js +1 -1
- package/.next/server/app/roots/[id]/memory/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/page.js +6 -6
- package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/new/page.js +4 -4
- package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +4 -4
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/file/page.js +2 -2
- package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/page.js +2 -2
- package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
- package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/page.js +2 -2
- package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +10 -10
- package/.next/server/chunks/1358.js +1 -1
- package/.next/server/chunks/1525.js +1 -0
- package/.next/server/chunks/285.js +8 -8
- package/.next/server/chunks/3332.js +1 -1
- package/.next/server/chunks/404.js +3 -0
- package/.next/server/chunks/4578.js +0 -0
- package/.next/server/chunks/4812.js +1 -1
- package/.next/server/chunks/{6370.js → 6217.js} +1 -1
- package/.next/server/chunks/8511.js +0 -0
- package/.next/server/chunks/9098.js +1 -1
- package/.next/server/chunks/{4333.js → 9186.js} +2 -2
- package/.next/server/chunks/9703.js +1 -0
- package/.next/server/chunks/9809.js +1 -1
- package/.next/server/functions-config-manifest.json +4 -4
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +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/4035-c900a19ab709c489.js +1 -0
- package/.next/static/chunks/4108.2a1cd2be227d1db6.js +1 -0
- package/.next/static/chunks/{1140-64068d731caa9e74.js → 5572-cc7066942d006956.js} +1 -1
- package/.next/static/chunks/59-8d4a53ee7c914335.js +1 -0
- package/.next/static/chunks/7343-d414cbf00d7903b3.js +1 -0
- package/.next/static/chunks/8523-ce9e5fd4102e0550.js +1 -0
- package/.next/static/chunks/app/layout-61561440bde8894f.js +1 -0
- package/.next/static/chunks/app/onboarding/page-25b3a1c1da972648.js +1 -0
- package/.next/static/chunks/app/page-a73a8abd219d328f.js +1 -0
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-1c1825c48749b024.js +1 -0
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-aa97c0262e3f3a94.js +1 -0
- package/.next/static/chunks/app/roots/[id]/memory/{page-8a6c36c8f8b18027.js → page-c69f17be3048bdc2.js} +1 -1
- package/.next/static/chunks/app/roots/[id]/page-5385296d9e6fb5bd.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-3d141c8450f93771.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/page-39f9bcc115ebee4b.js +1 -0
- package/.next/static/chunks/app/roots/new/{page-c053590d2d0db45b.js → page-be08d7bdb6d3ec29.js} +1 -1
- package/.next/static/chunks/app/settings/page-1a56d55862b78015.js +1 -0
- package/.next/static/chunks/app/share/[id]/page-4713e54d2c21a7d8.js +1 -0
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-749569080a03f192.js +1 -0
- package/.next/static/chunks/app/utilities/page-7ec6d0962a63b2cf.js +1 -0
- package/.next/static/chunks/{webpack-365da08c2f4d8fd4.js → webpack-648ac9036cb1b816.js} +1 -1
- package/.next/trace +90 -90
- package/package.json +1 -1
- package/.next/server/chunks/2420.js +0 -3
- package/.next/server/chunks/3943.js +0 -1
- package/.next/server/chunks/9840.js +0 -1
- package/.next/static/chunks/1449-6b7d830a92f3f938.js +0 -1
- package/.next/static/chunks/3281-8bd5b627634cdf42.js +0 -1
- package/.next/static/chunks/3680-c10f5bed1e72fdc2.js +0 -1
- package/.next/static/chunks/4108.19c3868f4af2c9f0.js +0 -1
- package/.next/static/chunks/9764-cdf07e52fe3e8237.js +0 -1
- package/.next/static/chunks/app/layout-a9e0a8f5993dd6d9.js +0 -1
- package/.next/static/chunks/app/onboarding/page-6fddd32281064f20.js +0 -1
- package/.next/static/chunks/app/page-04091ddd75f75dbe.js +0 -1
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-4ef3f3e86daba072.js +0 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-e06fed2af2d53515.js +0 -1
- package/.next/static/chunks/app/roots/[id]/page-dc75fd44657768c3.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-4159003e68210618.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/page-45cf79c938c988e5.js +0 -1
- package/.next/static/chunks/app/settings/page-5514c8538063c316.js +0 -1
- package/.next/static/chunks/app/share/[id]/page-f88950f6a8ad9e41.js +0 -1
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-b15dcef01e478b72.js +0 -1
- package/.next/static/chunks/app/utilities/page-bb3e4a011e6bad5c.js +0 -1
- /package/.next/static/{6dGMfpiSfKb8VjYCBSJk6 → wqvqGv9K0VMAHRhcQ6dS5}/_buildManifest.js +0 -0
- /package/.next/static/{6dGMfpiSfKb8VjYCBSJk6 → wqvqGv9K0VMAHRhcQ6dS5}/_ssgManifest.js +0 -0
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
(()=>{var a={};a.id=8138,a.ids=[8138],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},574:(a,b,c)=>{"use strict";c.d(b,{AddUtilityButton:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call AddUtilityButton() from the server but AddUtilityButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/_components/add-utility-button.tsx","AddUtilityButton")},770:(a,b,c)=>{"use strict";c.d(b,{RunInitButton:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call RunInitButton() from the server but RunInitButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/_components/run-init-button.tsx","RunInitButton")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3442:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},4984:a=>{"use strict";a.exports=require("readline")},7206:a=>{"use strict";a.exports=import("execa")},7373:(a,b,c)=>{"use strict";c.d(b,{Dashboard:()=>aB});var d=c(64173),e=c(17240),f=c(71813),g=c(63351),h=c(44052),i=c(20583),j=c(88724),k=c(1056),l=c.n(k),m=c(75430),n=c(62261),o=c(19356),p=c(42382),q=c(31041);function r({rootId:a,activeGoals:b,runningAgents:c}){let e=(0,f.c)("roots"),g=b.length+c.length;return(0,d.jsxs)(q.Zp,{children:[(0,d.jsxs)(q.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,d.jsxs)(q.ZB,{className:"text-sm flex items-center gap-2",children:[(0,d.jsx)(m.A,{className:"h-4 w-4 text-violet-600"}),e("activeGoals.title")]}),g>0&&(0,d.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:g})]}),(0,d.jsxs)(q.Wu,{className:"space-y-2",children:[0===g&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:e("activeGoals.empty")}),b.map(b=>(0,d.jsx)(l(),{href:`/roots/${a}/chat/${b.topicId}`,className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(m.A,{className:"h-3.5 w-3.5 text-violet-600 mt-0.5 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:b.topicTitle}),b.running&&(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin text-violet-600 shrink-0"})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:b.goal}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px] text-muted-foreground",children:[(0,d.jsx)("span",{children:e("activeGoals.iterationLabel",{count:b.goalIterations})}),(0,d.jsx)("span",{children:"\xb7"}),(0,d.jsx)("span",{children:e("activeGoals.updatedLabel",{time:function(a,b){let c=Date.now()-Date.parse(a);if(!Number.isFinite(c)||c<0)return b("activeGoals.justNow");let d=Math.floor(c/6e4);if(d<1)return b("activeGoals.justNow");if(d<60)return b("activeGoals.minutesAgo",{count:d});let e=Math.floor(d/60);return e<24?b("activeGoals.hoursAgo",{count:e}):b("activeGoals.daysAgo",{count:Math.floor(e/24)})}(b.updatedAt,e)})})]})]})]})},b.topicId)),c.map(b=>(0,d.jsx)(l(),{href:`/roots/${a}/chat/${b.topicId}`,className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(o.A,{className:"h-3.5 w-3.5 text-amber-600 mt-0.5 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:b.topicTitle}),(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin text-amber-600 shrink-0"}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e("activeGoals.agentRunning")})]})]})},b.topicId))]})]})}var s=c(74868),t=c(42324),u=c(63387),v=c(33120);function w({rootId:a,items:b}){let c=(0,f.c)("roots");return(0,d.jsxs)(q.Zp,{children:[(0,d.jsxs)(q.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,d.jsxs)(q.ZB,{className:"text-sm flex items-center gap-2",children:[(0,d.jsx)(s.A,{className:"h-4 w-4 text-amber-600"}),c("pendingApprovals.title")]}),b.length>0&&(0,d.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:b.length})]}),(0,d.jsxs)(q.Wu,{className:"space-y-2",children:[0===b.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("pendingApprovals.empty")}),b.map(b=>{var e;return(0,d.jsx)(l(),{href:`/roots/${a}/chat/${b.topicId}`,className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(x,{kind:b.kind}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:b.summary}),(0,d.jsx)(p.E,{variant:"outline",className:"text-[10px] shrink-0",children:"permission"===(e=b.kind)?"permission":"question"===e?"question":"mcp-add"})]}),b.details&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:b.details}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-1",children:["topic ",b.topicId.slice(0,12)," \xb7 ",function(a,b){let c=Date.now()-Date.parse(a);if(!Number.isFinite(c)||c<0)return b("pendingApprovals.justNow");let d=Math.floor(c/6e4);if(d<1)return b("pendingApprovals.justNow");if(d<60)return b("pendingApprovals.minutesAgo",{count:d});let e=Math.floor(d/60);return e<24?b("pendingApprovals.hoursAgo",{count:e}):b("pendingApprovals.daysAgo",{count:Math.floor(e/24)})}(b.ts,c)]})]})]})},`${b.kind}:${b.requestId}`)})]})]})}function x({kind:a}){let b="h-3.5 w-3.5 mt-0.5 shrink-0";return"permission"===a?(0,d.jsx)(t.A,{className:`${b} text-rose-600`}):"question"===a?(0,d.jsx)(u.A,{className:`${b} text-sky-600`}):(0,d.jsx)(v.A,{className:`${b} text-emerald-600`})}var y=c(68669),z=c(3265);function A({rootId:a,items:b}){let c=(0,f.c)("roots"),[g,h]=(0,e.useState)({});return(0,d.jsxs)(q.Zp,{children:[(0,d.jsxs)(q.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,d.jsxs)(q.ZB,{className:"text-sm flex items-center gap-2",children:[(0,d.jsx)(y.A,{className:"h-4 w-4 text-emerald-700"}),c("recentKb.title")]}),b.length>0&&(0,d.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:b.length})]}),(0,d.jsxs)(q.Wu,{className:"space-y-2",children:[0===b.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("recentKb.empty")}),b.map(b=>(0,d.jsx)(l(),{href:`/roots/${a}/kb/${b.rel.split("/").map(encodeURIComponent).join("/")}`,className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(y.A,{className:"h-3.5 w-3.5 mt-0.5 shrink-0 text-emerald-700"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:b.title}),b.kind&&(0,d.jsx)(p.E,{variant:"outline",className:"text-[10px] shrink-0",children:b.kind})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:g[b.rel]??b.rel}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-1",children:[function(a,b){let c=Date.now()-Date.parse(a);if(!Number.isFinite(c)||c<0)return b("recentKb.justNow");let d=Math.floor(c/6e4);if(d<1)return b("recentKb.justNow");if(d<60)return b("recentKb.minutesAgo",{count:d});let e=Math.floor(d/60);return e<24?b("recentKb.hoursAgo",{count:e}):b("recentKb.daysAgo",{count:Math.floor(e/24)})}(b.modifiedAt,c)," \xb7 ",(0,d.jsx)("span",{className:"font-mono",children:b.rel})]})]})]})},b.rel))]})]})}z.callServer,z.findSourceMapURL;var B=c(87671),C=c(42557);let D=(0,C.A)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var E=c(69552),F=c(62481),G=c(73569),H=c(89313);function I({rootId:a,cache:b}){let c=(0,f.c)("roots"),[j,k]=(0,e.useState)(b),[l,m]=(0,e.useTransition)(),o=(0,B.useRouter)(),r=j&&Date.now()-Date.parse(j.generatedAt)>864e5;return(0,d.jsxs)(q.Zp,{className:"lg:col-span-2",children:[(0,d.jsxs)(q.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,d.jsxs)(q.ZB,{className:"text-sm flex items-center gap-2",children:[(0,d.jsx)(D,{className:"h-4 w-4 text-amber-500"}),c("aiSuggestions.title"),r&&(0,d.jsx)(p.E,{variant:"outline",className:"text-[10px]",children:c("aiSuggestions.stale")})]}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{m(async()=>{try{let b=await fetch(`/api/roots/${a}/suggestions`,{method:"POST",cache:"no-store"}),d=await b.json();if(!d.ok)return void h.oR.error(d.error??c("aiSuggestions.regenerateFailed"));d.cache&&k(d.cache)}catch(a){h.oR.error(a instanceof Error?a.message:String(a))}})},disabled:l,className:"gap-1 h-7 text-xs",children:[l?(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(g.A,{className:"h-3 w-3"}),c("aiSuggestions.recompute")]})]}),(0,d.jsxs)(q.Wu,{className:"space-y-2",children:[!j&&!l&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("aiSuggestions.intro")}),j&&0===j.items.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("aiSuggestions.nothingUrgent")}),(0,d.jsx)("div",{className:"grid gap-2 md:grid-cols-2",children:j?.items.map((b,c)=>(0,d.jsxs)("div",{className:"rounded-md border bg-card p-3 space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(E.A,{className:"h-3.5 w-3.5 text-amber-500 mt-0.5 shrink-0"}),(0,d.jsx)("p",{className:"text-sm font-medium leading-snug flex-1",children:b.title})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:b.why}),(0,d.jsx)(J,{rootId:a,item:b,router:o})]},c))}),j&&(0,d.jsx)("p",{className:"text-[10px] text-muted-foreground pt-1",children:c.rich("aiSuggestions.generatedAt",{time:function(a,b){let c=Date.now()-Date.parse(a);if(!Number.isFinite(c)||c<0)return b("aiSuggestions.justNow");let d=Math.floor(c/6e4);if(d<1)return b("aiSuggestions.justNow");if(d<60)return b("aiSuggestions.minutesAgo",{count:d});let e=Math.floor(d/60);return e<24?b("aiSuggestions.hoursAgo",{count:e}):b("aiSuggestions.daysAgo",{count:Math.floor(e/24)})}(j.generatedAt,c),model:j.model,code:a=>(0,d.jsx)("code",{className:"font-mono",children:a})})})]})]})}function J({rootId:a,item:b,router:c}){let[g,k]=(0,e.useTransition)(),m=(0,f.c)("roots"),{action:o}=b;if("none"===o.kind)return null;if("open-topic"===o.kind&&o.target)return(0,d.jsx)(i.$,{asChild:!0,size:"sm",variant:"outline",className:"h-7 text-xs gap-1",children:(0,d.jsxs)(l(),{href:`/roots/${a}/chat/${o.target}`,children:[(0,d.jsx)(F.A,{className:"h-3 w-3"}),o.label]})});if("open-kb"===o.kind&&o.target){let b=o.target.split("/").map(encodeURIComponent).join("/");return(0,d.jsx)(i.$,{asChild:!0,size:"sm",variant:"outline",className:"h-7 text-xs gap-1",children:(0,d.jsxs)(l(),{href:`/roots/${a}/kb/${b}`,children:[(0,d.jsx)(F.A,{className:"h-3 w-3"}),o.label]})})}return"send-message"===o.kind&&o.target?(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:()=>{k(async()=>{try{let b=await (0,H.g)(a,o.target,[],void 0);if(!b.ok)return void h.oR.error(b.error??m("aiSuggestions.sendFailed"));(0,j.$d)(j.Zi.topicsChanged(a)),c.push(`/roots/${a}/chat/${b.topicId}`)}catch(a){h.oR.error(a instanceof Error?a.message:String(a))}})},disabled:g,children:[g?(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(G.A,{className:"h-3 w-3"}),o.label]}):null}var K=c(97162),L=c(34719),M=c(56189),N=c(12619),O=c(66979);let P=(0,z.createServerReference)("406954ae9e949798ecbb1553e67832c7d372b06ee6",z.callServer,void 0,z.findSourceMapURL,"listSuggestionsAction"),Q=(0,z.createServerReference)("40b36424b2bddd50f3460c781e2905f89a4d0d6356",z.callServer,void 0,z.findSourceMapURL,"approveSuggestionAction"),R=(0,z.createServerReference)("4026639a58bac280b123087c3f678ee116d819daaa",z.callServer,void 0,z.findSourceMapURL,"rejectSuggestionAction");var S=c(91344);let T={utility:K.A,research:L.A,widget:M.A,goal:m.A,skill:E.A},U={utility:"text-emerald-600",research:"text-violet-600",widget:"text-blue-600",goal:"text-amber-600",skill:"text-pink-600"};function V({rootId:a}){let b=(0,B.useRouter)(),[c,f]=(0,e.useState)([]),[j,k]=(0,e.useState)(!0),[l,m]=(0,e.useState)({}),[o,r]=(0,e.useTransition)(),s=(0,e.useCallback)(async()=>{let b=await P(a);k(!1),b.ok&&f(b.items)},[a]);return j||0===c.length?null:(0,d.jsxs)(q.Zp,{children:[(0,d.jsxs)(q.aR,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)(q.ZB,{className:"text-lg flex items-center gap-2",children:[(0,d.jsx)(D,{className:"h-4 w-4 text-amber-500"}),"Suggestions",(0,d.jsx)(p.E,{variant:"secondary",className:"ml-1",children:c.length})]}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>r(()=>s()),disabled:o,className:"h-7 gap-1",children:[(0,d.jsx)(g.A,{className:(0,S.cn)("h-3 w-3",o&&"animate-spin")}),"Refresh"]})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Hypotheses the agent put together from the onboarding chat. Approve to start a topic; dismiss to drop it (and remember you said no)."})]}),(0,d.jsx)(q.Wu,{className:"space-y-2",children:c.map(c=>{let e=T[c.kind]??D,g=l[c.id];return(0,d.jsxs)("div",{className:"flex items-start gap-3 rounded-md border p-3",children:[(0,d.jsx)(e,{className:(0,S.cn)("h-4 w-4 mt-1 shrink-0",U[c.kind])}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"font-medium text-sm",children:c.title}),(0,d.jsx)(p.E,{variant:"outline",className:"text-[10px]",children:c.kind})]}),c.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1 leading-snug",children:c.description}),c.prompt&&(0,d.jsx)("code",{className:"block mt-1 text-[10px] font-mono text-muted-foreground/70 truncate",children:c.prompt})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"default",disabled:!!g,onClick:()=>{m(a=>({...a,[c.id]:"approve"})),(async()=>{let d=await Q({rootId:a,suggestionId:c.id});if(m(a=>({...a,[c.id]:null})),!d.ok)return h.oR.error(d.error??"Failed to start topic");h.oR.success(`Started: ${c.title}`),f(a=>a.filter(a=>a.id!==c.id)),b.push(`/roots/${a}/chat/${d.topicId}`)})()},className:"h-8 gap-1",children:["approve"===g?(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(N.A,{className:"h-3 w-3"}),"Approve"]}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"ghost",disabled:!!g,onClick:()=>{m(a=>({...a,[c.id]:"reject"})),(async()=>{let b=await R({rootId:a,suggestionId:c.id});if(m(a=>({...a,[c.id]:null})),!b.ok)return h.oR.error(b.error??"Failed to reject");h.oR.success(`Dismissed: ${c.title}`),f(a=>a.filter(a=>a.id!==c.id))})()},className:"h-8 gap-1 text-muted-foreground hover:text-destructive",children:["reject"===g?(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(O.A,{className:"h-3 w-3"}),"Dismiss"]})]})]},c.id)})})]})}var W=c(36799);let X=(0,C.A)("LibraryBig",[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]]);var Y=c(30515);let Z=(0,z.createServerReference)("60dde64d15061b171a87cbec62bf441630ad671310",z.callServer,void 0,z.findSourceMapURL,"saveWidgetOrderAction"),$=(0,z.createServerReference)("608e88a467224322af17cf95d096aa2cded56afb57",z.callServer,void 0,z.findSourceMapURL,"hideWidgetAction"),_={sm:2,md:3,wide:6},aa=["sys:active-goals","sys:pending","sys:recent-kb","sys:ai-suggestions"],ab=[{id:"sys:active-goals",title:"Active goals & running agents",description:"Topics with an active /goal and a running orchestrator."},{id:"sys:pending",title:"Awaiting response",description:"Unanswered permission / question / mcp-add cards."},{id:"sys:recent-kb",title:"Recent in KB",description:"KB files modified in the last 72 hours."},{id:"sys:ai-suggestions",title:"What's next — Reflex suggestions",description:"Gemini-driven analysis of project state with actions."}],ac=(0,z.createServerReference)("707f02808e55bf59f59483588bf480df897ca21f20",z.callServer,void 0,z.findSourceMapURL,"setWidgetSizeAction"),ad=[{mode:"sm",label:"S",titleKey:"widgetsCommon.sizeSm"},{mode:"md",label:"M",titleKey:"widgetsCommon.sizeMd"},{mode:"wide",label:"W",titleKey:"widgetsCommon.sizeWide"}];function ae({rootId:a,widgetId:b,mode:c,onChanged:g}){let i=(0,f.c)("roots"),[j,k]=(0,e.useTransition)();return(0,d.jsx)("div",{role:"radiogroup","aria-label":i("widgetsCommon.sizeAria"),className:"inline-flex items-center rounded border bg-background/80 backdrop-blur overflow-hidden text-[10px] leading-none",children:ad.map(e=>{let f=e.mode===c,l="sm"===e.mode?i("widgetsCommon.sizeSm"):"md"===e.mode?i("widgetsCommon.sizeMd"):i("widgetsCommon.sizeWide");return(0,d.jsx)("button",{type:"button",role:"radio","aria-checked":f,"aria-label":l,title:l,onClick:()=>{var d;(d=e.mode)!==c&&k(async()=>{let c=await ac(a,b,d);if(!c.ok)return void h.oR.error(c.error??i("widgetsCommon.sizeFailed"));g()})},disabled:j,className:["px-1.5 py-0.5 font-mono transition-colors disabled:opacity-50",f?"bg-violet-600 text-white":"text-muted-foreground hover:bg-accent hover:text-foreground"].join(" "),children:e.label},e.mode)})})}function af(a){let b=_[a];return 2===b?"lg:col-span-2":3===b?"lg:col-span-3":"lg:col-span-6"}let ag=(0,C.A)("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var ah=c(54874),ai=c(14425),aj=c(71155),ak=c(46102);let al=(0,z.createServerReference)("786260562cbe7b3b0daf40aef3e3d5395eb090ed66",z.callServer,void 0,z.findSourceMapURL,"patchWidgetDataAction"),am=(0,z.createServerReference)("7023aecf15d54d7bf11241dba6226c2b21da628797",z.callServer,void 0,z.findSourceMapURL,"setWidgetRefreshAction"),an=(0,z.createServerReference)("603b48b0cfdb8b78838a9caa0083e0dc973ac22cb8",z.callServer,void 0,z.findSourceMapURL,"refreshWidgetNowAction");function ao({rootId:a,widget:b,mode:c,onHide:g,hiding:i,onLayoutChanged:j,dnd:k}){let m=(0,f.c)("roots"),[n,o]=(0,e.useTransition)(),r=k.dragging===b.id,s=k.dropTarget===b.id&&!r,t=af(c);return(0,d.jsxs)(q.Zp,{draggable:!0,onDragStart:a=>{a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",b.id),k.onDragStart(b.id)},onDragOver:a=>{a.preventDefault(),a.dataTransfer.dropEffect="move",k.dropTarget!==b.id&&k.onDragOver(b.id)},onDrop:a=>{a.preventDefault(),k.onDrop(b.id)},onDragEnd:()=>k.onDragEnd(),className:[t,"transition-all",r?"opacity-50":"",s?"ring-2 ring-violet-400 ring-offset-2 ring-offset-background":""].join(" "),children:[(0,d.jsxs)(q.aR,{className:"pb-2 flex flex-row items-start gap-2 space-y-0",children:[(0,d.jsx)(ag,{className:"h-3.5 w-3.5 text-muted-foreground/60 cursor-grab active:cursor-grabbing mt-1 shrink-0","aria-label":m("widgetsCommon.dragHandle")}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)(q.ZB,{className:"text-sm flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"truncate",children:b.title}),(0,d.jsx)(p.E,{variant:"outline",className:"text-[10px] font-mono shrink-0",children:b.kind})]}),b.description&&(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5 line-clamp-2",children:b.description})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 -mt-0.5 shrink-0",children:[(0,d.jsx)(ae,{rootId:a,widgetId:b.id,mode:c,onChanged:j}),b.sourceTopicId&&(0,d.jsx)(l(),{href:`/roots/${a}/chat/${b.sourceTopicId}`,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground","aria-label":m("widgetsCommon.editViaTopicAria"),title:m("widgetsCommon.editViaTopicTitle"),children:(0,d.jsx)(ah.A,{className:"h-3.5 w-3.5"})}),(0,d.jsx)("button",{type:"button",onClick:()=>o(async()=>{await Promise.resolve(),g(b.id)}),disabled:n||i,"aria-label":m("widgetsCommon.hideAria"),title:m("widgetsCommon.hideTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive",children:(0,d.jsx)(O.A,{className:"h-3.5 w-3.5"})})]})]}),(0,d.jsxs)(q.Wu,{className:"space-y-3",children:[(0,ak.v)(a,b.kind,b.data,{widgetId:b.id,onPatch:async c=>{let d=await al(a,b.id,c);if(!d.ok)throw h.oR.error(d.error??m("widgetsCommon.savePatchFailed")),Error(d.error??m("widgetsCommon.patchFailed"))}}),(0,d.jsx)(ap,{rootId:a,widget:b})]})]})}function ap({rootId:a,widget:b}){let c=(0,f.c)("roots"),[i,j]=(0,e.useTransition)(),[k,l]=(0,e.useTransition)(),m=b.refresh??"manual",n=b.lastRefreshAt??b.updatedAt;return b.sourceTopicId?(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-2 border-t text-[11px] text-muted-foreground",children:[(0,d.jsx)(ai.A,{className:"h-3 w-3 shrink-0"}),(0,d.jsx)("span",{className:"shrink-0",children:c("widgetsCommon.updatedAt",{time:function(a,b){let c=Date.now()-Date.parse(a);if(!Number.isFinite(c)||c<0)return b("widgetsCommon.justNow");let d=Math.floor(c/6e4);if(d<1)return b("widgetsCommon.justNow");if(d<60)return b("widgetsCommon.minutesAgo",{count:d});let e=Math.floor(d/60);return e<24?b("widgetsCommon.hoursAgo",{count:e}):b("widgetsCommon.daysAgo",{count:Math.floor(e/24)})}(n,c)})}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[(0,d.jsxs)(aj.l6,{value:m,onValueChange:d=>{l(async()=>{var e;let f=await am(a,b.id,d);f.ok?h.oR.success("manual"===d?c("widgetsCommon.autoRefreshOff"):c("widgetsCommon.cadenceSet",{cadence:(e=d,c("hourly"===e?"widgetsCommon.cadenceHourly":"daily"===e?"widgetsCommon.cadenceDaily":"weekly"===e?"widgetsCommon.cadenceWeekly":"widgetsCommon.cadenceManual"))})):h.oR.error(f.error??c("widgetsCommon.cadenceFailed"))})},disabled:k,children:[(0,d.jsx)(aj.bq,{className:"h-6 text-[10px] gap-1 px-1.5 w-auto min-w-[110px]",children:(0,d.jsx)(aj.yv,{})}),(0,d.jsxs)(aj.gC,{children:[(0,d.jsx)(aj.eb,{value:"manual",children:c("widgetsCommon.manual")}),(0,d.jsx)(aj.eb,{value:"hourly",children:c("widgetsCommon.hourly")}),(0,d.jsx)(aj.eb,{value:"daily",children:c("widgetsCommon.daily")}),(0,d.jsx)(aj.eb,{value:"weekly",children:c("widgetsCommon.weekly")})]})]}),(0,d.jsxs)("button",{type:"button",onClick:()=>{j(async()=>{let d=await an(a,b.id);d.ok?h.oR.success(c("widgetsCommon.refreshStarted")):h.oR.error(d.error??c("widgetsCommon.refreshFailed"))})},disabled:i,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 hover:bg-accent text-foreground/80 hover:text-foreground",title:c("widgetsCommon.refreshNowTitle"),children:[(0,d.jsx)(g.A,{className:`h-3 w-3 ${i?"animate-spin":""}`}),c("widgetsCommon.refreshLabel")]})]})]}):null}var aq=c(75482),ar=c(3442),as=c(97338),at=c(27456),au=c(43464);let av=(0,z.createServerReference)("6050952dc175da0f906e753b4ef2340acf5775a96b",z.callServer,void 0,z.findSourceMapURL,"deleteWidgetAction");function aw({rootId:a,open:b,onOpenChange:c,widgets:e,layout:g,onChanged:h}){let j=(0,f.c)("roots");if(!b)return null;let k=new Set(g.hidden);return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:a=>{a.target===a.currentTarget&&c(!1)},children:[(0,d.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 bg-background/80 backdrop-blur-sm",onClick:()=>c(!1)}),(0,d.jsxs)("div",{className:"relative bg-card border rounded-lg shadow-xl w-full max-w-2xl max-h-[80vh] flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 border-b",children:[(0,d.jsx)(X,{className:"h-4 w-4 text-violet-600"}),(0,d.jsx)("h2",{className:"text-sm font-medium flex-1",children:j("widgetsCommon.libraryTitle")}),(0,d.jsx)(i.$,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>c(!1),children:(0,d.jsx)(O.A,{className:"h-4 w-4"})})]}),(0,d.jsx)(at.F,{className:"flex-1 min-h-0",children:(0,d.jsxs)("div",{className:"p-4 space-y-4",children:[(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h3",{className:"text-[11px] uppercase tracking-wider text-muted-foreground",children:j("widgetsCommon.systemWidgetsHeading")}),ab.map(b=>(0,d.jsx)(ax,{rootId:a,id:b.id,title:b.title,description:b.description,badge:"system",badgeVariant:"default",hidden:k.has(b.id),canDelete:!1,onChanged:h},b.id))]}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h3",{className:"text-[11px] uppercase tracking-wider text-muted-foreground",children:j("widgetsCommon.userWidgetsHeading",{count:e.length})}),0===e.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:j("widgetsCommon.noUserWidgets")}),e.map(b=>(0,d.jsx)(ax,{rootId:a,id:b.id,title:b.title,description:b.description??`kind: ${b.kind}`,badge:b.kind,badgeVariant:"outline",hidden:k.has(b.id),canDelete:!0,onChanged:h},b.id))]})]})})]})]})}function ax({rootId:a,id:b,title:c,description:g,badge:j,badgeVariant:k,hidden:l,canDelete:m,onChanged:n}){let o=(0,f.c)("roots"),[q,r]=(0,e.useTransition)();return(0,d.jsxs)("div",{className:"flex items-start gap-3 rounded-md border bg-card px-3 py-2",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"text-sm font-medium truncate",children:c}),(0,d.jsx)(p.E,{variant:k,className:"text-[10px] font-mono",children:j}),l&&(0,d.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:o("widgetsCommon.hidden")})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:g})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{r(async()=>{let c=l?await (0,au.t)(a,b):await $(a,b);if(!c.ok)return void h.oR.error(c.error);n()})},disabled:q,className:"gap-1 h-7 text-xs",children:l?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(aq.A,{className:"h-3 w-3"}),o("widgetsCommon.show")]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ar.A,{className:"h-3 w-3"}),o("widgetsCommon.hide")]})}),m&&(0,d.jsx)(i.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>{confirm(o("widgetsCommon.deleteWidgetConfirm",{title:c}))&&r(async()=>{let c=await av(a,b);if(!c.ok)return void h.oR.error(c.error);n()})},disabled:q,className:"h-7 w-7 text-muted-foreground hover:text-destructive",title:o("widgetsCommon.deleteForever"),children:(0,d.jsx)(as.A,{className:"h-3.5 w-3.5"})})]})]})}function ay({rootId:a,widgets:b,layout:c,systemRenderers:g,snapshot:j,onLayoutChanged:k}){let l=(0,f.c)("roots"),m=(0,e.useMemo)(()=>{let a=new Map;for(let c of b)a.set(c.id,c);return a},[b]),[n,o]=(0,e.useState)(c.order),[p,q]=(0,e.useState)(c.hidden),[,r]=(0,e.useTransition)(),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1);aA(c.order,o),aA(c.hidden,q);let y=(0,e.useCallback)(b=>{o(b),r(async()=>{let c=await Z(a,b);c.ok?(o(c.layout.order),q(c.layout.hidden),k()):h.oR.error(c.error)})},[a,k]),z=(0,e.useCallback)(b=>{o(n.filter(a=>a!==b)),q(a=>[...new Set([b,...a])]),r(async()=>{let c=await $(a,b);if(!c.ok)return void h.oR.error(c.error);o(c.layout.order),q(c.layout.hidden),k()})},[a,n,k]),A={onDragStart:a=>t(a),onDragOver:a=>v(a),onDrop:a=>{if(t(null),v(null),!s||s===a)return;let b=[...n],c=b.indexOf(s),d=b.indexOf(a);c<0||d<0||(b.splice(c,1),b.splice(d,0,s),y(b))},onDragEnd:()=>{t(null),v(null)},dragging:s,dropTarget:u};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:l("widgetsCommon.projectWidgetsTitle")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:l("widgetsCommon.projectWidgetsHint")})]}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"outline",onClick:()=>x(!0),className:"gap-1 h-8",children:[(0,d.jsx)(X,{className:"h-3.5 w-3.5"}),l("widgetsCommon.library",{count:p.length})]})]}),0===n.length&&(0,d.jsxs)("div",{className:"rounded-md border border-dashed bg-muted/20 p-6 text-center space-y-2",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:l.rich("widgetsCommon.emptyDashboard",{example:()=>(0,d.jsx)("em",{children:l("widgetsCommon.emptyDashboardExample")})})}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>x(!0),className:"gap-1",children:[(0,d.jsx)(Y.A,{className:"h-3 w-3"}),l("widgetsCommon.restoreSystem")]})]}),(0,d.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-6 gap-4",children:n.map(b=>{var e;let f=m.get(b),h=c.sizes?.[b]??(e=f?.size,e?.mode?e.mode:e?.cols===1?"sm":e?.cols===2?"md":e?.cols===3?"wide":"md");return aa.includes(b)?(0,d.jsx)(az,{rootId:a,id:b,node:g[b],onHide:z,dnd:A,mode:h,onLayoutChanged:k},b):f?(0,d.jsx)(ao,{rootId:a,widget:f,mode:h,onHide:z,hiding:!1,dnd:A,onLayoutChanged:k},b):null})}),(0,d.jsx)(aw,{open:w,onOpenChange:x,rootId:a,widgets:b,layout:{order:n,hidden:p},onChanged:()=>{k()}})]})}function az({rootId:a,id:b,node:c,onHide:e,dnd:g,mode:h,onLayoutChanged:i}){let j=(0,f.c)("roots"),k=g.dragging===b,l=g.dropTarget===b&&!k,m=af(h);return(0,d.jsxs)("div",{draggable:!0,onDragStart:a=>{a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",b),g.onDragStart(b)},onDragOver:a=>{a.preventDefault(),a.dataTransfer.dropEffect="move",g.dropTarget!==b&&g.onDragOver(b)},onDrop:a=>{a.preventDefault(),g.onDrop(b)},onDragEnd:()=>g.onDragEnd(),className:[m,"relative group/sys transition-all",k?"opacity-50":"",l?"ring-2 ring-violet-400 ring-offset-2 ring-offset-background rounded-lg":""].join(" "),children:[c,(0,d.jsxs)("div",{className:"absolute top-2 right-2 opacity-0 group-hover/sys:opacity-100 transition-opacity flex items-center gap-1 bg-background/85 backdrop-blur rounded p-0.5",children:[(0,d.jsx)(ae,{rootId:a,widgetId:b,mode:h,onChanged:i}),(0,d.jsx)("button",{type:"button",onClick:()=>e(b),"aria-label":j("widgetsCommon.hideAria"),title:j("widgetsCommon.hideSystemTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive",children:"\xd7"})]})]})}function aA(a,b){(0,e.useMemo)(()=>{b(a)},[JSON.stringify(a)])}function aB({rootId:a,initialSnapshot:b}){let c=(0,f.c)("roots"),[k,l]=(0,e.useState)(b),[m,n]=(0,e.useTransition)(),o=(0,e.useCallback)(()=>{n(async()=>{try{let b=await fetch(`/api/roots/${a}/dashboard`,{cache:"no-store"}),d=await b.json();if(!d.ok||!d.snapshot)return void h.oR.error(d.error??c("dashboard.refreshFailed"));l(d.snapshot)}catch(a){h.oR.error(a instanceof Error?a.message:String(a))}})},[a,c]);(0,j.S9)(j.Zi.topicsChanged(a),o),(0,j.S9)(j.Zi.kbChanged(a),o);let p={"sys:active-goals":(0,d.jsx)(r,{rootId:a,activeGoals:k.activeGoals,runningAgents:k.runningAgents}),"sys:pending":(0,d.jsx)(w,{rootId:a,items:k.pendingApprovals}),"sys:recent-kb":(0,d.jsx)(A,{rootId:a,items:k.recentKb}),"sys:ai-suggestions":(0,d.jsx)(I,{rootId:a,cache:k.suggestions})};return(0,d.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,d.jsxs)("div",{className:"p-6 space-y-5 max-w-6xl mx-auto",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:c("dashboard.projectOverview")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:c("dashboard.projectOverviewHint")})]}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:o,disabled:m,className:"gap-1 h-8",children:[(0,d.jsx)(g.A,{className:`h-3.5 w-3.5 ${m?"animate-spin":""}`}),c("dashboard.refresh")]})]}),(0,d.jsx)(V,{rootId:a}),(0,d.jsx)(ay,{rootId:a,widgets:k.widgets,layout:k.layout,systemRenderers:p,snapshot:k,onLayoutChanged:o}),(0,d.jsx)(W.MemoryEditor,{scope:"project",rootId:a,title:c("dashboard.memoryTitle"),description:c("dashboard.memoryHint")})]})})}},8086:a=>{"use strict";a.exports=require("module")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},13682:(a,b,c)=>{"use strict";c.d(b,{j:()=>e});var d=c(3265);let e=(0,d.createServerReference)("701589955832e090fca62053f36b5915990fcbbed7",d.callServer,void 0,d.findSourceMapURL,"removeUtilityAction")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19356:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},20567:(a,b,c)=>{"use strict";c.d(b,{AU:()=>j,Z9:()=>i});var d=c(73024);c(76760);var e=c(56149),f=c(54287);let g=e.Ik({watchDebounceMs:e.ai().int().min(f.a,{message:`watchDebounceMs must be ≥ ${f.a} ms`}).default(f.VU),agentBackend:e.k5(["codex","claude-code"]).default("claude-code"),ignoreFile:e.Yj().default(".reflexignore")}),h=g.parse({});async function i(a){let b=(0,f.eQ)(a);try{let a=await d.promises.readFile(b,"utf8");return g.parse(JSON.parse(a))}catch(a){var c;if("object"==typeof(c=a)&&null!==c&&"code"in c&&"ENOENT"===c.code)return h;throw a}}async function j(a,b){await d.promises.mkdir((0,f.FF)(a),{recursive:!0}),await d.promises.writeFile((0,f.eQ)(a),JSON.stringify(b,null,2)+"\n","utf8")}},21820:a=>{"use strict";a.exports=require("os")},23050:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{"401843f7c2763226fa5823c8cf535bef815947fbc5":()=>e.Gh,"4048d3bf1bef4047dba520d246b2b548a7d176a32a":()=>e.rD,"40564b5ab3de86910f1317be4112ae5a68245f3d2e":()=>e.O1,"40684816c68967b101c03a7324b0180acee9ecfc08":()=>e.summarizeYoutubeAction,"40ae56d4ad1bc53c8436556c177fdc994ba2ba35eb":()=>f.x,"40dcac88f5808aad60a01055ac6573f7f928d6f93d":()=>e.AZ,"609737844013019434a24538e5227505aeb590b338":()=>f.k});var e=c(18746),f=c(49809),g=a([f]);f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},28074:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{y:()=>l});var e=c(7206),f=c(73024),g=c(46726),h=c(78744),i=a([e]);e=(i.then?(await i)():i)[0];let k="claude",l={id:"claude-code",async analyzeScope(a){await j(),await f.promises.mkdir(a.reflexScope,{recursive:!0});let b=await (0,h.p)(a),c=["-p",b,"--permission-mode","acceptEdits","--allowedTools","Read,Write,Edit,LS,Glob,Grep","--add-dir",a.reflexScope];a.model&&c.push("--model",a.model),await (0,e.execa)(k,c,{cwd:a.root,stdio:"inherit"})},async chat(a){await j();let b=await (0,h.M)(a);await (0,e.execa)(k,["--append-system-prompt",b,"--add-dir",a.reflexScope],{cwd:a.scope,stdio:"inherit"})}};async function j(){try{await (0,e.execa)(k,["--version"],{stdio:"ignore"})}catch(a){throw new g.g("claude-code",a)}}d()}catch(a){d(a)}})},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29830:(a,b,c)=>{Promise.resolve().then(c.bind(c,86673)),Promise.resolve().then(c.bind(c,62109)),Promise.resolve().then(c.bind(c,16805)),Promise.resolve().then(c.bind(c,574)),Promise.resolve().then(c.bind(c,90558)),Promise.resolve().then(c.bind(c,64845)),Promise.resolve().then(c.bind(c,770)),Promise.resolve().then(c.bind(c,60524)),Promise.resolve().then(c.bind(c,50155)),Promise.resolve().then(c.bind(c,26922)),Promise.resolve().then(c.bind(c,79008)),Promise.resolve().then(c.bind(c,68146)),Promise.resolve().then(c.bind(c,60936)),Promise.resolve().then(c.bind(c,65138)),Promise.resolve().then(c.bind(c,68902)),Promise.resolve().then(c.bind(c,69644)),Promise.resolve().then(c.bind(c,49186)),Promise.resolve().then(c.bind(c,93099)),Promise.resolve().then(c.bind(c,83594)),Promise.resolve().then(c.bind(c,24375)),Promise.resolve().then(c.bind(c,67135)),Promise.resolve().then(c.bind(c,85105)),Promise.resolve().then(c.bind(c,41886)),Promise.resolve().then(c.bind(c,33309)),Promise.resolve().then(c.bind(c,37550)),Promise.resolve().then(c.bind(c,96623)),Promise.resolve().then(c.bind(c,77372)),Promise.resolve().then(c.bind(c,65478)),Promise.resolve().then(c.bind(c,97230)),Promise.resolve().then(c.bind(c,73552)),Promise.resolve().then(c.bind(c,391)),Promise.resolve().then(c.bind(c,4235)),Promise.resolve().then(c.bind(c,41138)),Promise.resolve().then(c.bind(c,60877)),Promise.resolve().then(c.bind(c,7671)),Promise.resolve().then(c.bind(c,5637)),Promise.resolve().then(c.bind(c,36786)),Promise.resolve().then(c.t.bind(c,20594,23))},31041:(a,b,c)=>{"use strict";c.d(b,{BT:()=>i,Wu:()=>j,ZB:()=>h,Zp:()=>f,aR:()=>g,wL:()=>k});var d=c(64173);c(17240);var e=c(91344);function f({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card",className:(0,e.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",a),...b})}function g({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card-header",className:(0,e.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",a),...b})}function h({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card-title",className:(0,e.cn)("leading-none font-semibold",a),...b})}function i({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card-description",className:(0,e.cn)("text-sm text-muted-foreground",a),...b})}function j({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card-content",className:(0,e.cn)("px-6",a),...b})}function k({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card-footer",className:(0,e.cn)("flex items-center px-6 [.border-t]:pt-6",a),...b})}},31421:a=>{"use strict";a.exports=require("node:child_process")},33873:a=>{"use strict";a.exports=require("path")},35314:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{j:()=>h});var e=c(28074),f=c(48519),g=a([e,f]);[e,f]=g.then?(await g)():g;let i={"claude-code":e.y,codex:f.C};function h(a){let b=i[a.agentBackend];if(!b)throw Error(`Unknown agent backend: ${a.agentBackend}`);return b}d()}catch(a){d(a)}})},36306:a=>{"use strict";a.exports=import("@tailwindcss/node")},36799:(a,b,c)=>{"use strict";c.d(b,{MemoryEditor:()=>s});var d=c(64173),e=c(17240),f=c(44052),g=c(62261),h=c(74868),i=c(13530),j=c(97338),k=c(20583),l=c(31041),m=c(45477),n=c(91344),o=c(3265);let p=(0,o.createServerReference)("40d2c90b38d1d30c023a591d63acdf6ec346922985",o.callServer,void 0,o.findSourceMapURL,"loadMemoryAction"),q=(0,o.createServerReference)("40f39ecbb64c7ccc87b094dcffa2a8d6cb24103efe",o.callServer,void 0,o.findSourceMapURL,"saveMemoryFileAction"),r=(0,o.createServerReference)("401617ce87a323543766021939be22a6c8fb823be3",o.callServer,void 0,o.findSourceMapURL,"wipeMemoryAction");function s({scope:a,rootId:b,title:c,description:f,allowWipe:i}){let[j,k]=(0,e.useState)([]),[m,n]=(0,e.useState)(!0),[o,q]=(0,e.useState)(null),r=(0,e.useCallback)(async()=>{n(!0);let c=await p(b?{scope:a,rootId:b}:{scope:a});if(n(!1),!c.ok)return void q(c.error);q(null),k(c.files)},[a,b]);return(0,d.jsxs)(l.Zp,{children:[(0,d.jsx)(l.aR,{children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(l.ZB,{className:"text-lg",children:c}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:f})]}),i&&j.length>0&&(0,d.jsx)(u,{scope:a,rootId:b,onWiped:r})]})}),(0,d.jsx)(l.Wu,{children:m?(0,d.jsxs)("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[(0,d.jsx)(g.A,{className:"h-3 w-3 animate-spin"})," Loading…"]}):o?(0,d.jsxs)("p",{className:"text-sm text-destructive flex items-center gap-2",children:[(0,d.jsx)(h.A,{className:"h-3.5 w-3.5"}),o]}):(0,d.jsx)("div",{className:"space-y-4",children:j.map(c=>(0,d.jsx)(t,{snapshot:c,scope:a,rootId:b,onSaved:a=>k(b=>b.map(b=>b.file===a.file?a:b))},c.file))})})]})}function t({snapshot:a,scope:b,rootId:c,onSaved:h}){let[j,l]=(0,e.useState)(a.content),[o,p]=(0,e.useTransition)(),r=j.trim(),s=r?r.split("\n").length:0,t=s>a.cap,u=s>.9*a.cap,v=j!==a.content;return(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:"font-mono text-sm font-semibold",children:a.file}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:a.description})]}),(0,d.jsxs)("span",{className:(0,n.cn)("text-xs tabular-nums",t?"text-destructive font-medium":u?"text-amber-600":"text-muted-foreground"),children:[s,"/",a.cap]})]}),(0,d.jsx)(m.T,{value:j,onChange:a=>l(a.target.value),rows:Math.min(a.cap+2,Math.max(3,s+1)),placeholder:"Empty",className:"font-mono text-xs"}),(0,d.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,d.jsxs)(k.$,{type:"button",size:"sm",variant:v?"default":"ghost",disabled:!v||o||t,onClick:()=>{if(t)return void f.oR.error(`${a.file} exceeds ${a.cap}-line cap (${s}). Trim before saving.`);p(async()=>{let d=await q({scope:b,...c?{rootId:c}:{},file:a.file,content:r});if(!d.ok)return void f.oR.error(d.error??"Save failed");f.oR.success(`Saved ${a.file}`),h({...a,content:r,lines:d.lines})})},children:[o?(0,d.jsx)(g.A,{className:"mr-1 h-3 w-3 animate-spin"}):(0,d.jsx)(i.A,{className:"mr-1 h-3 w-3"}),"Save"]})})]})}function u({scope:a,rootId:b,onWiped:c}){let[g,h]=(0,e.useTransition)();return(0,d.jsxs)(k.$,{type:"button",size:"sm",variant:"ghost",disabled:g,onClick:()=>{confirm("Erase ALL memory at this scope? Cannot be undone.")&&h(async()=>{let d=await r(b?{scope:a,rootId:b}:{scope:a});if(!d.ok)return void f.oR.error(d.error??"Wipe failed");f.oR.success("Memory wiped"),await c()})},className:"text-destructive hover:text-destructive",children:[(0,d.jsx)(j.A,{className:"mr-1 h-3 w-3"}),"Wipe all"]})}},37509:(a,b,c)=>{"use strict";c.d(b,{B:()=>e});var d=c(3265);let e=(0,d.createServerReference)("00bfbc35f7b4c1441cb864f33471e1eb3a5fbbefbb",d.callServer,void 0,d.findSourceMapURL,"listCuratedAction")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},44171:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},46726:(a,b,c)=>{"use strict";c.d(b,{g:()=>d});class d extends Error{constructor(a,b){super(`Agent backend "${a}" is unavailable: ${b instanceof Error?b.message:String(b)}`),this.name="AgentUnavailableError"}}},47452:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(19963).A)("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]])},48161:a=>{"use strict";a.exports=require("node:os")},48519:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{C:()=>l});var e=c(7206),f=c(73024),g=c(46726),h=c(78744),i=a([e]);e=(i.then?(await i)():i)[0];let k="codex",l={id:"codex",async analyzeScope(a){await j(),await f.promises.mkdir(a.reflexScope,{recursive:!0});let b=await (0,h.p)(a),c=["exec","--cd",a.root,"--sandbox","workspace-write","--add-dir",a.reflexScope];a.model&&c.push("--model",a.model),c.push(b),await (0,e.execa)(k,c,{stdio:"inherit"})},async chat(a){await j();let b=await (0,h.M)(a);await (0,e.execa)(k,["--system",b],{cwd:a.scope,stdio:"inherit"})}};async function j(){try{await (0,e.execa)(k,["--version"],{stdio:"ignore"})}catch(a){throw new g.g("codex",a)}}d()}catch(a){d(a)}})},50108:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{E:()=>m});var e=c(73024),f=c(76760),g=c.n(f),h=c(20567),i=c(35314),j=c(79734),k=c(54287),l=a([i]);async function m(a,b={}){let c=g().resolve(a);await n(c),await e.promises.mkdir((0,k.FF)(c),{recursive:!0});let d=await (0,h.Z9)(c);if(await (0,h.AU)(c,d),await (0,j.D)(c),b.scaffoldOnly)return void process.stdout.write(`Reflex scaffolded at ${(0,k.FF)(c)} (scaffold-only).
|
|
2
|
-
`);let f=b.harness?{...d,agentBackend:b.harness}:d,l=await (0,j.z)({root:c,scope:c}),o={...l,...b.model?{model:b.model}:{},...b.language?{language:b.language}:{}};process.stdout.write(`Running ${f.agentBackend}${b.model?` (${b.model})`:""}${b.language?` [lang=${b.language}]`:""} over ${c} (${l.files.length} files visible)…
|
|
3
|
-
`);let p=(0,i.j)(f);await p.analyzeScope(o),process.stdout.write(`Done. KB written under ${(0,k.FF)(c)}
|
|
4
|
-
`)}async function n(a){let b=await e.promises.stat(a).catch(()=>null);if(!b||!b.isDirectory())throw Error(`Not a directory: ${a}`)}i=(l.then?(await l)():l)[0],d()}catch(a){d(a)}})},51333:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(19963).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},51455:a=>{"use strict";a.exports=require("node:fs/promises")},52869:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},52935:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{"0010ea974bdf681a7242026ca681c7114ddacd9beb":()=>l.Fm,"002690b8d381d1dc24ca3ad7dc45155b704fb18280":()=>l.Zl,"006f089ce00806d7b17d9d63f4cb2a460c9bbfdc57":()=>t.w,"00756da9935797a768271aa904a8e3ddd2c0f3d02e":()=>l.Ng,"00bfbc35f7b4c1441cb864f33471e1eb3a5fbbefbb":()=>m.Bp,"00cd0d16dd685ab15913a103336f488c19683855f8":()=>k.L8,"00d670f90aee8bee4f39627591d9319564f27971cb":()=>g.i,"00d8f99a5c52567b309a4768c05457b8c10493bf94":()=>l.Nt,"00f2b206f91bebbf997ce8827212be6a2e45d12593":()=>p.wd,"4005e74cbcc59f5f9e04879aa2b7b707ba258857ca":()=>m.nO,"400a768b336af0e259592a76fa4e197306cc226001":()=>h.MU,"400df9d9932b3c3c88537a7c4f0227b90e96630d10":()=>m.k_,"401617ce87a323543766021939be22a6c8fb823be3":()=>r.R1,"40189964def749f07c8c3b740f5c74b51616fd93e7":()=>f.uX,"401d5aa44719bfd0d07dad0a42e0b2b3b96cc3c3f7":()=>f.DW,"401d6894dac39fc99506d91d97d3880161d3503be6":()=>m.gn,"4022aee6e4d0e940cd98dc96ca91980d8313ec1bee":()=>m.Yt,"402376f3f032c853516f6ade95de129af5c67de04d":()=>m.RK,"402430f8e33f6a692460fcac36e2938d0e4873e462":()=>i.Cz,"4026639a58bac280b123087c3f678ee116d819daaa":()=>q.Yr,"402b23559f309c8e20e0d1de34ce46a9c90e8277b6":()=>k.Is,"4034014c41f93939d165a7b6a0666fdd73e00e2308":()=>e.nY,"403a27a8e14407d18b24574c5dc517e93114d2f37f":()=>m.vv,"4043410d57c6f585b5dd17caaa30be24015e9625b4":()=>p.LL,"40550e26c3e5de5c69a0246dcfe1a9f56b5165c74c":()=>k.ns,"4063845d06d92e1fea74f8ae88cdcd80c8a44c3a24":()=>j.rg,"406954ae9e949798ecbb1553e67832c7d372b06ee6":()=>q.uy,"406db9e1625b52ea78efba96ad856d7fef1d83fcde":()=>i.hN,"40744e2f9d98d864a231095170f07537fc6eb04eb9":()=>o.x,"40768bbcc710c08acdabab448ce69fafadd7510b4f":()=>h.$z,"40955b32d63b52a57d2e9072a6d11fda2e04cd6c1e":()=>m.QR,"40a46918919494fdc72de40d35407e5ef6085de6ce":()=>f.zm,"40a59da5a9d3cc8212c8f85c231cf5c5c8debdb563":()=>m.JR,"40b36424b2bddd50f3460c781e2905f89a4d0d6356":()=>q.ct,"40b79a9f3f5b309d706c167b8186bf6b15931ef026":()=>e.Pd,"40b7ab7f11fb9cf8192539e6d1e3ff3ffd34a0f888":()=>m.L_,"40b8e9a4d782ef3e30efda11489b2909dcd31ad573":()=>m.b7,"40cee193dfb56002fe738047aa328894a3028ba467":()=>j.K9,"40cef119c5313a938bc41b2be902ff6eed04cb333e":()=>f.u7,"40d2c90b38d1d30c023a591d63acdf6ec346922985":()=>r.c9,"40dc5dbb6894255604fa6d76f2bcab8b9920ea7086":()=>p.Xt,"40e169a71237c614be42ad30b3ece1952eeff025e7":()=>m.Zh,"40e33e325692250a5d9d2bd6cd40a52eef89d4819f":()=>m.mR,"40e50d6fe2ac7c6c38d8e3cc6e5a58d66e48954dcf":()=>i.IK,"40e71160bce57a046e08f8d51e9b8c69fcc9a35fbc":()=>l.bt,"40e8e6cb0732f659f03c1c753fd5bd5ab4045f4102":()=>m.Kt,"40f3458d9a364eaded68a7dc972aae90ca5827b01b":()=>i.uA,"40f39ecbb64c7ccc87b094dcffa2a8d6cb24103efe":()=>r.RR,"600734fbfcf263a57beab72117b0686e5d8cd03cbf":()=>h.Tc,"60197d819259cf9fd52df8051310392d79d4dd7101":()=>s.J7,"601cfb8b98ef37adc089e085d15784b0389f8fb647":()=>n.S,"603b48b0cfdb8b78838a9caa0083e0dc973ac22cb8":()=>s.KV,"6050952dc175da0f906e753b4ef2340acf5775a96b":()=>s.cl,"606c0364dd04c6e66c7d31584e0dc77933975469ec":()=>p.ZC,"607b3c857c7e049b014f29f9b4807748e8a30c5fce":()=>e.OQ,"608e88a467224322af17cf95d096aa2cded56afb57":()=>s.hL,"60aff47e9f8fa1af71863206f550d71bffe64a0faa":()=>e.L4,"60b9a44e1f67aaa4c09f9d10d4497aa5a9a4b3b868":()=>p.b2,"60ca92d22ad2815d2971d223272c2a23c89f885b15":()=>p.qO,"60db954de482b32684d3ecc6e2b71418bce1265ce2":()=>s.tT,"60dde64d15061b171a87cbec62bf441630ad671310":()=>s.Aq,"60e0290c5a9be27f90ad23f30b8b8774233a26baa3":()=>s.kv,"701589955832e090fca62053f36b5915990fcbbed7":()=>m.jf,"7023aecf15d54d7bf11241dba6226c2b21da628797":()=>s.mm,"70728da6f64f24bbae7f64a215875bc18ff1bf0c12":()=>e.h$,"707f02808e55bf59f59483588bf480df897ca21f20":()=>s.Mh,"708df4b6db7e8c7fa672e9244827ecea1ab3d1c372":()=>m.i8,"70a6c772963f53d36b3105975e711a86c3c313d399":()=>m.q_,"70c721e79fb4bc9a5227831dc787cc7ffc441c530e":()=>m.QI,"70eba1072f8cebe25de73e8d257d34b5ccfe73f429":()=>j.Ik,"786260562cbe7b3b0daf40aef3e3d5395eb090ed66":()=>s.ru,"7896e0b0661b4325be6050a8ebd112337b7fa269ae":()=>e.g3});var e=c(13415),f=c(3890),g=c(50995),h=c(15754),i=c(27129),j=c(78645),k=c(16856),l=c(92814),m=c(9328),n=c(4168),o=c(63337),p=c(72901),q=c(98783),r=c(91745),s=c(34639),t=c(48272),u=a([e,f,h,j,m,p,q,r,s]);[e,f,h,j,m,p,q,r,s]=u.then?(await u)():u,d()}catch(a){d(a)}})},57075:a=>{"use strict";a.exports=require("node:stream")},58550:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{default:()=>C});var e=c(63003),f=c(20594),g=c.n(f),h=c(9310),i=c(17596),j=c(88842),k=c(47452),l=c(51333),m=c(50895),n=c(84913),o=c(67248),p=c(60524),q=c(24576),r=c(11178),s=c(49809),t=c(61105),u=c(64845),v=c(770),w=c(90558),x=c(16805),y=c(86673),z=c(574),A=c(62109),B=a([s]);async function C({params:a}){let{id:b}=await a,c=await (0,q.getRoot)(b);c||(0,h.notFound)();let d=await (0,m.A)("roots"),[f,B,C]=await Promise.all([(0,r.RP)(c.path),(0,s.x)(b),(0,t.dH)({rootId:b})]),D=B.ok?B.snapshot:void 0,E=C.map(a=>({id:a.manifest.id,name:a.manifest.name,scope:a.scope}));return(0,e.jsxs)("main",{className:"flex-1 flex flex-col min-h-0",children:[(0,e.jsxs)("header",{className:"border-b px-6 py-4 flex items-center gap-4",children:[(0,e.jsx)(n.$,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-3",children:(0,e.jsxs)(g(),{href:"/",children:[(0,e.jsx)(i.A,{className:"mr-1 h-4 w-4"})," Roots"]})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(j.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,e.jsx)("h1",{className:"text-base font-medium truncate",children:c.path})]}),(0,e.jsx)("div",{className:"mt-1 flex items-center gap-2 text-xs text-muted-foreground",children:f.exists?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(o.E,{variant:"secondary",children:[f.fileCount," MD files"]}),c.lastInitAt?(0,e.jsxs)("span",{children:["Last init ",new Date(c.lastInitAt).toLocaleString()]}):(0,e.jsx)("span",{children:"No init recorded"})]}):(0,e.jsx)(o.E,{variant:"outline",children:".reflex/ not yet created"})})]}),(0,e.jsx)(z.AddUtilityButton,{rootId:c.id,installed:E}),(0,e.jsx)(n.$,{asChild:!0,variant:"ghost",size:"sm",className:"gap-1",children:(0,e.jsxs)(g(),{href:`/roots/${c.id}/workflows`,children:[(0,e.jsx)(k.A,{className:"h-4 w-4"}),"Workflows"]})}),(0,e.jsx)(y.InsertImageButton,{rootId:c.id}),(0,e.jsx)(x.ShareButton,{kind:"project",rootId:c.id,label:c.path.split("/").pop()||d("detail.projectFallbackLabel")}),(0,e.jsx)(v.RunInitButton,{rootPath:c.path,rootId:c.id}),(0,e.jsx)(A.RemoveRootButton,{id:c.id,path:c.path,redirectHome:!0})]}),(0,e.jsx)(p.Separator,{}),D?(0,e.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,e.jsx)(u.Dashboard,{rootId:c.id,initialSnapshot:D}),(0,e.jsx)(w.CommandBar,{rootId:c.id})]}):(0,e.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center text-muted-foreground gap-3 p-10 text-center",children:[(0,e.jsx)(l.A,{className:"h-6 w-6"}),(0,e.jsxs)("p",{children:[d("detail.loadFailed"),B.ok?"":`: ${B.error??""}`,"."]}),(0,e.jsx)("p",{className:"text-xs",children:d.rich("detail.loadFailedHint",{b:a=>(0,e.jsx)("strong",{children:a})})})]}),(0,e.jsx)(w.CommandBar,{rootId:c.id})]})]})}s=(B.then?(await B)():B)[0],d()}catch(a){d(a)}})},62109:(a,b,c)=>{"use strict";c.d(b,{RemoveRootButton:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call RemoveRootButton() from the server but RemoveRootButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/_components/remove-root-button.tsx","RemoveRootButton")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63351:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},64845:(a,b,c)=>{"use strict";c.d(b,{Dashboard:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call Dashboard() from the server but Dashboard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/_components/dashboard.tsx","Dashboard")},65686:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>E.a,__next_app__:()=>K,handler:()=>M,pages:()=>J,routeModule:()=>L,tree:()=>I});var d=c(61597),e=c(99210),f=c(1082),g=c(15003),h=c(36265),i=c(11817),j=c(45136),k=c(41809),l=c(55745),m=c(88963),n=c(69153),o=c(48343),p=c(15808),q=c(21238),r=c(2555),s=c(261),t=c(34370),u=c(89583),v=c(26713),w=c(53875),x=c(7952),y=c(54532),z=c(80269),A=c(17851),B=c(57865),C=c(86439),D=c(47319),E=c.n(D),F=c(1859),G=c(20498),H={};for(let a in F)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(H[a]=()=>F[a]);c.d(b,H);let I={children:["",{children:["roots",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,58550)),"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/page.tsx"]}]},{layout:[()=>Promise.resolve().then(c.bind(c,6993)),"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/layout.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(c.bind(c,79459)),"/home/runner/work/reflex-agent/reflex-agent/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,47319,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,82295,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,91570,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,72845,23)),"next/dist/client/components/builtin/unauthorized.js"]}]}.children,J=["/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/page.tsx"],K={require:c,loadChunk:()=>Promise.resolve()},L=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/roots/[id]/page",pathname:"/roots/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:I},distDir:".next",relativeProjectDir:""});async function M(a,b,d){var D;let H="/roots/[id]/page";"/index"===H&&(H="/");let N=(0,h.getRequestMeta)(a,"postponed"),O=(0,h.getRequestMeta)(a,"minimalMode"),P=await L.prepare(a,b,{srcPage:H,multiZoneDraftMode:!1});if(!P)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Q,query:R,params:S,parsedUrl:T,pageIsDynamic:U,buildManifest:V,nextFontManifest:W,reactLoadableManifest:X,serverActionsManifest:Y,clientReferenceManifest:Z,subresourceIntegrityManifest:$,prerenderManifest:_,isDraftMode:aa,resolvedPathname:ab,revalidateOnlyGenerated:ac,routerServerContext:ad,nextConfig:ae,interceptionRoutePatterns:af}=P,ag=T.pathname||"/",ah=(0,s.normalizeAppPath)(H),{isOnDemandRevalidate:ai}=P,aj=L.match(ag,_),ak=!!_.routes[ab],al=!!(aj||ak||_.routes[ah]),am=a.headers["user-agent"]||"",an=(0,v.getBotType)(am),ao=(0,q.isHtmlBotRequest)(a),ap=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[u.NEXT_ROUTER_PREFETCH_HEADER],aq=(0,h.getRequestMeta)(a,"isRSCRequest")??(0,n.f)(a.headers[u.RSC_HEADER]),ar=(0,t.getIsPossibleServerAction)(a),as=(0,m.checkIsAppPPREnabled)(ae.experimental.ppr)&&(null==(D=_.routes[ah]??_.dynamicRoutes[ah])?void 0:D.renderingMode)==="PARTIALLY_STATIC",at=!1,au=!1,av=as?N:void 0,aw=as&&aq&&!ap,ax=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ay=!am||(0,q.shouldServeStreamingMetadata)(am,ae.htmlLimitedBots);ao&&as&&(al=!1,ay=!1);let az=!0===L.isDev||!al||"string"==typeof N||aw,aA=ao&&as,aB=null;aa||!al||az||ar||av||aw||(aB=ab);let aC=aB;!aC&&L.isDev&&(aC=ab),L.isDev||aa||!al||!aq||aw||(0,k.d)(a.headers);let aD={...F,tree:I,pages:J,GlobalError:E(),handler:M,routeModule:L,__next_app__:K};Y&&Z&&(0,p.setReferenceManifestsSingleton)({page:H,clientReferenceManifest:Z,serverActionsManifest:Y,serverModuleMap:(0,r.createServerModuleMap)({serverActionsManifest:Y})});let aE=a.method||"GET",aF=(0,g.getTracer)(),aG=aF.getActiveScopeSpan();try{let f=L.getVaryHeader(ab,af);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return L.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aF.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aE} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aE} ${a.url}`)})},m=async({span:e,postponed:f,fallbackRouteParams:g})=>{let i={query:R,params:S,page:ah,sharedContext:{buildId:Q},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aD,Component:(0,j.T)(aD),params:S,routeModule:L,page:H,postponed:f,shouldWaitOnAllReady:aA,serveStreamingMetadata:ay,supportsDynamicResponse:"string"==typeof f||az,buildManifest:V,nextFontManifest:W,reactLoadableManifest:X,subresourceIntegrityManifest:$,serverActionsManifest:Y,clientReferenceManifest:Z,setIsrStatus:null==ad?void 0:ad.setIsrStatus,dir:c(33873).join(process.cwd(),L.relativeProjectDir),isDraftMode:aa,isRevalidate:al&&!f&&!aw,botType:an,isOnDemandRevalidate:ai,isPossibleServerAction:ar,assetPrefix:ae.assetPrefix,nextConfigOutput:ae.output,crossOrigin:ae.crossOrigin,trailingSlash:ae.trailingSlash,previewProps:_.preview,deploymentId:ae.deploymentId,enableTainting:ae.experimental.taint,htmlLimitedBots:ae.htmlLimitedBots,devtoolSegmentExplorer:ae.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ae.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ae.experimental.cacheLife,basePath:ae.basePath,serverActions:ae.experimental.serverActions,...at?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:at}:{},experimental:{isRoutePPREnabled:as,expireTime:ae.expireTime,staleTimes:ae.experimental.staleTimes,cacheComponents:!!ae.experimental.cacheComponents,clientSegmentCache:!!ae.experimental.clientSegmentCache,clientParamParsing:!!ae.experimental.clientParamParsing,dynamicOnHover:!!ae.experimental.dynamicOnHover,inlineCss:!!ae.experimental.inlineCss,authInterrupts:!!ae.experimental.authInterrupts,clientTraceMetadata:ae.experimental.clientTraceMetadata||[]},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>L.onRequestError(a,b,d,ad),err:(0,h.getRequestMeta)(a,"invokeError"),dev:L.isDev}},l=await k(e,i),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[z.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,al&&(null==n?void 0:n.revalidate)===0&&!L.isDev&&!as){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ab}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
|
|
5
|
-
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:w.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},n=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i})=>{let j,k=!1===L.isDev,l=c||b.writableEnded;if(ai&&ac&&!f&&!O)return(null==ad?void 0:ad.render404)?await ad.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(aj&&(j=(0,x.parseFallbackField)(aj.fallback)),j===x.FallbackMode.PRERENDER&&(0,v.isBot)(am)&&(!as||ao)&&(j=x.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ai=!0),ai&&(j!==x.FallbackMode.NOT_FOUND||f)&&(j=x.FallbackMode.BLOCKING_STATIC_RENDER),!O&&j!==x.FallbackMode.BLOCKING_STATIC_RENDER&&aC&&!l&&!aa&&U&&(k||!ak)){let b;if((k||aj)&&j===x.FallbackMode.NOT_FOUND)throw new C.NoFallbackError;if(as&&!aq){let c="string"==typeof(null==aj?void 0:aj.fallback)?aj.fallback:k?ah:null;if(b=await L.handleResponse({cacheKey:c,req:a,nextConfig:ae,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:_,isRoutePPREnabled:as,responseGenerator:async()=>m({span:i,postponed:void 0,fallbackRouteParams:k||au?(0,o.u)(ah):null}),waitUntil:d.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let n=ai||g||!av?void 0:av;if(at&&void 0!==n)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:w.CachedRouteKind.PAGES,html:y.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let p=U&&as&&((0,h.getRequestMeta)(a,"renderFallbackShell")||au)?(0,o.u)(ag):null;return m({span:i,postponed:n,fallbackRouteParams:p})},p=async c=>{var f,g,i,j,k;let l,o=await L.handleResponse({cacheKey:aB,responseGenerator:a=>n({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ai,isRoutePPREnabled:as,req:a,nextConfig:ae,prerenderManifest:_,waitUntil:d.waitUntil});if(aa&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),L.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!o){if(aB)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=o.value)?void 0:f.kind)!==w.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=o.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof o.value.postponed;al&&!aw&&(!p||ap)&&(O||b.setHeader("x-nextjs-cache",ai?"REVALIDATED":o.isMiss?"MISS":o.isStale?"STALE":"HIT"),b.setHeader(u.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=o;if(av)l={revalidate:0,expire:void 0};else if(O&&aq&&!ap&&as)l={revalidate:0,expire:void 0};else if(!L.isDev)if(aa)l={revalidate:0,expire:void 0};else if(al){if(o.cacheControl)if("number"==typeof o.cacheControl.revalidate){if(o.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${o.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:o.cacheControl.revalidate,expire:(null==(j=o.cacheControl)?void 0:j.expire)??ae.expireTime}}else l={revalidate:z.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(o.cacheControl=l,"string"==typeof ax&&(null==q?void 0:q.kind)===w.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(u.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[z.NEXT_CACHE_TAGS_HEADER];O&&al&&c&&"string"==typeof c&&b.setHeader(z.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(ax);return void 0!==d?(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.fromStatic(d,u.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl}):(b.statusCode=204,(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.EMPTY,cacheControl:o.cacheControl}))}let r=(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...o,value:{...o.value,kind:"PAGE"}},{url:(0,h.getRequestMeta)(a,"initURL")}))return null;if(p&&av)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(O&&al||delete a[z.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[z.NEXT_CACHE_TAGS_HEADER];if(O&&al&&s&&"string"==typeof s&&b.setHeader(z.NEXT_CACHE_TAGS_HEADER,s),!q.status||aq&&as||(b.statusCode=q.status),!O&&q.status&&G.RedirectStatusCode[q.status]&&aq&&(b.statusCode=200),p&&b.setHeader(u.NEXT_DID_POSTPONE_HEADER,"1"),aq&&!aa){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:q.html,cacheControl:aw?{revalidate:0,expire:void 0}:o.cacheControl})}return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.fromStatic(q.rscData,u.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl})}let t=q.html;if(!p||O||aq)return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:o.cacheControl});if(at)return t.push(new ReadableStream({start(a){a.enqueue(A.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}});let v=new TransformStream;return t.push(v.readable),m({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==w.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(v.writable)}).catch(a=>{v.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}})};if(!aG)return await aF.withPropagatedContext(a.headers,()=>aF.trace(i.BaseServerSpan.handleRequest,{spanName:`${aE} ${a.url}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aE,"http.target":a.url}},p));await p(aG)}catch(b){throw b instanceof C.NoFallbackError||await L.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"render",revalidateReason:(0,f.c)({isRevalidate:al,isOnDemandRevalidate:ai})},ad),b}}},68951:(a,b,c)=>{"use strict";c.d(b,{RemoveRootButton:()=>m});var d=c(64173),e=c(17240),f=c(97338),g=c(44052),h=c(87671),i=c(20583),j=c(3265);let k=(0,j.createServerReference)("4063845d06d92e1fea74f8ae88cdcd80c8a44c3a24",j.callServer,void 0,j.findSourceMapURL,"removeRootAction");var l=c(88724);function m({id:a,path:b,redirectHome:c}){let[j,m]=(0,e.useTransition)(),n=(0,h.useRouter)();return(0,d.jsx)(i.$,{variant:"ghost",size:"sm",disabled:j,title:"Delete Space",onClick:()=>{confirm(`Delete this Space?
|
|
1
|
+
(()=>{var a={};a.id=8138,a.ids=[8138],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},574:(a,b,c)=>{"use strict";c.d(b,{AddUtilityButton:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call AddUtilityButton() from the server but AddUtilityButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/_components/add-utility-button.tsx","AddUtilityButton")},770:(a,b,c)=>{"use strict";c.d(b,{RunInitButton:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call RunInitButton() from the server but RunInitButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/_components/run-init-button.tsx","RunInitButton")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3442:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},4984:a=>{"use strict";a.exports=require("readline")},7206:a=>{"use strict";a.exports=import("execa")},8086:a=>{"use strict";a.exports=require("module")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12135:(a,b,c)=>{"use strict";c.d(b,{RemoveRootButton:()=>m});var d=c(64173),e=c(17240),f=c(97338),g=c(44052),h=c(87671),i=c(20583),j=c(3265);let k=(0,j.createServerReference)("40c84b38aef24fa2815317cc7ce1fffbeca8f8263b",j.callServer,void 0,j.findSourceMapURL,"removeRootAction");var l=c(88724);function m({id:a,path:b,redirectHome:c}){let[j,m]=(0,e.useTransition)(),n=(0,h.useRouter)();return(0,d.jsx)(i.$,{variant:"ghost",size:"sm",disabled:j,title:"Delete Space",onClick:()=>{confirm(`Delete this Space?
|
|
6
2
|
|
|
7
3
|
Path: ${b}
|
|
8
4
|
|
|
@@ -10,4 +6,8 @@ This wipes the .reflex/ folder (KB, topics, memory, suggestions, audit) and remo
|
|
|
10
6
|
|
|
11
7
|
Your own files in the folder are NOT touched.
|
|
12
8
|
|
|
13
|
-
This cannot be undone.`)&&m(async()=>{let b=await k(a);b.ok?(g.oR.success("Space deleted"),(0,l.$d)(l.Zi.rootsChanged),c&&n.push("/")):g.oR.error(b.error??"Failed to delete")})},children:(0,d.jsx)(f.A,{className:"h-4 w-4 text-muted-foreground"})})}},69284:(a,b,c)=>{"use strict";c.d(b,{g:()=>e});var d=c(3265);let e=(0,d.createServerReference)("401d6894dac39fc99506d91d97d3880161d3503be6",d.callServer,void 0,d.findSourceMapURL,"installCuratedAction")},71152:a=>{"use strict";a.exports=require("esbuild")},72781:(a,b,c)=>{"use strict";c.d(b,{AddUtilityButton:()=>y});var d=c(64173),e=c(17240),f=c(1056),g=c.n(f),h=c(87671),i=c(71813),j=c(97162);let k=(0,c(42557).A)("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);var l=c(66979),m=c(62261),n=c(65177),o=c(97338),p=c(12619),q=c(44171),r=c(44052),s=c(20583);c(37509);var t=c(3265);t.callServer,t.findSourceMapURL;let u=(0,t.createServerReference)("40e33e325692250a5d9d2bd6cd40a52eef89d4819f",t.callServer,void 0,t.findSourceMapURL,"applyUtilityUpdateAction");var v=c(69284),w=c(13682),x=c(88724);function y({rootId:a,installed:b}){let c=(0,i.c)("roots"),[f,t]=(0,e.useState)(!1),[y,z]=(0,e.useState)([]),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useTransition)(),[G,H]=(0,e.useState)([]),I=(0,e.useRef)(null),J=(0,h.useRouter)(),K=new Set(b.map(a=>a.id)),L=b.filter(a=>"project"===a.scope),M=new Map(G.map(a=>[a.id,a]));return(0,d.jsxs)("div",{className:"relative",ref:I,children:[(0,d.jsxs)(s.$,{type:"button",variant:"ghost",size:"sm",className:"gap-1",onClick:()=>t(a=>!a),title:c("addUtility.buttonTitle"),children:[(0,d.jsx)(j.A,{className:"h-4 w-4"}),c("addUtility.buttonLabel"),L.length>0&&(0,d.jsx)("span",{className:"ml-1 text-[10px] rounded-full bg-violet-100 text-violet-700 px-1.5",children:L.length}),G.length>0&&(0,d.jsxs)("span",{className:"ml-0.5 text-[10px] rounded-full bg-amber-100 text-amber-800 px-1.5 inline-flex items-center gap-0.5",title:c("addUtility.updatesTitle",{count:G.length}),children:[(0,d.jsx)(k,{className:"h-2.5 w-2.5"}),G.length]})]}),f&&(0,d.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-30 w-[440px] max-h-[75vh] overflow-y-auto rounded-lg border bg-popover shadow-lg",children:[(0,d.jsxs)("div",{className:"sticky top-0 bg-popover flex items-center gap-2 px-3 py-2 border-b",children:[(0,d.jsx)(j.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,d.jsx)("span",{className:"text-xs font-medium",children:c("addUtility.popoverTitle")}),(0,d.jsx)("button",{type:"button",onClick:()=>t(!1),className:"ml-auto p-0.5 rounded hover:bg-accent",children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]}),L.length>0&&(0,d.jsxs)("section",{className:"p-2 border-b",children:[(0,d.jsx)("div",{className:"px-1 text-[10px] uppercase tracking-wider text-muted-foreground mb-1.5",children:c("addUtility.installedInProject")}),(0,d.jsx)("ul",{className:"space-y-1",children:L.map(b=>{let e=M.get(b.id);return(0,d.jsxs)("li",{className:"flex items-center gap-1.5 rounded-md border bg-card px-2 py-1.5 text-xs",children:[(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"truncate font-medium",children:b.name}),e&&(0,d.jsxs)("div",{className:"text-[10px] text-amber-700 inline-flex items-center gap-0.5",children:[(0,d.jsx)(k,{className:"h-2.5 w-2.5"}),e.currentVersion," → ",e.latestVersion]})]}),e&&(0,d.jsxs)("button",{type:"button",onClick:()=>{D(e.id),F(async()=>{let b=await u({...e,rootId:a});if(D(null),!b.ok)return void r.oR.error(b.error);r.oR.success(c("addUtility.applyUpdateSuccess",{name:e.name,from:e.currentVersion,to:b.newVersion})),H(a=>a.filter(a=>a.id!==e.id)),(0,x.$d)(x.Zi.kbChanged(a)),J.refresh()})},disabled:E&&C===b.id,className:"text-[11px] rounded bg-amber-600 px-2 py-1 text-white hover:bg-amber-700 disabled:opacity-50 inline-flex items-center gap-0.5",title:c("addUtility.applyUpdateTitle"),children:[E&&C===b.id?(0,d.jsx)(m.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(k,{className:"h-3 w-3"}),c("addUtility.updateAction")]}),(0,d.jsx)(g(),{href:`/utilities/${b.scope}/${b.id}?rootId=${encodeURIComponent(a)}`,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:c("addUtility.openAction"),children:(0,d.jsx)(n.A,{className:"h-3 w-3"})}),(0,d.jsx)("button",{type:"button",onClick:()=>{confirm(c("addUtility.removeConfirm",{name:b.name}))&&(D(b.id),F(async()=>{let d=await (0,w.j)(b.scope,b.id,"project"===b.scope?a:void 0);if(D(null),!d.ok)return void r.oR.error(d.error??c("addUtility.removeFailed"));r.oR.success(c("addUtility.removeSuccess",{name:b.name})),(0,x.$d)(x.Zi.kbChanged(a)),J.refresh()}))},disabled:E&&C===b.id,className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-50",title:c("addUtility.removeAction"),children:E&&C===b.id?(0,d.jsx)(m.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(o.A,{className:"h-3 w-3"})})]},b.id)})})]}),(0,d.jsxs)("section",{className:"p-2",children:[(0,d.jsx)("div",{className:"px-1 text-[10px] uppercase tracking-wider text-muted-foreground mb-1.5",children:c("addUtility.catalog")}),A?(0,d.jsxs)("div",{className:"px-2 py-4 text-xs text-muted-foreground flex items-center gap-1.5",children:[(0,d.jsx)(m.A,{className:"h-3 w-3 animate-spin"}),c("addUtility.loading")]}):0===y.length?(0,d.jsx)("p",{className:"px-2 py-4 text-xs text-muted-foreground",children:c("addUtility.catalogEmpty")}):(0,d.jsx)("ul",{className:"space-y-1",children:y.map(b=>{let e=K.has(b.id),f=C===b.id&&E;return(0,d.jsx)("li",{className:"rounded-md border bg-card px-2 py-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"text-xl leading-none",children:b.emoji}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"font-medium text-sm",children:b.name}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug",children:b.description})]}),e?(0,d.jsxs)("span",{className:"text-[10px] text-emerald-700 inline-flex items-center gap-0.5",children:[(0,d.jsx)(p.A,{className:"h-3 w-3"})," ",c("addUtility.already")]}):(0,d.jsxs)("button",{type:"button",onClick:()=>{D(b.id),F(async()=>{let d=b.suggestedScope??"global",e=await (0,v.g)({github:b.github,scope:d,..."project"===d?{rootId:a}:{}});if(D(null),!e.ok)return void r.oR.error(e.error);r.oR.success(c("addUtility.installSuccess",{name:b.name})),(0,x.$d)(x.Zi.kbChanged(a)),J.refresh()})},disabled:f||E,className:"text-[11px] rounded bg-violet-600 px-2 py-1 text-white hover:bg-violet-700 disabled:opacity-50 inline-flex items-center gap-0.5",children:[f?(0,d.jsx)(m.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(q.A,{className:"h-3 w-3"}),c("addUtility.add")]})]})},b.id)})})]})]})]})}},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},75482:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},78645:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Ik:()=>u,K9:()=>s,rg:()=>v});var e=c(73745);c(66493);var f=c(73024),g=c(76760),h=c.n(g),i=c(65326),j=c(53905),k=c(50108),l=c(36017),m=c(5492),n=c(51021),o=c(1947),p=c(81483),q=c(63781),r=a([k,n,o]);async function s(a){try{let b=await f.promises.stat(a).catch(()=>null);if(!b||!b.isDirectory())return{ok:!1,error:`Not a directory: ${a}`};let c=await (0,j.addRoot)(a);(0,i.revalidatePath)("/");let d=await t(c).catch(()=>void 0);return{ok:!0,id:c.id,...d?{onboardingTopicId:d}:{}}}catch(a){return{ok:!1,error:x(a)}}}async function t(a){let b=await (0,l.loadSettings)(),c=b.assignments.chat,d=await (0,m.createTopic)({root:a.path,firstMessage:"Space onboarding",harness:c.harness,model:c.model,language:b.language}),e=await (0,n.startOrchestratorTurn)({rootId:a.id,topicId:d.meta.id,message:"/skill space-onboarding",attachments:[]});return"error"in e,d.meta.id}async function u(a,b,c=!1){try{let d=await (0,l.loadSettings)(),e=d.assignments.analyze,f="claude-code"===e.harness||"codex"===e.harness?e.harness:void 0;return await (0,k.E)(a,{scaffoldOnly:c,language:d.language,...f?{harness:f}:{},...f?{model:e.model}:{}}),c||await (0,j.markInitialized)(b),(0,i.revalidatePath)("/"),(0,i.revalidatePath)(`/roots/${b}`),{ok:!0}}catch(a){return{ok:!1,error:x(a)}}}async function v(a){try{let b=await (0,j.getRoot)(a);if(!b)return(0,i.revalidatePath)("/"),{ok:!0};let c=h().join(b.path,".reflex");await f.promises.rm(c,{recursive:!0,force:!0}).catch(()=>null);let d=h().basename(b.path);return await w({projectName:d,projectPath:b.path}),await (0,j.removeRoot)(a),(0,i.revalidatePath)("/"),(0,i.revalidatePath)(`/roots/${a}`),{ok:!0}}catch(a){return{ok:!1,error:x(a)}}}async function w(a){let b=new Set;if(a.projectName.trim()&&b.add(a.projectName.trim()),a.projectPath.trim()&&b.add(a.projectPath.trim()),0!==b.size)for(let a of p.cs){let c=await (0,o.MJ)({scope:"global"},a);if(!c.content)continue;let d=c.content.split("\n").filter(a=>{let c=a.toLowerCase();for(let a of b)if(c.includes(a.toLowerCase()))return!1;return!0}).join("\n").trim();d!==c.content.trim()&&await (0,o.xP)({scope:"global"},a,"replace",{content:d})}}function x(a){if(a instanceof Error){try{let b=JSON.parse(a.message);if(Array.isArray(b))return b.map(a=>"object"==typeof a&&null!==a&&"message"in a?String(a.message):String(a)).join("; ")}catch{}return a.message}return String(a)}[k,n,o]=r.then?(await r)():r,(0,q.D)([s,u,v]),(0,e.A)(s,"40cee193dfb56002fe738047aa328894a3028ba467",null),(0,e.A)(u,"70eba1072f8cebe25de73e8d257d34b5ccfe73f429",null),(0,e.A)(v,"4063845d06d92e1fea74f8ae88cdcd80c8a44c3a24",null),d()}catch(a){d(a)}})},79428:a=>{"use strict";a.exports=require("buffer")},79646:a=>{"use strict";a.exports=require("child_process")},79734:(a,b,c)=>{"use strict";c.d(b,{D:()=>j,z:()=>i});var d=c(73024),e=c(76760),f=c.n(e),g=c(879),h=c(54287);async function i(a){let b=f().resolve(a.root),c=f().resolve(a.scope),d=f().relative(b,c);if(d.startsWith(".."))throw Error(`Scope ${c} is outside root ${b}`);let e=d?(0,h.x9)(b,d):f().join(b,h.fW),i=[];for await(let a of(0,g.G)(c))"."!==a.rel&&(a.isDir||i.push(a.rel));return{root:b,scope:c,reflexScope:e,files:i}}async function j(a){let b=f().join(a,h.KZ);try{await d.promises.access(b);return}catch{}await d.promises.writeFile(b,"# .reflexignore — gitignore syntax\n# Patterns listed here are excluded from Reflex's analysis and watchers.\n\nnode_modules/\ndist/\nbuild/\n.venv/\n__pycache__/\n*.log\n","utf8")}},79868:a=>{"use strict";a.exports=require("node:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88874:(a,b,c)=>{"use strict";c.d(b,{RunInitButton:()=>m});var d=c(64173),e=c(17240),f=c(62261),g=c(52869),h=c(44052),i=c(20583),j=c(3265);let k=(0,j.createServerReference)("70eba1072f8cebe25de73e8d257d34b5ccfe73f429",j.callServer,void 0,j.findSourceMapURL,"runInitAction");var l=c(88724);function m({rootPath:a,rootId:b}){let[c,j]=(0,e.useTransition)();return(0,d.jsx)(i.$,{onClick:()=>j(async()=>{let c=h.oR.loading("Running agent — this can take a minute or two…"),d=await k(a,b,!1);h.oR.dismiss(c),d.ok?(h.oR.success("Init complete"),(0,l.$d)(l.Zi.kbChanged(b)),(0,l.$d)(l.Zi.rootsChanged)):h.oR.error(d.error??"Init failed")}),disabled:c,children:c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.A,{className:"mr-2 h-4 w-4 animate-spin"})," Running…"]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.A,{className:"mr-2 h-4 w-4"})," Run init"]})})}},90510:(a,b,c)=>{Promise.resolve().then(c.bind(c,41693)),Promise.resolve().then(c.bind(c,68951)),Promise.resolve().then(c.bind(c,90934)),Promise.resolve().then(c.bind(c,72781)),Promise.resolve().then(c.bind(c,15620)),Promise.resolve().then(c.bind(c,7373)),Promise.resolve().then(c.bind(c,88874)),Promise.resolve().then(c.bind(c,46013)),Promise.resolve().then(c.bind(c,51189)),Promise.resolve().then(c.bind(c,66180)),Promise.resolve().then(c.bind(c,75266)),Promise.resolve().then(c.bind(c,14360)),Promise.resolve().then(c.bind(c,6786)),Promise.resolve().then(c.bind(c,44896)),Promise.resolve().then(c.bind(c,14848)),Promise.resolve().then(c.bind(c,53710)),Promise.resolve().then(c.bind(c,30544)),Promise.resolve().then(c.bind(c,13829)),Promise.resolve().then(c.bind(c,90044)),Promise.resolve().then(c.bind(c,57673)),Promise.resolve().then(c.bind(c,97053)),Promise.resolve().then(c.bind(c,43151)),Promise.resolve().then(c.bind(c,12156)),Promise.resolve().then(c.bind(c,71615)),Promise.resolve().then(c.bind(c,4080)),Promise.resolve().then(c.bind(c,87177)),Promise.resolve().then(c.bind(c,87634)),Promise.resolve().then(c.bind(c,6912)),Promise.resolve().then(c.bind(c,13976)),Promise.resolve().then(c.bind(c,18282)),Promise.resolve().then(c.bind(c,20633)),Promise.resolve().then(c.bind(c,61193)),Promise.resolve().then(c.bind(c,66188)),Promise.resolve().then(c.bind(c,66643)),Promise.resolve().then(c.bind(c,81669)),Promise.resolve().then(c.bind(c,39991)),Promise.resolve().then(c.bind(c,54972)),Promise.resolve().then(c.t.bind(c,1056,23))},90558:(a,b,c)=>{"use strict";c.d(b,{CommandBar:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call CommandBar() from the server but CommandBar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/_components/command-bar.tsx","CommandBar")},91745:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{R1:()=>n,RR:()=>m,c9:()=>l});var e=c(73745);c(66493);var f=c(81483),g=c(1947),h=c(53905),i=c(63781),j=a([g]);async function k(a,b){if("global"===a)return;if(!b)throw Error("project memory requires rootId");let c=await (0,h.getRoot)(b);if(!c)throw Error(`unknown root: ${b}`);return c.path}async function l(a){try{if(!(0,f.qL)(a.scope))return{ok:!1,error:"invalid scope"};let b=await k(a.scope,a.rootId),c=await (0,g.ab)(b?{scope:"project",rootPath:b}:{scope:"global"}),d=f.cs.map(a=>({file:a,content:c[a].content??"",lines:c[a].lines,cap:f.h0[a],tier:f.a9[a],description:f.lh[a]}));return{ok:!0,files:d}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function m(a){try{if(!(0,f.qL)(a.scope))return{ok:!1,error:"invalid scope"};if(!(0,f.UV)(a.file))return{ok:!1,error:"invalid file"};let b=await k(a.scope,a.rootId),c=await (0,g.xP)(b?{scope:"project",rootPath:b}:{scope:"global"},a.file,"replace",{content:a.content});if(!c.ok)return{ok:!1,error:c.error??"write failed",lines:c.lines,cap:c.cap};return{ok:!0,lines:c.lines,cap:c.cap}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function n(a){try{if(!(0,f.qL)(a.scope))return{ok:!1,error:"invalid scope"};let b=await k(a.scope,a.rootId),c=b?{scope:"project",rootPath:b}:{scope:"global"};for(let a of f.cs)await (0,g.xP)(c,a,"replace",{content:""});return{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}g=(j.then?(await j)():j)[0],(0,i.D)([l,m,n]),(0,e.A)(l,"40d2c90b38d1d30c023a591d63acdf6ec346922985",null),(0,e.A)(m,"40f39ecbb64c7ccc87b094dcffa2a8d6cb24103efe",null),(0,e.A)(n,"401617ce87a323543766021939be22a6c8fb823be3",null),d()}catch(a){d(a)}})},98783:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Yr:()=>o,ct:()=>n,uy:()=>m});var e=c(73745);c(66493);var f=c(65326),g=c(53905),h=c(22421),i=c(13415),j=c(1947),k=c(63781),l=a([i,j]);async function m(a){try{let b=await (0,g.getRoot)(a);if(!b)return{ok:!1,error:"Root not found"};let c=await (0,h.vd)(b.path);return{ok:!0,items:c}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function n(a){try{let b=await (0,g.getRoot)(a.rootId);if(!b)return{ok:!1,error:"Root not found"};let c=(await (0,h.vd)(b.path)).find(b=>b.id===a.suggestionId);if(!c)return{ok:!1,error:"Suggestion not found or already actioned"};let d=await (0,i.g3)(a.rootId,c.prompt,[]);if(!d.ok)return{ok:!1,error:d.error??"topic start failed"};return await (0,h.Bd)(b.path,c.id,d.topicId),(0,f.revalidatePath)(`/roots/${a.rootId}`),{ok:!0,topicId:d.topicId}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function o(a){try{let b=await (0,g.getRoot)(a.rootId);if(!b)return{ok:!1,error:"Root not found"};let c=(await (0,h.vd)(b.path)).find(b=>b.id===a.suggestionId);if(!c)return{ok:!1,error:"Suggestion not found"};let d=`Rejected suggestion: "${c.title}" (${c.kind})`;return await (0,j.xP)({scope:"project",rootPath:b.path},"AVOID","append",{content:d}),await (0,h.eJ)(b.path,c.id),(0,f.revalidatePath)(`/roots/${a.rootId}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}[i,j]=l.then?(await l)():l,(0,k.D)([m,n,o]),(0,e.A)(m,"406954ae9e949798ecbb1553e67832c7d372b06ee6",null),(0,e.A)(n,"40b36424b2bddd50f3460c781e2905f89a4d0d6356",null),(0,e.A)(o,"4026639a58bac280b123087c3f678ee116d819daaa",null),d()}catch(a){d(a)}})}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[9803,8404,9631,7229,4460,5895,8056,4842,5543,1105,4251,1358,285,9861,9840,4333,4812,3943,2420,9809],()=>b(b.s=65686));module.exports=c})();
|
|
9
|
+
This cannot be undone.`)&&m(async()=>{let b=await k(a);b.ok?(g.oR.success("Space deleted"),(0,l.$d)(l.Zi.rootsChanged),c&&n.push("/")):g.oR.error(b.error??"Failed to delete")})},children:(0,d.jsx)(f.A,{className:"h-4 w-4 text-muted-foreground"})})}},15156:(a,b,c)=>{"use strict";c.d(b,{RunInitButton:()=>m});var d=c(64173),e=c(17240),f=c(62261),g=c(52869),h=c(44052),i=c(20583),j=c(3265);let k=(0,j.createServerReference)("70892c3f3270339b060cb75287e8c8418238f1b7ca",j.callServer,void 0,j.findSourceMapURL,"runInitAction");var l=c(88724);function m({rootPath:a,rootId:b}){let[c,j]=(0,e.useTransition)();return(0,d.jsx)(i.$,{onClick:()=>j(async()=>{let c=h.oR.loading("Running agent — this can take a minute or two…"),d=await k(a,b,!1);h.oR.dismiss(c),d.ok?(h.oR.success("Init complete"),(0,l.$d)(l.Zi.kbChanged(b)),(0,l.$d)(l.Zi.rootsChanged)):h.oR.error(d.error??"Init failed")}),disabled:c,children:c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.A,{className:"mr-2 h-4 w-4 animate-spin"})," Running…"]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.A,{className:"mr-2 h-4 w-4"})," Run init"]})})}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19356:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},20567:(a,b,c)=>{"use strict";c.d(b,{AU:()=>j,Z9:()=>i});var d=c(73024);c(76760);var e=c(56149),f=c(54287);let g=e.Ik({watchDebounceMs:e.ai().int().min(f.a,{message:`watchDebounceMs must be ≥ ${f.a} ms`}).default(f.VU),agentBackend:e.k5(["codex","claude-code"]).default("claude-code"),ignoreFile:e.Yj().default(".reflexignore")}),h=g.parse({});async function i(a){let b=(0,f.eQ)(a);try{let a=await d.promises.readFile(b,"utf8");return g.parse(JSON.parse(a))}catch(a){var c;if("object"==typeof(c=a)&&null!==c&&"code"in c&&"ENOENT"===c.code)return h;throw a}}async function j(a,b){await d.promises.mkdir((0,f.FF)(a),{recursive:!0}),await d.promises.writeFile((0,f.eQ)(a),JSON.stringify(b,null,2)+"\n","utf8")}},21820:a=>{"use strict";a.exports=require("os")},23307:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{"000383b3b4150ac0200d3c3d0cf190c45eeae8641c":()=>t.w,"00057fc626059ed5185a070538b6e7e3006e0bbb4b":()=>l.Ng,"0009f653d714812f71443fada3df6d58bc9a8393cd":()=>m.Bp,"003187e71ac8e8e7a6374a21297f382fa77567f763":()=>p.wd,"0040ef250b316a7df1d400c5f6e7aa35218c5b98b9":()=>g.i,"008be4ab0a2c1fbe053424469bc4895f4f1630ddae":()=>l.Fm,"008ded1d9fe09296d30c9e7fc88f7df16740a0fbd7":()=>l.Nt,"00ab5100f09179bccd321ad4dd8266b6bc032ff949":()=>l.Zl,"00fe6e4dc3e30950a754db414464d39a9d8db0299f":()=>k.L8,"400d313ed5e0b7daf86947e171819a9c78339fad36":()=>m.mR,"401030fc31868af8226f3dbd4833e1ee593e306da9":()=>j.K9,"401beeb658b78410f707011958583c0aa81eb1cf65":()=>h.MU,"401ce6f7116ef91f433d75ab72508fa1c81f5ff6a6":()=>e.nY,"402315f9741b533ab5d137e4e652fe469d60761f49":()=>m.Kt,"402688a3202a7e3037e9a73ad7c666c6dec6d26479":()=>k.ns,"402ab9a387dcc73def39a2faff0f9b8fb16a01a554":()=>m.L_,"403d3588d904a02646778d85f6e2cc9d1b56178216":()=>i.uA,"403f7df439429657ddd038d5211bcde263490efa1a":()=>h.$z,"40493c396fbeb942eb2451b6b0fd04cf9642ab62dc":()=>r.RR,"404f5de4e009086ce5dabcbba64acbf87f5a980b25":()=>i.Cz,"405a74e479bc339b51e7e162a6a1788e3cb5ad36cc":()=>i.hN,"405e1cedf3dd2110a1435fdee6f6437aecf1755900":()=>o.x,"4063852f5ff34346d13e63411cd72c0fc4df1ff20d":()=>m.vv,"4063cf6e924015cf1e2958353b0356a659fb7f80bd":()=>m.k_,"4077453eca26f295a1a8fa4434d318523cc97082be":()=>e.Pd,"4079b03c72b14dd5635ed05df2860dfd3d9ac7815d":()=>m.QR,"4079c90491fc275c0315a46491d0b973e6f7ce96ce":()=>m.RK,"40898c25eb61dcf2b3360001847bb2a4197e4b2759":()=>f.uX,"408e9ddd109926e72fb5cfc5462e1fc34d239fe71d":()=>m.Zh,"40924b7eaeb0f85c2fe29ef13b02e186cddef723f9":()=>p.LL,"40959699a332d0a46d0555e2676d0d19bf48b47de3":()=>p.Xt,"40a5d1300a3e470a6db661ee995173b7dca023b3c4":()=>q.uy,"40b32318ea88fbf4b2c970a4a0bce3064822cf0748":()=>k.Is,"40b6f78729531b741b30672776359fe12625d5f315":()=>m.JR,"40b7b9a12b019ce869c98c6069b624b8cffef6b53d":()=>m.b7,"40b91737fcb2edb010b22caf5f39d3b7d7fcf836a1":()=>f.DW,"40bfc3439875b8c05edc03dac19744637e4e4c3dba":()=>l.bt,"40c15ec8ded15cc5ec9eb918994e4f729aeccb25e1":()=>r.c9,"40c3afc3c8f3e0cfc3023a0e28f39339b17f7be7fa":()=>m.gn,"40c84b38aef24fa2815317cc7ce1fffbeca8f8263b":()=>j.rg,"40cc6831ec3afc3d93ab0f8db8f7c844ec61ff84b8":()=>r.R1,"40cdf427516d351242d8cdb76ed09332ba26b2df82":()=>m.nO,"40d0173311dfc513dc124a51f600030ab3d05c1d23":()=>f.u7,"40dd36708c99c323debf6dfdc5d723986eb3cd5dfb":()=>q.Yr,"40de33cdbc6afcf36b287bb386cc046988ff603f70":()=>m.Yt,"40e41c6f66287c14223a233d8756b941c4763d1729":()=>i.IK,"40ecfcbdfa2479ad3ea225334a55fba56da16275e7":()=>f.zm,"40f1b7d743d741a7ecf30e8871f2f7dc01edf69501":()=>q.ct,"6007f6c1502627489aa43df99e5c9af1d41bb07a74":()=>p.b2,"60276b621e4f622eca904d3fb0a3fc9c94574b60d6":()=>s.tT,"603eaa80fbbe7b3ce4745a86965eca190fc159b8c6":()=>s.Aq,"604e058f00e68939dacbee146a9404c8aa2b6f42f5":()=>e.L4,"605ec3d3420761a459fa140f14cb882b3f06f28d0c":()=>s.J7,"606e9994146ed45fa13ec7ed132eb94d9aa4f08371":()=>n.S,"60a6b50c1412cbe26ad63b2268646fd8c31a9d1964":()=>p.ZC,"60a739378e69d87e74bd0a068ef7024cb39749edbe":()=>s.cl,"60ad4d87c0861c35772dfafc1f067794bbb40a2294":()=>s.hL,"60b6e9ac0cd311856600c4183a632ac26da9f6a401":()=>p.qO,"60be1aa4846a72333cc64ccdcceee4aa48f0b07dfd":()=>e.OQ,"60ce51210f452eeaa52ef82115c984446d397dc24a":()=>s.kv,"60ee466ad20b3daca025aa37742a21e0f5c102bfa4":()=>h.Tc,"60fb2e8ce5715fe6e17166fd6a7ce4e52db6ee822e":()=>s.KV,"70113bf2463be690baa407eef228125e354b511888":()=>m.QI,"70186d2061e06a6d3174513acba28e214c64606ade":()=>s.Mh,"7032ad65dae20d5d8f53caf09395a2a46cec5b89db":()=>m.q_,"7057d700c72d554d04a25c4f20d5f92ad7b3c243d3":()=>s.mm,"70892c3f3270339b060cb75287e8c8418238f1b7ca":()=>j.Ik,"70a40b241b0505ab87d9883731602fd0c483e4de43":()=>m.jf,"70aaf61b6a63a4dd5b7b197cde9f3da8570395923b":()=>m.i8,"70d4a05afd5ee7a4156902edab91f82885a9a0a185":()=>e.h$,"7816a0fbd664dde3368b93b8f7f094cde4d7b8e947":()=>s.ru,"7822c954dd8c0443302b5660c816de3259f25b6237":()=>e.g3});var e=c(13415),f=c(3890),g=c(50995),h=c(15754),i=c(27129),j=c(78645),k=c(16856),l=c(92814),m=c(9328),n=c(4168),o=c(63337),p=c(72901),q=c(98783),r=c(91745),s=c(34639),t=c(48272),u=a([e,f,h,j,m,p,q,r,s]);[e,f,h,j,m,p,q,r,s]=u.then?(await u)():u,d()}catch(a){d(a)}})},24401:(a,b,c)=>{"use strict";c.d(b,{AddUtilityButton:()=>y});var d=c(64173),e=c(17240),f=c(1056),g=c.n(f),h=c(87671),i=c(71813),j=c(97162);let k=(0,c(42557).A)("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);var l=c(66979),m=c(62261),n=c(65177),o=c(97338),p=c(12619),q=c(44171),r=c(44052),s=c(20583);c(53266);var t=c(3265);t.callServer,t.findSourceMapURL;let u=(0,t.createServerReference)("400d313ed5e0b7daf86947e171819a9c78339fad36",t.callServer,void 0,t.findSourceMapURL,"applyUtilityUpdateAction");var v=c(96194),w=c(53845),x=c(88724);function y({rootId:a,installed:b}){let c=(0,i.c)("roots"),[f,t]=(0,e.useState)(!1),[y,z]=(0,e.useState)([]),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useTransition)(),[G,H]=(0,e.useState)([]),I=(0,e.useRef)(null),J=(0,h.useRouter)(),K=new Set(b.map(a=>a.id)),L=b.filter(a=>"project"===a.scope),M=new Map(G.map(a=>[a.id,a]));return(0,d.jsxs)("div",{className:"relative",ref:I,children:[(0,d.jsxs)(s.$,{type:"button",variant:"ghost",size:"sm",className:"gap-1",onClick:()=>t(a=>!a),title:c("addUtility.buttonTitle"),children:[(0,d.jsx)(j.A,{className:"h-4 w-4"}),c("addUtility.buttonLabel"),L.length>0&&(0,d.jsx)("span",{className:"ml-1 text-[10px] rounded-full bg-violet-100 text-violet-700 px-1.5",children:L.length}),G.length>0&&(0,d.jsxs)("span",{className:"ml-0.5 text-[10px] rounded-full bg-amber-100 text-amber-800 px-1.5 inline-flex items-center gap-0.5",title:c("addUtility.updatesTitle",{count:G.length}),children:[(0,d.jsx)(k,{className:"h-2.5 w-2.5"}),G.length]})]}),f&&(0,d.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-30 w-[440px] max-h-[75vh] overflow-y-auto rounded-lg border bg-popover shadow-lg",children:[(0,d.jsxs)("div",{className:"sticky top-0 bg-popover flex items-center gap-2 px-3 py-2 border-b",children:[(0,d.jsx)(j.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,d.jsx)("span",{className:"text-xs font-medium",children:c("addUtility.popoverTitle")}),(0,d.jsx)("button",{type:"button",onClick:()=>t(!1),className:"ml-auto p-0.5 rounded hover:bg-accent",children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]}),L.length>0&&(0,d.jsxs)("section",{className:"p-2 border-b",children:[(0,d.jsx)("div",{className:"px-1 text-[10px] uppercase tracking-wider text-muted-foreground mb-1.5",children:c("addUtility.installedInProject")}),(0,d.jsx)("ul",{className:"space-y-1",children:L.map(b=>{let e=M.get(b.id);return(0,d.jsxs)("li",{className:"flex items-center gap-1.5 rounded-md border bg-card px-2 py-1.5 text-xs",children:[(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"truncate font-medium",children:b.name}),e&&(0,d.jsxs)("div",{className:"text-[10px] text-amber-700 inline-flex items-center gap-0.5",children:[(0,d.jsx)(k,{className:"h-2.5 w-2.5"}),e.currentVersion," → ",e.latestVersion]})]}),e&&(0,d.jsxs)("button",{type:"button",onClick:()=>{D(e.id),F(async()=>{let b=await u({...e,rootId:a});if(D(null),!b.ok)return void r.oR.error(b.error);r.oR.success(c("addUtility.applyUpdateSuccess",{name:e.name,from:e.currentVersion,to:b.newVersion})),H(a=>a.filter(a=>a.id!==e.id)),(0,x.$d)(x.Zi.kbChanged(a)),J.refresh()})},disabled:E&&C===b.id,className:"text-[11px] rounded bg-amber-600 px-2 py-1 text-white hover:bg-amber-700 disabled:opacity-50 inline-flex items-center gap-0.5",title:c("addUtility.applyUpdateTitle"),children:[E&&C===b.id?(0,d.jsx)(m.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(k,{className:"h-3 w-3"}),c("addUtility.updateAction")]}),(0,d.jsx)(g(),{href:`/utilities/${b.scope}/${b.id}?rootId=${encodeURIComponent(a)}`,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:c("addUtility.openAction"),children:(0,d.jsx)(n.A,{className:"h-3 w-3"})}),(0,d.jsx)("button",{type:"button",onClick:()=>{confirm(c("addUtility.removeConfirm",{name:b.name}))&&(D(b.id),F(async()=>{let d=await (0,w.j)(b.scope,b.id,"project"===b.scope?a:void 0);if(D(null),!d.ok)return void r.oR.error(d.error??c("addUtility.removeFailed"));r.oR.success(c("addUtility.removeSuccess",{name:b.name})),(0,x.$d)(x.Zi.kbChanged(a)),J.refresh()}))},disabled:E&&C===b.id,className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-50",title:c("addUtility.removeAction"),children:E&&C===b.id?(0,d.jsx)(m.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(o.A,{className:"h-3 w-3"})})]},b.id)})})]}),(0,d.jsxs)("section",{className:"p-2",children:[(0,d.jsx)("div",{className:"px-1 text-[10px] uppercase tracking-wider text-muted-foreground mb-1.5",children:c("addUtility.catalog")}),A?(0,d.jsxs)("div",{className:"px-2 py-4 text-xs text-muted-foreground flex items-center gap-1.5",children:[(0,d.jsx)(m.A,{className:"h-3 w-3 animate-spin"}),c("addUtility.loading")]}):0===y.length?(0,d.jsx)("p",{className:"px-2 py-4 text-xs text-muted-foreground",children:c("addUtility.catalogEmpty")}):(0,d.jsx)("ul",{className:"space-y-1",children:y.map(b=>{let e=K.has(b.id),f=C===b.id&&E;return(0,d.jsx)("li",{className:"rounded-md border bg-card px-2 py-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"text-xl leading-none",children:b.emoji}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"font-medium text-sm",children:b.name}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug",children:b.description})]}),e?(0,d.jsxs)("span",{className:"text-[10px] text-emerald-700 inline-flex items-center gap-0.5",children:[(0,d.jsx)(p.A,{className:"h-3 w-3"})," ",c("addUtility.already")]}):(0,d.jsxs)("button",{type:"button",onClick:()=>{D(b.id),F(async()=>{let d=b.suggestedScope??"global",e=await (0,v.g)({github:b.github,scope:d,..."project"===d?{rootId:a}:{}});if(D(null),!e.ok)return void r.oR.error(e.error);r.oR.success(c("addUtility.installSuccess",{name:b.name})),(0,x.$d)(x.Zi.kbChanged(a)),J.refresh()})},disabled:f||E,className:"text-[11px] rounded bg-violet-600 px-2 py-1 text-white hover:bg-violet-700 disabled:opacity-50 inline-flex items-center gap-0.5",children:[f?(0,d.jsx)(m.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(q.A,{className:"h-3 w-3"}),c("addUtility.add")]})]})},b.id)})})]})]})]})}},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},28074:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{y:()=>l});var e=c(7206),f=c(73024),g=c(46726),h=c(78744),i=a([e]);e=(i.then?(await i)():i)[0];let k="claude",l={id:"claude-code",async analyzeScope(a){await j(),await f.promises.mkdir(a.reflexScope,{recursive:!0});let b=await (0,h.p)(a),c=["-p",b,"--permission-mode","acceptEdits","--allowedTools","Read,Write,Edit,LS,Glob,Grep","--add-dir",a.reflexScope];a.model&&c.push("--model",a.model),await (0,e.execa)(k,c,{cwd:a.root,stdio:"inherit"})},async chat(a){await j();let b=await (0,h.M)(a);await (0,e.execa)(k,["--append-system-prompt",b,"--add-dir",a.reflexScope],{cwd:a.scope,stdio:"inherit"})}};async function j(){try{await (0,e.execa)(k,["--version"],{stdio:"ignore"})}catch(a){throw new g.g("claude-code",a)}}d()}catch(a){d(a)}})},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29830:(a,b,c)=>{Promise.resolve().then(c.bind(c,86673)),Promise.resolve().then(c.bind(c,62109)),Promise.resolve().then(c.bind(c,16805)),Promise.resolve().then(c.bind(c,574)),Promise.resolve().then(c.bind(c,90558)),Promise.resolve().then(c.bind(c,64845)),Promise.resolve().then(c.bind(c,770)),Promise.resolve().then(c.bind(c,60524)),Promise.resolve().then(c.bind(c,50155)),Promise.resolve().then(c.bind(c,26922)),Promise.resolve().then(c.bind(c,79008)),Promise.resolve().then(c.bind(c,68146)),Promise.resolve().then(c.bind(c,60936)),Promise.resolve().then(c.bind(c,65138)),Promise.resolve().then(c.bind(c,68902)),Promise.resolve().then(c.bind(c,69644)),Promise.resolve().then(c.bind(c,49186)),Promise.resolve().then(c.bind(c,93099)),Promise.resolve().then(c.bind(c,83594)),Promise.resolve().then(c.bind(c,24375)),Promise.resolve().then(c.bind(c,67135)),Promise.resolve().then(c.bind(c,85105)),Promise.resolve().then(c.bind(c,41886)),Promise.resolve().then(c.bind(c,33309)),Promise.resolve().then(c.bind(c,37550)),Promise.resolve().then(c.bind(c,96623)),Promise.resolve().then(c.bind(c,77372)),Promise.resolve().then(c.bind(c,65478)),Promise.resolve().then(c.bind(c,97230)),Promise.resolve().then(c.bind(c,73552)),Promise.resolve().then(c.bind(c,391)),Promise.resolve().then(c.bind(c,4235)),Promise.resolve().then(c.bind(c,41138)),Promise.resolve().then(c.bind(c,60877)),Promise.resolve().then(c.bind(c,7671)),Promise.resolve().then(c.bind(c,5637)),Promise.resolve().then(c.bind(c,36786)),Promise.resolve().then(c.t.bind(c,20594,23))},31041:(a,b,c)=>{"use strict";c.d(b,{BT:()=>i,Wu:()=>j,ZB:()=>h,Zp:()=>f,aR:()=>g,wL:()=>k});var d=c(64173);c(17240);var e=c(91344);function f({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card",className:(0,e.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",a),...b})}function g({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card-header",className:(0,e.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",a),...b})}function h({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card-title",className:(0,e.cn)("leading-none font-semibold",a),...b})}function i({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card-description",className:(0,e.cn)("text-sm text-muted-foreground",a),...b})}function j({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card-content",className:(0,e.cn)("px-6",a),...b})}function k({className:a,...b}){return(0,d.jsx)("div",{"data-slot":"card-footer",className:(0,e.cn)("flex items-center px-6 [.border-t]:pt-6",a),...b})}},31258:(a,b,c)=>{"use strict";c.d(b,{MemoryEditor:()=>s});var d=c(64173),e=c(17240),f=c(44052),g=c(62261),h=c(74868),i=c(13530),j=c(97338),k=c(20583),l=c(31041),m=c(45477),n=c(91344),o=c(3265);let p=(0,o.createServerReference)("40c15ec8ded15cc5ec9eb918994e4f729aeccb25e1",o.callServer,void 0,o.findSourceMapURL,"loadMemoryAction"),q=(0,o.createServerReference)("40493c396fbeb942eb2451b6b0fd04cf9642ab62dc",o.callServer,void 0,o.findSourceMapURL,"saveMemoryFileAction"),r=(0,o.createServerReference)("40cc6831ec3afc3d93ab0f8db8f7c844ec61ff84b8",o.callServer,void 0,o.findSourceMapURL,"wipeMemoryAction");function s({scope:a,rootId:b,title:c,description:f,allowWipe:i}){let[j,k]=(0,e.useState)([]),[m,n]=(0,e.useState)(!0),[o,q]=(0,e.useState)(null),r=(0,e.useCallback)(async()=>{n(!0);let c=await p(b?{scope:a,rootId:b}:{scope:a});if(n(!1),!c.ok)return void q(c.error);q(null),k(c.files)},[a,b]);return(0,d.jsxs)(l.Zp,{children:[(0,d.jsx)(l.aR,{children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)(l.ZB,{className:"text-lg",children:c}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:f})]}),i&&j.length>0&&(0,d.jsx)(u,{scope:a,rootId:b,onWiped:r})]})}),(0,d.jsx)(l.Wu,{children:m?(0,d.jsxs)("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[(0,d.jsx)(g.A,{className:"h-3 w-3 animate-spin"})," Loading…"]}):o?(0,d.jsxs)("p",{className:"text-sm text-destructive flex items-center gap-2",children:[(0,d.jsx)(h.A,{className:"h-3.5 w-3.5"}),o]}):(0,d.jsx)("div",{className:"space-y-4",children:j.map(c=>(0,d.jsx)(t,{snapshot:c,scope:a,rootId:b,onSaved:a=>k(b=>b.map(b=>b.file===a.file?a:b))},c.file))})})]})}function t({snapshot:a,scope:b,rootId:c,onSaved:h}){let[j,l]=(0,e.useState)(a.content),[o,p]=(0,e.useTransition)(),r=j.trim(),s=r?r.split("\n").length:0,t=s>a.cap,u=s>.9*a.cap,v=j!==a.content;return(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:"font-mono text-sm font-semibold",children:a.file}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:a.description})]}),(0,d.jsxs)("span",{className:(0,n.cn)("text-xs tabular-nums",t?"text-destructive font-medium":u?"text-amber-600":"text-muted-foreground"),children:[s,"/",a.cap]})]}),(0,d.jsx)(m.T,{value:j,onChange:a=>l(a.target.value),rows:Math.min(a.cap+2,Math.max(3,s+1)),placeholder:"Empty",className:"font-mono text-xs"}),(0,d.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,d.jsxs)(k.$,{type:"button",size:"sm",variant:v?"default":"ghost",disabled:!v||o||t,onClick:()=>{if(t)return void f.oR.error(`${a.file} exceeds ${a.cap}-line cap (${s}). Trim before saving.`);p(async()=>{let d=await q({scope:b,...c?{rootId:c}:{},file:a.file,content:r});if(!d.ok)return void f.oR.error(d.error??"Save failed");f.oR.success(`Saved ${a.file}`),h({...a,content:r,lines:d.lines})})},children:[o?(0,d.jsx)(g.A,{className:"mr-1 h-3 w-3 animate-spin"}):(0,d.jsx)(i.A,{className:"mr-1 h-3 w-3"}),"Save"]})})]})}function u({scope:a,rootId:b,onWiped:c}){let[g,h]=(0,e.useTransition)();return(0,d.jsxs)(k.$,{type:"button",size:"sm",variant:"ghost",disabled:g,onClick:()=>{confirm("Erase ALL memory at this scope? Cannot be undone.")&&h(async()=>{let d=await r(b?{scope:a,rootId:b}:{scope:a});if(!d.ok)return void f.oR.error(d.error??"Wipe failed");f.oR.success("Memory wiped"),await c()})},className:"text-destructive hover:text-destructive",children:[(0,d.jsx)(j.A,{className:"mr-1 h-3 w-3"}),"Wipe all"]})}},31421:a=>{"use strict";a.exports=require("node:child_process")},33873:a=>{"use strict";a.exports=require("path")},35314:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{j:()=>h});var e=c(28074),f=c(48519),g=a([e,f]);[e,f]=g.then?(await g)():g;let i={"claude-code":e.y,codex:f.C};function h(a){let b=i[a.agentBackend];if(!b)throw Error(`Unknown agent backend: ${a.agentBackend}`);return b}d()}catch(a){d(a)}})},36306:a=>{"use strict";a.exports=import("@tailwindcss/node")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},44171:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},46726:(a,b,c)=>{"use strict";c.d(b,{g:()=>d});class d extends Error{constructor(a,b){super(`Agent backend "${a}" is unavailable: ${b instanceof Error?b.message:String(b)}`),this.name="AgentUnavailableError"}}},47452:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(19963).A)("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]])},48161:a=>{"use strict";a.exports=require("node:os")},48519:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{C:()=>l});var e=c(7206),f=c(73024),g=c(46726),h=c(78744),i=a([e]);e=(i.then?(await i)():i)[0];let k="codex",l={id:"codex",async analyzeScope(a){await j(),await f.promises.mkdir(a.reflexScope,{recursive:!0});let b=await (0,h.p)(a),c=["exec","--cd",a.root,"--sandbox","workspace-write","--add-dir",a.reflexScope];a.model&&c.push("--model",a.model),c.push(b),await (0,e.execa)(k,c,{stdio:"inherit"})},async chat(a){await j();let b=await (0,h.M)(a);await (0,e.execa)(k,["--system",b],{cwd:a.scope,stdio:"inherit"})}};async function j(){try{await (0,e.execa)(k,["--version"],{stdio:"ignore"})}catch(a){throw new g.g("codex",a)}}d()}catch(a){d(a)}})},50108:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{E:()=>m});var e=c(73024),f=c(76760),g=c.n(f),h=c(20567),i=c(35314),j=c(79734),k=c(54287),l=a([i]);async function m(a,b={}){let c=g().resolve(a);await n(c),await e.promises.mkdir((0,k.FF)(c),{recursive:!0});let d=await (0,h.Z9)(c);if(await (0,h.AU)(c,d),await (0,j.D)(c),b.scaffoldOnly)return void process.stdout.write(`Reflex scaffolded at ${(0,k.FF)(c)} (scaffold-only).
|
|
10
|
+
`);let f=b.harness?{...d,agentBackend:b.harness}:d,l=await (0,j.z)({root:c,scope:c}),o={...l,...b.model?{model:b.model}:{},...b.language?{language:b.language}:{}};process.stdout.write(`Running ${f.agentBackend}${b.model?` (${b.model})`:""}${b.language?` [lang=${b.language}]`:""} over ${c} (${l.files.length} files visible)…
|
|
11
|
+
`);let p=(0,i.j)(f);await p.analyzeScope(o),process.stdout.write(`Done. KB written under ${(0,k.FF)(c)}
|
|
12
|
+
`)}async function n(a){let b=await e.promises.stat(a).catch(()=>null);if(!b||!b.isDirectory())throw Error(`Not a directory: ${a}`)}i=(l.then?(await l)():l)[0],d()}catch(a){d(a)}})},51333:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(19963).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},51455:a=>{"use strict";a.exports=require("node:fs/promises")},52869:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},53266:(a,b,c)=>{"use strict";c.d(b,{B:()=>e});var d=c(3265);let e=(0,d.createServerReference)("0009f653d714812f71443fada3df6d58bc9a8393cd",d.callServer,void 0,d.findSourceMapURL,"listCuratedAction")},53845:(a,b,c)=>{"use strict";c.d(b,{j:()=>e});var d=c(3265);let e=(0,d.createServerReference)("70a40b241b0505ab87d9883731602fd0c483e4de43",d.callServer,void 0,d.findSourceMapURL,"removeUtilityAction")},57075:a=>{"use strict";a.exports=require("node:stream")},58550:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{default:()=>C});var e=c(63003),f=c(20594),g=c.n(f),h=c(9310),i=c(17596),j=c(88842),k=c(47452),l=c(51333),m=c(50895),n=c(84913),o=c(67248),p=c(60524),q=c(24576),r=c(11178),s=c(49809),t=c(61105),u=c(64845),v=c(770),w=c(90558),x=c(16805),y=c(86673),z=c(574),A=c(62109),B=a([s]);async function C({params:a}){let{id:b}=await a,c=await (0,q.getRoot)(b);c||(0,h.notFound)();let d=await (0,m.A)("roots"),[f,B,C]=await Promise.all([(0,r.RP)(c.path),(0,s.x)(b),(0,t.dH)({rootId:b})]),D=B.ok?B.snapshot:void 0,E=C.map(a=>({id:a.manifest.id,name:a.manifest.name,scope:a.scope}));return(0,e.jsxs)("main",{className:"flex-1 flex flex-col min-h-0",children:[(0,e.jsxs)("header",{className:"border-b px-6 py-4 flex items-center gap-4",children:[(0,e.jsx)(n.$,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-3",children:(0,e.jsxs)(g(),{href:"/",children:[(0,e.jsx)(i.A,{className:"mr-1 h-4 w-4"})," Roots"]})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(j.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,e.jsx)("h1",{className:"text-base font-medium truncate",children:c.path})]}),(0,e.jsx)("div",{className:"mt-1 flex items-center gap-2 text-xs text-muted-foreground",children:f.exists?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(o.E,{variant:"secondary",children:[f.fileCount," MD files"]}),c.lastInitAt?(0,e.jsxs)("span",{children:["Last init ",new Date(c.lastInitAt).toLocaleString()]}):(0,e.jsx)("span",{children:"No init recorded"})]}):(0,e.jsx)(o.E,{variant:"outline",children:".reflex/ not yet created"})})]}),(0,e.jsx)(z.AddUtilityButton,{rootId:c.id,installed:E}),(0,e.jsx)(n.$,{asChild:!0,variant:"ghost",size:"sm",className:"gap-1",children:(0,e.jsxs)(g(),{href:`/roots/${c.id}/workflows`,children:[(0,e.jsx)(k.A,{className:"h-4 w-4"}),"Workflows"]})}),(0,e.jsx)(y.InsertImageButton,{rootId:c.id}),(0,e.jsx)(x.ShareButton,{kind:"project",rootId:c.id,label:c.path.split("/").pop()||d("detail.projectFallbackLabel")}),(0,e.jsx)(v.RunInitButton,{rootPath:c.path,rootId:c.id}),(0,e.jsx)(A.RemoveRootButton,{id:c.id,path:c.path,redirectHome:!0})]}),(0,e.jsx)(p.Separator,{}),D?(0,e.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,e.jsx)(u.Dashboard,{rootId:c.id,initialSnapshot:D}),(0,e.jsx)(w.CommandBar,{rootId:c.id})]}):(0,e.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center text-muted-foreground gap-3 p-10 text-center",children:[(0,e.jsx)(l.A,{className:"h-6 w-6"}),(0,e.jsxs)("p",{children:[d("detail.loadFailed"),B.ok?"":`: ${B.error??""}`,"."]}),(0,e.jsx)("p",{className:"text-xs",children:d.rich("detail.loadFailedHint",{b:a=>(0,e.jsx)("strong",{children:a})})})]}),(0,e.jsx)(w.CommandBar,{rootId:c.id})]})]})}s=(B.then?(await B)():B)[0],d()}catch(a){d(a)}})},62109:(a,b,c)=>{"use strict";c.d(b,{RemoveRootButton:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call RemoveRootButton() from the server but RemoveRootButton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/_components/remove-root-button.tsx","RemoveRootButton")},62882:(a,b,c)=>{"use strict";c.d(b,{Dashboard:()=>aB});var d=c(64173),e=c(17240),f=c(71813),g=c(63351),h=c(44052),i=c(20583),j=c(88724),k=c(1056),l=c.n(k),m=c(75430),n=c(62261),o=c(19356),p=c(42382),q=c(31041);function r({rootId:a,activeGoals:b,runningAgents:c}){let e=(0,f.c)("roots"),g=b.length+c.length;return(0,d.jsxs)(q.Zp,{children:[(0,d.jsxs)(q.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,d.jsxs)(q.ZB,{className:"text-sm flex items-center gap-2",children:[(0,d.jsx)(m.A,{className:"h-4 w-4 text-violet-600"}),e("activeGoals.title")]}),g>0&&(0,d.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:g})]}),(0,d.jsxs)(q.Wu,{className:"space-y-2",children:[0===g&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:e("activeGoals.empty")}),b.map(b=>(0,d.jsx)(l(),{href:`/roots/${a}/chat/${b.topicId}`,className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(m.A,{className:"h-3.5 w-3.5 text-violet-600 mt-0.5 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:b.topicTitle}),b.running&&(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin text-violet-600 shrink-0"})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:b.goal}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px] text-muted-foreground",children:[(0,d.jsx)("span",{children:e("activeGoals.iterationLabel",{count:b.goalIterations})}),(0,d.jsx)("span",{children:"\xb7"}),(0,d.jsx)("span",{children:e("activeGoals.updatedLabel",{time:function(a,b){let c=Date.now()-Date.parse(a);if(!Number.isFinite(c)||c<0)return b("activeGoals.justNow");let d=Math.floor(c/6e4);if(d<1)return b("activeGoals.justNow");if(d<60)return b("activeGoals.minutesAgo",{count:d});let e=Math.floor(d/60);return e<24?b("activeGoals.hoursAgo",{count:e}):b("activeGoals.daysAgo",{count:Math.floor(e/24)})}(b.updatedAt,e)})})]})]})]})},b.topicId)),c.map(b=>(0,d.jsx)(l(),{href:`/roots/${a}/chat/${b.topicId}`,className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(o.A,{className:"h-3.5 w-3.5 text-amber-600 mt-0.5 shrink-0"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:b.topicTitle}),(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin text-amber-600 shrink-0"}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e("activeGoals.agentRunning")})]})]})},b.topicId))]})]})}var s=c(74868),t=c(42324),u=c(63387),v=c(33120);function w({rootId:a,items:b}){let c=(0,f.c)("roots");return(0,d.jsxs)(q.Zp,{children:[(0,d.jsxs)(q.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,d.jsxs)(q.ZB,{className:"text-sm flex items-center gap-2",children:[(0,d.jsx)(s.A,{className:"h-4 w-4 text-amber-600"}),c("pendingApprovals.title")]}),b.length>0&&(0,d.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:b.length})]}),(0,d.jsxs)(q.Wu,{className:"space-y-2",children:[0===b.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("pendingApprovals.empty")}),b.map(b=>{var e;return(0,d.jsx)(l(),{href:`/roots/${a}/chat/${b.topicId}`,className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(x,{kind:b.kind}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:b.summary}),(0,d.jsx)(p.E,{variant:"outline",className:"text-[10px] shrink-0",children:"permission"===(e=b.kind)?"permission":"question"===e?"question":"mcp-add"})]}),b.details&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:b.details}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-1",children:["topic ",b.topicId.slice(0,12)," \xb7 ",function(a,b){let c=Date.now()-Date.parse(a);if(!Number.isFinite(c)||c<0)return b("pendingApprovals.justNow");let d=Math.floor(c/6e4);if(d<1)return b("pendingApprovals.justNow");if(d<60)return b("pendingApprovals.minutesAgo",{count:d});let e=Math.floor(d/60);return e<24?b("pendingApprovals.hoursAgo",{count:e}):b("pendingApprovals.daysAgo",{count:Math.floor(e/24)})}(b.ts,c)]})]})]})},`${b.kind}:${b.requestId}`)})]})]})}function x({kind:a}){let b="h-3.5 w-3.5 mt-0.5 shrink-0";return"permission"===a?(0,d.jsx)(t.A,{className:`${b} text-rose-600`}):"question"===a?(0,d.jsx)(u.A,{className:`${b} text-sky-600`}):(0,d.jsx)(v.A,{className:`${b} text-emerald-600`})}var y=c(68669),z=c(3265);function A({rootId:a,items:b}){let c=(0,f.c)("roots"),[g,h]=(0,e.useState)({});return(0,d.jsxs)(q.Zp,{children:[(0,d.jsxs)(q.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,d.jsxs)(q.ZB,{className:"text-sm flex items-center gap-2",children:[(0,d.jsx)(y.A,{className:"h-4 w-4 text-emerald-700"}),c("recentKb.title")]}),b.length>0&&(0,d.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:b.length})]}),(0,d.jsxs)(q.Wu,{className:"space-y-2",children:[0===b.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("recentKb.empty")}),b.map(b=>(0,d.jsx)(l(),{href:`/roots/${a}/kb/${b.rel.split("/").map(encodeURIComponent).join("/")}`,className:"block rounded-md border bg-card hover:bg-accent/40 transition px-3 py-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(y.A,{className:"h-3.5 w-3.5 mt-0.5 shrink-0 text-emerald-700"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium truncate flex-1 min-w-0",children:b.title}),b.kind&&(0,d.jsx)(p.E,{variant:"outline",className:"text-[10px] shrink-0",children:b.kind})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:g[b.rel]??b.rel}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-1",children:[function(a,b){let c=Date.now()-Date.parse(a);if(!Number.isFinite(c)||c<0)return b("recentKb.justNow");let d=Math.floor(c/6e4);if(d<1)return b("recentKb.justNow");if(d<60)return b("recentKb.minutesAgo",{count:d});let e=Math.floor(d/60);return e<24?b("recentKb.hoursAgo",{count:e}):b("recentKb.daysAgo",{count:Math.floor(e/24)})}(b.modifiedAt,c)," \xb7 ",(0,d.jsx)("span",{className:"font-mono",children:b.rel})]})]})]})},b.rel))]})]})}z.callServer,z.findSourceMapURL;var B=c(87671),C=c(42557);let D=(0,C.A)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var E=c(69552),F=c(62481),G=c(73569),H=c(68122);function I({rootId:a,cache:b}){let c=(0,f.c)("roots"),[j,k]=(0,e.useState)(b),[l,m]=(0,e.useTransition)(),o=(0,B.useRouter)(),r=j&&Date.now()-Date.parse(j.generatedAt)>864e5;return(0,d.jsxs)(q.Zp,{className:"lg:col-span-2",children:[(0,d.jsxs)(q.aR,{className:"pb-2 flex flex-row items-center justify-between space-y-0",children:[(0,d.jsxs)(q.ZB,{className:"text-sm flex items-center gap-2",children:[(0,d.jsx)(D,{className:"h-4 w-4 text-amber-500"}),c("aiSuggestions.title"),r&&(0,d.jsx)(p.E,{variant:"outline",className:"text-[10px]",children:c("aiSuggestions.stale")})]}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{m(async()=>{try{let b=await fetch(`/api/roots/${a}/suggestions`,{method:"POST",cache:"no-store"}),d=await b.json();if(!d.ok)return void h.oR.error(d.error??c("aiSuggestions.regenerateFailed"));d.cache&&k(d.cache)}catch(a){h.oR.error(a instanceof Error?a.message:String(a))}})},disabled:l,className:"gap-1 h-7 text-xs",children:[l?(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(g.A,{className:"h-3 w-3"}),c("aiSuggestions.recompute")]})]}),(0,d.jsxs)(q.Wu,{className:"space-y-2",children:[!j&&!l&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("aiSuggestions.intro")}),j&&0===j.items.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("aiSuggestions.nothingUrgent")}),(0,d.jsx)("div",{className:"grid gap-2 md:grid-cols-2",children:j?.items.map((b,c)=>(0,d.jsxs)("div",{className:"rounded-md border bg-card p-3 space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)(E.A,{className:"h-3.5 w-3.5 text-amber-500 mt-0.5 shrink-0"}),(0,d.jsx)("p",{className:"text-sm font-medium leading-snug flex-1",children:b.title})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:b.why}),(0,d.jsx)(J,{rootId:a,item:b,router:o})]},c))}),j&&(0,d.jsx)("p",{className:"text-[10px] text-muted-foreground pt-1",children:c.rich("aiSuggestions.generatedAt",{time:function(a,b){let c=Date.now()-Date.parse(a);if(!Number.isFinite(c)||c<0)return b("aiSuggestions.justNow");let d=Math.floor(c/6e4);if(d<1)return b("aiSuggestions.justNow");if(d<60)return b("aiSuggestions.minutesAgo",{count:d});let e=Math.floor(d/60);return e<24?b("aiSuggestions.hoursAgo",{count:e}):b("aiSuggestions.daysAgo",{count:Math.floor(e/24)})}(j.generatedAt,c),model:j.model,code:a=>(0,d.jsx)("code",{className:"font-mono",children:a})})})]})]})}function J({rootId:a,item:b,router:c}){let[g,k]=(0,e.useTransition)(),m=(0,f.c)("roots"),{action:o}=b;if("none"===o.kind)return null;if("open-topic"===o.kind&&o.target)return(0,d.jsx)(i.$,{asChild:!0,size:"sm",variant:"outline",className:"h-7 text-xs gap-1",children:(0,d.jsxs)(l(),{href:`/roots/${a}/chat/${o.target}`,children:[(0,d.jsx)(F.A,{className:"h-3 w-3"}),o.label]})});if("open-kb"===o.kind&&o.target){let b=o.target.split("/").map(encodeURIComponent).join("/");return(0,d.jsx)(i.$,{asChild:!0,size:"sm",variant:"outline",className:"h-7 text-xs gap-1",children:(0,d.jsxs)(l(),{href:`/roots/${a}/kb/${b}`,children:[(0,d.jsx)(F.A,{className:"h-3 w-3"}),o.label]})})}return"send-message"===o.kind&&o.target?(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:()=>{k(async()=>{try{let b=await (0,H.g)(a,o.target,[],void 0);if(!b.ok)return void h.oR.error(b.error??m("aiSuggestions.sendFailed"));(0,j.$d)(j.Zi.topicsChanged(a)),c.push(`/roots/${a}/chat/${b.topicId}`)}catch(a){h.oR.error(a instanceof Error?a.message:String(a))}})},disabled:g,children:[g?(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(G.A,{className:"h-3 w-3"}),o.label]}):null}var K=c(97162),L=c(34719),M=c(56189),N=c(12619),O=c(66979);let P=(0,z.createServerReference)("40a5d1300a3e470a6db661ee995173b7dca023b3c4",z.callServer,void 0,z.findSourceMapURL,"listSuggestionsAction"),Q=(0,z.createServerReference)("40f1b7d743d741a7ecf30e8871f2f7dc01edf69501",z.callServer,void 0,z.findSourceMapURL,"approveSuggestionAction"),R=(0,z.createServerReference)("40dd36708c99c323debf6dfdc5d723986eb3cd5dfb",z.callServer,void 0,z.findSourceMapURL,"rejectSuggestionAction");var S=c(91344);let T={utility:K.A,research:L.A,widget:M.A,goal:m.A,skill:E.A},U={utility:"text-emerald-600",research:"text-violet-600",widget:"text-blue-600",goal:"text-amber-600",skill:"text-pink-600"};function V({rootId:a}){let b=(0,B.useRouter)(),[c,f]=(0,e.useState)([]),[j,k]=(0,e.useState)(!0),[l,m]=(0,e.useState)({}),[o,r]=(0,e.useTransition)(),s=(0,e.useCallback)(async()=>{let b=await P(a);k(!1),b.ok&&f(b.items)},[a]);return j||0===c.length?null:(0,d.jsxs)(q.Zp,{children:[(0,d.jsxs)(q.aR,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)(q.ZB,{className:"text-lg flex items-center gap-2",children:[(0,d.jsx)(D,{className:"h-4 w-4 text-amber-500"}),"Suggestions",(0,d.jsx)(p.E,{variant:"secondary",className:"ml-1",children:c.length})]}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>r(()=>s()),disabled:o,className:"h-7 gap-1",children:[(0,d.jsx)(g.A,{className:(0,S.cn)("h-3 w-3",o&&"animate-spin")}),"Refresh"]})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Hypotheses the agent put together from the onboarding chat. Approve to start a topic; dismiss to drop it (and remember you said no)."})]}),(0,d.jsx)(q.Wu,{className:"space-y-2",children:c.map(c=>{let e=T[c.kind]??D,g=l[c.id];return(0,d.jsxs)("div",{className:"flex items-start gap-3 rounded-md border p-3",children:[(0,d.jsx)(e,{className:(0,S.cn)("h-4 w-4 mt-1 shrink-0",U[c.kind])}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"font-medium text-sm",children:c.title}),(0,d.jsx)(p.E,{variant:"outline",className:"text-[10px]",children:c.kind})]}),c.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1 leading-snug",children:c.description}),c.prompt&&(0,d.jsx)("code",{className:"block mt-1 text-[10px] font-mono text-muted-foreground/70 truncate",children:c.prompt})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"default",disabled:!!g,onClick:()=>{m(a=>({...a,[c.id]:"approve"})),(async()=>{let d=await Q({rootId:a,suggestionId:c.id});if(m(a=>({...a,[c.id]:null})),!d.ok)return h.oR.error(d.error??"Failed to start topic");h.oR.success(`Started: ${c.title}`),f(a=>a.filter(a=>a.id!==c.id)),b.push(`/roots/${a}/chat/${d.topicId}`)})()},className:"h-8 gap-1",children:["approve"===g?(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(N.A,{className:"h-3 w-3"}),"Approve"]}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"ghost",disabled:!!g,onClick:()=>{m(a=>({...a,[c.id]:"reject"})),(async()=>{let b=await R({rootId:a,suggestionId:c.id});if(m(a=>({...a,[c.id]:null})),!b.ok)return h.oR.error(b.error??"Failed to reject");h.oR.success(`Dismissed: ${c.title}`),f(a=>a.filter(a=>a.id!==c.id))})()},className:"h-8 gap-1 text-muted-foreground hover:text-destructive",children:["reject"===g?(0,d.jsx)(n.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(O.A,{className:"h-3 w-3"}),"Dismiss"]})]})]},c.id)})})]})}var W=c(31258);let X=(0,C.A)("LibraryBig",[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]]);var Y=c(30515);let Z=(0,z.createServerReference)("603eaa80fbbe7b3ce4745a86965eca190fc159b8c6",z.callServer,void 0,z.findSourceMapURL,"saveWidgetOrderAction"),$=(0,z.createServerReference)("60ad4d87c0861c35772dfafc1f067794bbb40a2294",z.callServer,void 0,z.findSourceMapURL,"hideWidgetAction"),_={sm:2,md:3,wide:6},aa=["sys:active-goals","sys:pending","sys:recent-kb","sys:ai-suggestions"],ab=[{id:"sys:active-goals",title:"Active goals & running agents",description:"Topics with an active /goal and a running orchestrator."},{id:"sys:pending",title:"Awaiting response",description:"Unanswered permission / question / mcp-add cards."},{id:"sys:recent-kb",title:"Recent in KB",description:"KB files modified in the last 72 hours."},{id:"sys:ai-suggestions",title:"What's next — Reflex suggestions",description:"Gemini-driven analysis of project state with actions."}],ac=(0,z.createServerReference)("70186d2061e06a6d3174513acba28e214c64606ade",z.callServer,void 0,z.findSourceMapURL,"setWidgetSizeAction"),ad=[{mode:"sm",label:"S",titleKey:"widgetsCommon.sizeSm"},{mode:"md",label:"M",titleKey:"widgetsCommon.sizeMd"},{mode:"wide",label:"W",titleKey:"widgetsCommon.sizeWide"}];function ae({rootId:a,widgetId:b,mode:c,onChanged:g}){let i=(0,f.c)("roots"),[j,k]=(0,e.useTransition)();return(0,d.jsx)("div",{role:"radiogroup","aria-label":i("widgetsCommon.sizeAria"),className:"inline-flex items-center rounded border bg-background/80 backdrop-blur overflow-hidden text-[10px] leading-none",children:ad.map(e=>{let f=e.mode===c,l="sm"===e.mode?i("widgetsCommon.sizeSm"):"md"===e.mode?i("widgetsCommon.sizeMd"):i("widgetsCommon.sizeWide");return(0,d.jsx)("button",{type:"button",role:"radio","aria-checked":f,"aria-label":l,title:l,onClick:()=>{var d;(d=e.mode)!==c&&k(async()=>{let c=await ac(a,b,d);if(!c.ok)return void h.oR.error(c.error??i("widgetsCommon.sizeFailed"));g()})},disabled:j,className:["px-1.5 py-0.5 font-mono transition-colors disabled:opacity-50",f?"bg-violet-600 text-white":"text-muted-foreground hover:bg-accent hover:text-foreground"].join(" "),children:e.label},e.mode)})})}function af(a){let b=_[a];return 2===b?"lg:col-span-2":3===b?"lg:col-span-3":"lg:col-span-6"}let ag=(0,C.A)("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var ah=c(54874),ai=c(14425),aj=c(71155),ak=c(76230);let al=(0,z.createServerReference)("7816a0fbd664dde3368b93b8f7f094cde4d7b8e947",z.callServer,void 0,z.findSourceMapURL,"patchWidgetDataAction"),am=(0,z.createServerReference)("7057d700c72d554d04a25c4f20d5f92ad7b3c243d3",z.callServer,void 0,z.findSourceMapURL,"setWidgetRefreshAction"),an=(0,z.createServerReference)("60fb2e8ce5715fe6e17166fd6a7ce4e52db6ee822e",z.callServer,void 0,z.findSourceMapURL,"refreshWidgetNowAction");function ao({rootId:a,widget:b,mode:c,onHide:g,hiding:i,onLayoutChanged:j,dnd:k}){let m=(0,f.c)("roots"),[n,o]=(0,e.useTransition)(),r=k.dragging===b.id,s=k.dropTarget===b.id&&!r,t=af(c);return(0,d.jsxs)(q.Zp,{draggable:!0,onDragStart:a=>{a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",b.id),k.onDragStart(b.id)},onDragOver:a=>{a.preventDefault(),a.dataTransfer.dropEffect="move",k.dropTarget!==b.id&&k.onDragOver(b.id)},onDrop:a=>{a.preventDefault(),k.onDrop(b.id)},onDragEnd:()=>k.onDragEnd(),className:[t,"transition-all",r?"opacity-50":"",s?"ring-2 ring-violet-400 ring-offset-2 ring-offset-background":""].join(" "),children:[(0,d.jsxs)(q.aR,{className:"pb-2 flex flex-row items-start gap-2 space-y-0",children:[(0,d.jsx)(ag,{className:"h-3.5 w-3.5 text-muted-foreground/60 cursor-grab active:cursor-grabbing mt-1 shrink-0","aria-label":m("widgetsCommon.dragHandle")}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)(q.ZB,{className:"text-sm flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"truncate",children:b.title}),(0,d.jsx)(p.E,{variant:"outline",className:"text-[10px] font-mono shrink-0",children:b.kind})]}),b.description&&(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5 line-clamp-2",children:b.description})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 -mt-0.5 shrink-0",children:[(0,d.jsx)(ae,{rootId:a,widgetId:b.id,mode:c,onChanged:j}),b.sourceTopicId&&(0,d.jsx)(l(),{href:`/roots/${a}/chat/${b.sourceTopicId}`,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground","aria-label":m("widgetsCommon.editViaTopicAria"),title:m("widgetsCommon.editViaTopicTitle"),children:(0,d.jsx)(ah.A,{className:"h-3.5 w-3.5"})}),(0,d.jsx)("button",{type:"button",onClick:()=>o(async()=>{await Promise.resolve(),g(b.id)}),disabled:n||i,"aria-label":m("widgetsCommon.hideAria"),title:m("widgetsCommon.hideTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive",children:(0,d.jsx)(O.A,{className:"h-3.5 w-3.5"})})]})]}),(0,d.jsxs)(q.Wu,{className:"space-y-3",children:[(0,ak.v)(a,b.kind,b.data,{widgetId:b.id,onPatch:async c=>{let d=await al(a,b.id,c);if(!d.ok)throw h.oR.error(d.error??m("widgetsCommon.savePatchFailed")),Error(d.error??m("widgetsCommon.patchFailed"))}}),(0,d.jsx)(ap,{rootId:a,widget:b})]})]})}function ap({rootId:a,widget:b}){let c=(0,f.c)("roots"),[i,j]=(0,e.useTransition)(),[k,l]=(0,e.useTransition)(),m=b.refresh??"manual",n=b.lastRefreshAt??b.updatedAt;return b.sourceTopicId?(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-2 border-t text-[11px] text-muted-foreground",children:[(0,d.jsx)(ai.A,{className:"h-3 w-3 shrink-0"}),(0,d.jsx)("span",{className:"shrink-0",children:c("widgetsCommon.updatedAt",{time:function(a,b){let c=Date.now()-Date.parse(a);if(!Number.isFinite(c)||c<0)return b("widgetsCommon.justNow");let d=Math.floor(c/6e4);if(d<1)return b("widgetsCommon.justNow");if(d<60)return b("widgetsCommon.minutesAgo",{count:d});let e=Math.floor(d/60);return e<24?b("widgetsCommon.hoursAgo",{count:e}):b("widgetsCommon.daysAgo",{count:Math.floor(e/24)})}(n,c)})}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[(0,d.jsxs)(aj.l6,{value:m,onValueChange:d=>{l(async()=>{var e;let f=await am(a,b.id,d);f.ok?h.oR.success("manual"===d?c("widgetsCommon.autoRefreshOff"):c("widgetsCommon.cadenceSet",{cadence:(e=d,c("hourly"===e?"widgetsCommon.cadenceHourly":"daily"===e?"widgetsCommon.cadenceDaily":"weekly"===e?"widgetsCommon.cadenceWeekly":"widgetsCommon.cadenceManual"))})):h.oR.error(f.error??c("widgetsCommon.cadenceFailed"))})},disabled:k,children:[(0,d.jsx)(aj.bq,{className:"h-6 text-[10px] gap-1 px-1.5 w-auto min-w-[110px]",children:(0,d.jsx)(aj.yv,{})}),(0,d.jsxs)(aj.gC,{children:[(0,d.jsx)(aj.eb,{value:"manual",children:c("widgetsCommon.manual")}),(0,d.jsx)(aj.eb,{value:"hourly",children:c("widgetsCommon.hourly")}),(0,d.jsx)(aj.eb,{value:"daily",children:c("widgetsCommon.daily")}),(0,d.jsx)(aj.eb,{value:"weekly",children:c("widgetsCommon.weekly")})]})]}),(0,d.jsxs)("button",{type:"button",onClick:()=>{j(async()=>{let d=await an(a,b.id);d.ok?h.oR.success(c("widgetsCommon.refreshStarted")):h.oR.error(d.error??c("widgetsCommon.refreshFailed"))})},disabled:i,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 hover:bg-accent text-foreground/80 hover:text-foreground",title:c("widgetsCommon.refreshNowTitle"),children:[(0,d.jsx)(g.A,{className:`h-3 w-3 ${i?"animate-spin":""}`}),c("widgetsCommon.refreshLabel")]})]})]}):null}var aq=c(75482),ar=c(3442),as=c(97338),at=c(27456),au=c(86098);let av=(0,z.createServerReference)("60a739378e69d87e74bd0a068ef7024cb39749edbe",z.callServer,void 0,z.findSourceMapURL,"deleteWidgetAction");function aw({rootId:a,open:b,onOpenChange:c,widgets:e,layout:g,onChanged:h}){let j=(0,f.c)("roots");if(!b)return null;let k=new Set(g.hidden);return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:a=>{a.target===a.currentTarget&&c(!1)},children:[(0,d.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 bg-background/80 backdrop-blur-sm",onClick:()=>c(!1)}),(0,d.jsxs)("div",{className:"relative bg-card border rounded-lg shadow-xl w-full max-w-2xl max-h-[80vh] flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 border-b",children:[(0,d.jsx)(X,{className:"h-4 w-4 text-violet-600"}),(0,d.jsx)("h2",{className:"text-sm font-medium flex-1",children:j("widgetsCommon.libraryTitle")}),(0,d.jsx)(i.$,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>c(!1),children:(0,d.jsx)(O.A,{className:"h-4 w-4"})})]}),(0,d.jsx)(at.F,{className:"flex-1 min-h-0",children:(0,d.jsxs)("div",{className:"p-4 space-y-4",children:[(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h3",{className:"text-[11px] uppercase tracking-wider text-muted-foreground",children:j("widgetsCommon.systemWidgetsHeading")}),ab.map(b=>(0,d.jsx)(ax,{rootId:a,id:b.id,title:b.title,description:b.description,badge:"system",badgeVariant:"default",hidden:k.has(b.id),canDelete:!1,onChanged:h},b.id))]}),(0,d.jsxs)("section",{className:"space-y-2",children:[(0,d.jsx)("h3",{className:"text-[11px] uppercase tracking-wider text-muted-foreground",children:j("widgetsCommon.userWidgetsHeading",{count:e.length})}),0===e.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:j("widgetsCommon.noUserWidgets")}),e.map(b=>(0,d.jsx)(ax,{rootId:a,id:b.id,title:b.title,description:b.description??`kind: ${b.kind}`,badge:b.kind,badgeVariant:"outline",hidden:k.has(b.id),canDelete:!0,onChanged:h},b.id))]})]})})]})]})}function ax({rootId:a,id:b,title:c,description:g,badge:j,badgeVariant:k,hidden:l,canDelete:m,onChanged:n}){let o=(0,f.c)("roots"),[q,r]=(0,e.useTransition)();return(0,d.jsxs)("div",{className:"flex items-start gap-3 rounded-md border bg-card px-3 py-2",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"text-sm font-medium truncate",children:c}),(0,d.jsx)(p.E,{variant:k,className:"text-[10px] font-mono",children:j}),l&&(0,d.jsx)(p.E,{variant:"secondary",className:"text-[10px]",children:o("widgetsCommon.hidden")})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:g})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>{r(async()=>{let c=l?await (0,au.t)(a,b):await $(a,b);if(!c.ok)return void h.oR.error(c.error);n()})},disabled:q,className:"gap-1 h-7 text-xs",children:l?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(aq.A,{className:"h-3 w-3"}),o("widgetsCommon.show")]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ar.A,{className:"h-3 w-3"}),o("widgetsCommon.hide")]})}),m&&(0,d.jsx)(i.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>{confirm(o("widgetsCommon.deleteWidgetConfirm",{title:c}))&&r(async()=>{let c=await av(a,b);if(!c.ok)return void h.oR.error(c.error);n()})},disabled:q,className:"h-7 w-7 text-muted-foreground hover:text-destructive",title:o("widgetsCommon.deleteForever"),children:(0,d.jsx)(as.A,{className:"h-3.5 w-3.5"})})]})]})}function ay({rootId:a,widgets:b,layout:c,systemRenderers:g,snapshot:j,onLayoutChanged:k}){let l=(0,f.c)("roots"),m=(0,e.useMemo)(()=>{let a=new Map;for(let c of b)a.set(c.id,c);return a},[b]),[n,o]=(0,e.useState)(c.order),[p,q]=(0,e.useState)(c.hidden),[,r]=(0,e.useTransition)(),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1);aA(c.order,o),aA(c.hidden,q);let y=(0,e.useCallback)(b=>{o(b),r(async()=>{let c=await Z(a,b);c.ok?(o(c.layout.order),q(c.layout.hidden),k()):h.oR.error(c.error)})},[a,k]),z=(0,e.useCallback)(b=>{o(n.filter(a=>a!==b)),q(a=>[...new Set([b,...a])]),r(async()=>{let c=await $(a,b);if(!c.ok)return void h.oR.error(c.error);o(c.layout.order),q(c.layout.hidden),k()})},[a,n,k]),A={onDragStart:a=>t(a),onDragOver:a=>v(a),onDrop:a=>{if(t(null),v(null),!s||s===a)return;let b=[...n],c=b.indexOf(s),d=b.indexOf(a);c<0||d<0||(b.splice(c,1),b.splice(d,0,s),y(b))},onDragEnd:()=>{t(null),v(null)},dragging:s,dropTarget:u};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:l("widgetsCommon.projectWidgetsTitle")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:l("widgetsCommon.projectWidgetsHint")})]}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"outline",onClick:()=>x(!0),className:"gap-1 h-8",children:[(0,d.jsx)(X,{className:"h-3.5 w-3.5"}),l("widgetsCommon.library",{count:p.length})]})]}),0===n.length&&(0,d.jsxs)("div",{className:"rounded-md border border-dashed bg-muted/20 p-6 text-center space-y-2",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:l.rich("widgetsCommon.emptyDashboard",{example:()=>(0,d.jsx)("em",{children:l("widgetsCommon.emptyDashboardExample")})})}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>x(!0),className:"gap-1",children:[(0,d.jsx)(Y.A,{className:"h-3 w-3"}),l("widgetsCommon.restoreSystem")]})]}),(0,d.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-6 gap-4",children:n.map(b=>{var e;let f=m.get(b),h=c.sizes?.[b]??(e=f?.size,e?.mode?e.mode:e?.cols===1?"sm":e?.cols===2?"md":e?.cols===3?"wide":"md");return aa.includes(b)?(0,d.jsx)(az,{rootId:a,id:b,node:g[b],onHide:z,dnd:A,mode:h,onLayoutChanged:k},b):f?(0,d.jsx)(ao,{rootId:a,widget:f,mode:h,onHide:z,hiding:!1,dnd:A,onLayoutChanged:k},b):null})}),(0,d.jsx)(aw,{open:w,onOpenChange:x,rootId:a,widgets:b,layout:{order:n,hidden:p},onChanged:()=>{k()}})]})}function az({rootId:a,id:b,node:c,onHide:e,dnd:g,mode:h,onLayoutChanged:i}){let j=(0,f.c)("roots"),k=g.dragging===b,l=g.dropTarget===b&&!k,m=af(h);return(0,d.jsxs)("div",{draggable:!0,onDragStart:a=>{a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/plain",b),g.onDragStart(b)},onDragOver:a=>{a.preventDefault(),a.dataTransfer.dropEffect="move",g.dropTarget!==b&&g.onDragOver(b)},onDrop:a=>{a.preventDefault(),g.onDrop(b)},onDragEnd:()=>g.onDragEnd(),className:[m,"relative group/sys transition-all",k?"opacity-50":"",l?"ring-2 ring-violet-400 ring-offset-2 ring-offset-background rounded-lg":""].join(" "),children:[c,(0,d.jsxs)("div",{className:"absolute top-2 right-2 opacity-0 group-hover/sys:opacity-100 transition-opacity flex items-center gap-1 bg-background/85 backdrop-blur rounded p-0.5",children:[(0,d.jsx)(ae,{rootId:a,widgetId:b,mode:h,onChanged:i}),(0,d.jsx)("button",{type:"button",onClick:()=>e(b),"aria-label":j("widgetsCommon.hideAria"),title:j("widgetsCommon.hideSystemTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive",children:"\xd7"})]})]})}function aA(a,b){(0,e.useMemo)(()=>{b(a)},[JSON.stringify(a)])}function aB({rootId:a,initialSnapshot:b}){let c=(0,f.c)("roots"),[k,l]=(0,e.useState)(b),[m,n]=(0,e.useTransition)(),o=(0,e.useCallback)(()=>{n(async()=>{try{let b=await fetch(`/api/roots/${a}/dashboard`,{cache:"no-store"}),d=await b.json();if(!d.ok||!d.snapshot)return void h.oR.error(d.error??c("dashboard.refreshFailed"));l(d.snapshot)}catch(a){h.oR.error(a instanceof Error?a.message:String(a))}})},[a,c]);(0,j.S9)(j.Zi.topicsChanged(a),o),(0,j.S9)(j.Zi.kbChanged(a),o);let p={"sys:active-goals":(0,d.jsx)(r,{rootId:a,activeGoals:k.activeGoals,runningAgents:k.runningAgents}),"sys:pending":(0,d.jsx)(w,{rootId:a,items:k.pendingApprovals}),"sys:recent-kb":(0,d.jsx)(A,{rootId:a,items:k.recentKb}),"sys:ai-suggestions":(0,d.jsx)(I,{rootId:a,cache:k.suggestions})};return(0,d.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,d.jsxs)("div",{className:"p-6 space-y-5 max-w-6xl mx-auto",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:c("dashboard.projectOverview")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:c("dashboard.projectOverviewHint")})]}),(0,d.jsxs)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:o,disabled:m,className:"gap-1 h-8",children:[(0,d.jsx)(g.A,{className:`h-3.5 w-3.5 ${m?"animate-spin":""}`}),c("dashboard.refresh")]})]}),(0,d.jsx)(V,{rootId:a}),(0,d.jsx)(ay,{rootId:a,widgets:k.widgets,layout:k.layout,systemRenderers:p,snapshot:k,onLayoutChanged:o}),(0,d.jsx)(W.MemoryEditor,{scope:"project",rootId:a,title:c("dashboard.memoryTitle"),description:c("dashboard.memoryHint")})]})})}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63351:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},64845:(a,b,c)=>{"use strict";c.d(b,{Dashboard:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call Dashboard() from the server but Dashboard is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/_components/dashboard.tsx","Dashboard")},65686:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>E.a,__next_app__:()=>K,handler:()=>M,pages:()=>J,routeModule:()=>L,tree:()=>I});var d=c(61597),e=c(99210),f=c(1082),g=c(15003),h=c(36265),i=c(11817),j=c(45136),k=c(41809),l=c(55745),m=c(88963),n=c(69153),o=c(48343),p=c(15808),q=c(21238),r=c(2555),s=c(261),t=c(34370),u=c(89583),v=c(26713),w=c(53875),x=c(7952),y=c(54532),z=c(80269),A=c(17851),B=c(57865),C=c(86439),D=c(47319),E=c.n(D),F=c(1859),G=c(20498),H={};for(let a in F)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(H[a]=()=>F[a]);c.d(b,H);let I={children:["",{children:["roots",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,58550)),"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/page.tsx"]}]},{layout:[()=>Promise.resolve().then(c.bind(c,6993)),"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/layout.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(c.bind(c,79459)),"/home/runner/work/reflex-agent/reflex-agent/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,47319,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,82295,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,91570,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,72845,23)),"next/dist/client/components/builtin/unauthorized.js"]}]}.children,J=["/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/page.tsx"],K={require:c,loadChunk:()=>Promise.resolve()},L=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/roots/[id]/page",pathname:"/roots/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:I},distDir:".next",relativeProjectDir:""});async function M(a,b,d){var D;let H="/roots/[id]/page";"/index"===H&&(H="/");let N=(0,h.getRequestMeta)(a,"postponed"),O=(0,h.getRequestMeta)(a,"minimalMode"),P=await L.prepare(a,b,{srcPage:H,multiZoneDraftMode:!1});if(!P)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Q,query:R,params:S,parsedUrl:T,pageIsDynamic:U,buildManifest:V,nextFontManifest:W,reactLoadableManifest:X,serverActionsManifest:Y,clientReferenceManifest:Z,subresourceIntegrityManifest:$,prerenderManifest:_,isDraftMode:aa,resolvedPathname:ab,revalidateOnlyGenerated:ac,routerServerContext:ad,nextConfig:ae,interceptionRoutePatterns:af}=P,ag=T.pathname||"/",ah=(0,s.normalizeAppPath)(H),{isOnDemandRevalidate:ai}=P,aj=L.match(ag,_),ak=!!_.routes[ab],al=!!(aj||ak||_.routes[ah]),am=a.headers["user-agent"]||"",an=(0,v.getBotType)(am),ao=(0,q.isHtmlBotRequest)(a),ap=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[u.NEXT_ROUTER_PREFETCH_HEADER],aq=(0,h.getRequestMeta)(a,"isRSCRequest")??(0,n.f)(a.headers[u.RSC_HEADER]),ar=(0,t.getIsPossibleServerAction)(a),as=(0,m.checkIsAppPPREnabled)(ae.experimental.ppr)&&(null==(D=_.routes[ah]??_.dynamicRoutes[ah])?void 0:D.renderingMode)==="PARTIALLY_STATIC",at=!1,au=!1,av=as?N:void 0,aw=as&&aq&&!ap,ax=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ay=!am||(0,q.shouldServeStreamingMetadata)(am,ae.htmlLimitedBots);ao&&as&&(al=!1,ay=!1);let az=!0===L.isDev||!al||"string"==typeof N||aw,aA=ao&&as,aB=null;aa||!al||az||ar||av||aw||(aB=ab);let aC=aB;!aC&&L.isDev&&(aC=ab),L.isDev||aa||!al||!aq||aw||(0,k.d)(a.headers);let aD={...F,tree:I,pages:J,GlobalError:E(),handler:M,routeModule:L,__next_app__:K};Y&&Z&&(0,p.setReferenceManifestsSingleton)({page:H,clientReferenceManifest:Z,serverActionsManifest:Y,serverModuleMap:(0,r.createServerModuleMap)({serverActionsManifest:Y})});let aE=a.method||"GET",aF=(0,g.getTracer)(),aG=aF.getActiveScopeSpan();try{let f=L.getVaryHeader(ab,af);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return L.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aF.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aE} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aE} ${a.url}`)})},m=async({span:e,postponed:f,fallbackRouteParams:g})=>{let i={query:R,params:S,page:ah,sharedContext:{buildId:Q},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aD,Component:(0,j.T)(aD),params:S,routeModule:L,page:H,postponed:f,shouldWaitOnAllReady:aA,serveStreamingMetadata:ay,supportsDynamicResponse:"string"==typeof f||az,buildManifest:V,nextFontManifest:W,reactLoadableManifest:X,subresourceIntegrityManifest:$,serverActionsManifest:Y,clientReferenceManifest:Z,setIsrStatus:null==ad?void 0:ad.setIsrStatus,dir:c(33873).join(process.cwd(),L.relativeProjectDir),isDraftMode:aa,isRevalidate:al&&!f&&!aw,botType:an,isOnDemandRevalidate:ai,isPossibleServerAction:ar,assetPrefix:ae.assetPrefix,nextConfigOutput:ae.output,crossOrigin:ae.crossOrigin,trailingSlash:ae.trailingSlash,previewProps:_.preview,deploymentId:ae.deploymentId,enableTainting:ae.experimental.taint,htmlLimitedBots:ae.htmlLimitedBots,devtoolSegmentExplorer:ae.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ae.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ae.experimental.cacheLife,basePath:ae.basePath,serverActions:ae.experimental.serverActions,...at?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:at}:{},experimental:{isRoutePPREnabled:as,expireTime:ae.expireTime,staleTimes:ae.experimental.staleTimes,cacheComponents:!!ae.experimental.cacheComponents,clientSegmentCache:!!ae.experimental.clientSegmentCache,clientParamParsing:!!ae.experimental.clientParamParsing,dynamicOnHover:!!ae.experimental.dynamicOnHover,inlineCss:!!ae.experimental.inlineCss,authInterrupts:!!ae.experimental.authInterrupts,clientTraceMetadata:ae.experimental.clientTraceMetadata||[]},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>L.onRequestError(a,b,d,ad),err:(0,h.getRequestMeta)(a,"invokeError"),dev:L.isDev}},l=await k(e,i),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[z.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,al&&(null==n?void 0:n.revalidate)===0&&!L.isDev&&!as){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ab}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
|
|
13
|
+
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:w.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},n=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i})=>{let j,k=!1===L.isDev,l=c||b.writableEnded;if(ai&&ac&&!f&&!O)return(null==ad?void 0:ad.render404)?await ad.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(aj&&(j=(0,x.parseFallbackField)(aj.fallback)),j===x.FallbackMode.PRERENDER&&(0,v.isBot)(am)&&(!as||ao)&&(j=x.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ai=!0),ai&&(j!==x.FallbackMode.NOT_FOUND||f)&&(j=x.FallbackMode.BLOCKING_STATIC_RENDER),!O&&j!==x.FallbackMode.BLOCKING_STATIC_RENDER&&aC&&!l&&!aa&&U&&(k||!ak)){let b;if((k||aj)&&j===x.FallbackMode.NOT_FOUND)throw new C.NoFallbackError;if(as&&!aq){let c="string"==typeof(null==aj?void 0:aj.fallback)?aj.fallback:k?ah:null;if(b=await L.handleResponse({cacheKey:c,req:a,nextConfig:ae,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:_,isRoutePPREnabled:as,responseGenerator:async()=>m({span:i,postponed:void 0,fallbackRouteParams:k||au?(0,o.u)(ah):null}),waitUntil:d.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let n=ai||g||!av?void 0:av;if(at&&void 0!==n)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:w.CachedRouteKind.PAGES,html:y.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let p=U&&as&&((0,h.getRequestMeta)(a,"renderFallbackShell")||au)?(0,o.u)(ag):null;return m({span:i,postponed:n,fallbackRouteParams:p})},p=async c=>{var f,g,i,j,k;let l,o=await L.handleResponse({cacheKey:aB,responseGenerator:a=>n({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ai,isRoutePPREnabled:as,req:a,nextConfig:ae,prerenderManifest:_,waitUntil:d.waitUntil});if(aa&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),L.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!o){if(aB)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=o.value)?void 0:f.kind)!==w.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=o.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof o.value.postponed;al&&!aw&&(!p||ap)&&(O||b.setHeader("x-nextjs-cache",ai?"REVALIDATED":o.isMiss?"MISS":o.isStale?"STALE":"HIT"),b.setHeader(u.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=o;if(av)l={revalidate:0,expire:void 0};else if(O&&aq&&!ap&&as)l={revalidate:0,expire:void 0};else if(!L.isDev)if(aa)l={revalidate:0,expire:void 0};else if(al){if(o.cacheControl)if("number"==typeof o.cacheControl.revalidate){if(o.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${o.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:o.cacheControl.revalidate,expire:(null==(j=o.cacheControl)?void 0:j.expire)??ae.expireTime}}else l={revalidate:z.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(o.cacheControl=l,"string"==typeof ax&&(null==q?void 0:q.kind)===w.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(u.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[z.NEXT_CACHE_TAGS_HEADER];O&&al&&c&&"string"==typeof c&&b.setHeader(z.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(ax);return void 0!==d?(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.fromStatic(d,u.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl}):(b.statusCode=204,(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.EMPTY,cacheControl:o.cacheControl}))}let r=(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...o,value:{...o.value,kind:"PAGE"}},{url:(0,h.getRequestMeta)(a,"initURL")}))return null;if(p&&av)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(O&&al||delete a[z.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[z.NEXT_CACHE_TAGS_HEADER];if(O&&al&&s&&"string"==typeof s&&b.setHeader(z.NEXT_CACHE_TAGS_HEADER,s),!q.status||aq&&as||(b.statusCode=q.status),!O&&q.status&&G.RedirectStatusCode[q.status]&&aq&&(b.statusCode=200),p&&b.setHeader(u.NEXT_DID_POSTPONE_HEADER,"1"),aq&&!aa){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:q.html,cacheControl:aw?{revalidate:0,expire:void 0}:o.cacheControl})}return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.fromStatic(q.rscData,u.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl})}let t=q.html;if(!p||O||aq)return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:o.cacheControl});if(at)return t.push(new ReadableStream({start(a){a.enqueue(A.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}});let v=new TransformStream;return t.push(v.readable),m({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==w.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(v.writable)}).catch(a=>{v.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}})};if(!aG)return await aF.withPropagatedContext(a.headers,()=>aF.trace(i.BaseServerSpan.handleRequest,{spanName:`${aE} ${a.url}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aE,"http.target":a.url}},p));await p(aG)}catch(b){throw b instanceof C.NoFallbackError||await L.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"render",revalidateReason:(0,f.c)({isRevalidate:al,isOnDemandRevalidate:ai})},ad),b}}},66558:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{"401ca1f96d277517647c521e584ee4054515e353d4":()=>e.rD,"402f9f24a9529e9ed2d16b9d0032efd9e0fc7e8995":()=>e.AZ,"40614b3d0d98951433a7fae1ae04f55d2fa465e8cc":()=>f.x,"408714f9962f1d076260bdac98c9115e4aeecc82c9":()=>e.Gh,"40c79315b764b444d91c05a5807317643d261026f7":()=>e.summarizeYoutubeAction,"40f9267e0b7477763dc7cd1f22fb148e6d08d6dbac":()=>e.O1,"6077e96b401dd0d46eaa9985bd0f593faaca3cd0a1":()=>f.k});var e=c(18746),f=c(49809),g=a([f]);f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},71152:a=>{"use strict";a.exports=require("esbuild")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},75482:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},78645:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Ik:()=>u,K9:()=>s,rg:()=>v});var e=c(73745);c(66493);var f=c(73024),g=c(76760),h=c.n(g),i=c(65326),j=c(53905),k=c(50108),l=c(36017),m=c(5492),n=c(51021),o=c(1947),p=c(81483),q=c(63781),r=a([k,n,o]);async function s(a){try{let b=await f.promises.stat(a).catch(()=>null);if(!b||!b.isDirectory())return{ok:!1,error:`Not a directory: ${a}`};let c=await (0,j.addRoot)(a);(0,i.revalidatePath)("/");let d=await t(c).catch(()=>void 0);return{ok:!0,id:c.id,...d?{onboardingTopicId:d}:{}}}catch(a){return{ok:!1,error:x(a)}}}async function t(a){let b=await (0,l.loadSettings)(),c=b.assignments.chat,d=await (0,m.createTopic)({root:a.path,firstMessage:"Space onboarding",harness:c.harness,model:c.model,language:b.language}),e=await (0,n.startOrchestratorTurn)({rootId:a.id,topicId:d.meta.id,message:"/skill space-onboarding",attachments:[]});return"error"in e,d.meta.id}async function u(a,b,c=!1){try{let d=await (0,l.loadSettings)(),e=d.assignments.analyze,f="claude-code"===e.harness||"codex"===e.harness?e.harness:void 0;return await (0,k.E)(a,{scaffoldOnly:c,language:d.language,...f?{harness:f}:{},...f?{model:e.model}:{}}),c||await (0,j.markInitialized)(b),(0,i.revalidatePath)("/"),(0,i.revalidatePath)(`/roots/${b}`),{ok:!0}}catch(a){return{ok:!1,error:x(a)}}}async function v(a){try{let b=await (0,j.getRoot)(a);if(!b)return(0,i.revalidatePath)("/"),{ok:!0};let c=h().join(b.path,".reflex");await f.promises.rm(c,{recursive:!0,force:!0}).catch(()=>null);let d=h().basename(b.path);return await w({projectName:d,projectPath:b.path}),await (0,j.removeRoot)(a),(0,i.revalidatePath)("/"),(0,i.revalidatePath)(`/roots/${a}`),{ok:!0}}catch(a){return{ok:!1,error:x(a)}}}async function w(a){let b=new Set;if(a.projectName.trim()&&b.add(a.projectName.trim()),a.projectPath.trim()&&b.add(a.projectPath.trim()),0!==b.size)for(let a of p.cs){let c=await (0,o.MJ)({scope:"global"},a);if(!c.content)continue;let d=c.content.split("\n").filter(a=>{let c=a.toLowerCase();for(let a of b)if(c.includes(a.toLowerCase()))return!1;return!0}).join("\n").trim();d!==c.content.trim()&&await (0,o.xP)({scope:"global"},a,"replace",{content:d})}}function x(a){if(a instanceof Error){try{let b=JSON.parse(a.message);if(Array.isArray(b))return b.map(a=>"object"==typeof a&&null!==a&&"message"in a?String(a.message):String(a)).join("; ")}catch{}return a.message}return String(a)}[k,n,o]=r.then?(await r)():r,(0,q.D)([s,u,v]),(0,e.A)(s,"401030fc31868af8226f3dbd4833e1ee593e306da9",null),(0,e.A)(u,"70892c3f3270339b060cb75287e8c8418238f1b7ca",null),(0,e.A)(v,"40c84b38aef24fa2815317cc7ce1fffbeca8f8263b",null),d()}catch(a){d(a)}})},79428:a=>{"use strict";a.exports=require("buffer")},79646:a=>{"use strict";a.exports=require("child_process")},79734:(a,b,c)=>{"use strict";c.d(b,{D:()=>j,z:()=>i});var d=c(73024),e=c(76760),f=c.n(e),g=c(879),h=c(54287);async function i(a){let b=f().resolve(a.root),c=f().resolve(a.scope),d=f().relative(b,c);if(d.startsWith(".."))throw Error(`Scope ${c} is outside root ${b}`);let e=d?(0,h.x9)(b,d):f().join(b,h.fW),i=[];for await(let a of(0,g.G)(c))"."!==a.rel&&(a.isDir||i.push(a.rel));return{root:b,scope:c,reflexScope:e,files:i}}async function j(a){let b=f().join(a,h.KZ);try{await d.promises.access(b);return}catch{}await d.promises.writeFile(b,"# .reflexignore — gitignore syntax\n# Patterns listed here are excluded from Reflex's analysis and watchers.\n\nnode_modules/\ndist/\nbuild/\n.venv/\n__pycache__/\n*.log\n","utf8")}},79868:a=>{"use strict";a.exports=require("node:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90510:(a,b,c)=>{Promise.resolve().then(c.bind(c,87605)),Promise.resolve().then(c.bind(c,12135)),Promise.resolve().then(c.bind(c,74950)),Promise.resolve().then(c.bind(c,24401)),Promise.resolve().then(c.bind(c,15620)),Promise.resolve().then(c.bind(c,62882)),Promise.resolve().then(c.bind(c,15156)),Promise.resolve().then(c.bind(c,46013)),Promise.resolve().then(c.bind(c,51189)),Promise.resolve().then(c.bind(c,66180)),Promise.resolve().then(c.bind(c,75266)),Promise.resolve().then(c.bind(c,14360)),Promise.resolve().then(c.bind(c,6786)),Promise.resolve().then(c.bind(c,44896)),Promise.resolve().then(c.bind(c,14848)),Promise.resolve().then(c.bind(c,53710)),Promise.resolve().then(c.bind(c,30544)),Promise.resolve().then(c.bind(c,13829)),Promise.resolve().then(c.bind(c,90044)),Promise.resolve().then(c.bind(c,57673)),Promise.resolve().then(c.bind(c,97053)),Promise.resolve().then(c.bind(c,43151)),Promise.resolve().then(c.bind(c,12156)),Promise.resolve().then(c.bind(c,71615)),Promise.resolve().then(c.bind(c,4080)),Promise.resolve().then(c.bind(c,87177)),Promise.resolve().then(c.bind(c,87634)),Promise.resolve().then(c.bind(c,6912)),Promise.resolve().then(c.bind(c,13976)),Promise.resolve().then(c.bind(c,18282)),Promise.resolve().then(c.bind(c,20633)),Promise.resolve().then(c.bind(c,61193)),Promise.resolve().then(c.bind(c,66188)),Promise.resolve().then(c.bind(c,66643)),Promise.resolve().then(c.bind(c,81669)),Promise.resolve().then(c.bind(c,39991)),Promise.resolve().then(c.bind(c,54972)),Promise.resolve().then(c.t.bind(c,1056,23))},90558:(a,b,c)=>{"use strict";c.d(b,{CommandBar:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call CommandBar() from the server but CommandBar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/_components/command-bar.tsx","CommandBar")},91745:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{R1:()=>n,RR:()=>m,c9:()=>l});var e=c(73745);c(66493);var f=c(81483),g=c(1947),h=c(53905),i=c(63781),j=a([g]);async function k(a,b){if("global"===a)return;if(!b)throw Error("project memory requires rootId");let c=await (0,h.getRoot)(b);if(!c)throw Error(`unknown root: ${b}`);return c.path}async function l(a){try{if(!(0,f.qL)(a.scope))return{ok:!1,error:"invalid scope"};let b=await k(a.scope,a.rootId),c=await (0,g.ab)(b?{scope:"project",rootPath:b}:{scope:"global"}),d=f.cs.map(a=>({file:a,content:c[a].content??"",lines:c[a].lines,cap:f.h0[a],tier:f.a9[a],description:f.lh[a]}));return{ok:!0,files:d}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function m(a){try{if(!(0,f.qL)(a.scope))return{ok:!1,error:"invalid scope"};if(!(0,f.UV)(a.file))return{ok:!1,error:"invalid file"};let b=await k(a.scope,a.rootId),c=await (0,g.xP)(b?{scope:"project",rootPath:b}:{scope:"global"},a.file,"replace",{content:a.content});if(!c.ok)return{ok:!1,error:c.error??"write failed",lines:c.lines,cap:c.cap};return{ok:!0,lines:c.lines,cap:c.cap}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function n(a){try{if(!(0,f.qL)(a.scope))return{ok:!1,error:"invalid scope"};let b=await k(a.scope,a.rootId),c=b?{scope:"project",rootPath:b}:{scope:"global"};for(let a of f.cs)await (0,g.xP)(c,a,"replace",{content:""});return{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}g=(j.then?(await j)():j)[0],(0,i.D)([l,m,n]),(0,e.A)(l,"40c15ec8ded15cc5ec9eb918994e4f729aeccb25e1",null),(0,e.A)(m,"40493c396fbeb942eb2451b6b0fd04cf9642ab62dc",null),(0,e.A)(n,"40cc6831ec3afc3d93ab0f8db8f7c844ec61ff84b8",null),d()}catch(a){d(a)}})},96194:(a,b,c)=>{"use strict";c.d(b,{g:()=>e});var d=c(3265);let e=(0,d.createServerReference)("40c3afc3c8f3e0cfc3023a0e28f39339b17f7be7fa",d.callServer,void 0,d.findSourceMapURL,"installCuratedAction")},98783:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Yr:()=>o,ct:()=>n,uy:()=>m});var e=c(73745);c(66493);var f=c(65326),g=c(53905),h=c(22421),i=c(13415),j=c(1947),k=c(63781),l=a([i,j]);async function m(a){try{let b=await (0,g.getRoot)(a);if(!b)return{ok:!1,error:"Root not found"};let c=await (0,h.vd)(b.path);return{ok:!0,items:c}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function n(a){try{let b=await (0,g.getRoot)(a.rootId);if(!b)return{ok:!1,error:"Root not found"};let c=(await (0,h.vd)(b.path)).find(b=>b.id===a.suggestionId);if(!c)return{ok:!1,error:"Suggestion not found or already actioned"};let d=await (0,i.g3)(a.rootId,c.prompt,[]);if(!d.ok)return{ok:!1,error:d.error??"topic start failed"};return await (0,h.Bd)(b.path,c.id,d.topicId),(0,f.revalidatePath)(`/roots/${a.rootId}`),{ok:!0,topicId:d.topicId}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function o(a){try{let b=await (0,g.getRoot)(a.rootId);if(!b)return{ok:!1,error:"Root not found"};let c=(await (0,h.vd)(b.path)).find(b=>b.id===a.suggestionId);if(!c)return{ok:!1,error:"Suggestion not found"};let d=`Rejected suggestion: "${c.title}" (${c.kind})`;return await (0,j.xP)({scope:"project",rootPath:b.path},"AVOID","append",{content:d}),await (0,h.eJ)(b.path,c.id),(0,f.revalidatePath)(`/roots/${a.rootId}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}[i,j]=l.then?(await l)():l,(0,k.D)([m,n,o]),(0,e.A)(m,"40a5d1300a3e470a6db661ee995173b7dca023b3c4",null),(0,e.A)(n,"40f1b7d743d741a7ecf30e8871f2f7dc01edf69501",null),(0,e.A)(o,"40dd36708c99c323debf6dfdc5d723986eb3cd5dfb",null),d()}catch(a){d(a)}})}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[9803,8404,9631,7229,4460,5895,8056,4842,5543,1105,4251,1358,4578,285,9861,9703,9186,4812,1525,404,9809],()=>b(b.s=65686));module.exports=c})();
|