fix(ui): trim filler prose and expose appearance in settings nav

This commit is contained in:
sam committed 2026-10-05 22:20:16 +11:00
1 parent 977f149d6b
commit e50a381992
31 files changed
+38 -89

No files matched your search

+1 -1
View File
@@ -13,4 +13,4 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),oa&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=ka(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Wi(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-Aa),Aa),t/=Aa,t/Math.abs(t)+Math.round(t*(ja-1)))}shouldForceSelection(e){return na?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),Ma)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(na&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._active Line truncated
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(F(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(A(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<Es+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Es+1&&(this._liveRegion.textContent+=be.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let Line truncated
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return ve.get()},set promptLabel(e){ve.set(e)},get tooMuchOutput(){return be.get()},set tooMuchOutput(e){be.set(e)}}}_verifyIntegers(...e){for(zs of e)if(zs===1/0||isNaN(zs)||zs%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(zs of e)if(zs&&(zs===1/0||isNaN(zs)||zs%1!=0||zs<0))throw Error(`This API only accepts positive integers`)}},Vs=2,Hs=1,Us=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(Vs,Math.floor(u/e.css.cell.width)),rows:Math.max(Hs,Math.floor(l/e.css.cell.height))}}};function Ws(e,t=Date.now()){if(!e.captured)return`unconfigured`;if(!e.expires_at)return`ready`;let n=Date.parse(e.expires_at);return Number.isNaN(n)?`ready`:n<=t?`expired`:n-t<=18e5?`expiring`:`ready`}function Gs(e,t){let n=t.protocol===`https:`?`wss:`:`ws:`,r=new URLSearchParams({profile:e}).toString();return`${n}//${t.host}/api/harness/terminal?${r}`}var Ks={class:`flex h-full min-h-0 flex-col gap-2`},qs={key:0,class:`text-sm text-muted-foreground`,role:`status`},Js=e({__name:`SetupTerminal`,props:{profile:{}},setup(e){let i=e,a=o(null),u=o(`connecting`),d=null,f=null,p=null,m=null;function h(){try{p?.fit()}catch{}}return s(()=>{let e=a.value;if(!e)return;d=new Bs({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),p=new Us,d.loadAddon(p),d.open(e),h(),d.focus();let t=new WebSocket(Gs(i.profile,window.location));f=t,t.binaryType=`arraybuffer`,t.onopen=()=>{u.value=`open`},t.onmessage=e=>{d&&(typeof e.data==`string`?d.write(e.data):d.write(new Uint8Array(e.data)))},t.onerror=()=>{u.value=`failed`},t.onclose=()=>{u.value=`closed`},d.onData(e=>{t.readyState===WebSocket.OPEN&&t.send(e)}),m=new ResizeObserver(h),m.observe(e)}),v(()=>{m?.disconnect(),m=null,f?.close(),f=null,d?.dispose(),d=null,p=null}),(e,i)=>(c(),n(`div`,Ks,[u.value===`open`?r(``,!0):(c(),n(`p`,qs,[u.value===`connecting`?(c(),n(t,{key:0},[l(`Connecting…`)],64)):u.value===`closed`?(c(),n(t,{key:1},[l(`The terminal session ended.`)],64)):(c(),n(t,{key:2},[l(`Could not open the setup terminal.`)],64))])),fe(`div`,{ref_key:`host`,ref:a,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Ys={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},Xs={key:1,class:`space-y-2`},Zs={class:`flex flex-col gap-1 text-sm`},Qs=[`disabled`],$s={key:0,value:``},ec=[`value`],tc=e({__name:`HarnessPage`,setup(e){let v=o(null),C=o(!0),ge=o(null),w=o(!1),T=o(``),E=o(!1),_e={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};s(ve);async function ve(){C.value=!0,ge.value=null,w.value=!1;try{let e=await pe.harnessBindings();v.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},T.value=v.value.profiles[0]??``}catch(e){let t=e instanceof g?e.status:void 0;t===501||t===503?w.value=!0:ge.value=e instanceof Error?e.message:String(e),v.value=null}finally{C.value=!1}}function ye(){v.value?.terminal&&T.value&&(E.value=!0)}function be(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function xe(e){return e.scopes?.length?e.scopes.join(`, `):`—`}return(e,o)=>(c(),n(`div`,null,[y(de,{title:`Harness`}),ge.value?(c(),n(`p`,Ys,he(ge.value),1)):r(``,!0),C.value?(c(),n(`div`,Xs,[y(d(ue),{class:`h-24 w-full`}),y(d(ue),{class:`h-40 w-full`})])):w.value?(c(),p(d(m),{key:2},{default:i(()=>[y(d(re),null,{default:i(()=>[y(d(oe),null,{default:i(()=>[...o[1]||=[l(`Harness bindings are not configured`,-1)]]) Line truncated
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return ve.get()},set promptLabel(e){ve.set(e)},get tooMuchOutput(){return be.get()},set tooMuchOutput(e){be.set(e)}}}_verifyIntegers(...e){for(zs of e)if(zs===1/0||isNaN(zs)||zs%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(zs of e)if(zs&&(zs===1/0||isNaN(zs)||zs%1!=0||zs<0))throw Error(`This API only accepts positive integers`)}},Vs=2,Hs=1,Us=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(Vs,Math.floor(u/e.css.cell.width)),rows:Math.max(Hs,Math.floor(l/e.css.cell.height))}}};function Ws(e,t=Date.now()){if(!e.captured)return`unconfigured`;if(!e.expires_at)return`ready`;let n=Date.parse(e.expires_at);return Number.isNaN(n)?`ready`:n<=t?`expired`:n-t<=18e5?`expiring`:`ready`}function Gs(e,t){let n=t.protocol===`https:`?`wss:`:`ws:`,r=new URLSearchParams({profile:e}).toString();return`${n}//${t.host}/api/harness/terminal?${r}`}var Ks={class:`flex h-full min-h-0 flex-col gap-2`},qs={key:0,class:`text-sm text-muted-foreground`,role:`status`},Js=e({__name:`SetupTerminal`,props:{profile:{}},setup(e){let i=e,a=o(null),u=o(`connecting`),d=null,f=null,p=null,m=null;function h(){try{p?.fit()}catch{}}return s(()=>{let e=a.value;if(!e)return;d=new Bs({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),p=new Us,d.loadAddon(p),d.open(e),h(),d.focus();let t=new WebSocket(Gs(i.profile,window.location));f=t,t.binaryType=`arraybuffer`,t.onopen=()=>{u.value=`open`},t.onmessage=e=>{d&&(typeof e.data==`string`?d.write(e.data):d.write(new Uint8Array(e.data)))},t.onerror=()=>{u.value=`failed`},t.onclose=()=>{u.value=`closed`},d.onData(e=>{t.readyState===WebSocket.OPEN&&t.send(e)}),m=new ResizeObserver(h),m.observe(e)}),v(()=>{m?.disconnect(),m=null,f?.close(),f=null,d?.dispose(),d=null,p=null}),(e,i)=>(c(),n(`div`,Ks,[u.value===`open`?r(``,!0):(c(),n(`p`,qs,[u.value===`connecting`?(c(),n(t,{key:0},[l(`Connecting…`)],64)):u.value===`closed`?(c(),n(t,{key:1},[l(`The terminal session ended.`)],64)):(c(),n(t,{key:2},[l(`Could not open the setup terminal.`)],64))])),fe(`div`,{ref_key:`host`,ref:a,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Ys={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},Xs={key:1,class:`space-y-2`},Zs={class:`flex flex-col gap-1 text-sm`},Qs=[`disabled`],$s={key:0,value:``},ec=[`value`],tc=e({__name:`HarnessPage`,setup(e){let v=o(null),C=o(!0),ge=o(null),w=o(!1),T=o(``),E=o(!1),_e={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};s(ve);async function ve(){C.value=!0,ge.value=null,w.value=!1;try{let e=await pe.harnessBindings();v.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},T.value=v.value.profiles[0]??``}catch(e){let t=e instanceof g?e.status:void 0;t===501||t===503?w.value=!0:ge.value=e instanceof Error?e.message:String(e),v.value=null}finally{C.value=!1}}function ye(){v.value?.terminal&&T.value&&(E.value=!0)}function be(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function xe(e){return e.scopes?.length?e.scopes.join(`, `):`—`}return(e,o)=>(c(),n(`div`,null,[y(de,{title:`Harness`}),ge.value?(c(),n(`p`,Ys,he(ge.value),1)):r(``,!0),C.value?(c(),n(`div`,Xs,[y(d(ue),{class:`h-24 w-full`}),y(d(ue),{class:`h-40 w-full`})])):w.value?(c(),p(d(m),{key:2},{default:i(()=>[y(d(re),null,{default:i(()=>[y(d(oe),null,{default:i(()=>[...o[1]||=[l(`Harness bindings are not configured`,-1)]]) Line truncated
+5 -5
View File
@@ -16,9 +16,9 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
Defaulting to \`null\`.`),null)}function _S(e){return hS(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${fS}\`.`),fS)}var vS=I({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:fS},getValueLabel:{type:Function,required:!1,default:(e,t)=>hS(e)?`${Math.round(e/t*fS)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Z();let i=gh(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=gh(n,`max`,r,{passive:n.max===void 0});F(()=>i.value,async e=>{let t=gS(e,n.max);t!==e&&(await qn(),i.value=t)},{immediate:!0}),F(()=>n.max,e=>{let t=_S(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=J(()=>Rm(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return mS({modelValue:i,max:a,progressState:o}),(e,t)=>(B(),H(N(xg),{"as-child":e.asChild,as:e.as,"aria-valuemax":N(a),"aria-valuemin":0,"aria-valuenow":hS(N(i))?N(i):void 0,"aria-valuetext":e.getValueText?.(N(i),N(a)),"aria-label":e.getValueLabel(N(i),N(a)),role:`progressbar`,"data-state":o.value,"data-value":N(i)??void 0,"data-max":N(a)},{default:P(()=>[R(e.$slots,`default`,{modelValue:N(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),yS=I({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=pS();return Z(),(e,r)=>(B(),H(N(xg),q(t,{"data-state":N(n).progressState.value,"data-value":N(n).modelValue?.value??void 0,"data-max":N(n).max.value}),{default:P(()=>[R(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),bS=`radio.select`;function xS(e,t,n){Lm(bS,n,{originalEvent:e,value:t})}var SS=I({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=gh(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=vn(n),{forwardRef:o,currentElement:s}=Z(),c=Bh(s),l=Uh(),u=J(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||xS(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(B(),V(z,null,[W(N(xg),q({id:e.id,ref:N(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":N(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":N(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:N(a),required:e.required,name:e.name},{...N(l),...e.$attrs},{onClick:zl(d,[`stop`])}),{default:P(()=>[R(e.$slots,`default`,{checked:N(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),N(c)&&e.name?(B(),H(N(X_),q({key:0,type:`radio`,tabindex:`-1`,value:N(a),checked:!!N(i),name:e.name,disabled:e.disabled,required:e.required},N(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):K(`v-if`,!0)],64))}}),[CS,wS]=Fm(`RadioGroupRoot`),TS=I({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Z(),o=gh(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=vn(n),p=Fh(f),m=Bh(a);return wS({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(B(),H(N(Mb),{"as-child":``,orientation:N(l),dir:N(p),loop:N(c)},{default:P(()=>[W(N(xg),{ref:N(i),role:`radiogroup`,"data-disabled":N(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":N(l),"aria-required":N(d),dir:N(p)},{default:P(()=>[R(e.$slots,`default`,{modelValue:N(o)}),N(m)&&N(u)?(B(),H(N(X_),{key:0,required:N(d),disabled:N(s),value:N(o),name:N(u)},null,8,[`required`,`disabled`,`value`,`name`])):K(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[Gee,ES]=Fm(`RadioGroupItem`),DS=I({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:nuLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:ZT(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>ZT(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=QT(c),u=e+1<n.length?QT(n[e+1]):null;if(l&&u&&vte(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=QT(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>ZT(e)),rows:r.map(e=>e.map(e=>ZT(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:ZT(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:ZT(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function QT(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function vte(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var yte={class:`[overflow-wrap:anywhere]`},bte={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},xte={class:`font-mono text-[0.85em]`},Ste={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Cte={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},wte={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Tte={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Ete={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Dte={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Ote={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},kte={key:8,class:`mb-2.5 last:mb-0`},Ate=I({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=J(()=>_te(t.text));return(e,t)=>(B(),V(`div`,yte,[(B(!0),V(z,null,L(n.value,(e,t)=>(B(),V(z,{key:t},[e.kind===`pre`?(B(),V(`pre`,bte,[U(`code`,xte,j(e.code),1)])):e.kind===`table`?(B(),V(`table`,Ste,[U(`thead`,null,[U(`tr`,null,[(B(!0),V(z,null,L(e.head,(e,t)=>(B(),V(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[W(XT,{inline:e},null,8,[`inline`])]))),128))])]),U(`tbody`,null,[(B(!0),V(z,null,L(e.rows,(e,t)=>(B(),V(`tr`,{key:t},[(B(!0),V(z,null,L(e,(e,t)=>(B(),V(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[W(XT,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(B(),V(`blockquote`,Cte,[W(XT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(B(),V(`h1`,wte,[W(XT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(B(),V(`h2`,Tte,[W(XT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(B(),V(`h3`,Ete,[W(XT,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(B(),V(`ul`,Dte,[(B(!0),V(z,null,L(e.items,(e,t)=>(B(),V(`li`,{key:t},[W(XT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(B(),V(`ol`,Ote,[(B(!0),V(z,null,L(e.items,(e,t)=>(B(),V(`li`,{key:t},[W(XT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(B(),V(`p`,kte,[W(XT,{inline:e.inline},null,8,[`inline`])])):K(``,!0)],64))),128))]))}}),jte={class:`truncate`},Mte=I({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=$i(`RouterLink`);return B(),H(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:P(()=>[W(N(Ju),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),U(`span`,jte,j(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Nte={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Pte={class:`font-semibold text-foreground`},Fte={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Ite=I({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=J(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=J(()=>t.tool.parameters||t.tool.Parameters||``),i=J(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=J(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(B(),H(Mte,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(B(),V(`div`,Nte,[W(N(Yd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),U(`span`,Pte,j(n.value),1),r.value?(B(),V(`code`,Fte,j(r.value),1)):K(``,!0),U(`span`,{class:A(N(Y)(`text-fg-muted`,i.value&&`text-danger`))},j(a.value),3)]))}}),Lte={key:0,class:`mb-2 grid gap-0.5 text-xs`},Rte={key:1,class:`mb-2 flex flex-wrap gap-1.5`},zte={key:3,class:`whitespace-pre-wrap`},$T=I({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(B(),V(`div`,{class:A([`flex`,e.assistant?`justify-start`:`justify-end`])},[U(`div`,{class:A(N(Y)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(B(),V(`div`,Lte,[(B(!0),V(z,null,L(e.tools,(t,n)=>(B(),H(Ite,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):K(``,!0),e.media.length?(B(),V(`div`,Rte,[(B(!0),V(z,null,L(e.media,(e,t)=>(B(),H(lte,{key:t,attachment:e},null,8,[`attachment`]))),128))])):K(``,!0),e.assistant?(B(),H(Ate,{key:2,text:e.text},null,8,[`text`])):(B(),V(`div`,zte,j(e.text),1)),R(t.$slots,`default`)],2)],2))}}),Bte={class:`w-full self-center justify-self-center py-6 text-center`},Vte={class:`grid gap-2`},Hte=[`onCLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>UA?`${n.slice(0,UA).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var GA=[`title`],KA=I({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=J(()=>gA(n.event)),a=J(()=>WA(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=J(()=>n.event.at?wk(n.event.at):`—`);return(e,t)=>(B(),H(N(BA),{class:A(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[Bl(zl(o,[`prevent`]),[`enter`]),Bl(zl(o,[`prevent`]),[`space`])]},{default:P(()=>[W(N($),{class:`font-medium`},{default:P(()=>[G(j(n.event.kind||n.event.type||`event`),1)]),_:1}),W(N($),{class:`font-mono`},{default:P(()=>[G(j(i.value>0?`#${i.value}`:`—`),1)]),_:1}),W(N($),{class:`w-[55%] max-w-0`},{default:P(()=>[U(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},j(a.value.text),9,GA)]),_:1}),W(N($),null,{default:P(()=>[G(j(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),qA=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function JA(e){return(Number(e?.task_id)||0)>0}function YA(e,t){return t===`tasks`?JA(e):t!==`system`||!JA(e)}function XA(e,t){return e.filter(e=>YA(e,t))}function ZA(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function QA(e,t){return`${e}:${t??0}`}function $A(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=QA(WA(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var ej={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},tj={class:`max-h-[28rem] overflow-y-auto`},nj=[`aria-expanded`,`aria-label`,`onClick`],rj=[`title`],ij=I({__name:`LiveActivityCard`,setup(e){let t=mE(),{activity:n,streamKind:r,streamState:i}=Nu(EO()),a=M(`all`),o=J(()=>XA(n.value,a.value)),s=J(()=>ZA(o.value.length,a.value)),c=Jt(new Set),l=J(()=>$A(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return WA(e.representative)}function p(e){return e.representative.at?wk(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(B(),H(N(_k),null,{default:P(()=>[W(N(Sk),null,{default:P(()=>[W(N(Ck),null,{default:P(()=>[...t[1]||=[G(`Live activity`,-1)]]),_:1}),W(N(vk),{class:`flex items-center gap-2`},{default:P(()=>[W(N(IA),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:N(qA)},null,8,[`modelValue`,`options`]),W(N(mk),{variant:N(r)},{default:P(()=>[G(j(N(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),W(N(yk),null,{default:P(()=>[U(`div`,ej,[U(`div`,tj,[W(N(RA),null,{default:P(()=>[W(N(HA),{class:`sticky top-0 z-10 bg-card`},{default:P(()=>[W(N(BA),null,{default:P(()=>[W(N(VA),null,{default:P(()=>[...t[2]||=[G(`Event`,-1)]]),_:1}),W(N(VA),null,{default:P(()=>[...t[3]||=[G(`Task`,-1)]]),_:1}),W(N(VA),null,{default:P(()=>[...t[4]||=[G(`Detail`,-1)]]),_:1}),W(N(VA),null,{default:P(()=>[...t[5]||=[G(`When`,-1)]]),_:1})]),_:1})]),_:1}),W(N(zA),null,{default:P(()=>[o.value.length?K(``,!0):(B(),H(N(BA),{key:0},{default:P(()=>[W(N($),{colspan:`4`},{default:P(()=>[W(N(ok),null,{default:P(()=>[W(N(lk),null,{default:P(()=>[W(N(fk),null,{default:P(()=>[G(j(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(B(!0),V(z,{key:1},L(l.value,e=>(B(),V(z,{key:e.key},[e.count===1?(B(),H(KA,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(B(),V(z,{key:1},[W(N(BA),{class:A(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[Bl(zl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Bl(zl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:P(()=>[W(N($),{class:`font-medium`},{default:P(()=>[U(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:zl(t=>u(e.key),[`stop`])},[d(e)?(B(),H(N(td),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(B(),H(N(nd),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),G(` `+j(e.label)+` `,1),W(N(mk),{variant:`idle`},{default:P(()=>[G(`×`+j(e.count),1)]),_:2},1024)],8,nj)]),_:2},1024),W(N($),{class:`font-mono`},{default:P(()=>[G(j(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),W(N($),{class:`w-[55%] max-w-0`},{default:P(()=>[U(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},j(f(e).text),9,rj)]),_:2},1024),W(N($),null,{default:P(()=>[G(j(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(B(!0),V(z,{key:0},L(e.events,(t,n)=>(B(),H(KA,{key:`${e.key}:${n}`,event:t,onO Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function TM(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function EM(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function DM(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function OM(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var kM=M([]),AM=M([]),jM=M(!0),MM=M(null),NM=M(null),PM=M(!1),FM=M(null);async function IM(){try{let e=await X.eventTypes();jM.value=e.enabled!==!1,kM.value=e.event_types||[],AM.value=e.proposals||[],MM.value=null}catch(e){MM.value=e.message||String(e)}}function LM(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function RM(e){FM.value=null,NM.value=e}function zM(e){let t=qM.value.find(t=>String(t.id)===e.sample_id);RM({mode:`proposal`,id:null,source:e.source,name:``,rule:LM(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function BM(e=``){RM({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function VM(e){RM({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:LM(e.rule),headersText:``,body:``,exampleHeaders:{}})}function HM(){NM.value=null}async function UM(){let e=NM.value;if(e){PM.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:OM(e.rule)});else{let t=e.mode===`paste`?wM(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:OM(e.rule),example:{headers:t,body:e.body}})}NM.value=null,await IM()}catch(e){FM.value=e.message||String(e)}finally{PM.value=!1}}}var WM=M(null);async function GM(){let e=WM.value;if(WM.value=null,e)try{await X.eventTypeDelete(e.id),await IM()}catch(e){MM.value=e.message||String(e)}}var KM=100,qM=M([]),JM=M(!0),YM=M(null),XM=M(!0),ZM=M(null);async function QM(){try{let e=await X.captures(KM);JM.value=e.enabled!==!1,qM.value=e.captures||[],YM.value=null}catch(e){YM.value=e.message||String(e)}finally{XM.value=!1}}function $M(e){let t=qM.value.find(t=>t.id===e);return t&&(ZM.value=t),!!t}function eN(){qM.value.length&&(ZM.value=qM.value[0])}function tN(){DO(`captures`,()=>{QM(),IM()})}var nN=`archie.theme`,rN=`archie.density`,iN=`archie.motion`,aN=`archie.tooltips`;function oN(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function sN(e,t){try{localStorage.setItem(e,t)}catch{}}function cN(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var lN=Mu(`appearance`,()=>{let e=M(oN(nN,[`system`,`dark`,`light`],`dark`)),t=M(oN(rN,[`comfortable`,`compact`],`comfortable`)),n=M(oN(iN,[`system`,`reduced`],`system`)),r=M(oN(aN,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=cN(e.value)}function o(t){e.value=t,a(),sN(nN,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,sN(rN,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,sN(iN,e)}function l(e){r.value=e,sN(aN,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),uN=I({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Hh(n,t),{tooltipsEnabled:i}=Nu(lN());return(e,t)=>(B(),H(N(UC),q({"data-slot":`tooltip`},N(r),{disabled:n.disabled||!N(i)}),{default:P(t=>[R(e.$slots,`default`,ye(ss(t)))]),_:3},16,[`disabled`]))}}),dN=I({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Hh(lw(n,`class`),r);return(e,t)=>(B(),H(N(qC),null,{default:P( Line truncated
`)}),t}function QT(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function vte(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var yte={class:`[overflow-wrap:anywhere]`},bte={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},xte={class:`font-mono text-[0.85em]`},Ste={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Cte={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},wte={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Tte={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Ete={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Dte={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Ote={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},kte={key:8,class:`mb-2.5 last:mb-0`},Ate=I({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=J(()=>_te(t.text));return(e,t)=>(B(),V(`div`,yte,[(B(!0),V(z,null,L(n.value,(e,t)=>(B(),V(z,{key:t},[e.kind===`pre`?(B(),V(`pre`,bte,[U(`code`,xte,j(e.code),1)])):e.kind===`table`?(B(),V(`table`,Ste,[U(`thead`,null,[U(`tr`,null,[(B(!0),V(z,null,L(e.head,(e,t)=>(B(),V(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[W(XT,{inline:e},null,8,[`inline`])]))),128))])]),U(`tbody`,null,[(B(!0),V(z,null,L(e.rows,(e,t)=>(B(),V(`tr`,{key:t},[(B(!0),V(z,null,L(e,(e,t)=>(B(),V(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[W(XT,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(B(),V(`blockquote`,Cte,[W(XT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(B(),V(`h1`,wte,[W(XT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(B(),V(`h2`,Tte,[W(XT,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(B(),V(`h3`,Ete,[W(XT,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(B(),V(`ul`,Dte,[(B(!0),V(z,null,L(e.items,(e,t)=>(B(),V(`li`,{key:t},[W(XT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(B(),V(`ol`,Ote,[(B(!0),V(z,null,L(e.items,(e,t)=>(B(),V(`li`,{key:t},[W(XT,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(B(),V(`p`,kte,[W(XT,{inline:e.inline},null,8,[`inline`])])):K(``,!0)],64))),128))]))}}),jte={class:`truncate`},Mte=I({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=$i(`RouterLink`);return B(),H(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:P(()=>[W(N(Ju),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),U(`span`,jte,j(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Nte={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Pte={class:`font-semibold text-foreground`},Fte={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Ite=I({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=J(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=J(()=>t.tool.parameters||t.tool.Parameters||``),i=J(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=J(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(B(),H(Mte,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(B(),V(`div`,Nte,[W(N(Yd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),U(`span`,Pte,j(n.value),1),r.value?(B(),V(`code`,Fte,j(r.value),1)):K(``,!0),U(`span`,{class:A(N(Y)(`text-fg-muted`,i.value&&`text-danger`))},j(a.value),3)]))}}),Lte={key:0,class:`mb-2 grid gap-0.5 text-xs`},Rte={key:1,class:`mb-2 flex flex-wrap gap-1.5`},zte={key:3,class:`whitespace-pre-wrap`},$T=I({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(B(),V(`div`,{class:A([`flex`,e.assistant?`justify-start`:`justify-end`])},[U(`div`,{class:A(N(Y)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(B(),V(`div`,Lte,[(B(!0),V(z,null,L(e.tools,(t,n)=>(B(),H(Ite,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):K(``,!0),e.media.length?(B(),V(`div`,Rte,[(B(!0),V(z,null,L(e.media,(e,t)=>(B(),H(lte,{key:t,attachment:e},null,8,[`attachment`]))),128))])):K(``,!0),e.assistant?(B(),H(Ate,{key:2,text:e.text},null,8,[`text`])):(B(),V(`div`,zte,j(e.text),1)),R(t.$slots,`default`)],2)],2))}}),Bte={class:`w-full self-center justify-self-center py-6 text-center`},Vte={class:`grid gap-2`},Hte=[`onCLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>UA?`${n.slice(0,UA).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var GA=[`title`],KA=I({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=J(()=>gA(n.event)),a=J(()=>WA(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=J(()=>n.event.at?wk(n.event.at):`—`);return(e,t)=>(B(),H(N(BA),{class:A(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[Bl(zl(o,[`prevent`]),[`enter`]),Bl(zl(o,[`prevent`]),[`space`])]},{default:P(()=>[W(N($),{class:`font-medium`},{default:P(()=>[G(j(n.event.kind||n.event.type||`event`),1)]),_:1}),W(N($),{class:`font-mono`},{default:P(()=>[G(j(i.value>0?`#${i.value}`:`—`),1)]),_:1}),W(N($),{class:`w-[55%] max-w-0`},{default:P(()=>[U(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},j(a.value.text),9,GA)]),_:1}),W(N($),null,{default:P(()=>[G(j(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),qA=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function JA(e){return(Number(e?.task_id)||0)>0}function YA(e,t){return t===`tasks`?JA(e):t!==`system`||!JA(e)}function XA(e,t){return e.filter(e=>YA(e,t))}function ZA(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function QA(e,t){return`${e}:${t??0}`}function $A(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=QA(WA(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var ej={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},tj={class:`max-h-[28rem] overflow-y-auto`},nj=[`aria-expanded`,`aria-label`,`onClick`],rj=[`title`],ij=I({__name:`LiveActivityCard`,setup(e){let t=mE(),{activity:n,streamKind:r,streamState:i}=Nu(EO()),a=M(`all`),o=J(()=>XA(n.value,a.value)),s=J(()=>ZA(o.value.length,a.value)),c=Jt(new Set),l=J(()=>$A(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return WA(e.representative)}function p(e){return e.representative.at?wk(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(B(),H(N(_k),null,{default:P(()=>[W(N(Sk),null,{default:P(()=>[W(N(Ck),null,{default:P(()=>[...t[1]||=[G(`Live activity`,-1)]]),_:1}),W(N(vk),{class:`flex items-center gap-2`},{default:P(()=>[W(N(IA),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:N(qA)},null,8,[`modelValue`,`options`]),W(N(mk),{variant:N(r)},{default:P(()=>[G(j(N(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),W(N(yk),null,{default:P(()=>[U(`div`,ej,[U(`div`,tj,[W(N(RA),null,{default:P(()=>[W(N(HA),{class:`sticky top-0 z-10 bg-card`},{default:P(()=>[W(N(BA),null,{default:P(()=>[W(N(VA),null,{default:P(()=>[...t[2]||=[G(`Event`,-1)]]),_:1}),W(N(VA),null,{default:P(()=>[...t[3]||=[G(`Task`,-1)]]),_:1}),W(N(VA),null,{default:P(()=>[...t[4]||=[G(`Detail`,-1)]]),_:1}),W(N(VA),null,{default:P(()=>[...t[5]||=[G(`When`,-1)]]),_:1})]),_:1})]),_:1}),W(N(zA),null,{default:P(()=>[o.value.length?K(``,!0):(B(),H(N(BA),{key:0},{default:P(()=>[W(N($),{colspan:`4`},{default:P(()=>[W(N(ok),null,{default:P(()=>[W(N(lk),null,{default:P(()=>[W(N(fk),null,{default:P(()=>[G(j(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(B(!0),V(z,{key:1},L(l.value,e=>(B(),V(z,{key:e.key},[e.count===1?(B(),H(KA,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(B(),V(z,{key:1},[W(N(BA),{class:A(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[Bl(zl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Bl(zl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:P(()=>[W(N($),{class:`font-medium`},{default:P(()=>[U(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:zl(t=>u(e.key),[`stop`])},[d(e)?(B(),H(N(td),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(B(),H(N(nd),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),G(` `+j(e.label)+` `,1),W(N(mk),{variant:`idle`},{default:P(()=>[G(`×`+j(e.count),1)]),_:2},1024)],8,nj)]),_:2},1024),W(N($),{class:`font-mono`},{default:P(()=>[G(j(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),W(N($),{class:`w-[55%] max-w-0`},{default:P(()=>[U(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},j(f(e).text),9,rj)]),_:2},1024),W(N($),null,{default:P(()=>[G(j(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(B(!0),V(z,{key:0},L(e.events,(t,n)=>(B(),H(KA,{key:`${e.key}:${n}`,event:t,onO Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function TM(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function EM(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function DM(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function OM(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var kM=M([]),AM=M([]),jM=M(!0),MM=M(null),NM=M(null),PM=M(!1),FM=M(null);async function IM(){try{let e=await X.eventTypes();jM.value=e.enabled!==!1,kM.value=e.event_types||[],AM.value=e.proposals||[],MM.value=null}catch(e){MM.value=e.message||String(e)}}function LM(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function RM(e){FM.value=null,NM.value=e}function zM(e){let t=qM.value.find(t=>String(t.id)===e.sample_id);RM({mode:`proposal`,id:null,source:e.source,name:``,rule:LM(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function BM(e=``){RM({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function VM(e){RM({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:LM(e.rule),headersText:``,body:``,exampleHeaders:{}})}function HM(){NM.value=null}async function UM(){let e=NM.value;if(e){PM.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:OM(e.rule)});else{let t=e.mode===`paste`?wM(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:OM(e.rule),example:{headers:t,body:e.body}})}NM.value=null,await IM()}catch(e){FM.value=e.message||String(e)}finally{PM.value=!1}}}var WM=M(null);async function GM(){let e=WM.value;if(WM.value=null,e)try{await X.eventTypeDelete(e.id),await IM()}catch(e){MM.value=e.message||String(e)}}var KM=100,qM=M([]),JM=M(!0),YM=M(null),XM=M(!0),ZM=M(null);async function QM(){try{let e=await X.captures(KM);JM.value=e.enabled!==!1,qM.value=e.captures||[],YM.value=null}catch(e){YM.value=e.message||String(e)}finally{XM.value=!1}}function $M(e){let t=qM.value.find(t=>t.id===e);return t&&(ZM.value=t),!!t}function eN(){qM.value.length&&(ZM.value=qM.value[0])}function tN(){DO(`captures`,()=>{QM(),IM()})}var nN=`archie.theme`,rN=`archie.density`,iN=`archie.motion`,aN=`archie.tooltips`;function oN(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function sN(e,t){try{localStorage.setItem(e,t)}catch{}}function cN(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var lN=Mu(`appearance`,()=>{let e=M(oN(nN,[`system`,`dark`,`light`],`dark`)),t=M(oN(rN,[`comfortable`,`compact`],`comfortable`)),n=M(oN(iN,[`system`,`reduced`],`system`)),r=M(oN(aN,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=cN(e.value)}function o(t){e.value=t,a(),sN(nN,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,sN(rN,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,sN(iN,e)}function l(e){r.value=e,sN(aN,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),uN=I({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Hh(n,t),{tooltipsEnabled:i}=Nu(lN());return(e,t)=>(B(),H(N(UC),q({"data-slot":`tooltip`},N(r),{disabled:n.disabled||!N(i)}),{default:P(t=>[R(e.$slots,`default`,ye(ss(t)))]),_:3},16,[`disabled`]))}}),dN=I({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Hh(lw(n,`class`),r);return(e,t)=>(B(),H(N(qC),null,{default:P( Line truncated
`)}};gJ.defaultYaml={explicit:!1,version:`1.2`},gJ.defaultTags={"!!":`tag:yaml.org,2002:`};function _J(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function vJ(e){let t=new Set;return lJ(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function yJ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function bJ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=vJ(e);let a=yJ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(tJ(t.node)||rJ(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function xJ(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=xJ(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=xJ(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=xJ(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=xJ(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function SJ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>SJ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!aJ(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var CJ=class{constructor(e){Object.defineProperty(this,Xq,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Qq(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=SJ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?xJ(i,{"":o},``,o):o}},wJ=class extends CJ{constructor(e){super(Wq),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],lJ(e,{Node:(e,t)=>{(Zq(t)||aJ(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(SJ(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=TJ(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(_J(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function TJ(e,t,n){if(Zq(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(rJ(t)){let r=0;for(let i of t.items){let t=TJ(e,i,n);t>r&&(r=t)}return r}if(eJ(t)){let r=TJ(e,t.key,n),i=TJ(e,t.value,n);return Math.max(r,i)}return 1}var EJ=e=>!e||typeof e!=`function`&&typeof e!=`object`,DJ=class extends CJ{constructor(e){super(Jq),this.value=e}toJSON(e,t){return t?.keep?this.value:SJ(this.value,e,t)}toString(){return String(this.value)}};DJ.BLOCK_FOLDED=`BLOCK_FOLDED`,DJ.BLOCK_LITERAL=`BLOCK_LITERAL`,DJ.PLAIN=`PLAIN`,DJ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,DJ.QUOTE_SINGLE=`QUOTE_SINGLE`;var OJ=`tag:yaml.org,2002:`;function kJ(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function AJ(e,t,n){if(Qq(e)&&(e=e.contents),iJ(e))return e;if(eJ(e)){let t=n.schema[Kq].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new wJ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=OJ+t.slice(2));let l=kJ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new DJ(e);return c&&(c.node=t),t Line truncated
`)?FJ(n,t):n.includes(`
`)?`
@@ -128,7 +128,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`)[0]?.trim()||`invalid YAML`}function CQ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function wQ(e){return typeof e==`string`&&e.trim()!==``}var TQ={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},EQ={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},DQ={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},OQ={class:`min-w-0 flex-1`},kQ=[`value`,`placeholder`],AQ={class:`truncate font-mono text-[11px] text-fg-subtle`},jQ={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},MQ={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},NQ={key:1,class:`space-y-1.5`},PQ=[`title`],FQ=[`value`],IQ=[`value`],LQ={key:3,class:`flex flex-wrap items-center gap-1 pt-0.5`},RQ=[`onClick`],zQ=[`onClick`],BQ={key:2,class:`divide-y divide-border rounded-md border border-border`},VQ=[`title`],HQ=[`value`,`onChange`],UQ=[`value`],WQ=[`value`,`onInput`],GQ=[`value`,`onFocus`,`onInput`],KQ=[`title`],qQ={key:0,class:`text-xs text-danger`},JQ={class:`space-y-2`},YQ={class:`divide-y divide-border rounded-md border border-border`},XQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},ZQ=[`value`],QQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},$Q=[`value`],e$={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},t$=[`value`],n$={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},r$={class:`flex items-center border-t border-border px-4 py-2.5`},i$=I({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=J(()=>ZZ(n.yaml,n.path)??{}),a=J(()=>typeof i.value.type==`string`?i.value.type:``),o=J(()=>n.vocabulary.find(e=>e.name===a.value)),s=J(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=J(()=>rQ(n.yaml,n.path)),l=J(()=>o.value?.settings&&i.value.settings?pQ(i.value.settings,o.value.settings,`settings`):``),u=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],d=/mission|body|detail|plan|rules/;function f(e,t){return t.type===`string`?t.enum?`select`:d.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let p=J(()=>{let e=Object.entries(o.value?.settings?.properties??{}).map(([e,t])=>({key:e,schema:t,kind:f(e,t)})),t=e.filter(e=>u.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>u.indexOf(e.key)-u.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function m(e){let{id:t,type:i,...a}=e;r(`update:yaml`,QZ(n.yaml,n.path,{id:t,type:i,...a}))}function h(e,t){m({...i.value,[e]:t})}function g(e){h(`retry`,{...i.value.retry,...e})}function _(e,t){m({...i.value,settings:{...s.value,[e]:t}})}let v=M(null);function y(e,t){let n=v.value??p.value.lead?.key;if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=`{{ steps.${e}.${t} }}`;_(n,r?`${r.trimEnd()} ${i}`:i)}let b=M({});function x(e,t){try{_(e,t.trim()?NZ(t):void 0),b.value={...b.value,[e]:``}}catch(t){b.value={...b.value,[e]:String(t.message).split(`
`)[0]}}}let S=e=>e===void 0?``:PZ(e).trimEnd(),C=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),w=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(B(),V(`aside`,TQ,[U(`header`,EQ,[U(`span`,DQ,[(B(),H(ta(N(YZ)(a.value)),{class:`size-4`}))]),U(`div`,OQ,[U(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:N(BZ)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>h(`id`,e.target.value)},null,40,kQ),U(`div`,AQ,j(a.value),1)]),W(N(Q),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:P(()=>[W(N(Xd))]),_:1})]),U(`div`,jQ,[l.value?(B(),V(`p`,MQ,j(l.value),1)):K(``,!0),p.value.lead?(B(),V(`section`,NQ,[U(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:p.value.lead.schema.description},[G(j(C(p.value.lead.key,p.value.lead.schema))+` `,1),p.value.lead.schema.description?(B(),H(N(sd),{key:0,class:`size-3 text-fg-subtle`})):K(``,!0)],8,PQ),p.value.lead.kind===`select`?(B(),V(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:w(p.value.lead.key),onChange:t[2]||=e=>_(p.value.lead.key,e.target.value||void 0)},[t[13]||=U(`option`,{value:``},`Default`,-1),(B(!0),V(z,null,L(p.value.lead.schema.enum,e=>(B(),V(`option`,{key:e,value:e},j(e),9,IQ))),128))],40,FQ)):p.value.lead.kind===`text`?(B(),H(N(nT),{key:1,"model-value":w(p.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>v.value=p.value.lead.key,"onUpdate:modelValue":t[4]||=e=>_(p.value.lead.key,String(e))},null,8,[`model-value`])):(B(),H(N(PD),{key:2,"model-value":w(p.value.lead.key),onFocus:t[5]||=e=>v.value=p.value.lead.key,"onUpdate:modelValue":t[6]||=e=>_(p.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&p.value.lead.kind!==`select`?(B(),V(`div`,LQ,[t[14]||=U(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(B(!0),V(z,null,L(c.value,e=>(B(),V(z,{key:e},[U(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>y(e,`summary`)},j(e),9,RQ),U(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>y(e,`result`)},j(e)+`.result`,9,zQ)],64))),128))])):K(``,!0)])):K(``,!0),p.value.compact.length?(B(),V(`section`,BQ,[(B(!0),V(z,null,L(p.value.compact,e=>(B(),V(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[U(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[G(j(C(e.key,e.schema))+` `,1),e.schema.description?(B(),H(N(sd),{key:0,class:`size-3 text-fg-subtle`})):K(``,!0)],8,VQ),e.kind===`boolean`?(B(),H(N(aO),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>_(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(B(),V(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:w(e.key),onChange:t=>_(e.key,t.target.value||void 0)},[t[15]||=U(`option`,{value:``},`Default`,-1),(B(!0),V(z,null,L(e.schema.enum,e=>(B(),V(`option`,{key:e,value:e},j(e),9,UQ))),128))],40,HQ)):e.kind===`number`?(B(),V(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>_(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,WQ)):(B(),V(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:w(e.key),onFocus:t=>v.value=e.key,onInput:t=>_(e.key,t.target.value)},null,40,GQ))]))),128))])):K(``,!0),(B(!0),V(z,null,L(p.value.long,e=>(B(),V(`section`,{key:e.key,class:`space-y-1.5`},[U(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[G(j(C(e.key,e.schema))+` `,1),e.schema.description?(B(),H(N(sd),{key:0,class:`size-3 text-fg-subtle`})):K(``,!0)],8,KQ),e.kind===`text`?(B(),H(N(nT),{key:0,"model-value":w(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>v.value=e.key,"onUpdate:modelValue":t=>_(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(B(),H(N(nT),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>_(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(B(),V(z,{key:2},[W(N(nT),{"model-value":S(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>x(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),b.value[e.key]?(B(),V(`span`,qQ,j(b.value[e.key]),1)):K(``,!0)],64))]))),128)),U(`section`,JQ,[t[21]||=U(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),U(`div`,YQ,[U(`label`,XQ,[t[16]||=U(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),U(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>h(`when`,e.target.value)},null,40,ZQ)]),U(`label`,QQ,[t[18]||=U(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),U(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>h(`on_failure`,e.target.value||void 0)},[...t[17]||=[U(`option`,{value:``},`Park the task`,-1),U(`option`,{value:`continue`},`Continue`,-1)]],40,$Q)]),U(`label`,e$,[t[19]||=U(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),U(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>g({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,t$)]),U(`label`,n$,[t[20]||=U(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),W(N(qD),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":t[10]||=e=>g({backoff:e||void 0})},null,8,[`model-value`])])])])]),U(`footer`,r$,[W(N(Q),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[11]||=e=>r(`remove`)},{default:P(()=>[W(N(Bd)),t[22]||=G(` Delete step`,-1)]),_:1}),W(N(Q),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[12]||=e=>r(`close`)},{default:P(()=>[...t[23]||=[G(`Done`,-1)]]),_:1})])]))}}),a$=`repository_path`;function o$(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:a$,path:n.trim(),type:`string`,required:!0}),r}function s$(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function c$(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=s$(RN(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function l$(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:RN(e.value,i.type??`string`)})}return n}function u$(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function d$(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...d$(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...d$(n,r)]}):[]}function f$(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function p$(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function m$(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var h$={class:`flex h-full flex-col`},g$={class:`flex items-center gap-2 border-b border-border px-4 py-3`},_$={class:`min-w-0 flex-1 truncate text-sm font-medium`},v$={key:0,class:`flex flex-1 items-center justify-center`},y$={class:`space-y-1.5`},b$=[`disabled`],x$=[`value`],S$={key:1,class:`space-y-1.5`},C$=[`value`],w$=[`title`],T$={class:`space-y-1.5`},E$={id:`bind-paths`},D$=[`value`],O$={class:`divide-y divide-border rounded-md border border-border`},k$={class:`flex items-center gap-1.5 text-xs`},A$={class:`font-mono`},j$={class:`text-fg-subtle`},M$={key:0,class:`text-danger`,title:`Required`},N$=[`title`,`aria-label`,`onClick`],P$=[`onUpdate:modelValue`,`aria-label`],F$=[`onUpdate:modelValue`,`aria-label`],I$={key:2,class:`text-xs text-danger`},L$=[`title`],R$={key:0,class:`space-y-1 px-3 py-2`},z$={key:0,class:`text-xs text-danger`},B$={key:1,class:`truncate font-mono text-xs text-success`},V$={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},H$={class:`space-y-2`},U$={key:0,role:`alert`,class:`text-xs text-danger`},W$={key:1,class:`texLine truncated
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(B(),V(z,{key:2},[W(N(nT),{"model-value":S(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>x(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),b.value[e.key]?(B(),V(`span`,qQ,j(b.value[e.key]),1)):K(``,!0)],64))]))),128)),U(`section`,JQ,[t[21]||=U(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),U(`div`,YQ,[U(`label`,XQ,[t[16]||=U(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),U(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>h(`when`,e.target.value)},null,40,ZQ)]),U(`label`,QQ,[t[18]||=U(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),U(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>h(`on_failure`,e.target.value||void 0)},[...t[17]||=[U(`option`,{value:``},`Park the task`,-1),U(`option`,{value:`continue`},`Continue`,-1)]],40,$Q)]),U(`label`,e$,[t[19]||=U(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),U(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>g({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,t$)]),U(`label`,n$,[t[20]||=U(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),W(N(qD),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":t[10]||=e=>g({backoff:e||void 0})},null,8,[`model-value`])])])])]),U(`footer`,r$,[W(N(Q),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[11]||=e=>r(`remove`)},{default:P(()=>[W(N(Bd)),t[22]||=G(` Delete step`,-1)]),_:1}),W(N(Q),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[12]||=e=>r(`close`)},{default:P(()=>[...t[23]||=[G(`Done`,-1)]]),_:1})])]))}}),a$=`repository_path`;function o$(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:a$,path:n.trim(),type:`string`,required:!0}),r}function s$(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function c$(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=s$(RN(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function l$(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:RN(e.value,i.type??`string`)})}return n}function u$(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function d$(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...d$(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...d$(n,r)]}):[]}function f$(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function p$(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function m$(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var h$={class:`flex h-full flex-col`},g$={class:`flex items-center gap-2 border-b border-border px-4 py-3`},_$={class:`min-w-0 flex-1 truncate text-sm font-medium`},v$={key:0,class:`flex flex-1 items-center justify-center`},y$={class:`space-y-1.5`},b$=[`disabled`],x$=[`value`],S$={key:1,class:`space-y-1.5`},C$=[`value`],w$=[`title`],T$={class:`space-y-1.5`},E$={id:`bind-paths`},D$=[`value`],O$={class:`divide-y divide-border rounded-md border border-border`},k$={class:`flex items-center gap-1.5 text-xs`},A$={class:`font-mono`},j$={class:`text-fg-subtle`},M$={key:0,class:`text-danger`,title:`Required`},N$=[`title`,`aria-label`,`onClick`],P$=[`onUpdate:modelValue`,`aria-label`],F$=[`onUpdate:modelValue`,`aria-label`],I$={key:2,class:`text-xs text-danger`},L$=[`title`],R$={key:0,class:`space-y-1 px-3 py-2`},z$={key:0,class:`text-xs text-danger`},B$={key:1,class:`truncate font-mono text-xs text-success`},V$={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},H$={class:`space-y-2`},U$={key:0,role:`alert`,class:`text-xs text-danger`},W$={key:1,class:`texLine truncated
`).replace(`
`,`
@@ -153,4 +153,4 @@ Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},A7=class extends Error{constructor(e,...t){super(k7[e]?.call(k7,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function j7(e){return`clientX`in e}function Kne(e){return`sourceEvent`in e}function M7(e,t){let n=j7(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var N7=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function qne(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function P7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var Jne=()=>!0;function F7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Yne(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())H5(i,V5(e))>0&&r.push(e);return r}var Xne=250;function Zne(e,t,n,r){let i=[],a=1/0,o=Yne(e,n,t+Xne);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=E7(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function I7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Jne},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=M7(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=L7(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===O5.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=R7(t,e,a,p,n,!0)}return b}function L7(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Qne(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function $ne(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function R7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===O5.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...E7(o,c,c.position,!0)}:c}var z7={[T5.Left]:T5.Right,[T5.Right]:T5.Left,[T5.Top]:T5.Bottom,[T5.Bottom]:T5.Top},ere=[`production`,`prod`];function B7(e,...t){V7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function V7(){return!ere.includes(`production`)}function H7(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...U5(t)}}):null}function U7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),qn(()=>{o.blur()})):n([e])}function W7(e){return N(e)!==void 0}function tre(e,t,n,r){if(!e||!e.source||!e.target)return n(new A7(O7.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=q5(e)?e:{...e,id:$5(e)},i=Z5(i,void 0,r),!Pne(i,t)&&i}function nre(e,t,n,r,i){if(!t.source||!t.target)return i(new A7(O7.EDGE_INVALID,e.id)),!1;if(!n)return i(new A7(O7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?$5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function G7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!J5(o)){n(new A7(O7.NODE_INVALID,o?.id));continue}let s=jne(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new A7(O7.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function K7(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function q7(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;K7(`sourcLine truncated
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},A7=class extends Error{constructor(e,...t){super(k7[e]?.call(k7,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function j7(e){return`clientX`in e}function Kne(e){return`sourceEvent`in e}function M7(e,t){let n=j7(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var N7=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function qne(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function P7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var Jne=()=>!0;function F7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Yne(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())H5(i,V5(e))>0&&r.push(e);return r}var Xne=250;function Zne(e,t,n,r){let i=[],a=1/0,o=Yne(e,n,t+Xne);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=E7(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function I7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Jne},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=M7(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=L7(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===O5.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=R7(t,e,a,p,n,!0)}return b}function L7(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Qne(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function $ne(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function R7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===O5.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...E7(o,c,c.position,!0)}:c}var z7={[T5.Left]:T5.Right,[T5.Right]:T5.Left,[T5.Top]:T5.Bottom,[T5.Bottom]:T5.Top},ere=[`production`,`prod`];function B7(e,...t){V7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function V7(){return!ere.includes(`production`)}function H7(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...U5(t)}}):null}function U7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),qn(()=>{o.blur()})):n([e])}function W7(e){return N(e)!==void 0}function tre(e,t,n,r){if(!e||!e.source||!e.target)return n(new A7(O7.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=q5(e)?e:{...e,id:$5(e)},i=Z5(i,void 0,r),!Pne(i,t)&&i}function nre(e,t,n,r,i){if(!t.source||!t.target)return i(new A7(O7.EDGE_INVALID,e.id)),!1;if(!n)return i(new A7(O7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?$5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function G7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!J5(o)){n(new A7(O7.NODE_INVALID,o?.id));continue}let s=jne(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new A7(O7.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function K7(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function q7(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;K7(`sourcLine truncated
+2 -4
View File
@@ -141,8 +141,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
<DialogHeader>
<DialogTitle>{{ title }}</DialogTitle>
<DialogDescription>
A binding is not armed until it is approved, and editing one drops it
back to pending approval.
Editing returns this binding to pending approval.
</DialogDescription>
</DialogHeader>
@@ -308,8 +307,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
</Field>
</div>
<FieldDescription>
Optional. A pin is both halves or neither, so leave both blank to
use the single configured repo.
Both or neither; blank uses the configured repo.
</FieldDescription>
</Field>
</FieldGroup>
+1 -2
View File
@@ -63,8 +63,7 @@ const failureTitle = computed(() =>
<EmptyHeader>
<EmptyTitle>No bindings yet</EmptyTitle>
<EmptyDescription>
Create one from a saved field mapping to turn a captured webhook into a
workflow.
None yet. A mapping + a workflow make a binding.
</EmptyDescription>
</EmptyHeader>
</Empty>
+1 -2
View File
@@ -36,8 +36,7 @@ function onOpenChange(open: boolean): void {
<AlertDialogHeader>
<AlertDialogTitle>Delete "{{ props.binding?.name }}"?</AlertDialogTitle>
<AlertDialogDescription>
It stops dispatching immediately and cannot be recovered. Captured
events for its source keep arriving; they just stop starting tasks.
It stops dispatching immediately and cannot be recovered.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
+1 -1
View File
@@ -64,7 +64,7 @@ async function copyEndpoint() {
<EmptyHeader>
<EmptyMedia variant="icon"><Inbox /></EmptyMedia>
<EmptyTitle>No captures yet</EmptyTitle>
<EmptyDescription>Point a webhook at this address and it shows up here.</EmptyDescription>
<EmptyDescription>Webhooks sent here appear below.</EmptyDescription>
</EmptyHeader>
<div class="flex items-center gap-2 rounded-md border border-border bg-background py-1 pr-1 pl-3">
<code class="font-mono text-xs">{{ endpoint }}</code>
+1 -1
View File
@@ -164,7 +164,7 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
<EmptyHeader>
<EmptyTitle>No event types yet</EmptyTitle>
<EmptyDescription>
Create one from a captured event.
Nothing is dispatched until a type matches.
</EmptyDescription>
</EmptyHeader>
</Empty>
-1
View File
@@ -174,7 +174,6 @@ const models = computed({
</SettingRow>
<SettingRow
label="Unrestricted filesystem"
hint="File tools can write anywhere."
:tone="chat.unrestricted_filesystem ? 'danger' : 'default'"
>
<Switch v-model="chat.unrestricted_filesystem" aria-label="Unrestricted filesystem" />
+3 -4
View File
@@ -119,8 +119,7 @@ function scopes(binding: HarnessBinding): string {
<EmptyHeader>
<EmptyTitle>Harness bindings are not configured</EmptyTitle>
<EmptyDescription>
This process cannot read credential bindings or captured OAuth tokens,
so there is nothing to set up here.
This process cannot read credential bindings or captured OAuth tokens.
</EmptyDescription>
</EmptyHeader>
</Empty>
@@ -129,8 +128,8 @@ function scopes(binding: HarnessBinding): string {
<Alert v-if="!state.terminal" class="mb-4">
<AlertTitle>Setup terminal unavailable</AlertTitle>
<AlertDescription>
This process cannot open a Kit container. The bindings below are still
listed; the setup terminal needs a container-capable process.
This process cannot open a Kit container. Bindings are still listed
below.
</AlertDescription>
</Alert>
+2 -2
View File
@@ -78,13 +78,13 @@ const settings: NavSpec = {
"/settings/status",
],
},
{ paths: ["/settings/history"] },
{ paths: ["/settings/appearance", "/settings/history"] },
],
};
// Reached from the Dashboard's Logs button and the account menu, and by
// Jump to, but not from the bar.
const unlisted = ["/logs", "/settings/appearance"];
const unlisted = ["/logs"];
export function navTree(hidden: string[] = []): NavNode[] {
return buildNav(table, specs, hidden).tree;
+2 -7
View File
@@ -11,7 +11,6 @@ import {
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
@@ -52,10 +51,6 @@ function onOpenChange(open: boolean) {
<DialogTitle>{{
draft.id === null ? "New mapping" : "Edit mapping"
}}</DialogTitle>
<DialogDescription>
Bind named fields to JSON paths from a real captured event, ready for
a playbook binding.
</DialogDescription>
</DialogHeader>
<Card>
@@ -78,7 +73,7 @@ function onOpenChange(open: boolean) {
<Card>
<CardHeader>
<CardTitle>Payload — click a value to bind it</CardTitle>
<CardTitle>Payload</CardTitle>
</CardHeader>
<CardContent>
<Alert v-if="draft.payloadError" variant="destructive">
@@ -90,7 +85,7 @@ function onOpenChange(open: boolean) {
@pick="addField"
/>
<p v-else class="text-sm text-fg-muted">
Pick a captured event above to see its payload.
No event selected.
</p>
</CardContent>
</Card>
+1 -1
View File
@@ -36,7 +36,7 @@ const failureByField = computed(
<template>
<p v-if="!fields.length" class="py-3 text-sm text-fg-muted">
Click a value in the payload to bind a field.
No fields bound.
</p>
<Table v-else>
+1 -4
View File
@@ -47,10 +47,7 @@ import {
<Empty v-else-if="!mappings.length">
<EmptyHeader>
<EmptyTitle>No mappings yet</EmptyTitle>
<EmptyDescription
>Create one from a captured event to reuse its fields in a future
playbook binding.</EmptyDescription
>
<EmptyDescription>None yet.</EmptyDescription>
</EmptyHeader>
</Empty>
+2 -4
View File
@@ -141,7 +141,6 @@ const routes = [
navPath: "/settings",
settings: true,
label: "Appearance",
description: "Theme and display preferences.",
},
},
{
@@ -317,7 +316,7 @@ const routes = [
navPath: "/settings",
settings: true,
label: "Extensions",
description: "Installable extensions: install, accept what they may use, enable.",
description: "Installed extensions and their grants.",
section: "settings",
},
},
@@ -329,7 +328,7 @@ const routes = [
navPath: "/settings",
settings: true,
label: "Plugins",
description: "Directories Archie loads extensions from at startup.",
description: "Where extension directories are loaded from.",
section: "settings",
},
},
@@ -376,7 +375,6 @@ const routes = [
redirect: "/settings/personas",
meta: {
label: "Settings",
description: "Everything you configure: agents, integrations, runtime.",
},
},
// Paths from before Settings existed, kept for bookmarks and chat history.
+1 -1
View File
@@ -63,7 +63,7 @@ onMounted(load);
<Button size="sm" :disabled="busy" @click="create"><Plus data-icon="inline-start" /> New token</Button>
</div>
<p class="mb-3 text-xs text-fg-subtle">
A token acts as you. Send it as <code>Authorization: Bearer &lt;token&gt;</code>.
Send it as <code>Authorization: Bearer &lt;token&gt;</code>.
</p>
<p v-if="error" role="alert" class="mb-3 text-sm text-danger">{{ error }}</p>
<div v-if="created" class="mb-3 rounded-lg border border-border bg-card p-3">
+1 -1
View File
@@ -53,7 +53,7 @@ const status = computed(() => (dials.value ? reviewDialStatus(config.value, dial
<SettingRow
label="Approve before posting"
for="review-approve"
hint="Park a finished review so an operator approves the draft before it posts."
hint="Draft waits for you before it posts."
>
<div class="flex flex-wrap items-center gap-3">
<Switch id="review-approve" v-model="dials.approve_before_post" aria-label="Approve before posting" />
+1 -2
View File
@@ -95,8 +95,7 @@ async function save() {
<SheetHeader>
<SheetTitle>Review {{ count }} {{ count === 1 ? "change" : "changes" }}</SheetTitle>
<SheetDescription>
{{ sections.length }} {{ sections.length === 1 ? "section" : "sections" }},
saved in order; a failure stops the rest.
{{ sections.length }} {{ sections.length === 1 ? "section" : "sections" }}
</SheetDescription>
</SheetHeader>
<div class="flex-1 space-y-3 overflow-y-auto px-4 pb-4">
+1 -3
View File
@@ -36,9 +36,7 @@ const chars = computed(() => soul.value?.text.length ?? 0);
<DraftHint :kind="KIND" path="text" />
</div>
<p class="mt-1 text-xs text-fg-subtle">
Archie's name, register and warmth, rendered into the chat prompt's identity slot. An empty
value falls back to the SOUL file, then the shipped default. The invariant rules and tool
inventory are unaffected.
Empty falls back to the SOUL file, then the shipped default.
</p>
<Textarea
id="soul-text"
-12
View File
@@ -50,9 +50,6 @@ function chooseMotion(value: unknown): void {
<section class="flex min-w-0 flex-col items-start">
<div>
<h2 id="appearance-theme" class="text-sm font-medium">Theme</h2>
<p class="mt-1 text-sm text-muted-foreground">
Follow your device, or keep Archie light or dark.
</p>
</div>
<ToggleGroup
type="single"
@@ -71,9 +68,6 @@ function chooseMotion(value: unknown): void {
<section class="flex min-w-0 flex-col items-start">
<div>
<h2 id="appearance-density" class="text-sm font-medium">Density</h2>
<p class="mt-1 text-sm text-muted-foreground">
Use relaxed spacing, or fit more work on screen.
</p>
</div>
<ToggleGroup
type="single"
@@ -91,9 +85,6 @@ function chooseMotion(value: unknown): void {
<section class="flex min-w-0 flex-col items-start">
<div>
<h2 id="appearance-motion" class="text-sm font-medium">Motion</h2>
<p class="mt-1 text-sm text-muted-foreground">
Follow your device, or reduce interface animation here.
</p>
</div>
<ToggleGroup
type="single"
@@ -113,9 +104,6 @@ function chooseMotion(value: unknown): void {
<h2 id="appearance-tooltips" class="text-sm font-medium">
Tooltips
</h2>
<p class="mt-1 text-sm text-muted-foreground">
Show extra context when controls are hovered or focused.
</p>
</div>
<Switch
:model-value="tooltipsEnabled"
+1 -2
View File
@@ -204,8 +204,7 @@ onMounted(load);
}}
</Button>
<p v-if="installing" class="text-xs text-fg-muted">
The build runs on this host and the restart is verified out of band;
the page can be left.
You can leave this page; the restart continues here.
</p>
</div>
-4
View File
@@ -5,7 +5,6 @@ import PageHeader from "@/base/PageHeader.vue";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
@@ -54,9 +53,6 @@ const filtered = computed(() => {
<Card>
<CardHeader>
<CardTitle>Catalogue</CardTitle>
<CardDescription
>Project, shared, and user-global skills</CardDescription
>
<Input
v-model="search"
type="search"
+1 -2
View File
@@ -68,8 +68,7 @@ const total = computed(
</TableBody>
</Table>
<p v-if="capture.truncated" class="mt-2 text-xs text-fg-muted">
Showing the first {{ files.length }} of {{ total }} files. The totals
above cover every file in this capture.
Showing the first {{ files.length }} of {{ total }} files.
</p>
</template>
</template>
+1 -2
View File
@@ -57,8 +57,7 @@ const nothingRecorded = computed(
<div v-else class="flex flex-col">
<p class="mb-3 text-xs text-fg-muted">
Captured when the attempt's work was committed, so this covers the whole
attempt, not one stage.
Whole attempt, not one stage.
</p>
<ChangeCapture
v-for="(capture, i) in captures"
+2 -3
View File
@@ -229,8 +229,7 @@ const download = computed(() =>
<EmptyHeader>
<EmptyTitle>No persisted log for this attempt</EmptyTitle>
<EmptyDescription
>The log service is not reporting a reader, so the file cannot be
read.</EmptyDescription
>The log service has no reader for this file.</EmptyDescription
>
</EmptyHeader>
</Empty>
@@ -268,7 +267,7 @@ const download = computed(() =>
>
</div>
<p v-if="current?.truncated" class="px-1 pt-1 text-xs text-warn">
The log is larger than the readable window; its oldest entries cannot be paged.
Log truncated; older entries are not pageable.
</p>
<Button v-if="download" variant="outline" size="sm" class="mt-3" as-child>
<a :href="download" download>Download log</a>
+1 -2
View File
@@ -19,7 +19,6 @@ watch(() => props.task.review_gate, () => {
<Card v-if="gate" class="mb-6">
<CardHeader>
<CardTitle>Review findings</CardTitle>
<p class="text-sm text-muted-foreground">Select the findings to post to the pull request.</p>
<p v-if="gate.head_sha" class="break-all font-mono text-xs text-muted-foreground">Head commit: {{ gate.head_sha }}</p>
</CardHeader>
<CardContent class="space-y-4">
@@ -44,7 +43,7 @@ watch(() => props.task.review_gate, () => {
</li>
</ul>
<div class="flex flex-wrap items-center justify-between gap-3">
<p class="text-xs text-muted-foreground">{{ selected.length }} of {{ gate.findings.length }} selected<template v-if="!selected.length">. Select at least one finding to approve.</template></p>
<p class="text-xs text-muted-foreground">{{ selected.length }} of {{ gate.findings.length }} selected</p>
<TaskRowActions :task="task" :only="['approve', 'rereview', 'reject']" :findings="selected" @done="emit('done', $event)" />
</div>
</CardContent>
+3 -5
View File
@@ -354,9 +354,8 @@ function requestFromMenu(id: string) {
<DialogHeader>
<DialogTitle>Re-review this pull request?</DialogTitle>
<DialogDescription>
The review phases run again with your instructions. Two re-reviews
are allowed; this is
{{ props.task.rereview_rounds ? "the next" : "the first" }} one.
Two re-reviews allowed; this is the
{{ props.task.rereview_rounds ? "next" : "first" }}.
</DialogDescription>
</DialogHeader>
<div class="flex flex-col gap-2">
@@ -397,8 +396,7 @@ function requestFromMenu(id: string) {
<DialogHeader>
<DialogTitle>Retry this task?</DialogTitle>
<DialogDescription>
Choose where the retry starts. The mode is saved on the task and
the daemon prepares the worktree from it.
Choose where the retry starts.
</DialogDescription>
</DialogHeader>
<RadioGroupRoot
-2
View File
@@ -23,7 +23,6 @@ import { useRoute, useRouter } from "vue-router";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
@@ -209,7 +208,6 @@ async function reveal(id: number) {
<Card>
<CardHeader>
<CardTitle>All tasks</CardTitle>
<CardDescription>Click a row for its timeline</CardDescription>
</CardHeader>
<CardContent class="flex flex-col gap-3">
<TaskFilters
-4
View File
@@ -4,7 +4,6 @@ import { computed } from "vue";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
@@ -31,9 +30,6 @@ const maxMs = computed(() => maxStageMs(props.stages));
<Card>
<CardHeader>
<CardTitle>Slowest stages</CardTitle>
<CardDescription
>Average duration, this workflow's stages</CardDescription
>
</CardHeader>
<CardContent>
<Table>
-2
View File
@@ -4,7 +4,6 @@ import { computed } from "vue";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
@@ -36,7 +35,6 @@ const rows = computed(() => failingStages(props.stages));
<Card>
<CardHeader>
<CardTitle>Most failures</CardTitle>
<CardDescription>Stages that error out, over their runs</CardDescription>
</CardHeader>
<CardContent>
<Empty v-if="!rows.length">
+1 -1
View File
@@ -62,7 +62,7 @@ function duration(ms?: number): string {
<span v-if="trigger.detail" class="truncate text-fg-subtle">{{ trigger.detail }}</span>
</li>
</ul>
<div v-else-if="data.kind === 'start'" class="mt-0.5 text-xs text-muted-foreground">Nothing starts it yet; run it by hand or bind an event to it.</div>
<div v-else-if="data.kind === 'start'" class="mt-0.5 text-xs text-muted-foreground">Nothing starts it yet.</div>
<div v-else-if="data.detail" class="mt-0.5 truncate text-xs text-muted-foreground" :title="data.detail">{{ data.detail }}</div>
<p v-if="data.summary" class="mt-1 line-clamp-2 text-xs leading-snug text-foreground/80" :title="data.summary">{{ data.summary }}</p>
<div v-if="data.when || data.retry || data.continues" class="mt-1 flex flex-wrap gap-1 text-[11px]">
+1 -2
View File
@@ -79,7 +79,6 @@ function setNeeds(next: { captures?: boolean; gate_retries?: number }): void {
<header class="flex items-center gap-2 border-b border-border px-4 py-3">
<div class="min-w-0 flex-1">
<div class="text-sm font-medium">Workflow settings</div>
<div class="text-[11px] text-fg-subtle">What it takes, where it works, and what starts it</div>
</div>
<Button type="button" variant="ghost" size="icon-sm" aria-label="Close" @click="emit('close')"><X /></Button>
</header>
@@ -202,7 +201,7 @@ function setNeeds(next: { captures?: boolean; gate_retries?: number }): void {
</div>
</li>
</ul>
<p v-else class="text-xs text-fg-subtle">Nothing starts it automatically. Run it by hand, or bind an event.</p>
<p v-else class="text-xs text-fg-subtle">Nothing starts it automatically.</p>
</section>
</div>
</template>