@devflow-tools/devflow 0.16.0 → 0.16.2
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/dist/cli.js +78 -49
- package/dist/dashboard/404.html +1 -1
- package/dist/dashboard/_next/static/chunks/{736-db1a009357c222d2.js → 384-484184f146e1b764.js} +1 -1
- package/dist/dashboard/_next/static/chunks/{429-eac85fdc49353ed8.js → 429-3a8e078af4ea04bd.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/accuracy/{page-ca6a419d8b29eb4f.js → page-3b8b7448c9c7aeee.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/benchmark/page-d8f3f089f1d15cc7.js +1 -0
- package/dist/dashboard/_next/static/chunks/app/context/{page-1874ae1050524cb6.js → page-480f7324dee9cf74.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/doctor/{page-d542f2ab8d6a1c59.js → page-c32c81c69968099f.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/executions/{page-b98ec834dcda8d93.js → page-bee250062acc03a8.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/graph/{page-f0e7e15288791e9c.js → page-75947209e5b7741c.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/knowledge/{page-86808abd0d47c026.js → page-61a2d663940fb04b.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/{layout-4b78776412bd4fee.js → layout-572650e435947896.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/memory/{page-e169762426ac7a23.js → page-71d7c8926179b065.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/{page-c3e980fb2621470c.js → page-10dcf844701d7903.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/replay/{page-a8a465ed885df0cf.js → page-f354eb8ed0bfbb11.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/runs/[id]/{page-cc1d5182707fca5b.js → page-ffc0fda72263722c.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/runs/{page-bbf0a58abd70430c.js → page-4da6997bddcfeb45.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/settings/{page-9602ff45892e7910.js → page-0fa1d3b02152a97c.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/timeline/{page-a8eb3caf23be8a86.js → page-b676878a19561da3.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/tool-metrics/{page-1f86f62b187f2b5e.js → page-6452423bc1f543ec.js} +1 -1
- package/dist/dashboard/_next/static/chunks/app/workflows/{page-551939c9e86b26c6.js → page-0ff0044616ac56aa.js} +1 -1
- package/dist/dashboard/_next/static/chunks/main-app-cf693a9b955f073e.js +1 -0
- package/dist/dashboard/accuracy.html +1 -1
- package/dist/dashboard/accuracy.txt +3 -3
- package/dist/dashboard/benchmark.html +1 -1
- package/dist/dashboard/benchmark.txt +3 -3
- package/dist/dashboard/context.html +1 -1
- package/dist/dashboard/context.txt +3 -3
- package/dist/dashboard/doctor.html +1 -1
- package/dist/dashboard/doctor.txt +3 -3
- package/dist/dashboard/executions.html +1 -1
- package/dist/dashboard/executions.txt +3 -3
- package/dist/dashboard/graph.html +1 -1
- package/dist/dashboard/graph.txt +3 -3
- package/dist/dashboard/index.html +1 -1
- package/dist/dashboard/index.txt +3 -3
- package/dist/dashboard/knowledge.html +1 -1
- package/dist/dashboard/knowledge.txt +3 -3
- package/dist/dashboard/memory.html +1 -1
- package/dist/dashboard/memory.txt +3 -3
- package/dist/dashboard/replay.html +1 -1
- package/dist/dashboard/replay.txt +3 -3
- package/dist/dashboard/runs/_.html +1 -1
- package/dist/dashboard/runs/_.txt +3 -3
- package/dist/dashboard/runs.html +1 -1
- package/dist/dashboard/runs.txt +3 -3
- package/dist/dashboard/settings.html +1 -1
- package/dist/dashboard/settings.txt +3 -3
- package/dist/dashboard/timeline.html +1 -1
- package/dist/dashboard/timeline.txt +3 -3
- package/dist/dashboard/tool-metrics.html +1 -1
- package/dist/dashboard/tool-metrics.txt +3 -3
- package/dist/dashboard/workflows.html +1 -1
- package/dist/dashboard/workflows.txt +3 -3
- package/dist/hooks/hook-client.js +5 -5
- package/dist/hooks/hook-daemon.js +11 -11
- package/dist/hooks/post-tool-use-failure.js +2 -2
- package/dist/hooks/post-tool-use.js +3 -3
- package/dist/hooks/pre-compact.js +2 -2
- package/dist/hooks/pre-tool-use.js +2 -2
- package/dist/hooks/session-end.js +2 -2
- package/dist/hooks/stop.js +2 -2
- package/dist/hooks/user-prompt-submit.js +3 -2
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/CLAUDE.md +34 -0
- package/dist/plugin/dist/command-registry.json +297 -0
- package/dist/plugin/dist/hooks/hook-client.js +5 -5
- package/dist/plugin/dist/hooks/hook-daemon.js +11 -11
- package/dist/plugin/dist/hooks/post-tool-use-failure.js +2 -2
- package/dist/plugin/dist/hooks/post-tool-use.js +3 -3
- package/dist/plugin/dist/hooks/pre-compact.js +2 -2
- package/dist/plugin/dist/hooks/pre-tool-use.js +2 -2
- package/dist/plugin/dist/hooks/session-end.js +2 -2
- package/dist/plugin/dist/hooks/stop.js +2 -2
- package/dist/plugin/dist/hooks/user-prompt-submit.js +3 -2
- package/dist/plugin/dist/skills/devflow:animation/SKILL.md +63 -0
- package/dist/plugin/dist/skills/devflow:context/SKILL.md +90 -0
- package/dist/plugin/dist/skills/devflow:css/SKILL.md +63 -0
- package/dist/plugin/dist/skills/devflow:docker/SKILL.md +67 -0
- package/dist/plugin/dist/skills/devflow:electron/SKILL.md +67 -0
- package/dist/plugin/dist/skills/devflow:git/SKILL.md +67 -0
- package/dist/plugin/dist/skills/devflow:graph/SKILL.md +80 -0
- package/dist/plugin/dist/skills/devflow:graphql/SKILL.md +66 -0
- package/dist/plugin/dist/skills/devflow:knowledge/SKILL.md +80 -0
- package/dist/plugin/dist/skills/devflow:memory/SKILL.md +79 -0
- package/dist/plugin/dist/skills/devflow:nest/SKILL.md +68 -0
- package/dist/plugin/dist/skills/devflow:nextjs/SKILL.md +65 -0
- package/dist/plugin/dist/skills/devflow:performance/SKILL.md +67 -0
- package/dist/plugin/dist/skills/devflow:react/SKILL.md +96 -0
- package/dist/plugin/dist/skills/devflow:tailwind/SKILL.md +65 -0
- package/dist/plugin/dist/skills/devflow:taro/SKILL.md +66 -0
- package/dist/plugin/dist/skills/devflow:ui-layout/SKILL.md +63 -0
- package/dist/plugin/dist/skills/devflow:vue/SKILL.md +72 -0
- package/dist/plugin/dist/skills/devflow:workflow/SKILL.md +80 -0
- package/dist/plugin/hooks/constitution.md +20 -0
- package/dist/plugin/hooks/post-tool-use +20 -0
- package/dist/plugin/hooks/post-tool-use-failure +19 -0
- package/dist/plugin/hooks/pre-compact +19 -0
- package/dist/plugin/hooks/pre-tool-use +23 -0
- package/dist/plugin/hooks/session-end +19 -0
- package/dist/plugin/hooks/session-start +249 -0
- package/dist/plugin/hooks/stop +27 -0
- package/dist/plugin/hooks/user-prompt-submit +19 -0
- package/dist/plugin/package.json +43 -0
- package/dist/plugin/skills/{devflow:react → react}/SKILL.md +16 -3
- package/package.json +13 -13
- package/plugin-registry.json +29 -29
- package/dist/dashboard/_next/static/chunks/app/benchmark/page-6c6d0acbcde4eb85.js +0 -1
- package/dist/dashboard/_next/static/chunks/main-app-202a5f91ead17fa7.js +0 -1
- /package/dist/dashboard/_next/static/{n_2t1_63toasXsidAssD9 → ZaapgyqOj6AXHY5zdw6_X}/_buildManifest.js +0 -0
- /package/dist/dashboard/_next/static/{n_2t1_63toasXsidAssD9 → ZaapgyqOj6AXHY5zdw6_X}/_ssgManifest.js +0 -0
- /package/dist/plugin/{hooks.json → hooks/hooks.json} +0 -0
- /package/dist/plugin/skills/{devflow:animation → animation}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:context → context}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:css → css}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:docker → docker}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:doctor → doctor}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:electron → electron}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:git → git}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:graph → graph}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:graphql → graphql}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:knowledge → knowledge}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:memory → memory}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:nest → nest}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:nextjs → nextjs}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:performance → performance}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:start → start}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:tailwind → tailwind}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:taro → taro}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:ui-layout → ui-layout}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:vue → vue}/SKILL.md +0 -0
- /package/dist/plugin/skills/{devflow:workflow → workflow}/SKILL.md +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46],{13002:function(t,e,s){Promise.resolve().then(s.bind(s,51098))},51098:function(t,e,s){"use strict";s.d(e,{ReplayView:function(){return g}});var i=s(27573),r=s(88146),n=s(81695),a=s(7653),o=s(2389);let u=(0,o.Z)("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);var c=s(58410);let l=(0,o.Z)("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);var d=s(61990),h=s(2966);let m=(0,o.Z)("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);function p(t){let{isPlaying:e,speed:s,onPlayPause:r,onStepForward:n,onStepBack:a,onJumpToStart:o,onJumpToEnd:p,onSpeedChange:x}=t;return(0,i.jsxs)("div",{className:"flex items-center justify-center gap-2 p-3 border-b border-border bg-secondary/30",children:[(0,i.jsx)("button",{onClick:o,className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(u,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:a,className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(c.Z,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:r,className:"p-2 rounded-full bg-primary text-primary-foreground hover:opacity-90",children:e?(0,i.jsx)(l,{className:"h-4 w-4"}):(0,i.jsx)(d.Z,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:n,className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(h.Z,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:p,className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(m,{className:"h-4 w-4"})}),(0,i.jsx)("div",{className:"border-l border-border h-5 mx-2"}),[.5,1,2,4,8].map(t=>(0,i.jsxs)("button",{onClick:()=>x(t),className:"px-1.5 py-0.5 text-xs rounded ".concat(s===t?"bg-primary text-primary-foreground":"hover:bg-accent text-muted-foreground"),children:[t,"x"]},t))]})}function x(t){let{events:e,currentIndex:s,onSeek:r}=t;if(0===e.length)return null;let n=e[0].timestamp,a=e[e.length-1].timestamp-n||1;return(0,i.jsx)("div",{className:"px-4 py-2 border-b border-border",children:(0,i.jsxs)("div",{className:"relative h-8 bg-secondary rounded cursor-pointer",onClick:t=>{let s=t.currentTarget.getBoundingClientRect();r(Math.round((t.clientX-s.left)/s.width*(e.length-1)))},children:[e.map((t,e)=>{let r=(t.timestamp-n)/a*100;return(0,i.jsx)("div",{className:"absolute top-1 w-2 h-6 rounded-sm ".concat(e<=s?"bg-primary":"bg-border"),style:{left:"".concat(r,"%")},title:t.stepId},t.id)}),(0,i.jsx)("div",{className:"absolute top-0 h-full w-0.5 bg-foreground",style:{left:"".concat(s/(e.length-1||1)*100,"%")}})]})})}function f(t){var e,s;let{events:r,currentIndex:n}=t,a=null!==(s=null===(e=r[0])||void 0===e?void 0:e.timestamp)&&void 0!==s?s:0;return(0,i.jsx)("div",{className:"space-y-0.5 font-mono text-xs",children:r.map((t,e)=>{var s,r,o,u;let c=((t.timestamp-a)/1e3).toFixed(1),l=e===n;return(0,i.jsxs)("div",{className:"flex gap-2 py-1 px-2 rounded ".concat(l?"bg-primary/10 text-primary font-medium":e<n?"text-muted-foreground":"text-muted-foreground/50"),children:[(0,i.jsxs)("span",{className:"w-16 text-right tabular-nums",children:["[",c,"s]"]}),(0,i.jsx)("span",{children:t.kind}),(0,i.jsx)("span",{className:"text-muted-foreground/50",children:(null===(s=t.data)||void 0===s?void 0:s.toolName)||(null===(r=t.data)||void 0===r?void 0:r.filePath)||(null===(o=t.data)||void 0===o?void 0:o.model)||(null===(u=t.data)||void 0===u?void 0:u.command)||""}),l&&(0,i.jsx)("span",{className:"ml-auto text-primary",children:"YOU ARE HERE"})]},t.id)})})}var v=s(61883);function y(t){var e;let{events:s,runId:r,onBack:n}=t,o=[...s].sort((t,e)=>t.timestamp-e.timestamp),[u,c]=(0,a.useState)(0),[l,d]=(0,a.useState)(!1),[h,m]=(0,a.useState)(1),y=(0,a.useRef)(null),b=null!==(e=o[u])&&void 0!==e?e:null,g=(0,a.useCallback)(()=>{c(t=>{let e=t+1;if(e>=o.length)return d(!1),t;let s=Math.min((o[e].timestamp-o[t].timestamp)/h,2e3);return y.current=setTimeout(()=>g(),s),e})},[o,h]);return(0,a.useEffect)(()=>(l?g():y.current&&clearTimeout(y.current),()=>{y.current&&clearTimeout(y.current)}),[l,g]),(0,i.jsxs)("div",{className:"flex flex-col h-full",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b border-border",children:[(0,i.jsx)("button",{onClick:n,className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(v.Z,{className:"h-4 w-4"})}),(0,i.jsx)("h2",{className:"text-lg font-bold",children:"Replay"}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:r}),(0,i.jsxs)("span",{className:"ml-auto text-xs text-muted-foreground",children:["Event ",u+1,"/",o.length]})]}),(0,i.jsx)(p,{isPlaying:l,speed:h,onPlayPause:()=>d(t=>!t),onStepForward:()=>c(t=>Math.min(t+1,o.length-1)),onStepBack:()=>c(t=>Math.max(t-1,0)),onJumpToStart:()=>{d(!1),c(0)},onJumpToEnd:()=>{d(!1),c(o.length-1)},onSpeedChange:m}),(0,i.jsx)(x,{events:o,currentIndex:u,onSeek:t=>{d(!1),c(t)}}),(0,i.jsxs)("div",{className:"flex-1 overflow-hidden flex",children:[(0,i.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,i.jsx)(f,{events:o,currentIndex:u})}),b&&(0,i.jsxs)("div",{className:"w-80 border-l border-border overflow-y-auto p-4",children:[(0,i.jsx)("h3",{className:"text-sm font-semibold mb-3",children:"Current Event"}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-xs text-muted-foreground",children:"Kind"}),(0,i.jsx)("div",{className:"text-sm font-medium",children:b.kind})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-xs text-muted-foreground",children:"Step"}),(0,i.jsx)("div",{className:"text-sm font-mono text-xs",children:b.stepId})]}),null!=b.data.model&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-xs text-muted-foreground",children:"Model"}),(0,i.jsx)("div",{className:"text-sm",children:b.data.model})]}),null!=b.data.prompt&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-xs text-muted-foreground",children:"Prompt"}),(0,i.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-32 overflow-y-auto whitespace-pre-wrap",children:b.data.prompt})]}),null!=b.data.response&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-xs text-muted-foreground",children:"Response"}),(0,i.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-32 overflow-y-auto whitespace-pre-wrap",children:b.data.response})]})]})]})]})]})}var b=s(57429);function g(){let t=(0,n.useRouter)(),e=(0,n.useSearchParams)().get("runId"),{data:s,isLoading:a}=(0,b.JM)(e),{data:o}=(0,b.Vc)(30,0);if(!e){let t=null!=o?o:[];return(0,i.jsxs)("div",{className:"h-full overflow-y-auto p-6",children:[(0,i.jsx)("h2",{className:"mb-4 text-2xl font-bold",children:"Replay"}),(0,i.jsxs)("div",{className:"divide-y divide-border border-y border-border",children:[t.map(t=>(0,i.jsxs)(r.default,{href:"/replay?runId=".concat(encodeURIComponent(t.id)),className:"flex items-center gap-4 px-2 py-3 text-sm hover:bg-accent",children:[(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:t.id}),(0,i.jsx)("span",{className:"text-muted-foreground",children:t.status}),(0,i.jsx)("span",{className:"text-muted-foreground",children:new Date(t.startedAt).toLocaleString()})]},t.id)),0===t.length?(0,i.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No runs available"}):null]})]})}if(a)return(0,i.jsx)("div",{className:"p-6 text-sm text-muted-foreground",children:"Loading replay..."});let u=(null!=s?s:[]).map(t=>{var e,s,i,r;return{id:String(null!==(e=t.id)&&void 0!==e?e:""),kind:String(null!==(s=t.kind)&&void 0!==s?s:"tool_use"),stepId:String(null!==(i=t.stepId)&&void 0!==i?i:"unknown"),timestamp:Number(null!==(r=t.timestamp)&&void 0!==r?r:0),duration:"number"==typeof t.duration?t.duration:void 0,data:t.data&&"object"==typeof t.data?t.data:{}}});return(0,i.jsx)(y,{events:u,runId:e,onBack:()=>t.push("/replay")})}},61883:function(t,e,s){"use strict";s.d(e,{Z:function(){return i}});let i=(0,s(2389).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},58410:function(t,e,s){"use strict";s.d(e,{Z:function(){return i}});let i=(0,s(2389).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},2966:function(t,e,s){"use strict";s.d(e,{Z:function(){return i}});let i=(0,s(2389).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},64855:function(t,e,s){"use strict";s.d(e,{R:function(){return o},m:function(){return a}});var i=s(2906),r=s(5531),n=s(11135),a=class extends r.F{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||o(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#r({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,n.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#r({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});let i="pending"===this.state.status,r=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:r}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#r({type:"pending",context:e,variables:t,isPaused:r})}let n=await this.#i.start();return await this.#s.config.onSuccess?.(n,t,this.state.context,this,s),await this.options.onSuccess?.(n,t,this.state.context,s),await this.#s.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(n,null,t,this.state.context,s),this.#r({type:"success",data:n}),n}catch(e){try{await this.#s.config.onError?.(e,t,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onError?.(e,t,this.state.context,s)}catch(t){Promise.reject(t)}try{await this.#s.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,s)}catch(t){Promise.reject(t)}throw this.#r({type:"error",error:e}),e}finally{this.#s.runNext(this)}}#r(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},15969:function(t,e,s){"use strict";s.d(e,{D:function(){return l}});var i=s(7653),r=s(64855),n=s(2906),a=s(24559),o=s(50803),u=class extends a.l{#t;#n=void 0;#a;#o;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#u()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,o.VS)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,o.Ym)(e.mutationKey)!==(0,o.Ym)(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(t){this.#u(),this.#c(t)}getCurrentResult(){return this.#n}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#u(),this.#c()}mutate(t,e){return this.#o=e,this.#a?.removeObserver(this),this.#a=this.#t.getMutationCache().build(this.#t,this.options),this.#a.addObserver(this),this.#a.execute(t)}#u(){let t=this.#a?.state??(0,r.R)();this.#n={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#c(t){n.Vr.batch(()=>{if(this.#o&&this.hasListeners()){let e=this.#n.variables,s=this.#n.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#o.onSuccess?.(t.data,e,s,i)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(t.data,null,e,s,i)}catch(t){Promise.reject(t)}}else if(t?.type==="error"){try{this.#o.onError?.(t.error,e,s,i)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(void 0,t.error,e,s,i)}catch(t){Promise.reject(t)}}}this.listeners.forEach(t=>{t(this.#n)})})}},c=s(77930);function l(t,e){let s=(0,c.NL)(e),[r]=i.useState(()=>new u(s,t));i.useEffect(()=>{r.setOptions(t)},[r,t]);let a=i.useSyncExternalStore(i.useCallback(t=>r.subscribe(n.Vr.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=i.useCallback((t,e)=>{r.mutate(t,e).catch(o.ZT)},[r]);if(a.error&&(0,o.L3)(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:l,mutateAsync:a.mutate}}}},function(t){t.O(0,[736,458,429,293,528,744],function(){return t(t.s=13002)}),_N_E=t.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46],{38154:function(t,e,s){Promise.resolve().then(s.bind(s,51098))},51098:function(t,e,s){"use strict";s.d(e,{ReplayView:function(){return g}});var i=s(27573),r=s(88146),n=s(81695),a=s(7653),o=s(2389);let u=(0,o.Z)("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);var c=s(58410);let l=(0,o.Z)("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);var d=s(61990),h=s(2966);let m=(0,o.Z)("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);function p(t){let{isPlaying:e,speed:s,onPlayPause:r,onStepForward:n,onStepBack:a,onJumpToStart:o,onJumpToEnd:p,onSpeedChange:x}=t;return(0,i.jsxs)("div",{className:"flex items-center justify-center gap-2 p-3 border-b border-border bg-secondary/30",children:[(0,i.jsx)("button",{onClick:o,className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(u,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:a,className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(c.Z,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:r,className:"p-2 rounded-full bg-primary text-primary-foreground hover:opacity-90",children:e?(0,i.jsx)(l,{className:"h-4 w-4"}):(0,i.jsx)(d.Z,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:n,className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(h.Z,{className:"h-4 w-4"})}),(0,i.jsx)("button",{onClick:p,className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(m,{className:"h-4 w-4"})}),(0,i.jsx)("div",{className:"border-l border-border h-5 mx-2"}),[.5,1,2,4,8].map(t=>(0,i.jsxs)("button",{onClick:()=>x(t),className:"px-1.5 py-0.5 text-xs rounded ".concat(s===t?"bg-primary text-primary-foreground":"hover:bg-accent text-muted-foreground"),children:[t,"x"]},t))]})}function x(t){let{events:e,currentIndex:s,onSeek:r}=t;if(0===e.length)return null;let n=e[0].timestamp,a=e[e.length-1].timestamp-n||1;return(0,i.jsx)("div",{className:"px-4 py-2 border-b border-border",children:(0,i.jsxs)("div",{className:"relative h-8 bg-secondary rounded cursor-pointer",onClick:t=>{let s=t.currentTarget.getBoundingClientRect();r(Math.round((t.clientX-s.left)/s.width*(e.length-1)))},children:[e.map((t,e)=>{let r=(t.timestamp-n)/a*100;return(0,i.jsx)("div",{className:"absolute top-1 w-2 h-6 rounded-sm ".concat(e<=s?"bg-primary":"bg-border"),style:{left:"".concat(r,"%")},title:t.stepId},t.id)}),(0,i.jsx)("div",{className:"absolute top-0 h-full w-0.5 bg-foreground",style:{left:"".concat(s/(e.length-1||1)*100,"%")}})]})})}function f(t){var e,s;let{events:r,currentIndex:n}=t,a=null!==(s=null===(e=r[0])||void 0===e?void 0:e.timestamp)&&void 0!==s?s:0;return(0,i.jsx)("div",{className:"space-y-0.5 font-mono text-xs",children:r.map((t,e)=>{var s,r,o,u;let c=((t.timestamp-a)/1e3).toFixed(1),l=e===n;return(0,i.jsxs)("div",{className:"flex gap-2 py-1 px-2 rounded ".concat(l?"bg-primary/10 text-primary font-medium":e<n?"text-muted-foreground":"text-muted-foreground/50"),children:[(0,i.jsxs)("span",{className:"w-16 text-right tabular-nums",children:["[",c,"s]"]}),(0,i.jsx)("span",{children:t.kind}),(0,i.jsx)("span",{className:"text-muted-foreground/50",children:(null===(s=t.data)||void 0===s?void 0:s.toolName)||(null===(r=t.data)||void 0===r?void 0:r.filePath)||(null===(o=t.data)||void 0===o?void 0:o.model)||(null===(u=t.data)||void 0===u?void 0:u.command)||""}),l&&(0,i.jsx)("span",{className:"ml-auto text-primary",children:"YOU ARE HERE"})]},t.id)})})}var v=s(61883);function y(t){var e;let{events:s,runId:r,onBack:n}=t,o=[...s].sort((t,e)=>t.timestamp-e.timestamp),[u,c]=(0,a.useState)(0),[l,d]=(0,a.useState)(!1),[h,m]=(0,a.useState)(1),y=(0,a.useRef)(null),b=null!==(e=o[u])&&void 0!==e?e:null,g=(0,a.useCallback)(()=>{c(t=>{let e=t+1;if(e>=o.length)return d(!1),t;let s=Math.min((o[e].timestamp-o[t].timestamp)/h,2e3);return y.current=setTimeout(()=>g(),s),e})},[o,h]);return(0,a.useEffect)(()=>(l?g():y.current&&clearTimeout(y.current),()=>{y.current&&clearTimeout(y.current)}),[l,g]),(0,i.jsxs)("div",{className:"flex flex-col h-full",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b border-border",children:[(0,i.jsx)("button",{onClick:n,className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(v.Z,{className:"h-4 w-4"})}),(0,i.jsx)("h2",{className:"text-lg font-bold",children:"Replay"}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:r}),(0,i.jsxs)("span",{className:"ml-auto text-xs text-muted-foreground",children:["Event ",u+1,"/",o.length]})]}),(0,i.jsx)(p,{isPlaying:l,speed:h,onPlayPause:()=>d(t=>!t),onStepForward:()=>c(t=>Math.min(t+1,o.length-1)),onStepBack:()=>c(t=>Math.max(t-1,0)),onJumpToStart:()=>{d(!1),c(0)},onJumpToEnd:()=>{d(!1),c(o.length-1)},onSpeedChange:m}),(0,i.jsx)(x,{events:o,currentIndex:u,onSeek:t=>{d(!1),c(t)}}),(0,i.jsxs)("div",{className:"flex-1 overflow-hidden flex",children:[(0,i.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,i.jsx)(f,{events:o,currentIndex:u})}),b&&(0,i.jsxs)("div",{className:"w-80 border-l border-border overflow-y-auto p-4",children:[(0,i.jsx)("h3",{className:"text-sm font-semibold mb-3",children:"Current Event"}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-xs text-muted-foreground",children:"Kind"}),(0,i.jsx)("div",{className:"text-sm font-medium",children:b.kind})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-xs text-muted-foreground",children:"Step"}),(0,i.jsx)("div",{className:"text-sm font-mono text-xs",children:b.stepId})]}),null!=b.data.model&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-xs text-muted-foreground",children:"Model"}),(0,i.jsx)("div",{className:"text-sm",children:b.data.model})]}),null!=b.data.prompt&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-xs text-muted-foreground",children:"Prompt"}),(0,i.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-32 overflow-y-auto whitespace-pre-wrap",children:b.data.prompt})]}),null!=b.data.response&&(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-xs text-muted-foreground",children:"Response"}),(0,i.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-32 overflow-y-auto whitespace-pre-wrap",children:b.data.response})]})]})]})]})]})}var b=s(57429);function g(){let t=(0,n.useRouter)(),e=(0,n.useSearchParams)().get("runId"),{data:s,isLoading:a}=(0,b.JM)(e),{data:o}=(0,b.Vc)(30,0);if(!e){let t=null!=o?o:[];return(0,i.jsxs)("div",{className:"h-full overflow-y-auto p-6",children:[(0,i.jsx)("h2",{className:"mb-4 text-2xl font-bold",children:"Replay"}),(0,i.jsxs)("div",{className:"divide-y divide-border border-y border-border",children:[t.map(t=>(0,i.jsxs)(r.default,{href:"/replay?runId=".concat(encodeURIComponent(t.id)),className:"flex items-center gap-4 px-2 py-3 text-sm hover:bg-accent",children:[(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:t.id}),(0,i.jsx)("span",{className:"text-muted-foreground",children:t.status}),(0,i.jsx)("span",{className:"text-muted-foreground",children:new Date(t.startedAt).toLocaleString()})]},t.id)),0===t.length?(0,i.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No runs available"}):null]})]})}if(a)return(0,i.jsx)("div",{className:"p-6 text-sm text-muted-foreground",children:"Loading replay..."});let u=(null!=s?s:[]).map(t=>{var e,s,i,r;return{id:String(null!==(e=t.id)&&void 0!==e?e:""),kind:String(null!==(s=t.kind)&&void 0!==s?s:"tool_use"),stepId:String(null!==(i=t.stepId)&&void 0!==i?i:"unknown"),timestamp:Number(null!==(r=t.timestamp)&&void 0!==r?r:0),duration:"number"==typeof t.duration?t.duration:void 0,data:t.data&&"object"==typeof t.data?t.data:{}}});return(0,i.jsx)(y,{events:u,runId:e,onBack:()=>t.push("/replay")})}},61883:function(t,e,s){"use strict";s.d(e,{Z:function(){return i}});let i=(0,s(2389).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},58410:function(t,e,s){"use strict";s.d(e,{Z:function(){return i}});let i=(0,s(2389).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},2966:function(t,e,s){"use strict";s.d(e,{Z:function(){return i}});let i=(0,s(2389).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},64855:function(t,e,s){"use strict";s.d(e,{R:function(){return o},m:function(){return a}});var i=s(2906),r=s(5531),n=s(11135),a=class extends r.F{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||o(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#r({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,n.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#r({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});let i="pending"===this.state.status,r=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:r}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#r({type:"pending",context:e,variables:t,isPaused:r})}let n=await this.#i.start();return await this.#s.config.onSuccess?.(n,t,this.state.context,this,s),await this.options.onSuccess?.(n,t,this.state.context,s),await this.#s.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(n,null,t,this.state.context,s),this.#r({type:"success",data:n}),n}catch(e){try{await this.#s.config.onError?.(e,t,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onError?.(e,t,this.state.context,s)}catch(t){Promise.reject(t)}try{await this.#s.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,s)}catch(t){Promise.reject(t)}throw this.#r({type:"error",error:e}),e}finally{this.#s.runNext(this)}}#r(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},15969:function(t,e,s){"use strict";s.d(e,{D:function(){return l}});var i=s(7653),r=s(64855),n=s(2906),a=s(24559),o=s(50803),u=class extends a.l{#t;#n=void 0;#a;#o;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#u()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,o.VS)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,o.Ym)(e.mutationKey)!==(0,o.Ym)(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(t){this.#u(),this.#c(t)}getCurrentResult(){return this.#n}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#u(),this.#c()}mutate(t,e){return this.#o=e,this.#a?.removeObserver(this),this.#a=this.#t.getMutationCache().build(this.#t,this.options),this.#a.addObserver(this),this.#a.execute(t)}#u(){let t=this.#a?.state??(0,r.R)();this.#n={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#c(t){n.Vr.batch(()=>{if(this.#o&&this.hasListeners()){let e=this.#n.variables,s=this.#n.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#o.onSuccess?.(t.data,e,s,i)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(t.data,null,e,s,i)}catch(t){Promise.reject(t)}}else if(t?.type==="error"){try{this.#o.onError?.(t.error,e,s,i)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(void 0,t.error,e,s,i)}catch(t){Promise.reject(t)}}}this.listeners.forEach(t=>{t(this.#n)})})}},c=s(77930);function l(t,e){let s=(0,c.NL)(e),[r]=i.useState(()=>new u(s,t));i.useEffect(()=>{r.setOptions(t)},[r,t]);let a=i.useSyncExternalStore(i.useCallback(t=>r.subscribe(n.Vr.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=i.useCallback((t,e)=>{r.mutate(t,e).catch(o.ZT)},[r]);if(a.error&&(0,o.L3)(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:l,mutateAsync:a.mutate}}}},function(t){t.O(0,[384,458,429,293,528,744],function(){return t(t.s=38154)}),_N_E=t.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[348],{64184:function(e,t,r){Promise.resolve().then(r.bind(r,50687))},38941:function(e,t,r){"use strict";r.d(t,{C:function(){return o}});var n=r(27573);r(7653);var s=r(29147);let l=(0,r(49289).j)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:r,...o}=e;return(0,n.jsx)("div",{className:(0,s.cn)(l({variant:r}),t),...o})}},72196:function(e,t,r){"use strict";r.d(t,{Ol:function(){return a},Zb:function(){return o},aY:function(){return i},ll:function(){return d}});var n=r(27573),s=r(7653),l=r(29147);let o=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("rounded-lg border border-border bg-card text-card-foreground",r),...s})});o.displayName="Card";let a=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-4",r),...s})});a.displayName="CardHeader";let d=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("h3",{ref:t,className:(0,l.cn)("text-sm font-semibold leading-none tracking-tight",r),...s})});d.displayName="CardTitle";let i=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("p-4 pt-0",r),...s})});i.displayName="CardContent"},50687:function(e,t,r){"use strict";r.d(t,{RunDetailRoute:function(){return y}});var n=r(27573),s=r(81695),l=r(7653),o=r(57429),a=r(3806);function d(e){let{steps:t,events:r}=e,{t:s}=(0,a.$G)();return(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("h3",{className:"text-xs font-semibold text-muted-foreground mb-2",children:s("events.steps")}),t.map(e=>{let t=r.filter(t=>t.stepId===e),l=t.reduce((e,t)=>{var r;return e+(null!==(r=t.duration)&&void 0!==r?r:0)},0);return(0,n.jsxs)("div",{className:"text-xs py-1 px-2 rounded hover:bg-accent cursor-pointer",children:[(0,n.jsx)("div",{className:"font-medium truncate",children:e}),(0,n.jsxs)("div",{className:"text-muted-foreground",children:[t.length," ",s("events.eventCount")," \xb7 ",l,"ms"]})]},e)})]})}let i={llm_call:"text-blue-500",tool_use:"text-green-500",memory_read:"text-pink-500",memory_write:"text-pink-500",file_read:"text-gray-500",file_write:"text-yellow-500",bash_command:"text-purple-500",subagent:"text-orange-500",skill_invoke:"text-cyan-500",mcp_tool_call:"text-indigo-500",error:"text-red-500",user_input:"text-orange-500",step_start:"text-cyan-500",step_end:"text-cyan-500"},c={llm_call:"events.llmCall",tool_use:"events.toolUse",memory_read:"events.memoryRead",memory_write:"events.memoryWrite",file_read:"events.fileRead",file_write:"events.fileWrite",bash_command:"events.bashCommand",subagent:"events.subagent",skill_invoke:"events.skillInvoke",mcp_tool_call:"events.mcpToolCall",error:"events.error",user_input:"events.userInput",step_start:"events.stepStart",step_end:"events.stepEnd"};function u(e){let{events:t,onSelect:r,selectedId:s}=e,{t:l}=(0,a.$G)(),o=[...t].sort((e,t)=>e.timestamp-t.timestamp);if(0===o.length)return(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:l("events.empty")});let d="";return(0,n.jsx)("div",{className:"space-y-0",children:o.map(e=>{var t,o,a,u,m,x,p,v;let f=e.stepId!==d;d=e.stepId;let h=null!==(v=i[e.kind])&&void 0!==v?v:"text-muted-foreground",g=c[e.kind],j=g?l(g):e.kind,N=(null===(t=e.data)||void 0===t?void 0:t.toolName)||(null===(o=e.data)||void 0===o?void 0:o.filePath)||(null===(a=e.data)||void 0===a?void 0:a.model)||(null===(u=e.data)||void 0===u?void 0:u.command)||(null===(m=e.data)||void 0===m?void 0:m.memoryKey)||"";return(0,n.jsxs)("div",{children:[f&&(0,n.jsx)("div",{className:"text-xs font-semibold text-muted-foreground pt-2 pb-1 border-t border-border mt-1",children:e.stepId}),(0,n.jsxs)("div",{onClick:()=>r(e),className:"flex items-center gap-2 py-1.5 px-2 rounded cursor-pointer text-xs hover:bg-accent ".concat(s===e.id?"bg-accent":""," ").concat((null===(x=e.metadata)||void 0===x?void 0:x.blocked)?"border-l-2 border-red-500 bg-red-50 dark:bg-red-950":""),children:[(null===(p=e.metadata)||void 0===p?void 0:p.blocked)&&(0,n.jsx)("span",{className:"text-red-500 font-bold text-[10px] uppercase tracking-wider",children:"BLOCKED"}),(0,n.jsx)("span",{className:"w-16 ".concat(h," font-medium"),children:j}),(0,n.jsx)("span",{className:"text-muted-foreground truncate flex-1",children:N}),e.duration?(0,n.jsxs)("span",{className:"text-muted-foreground",children:[e.duration,"ms"]}):null]})]},e.id)})})}var m=r(72196);function x(e){let{event:t}=e,[r,s]=(0,l.useState)(!1),o=t.input?JSON.stringify(t.input,null,2):"null",a=t.output?JSON.stringify(t.output,null,2):"null";return(0,n.jsxs)("div",{className:"space-y-4 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-semibold text-lg",children:t.mcpToolName||t.toolName}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:[t.toolType," \xb7 ",t.kind," \xb7 ",t.duration,"ms",t.blocked&&(0,n.jsx)("span",{className:"text-red-500 ml-2 font-bold",children:"BLOCKED"})]})]}),(0,n.jsx)("button",{onClick:()=>s(!r),className:"text-xs border rounded px-2 py-1 hover:bg-accent",children:r?"Formatted":"Raw JSON"})]}),t.error&&(0,n.jsx)("div",{className:"p-3 bg-red-50 dark:bg-red-950 border border-red-300 rounded text-sm text-red-700",children:t.error}),(0,n.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,n.jsxs)(m.Zb,{className:"p-3",children:[(0,n.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase",children:"Input"}),(0,n.jsx)("pre",{className:"text-xs overflow-auto max-h-96 ".concat(r?"":"max-h-40 overflow-hidden"),children:(0,n.jsx)("code",{children:r?o:o.slice(0,500)+(o.length>500?"\n... (truncated)":"")})})]}),(0,n.jsxs)(m.Zb,{className:"p-3",children:[(0,n.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase",children:"Output"}),null==t.output?(0,n.jsx)("p",{className:"text-xs text-yellow-600",children:"No output captured for this event"}):(0,n.jsx)("pre",{className:"text-xs overflow-auto max-h-96 ".concat(r?"":"max-h-40 overflow-hidden"),children:(0,n.jsx)("code",{children:r?a:a.slice(0,500)+(a.length>500?"\n... (truncated)":"")})})]})]})]})}function p(e){var t,r;let{event:s}=e,{t:l}=(0,a.$G)();if(!s)return(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:l("events.selectEvent")});if("tool_use"===s.kind&&(s.toolName||s.mcpToolName))return(0,n.jsx)(x,{event:s});let o=null!==(r=s.data)&&void 0!==r?r:{};return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold",children:l("events.eventDetail")}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.kind")}),(0,n.jsx)("div",{className:"text-sm font-medium",children:s.kind})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.step")}),(0,n.jsx)("div",{className:"text-sm font-mono",children:s.stepId})]}),null!=s.duration&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.duration")}),(0,n.jsxs)("div",{className:"text-sm",children:[s.duration,"ms"]})]}),null!=o.inputTokens&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.tokens")}),(0,n.jsx)("div",{className:"text-sm",children:l("events.tokensInOut",{input:o.inputTokens,output:o.outputTokens})})]}),null!=o.prompt&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.prompt")}),(0,n.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:o.prompt})]}),null!=o.response&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.response")}),(0,n.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:o.response})]}),null!=o.stdout&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.stdout")}),(0,n.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:o.stdout})]}),null!=o.stderr&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.stderr")}),(0,n.jsx)("pre",{className:"text-xs bg-red-50 dark:bg-red-950 p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:o.stderr})]}),null!=o.errorMessage&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.error")}),(0,n.jsx)("pre",{className:"text-xs bg-red-50 dark:bg-red-950 p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:o.errorMessage})]}),(null===(t=s.metadata)||void 0===t?void 0:t.truncated)!=null&&(0,n.jsx)("div",{className:"text-xs text-yellow-500",children:l("events.truncated")})]})]})}var v=r(38941),f=r(77329);let h=(0,r(2389).Z)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),g={context_insufficient:[{action:"Supplement task context",priority:"high"},{action:"Inspect graph roots and related files",priority:"medium"}],knowledge_missing:[{action:"Sync the required knowledge source",priority:"high"},{action:"Add or broaden documentation scopes",priority:"medium"}],workflow_design_issue:[{action:"Correct the failing step contract",priority:"high"},{action:"Review workflow dependencies",priority:"medium"}],tool_error:[{action:"Inspect the tool error and connectivity",priority:"high"},{action:"Retry with a validated input",priority:"medium"}],agent_override:[{action:"Review the rejected change and user feedback",priority:"high"}],unknown:[{action:"Inspect the failed step evidence",priority:"high"}]};function j(e){var t;let{failureCategory:r,failureReason:s,suggestedActions:l}=e,{t:o}=(0,a.$G)();return r?(0,n.jsxs)(m.Zb,{children:[(0,n.jsxs)(m.Ol,{children:[(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsx)(v.C,{className:null!==(t=({context_insufficient:"bg-yellow-500",knowledge_missing:"bg-orange-500",workflow_design_issue:"bg-purple-500",tool_error:"bg-red-500",agent_override:"bg-gray-500",unknown:"bg-gray-500"})[r])&&void 0!==t?t:"bg-gray-500",children:o("runDetail.category.".concat(r))})}),(0,n.jsx)(m.ll,{className:"text-sm",children:o("runDetail.failureReason")})]}),(0,n.jsxs)(m.aY,{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:s}),l&&l.length>0&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,n.jsx)(f.Z,{className:"h-4 w-4"}),o("runDetail.suggestedActions")]}),(0,n.jsx)("ul",{className:"space-y-1",children:l.map((e,t)=>(0,n.jsxs)("li",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(h,{className:"h-3 w-3 text-muted-foreground"}),(0,n.jsx)("span",{children:e.action}),(0,n.jsx)(v.C,{variant:"outline",className:"text-xs",children:e.priority})]},t))})]})]})]}):null}var N=r(61883);function b(e){var t,r;let{runId:i,onBack:c}=e,m=(0,s.useRouter)(),{t:x}=(0,a.$G)(),{data:v}=(0,o.rC)(i),{data:f}=(0,o.kP)(i),[h,b]=(0,l.useState)(null),y=(null!=v?v:[]).map(e=>{var t,r,n,s,l,o,a;let d=null!==(r=null!==(t=e.eventId)&&void 0!==t?t:e.id)&&void 0!==r?r:"",i=(null!==(n=e.kind)&&void 0!==n?n:e.toolType)||"tool_use",c={toolName:null!==(s=e.toolName)&&void 0!==s?s:e.mcpToolName,...null!==(l=e.input)&&void 0!==l?l:{}};return{id:d,stepId:null!==(o=e.executionId)&&void 0!==o?o:d,kind:i,timestamp:null!==(a=e.timestamp)&&void 0!==a?a:0,duration:e.duration,data:c,metadata:{isMcpTool:e.isMcpTool,mcpEnforced:e.mcpEnforced,mcpFallback:e.mcpFallback,blocked:e.blocked,blockReason:e.blockReason}}}),w=[...new Set(y.map(e=>e.stepId))],k=null!=f?f:{},_=[...null!=v?v:[]].reverse().find(e=>"string"==typeof e.failureCategory),C=null==_?void 0:_.failureCategory;return(0,n.jsxs)("div",{className:"flex flex-col h-full",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b border-border",children:[(0,n.jsx)("button",{onClick:null!=c?c:()=>m.push("/runs"),className:"p-1 rounded hover:bg-accent",title:x("runs.title"),children:(0,n.jsx)(N.Z,{className:"h-4 w-4"})}),(0,n.jsx)("h2",{className:"text-lg font-bold",children:x("runDetail.title","Session Detail")}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:i}),null!=k.totalToolCalls&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[String(k.totalToolCalls)," tools \xb7 ",String(k.mcpToolCalls)," MCP"]})]}),(0,n.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,n.jsx)("div",{className:"w-48 border-r border-border overflow-y-auto p-3",children:(0,n.jsx)(d,{steps:w,events:y})}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:(0,n.jsx)(u,{events:y,onSelect:e=>b(e),selectedId:null==h?void 0:h.id})}),(0,n.jsxs)("div",{className:"w-80 border-l border-border overflow-y-auto p-3",children:[C&&(0,n.jsx)("div",{className:"mb-3",children:(0,n.jsx)(j,{failureCategory:C,failureReason:String(null!==(t=null==_?void 0:_.error)&&void 0!==t?t:"Workflow step failed"),suggestedActions:null!==(r=g[C])&&void 0!==r?r:g.unknown})}),(0,n.jsx)(p,{event:h})]})]})]})}function y(){var e;let t=null!==(e=(0,s.usePathname)().split("/").filter(Boolean).at(-1))&&void 0!==e?e:"";return(0,n.jsx)(b,{runId:decodeURIComponent(t)})}},29147:function(e,t,r){"use strict";r.d(t,{cn:function(){return l}});var n=r(10607),s=r(25579);function l(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.m6)((0,n.W)(t))}},2389:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(7653);let s=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&r.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:s=24,strokeWidth:a=2,absoluteStrokeWidth:d,className:i="",children:c,iconNode:u,...m}=e;return(0,n.createElement)("svg",{ref:t,...o,width:s,height:s,stroke:r,strokeWidth:d?24*Number(a)/Number(s):a,className:l("lucide",i),...m},[...u.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(c)?c:[c]])}),d=(e,t)=>{let r=(0,n.forwardRef)((r,o)=>{let{className:d,...i}=r;return(0,n.createElement)(a,{ref:o,iconNode:t,className:l("lucide-".concat(s(e)),d),...i})});return r.displayName="".concat(e),r}},61883:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(2389).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},77329:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(2389).Z)("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"}]])},81695:function(e,t,r){"use strict";var n=r(21219);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},49289:function(e,t,r){"use strict";r.d(t,{j:function(){return o}});var n=r(10607);let s=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,l=n.W,o=(e,t)=>r=>{var n;if((null==t?void 0:t.variants)==null)return l(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:o,defaultVariants:a}=t,d=Object.keys(o).map(e=>{let t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;let l=s(t)||s(n);return o[e][l]}),i=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return l(e,d,null==t?void 0:null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...i}[t]):({...a,...i})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}},function(e){e.O(0,[736,806,697,429,293,528,744],function(){return e(e.s=64184)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[348],{71350:function(e,t,r){Promise.resolve().then(r.bind(r,50687))},38941:function(e,t,r){"use strict";r.d(t,{C:function(){return o}});var n=r(27573);r(7653);var s=r(29147);let l=(0,r(49289).j)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:r,...o}=e;return(0,n.jsx)("div",{className:(0,s.cn)(l({variant:r}),t),...o})}},72196:function(e,t,r){"use strict";r.d(t,{Ol:function(){return a},Zb:function(){return o},aY:function(){return i},ll:function(){return d}});var n=r(27573),s=r(7653),l=r(29147);let o=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("rounded-lg border border-border bg-card text-card-foreground",r),...s})});o.displayName="Card";let a=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-4",r),...s})});a.displayName="CardHeader";let d=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("h3",{ref:t,className:(0,l.cn)("text-sm font-semibold leading-none tracking-tight",r),...s})});d.displayName="CardTitle";let i=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("p-4 pt-0",r),...s})});i.displayName="CardContent"},50687:function(e,t,r){"use strict";r.d(t,{RunDetailRoute:function(){return y}});var n=r(27573),s=r(81695),l=r(7653),o=r(57429),a=r(3806);function d(e){let{steps:t,events:r}=e,{t:s}=(0,a.$G)();return(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("h3",{className:"text-xs font-semibold text-muted-foreground mb-2",children:s("events.steps")}),t.map(e=>{let t=r.filter(t=>t.stepId===e),l=t.reduce((e,t)=>{var r;return e+(null!==(r=t.duration)&&void 0!==r?r:0)},0);return(0,n.jsxs)("div",{className:"text-xs py-1 px-2 rounded hover:bg-accent cursor-pointer",children:[(0,n.jsx)("div",{className:"font-medium truncate",children:e}),(0,n.jsxs)("div",{className:"text-muted-foreground",children:[t.length," ",s("events.eventCount")," \xb7 ",l,"ms"]})]},e)})]})}let i={llm_call:"text-blue-500",tool_use:"text-green-500",memory_read:"text-pink-500",memory_write:"text-pink-500",file_read:"text-gray-500",file_write:"text-yellow-500",bash_command:"text-purple-500",subagent:"text-orange-500",skill_invoke:"text-cyan-500",mcp_tool_call:"text-indigo-500",error:"text-red-500",user_input:"text-orange-500",step_start:"text-cyan-500",step_end:"text-cyan-500"},c={llm_call:"events.llmCall",tool_use:"events.toolUse",memory_read:"events.memoryRead",memory_write:"events.memoryWrite",file_read:"events.fileRead",file_write:"events.fileWrite",bash_command:"events.bashCommand",subagent:"events.subagent",skill_invoke:"events.skillInvoke",mcp_tool_call:"events.mcpToolCall",error:"events.error",user_input:"events.userInput",step_start:"events.stepStart",step_end:"events.stepEnd"};function u(e){let{events:t,onSelect:r,selectedId:s}=e,{t:l}=(0,a.$G)(),o=[...t].sort((e,t)=>e.timestamp-t.timestamp);if(0===o.length)return(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:l("events.empty")});let d="";return(0,n.jsx)("div",{className:"space-y-0",children:o.map(e=>{var t,o,a,u,m,x,p,v;let f=e.stepId!==d;d=e.stepId;let h=null!==(v=i[e.kind])&&void 0!==v?v:"text-muted-foreground",g=c[e.kind],j=g?l(g):e.kind,N=(null===(t=e.data)||void 0===t?void 0:t.toolName)||(null===(o=e.data)||void 0===o?void 0:o.filePath)||(null===(a=e.data)||void 0===a?void 0:a.model)||(null===(u=e.data)||void 0===u?void 0:u.command)||(null===(m=e.data)||void 0===m?void 0:m.memoryKey)||"";return(0,n.jsxs)("div",{children:[f&&(0,n.jsx)("div",{className:"text-xs font-semibold text-muted-foreground pt-2 pb-1 border-t border-border mt-1",children:e.stepId}),(0,n.jsxs)("div",{onClick:()=>r(e),className:"flex items-center gap-2 py-1.5 px-2 rounded cursor-pointer text-xs hover:bg-accent ".concat(s===e.id?"bg-accent":""," ").concat((null===(x=e.metadata)||void 0===x?void 0:x.blocked)?"border-l-2 border-red-500 bg-red-50 dark:bg-red-950":""),children:[(null===(p=e.metadata)||void 0===p?void 0:p.blocked)&&(0,n.jsx)("span",{className:"text-red-500 font-bold text-[10px] uppercase tracking-wider",children:"BLOCKED"}),(0,n.jsx)("span",{className:"w-16 ".concat(h," font-medium"),children:j}),(0,n.jsx)("span",{className:"text-muted-foreground truncate flex-1",children:N}),e.duration?(0,n.jsxs)("span",{className:"text-muted-foreground",children:[e.duration,"ms"]}):null]})]},e.id)})})}var m=r(72196);function x(e){let{event:t}=e,[r,s]=(0,l.useState)(!1),o=t.input?JSON.stringify(t.input,null,2):"null",a=t.output?JSON.stringify(t.output,null,2):"null";return(0,n.jsxs)("div",{className:"space-y-4 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-semibold text-lg",children:t.mcpToolName||t.toolName}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:[t.toolType," \xb7 ",t.kind," \xb7 ",t.duration,"ms",t.blocked&&(0,n.jsx)("span",{className:"text-red-500 ml-2 font-bold",children:"BLOCKED"})]})]}),(0,n.jsx)("button",{onClick:()=>s(!r),className:"text-xs border rounded px-2 py-1 hover:bg-accent",children:r?"Formatted":"Raw JSON"})]}),t.error&&(0,n.jsx)("div",{className:"p-3 bg-red-50 dark:bg-red-950 border border-red-300 rounded text-sm text-red-700",children:t.error}),(0,n.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,n.jsxs)(m.Zb,{className:"p-3",children:[(0,n.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase",children:"Input"}),(0,n.jsx)("pre",{className:"text-xs overflow-auto max-h-96 ".concat(r?"":"max-h-40 overflow-hidden"),children:(0,n.jsx)("code",{children:r?o:o.slice(0,500)+(o.length>500?"\n... (truncated)":"")})})]}),(0,n.jsxs)(m.Zb,{className:"p-3",children:[(0,n.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase",children:"Output"}),null==t.output?(0,n.jsx)("p",{className:"text-xs text-yellow-600",children:"No output captured for this event"}):(0,n.jsx)("pre",{className:"text-xs overflow-auto max-h-96 ".concat(r?"":"max-h-40 overflow-hidden"),children:(0,n.jsx)("code",{children:r?a:a.slice(0,500)+(a.length>500?"\n... (truncated)":"")})})]})]})]})}function p(e){var t,r;let{event:s}=e,{t:l}=(0,a.$G)();if(!s)return(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:l("events.selectEvent")});if("tool_use"===s.kind&&(s.toolName||s.mcpToolName))return(0,n.jsx)(x,{event:s});let o=null!==(r=s.data)&&void 0!==r?r:{};return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold",children:l("events.eventDetail")}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.kind")}),(0,n.jsx)("div",{className:"text-sm font-medium",children:s.kind})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.step")}),(0,n.jsx)("div",{className:"text-sm font-mono",children:s.stepId})]}),null!=s.duration&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.duration")}),(0,n.jsxs)("div",{className:"text-sm",children:[s.duration,"ms"]})]}),null!=o.inputTokens&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.tokens")}),(0,n.jsx)("div",{className:"text-sm",children:l("events.tokensInOut",{input:o.inputTokens,output:o.outputTokens})})]}),null!=o.prompt&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.prompt")}),(0,n.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:o.prompt})]}),null!=o.response&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.response")}),(0,n.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:o.response})]}),null!=o.stdout&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.stdout")}),(0,n.jsx)("pre",{className:"text-xs bg-secondary p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:o.stdout})]}),null!=o.stderr&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.stderr")}),(0,n.jsx)("pre",{className:"text-xs bg-red-50 dark:bg-red-950 p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:o.stderr})]}),null!=o.errorMessage&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:l("events.error")}),(0,n.jsx)("pre",{className:"text-xs bg-red-50 dark:bg-red-950 p-2 rounded mt-1 max-h-40 overflow-y-auto whitespace-pre-wrap",children:o.errorMessage})]}),(null===(t=s.metadata)||void 0===t?void 0:t.truncated)!=null&&(0,n.jsx)("div",{className:"text-xs text-yellow-500",children:l("events.truncated")})]})]})}var v=r(38941),f=r(77329);let h=(0,r(2389).Z)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),g={context_insufficient:[{action:"Supplement task context",priority:"high"},{action:"Inspect graph roots and related files",priority:"medium"}],knowledge_missing:[{action:"Sync the required knowledge source",priority:"high"},{action:"Add or broaden documentation scopes",priority:"medium"}],workflow_design_issue:[{action:"Correct the failing step contract",priority:"high"},{action:"Review workflow dependencies",priority:"medium"}],tool_error:[{action:"Inspect the tool error and connectivity",priority:"high"},{action:"Retry with a validated input",priority:"medium"}],agent_override:[{action:"Review the rejected change and user feedback",priority:"high"}],unknown:[{action:"Inspect the failed step evidence",priority:"high"}]};function j(e){var t;let{failureCategory:r,failureReason:s,suggestedActions:l}=e,{t:o}=(0,a.$G)();return r?(0,n.jsxs)(m.Zb,{children:[(0,n.jsxs)(m.Ol,{children:[(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsx)(v.C,{className:null!==(t=({context_insufficient:"bg-yellow-500",knowledge_missing:"bg-orange-500",workflow_design_issue:"bg-purple-500",tool_error:"bg-red-500",agent_override:"bg-gray-500",unknown:"bg-gray-500"})[r])&&void 0!==t?t:"bg-gray-500",children:o("runDetail.category.".concat(r))})}),(0,n.jsx)(m.ll,{className:"text-sm",children:o("runDetail.failureReason")})]}),(0,n.jsxs)(m.aY,{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:s}),l&&l.length>0&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,n.jsx)(f.Z,{className:"h-4 w-4"}),o("runDetail.suggestedActions")]}),(0,n.jsx)("ul",{className:"space-y-1",children:l.map((e,t)=>(0,n.jsxs)("li",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(h,{className:"h-3 w-3 text-muted-foreground"}),(0,n.jsx)("span",{children:e.action}),(0,n.jsx)(v.C,{variant:"outline",className:"text-xs",children:e.priority})]},t))})]})]})]}):null}var N=r(61883);function b(e){var t,r;let{runId:i,onBack:c}=e,m=(0,s.useRouter)(),{t:x}=(0,a.$G)(),{data:v}=(0,o.rC)(i),{data:f}=(0,o.kP)(i),[h,b]=(0,l.useState)(null),y=(null!=v?v:[]).map(e=>{var t,r,n,s,l,o,a;let d=null!==(r=null!==(t=e.eventId)&&void 0!==t?t:e.id)&&void 0!==r?r:"",i=(null!==(n=e.kind)&&void 0!==n?n:e.toolType)||"tool_use",c={toolName:null!==(s=e.toolName)&&void 0!==s?s:e.mcpToolName,...null!==(l=e.input)&&void 0!==l?l:{}};return{id:d,stepId:null!==(o=e.executionId)&&void 0!==o?o:d,kind:i,timestamp:null!==(a=e.timestamp)&&void 0!==a?a:0,duration:e.duration,data:c,metadata:{isMcpTool:e.isMcpTool,mcpEnforced:e.mcpEnforced,mcpFallback:e.mcpFallback,blocked:e.blocked,blockReason:e.blockReason}}}),w=[...new Set(y.map(e=>e.stepId))],k=null!=f?f:{},_=[...null!=v?v:[]].reverse().find(e=>"string"==typeof e.failureCategory),C=null==_?void 0:_.failureCategory;return(0,n.jsxs)("div",{className:"flex flex-col h-full",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b border-border",children:[(0,n.jsx)("button",{onClick:null!=c?c:()=>m.push("/runs"),className:"p-1 rounded hover:bg-accent",title:x("runs.title"),children:(0,n.jsx)(N.Z,{className:"h-4 w-4"})}),(0,n.jsx)("h2",{className:"text-lg font-bold",children:x("runDetail.title","Session Detail")}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:i}),null!=k.totalToolCalls&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[String(k.totalToolCalls)," tools \xb7 ",String(k.mcpToolCalls)," MCP"]})]}),(0,n.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,n.jsx)("div",{className:"w-48 border-r border-border overflow-y-auto p-3",children:(0,n.jsx)(d,{steps:w,events:y})}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:(0,n.jsx)(u,{events:y,onSelect:e=>b(e),selectedId:null==h?void 0:h.id})}),(0,n.jsxs)("div",{className:"w-80 border-l border-border overflow-y-auto p-3",children:[C&&(0,n.jsx)("div",{className:"mb-3",children:(0,n.jsx)(j,{failureCategory:C,failureReason:String(null!==(t=null==_?void 0:_.error)&&void 0!==t?t:"Workflow step failed"),suggestedActions:null!==(r=g[C])&&void 0!==r?r:g.unknown})}),(0,n.jsx)(p,{event:h})]})]})]})}function y(){var e;let t=null!==(e=(0,s.usePathname)().split("/").filter(Boolean).at(-1))&&void 0!==e?e:"";return(0,n.jsx)(b,{runId:decodeURIComponent(t)})}},29147:function(e,t,r){"use strict";r.d(t,{cn:function(){return l}});var n=r(10607),s=r(25579);function l(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.m6)((0,n.W)(t))}},2389:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(7653);let s=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&r.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:s=24,strokeWidth:a=2,absoluteStrokeWidth:d,className:i="",children:c,iconNode:u,...m}=e;return(0,n.createElement)("svg",{ref:t,...o,width:s,height:s,stroke:r,strokeWidth:d?24*Number(a)/Number(s):a,className:l("lucide",i),...m},[...u.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(c)?c:[c]])}),d=(e,t)=>{let r=(0,n.forwardRef)((r,o)=>{let{className:d,...i}=r;return(0,n.createElement)(a,{ref:o,iconNode:t,className:l("lucide-".concat(s(e)),d),...i})});return r.displayName="".concat(e),r}},61883:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(2389).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},77329:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(2389).Z)("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"}]])},81695:function(e,t,r){"use strict";var n=r(21219);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},49289:function(e,t,r){"use strict";r.d(t,{j:function(){return o}});var n=r(10607);let s=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,l=n.W,o=(e,t)=>r=>{var n;if((null==t?void 0:t.variants)==null)return l(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:o,defaultVariants:a}=t,d=Object.keys(o).map(e=>{let t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;let l=s(t)||s(n);return o[e][l]}),i=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return l(e,d,null==t?void 0:null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...i}[t]):({...a,...i})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}},function(e){e.O(0,[384,806,697,429,293,528,744],function(){return e(e.s=71350)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[611],{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[611],{24364:function(t,e,s){Promise.resolve().then(s.bind(s,10821))},10821:function(t,e,s){"use strict";s.d(e,{RunsView:function(){return o}});var i=s(27573),n=s(57429),r=s(3806);let a={active:"text-yellow-500",closed:"text-green-500"};function o(){let{t}=(0,r.$G)(),{data:e}=(0,n.dL)(50,0),s=null!=e?e:[];return(0,i.jsxs)("div",{className:"p-6 space-y-4",children:[(0,i.jsx)("h2",{className:"text-2xl font-bold",children:t("runs.title")}),0===s.length?(0,i.jsx)("p",{className:"text-muted-foreground",children:t("runs.empty")}):(0,i.jsx)("div",{className:"space-y-2",children:s.map(t=>{var e;return(0,i.jsxs)("a",{href:"/runs/".concat(encodeURIComponent(t.id)),className:"flex items-center gap-4 p-3 rounded bg-secondary hover:bg-accent cursor-pointer",children:[(0,i.jsx)("span",{className:"font-mono text-xs truncate max-w-[200px]",children:t.label||t.id}),(0,i.jsx)("span",{className:"px-1.5 py-0.5 rounded text-xs ".concat(null!==(e=a[t.status])&&void 0!==e?e:"text-muted-foreground"),children:t.status}),(0,i.jsxs)("span",{className:"text-xs text-muted-foreground",children:[t.totalToolCalls," tools (",t.mcpToolCalls," MCP)"]}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:t.durationMs>0?"".concat((t.durationMs/1e3).toFixed(1),"s"):"--"}),(0,i.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:new Date(t.startedAt).toLocaleString()})]},t.id)})})]})}},64855:function(t,e,s){"use strict";s.d(e,{R:function(){return o},m:function(){return a}});var i=s(2906),n=s(5531),r=s(11135),a=class extends n.F{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||o(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#n({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,r.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#n({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#n({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});let i="pending"===this.state.status,n=!this.#i.canStart();try{if(i)e();else{this.#n({type:"pending",variables:t,isPaused:n}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#n({type:"pending",context:e,variables:t,isPaused:n})}let r=await this.#i.start();return await this.#s.config.onSuccess?.(r,t,this.state.context,this,s),await this.options.onSuccess?.(r,t,this.state.context,s),await this.#s.config.onSettled?.(r,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(r,null,t,this.state.context,s),this.#n({type:"success",data:r}),r}catch(e){try{await this.#s.config.onError?.(e,t,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onError?.(e,t,this.state.context,s)}catch(t){Promise.reject(t)}try{await this.#s.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,s)}catch(t){Promise.reject(t)}throw this.#n({type:"error",error:e}),e}finally{this.#s.runNext(this)}}#n(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},15969:function(t,e,s){"use strict";s.d(e,{D:function(){return h}});var i=s(7653),n=s(64855),r=s(2906),a=s(24559),o=s(50803),u=class extends a.l{#t;#r=void 0;#a;#o;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#u()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,o.VS)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,o.Ym)(e.mutationKey)!==(0,o.Ym)(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(t){this.#u(),this.#c(t)}getCurrentResult(){return this.#r}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#u(),this.#c()}mutate(t,e){return this.#o=e,this.#a?.removeObserver(this),this.#a=this.#t.getMutationCache().build(this.#t,this.options),this.#a.addObserver(this),this.#a.execute(t)}#u(){let t=this.#a?.state??(0,n.R)();this.#r={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#c(t){r.Vr.batch(()=>{if(this.#o&&this.hasListeners()){let e=this.#r.variables,s=this.#r.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#o.onSuccess?.(t.data,e,s,i)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(t.data,null,e,s,i)}catch(t){Promise.reject(t)}}else if(t?.type==="error"){try{this.#o.onError?.(t.error,e,s,i)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(void 0,t.error,e,s,i)}catch(t){Promise.reject(t)}}}this.listeners.forEach(t=>{t(this.#r)})})}},c=s(77930);function h(t,e){let s=(0,c.NL)(e),[n]=i.useState(()=>new u(s,t));i.useEffect(()=>{n.setOptions(t)},[n,t]);let a=i.useSyncExternalStore(i.useCallback(t=>n.subscribe(r.Vr.batchCalls(t)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),h=i.useCallback((t,e)=>{n.mutate(t,e).catch(o.ZT)},[n]);if(a.error&&(0,o.L3)(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:h,mutateAsync:a.mutate}}}},function(t){t.O(0,[384,806,429,293,528,744],function(){return t(t.s=24364)}),_N_E=t.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[938],{73449:function(e,t,s){Promise.resolve().then(s.bind(s,19830))},38941:function(e,t,s){"use strict";s.d(t,{C:function(){return r}});var n=s(27573);s(7653);var a=s(29147);let l=(0,s(49289).j)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function r(e){let{className:t,variant:s,...r}=e;return(0,n.jsx)("div",{className:(0,a.cn)(l({variant:s}),t),...r})}},50466:function(e,t,s){"use strict";s.d(t,{z:function(){return i}});var n=s(27573),a=s(7653),l=s(29147);let r=(0,s(49289).j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),i=a.forwardRef((e,t)=>{let{className:s,variant:a,size:i,...d}=e;return(0,n.jsx)("button",{className:(0,l.cn)(r({variant:a,size:i,className:s})),ref:t,...d})});i.displayName="Button"},72196:function(e,t,s){"use strict";s.d(t,{Ol:function(){return i},Zb:function(){return r},aY:function(){return c},ll:function(){return d}});var n=s(27573),a=s(7653),l=s(29147);let r=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("rounded-lg border border-border bg-card text-card-foreground",s),...a})});r.displayName="Card";let i=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-4",s),...a})});i.displayName="CardHeader";let d=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)("h3",{ref:t,className:(0,l.cn)("text-sm font-semibold leading-none tracking-tight",s),...a})});d.displayName="CardTitle";let c=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("p-4 pt-0",s),...a})});c.displayName="CardContent"},29324:function(e,t,s){"use strict";s.d(t,{$N:function(){return o},Vq:function(){return l},cZ:function(){return d},fK:function(){return c}});var n=s(27573);s(7653);var a=s(57431);let l=a.fC;a.xz;let r=a.h_;function i(e){let{className:t,...s}=e;return(0,n.jsx)(a.aV,{className:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ".concat(null!=t?t:""),...s})}function d(e){let{className:t,children:s,...l}=e;return(0,n.jsxs)(r,{children:[(0,n.jsx)(i,{}),(0,n.jsx)(a.VY,{className:"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg ".concat(null!=t?t:""),...l,children:s})]})}function c(e){let{className:t,...s}=e;return(0,n.jsx)("div",{className:"flex flex-col space-y-1.5 text-center sm:text-left ".concat(null!=t?t:""),...s})}function o(e){let{className:t,...s}=e;return(0,n.jsx)(a.Dx,{className:"text-lg font-semibold leading-none tracking-tight ".concat(null!=t?t:""),...s})}a.x8},39134:function(e,t,s){"use strict";s.d(t,{I:function(){return r}});var n=s(27573),a=s(7653),l=s(29147);let r=a.forwardRef((e,t)=>{let{className:s,type:a,...r}=e;return(0,n.jsx)("input",{type:a,className:(0,l.cn)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...r})});r.displayName="Input"},12862:function(e,t,s){"use strict";s.d(t,{SP:function(){return c},dr:function(){return d},mQ:function(){return i},nU:function(){return o}});var n=s(27573),a=s(7653),l=s(4343),r=s(29147);let i=l.fC,d=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(l.aV,{ref:t,className:(0,r.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...a})});d.displayName=l.aV.displayName;let c=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(l.xz,{ref:t,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s),...a})});c.displayName=l.xz.displayName;let o=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(l.VY,{ref:t,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a})});o.displayName=l.VY.displayName},4509:function(e,t,s){"use strict";s.d(t,{q:function(){return d}});var n=s(27573),a=s(72196),l=s(38941),r=s(3806),i=s(57429);function d(){let{t:e}=(0,r.$G)(),t=localStorage.getItem("devflow-active-project-root")||void 0,{data:s=[],isLoading:d,error:c}=(0,i.Vw)(t);if(d)return(0,n.jsx)("div",{children:e("benchmark.loading")});if(c)return(0,n.jsxs)(a.Zb,{children:[(0,n.jsx)(a.Ol,{children:(0,n.jsx)(a.ll,{children:e("benchmark.pluginAnalysis")})}),(0,n.jsx)(a.aY,{children:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("benchmark.loadFailed",{error:String(c)})})})]});let o=s.filter(e=>"install"===e.recommendation),u=s.filter(e=>"remove"===e.recommendation);return(0,n.jsxs)(a.Zb,{children:[(0,n.jsx)(a.Ol,{children:(0,n.jsx)(a.ll,{children:e("benchmark.pluginAnalysis")})}),(0,n.jsxs)(a.aY,{className:"space-y-6",children:[o.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"font-semibold mb-2 text-green-600",children:e("benchmark.recommendedInstall")}),(0,n.jsx)("div",{className:"space-y-2",children:o.map(t=>{var s,a,r;return(0,n.jsxs)("div",{className:"border rounded p-3 space-y-2",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)("span",{className:"font-medium",children:t.name}),(0,n.jsx)(l.C,{variant:"default",children:e("benchmark.recommended")})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,n.jsxs)("div",{children:[e("benchmark.installCount"),": ",t.installCount]}),(0,n.jsxs)("div",{children:[e("benchmark.usageRate"),": ",((null!==(s=null==t?void 0:t.activeRate)&&void 0!==s?s:0)*100).toFixed(0),"%"]}),(0,n.jsxs)("div",{children:[e("benchmark.successRateShort"),": ",((null!==(a=null==t?void 0:t.successRate)&&void 0!==a?a:0)*100).toFixed(0),"%"]}),(0,n.jsxs)("div",{children:[e("benchmark.tokenImpact"),": ",(null!==(r=null==t?void 0:t.avgTokenImpact)&&void 0!==r?r:0).toFixed(0)]})]}),t.lastUsedAt&&(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e("benchmark.lastUsed"),": ",new Date(t.lastUsedAt).toLocaleDateString()]})]},t.name)})})]}),u.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"font-semibold mb-2 text-red-600",children:e("benchmark.suggestedRemove")}),(0,n.jsx)("div",{className:"space-y-2",children:u.map(t=>{var s,a;return(0,n.jsxs)("div",{className:"border rounded p-3 space-y-2",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)("span",{className:"font-medium",children:t.name}),(0,n.jsx)(l.C,{variant:"destructive",children:e("benchmark.lowEfficiency")})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,n.jsxs)("div",{children:[e("benchmark.installCount"),": ",t.installCount]}),(0,n.jsxs)("div",{children:[e("benchmark.usageRate"),": ",((null!==(s=null==t?void 0:t.activeRate)&&void 0!==s?s:0)*100).toFixed(0),"%"]}),(0,n.jsxs)("div",{children:[e("benchmark.successRateShort"),": ",((null!==(a=null==t?void 0:t.successRate)&&void 0!==a?a:0)*100).toFixed(0),"%"]})]})]},t.name)})})]}),0===s.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("benchmark.noPluginData")})]})]})}},19830:function(e,t,s){"use strict";s.d(t,{SettingsView:function(){return z}});var n=s(27573),a=s(57429),l=s(72196),r=s(50466),i=s(4509),d=s(3806),c=s(7653),o=s(2389);let u=(0,o.Z)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),m=(0,o.Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var x=s(6315),f=s(10997);let h=(0,o.Z)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),g=(0,o.Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var p=s(38941),v=s(29324),j=s(39134),b=s(12862);let N=["Constitutional","Skill Routing","Context Intercept","Correct"],y=/^(?:C\d{3}|S\d{3}|I\d{3}|R\d{3})$/,w={id:"CUSTOM001",name:"Custom rule",gate:1,level:"project",condition:{tools:["*"]},action:"warn",message:"Review this operation before continuing.",enabled:!0};function k(){var e;let{data:t=[],isLoading:s}=(0,a.rw)(),{data:l}=(0,a.xT)(),i=(0,a.iP)(),d=(0,a.OV)(),[o,g]=(0,c.useState)(null),v=(0,c.useMemo)(()=>[1,2,3,4].map(e=>({gate:e,rules:t.filter(t=>t.gate===e)})),[t]),j=t.filter(e=>e.enabled).length;return(0,n.jsxs)("section",{className:"border-y border-border py-5",children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(u,{className:"h-4 w-4 text-emerald-600"}),(0,n.jsx)("h3",{className:"text-sm font-semibold",children:"Enforcer governance"})]}),(0,n.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[j," of ",t.length," rules active across 4 gates"]})]}),(0,n.jsxs)(r.z,{size:"sm",onClick:()=>g({rule:{...w},create:!0}),children:[(0,n.jsx)(m,{className:"mr-1.5 h-3.5 w-3.5"}),"Add rule"]})]}),(0,n.jsxs)(b.mQ,{defaultValue:"rules",children:[(0,n.jsxs)(b.dr,{children:[(0,n.jsx)(b.SP,{value:"rules",children:"Rules"}),(0,n.jsxs)(b.SP,{value:"audit",children:["Audit chain",(0,n.jsx)("span",{className:"ml-1.5 text-[10px] text-muted-foreground",children:null!==(e=null==l?void 0:l.total)&&void 0!==e?e:0})]})]}),(0,n.jsxs)(b.nU,{value:"rules",className:"mt-3 space-y-5",children:[s?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading rules..."}):null,v.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 text-xs font-medium uppercase text-muted-foreground",children:[(0,n.jsx)("span",{className:"flex h-5 w-5 items-center justify-center rounded bg-muted text-[10px] text-foreground",children:e.gate}),N[e.gate-1],(0,n.jsxs)("span",{className:"font-normal normal-case",children:[e.rules.length," rules"]})]}),(0,n.jsxs)("div",{className:"divide-y rounded-md border bg-background",children:[e.rules.map(e=>(0,n.jsxs)("div",{className:"grid min-h-14 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 px-3 py-2",children:[(0,n.jsx)("input",{type:"checkbox",checked:e.enabled,"aria-label":"".concat(e.enabled?"Disable":"Enable"," ").concat(e.name),className:"h-4 w-4 accent-emerald-600",disabled:i.isPending,onChange:()=>i.mutate({rule:{...e,enabled:!e.enabled},create:!1})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.id}),(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),(0,n.jsx)(p.C,{variant:"deny"===e.action?"destructive":"outline",className:"px-1.5 py-0 text-[10px]",children:e.action})]}),(0,n.jsx)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:e.message})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(r.z,{variant:"ghost",size:"icon",className:"h-8 w-8",title:"Edit rule",onClick:()=>g({rule:e,create:!1}),children:(0,n.jsx)(x.Z,{className:"h-3.5 w-3.5"})}),(0,n.jsx)(r.z,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",title:y.test(e.id)?"Canonical rules cannot be deleted":"Delete rule",disabled:d.isPending||y.test(e.id),"aria-label":y.test(e.id)?"Canonical rules cannot be deleted":"Delete ".concat(e.name),onClick:()=>d.mutate(e.id),children:(0,n.jsx)(f.Z,{className:"h-3.5 w-3.5"})})]})]},e.id)),0===e.rules.length?(0,n.jsx)("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No rules configured for this gate."}):null]})]},e.gate))]}),(0,n.jsx)(b.nU,{value:"audit",className:"mt-3",children:(0,n.jsxs)("div",{className:"max-h-[420px] overflow-auto rounded-md border",children:[(0,n.jsxs)("table",{className:"w-full min-w-[760px] text-left text-xs",children:[(0,n.jsx)("thead",{className:"sticky top-0 bg-muted/95 text-muted-foreground backdrop-blur",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Seq"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Time"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Tool"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Decision"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Rule"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Session"})]})}),(0,n.jsx)("tbody",{className:"divide-y",children:null==l?void 0:l.items.map(e=>{var t;return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:e.seq}),(0,n.jsx)("td",{className:"whitespace-nowrap px-3 py-2",children:new Date(e.ts).toLocaleString()}),(0,n.jsx)("td",{className:"max-w-56 truncate px-3 py-2 font-mono",children:e.tool}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(C,{decision:e.decision})}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:null!==(t=e.ruleId)&&void 0!==t?t:"-"}),(0,n.jsx)("td",{className:"max-w-44 truncate px-3 py-2 font-mono text-muted-foreground",children:e.sessionId})]},e.seq)})})]}),(null==l?void 0:l.items.length)?null:(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,n.jsx)(h,{className:"h-4 w-4"}),"No enforcement decisions recorded yet."]})]})})]}),o?(0,n.jsx)(S,{editing:o,pending:i.isPending,onClose:()=>g(null),onSave:(e,t)=>i.mutate({rule:e,create:t},{onSuccess:()=>g(null)})},"".concat(o.create?"new":"edit",":").concat(o.rule.id)):null]})}function C(e){let{decision:t}=e,s="allow"===t?"text-emerald-600":"deny"===t?"text-destructive":"text-amber-600";return(0,n.jsx)("span",{className:"font-medium ".concat(s),children:t})}function S(e){let{editing:t,pending:s,onClose:a,onSave:l}=e,[i,d]=(0,c.useState)(()=>({...t.rule})),[o,u]=(0,c.useState)(()=>JSON.stringify(t.rule.condition,null,2)),[m,x]=(0,c.useState)("");return(0,n.jsx)(v.Vq,{open:!0,onOpenChange:e=>{e||a()},children:(0,n.jsxs)(v.cZ,{className:"max-w-xl",children:[(0,n.jsx)(v.fK,{children:(0,n.jsx)(v.$N,{children:t.create?"Add governance rule":"Edit ".concat(i.id)})}),(0,n.jsxs)("div",{className:"grid gap-3",children:[(0,n.jsxs)("div",{className:"grid grid-cols-[140px_minmax(0,1fr)] gap-3",children:[(0,n.jsxs)("label",{className:"text-xs font-medium",children:["Rule ID",(0,n.jsx)(j.I,{className:"mt-1 font-mono",value:i.id,disabled:!t.create,onChange:e=>d({...i,id:e.target.value})})]}),(0,n.jsxs)("label",{className:"text-xs font-medium",children:["Name",(0,n.jsx)(j.I,{className:"mt-1",value:i.name,onChange:e=>d({...i,name:e.target.value})})]})]}),(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,n.jsx)(R,{label:"Gate",value:String(i.gate),options:["1","2","3","4"],onChange:e=>d({...i,gate:Number(e)})}),(0,n.jsx)(R,{label:"Level",value:i.level,options:["constitutional","project","session"],onChange:e=>d({...i,level:e})}),(0,n.jsx)(R,{label:"Action",value:i.action,options:["warn","deny","allow"],onChange:e=>d({...i,action:e})})]}),(0,n.jsxs)("label",{className:"text-xs font-medium",children:["Message",(0,n.jsx)(j.I,{className:"mt-1",value:i.message,onChange:e=>d({...i,message:e.target.value})})]}),(0,n.jsxs)("label",{className:"text-xs font-medium",children:["Condition JSON",(0,n.jsx)("textarea",{className:"mt-1 min-h-36 w-full resize-y rounded-md border border-input bg-background px-3 py-2 font-mono text-xs focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:o,onChange:e=>u(e.target.value)})]}),m?(0,n.jsx)("p",{className:"text-xs text-destructive",children:m}):null,(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(r.z,{variant:"outline",onClick:a,children:"Cancel"}),(0,n.jsxs)(r.z,{onClick:()=>{try{let e=JSON.parse(o);x(""),l({...i,condition:e},t.create)}catch(e){x("Condition must be valid JSON.")}},disabled:s,children:[(0,n.jsx)(g,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]})})}function R(e){let{label:t,value:s,options:a,onChange:l}=e;return(0,n.jsxs)("label",{className:"text-xs font-medium",children:[t,(0,n.jsx)("select",{className:"mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm",value:s,onChange:e=>l(e.target.value),children:a.map(e=>(0,n.jsx)("option",{children:e},e))})]})}function z(){var e,t,s,c,o;let{t:u}=(0,d.$G)(),{data:m}=(0,a._m)(),{data:x}=(0,a.bz)(),f=(0,a.Hx)();return(0,n.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,n.jsx)("h2",{className:"text-2xl font-bold",children:u("settings.title","Project Settings")}),(0,n.jsxs)(l.Zb,{children:[(0,n.jsx)(l.Ol,{children:(0,n.jsx)(l.ll,{className:"text-sm",children:u("settings.projectInfo","Project Info")})}),(0,n.jsxs)(l.aY,{className:"space-y-2 text-sm",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[u("settings.name","Name"),":"]}),(0,n.jsx)("span",{children:"devflow"})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[u("settings.mode","Mode"),":"]}),(0,n.jsx)("span",{children:"monorepo"})]})]})]}),(0,n.jsxs)(l.Zb,{children:[(0,n.jsx)(l.Ol,{children:(0,n.jsxs)(l.ll,{className:"text-sm",children:[u("settings.plugins","Plugins")," (",null!==(s=null==m?void 0:m.length)&&void 0!==s?s:0," installed)"]})}),(0,n.jsx)(l.aY,{className:"space-y-2",children:m&&m.length>0?m.map(e=>(0,n.jsxs)("div",{className:"flex justify-between items-center text-sm p-2 border rounded",children:[(0,n.jsx)("span",{className:"font-medium",children:e.name}),(0,n.jsxs)("span",{className:"text-muted-foreground",children:["@",e.version]})]},e.name)):(0,n.jsx)("div",{className:"text-sm text-muted-foreground",children:u("settings.noPlugins","No plugins installed")})})]}),(0,n.jsx)(i.q,{}),(0,n.jsx)(k,{}),(0,n.jsxs)(l.Zb,{children:[(0,n.jsx)(l.Ol,{children:(0,n.jsx)(l.ll,{className:"text-sm",children:u("settings.telemetry","Telemetry")})}),(0,n.jsxs)(l.aY,{className:"space-y-2 text-sm",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[u("settings.totalRuns","Runs stored"),":"]}),(0,n.jsx)("span",{children:null!==(c=null==x?void 0:null===(e=x.summary)||void 0===e?void 0:e.totalRuns)&&void 0!==c?c:0})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[u("settings.totalTokens","Total tokens"),":"]}),(0,n.jsx)("span",{children:(null!==(o=null==x?void 0:null===(t=x.summary)||void 0===t?void 0:t.totalTokens)&&void 0!==o?o:0).toLocaleString()})]}),(0,n.jsx)(r.z,{variant:"outline",size:"sm",onClick:()=>f.mutate(30),disabled:f.isPending,children:u("settings.clearOldRuns","Clear old runs (30d+)")})]})]})]})}},29147:function(e,t,s){"use strict";s.d(t,{cn:function(){return l}});var n=s(10607),a=s(25579);function l(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.m6)((0,n.W)(t))}}},function(e){e.O(0,[736,806,697,402,568,343,429,293,528,744],function(){return e(e.s=73449)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[938],{11557:function(e,t,s){Promise.resolve().then(s.bind(s,19830))},38941:function(e,t,s){"use strict";s.d(t,{C:function(){return r}});var n=s(27573);s(7653);var a=s(29147);let l=(0,s(49289).j)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function r(e){let{className:t,variant:s,...r}=e;return(0,n.jsx)("div",{className:(0,a.cn)(l({variant:s}),t),...r})}},50466:function(e,t,s){"use strict";s.d(t,{z:function(){return i}});var n=s(27573),a=s(7653),l=s(29147);let r=(0,s(49289).j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),i=a.forwardRef((e,t)=>{let{className:s,variant:a,size:i,...d}=e;return(0,n.jsx)("button",{className:(0,l.cn)(r({variant:a,size:i,className:s})),ref:t,...d})});i.displayName="Button"},72196:function(e,t,s){"use strict";s.d(t,{Ol:function(){return i},Zb:function(){return r},aY:function(){return c},ll:function(){return d}});var n=s(27573),a=s(7653),l=s(29147);let r=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("rounded-lg border border-border bg-card text-card-foreground",s),...a})});r.displayName="Card";let i=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-4",s),...a})});i.displayName="CardHeader";let d=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)("h3",{ref:t,className:(0,l.cn)("text-sm font-semibold leading-none tracking-tight",s),...a})});d.displayName="CardTitle";let c=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("p-4 pt-0",s),...a})});c.displayName="CardContent"},29324:function(e,t,s){"use strict";s.d(t,{$N:function(){return o},Vq:function(){return l},cZ:function(){return d},fK:function(){return c}});var n=s(27573);s(7653);var a=s(57431);let l=a.fC;a.xz;let r=a.h_;function i(e){let{className:t,...s}=e;return(0,n.jsx)(a.aV,{className:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ".concat(null!=t?t:""),...s})}function d(e){let{className:t,children:s,...l}=e;return(0,n.jsxs)(r,{children:[(0,n.jsx)(i,{}),(0,n.jsx)(a.VY,{className:"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg ".concat(null!=t?t:""),...l,children:s})]})}function c(e){let{className:t,...s}=e;return(0,n.jsx)("div",{className:"flex flex-col space-y-1.5 text-center sm:text-left ".concat(null!=t?t:""),...s})}function o(e){let{className:t,...s}=e;return(0,n.jsx)(a.Dx,{className:"text-lg font-semibold leading-none tracking-tight ".concat(null!=t?t:""),...s})}a.x8},39134:function(e,t,s){"use strict";s.d(t,{I:function(){return r}});var n=s(27573),a=s(7653),l=s(29147);let r=a.forwardRef((e,t)=>{let{className:s,type:a,...r}=e;return(0,n.jsx)("input",{type:a,className:(0,l.cn)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...r})});r.displayName="Input"},12862:function(e,t,s){"use strict";s.d(t,{SP:function(){return c},dr:function(){return d},mQ:function(){return i},nU:function(){return o}});var n=s(27573),a=s(7653),l=s(4343),r=s(29147);let i=l.fC,d=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(l.aV,{ref:t,className:(0,r.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...a})});d.displayName=l.aV.displayName;let c=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(l.xz,{ref:t,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s),...a})});c.displayName=l.xz.displayName;let o=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(l.VY,{ref:t,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a})});o.displayName=l.VY.displayName},4509:function(e,t,s){"use strict";s.d(t,{q:function(){return d}});var n=s(27573),a=s(72196),l=s(38941),r=s(3806),i=s(57429);function d(){let{t:e}=(0,r.$G)(),t=localStorage.getItem("devflow-active-project-root")||void 0,{data:s=[],isLoading:d,error:c}=(0,i.Vw)(t);if(d)return(0,n.jsx)("div",{children:e("benchmark.loading")});if(c)return(0,n.jsxs)(a.Zb,{children:[(0,n.jsx)(a.Ol,{children:(0,n.jsx)(a.ll,{children:e("benchmark.pluginAnalysis")})}),(0,n.jsx)(a.aY,{children:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("benchmark.loadFailed",{error:String(c)})})})]});let o=s.filter(e=>"install"===e.recommendation),u=s.filter(e=>"remove"===e.recommendation);return(0,n.jsxs)(a.Zb,{children:[(0,n.jsx)(a.Ol,{children:(0,n.jsx)(a.ll,{children:e("benchmark.pluginAnalysis")})}),(0,n.jsxs)(a.aY,{className:"space-y-6",children:[o.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"font-semibold mb-2 text-green-600",children:e("benchmark.recommendedInstall")}),(0,n.jsx)("div",{className:"space-y-2",children:o.map(t=>{var s,a,r;return(0,n.jsxs)("div",{className:"border rounded p-3 space-y-2",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)("span",{className:"font-medium",children:t.name}),(0,n.jsx)(l.C,{variant:"default",children:e("benchmark.recommended")})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,n.jsxs)("div",{children:[e("benchmark.installCount"),": ",t.installCount]}),(0,n.jsxs)("div",{children:[e("benchmark.usageRate"),": ",((null!==(s=null==t?void 0:t.activeRate)&&void 0!==s?s:0)*100).toFixed(0),"%"]}),(0,n.jsxs)("div",{children:[e("benchmark.successRateShort"),": ",((null!==(a=null==t?void 0:t.successRate)&&void 0!==a?a:0)*100).toFixed(0),"%"]}),(0,n.jsxs)("div",{children:[e("benchmark.tokenImpact"),": ",(null!==(r=null==t?void 0:t.avgTokenImpact)&&void 0!==r?r:0).toFixed(0)]})]}),t.lastUsedAt&&(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e("benchmark.lastUsed"),": ",new Date(t.lastUsedAt).toLocaleDateString()]})]},t.name)})})]}),u.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)("h4",{className:"font-semibold mb-2 text-red-600",children:e("benchmark.suggestedRemove")}),(0,n.jsx)("div",{className:"space-y-2",children:u.map(t=>{var s,a;return(0,n.jsxs)("div",{className:"border rounded p-3 space-y-2",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)("span",{className:"font-medium",children:t.name}),(0,n.jsx)(l.C,{variant:"destructive",children:e("benchmark.lowEfficiency")})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,n.jsxs)("div",{children:[e("benchmark.installCount"),": ",t.installCount]}),(0,n.jsxs)("div",{children:[e("benchmark.usageRate"),": ",((null!==(s=null==t?void 0:t.activeRate)&&void 0!==s?s:0)*100).toFixed(0),"%"]}),(0,n.jsxs)("div",{children:[e("benchmark.successRateShort"),": ",((null!==(a=null==t?void 0:t.successRate)&&void 0!==a?a:0)*100).toFixed(0),"%"]})]})]},t.name)})})]}),0===s.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("benchmark.noPluginData")})]})]})}},19830:function(e,t,s){"use strict";s.d(t,{SettingsView:function(){return z}});var n=s(27573),a=s(57429),l=s(72196),r=s(50466),i=s(4509),d=s(3806),c=s(7653),o=s(2389);let u=(0,o.Z)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),m=(0,o.Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var x=s(6315),f=s(10997);let h=(0,o.Z)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),g=(0,o.Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var p=s(38941),v=s(29324),j=s(39134),b=s(12862);let N=["Constitutional","Skill Routing","Context Intercept","Correct"],y=/^(?:C\d{3}|S\d{3}|I\d{3}|R\d{3})$/,w={id:"CUSTOM001",name:"Custom rule",gate:1,level:"project",condition:{tools:["*"]},action:"warn",message:"Review this operation before continuing.",enabled:!0};function k(){var e;let{data:t=[],isLoading:s}=(0,a.rw)(),{data:l}=(0,a.xT)(),i=(0,a.iP)(),d=(0,a.OV)(),[o,g]=(0,c.useState)(null),v=(0,c.useMemo)(()=>[1,2,3,4].map(e=>({gate:e,rules:t.filter(t=>t.gate===e)})),[t]),j=t.filter(e=>e.enabled).length;return(0,n.jsxs)("section",{className:"border-y border-border py-5",children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(u,{className:"h-4 w-4 text-emerald-600"}),(0,n.jsx)("h3",{className:"text-sm font-semibold",children:"Enforcer governance"})]}),(0,n.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[j," of ",t.length," rules active across 4 gates"]})]}),(0,n.jsxs)(r.z,{size:"sm",onClick:()=>g({rule:{...w},create:!0}),children:[(0,n.jsx)(m,{className:"mr-1.5 h-3.5 w-3.5"}),"Add rule"]})]}),(0,n.jsxs)(b.mQ,{defaultValue:"rules",children:[(0,n.jsxs)(b.dr,{children:[(0,n.jsx)(b.SP,{value:"rules",children:"Rules"}),(0,n.jsxs)(b.SP,{value:"audit",children:["Audit chain",(0,n.jsx)("span",{className:"ml-1.5 text-[10px] text-muted-foreground",children:null!==(e=null==l?void 0:l.total)&&void 0!==e?e:0})]})]}),(0,n.jsxs)(b.nU,{value:"rules",className:"mt-3 space-y-5",children:[s?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading rules..."}):null,v.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 text-xs font-medium uppercase text-muted-foreground",children:[(0,n.jsx)("span",{className:"flex h-5 w-5 items-center justify-center rounded bg-muted text-[10px] text-foreground",children:e.gate}),N[e.gate-1],(0,n.jsxs)("span",{className:"font-normal normal-case",children:[e.rules.length," rules"]})]}),(0,n.jsxs)("div",{className:"divide-y rounded-md border bg-background",children:[e.rules.map(e=>(0,n.jsxs)("div",{className:"grid min-h-14 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 px-3 py-2",children:[(0,n.jsx)("input",{type:"checkbox",checked:e.enabled,"aria-label":"".concat(e.enabled?"Disable":"Enable"," ").concat(e.name),className:"h-4 w-4 accent-emerald-600",disabled:i.isPending,onChange:()=>i.mutate({rule:{...e,enabled:!e.enabled},create:!1})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.id}),(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),(0,n.jsx)(p.C,{variant:"deny"===e.action?"destructive":"outline",className:"px-1.5 py-0 text-[10px]",children:e.action})]}),(0,n.jsx)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:e.message})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(r.z,{variant:"ghost",size:"icon",className:"h-8 w-8",title:"Edit rule",onClick:()=>g({rule:e,create:!1}),children:(0,n.jsx)(x.Z,{className:"h-3.5 w-3.5"})}),(0,n.jsx)(r.z,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",title:y.test(e.id)?"Canonical rules cannot be deleted":"Delete rule",disabled:d.isPending||y.test(e.id),"aria-label":y.test(e.id)?"Canonical rules cannot be deleted":"Delete ".concat(e.name),onClick:()=>d.mutate(e.id),children:(0,n.jsx)(f.Z,{className:"h-3.5 w-3.5"})})]})]},e.id)),0===e.rules.length?(0,n.jsx)("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No rules configured for this gate."}):null]})]},e.gate))]}),(0,n.jsx)(b.nU,{value:"audit",className:"mt-3",children:(0,n.jsxs)("div",{className:"max-h-[420px] overflow-auto rounded-md border",children:[(0,n.jsxs)("table",{className:"w-full min-w-[760px] text-left text-xs",children:[(0,n.jsx)("thead",{className:"sticky top-0 bg-muted/95 text-muted-foreground backdrop-blur",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Seq"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Time"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Tool"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Decision"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Rule"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Session"})]})}),(0,n.jsx)("tbody",{className:"divide-y",children:null==l?void 0:l.items.map(e=>{var t;return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:e.seq}),(0,n.jsx)("td",{className:"whitespace-nowrap px-3 py-2",children:new Date(e.ts).toLocaleString()}),(0,n.jsx)("td",{className:"max-w-56 truncate px-3 py-2 font-mono",children:e.tool}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsx)(C,{decision:e.decision})}),(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:null!==(t=e.ruleId)&&void 0!==t?t:"-"}),(0,n.jsx)("td",{className:"max-w-44 truncate px-3 py-2 font-mono text-muted-foreground",children:e.sessionId})]},e.seq)})})]}),(null==l?void 0:l.items.length)?null:(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,n.jsx)(h,{className:"h-4 w-4"}),"No enforcement decisions recorded yet."]})]})})]}),o?(0,n.jsx)(S,{editing:o,pending:i.isPending,onClose:()=>g(null),onSave:(e,t)=>i.mutate({rule:e,create:t},{onSuccess:()=>g(null)})},"".concat(o.create?"new":"edit",":").concat(o.rule.id)):null]})}function C(e){let{decision:t}=e,s="allow"===t?"text-emerald-600":"deny"===t?"text-destructive":"text-amber-600";return(0,n.jsx)("span",{className:"font-medium ".concat(s),children:t})}function S(e){let{editing:t,pending:s,onClose:a,onSave:l}=e,[i,d]=(0,c.useState)(()=>({...t.rule})),[o,u]=(0,c.useState)(()=>JSON.stringify(t.rule.condition,null,2)),[m,x]=(0,c.useState)("");return(0,n.jsx)(v.Vq,{open:!0,onOpenChange:e=>{e||a()},children:(0,n.jsxs)(v.cZ,{className:"max-w-xl",children:[(0,n.jsx)(v.fK,{children:(0,n.jsx)(v.$N,{children:t.create?"Add governance rule":"Edit ".concat(i.id)})}),(0,n.jsxs)("div",{className:"grid gap-3",children:[(0,n.jsxs)("div",{className:"grid grid-cols-[140px_minmax(0,1fr)] gap-3",children:[(0,n.jsxs)("label",{className:"text-xs font-medium",children:["Rule ID",(0,n.jsx)(j.I,{className:"mt-1 font-mono",value:i.id,disabled:!t.create,onChange:e=>d({...i,id:e.target.value})})]}),(0,n.jsxs)("label",{className:"text-xs font-medium",children:["Name",(0,n.jsx)(j.I,{className:"mt-1",value:i.name,onChange:e=>d({...i,name:e.target.value})})]})]}),(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,n.jsx)(R,{label:"Gate",value:String(i.gate),options:["1","2","3","4"],onChange:e=>d({...i,gate:Number(e)})}),(0,n.jsx)(R,{label:"Level",value:i.level,options:["constitutional","project","session"],onChange:e=>d({...i,level:e})}),(0,n.jsx)(R,{label:"Action",value:i.action,options:["warn","deny","allow"],onChange:e=>d({...i,action:e})})]}),(0,n.jsxs)("label",{className:"text-xs font-medium",children:["Message",(0,n.jsx)(j.I,{className:"mt-1",value:i.message,onChange:e=>d({...i,message:e.target.value})})]}),(0,n.jsxs)("label",{className:"text-xs font-medium",children:["Condition JSON",(0,n.jsx)("textarea",{className:"mt-1 min-h-36 w-full resize-y rounded-md border border-input bg-background px-3 py-2 font-mono text-xs focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:o,onChange:e=>u(e.target.value)})]}),m?(0,n.jsx)("p",{className:"text-xs text-destructive",children:m}):null,(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(r.z,{variant:"outline",onClick:a,children:"Cancel"}),(0,n.jsxs)(r.z,{onClick:()=>{try{let e=JSON.parse(o);x(""),l({...i,condition:e},t.create)}catch(e){x("Condition must be valid JSON.")}},disabled:s,children:[(0,n.jsx)(g,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]})})}function R(e){let{label:t,value:s,options:a,onChange:l}=e;return(0,n.jsxs)("label",{className:"text-xs font-medium",children:[t,(0,n.jsx)("select",{className:"mt-1 h-9 w-full rounded-md border border-input bg-background px-2 text-sm",value:s,onChange:e=>l(e.target.value),children:a.map(e=>(0,n.jsx)("option",{children:e},e))})]})}function z(){var e,t,s,c,o;let{t:u}=(0,d.$G)(),{data:m}=(0,a._m)(),{data:x}=(0,a.bz)(),f=(0,a.Hx)();return(0,n.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,n.jsx)("h2",{className:"text-2xl font-bold",children:u("settings.title","Project Settings")}),(0,n.jsxs)(l.Zb,{children:[(0,n.jsx)(l.Ol,{children:(0,n.jsx)(l.ll,{className:"text-sm",children:u("settings.projectInfo","Project Info")})}),(0,n.jsxs)(l.aY,{className:"space-y-2 text-sm",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[u("settings.name","Name"),":"]}),(0,n.jsx)("span",{children:"devflow"})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[u("settings.mode","Mode"),":"]}),(0,n.jsx)("span",{children:"monorepo"})]})]})]}),(0,n.jsxs)(l.Zb,{children:[(0,n.jsx)(l.Ol,{children:(0,n.jsxs)(l.ll,{className:"text-sm",children:[u("settings.plugins","Plugins")," (",null!==(s=null==m?void 0:m.length)&&void 0!==s?s:0," installed)"]})}),(0,n.jsx)(l.aY,{className:"space-y-2",children:m&&m.length>0?m.map(e=>(0,n.jsxs)("div",{className:"flex justify-between items-center text-sm p-2 border rounded",children:[(0,n.jsx)("span",{className:"font-medium",children:e.name}),(0,n.jsxs)("span",{className:"text-muted-foreground",children:["@",e.version]})]},e.name)):(0,n.jsx)("div",{className:"text-sm text-muted-foreground",children:u("settings.noPlugins","No plugins installed")})})]}),(0,n.jsx)(i.q,{}),(0,n.jsx)(k,{}),(0,n.jsxs)(l.Zb,{children:[(0,n.jsx)(l.Ol,{children:(0,n.jsx)(l.ll,{className:"text-sm",children:u("settings.telemetry","Telemetry")})}),(0,n.jsxs)(l.aY,{className:"space-y-2 text-sm",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[u("settings.totalRuns","Runs stored"),":"]}),(0,n.jsx)("span",{children:null!==(c=null==x?void 0:null===(e=x.summary)||void 0===e?void 0:e.totalRuns)&&void 0!==c?c:0})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[u("settings.totalTokens","Total tokens"),":"]}),(0,n.jsx)("span",{children:(null!==(o=null==x?void 0:null===(t=x.summary)||void 0===t?void 0:t.totalTokens)&&void 0!==o?o:0).toLocaleString()})]}),(0,n.jsx)(r.z,{variant:"outline",size:"sm",onClick:()=>f.mutate(30),disabled:f.isPending,children:u("settings.clearOldRuns","Clear old runs (30d+)")})]})]})]})}},29147:function(e,t,s){"use strict";s.d(t,{cn:function(){return l}});var n=s(10607),a=s(25579);function l(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.m6)((0,n.W)(t))}}},function(e){e.O(0,[384,806,697,402,568,343,429,293,528,744],function(){return e(e.s=11557)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[571],{68533:function(t,e,s){Promise.resolve().then(s.bind(s,96098))},96098:function(t,e,s){"use strict";s.d(e,{TimelineView:function(){return d}});var i=s(27573),r=s(7653),n=s(57429);let a={cli:"#3b82f6",mcp:"#22c55e",dashboard:"#a855f7"};function o(t){let{runs:e,date:s}=t,r=new Date(s+"T00:00:00Z").getTime(),n=Math.max(28*e.length+40,120),o=[0,4,8,12,16,20,24].map(t=>({hour:t,x:40+t/24*720,label:"".concat(String(t).padStart(2,"0"),":00")}));return(0,i.jsx)("div",{className:"overflow-x-auto",children:(0,i.jsxs)("svg",{viewBox:"0 0 ".concat(800," ").concat(n),className:"w-full",children:[o.map(t=>(0,i.jsxs)("g",{children:[(0,i.jsx)("line",{x1:t.x,y1:0,x2:t.x,y2:n,stroke:"#e5e7eb",strokeWidth:.5}),(0,i.jsx)("text",{x:t.x,y:12,textAnchor:"middle",fontSize:"9",fill:"#9ca3af",children:t.label})]},t.hour)),e.map((t,e)=>{var s;let n=40+(t.startedAt-r)/864e5*720,o=Math.max(40,40*(t.totalToolCalls||1)),c=40+28*e,u=null!==(s=a[t.source])&&void 0!==s?s:"#6b7280",l="completed"===t.status?.9:"failed"===t.status?.6:.4;return(0,i.jsxs)("g",{children:[(0,i.jsx)("rect",{x:n,y:c,width:o,height:20,rx:3,fill:u,opacity:l}),(0,i.jsx)("text",{x:n+o+4,y:c+13,fontSize:"10",fill:"#6b7280",children:new Date(t.startedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),o>60&&(0,i.jsxs)("text",{x:n+4,y:c+13,fontSize:"9",fill:"white",fontWeight:"500",children:[t.agent," \xb7 ",t.source]})]},t.id)})]})})}var c=s(58410),u=s(2966),l=s(3806),h=s(33127);function d(){(0,h.z)("timeline",[["telemetry-runs"],["telemetry-stats"]]);let{t}=(0,l.$G)(),e=new Date().toISOString().slice(0,10),[s,a]=(0,r.useState)(e),{data:d}=(0,n.Vc)(100,0),{data:m}=(0,n.bz)(1),f=new Date(s+"T00:00:00Z").getTime(),p=f+864e5,x=(null!=d?d:[]).filter(t=>t.startedAt>=f&&t.startedAt<p).slice(0,100),v=t=>{let e=new Date(s+"T00:00:00Z");e.setDate(e.getDate()+t),a(e.toISOString().slice(0,10))};return(0,i.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)("h2",{className:"text-2xl font-bold",children:t("timeline.title")}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("button",{onClick:()=>v(-1),className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(c.Z,{className:"h-4 w-4"})}),(0,i.jsx)("span",{className:"text-sm font-medium",children:s}),(0,i.jsx)("button",{onClick:()=>v(1),className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(u.Z,{className:"h-4 w-4"})})]})]}),(0,i.jsx)(o,{runs:x,date:s}),m&&(0,i.jsxs)("div",{className:"grid grid-cols-3 gap-3 text-sm",children:[(0,i.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,i.jsx)("div",{className:"text-muted-foreground text-xs",children:t("timeline.runs")}),(0,i.jsxs)("div",{className:"font-bold text-lg",children:[m.summary.completedRuns," ",t("timeline.completed")," / ",m.summary.failedRuns," ",t("timeline.failed")]})]}),(0,i.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,i.jsx)("div",{className:"text-muted-foreground text-xs",children:t("timeline.toolUses")}),(0,i.jsx)("div",{className:"font-bold text-lg",children:m.summary.totalToolUses})]}),(0,i.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,i.jsx)("div",{className:"text-muted-foreground text-xs",children:t("timeline.avgDuration")}),(0,i.jsxs)("div",{className:"font-bold text-lg",children:[(m.summary.avgRunDuration/1e3).toFixed(1),"s"]})]})]})]})}},33127:function(t,e,s){"use strict";s.d(e,{D:function(){return u},z:function(){return l}});var i,r=s(7653),n=s(77930),a=s(50794);let o=null!==(i=s(49767).env.NEXT_PUBLIC_DEVFLOW_API_URL)&&void 0!==i?i:"http://localhost:13337";async function c(t,e,s){let i=await fetch("".concat(o,"/api").concat(t),{headers:(0,a.O)(),signal:e});if(!i.ok||!i.body)throw Error("SSE ".concat(i.status));let r=i.body.getReader(),n=new TextDecoder,c="";for(;!e.aborted;){var u;let{value:t,done:e}=await r.read();if(e)break;let i=(c+=n.decode(t,{stream:!0})).split("\n\n");for(let t of(c=null!==(u=i.pop())&&void 0!==u?u:"",i)){let e="message",i=[];for(let s of t.split("\n"))s.startsWith("event:")&&(e=s.slice(6).trim()),s.startsWith("data:")&&i.push(s.slice(5).trim());if(0!==i.length)try{s({type:e,data:JSON.parse(i.join("\n"))})}catch(t){}}}}function u(t){let[e,s]=(0,r.useState)([]);return(0,r.useEffect)(()=>{if(!t)return;let e=new AbortController;return c("/workflows/runs/".concat(encodeURIComponent(t),"/stream"),e.signal,t=>s(e=>[...e,t])).catch(()=>void 0),()=>e.abort()},[t]),{events:e,clear:(0,r.useCallback)(()=>s([]),[])}}function l(t,e){let s=(0,n.NL)(),i=JSON.stringify(e);(0,r.useEffect)(()=>{let e=new AbortController,r=JSON.parse(i);return c("/live/stream?channels=".concat(encodeURIComponent(t)),e.signal,e=>{if("refresh"===e.type&&e.data.channel===t)for(let t of r)s.invalidateQueries({queryKey:t})}).catch(()=>void 0),()=>e.abort()},[t,s,i])}},2389:function(t,e,s){"use strict";s.d(e,{Z:function(){return c}});var i=s(7653);let r=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),n=function(){for(var t=arguments.length,e=Array(t),s=0;s<t;s++)e[s]=arguments[s];return e.filter((t,e,s)=>!!t&&s.indexOf(t)===e).join(" ")};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,i.forwardRef)((t,e)=>{let{color:s="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:u="",children:l,iconNode:h,...d}=t;return(0,i.createElement)("svg",{ref:e,...a,width:r,height:r,stroke:s,strokeWidth:c?24*Number(o)/Number(r):o,className:n("lucide",u),...d},[...h.map(t=>{let[e,s]=t;return(0,i.createElement)(e,s)}),...Array.isArray(l)?l:[l]])}),c=(t,e)=>{let s=(0,i.forwardRef)((s,a)=>{let{className:c,...u}=s;return(0,i.createElement)(o,{ref:a,iconNode:e,className:n("lucide-".concat(r(t)),c),...u})});return s.displayName="".concat(t),s}},58410:function(t,e,s){"use strict";s.d(e,{Z:function(){return i}});let i=(0,s(2389).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},2966:function(t,e,s){"use strict";s.d(e,{Z:function(){return i}});let i=(0,s(2389).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},64855:function(t,e,s){"use strict";s.d(e,{R:function(){return o},m:function(){return a}});var i=s(2906),r=s(5531),n=s(11135),a=class extends r.F{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||o(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#r({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,n.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#r({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});let i="pending"===this.state.status,r=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:r}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#r({type:"pending",context:e,variables:t,isPaused:r})}let n=await this.#i.start();return await this.#s.config.onSuccess?.(n,t,this.state.context,this,s),await this.options.onSuccess?.(n,t,this.state.context,s),await this.#s.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(n,null,t,this.state.context,s),this.#r({type:"success",data:n}),n}catch(e){try{await this.#s.config.onError?.(e,t,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onError?.(e,t,this.state.context,s)}catch(t){Promise.reject(t)}try{await this.#s.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,s)}catch(t){Promise.reject(t)}throw this.#r({type:"error",error:e}),e}finally{this.#s.runNext(this)}}#r(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},15969:function(t,e,s){"use strict";s.d(e,{D:function(){return l}});var i=s(7653),r=s(64855),n=s(2906),a=s(24559),o=s(50803),c=class extends a.l{#t;#n=void 0;#a;#o;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#c()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,o.VS)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,o.Ym)(e.mutationKey)!==(0,o.Ym)(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(t){this.#c(),this.#u(t)}getCurrentResult(){return this.#n}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#c(),this.#u()}mutate(t,e){return this.#o=e,this.#a?.removeObserver(this),this.#a=this.#t.getMutationCache().build(this.#t,this.options),this.#a.addObserver(this),this.#a.execute(t)}#c(){let t=this.#a?.state??(0,r.R)();this.#n={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#u(t){n.Vr.batch(()=>{if(this.#o&&this.hasListeners()){let e=this.#n.variables,s=this.#n.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#o.onSuccess?.(t.data,e,s,i)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(t.data,null,e,s,i)}catch(t){Promise.reject(t)}}else if(t?.type==="error"){try{this.#o.onError?.(t.error,e,s,i)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(void 0,t.error,e,s,i)}catch(t){Promise.reject(t)}}}this.listeners.forEach(t=>{t(this.#n)})})}},u=s(77930);function l(t,e){let s=(0,u.NL)(e),[r]=i.useState(()=>new c(s,t));i.useEffect(()=>{r.setOptions(t)},[r,t]);let a=i.useSyncExternalStore(i.useCallback(t=>r.subscribe(n.Vr.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=i.useCallback((t,e)=>{r.mutate(t,e).catch(o.ZT)},[r]);if(a.error&&(0,o.L3)(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:l,mutateAsync:a.mutate}}}},function(t){t.O(0,[736,806,429,293,528,744],function(){return t(t.s=68533)}),_N_E=t.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[571],{65897:function(t,e,s){Promise.resolve().then(s.bind(s,96098))},96098:function(t,e,s){"use strict";s.d(e,{TimelineView:function(){return d}});var i=s(27573),r=s(7653),n=s(57429);let a={cli:"#3b82f6",mcp:"#22c55e",dashboard:"#a855f7"};function o(t){let{runs:e,date:s}=t,r=new Date(s+"T00:00:00Z").getTime(),n=Math.max(28*e.length+40,120),o=[0,4,8,12,16,20,24].map(t=>({hour:t,x:40+t/24*720,label:"".concat(String(t).padStart(2,"0"),":00")}));return(0,i.jsx)("div",{className:"overflow-x-auto",children:(0,i.jsxs)("svg",{viewBox:"0 0 ".concat(800," ").concat(n),className:"w-full",children:[o.map(t=>(0,i.jsxs)("g",{children:[(0,i.jsx)("line",{x1:t.x,y1:0,x2:t.x,y2:n,stroke:"#e5e7eb",strokeWidth:.5}),(0,i.jsx)("text",{x:t.x,y:12,textAnchor:"middle",fontSize:"9",fill:"#9ca3af",children:t.label})]},t.hour)),e.map((t,e)=>{var s;let n=40+(t.startedAt-r)/864e5*720,o=Math.max(40,40*(t.totalToolCalls||1)),c=40+28*e,u=null!==(s=a[t.source])&&void 0!==s?s:"#6b7280",l="completed"===t.status?.9:"failed"===t.status?.6:.4;return(0,i.jsxs)("g",{children:[(0,i.jsx)("rect",{x:n,y:c,width:o,height:20,rx:3,fill:u,opacity:l}),(0,i.jsx)("text",{x:n+o+4,y:c+13,fontSize:"10",fill:"#6b7280",children:new Date(t.startedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),o>60&&(0,i.jsxs)("text",{x:n+4,y:c+13,fontSize:"9",fill:"white",fontWeight:"500",children:[t.agent," \xb7 ",t.source]})]},t.id)})]})})}var c=s(58410),u=s(2966),l=s(3806),h=s(33127);function d(){(0,h.z)("timeline",[["telemetry-runs"],["telemetry-stats"]]);let{t}=(0,l.$G)(),e=new Date().toISOString().slice(0,10),[s,a]=(0,r.useState)(e),{data:d}=(0,n.Vc)(100,0),{data:m}=(0,n.bz)(1),f=new Date(s+"T00:00:00Z").getTime(),p=f+864e5,x=(null!=d?d:[]).filter(t=>t.startedAt>=f&&t.startedAt<p).slice(0,100),v=t=>{let e=new Date(s+"T00:00:00Z");e.setDate(e.getDate()+t),a(e.toISOString().slice(0,10))};return(0,i.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)("h2",{className:"text-2xl font-bold",children:t("timeline.title")}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("button",{onClick:()=>v(-1),className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(c.Z,{className:"h-4 w-4"})}),(0,i.jsx)("span",{className:"text-sm font-medium",children:s}),(0,i.jsx)("button",{onClick:()=>v(1),className:"p-1 rounded hover:bg-accent",children:(0,i.jsx)(u.Z,{className:"h-4 w-4"})})]})]}),(0,i.jsx)(o,{runs:x,date:s}),m&&(0,i.jsxs)("div",{className:"grid grid-cols-3 gap-3 text-sm",children:[(0,i.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,i.jsx)("div",{className:"text-muted-foreground text-xs",children:t("timeline.runs")}),(0,i.jsxs)("div",{className:"font-bold text-lg",children:[m.summary.completedRuns," ",t("timeline.completed")," / ",m.summary.failedRuns," ",t("timeline.failed")]})]}),(0,i.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,i.jsx)("div",{className:"text-muted-foreground text-xs",children:t("timeline.toolUses")}),(0,i.jsx)("div",{className:"font-bold text-lg",children:m.summary.totalToolUses})]}),(0,i.jsxs)("div",{className:"bg-secondary rounded-lg p-3",children:[(0,i.jsx)("div",{className:"text-muted-foreground text-xs",children:t("timeline.avgDuration")}),(0,i.jsxs)("div",{className:"font-bold text-lg",children:[(m.summary.avgRunDuration/1e3).toFixed(1),"s"]})]})]})]})}},33127:function(t,e,s){"use strict";s.d(e,{D:function(){return u},z:function(){return l}});var i,r=s(7653),n=s(77930),a=s(50794);let o=null!==(i=s(53241).env.NEXT_PUBLIC_DEVFLOW_API_URL)&&void 0!==i?i:"http://localhost:13337";async function c(t,e,s){let i=await fetch("".concat(o,"/api").concat(t),{headers:(0,a.O)(),signal:e});if(!i.ok||!i.body)throw Error("SSE ".concat(i.status));let r=i.body.getReader(),n=new TextDecoder,c="";for(;!e.aborted;){var u;let{value:t,done:e}=await r.read();if(e)break;let i=(c+=n.decode(t,{stream:!0})).split("\n\n");for(let t of(c=null!==(u=i.pop())&&void 0!==u?u:"",i)){let e="message",i=[];for(let s of t.split("\n"))s.startsWith("event:")&&(e=s.slice(6).trim()),s.startsWith("data:")&&i.push(s.slice(5).trim());if(0!==i.length)try{s({type:e,data:JSON.parse(i.join("\n"))})}catch(t){}}}}function u(t){let[e,s]=(0,r.useState)([]);return(0,r.useEffect)(()=>{if(!t)return;let e=new AbortController;return c("/workflows/runs/".concat(encodeURIComponent(t),"/stream"),e.signal,t=>s(e=>[...e,t])).catch(()=>void 0),()=>e.abort()},[t]),{events:e,clear:(0,r.useCallback)(()=>s([]),[])}}function l(t,e){let s=(0,n.NL)(),i=JSON.stringify(e);(0,r.useEffect)(()=>{let e=new AbortController,r=JSON.parse(i);return c("/live/stream?channels=".concat(encodeURIComponent(t)),e.signal,e=>{if("refresh"===e.type&&e.data.channel===t)for(let t of r)s.invalidateQueries({queryKey:t})}).catch(()=>void 0),()=>e.abort()},[t,s,i])}},2389:function(t,e,s){"use strict";s.d(e,{Z:function(){return c}});var i=s(7653);let r=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),n=function(){for(var t=arguments.length,e=Array(t),s=0;s<t;s++)e[s]=arguments[s];return e.filter((t,e,s)=>!!t&&s.indexOf(t)===e).join(" ")};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,i.forwardRef)((t,e)=>{let{color:s="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:u="",children:l,iconNode:h,...d}=t;return(0,i.createElement)("svg",{ref:e,...a,width:r,height:r,stroke:s,strokeWidth:c?24*Number(o)/Number(r):o,className:n("lucide",u),...d},[...h.map(t=>{let[e,s]=t;return(0,i.createElement)(e,s)}),...Array.isArray(l)?l:[l]])}),c=(t,e)=>{let s=(0,i.forwardRef)((s,a)=>{let{className:c,...u}=s;return(0,i.createElement)(o,{ref:a,iconNode:e,className:n("lucide-".concat(r(t)),c),...u})});return s.displayName="".concat(t),s}},58410:function(t,e,s){"use strict";s.d(e,{Z:function(){return i}});let i=(0,s(2389).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},2966:function(t,e,s){"use strict";s.d(e,{Z:function(){return i}});let i=(0,s(2389).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},64855:function(t,e,s){"use strict";s.d(e,{R:function(){return o},m:function(){return a}});var i=s(2906),r=s(5531),n=s(11135),a=class extends r.F{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||o(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#r({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,n.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#r({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});let i="pending"===this.state.status,r=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:r}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#r({type:"pending",context:e,variables:t,isPaused:r})}let n=await this.#i.start();return await this.#s.config.onSuccess?.(n,t,this.state.context,this,s),await this.options.onSuccess?.(n,t,this.state.context,s),await this.#s.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(n,null,t,this.state.context,s),this.#r({type:"success",data:n}),n}catch(e){try{await this.#s.config.onError?.(e,t,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onError?.(e,t,this.state.context,s)}catch(t){Promise.reject(t)}try{await this.#s.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,s)}catch(t){Promise.reject(t)}throw this.#r({type:"error",error:e}),e}finally{this.#s.runNext(this)}}#r(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},15969:function(t,e,s){"use strict";s.d(e,{D:function(){return l}});var i=s(7653),r=s(64855),n=s(2906),a=s(24559),o=s(50803),c=class extends a.l{#t;#n=void 0;#a;#o;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#c()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,o.VS)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,o.Ym)(e.mutationKey)!==(0,o.Ym)(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(t){this.#c(),this.#u(t)}getCurrentResult(){return this.#n}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#c(),this.#u()}mutate(t,e){return this.#o=e,this.#a?.removeObserver(this),this.#a=this.#t.getMutationCache().build(this.#t,this.options),this.#a.addObserver(this),this.#a.execute(t)}#c(){let t=this.#a?.state??(0,r.R)();this.#n={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#u(t){n.Vr.batch(()=>{if(this.#o&&this.hasListeners()){let e=this.#n.variables,s=this.#n.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#o.onSuccess?.(t.data,e,s,i)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(t.data,null,e,s,i)}catch(t){Promise.reject(t)}}else if(t?.type==="error"){try{this.#o.onError?.(t.error,e,s,i)}catch(t){Promise.reject(t)}try{this.#o.onSettled?.(void 0,t.error,e,s,i)}catch(t){Promise.reject(t)}}}this.listeners.forEach(t=>{t(this.#n)})})}},u=s(77930);function l(t,e){let s=(0,u.NL)(e),[r]=i.useState(()=>new c(s,t));i.useEffect(()=>{r.setOptions(t)},[r,t]);let a=i.useSyncExternalStore(i.useCallback(t=>r.subscribe(n.Vr.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=i.useCallback((t,e)=>{r.mutate(t,e).catch(o.ZT)},[r]);if(a.error&&(0,o.L3)(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:l,mutateAsync:a.mutate}}}},function(t){t.O(0,[384,806,429,293,528,744],function(){return t(t.s=65897)}),_N_E=t.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[802],{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[802],{96652:function(e,t,r){Promise.resolve().then(r.bind(r,28392))},38941:function(e,t,r){"use strict";r.d(t,{C:function(){return l}});var s=r(27573);r(7653);var n=r(29147);let a=(0,r(49289).j)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:r,...l}=e;return(0,s.jsx)("div",{className:(0,n.cn)(a({variant:r}),t),...l})}},72196:function(e,t,r){"use strict";r.d(t,{Ol:function(){return o},Zb:function(){return l},aY:function(){return i},ll:function(){return c}});var s=r(27573),n=r(7653),a=r(29147);let l=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("div",{ref:t,className:(0,a.cn)("rounded-lg border border-border bg-card text-card-foreground",r),...n})});l.displayName="Card";let o=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("div",{ref:t,className:(0,a.cn)("flex flex-col space-y-1.5 p-4",r),...n})});o.displayName="CardHeader";let c=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("h3",{ref:t,className:(0,a.cn)("text-sm font-semibold leading-none tracking-tight",r),...n})});c.displayName="CardTitle";let i=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("div",{ref:t,className:(0,a.cn)("p-4 pt-0",r),...n})});i.displayName="CardContent"},28392:function(e,t,r){"use strict";r.d(t,{ToolMetricsView:function(){return i}});var s=r(27573),n=r(7653),a=r(72196),l=r(38941),o=r(57429),c=r(33127);function i(){(0,c.z)("tool-metrics",[["tool-metrics-summary"]]);let[e,t]=(0,n.useState)(7),{data:r=[],isLoading:i}=(0,o.Re)(e);return i?(0,s.jsx)("div",{className:"p-4 text-muted-foreground",children:"Loading tool metrics..."}):(0,s.jsxs)("div",{className:"p-6 space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold",children:"Tool Metrics"}),(0,s.jsxs)("select",{value:e,onChange:e=>t(Number(e.target.value)),className:"border rounded px-2 py-1 text-sm bg-background",children:[(0,s.jsx)("option",{value:1,children:"Last 24h"}),(0,s.jsx)("option",{value:7,children:"Last 7 days"}),(0,s.jsx)("option",{value:30,children:"Last 30 days"})]})]}),0===r.length?(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"No tool metrics yet. Start a Claude Code session to collect data."}):(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:r.map(e=>(0,s.jsxs)(a.Zb,{className:"p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h3",{className:"font-mono text-sm font-medium",children:e.toolName}),(0,s.jsxs)(l.C,{variant:e.callCount>10?"default":"secondary",children:[e.callCount," calls"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Success"}),(0,s.jsxs)("p",{className:"font-semibold",style:{color:e.successRate>=90?"#22c55e":e.successRate>=70?"#f59e0b":"#ef4444"},children:[e.successRate,"%"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Empty"}),(0,s.jsxs)("p",{className:"font-semibold",style:{color:e.emptyRate<=10?"#22c55e":e.emptyRate<=30?"#f59e0b":"#ef4444"},children:[e.emptyRate,"%"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Avg Results"}),(0,s.jsx)("p",{className:"font-semibold",children:e.avgResults})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Avg Latency"}),(0,s.jsxs)("p",{className:"font-semibold",children:[e.avgLatency,"ms"]})]})]})]},e.toolName))})]})}},33127:function(e,t,r){"use strict";r.d(t,{D:function(){return i},z:function(){return d}});var s,n=r(7653),a=r(77930),l=r(50794);let o=null!==(s=r(53241).env.NEXT_PUBLIC_DEVFLOW_API_URL)&&void 0!==s?s:"http://localhost:13337";async function c(e,t,r){let s=await fetch("".concat(o,"/api").concat(e),{headers:(0,l.O)(),signal:t});if(!s.ok||!s.body)throw Error("SSE ".concat(s.status));let n=s.body.getReader(),a=new TextDecoder,c="";for(;!t.aborted;){var i;let{value:e,done:t}=await n.read();if(t)break;let s=(c+=a.decode(e,{stream:!0})).split("\n\n");for(let e of(c=null!==(i=s.pop())&&void 0!==i?i:"",s)){let t="message",s=[];for(let r of e.split("\n"))r.startsWith("event:")&&(t=r.slice(6).trim()),r.startsWith("data:")&&s.push(r.slice(5).trim());if(0!==s.length)try{r({type:t,data:JSON.parse(s.join("\n"))})}catch(e){}}}}function i(e){let[t,r]=(0,n.useState)([]);return(0,n.useEffect)(()=>{if(!e)return;let t=new AbortController;return c("/workflows/runs/".concat(encodeURIComponent(e),"/stream"),t.signal,e=>r(t=>[...t,e])).catch(()=>void 0),()=>t.abort()},[e]),{events:t,clear:(0,n.useCallback)(()=>r([]),[])}}function d(e,t){let r=(0,a.NL)(),s=JSON.stringify(t);(0,n.useEffect)(()=>{let t=new AbortController,n=JSON.parse(s);return c("/live/stream?channels=".concat(encodeURIComponent(e)),t.signal,t=>{if("refresh"===t.type&&t.data.channel===e)for(let e of n)r.invalidateQueries({queryKey:e})}).catch(()=>void 0),()=>t.abort()},[e,r,s])}},29147:function(e,t,r){"use strict";r.d(t,{cn:function(){return a}});var s=r(10607),n=r(25579);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.m6)((0,s.W)(t))}},49289:function(e,t,r){"use strict";r.d(t,{j:function(){return l}});var s=r(10607);let n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=s.W,l=(e,t)=>r=>{var s;if((null==t?void 0:t.variants)==null)return a(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:l,defaultVariants:o}=t,c=Object.keys(l).map(e=>{let t=null==r?void 0:r[e],s=null==o?void 0:o[e];if(null===t)return null;let a=n(t)||n(s);return l[e][a]}),i=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return a(e,c,null==t?void 0:null===(s=t.compoundVariants)||void 0===s?void 0:s.reduce((e,t)=>{let{class:r,className:s,...n}=t;return Object.entries(n).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...i}[t]):({...o,...i})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}},function(e){e.O(0,[384,697,429,293,528,744],function(){return e(e.s=96652)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[467],{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[467],{79746:function(e,t,r){Promise.resolve().then(r.bind(r,72684))},50466:function(e,t,r){"use strict";r.d(t,{z:function(){return o}});var n=r(27573),s=r(7653),l=r(29147);let a=(0,r(49289).j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),o=s.forwardRef((e,t)=>{let{className:r,variant:s,size:o,...i}=e;return(0,n.jsx)("button",{className:(0,l.cn)(a({variant:s,size:o,className:r})),ref:t,...i})});o.displayName="Button"},72196:function(e,t,r){"use strict";r.d(t,{Ol:function(){return o},Zb:function(){return a},aY:function(){return c},ll:function(){return i}});var n=r(27573),s=r(7653),l=r(29147);let a=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("rounded-lg border border-border bg-card text-card-foreground",r),...s})});a.displayName="Card";let o=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-4",r),...s})});o.displayName="CardHeader";let i=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("h3",{ref:t,className:(0,l.cn)("text-sm font-semibold leading-none tracking-tight",r),...s})});i.displayName="CardTitle";let c=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,l.cn)("p-4 pt-0",r),...s})});c.displayName="CardContent"},72684:function(e,t,r){"use strict";r.d(t,{WorkflowRuns:function(){return d}});var n=r(27573),s=r(7653),l=r(57429),a=r(33127),o=r(50466),i=r(72196),c=r(3806);function d(){let{t:e}=(0,c.$G)(),{data:t}=(0,l.D)(),{data:r}=(0,l.xX)(),d=(0,l.aw)(),[u,f]=(0,s.useState)(null),{events:h,clear:m}=(0,a.D)(u);return(0,n.jsxs)("div",{className:"p-6 space-y-4 h-full overflow-y-auto",children:[(0,n.jsx)("h2",{className:"text-2xl font-bold",children:e("workflows.title")}),(0,n.jsxs)(i.Zb,{children:[(0,n.jsx)(i.Ol,{children:(0,n.jsx)(i.ll,{children:e("workflows.available")})}),(0,n.jsx)(i.aY,{children:(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:(null!=t?t:[]).map(t=>(0,n.jsxs)(o.z,{variant:"outline",size:"sm",onClick:()=>d.mutate({type:t.name},{onSuccess:e=>f(e.runId)}),children:[t.name," (",t.stepCount," ",e("workflows.steps"),")"]},t.name))})})]}),u&&h.length>0&&(0,n.jsxs)(i.Zb,{children:[(0,n.jsx)(i.Ol,{children:(0,n.jsxs)(i.ll,{children:[e("workflows.stream"),": ",u]})}),(0,n.jsxs)(i.aY,{children:[(0,n.jsx)("div",{className:"space-y-1 max-h-60 overflow-y-auto font-mono text-xs",children:h.map((e,t)=>(0,n.jsxs)("div",{className:"text-muted-foreground",children:["[",e.type,"] ",JSON.stringify(e.data)]},t))}),(0,n.jsx)(o.z,{variant:"ghost",size:"sm",onClick:()=>{f(null),m()},className:"mt-2",children:e("workflows.closeStream")})]})]}),(0,n.jsxs)(i.Zb,{children:[(0,n.jsx)(i.Ol,{children:(0,n.jsx)(i.ll,{children:e("workflows.runHistory")})}),(0,n.jsx)(i.aY,{children:r&&r.length>0?(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"text-left text-muted-foreground",children:[(0,n.jsx)("th",{children:e("workflows.runId")}),(0,n.jsx)("th",{children:e("overview.status")}),(0,n.jsx)("th",{children:e("workflows.started")})]})}),(0,n.jsx)("tbody",{children:r.slice(0,10).map(e=>(0,n.jsxs)("tr",{className:"border-t border-border",children:[(0,n.jsx)("td",{className:"py-1 font-mono text-xs",children:e.runId}),(0,n.jsx)("td",{children:e.status}),(0,n.jsx)("td",{children:new Date(e.startedAt).toLocaleTimeString()})]},e.runId))})]}):(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:e("workflows.noRuns")})})]})]})}},33127:function(e,t,r){"use strict";r.d(t,{D:function(){return c},z:function(){return d}});var n,s=r(7653),l=r(77930),a=r(50794);let o=null!==(n=r(53241).env.NEXT_PUBLIC_DEVFLOW_API_URL)&&void 0!==n?n:"http://localhost:13337";async function i(e,t,r){let n=await fetch("".concat(o,"/api").concat(e),{headers:(0,a.O)(),signal:t});if(!n.ok||!n.body)throw Error("SSE ".concat(n.status));let s=n.body.getReader(),l=new TextDecoder,i="";for(;!t.aborted;){var c;let{value:e,done:t}=await s.read();if(t)break;let n=(i+=l.decode(e,{stream:!0})).split("\n\n");for(let e of(i=null!==(c=n.pop())&&void 0!==c?c:"",n)){let t="message",n=[];for(let r of e.split("\n"))r.startsWith("event:")&&(t=r.slice(6).trim()),r.startsWith("data:")&&n.push(r.slice(5).trim());if(0!==n.length)try{r({type:t,data:JSON.parse(n.join("\n"))})}catch(e){}}}}function c(e){let[t,r]=(0,s.useState)([]);return(0,s.useEffect)(()=>{if(!e)return;let t=new AbortController;return i("/workflows/runs/".concat(encodeURIComponent(e),"/stream"),t.signal,e=>r(t=>[...t,e])).catch(()=>void 0),()=>t.abort()},[e]),{events:t,clear:(0,s.useCallback)(()=>r([]),[])}}function d(e,t){let r=(0,l.NL)(),n=JSON.stringify(t);(0,s.useEffect)(()=>{let t=new AbortController,s=JSON.parse(n);return i("/live/stream?channels=".concat(encodeURIComponent(e)),t.signal,t=>{if("refresh"===t.type&&t.data.channel===e)for(let e of s)r.invalidateQueries({queryKey:e})}).catch(()=>void 0),()=>t.abort()},[e,r,n])}},29147:function(e,t,r){"use strict";r.d(t,{cn:function(){return l}});var n=r(10607),s=r(25579);function l(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.m6)((0,n.W)(t))}},49289:function(e,t,r){"use strict";r.d(t,{j:function(){return a}});var n=r(10607);let s=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,l=n.W,a=(e,t)=>r=>{var n;if((null==t?void 0:t.variants)==null)return l(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:a,defaultVariants:o}=t,i=Object.keys(a).map(e=>{let t=null==r?void 0:r[e],n=null==o?void 0:o[e];if(null===t)return null;let l=s(t)||s(n);return a[e][l]}),c=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return l(e,i,null==t?void 0:null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...c}[t]):({...o,...c})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}},function(e){e.O(0,[384,806,697,429,293,528,744],function(){return e(e.s=79746)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{2971:function(e,n,t){Promise.resolve().then(t.t.bind(t,11815,23)),Promise.resolve().then(t.t.bind(t,5428,23)),Promise.resolve().then(t.t.bind(t,91584,23)),Promise.resolve().then(t.t.bind(t,55092,23)),Promise.resolve().then(t.t.bind(t,63859,23)),Promise.resolve().then(t.t.bind(t,82023,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[293,528],function(){return n(86e3),n(2971)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="zh" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/7d4d1db5aa137b5a.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js"/><script src="/_next/static/chunks/1dd3208c-f3e84932bdc53383.js" async=""></script><script src="/_next/static/chunks/528-7d4fc14903647f1e.js" async=""></script><script src="/_next/static/chunks/main-app-
|
|
1
|
+
<!DOCTYPE html><html lang="zh" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/7d4d1db5aa137b5a.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js"/><script src="/_next/static/chunks/1dd3208c-f3e84932bdc53383.js" async=""></script><script src="/_next/static/chunks/528-7d4fc14903647f1e.js" async=""></script><script src="/_next/static/chunks/main-app-cf693a9b955f073e.js" async=""></script><script src="/_next/static/chunks/384-484184f146e1b764.js" async=""></script><script src="/_next/static/chunks/697-05cf55b6c667773f.js" async=""></script><script src="/_next/static/chunks/429-3a8e078af4ea04bd.js" async=""></script><script src="/_next/static/chunks/app/accuracy/page-3b8b7448c9c7aeee.js" async=""></script><script src="/_next/static/chunks/806-195d4d5cc6c28f6c.js" async=""></script><script src="/_next/static/chunks/458-75822399a849befa.js" async=""></script><script src="/_next/static/chunks/249-e04c1de6240fd78a.js" async=""></script><script src="/_next/static/chunks/app/layout-572650e435947896.js" async=""></script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="h-dvh overflow-hidden"><div class="flex h-dvh items-center justify-center text-sm text-muted-foreground">Loading...</div><script src="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/7d4d1db5aa137b5a.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[11815,[],\"\"]\n4:I[72206,[\"384\",\"static/chunks/384-484184f146e1b764.js\",\"697\",\"static/chunks/697-05cf55b6c667773f.js\",\"429\",\"static/chunks/429-3a8e078af4ea04bd.js\",\"506\",\"static/chunks/app/accuracy/page-3b8b7448c9c7aeee.js\"],\"AccuracyView\"]\n5:I[55092,[],\"\"]\n6:I[82023,[],\"\"]\n7:I[68762,[\"384\",\"static/chunks/384-484184f146e1b764.js\",\"806\",\"static/chunks/806-195d4d5cc6c28f6c.js\",\"697\",\"static/chunks/697-05cf55b6c667773f.js\",\"458\",\"static/chunks/458-75822399a849befa.js\",\"249\",\"static/chunks/249-e04c1de6240fd78a.js\",\"429\",\"static/chunks/429-3a8e078af4ea04bd.js\",\"185\",\"static/chunks/app/layout-572650e435947896.js\"],\"default\",1]\n9:I[91584,[],\"\"]\na:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"ZaapgyqOj6AXHY5zdw6_X\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"accuracy\"],\"initialTree\":[\"\",{\"children\":[\"accuracy\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"accuracy\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$L4\",null,{}],null],null],null]},[null,[\"$\",\"$L5\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"accuracy\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L6\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/7d4d1db5aa137b5a.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L7\",null,{\"children\":[\"$\",\"$L5\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L6\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L8\"],\"globalErrorComponent\":\"$9\",\"missingSlots\":\"$Wa\"}]\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
2:I[72206,["
|
|
1
|
+
2:I[72206,["384","static/chunks/384-484184f146e1b764.js","697","static/chunks/697-05cf55b6c667773f.js","429","static/chunks/429-3a8e078af4ea04bd.js","506","static/chunks/app/accuracy/page-3b8b7448c9c7aeee.js"],"AccuracyView"]
|
|
2
2
|
3:I[55092,[],""]
|
|
3
3
|
4:I[82023,[],""]
|
|
4
|
-
5:I[68762,["
|
|
5
|
-
0:["
|
|
4
|
+
5:I[68762,["384","static/chunks/384-484184f146e1b764.js","806","static/chunks/806-195d4d5cc6c28f6c.js","697","static/chunks/697-05cf55b6c667773f.js","458","static/chunks/458-75822399a849befa.js","249","static/chunks/249-e04c1de6240fd78a.js","429","static/chunks/429-3a8e078af4ea04bd.js","185","static/chunks/app/layout-572650e435947896.js"],"default",1]
|
|
5
|
+
0:["ZaapgyqOj6AXHY5zdw6_X",[[["",{"children":["accuracy",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["accuracy",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{}],null],null],null]},[null,["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","accuracy","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/7d4d1db5aa137b5a.css","precedence":"next","crossOrigin":"$undefined"}]],["$","$L5",null,{"children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}],"params":{}}]],null],null],["$L6",null]]]]
|
|
6
6
|
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}]]
|
|
7
7
|
1:null
|