specrails-desktop 2.14.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/dist/assets/{ActivityFeedPage-BBGvhMX5.js → ActivityFeedPage-C_clKk8d.js} +1 -1
- package/client/dist/assets/AgentsPage-jcPUtPhP.js +86 -0
- package/client/dist/assets/AnalyticsPage-DZkVU3yd.js +1 -0
- package/client/dist/assets/{BarChart-zCFHhnbZ.js → BarChart-Dq1h8eYR.js} +2 -2
- package/client/dist/assets/CodePage-BcbZT88K.js +2 -0
- package/client/dist/assets/{DesktopAnalyticsPage-DlrcBWPo.js → DesktopAnalyticsPage-CYhXhJoQ.js} +1 -1
- package/client/dist/assets/{DocsDialog-B8mSbQhA.js → DocsDialog-CS3Syf61.js} +2 -2
- package/client/dist/assets/{DocsPage-D7t2Bc-K.js → DocsPage-l3ZcTO2E.js} +2 -2
- package/client/dist/assets/{ExportDropdown-ClTut9WA.js → ExportDropdown-DdB2ncYh.js} +1 -1
- package/client/dist/assets/IntegrationsPage-CJ_Om1zu.js +3 -0
- package/client/dist/assets/JobDetailPage-D5Cxw0md.js +16 -0
- package/client/dist/assets/JobsPage-3v_iX83r.js +1 -0
- package/client/dist/assets/{LoopBuilderPage-CScd8wyY.js → LoopBuilderPage-4s_adZy5.js} +2 -2
- package/client/dist/assets/LoopsPage-DA94-o0j.js +1 -0
- package/client/dist/assets/analytics-BDlELxc7.js +1 -0
- package/client/dist/assets/analytics-BE49LbUk.js +1 -0
- package/client/dist/assets/analytics-CQqu1yE5.js +1 -0
- package/client/dist/assets/analytics-CgEkAUiP.js +1 -0
- package/client/dist/assets/analytics-D1ElChhs.js +1 -0
- package/client/dist/assets/analytics-DBGO8B6-.js +1 -0
- package/client/dist/assets/analytics-DDqve9Ma.js +1 -0
- package/client/dist/assets/analytics-DEsEAJZL.js +1 -0
- package/client/dist/assets/{common-DI4jE5y-.js → common-C9VyfY7g.js} +1 -1
- package/client/dist/assets/{common-DTHzyfYC.js → common-CNoRVpnA.js} +1 -1
- package/client/dist/assets/{common-CnrZ9gCZ.js → common-CcHFVATT.js} +1 -1
- package/client/dist/assets/{common-BhFasU8N.js → common-CzCQ0rpW.js} +1 -1
- package/client/dist/assets/{common-DY4nzbWC.js → common-Dmpyh323.js} +1 -1
- package/client/dist/assets/{common-CwhHWbTD.js → common-LDwESeCX.js} +1 -1
- package/client/dist/assets/{common-DS8zKLQT.js → common-ULlk84G4.js} +1 -1
- package/client/dist/assets/common-kftoE0Q-.js +1 -0
- package/client/dist/assets/dashboard-03EpOoMM.js +1 -0
- package/client/dist/assets/dashboard-BQ3Oa8CE.js +1 -0
- package/client/dist/assets/dashboard-C-dXxut-.js +1 -0
- package/client/dist/assets/dashboard-C2owt3eN.js +1 -0
- package/client/dist/assets/dashboard-C52PElPV.js +1 -0
- package/client/dist/assets/dashboard-CUjyhohl.js +1 -0
- package/client/dist/assets/dashboard-Ch6H-457.js +1 -0
- package/client/dist/assets/dashboard-zH9quXks.js +1 -0
- package/client/dist/assets/{dist-js-Ca7dsMhN.js → dist-js-D27I-bfi.js} +1 -1
- package/client/dist/assets/{dist-js-BHJ5LpTw.js → dist-js-Ele_sHO7.js} +1 -1
- package/client/dist/assets/index-BRMyOS1B.css +2 -0
- package/client/dist/assets/index-meTWPBzY.js +144 -0
- package/client/dist/assets/{lib-3_pPhUqA.js → lib-qdRfWwE1.js} +1 -1
- package/client/dist/assets/{tickets-IbYhlr-6.js → tickets-68LH1xp6.js} +1 -1
- package/client/dist/assets/{tickets-EnP6m_Ao.js → tickets-D6f3GSYn.js} +1 -1
- package/client/dist/assets/{tickets-BFrVcXAI.js → tickets-DBQXMYYA.js} +1 -1
- package/client/dist/assets/{tickets-C3gG--yT.js → tickets-OrJwUxJR.js} +1 -1
- package/client/dist/assets/{tickets-Cfhwbdxj.js → tickets-PtHNxQo5.js} +1 -1
- package/client/dist/assets/{tickets-ZS5EsDxn.js → tickets-REr-EQx9.js} +1 -1
- package/client/dist/assets/{tickets-DcggvP3k.js → tickets-blQnNA4N.js} +1 -1
- package/client/dist/assets/{tickets-lJR7pWNI.js → tickets-jxsTrApR.js} +1 -1
- package/client/dist/assets/{upload-DsygVwLQ.js → upload-DPG87J4t.js} +1 -1
- package/client/dist/assets/{value-B5mYukkD.js → value-BRVOAvhY.js} +1 -1
- package/client/dist/index.html +6 -6
- package/package.json +1 -1
- package/server/dist/ai-invocations.js +5 -2
- package/server/dist/db.js +35 -2
- package/server/dist/desktop-analytics.js +39 -6
- package/server/dist/loop-command-catalog.js +40 -1
- package/server/dist/loop-constants.js +37 -1
- package/server/dist/loop-decider.js +13 -10
- package/server/dist/loop-executors.js +58 -6
- package/server/dist/loop-factory.js +10 -3
- package/server/dist/loop-run-manager.js +199 -16
- package/server/dist/loop-runs-store.js +51 -0
- package/server/dist/loop-templates-ported.js +25 -21
- package/server/dist/loop-templates.js +87 -7
- package/server/dist/merge-manager.js +81 -0
- package/server/dist/pricing.js +20 -1
- package/server/dist/project-registry.js +7 -0
- package/server/dist/project-router-spending.js +56 -8
- package/server/dist/queue-manager.js +70 -10
- package/server/dist/rail-isolated-launch.js +189 -0
- package/server/dist/rail-isolation.js +55 -0
- package/server/dist/rail-merge-orchestrator.js +45 -0
- package/server/dist/rail-worktrees-store.js +52 -0
- package/server/dist/rails-router.js +47 -4
- package/server/dist/repo-lock.js +25 -0
- package/server/dist/result-event.js +15 -1
- package/server/dist/spending.js +161 -21
- package/server/dist/workspace-manager.js +134 -14
- package/server/dist/worktree-manager.js +159 -0
- package/client/dist/assets/AgentsPage-CSrs9kuV.js +0 -86
- package/client/dist/assets/AnalyticsPage-B011XilA.js +0 -1
- package/client/dist/assets/CodePage-MB0JiLis.js +0 -2
- package/client/dist/assets/IntegrationsPage-CgJf4uLW.js +0 -3
- package/client/dist/assets/JobDetailPage-DlyLLI4l.js +0 -16
- package/client/dist/assets/JobsPage-mbez97dP.js +0 -1
- package/client/dist/assets/LoopsPage-mBDRcEzq.js +0 -1
- package/client/dist/assets/analytics-BHApBnUn.js +0 -1
- package/client/dist/assets/analytics-BUxrug9J.js +0 -1
- package/client/dist/assets/analytics-Cy6DTfO-.js +0 -1
- package/client/dist/assets/analytics-DMJxD9FD.js +0 -1
- package/client/dist/assets/analytics-DgrBuxla.js +0 -1
- package/client/dist/assets/analytics-DwxT1CS8.js +0 -1
- package/client/dist/assets/analytics-GrLc-SMr.js +0 -1
- package/client/dist/assets/analytics-qvPq4T4h.js +0 -1
- package/client/dist/assets/common-D9GAPxeN.js +0 -1
- package/client/dist/assets/dashboard-8FSyxKGV.js +0 -1
- package/client/dist/assets/dashboard-A9XQUfdS.js +0 -1
- package/client/dist/assets/dashboard-BFktSDsV.js +0 -1
- package/client/dist/assets/dashboard-C1PKCXLs.js +0 -1
- package/client/dist/assets/dashboard-DNf0czU-.js +0 -1
- package/client/dist/assets/dashboard-DQQCOVfu.js +0 -1
- package/client/dist/assets/dashboard-DxFqeHZk.js +0 -1
- package/client/dist/assets/dashboard-WvPGhbbi.js +0 -1
- package/client/dist/assets/index-ByhYcYLV.css +0 -2
- package/client/dist/assets/index-CEunZ8kJ.js +0 -144
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor.main-Cd8qBRAT.js","assets/chunk-CilyBKbf.js","assets/preload-helper-DSXbuxSR.js","assets/editor.api2-Cwla1nvV.js","assets/editor-Br_kD0ds.css","assets/workers-yr2u4c3C.js","assets/monaco.contribution-CIvCAJs4.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./preload-helper-DSXbuxSR.js";import{$ as n,Dt as r,Et as i,It as a,Ot as o,Qt as s,Rt as c,V as l,Xt as u,Zt as d,_ as f,_t as p,a as m,bn as h,dn as g,dt as _,fn as v,g as y,gn as b,gt as x,ht as S,l as C,pt as w,vn as T,vt as E,yn as D,z as O,zt as k}from"./index-CEunZ8kJ.js";var A=a(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),ee=a(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),j=a(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),M=e(h(),1),N=e(D(),1);function te(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function P(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function F(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var I=(e,t)=>Math.abs(e-t)<1.01,L=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},R,z=()=>{if(R!==void 0)return R;if(typeof navigator>`u`)return R=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return R=!0;let e=navigator.maxTouchPoints;return R=navigator.platform===`MacIntel`&&e!==void 0&&e>0},B=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ne=e=>e,V=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},H=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(B(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(B(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},U={passive:!0},W=typeof window>`u`?!0:`onscrollend`in window,G=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&W,o=0,s=a?null:L(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,U),a&&r.addEventListener(`scrollend`,u,U),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},re=(e,t)=>G(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),K=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},ie=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},ae=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ne,rangeExtractor:V,onChange:()=>{},measureElement:K,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}this.options=t},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=P(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!z()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,U),e.addEventListener(`touchend`,n,U),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=P(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=P(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=te(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=P(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?se({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=P(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);o!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!==`backward`:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this))&&(z()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=o:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,this.notify(!1))},this.getVirtualItems=P(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return F(t[oe(0,t.length-1,r?e=>n[e*2]:e=>F(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&I(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},oe=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function se({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=oe(0,a,o,n),l=c;if(r===1)for(;l<a&&s(l)<n+t;)l++;else if(r>1){let i=Array(r).fill(0);for(;l<a&&i.some(e=>e<n+t);){let t=e[l];i[t.lane]=t.end,l++}let o=Array(r).fill(n+t);for(;c>=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}var q=typeof document<`u`?M.useLayoutEffect:M.useEffect;function ce({useFlushSync:e=!0,...t}){let n=M.useReducer(e=>e+1,0)[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,N.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=M.useState(()=>new ae(r));return i.setOptions(r),q(()=>i._didMount(),[]),q(()=>i._willUpdate()),i}function J(e){return ce({observeElementRect:H,observeElementOffset:re,scrollToFn:ie,...e})}var Y=d(),X=e=>`specrails-desktop:code-tree-filter:${e}`,Z=e=>`specrails-desktop:code-tree-collapsed:${e}`;function le(e){return e.split(`/`).length-1}function ue(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function de(e){return e?e.length>10?e.slice(0,10):e:null}function fe(e){return e===`created`?`added`:e===`modified`?`changed`:e===`deleted`?`deleted`:null}function pe(e,t){if(t.size===0)return!1;let n=e.split(`/`);for(let e=1;e<n.length;e++)if(t.has(n.slice(0,e).join(`/`)))return!0;return!1}function me({onOpenFile:e,selectedPath:t,filterJobId:n,filterTicketId:i}){let{t:a}=v(`code`),{activeProjectId:l}=c(),{openTicketDetail:d}=C(),{registerHandler:f,unregisterHandler:p}=u(),[m,h]=(0,M.useState)(()=>{if(!l)return`touched-by-ai`;try{let e=localStorage.getItem(X(l));if(e===`all`||e===`touched-by-ai`)return e}catch{}return`touched-by-ai`});(0,M.useEffect)(()=>{if(l)try{localStorage.setItem(X(l),m)}catch{}},[m,l]);let[g,y]=(0,M.useState)(()=>{if(!l)return new Set;try{let e=localStorage.getItem(Z(l));if(!e)return new Set;let t=JSON.parse(e);if(Array.isArray(t))return new Set(t.filter(e=>typeof e==`string`))}catch{}return new Set});(0,M.useEffect)(()=>{if(l)try{localStorage.setItem(Z(l),JSON.stringify([...g]))}catch{}},[g,l]);let b=(0,M.useCallback)(e=>{y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),x=(0,M.useCallback)(()=>{y(new Set)},[]),{data:S,refresh:T,isFirstLoad:E}=k({namespace:`code-tree:${m}:${m===`touched-by-ai`?`${n??`all-jobs`}:${i??`all-specs`}`:`all`}`,projectId:l,initialValue:[],fetcher:(0,M.useCallback)(async()=>{let e=[],t=null;for(let r=0;r<100;r+=1){let r=new URLSearchParams({withProvenance:`1`,filter:m});m===`touched-by-ai`&&n&&r.set(`jobId`,n),m===`touched-by-ai`&&typeof i==`number`&&r.set(`ticketId`,String(i)),t&&r.set(`cursor`,t);let a=await fetch(`${s()}/code/tree?${r.toString()}`);if(!a.ok)break;let o=await a.json().catch(()=>({}));if(Array.isArray(o.entries)&&e.push(...o.entries),!o.nextCursor)break;t=o.nextCursor}return e},[m,n,i])}),D=(0,M.useRef)(l);(0,M.useEffect)(()=>{D.current=l},[l]),(0,M.useEffect)(()=>{if(!l)return;let e=`code-tree-${l}`;return f(e,e=>{let t=e;t.projectId===D.current&&t.type===`file.provenance_updated`&&T()}),()=>p(e)},[l,f,p,T]);let j=(0,M.useRef)(null),N=(0,M.useMemo)(()=>(S??[]).filter(e=>!pe(e.path,g)),[S,g]),te=(0,M.useCallback)(()=>{y(new Set((S??[]).filter(e=>e.kind===`dir`).map(e=>e.path)))},[S]),P=J({count:N.length,getScrollElement:()=>j.current,estimateSize:()=>28,overscan:12,initialRect:{width:320,height:600},observeElementRect:(e,t)=>{let n=e.scrollElement;if(!n)return()=>{};let r=()=>{let e=n.getBoundingClientRect(),r=e.height||n.clientHeight||600;t({width:e.width||n.clientWidth||320,height:r})};if(r(),typeof ResizeObserver<`u`){let e=new ResizeObserver(r);return e.observe(n),()=>e.disconnect()}return()=>{}}}),F=N.length===0,I=(0,M.useMemo)(()=>(S??[]).filter(e=>e.kind===`file`).length,[S]);return(0,Y.jsxs)(`div`,{className:`flex flex-col h-full`,"data-testid":`file-tree`,children:[(0,Y.jsxs)(`div`,{className:`px-2 py-2 border-b border-border text-xs space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`button`,{type:`button`,onClick:()=>h(`touched-by-ai`),className:O(`px-2 py-1 rounded-md transition-colors`,m===`touched-by-ai`?`bg-accent-primary/20 text-accent-primary`:`text-muted-foreground hover:text-foreground hover:bg-muted/50`),"aria-pressed":m===`touched-by-ai`,children:a(n?`tree.jobFiles`:i?`tree.specFiles`:`tree.touchedByAi`)}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>h(`all`),className:O(`px-2 py-1 rounded-md transition-colors`,m===`all`?`bg-accent-primary/20 text-accent-primary`:`text-muted-foreground hover:text-foreground hover:bg-muted/50`),"aria-pressed":m===`all`,children:a(`tree.allFiles`)}),(0,Y.jsx)(`div`,{className:`flex-1`}),(0,Y.jsx)(`button`,{type:`button`,onClick:te,title:a(`tree.collapseAll`),className:`px-1.5 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,"aria-label":a(`tree.collapseAll`),children:(0,Y.jsx)(r,{className:`w-3.5 h-3.5`})}),(0,Y.jsx)(`button`,{type:`button`,onClick:x,title:a(`tree.expandAll`),className:`px-1.5 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,"aria-label":a(`tree.expandAll`),children:(0,Y.jsx)(o,{className:`w-3.5 h-3.5`})})]}),m===`touched-by-ai`&&I>0&&(0,Y.jsx)(`div`,{className:`flex items-center justify-between gap-2 text-[11px] text-muted-foreground`,children:(0,Y.jsx)(`span`,{children:a(`tree.touchedCount`,{count:I})})})]}),F&&E?(0,Y.jsx)(`div`,{className:`flex-1 flex items-center justify-center px-4 text-center`,"data-testid":`file-tree-loading`,children:(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground animate-pulse`,children:a(`tree.loadingFiles`)})}):F&&m===`touched-by-ai`?(0,Y.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center px-4 text-center gap-3`,children:[(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`tree.emptyTouched`)}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>h(`all`),className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary/20 text-accent-primary hover:bg-accent-primary/30`,children:a(`tree.showAllFiles`)})]}):F?(0,Y.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-muted-foreground px-4 text-center`,children:a(`tree.noFiles`)}):(0,Y.jsx)(`div`,{ref:j,className:`flex-1 overflow-auto`,"data-testid":`file-tree-scroller`,children:(0,Y.jsx)(`div`,{style:{height:P.getTotalSize(),position:`relative`,width:`100%`},children:P.getVirtualItems().map(n=>{let i=N[n.index],s=le(i.path)*12,c=i.kind===`file`&&i.path===t,l=i.provenance?.createdByTicketId,u=i.provenance?.modifiedByTicketIds??[],f=i.provenance?.latest??null,p=de(f?.jobId),m=fe(f?.kind),h=i.kind===`dir`,v=h&&g.has(i.path),y=i.provenance?.touchedFileCount??0;return(0,Y.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,transform:`translateY(${n.start}px)`,height:n.size,width:`100%`},className:O(`flex items-center gap-2 px-2 text-xs cursor-pointer hover:bg-muted/50`,c&&`bg-muted text-foreground`),onClick:()=>{h?b(i.path):e(i.path)},role:`button`,tabIndex:0,"aria-expanded":h?!v:void 0,"data-testid":`file-tree-row-${i.path}`,children:[(0,Y.jsxs)(`span`,{style:{paddingLeft:s},className:`flex items-center gap-1 min-w-0 flex-1`,children:[h?(0,Y.jsxs)(Y.Fragment,{children:[v?(0,Y.jsx)(r,{className:`w-3 h-3 text-muted-foreground flex-shrink-0`}):(0,Y.jsx)(o,{className:`w-3 h-3 text-muted-foreground flex-shrink-0`}),v?(0,Y.jsx)(ee,{className:`w-3.5 h-3.5 text-accent-info flex-shrink-0`}):(0,Y.jsx)(w,{className:`w-3.5 h-3.5 text-accent-info flex-shrink-0`})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`w-3 flex-shrink-0`}),(0,Y.jsx)(A,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`})]}),(0,Y.jsx)(`span`,{className:`truncate ml-0.5`,children:ue(i.path)})]}),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1 flex-shrink-0`,children:[h&&y>0&&(0,Y.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted/60 text-muted-foreground`,title:a(`tree.folderTouched`,{count:y}),children:y}),!h&&m&&(0,Y.jsx)(`span`,{className:O(`text-[10px] px-1.5 py-0.5 rounded`,f?.kind===`created`&&`bg-accent-success/15 text-accent-success`,f?.kind===`modified`&&`bg-accent-info/15 text-accent-info`,f?.kind===`deleted`&&`bg-destructive/15 text-destructive`),title:f?.kind===`created`?a(`tree.latestTitleCreated`):f?.kind===`deleted`?a(`tree.latestTitleDeleted`):a(`tree.latestTitleModified`),children:a(`action.${m}`)}),!h&&p&&(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded bg-muted/60 text-muted-foreground font-mono`,title:a(`tree.jobTitle`,{jobId:f?.jobId??``}),children:[(0,Y.jsx)(_,{className:`h-3 w-3`}),p]}),!h&&typeof l==`number`&&(0,Y.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),d(l)},className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success`,"data-testid":`provenance-chip-created-${l}`,title:a(`tree.createdBySpec`,{id:l}),children:[`#`,l]}),!h&&u.slice(0,2).map(e=>(0,Y.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),d(e)},className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info`,"data-testid":`provenance-chip-modified-${e}`,title:a(`tree.modifiedBySpec`,{id:e}),children:[`#`,e]},e))]})]},i.path)})})})]})}function he(e){return new Worker(`/assets/editor.worker-Bd9IXS8d.js`,{name:e?.name})}function ge(e){return new Worker(`/assets/json.worker-DzV-CpCQ.js`,{name:e?.name})}function _e(e){return new Worker(`/assets/css.worker-Wv5dxAWO.js`,{name:e?.name})}function ve(e){return new Worker(`/assets/html.worker-CQP8QQsS.js`,{name:e?.name})}function ye(e){return new Worker(`/assets/ts.worker-METxwbDZ.js`,{name:e?.name})}var be=!1;function xe(e){let t=e.trim().match(/^hsl\(\s*([-\d.]+)[\s,]+([\d.]+)%[\s,]+([\d.]+)%\s*\)$/i);return t?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]:null}function Q(e,t=`#1e1e1e`){if(e.startsWith(`#`))return e;let n=xe(e);if(!n)return t;let[r,i,a]=n,o=i/100,s=a/100,c=(1-Math.abs(2*s-1))*o,l=(r%360+360)%360/60,u=c*(1-Math.abs(l%2-1)),d=0,f=0,p=0;l<1?(d=c,f=u):l<2?(d=u,f=c):l<3?(f=c,p=u):l<4?(f=u,p=c):l<5?(d=u,p=c):(d=c,p=u);let m=s-c/2,h=e=>Math.round((e+m)*255).toString(16).padStart(2,`0`);return`#${h(d)}${h(f)}${h(p)}`}function Se(e){return`specrails-${e}`}function Ce(e,t){let n=Se(t.id),r=t.xterm,i=Q(r.background),a=Q(r.foreground),o=Q(r.brightBlack),s=Q(r.magenta),c=Q(r.yellow),l=Q(r.cyan),u=Q(r.blue),d=Q(r.green),f=Q(r.brightBlack),p=Q(r.brightCyan),m=Q(r.red),h=Q(r.selectionBackground);return e.editor.defineTheme(n,{base:t.scheme===`light`?`vs`:`vs-dark`,inherit:!0,rules:[{token:``,foreground:a.slice(1)},{token:`comment`,foreground:f.slice(1),fontStyle:`italic`},{token:`keyword`,foreground:s.slice(1)},{token:`string`,foreground:c.slice(1)},{token:`number`,foreground:l.slice(1)},{token:`constant`,foreground:p.slice(1)},{token:`constant.numeric`,foreground:l.slice(1)},{token:`type`,foreground:d.slice(1)},{token:`type.identifier`,foreground:d.slice(1)},{token:`identifier`,foreground:a.slice(1)},{token:`function`,foreground:u.slice(1)},{token:`tag`,foreground:m.slice(1)},{token:`attribute.name`,foreground:p.slice(1)},{token:`attribute.value`,foreground:c.slice(1)},{token:`delimiter`,foreground:o.slice(1)},{token:`operator`,foreground:o.slice(1)}],colors:{"editor.background":i,"editor.foreground":a,"editorLineNumber.foreground":o,"editorLineNumber.activeForeground":a,"editorCursor.foreground":Q(r.cursor),"editor.selectionBackground":h,"editor.inactiveSelectionBackground":h,"editor.lineHighlightBackground":Q(r.black),"editor.lineHighlightBorder":Q(r.black),"editorGutter.background":i,"editorWhitespace.foreground":o,"editorIndentGuide.background1":Q(r.black),"editorIndentGuide.activeBackground1":o,"scrollbarSlider.background":`${o}55`,"scrollbarSlider.hoverBackground":`${o}88`,"scrollbarSlider.activeBackground":`${o}bb`,"minimap.background":i}}),n}function we(){be||=(self.MonacoEnvironment={getWorker(e,t){switch(t){case`json`:return new ge;case`css`:case`scss`:case`less`:return new _e;case`html`:case`handlebars`:case`razor`:return new ve;case`typescript`:case`javascript`:return new ye;default:return new he}}},!0)}function Te({content:e,language:n,readOnly:r,onChange:i}){let{t:a}=v(`code`),o=m(),s=(0,M.useRef)(null),c=(0,M.useRef)(null),l=(0,M.useRef)(null),[u,d]=(0,M.useState)(!1),f=(0,M.useRef)(e),p=(0,M.useRef)(n),h=(0,M.useRef)(o),g=(0,M.useRef)(r),_=(0,M.useRef)(i);return(0,M.useEffect)(()=>{f.current=e},[e]),(0,M.useEffect)(()=>{p.current=n},[n]),(0,M.useEffect)(()=>{h.current=o},[o]),(0,M.useEffect)(()=>{g.current=r},[r]),(0,M.useEffect)(()=>{_.current=i},[i]),(0,M.useEffect)(()=>{let e=!1;return we(),t(()=>import(`./editor.main-Cd8qBRAT.js`).then(t=>{if(e||!s.current)return;l.current=t;let n=Ce(t,h.current),r=t.editor.create(s.current,{value:f.current,language:p.current,readOnly:g.current,theme:n,minimap:{enabled:!1},lineNumbers:`on`,scrollBeyondLastLine:!1,automaticLayout:!0,fontSize:13});r.onDidChangeModelContent(()=>{_.current?.(r.getValue())}),c.current=r}),__vite__mapDeps([0,1,2,3,4,5,6])).catch(()=>{e||d(!0)}),()=>{e=!0,c.current?.dispose?.(),c.current=null}},[]),(0,M.useEffect)(()=>{let t=c.current;t&&t.getValue?.()!==e&&t.setValue?.(e)},[e]),(0,M.useEffect)(()=>{c.current?.updateOptions?.({readOnly:r})},[r]),(0,M.useEffect)(()=>{let e=l.current,t=c.current;if(!e||!t)return;let r=t.getModel?.();r&&e.editor.setModelLanguage(r,n)},[n]),(0,M.useEffect)(()=>{let e=l.current;if(!e)return;let t=Ce(e,o);e.editor.setTheme(t)},[o]),u?(0,Y.jsxs)(`div`,{className:`w-full h-full flex flex-col items-center justify-center gap-2 text-sm text-muted-foreground`,"data-testid":`monaco-load-error`,children:[(0,Y.jsx)(`span`,{children:a(`monaco.loadFailed`)}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`rounded-md bg-accent-primary/15 px-3 py-1 text-xs text-accent-primary hover:bg-accent-primary/25`,children:a(`monaco.reload`)})]}):(0,Y.jsx)(`div`,{ref:s,className:`w-full h-full`,"data-testid":`monaco-host`})}var Ee=(0,M.lazy)(async()=>({default:Te}));function De({content:e,language:t,readOnly:n=!0,onChange:r}){let{t:i}=v(`code`);return(0,Y.jsx)(M.Suspense,{fallback:(0,Y.jsx)(`div`,{className:`w-full h-full flex items-center justify-center text-sm text-muted-foreground animate-pulse`,children:i(`monaco.loadingEditor`)}),children:(0,Y.jsx)(Ee,{content:e,language:t,readOnly:n,onChange:r})})}function Oe(e,t){if(!e)return null;let n=Date.parse(e);if(Number.isNaN(n))return null;let r=Math.round((n-Date.now())/1e3),i=new Intl.RelativeTimeFormat(t,{numeric:`auto`}),a=Math.abs(r);return a<60?i.format(r,`second`):a<3600?i.format(Math.round(r/60),`minute`):a<86400?i.format(Math.round(r/3600),`hour`):i.format(Math.round(r/86400),`day`)}function ke({path:e,summary:t,stale:n,regenerating:r,generateDisabledReason:a,onCollapse:o}){let{t:s,i18n:c}=v(`code`),{openTicketDetail:l}=C();if(!t)return(0,Y.jsx)(`div`,{className:`border-b border-border px-4 py-3 bg-surface`,"data-testid":`summary-header-empty`,children:(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:e}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a?s(`summary.unavailable`,{reason:a}):s(`summary.empty`)})]}),o&&(0,Y.jsxs)(`button`,{type:`button`,onClick:o,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,Y.jsx)(i,{className:`h-3.5 w-3.5`}),s(`summary.hide`)]})]})});let u=Oe(t.generatedAt,c.language),d=t.triggeredBy?.ticketId,f=t.triggeredBy?.modifiedTicketIds??[];return(0,Y.jsx)(`div`,{className:`border-b border-border px-4 py-3 bg-surface`,"data-testid":`summary-header`,children:(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:e}),n&&(0,Y.jsx)(`span`,{className:O(`text-[10px] px-1.5 py-0.5 rounded bg-accent-warning/20 text-accent-warning font-medium`),"data-testid":`summary-stale-badge`,children:s(`summary.stale`)}),r&&(0,Y.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent-primary animate-pulse`,"aria-hidden":!0})]}),(0,Y.jsx)(`p`,{className:`text-sm text-foreground mt-1`,children:t.summary}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 flex-wrap`,children:[typeof d==`number`&&(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>l(d),className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success`,children:[`#`,d]}),f.map(e=>(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>l(e),className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info`,children:[`#`,e]},e)),u&&(0,Y.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:u})]})]}),o&&(0,Y.jsxs)(`button`,{type:`button`,onClick:o,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,Y.jsx)(i,{className:`h-3.5 w-3.5`}),s(`summary.hide`)]})]})})}function Ae({content:e}){return(0,Y.jsx)(f,{remarkPlugins:[y],children:e})}function je(e,t){return t===`markdown`||t===`md`?!0:/\.(md|mdx|markdown)$/i.test(e)}var Me=180,Ne=120,Pe=240;function Fe(e){return e?`specrails-desktop:code-summary-collapsed:${e}`:null}function Ie(e){return e?`specrails-desktop:code-history-height:${e}`:null}function Le(e){return e?`specrails-desktop:code-history-collapsed:${e}`:null}function Re(e){let t=Ie(e);if(!t)return Me;try{let e=localStorage.getItem(t),n=e?Number(e):NaN;return Number.isFinite(n)&&n>0?n:Me}catch{return Me}}function ze(e,t){let n=Ie(e);if(n)try{localStorage.setItem(n,String(Math.round(t)))}catch{}}function Be(e){let t=Fe(e);if(!t)return!1;try{return localStorage.getItem(t)===`true`}catch{return!1}}function Ve(e,t){let n=Fe(e);if(n)try{localStorage.setItem(n,t?`true`:`false`)}catch{}}function He(e){let t=Le(e);if(!t)return!1;try{return localStorage.getItem(t)===`true`}catch{return!1}}function Ue(e,t){let n=Le(e);if(n)try{localStorage.setItem(n,t?`true`:`false`)}catch{}}function We(e,t){let n=Math.max(Ne,t-Pe);return Math.min(Math.max(e,Ne),n)}function Ge({relPath:e,onFilterJob:t,onSummaryActionChange:n,onCopyPathActionChange:r}){let{t:a}=v(`code`),{activeProjectId:l}=c(),{openTicketDetail:d}=C(),{registerHandler:f,unregisterHandler:p}=u(),m=(0,M.useRef)(null),[h,_]=(0,M.useState)(null),[y,b]=(0,M.useState)(!0),[x,S]=(0,M.useState)(!1),[w,T]=(0,M.useState)(!1),[E,D]=(0,M.useState)(()=>Be(l)),[O,k]=(0,M.useState)(()=>Re(l)),[A,ee]=(0,M.useState)(()=>He(l)),j=(0,M.useRef)(l);(0,M.useEffect)(()=>{j.current=l},[l]);let N=(0,M.useRef)(e);(0,M.useEffect)(()=>{N.current=e},[e]),(0,M.useEffect)(()=>{let e=m.current?.clientHeight||window.innerHeight;D(Be(l)),k(We(Re(l),e)),ee(He(l))},[l]);let te=(0,M.useCallback)(e=>{let t=e.clientY,n=O,r=m.current?.clientHeight||window.innerHeight,i=e.currentTarget;try{i.setPointerCapture(e.pointerId)}catch{}function a(e){k(We(n+(t-e.clientY),r))}function o(){window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),k(e=>{let t=We(e,r);return ze(l,t),t})}window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,o)},[l,O]),P=(0,M.useCallback)(()=>{let e=We(Me,m.current?.clientHeight||window.innerHeight);k(e),ze(l,e)},[l]),F=(0,M.useCallback)(()=>{D(e=>{let t=!e;return Ve(l,t),t})},[l]),I=(0,M.useCallback)(()=>{ee(e=>{let t=!e;return Ue(l,t),t})},[l]);(0,M.useEffect)(()=>{S(!1),T(!1),H(`preview`),W(!1)},[e]);let L=(0,M.useRef)(0),R=(0,M.useCallback)(async()=>{let t=++L.current;b(!0);try{let n=await fetch(`${s()}/code/file?path=${encodeURIComponent(e)}`);if(t!==L.current)return;if(!n.ok){_(null);return}let r=await n.json();if(t!==L.current)return;_(r)}catch{t===L.current&&_(null)}finally{t===L.current&&b(!1)}},[e,l]);(0,M.useEffect)(()=>{R()},[R]),(0,M.useEffect)(()=>{if(!l)return;let e=`code-file-${l}`;return f(e,e=>{let t=e;t.projectId===j.current&&(t.type===`file.summary_updated`&&t.path===N.current?(S(!1),R()):t.type===`file.summary_failed`&&t.path===N.current?(g.error(t.reason??a(`summary.generationFailed`)),S(!1)):t.type===`file.summary_skipped`&&t.path===N.current&&(t.reason&&g(a(`summary.skipped`,{reason:t.reason})),S(!1)))}),()=>p(e)},[l,f,p,R,a]);let z=(0,M.useCallback)(async t=>{S(!0);try{let n=await fetch(`${s()}/code/file/regenerate-summary?path=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({overrideBudget:t})}),r=await n.json().catch(()=>({}));if(!n.ok){S(!1);let e=typeof r.skipped==`string`?r.skipped:null;g.error(e?a(`summary.skipped`,{reason:e}):a(`summary.generationFailed`));return}if(r.skipped===`budget`){S(!1),T(!0);return}if(r.skipped){S(!1),g(a(`summary.skipped`,{reason:r.skipped}));return}await R(),S(!1)}catch{S(!1),g.error(a(`summary.generationFailed`))}},[R,e,a]),B=(0,M.useCallback)(async()=>{let t=h?.absolutePath??e;try{await navigator.clipboard?.writeText(t),g.success(a(`viewer.pathCopied`))}catch{g.error(a(`viewer.copyPathFailed`))}},[h,e,a]),ne=(0,M.useMemo)(()=>je(e,h?.language),[e,h?.language]),[V,H]=(0,M.useState)(`preview`),[U,W]=(0,M.useState)(!1),[G,re]=(0,M.useState)(``),[K,ie]=(0,M.useState)(!1),ae=h?.content!==void 0&&!h.binary&&!h.tooLarge&&h.reason!==`not-found`,oe=(0,M.useCallback)(()=>{re(h?.content??``),H(`raw`),W(!0)},[h]),se=(0,M.useCallback)(async()=>{ie(!0);try{let t=await fetch(`${s()}/code/file`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({path:e,content:G})});if(!t.ok){let e=await t.json().catch(()=>({}));g.error(e.error??a(`viewer.saveFailed`));return}g.success(a(`viewer.saved`)),W(!1),R()}catch{g.error(a(`viewer.saveFailed`))}finally{ie(!1)}},[e,G,a,R]),q=h?.summary??null,ce=!!h?.summaryStale,J=h?.provenance??[],X=h?.reason===`not-found`,Z=X?a(`summary.reason.missing`):h?.binary?a(`summary.reason.binary`):h?.tooLarge?a(`summary.reason.tooLarge`):null;return(0,M.useEffect)(()=>{if(n){if(y&&!h){n(null);return}return n({hasSummary:!!q,regenerating:x,disabledReason:Z,onClick:()=>z(!1)}),()=>n(null)}},[h,z,y,n,x,q,Z]),(0,M.useEffect)(()=>{if(r){if(y&&!h){r(null);return}return r({onClick:B}),()=>r(null)}},[B,h,y,r]),y&&!h?(0,Y.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-sm text-muted-foreground animate-pulse`,children:a(`viewer.loadingFile`)}):(0,Y.jsxs)(`div`,{ref:m,className:`flex flex-col h-full`,"data-testid":`file-viewer`,children:[E?(0,Y.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b border-border bg-surface px-4`,"data-testid":`summary-header-collapsed`,children:[(0,Y.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e}),(0,Y.jsxs)(`button`,{type:`button`,onClick:F,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,Y.jsx)(o,{className:`h-3.5 w-3.5`}),a(`viewer.showSummary`)]})]}):(0,Y.jsx)(ke,{path:e,summary:q,stale:ce,regenerating:x,generateDisabledReason:Z,onCollapse:F}),(0,Y.jsxs)(`div`,{className:`px-4 py-1 border-b border-border flex items-center justify-between gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:ne&&h?.content!==void 0&&!h.binary&&!h.tooLarge&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px]`,role:`group`,"aria-label":a(`viewer.markdownViewMode`),children:[(0,Y.jsx)(`button`,{type:`button`,onClick:()=>H(`preview`),"aria-pressed":V===`preview`,className:V===`preview`?`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary`:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:a(`viewer.preview`)}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>H(`raw`),"aria-pressed":V===`raw`,className:V===`raw`?`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary`:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:a(`viewer.raw`)})]})}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] shrink-0`,children:[ae&&!U&&(0,Y.jsx)(`button`,{type:`button`,onClick:oe,className:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:a(`viewer.edit`)}),U&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`button`,{type:`button`,onClick:()=>W(!1),disabled:K,className:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 disabled:opacity-50`,children:a(`actions.cancel`,{ns:`common`})}),(0,Y.jsx)(`button`,{type:`button`,onClick:se,disabled:K,className:`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary hover:bg-accent-primary/30 disabled:opacity-50`,children:a(K?`viewer.saving`:`viewer.save`)})]})]})]}),(0,Y.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:X?(0,Y.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-missing`,children:a(`viewer.missingFile`)}):h?.binary?(0,Y.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-binary`,children:a(`viewer.binaryFile`)}):h?.tooLarge?(0,Y.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-too-large`,children:a(`viewer.tooLarge`,{size:Math.round((h.sizeBytes??0)/1024/1024)})}):h?.content===void 0?(0,Y.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,children:a(`viewer.noContent`)}):U?(0,Y.jsx)(De,{content:G,language:h.language??`plaintext`,readOnly:!1,onChange:re}):ne&&V===`preview`?(0,Y.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4 prose prose-invert prose-sm max-w-none prose-p:my-2 prose-headings:mt-4 prose-headings:mb-2 prose-pre:bg-muted/40 prose-pre:rounded-md prose-code:before:content-none prose-code:after:content-none`,"data-testid":`markdown-preview`,children:(0,Y.jsx)(Ae,{content:h.content})}):(0,Y.jsx)(De,{content:h.content,language:h.language??`plaintext`})}),J.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":a(`history.resize`),onPointerDown:A?void 0:te,onDoubleClick:A?void 0:P,className:A?`flex h-8 shrink-0 items-center justify-between border-t border-border bg-card/35 px-4`:`flex h-8 shrink-0 cursor-row-resize items-center justify-between border-y border-border/40 bg-card/35 px-4 hover:bg-accent-primary/10`,title:A?void 0:a(`resizer.hint`),"data-testid":`code-history-resizer`,children:[(0,Y.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:a(`history.title`,{count:J.length})}),(0,Y.jsxs)(`button`,{type:`button`,onPointerDown:e=>e.stopPropagation(),onClick:I,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[A?(0,Y.jsx)(i,{className:`h-3.5 w-3.5`}):(0,Y.jsx)(o,{className:`h-3.5 w-3.5`}),a(A?`history.show`:`history.hide`)]})]}),!A&&(0,Y.jsx)(Ke,{rows:J,onOpenTicket:d,onFilterJob:t,height:O})]}),w&&(0,Y.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,role:`dialog`,"aria-modal":`true`,"data-testid":`budget-prompt`,children:(0,Y.jsxs)(`div`,{className:`bg-card border border-border rounded-lg p-4 w-80 flex flex-col gap-3`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-foreground`,children:a(`viewer.budgetPrompt`)}),(0,Y.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Y.jsx)(`button`,{type:`button`,onClick:()=>T(!1),className:`text-xs px-3 py-1.5 rounded-md text-muted-foreground hover:text-foreground`,children:a(`common:actions.cancel`)}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>{T(!1),z(!0)},className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white`,children:a(`common:actions.confirm`)})]})]})})]})}function Ke({rows:e,onOpenTicket:t,onFilterJob:n,height:r}){let{t:i}=v(`code`),[a,o]=(0,M.useState)(null),[c,l]=(0,M.useState)({});if(e.length===0)return null;async function u(e,t){if(a===t){o(null);return}if(o(t),!(!e.jobId||c[t])){l(e=>({...e,[t]:`loading`}));try{let n=new URLSearchParams({jobId:e.jobId,path:e.path}),r=await fetch(`${s()}/code/diff?${n.toString()}`);if(r.status===404){l(e=>({...e,[t]:`missing`}));return}if(!r.ok)throw Error(`diff failed`);let i=await r.json();l(e=>({...e,[t]:{patch:i.patch??``,truncated:i.truncated===!0}}))}catch{l(e=>({...e,[t]:`missing`}))}}}return(0,Y.jsx)(`div`,{className:`shrink-0 border-t border-border bg-card/40 px-4 py-3 overflow-hidden`,style:{height:r},"data-testid":`file-provenance-timeline`,children:(0,Y.jsx)(`div`,{className:`h-full overflow-auto space-y-1`,children:e.map((e,r)=>{let o=e.kind===`created`?x:e.kind===`deleted`?p:S,s=e.jobId?e.jobId.length>12?e.jobId.slice(0,12):e.jobId:i(`history.unknownJob`),l=`${e.jobId??`job`}:${e.path}:${e.at}:${r}`,d=c[l];return(0,Y.jsxs)(`div`,{className:`rounded-md hover:bg-muted/40`,children:[(0,Y.jsxs)(`div`,{className:`grid grid-cols-[minmax(72px,auto)_minmax(0,1fr)_auto] items-center gap-2 text-xs px-2 py-1.5`,children:[(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 min-w-0`,children:[(0,Y.jsx)(o,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,Y.jsx)(`span`,{className:`capitalize`,children:i(`kind.${e.kind}`)})]}),(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 min-w-0 text-muted-foreground`,children:[(0,Y.jsx)(_,{className:`h-3.5 w-3.5 shrink-0`}),e.jobId&&n?(0,Y.jsx)(`button`,{type:`button`,onClick:()=>n(e.jobId),className:`font-mono truncate hover:text-foreground`,title:i(`history.filterByJob`,{jobId:e.jobId}),children:s}):(0,Y.jsx)(`span`,{className:`font-mono truncate`,title:e.jobId??void 0,children:s}),e.jobId&&(0,Y.jsx)(`button`,{type:`button`,onClick:()=>u(e,l),className:`shrink-0 rounded bg-muted/60 px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,children:i(`history.diff`)}),typeof e.ticketId==`number`&&(0,Y.jsx)(`button`,{type:`button`,onClick:()=>t(e.ticketId),className:`shrink-0 rounded bg-accent-primary/15 px-1.5 py-0.5 text-[10px] text-accent-primary hover:bg-accent-primary/25`,title:i(`history.openSpec`,{ticketId:e.ticketId}),children:i(`history.specChip`,{ticketId:e.ticketId})})]}),(0,Y.jsx)(`time`,{className:`text-[11px] text-muted-foreground`,dateTime:new Date(e.at).toISOString(),children:new Date(e.at).toLocaleString()})]}),a===l&&(0,Y.jsx)(`div`,{className:`px-2 pb-2`,children:d===`loading`?(0,Y.jsx)(`div`,{className:`rounded-md bg-muted/35 px-2 py-2 text-[11px] text-muted-foreground`,children:i(`history.loadingDiff`)}):d===`missing`||!d?(0,Y.jsx)(`div`,{className:`rounded-md bg-muted/35 px-2 py-2 text-[11px] text-muted-foreground`,children:i(`history.diffUnavailable`)}):(0,Y.jsxs)(`pre`,{className:`max-h-72 overflow-auto rounded-md bg-muted/50 px-2 py-2 font-mono text-[11px] leading-relaxed text-foreground/85`,children:[d.patch,d.truncated?`\n${i(`history.diffTruncated`)}`:``]})})]},l)})})})}var qe=320,Je=240,Ye=520;function Xe(e){return e?`specrails-desktop:code-tree-width:${e}`:null}function Ze(e){let t=Xe(e);if(!t)return qe;try{let e=localStorage.getItem(t),n=e?Number(e):NaN;return Number.isFinite(n)&&n>0?n:qe}catch{return qe}}function Qe(e,t){let n=Xe(e);if(n)try{localStorage.setItem(n,String(Math.round(t)))}catch{}}function $(e,t){let n=Math.max(Je,t-Ye);return Math.min(Math.max(e,Je),n)}function $e(){let{t:e}=v(`code`),{activeProjectId:t}=c(),[n]=T(),r=b(),i=(0,M.useRef)(null),[a,o]=(0,M.useState)(n.get(`path`)),[s,l]=(0,M.useState)(null),[u,d]=(0,M.useState)(null),[f,p]=(0,M.useState)(()=>Ze(t)),m=n.get(`jobId`),h=(0,M.useMemo)(()=>{let e=n.get(`ticketId`);if(!e)return null;let t=Number(e);return Number.isInteger(t)&&t>0?t:null},[n]),[g,_]=(0,M.useState)(h==null?``:String(h));(0,M.useEffect)(()=>{let e=n.get(`path`);e!==a&&o(e)},[n]),(0,M.useEffect)(()=>{_(h==null?``:String(h))},[h]),(0,M.useEffect)(()=>{let e=i.current?.clientWidth||window.innerWidth;p($(Ze(t),e))},[t]),(0,M.useEffect)(()=>{let e=i.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(e=>{let t=e[0]?.contentRect.width;typeof t==`number`&&p(e=>$(e,t))});return t.observe(e),()=>t.disconnect()},[]);let y=(0,M.useCallback)(e=>{let n=e.clientX,r=f,a=i.current?.clientWidth||window.innerWidth,o=e.currentTarget;try{o.setPointerCapture(e.pointerId)}catch{}function s(e){p($(r+(e.clientX-n),a))}function c(){window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),p(e=>{let n=$(e,a);return Qe(t,n),n})}window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)},[t,f]),x=(0,M.useCallback)(()=>{let e=$(qe,i.current?.clientWidth||window.innerWidth);p(e),Qe(t,e)},[t]),S=(0,M.useCallback)(e=>{o(e);let t=new URLSearchParams(n);t.set(`path`,e),r({pathname:`/code`,search:`?${t.toString()}`},{replace:!0})},[r,n]),C=(0,M.useCallback)(e=>{let t=new URLSearchParams(n);t.set(`jobId`,e),t.delete(`ticketId`),r({pathname:`/code`,search:`?${t.toString()}`},{replace:!0})},[r,n]),w=(0,M.useCallback)(()=>{let e=new URLSearchParams(n);e.delete(`jobId`),e.delete(`ticketId`),r({pathname:`/code`,search:e.toString()?`?${e.toString()}`:``},{replace:!0})},[r,n]),E=(0,M.useCallback)(e=>{let t=Number(e.trim());if(!Number.isInteger(t)||t<=0){w();return}let i=new URLSearchParams(n);i.set(`ticketId`,String(t)),i.delete(`jobId`),r({pathname:`/code`,search:`?${i.toString()}`},{replace:!0})},[w,r,n]);return(0,Y.jsxs)(`div`,{ref:i,className:`flex h-full w-full`,"data-testid":`code-page`,children:[(0,Y.jsx)(`aside`,{className:`overflow-hidden flex flex-col shrink-0`,style:{width:f},children:(0,Y.jsx)(me,{onOpenFile:S,selectedPath:a,filterJobId:m,filterTicketId:h},t??`no-project`)}),(0,Y.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":e(`page.resizeFileTree`),onPointerDown:y,onDoubleClick:x,className:`relative w-1.5 shrink-0 cursor-col-resize select-none touch-none border-x border-border/40 hover:bg-accent-primary/20 focus-visible:outline-none focus-visible:bg-accent-primary/30`,title:e(`resizer.hint`),"data-testid":`code-tree-resizer`}),(0,Y.jsxs)(`main`,{className:`flex-1 overflow-hidden flex flex-col`,children:[(0,Y.jsx)(et,{jobId:m,ticketId:h,ticketInput:g,onTicketInputChange:_,onApplyTicket:E,onClear:w,summaryAction:s,copyPathAction:u}),(m||h)&&(0,Y.jsx)(tt,{jobId:m,ticketId:h,onOpenFile:S}),a?(0,Y.jsx)(Ge,{relPath:a,onFilterJob:C,onSummaryActionChange:l,onCopyPathActionChange:d}):(0,Y.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,children:e(`page.selectFile`)})]})]})}function et({jobId:e,ticketId:t,ticketInput:r,onTicketInputChange:i,onApplyTicket:a,onClear:o,summaryAction:s,copyPathAction:c}){let{t:u}=v(`code`),d=t?`spec`:e?`job-context`:`all`;return(0,Y.jsx)(`div`,{className:`border-b border-border bg-background/80 px-4 py-2`,"data-testid":`code-provenance-toolbar`,children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,Y.jsx)(j,{className:`h-3.5 w-3.5`}),u(`toolbar.scope`)]}),(0,Y.jsx)(`button`,{type:`button`,onClick:o,"aria-pressed":d===`all`,className:d===`all`?`rounded-md bg-accent-primary/20 px-2 py-1 text-xs text-accent-primary`:`rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:u(`toolbar.allAi`)}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border/70 bg-card/40 px-1 py-1`,children:[(0,Y.jsx)(`button`,{type:`button`,onClick:()=>a(r),"aria-pressed":d===`spec`,className:d===`spec`?`rounded bg-accent-success/20 px-2 py-0.5 text-xs text-accent-success`:`rounded px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:u(`toolbar.spec`)}),(0,Y.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&a(r)},placeholder:u(`toolbar.ticketIdPlaceholder`),inputMode:`numeric`,className:`h-6 w-20 bg-transparent px-1 font-mono text-xs outline-none placeholder:text-muted-foreground/60`})]}),(0,Y.jsx)(`div`,{className:`flex-1`}),c&&(0,Y.jsx)(`button`,{type:`button`,onClick:c.onClick,className:`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:u(`toolbar.copyFilePath`)}),s&&(0,Y.jsxs)(`button`,{type:`button`,onClick:s.onClick,disabled:s.regenerating||!!s.disabledReason,"aria-label":s.hasSummary?u(`toolbar.regenerateSummary`):u(`toolbar.generateSummary`),className:`inline-flex items-center gap-1.5 rounded-md bg-accent-primary/15 px-2.5 py-1 text-xs text-accent-primary hover:bg-accent-primary/25 disabled:opacity-50`,title:s.disabledReason?u(`toolbar.summaryUnavailable`,{reason:s.disabledReason}):void 0,children:[(0,Y.jsx)(n,{className:s.regenerating?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),s.hasSummary?s.regenerating?u(`toolbar.regenerating`):u(`toolbar.regenerateSummary`):s.regenerating?u(`toolbar.generating`):u(`toolbar.generateSummary`)]}),d===`job-context`&&(0,Y.jsx)(`span`,{className:`rounded-md bg-accent-info/15 px-2 py-1 text-xs text-accent-info`,children:u(`toolbar.jobContext`)}),(e||t)&&(0,Y.jsxs)(`button`,{type:`button`,onClick:o,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,Y.jsx)(l,{className:`h-3.5 w-3.5`}),u(`toolbar.clear`)]})]})})}function tt({jobId:e,ticketId:t,onOpenFile:n}){let{t:r}=v(`code`),[i,a]=(0,M.useState)(null);(0,M.useEffect)(()=>{let n=!1,r=new URLSearchParams;return e&&r.set(`jobId`,e),t&&r.set(`ticketId`,String(t)),fetch(`${s()}/code/provenance?${r.toString()}`).then(e=>e.ok?e.json():[]).then(e=>{n||a(Array.isArray(e)?e:[])}).catch(()=>{n||a([])}),()=>{n=!0}},[e,t]);let o=(0,M.useMemo)(()=>{let e=i??[];return{created:e.filter(e=>e.kind===`created`),modified:e.filter(e=>e.kind===`modified`),deleted:e.filter(e=>e.kind===`deleted`)}},[i]),c=i?.length??0;return(0,Y.jsx)(`section`,{className:`border-b border-border bg-card/35 px-4 py-3`,"data-testid":`provenance-result-panel`,children:(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`h2`,{className:`text-sm font-semibold truncate`,children:e?r(`provenancePanel.jobTitle`,{jobId:e}):r(`provenancePanel.specTitle`,{ticketId:t})}),(0,Y.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:r(`provenancePanel.touchedFiles`,{count:c})})]}),(0,Y.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,Y.jsx)(nt,{label:r(`action.added`),rows:o.created,icon:`created`,onOpenFile:n}),(0,Y.jsx)(nt,{label:r(`action.changed`),rows:o.modified,icon:`modified`,onOpenFile:n}),(0,Y.jsx)(nt,{label:r(`action.deleted`),rows:o.deleted,icon:`deleted`,onOpenFile:n})]})]}),(0,Y.jsx)(`div`,{className:`flex items-center gap-1 shrink-0`,children:e&&(0,Y.jsxs)(`a`,{href:`/jobs/${encodeURIComponent(e)}`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,Y.jsx)(E,{className:`h-3.5 w-3.5`}),r(`provenancePanel.log`)]})})]})})}function nt({label:e,rows:t,icon:n,onOpenFile:r}){return(0,Y.jsxs)(`details`,{className:`group min-w-[180px] max-w-[320px]`,children:[(0,Y.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1.5 rounded-md bg-muted/35 px-2 py-1 text-xs hover:bg-muted/55`,children:[(0,Y.jsx)(n===`created`?x:n===`deleted`?p:S,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,Y.jsx)(`span`,{children:e}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:t.length})]}),t.length>0&&(0,Y.jsx)(`div`,{className:`mt-1 max-h-28 overflow-auto rounded-md border border-border/60 bg-background/60 p-1`,children:t.map((e,t)=>(0,Y.jsx)(`button`,{type:`button`,onClick:()=>r(e.path),className:`block w-full truncate rounded px-1.5 py-1 text-left font-mono text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,title:e.path,children:e.path},`${e.path}-${e.jobId??`job`}-${e.at}-${t}`))})]})}export{$e as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{A as t,Ct as n,D as r,Lt as i,N as a,O as o,P as s,Qt as c,R as l,Rt as u,U as d,W as f,Xt as p,Zt as m,bn as h,ct as g,dn as _,fn as v,it as y,k as b,mn as x,nt as S,t as C,wt as w,yt as T,zt as E}from"./index-CEunZ8kJ.js";var D=e(h(),1),O=m(),k=[`todo`,`in_progress`,`done`,`cancelled`],A={todo:`todo`,in_progress:`inProgress`,done:`done`,cancelled:`cancelled`};function j({state:e,onChanged:t}){let{t:n}=v(`jira`),i=e.connection,[a,o]=(0,D.useState)(i.enabled),[s,c]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),[f,p]=(0,D.useState)([]),[m,h]=(0,D.useState)([]),[g,y]=(0,D.useState)(i.discardStatus??``),[b,x]=(0,D.useState)(i.statusMap??{}),S=e.outbox??{pending:0,inflight:0,done:0,dead:0},C=(0,D.useCallback)(async()=>{try{let{ops:e}=await r.listOutbox(`dead`);p(e)}catch{p([])}},[]);(0,D.useEffect)(()=>{C()},[C]),(0,D.useEffect)(()=>{let e=!1;return r.listStatuses().then(({statuses:t})=>{e||h(t)}).catch(()=>{e||h([])}),()=>{e=!0}},[]);async function w(e){let i=g;y(e);try{await r.patchConnection({discardStatus:e||null}),t()}catch(e){y(i),_.error(N(e,n))}}async function T(e,i){let a=b,o={...b,[e]:i||void 0};x(o);let s=Object.fromEntries(Object.entries(o).filter(([,e])=>e));try{await r.patchConnection({statusMap:Object.keys(s).length?s:null}),t()}catch(e){x(a),_.error(N(e,n))}}async function E(){let e=!a;o(e),d(!0);try{await r.setEnabled(e)}catch(t){o(!e),_.error(N(t,n))}finally{d(!1)}}async function j(){c(!0);try{let e=await r.syncNow();_.success(n(`status.syncedToast`,{count:e.upserted}))}catch(e){_.error(N(e,n))}finally{c(!1)}}async function P(){if(window.confirm(n(`status.disconnectConfirm`))){d(!0);try{await r.disconnect(),_.success(n(`status.disconnectedToast`)),t()}catch(e){_.error(N(e,n))}finally{d(!1)}}}async function F(e){try{await r.retryOutbox(e),await C()}catch(e){_.error(N(e,n))}}let I=S.pending+S.inflight;return(0,O.jsxs)(`div`,{className:`space-y-4`,"data-testid":`jira-connected`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:n(`status.connected`,{key:i.jiraProjectKey})}),(0,O.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i.baseUrl,` · `,i.deployment===`cloud`?n(`review.cloud`):n(`review.dc`)]})]}),(0,O.jsx)(`a`,{href:`${i.baseUrl}/browse/${i.jiraProjectKey}`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-accent-primary hover:underline`,children:n(`badge.openInJira`)})]}),(0,O.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border p-3`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:n(`status.enabledLabel`)}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(a?`status.enabledHelp`:`status.pausedHelp`)})]}),(0,O.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":a,"aria-label":n(`status.enabledLabel`),disabled:u,onClick:E,className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${a?`bg-accent-success`:`bg-input`}`,children:(0,O.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-background shadow-sm transition-transform ${a?`translate-x-4`:`translate-x-0.5`}`})})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-status-map`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:n(`wizard.step3Title`)}),(0,O.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:n(`mapping.intro`)}),(0,O.jsx)(`div`,{className:`space-y-2`,children:k.map(e=>(0,O.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`mapping.${A[e]}`)}),(0,O.jsxs)(`select`,{value:b[e]??``,onChange:t=>void T(e,t.target.value),className:`w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-statusmap-${e}`,children:[(0,O.jsx)(`option`,{value:``,children:n(`mapping.auto`)}),m.map(e=>(0,O.jsx)(`option`,{value:e.name,children:e.name},e.id)),b[e]&&!m.some(t=>t.name===b[e])&&(0,O.jsx)(`option`,{value:b[e],children:b[e]})]})]},e))})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:n(`discard.configLabel`)}),(0,O.jsx)(`p`,{className:`mt-0.5 mb-2 text-xs text-muted-foreground`,children:n(`discard.configHelp`)}),(0,O.jsxs)(`select`,{value:g,onChange:e=>void w(e.target.value),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm`,"data-testid":`jira-discard-status-select`,children:[(0,O.jsx)(`option`,{value:``,children:n(`discard.configNone`)}),m.map(e=>(0,O.jsx)(`option`,{value:e.name,children:e.name},e.id)),g&&!m.some(e=>e.name===g)&&(0,O.jsx)(`option`,{value:g,children:g})]})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(l,{variant:`outline`,size:`sm`,onClick:j,disabled:s,children:n(s?`status.syncing`:`status.syncNow`)}),(0,O.jsx)(l,{variant:`ghost`,size:`sm`,onClick:P,disabled:u,className:`text-destructive`,children:n(`status.disconnect`)})]}),(0,O.jsxs)(`div`,{className:`rounded-md border border-border p-3`,"data-testid":`jira-outbox`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:n(`outbox.title`)}),S.dead>0?(0,O.jsx)(`p`,{className:`mt-1 text-xs text-accent-warning`,children:n(`outbox.dead`,{count:S.dead})}):I>0?(0,O.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n(`outbox.pending`,{count:I})}):(0,O.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n(`outbox.allSynced`)}),f.length>0&&(0,O.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`outbox.deadHelp`)}),f.map(e=>(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded border border-border/60 px-2 py-1`,children:[(0,O.jsxs)(`span`,{className:`truncate text-xs`,children:[M(e,n),` · `,e.deadReason??e.lastError??``]}),(0,O.jsx)(l,{variant:`outline`,size:`sm`,onClick:()=>F(e.id),children:n(`outbox.retry`)})]},e.id))]})]})]})}function M(e,t){return e.opType===`transition`?t(`outbox.opTransition`):e.opType===`comment`?t(`outbox.opComment`):t(`outbox.opCreate`)}function N(e,t){return e instanceof Error?e.message:t(`errors.generic`)}function P({activeProjectId:e}){let{t:n}=v(`integrations`),[i,c]=(0,D.useState)(null),[l,u]=(0,D.useState)(!0),[d,f]=(0,D.useState)(!1),[p,m]=(0,D.useState)(!1),h=(0,D.useCallback)(async()=>{try{c(await r.getConnection())}catch{c({connected:!1})}finally{u(!1)}},[]);if((0,D.useEffect)(()=>{!o||!e||(u(!0),h())},[e,h]),!o)return null;let g=!!(i?.connected&&i.connection);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 flex flex-col gap-3 h-full`,"data-testid":`jira-integration-card`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,O.jsx)(`div`,{className:`grid place-items-center w-9 h-9 rounded-md bg-accent-info/15 text-accent-info shrink-0`,children:(0,O.jsx)(y,{className:`w-4 h-4`})}),(0,O.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`jiraCard.title`)}),g&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success flex items-center gap-1`,"data-testid":`jira-connected-badge`,children:[(0,O.jsx)(w,{className:`w-3 h-3`}),` `,n(`jiraCard.connected`)]})]}),(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:n(`jiraCard.category`)})]})]}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:g&&i?.connection?n(`jiraCard.connectedDescription`,{key:i.connection.jiraProjectKey}):n(`jiraCard.description`)}),(0,O.jsxs)(`ul`,{className:`text-xs space-y-1 list-disc pl-4 text-foreground/80`,children:[(0,O.jsx)(`li`,{children:n(`jiraCard.bullet1`)}),(0,O.jsx)(`li`,{children:n(`jiraCard.bullet2`)}),(0,O.jsx)(`li`,{children:n(`jiraCard.bullet3`)})]}),(0,O.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:n(`jiraCard.requires`)}),(0,O.jsx)(`div`,{className:`mt-auto pt-2 flex items-center justify-end gap-2`,children:l?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`…`}):g?(0,O.jsx)(`button`,{type:`button`,onClick:()=>m(!0),"data-testid":`jira-manage-btn`,className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-muted/30 inline-flex items-center gap-1.5`,children:n(`jiraCard.manage`)}):(0,O.jsxs)(`button`,{type:`button`,onClick:()=>f(!0),"data-testid":`jira-connect-btn`,className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white hover:opacity-90 inline-flex items-center gap-1.5`,children:[(0,O.jsx)(y,{className:`w-3.5 h-3.5`}),n(`jiraCard.connect`)]})}),(0,O.jsx)(b,{open:d,onOpenChange:f,children:(0,O.jsxs)(t,{className:`max-w-lg`,children:[(0,O.jsx)(a,{children:(0,O.jsx)(s,{children:n(`jiraCard.modalTitle`)})}),(0,O.jsx)(C,{onConnected:()=>{f(!1),h()},onSkip:()=>f(!1)})]})}),(0,O.jsx)(b,{open:p,onOpenChange:m,children:(0,O.jsxs)(t,{className:`max-w-lg`,children:[(0,O.jsx)(a,{children:(0,O.jsx)(s,{children:n(`jiraCard.manageTitle`)})}),i?.connected&&i.connection&&(0,O.jsx)(j,{state:i,onChanged:()=>{h().then(()=>m(!1))}})]})})]})}function F(){let{t:e}=v(`integrations`),{activeProjectId:t,projects:n}=u(),r=n.find(e=>e.id===t),a=r?i(r).includes(`claude`):!0,{registerHandler:s,unregisterHandler:l}=p(),f=(0,D.useRef)(t);(0,D.useEffect)(()=>{f.current=t},[t]);let[m,h]=(0,D.useState)(null),[g,_]=(0,D.useState)(null),{data:y,isLoading:b,isFirstLoad:x,refresh:C}=E({namespace:`plugins`,projectId:t,initialValue:[],fetcher:(0,D.useCallback)(async()=>{let e=await fetch(`${c()}/plugins`);if(!e.ok)throw Error(`HTTP ${e.status}`);return(await e.json()).plugins??[]},[])});(0,D.useEffect)(()=>(s(`integrations-page`,e=>{let t=e;t.type&&(t.projectId&&t.projectId!==f.current||t.type.startsWith(`plugin.`)&&C())}),()=>l(`integrations-page`)),[s,l,C]),(0,D.useEffect)(()=>{h(!b&&!y?`Failed to load plugins`:null)},[b,y]);let w=(0,D.useMemo)(()=>(y??[]).filter(e=>e.status!==`orphan`),[y]),T=(0,D.useMemo)(()=>(y??[]).filter(e=>e.status===`orphan`),[y]);return t?(0,O.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,O.jsxs)(`div`,{className:`flex-shrink-0 border-b border-border px-6 pt-4 pb-3 flex items-center gap-2`,children:[(0,O.jsx)(S,{className:`w-4 h-4 text-accent-primary`}),(0,O.jsxs)(`div`,{className:`flex-1`,children:[(0,O.jsx)(`h1`,{className:`text-lg font-semibold`,children:e(`page.title`)}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`page.subtitle`)})]})]}),(0,O.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:x&&b?(0,O.jsx)(G,{}):m&&a?(0,O.jsx)(K,{onRetry:C}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:[(0,O.jsx)(P,{activeProjectId:t}),a&&w.map(e=>(0,O.jsx)(I,{plugin:e,isInstalling:g===e.name,onInstall:()=>_(e.name),onCloseInstall:()=>{_(null),C()}},e.name))]}),a&&T.length>0&&(0,O.jsxs)(`div`,{className:`mt-10`,children:[(0,O.jsxs)(`h2`,{className:`text-sm font-semibold text-muted-foreground mb-3 flex items-center gap-2`,children:[(0,O.jsx)(d,{className:`w-3.5 h-3.5`}),` `,e(`page.deprecated`)]}),(0,O.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:T.map(e=>(0,O.jsx)(V,{plugin:e,onRemoved:C},e.name))})]}),!o&&(!a||w.length===0)&&(0,O.jsx)(q,{})]})})]}):(0,O.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full text-muted-foreground text-sm`,children:e(`page.selectProject`)})}function I({plugin:e,isInstalling:t,onInstall:r,onCloseInstall:i}){let{t:a}=v(`integrations`),[o,s]=(0,D.useState)(!1);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 flex flex-col gap-3 h-full`,children:[(0,O.jsx)(`div`,{className:`flex items-start gap-2`,children:(0,O.jsxs)(`div`,{className:`flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:[`v`,e.version]}),e.status===`installed`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success flex items-center gap-1`,children:[(0,O.jsx)(w,{className:`w-3 h-3`}),` `,a(`card.statusActive`)]}),e.status===`deactivated`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground flex items-center gap-1`,children:[(0,O.jsx)(n,{className:`w-3 h-3`}),` `,a(`card.statusDeactivated`)]}),e.status===`degraded`&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-warning/20 text-accent-warning flex items-center gap-1`,children:[(0,O.jsx)(d,{className:`w-3 h-3`}),` `,a(`card.statusDegraded`)]}),e.updateAvailable&&(0,O.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/20 text-accent-info flex items-center gap-1`,children:[(0,O.jsx)(T,{className:`w-3 h-3`}),` `,a(`card.updateAvailable`)]})]}),e.category&&(0,O.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:e.category})]})}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:e.description}),e.whatItDoes.length>0&&(0,O.jsx)(`ul`,{className:`text-xs space-y-1 list-disc pl-4 text-foreground/80`,children:e.whatItDoes.map((e,t)=>(0,O.jsx)(`li`,{children:e},t))}),e.requirements.length>0&&(0,O.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:a(`card.requires`,{list:e.requirements.map(e=>`${e.name}${e.minVersion?` ≥ ${e.minVersion}`:``}`).join(`, `)})}),e.healthReason&&e.status===`degraded`&&(0,O.jsx)(`div`,{className:`text-[11px] text-accent-warning`,children:e.healthReason}),e.status===`deactivated`&&(0,O.jsx)(`div`,{className:`text-[11px] text-muted-foreground leading-relaxed`,children:(0,O.jsx)(x,{t:a,i18nKey:`card.deactivatedHint`,components:{strong:(0,O.jsx)(`strong`,{})}})}),e.marketplaceConflicts&&e.marketplaceConflicts.length>0&&(0,O.jsx)(B,{pluginName:e.name,conflicts:e.marketplaceConflicts}),e.marketplaceCachedButDisabled&&e.marketplaceCachedButDisabled.length>0&&(0,O.jsx)(R,{keys:e.marketplaceCachedButDisabled}),e.updateAvailable&&(0,O.jsx)(z,{pluginName:e.name}),(0,O.jsx)(`div`,{className:`mt-auto pt-2 flex items-center justify-end gap-2`,children:e.status===`not-installed`?(0,O.jsx)(`button`,{type:`button`,onClick:r,className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white hover:opacity-90`,children:a(`card.install`)}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(L,{pluginName:e.name,active:e.status===`installed`}),(0,O.jsxs)(`button`,{type:`button`,onClick:()=>s(!0),className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-destructive/10 hover:text-destructive flex items-center gap-1.5`,children:[(0,O.jsx)(f,{className:`w-3 h-3`}),` `,a(`card.uninstall`)]})]})}),t&&(0,O.jsx)(H,{pluginName:e.name,onClose:i}),o&&(0,O.jsx)(U,{pluginName:e.name,onClose:()=>s(!1),onUninstalled:()=>{s(!1)}})]})}function L({pluginName:e,active:t}){let{t:n}=v(`integrations`),[r,i]=(0,D.useState)(!1),[a,o]=(0,D.useState)(null);return(0,O.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,O.jsx)(`button`,{type:`button`,disabled:r,onClick:async()=>{i(!0),o(null);try{let n=`${c()}/plugins/${e}/${t?`deactivate`:`activate`}`,r=await fetch(n,{method:`POST`});if(!r.ok)throw Error((await r.json()).error??`HTTP ${r.status}`)}catch(e){o(e.message)}finally{i(!1)}},role:`switch`,"aria-checked":t,className:`relative inline-flex items-center h-5 w-9 rounded-full transition-colors disabled:opacity-50 ${t?`bg-accent-success`:`bg-muted`}`,title:n(t?`toggle.titleActive`:`toggle.titleDeactivated`),children:(0,O.jsx)(`span`,{className:`inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${t?`translate-x-4`:`translate-x-0.5`}`})}),(0,O.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:n(t?`card.statusActive`:`common:states.off`)}),a&&(0,O.jsx)(`span`,{className:`text-[10px] text-destructive`,children:a})]})}function R({keys:e}){let{t}=v(`integrations`);return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-2 leading-relaxed space-y-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(d,{className:`w-3 h-3 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t,i18nKey:`cachedNotice.body`,components:{strong:(0,O.jsx)(`strong`,{}),code:(0,O.jsx)(`code`,{className:`bg-muted px-1 rounded`})}})})]}),(0,O.jsx)(`div`,{className:`pl-5 space-y-0.5`,children:e.map(e=>(0,O.jsxs)(`pre`,{className:`text-[10px] bg-muted/40 rounded px-1.5 py-0.5 inline-block font-mono`,children:[`/plugin uninstall `,e]},e))}),(0,O.jsx)(`div`,{className:`pl-5 text-[10px] text-muted-foreground`,children:t(`cachedNotice.runInstruction`)})]})}function z({pluginName:e}){let{t}=v(`integrations`),[n,r]=(0,D.useState)(!1),[i,a]=(0,D.useState)(null);return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-accent-info/30 bg-accent-info/5 p-2 leading-relaxed space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(T,{className:`w-3 h-3 text-accent-info mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t,i18nKey:`update.body`,components:{code:(0,O.jsx)(`code`,{className:`bg-muted px-1 rounded`})}})})]}),(0,O.jsxs)(`button`,{type:`button`,disabled:n,onClick:async()=>{r(!0),a(null);try{let t=await fetch(`${c()}/plugins/${e}/update`,{method:`POST`});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`)}catch(e){a(e.message)}finally{r(!1)}},className:`text-[10px] px-2 py-0.5 rounded border border-accent-info/40 hover:bg-accent-info/10 disabled:opacity-50 flex items-center gap-1`,children:[n&&(0,O.jsx)(g,{className:`w-2.5 h-2.5 animate-spin`}),(0,O.jsx)(x,{t,i18nKey:`update.button`,components:{code:(0,O.jsx)(`code`,{})}})]}),i&&(0,O.jsx)(`div`,{className:`text-destructive text-[10px]`,children:i})]})}function B({pluginName:e,conflicts:t}){let{t:n}=v(`integrations`),[r,i]=(0,D.useState)(null),[a,o]=(0,D.useState)(null),s=async e=>{i(e),o(null);try{let t=await fetch(`${c()}/plugins/_marketplace/disable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({key:e})});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`)}catch(e){o(e.message)}finally{i(null)}};return(0,O.jsxs)(`div`,{className:`text-[11px] rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-2 leading-relaxed space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,O.jsx)(d,{className:`w-3 h-3 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(x,{t:n,i18nKey:`conflict.body`,values:{name:e},components:{strong:(0,O.jsx)(`strong`,{})}})})]}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1.5 pt-1`,children:t.map(e=>(0,O.jsxs)(`button`,{type:`button`,disabled:r===e,onClick:()=>s(e),className:`text-[10px] px-2 py-0.5 rounded border border-yellow-500/40 aurora-light:border-accent-warning/40 hover:bg-yellow-500/10 aurora-light:hover:bg-accent-warning/10 disabled:opacity-50 flex items-center gap-1`,children:[r===e&&(0,O.jsx)(g,{className:`w-2.5 h-2.5 animate-spin`}),(0,O.jsx)(x,{t:n,i18nKey:`conflict.disableButton`,values:{key:e},components:{code:(0,O.jsx)(`code`,{})}})]},e))}),a&&(0,O.jsx)(`div`,{className:`text-destructive`,children:a})]})}function V({plugin:e,onRemoved:t}){let{t:n}=v(`integrations`),[r,i]=(0,D.useState)(!1);return(0,O.jsxs)(`div`,{className:`rounded-lg border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 p-4 flex flex-col gap-3`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),(0,O.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-yellow-500/20 aurora-light:bg-accent-warning/15 text-yellow-500 aurora-light:text-accent-warning`,children:n(`orphan.badge`)})]}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}),(0,O.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,O.jsxs)(`button`,{type:`button`,disabled:r,onClick:async()=>{i(!0);try{await fetch(`${c()}/plugins/${e.name}`,{method:`DELETE`}),t()}finally{i(!1)}},className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-destructive/10 hover:text-destructive flex items-center gap-1.5`,children:[(0,O.jsx)(f,{className:`w-3 h-3`}),` `,n(`orphan.removeButton`)]})})]})}function H({pluginName:e,onClose:t}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(null),[o,s]=(0,D.useState)(null),[l,u]=(0,D.useState)(!1),[f,m]=(0,D.useState)(null),[h,_]=(0,D.useState)([]),[y,b]=(0,D.useState)(null),[x,S]=(0,D.useState)([]),{registerHandler:C,unregisterHandler:E}=p(),k=(0,D.useCallback)(()=>{a(null),s(null),fetch(`${c()}/plugins/${e}/preview-install`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>a(e)).catch(e=>s(e.message))},[e]);(0,D.useEffect)(()=>{k()},[k]),(0,D.useEffect)(()=>(C(`install-${e}`,t=>{let n=t;if(n.type===`plugin.install_progress`&&n.name===e&&n.line&&_(e=>[...e,n.line]),n.type===`plugin.prereq_install_progress`&&n.line&&S(e=>[...e,n.line]),n.type===`plugin.prereq_installed`){b(null);let e=n.reason;e&&S(t=>[...t,`► ${e}`]),n.ok&&k()}}),()=>E(`install-${e}`)),[e,C,E,k]);let A=async e=>{b(e),S([r(`installDialog.installingPrereq`,{name:e})]);try{await fetch(`${c()}/plugins/_prerequisites/${e}/install`,{method:`POST`})}catch(e){S(t=>[...t,r(`installDialog.prereqStartFailed`,{message:e.message})]),b(null)}},j=(i?.requirements??[]).every(e=>e.installed&&e.executable&&e.meetsMinimum);return(0,O.jsxs)(W,{onClose:t,title:r(`installDialog.title`,{name:e}),children:[o&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:o}),!i&&!o&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(g,{className:`w-3 h-3 animate-spin`}),` `,r(`installDialog.computingChanges`)]}),i&&(0,O.jsxs)(O.Fragment,{children:[i.platformNote&&(0,O.jsxs)(`div`,{className:`flex items-start gap-2 p-2.5 rounded-md border border-yellow-500/30 aurora-light:border-accent-warning/30 bg-yellow-500/5 aurora-light:bg-accent-warning/10 text-[11px] leading-relaxed`,children:[(0,O.jsx)(d,{className:`w-3.5 h-3.5 text-yellow-500 aurora-light:text-accent-warning mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:i.platformNote})]}),(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.filesHeading`)}),(0,O.jsx)(`ul`,{className:`text-xs space-y-0.5 font-mono`,children:i.files.map((e,t)=>(0,O.jsxs)(`li`,{className:e.op===`create`?`text-accent-success`:`text-accent-info`,children:[e.op===`create`?`+ `:`~ `,e.path,e.summary&&(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,e.summary]})]},t))})]}),i.requirements.length>0&&(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.prerequisites`)}),(0,O.jsx)(`ul`,{className:`text-xs space-y-1`,children:i.requirements.map(e=>{let t=e.installed&&e.executable&&e.meetsMinimum,i=e.name===`uv`;return(0,O.jsxs)(`li`,{className:`flex items-center gap-2`,children:[t?(0,O.jsx)(w,{className:`w-3 h-3 text-accent-success`}):(0,O.jsx)(n,{className:`w-3 h-3 text-accent-warning`}),(0,O.jsxs)(`span`,{children:[e.name,e.minVersion?` ≥ ${e.minVersion}`:``]}),e.version&&(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.version,`)`]}),!t&&i&&(0,O.jsxs)(`button`,{type:`button`,disabled:y===e.name,onClick:()=>A(e.name),className:`ml-auto text-[10px] px-2 py-0.5 rounded border border-border hover:bg-muted disabled:opacity-50 flex items-center gap-1`,children:[y===e.name&&(0,O.jsx)(g,{className:`w-2.5 h-2.5 animate-spin`}),r(`installDialog.autoInstall`)]})]},e.name)})}),x.length>0&&(0,O.jsx)(`pre`,{className:`mt-2 text-[11px] bg-muted/40 rounded p-2 max-h-24 overflow-auto font-mono`,children:x.join(`
|
|
2
|
-
`)})]}),h.length>0&&(0,O.jsxs)(`section`,{children:[(0,O.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.progress`)}),(0,O.jsx)(`pre`,{className:`text-[11px] bg-muted/40 rounded p-2 max-h-32 overflow-auto font-mono`,children:h.join(`
|
|
3
|
-
`)})]}),f&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:f})]}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,O.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:r(`common:actions.cancel`)}),(0,O.jsxs)(`button`,{type:`button`,disabled:!i||!j||l,onClick:async()=>{u(!0),m(null);try{let n=await fetch(`${c()}/plugins/${e}/install`,{method:`POST`});if(!n.ok)throw Error((await n.json()).error??`HTTP ${n.status}`);setTimeout(t,1500)}catch(e){m(e.message)}finally{u(!1)}},className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white disabled:opacity-50 flex items-center gap-1.5`,children:[l?(0,O.jsx)(g,{className:`w-3 h-3 animate-spin`}):(0,O.jsx)(T,{className:`w-3 h-3`}),r(`card.install`)]})]})]})}function U({pluginName:e,onClose:t,onUninstalled:n}){let{t:r}=v(`integrations`),[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(null);return(0,O.jsxs)(W,{onClose:t,title:r(`uninstallDialog.title`,{name:e}),children:[(0,O.jsx)(`p`,{className:`text-xs`,children:(0,O.jsx)(x,{t:r,i18nKey:`uninstallDialog.body`,components:{code:(0,O.jsx)(`code`,{})}})}),o&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:o}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,O.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:r(`common:actions.cancel`)}),(0,O.jsxs)(`button`,{type:`button`,disabled:i,onClick:async()=>{a(!0);try{let t=await fetch(`${c()}/plugins/${e}`,{method:`DELETE`});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`);n()}catch(e){s(e.message)}finally{a(!1)}},className:`text-xs px-3 py-1.5 rounded-md bg-destructive text-white disabled:opacity-50 flex items-center gap-1.5`,children:[i&&(0,O.jsx)(g,{className:`w-3 h-3 animate-spin`}),r(`card.uninstall`)]})]})]})}function W({title:e,onClose:t,children:n}){return(0,O.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,role:`dialog`,tabIndex:-1,onClick:t,children:(0,O.jsxs)(`div`,{className:`bg-card border border-border rounded-lg shadow-xl w-full max-w-md p-5 flex flex-col gap-3`,onClick:e=>e.stopPropagation(),children:[(0,O.jsx)(`h3`,{className:`text-sm font-semibold`,children:e}),n]})})}function G(){return(0,O.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:Array.from({length:3},(e,t)=>(0,O.jsx)(`div`,{className:`rounded-lg border border-border bg-card p-4 h-40 animate-pulse`},t))})}function K({onRetry:e}){let{t}=v(`integrations`);return(0,O.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground`,children:[(0,O.jsx)(d,{className:`w-5 h-5 text-destructive`}),(0,O.jsx)(`p`,{children:t(`page.loadError`)}),(0,O.jsx)(`button`,{type:`button`,onClick:e,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:t(`common:actions.retry`)})]})}function q(){let{t:e}=v(`integrations`);return(0,O.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 gap-2 text-sm text-muted-foreground`,children:[(0,O.jsx)(S,{className:`w-6 h-6`}),(0,O.jsx)(`p`,{children:e(`page.empty`)})]})}export{F as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{Bt as t,C as n,Ct as r,Dt as i,E as a,Et as o,It as s,L as c,Ot as l,Qt as u,R as d,Rt as f,St as p,Vt as m,X as h,Xt as g,Z as _,Zt as v,_ as y,_n as b,bn as x,bt as S,ct as C,dn as w,et as ee,fn as T,g as E,gn as te,hn as ne,l as D,o as O,u as k,w as A,wt as j,yt as re,z as M}from"./index-CEunZ8kJ.js";import{t as N}from"./lib-3_pPhUqA.js";import{t as ie}from"./format-command-CMsBTOPN.js";var P=s(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),F=s(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),I=e(x(),1),L=v();function ae({phases:e,phaseDefinitions:t}){return t.length===0?null:(0,L.jsx)(`div`,{className:`flex items-center`,children:t.map((r,i)=>{let o=e[r.key]??`idle`,s=i<t.length-1?e[t[i+1].key]??`idle`:null;return(0,L.jsxs)(`div`,{className:`flex items-center`,children:[(0,L.jsxs)(n,{children:[(0,L.jsx)(a,{asChild:!0,children:(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5 cursor-default px-4`,children:[(0,L.jsx)(R,{state:o}),(0,L.jsx)(`span`,{className:M(`text-xs font-medium transition-colors`,o===`running`?`text-blue-400 aurora-light:text-accent-info`:o===`done`?`text-emerald-400 aurora-light:text-accent-success`:o===`error`?`text-red-400 aurora-light:text-destructive`:`text-muted-foreground/40`),children:r.label})]})}),(0,L.jsxs)(A,{side:`bottom`,className:`max-w-[200px]`,children:[(0,L.jsx)(`p`,{className:`font-medium`,children:r.label}),(0,L.jsx)(`p`,{className:`text-muted-foreground mt-0.5`,children:r.description})]})]}),s!==null&&(0,L.jsx)(`div`,{className:M(`h-px w-12 -mt-5 shrink-0 transition-all duration-300`,s===`done`||o===`done`?`bg-emerald-500/30 aurora-light:bg-accent-success/40`:s===`running`?`bg-blue-400/40 aurora-light:bg-accent-info/40`:`bg-border/30`)})]},r.key)})})}function R({state:e}){return(0,L.jsxs)(`div`,{className:M(`flex items-center justify-center w-10 h-10 rounded-full transition-all duration-300`,e===`running`?`bg-blue-500/10 aurora-light:bg-accent-info/10 ring-1 ring-blue-400/30 aurora-light:ring-accent-info/30 animate-pulse`:e===`done`?`bg-emerald-500/10 aurora-light:bg-accent-success/10`:e===`error`?`bg-red-500/10 aurora-light:bg-destructive/10`:`bg-muted/20`),children:[e===`running`&&(0,L.jsx)(C,{className:`w-6 h-6 text-blue-400 aurora-light:text-accent-info animate-spin`}),e===`done`&&(0,L.jsx)(j,{className:`w-6 h-6 text-emerald-400 aurora-light:text-accent-success`}),e===`error`&&(0,L.jsx)(r,{className:`w-6 h-6 text-red-400 aurora-light:text-destructive`}),e===`idle`&&(0,L.jsx)(p,{className:`w-6 h-6 text-muted-foreground/20`})]})}function oe(e,t){let n=(typeof t==`number`?t:new Date(t).getTime())-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return`—`;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function se(e){let t=new Set;for(let n of e)if(n.event_type===`log`)try{let e=(JSON.parse(n.payload).line??``).match(/(?:Writing|Editing|Created?|Updated?)\s+(?:file:\s*)?([\w./\-]+\.\w+)/i);e&&t.add(e[1])}catch{}return Array.from(t).slice(0,20)}var ce=new Set([`editing`,`writing`,`reading`,`searching`,`running`]);function z(e){return e.length>40?`${e.slice(0,39)}…`:e}function B(e){return typeof e!=`string`||e.length===0?``:z(e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??``)}function V(e){return typeof e!=`string`||e.length===0?``:z(e.trim().split(/\s+/)[0]??``)}function H(e){if(typeof e!=`string`)return``;try{let t=JSON.parse(e)?.command;if(Array.isArray(t))return V(t.filter(e=>typeof e==`string`).join(` `));if(typeof t==`string`)return V(t)}catch{}return``}function U(e,t){let n=t??{},r=B(n.file_path??n.path);switch(e){case`Edit`:case`MultiEdit`:case`NotebookEdit`:case`Update`:return{step:!0,actionKey:`editing`,actionArg:r};case`Write`:case`create`:return{step:!0,actionKey:`writing`,actionArg:r};case`Read`:return{step:!0,actionKey:`reading`,actionArg:r};case`Grep`:case`Glob`:case`search`:return{step:!0,actionKey:`searching`,actionArg:z(String(n.pattern??n.query??``))};case`Bash`:case`shell`:return{step:!0,actionKey:`running`,actionArg:V(n.command)};default:return{step:!0,actionKey:`working`}}}function W(e){let t=e.event_type,n={};try{let t=JSON.parse(e.payload);t&&typeof t==`object`&&!Array.isArray(t)&&(n=t)}catch{}if(t===`assistant`){let e=n.message?.content;if(Array.isArray(e)){let t=e.filter(e=>e?.type===`tool_use`);if(t.length>0){let e=t[t.length-1];return{...U(e.name,e.input),stepCount:t.length}}if(e.some(e=>e?.type===`text`))return{step:!0,actionKey:`thinking`}}return{step:!0}}if(t===`tool_use`)return U(n.name,n.input);if(t===`item.completed`){let e=n.item,t=e?.type;return t===`agent_message`?{step:!0,actionKey:`thinking`}:t===`agent_reasoning`?{step:!0,actionKey:`reasoning`}:t===`function_call`||t===`local_shell_call`||t===`command_execution`?{step:!0,actionKey:`running`,actionArg:V(e?.command)||H(e?.arguments)||(typeof e?.name==`string`?z(e.name):``)||(t===`local_shell_call`?`shell`:``)}:{step:!0}}return{step:!1}}var G={steps:0,actionKey:``,actionArg:``,lastSeenIdx:0};function K(e,t){if(t.type===`reset`)return G;if(t.type===`consume`){let{events:n}=t,r=e.lastSeenIdx>n.length?n.length:e.lastSeenIdx;if(n.length<=r)return r===e.lastSeenIdx?e:{...e,lastSeenIdx:r};let{steps:i,actionKey:a,actionArg:o}=e;for(let e=r;e<n.length;e++){let t=W(n[e]);t.step&&(i+=t.stepCount??1),t.actionKey&&(a=t.actionKey,o=t.actionArg??``)}return{steps:i,actionKey:a,actionArg:o,lastSeenIdx:n.length}}return e}function le({job:e,events:t,defaultOpen:n=!0,pipelineTotals:i,phases:a,phaseDefinitions:o}){let{t:s}=T(`jobs`),[c,u]=(0,I.useState)(n),d=(0,I.useMemo)(()=>se(t),[t]),f=e.status===`running`,p=e.status===`completed`,[m,h]=(0,I.useState)(()=>Date.now());(0,I.useEffect)(()=>{if(!f)return;let e=window.setInterval(()=>h(Date.now()),1e3);return()=>window.clearInterval(e)},[f]);let[g,_]=(0,I.useReducer)(K,G),v=(0,I.useRef)(e.id);(0,I.useEffect)(()=>{v.current!==e.id&&(v.current=e.id,_({type:`reset`})),_({type:`consume`,events:t})},[e.id,t]);let[y,b]=(0,I.useState)(!0);(0,I.useEffect)(()=>{if(!f)return;b(!0);let e=window.setTimeout(()=>b(!1),8e3);return()=>window.clearTimeout(e)},[f,e.id]);let x=e.finished_at?oe(e.started_at,e.finished_at):f?oe(e.started_at,m):`—`,S=!!e.total_cost_usd_estimated,w=e.total_cost_usd==null?null:`${S?`~`:``}$${e.total_cost_usd.toFixed(4)}`,ee=e.num_turns==null?null:String(e.num_turns),E=e.tokens_in==null?null:(e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0),te=E==null?null:`${(E/1e3).toFixed(1)}k`,ne=(0,I.useMemo)(()=>!a||!o?null:o.find(e=>a[e.key]===`running`)?.label??null,[a,o]),D=f&&g.steps===0?`connecting`:g.actionKey||`thinking`,O=ce.has(D)&&g.actionArg!==``,k=ce.has(D)&&!O?`working`:D,A=O?s(`statusPanel.activity.${k}`,{arg:g.actionArg}):s(`statusPanel.activity.${k}`),re=ne??(f&&g.steps===0?s(`statusPanel.activity.starting`):null),N=g.steps>0?s(`statusPanel.steps`,{count:g.steps}):null,ie=s(f?`statusPanel.inProgress`:p?`statusPanel.completed`:`statusPanel.failed`),P=f?`border-accent-info/20 bg-accent-info/5`:p?`border-emerald-500/20 aurora-light:border-accent-success/30 bg-emerald-500/5 aurora-light:bg-accent-success/5`:`border-red-500/20 aurora-light:border-destructive/30 bg-red-500/5 aurora-light:bg-destructive/5`,F=f?C:p?j:r,ae=f?`w-4 h-4 text-accent-info shrink-0 animate-spin`:p?`w-4 h-4 text-emerald-400 aurora-light:text-accent-success shrink-0`:`w-4 h-4 text-red-400 aurora-light:text-destructive shrink-0`;return(0,L.jsxs)(`div`,{className:M(`mx-4 my-2 rounded-xl border transition-colors duration-500`,P),children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>u(!c),className:`w-full flex items-center gap-3 px-4 py-3`,children:[(0,L.jsx)(F,{className:ae,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`text-sm font-semibold flex-1 text-left`,children:ie}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`tabular-nums`,children:x}),f?N&&(0,L.jsx)(`span`,{className:`tabular-nums`,children:N}):(0,L.jsxs)(L.Fragment,{children:[w&&(0,L.jsx)(`span`,{className:`tabular-nums text-yellow-400 aurora-light:text-accent-warning`,children:w}),d.length>0&&(0,L.jsx)(`span`,{children:s(`statusPanel.filesCount`,{count:d.length})})]})]}),(0,L.jsx)(l,{className:M(`w-4 h-4 text-muted-foreground/40 transition-transform duration-150 shrink-0`,c&&`rotate-180`)})]}),c&&(0,L.jsx)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/20`,children:f?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:s(`statusPanel.zoneInProgress`)}),(0,L.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3 sm:items-stretch`,children:[(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 sm:w-44 shrink-0`,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[s(`statusPanel.duration`),(0,L.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-accent-info animate-pulse`,title:s(`statusPanel.liveTooltip`),"aria-label":s(`statusPanel.liveTooltip`)})]}),(0,L.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-accent-info`,children:x})]}),(0,L.jsxs)(`div`,{className:`flex-1 flex items-center gap-2 bg-muted/10 rounded-lg px-3 py-2 min-w-0`,children:[(0,L.jsx)(C,{className:`w-3.5 h-3.5 text-accent-info shrink-0 animate-spin`,"aria-hidden":`true`}),re&&(0,L.jsx)(`span`,{className:`text-[11px] font-medium px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info shrink-0`,children:re}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground truncate flex-1 min-w-0`,children:A}),N&&(0,L.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/60 tabular-nums shrink-0`,children:[`· `,N]})]})]}),y&&(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground/40 leading-snug`,children:s(`statusPanel.explainer`)}),(0,L.jsx)(`p`,{className:`pt-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider border-t border-accent-info/10 mt-1`,children:s(`statusPanel.zoneFinalPending`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,L.jsx)(Y,{label:s(`statusPanel.cost`),caption:s(`statusPanel.pendingCaption`),tooltip:s(`statusPanel.costTooltip`)}),(0,L.jsx)(Y,{label:s(`statusPanel.turns`),caption:s(`statusPanel.pendingCaption`),tooltip:s(`statusPanel.pendingTooltip`)}),(0,L.jsx)(Y,{label:s(`statusPanel.tokens`),caption:s(`statusPanel.pendingCaption`),tooltip:s(`statusPanel.pendingTooltip`)})]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:s(`statusPanel.zoneFinal`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:[(0,L.jsx)(q,{label:s(`statusPanel.duration`),value:x}),(0,L.jsx)(J,{label:s(`statusPanel.cost`),value:w,valueClass:`text-yellow-400 aurora-light:text-accent-warning`,naCaption:s(`statusPanel.notAvailable`)}),(0,L.jsx)(J,{label:s(`statusPanel.turns`),value:ee,naCaption:s(`statusPanel.notAvailable`)}),(0,L.jsx)(J,{label:s(`statusPanel.tokens`),value:te,naCaption:s(`statusPanel.notAvailable`)})]}),i&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:s(`statusPanel.pipelineTotal`,{count:i.jobCount})}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,L.jsx)(q,{label:s(`statusPanel.totalCost`),value:`$${i.totalCostUsd.toFixed(4)}`,valueClass:`text-yellow-400 aurora-light:text-accent-warning`}),(0,L.jsx)(q,{label:s(`statusPanel.totalTokens`),value:`${((i.totalTokensIn+i.totalTokensOut+i.totalTokensCacheRead+i.totalTokensCacheCreate)/1e3).toFixed(1)}k`})]})]}),d.length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:s(`statusPanel.filesModified`)}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d.map(e=>(0,L.jsx)(`code`,{className:`text-[10px] font-mono bg-muted/30 px-2 py-0.5 rounded text-cyan-400/80 aurora-light:text-accent-info`,children:e},e))})]})]})})]})}function q({label:e,value:t,valueClass:n}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,L.jsx)(`p`,{className:M(`text-sm font-semibold tabular-nums mt-0.5`,n),children:t})]})}function J({label:e,value:t,valueClass:n,naCaption:r}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,L.jsx)(`p`,{className:M(`text-sm font-semibold tabular-nums mt-0.5`,t==null?`text-muted-foreground`:n),children:t??`—`}),t==null&&(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:r})]})}function Y({label:e,caption:t,tooltip:n}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 ring-1 ring-accent-info/10`,title:n,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[e,(0,L.jsx)(P,{className:`w-2.5 h-2.5 text-muted-foreground/30`,"aria-hidden":`true`})]}),(0,L.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-muted-foreground/40`,children:`—`}),(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:t})]})}var X=4;function ue({tickets:e,onTicketClick:t}){let{t:n}=T(`jobs`),[r,i]=(0,I.useState)(!1);if(e.length===0)return null;let a=e.length>=X&&!r?e.slice(0,1):e,s=e.length-a.length;return(0,L.jsxs)(`div`,{className:`rounded-xl border border-border/40 bg-card/40 px-4 py-3 space-y-1.5`,children:[a.map(e=>(0,L.jsx)(Z,{ticket:e,onClick:()=>t(e.id)},e.id)),s>0&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showMore`,{count:s}),(0,L.jsx)(l,{className:`w-3 h-3`})]}),r&&e.length>=X&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!1),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showLess`),(0,L.jsx)(o,{className:`w-3 h-3`})]})]})}function Z({ticket:e,onClick:t}){let{t:n}=T(`jobs`),r=e.title==null,i=`inline-flex items-center px-1.5 py-0.5 rounded-md text-[11px] font-mono tabular-nums shrink-0`;return r?(0,L.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:(0,L.jsx)(`span`,{className:M(i,`text-muted-foreground bg-muted/20 select-none`),title:n(`ticketHeader.deletedTooltip`),children:n(`ticketHeader.deletedTicket`,{id:e.id})})}):(0,L.jsxs)(`button`,{type:`button`,onClick:t,className:`flex items-center gap-2 min-w-0 w-full text-left group`,title:e.title??void 0,children:[(0,L.jsxs)(`span`,{className:M(i,`text-accent-primary bg-accent-primary/10 group-hover:bg-accent-primary/20 transition-colors`),children:[`#`,e.id]}),(0,L.jsx)(`span`,{className:`text-lg font-semibold text-foreground truncate group-hover:text-accent-primary transition-colors`,children:e.title})]})}function Q(e){let t=e.trimStart();return!!(/^#{1,6}\s/.test(t)||/^[-*+]\s/.test(t)||/^\d+\.\s/.test(t)||/^\|.+\|/.test(t)||t.startsWith("```")||t.startsWith(`> `)||/\*\*[^*]+\*\*/.test(e)||/`[^`]+`/.test(e)||/\[.+\]\(.+\)/.test(e)||/^(-{3,}|_{3,}|\*{3,})$/.test(t)||/^- \[[ x]\]\s/.test(t))}function de(e,t){let n=`${e.id??t}`,r=e.timestamp;if(e.event_type===`log`)try{let t=JSON.parse(e.payload).line??``;return t.trim()?t.startsWith(`▸`)||t.match(/^(architect|developer|reviewer|ship|analyst)\s*:/i)?{id:n,content:t,type:`phase`,timestamp:r}:e.source===`stderr`?{id:n,content:t,type:`stderr`,timestamp:r}:Q(t)?{id:n,content:t,type:`assistant`,timestamp:r}:{id:n,content:t,type:`plain`,timestamp:r}:null}catch{return null}if(e.event_type!==`log`&&e.event_type!==`result`)return null;if(e.event_type===`result`)try{let t=JSON.parse(e.payload),i=[];return t.duration_ms&&i.push(`${(t.duration_ms/1e3).toFixed(1)}s`),t.total_cost_usd&&i.push(`$${t.total_cost_usd.toFixed(4)}`),t.num_turns&&i.push(m.t(`jobs:logViewer.turns`,{count:t.num_turns})),{id:n,content:`▸ ${m.t(`jobs:logViewer.completed`)}${i.length?` — ${i.join(` · `)}`:``}`,type:`result`,timestamp:r}}catch{return null}return null}function $(e){let t=`none`,n=[];for(let r of e){let e=r.type;if(e!==`plain`&&e!==`log`){t=`none`,n.push(r);continue}let i=r.content;i.startsWith(`--- `)?(t=`saw_minus`,n.push({...r,type:`diff-meta`})):t===`saw_minus`&&i.startsWith(`+++ `)?(t=`active`,n.push({...r,type:`diff-meta`})):t===`active`&&i.startsWith(`@@ `)?n.push({...r,type:`diff-hunk`}):t===`active`&&i.startsWith(`+`)&&!i.startsWith(`+++`)?n.push({...r,type:`diff-add`}):t===`active`&&i.startsWith(`-`)&&!i.startsWith(`---`)?n.push({...r,type:`diff-remove`}):(t===`active`&&(i.startsWith(` `)||i===``)||(t=`none`),n.push(r))}return n}function fe(e){let t=[{key:`__preamble__`,header:null,lines:[]}];for(let n of e)n.type===`phase`?t.push({key:n.id,header:n,lines:[]}):t[t.length-1].lines.push(n);return t.filter(e=>e.header!==null||e.lines.length>0)}function pe({events:e,isLoading:t}){let{t:n,i18n:r}=T(`jobs`),[i,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(!0),[c,u]=(0,I.useState)(new Set),f=(0,I.useRef)(null),p=(0,I.useRef)(null),{processedLines:m,groups:h,totalLines:g}=(0,I.useMemo)(()=>{let t=e.map((e,t)=>de(e,t)).filter(e=>e!==null),n=[];for(let e of t){let t=n.length>0?n[n.length-1]:null;e.type===`assistant`&&t?.type===`assistant`?t.content+=`
|
|
2
|
-
`+e.content:n.push({...e})}let r=$(n);return{processedLines:r,groups:fe(r),totalLines:r.length}},[e,r.language]),v=(0,I.useMemo)(()=>{if(!i)return g;let e=i.toLowerCase();return m.filter(t=>t.content.toLowerCase().includes(e)).length},[i,m,g]),y=(0,I.useCallback)(()=>{let e=p.current;e&&(e.scrollTop=e.scrollHeight)},[]);(0,I.useEffect)(()=>{o&&y()},[e.length,o,y]);function b(){let e=p.current;e&&s(e.scrollHeight-e.scrollTop-e.clientHeight<50)}function x(e){u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return t?(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`logViewer.loading`)})}):g===0?(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`logViewer.empty`)})}):(0,L.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,L.jsxs)(`div`,{className:`px-4 py-2 border-b border-border flex items-center gap-2`,children:[(0,L.jsxs)(`div`,{className:`relative flex-1 max-w-xs`,children:[(0,L.jsx)(_,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground`}),(0,L.jsx)(O,{placeholder:n(`logViewer.filterPlaceholder`),value:i,onChange:e=>a(e.target.value),className:`pl-7 h-7`})]}),(0,L.jsx)(d,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground/50 hover:text-foreground`,onClick:()=>{let e=m.map(e=>e.content).join(`
|
|
3
|
-
`);navigator.clipboard.writeText(e).then(()=>{w.success(n(`logViewer.copySuccess`))}).catch(()=>{w.error(n(`logViewer.copyFailed`))})},children:(0,L.jsx)(S,{className:`w-3.5 h-3.5`})}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:n(`logViewer.lineCount`,{filtered:v,total:g})})]}),(0,L.jsxs)(`div`,{ref:p,className:`flex-1 overflow-y-auto p-2 text-xs relative`,onScroll:b,children:[h.map(e=>(0,L.jsx)(me,{group:e,filter:i,collapsed:c.has(e.key),onToggle:()=>x(e.key)},e.key)),(0,L.jsx)(`div`,{ref:f})]}),!o&&(0,L.jsxs)(d,{size:`sm`,variant:`secondary`,onClick:()=>{s(!0),y()},className:`absolute bottom-16 right-6 h-7 gap-1 shadow-lg`,children:[(0,L.jsx)(l,{className:`w-3 h-3`}),n(`logViewer.jumpToBottom`)]})]})}var me=(0,I.memo)(function({group:e,filter:t,collapsed:n,onToggle:r}){let{t:a}=T(`jobs`),o=t?e.lines.filter(e=>e.content.toLowerCase().includes(t.toLowerCase())):e.lines;if(e.header===null)return o.length===0?null:(0,L.jsx)(`div`,{children:o.map((e,t)=>(0,L.jsx)(ge,{line:e,even:t%2==0},e.id))});let s=e.header.content;return(0,L.jsxs)(`div`,{className:`mt-3 rounded-md overflow-hidden border border-border/20`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:r,className:M(`flex items-center gap-2 w-full text-left px-3 py-2`,`bg-primary/5 border-b border-primary/20`,`hover:bg-primary/10 transition-colors duration-150 cursor-pointer`),children:[(0,L.jsx)(i,{className:M(`w-3 h-3 text-primary/60 shrink-0 transition-transform duration-150`,!n&&`rotate-90`)}),(0,L.jsx)(`span`,{className:`flex-1 text-[12px] font-semibold text-foreground leading-none`,children:s}),e.header.timestamp&&(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 font-mono tabular-nums shrink-0`,children:new Date(e.header.timestamp).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0`,children:a(`logViewer.phaseLines`,{count:e.lines.length})})]}),!n&&(0,L.jsx)(`div`,{className:`bg-muted/5`,children:o.length===0?(0,L.jsx)(`p`,{className:`px-4 py-2 text-[10px] text-muted-foreground/40 italic`,children:a(t?`logViewer.noMatchingLines`:`logViewer.noOutput`)}):o.map((e,t)=>(0,L.jsx)(ge,{line:e,even:t%2==0},e.id))})]})}),he=[N],ge=(0,I.memo)(function({line:e,even:t}){let n=e.type===`assistant`,r=e.type===`diff-add`,i=e.type===`diff-remove`,a=e.type===`diff-meta`,o=e.type===`diff-hunk`;return(0,L.jsxs)(`div`,{className:M(`flex items-start gap-2 group px-2 py-0.5 rounded-sm`,!(r||i||a||o)&&(t?`bg-muted/20`:`bg-transparent`),e.type===`result`&&`bg-emerald-500/5 aurora-light:bg-accent-success/10 border-l-2 border-emerald-500/40 aurora-light:border-accent-success/40 mt-2 py-2`,r&&`bg-emerald-500/8 aurora-light:bg-accent-success/10 border-l-2 border-emerald-500/50 aurora-light:border-accent-success/50`,i&&`bg-red-500/8 aurora-light:bg-destructive/10 border-l-2 border-red-500/50 aurora-light:border-destructive/50`,a&&`bg-accent-primary/5 border-l-2 border-accent-primary/30`,o&&`bg-accent-info/5 border-l-2 border-accent-info/30`),children:[e.timestamp&&(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0 mt-0.5 w-[52px] font-mono tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}),n?(0,L.jsx)(`div`,{className:`flex-1 min-w-0 prose prose-invert prose-xs max-w-none
|
|
4
|
-
prose-p:my-1 prose-p:leading-relaxed
|
|
5
|
-
prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold
|
|
6
|
-
prose-ul:my-1 prose-ol:my-1 prose-li:my-0
|
|
7
|
-
prose-code:text-cyan-300 prose-code:text-[11px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded
|
|
8
|
-
prose-pre:my-1 prose-pre:bg-muted/30 prose-pre:rounded-md prose-pre:p-2 prose-pre:text-[11px]
|
|
9
|
-
prose-strong:text-foreground prose-em:text-foreground/70
|
|
10
|
-
prose-a:text-blue-400 prose-a:no-underline hover:prose-a:underline
|
|
11
|
-
prose-table:my-2 prose-table:text-[11px]
|
|
12
|
-
prose-thead:border-border prose-thead:bg-muted/30
|
|
13
|
-
prose-th:px-3 prose-th:py-1.5 prose-th:text-left prose-th:font-semibold prose-th:text-foreground/90
|
|
14
|
-
prose-td:px-3 prose-td:py-1.5 prose-td:border-border
|
|
15
|
-
prose-tr:border-border
|
|
16
|
-
text-foreground/80`,children:(0,L.jsx)(y,{remarkPlugins:[E],rehypePlugins:he,children:e.content})}):(0,L.jsx)(`span`,{className:M(`flex-1 break-all leading-relaxed whitespace-pre-wrap font-mono`,e.type===`tool-use`&&`text-cyan-400/80 aurora-light:text-accent-info text-[11px]`,e.type===`stderr`&&`text-orange-400 aurora-light:text-accent-warning`,e.type===`result`&&`text-emerald-400 aurora-light:text-accent-success font-medium`,e.type===`log`&&`text-foreground/60`,e.type===`plain`&&`text-foreground/70`,e.type===`tool-result`&&`text-muted-foreground/50`,r&&`text-emerald-400 aurora-light:text-accent-success`,i&&`text-red-400 aurora-light:text-destructive`,a&&`text-accent-primary/80`,o&&`text-accent-info/80`),children:e.content})]})}),_e={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.completed`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queued`}};function ve(){let{t:e}=T(`jobs`),{id:r}=b(),{activeProjectId:o,projects:s}=f(),l=s.find(e=>e.id===o)?.provider,p=te(),{openTicketDetail:m}=D(),[_,v]=(0,I.useState)(null),[y,x]=(0,I.useState)([]),[S,E]=(0,I.useState)([]),[O,N]=(0,I.useState)({}),[P,R]=(0,I.useState)([]),[oe,se]=(0,I.useState)(!0),[ce,z]=(0,I.useState)(!1),[B,V]=(0,I.useState)(null),[H,U]=(0,I.useState)(!1),[W,G]=(0,I.useState)(``),[K,q]=(0,I.useState)(!1),[J,Y]=(0,I.useState)(!1);(0,I.useEffect)(()=>{if(!r)return;let e=new AbortController;v(null),x([]),E([]),N({}),se(!0),z(!1);async function t(){try{let t=await fetch(`${u()}/jobs/${r}`,{signal:e.signal});if(t.status===404){z(!0);return}if(!t.ok)throw Error(`Failed to fetch job`);let n=await t.json();v(n.job),x(n.events)}catch(e){if(e.name===`AbortError`)return;z(!0)}finally{e.signal.aborted||se(!1)}}return t(),()=>e.abort()},[r,o]),(0,I.useEffect)(()=>{if(!_?.pipeline_id){R([]);return}let e=_.pipeline_id;fetch(`${u()}/pipelines/${e}`).then(e=>e.ok?e.json():null).then(e=>{e?.jobs&&R(e.jobs)}).catch(()=>{})},[_?.pipeline_id,_?.status]);let X=(0,I.useRef)(o);X.current=o;let Z=(0,I.useRef)([]),Q=(0,I.useRef)(null),de=(0,I.useCallback)(()=>{Q.current=null;let e=Z.current;e.length!==0&&(Z.current=[],x(t=>{let n=[...t,...e];return n.length>1e4?n.slice(n.length-8e3):n}))},[]),$=(0,I.useCallback)(e=>{let t=Z.current;t.push(e),t.length>1e4&&(Z.current=t.slice(-8e3)),Q.current||=requestAnimationFrame(de)},[de]);(0,I.useEffect)(()=>()=>{Q.current&&cancelAnimationFrame(Q.current)},[]);let fe=(0,I.useCallback)(e=>{let t=e;if(!(X.current&&t.projectId&&t.projectId!==X.current)){if(t.type===`init`){let e=t.phaseDefinitions??[];E(e);let n={};for(let r of e)n[r.key]=t.phases?.[r.key]??`idle`;N(n)}else if(t.type===`event`&&t.jobId===r)$({id:Date.now(),job_id:r??``,seq:t.seq??0,event_type:t.event_type,source:t.source,payload:t.payload,timestamp:t.timestamp});else if(t.type===`log`&&t.processId===r)$({id:Date.now(),job_id:r??``,seq:0,event_type:`log`,source:t.source,payload:JSON.stringify({line:t.line}),timestamp:t.timestamp});else if(t.type===`job.turn_user`&&t.jobId===r)U(!0);else if(t.type===`job.turn_done`&&t.jobId===r)V(t.totals),U(!1);else if(t.type===`job.finalized`&&t.jobId===r){U(!1),q(!1);let e=t.totals;e&&V(e),fetch(`${u()}/jobs/${r}`).then(e=>e.json()).then(e=>v(e.job)).catch(()=>{})}else if(t.type===`phase`){let e=t.phase,n=t.state;N(t=>({...t,[e]:n}))}else if(t.type===`queue`){let e=t.jobs?.find(e=>e.id===r);if(e){let t=e.status;v(e=>e&&{...e,status:t}),(t===`completed`||t===`failed`||t===`canceled`)&&fetch(`${u()}/jobs/${r}`).then(e=>e.json()).then(e=>v(e.job)).catch(()=>{})}}}},[r,$]),{registerHandler:me,unregisterHandler:he}=g();(0,I.useEffect)(()=>(me(`job-detail-${r}`,fe),()=>he(`job-detail-${r}`)),[r,fe,me,he]),(0,I.useEffect)(()=>{if(!r||!_||_.status!==`running`||_.hasTelemetry)return;let e=setInterval(()=>{fetch(`${u()}/jobs/${r}`).then(e=>e.ok?e.json():null).then(e=>{e?.job?.hasTelemetry&&v(e=>e&&{...e,hasTelemetry:!0})}).catch(()=>{})},8e3);return()=>clearInterval(e)},[r,_?.status,_?.hasTelemetry]);async function ge(){if(r)try{let t=await fetch(`${u()}/jobs/${r}`,{method:`DELETE`});if(t.ok)(await t.json()).status===`deleted`?(w.success(e(`detail.toast.jobDeleted`)),p(`/jobs`)):w.success(e(`detail.toast.cancelSignalSent`),{description:e(`detail.toast.cancelSignalSentDescription`)});else{let n=await t.json();w.error(e(`detail.toast.failed`),{description:n.error})}}catch{w.error(e(`detail.toast.networkError`))}}async function ve(){if(!(!r||K)){q(!0);try{let t=await fetch(`${u()}/jobs/${r}/finalize`,{method:`POST`});if(t.ok)w.success(e(`detail.toast.finalizeScheduled`));else{let n=await t.json().catch(()=>({}));w.error(e(`detail.toast.finalizeFailed`),{description:n.error}),q(!1)}}catch{w.error(e(`detail.toast.networkError`)),q(!1)}}}async function ye(){let t=W.trim();if(!(!r||!t||J)){Y(!0);try{let n=await fetch(`${u()}/jobs/${r}/messages`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:t})});if(n.ok)G(``);else{let t=await n.json().catch(()=>({}));w.error(e(`detail.toast.sendFailed`),{description:t.error})}}catch{w.error(e(`detail.toast.networkError`))}finally{Y(!1)}}}async function be(){if(_)try{let t=await fetch(`${u()}/jobs/${_.id}/diagnostic`);if(!t.ok){let n=await t.json().catch(()=>({}));throw Error(n.error??e(`detail.toast.exportFailedHttp`,{status:t.status}))}let n=await t.blob(),r=URL.createObjectURL(n),i=new Date().toISOString().slice(0,10),a=document.createElement(`a`);a.href=r,a.download=`specrails-diagnostic-${_.id}-${i}.zip`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(r)}catch(t){w.error(e(`detail.toast.exportFailed`),{description:t.message})}}async function xe(){if(_)try{let t=await fetch(`${u()}/spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({command:_.command})}),n=await t.json();if(!t.ok)throw Error(n.error??e(`detail.toast.spawnFailed`));w.success(e(`detail.toast.jobRequeued`)),p(`/jobs/${n.jobId}`)}catch(e){w.error(e.message)}}if(oe)return(0,L.jsx)(`div`,{className:`max-w-5xl mx-auto px-4 py-6`,children:(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(`div`,{className:`h-4 w-48 bg-muted/30 rounded animate-pulse`}),(0,L.jsx)(`div`,{className:`h-20 bg-muted/30 rounded-lg animate-pulse`}),(0,L.jsx)(`div`,{className:`h-64 bg-muted/30 rounded-lg animate-pulse`})]})});if(ce||!_)return(0,L.jsxs)(`div`,{className:`max-w-5xl mx-auto px-4 py-6 flex flex-col items-center gap-3 mt-12`,children:[(0,L.jsx)(`p`,{className:`text-lg font-semibold`,children:e(`detail.notFound`)}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`detail.notFoundDescription`,{id:r})}),(0,L.jsx)(d,{asChild:!0,variant:`outline`,size:`sm`,children:(0,L.jsxs)(ne,{to:`/`,children:[(0,L.jsx)(F,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.backToDashboard`)]})})]});let Se=_e[_.status]??_e.queued,Ce=_.status===`running`,we=_.status===`completed`||_.status===`failed`,Te=!!_.interactive,Ee=Te&&Ce,De=(_.tickets?.length??0)>0,Oe=P.length>1?{totalCostUsd:P.reduce((e,t)=>e+(t.total_cost_usd??0),0),totalTokensIn:P.reduce((e,t)=>e+(t.tokens_in??0),0),totalTokensOut:P.reduce((e,t)=>e+(t.tokens_out??0),0),totalTokensCacheRead:P.reduce((e,t)=>e+(t.tokens_cache_read??0),0),totalTokensCacheCreate:P.reduce((e,t)=>e+(t.tokens_cache_create??0),0),jobCount:P.length}:null;return(0,L.jsxs)(`div`,{"data-job-detail-surface":!0,className:`flex flex-col h-full max-w-5xl mx-auto w-full`,children:[(0,L.jsxs)(`div`,{className:`px-4 py-4 border-b border-border space-y-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,L.jsxs)(ne,{to:`/`,className:`hover:text-foreground transition-colors flex items-center gap-1`,children:[(0,L.jsx)(F,{className:`w-3 h-3`}),e(`detail.breadcrumbDashboard`)]}),(0,L.jsx)(i,{className:`w-3 h-3`}),(0,L.jsx)(`span`,{className:`text-foreground font-mono`,children:e(`detail.breadcrumbJob`,{id:r?.slice(0,8)})})]}),De&&(0,L.jsx)(ue,{tickets:_.tickets??[],onTicketClick:m}),(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,L.jsxs)(n,{children:[(0,L.jsx)(a,{asChild:!0,children:(0,L.jsx)(`div`,{children:(0,L.jsx)(c,{variant:Se.variant,children:e(Se.labelKey)})})}),(0,L.jsx)(A,{children:e(Se.tooltipKey)})]}),(0,L.jsx)(`code`,{className:M(`font-mono text-foreground/90 truncate`,De?`text-xs text-muted-foreground`:`text-sm`),children:ie(_.command,l)})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground flex-wrap`,children:[(0,L.jsx)(`span`,{children:_.started_at?e(`detail.startedAgo`,{timeAgo:k(new Date(_.started_at),{addSuffix:!0,locale:t()})}):e(`detail.queuedWaiting`)}),_.model&&(0,L.jsx)(`span`,{className:`text-muted-foreground/40`,children:_.model})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[_.hasTelemetry&&(0,L.jsxs)(n,{children:[(0,L.jsx)(a,{asChild:!0,children:(0,L.jsxs)(d,{variant:`outline`,size:`sm`,className:`h-7`,onClick:be,"aria-label":e(`detail.exportDiagnosticAria`),children:[(0,L.jsx)(re,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.exportDiagnostic`)]})}),(0,L.jsx)(A,{children:e(`detail.exportDiagnosticTooltip`)})]}),we&&(0,L.jsxs)(n,{children:[(0,L.jsx)(a,{asChild:!0,children:(0,L.jsxs)(d,{variant:`outline`,size:`sm`,onClick:xe,className:`h-7`,children:[(0,L.jsx)(ee,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.reExecute`)]})}),(0,L.jsx)(A,{children:e(`detail.reExecuteTooltip`)})]}),Ee&&(0,L.jsxs)(n,{children:[(0,L.jsx)(a,{asChild:!0,children:(0,L.jsxs)(d,{variant:`outline`,size:`sm`,onClick:ve,disabled:K,className:`h-7 border-accent-success/40 text-accent-success hover:bg-accent-success/10`,children:[(0,L.jsx)(j,{className:`w-3.5 h-3.5 mr-1.5`}),e(K?`detail.finalizing`:`detail.finalizeJob`)]})}),(0,L.jsx)(A,{children:e(`detail.finalizeJobTooltip`)})]}),Ce&&(0,L.jsxs)(n,{children:[(0,L.jsx)(a,{asChild:!0,children:(0,L.jsx)(d,{variant:`outline`,size:`sm`,onClick:ge,className:`h-7 border-destructive/30 text-destructive hover:bg-destructive/10`,children:e(Te?`detail.cancelInteractive`:`detail.cancelJob`)})}),(0,L.jsx)(A,{children:e(`detail.cancelJobTooltip`)})]})]})]}),(0,L.jsx)(ae,{phases:O,phaseDefinitions:S})]}),(_.status===`running`||_.status===`completed`||_.status===`failed`)&&(0,L.jsx)(le,{job:_,events:y,defaultOpen:_.status===`completed`||_.status===`running`,pipelineTotals:Oe??void 0,phases:O,phaseDefinitions:S}),(0,L.jsx)(`div`,{className:`flex-1 overflow-hidden relative`,children:(0,L.jsx)(pe,{events:y})}),Ee&&(0,L.jsxs)(`div`,{className:`shrink-0 border-t border-border/40 bg-surface/40 px-3 py-2 space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[H&&(0,L.jsx)(C,{className:`w-3 h-3 animate-spin`}),e(H?`detail.interactive.working`:`detail.interactive.ready`)]}),B&&(0,L.jsx)(`span`,{className:`tabular-nums`,children:e(`detail.interactive.liveTotals`,{turns:B.num_turns,cost:B.total_cost_usd.toFixed(4)})})]}),(0,L.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,L.jsx)(`textarea`,{value:W,onChange:e=>G(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),ye())},rows:2,placeholder:e(`detail.interactive.placeholder`),"aria-label":e(`detail.interactive.placeholder`),className:`flex-1 resize-none rounded-md border border-border/50 bg-background px-2.5 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring`}),(0,L.jsxs)(d,{size:`sm`,onClick:()=>void ye(),disabled:J||!W.trim(),className:`h-9 shrink-0`,children:[(0,L.jsx)(h,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.interactive.send`)]})]})]})]})}export{ve as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{A as t,Bt as n,C as r,Ct as i,E as a,It as o,L as s,M as c,N as l,P as u,Qt as d,R as f,Rt as p,V as m,W as h,Zt as g,_ as ee,bn as _,dn as v,fn as y,g as te,gn as b,j as x,k as S,lt as C,n as w,u as T,w as E,wt as D,xt as ne,zt as O}from"./index-CEunZ8kJ.js";import{t as k}from"./ExportDropdown-ClTut9WA.js";import{t as re}from"./format-command-CMsBTOPN.js";var ie=o(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),A=e(_(),1),j=g();function M(e){if(e==null)return`—`;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function N(e){return e==null?`—`:e===0?`$0`:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function P(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function F({label:e,a:t,b:n,highlight:r}){return(0,j.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 py-2 border-b border-border/20 last:border-0 text-xs`,children:[(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,j.jsx)(`span`,{className:`font-mono text-right ${r===`a`?`text-emerald-400 aurora-light:text-accent-success font-semibold`:``}`,children:t}),(0,j.jsx)(`span`,{className:`font-mono text-right ${r===`b`?`text-emerald-400 aurora-light:text-accent-success font-semibold`:``}`,children:n})]})}function I(e,t,n=!0){return e==null||t==null||e===t?null:n?e<t?`a`:`b`:e>t?`a`:`b`}function ae({jobIds:e,onClose:t}){let{t:n}=y(`jobs`),[r,a]=(0,A.useState)(null),[o,s]=(0,A.useState)(!0),[c,l]=(0,A.useState)(null);(0,A.useEffect)(()=>{let t=new AbortController;return fetch(`${d()}/jobs/compare?jobIds=${e.join(`,`)}`,{signal:t.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{a(e),s(!1)}).catch(e=>{e.name!==`AbortError`&&(l(e.message),s(!1))}),()=>t.abort()},[e]);function u(e,t){return(0,j.jsxs)(`div`,{className:`text-center space-y-1`,children:[(0,j.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:n(`comparison.jobN`,{n:t+1})}),(0,j.jsx)(`code`,{className:`text-[10px] text-foreground/70 block truncate max-w-[160px] mx-auto`,children:e.command}),(0,j.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-[10px]`,children:[e.status===`completed`?(0,j.jsx)(D,{className:`w-3 h-3 text-emerald-400 aurora-light:text-accent-success`}):(0,j.jsx)(i,{className:`w-3 h-3 text-rose-400 aurora-light:text-destructive`}),(0,j.jsx)(`span`,{className:`capitalize text-muted-foreground`,children:n(`statusLabel.${e.status}`,{defaultValue:e.status})})]}),(0,j.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-mono`,children:e.id.slice(0,8)})]})}return(0,j.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:t,children:(0,j.jsxs)(`div`,{className:`w-full max-w-lg rounded-xl border border-border/30 bg-popover p-5 shadow-xl space-y-4 mx-4`,onClick:e=>e.stopPropagation(),children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`h2`,{className:`text-sm font-semibold`,children:n(`comparison.title`)}),(0,j.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted-foreground hover:text-foreground transition-colors`,children:(0,j.jsx)(m,{className:`w-4 h-4`})})]}),o&&(0,j.jsx)(`div`,{className:`space-y-2`,children:[0,1,2,3].map(e=>(0,j.jsx)(`div`,{className:`h-8 bg-muted/20 rounded animate-pulse`},e))}),c&&(0,j.jsx)(`p`,{className:`text-xs text-red-400 aurora-light:text-destructive`,children:n(`comparison.loadFailed`,{error:c})}),r&&(()=>{let[e,t]=r.jobs,i=I(e.durationMs,t.durationMs,!0),a=I(e.totalCostUsd,t.totalCostUsd,!0),o=I(e.tokensOut==null?null:e.tokensOut,t.tokensOut==null?null:t.tokensOut,!0);return(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pb-3 border-b border-border/30 mb-1`,children:[(0,j.jsx)(`div`,{}),u(e,0),u(t,1)]}),(0,j.jsx)(F,{label:n(`comparison.duration`),a:M(e.durationMs),b:M(t.durationMs),highlight:i}),(0,j.jsx)(F,{label:n(`comparison.cost`),a:N(e.totalCostUsd),b:N(t.totalCostUsd),highlight:a}),(0,j.jsx)(F,{label:n(`comparison.tokensOut`),a:P(e.tokensOut),b:P(t.tokensOut),highlight:o}),(0,j.jsx)(F,{label:n(`comparison.tokensIn`),a:P(e.tokensIn),b:P(t.tokensIn),highlight:null}),(0,j.jsx)(F,{label:n(`comparison.cacheRead`),a:P(e.tokensCacheRead),b:P(t.tokensCacheRead),highlight:null}),(0,j.jsx)(F,{label:n(`comparison.model`),a:e.model??`—`,b:t.model??`—`,highlight:null}),(0,j.jsx)(F,{label:n(`comparison.phasesDone`),a:e.phasesCompleted.length>0?e.phasesCompleted.join(`, `):`—`,b:t.phasesCompleted.length>0?t.phasesCompleted.join(`, `):`—`,highlight:null})]})})(),r&&(0,j.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60 text-center`,children:n(`comparison.betterValueHint`)})]})})}var oe={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.done`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queuedToRun`},zombie_terminated:{variant:`failed`,labelKey:`statusLabel.zombie`,tooltipKey:`statusTooltip.zombie`},skipped:{variant:`warning`,labelKey:`statusLabel.skipped`,tooltipKey:`statusTooltip.skipped`}},se=[`running`,`completed`,`failed`,`canceled`,`zombie_terminated`,`queued`,`skipped`],L={critical:{className:`bg-red-500/15 aurora-light:bg-destructive/10 text-red-400 aurora-light:text-destructive border-red-500/30 aurora-light:border-destructive/30`,labelKey:`recent.priority.critical`},high:{className:`bg-orange-500/15 aurora-light:bg-accent-warning/10 text-orange-400 aurora-light:text-accent-warning border-orange-500/30 aurora-light:border-accent-warning/30`,labelKey:`recent.priority.high`},normal:{className:``,labelKey:`recent.priority.normal`},low:{className:`bg-gray-500/15 aurora-light:bg-muted text-gray-400 aurora-light:text-muted-foreground border-gray-500/30 aurora-light:border-border`,labelKey:`recent.priority.low`}};function ce(e){return e==null||e===0?null:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function le(e,t){if(!t)return null;let n=new Date(t).getTime()-new Date(e).getTime();if(n<0)return null;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function ue(e){return e==null||e===0?null:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function de(e){try{return T(new Date(e),{addSuffix:!0,locale:n()})}catch{return e}}var R=10;function z({jobs:e,isLoading:n,onJobsCleared:i,onProposalClick:o,onProposalDelete:m}){let{t:g}=y(`jobs`),ee=b(),{activeProjectId:_,projects:te}=p(),w=te.find(e=>e.id===_)?.provider,[T,D]=(0,A.useState)(null),[O,k]=(0,A.useState)(``),[M,N]=(0,A.useState)(``),[P,F]=(0,A.useState)(!1),[I,z]=(0,A.useState)(``),[B,V]=(0,A.useState)(``),[H,U]=(0,A.useState)(!1),[W,G]=(0,A.useState)(null),[K,q]=(0,A.useState)(R),[J,Y]=(0,A.useState)(!1),[X,Z]=(0,A.useState)([]),[fe,Q]=(0,A.useState)(null);(0,A.useEffect)(()=>{q(R)},[e.length]);function pe(){Y(e=>!e),Z([])}function me(e){Z(t=>{if(t.includes(e))return t.filter(t=>t!==e);if(t.length>=2)return t;let n=[...t,e];return n.length===2&&Q(n),n})}let $=e.filter(e=>!(T&&e.status!==T||O&&e.started_at<O||M&&e.started_at>`${M}T23:59:59`)),he=e.filter(e=>!(I&&e.started_at<I||B&&e.started_at>`${B}T23:59:59`)).length;async function ge(e){U(!0);try{let t={};e===`range`&&(I&&(t.from=I),B&&(t.to=B));let n=await fetch(`${d()}/jobs`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(n.ok){let e=await n.json();v.success(g(`recent.toast.cleared`,{count:e.deleted})),F(!1),z(``),V(``),i?.()}else v.error(g(`recent.toast.clearFailed`))}catch{v.error(g(`recent.toast.networkError`))}finally{U(!1)}}return n?(0,j.jsx)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-1`,children:[0,1,2].map(e=>(0,j.jsx)(`div`,{className:`h-9 bg-muted/30 rounded-md animate-pulse`},e))}):e.length===0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border/40 bg-card/50 p-8 text-center space-y-2`,children:[(0,j.jsx)(ne,{className:`w-8 h-8 text-muted-foreground/30 mx-auto`}),(0,j.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:g(`recent.emptyTitle`)}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:g(`recent.emptyDescription`)})]}):(0,j.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:()=>D(null),className:`px-2 py-0.5 rounded text-[10px] font-medium transition-colors ${T===null?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:g(`recent.filterAll`,{count:e.length})}),se.map(t=>{let n=e.filter(e=>e.status===t).length;return n===0?null:(0,j.jsx)(`button`,{type:`button`,onClick:()=>D(T===t?null:t),className:`px-2 py-0.5 rounded text-[10px] font-medium capitalize transition-colors ${T===t?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:g(`recent.filterStatus`,{status:g(`statusName.${t}`),count:n})},t)})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`input`,{type:`date`,value:O,onChange:e=>k(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:g(`recent.fromDate`)}),(0,j.jsx)(`input`,{type:`date`,value:M,onChange:e=>N(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:g(`recent.toDate`)}),(O||M)&&(0,j.jsx)(`button`,{type:`button`,onClick:()=>{k(``),N(``)},className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:g(`recent.clear`)}),(0,j.jsxs)(r,{children:[(0,j.jsx)(a,{asChild:!0,children:(0,j.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 transition-colors ${J?`text-foreground bg-accent`:`text-muted-foreground hover:text-foreground`}`,onClick:pe,children:(0,j.jsx)(ie,{className:`w-3.5 h-3.5`})})}),(0,j.jsx)(E,{children:g(J?`recent.exitCompareMode`:`recent.compareTwoJobs`)})]}),(0,j.jsxs)(r,{children:[(0,j.jsx)(a,{asChild:!0,children:(0,j.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 text-muted-foreground hover:text-destructive`,onClick:()=>F(!0),children:(0,j.jsx)(h,{className:`w-3.5 h-3.5`})})}),(0,j.jsx)(E,{children:g(`recent.clearJobs`)})]})]})]}),J&&(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-md bg-accent/40 px-3 py-1.5 text-[10px] text-muted-foreground`,children:[(0,j.jsxs)(`span`,{children:[X.length===0&&g(`recent.selectTwoToCompare`),X.length===1&&g(`recent.selectOneMore`),X.length===2&&g(`recent.readyToCompare`)]}),X.length===2&&(0,j.jsx)(`button`,{type:`button`,className:`text-[10px] font-medium text-foreground hover:underline`,onClick:()=>Q(X),children:g(`recent.compareAction`)})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1 text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:[(0,j.jsx)(`span`,{className:`w-14`,children:g(`recent.colStatus`)}),(0,j.jsx)(`span`,{className:`flex-1 min-w-0`,children:g(`recent.colCommand`)}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,j.jsx)(`span`,{className:`w-14 text-right`,children:g(`recent.colDuration`)}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:g(`recent.colTokens`)}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:g(`recent.colCost`)}),(0,j.jsx)(`span`,{className:`w-20 text-right`,children:g(`recent.colStarted`)})]})]}),(0,j.jsx)(`div`,{className:`space-y-0.5`,children:$.slice(0,K).map(e=>{let t=oe[e.status]??oe.queued,n=ce(e.total_cost_usd),i=le(e.started_at,e.finished_at),c=ue((e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0)||null),l=e.id.startsWith(`proposal:`),u=l?e.id.replace(`proposal:`,``):null,d=X.includes(e.id),f=J&&!l&&X.length===2&&!d;return(0,j.jsxs)(`div`,{role:`button`,tabIndex:0,className:`flex items-center gap-3 px-3 py-2 rounded-md transition-colors cursor-pointer group ${d?`bg-accent/70 ring-1 ring-border`:f?`opacity-40 cursor-not-allowed`:`hover:bg-accent/50`}`,onClick:()=>{if(J&&!l){me(e.id);return}l&&u?o?.(u):ee(`/jobs/${e.id}`)},children:[(0,j.jsxs)(r,{children:[(0,j.jsx)(a,{asChild:!0,children:(0,j.jsx)(`div`,{children:(0,j.jsx)(s,{variant:t.variant,children:g(t.labelKey)})})}),(0,j.jsx)(E,{children:g(t.tooltipKey)})]}),e.priority&&e.priority!==`normal`&&(0,j.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border ${L[e.priority].className}`,children:g(L[e.priority].labelKey)}),e.profile_name&&(0,j.jsxs)(r,{children:[(0,j.jsx)(a,{asChild:!0,children:(0,j.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border border-accent-primary/40 bg-accent-primary/10 text-accent-primary/90`,children:e.profile_name})}),(0,j.jsx)(E,{children:g(`recent.profileTooltip`,{name:e.profile_name})})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1 flex-1 min-w-0`,children:[e.pipeline_id&&(0,j.jsxs)(r,{children:[(0,j.jsx)(a,{asChild:!0,children:(0,j.jsx)(C,{className:`w-3 h-3 text-accent-primary/60 shrink-0`})}),(0,j.jsxs)(E,{children:[g(`recent.pipelinePart`),e.depends_on_job_id&&` ${g(`recent.pipelineDependsOn`)}`,e.skip_reason&&` — ${e.skip_reason}`]})]}),(0,j.jsx)(`code`,{className:`text-xs text-foreground/80 truncate`,children:re(e.command,w)})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground shrink-0`,children:[(0,j.jsx)(`span`,{className:`w-14 text-right`,children:i??`—`}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:c?`${c}`:`—`}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:n??`—`}),(0,j.jsx)(`span`,{className:`w-20 text-right`,children:de(e.started_at)}),l&&u&&(0,j.jsx)(`button`,{type:`button`,className:`w-4 h-4 md:opacity-0 md:group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all`,onClick:e=>{e.stopPropagation(),G(u)},title:g(`recent.deleteProposal`),children:(0,j.jsx)(h,{className:`w-3 h-3`})})]})]},e.id)})}),$.length>K&&(0,j.jsx)(`div`,{className:`pt-1 text-center`,children:(0,j.jsx)(`button`,{type:`button`,onClick:()=>q(e=>e+R),className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors px-3 py-1 rounded hover:bg-accent/50`,children:g(`recent.loadMore`,{count:$.length-K})})}),P&&(0,j.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:()=>F(!1),children:(0,j.jsxs)(`div`,{className:`w-80 rounded-xl border border-border/30 bg-popover p-4 shadow-lg space-y-4`,onClick:e=>e.stopPropagation(),children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-sm font-semibold`,children:g(`recent.clearModal.title`)}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:g(`recent.clearModal.jobsInHistory`,{count:e.length})})]}),(0,j.jsx)(f,{variant:`destructive`,size:`sm`,className:`w-full`,disabled:H,onClick:()=>ge(`all`),children:g(`recent.clearModal.clearAll`,{count:e.length})}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:g(`recent.clearModal.orByRange`)}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`input`,{type:`date`,value:I,onChange:e=>z(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:g(`recent.clearModal.fromPlaceholder`)}),(0,j.jsx)(`input`,{type:`date`,value:B,onChange:e=>V(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:g(`recent.clearModal.toPlaceholder`)})]}),(0,j.jsx)(f,{variant:`outline`,size:`sm`,className:`w-full`,disabled:H||!I&&!B,onClick:()=>ge(`range`),children:I||B?g(`recent.clearModal.clearInRange`,{count:he}):g(`recent.clearModal.clearRange`)})]}),(0,j.jsx)(f,{variant:`ghost`,size:`sm`,className:`w-full`,onClick:()=>F(!1),children:g(`common:actions.cancel`)})]})}),(0,j.jsx)(S,{open:W!==null,onOpenChange:e=>!e&&G(null),children:(0,j.jsxs)(t,{className:`max-w-sm`,children:[(0,j.jsxs)(l,{children:[(0,j.jsx)(u,{children:g(`recent.deleteProposalConfirm.title`)}),(0,j.jsx)(x,{children:g(`recent.deleteProposalConfirm.description`)})]}),(0,j.jsxs)(c,{children:[(0,j.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>G(null),children:g(`common:actions.cancel`)}),(0,j.jsx)(f,{variant:`destructive`,size:`sm`,onClick:()=>{W&&m?.(W),G(null)},children:g(`common:actions.delete`)})]})]})}),fe&&(0,j.jsx)(ae,{jobIds:fe,onClose:()=>{Q(null),Z([]),Y(!1)}})]})}function B(){let{t:e}=y(`jobs`),{activeProjectId:n}=p(),{recentJobs:r}=w(n),{data:i,isFirstLoad:a,refresh:o}=O({namespace:`jobs`,projectId:n,initialValue:r,fetcher:async()=>{let e=await fetch(`${d()}/jobs?limit=10`);return e.ok?(await e.json()).jobs:[]},pollInterval:1e4}),{data:m}=O({namespace:`proposals`,projectId:n,initialValue:[],fetcher:async()=>{let e=await fetch(`${d()}/propose?limit=10`);return e.ok?(await e.json()).proposals:[]},pollInterval:1e4}),h={input:`queued`,exploring:`running`,review:`running`,refining:`running`,creating_issue:`running`,created:`completed`,cancelled:`canceled`},g=m.map(e=>({id:`proposal:${e.id}`,command:`/specrails:propose-feature ${e.idea.length>60?e.idea.slice(0,57)+`...`:e.idea}`,started_at:e.created_at,status:h[e.status]??`queued`})),_=[...i,...g].sort((e,t)=>new Date(t.started_at).getTime()-new Date(e.started_at).getTime()),[b,x]=(0,A.useState)(null),C=(0,A.useCallback)(async e=>{try{let t=await fetch(`${d()}/propose/${e}`);if(!t.ok)return;x((await t.json()).proposal)}catch{}},[]),T=(0,A.useCallback)(async t=>{try{(await fetch(`${d()}/propose/${t}`,{method:`DELETE`})).ok&&(v.success(e(`page.proposalDeleted`)),o())}catch{}},[o,e]);return(0,j.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 py-6`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,j.jsx)(`h1`,{className:`text-sm font-semibold`,children:e(`page.title`)}),(0,j.jsx)(k,{baseUrl:`${d()}/jobs/export`,label:e(`page.exportJobs`)})]}),(0,j.jsx)(z,{jobs:_,isLoading:a,onJobsCleared:o,onProposalClick:C,onProposalDelete:T}),(0,j.jsx)(S,{open:b!==null,onOpenChange:e=>!e&&x(null),children:(0,j.jsx)(t,{className:`max-w-3xl glass-card`,children:b&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(l,{children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(u,{className:`flex-1 min-w-0`,children:e(`page.proposal.title`)}),(0,j.jsx)(s,{variant:b.status===`created`?`success`:b.status===`cancelled`?`destructive`:`secondary`,children:b.status})]})}),(0,j.jsx)(`div`,{className:`text-xs text-muted-foreground bg-muted/20 rounded px-2 py-1 italic`,children:b.idea}),b.result_markdown?(0,j.jsx)(`div`,{className:`max-h-[400px] overflow-y-auto rounded-lg px-3 py-2 text-xs bg-muted/40`,children:(0,j.jsx)(`div`,{className:`prose prose-invert prose-xs max-w-none prose-p:my-1 prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-code:text-cyan-300 prose-code:text-[10px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded text-foreground/80`,children:(0,j.jsx)(ee,{remarkPlugins:[te],children:b.result_markdown})})}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground py-4 text-center`,children:e(`page.proposal.noContent`)}),b.issue_url&&(0,j.jsxs)(`div`,{className:`text-xs`,children:[e(`page.proposal.githubIssue`),` `,(0,j.jsx)(`a`,{href:b.issue_url,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent-primary hover:underline`,children:b.issue_url})]}),(0,j.jsxs)(c,{children:[(0,j.jsx)(f,{variant:`destructive`,size:`sm`,onClick:()=>{T(b.id),x(null)},children:e(`common:actions.delete`)}),(0,j.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>x(null),children:e(`common:actions.close`)})]})]})})})]})}export{B as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{n as t,r as n,t as r}from"./upload-DsygVwLQ.js";import{A as i,G as a,H as o,It as s,J as c,Lt as l,M as u,N as d,P as f,R as p,Rt as m,S as h,W as g,Zt as _,at as v,bn as y,bt as b,dn as x,f as S,fn as C,ft as w,gn as T,j as E,k as D,m as O,ot as k,p as ee,q as A,rt as te,yt as j,z as M}from"./index-CEunZ8kJ.js";var N=s(`file-down`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]),ne=s(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),P=e(y(),1);function re(e){return{specrailsLoops:1,loops:e.map(e=>({name:e.name,description:e.description,graph:e.graph}))}}function F(e){let t=e;return!!t&&typeof t.name==`string`&&!!t.graph&&typeof t.graph==`object`}function ie(e){let t;try{t=JSON.parse(e)}catch{throw Error(`invalid-json`)}let n=(Array.isArray(t)?t:Array.isArray(t?.loops)?t.loops:F(t)?[t]:[]).filter(F);if(n.length===0)throw Error(`no-loops`);return n.map(e=>({name:e.name,description:e.description??null,graph:e.graph}))}function ae(e){return e.length===1?`${e[0].name.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`loop`}.loop.json`:`specrails-loops-${e.length}.json`}var I=[`API`,`Automation`,`CI`,`Database`,`Debugging`,`DevOps`,`Docs`,`Git`,`Maintenance`,`Performance`,`Planning`,`Quality`,`Review`,`Security`,`Testing`];function oe(e,t){let n=t.query.trim().toLowerCase(),r=t.categories;return e.filter(e=>r.length>0&&!(e.category&&r.includes(e.category))?!1:n?`${e.name} ${e.description} ${e.tags.join(` `)} ${e.category??``} ${e.searchTerms??``}`.toLowerCase().includes(n):!0)}function se(e){let t=new Map;for(let n of e)n.category&&t.set(n.category,(t.get(n.category)??0)+1);let n=[];for(let e of I){let r=t.get(e);r&&(n.push({category:e,count:r}),t.delete(e))}for(let e of[...t.keys()].sort())n.push({category:e,count:t.get(e)});return n}var L=_(),R={start:v,"ai-step":n,shell:a,decider:w,condition:w,end:A};function ce(e){return e.type===`ai-step`?typeof e.data?.prompt==`string`?e.data.prompt:null:e.type===`shell`?typeof e.data?.command==`string`?e.data.command:null:e.type===`decider`?typeof e.data?.goal==`string`?e.data.goal:null:e.type===`end`?e.data?.outcome===`failure`?`failure`:`success`:null}function le({template:e,onClose:t,onUse:r,mode:a=`use`}){let{t:o}=C(`loops`);return(0,L.jsx)(D,{open:e!==null,onOpenChange:e=>{e||t()},children:(0,L.jsx)(i,{className:`max-w-lg`,children:e&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(d,{children:[(0,L.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,L.jsx)(n,{className:`w-4 h-4 text-accent-highlight`}),e.name]}),(0,L.jsx)(E,{children:e.description})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[S(e.graph)?(0,L.jsx)(`span`,{title:o(`gallery.needsSpecHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-secondary/15 text-accent-secondary`,children:o(`gallery.needsSpec`)}):(0,L.jsx)(`span`,{title:o(`gallery.standaloneHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-success/15 text-accent-success`,children:o(`gallery.standalone`)}),e.category&&(0,L.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-info/15 text-accent-info`,children:o(`categories.${e.category}`,{defaultValue:e.category})}),e.tags.map(e=>(0,L.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))]}),(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:o(`preview.limits`,{iterations:e.graph.config.maxIterations,timeout:e.graph.config.timeoutMinutes})}),(0,L.jsxs)(`div`,{className:`max-h-[50vh] overflow-y-auto space-y-1.5 pr-1`,children:[(0,L.jsx)(`span`,{className:`block text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:o(`preview.steps`)}),e.graph.nodes.map((e,t)=>{let n=R[e.type]??A,r=ce(e);return(0,L.jsxs)(`div`,{className:`rounded border border-border bg-surface/30 p-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,L.jsx)(n,{className:`w-3.5 h-3.5 text-accent-primary`}),o(`builder.nodes.${e.type}`)]}),r&&(0,L.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words text-[11px] text-muted-foreground font-mono`,children:r})]},e.id)})]}),(0,L.jsxs)(u,{children:[(0,L.jsx)(p,{variant:`ghost`,onClick:t,children:o(`common:actions.cancel`)}),(0,L.jsxs)(p,{onClick:()=>r(e.id),children:[a===`fork`?(0,L.jsx)(b,{className:`w-3.5 h-3.5 mr-1.5`}):(0,L.jsx)(j,{className:`w-3.5 h-3.5 mr-1.5`}),o(a===`fork`?`actions.fork`:`actions.use`)]})]})]})})})}var z={claude:[{value:`sonnet`,label:`Claude Sonnet`},{value:`opus`,label:`Claude Opus`},{value:`haiku`,label:`Claude Haiku`}],codex:[{value:`gpt-5.5`,label:`GPT-5.5`},{value:`gpt-5.4`,label:`GPT-5.4`},{value:`gpt-5.4-mini`,label:`GPT-5.4 Mini`},{value:`gpt-5.3-codex`,label:`GPT-5.3 Codex`}],gemini:[{value:`gemini-3.5-flash`,label:`Gemini 3.5 Flash`},{value:`gemini-3.1-pro-preview`,label:`Gemini 3.1 Pro (preview)`},{value:`gemini-3.1-flash-lite`,label:`Gemini 3.1 Flash Lite`},{value:`gemini-2.5-flash-lite`,label:`Gemini 2.5 Flash Lite`}]};function B(e){return e&&z[e]||[]}function V(e){return B(e)[0]?.value??``}function ue({loop:e,projects:t,onClose:n,onExecute:r}){let{t:a}=C(`loops`),o=e!==null,[s,c]=(0,P.useState)(``),[l,m]=(0,P.useState)(``),[g,_]=(0,P.useState)(``),[y,b]=(0,P.useState)(`medium`),x=t.find(e=>e.id===(s||t[0]?.id)),S=(0,P.useMemo)(()=>x?.providers??(x?.provider?[x.provider]:[]),[x]),w=l||S[0]||``,T=(0,P.useMemo)(()=>B(w),[w]),O=g||V(w),k=w?h(w):!1;return(0,L.jsx)(D,{open:o,onOpenChange:e=>{e||n()},children:(0,L.jsx)(i,{className:`max-w-sm`,children:e&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(d,{children:[(0,L.jsx)(f,{children:a(`run.title`,{name:e.name})}),(0,L.jsx)(E,{children:a(`run.subtitle`)})]}),(0,L.jsx)(`label`,{className:`block text-[11px] font-medium text-muted-foreground`,children:a(`run.project`)}),t.length===0?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`run.noProjects`)}):(0,L.jsx)(`select`,{"aria-label":a(`run.project`),"data-testid":`run-project-select`,value:s||t[0]?.id,onChange:e=>{c(e.target.value),m(``),_(``)},className:`w-full text-xs rounded border border-border bg-transparent px-2 py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-accent-primary/40`,children:t.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.name},e.id))}),S.length>1&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`label`,{className:`block text-[11px] font-medium text-muted-foreground`,children:a(`run.provider`)}),(0,L.jsx)(`select`,{"aria-label":a(`run.provider`),value:w,onChange:e=>{m(e.target.value),_(``)},className:`w-full text-xs rounded border border-border bg-transparent px-2 py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-accent-primary/40`,children:S.map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))})]}),T.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`label`,{className:`block text-[11px] font-medium text-muted-foreground`,children:a(`run.model`)}),(0,L.jsx)(`select`,{"aria-label":a(`run.model`),"data-testid":`run-model-select`,value:O,onChange:e=>_(e.target.value),className:`w-full text-xs rounded border border-border bg-transparent px-2 py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-accent-primary/40`,children:T.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),k&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`label`,{className:`block text-[11px] font-medium text-muted-foreground`,children:a(`run.effort`)}),(0,L.jsxs)(`select`,{"aria-label":a(`run.effort`),value:y,onChange:e=>b(e.target.value),className:`w-full text-xs rounded border border-border bg-transparent px-2 py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-accent-primary/40`,children:[(0,L.jsx)(`option`,{value:`low`,children:`low`}),(0,L.jsx)(`option`,{value:`medium`,children:`medium`}),(0,L.jsx)(`option`,{value:`high`,children:`high`})]})]}),(0,L.jsxs)(u,{children:[(0,L.jsx)(p,{variant:`ghost`,onClick:n,children:a(`common:actions.cancel`)}),(0,L.jsxs)(p,{onClick:()=>{let e=s||t[0]?.id;e&&r({projectId:e,provider:S.length>1?w:void 0,model:T.length>0?O:void 0,effort:k?y:void 0})},disabled:t.length===0,children:[(0,L.jsx)(v,{className:`w-3.5 h-3.5 mr-1.5`}),a(`run.execute`)]})]})]})})})}var H={draft:`bg-accent-secondary/15 text-accent-secondary ring-accent-secondary/40`,published:`bg-accent-success/15 text-accent-success ring-accent-success/40`};function U({status:e}){let{t}=C(`loops`);return(0,L.jsx)(`span`,{className:M(`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium ring-1 ring-inset`,H[e]),children:t(`status.${e}`)})}function W(){let{t:e}=C(`loops`),n=T(),r=(0,P.useCallback)(e=>e.replace(/:/g,`_`),[]),a=(0,P.useCallback)((t,n)=>e(`catalog.${r(t)}.name`,{defaultValue:n}),[e,r]),s=(0,P.useCallback)((t,n)=>e(`catalog.${r(t)}.description`,{defaultValue:n}),[e,r]),[h,_]=(0,P.useState)([]),[v,y]=(0,P.useState)([]),[w,k]=(0,P.useState)([]),[A,F]=(0,P.useState)(!0),[I,R]=(0,P.useState)(null),[ce,z]=(0,P.useState)(null),[B,V]=(0,P.useState)(`use`),[H,U]=(0,P.useState)(null),[W,K]=(0,P.useState)(new Set),fe=`specrails-desktop:loop-template-filter`,pe=(()=>{try{let e=localStorage.getItem(fe),t=e?JSON.parse(e):null;return{query:typeof t?.query==`string`?t.query:``,categories:Array.isArray(t?.categories)?t.categories:[]}}catch{return{query:``,categories:[]}}})(),[q,me]=(0,P.useState)(pe.query),[J,he]=(0,P.useState)(pe.categories);(0,P.useEffect)(()=>{try{localStorage.setItem(fe,JSON.stringify({query:q,categories:J}))}catch{}},[q,J]);let ge=(0,P.useCallback)(e=>{he(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),_e=(0,P.useCallback)(()=>{me(``),he([])},[]),ve=(0,P.useRef)(null),{projects:ye,setActiveProjectId:be}=m(),xe=(0,P.useCallback)(e=>{K(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Y=(0,P.useCallback)(e=>{if(e.length===0)return;let t=new Blob([JSON.stringify(re(e),null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=ae(e),r.click(),URL.revokeObjectURL(n)},[]),X=(0,P.useCallback)(async()=>{try{let[e,t]=await Promise.all([O.list(),O.templates()]);_(e),y(t)}catch{x.error(e(`errors.load`))}finally{F(!1)}try{k(await O.factoryLoops())}catch{k([])}},[e]);(0,P.useEffect)(()=>{X()},[X]);let Se=(0,P.useCallback)(async t=>{try{let n=ie(await t.text()),{imported:r,skipped:i}=await O.importLoops(n);await X(),r.length&&x.success(e(`import.done`,{count:r.length})),i.length&&x.warning(e(`import.skipped`,{count:i.length,names:i.join(`, `)})),!r.length&&!i.length&&x.warning(e(`import.invalid`))}catch(t){let n=t instanceof Error?t.message:``;x.error(e(n===`invalid-json`||n===`no-loops`?`import.invalid`:`errors.save`))}},[X,e]),Z=(0,P.useCallback)(e=>n(`/loops/${e}/edit`),[n]),Ce=(0,P.useCallback)(async()=>{try{Z((await O.create({name:e(`newLoopName`)})).id)}catch{x.error(e(`errors.save`))}},[e,Z]),we=(0,P.useCallback)(async t=>{try{Z((await O.fromTemplate(t)).id)}catch{x.error(e(`errors.save`))}},[e,Z]),Te=(0,P.useCallback)(async t=>{try{Z((await O.forkFactory(t)).id)}catch{x.error(e(`errors.save`))}},[e,Z]),Ee=(0,P.useCallback)(async({projectId:t,provider:r,model:i,effort:a})=>{let o=H;if(o){U(null);try{let{loopRunId:s}=await O.runStandalone(t,o.id,{aiEngine:r,model:i,reasoning_effort:a});be(t),n(`/jobs/${s}`),x.success(e(`run.launched`,{name:o.name}))}catch{x.error(e(`errors.save`))}}},[H,n,be,e]),De=(0,P.useCallback)(e=>{V(`fork`),z({id:e.id,name:a(e.id,e.name),description:s(e.id,e.description),tags:e.claudeOnly?[`claude-only`]:[],graph:e.graph})},[a,s]),Oe=(0,P.useCallback)(async t=>{try{await O.publish(t),await X()}catch(t){t instanceof ee?x.error(e(`errors.publishInvalid`)):x.error(e(`errors.save`))}},[e,X]),ke=(0,P.useCallback)(async t=>{try{await O.unpublish(t),await X()}catch{x.error(e(`errors.save`))}},[e,X]),Ae=(0,P.useCallback)(async t=>{try{await O.duplicate(t),await X()}catch{x.error(e(`errors.save`))}},[e,X]),je=(0,P.useCallback)(e=>R(e),[]),Me=(0,P.useCallback)(async()=>{let t=I;if(t){R(null);try{await O.remove(t),await X()}catch{x.error(e(`errors.save`))}}},[I,e,X]),Q=h.filter(e=>e.status===`draft`),$=h.filter(e=>e.status===`published`),Ne=se(v),Pe=oe(v.map(t=>({...t,searchTerms:`${a(t.id,t.name)} ${s(t.id,t.description)} ${t.category?e(`categories.${t.category}`,{defaultValue:t.category}):``}`})),{query:q,categories:J}),Fe=q.trim()!==``||J.length>0;return(0,L.jsxs)(`div`,{className:`h-full overflow-y-auto`,children:[(0,L.jsxs)(`div`,{className:`max-w-5xl mx-auto px-6 py-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between mb-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,L.jsx)(o,{className:`w-5 h-5 text-accent-primary`}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:e(`title`)}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`subtitle`)})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[W.size>0&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>Y(h.filter(e=>W.has(e.id))),className:`inline-flex items-center gap-1.5 h-8 px-3 rounded-md text-xs font-medium border border-border text-foreground hover:bg-muted`,children:[(0,L.jsx)(N,{className:`w-3.5 h-3.5`}),e(`actions.export`),` (`,W.size,`)`]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>ve.current?.click(),className:`inline-flex items-center gap-1.5 h-8 px-3 rounded-md text-xs font-medium border border-border text-foreground hover:bg-muted`,children:[(0,L.jsx)(ne,{className:`w-3.5 h-3.5`}),e(`actions.import`)]}),(0,L.jsx)(`input`,{ref:ve,type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&Se(t),e.target.value=``}}),(0,L.jsxs)(`button`,{type:`button`,onClick:Ce,className:`inline-flex items-center gap-1.5 h-8 px-3 rounded-md text-xs font-medium bg-accent-primary text-white hover:bg-accent-primary/90`,children:[(0,L.jsx)(te,{className:`w-3.5 h-3.5`}),e(`newLoop`)]})]})]}),A?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`…`}):(0,L.jsxs)(`div`,{className:`space-y-8`,children:[Q.length===0&&$.length===0&&(0,L.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border p-8 text-center`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e(`empty.title`)}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:e(`empty.body`)})]}),$.length>0&&(0,L.jsx)(G,{title:e(`sections.published`),children:$.map(e=>(0,L.jsx)(de,{loop:e,selected:W.has(e.id),onToggleSelect:()=>xe(e.id),onEdit:()=>Z(e.id),onUnpublish:()=>ke(e.id),onDuplicate:()=>Ae(e.id),onExport:()=>Y([e]),onDelete:()=>je(e.id),onRun:S(e.graph)?void 0:()=>U(e)},e.id))}),Q.length>0&&(0,L.jsx)(G,{title:e(`sections.drafts`),children:Q.map(e=>(0,L.jsx)(de,{loop:e,selected:W.has(e.id),onToggleSelect:()=>xe(e.id),onEdit:()=>Z(e.id),onPublish:()=>Oe(e.id),onDuplicate:()=>Ae(e.id),onExport:()=>Y([e]),onDelete:()=>je(e.id)},e.id))}),w.length>0&&(0,L.jsx)(G,{title:e(`sections.builtIn`),children:w.map(n=>(0,L.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-3 flex flex-col gap-2`,"data-testid":`factory-loop-card`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(o,{className:`w-3.5 h-3.5 text-accent-primary`}),(0,L.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:a(n.id,n.name)}),(0,L.jsx)(`span`,{className:`ml-auto px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e(`builtInBadge`)})]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground flex-1`,children:s(n.id,n.description)}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>De(n),className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md text-xs border border-border hover:bg-muted text-foreground`,children:[(0,L.jsx)(t,{className:`w-3 h-3`}),e(`actions.preview`)]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>void Te(n.id),className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md text-xs border border-border hover:bg-muted text-foreground`,children:[(0,L.jsx)(b,{className:`w-3 h-3`}),e(`actions.fork`)]})]})]},n.id))}),v.length>0&&(0,L.jsxs)(`section`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-2 flex-wrap`,children:[(0,L.jsx)(`h2`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e(`sections.templates`)}),(0,L.jsx)(`input`,{type:`search`,value:q,onChange:e=>me(e.target.value),placeholder:e(`gallery.search`),"aria-label":e(`gallery.search`),"data-testid":`template-search`,className:`h-7 w-48 max-w-full rounded-md border border-border bg-surface/40 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/70 focus:outline-none focus:ring-1 focus:ring-accent-primary`})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-3`,"data-testid":`category-chips`,children:[Ne.map(({category:t,count:n})=>{let r=J.includes(t);return(0,L.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>ge(t),className:M(`inline-flex items-center gap-1 h-6 px-2 rounded-full text-[11px] border transition-colors`,r?`border-accent-primary bg-accent-primary/15 text-accent-primary`:`border-border bg-surface/40 text-muted-foreground hover:text-foreground hover:bg-muted`),children:[e(`categories.${t}`,{defaultValue:t}),(0,L.jsx)(`span`,{className:`opacity-60 tabular-nums`,children:n})]},t)}),Fe&&(0,L.jsx)(`button`,{type:`button`,onClick:_e,className:`inline-flex items-center h-6 px-2 rounded-full text-[11px] text-accent-primary hover:underline`,children:e(`gallery.clearFilter`)})]}),Pe.length===0?(0,L.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border p-6 text-center`,"data-testid":`template-empty`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`gallery.noResults`)}),(0,L.jsx)(`button`,{type:`button`,onClick:_e,className:`mt-2 text-xs text-accent-primary hover:underline`,children:e(`gallery.clearFilter`)})]}):(0,L.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:Pe.map(n=>(0,L.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-3 flex flex-col gap-2`,"data-testid":`template-card`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(c,{className:`w-3.5 h-3.5 text-accent-highlight flex-shrink-0`}),(0,L.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:a(n.id,n.name)}),n.category&&(0,L.jsx)(`span`,{className:`ml-auto px-1.5 py-0.5 rounded text-[10px] bg-accent-info/15 text-accent-info flex-shrink-0`,children:e(`categories.${n.category}`,{defaultValue:n.category})})]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground flex-1`,children:s(n.id,n.description)}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[S(n.graph)?(0,L.jsx)(`span`,{title:e(`gallery.needsSpecHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-secondary/15 text-accent-secondary`,children:e(`gallery.needsSpec`)}):(0,L.jsx)(`span`,{title:e(`gallery.standaloneHint`),className:`px-1.5 py-0.5 rounded text-[10px] bg-accent-success/15 text-accent-success`,children:e(`gallery.standalone`)}),n.tags.map(e=>(0,L.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{V(`use`),z({...n,name:a(n.id,n.name),description:s(n.id,n.description)})},className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md text-xs border border-border hover:bg-muted text-foreground`,children:[(0,L.jsx)(t,{className:`w-3 h-3`}),e(`actions.preview`)]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>we(n.id),className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md text-xs border border-border hover:bg-muted text-foreground`,children:[(0,L.jsx)(j,{className:`w-3 h-3`}),e(`actions.use`)]})]})]},n.id))})]})]})]}),(0,L.jsx)(D,{open:I!==null,onOpenChange:e=>{e||R(null)},children:(0,L.jsxs)(i,{className:`max-w-sm`,children:[(0,L.jsxs)(d,{children:[(0,L.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,L.jsx)(g,{className:`w-4 h-4 text-destructive`}),h.find(e=>e.id===I)?.name??e(`actions.delete`)]}),(0,L.jsx)(E,{children:e(`confirmDelete`)})]}),(0,L.jsxs)(u,{children:[(0,L.jsx)(p,{variant:`ghost`,onClick:()=>R(null),children:e(`common:actions.cancel`)}),(0,L.jsx)(p,{variant:`destructive`,onClick:()=>void Me(),children:e(`common:actions.delete`)})]})]})}),(0,L.jsx)(le,{template:ce,mode:B,onClose:()=>z(null),onUse:e=>{z(null),B===`fork`?Te(e):we(e)}}),(0,L.jsx)(ue,{loop:H?{id:H.id,name:H.name}:null,projects:ye.map(e=>({id:e.id,name:e.name,providers:l(e)})),onClose:()=>U(null),onExecute:Ee})]})}function G({title:e,children:t}){return(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`h2`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2`,children:e}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:t})]})}function de({loop:e,selected:t,onToggleSelect:n,onEdit:i,onPublish:a,onUnpublish:o,onDuplicate:s,onExport:c,onDelete:l,onRun:u}){let{t:d}=C(`loops`),f=e.graph?.nodes?.length??0;return(0,L.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-3 flex flex-col gap-2`,"data-testid":`loop-card`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:t,onChange:n,"aria-label":d(`actions.select`,{name:e.name}),className:`accent-accent-primary flex-shrink-0`}),(0,L.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:e.name})]}),(0,L.jsx)(U,{status:e.status})]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d(`card.nodes`,{count:f})}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:[u&&(0,L.jsx)(K,{icon:v,label:d(`actions.run`),onClick:u}),(0,L.jsx)(K,{icon:k,label:d(`actions.edit`),onClick:i}),a&&(0,L.jsx)(K,{icon:r,label:d(`actions.publish`),onClick:a}),o&&(0,L.jsx)(K,{icon:j,label:d(`actions.unpublish`),onClick:o}),(0,L.jsx)(K,{icon:b,label:d(`actions.duplicate`),onClick:s}),(0,L.jsx)(K,{icon:N,label:d(`actions.export`),onClick:c}),(0,L.jsx)(K,{icon:g,label:d(`actions.delete`),onClick:l,danger:!0})]})]})}function K({icon:e,label:t,onClick:n,danger:r}){return(0,L.jsx)(`button`,{type:`button`,onClick:n,title:t,"aria-label":t,className:M(`inline-flex items-center justify-center w-7 h-7 rounded-md transition-colors`,r?`text-muted-foreground hover:text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:text-foreground hover:bg-muted`),children:(0,L.jsx)(e,{className:`w-3.5 h-3.5`})})}export{W as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-CilyBKbf.js";var t=e({default:()=>g,desktop:()=>h,hero:()=>s,models:()=>d,page:()=>o,periods:()=>r,providerCard:()=>c,quickVsExplore:()=>u,runs_one:()=>i,runs_other:()=>a,scatter:()=>f,surfaces:()=>n,table:()=>m,timeline:()=>l,topTickets:()=>p}),n={job:`Jobs`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`Refine`,smash:`SMASH`,fileSummary:`File summaries`,loop:`Loops`},r={d7:`7d`,d30:`30d`,d90:`90d`,all:`All`,custom:`Custom`,startDate:`Start date`,endDate:`End date`,to:`to`},i=`{{count}} run`,a=`{{count}} runs`,o={title:`Analytics`,all:`All`,engine:`Engine`,ticketChip:`ticket #{{id}} · ✕`,failedToLoad:`Failed to load: {{error}}`},s={spending:`Spending`,vsPrev:`{{pct}}% vs prev`,invocations_one:`{{count}} invocation`,invocations_other:`{{count}} invocations`,tokens:`· {{tokens}} tokens`,tokensTooltip:`Total tokens = fresh input + output + cache-read + cache-create across all invocations in this window.`,includesEstimated:`· includes ~{{amount}} estimated`,includesEstimatedTooltip:`Includes {{amount}} of estimated cost from providers without a native cost field (e.g. codex via the local pricing table).`,trackingStarted:`Tracking started {{date}}`,trackingStartedFallback:`Tracking started on first invocation`,emptyState:`No invocations yet for this filter window.`,segmentTitle:`{{label}}: {{value}}`},c={title:`By provider`,description:`How cost splits across the AI CLIs in this project. The <tilde>~</tilde> prefix marks rows where cost is estimated from the local pricing table (the provider does not report it natively).`,noCost:`No cost recorded yet in this window.`,segmentTitle:`{{label}}: {{value}} ({{count}})`},l={title:`Daily timeline`,subtitle:`stacked by surface`,empty:`No spend in this period.`},u={title:`Quick vs Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`Try Explore for richer specs`,runsSoFar_one:`{{count}} run so far`,runsSoFar_other:`{{count}} runs so far`,perSpec:`per spec`,createdRuns:`<strong>{{created}}</strong> created · {{runs}} runs`,avgDuration:`{{duration}} avg`,ratio:`{{ratio}}× more per spec`},d={title:`Models`,empty:`No models recorded.`},f={title:`Cost vs Turns`,empty:`No invocations to plot.`,turnsLabel:`turns`,costLabel:`cost`},p={title:`Top tickets`,empty:`No ticket activity in this period.`,breakdownItem:`{{n}} {{label}}`,unattributed:`Unattributed`,deletedTicket:`deleted ticket #{{id}}`},m={title:`All invocations`,statusFilterAria:`Status filter`,minCostFilterAria:`Minimum cost filter`,minCostPlaceholder:`≥ $0.00`,allStatus:`All status`,success:`Success`,failed:`Failed`,aborted:`Aborted`,empty:`No invocations match the current filters.`,colSurface:`Surface`,colTicket:`Ticket`,colCost:`Cost`,colTurns:`Turns`,colTokens:`Tokens`,colModel:`Model`,colStatus:`Status`,colStarted:`Started`,contractLayer:`Contract Layer`,contractLayerRefinement:`Contract Layer refinement`,deleted:`(deleted)`,provisionalTitleTooltip:`Provisional Explore title — not yet committed`,estimatedCostTooltip:`Estimated from local pricing table — this provider does not report cost natively.`,inferred:`inferred`,statusValue:{success:`success`,failed:`failed`,aborted:`aborted`},truncated:`Showing first {{shown}} of {{total}} matching rows.`},h={title:`Desktop Analytics`,refreshAria:`Refresh analytics`,failedToLoad:`Failed to load analytics: {{error}}`,totalCost:`Total Cost`,costToday:`{{value}} today`,totalJobs:`Total Jobs`,jobsToday:`{{n}} today`,successRate:`Success Rate`,acrossAllProjects:`across all projects`,avgCostPerJob:`Avg Cost / Job`,periodAverage:`period average`,costOverTime:`Cross-Project Cost Over Time`,noCostData:`No cost data for this period`,projectComparison:`Project Comparison`,noProjects:`No projects registered.`,jobsCount_one:`{{count}} job`,jobsCount_other:`{{count}} jobs`,successPct:`{{pct}}% success`,costByProject:`Cost by Project`},g={surfaces:n,periods:r,runs_one:i,runs_other:a,page:o,hero:s,providerCard:c,timeline:l,quickVsExplore:u,models:d,scatter:f,topTickets:p,table:m,export:{summaryCsv:`Summary CSV`,rawCsv:`Raw CSV`,summaryJson:`Summary JSON`,rawJson:`Raw JSON`,downloading:`Downloading…`,noData:`No data for current filters`,failed:`Export failed`},desktop:h};export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={job:`Jobs`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`Affinage`,smash:`SMASH`,fileSummary:`Résumés de fichiers`,loop:`Loops`},t={d7:`7j`,d30:`30j`,d90:`90j`,all:`Tout`,custom:`Personnalisé`,startDate:`Date de début`,endDate:`Date de fin`,to:`au`},n=`{{count}} exécution`,r=`{{count}} exécutions`,i={title:`Analytics`,all:`Tout`,engine:`Moteur`,ticketChip:`ticket #{{id}} · ✕`,failedToLoad:`Échec du chargement : {{error}}`},a={spending:`Dépenses`,vsPrev:`{{pct}} % vs préc.`,invocations_one:`{{count}} invocation`,invocations_other:`{{count}} invocations`,tokens:`· {{tokens}} tokens`,tokensTooltip:`Total des tokens = entrée fraîche + sortie + lecture cache + création cache, sur toutes les invocations de cette période.`,includesEstimated:`· inclut ~{{amount}} estimés`,includesEstimatedTooltip:`Inclut {{amount}} de coût estimé pour les fournisseurs sans champ de coût natif (ex. codex via la table de tarifs locale).`,trackingStarted:`Suivi démarré le {{date}}`,trackingStartedFallback:`Le suivi démarre à la première invocation`,emptyState:`Aucune invocation pour cette période de filtrage.`,segmentTitle:`{{label}} : {{value}}`},o={title:`Par fournisseur`,description:`Répartition du coût entre les CLI IA de ce projet. Le préfixe <tilde>~</tilde> marque les lignes dont le coût est estimé à partir de la table de tarifs locale (le fournisseur ne le rapporte pas nativement).`,noCost:`Aucun coût enregistré sur cette période.`,segmentTitle:`{{label}} : {{value}} ({{count}})`},s={title:`Chronologie quotidienne`,subtitle:`empilée par surface`,empty:`Aucune dépense sur cette période.`},c={title:`Quick vs Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`Essayez Explore pour des specs plus riches`,runsSoFar_one:`{{count}} exécution pour l'instant`,runsSoFar_other:`{{count}} exécutions pour l'instant`,perSpec:`par spec`,createdRuns:`<strong>{{created}}</strong> créées · {{runs}} exécutions`,avgDuration:`{{duration}} en moyenne`,ratio:`{{ratio}}× de plus par spec`},l={title:`Modèles`,empty:`Aucun modèle enregistré.`},u={title:`Coût vs tours`,empty:`Aucune invocation à tracer.`,turnsLabel:`tours`,costLabel:`coût`},d={title:`Top tickets`,empty:`Aucune activité de ticket sur cette période.`,breakdownItem:`{{n}} {{label}}`,unattributed:`Non attribué`,deletedTicket:`ticket supprimé #{{id}}`},f={title:`Toutes les invocations`,statusFilterAria:`Filtre de statut`,minCostFilterAria:`Filtre de coût minimum`,minCostPlaceholder:`≥ $0.00`,allStatus:`Tous les statuts`,success:`Succès`,failed:`Échec`,aborted:`Interrompu`,empty:`Aucune invocation ne correspond aux filtres actuels.`,colSurface:`Surface`,colTicket:`Ticket`,colCost:`Coût`,colTurns:`Tours`,colTokens:`Tokens`,colModel:`Modèle`,colStatus:`Statut`,colStarted:`Démarré`,contractLayer:`Contract Layer`,contractLayerRefinement:`Affinage Contract Layer`,deleted:`(supprimé)`,provisionalTitleTooltip:`Titre Explore provisoire — pas encore validé`,estimatedCostTooltip:`Estimé à partir de la table de tarifs locale — ce fournisseur ne rapporte pas le coût nativement.`,inferred:`inféré`,statusValue:{success:`succès`,failed:`échec`,aborted:`interrompu`},truncated:`Affichage des {{shown}} premières lignes sur {{total}} correspondantes.`},p={title:`Analytics de Desktop`,refreshAria:`Actualiser les analytics`,failedToLoad:`Échec du chargement des analytics : {{error}}`,totalCost:`Coût total`,costToday:`{{value}} aujourd'hui`,totalJobs:`Total des jobs`,jobsToday:`{{n}} aujourd'hui`,successRate:`Taux de réussite`,acrossAllProjects:`sur tous les projets`,avgCostPerJob:`Coût moyen / job`,periodAverage:`moyenne de la période`,costOverTime:`Coût inter-projets dans le temps`,noCostData:`Aucune donnée de coût pour cette période`,projectComparison:`Comparaison des projets`,noProjects:`Aucun projet enregistré.`,jobsCount_one:`{{count}} job`,jobsCount_other:`{{count}} jobs`,successPct:`{{pct}} % de réussite`,costByProject:`Coût par projet`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`CSV résumé`,rawCsv:`CSV brut`,summaryJson:`JSON résumé`,rawJson:`JSON brut`,downloading:`Téléchargement…`,noData:`Aucune donnée pour les filtres actuels`,failed:`Échec de l'export`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={job:`Jobs`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`Refinado`,smash:`SMASH`,fileSummary:`Resúmenes de archivo`,loop:`Loops`},t={d7:`7d`,d30:`30d`,d90:`90d`,all:`Todo`,custom:`Personalizado`,startDate:`Fecha de inicio`,endDate:`Fecha de fin`,to:`a`},n=`{{count}} ejecución`,r=`{{count}} ejecuciones`,i={title:`Analíticas`,all:`Todo`,engine:`Motor`,ticketChip:`ticket #{{id}} · ✕`,failedToLoad:`Error al cargar: {{error}}`},a={spending:`Gasto`,vsPrev:`{{pct}}% vs anterior`,invocations_one:`{{count}} invocación`,invocations_other:`{{count}} invocaciones`,tokens:`· {{tokens}} tokens`,tokensTooltip:`Tokens totales = entrada nueva + salida + lectura de caché + creación de caché en todas las invocaciones de esta ventana.`,includesEstimated:`· incluye ~{{amount}} estimado`,includesEstimatedTooltip:`Incluye {{amount}} de coste estimado de proveedores sin campo de coste nativo (p. ej. codex mediante la tabla de precios local).`,trackingStarted:`Seguimiento iniciado el {{date}}`,trackingStartedFallback:`El seguimiento empieza con la primera invocación`,emptyState:`Aún no hay invocaciones para esta ventana de filtros.`,segmentTitle:`{{label}}: {{value}}`},o={title:`Por proveedor`,description:`Cómo se reparte el coste entre las CLI de IA de este proyecto. El prefijo <tilde>~</tilde> marca las filas cuyo coste se estima con la tabla de precios local (el proveedor no lo informa de forma nativa).`,noCost:`Aún no hay coste registrado en esta ventana.`,segmentTitle:`{{label}}: {{value}} ({{count}})`},s={title:`Cronología diaria`,subtitle:`apilada por superficie`,empty:`Sin gasto en este periodo.`},c={title:`Quick vs Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`Prueba Explore para conseguir specs más completas`,runsSoFar_one:`{{count}} ejecución hasta ahora`,runsSoFar_other:`{{count}} ejecuciones hasta ahora`,perSpec:`por spec`,createdRuns:`<strong>{{created}}</strong> creadas · {{runs}} ejecuciones`,avgDuration:`{{duration}} de media`,ratio:`{{ratio}}× más por spec`},l={title:`Modelos`,empty:`No hay modelos registrados.`},u={title:`Coste vs turnos`,empty:`No hay invocaciones que representar.`,turnsLabel:`turnos`,costLabel:`coste`},d={title:`Tickets principales`,empty:`Sin actividad de tickets en este periodo.`,breakdownItem:`{{n}} {{label}}`,unattributed:`Sin atribuir`,deletedTicket:`ticket eliminado #{{id}}`},f={title:`Todas las invocaciones`,statusFilterAria:`Filtro de estado`,minCostFilterAria:`Filtro de coste mínimo`,minCostPlaceholder:`≥ $0.00`,allStatus:`Todos los estados`,success:`Éxito`,failed:`Fallido`,aborted:`Abortado`,empty:`Ninguna invocación coincide con los filtros actuales.`,colSurface:`Superficie`,colTicket:`Ticket`,colCost:`Coste`,colTurns:`Turnos`,colTokens:`Tokens`,colModel:`Modelo`,colStatus:`Estado`,colStarted:`Inicio`,contractLayer:`Contract Layer`,contractLayerRefinement:`Refinamiento de Contract Layer`,deleted:`(eliminado)`,provisionalTitleTooltip:`Título provisional de Explore — aún sin confirmar`,estimatedCostTooltip:`Estimado con la tabla de precios local — este proveedor no informa el coste de forma nativa.`,inferred:`inferido`,statusValue:{success:`éxito`,failed:`fallido`,aborted:`abortado`},truncated:`Mostrando las primeras {{shown}} de {{total}} filas coincidentes.`},p={title:`Analíticas de Desktop`,refreshAria:`Actualizar analíticas`,failedToLoad:`No se pudieron cargar las analíticas: {{error}}`,totalCost:`Coste total`,costToday:`{{value}} hoy`,totalJobs:`Jobs totales`,jobsToday:`{{n}} hoy`,successRate:`Tasa de éxito`,acrossAllProjects:`en todos los proyectos`,avgCostPerJob:`Coste medio / job`,periodAverage:`media del periodo`,costOverTime:`Coste entre proyectos a lo largo del tiempo`,noCostData:`Sin datos de coste para este periodo`,projectComparison:`Comparación de proyectos`,noProjects:`No hay proyectos registrados.`,jobsCount_one:`{{count}} job`,jobsCount_other:`{{count}} jobs`,successPct:`{{pct}}% de éxito`,costByProject:`Coste por proyecto`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`CSV resumen`,rawCsv:`CSV en bruto`,summaryJson:`JSON resumen`,rawJson:`JSON en bruto`,downloading:`Descargando…`,noData:`Sin datos para los filtros actuales`,failed:`Error al exportar`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={job:`Jobs`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`Verfeinern`,smash:`SMASH`,fileSummary:`Dateizusammenfassungen`,loop:`Loops`},t={d7:`7d`,d30:`30d`,d90:`90d`,all:`Alle`,custom:`Benutzerdefiniert`,startDate:`Startdatum`,endDate:`Enddatum`,to:`bis`},n=`{{count}} Lauf`,r=`{{count}} Läufe`,i={title:`Analytics`,all:`Alle`,engine:`Engine`,ticketChip:`Ticket #{{id}} · ✕`,failedToLoad:`Laden fehlgeschlagen: {{error}}`},a={spending:`Ausgaben`,vsPrev:`{{pct}} % ggü. Vorperiode`,invocations_one:`{{count}} Aufruf`,invocations_other:`{{count}} Aufrufe`,tokens:`· {{tokens}} Tokens`,tokensTooltip:`Tokens gesamt = neue Eingabe + Ausgabe + Cache-Read + Cache-Create über alle Aufrufe in diesem Zeitraum.`,includesEstimated:`· enthält ~{{amount}} geschätzt`,includesEstimatedTooltip:`Enthält {{amount}} geschätzte Kosten von Providern ohne natives Kostenfeld (z. B. codex über die lokale Preistabelle).`,trackingStarted:`Tracking gestartet am {{date}}`,trackingStartedFallback:`Tracking beginnt mit dem ersten Aufruf`,emptyState:`Noch keine Aufrufe für diesen Filterzeitraum.`,segmentTitle:`{{label}}: {{value}}`},o={title:`Nach Provider`,description:`So verteilen sich die Kosten auf die KI-CLIs in diesem Projekt. Das Präfix <tilde>~</tilde> markiert Zeilen, deren Kosten über die lokale Preistabelle geschätzt sind (der Provider meldet sie nicht nativ).`,noCost:`Noch keine Kosten in diesem Zeitraum erfasst.`,segmentTitle:`{{label}}: {{value}} ({{count}})`},s={title:`Täglicher Verlauf`,subtitle:`gestapelt nach Surface`,empty:`Keine Ausgaben in diesem Zeitraum.`},c={title:`Quick vs. Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`Probiere Explore für reichhaltigere Specs`,runsSoFar_one:`bisher {{count}} Lauf`,runsSoFar_other:`bisher {{count}} Läufe`,perSpec:`pro Spec`,createdRuns:`<strong>{{created}}</strong> erstellt · {{runs}} Läufe`,avgDuration:`Ø {{duration}}`,ratio:`{{ratio}}× mehr pro Spec`},l={title:`Modelle`,empty:`Keine Modelle erfasst.`},u={title:`Kosten vs. Turns`,empty:`Keine Aufrufe zum Darstellen.`,turnsLabel:`Turns`,costLabel:`Kosten`},d={title:`Top-Tickets`,empty:`Keine Ticket-Aktivität in diesem Zeitraum.`,breakdownItem:`{{n}} {{label}}`,unattributed:`Nicht zugeordnet`,deletedTicket:`gelöschtes Ticket #{{id}}`},f={title:`Alle Aufrufe`,statusFilterAria:`Statusfilter`,minCostFilterAria:`Mindestkosten-Filter`,minCostPlaceholder:`≥ $0.00`,allStatus:`Alle Status`,success:`Erfolgreich`,failed:`Fehlgeschlagen`,aborted:`Abgebrochen`,empty:`Keine Aufrufe entsprechen den aktuellen Filtern.`,colSurface:`Surface`,colTicket:`Ticket`,colCost:`Kosten`,colTurns:`Turns`,colTokens:`Tokens`,colModel:`Modell`,colStatus:`Status`,colStarted:`Gestartet`,contractLayer:`Contract Layer`,contractLayerRefinement:`Contract-Layer-Verfeinerung`,deleted:`(gelöscht)`,provisionalTitleTooltip:`Vorläufiger Explore-Titel – noch nicht committet`,estimatedCostTooltip:`Geschätzt anhand der lokalen Preistabelle – dieser Provider meldet Kosten nicht nativ.`,inferred:`abgeleitet`,statusValue:{success:`erfolgreich`,failed:`fehlgeschlagen`,aborted:`abgebrochen`},truncated:`Zeige die ersten {{shown}} von {{total}} passenden Zeilen.`},p={title:`Desktop-Analytics`,refreshAria:`Analytics aktualisieren`,failedToLoad:`Analytics konnten nicht geladen werden: {{error}}`,totalCost:`Gesamtkosten`,costToday:`{{value}} heute`,totalJobs:`Jobs gesamt`,jobsToday:`{{n}} heute`,successRate:`Erfolgsquote`,acrossAllProjects:`über alle Projekte`,avgCostPerJob:`Ø Kosten / Job`,periodAverage:`Durchschnitt im Zeitraum`,costOverTime:`Projektübergreifende Kosten im Zeitverlauf`,noCostData:`Keine Kostendaten für diesen Zeitraum`,projectComparison:`Projektvergleich`,noProjects:`Keine Projekte registriert.`,jobsCount_one:`{{count}} Job`,jobsCount_other:`{{count}} Jobs`,successPct:`{{pct}} % Erfolg`,costByProject:`Kosten nach Projekt`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`Zusammenfassung (CSV)`,rawCsv:`Rohdaten (CSV)`,summaryJson:`Zusammenfassung (JSON)`,rawJson:`Rohdaten (JSON)`,downloading:`Wird heruntergeladen…`,noData:`Keine Daten für aktuelle Filter`,failed:`Export fehlgeschlagen`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={job:`ジョブ`,quickSpec:`クイック`,exploreSpec:`Explore`,aiEdit:`リファイン`,smash:`SMASH`,fileSummary:`ファイル要約`,loop:`Loops`},t={d7:`7日`,d30:`30日`,d90:`90日`,all:`すべて`,custom:`カスタム`,startDate:`開始日`,endDate:`終了日`,to:`〜`},n=`{{count}} 回の実行`,r=`{{count}} 回の実行`,i={title:`アナリティクス`,all:`すべて`,engine:`エンジン`,ticketChip:`チケット #{{id}} · ✕`,failedToLoad:`読み込みに失敗しました: {{error}}`},a={spending:`支出`,vsPrev:`前期間比 {{pct}}%`,invocations_one:`{{count}} 回の呼び出し`,invocations_other:`{{count}} 回の呼び出し`,tokens:`· {{tokens}} トークン`,tokensTooltip:`合計トークン = この期間の全呼び出しにおける新規入力 + 出力 + キャッシュ読み取り + キャッシュ作成の合計。`,includesEstimated:`· 約 {{amount}} の推定値を含む`,includesEstimatedTooltip:`ネイティブのコストフィールドを持たないプロバイダーからの推定コスト {{amount}} を含みます(例: ローカル料金表で算出する codex)。`,trackingStarted:`トラッキング開始: {{date}}`,trackingStartedFallback:`最初の呼び出しからトラッキングを開始`,emptyState:`このフィルター期間の呼び出しはまだありません。`,segmentTitle:`{{label}}: {{value}}`},o={title:`プロバイダー別`,description:`このプロジェクトの AI CLI 間でのコストの内訳。<tilde>~</tilde> プレフィックスは、コストがローカル料金表からの推定値である行を示します(プロバイダーがネイティブに報告しない場合)。`,noCost:`この期間に記録されたコストはまだありません。`,segmentTitle:`{{label}}: {{value}} ({{count}})`},s={title:`日次タイムライン`,subtitle:`サーフェス別の積み上げ`,empty:`この期間の支出はありません。`},c={title:`クイック vs Explore`,quick:`クイック`,explore:`Explore`,sparseCta:`より充実したスペックには Explore をお試しください`,runsSoFar_one:`これまで {{count}} 回実行`,runsSoFar_other:`これまで {{count}} 回実行`,perSpec:`スペックあたり`,createdRuns:`<strong>{{created}}</strong> 件作成 · {{runs}} 回実行`,avgDuration:`平均 {{duration}}`,ratio:`スペックあたり {{ratio}}× 多い`},l={title:`モデル`,empty:`記録されたモデルはありません。`},u={title:`コスト vs ターン`,empty:`プロットする呼び出しがありません。`,turnsLabel:`ターン`,costLabel:`コスト`},d={title:`上位チケット`,empty:`この期間のチケットアクティビティはありません。`,breakdownItem:`{{n}} {{label}}`,unattributed:`未割り当て`,deletedTicket:`削除済みチケット #{{id}}`},f={title:`すべての呼び出し`,statusFilterAria:`ステータスフィルター`,minCostFilterAria:`最小コストフィルター`,minCostPlaceholder:`≥ $0.00`,allStatus:`すべてのステータス`,success:`成功`,failed:`失敗`,aborted:`中断`,empty:`現在のフィルターに一致する呼び出しはありません。`,colSurface:`サーフェス`,colTicket:`チケット`,colCost:`コスト`,colTurns:`ターン`,colTokens:`トークン`,colModel:`モデル`,colStatus:`ステータス`,colStarted:`開始`,contractLayer:`Contract Layer`,contractLayerRefinement:`Contract Layer の改良`,deleted:`(削除済み)`,provisionalTitleTooltip:`暫定の Explore タイトル — まだコミットされていません`,estimatedCostTooltip:`ローカル料金表からの推定値 — このプロバイダーはコストをネイティブに報告しません。`,inferred:`推定`,statusValue:{success:`成功`,failed:`失敗`,aborted:`中断`},truncated:`一致する {{total}} 行のうち最初の {{shown}} 行を表示しています。`},p={title:`Desktop アナリティクス`,refreshAria:`アナリティクスを更新`,failedToLoad:`アナリティクスの読み込みに失敗しました: {{error}}`,totalCost:`合計コスト`,costToday:`本日 {{value}}`,totalJobs:`合計ジョブ数`,jobsToday:`本日 {{n}} 件`,successRate:`成功率`,acrossAllProjects:`全プロジェクト`,avgCostPerJob:`ジョブあたり平均コスト`,periodAverage:`期間平均`,costOverTime:`プロジェクト横断のコスト推移`,noCostData:`この期間のコストデータはありません`,projectComparison:`プロジェクト比較`,noProjects:`登録されたプロジェクトはありません。`,jobsCount_one:`{{count}} 件のジョブ`,jobsCount_other:`{{count}} 件のジョブ`,successPct:`成功率 {{pct}}%`,costByProject:`プロジェクト別コスト`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`サマリー CSV`,rawCsv:`生データ CSV`,summaryJson:`サマリー JSON`,rawJson:`生データ JSON`,downloading:`ダウンロード中…`,noData:`現在のフィルターにデータがありません`,failed:`エクスポートに失敗しました`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={job:`任务`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`AI 编辑`,smash:`SMASH`,fileSummary:`文件摘要`,loop:`Loops`},t={d7:`7天`,d30:`30天`,d90:`90天`,all:`全部`,custom:`自定义`,startDate:`开始日期`,endDate:`结束日期`,to:`至`},n=`{{count}} 次运行`,r=`{{count}} 次运行`,i={title:`分析`,all:`全部`,engine:`引擎`,ticketChip:`工单 #{{id}} · ✕`,failedToLoad:`加载失败:{{error}}`},a={spending:`支出`,vsPrev:`较上期 {{pct}}%`,invocations_one:`{{count}} 次调用`,invocations_other:`{{count}} 次调用`,tokens:`· {{tokens}} token`,tokensTooltip:`总 token 数 = 此时间窗口内所有调用的新输入 + 输出 + 缓存读取 + 缓存创建之和。`,includesEstimated:`· 含约 {{amount}} 估算值`,includesEstimatedTooltip:`包含 {{amount}} 的估算成本,来自不原生上报成本的提供方(例如 codex,按本地价格表估算)。`,trackingStarted:`追踪始于 {{date}}`,trackingStartedFallback:`首次调用后开始追踪`,emptyState:`当前筛选窗口内暂无调用。`,segmentTitle:`{{label}}:{{value}}`},o={title:`按提供方`,description:`此项目中各 AI CLI 的成本分布。<tilde>~</tilde> 前缀表示该行成本由本地价格表估算(提供方不原生上报)。`,noCost:`此时间窗口内暂无成本记录。`,segmentTitle:`{{label}}:{{value}}({{count}})`},s={title:`每日时间线`,subtitle:`按来源堆叠`,empty:`此期间没有支出。`},c={title:`Quick vs Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`试试 Explore,获得更丰富的 spec`,runsSoFar_one:`目前 {{count}} 次运行`,runsSoFar_other:`目前 {{count}} 次运行`,perSpec:`每个 spec`,createdRuns:`已创建 <strong>{{created}}</strong> · {{runs}} 次运行`,avgDuration:`平均 {{duration}}`,ratio:`每个 spec 多 {{ratio}}×`},l={title:`模型`,empty:`暂无模型记录。`},u={title:`成本 vs 轮次`,empty:`暂无可绘制的调用。`,turnsLabel:`轮次`,costLabel:`成本`},d={title:`热门工单`,empty:`此期间没有工单活动。`,breakdownItem:`{{n}} {{label}}`,unattributed:`未归属`,deletedTicket:`已删除工单 #{{id}}`},f={title:`全部调用`,statusFilterAria:`状态筛选`,minCostFilterAria:`最低成本筛选`,minCostPlaceholder:`≥ $0.00`,allStatus:`全部状态`,success:`成功`,failed:`失败`,aborted:`已中止`,empty:`没有符合当前筛选条件的调用。`,colSurface:`来源`,colTicket:`工单`,colCost:`成本`,colTurns:`轮次`,colTokens:`Token`,colModel:`模型`,colStatus:`状态`,colStarted:`开始时间`,contractLayer:`Contract Layer`,contractLayerRefinement:`Contract Layer 增强`,deleted:`(已删除)`,provisionalTitleTooltip:`Explore 临时标题——尚未提交`,estimatedCostTooltip:`按本地价格表估算——此提供方不原生上报成本。`,inferred:`推断`,statusValue:{success:`成功`,failed:`失败`,aborted:`已中止`},truncated:`显示前 {{shown}} 条,共 {{total}} 条匹配记录。`},p={title:`Desktop 分析`,refreshAria:`刷新分析数据`,failedToLoad:`加载分析数据失败:{{error}}`,totalCost:`总成本`,costToday:`今日 {{value}}`,totalJobs:`任务总数`,jobsToday:`今日 {{n}} 个`,successRate:`成功率`,acrossAllProjects:`所有项目汇总`,avgCostPerJob:`平均成本 / 任务`,periodAverage:`期间平均`,costOverTime:`跨项目成本走势`,noCostData:`此期间无成本数据`,projectComparison:`项目对比`,noProjects:`尚未注册任何项目。`,jobsCount_one:`{{count}} 个任务`,jobsCount_other:`{{count}} 个任务`,successPct:`成功率 {{pct}}%`,costByProject:`按项目统计成本`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`摘要 CSV`,rawCsv:`原始 CSV`,summaryJson:`摘要 JSON`,rawJson:`原始 JSON`,downloading:`正在下载…`,noData:`当前筛选条件下无数据`,failed:`导出失败`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={job:`Jobs`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`Refinamento`,smash:`SMASH`,fileSummary:`Resumos de ficheiros`,loop:`Loops`},t={d7:`7d`,d30:`30d`,d90:`90d`,all:`Tudo`,custom:`Personalizado`,startDate:`Data de início`,endDate:`Data de fim`,to:`até`},n=`{{count}} execução`,r=`{{count}} execuções`,i={title:`Analytics`,all:`Tudo`,engine:`Motor`,ticketChip:`ticket #{{id}} · ✕`,failedToLoad:`Falha ao carregar: {{error}}`},a={spending:`Gastos`,vsPrev:`{{pct}}% vs anterior`,invocations_one:`{{count}} invocação`,invocations_other:`{{count}} invocações`,tokens:`· {{tokens}} tokens`,tokensTooltip:`Total de tokens = input novo + output + leitura de cache + criação de cache em todas as invocações desta janela.`,includesEstimated:`· inclui ~{{amount}} estimado`,includesEstimatedTooltip:`Inclui {{amount}} de custo estimado de fornecedores sem campo de custo nativo (p. ex. codex através da tabela de preços local).`,trackingStarted:`Registo iniciado em {{date}}`,trackingStartedFallback:`O registo começa na primeira invocação`,emptyState:`Ainda não há invocações para esta janela de filtros.`,segmentTitle:`{{label}}: {{value}}`},o={title:`Por fornecedor`,description:`Como o custo se divide entre as CLIs de IA deste projeto. O prefixo <tilde>~</tilde> assinala as linhas em que o custo é estimado a partir da tabela de preços local (o fornecedor não o reporta nativamente).`,noCost:`Ainda não há custo registado nesta janela.`,segmentTitle:`{{label}}: {{value}} ({{count}})`},s={title:`Cronologia diária`,subtitle:`empilhada por superfície`,empty:`Sem gastos neste período.`},c={title:`Quick vs Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`Experimente o Explore para specs mais ricas`,runsSoFar_one:`{{count}} execução até agora`,runsSoFar_other:`{{count}} execuções até agora`,perSpec:`por spec`,createdRuns:`<strong>{{created}}</strong> criadas · {{runs}} execuções`,avgDuration:`{{duration}} em média`,ratio:`{{ratio}}× mais por spec`},l={title:`Modelos`,empty:`Nenhum modelo registado.`},u={title:`Custo vs Turnos`,empty:`Sem invocações para representar.`,turnsLabel:`turnos`,costLabel:`custo`},d={title:`Top tickets`,empty:`Sem atividade de tickets neste período.`,breakdownItem:`{{n}} {{label}}`,unattributed:`Sem atribuição`,deletedTicket:`ticket eliminado #{{id}}`},f={title:`Todas as invocações`,statusFilterAria:`Filtro de estado`,minCostFilterAria:`Filtro de custo mínimo`,minCostPlaceholder:`≥ $0.00`,allStatus:`Todos os estados`,success:`Sucesso`,failed:`Falhadas`,aborted:`Abortadas`,empty:`Nenhuma invocação corresponde aos filtros atuais.`,colSurface:`Superfície`,colTicket:`Ticket`,colCost:`Custo`,colTurns:`Turnos`,colTokens:`Tokens`,colModel:`Modelo`,colStatus:`Estado`,colStarted:`Início`,contractLayer:`Contract Layer`,contractLayerRefinement:`Refinamento do Contract Layer`,deleted:`(eliminado)`,provisionalTitleTooltip:`Título provisório do Explore — ainda não confirmado`,estimatedCostTooltip:`Estimado a partir da tabela de preços local — este fornecedor não reporta o custo nativamente.`,inferred:`inferido`,statusValue:{success:`sucesso`,failed:`falhada`,aborted:`abortada`},truncated:`A mostrar as primeiras {{shown}} de {{total}} linhas correspondentes.`},p={title:`Analytics do Desktop`,refreshAria:`Atualizar analytics`,failedToLoad:`Falha ao carregar as analytics: {{error}}`,totalCost:`Custo total`,costToday:`{{value}} hoje`,totalJobs:`Total de jobs`,jobsToday:`{{n}} hoje`,successRate:`Taxa de sucesso`,acrossAllProjects:`em todos os projetos`,avgCostPerJob:`Custo médio / job`,periodAverage:`média do período`,costOverTime:`Custo entre projetos ao longo do tempo`,noCostData:`Sem dados de custo para este período`,projectComparison:`Comparação de projetos`,noProjects:`Nenhum projeto registado.`,jobsCount_one:`{{count}} job`,jobsCount_other:`{{count}} jobs`,successPct:`{{pct}}% de sucesso`,costByProject:`Custo por projeto`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`CSV de resumo`,rawCsv:`CSV em bruto`,summaryJson:`JSON de resumo`,rawJson:`JSON em bruto`,downloading:`A transferir…`,noData:`Sem dados para os filtros atuais`,failed:`Falha na exportação`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={job:`Job`,quickSpec:`Quick`,exploreSpec:`Explore`,aiEdit:`Raffinamento`,smash:`SMASH`,fileSummary:`Riepiloghi file`,loop:`Loops`},t={d7:`7d`,d30:`30d`,d90:`90d`,all:`Tutto`,custom:`Personalizzato`,startDate:`Data di inizio`,endDate:`Data di fine`,to:`a`},n=`{{count}} esecuzione`,r=`{{count}} esecuzioni`,i={title:`Analytics`,all:`Tutti`,engine:`Engine`,ticketChip:`ticket #{{id}} · ✕`,failedToLoad:`Caricamento non riuscito: {{error}}`},a={spending:`Spesa`,vsPrev:`{{pct}}% vs prec.`,invocations_one:`{{count}} invocazione`,invocations_other:`{{count}} invocazioni`,tokens:`· {{tokens}} token`,tokensTooltip:`Token totali = input nuovo + output + lettura cache + creazione cache su tutte le invocazioni in questa finestra.`,includesEstimated:`· include ~{{amount}} stimati`,includesEstimatedTooltip:`Include {{amount}} di costo stimato da provider senza un campo di costo nativo (es. codex tramite la tabella prezzi locale).`,trackingStarted:`Tracciamento iniziato il {{date}}`,trackingStartedFallback:`Il tracciamento inizia alla prima invocazione`,emptyState:`Ancora nessuna invocazione per questa finestra di filtri.`,segmentTitle:`{{label}}: {{value}}`},o={title:`Per provider`,description:`Come si ripartisce il costo tra le CLI AI di questo progetto. Il prefisso <tilde>~</tilde> indica le righe in cui il costo è stimato dalla tabella prezzi locale (il provider non lo riporta nativamente).`,noCost:`Ancora nessun costo registrato in questa finestra.`,segmentTitle:`{{label}}: {{value}} ({{count}})`},s={title:`Timeline giornaliera`,subtitle:`impilata per origine`,empty:`Nessuna spesa in questo periodo.`},c={title:`Quick vs Explore`,quick:`Quick`,explore:`Explore`,sparseCta:`Prova Explore per spec più ricche`,runsSoFar_one:`{{count}} esecuzione finora`,runsSoFar_other:`{{count}} esecuzioni finora`,perSpec:`per spec`,createdRuns:`<strong>{{created}}</strong> create · {{runs}} esecuzioni`,avgDuration:`{{duration}} in media`,ratio:`{{ratio}}× in più per spec`},l={title:`Modelli`,empty:`Nessun modello registrato.`},u={title:`Costo vs Turni`,empty:`Nessuna invocazione da rappresentare.`,turnsLabel:`turni`,costLabel:`costo`},d={title:`Top ticket`,empty:`Nessuna attività sui ticket in questo periodo.`,breakdownItem:`{{n}} {{label}}`,unattributed:`Non attribuito`,deletedTicket:`ticket eliminato #{{id}}`},f={title:`Tutte le invocazioni`,statusFilterAria:`Filtro stato`,minCostFilterAria:`Filtro costo minimo`,minCostPlaceholder:`≥ $0.00`,allStatus:`Tutti gli stati`,success:`Riuscita`,failed:`Fallita`,aborted:`Interrotta`,empty:`Nessuna invocazione corrisponde ai filtri attuali.`,colSurface:`Origine`,colTicket:`Ticket`,colCost:`Costo`,colTurns:`Turni`,colTokens:`Token`,colModel:`Modello`,colStatus:`Stato`,colStarted:`Avvio`,contractLayer:`Contract Layer`,contractLayerRefinement:`Raffinamento Contract Layer`,deleted:`(eliminato)`,provisionalTitleTooltip:`Titolo Explore provvisorio — non ancora confermato`,estimatedCostTooltip:`Stimato dalla tabella prezzi locale — questo provider non riporta il costo nativamente.`,inferred:`dedotto`,statusValue:{success:`riuscita`,failed:`fallita`,aborted:`interrotta`},truncated:`Mostrate le prime {{shown}} di {{total}} righe corrispondenti.`},p={title:`Analytics di Desktop`,refreshAria:`Aggiorna le analytics`,failedToLoad:`Impossibile caricare le analytics: {{error}}`,totalCost:`Costo totale`,costToday:`{{value}} oggi`,totalJobs:`Job totali`,jobsToday:`{{n}} oggi`,successRate:`Tasso di successo`,acrossAllProjects:`su tutti i progetti`,avgCostPerJob:`Costo medio / job`,periodAverage:`media del periodo`,costOverTime:`Costo nel tempo tra i progetti`,noCostData:`Nessun dato di costo per questo periodo`,projectComparison:`Confronto progetti`,noProjects:`Nessun progetto registrato.`,jobsCount_one:`{{count}} job`,jobsCount_other:`{{count}} job`,successPct:`{{pct}}% di successo`,costByProject:`Costo per progetto`},m={surfaces:e,periods:t,runs_one:n,runs_other:r,page:i,hero:a,providerCard:o,timeline:s,quickVsExplore:c,models:l,scatter:u,topTickets:d,table:f,export:{summaryCsv:`CSV riepilogo`,rawCsv:`CSV raw`,summaryJson:`JSON riepilogo`,rawJson:`JSON raw`,downloading:`Download in corso…`,noData:`Nessun dato per i filtri attuali`,failed:`Esportazione non riuscita`},desktop:p};export{m as default,p as desktop,a as hero,l as models,i as page,t as periods,o as providerCard,c as quickVsExplore,n as runs_one,r as runs_other,u as scatter,e as surfaces,f as table,s as timeline,d as topTickets};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-CilyBKbf.js";var t=e({actions:()=>n,default:()=>a,states:()=>r,status:()=>i}),n={save:`Save`,cancel:`Cancel`,close:`Close`,delete:`Delete`,confirm:`Confirm`,retry:`Retry`,search:`Search`,copy:`Copy`,copied:`Copied`,back:`Back`,next:`Next`,done:`Done`,open:`Open`,add:`Add`,remove:`Remove`,edit:`Edit`,rename:`Rename`,duplicate:`Duplicate`,refresh:`Refresh`,export:`Export`,discard:`Discard`,minimize:`Minimize`,expand:`Expand`,collapse:`Collapse`,viewAll:`View all`,learnMore:`Learn more`},r={loading:`Loading…`,saving:`Saving…`,error:`Error`,empty:`No data`,none:`None`,unknown:`Unknown`,yes:`Yes`,no:`No`,on:`On`,off:`Off`,enabled:`Enabled`,disabled:`Disabled`},i={queued:`Queued`,running:`Running`,completed:`Completed`,failed:`Failed`,canceled:`Canceled`,draft:`Draft`},a={actions:n,states:r,status:i};export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={railAdded:`Rail {{n}} hinzugefügt`,railRemoved:`{{rail}} entfernt`,railCompleted:`Rail {{n}} abgeschlossen`,railFailed:`Rail {{n}} fehlgeschlagen – Specs zurück in Specs`,railEnded:`Rail {{n}} {{status}} – Specs zurück in Specs`,alreadyOnRail:`Bereits auf {{rail}}`,movedToRail:`Auf {{rail}} verschoben`,railRunningStopFirst:`{{rail}} läuft – vor dem Entfernen stoppen`,removedFromRail:`Von {{rail}} entfernt`,queuedOnRail:`Auf {{rail}} eingereiht`,queuedOnRailDescription:`Rail läuft gerade`,railStopped:`{{rail}} gestoppt`,stopFailed:`Rail konnte nicht gestoppt werden`,syncTicketsFailed:`Rail-Tickets konnten nicht synchronisiert werden`,launchFailed:`Rail konnte nicht gestartet werden`,launchNetworkError:`Netzwerkfehler beim Starten des Rails`,railLaunched:`{{rail}} gestartet`,launchDescription_one:`{{mode}} mit {{count}} Spec`,launchDescription_other:`{{mode}} mit {{count}} Specs`},t={title:`Rails`,runningCount_one:`{{count}} läuft`,runningCount_other:`{{count}} laufen`},n={viewJobLog:`Job-Log anzeigen`,log:`Log`,implement:`Implement`,batch:`Batch`,ultra:`Ultra`,ultraTitle:`Ultracode – Claude implementiert die Spec autonom, ohne Pipeline`,loop:`Loop`,loopTitle:`Loop – eine veröffentlichte Automatisierungsschleife gegen die Specs des Rails ausführen`,pickLoop:`Schleife auswählen…`,effortTitle:`Denkaufwand`,interactive:`Interaktiv`,interactiveTitle:`Interaktiv – chatte mit dem laufenden Job; sende weitere Prompts und schließe ab, wenn du fertig bist`,stop:`Stopp`,play:`Start`,failedRetry:`Job fehlgeschlagen – zum Wiederholen klicken`,addSpecsFirst:`Füge zuerst Specs zu diesem Rail hinzu`,builtInLoops:`Integriert`,customLoops:`Eigene Loops`},r={moveToSpecs:`Nach Specs verschieben`,deleteRail:`{{label}} löschen`,dropHere:`Hier ablegen`,dropOnThisRail:`Auf diesem Rail ablegen`,dragSpecsHere:`Specs hierher ziehen`},i={title:`Im Ultracode-Modus starten`,context_one:`{{rail}} · {{count}} Spec`,context_other:`{{rail}} · {{count}} Specs`,noPipelineTitle:`Keine OpenSpec-Pipeline.`,noPipelineBody:`Der strukturierte Flow Architect → Developer → Reviewer wird komplett übersprungen.`,autonomyTitle:`Native Claude-Autonomie.`,autonomyBody:`Claude arbeitet eigenständig mit nativen Agenten und dynamischen Workflows.`,costTitle:`Variable Kosten.`,costBody:`Die Ausgaben hängen davon ab, was Claude entscheidet – sie können höher ausfallen als erwartet.`,continue:`Weiter`},a={fetchFailed:`Rails konnten nicht geladen werden: {{status}}`},o={toasts:e,railsBoard:t,railControls:n,railRow:r,ultracodeDialog:i,useRails:a};export{o as default,n as railControls,r as railRow,t as railsBoard,e as toasts,i as ultracodeDialog,a as useRails};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-CilyBKbf.js";var t=e({default:()=>c,railControls:()=>i,railRow:()=>a,railsBoard:()=>r,toasts:()=>n,ultracodeDialog:()=>o,useRails:()=>s}),n={railAdded:`Rail {{n}} added`,railRemoved:`{{rail}} removed`,railCompleted:`Rail {{n}} completed`,railFailed:`Rail {{n}} failed — specs returned to Specs`,railEnded:`Rail {{n}} {{status}} — specs returned to Specs`,alreadyOnRail:`Already on {{rail}}`,movedToRail:`Moved to {{rail}}`,railRunningStopFirst:`{{rail}} is running — stop it before removing`,removedFromRail:`Removed from {{rail}}`,queuedOnRail:`Queued on {{rail}}`,queuedOnRailDescription:`Rail is currently running`,railStopped:`{{rail}} stopped`,stopFailed:`Failed to stop rail`,syncTicketsFailed:`Failed to sync rail tickets`,launchFailed:`Failed to launch rail`,launchNetworkError:`Network error launching rail`,railLaunched:`{{rail}} launched`,launchDescription_one:`{{mode}} with {{count}} spec`,launchDescription_other:`{{mode}} with {{count}} specs`},r={title:`Rails`,runningCount_one:`{{count}} running`,runningCount_other:`{{count}} running`},i={viewJobLog:`View job log`,log:`Log`,implement:`Implement`,batch:`Batch`,ultra:`Ultra`,ultraTitle:`Ultracode — Claude implements the spec autonomously, no pipeline`,loop:`Loop`,loopTitle:`Loop — run a published automation loop against the rail's specs`,pickLoop:`Pick a loop…`,effortTitle:`Reasoning effort`,interactive:`Interactive`,interactiveTitle:`Interactive — chat with the running job; send more prompts and finalize when done`,stop:`Stop`,play:`Play`,failedRetry:`Job failed — click to retry`,addSpecsFirst:`Add specs to this rail first`,builtInLoops:`Built-in`,customLoops:`Custom loops`},a={moveToSpecs:`Move to Specs`,deleteRail:`Delete {{label}}`,dropHere:`Drop here`,dropOnThisRail:`Drop on this rail`,dragSpecsHere:`Drag specs here`},o={title:`Launch in Ultracode mode`,context_one:`{{rail}} · {{count}} spec`,context_other:`{{rail}} · {{count}} specs`,noPipelineTitle:`No OpenSpec pipeline.`,noPipelineBody:`The structured architect → developer → reviewer flow is skipped entirely.`,autonomyTitle:`Native Claude autonomy.`,autonomyBody:`Claude works on its own using native agents and dynamic workflows.`,costTitle:`Variable cost.`,costBody:`Spend depends on what Claude decides to do — it can be higher than expected.`,continue:`Continue`},s={fetchFailed:`Failed to fetch rails: {{status}}`},c={toasts:n,railsBoard:r,railControls:i,railRow:a,ultracodeDialog:o,useRails:s};export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={railAdded:`Rail {{n}} añadido`,railRemoved:`{{rail}} eliminado`,railCompleted:`Rail {{n}} completado`,railFailed:`Rail {{n}} fallido — las specs han vuelto a Specs`,railEnded:`Rail {{n}} {{status}} — las specs han vuelto a Specs`,alreadyOnRail:`Ya está en {{rail}}`,movedToRail:`Movida a {{rail}}`,railRunningStopFirst:`{{rail}} está en ejecución — detenlo antes de eliminarlo`,removedFromRail:`Quitada de {{rail}}`,queuedOnRail:`En cola en {{rail}}`,queuedOnRailDescription:`El rail está en ejecución`,railStopped:`{{rail}} detenido`,stopFailed:`No se pudo detener el rail`,syncTicketsFailed:`No se pudieron sincronizar los tickets del rail`,launchFailed:`No se pudo lanzar el rail`,launchNetworkError:`Error de red al lanzar el rail`,railLaunched:`{{rail}} lanzado`,launchDescription_one:`{{mode}} con {{count}} spec`,launchDescription_other:`{{mode}} con {{count}} specs`},t={title:`Rails`,runningCount_one:`{{count}} en ejecución`,runningCount_other:`{{count}} en ejecución`},n={viewJobLog:`Ver log del job`,log:`Log`,implement:`Implement`,batch:`Batch`,ultra:`Ultra`,ultraTitle:`Ultracode — Claude implementa la spec de forma autónoma, sin pipeline`,loop:`Loop`,loopTitle:`Loop — ejecuta un bucle de automatización publicado sobre las specs del rail`,pickLoop:`Elige un bucle…`,effortTitle:`Esfuerzo de razonamiento`,interactive:`Interactivo`,interactiveTitle:`Interactivo — chatea con el job en ejecución; envía más prompts y finaliza cuando termines`,stop:`Detener`,play:`Iniciar`,failedRetry:`El job ha fallado — haz clic para reintentar`,addSpecsFirst:`Añade primero specs a este rail`,builtInLoops:`Integrados`,customLoops:`Loops personalizados`},r={moveToSpecs:`Mover a Specs`,deleteRail:`Eliminar {{label}}`,dropHere:`Suelta aquí`,dropOnThisRail:`Suelta en este rail`,dragSpecsHere:`Arrastra specs aquí`},i={title:`Lanzar en modo Ultracode`,context_one:`{{rail}} · {{count}} spec`,context_other:`{{rail}} · {{count}} specs`,noPipelineTitle:`Sin pipeline de OpenSpec.`,noPipelineBody:`El flujo estructurado architect → developer → reviewer se omite por completo.`,autonomyTitle:`Autonomía nativa de Claude.`,autonomyBody:`Claude trabaja por su cuenta con agentes nativos y flujos dinámicos.`,costTitle:`Coste variable.`,costBody:`El gasto depende de lo que Claude decida hacer — puede ser mayor de lo esperado.`,continue:`Continuar`},a={fetchFailed:`No se pudieron obtener los rails: {{status}}`},o={toasts:e,railsBoard:t,railControls:n,railRow:r,ultracodeDialog:i,useRails:a};export{o as default,n as railControls,r as railRow,t as railsBoard,e as toasts,i as ultracodeDialog,a as useRails};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={railAdded:`已添加 Rail {{n}}`,railRemoved:`已移除 {{rail}}`,railCompleted:`Rail {{n}} 已完成`,railFailed:`Rail {{n}} 失败 — Spec 已退回 Specs`,railEnded:`Rail {{n}} {{status}} — Spec 已退回 Specs`,alreadyOnRail:`已在 {{rail}} 上`,movedToRail:`已移至 {{rail}}`,railRunningStopFirst:`{{rail}} 正在运行 — 请先停止再移除`,removedFromRail:`已从 {{rail}} 移除`,queuedOnRail:`已在 {{rail}} 排队`,queuedOnRailDescription:`Rail 正在运行`,railStopped:`{{rail}} 已停止`,stopFailed:`停止 Rail 失败`,syncTicketsFailed:`同步 Rail 工单失败`,launchFailed:`启动 Rail 失败`,launchNetworkError:`启动 Rail 时网络错误`,railLaunched:`{{rail}} 已启动`,launchDescription_one:`{{mode}},共 {{count}} 个 Spec`,launchDescription_other:`{{mode}},共 {{count}} 个 Spec`},t={title:`Rails`,runningCount_one:`{{count}} 个运行中`,runningCount_other:`{{count}} 个运行中`},n={viewJobLog:`查看任务日志`,log:`日志`,implement:`实现`,batch:`批量`,ultra:`Ultra`,ultraTitle:`Ultracode — Claude 自主实现该 Spec,不走流水线`,loop:`Loop`,loopTitle:`Loop — 针对该轨道的 Spec 运行已发布的自动化循环`,pickLoop:`选择一个循环…`,effortTitle:`推理强度`,interactive:`交互`,interactiveTitle:`交互 — 与运行中的任务对话;可继续发送提示,完成后再定稿`,stop:`停止`,play:`运行`,failedRetry:`任务失败 — 点击重试`,addSpecsFirst:`请先向此 Rail 添加 Spec`,builtInLoops:`内置`,customLoops:`自定义循环`},r={moveToSpecs:`移至 Specs`,deleteRail:`删除 {{label}}`,dropHere:`拖放到此处`,dropOnThisRail:`拖放到此 Rail`,dragSpecsHere:`将 Spec 拖到此处`},i={title:`以 Ultracode 模式启动`,context_one:`{{rail}} · {{count}} 个 Spec`,context_other:`{{rail}} · {{count}} 个 Spec`,noPipelineTitle:`无 OpenSpec 流水线。`,noPipelineBody:`完全跳过架构师 → 开发者 → 审查者的结构化流程。`,autonomyTitle:`Claude 原生自主模式。`,autonomyBody:`Claude 使用原生 Agent 和动态工作流自主工作。`,costTitle:`成本不固定。`,costBody:`花费取决于 Claude 的决策 — 可能高于预期。`,continue:`继续`},a={fetchFailed:`获取 Rails 失败:{{status}}`},o={toasts:e,railsBoard:t,railControls:n,railRow:r,ultracodeDialog:i,useRails:a};export{o as default,n as railControls,r as railRow,t as railsBoard,e as toasts,i as ultracodeDialog,a as useRails};
|