specrails-desktop 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/dist/assets/{ActivityFeedPage-DJJlZ3mF.js → ActivityFeedPage-CoWwVcty.js} +1 -1
- package/client/dist/assets/AgentsPage-CgPvynWc.js +86 -0
- package/client/dist/assets/{AnalyticsPage-BUd3gWYC.js → AnalyticsPage-ioz3Ub2D.js} +1 -1
- package/client/dist/assets/{BarChart-HDe_YoUD.js → BarChart-BKXQPcoW.js} +1 -1
- package/client/dist/assets/CodePage-CYhXRKiI.js +2 -0
- package/client/dist/assets/{DesktopAnalyticsPage-CgvmSvF0.js → DesktopAnalyticsPage-CBfPCT3q.js} +1 -1
- package/client/dist/assets/DocsDialog-uRTBV-3T.js +11 -0
- package/client/dist/assets/DocsPage-gH0Lc54I.js +11 -0
- package/client/dist/assets/{ExportDropdown-f4dwQjlT.js → ExportDropdown-DAp7zWib.js} +1 -1
- package/client/dist/assets/IntegrationsPage-D40Si_7s.js +3 -0
- package/client/dist/assets/JobDetailPage-DSxAvB1n.js +16 -0
- package/client/dist/assets/JobsPage-ZMBc1BHE.js +1 -0
- package/client/dist/assets/dashboard--Ahnvfr3.js +1 -0
- package/client/dist/assets/dashboard-BN1C2pEh.js +1 -0
- package/client/dist/assets/dashboard-BZs_EzAn.js +1 -0
- package/client/dist/assets/dashboard-Bsw44L8_.js +1 -0
- package/client/dist/assets/dashboard-Bw3VECgY.js +1 -0
- package/client/dist/assets/{dashboard-Duo4DDCW.js → dashboard-CuOshSHn.js} +1 -1
- package/client/dist/assets/dashboard-DfouCM3_.js +1 -0
- package/client/dist/assets/dashboard-Pp5hwnZB.js +1 -0
- package/client/dist/assets/{dist-js-COfIfLRE.js → dist-js-CKqmDyXR.js} +1 -1
- package/client/dist/assets/{dist-js-CvScGQU_.js → dist-js-bTZuok_W.js} +1 -1
- package/client/dist/assets/{index-DGIXKRHE.js → index-B9IKK_QQ.js} +45 -45
- package/client/dist/assets/index-BqAXaTbC.css +2 -0
- package/client/dist/assets/jobs-BGkI19S_.js +1 -0
- package/client/dist/assets/jobs-Brp44JDd.js +1 -0
- package/client/dist/assets/jobs-D93lG6If.js +1 -0
- package/client/dist/assets/jobs-DAF8AGy5.js +1 -0
- package/client/dist/assets/jobs-Db3xrsp_.js +1 -0
- package/client/dist/assets/jobs-Do4Ltqdj.js +1 -0
- package/client/dist/assets/jobs-F5PGJwbW.js +1 -0
- package/client/dist/assets/jobs-fYWWxCUV.js +1 -0
- package/client/dist/assets/{lib-Bro9Z0gp.js → lib-B5mjOeEi.js} +1 -1
- package/client/dist/assets/{settings-D3LurcR5.js → settings-BI_cVCqN.js} +1 -1
- package/client/dist/assets/{settings-5tzo0Rn3.js → settings-BRaLLSVi.js} +1 -1
- package/client/dist/assets/{settings-BEWv3VEu.js → settings-BcqH0oea.js} +1 -1
- package/client/dist/assets/settings-C0-7Fpxg.js +1 -0
- package/client/dist/assets/{settings-BORg56um.js → settings-D6QMBlGQ.js} +1 -1
- package/client/dist/assets/{settings-DcqWIEM6.js → settings-GOBKOTGl.js} +1 -1
- package/client/dist/assets/{settings-BDAW3trC.js → settings-pT3MzfRu.js} +1 -1
- package/client/dist/assets/{settings-Dfz8QbZS.js → settings-u-16ISHt.js} +1 -1
- package/client/dist/assets/{setup-D3rNZA9A.js → setup-BIIkb-_K.js} +1 -1
- package/client/dist/assets/{setup-C1IA-9YS.js → setup-BeQxu9kD.js} +1 -1
- package/client/dist/assets/{setup-pjgmYHx6.js → setup-CPa6GnlI.js} +1 -1
- package/client/dist/assets/{setup-gzLG8T6F.js → setup-CZl4OEJx.js} +1 -1
- package/client/dist/assets/{setup-C0dzw8j4.js → setup-ChpodNfn.js} +1 -1
- package/client/dist/assets/{setup-WP6WOYQh.js → setup-D_fjJH6u.js} +1 -1
- package/client/dist/assets/{setup-UD2aanGs.js → setup-YzD8DX4O.js} +1 -1
- package/client/dist/assets/{setup-CpfjaNut.js → setup-fRpDozmq.js} +1 -1
- package/client/dist/assets/{specs-DicWhvwi.js → specs-B4GuOzuZ.js} +1 -1
- package/client/dist/assets/{specs-CXNQzPk9.js → specs-BVLKe2n5.js} +1 -1
- package/client/dist/assets/{specs-dkro6lSM.js → specs-C62F2CDv.js} +1 -1
- package/client/dist/assets/{specs-4lA_u79w.js → specs-D-Sb6dre.js} +1 -1
- package/client/dist/assets/{specs-DgmyAE3N.js → specs-DFSkAeK8.js} +1 -1
- package/client/dist/assets/{specs-DZCLH2-l.js → specs-DfwDeADE.js} +1 -1
- package/client/dist/assets/{specs-BHjxcjOf.js → specs-VK-zXv7x.js} +1 -1
- package/client/dist/assets/{specs-DFnc2Huj.js → specs-ghyBMnib.js} +1 -1
- package/client/dist/assets/{useProjectCache-D9juBhsO.js → useProjectCache-Cf83MBQh.js} +1 -1
- package/client/dist/index.html +7 -7
- package/docs/internals/api-reference.md +4 -7
- package/package.json +2 -2
- package/server/dist/chat-manager.js +19 -7
- package/server/dist/context-scope.js +29 -8
- package/server/dist/db.js +47 -2
- package/server/dist/feature-flags.js +15 -0
- package/server/dist/interactive-job-session.js +363 -0
- package/server/dist/mobile/index.js +5 -5
- package/server/dist/mobile/mobile-admin-router.js +28 -35
- package/server/dist/mobile/mobile-datachannel.js +167 -0
- package/server/dist/mobile/mobile-gateway.js +72 -98
- package/server/dist/mobile/mobile-router.js +4 -35
- package/server/dist/mobile/mobile-signal-reconnect.js +84 -0
- package/server/dist/mobile/mobile-types.js +5 -5
- package/server/dist/mobile/mobile-webrtc-peer.js +129 -0
- package/server/dist/mobile/mobile-webrtc.js +117 -0
- package/server/dist/project-router-jobs.js +42 -0
- package/server/dist/queue-manager.js +214 -54
- package/server/dist/rails-router.js +15 -1
- package/server/dist/util/stream-display.js +66 -0
- package/client/dist/assets/AgentsPage-49JaEDjR.js +0 -86
- package/client/dist/assets/CodePage-CqPPND47.js +0 -2
- package/client/dist/assets/DocsDialog-hHFd3Ejs.js +0 -11
- package/client/dist/assets/DocsPage-B4R1aksg.js +0 -11
- package/client/dist/assets/IntegrationsPage-CX2Ybxx0.js +0 -3
- package/client/dist/assets/JobDetailPage-DN2Jc8Ti.js +0 -16
- package/client/dist/assets/JobsPage-DmdpqijT.js +0 -1
- package/client/dist/assets/dashboard--Y6yzMlf.js +0 -1
- package/client/dist/assets/dashboard--a4-6oYE.js +0 -1
- package/client/dist/assets/dashboard-BiJ3CDTG.js +0 -1
- package/client/dist/assets/dashboard-CiXjk63Z.js +0 -1
- package/client/dist/assets/dashboard-Cx5VjCea.js +0 -1
- package/client/dist/assets/dashboard-D7jg25XR.js +0 -1
- package/client/dist/assets/dashboard-DpGYK2s1.js +0 -1
- package/client/dist/assets/index-DBpvYrDK.css +0 -2
- package/client/dist/assets/jobs-8viuHLDV.js +0 -1
- package/client/dist/assets/jobs-AW2eB5D-.js +0 -1
- package/client/dist/assets/jobs-BSm89DL5.js +0 -1
- package/client/dist/assets/jobs-BZ3sQHjZ.js +0 -1
- package/client/dist/assets/jobs-Bd8AdOTb.js +0 -1
- package/client/dist/assets/jobs-CRtsq_u0.js +0 -1
- package/client/dist/assets/jobs-CSRwFQ6K.js +0 -1
- package/client/dist/assets/jobs-CbEl7WMI.js +0 -1
- package/client/dist/assets/settings-yMubjqYw.js +0 -1
- package/server/dist/mobile/mobile-mdns.js +0 -81
- package/server/dist/mobile/mobile-pairing.js +0 -179
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor.main-C7Rmw-hR.js","assets/chunk-CilyBKbf.js","assets/preload-helper-DSXbuxSR.js","assets/editor.api2-BPnIxMjz.js","assets/editor-Br_kD0ds.css","assets/workers-BvicOoDf.js","assets/monaco.contribution-YMAkHQcQ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./preload-helper-DSXbuxSR.js";import{Ct as n,I as r,It as i,Lt as a,P as o,Qt as s,Rt as c,Tt as l,U as u,Zt as d,a as f,an as p,at as m,et as h,ht as g,in as _,it as v,l as y,m as b,mt as x,nn as S,nt as C,on as w,p as T,pt as E,rt as D,tt as ee}from"./index-DGIXKRHE.js";import{t as O}from"./useProjectCache-D9juBhsO.js";var k=n(`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`}]]),te=n(`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`}]]),A=n(`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`}]]),j=e(w(),1),M=e(p(),1);function ne(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 N(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 P(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var F=(e,t)=>Math.abs(e-t)<1.01,I=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},L,R=()=>{if(L!==void 0)return L;if(typeof navigator>`u`)return L=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return L=!0;let e=navigator.maxTouchPoints;return L=navigator.platform===`MacIntel`&&e!==void 0&&e>0},z=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},re=e=>e,B=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},V=(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(z(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(z(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},H={passive:!0},U=typeof window>`u`?!0:`onscrollend`in window,W=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&U,o=0,s=a?null:I(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,H),a&&r.addEventListener(`scrollend`,u,H),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},ie=(e,t)=>W(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),G=(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`]},ae=(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})},oe=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:re,rangeExtractor:B,onChange:()=>{},measureElement:G,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=N(()=>(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,!(!R()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,H),e.addEventListener(`touchend`,n,H),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=N(()=>[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=N(()=>[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=ne(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=N(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?ce({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=N(()=>{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))&&(R()&&(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=N(()=>[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 P(t[se(0,t.length-1,r?e=>n[e*2]:e=>P(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&&F(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()}},se=(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 ce({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=se(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 K=typeof document<`u`?j.useLayoutEffect:j.useEffect;function le({useFlushSync:e=!0,...t}){let n=j.useReducer(e=>e+1,0)[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,M.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=j.useState(()=>new oe(r));return i.setOptions(r),K(()=>i._didMount(),[]),K(()=>i._willUpdate()),i}function q(e){return le({observeElementRect:V,observeElementOffset:ie,scrollToFn:ae,...e})}var J=a(),Y=e=>`specrails-desktop:code-tree-filter:${e}`,X=e=>`specrails-desktop:code-tree-collapsed:${e}`;function ue(e){return e.split(`/`).length-1}function de(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function fe(e){return e?e.length>10?e.slice(0,10):e:null}function pe(e){return e===`created`?`added`:e===`modified`?`changed`:e===`deleted`?`deleted`:null}function me(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 he({onOpenFile:e,selectedPath:t,filterJobId:n,filterTicketId:r}){let{t:a}=s(`code`),{activeProjectId:u}=l(),{openTicketDetail:d}=y(),{registerHandler:f,unregisterHandler:p}=i(),[m,_]=(0,j.useState)(()=>{if(!u)return`touched-by-ai`;try{let e=localStorage.getItem(Y(u));if(e===`all`||e===`touched-by-ai`)return e}catch{}return`touched-by-ai`});(0,j.useEffect)(()=>{if(u)try{localStorage.setItem(Y(u),m)}catch{}},[m,u]);let[v,b]=(0,j.useState)(()=>{if(!u)return new Set;try{let e=localStorage.getItem(X(u));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,j.useEffect)(()=>{if(u)try{localStorage.setItem(X(u),JSON.stringify([...v]))}catch{}},[v,u]);let S=(0,j.useCallback)(e=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),C=(0,j.useCallback)(()=>{b(new Set)},[]),{data:w,refresh:T,isFirstLoad:E}=O({namespace:`code-tree:${m}:${m===`touched-by-ai`?`${n??`all-jobs`}:${r??`all-specs`}`:`all`}`,projectId:u,initialValue:[],fetcher:(0,j.useCallback)(async()=>{let e=[],t=null;for(let i=0;i<100;i+=1){let i=new URLSearchParams({withProvenance:`1`,filter:m});m===`touched-by-ai`&&n&&i.set(`jobId`,n),m===`touched-by-ai`&&typeof r==`number`&&i.set(`ticketId`,String(r)),t&&i.set(`cursor`,t);let a=await fetch(`${c()}/code/tree?${i.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,r])}),D=(0,j.useRef)(u);(0,j.useEffect)(()=>{D.current=u},[u]),(0,j.useEffect)(()=>{if(!u)return;let e=`code-tree-${u}`;return f(e,e=>{let t=e;t.projectId===D.current&&t.type===`file.provenance_updated`&&T()}),()=>p(e)},[u,f,p,T]);let A=(0,j.useRef)(null),M=(0,j.useMemo)(()=>(w??[]).filter(e=>!me(e.path,v)),[w,v]),ne=(0,j.useCallback)(()=>{b(new Set((w??[]).filter(e=>e.kind===`dir`).map(e=>e.path)))},[w]),N=q({count:M.length,getScrollElement:()=>A.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()=>{}}}),P=M.length===0,F=(0,j.useMemo)(()=>(w??[]).filter(e=>e.kind===`file`).length,[w]);return(0,J.jsxs)(`div`,{className:`flex flex-col h-full`,"data-testid":`file-tree`,children:[(0,J.jsxs)(`div`,{className:`px-2 py-2 border-b border-border text-xs space-y-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>_(`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`:r?`tree.specFiles`:`tree.touchedByAi`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>_(`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,J.jsx)(`div`,{className:`flex-1`}),(0,J.jsx)(`button`,{type:`button`,onClick:ne,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,J.jsx)(x,{className:`w-3.5 h-3.5`})}),(0,J.jsx)(`button`,{type:`button`,onClick:C,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,J.jsx)(g,{className:`w-3.5 h-3.5`})})]}),m===`touched-by-ai`&&F>0&&(0,J.jsx)(`div`,{className:`flex items-center justify-between gap-2 text-[11px] text-muted-foreground`,children:(0,J.jsx)(`span`,{children:a(`tree.touchedCount`,{count:F})})})]}),P&&E?(0,J.jsx)(`div`,{className:`flex-1 flex items-center justify-center px-4 text-center`,"data-testid":`file-tree-loading`,children:(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground animate-pulse`,children:a(`tree.loadingFiles`)})}):P&&m===`touched-by-ai`?(0,J.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center px-4 text-center gap-3`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`tree.emptyTouched`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>_(`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`)})]}):P?(0,J.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-muted-foreground px-4 text-center`,children:a(`tree.noFiles`)}):(0,J.jsx)(`div`,{ref:A,className:`flex-1 overflow-auto`,"data-testid":`file-tree-scroller`,children:(0,J.jsx)(`div`,{style:{height:N.getTotalSize(),position:`relative`,width:`100%`},children:N.getVirtualItems().map(n=>{let r=M[n.index],i=ue(r.path)*12,s=r.kind===`file`&&r.path===t,c=r.provenance?.createdByTicketId,l=r.provenance?.modifiedByTicketIds??[],u=r.provenance?.latest??null,f=fe(u?.jobId),p=pe(u?.kind),m=r.kind===`dir`,_=m&&v.has(r.path),y=r.provenance?.touchedFileCount??0;return(0,J.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`,s&&`bg-muted text-foreground`),onClick:()=>{m?S(r.path):e(r.path)},role:`button`,tabIndex:0,"aria-expanded":m?!_:void 0,"data-testid":`file-tree-row-${r.path}`,children:[(0,J.jsxs)(`span`,{style:{paddingLeft:i},className:`flex items-center gap-1 min-w-0 flex-1`,children:[m?(0,J.jsxs)(J.Fragment,{children:[_?(0,J.jsx)(x,{className:`w-3 h-3 text-muted-foreground flex-shrink-0`}):(0,J.jsx)(g,{className:`w-3 h-3 text-muted-foreground flex-shrink-0`}),_?(0,J.jsx)(te,{className:`w-3.5 h-3.5 text-accent-info flex-shrink-0`}):(0,J.jsx)(ee,{className:`w-3.5 h-3.5 text-accent-info flex-shrink-0`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`w-3 flex-shrink-0`}),(0,J.jsx)(k,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`})]}),(0,J.jsx)(`span`,{className:`truncate ml-0.5`,children:de(r.path)})]}),(0,J.jsxs)(`span`,{className:`flex items-center gap-1 flex-shrink-0`,children:[m&&y>0&&(0,J.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}),!m&&p&&(0,J.jsx)(`span`,{className:o(`text-[10px] px-1.5 py-0.5 rounded`,u?.kind===`created`&&`bg-accent-success/15 text-accent-success`,u?.kind===`modified`&&`bg-accent-info/15 text-accent-info`,u?.kind===`deleted`&&`bg-destructive/15 text-destructive`),title:u?.kind===`created`?a(`tree.latestTitleCreated`):u?.kind===`deleted`?a(`tree.latestTitleDeleted`):a(`tree.latestTitleModified`),children:a(`action.${p}`)}),!m&&f&&(0,J.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:u?.jobId??``}),children:[(0,J.jsx)(h,{className:`h-3 w-3`}),f]}),!m&&typeof c==`number`&&(0,J.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),d(c)},className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success`,"data-testid":`provenance-chip-created-${c}`,title:a(`tree.createdBySpec`,{id:c}),children:[`#`,c]}),!m&&l.slice(0,2).map(e=>(0,J.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))]})]},r.path)})})})]})}function ge(e){return new Worker(`/assets/editor.worker-Bd9IXS8d.js`,{name:e?.name})}function _e(e){return new Worker(`/assets/json.worker-DzV-CpCQ.js`,{name:e?.name})}function ve(e){return new Worker(`/assets/css.worker-Wv5dxAWO.js`,{name:e?.name})}function ye(e){return new Worker(`/assets/html.worker-CQP8QQsS.js`,{name:e?.name})}function be(e){return new Worker(`/assets/ts.worker-METxwbDZ.js`,{name:e?.name})}var xe=!1;function Se(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 Z(e,t=`#1e1e1e`){if(e.startsWith(`#`))return e;let n=Se(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 Ce(e){return`specrails-${e}`}function we(e,t){let n=Ce(t.id),r=t.xterm,i=Z(r.background),a=Z(r.foreground),o=Z(r.brightBlack),s=Z(r.magenta),c=Z(r.yellow),l=Z(r.cyan),u=Z(r.blue),d=Z(r.green),f=Z(r.brightBlack),p=Z(r.brightCyan),m=Z(r.red),h=Z(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":Z(r.cursor),"editor.selectionBackground":h,"editor.inactiveSelectionBackground":h,"editor.lineHighlightBackground":Z(r.black),"editor.lineHighlightBorder":Z(r.black),"editorGutter.background":i,"editorWhitespace.foreground":o,"editorIndentGuide.background1":Z(r.black),"editorIndentGuide.activeBackground1":o,"scrollbarSlider.background":`${o}55`,"scrollbarSlider.hoverBackground":`${o}88`,"scrollbarSlider.activeBackground":`${o}bb`,"minimap.background":i}}),n}function Te(){xe||=(self.MonacoEnvironment={getWorker(e,t){switch(t){case`json`:return new _e;case`css`:case`scss`:case`less`:return new ve;case`html`:case`handlebars`:case`razor`:return new ye;case`typescript`:case`javascript`:return new be;default:return new ge}}},!0)}function Ee({content:e,language:n,readOnly:r,onChange:i}){let{t:a}=s(`code`),o=f(),c=(0,j.useRef)(null),l=(0,j.useRef)(null),u=(0,j.useRef)(null),[d,p]=(0,j.useState)(!1),m=(0,j.useRef)(e),h=(0,j.useRef)(n),g=(0,j.useRef)(o),_=(0,j.useRef)(r),v=(0,j.useRef)(i);return(0,j.useEffect)(()=>{m.current=e},[e]),(0,j.useEffect)(()=>{h.current=n},[n]),(0,j.useEffect)(()=>{g.current=o},[o]),(0,j.useEffect)(()=>{_.current=r},[r]),(0,j.useEffect)(()=>{v.current=i},[i]),(0,j.useEffect)(()=>{let e=!1;return Te(),t(()=>import(`./editor.main-C7Rmw-hR.js`).then(t=>{if(e||!c.current)return;u.current=t;let n=we(t,g.current),r=t.editor.create(c.current,{value:m.current,language:h.current,readOnly:_.current,theme:n,minimap:{enabled:!1},lineNumbers:`on`,scrollBeyondLastLine:!1,automaticLayout:!0,fontSize:13});r.onDidChangeModelContent(()=>{v.current?.(r.getValue())}),l.current=r}),__vite__mapDeps([0,1,2,3,4,5,6])).catch(()=>{e||p(!0)}),()=>{e=!0,l.current?.dispose?.(),l.current=null}},[]),(0,j.useEffect)(()=>{let t=l.current;t&&t.getValue?.()!==e&&t.setValue?.(e)},[e]),(0,j.useEffect)(()=>{l.current?.updateOptions?.({readOnly:r})},[r]),(0,j.useEffect)(()=>{let e=u.current,t=l.current;if(!e||!t)return;let r=t.getModel?.();r&&e.editor.setModelLanguage(r,n)},[n]),(0,j.useEffect)(()=>{let e=u.current;if(!e)return;let t=we(e,o);e.editor.setTheme(t)},[o]),d?(0,J.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,J.jsx)(`span`,{children:a(`monaco.loadFailed`)}),(0,J.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,J.jsx)(`div`,{ref:c,className:`w-full h-full`,"data-testid":`monaco-host`})}var De=(0,j.lazy)(async()=>({default:Ee}));function Oe({content:e,language:t,readOnly:n=!0,onChange:r}){let{t:i}=s(`code`);return(0,J.jsx)(j.Suspense,{fallback:(0,J.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,J.jsx)(De,{content:e,language:t,readOnly:n,onChange:r})})}function ke(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 Ae({path:e,summary:t,stale:n,regenerating:r,generateDisabledReason:i,onCollapse:a}){let{t:c,i18n:l}=s(`code`),{openTicketDetail:u}=y();if(!t)return(0,J.jsx)(`div`,{className:`border-b border-border px-4 py-3 bg-surface`,"data-testid":`summary-header-empty`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:e}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i?c(`summary.unavailable`,{reason:i}):c(`summary.empty`)})]}),a&&(0,J.jsxs)(`button`,{type:`button`,onClick:a,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,J.jsx)(E,{className:`h-3.5 w-3.5`}),c(`summary.hide`)]})]})});let d=ke(t.generatedAt,l.language),f=t.triggeredBy?.ticketId,p=t.triggeredBy?.modifiedTicketIds??[];return(0,J.jsx)(`div`,{className:`border-b border-border px-4 py-3 bg-surface`,"data-testid":`summary-header`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:e}),n&&(0,J.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:c(`summary.stale`)}),r&&(0,J.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent-primary animate-pulse`,"aria-hidden":!0})]}),(0,J.jsx)(`p`,{className:`text-sm text-foreground mt-1`,children:t.summary}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 flex-wrap`,children:[typeof f==`number`&&(0,J.jsxs)(`button`,{type:`button`,onClick:()=>u(f),className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success`,children:[`#`,f]}),p.map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>u(e),className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info`,children:[`#`,e]},e)),d&&(0,J.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:d})]})]}),a&&(0,J.jsxs)(`button`,{type:`button`,onClick:a,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,J.jsx)(E,{className:`h-3.5 w-3.5`}),c(`summary.hide`)]})]})})}function je({content:e}){return(0,J.jsx)(b,{remarkPlugins:[T],children:e})}function Me(e,t){return t===`markdown`||t===`md`?!0:/\.(md|mdx|markdown)$/i.test(e)}var Q=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 Q;try{let e=localStorage.getItem(t),n=e?Number(e):NaN;return Number.isFinite(n)&&n>0?n:Q}catch{return Q}}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}=s(`code`),{activeProjectId:o}=l(),{openTicketDetail:u}=y(),{registerHandler:f,unregisterHandler:p}=i(),m=(0,j.useRef)(null),[h,_]=(0,j.useState)(null),[v,b]=(0,j.useState)(!0),[x,S]=(0,j.useState)(!1),[C,w]=(0,j.useState)(!1),[T,D]=(0,j.useState)(()=>Be(o)),[ee,O]=(0,j.useState)(()=>Re(o)),[k,te]=(0,j.useState)(()=>He(o)),A=(0,j.useRef)(o);(0,j.useEffect)(()=>{A.current=o},[o]);let M=(0,j.useRef)(e);(0,j.useEffect)(()=>{M.current=e},[e]),(0,j.useEffect)(()=>{let e=m.current?.clientHeight||window.innerHeight;D(Be(o)),O(We(Re(o),e)),te(He(o))},[o]);let ne=(0,j.useCallback)(e=>{let t=e.clientY,n=ee,r=m.current?.clientHeight||window.innerHeight,i=e.currentTarget;try{i.setPointerCapture(e.pointerId)}catch{}function a(e){O(We(n+(t-e.clientY),r))}function s(){window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),O(e=>{let t=We(e,r);return ze(o,t),t})}window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,s),window.addEventListener(`pointercancel`,s)},[o,ee]),N=(0,j.useCallback)(()=>{let e=We(Q,m.current?.clientHeight||window.innerHeight);O(e),ze(o,e)},[o]),P=(0,j.useCallback)(()=>{D(e=>{let t=!e;return Ve(o,t),t})},[o]),F=(0,j.useCallback)(()=>{te(e=>{let t=!e;return Ue(o,t),t})},[o]);(0,j.useEffect)(()=>{S(!1),w(!1),V(`preview`),U(!1)},[e]);let I=(0,j.useRef)(0),L=(0,j.useCallback)(async()=>{let t=++I.current;b(!0);try{let n=await fetch(`${c()}/code/file?path=${encodeURIComponent(e)}`);if(t!==I.current)return;if(!n.ok){_(null);return}let r=await n.json();if(t!==I.current)return;_(r)}catch{t===I.current&&_(null)}finally{t===I.current&&b(!1)}},[e,o]);(0,j.useEffect)(()=>{L()},[L]),(0,j.useEffect)(()=>{if(!o)return;let e=`code-file-${o}`;return f(e,e=>{let t=e;t.projectId===A.current&&(t.type===`file.summary_updated`&&t.path===M.current?(S(!1),L()):t.type===`file.summary_failed`&&t.path===M.current?(d.error(t.reason??a(`summary.generationFailed`)),S(!1)):t.type===`file.summary_skipped`&&t.path===M.current&&(t.reason&&d(a(`summary.skipped`,{reason:t.reason})),S(!1)))}),()=>p(e)},[o,f,p,L,a]);let R=(0,j.useCallback)(async t=>{S(!0);try{let n=await fetch(`${c()}/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;d.error(e?a(`summary.skipped`,{reason:e}):a(`summary.generationFailed`));return}if(r.skipped===`budget`){S(!1),w(!0);return}if(r.skipped){S(!1),d(a(`summary.skipped`,{reason:r.skipped}));return}await L(),S(!1)}catch{S(!1),d.error(a(`summary.generationFailed`))}},[L,e,a]),z=(0,j.useCallback)(async()=>{let t=h?.absolutePath??e;try{await navigator.clipboard?.writeText(t),d.success(a(`viewer.pathCopied`))}catch{d.error(a(`viewer.copyPathFailed`))}},[h,e,a]),re=(0,j.useMemo)(()=>Me(e,h?.language),[e,h?.language]),[B,V]=(0,j.useState)(`preview`),[H,U]=(0,j.useState)(!1),[W,ie]=(0,j.useState)(``),[G,ae]=(0,j.useState)(!1),oe=h?.content!==void 0&&!h.binary&&!h.tooLarge&&h.reason!==`not-found`,se=(0,j.useCallback)(()=>{ie(h?.content??``),V(`raw`),U(!0)},[h]),ce=(0,j.useCallback)(async()=>{ae(!0);try{let t=await fetch(`${c()}/code/file`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({path:e,content:W})});if(!t.ok){let e=await t.json().catch(()=>({}));d.error(e.error??a(`viewer.saveFailed`));return}d.success(a(`viewer.saved`)),U(!1),L()}catch{d.error(a(`viewer.saveFailed`))}finally{ae(!1)}},[e,W,a,L]),K=h?.summary??null,le=!!h?.summaryStale,q=h?.provenance??[],Y=h?.reason===`not-found`,X=Y?a(`summary.reason.missing`):h?.binary?a(`summary.reason.binary`):h?.tooLarge?a(`summary.reason.tooLarge`):null;return(0,j.useEffect)(()=>{if(n){if(v&&!h){n(null);return}return n({hasSummary:!!K,regenerating:x,disabledReason:X,onClick:()=>R(!1)}),()=>n(null)}},[h,R,v,n,x,K,X]),(0,j.useEffect)(()=>{if(r){if(v&&!h){r(null);return}return r({onClick:z}),()=>r(null)}},[z,h,v,r]),v&&!h?(0,J.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-sm text-muted-foreground animate-pulse`,children:a(`viewer.loadingFile`)}):(0,J.jsxs)(`div`,{ref:m,className:`flex flex-col h-full`,"data-testid":`file-viewer`,children:[T?(0,J.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,J.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e}),(0,J.jsxs)(`button`,{type:`button`,onClick:P,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,J.jsx)(g,{className:`h-3.5 w-3.5`}),a(`viewer.showSummary`)]})]}):(0,J.jsx)(Ae,{path:e,summary:K,stale:le,regenerating:x,generateDisabledReason:X,onCollapse:P}),(0,J.jsxs)(`div`,{className:`px-4 py-1 border-b border-border flex items-center justify-between gap-3`,children:[(0,J.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:re&&h?.content!==void 0&&!h.binary&&!h.tooLarge&&(0,J.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px]`,role:`group`,"aria-label":a(`viewer.markdownViewMode`),children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>V(`preview`),"aria-pressed":B===`preview`,className:B===`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,J.jsx)(`button`,{type:`button`,onClick:()=>V(`raw`),"aria-pressed":B===`raw`,className:B===`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,J.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px] shrink-0`,children:[oe&&!H&&(0,J.jsx)(`button`,{type:`button`,onClick:se,className:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:a(`viewer.edit`)}),H&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>U(!1),disabled:G,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,J.jsx)(`button`,{type:`button`,onClick:ce,disabled:G,className:`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary hover:bg-accent-primary/30 disabled:opacity-50`,children:a(G?`viewer.saving`:`viewer.save`)})]})]})]}),(0,J.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:Y?(0,J.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,J.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,J.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,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,children:a(`viewer.noContent`)}):H?(0,J.jsx)(Oe,{content:W,language:h.language??`plaintext`,readOnly:!1,onChange:ie}):re&&B===`preview`?(0,J.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,J.jsx)(je,{content:h.content})}):(0,J.jsx)(Oe,{content:h.content,language:h.language??`plaintext`})}),q.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":a(`history.resize`),onPointerDown:k?void 0:ne,onDoubleClick:k?void 0:N,className:k?`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:k?void 0:a(`resizer.hint`),"data-testid":`code-history-resizer`,children:[(0,J.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:a(`history.title`,{count:q.length})}),(0,J.jsxs)(`button`,{type:`button`,onPointerDown:e=>e.stopPropagation(),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:[k?(0,J.jsx)(E,{className:`h-3.5 w-3.5`}):(0,J.jsx)(g,{className:`h-3.5 w-3.5`}),a(k?`history.show`:`history.hide`)]})]}),!k&&(0,J.jsx)(Ke,{rows:q,onOpenTicket:u,onFilterJob:t,height:ee})]}),C&&(0,J.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,J.jsxs)(`div`,{className:`bg-card border border-border rounded-lg p-4 w-80 flex flex-col gap-3`,children:[(0,J.jsx)(`p`,{className:`text-sm text-foreground`,children:a(`viewer.budgetPrompt`)}),(0,J.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>w(!1),className:`text-xs px-3 py-1.5 rounded-md text-muted-foreground hover:text-foreground`,children:a(`common:actions.cancel`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>{w(!1),R(!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}=s(`code`),[a,o]=(0,j.useState)(null),[l,u]=(0,j.useState)({});if(e.length===0)return null;async function d(e,t){if(a===t){o(null);return}if(o(t),!(!e.jobId||l[t])){u(e=>({...e,[t]:`loading`}));try{let n=new URLSearchParams({jobId:e.jobId,path:e.path}),r=await fetch(`${c()}/code/diff?${n.toString()}`);if(r.status===404){u(e=>({...e,[t]:`missing`}));return}if(!r.ok)throw Error(`diff failed`);let i=await r.json();u(e=>({...e,[t]:{patch:i.patch??``,truncated:i.truncated===!0}}))}catch{u(e=>({...e,[t]:`missing`}))}}}return(0,J.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,J.jsx)(`div`,{className:`h-full overflow-auto space-y-1`,children:e.map((e,r)=>{let o=e.kind===`created`?D:e.kind===`deleted`?v:C,s=e.jobId?e.jobId.length>12?e.jobId.slice(0,12):e.jobId:i(`history.unknownJob`),c=`${e.jobId??`job`}:${e.path}:${e.at}:${r}`,u=l[c];return(0,J.jsxs)(`div`,{className:`rounded-md hover:bg-muted/40`,children:[(0,J.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,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 min-w-0`,children:[(0,J.jsx)(o,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,J.jsx)(`span`,{className:`capitalize`,children:i(`kind.${e.kind}`)})]}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 min-w-0 text-muted-foreground`,children:[(0,J.jsx)(h,{className:`h-3.5 w-3.5 shrink-0`}),e.jobId&&n?(0,J.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,J.jsx)(`span`,{className:`font-mono truncate`,title:e.jobId??void 0,children:s}),e.jobId&&(0,J.jsx)(`button`,{type:`button`,onClick:()=>d(e,c),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,J.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,J.jsx)(`time`,{className:`text-[11px] text-muted-foreground`,dateTime:new Date(e.at).toISOString(),children:new Date(e.at).toLocaleString()})]}),a===c&&(0,J.jsx)(`div`,{className:`px-2 pb-2`,children:u===`loading`?(0,J.jsx)(`div`,{className:`rounded-md bg-muted/35 px-2 py-2 text-[11px] text-muted-foreground`,children:i(`history.loadingDiff`)}):u===`missing`||!u?(0,J.jsx)(`div`,{className:`rounded-md bg-muted/35 px-2 py-2 text-[11px] text-muted-foreground`,children:i(`history.diffUnavailable`)}):(0,J.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:[u.patch,u.truncated?`\n${i(`history.diffTruncated`)}`:``]})})]},c)})})})}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}=s(`code`),{activeProjectId:t}=l(),[n]=_(),r=S(),i=(0,j.useRef)(null),[a,o]=(0,j.useState)(n.get(`path`)),[c,u]=(0,j.useState)(null),[d,f]=(0,j.useState)(null),[p,m]=(0,j.useState)(()=>Ze(t)),h=n.get(`jobId`),g=(0,j.useMemo)(()=>{let e=n.get(`ticketId`);if(!e)return null;let t=Number(e);return Number.isInteger(t)&&t>0?t:null},[n]),[v,y]=(0,j.useState)(g==null?``:String(g));(0,j.useEffect)(()=>{let e=n.get(`path`);e!==a&&o(e)},[n]),(0,j.useEffect)(()=>{y(g==null?``:String(g))},[g]),(0,j.useEffect)(()=>{let e=i.current?.clientWidth||window.innerWidth;m($(Ze(t),e))},[t]),(0,j.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`&&m(e=>$(e,t))});return t.observe(e),()=>t.disconnect()},[]);let b=(0,j.useCallback)(e=>{let n=e.clientX,r=p,a=i.current?.clientWidth||window.innerWidth,o=e.currentTarget;try{o.setPointerCapture(e.pointerId)}catch{}function s(e){m($(r+(e.clientX-n),a))}function c(){window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),m(e=>{let n=$(e,a);return Qe(t,n),n})}window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)},[t,p]),x=(0,j.useCallback)(()=>{let e=$(qe,i.current?.clientWidth||window.innerWidth);m(e),Qe(t,e)},[t]),C=(0,j.useCallback)(e=>{o(e);let t=new URLSearchParams(n);t.set(`path`,e),r({pathname:`/code`,search:`?${t.toString()}`},{replace:!0})},[r,n]),w=(0,j.useCallback)(e=>{let t=new URLSearchParams(n);t.set(`jobId`,e),t.delete(`ticketId`),r({pathname:`/code`,search:`?${t.toString()}`},{replace:!0})},[r,n]),T=(0,j.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,j.useCallback)(e=>{let t=Number(e.trim());if(!Number.isInteger(t)||t<=0){T();return}let i=new URLSearchParams(n);i.set(`ticketId`,String(t)),i.delete(`jobId`),r({pathname:`/code`,search:`?${i.toString()}`},{replace:!0})},[T,r,n]);return(0,J.jsxs)(`div`,{ref:i,className:`flex h-full w-full`,"data-testid":`code-page`,children:[(0,J.jsx)(`aside`,{className:`overflow-hidden flex flex-col shrink-0`,style:{width:p},children:(0,J.jsx)(he,{onOpenFile:C,selectedPath:a,filterJobId:h,filterTicketId:g},t??`no-project`)}),(0,J.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":e(`page.resizeFileTree`),onPointerDown:b,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,J.jsxs)(`main`,{className:`flex-1 overflow-hidden flex flex-col`,children:[(0,J.jsx)(et,{jobId:h,ticketId:g,ticketInput:v,onTicketInputChange:y,onApplyTicket:E,onClear:T,summaryAction:c,copyPathAction:d}),(h||g)&&(0,J.jsx)(tt,{jobId:h,ticketId:g,onOpenFile:C}),a?(0,J.jsx)(Ge,{relPath:a,onFilterJob:w,onSummaryActionChange:u,onCopyPathActionChange:f}):(0,J.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:n,onTicketInputChange:i,onApplyTicket:a,onClear:o,summaryAction:c,copyPathAction:l}){let{t:d}=s(`code`),f=t?`spec`:e?`job-context`:`all`;return(0,J.jsx)(`div`,{className:`border-b border-border bg-background/80 px-4 py-2`,"data-testid":`code-provenance-toolbar`,children:(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,J.jsx)(A,{className:`h-3.5 w-3.5`}),d(`toolbar.scope`)]}),(0,J.jsx)(`button`,{type:`button`,onClick:o,"aria-pressed":f===`all`,className:f===`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:d(`toolbar.allAi`)}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border/70 bg-card/40 px-1 py-1`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>a(n),"aria-pressed":f===`spec`,className:f===`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:d(`toolbar.spec`)}),(0,J.jsx)(`input`,{value:n,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&a(n)},placeholder:d(`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,J.jsx)(`div`,{className:`flex-1`}),l&&(0,J.jsx)(`button`,{type:`button`,onClick:l.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:d(`toolbar.copyFilePath`)}),c&&(0,J.jsxs)(`button`,{type:`button`,onClick:c.onClick,disabled:c.regenerating||!!c.disabledReason,"aria-label":c.hasSummary?d(`toolbar.regenerateSummary`):d(`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:c.disabledReason?d(`toolbar.summaryUnavailable`,{reason:c.disabledReason}):void 0,children:[(0,J.jsx)(u,{className:c.regenerating?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),c.hasSummary?c.regenerating?d(`toolbar.regenerating`):d(`toolbar.regenerateSummary`):c.regenerating?d(`toolbar.generating`):d(`toolbar.generateSummary`)]}),f===`job-context`&&(0,J.jsx)(`span`,{className:`rounded-md bg-accent-info/15 px-2 py-1 text-xs text-accent-info`,children:d(`toolbar.jobContext`)}),(e||t)&&(0,J.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,J.jsx)(r,{className:`h-3.5 w-3.5`}),d(`toolbar.clear`)]})]})})}function tt({jobId:e,ticketId:t,onOpenFile:n}){let{t:r}=s(`code`),[i,a]=(0,j.useState)(null);(0,j.useEffect)(()=>{let n=!1,r=new URLSearchParams;return e&&r.set(`jobId`,e),t&&r.set(`ticketId`,String(t)),fetch(`${c()}/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,j.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]),l=i?.length??0;return(0,J.jsx)(`section`,{className:`border-b border-border bg-card/35 px-4 py-3`,"data-testid":`provenance-result-panel`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold truncate`,children:e?r(`provenancePanel.jobTitle`,{jobId:e}):r(`provenancePanel.specTitle`,{ticketId:t})}),(0,J.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:r(`provenancePanel.touchedFiles`,{count:l})})]}),(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,J.jsx)(nt,{label:r(`action.added`),rows:o.created,icon:`created`,onOpenFile:n}),(0,J.jsx)(nt,{label:r(`action.changed`),rows:o.modified,icon:`modified`,onOpenFile:n}),(0,J.jsx)(nt,{label:r(`action.deleted`),rows:o.deleted,icon:`deleted`,onOpenFile:n})]})]}),(0,J.jsx)(`div`,{className:`flex items-center gap-1 shrink-0`,children:e&&(0,J.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,J.jsx)(m,{className:`h-3.5 w-3.5`}),r(`provenancePanel.log`)]})})]})})}function nt({label:e,rows:t,icon:n,onOpenFile:r}){return(0,J.jsxs)(`details`,{className:`group min-w-[180px] max-w-[320px]`,children:[(0,J.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,J.jsx)(n===`created`?D:n===`deleted`?v:C,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,J.jsx)(`span`,{children:e}),(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:t.length})]}),t.length>0&&(0,J.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,J.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,11 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{E as t,Lt as n,P as r,Qt as i,T as a,Z as o,_t as s,k as c,m as l,mt as u,nt as d,on as f,p,w as m}from"./index-DGIXKRHE.js";import{t as h}from"./lib-Bro9Z0gp.js";/* empty css */var g=e(f(),1),_=n();function v({categories:e,activeCategory:t,activeSlug:n,onSelect:a,onHome:o}){let{t:c}=i(`integrations`);return(0,_.jsxs)(`nav`,{className:`w-56 flex-shrink-0 border-r border-border overflow-y-auto py-4 px-3`,children:[(0,_.jsxs)(`button`,{onClick:o,className:`flex items-center gap-2 mb-4 px-2 text-xs font-bold text-muted-foreground hover:text-foreground transition-colors`,children:[(0,_.jsx)(s,{className:`w-3.5 h-3.5`}),c(`docs.title`)]}),(0,_.jsx)(`div`,{className:`space-y-4`,children:e.map(e=>(0,_.jsxs)(`div`,{children:[(0,_.jsxs)(`div`,{className:`px-2 mb-1 flex items-center justify-between`,children:[(0,_.jsx)(`span`,{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e.name}),e.docs.length>0&&(0,_.jsx)(`span`,{className:`text-[9px] font-medium text-muted-foreground/60 bg-muted/40 rounded px-1 py-0.5 leading-none`,children:e.docs.length})]}),e.docs.length===0?(0,_.jsx)(`p`,{className:`px-2 text-xs text-muted-foreground italic`,children:c(`docs.sidebarEmpty`)}):(0,_.jsx)(`ul`,{className:`space-y-0.5`,children:e.docs.map(i=>(0,_.jsx)(`li`,{children:(0,_.jsxs)(`button`,{onClick:()=>a(e.slug,i.slug),className:r(`w-full flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-colors text-left`,t===e.slug&&n===i.slug?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`),children:[(0,_.jsx)(d,{className:`w-3 h-3 flex-shrink-0`}),i.title]})},i.slug))})]},e.slug))})]})}function y({categories:e,onSelect:t}){let{t:n}=i(`integrations`),r=e.reduce((e,t)=>e+t.docs.length,0),a=e.filter(e=>e.docs.length>0).length;return(0,_.jsxs)(`div`,{className:`max-w-2xl mx-auto py-8 px-6`,children:[(0,_.jsxs)(`div`,{className:`mb-8`,children:[(0,_.jsx)(`h1`,{className:`text-xl font-bold mb-2`,children:n(`docs.title`)}),(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r===0?n(`docs.indexEmpty`):n(`docs.summary`,{documents:n(`docs.documentCount`,{count:r}),categories:n(`docs.categoryCount`,{count:a})})})]}),(0,_.jsx)(`div`,{className:`space-y-6`,children:e.map(e=>(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-2`,children:e.name}),e.docs.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground italic pl-2`,children:n(`docs.categoryEmpty`)}):(0,_.jsx)(`ul`,{className:`space-y-1`,children:e.docs.map(n=>(0,_.jsx)(`li`,{children:(0,_.jsxs)(`button`,{onClick:()=>t(e.slug,n.slug),className:`w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm hover:bg-accent transition-colors group text-left`,children:[(0,_.jsx)(d,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`}),(0,_.jsx)(`span`,{className:`text-foreground group-hover:text-foreground`,children:n.title}),(0,_.jsx)(u,{className:`w-3 h-3 text-muted-foreground ml-auto md:opacity-0 md:group-hover:opacity-100 transition-opacity`})]})},n.slug))})]},e.slug))})]})}var b=(0,g.memo)(function({content:e}){return(0,_.jsx)(l,{remarkPlugins:[p],rehypePlugins:[h],children:e})});function x({category:e,slug:t,onNotFound:n,scrollContainerRef:r}){let{t:a}=i(`integrations`),[s,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(null),d=(0,g.useRef)(0);return(0,g.useEffect)(()=>{let i=++d.current;u(null),fetch(`/api/docs/${e}/${t}`).then(async e=>{if(e.status===404){n();return}if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{i===d.current&&e&&(c(e),r.current&&(r.current.scrollTop=0))}).catch(e=>{i===d.current&&u(e instanceof Error?e.message:a(`docs.loadError`))})},[e,t,n,r]),!s&&!l?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(o,{className:`w-4 h-4 animate-spin text-muted-foreground`})}):l&&!s?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(`p`,{className:`text-sm text-destructive`,children:l})}):s?(0,_.jsx)(`article`,{className:`max-w-2xl mx-auto py-8 px-6`,children:(0,_.jsx)(`div`,{className:`prose prose-sm max-w-none
|
|
2
|
-
prose-headings:text-foreground prose-headings:font-bold
|
|
3
|
-
prose-p:text-foreground/90
|
|
4
|
-
prose-a:text-accent-primary prose-a:no-underline hover:prose-a:underline
|
|
5
|
-
prose-strong:text-foreground
|
|
6
|
-
prose-code:text-accent-info prose-code:bg-card prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:text-xs
|
|
7
|
-
prose-pre:bg-card prose-pre:border prose-pre:border-border prose-pre:rounded-md prose-pre:p-0 prose-pre:overflow-x-auto
|
|
8
|
-
prose-blockquote:border-l-accent-primary prose-blockquote:text-muted-foreground
|
|
9
|
-
prose-hr:border-border
|
|
10
|
-
prose-th:text-foreground prose-td:text-foreground/90
|
|
11
|
-
prose-li:text-foreground/90`,children:(0,_.jsx)(b,{content:s.content})})}):null}function S({open:e,onClose:n}){let{t:r}=i(`integrations`),[s,l]=(0,g.useState)(null),[u,d]=(0,g.useState)(!0),[f,p]=(0,g.useState)(),[h,b]=(0,g.useState)(),S=(0,g.useRef)(null);(0,g.useEffect)(()=>{e&&(d(!0),fetch(`/api/docs`).then(e=>e.json()).then(e=>l(e)).catch(()=>l({categories:[]})).finally(()=>d(!1)))},[e]);let C=(0,g.useCallback)((e,t)=>{p(e),b(t)},[]),w=(0,g.useCallback)(()=>{p(void 0),b(void 0)},[]),T=!!(f&&h);return(0,_.jsx)(m,{open:e,onOpenChange:e=>{e||n()},children:(0,_.jsxs)(a,{className:`max-w-5xl max-h-[90vh] overflow-hidden p-0 flex flex-col`,children:[(0,_.jsx)(c,{className:`sr-only`,children:r(`docs.title`)}),(0,_.jsx)(t,{className:`sr-only`,children:r(`docs.dialogDescription`)}),(0,_.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[u?(0,_.jsx)(`div`,{className:`w-56 flex-shrink-0 border-r border-border flex items-center justify-center`,children:(0,_.jsx)(o,{className:`w-3.5 h-3.5 animate-spin text-muted-foreground`})}):(0,_.jsx)(v,{categories:s?.categories??[],activeCategory:f,activeSlug:h,onSelect:C,onHome:w}),(0,_.jsx)(`main`,{ref:S,className:`flex-1 overflow-y-auto`,children:T&&f&&h?(0,_.jsx)(x,{category:f,slug:h,onNotFound:w,scrollContainerRef:S}):s&&(0,_.jsx)(y,{categories:s.categories,onSelect:C})})]})]})})}var C=(0,g.memo)(S);export{C as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{Lt as t,P as n,Qt as r,Z as i,_t as a,m as o,mt as s,nn as c,nt as l,on as u,p as d,rn as f,tn as p}from"./index-DGIXKRHE.js";import{t as m}from"./lib-Bro9Z0gp.js";/* empty css */var h=e(u(),1),g=t();function _({categories:e,activeCategory:t,activeSlug:i}){let{t:o}=r(`integrations`);return(0,g.jsxs)(`nav`,{className:`w-56 flex-shrink-0 border-r border-border overflow-y-auto py-4 px-3`,children:[(0,g.jsxs)(p,{to:`/docs`,className:`flex items-center gap-2 mb-4 px-2 text-xs font-bold text-muted-foreground hover:text-foreground transition-colors`,children:[(0,g.jsx)(a,{className:`w-3.5 h-3.5`}),o(`docs.title`)]}),(0,g.jsx)(`div`,{className:`space-y-4`,children:e.map(e=>(0,g.jsxs)(`div`,{children:[(0,g.jsxs)(`div`,{className:`px-2 mb-1 flex items-center justify-between`,children:[(0,g.jsx)(`span`,{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e.name}),e.docs.length>0&&(0,g.jsx)(`span`,{className:`text-[9px] font-medium text-muted-foreground/60 bg-muted/40 rounded px-1 py-0.5 leading-none`,children:e.docs.length})]}),e.docs.length===0?(0,g.jsx)(`p`,{className:`px-2 text-xs text-muted-foreground italic`,children:o(`docs.sidebarEmpty`)}):(0,g.jsx)(`ul`,{className:`space-y-0.5`,children:e.docs.map(r=>{let a=t===e.slug&&i===r.slug;return(0,g.jsx)(`li`,{children:(0,g.jsxs)(p,{to:`/docs/${e.slug}/${r.slug}`,className:n(`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-colors`,a?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`),children:[(0,g.jsx)(l,{className:`w-3 h-3 flex-shrink-0`}),r.title]})},r.slug)})})]},e.slug))})]})}function v({categories:e}){let{t}=r(`integrations`),n=e.reduce((e,t)=>e+t.docs.length,0),i=e.filter(e=>e.docs.length>0).length;return(0,g.jsxs)(`div`,{className:`max-w-2xl mx-auto py-8 px-6`,children:[(0,g.jsxs)(`div`,{className:`mb-8`,children:[(0,g.jsx)(`h1`,{className:`text-xl font-bold mb-2`,children:t(`docs.title`)}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n===0?t(`docs.indexEmpty`):t(`docs.summary`,{documents:t(`docs.documentCount`,{count:n}),categories:t(`docs.categoryCount`,{count:i})})})]}),(0,g.jsx)(`div`,{className:`space-y-6`,children:e.map(e=>(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-2`,children:e.name}),e.docs.length===0?(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground italic pl-2`,children:t(`docs.categoryEmpty`)}):(0,g.jsx)(`ul`,{className:`space-y-1`,children:e.docs.map(t=>(0,g.jsx)(`li`,{children:(0,g.jsxs)(p,{to:`/docs/${e.slug}/${t.slug}`,className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm hover:bg-accent transition-colors group`,children:[(0,g.jsx)(l,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`}),(0,g.jsx)(`span`,{className:`text-foreground group-hover:text-foreground`,children:t.title}),(0,g.jsx)(s,{className:`w-3 h-3 text-muted-foreground ml-auto md:opacity-0 md:group-hover:opacity-100 transition-opacity`})]})},t.slug))})]},e.slug))})]})}var y=(0,h.memo)(function({content:e}){return(0,g.jsx)(o,{remarkPlugins:[d],rehypePlugins:[m],children:e})});function b({category:e,slug:t,scrollContainerRef:n}){let{t:a}=r(`integrations`),[o,s]=(0,h.useState)(null),[l,u]=(0,h.useState)(null),d=(0,h.useRef)(0),f=c();return(0,h.useEffect)(()=>{let r=++d.current;u(null),fetch(`/api/docs/${e}/${t}`).then(async e=>{if(e.status===404){f(`/docs`,{replace:!0});return}if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{r===d.current&&e&&(s(e),n.current&&(n.current.scrollTop=0))}).catch(e=>{r===d.current&&u(e instanceof Error?e.message:a(`docs.loadError`))})},[e,t,f,n]),!o&&!l?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,g.jsx)(i,{className:`w-4 h-4 animate-spin text-muted-foreground`})}):l&&!o?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,g.jsx)(`p`,{className:`text-sm text-destructive`,children:l})}):o?(0,g.jsx)(`article`,{className:`max-w-2xl mx-auto py-8 px-6`,children:(0,g.jsx)(`div`,{className:`prose prose-sm max-w-none
|
|
2
|
-
prose-headings:text-foreground prose-headings:font-bold
|
|
3
|
-
prose-p:text-foreground/90
|
|
4
|
-
prose-a:text-accent-primary prose-a:no-underline hover:prose-a:underline
|
|
5
|
-
prose-strong:text-foreground
|
|
6
|
-
prose-code:text-accent-info prose-code:bg-card prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:text-xs
|
|
7
|
-
prose-pre:bg-card prose-pre:border prose-pre:border-border prose-pre:rounded-md prose-pre:p-0 prose-pre:overflow-x-auto
|
|
8
|
-
prose-blockquote:border-l-accent-primary prose-blockquote:text-muted-foreground
|
|
9
|
-
prose-hr:border-border
|
|
10
|
-
prose-th:text-foreground prose-td:text-foreground/90
|
|
11
|
-
prose-li:text-foreground/90`,children:(0,g.jsx)(y,{content:o.content})})}):null}function x(){let{category:e,slug:t}=f(),[n,r]=(0,h.useState)(null),[a,o]=(0,h.useState)(!0),s=(0,h.useRef)(null);(0,h.useEffect)(()=>{fetch(`/api/docs`).then(e=>e.json()).then(e=>r(e)).catch(()=>r({categories:[]})).finally(()=>o(!1))},[]);let c=!!(e&&t);return(0,g.jsxs)(`div`,{className:`flex h-full overflow-hidden`,children:[a?(0,g.jsx)(`div`,{className:`w-56 flex-shrink-0 border-r border-border flex items-center justify-center`,children:(0,g.jsx)(i,{className:`w-3.5 h-3.5 animate-spin text-muted-foreground`})}):(0,g.jsx)(_,{categories:n?.categories??[],activeCategory:e,activeSlug:t}),(0,g.jsx)(`main`,{ref:s,className:`flex-1 overflow-y-auto`,children:c&&e&&t?(0,g.jsx)(b,{category:e,slug:t,scrollContainerRef:s}):n&&(0,g.jsx)(v,{categories:n.categories})})]})}export{x as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{C as t,It as n,J as r,K as i,L as a,Lt as o,N as s,O as c,Qt as l,R as u,Rt as d,S as f,T as p,Tt as m,Z as h,Zt as g,dt as _,en as v,k as y,on as b,ot as x,t as S,ut as C,w,wt as T}from"./index-DGIXKRHE.js";import{t as E}from"./useProjectCache-D9juBhsO.js";var D=e(b(),1),O=o(),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}=l(`jira`),r=e.connection,[i,a]=(0,D.useState)(r.enabled),[o,c]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),[p,m]=(0,D.useState)([]),[h,_]=(0,D.useState)([]),[v,y]=(0,D.useState)(r.discardStatus??``),[b,x]=(0,D.useState)(r.statusMap??{}),S=e.outbox??{pending:0,inflight:0,done:0,dead:0},C=(0,D.useCallback)(async()=>{try{let{ops:e}=await f.listOutbox(`dead`);m(e)}catch{m([])}},[]);(0,D.useEffect)(()=>{C()},[C]),(0,D.useEffect)(()=>{let e=!1;return f.listStatuses().then(({statuses:t})=>{e||_(t)}).catch(()=>{e||_([])}),()=>{e=!0}},[]);async function w(e){let r=v;y(e);try{await f.patchConnection({discardStatus:e||null}),t()}catch(e){y(r),g.error(N(e,n))}}async function T(e,r){let i=b,a={...b,[e]:r||void 0};x(a);let o=Object.fromEntries(Object.entries(a).filter(([,e])=>e));try{await f.patchConnection({statusMap:Object.keys(o).length?o:null}),t()}catch(e){x(i),g.error(N(e,n))}}async function E(){let e=!i;a(e),d(!0);try{await f.setEnabled(e)}catch(t){a(!e),g.error(N(t,n))}finally{d(!1)}}async function j(){c(!0);try{let e=await f.syncNow();g.success(n(`status.syncedToast`,{count:e.upserted}))}catch(e){g.error(N(e,n))}finally{c(!1)}}async function P(){if(window.confirm(n(`status.disconnectConfirm`))){d(!0);try{await f.disconnect(),g.success(n(`status.disconnectedToast`)),t()}catch(e){g.error(N(e,n))}finally{d(!1)}}}async function F(e){try{await f.retryOutbox(e),await C()}catch(e){g.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:r.jiraProjectKey})}),(0,O.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[r.baseUrl,` · `,r.deployment===`cloud`?n(`review.cloud`):n(`review.dc`)]})]}),(0,O.jsx)(`a`,{href:`${r.baseUrl}/browse/${r.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(i?`status.enabledHelp`:`status.pausedHelp`)})]}),(0,O.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":i,"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 ${i?`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 ${i?`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`)}),h.map(e=>(0,O.jsx)(`option`,{value:e.name,children:e.name},e.id)),b[e]&&!h.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:v,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`)}),h.map(e=>(0,O.jsx)(`option`,{value:e.name,children:e.name},e.id)),v&&!h.some(e=>e.name===v)&&(0,O.jsx)(`option`,{value:v,children:v})]})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(s,{variant:`outline`,size:`sm`,onClick:j,disabled:o,children:n(o?`status.syncing`:`status.syncNow`)}),(0,O.jsx)(s,{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`)}),p.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`)}),p.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)(s,{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}=l(`integrations`),[i,a]=(0,D.useState)(null),[o,s]=(0,D.useState)(!0),[u,d]=(0,D.useState)(!1),[m,h]=(0,D.useState)(!1),g=(0,D.useCallback)(async()=>{try{a(await f.getConnection())}catch{a({connected:!1})}finally{s(!1)}},[]);if((0,D.useEffect)(()=>{!t||!e||(s(!0),g())},[e,g]),!t)return null;let v=!!(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)(r,{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`)}),v&&(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)(_,{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:v&&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:o?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`…`}):v?(0,O.jsx)(`button`,{type:`button`,onClick:()=>h(!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:()=>d(!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)(r,{className:`w-3.5 h-3.5`}),n(`jiraCard.connect`)]})}),(0,O.jsx)(w,{open:u,onOpenChange:d,children:(0,O.jsxs)(p,{className:`max-w-lg`,children:[(0,O.jsx)(c,{children:(0,O.jsx)(y,{children:n(`jiraCard.modalTitle`)})}),(0,O.jsx)(S,{onConnected:()=>{d(!1),g()},onSkip:()=>d(!1)})]})}),(0,O.jsx)(w,{open:m,onOpenChange:h,children:(0,O.jsxs)(p,{className:`max-w-lg`,children:[(0,O.jsx)(c,{children:(0,O.jsx)(y,{children:n(`jiraCard.manageTitle`)})}),i?.connected&&i.connection&&(0,O.jsx)(j,{state:i,onChanged:()=>{g().then(()=>h(!1))}})]})})]})}function F(){let{t:e}=l(`integrations`),{activeProjectId:r,projects:o}=m(),s=o.find(e=>e.id===r),c=s?T(s).includes(`claude`):!0,{registerHandler:u,unregisterHandler:f}=n(),p=(0,D.useRef)(r);(0,D.useEffect)(()=>{p.current=r},[r]);let[h,g]=(0,D.useState)(null),[_,v]=(0,D.useState)(null),{data:y,isLoading:b,isFirstLoad:x,refresh:S}=E({namespace:`plugins`,projectId:r,initialValue:[],fetcher:(0,D.useCallback)(async()=>{let e=await fetch(`${d()}/plugins`);if(!e.ok)throw Error(`HTTP ${e.status}`);return(await e.json()).plugins??[]},[])});(0,D.useEffect)(()=>(u(`integrations-page`,e=>{let t=e;t.type&&(t.projectId&&t.projectId!==p.current||t.type.startsWith(`plugin.`)&&S())}),()=>f(`integrations-page`)),[u,f,S]),(0,D.useEffect)(()=>{g(!b&&!y?`Failed to load plugins`:null)},[b,y]);let C=(0,D.useMemo)(()=>(y??[]).filter(e=>e.status!==`orphan`),[y]),w=(0,D.useMemo)(()=>(y??[]).filter(e=>e.status===`orphan`),[y]);return r?(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)(i,{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,{}):h&&c?(0,O.jsx)(K,{onRetry:S}):(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:r}),c&&C.map(e=>(0,O.jsx)(I,{plugin:e,isInstalling:_===e.name,onInstall:()=>v(e.name),onCloseInstall:()=>{v(null),S()}},e.name))]}),c&&w.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)(a,{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:w.map(e=>(0,O.jsx)(V,{plugin:e,onRemoved:S},e.name))})]}),!t&&(!c||C.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:n,onCloseInstall:r}){let{t:i}=l(`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)(_,{className:`w-3 h-3`}),` `,i(`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)(C,{className:`w-3 h-3`}),` `,i(`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)(a,{className:`w-3 h-3`}),` `,i(`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)(x,{className:`w-3 h-3`}),` `,i(`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:i(`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)(v,{t:i,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:n,className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white hover:opacity-90`,children:i(`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)(u,{className:`w-3 h-3`}),` `,i(`card.uninstall`)]})]})}),t&&(0,O.jsx)(H,{pluginName:e.name,onClose:r}),o&&(0,O.jsx)(U,{pluginName:e.name,onClose:()=>s(!1),onUninstalled:()=>{s(!1)}})]})}function L({pluginName:e,active:t}){let{t:n}=l(`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=`${d()}/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}=l(`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)(a,{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)(v,{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}=l(`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)(x,{className:`w-3 h-3 text-accent-info mt-0.5 flex-shrink-0`}),(0,O.jsx)(`span`,{children:(0,O.jsx)(v,{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(`${d()}/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)(h,{className:`w-2.5 h-2.5 animate-spin`}),(0,O.jsx)(v,{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}=l(`integrations`),[r,i]=(0,D.useState)(null),[o,s]=(0,D.useState)(null),c=async e=>{i(e),s(null);try{let t=await fetch(`${d()}/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){s(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)(a,{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)(v,{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:()=>c(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)(h,{className:`w-2.5 h-2.5 animate-spin`}),(0,O.jsx)(v,{t:n,i18nKey:`conflict.disableButton`,values:{key:e},components:{code:(0,O.jsx)(`code`,{})}})]},e))}),o&&(0,O.jsx)(`div`,{className:`text-destructive`,children:o})]})}function V({plugin:e,onRemoved:t}){let{t:n}=l(`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(`${d()}/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)(u,{className:`w-3 h-3`}),` `,n(`orphan.removeButton`)]})})]})}function H({pluginName:e,onClose:t}){let{t:r}=l(`integrations`),[i,o]=(0,D.useState)(null),[s,c]=(0,D.useState)(null),[u,f]=(0,D.useState)(!1),[p,m]=(0,D.useState)(null),[g,v]=(0,D.useState)([]),[y,b]=(0,D.useState)(null),[S,w]=(0,D.useState)([]),{registerHandler:T,unregisterHandler:E}=n(),k=(0,D.useCallback)(()=>{o(null),c(null),fetch(`${d()}/plugins/${e}/preview-install`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>o(e)).catch(e=>c(e.message))},[e]);(0,D.useEffect)(()=>{k()},[k]),(0,D.useEffect)(()=>(T(`install-${e}`,t=>{let n=t;if(n.type===`plugin.install_progress`&&n.name===e&&n.line&&v(e=>[...e,n.line]),n.type===`plugin.prereq_install_progress`&&n.line&&w(e=>[...e,n.line]),n.type===`plugin.prereq_installed`){b(null);let e=n.reason;e&&w(t=>[...t,`► ${e}`]),n.ok&&k()}}),()=>E(`install-${e}`)),[e,T,E,k]);let A=async e=>{b(e),w([r(`installDialog.installingPrereq`,{name:e})]);try{await fetch(`${d()}/plugins/_prerequisites/${e}/install`,{method:`POST`})}catch(e){w(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:[s&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:s}),!i&&!s&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(h,{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)(a,{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,n=e.name===`uv`;return(0,O.jsxs)(`li`,{className:`flex items-center gap-2`,children:[t?(0,O.jsx)(_,{className:`w-3 h-3 text-accent-success`}):(0,O.jsx)(C,{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&&n&&(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)(h,{className:`w-2.5 h-2.5 animate-spin`}),r(`installDialog.autoInstall`)]})]},e.name)})}),S.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:S.join(`
|
|
2
|
-
`)})]}),g.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:g.join(`
|
|
3
|
-
`)})]}),p&&(0,O.jsx)(`div`,{className:`text-xs text-destructive`,children:p})]}),(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||u,onClick:async()=>{f(!0),m(null);try{let n=await fetch(`${d()}/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{f(!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:[u?(0,O.jsx)(h,{className:`w-3 h-3 animate-spin`}):(0,O.jsx)(x,{className:`w-3 h-3`}),r(`card.install`)]})]})]})}function U({pluginName:e,onClose:t,onUninstalled:n}){let{t:r}=l(`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)(v,{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(`${d()}/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)(h,{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}=l(`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)(a,{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}=l(`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)(i,{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{Ct as t,Dt as n,Et as r,It as i,Lt as a,M as o,N as s,P as c,Qt as l,Rt as u,Tt as d,V as f,W as p,Z as m,Zt as h,b as g,dt as _,ht as v,l as y,lt as b,m as x,mt as S,nn as C,o as w,on as T,ot as E,p as D,pt as O,rn as ee,st as k,tn as A,u as j,ut as M,x as N,y as P}from"./index-DGIXKRHE.js";import{t as F}from"./lib-Bro9Z0gp.js";import{t as I}from"./format-command-2VNoNnMv.js";var te=t(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),L=t(`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`}]]),R=e(T(),1),z=a();function ne({phases:e,phaseDefinitions:t}){return t.length===0?null:(0,z.jsx)(`div`,{className:`flex items-center`,children:t.map((n,r)=>{let i=e[n.key]??`idle`,a=r<t.length-1?e[t[r+1].key]??`idle`:null;return(0,z.jsxs)(`div`,{className:`flex items-center`,children:[(0,z.jsxs)(P,{children:[(0,z.jsx)(N,{asChild:!0,children:(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5 cursor-default px-4`,children:[(0,z.jsx)(B,{state:i}),(0,z.jsx)(`span`,{className:c(`text-xs font-medium transition-colors`,i===`running`?`text-blue-400 aurora-light:text-accent-info`:i===`done`?`text-emerald-400 aurora-light:text-accent-success`:i===`error`?`text-red-400 aurora-light:text-destructive`:`text-muted-foreground/40`),children:n.label})]})}),(0,z.jsxs)(g,{side:`bottom`,className:`max-w-[200px]`,children:[(0,z.jsx)(`p`,{className:`font-medium`,children:n.label}),(0,z.jsx)(`p`,{className:`text-muted-foreground mt-0.5`,children:n.description})]})]}),a!==null&&(0,z.jsx)(`div`,{className:c(`h-px w-12 -mt-5 shrink-0 transition-all duration-300`,a===`done`||i===`done`?`bg-emerald-500/30 aurora-light:bg-accent-success/40`:a===`running`?`bg-blue-400/40 aurora-light:bg-accent-info/40`:`bg-border/30`)})]},n.key)})})}function B({state:e}){return(0,z.jsxs)(`div`,{className:c(`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,z.jsx)(m,{className:`w-6 h-6 text-blue-400 aurora-light:text-accent-info animate-spin`}),e===`done`&&(0,z.jsx)(_,{className:`w-6 h-6 text-emerald-400 aurora-light:text-accent-success`}),e===`error`&&(0,z.jsx)(M,{className:`w-6 h-6 text-red-400 aurora-light:text-destructive`}),e===`idle`&&(0,z.jsx)(b,{className:`w-6 h-6 text-muted-foreground/20`})]})}function V(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 H(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 U=new Set([`editing`,`writing`,`reading`,`searching`,`running`]);function W(e){return e.length>40?`${e.slice(0,39)}…`:e}function G(e){return typeof e!=`string`||e.length===0?``:W(e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()??``)}function K(e){return typeof e!=`string`||e.length===0?``:W(e.trim().split(/\s+/)[0]??``)}function q(e){if(typeof e!=`string`)return``;try{let t=JSON.parse(e)?.command;if(Array.isArray(t))return K(t.filter(e=>typeof e==`string`).join(` `));if(typeof t==`string`)return K(t)}catch{}return``}function J(e,t){let n=t??{},r=G(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:W(String(n.pattern??n.query??``))};case`Bash`:case`shell`:return{step:!0,actionKey:`running`,actionArg:K(n.command)};default:return{step:!0,actionKey:`working`}}}function Y(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{...J(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 J(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:K(e?.command)||q(e?.arguments)||(typeof e?.name==`string`?W(e.name):``)||(t===`local_shell_call`?`shell`:``)}:{step:!0}}return{step:!1}}var X={steps:0,actionKey:``,actionArg:``,lastSeenIdx:0};function re(e,t){if(t.type===`reset`)return X;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=Y(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 ie({job:e,events:t,defaultOpen:n=!0,pipelineTotals:r,phases:i,phaseDefinitions:a}){let{t:o}=l(`jobs`),[s,u]=(0,R.useState)(n),d=(0,R.useMemo)(()=>H(t),[t]),f=e.status===`running`,p=e.status===`completed`,[h,g]=(0,R.useState)(()=>Date.now());(0,R.useEffect)(()=>{if(!f)return;let e=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(e)},[f]);let[y,b]=(0,R.useReducer)(re,X),x=(0,R.useRef)(e.id);(0,R.useEffect)(()=>{x.current!==e.id&&(x.current=e.id,b({type:`reset`})),b({type:`consume`,events:t})},[e.id,t]);let[S,C]=(0,R.useState)(!0);(0,R.useEffect)(()=>{if(!f)return;C(!0);let e=window.setTimeout(()=>C(!1),8e3);return()=>window.clearTimeout(e)},[f,e.id]);let w=e.finished_at?V(e.started_at,e.finished_at):f?V(e.started_at,h):`—`,T=!!e.total_cost_usd_estimated,E=e.total_cost_usd==null?null:`${T?`~`:``}$${e.total_cost_usd.toFixed(4)}`,D=e.num_turns==null?null:String(e.num_turns),O=e.tokens_in==null?null:(e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0),ee=O==null?null:`${(O/1e3).toFixed(1)}k`,k=(0,R.useMemo)(()=>!i||!a?null:a.find(e=>i[e.key]===`running`)?.label??null,[i,a]),A=f&&y.steps===0?`connecting`:y.actionKey||`thinking`,j=U.has(A)&&y.actionArg!==``,N=U.has(A)&&!j?`working`:A,P=j?o(`statusPanel.activity.${N}`,{arg:y.actionArg}):o(`statusPanel.activity.${N}`),F=k??(f&&y.steps===0?o(`statusPanel.activity.starting`):null),I=y.steps>0?o(`statusPanel.steps`,{count:y.steps}):null,te=o(f?`statusPanel.inProgress`:p?`statusPanel.completed`:`statusPanel.failed`),L=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`,ne=f?m:p?_:M,B=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,z.jsxs)(`div`,{className:c(`mx-4 my-2 rounded-xl border transition-colors duration-500`,L),children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>u(!s),className:`w-full flex items-center gap-3 px-4 py-3`,children:[(0,z.jsx)(ne,{className:B,"aria-hidden":`true`}),(0,z.jsx)(`span`,{className:`text-sm font-semibold flex-1 text-left`,children:te}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-muted-foreground`,children:[(0,z.jsx)(`span`,{className:`tabular-nums`,children:w}),f?I&&(0,z.jsx)(`span`,{className:`tabular-nums`,children:I}):(0,z.jsxs)(z.Fragment,{children:[E&&(0,z.jsx)(`span`,{className:`tabular-nums text-yellow-400 aurora-light:text-accent-warning`,children:E}),d.length>0&&(0,z.jsx)(`span`,{children:o(`statusPanel.filesCount`,{count:d.length})})]})]}),(0,z.jsx)(v,{className:c(`w-4 h-4 text-muted-foreground/40 transition-transform duration-150 shrink-0`,s&&`rotate-180`)})]}),s&&(0,z.jsx)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/20`,children:f?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:o(`statusPanel.zoneInProgress`)}),(0,z.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3 sm:items-stretch`,children:[(0,z.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 sm:w-44 shrink-0`,children:[(0,z.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[o(`statusPanel.duration`),(0,z.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full bg-accent-info animate-pulse`,title:o(`statusPanel.liveTooltip`),"aria-label":o(`statusPanel.liveTooltip`)})]}),(0,z.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-accent-info`,children:w})]}),(0,z.jsxs)(`div`,{className:`flex-1 flex items-center gap-2 bg-muted/10 rounded-lg px-3 py-2 min-w-0`,children:[(0,z.jsx)(m,{className:`w-3.5 h-3.5 text-accent-info shrink-0 animate-spin`,"aria-hidden":`true`}),F&&(0,z.jsx)(`span`,{className:`text-[11px] font-medium px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info shrink-0`,children:F}),(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground truncate flex-1 min-w-0`,children:P}),I&&(0,z.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/60 tabular-nums shrink-0`,children:[`· `,I]})]})]}),S&&(0,z.jsx)(`p`,{className:`text-[11px] text-muted-foreground/40 leading-snug`,children:o(`statusPanel.explainer`)}),(0,z.jsx)(`p`,{className:`pt-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider border-t border-accent-info/10 mt-1`,children:o(`statusPanel.zoneFinalPending`)}),(0,z.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,z.jsx)($,{label:o(`statusPanel.cost`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.costTooltip`)}),(0,z.jsx)($,{label:o(`statusPanel.turns`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.pendingTooltip`)}),(0,z.jsx)($,{label:o(`statusPanel.tokens`),caption:o(`statusPanel.pendingCaption`),tooltip:o(`statusPanel.pendingTooltip`)})]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`pt-3 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:o(`statusPanel.zoneFinal`)}),(0,z.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:[(0,z.jsx)(Z,{label:o(`statusPanel.duration`),value:w}),(0,z.jsx)(Q,{label:o(`statusPanel.cost`),value:E,valueClass:`text-yellow-400 aurora-light:text-accent-warning`,naCaption:o(`statusPanel.notAvailable`)}),(0,z.jsx)(Q,{label:o(`statusPanel.turns`),value:D,naCaption:o(`statusPanel.notAvailable`)}),(0,z.jsx)(Q,{label:o(`statusPanel.tokens`),value:ee,naCaption:o(`statusPanel.notAvailable`)})]}),r&&(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.pipelineTotal`,{count:r.jobCount})}),(0,z.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,z.jsx)(Z,{label:o(`statusPanel.totalCost`),value:`$${r.totalCostUsd.toFixed(4)}`,valueClass:`text-yellow-400 aurora-light:text-accent-warning`}),(0,z.jsx)(Z,{label:o(`statusPanel.totalTokens`),value:`${((r.totalTokensIn+r.totalTokensOut+r.totalTokensCacheRead+r.totalTokensCacheCreate)/1e3).toFixed(1)}k`})]})]}),d.length>0&&(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.filesModified`)}),(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d.map(e=>(0,z.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 Z({label:e,value:t,valueClass:n}){return(0,z.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,z.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,z.jsx)(`p`,{className:c(`text-sm font-semibold tabular-nums mt-0.5`,n),children:t})]})}function Q({label:e,value:t,valueClass:n,naCaption:r}){return(0,z.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,z.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,z.jsx)(`p`,{className:c(`text-sm font-semibold tabular-nums mt-0.5`,t==null?`text-muted-foreground`:n),children:t??`—`}),t==null&&(0,z.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:r})]})}function $({label:e,caption:t,tooltip:n}){return(0,z.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2 ring-1 ring-accent-info/10`,title:n,children:[(0,z.jsxs)(`p`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:[e,(0,z.jsx)(te,{className:`w-2.5 h-2.5 text-muted-foreground/30`,"aria-hidden":`true`})]}),(0,z.jsx)(`p`,{className:`text-sm font-semibold tabular-nums mt-0.5 text-muted-foreground/40`,children:`—`}),(0,z.jsx)(`p`,{className:`text-[10px] text-muted-foreground/30 mt-0.5`,children:t})]})}var ae=4;function oe({tickets:e,onTicketClick:t}){let{t:n}=l(`jobs`),[r,i]=(0,R.useState)(!1);if(e.length===0)return null;let a=e.length>=ae&&!r?e.slice(0,1):e,o=e.length-a.length;return(0,z.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,z.jsx)(se,{ticket:e,onClick:()=>t(e.id)},e.id)),o>0&&(0,z.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:o}),(0,z.jsx)(v,{className:`w-3 h-3`})]}),r&&e.length>=ae&&(0,z.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,z.jsx)(O,{className:`w-3 h-3`})]})]})}function se({ticket:e,onClick:t}){let{t:n}=l(`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,z.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:(0,z.jsx)(`span`,{className:c(i,`text-muted-foreground bg-muted/20 select-none`),title:n(`ticketHeader.deletedTooltip`),children:n(`ticketHeader.deletedTicket`,{id:e.id})})}):(0,z.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,z.jsxs)(`span`,{className:c(i,`text-accent-primary bg-accent-primary/10 group-hover:bg-accent-primary/20 transition-colors`),children:[`#`,e.id]}),(0,z.jsx)(`span`,{className:`text-lg font-semibold text-foreground truncate group-hover:text-accent-primary transition-colors`,children:e.title})]})}function ce(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 le(e,t){let r=`${e.id??t}`,i=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:r,content:t,type:`phase`,timestamp:i}:e.source===`stderr`?{id:r,content:t,type:`stderr`,timestamp:i}:ce(t)?{id:r,content:t,type:`assistant`,timestamp:i}:{id:r,content:t,type:`plain`,timestamp:i}: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),a=[];return t.duration_ms&&a.push(`${(t.duration_ms/1e3).toFixed(1)}s`),t.total_cost_usd&&a.push(`$${t.total_cost_usd.toFixed(4)}`),t.num_turns&&a.push(n.t(`jobs:logViewer.turns`,{count:t.num_turns})),{id:r,content:`▸ ${n.t(`jobs:logViewer.completed`)}${a.length?` — ${a.join(` · `)}`:``}`,type:`result`,timestamp:i}}catch{return null}return null}function ue(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 de(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 fe({events:e,isLoading:t}){let{t:n,i18n:r}=l(`jobs`),[i,a]=(0,R.useState)(``),[o,c]=(0,R.useState)(!0),[u,d]=(0,R.useState)(new Set),p=(0,R.useRef)(null),m=(0,R.useRef)(null),{processedLines:g,groups:_,totalLines:y}=(0,R.useMemo)(()=>{let t=e.map((e,t)=>le(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=ue(n);return{processedLines:r,groups:de(r),totalLines:r.length}},[e,r.language]),b=(0,R.useMemo)(()=>{if(!i)return y;let e=i.toLowerCase();return g.filter(t=>t.content.toLowerCase().includes(e)).length},[i,g,y]),x=(0,R.useCallback)(()=>{let e=m.current;e&&(e.scrollTop=e.scrollHeight)},[]);(0,R.useEffect)(()=>{o&&x()},[e.length,o,x]);function S(){let e=m.current;e&&c(e.scrollHeight-e.scrollTop-e.clientHeight<50)}function C(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return t?(0,z.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`logViewer.loading`)})}):y===0?(0,z.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`logViewer.empty`)})}):(0,z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,z.jsxs)(`div`,{className:`px-4 py-2 border-b border-border flex items-center gap-2`,children:[(0,z.jsxs)(`div`,{className:`relative flex-1 max-w-xs`,children:[(0,z.jsx)(f,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground`}),(0,z.jsx)(w,{placeholder:n(`logViewer.filterPlaceholder`),value:i,onChange:e=>a(e.target.value),className:`pl-7 h-7`})]}),(0,z.jsx)(s,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground/50 hover:text-foreground`,onClick:()=>{let e=g.map(e=>e.content).join(`
|
|
3
|
-
`);navigator.clipboard.writeText(e).then(()=>{h.success(n(`logViewer.copySuccess`))}).catch(()=>{h.error(n(`logViewer.copyFailed`))})},children:(0,z.jsx)(k,{className:`w-3.5 h-3.5`})}),(0,z.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:n(`logViewer.lineCount`,{filtered:b,total:y})})]}),(0,z.jsxs)(`div`,{ref:m,className:`flex-1 overflow-y-auto p-2 text-xs relative`,onScroll:S,children:[_.map(e=>(0,z.jsx)(pe,{group:e,filter:i,collapsed:u.has(e.key),onToggle:()=>C(e.key)},e.key)),(0,z.jsx)(`div`,{ref:p})]}),!o&&(0,z.jsxs)(s,{size:`sm`,variant:`secondary`,onClick:()=>{c(!0),x()},className:`absolute bottom-16 right-6 h-7 gap-1 shadow-lg`,children:[(0,z.jsx)(v,{className:`w-3 h-3`}),n(`logViewer.jumpToBottom`)]})]})}var pe=(0,R.memo)(function({group:e,filter:t,collapsed:n,onToggle:r}){let{t:i}=l(`jobs`),a=t?e.lines.filter(e=>e.content.toLowerCase().includes(t.toLowerCase())):e.lines;if(e.header===null)return a.length===0?null:(0,z.jsx)(`div`,{children:a.map((e,t)=>(0,z.jsx)(he,{line:e,even:t%2==0},e.id))});let o=e.header.content;return(0,z.jsxs)(`div`,{className:`mt-3 rounded-md overflow-hidden border border-border/20`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:r,className:c(`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,z.jsx)(S,{className:c(`w-3 h-3 text-primary/60 shrink-0 transition-transform duration-150`,!n&&`rotate-90`)}),(0,z.jsx)(`span`,{className:`flex-1 text-[12px] font-semibold text-foreground leading-none`,children:o}),e.header.timestamp&&(0,z.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,z.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0`,children:i(`logViewer.phaseLines`,{count:e.lines.length})})]}),!n&&(0,z.jsx)(`div`,{className:`bg-muted/5`,children:a.length===0?(0,z.jsx)(`p`,{className:`px-4 py-2 text-[10px] text-muted-foreground/40 italic`,children:i(t?`logViewer.noMatchingLines`:`logViewer.noOutput`)}):a.map((e,t)=>(0,z.jsx)(he,{line:e,even:t%2==0},e.id))})]})}),me=[F],he=(0,R.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,z.jsxs)(`div`,{className:c(`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,z.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,z.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,z.jsx)(x,{remarkPlugins:[D],rehypePlugins:me,children:e.content})}):(0,z.jsx)(`span`,{className:c(`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})]})}),ge={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 _e(){let{t:e}=l(`jobs`),{id:t}=ee(),{activeProjectId:n,projects:a}=d(),f=a.find(e=>e.id===n)?.provider,m=C(),{openTicketDetail:_}=y(),[v,b]=(0,R.useState)(null),[x,w]=(0,R.useState)([]),[T,D]=(0,R.useState)([]),[O,k]=(0,R.useState)({}),[M,F]=(0,R.useState)([]),[te,B]=(0,R.useState)(!0),[V,H]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!t)return;let e=new AbortController;b(null),w([]),D([]),k({}),B(!0),H(!1);async function n(){try{let n=await fetch(`${u()}/jobs/${t}`,{signal:e.signal});if(n.status===404){H(!0);return}if(!n.ok)throw Error(`Failed to fetch job`);let r=await n.json();b(r.job),w(r.events)}catch(e){if(e.name===`AbortError`)return;H(!0)}finally{e.signal.aborted||B(!1)}}return n(),()=>e.abort()},[t,n]),(0,R.useEffect)(()=>{if(!v?.pipeline_id){F([]);return}let e=v.pipeline_id;fetch(`${u()}/pipelines/${e}`).then(e=>e.ok?e.json():null).then(e=>{e?.jobs&&F(e.jobs)}).catch(()=>{})},[v?.pipeline_id,v?.status]);let U=(0,R.useRef)(n);U.current=n;let W=(0,R.useRef)([]),G=(0,R.useRef)(null),K=(0,R.useCallback)(()=>{G.current=null;let e=W.current;e.length!==0&&(W.current=[],w(t=>{let n=[...t,...e];return n.length>1e4?n.slice(n.length-8e3):n}))},[]),q=(0,R.useCallback)(e=>{let t=W.current;t.push(e),t.length>1e4&&(W.current=t.slice(-8e3)),G.current||=requestAnimationFrame(K)},[K]);(0,R.useEffect)(()=>()=>{G.current&&cancelAnimationFrame(G.current)},[]);let J=(0,R.useCallback)(e=>{let n=e;if(!(U.current&&n.projectId&&n.projectId!==U.current)){if(n.type===`init`){let e=n.phaseDefinitions??[];D(e);let t={};for(let r of e)t[r.key]=n.phases?.[r.key]??`idle`;k(t)}else if(n.type===`event`&&n.jobId===t)q({id:Date.now(),job_id:t??``,seq:n.seq??0,event_type:n.event_type,source:n.source,payload:n.payload,timestamp:n.timestamp});else if(n.type===`log`&&n.processId===t)q({id:Date.now(),job_id:t??``,seq:0,event_type:`log`,source:n.source,payload:JSON.stringify({line:n.line}),timestamp:n.timestamp});else if(n.type===`phase`){let e=n.phase,t=n.state;k(n=>({...n,[e]:t}))}else if(n.type===`queue`){let e=n.jobs?.find(e=>e.id===t);if(e){let n=e.status;b(e=>e&&{...e,status:n}),(n===`completed`||n===`failed`||n===`canceled`)&&fetch(`${u()}/jobs/${t}`).then(e=>e.json()).then(e=>b(e.job)).catch(()=>{})}}}},[t,q]),{registerHandler:Y,unregisterHandler:X}=i();(0,R.useEffect)(()=>(Y(`job-detail-${t}`,J),()=>X(`job-detail-${t}`)),[t,J,Y,X]),(0,R.useEffect)(()=>{if(!t||!v||v.status!==`running`||v.hasTelemetry)return;let e=setInterval(()=>{fetch(`${u()}/jobs/${t}`).then(e=>e.ok?e.json():null).then(e=>{e?.job?.hasTelemetry&&b(e=>e&&{...e,hasTelemetry:!0})}).catch(()=>{})},8e3);return()=>clearInterval(e)},[t,v?.status,v?.hasTelemetry]);async function re(){if(t)try{let n=await fetch(`${u()}/jobs/${t}`,{method:`DELETE`});if(n.ok)(await n.json()).status===`deleted`?(h.success(e(`detail.toast.jobDeleted`)),m(`/jobs`)):h.success(e(`detail.toast.cancelSignalSent`),{description:e(`detail.toast.cancelSignalSentDescription`)});else{let t=await n.json();h.error(e(`detail.toast.failed`),{description:t.error})}}catch{h.error(e(`detail.toast.networkError`))}}async function Z(){if(v)try{let t=await fetch(`${u()}/jobs/${v.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-${v.id}-${i}.zip`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(r)}catch(t){h.error(e(`detail.toast.exportFailed`),{description:t.message})}}async function Q(){if(v)try{let t=await fetch(`${u()}/spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({command:v.command})}),n=await t.json();if(!t.ok)throw Error(n.error??e(`detail.toast.spawnFailed`));h.success(e(`detail.toast.jobRequeued`)),m(`/jobs/${n.jobId}`)}catch(e){h.error(e.message)}}if(te)return(0,z.jsx)(`div`,{className:`max-w-5xl mx-auto px-4 py-6`,children:(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`div`,{className:`h-4 w-48 bg-muted/30 rounded animate-pulse`}),(0,z.jsx)(`div`,{className:`h-20 bg-muted/30 rounded-lg animate-pulse`}),(0,z.jsx)(`div`,{className:`h-64 bg-muted/30 rounded-lg animate-pulse`})]})});if(V||!v)return(0,z.jsxs)(`div`,{className:`max-w-5xl mx-auto px-4 py-6 flex flex-col items-center gap-3 mt-12`,children:[(0,z.jsx)(`p`,{className:`text-lg font-semibold`,children:e(`detail.notFound`)}),(0,z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`detail.notFoundDescription`,{id:t})}),(0,z.jsx)(s,{asChild:!0,variant:`outline`,size:`sm`,children:(0,z.jsxs)(A,{to:`/`,children:[(0,z.jsx)(L,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.backToDashboard`)]})})]});let $=ge[v.status]??ge.queued,ae=v.status===`running`,se=v.status===`completed`||v.status===`failed`,ce=(v.tickets?.length??0)>0,le=M.length>1?{totalCostUsd:M.reduce((e,t)=>e+(t.total_cost_usd??0),0),totalTokensIn:M.reduce((e,t)=>e+(t.tokens_in??0),0),totalTokensOut:M.reduce((e,t)=>e+(t.tokens_out??0),0),totalTokensCacheRead:M.reduce((e,t)=>e+(t.tokens_cache_read??0),0),totalTokensCacheCreate:M.reduce((e,t)=>e+(t.tokens_cache_create??0),0),jobCount:M.length}:null;return(0,z.jsxs)(`div`,{"data-job-detail-surface":!0,className:`flex flex-col h-full max-w-5xl mx-auto w-full`,children:[(0,z.jsxs)(`div`,{className:`px-4 py-4 border-b border-border space-y-3`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,z.jsxs)(A,{to:`/`,className:`hover:text-foreground transition-colors flex items-center gap-1`,children:[(0,z.jsx)(L,{className:`w-3 h-3`}),e(`detail.breadcrumbDashboard`)]}),(0,z.jsx)(S,{className:`w-3 h-3`}),(0,z.jsx)(`span`,{className:`text-foreground font-mono`,children:e(`detail.breadcrumbJob`,{id:t?.slice(0,8)})})]}),ce&&(0,z.jsx)(oe,{tickets:v.tickets??[],onTicketClick:_}),(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,z.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,z.jsxs)(P,{children:[(0,z.jsx)(N,{asChild:!0,children:(0,z.jsx)(`div`,{children:(0,z.jsx)(o,{variant:$.variant,children:e($.labelKey)})})}),(0,z.jsx)(g,{children:e($.tooltipKey)})]}),(0,z.jsx)(`code`,{className:c(`font-mono text-foreground/90 truncate`,ce?`text-xs text-muted-foreground`:`text-sm`),children:I(v.command,f)})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground flex-wrap`,children:[(0,z.jsx)(`span`,{children:v.started_at?e(`detail.startedAgo`,{timeAgo:j(new Date(v.started_at),{addSuffix:!0,locale:r()})}):e(`detail.queuedWaiting`)}),v.model&&(0,z.jsx)(`span`,{className:`text-muted-foreground/40`,children:v.model})]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[v.hasTelemetry&&(0,z.jsxs)(P,{children:[(0,z.jsx)(N,{asChild:!0,children:(0,z.jsxs)(s,{variant:`outline`,size:`sm`,className:`h-7`,onClick:Z,"aria-label":e(`detail.exportDiagnosticAria`),children:[(0,z.jsx)(E,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.exportDiagnostic`)]})}),(0,z.jsx)(g,{children:e(`detail.exportDiagnosticTooltip`)})]}),se&&(0,z.jsxs)(P,{children:[(0,z.jsx)(N,{asChild:!0,children:(0,z.jsxs)(s,{variant:`outline`,size:`sm`,onClick:Q,className:`h-7`,children:[(0,z.jsx)(p,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.reExecute`)]})}),(0,z.jsx)(g,{children:e(`detail.reExecuteTooltip`)})]}),ae&&(0,z.jsxs)(P,{children:[(0,z.jsx)(N,{asChild:!0,children:(0,z.jsx)(s,{variant:`outline`,size:`sm`,onClick:re,className:`h-7 border-destructive/30 text-destructive hover:bg-destructive/10`,children:e(`detail.cancelJob`)})}),(0,z.jsx)(g,{children:e(`detail.cancelJobTooltip`)})]})]})]}),(0,z.jsx)(ne,{phases:O,phaseDefinitions:T})]}),(v.status===`running`||v.status===`completed`||v.status===`failed`)&&(0,z.jsx)(ie,{job:v,events:x,defaultOpen:v.status===`completed`||v.status===`running`,pipelineTotals:le??void 0,phases:O,phaseDefinitions:T}),(0,z.jsx)(`div`,{className:`flex-1 overflow-hidden relative`,children:(0,z.jsx)(fe,{events:x})})]})}export{_e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CilyBKbf.js";import{Ct as t,D as n,E as r,Et as i,I as a,Lt as o,M as s,N as c,O as l,Q as u,Qt as d,R as f,Rt as p,T as m,Tt as ee,Zt as h,b as g,ct as _,dt as v,k as y,m as te,n as b,nn as x,on as S,p as ne,u as C,ut as w,w as T,x as E,y as D}from"./index-DGIXKRHE.js";import{t as O}from"./ExportDropdown-f4dwQjlT.js";import{t as k}from"./useProjectCache-D9juBhsO.js";import{t as re}from"./format-command-2VNoNnMv.js";var ie=t(`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(S(),1),j=o();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}=d(`jobs`),[r,i]=(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(`${p()}/jobs/compare?jobIds=${e.join(`,`)}`,{signal:t.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{i(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)(v,{className:`w-3 h-3 text-emerald-400 aurora-light:text-accent-success`}):(0,j.jsx)(w,{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)(a,{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 L={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`}},oe=[`running`,`completed`,`failed`,`canceled`,`zombie_terminated`,`queued`,`skipped`],R={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 se(e){return e==null||e===0?null:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function ce(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 le(e){return e==null||e===0?null:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function ue(e){try{return C(new Date(e),{addSuffix:!0,locale:i()})}catch{return e}}var z=10;function B({jobs:e,isLoading:t,onJobsCleared:i,onProposalClick:a,onProposalDelete:o}){let{t:v}=d(`jobs`),te=x(),{activeProjectId:b,projects:S}=ee(),ne=S.find(e=>e.id===b)?.provider,[C,w]=(0,A.useState)(null),[O,k]=(0,A.useState)(``),[M,N]=(0,A.useState)(``),[P,F]=(0,A.useState)(!1),[I,B]=(0,A.useState)(``),[V,H]=(0,A.useState)(``),[U,W]=(0,A.useState)(!1),[G,K]=(0,A.useState)(null),[q,J]=(0,A.useState)(z),[Y,de]=(0,A.useState)(!1),[X,Z]=(0,A.useState)([]),[fe,Q]=(0,A.useState)(null);(0,A.useEffect)(()=>{J(z)},[e.length]);function pe(){de(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=>!(C&&e.status!==C||O&&e.started_at<O||M&&e.started_at>`${M}T23:59:59`)),he=e.filter(e=>!(I&&e.started_at<I||V&&e.started_at>`${V}T23:59:59`)).length;async function ge(e){W(!0);try{let t={};e===`range`&&(I&&(t.from=I),V&&(t.to=V));let n=await fetch(`${p()}/jobs`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(n.ok){let e=await n.json();h.success(v(`recent.toast.cleared`,{count:e.deleted})),F(!1),B(``),H(``),i?.()}else h.error(v(`recent.toast.clearFailed`))}catch{h.error(v(`recent.toast.networkError`))}finally{W(!1)}}return t?(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)(_,{className:`w-8 h-8 text-muted-foreground/30 mx-auto`}),(0,j.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:v(`recent.emptyTitle`)}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:v(`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:()=>w(null),className:`px-2 py-0.5 rounded text-[10px] font-medium transition-colors ${C===null?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:v(`recent.filterAll`,{count:e.length})}),oe.map(t=>{let n=e.filter(e=>e.status===t).length;return n===0?null:(0,j.jsx)(`button`,{type:`button`,onClick:()=>w(C===t?null:t),className:`px-2 py-0.5 rounded text-[10px] font-medium capitalize transition-colors ${C===t?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:v(`recent.filterStatus`,{status:v(`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:v(`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:v(`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:v(`recent.clear`)}),(0,j.jsxs)(D,{children:[(0,j.jsx)(E,{asChild:!0,children:(0,j.jsx)(c,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 transition-colors ${Y?`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)(g,{children:v(Y?`recent.exitCompareMode`:`recent.compareTwoJobs`)})]}),(0,j.jsxs)(D,{children:[(0,j.jsx)(E,{asChild:!0,children:(0,j.jsx)(c,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 text-muted-foreground hover:text-destructive`,onClick:()=>F(!0),children:(0,j.jsx)(f,{className:`w-3.5 h-3.5`})})}),(0,j.jsx)(g,{children:v(`recent.clearJobs`)})]})]})]}),Y&&(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&&v(`recent.selectTwoToCompare`),X.length===1&&v(`recent.selectOneMore`),X.length===2&&v(`recent.readyToCompare`)]}),X.length===2&&(0,j.jsx)(`button`,{type:`button`,className:`text-[10px] font-medium text-foreground hover:underline`,onClick:()=>Q(X),children:v(`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:v(`recent.colStatus`)}),(0,j.jsx)(`span`,{className:`flex-1 min-w-0`,children:v(`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:v(`recent.colDuration`)}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:v(`recent.colTokens`)}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:v(`recent.colCost`)}),(0,j.jsx)(`span`,{className:`w-20 text-right`,children:v(`recent.colStarted`)})]})]}),(0,j.jsx)(`div`,{className:`space-y-0.5`,children:$.slice(0,q).map(e=>{let t=L[e.status]??L.queued,n=se(e.total_cost_usd),r=ce(e.started_at,e.finished_at),i=le((e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0)||null),o=e.id.startsWith(`proposal:`),c=o?e.id.replace(`proposal:`,``):null,l=X.includes(e.id),d=Y&&!o&&X.length===2&&!l;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 ${l?`bg-accent/70 ring-1 ring-border`:d?`opacity-40 cursor-not-allowed`:`hover:bg-accent/50`}`,onClick:()=>{if(Y&&!o){me(e.id);return}o&&c?a?.(c):te(`/jobs/${e.id}`)},children:[(0,j.jsxs)(D,{children:[(0,j.jsx)(E,{asChild:!0,children:(0,j.jsx)(`div`,{children:(0,j.jsx)(s,{variant:t.variant,children:v(t.labelKey)})})}),(0,j.jsx)(g,{children:v(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 ${R[e.priority].className}`,children:v(R[e.priority].labelKey)}),e.profile_name&&(0,j.jsxs)(D,{children:[(0,j.jsx)(E,{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)(g,{children:v(`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)(D,{children:[(0,j.jsx)(E,{asChild:!0,children:(0,j.jsx)(u,{className:`w-3 h-3 text-accent-primary/60 shrink-0`})}),(0,j.jsxs)(g,{children:[v(`recent.pipelinePart`),e.depends_on_job_id&&` ${v(`recent.pipelineDependsOn`)}`,e.skip_reason&&` — ${e.skip_reason}`]})]}),(0,j.jsx)(`code`,{className:`text-xs text-foreground/80 truncate`,children:re(e.command,ne)})]}),(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:r??`—`}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:i?`${i}`:`—`}),(0,j.jsx)(`span`,{className:`w-12 text-right`,children:n??`—`}),(0,j.jsx)(`span`,{className:`w-20 text-right`,children:ue(e.started_at)}),o&&c&&(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(),K(c)},title:v(`recent.deleteProposal`),children:(0,j.jsx)(f,{className:`w-3 h-3`})})]})]},e.id)})}),$.length>q&&(0,j.jsx)(`div`,{className:`pt-1 text-center`,children:(0,j.jsx)(`button`,{type:`button`,onClick:()=>J(e=>e+z),className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors px-3 py-1 rounded hover:bg-accent/50`,children:v(`recent.loadMore`,{count:$.length-q})})}),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:v(`recent.clearModal.title`)}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:v(`recent.clearModal.jobsInHistory`,{count:e.length})})]}),(0,j.jsx)(c,{variant:`destructive`,size:`sm`,className:`w-full`,disabled:U,onClick:()=>ge(`all`),children:v(`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:v(`recent.clearModal.orByRange`)}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`input`,{type:`date`,value:I,onChange:e=>B(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:v(`recent.clearModal.fromPlaceholder`)}),(0,j.jsx)(`input`,{type:`date`,value:V,onChange:e=>H(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:v(`recent.clearModal.toPlaceholder`)})]}),(0,j.jsx)(c,{variant:`outline`,size:`sm`,className:`w-full`,disabled:U||!I&&!V,onClick:()=>ge(`range`),children:I||V?v(`recent.clearModal.clearInRange`,{count:he}):v(`recent.clearModal.clearRange`)})]}),(0,j.jsx)(c,{variant:`ghost`,size:`sm`,className:`w-full`,onClick:()=>F(!1),children:v(`common:actions.cancel`)})]})}),(0,j.jsx)(T,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,j.jsxs)(m,{className:`max-w-sm`,children:[(0,j.jsxs)(l,{children:[(0,j.jsx)(y,{children:v(`recent.deleteProposalConfirm.title`)}),(0,j.jsx)(r,{children:v(`recent.deleteProposalConfirm.description`)})]}),(0,j.jsxs)(n,{children:[(0,j.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>K(null),children:v(`common:actions.cancel`)}),(0,j.jsx)(c,{variant:`destructive`,size:`sm`,onClick:()=>{G&&o?.(G),K(null)},children:v(`common:actions.delete`)})]})]})}),fe&&(0,j.jsx)(ae,{jobIds:fe,onClose:()=>{Q(null),Z([]),de(!1)}})]})}function V(){let{t:e}=d(`jobs`),{activeProjectId:t}=ee(),{recentJobs:r}=b(t),{data:i,isFirstLoad:a,refresh:o}=k({namespace:`jobs`,projectId:t,initialValue:r,fetcher:async()=>{let e=await fetch(`${p()}/jobs?limit=10`);return e.ok?(await e.json()).jobs:[]},pollInterval:1e4}),{data:u}=k({namespace:`proposals`,projectId:t,initialValue:[],fetcher:async()=>{let e=await fetch(`${p()}/propose?limit=10`);return e.ok?(await e.json()).proposals:[]},pollInterval:1e4}),f={input:`queued`,exploring:`running`,review:`running`,refining:`running`,creating_issue:`running`,created:`completed`,cancelled:`canceled`},g=u.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:f[e.status]??`queued`})),_=[...i,...g].sort((e,t)=>new Date(t.started_at).getTime()-new Date(e.started_at).getTime()),[v,x]=(0,A.useState)(null),S=(0,A.useCallback)(async e=>{try{let t=await fetch(`${p()}/propose/${e}`);if(!t.ok)return;x((await t.json()).proposal)}catch{}},[]),C=(0,A.useCallback)(async t=>{try{(await fetch(`${p()}/propose/${t}`,{method:`DELETE`})).ok&&(h.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)(O,{baseUrl:`${p()}/jobs/export`,label:e(`page.exportJobs`)})]}),(0,j.jsx)(B,{jobs:_,isLoading:a,onJobsCleared:o,onProposalClick:S,onProposalDelete:C}),(0,j.jsx)(T,{open:v!==null,onOpenChange:e=>!e&&x(null),children:(0,j.jsx)(m,{className:`max-w-3xl glass-card`,children:v&&(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)(y,{className:`flex-1 min-w-0`,children:e(`page.proposal.title`)}),(0,j.jsx)(s,{variant:v.status===`created`?`success`:v.status===`cancelled`?`destructive`:`secondary`,children:v.status})]})}),(0,j.jsx)(`div`,{className:`text-xs text-muted-foreground bg-muted/20 rounded px-2 py-1 italic`,children:v.idea}),v.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)(te,{remarkPlugins:[ne],children:v.result_markdown})})}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground py-4 text-center`,children:e(`page.proposal.noContent`)}),v.issue_url&&(0,j.jsxs)(`div`,{className:`text-xs`,children:[e(`page.proposal.githubIssue`),` `,(0,j.jsx)(`a`,{href:v.issue_url,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent-primary hover:underline`,children:v.issue_url})]}),(0,j.jsxs)(n,{children:[(0,j.jsx)(c,{variant:`destructive`,size:`sm`,onClick:()=>{C(v.id),x(null)},children:e(`common:actions.delete`)}),(0,j.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>x(null),children:e(`common:actions.close`)})]})]})})})]})}export{V as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={railAdded:`Rail {{n}} ajouté`,railRemoved:`{{rail}} supprimé`,railCompleted:`Rail {{n}} terminé`,railFailed:`Rail {{n}} en échec — specs renvoyées vers Specs`,railEnded:`Rail {{n}} {{status}} — specs renvoyées vers Specs`,alreadyOnRail:`Déjà sur {{rail}}`,movedToRail:`Déplacé vers {{rail}}`,railRunningStopFirst:`{{rail}} est en cours d'exécution — arrêtez-le avant de le supprimer`,removedFromRail:`Retiré de {{rail}}`,queuedOnRail:`Mis en file sur {{rail}}`,queuedOnRailDescription:`Le rail est en cours d'exécution`,railStopped:`{{rail}} arrêté`,stopFailed:`Échec de l'arrêt du rail`,syncTicketsFailed:`Échec de la synchronisation des tickets du rail`,launchFailed:`Échec du lancement du rail`,launchNetworkError:`Erreur réseau au lancement du rail`,railLaunched:`{{rail}} lancé`,launchDescription_one:`{{mode}} avec {{count}} spec`,launchDescription_other:`{{mode}} avec {{count}} specs`},t={title:`Rails`,runningCount_one:`{{count}} en cours`,runningCount_other:`{{count}} en cours`},n={viewJobLog:`Voir le log du job`,log:`Log`,implement:`Implémenter`,batch:`Batch`,ultra:`Ultra`,ultraTitle:`Ultracode — Claude implémente la spec en autonomie, sans pipeline`,stop:`Arrêter`,play:`Lancer`,failedRetry:`Job en échec — cliquez pour réessayer`,addSpecsFirst:`Ajoutez d'abord des specs à ce rail`},r={moveToSpecs:`Déplacer vers Specs`,deleteRail:`Supprimer {{label}}`,dropHere:`Déposer ici`,dropOnThisRail:`Déposer sur ce rail`,dragSpecsHere:`Glissez des specs ici`},i={title:`Lancer en mode Ultracode`,context_one:`{{rail}} · {{count}} spec`,context_other:`{{rail}} · {{count}} specs`,noPipelineTitle:`Pas de pipeline OpenSpec.`,noPipelineBody:`Le flux structuré architecte → développeur → reviewer est entièrement ignoré.`,autonomyTitle:`Autonomie native de Claude.`,autonomyBody:`Claude travaille seul avec ses agents natifs et des workflows dynamiques.`,costTitle:`Coût variable.`,costBody:`La dépense dépend de ce que Claude décide de faire — elle peut être plus élevée que prévu.`,continue:`Continuer`},a={fetchFailed:`Échec de la récupération des 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}} adicionado`,railRemoved:`{{rail}} removido`,railCompleted:`Rail {{n}} concluído`,railFailed:`Rail {{n}} falhou — specs devolvidas a Specs`,railEnded:`Rail {{n}} {{status}} — specs devolvidas a Specs`,alreadyOnRail:`Já está em {{rail}}`,movedToRail:`Movido para {{rail}}`,railRunningStopFirst:`{{rail}} está em execução — pare-o antes de remover`,removedFromRail:`Removido de {{rail}}`,queuedOnRail:`Em fila em {{rail}}`,queuedOnRailDescription:`O rail está atualmente em execução`,railStopped:`{{rail}} parado`,stopFailed:`Falha ao parar o rail`,syncTicketsFailed:`Falha ao sincronizar os tickets do rail`,launchFailed:`Falha ao lançar o rail`,launchNetworkError:`Erro de rede ao lançar o rail`,railLaunched:`{{rail}} lançado`,launchDescription_one:`{{mode}} com {{count}} spec`,launchDescription_other:`{{mode}} com {{count}} specs`},t={title:`Rails`,runningCount_one:`{{count}} em execução`,runningCount_other:`{{count}} em execução`},n={viewJobLog:`Ver log do job`,log:`Log`,implement:`Implementar`,batch:`Batch`,ultra:`Ultra`,ultraTitle:`Ultracode — o Claude implementa a spec de forma autónoma, sem pipeline`,stop:`Parar`,play:`Iniciar`,failedRetry:`O job falhou — clique para repetir`,addSpecsFirst:`Adicione primeiro specs a este rail`},r={moveToSpecs:`Mover para Specs`,deleteRail:`Eliminar {{label}}`,dropHere:`Largar aqui`,dropOnThisRail:`Largar neste rail`,dragSpecsHere:`Arraste specs para aqui`},i={title:`Lançar em modo Ultracode`,context_one:`{{rail}} · {{count}} spec`,context_other:`{{rail}} · {{count}} specs`,noPipelineTitle:`Sem pipeline OpenSpec.`,noPipelineBody:`O fluxo estruturado architect → developer → reviewer é totalmente ignorado.`,autonomyTitle:`Autonomia nativa do Claude.`,autonomyBody:`O Claude trabalha por conta própria com agentes nativos e workflows dinâmicos.`,costTitle:`Custo variável.`,costBody:`O gasto depende do que o Claude decidir fazer — pode ser superior ao esperado.`,continue:`Continuar`},a={fetchFailed:`Falha ao obter os 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:`レール {{n}} を追加しました`,railRemoved:`{{rail}} を削除しました`,railCompleted:`レール {{n}} が完了しました`,railFailed:`レール {{n}} が失敗しました — スペックは Specs に戻されました`,railEnded:`レール {{n}}: {{status}} — スペックは Specs に戻されました`,alreadyOnRail:`すでに {{rail}} にあります`,movedToRail:`{{rail}} に移動しました`,railRunningStopFirst:`{{rail}} は実行中です — 削除する前に停止してください`,removedFromRail:`{{rail}} から削除しました`,queuedOnRail:`{{rail}} のキューに追加しました`,queuedOnRailDescription:`レールは現在実行中です`,railStopped:`{{rail}} を停止しました`,stopFailed:`レールの停止に失敗しました`,syncTicketsFailed:`レールのチケット同期に失敗しました`,launchFailed:`レールの起動に失敗しました`,launchNetworkError:`レール起動中にネットワークエラーが発生しました`,railLaunched:`{{rail}} を起動しました`,launchDescription_one:`{{mode}} · スペック {{count}} 件`,launchDescription_other:`{{mode}} · スペック {{count}} 件`},t={title:`レール`,runningCount_one:`{{count}} 件実行中`,runningCount_other:`{{count}} 件実行中`},n={viewJobLog:`ジョブログを表示`,log:`ログ`,implement:`実装`,batch:`バッチ`,ultra:`Ultra`,ultraTitle:`Ultracode — Claude がパイプラインなしでスペックを自律的に実装します`,stop:`停止`,play:`実行`,failedRetry:`ジョブが失敗しました — クリックして再試行`,addSpecsFirst:`先にこのレールにスペックを追加してください`},r={moveToSpecs:`Specs に移動`,deleteRail:`{{label}} を削除`,dropHere:`ここにドロップ`,dropOnThisRail:`このレールにドロップ`,dragSpecsHere:`ここにスペックをドラッグ`},i={title:`Ultracode モードで起動`,context_one:`{{rail}} · スペック {{count}} 件`,context_other:`{{rail}} · スペック {{count}} 件`,noPipelineTitle:`OpenSpec パイプラインなし。`,noPipelineBody:`アーキテクト → 開発者 → レビュアーの構造化フローは完全にスキップされます。`,autonomyTitle:`Claude ネイティブの自律性。`,autonomyBody:`Claude はネイティブエージェントと動的ワークフローを使って自律的に作業します。`,costTitle:`コストは変動します。`,costBody:`支出は Claude の判断に依存し、想定より高くなることがあります。`,continue:`続行`},a={fetchFailed:`レールの取得に失敗しました: {{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,不走流水线`,stop:`停止`,play:`运行`,failedRetry:`任务失败 — 点击重试`,addSpecsFirst:`请先向此 Rail 添加 Spec`},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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={railAdded:`Rail {{n}} aggiunto`,railRemoved:`{{rail}} rimosso`,railCompleted:`Rail {{n}} completato`,railFailed:`Rail {{n}} non riuscito — le spec sono tornate in Specs`,railEnded:`Rail {{n}} {{status}} — le spec sono tornate in Specs`,alreadyOnRail:`Già su {{rail}}`,movedToRail:`Spostata su {{rail}}`,railRunningStopFirst:`{{rail}} è in esecuzione — fermalo prima di rimuoverlo`,removedFromRail:`Rimossa da {{rail}}`,queuedOnRail:`In coda su {{rail}}`,queuedOnRailDescription:`Il rail è attualmente in esecuzione`,railStopped:`{{rail}} fermato`,stopFailed:`Impossibile fermare il rail`,syncTicketsFailed:`Impossibile sincronizzare i ticket del rail`,launchFailed:`Impossibile avviare il rail`,launchNetworkError:`Errore di rete durante l'avvio del rail`,railLaunched:`{{rail}} avviato`,launchDescription_one:`{{mode}} con {{count}} spec`,launchDescription_other:`{{mode}} con {{count}} spec`},t={title:`Rails`,runningCount_one:`{{count}} in esecuzione`,runningCount_other:`{{count}} in esecuzione`},n={viewJobLog:`Visualizza log del job`,log:`Log`,implement:`Implementa`,batch:`Batch`,ultra:`Ultra`,ultraTitle:`Ultracode — Claude implementa la spec in autonomia, senza pipeline`,stop:`Stop`,play:`Avvia`,failedRetry:`Job non riuscito — clicca per riprovare`,addSpecsFirst:`Aggiungi prima delle spec a questo rail`},r={moveToSpecs:`Sposta in Specs`,deleteRail:`Elimina {{label}}`,dropHere:`Rilascia qui`,dropOnThisRail:`Rilascia su questo rail`,dragSpecsHere:`Trascina qui le spec`},i={title:`Avvia in modalità Ultracode`,context_one:`{{rail}} · {{count}} spec`,context_other:`{{rail}} · {{count}} spec`,noPipelineTitle:`Nessuna pipeline OpenSpec.`,noPipelineBody:`Il flusso strutturato architect → developer → reviewer viene saltato del tutto.`,autonomyTitle:`Autonomia nativa di Claude.`,autonomyBody:`Claude lavora in autonomia usando agenti nativi e workflow dinamici.`,costTitle:`Costo variabile.`,costBody:`La spesa dipende da cosa Claude decide di fare — può essere più alta del previsto.`,continue:`Continua`},a={fetchFailed:`Impossibile recuperare i rail: {{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}} 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`,stop:`Detener`,play:`Iniciar`,failedRetry:`El job ha fallado — haz clic para reintentar`,addSpecsFirst:`Añade primero specs a este rail`},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}} 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`,stop:`Stopp`,play:`Start`,failedRetry:`Job fehlgeschlagen – zum Wiederholen klicken`,addSpecsFirst:`Füge zuerst Specs zu diesem Rail hinzu`},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};
|