aegisone 1.0.66 → 1.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # AEGISONE
2
2
 
3
- Product version: **1.0.66**
3
+ Product version: **1.0.67**
4
4
 
5
5
  One product, two faces: the terminal (`aegiscode`) and the window (`aegis-desktop`),
6
6
  reached through one command — `aegis` — and released as one version.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aegisone",
3
3
  "productName": "AEGISONE",
4
- "version": "1.0.66",
4
+ "version": "1.0.67",
5
5
  "description": "AEGISONE — one product, two faces. `aegis` opens the window when there is nothing else to do and runs the terminal otherwise; `aegiscode` keeps behaving exactly as it always has.",
6
6
  "author": {
7
7
  "name": "AEGIS Code",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aegiscode",
3
3
  "productName": "AEGIS Code",
4
- "version": "7.0.58",
4
+ "version": "7.0.59",
5
5
  "description": "aegiscode — the command-line version of AEGIS One. The shared tool surface in your shell, over the same thin transport and tool registry as the MCP plugin and the desktop app. Ships transport + UI only; no brain.",
6
6
  "author": {
7
7
  "name": "AEGIS Code",
@@ -1,3 +1,3 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
- "use strict";const ANSI_RE=/\x1b\[[0-9;]*[A-Za-z]/g,{caps:caps,cellWidth:cellWidth}=require("./caps.js"),cwidth=t=>cellWidth(t);function stripAnsi(t){return String(t).replace(ANSI_RE,"")}function w(t){let e=0;for(const o of stripAnsi(t))e+=cwidth(o);return e}function clip(t,e){if(w(t)<=e)return t;let o="",i=0;for(const n of String(t)){const t=cwidth(n);if(i+t>e)break;o+=n,i+=t}return o}function pad(t,e){const o=clip(t,e);return o+" ".repeat(Math.max(0,e-w(o)))}function padStart(t,e){const o=clip(t,e);return" ".repeat(Math.max(0,e-w(o)))+o}function span(t,e){return{t:e,s:t,w:w(e)}}const lineWidth=t=>t.reduce((t,e)=>t+e.w,0);function padLine(t,e){let o=0;const i=[];for(const n of t){if(o>=e)break;let t=n.t,s=n.w;if(o+s>e){const i=e-o;let n="",r=0;for(const e of[...t]){const t=w(e);if(r+t>i)break;n+=e,r+=t}t=n,s=r}i.push({t:t,s:n.s,w:s}),o+=s}return o<e&&i.push(span(""," ".repeat(e-o))),i}const getSize=()=>{const t=caps();return{cols:t.cols,rows:t.rows}};function wrapLine(t,e,o=""){const i=Math.max(8,e);if(w(t)<=i)return[t];const n=t.split(" "),s=[];let r="";for(const t of n){const e=r?`${r} ${t}`:t;if(w(e)<=i){r=e;continue}if(r&&s.push(r),w(t)<=i){r=t;continue}let o=t;for(;w(o)>i;){const t=clip(o,i);s.push(t),o=o.slice(t.length)}r=o}return!r&&s.length||s.push(r),s}function wrapBlock(t,e,o="",i=!1){const n=[];for(const i of String(t).split("\n"))""!==i?wrapLine(i,e-w(o)).forEach(t=>n.push(o+t)):n.push("");return n}const ESC={hideCursor:"[?25l",showCursor:"[?25h",clearToEnd:"",clearLine:"",clearScreen:"",up:t=>t>0?`[${t}A`:"",down:t=>t>0?`[${t}B`:"",col:t=>`[${t}G`},hideCursor=()=>process.stdout.write("[?25l"),showCursor=()=>process.stdout.write("[?25h"),moveTo=(t,e)=>process.stdout.write(`[${t};${e}H`);function clearScreen(){process.stdout.write("")}let inAlt=!1;function enterAltScreen(){inAlt||(inAlt=!0,process.stdout.write("[?1049h"))}function leaveAltScreen(){inAlt&&(inAlt=!1,process.stdout.write("[?1049l"),flushExitNotice())}let exitNotice=null;function queueExitNotice(t){exitNotice=t}function flushExitNotice(){if(null===exitNotice)return;const t=exitNotice;exitNotice=null,process.stdout.write(t)}const hasExitNotice=()=>null!==exitNotice,isAltScreen=()=>inAlt,enableBracketedPaste=()=>process.stdout.write("[?2004h"),disableBracketedPaste=()=>process.stdout.write("[?2004l"),enableMouseTracking=()=>process.stdout.write("[?1000h[?1002h[?1006h"),disableMouseTracking=()=>process.stdout.write("[?1000l[?1002l[?1006l"),SELECT_ON="",SELECT_OFF="";function selectionRange(t,e){return t.row<e.row||t.row===e.row&&t.col<=e.col?{startRow:t.row,startCol:t.col,endRow:e.row,endCol:e.col}:{startRow:e.row,startCol:e.col,endRow:t.row,endCol:t.col}}function sliceLine(t,e,o){const i=[];let n=0;for(const s of t){const t=n;if(n+=s.w,n<=e||t>=o)continue;let r=s.t,c=t;if(c<e){const t=e-c;let o=0,i=0;for(const e of r){if(o>=t)break;o+=w(e),i+=e.length}r=r.slice(i),c+=o}if(c+w(r)>o){let t=0,e="";for(const i of r){const n=w(i);if(c+t+n>o)break;e+=i,t+=n}r=e}r&&i.push({t:r,s:s.s,w:w(r)})}return i}function selectionText(t,e){const o=[];for(let i=e.startRow;i<=e.endRow;i++){const n=t[i]||[],s=i===e.startRow?e.startCol:0,r=i===e.endRow?e.endCol:1/0;o.push(sliceLine(n,s,r).map(t=>t.t).join("").replace(/[ \t]+$/,""))}for(;o.length&&""===o[0];)o.shift();for(;o.length&&""===o[o.length-1];)o.pop();return o.join("\n")}function applySelection(t,e,o){const i=t.slice();for(let t=e.startRow;t<=e.endRow;t++){if(t<0||t>=i.length)continue;const n=padLine(i[t]||[],o),s=t===e.startRow?e.startCol:0,r=t===e.endRow?e.endCol:o,c=sliceLine(n,s,r);c.length&&(i[t]=[...sliceLine(n,0,s),{t:"",s:"",w:0},...c,{t:"",s:"",w:0},...sliceLine(n,r,o)])}return i}function paint(t){const{rows:e,cols:o}=getSize();let i="";for(let n=0;n<e;n++){i+="";const s=t[n];if(s){const t=padLine(s,o);for(const e of t)i+=e.s+e.t;i+=""}else i+="";n<e-1&&(i+="\n")}i+="",process.stdout.write(i)}function paintFrom(t,e){const{rows:o,cols:i}=getSize();let n="";for(let s=0;s<o-e;s++){const o=t[e+s];if(s>0&&(n+="\n"),n+="",n+="",o){const t=padLine(o,i);for(const e of t)n+=e.s+e.t}}n+="",process.stdout.write(n)}function termWidth(t=80){const{cols:e}=getSize();return e>0?e:Math.max(20,t)}class LiveRegion{constructor(t=process.stdout){this.out=t,this.rows=0,this.active=!1}update(t){const e=t.map(t=>t+ESC.clearToEnd).join("\n");this.active?this.out.write(ESC.col(1)+ESC.up(this.rows)+e+"\n"+ESC.col(1)+ESC.up(1)):(this.out.write(e),this.active=!0);const o=Math.max(1,getSize().cols);this.rows=t.reduce((t,e)=>t+Math.max(1,Math.ceil(w(e)/o)),0)}clear(){if(this.active){this.out.write(ESC.col(1)+ESC.clearLine);for(let t=1;t<this.rows;t++)this.out.write(`\n${ESC.clearLine}`);this.out.write(ESC.up(this.rows-1)+ESC.col(1)),this.rows=0,this.active=!1}}}module.exports={queueExitNotice:queueExitNotice,flushExitNotice:flushExitNotice,hasExitNotice:hasExitNotice,w:w,clip:clip,pad:pad,padStart:padStart,stripAnsi:stripAnsi,wrapLine:wrapLine,wrapBlock:wrapBlock,span:span,lineWidth:lineWidth,padLine:padLine,paint:paint,paintFrom:paintFrom,getSize:getSize,EC:ESC,hideCursor:hideCursor,showCursor:showCursor,moveTo:moveTo,clearScreen:clearScreen,enterAltScreen:enterAltScreen,leaveAltScreen:leaveAltScreen,isAltScreen:isAltScreen,enableBracketedPaste:enableBracketedPaste,disableBracketedPaste:disableBracketedPaste,enableMouseTracking:enableMouseTracking,disableMouseTracking:disableMouseTracking,SELECT_ON:"",SELECT_OFF:"",selectionRange:selectionRange,sliceLine:sliceLine,selectionText:selectionText,applySelection:applySelection,LiveRegion:LiveRegion,termWidth:termWidth};
3
+ "use strict";const ANSI_RE=/\x1b\[[0-9;]*[A-Za-z]/g,{caps:caps,cellWidth:cellWidth}=require("./caps.js"),cwidth=t=>cellWidth(t);function stripAnsi(t){return String(t).replace(ANSI_RE,"")}function w(t){let e=0;for(const o of stripAnsi(t))e+=cwidth(o);return e}function clip(t,e){if(w(t)<=e)return t;let o="",n=0;for(const i of String(t)){const t=cwidth(i);if(n+t>e)break;o+=i,n+=t}return o}function pad(t,e){const o=clip(t,e);return o+" ".repeat(Math.max(0,e-w(o)))}function padStart(t,e){const o=clip(t,e);return" ".repeat(Math.max(0,e-w(o)))+o}function span(t,e){return{t:e,s:t,w:w(e)}}const lineWidth=t=>t.reduce((t,e)=>t+e.w,0);function padLine(t,e){let o=0;const n=[];for(const i of t){if(o>=e)break;let t=i.t,s=i.w;if(o+s>e){const n=e-o;let i="",r=0;for(const e of[...t]){const t=w(e);if(r+t>n)break;i+=e,r+=t}t=i,s=r}n.push({t:t,s:i.s,w:s}),o+=s}return o<e&&n.push(span(""," ".repeat(e-o))),n}const getSize=()=>{const t=caps();return{cols:t.cols,rows:t.rows}};function wrapLine(t,e,o=""){const n=Math.max(8,e);if(w(t)<=n)return[t];const i=t.split(" "),s=[];let r="";for(const t of i){const e=r?`${r} ${t}`:t;if(w(e)<=n){r=e;continue}if(r&&s.push(r),w(t)<=n){r=t;continue}let o=t;for(;w(o)>n;){const t=clip(o,n);s.push(t),o=o.slice(t.length)}r=o}return!r&&s.length||s.push(r),s}function wrapBlock(t,e,o="",n=!1){const i=[];for(const n of String(t).split("\n"))""!==n?wrapLine(n,e-w(o)).forEach(t=>i.push(o+t)):i.push("");return i}const ESC={hideCursor:"[?25l",showCursor:"[?25h",clearToEnd:"",clearLine:"",clearScreen:"",up:t=>t>0?`[${t}A`:"",down:t=>t>0?`[${t}B`:"",col:t=>`[${t}G`,eraseDown:""},hideCursor=()=>process.stdout.write("[?25l"),showCursor=()=>process.stdout.write("[?25h"),moveTo=(t,e)=>process.stdout.write(`[${t};${e}H`);function clearScreen(){process.stdout.write("")}let inAlt=!1;function enterAltScreen(){inAlt||(inAlt=!0,process.stdout.write("[?1049h"))}function leaveAltScreen(){inAlt&&(inAlt=!1,process.stdout.write("[?1049l"),flushExitNotice())}let exitNotice=null;function queueExitNotice(t){exitNotice=t}function flushExitNotice(){if(null===exitNotice)return;const t=exitNotice;exitNotice=null,process.stdout.write(t)}const hasExitNotice=()=>null!==exitNotice,isAltScreen=()=>inAlt,enableBracketedPaste=()=>process.stdout.write("[?2004h"),disableBracketedPaste=()=>process.stdout.write("[?2004l"),enableMouseTracking=()=>process.stdout.write("[?1000h[?1002h[?1006h"),disableMouseTracking=()=>process.stdout.write("[?1000l[?1002l[?1006l"),SELECT_ON="",SELECT_OFF="";function selectionRange(t,e){return t.row<e.row||t.row===e.row&&t.col<=e.col?{startRow:t.row,startCol:t.col,endRow:e.row,endCol:e.col}:{startRow:e.row,startCol:e.col,endRow:t.row,endCol:t.col}}function sliceLine(t,e,o){const n=[];let i=0;for(const s of t){const t=i;if(i+=s.w,i<=e||t>=o)continue;let r=s.t,c=t;if(c<e){const t=e-c;let o=0,n=0;for(const e of r){if(o>=t)break;o+=w(e),n+=e.length}r=r.slice(n),c+=o}if(c+w(r)>o){let t=0,e="";for(const n of r){const i=w(n);if(c+t+i>o)break;e+=n,t+=i}r=e}r&&n.push({t:r,s:s.s,w:w(r)})}return n}function selectionText(t,e){const o=[];for(let n=e.startRow;n<=e.endRow;n++){const i=t[n]||[],s=n===e.startRow?e.startCol:0,r=n===e.endRow?e.endCol:1/0;o.push(sliceLine(i,s,r).map(t=>t.t).join("").replace(/[ \t]+$/,""))}for(;o.length&&""===o[0];)o.shift();for(;o.length&&""===o[o.length-1];)o.pop();return o.join("\n")}function applySelection(t,e,o){const n=t.slice();for(let t=e.startRow;t<=e.endRow;t++){if(t<0||t>=n.length)continue;const i=padLine(n[t]||[],o),s=t===e.startRow?e.startCol:0,r=t===e.endRow?e.endCol:o,c=sliceLine(i,s,r);c.length&&(n[t]=[...sliceLine(i,0,s),{t:"",s:"",w:0},...c,{t:"",s:"",w:0},...sliceLine(i,r,o)])}return n}function paint(t){const{rows:e,cols:o}=getSize();let n="";for(let i=0;i<e;i++){n+="";const s=t[i];if(s){const t=padLine(s,o);for(const e of t)n+=e.s+e.t;n+=""}else n+="";i<e-1&&(n+="\n")}n+="",process.stdout.write(n)}function paintFrom(t,e){const{rows:o,cols:n}=getSize();let i="";for(let s=0;s<o-e;s++){const o=t[e+s];if(s>0&&(i+="\n"),i+="",i+="",o){const t=padLine(o,n);for(const e of t)i+=e.s+e.t}}i+="",process.stdout.write(i)}function termWidth(t=80){const{cols:e}=getSize();return e>0?e:Math.max(20,t)}class LiveRegion{constructor(t=process.stdout){this.out=t,this.rows=0,this.active=!1}update(t){const e=Math.max(1,getSize().cols),o=t.reduce((t,o)=>t+Math.max(1,Math.ceil(w(o)/e)),0),n=t.map(t=>ESC.col(1)+t+ESC.clearToEnd).join("\n");this.active?this.out.write(ESC.col(1)+ESC.up(this.rows-1)+ESC.eraseDown+n):(this.out.write(n),this.active=!0),this.rows=o}clear(){this.active&&(this.out.write(ESC.col(1)+ESC.up(this.rows-1)+ESC.eraseDown),this.rows=0,this.active=!1)}}module.exports={queueExitNotice:queueExitNotice,flushExitNotice:flushExitNotice,hasExitNotice:hasExitNotice,w:w,clip:clip,pad:pad,padStart:padStart,stripAnsi:stripAnsi,wrapLine:wrapLine,wrapBlock:wrapBlock,span:span,lineWidth:lineWidth,padLine:padLine,paint:paint,paintFrom:paintFrom,getSize:getSize,EC:ESC,hideCursor:hideCursor,showCursor:showCursor,moveTo:moveTo,clearScreen:clearScreen,enterAltScreen:enterAltScreen,leaveAltScreen:leaveAltScreen,isAltScreen:isAltScreen,enableBracketedPaste:enableBracketedPaste,disableBracketedPaste:disableBracketedPaste,enableMouseTracking:enableMouseTracking,disableMouseTracking:disableMouseTracking,SELECT_ON:"",SELECT_OFF:"",selectionRange:selectionRange,sliceLine:sliceLine,selectionText:selectionText,applySelection:applySelection,LiveRegion:LiveRegion,termWidth:termWidth};
@@ -2,7 +2,7 @@
2
2
  "name": "aegis-desktop",
3
3
  "productName": "aegis one",
4
4
  "desktopName": "aegis-desktop",
5
- "version": "1.0.58",
5
+ "version": "1.0.59",
6
6
  "description": "Thin Electron host for AEGIS — a local chat UI over the shared client/aegis.js transport. Ships transport + UI only; engine logic stays server-side.",
7
7
  "author": {
8
8
  "name": "AEGIS Code",
@@ -1,3 +1,3 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
- "use strict";const ptyWinSessions=new Map;let ptyWinNextLabel=1,ptyWinActive=null;function ptyWinId(){return window.crypto&&"function"==typeof window.crypto.randomUUID?window.crypto.randomUUID():`pty-${Date.now()}-${Math.random().toString(36).slice(2)}`}function ptyWinFit(t,e){const n=t&&t._core,i=n&&n._renderService&&n._renderService.dimensions&&n._renderService.dimensions.css.cell;if(!i||!i.width||!i.height)return null;const o=Math.max(2,Math.floor(e.clientWidth/i.width)),s=Math.max(1,Math.floor(e.clientHeight/i.height));return o===t.cols&&s===t.rows||t.resize(o,s),{cols:o,rows:s}}function ptyWinFontFamily(){return getComputedStyle(document.documentElement).getPropertyValue("--font-mono").trim()||"ui-monospace, SFMono-Regular, Menlo, monospace"}function ptyWinActivate(t){if(t&&!t.closed){for(const e of ptyWinSessions.values()){const n=e===t;e.slot&&(e.slot.hidden=!n),e.tab&&(e.tab.classList.toggle("is-active",n),e.tab.setAttribute("aria-selected",n?"true":"false"))}ptyWinActive=t.id,t.term&&t.slot&&ptyWinFit(t.term,t.slot),t.term&&t.term.focus()}}function ptyWinTeardown(t){if(t){t.closed=!0;try{t.unsubscribe&&t.unsubscribe()}catch{}try{t.ro&&t.ro.disconnect()}catch{}try{window.aegis.pty.cancel(t.id)}catch{}if(ptyWinSessions.delete(t.id),t.tab&&t.tab.remove&&t.tab.remove(),t.slot&&t.slot.remove&&t.slot.remove(),ptyWinActive===t.id){const t=ptyWinSessions.values().next().value||null;ptyWinActive=null,t&&ptyWinActivate(t)}}}function ptyWinClose(t){const e=t?ptyWinSessions.get(t):ptyWinActive&&ptyWinSessions.get(ptyWinActive);e&&ptyWinTeardown(e),0===ptyWinSessions.size&&window.aegis&&"function"==typeof window.aegis.closePtyWindow&&window.aegis.closePtyWindow()}function ptyWinFail(t,e){const n=document.createElement("div");n.className="pty-win-note",n.textContent=e,t.slot&&t.slot.appendChild(n)}function ptyWinStart(){if("undefined"==typeof window||!window.aegis||!window.aegis.pty)return document.getElementById("pty-win-body").innerHTML='<div class="pty-win-note">the terminal bridge is not available in this build</div>',null;if("function"!=typeof window.Terminal)return document.getElementById("pty-win-body").innerHTML='<div class="pty-win-note">xterm.js is missing from this build — the terminal cannot render</div>',null;const t=document.getElementById("pty-win-tabs"),e=document.getElementById("pty-win-body"),n=ptyWinId(),i=String(ptyWinNextLabel++),o=document.createElement("button");o.type="button",o.className="pty-win-tab",o.setAttribute("role","tab"),o.textContent=i,o.title=`Terminal ${i} — click to switch, middle-click to close`;const s=document.createElement("div");s.className="pty-win-slot",s.hidden=!0;const r={id:n,label:i,tab:o,slot:s,term:null,unsubscribe:null,ro:null,closed:!1};ptyWinSessions.set(n,r),o.addEventListener("click",()=>ptyWinActivate(r)),o.addEventListener("auxclick",t=>{1===t.button&&(t.preventDefault(),ptyWinClose(n))}),t.appendChild(o),e.appendChild(s);const c=new window.Terminal({convertEol:!0,cursorBlink:!0,fontSize:13,fontFamily:ptyWinFontFamily(),allowProposedApi:!0});return r.term=c,c.open(s),ptyWinFit(c,s),r.unsubscribe=window.aegis.pty.onEvent(n,t=>{const e=t&&t.p;e&&("data"===e.kind?c.write(e.chunk):"exit"===e.kind&&c.write("\r\n[process exited]\r\n"))}),"function"==typeof ResizeObserver&&(r.ro=new ResizeObserver(()=>ptyWinFit(c,s)),r.ro.observe(s)),c.onData(t=>window.aegis.pty.write(n,t)),c.onResize(({cols:t,rows:e})=>window.aegis.pty.resize(n,t,e)),window.aegis.pty.exec(n,{cols:c.cols,rows:c.rows}).then(t=>{t&&t.ok||c.write(`\r\n[could not start: ${t&&t.e&&t.e.msg||"unknown error"}]\r\n`)}),ptyWinActivate(r),r}window.addEventListener("DOMContentLoaded",()=>{const t=document.getElementById("pty-win-new");t&&t.addEventListener("click",()=>ptyWinStart()),window.addEventListener("keydown",t=>{t.ctrlKey&&t.shiftKey&&("T"===t.key||"t"===t.key)?(t.preventDefault(),ptyWinStart()):t.ctrlKey&&t.shiftKey&&("W"===t.key||"w"===t.key)&&(t.preventDefault(),ptyWinClose())}),ptyWinStart()}),window.aegisPtyWindow={start:ptyWinStart,close:ptyWinClose,count:()=>ptyWinSessions.size,active:()=>ptyWinActive};
3
+ "use strict";const ptyWinSessions=new Map;let ptyWinNextLabel=1,ptyWinActive=null;function ptyWinId(){return window.crypto&&"function"==typeof window.crypto.randomUUID?window.crypto.randomUUID():`pty-${Date.now()}-${Math.random().toString(36).slice(2)}`}let ptyWinFitting=null;function ptyWinFit(t,e){const n=t&&t._core,i=n&&n._renderService&&n._renderService.dimensions&&n._renderService.dimensions.css.cell;if(!i||!i.width||!i.height)return null;const o=Math.max(2,Math.floor(e.clientWidth/i.width)),s=Math.max(1,Math.floor(e.clientHeight/i.height));if(o!==t.cols||s!==t.rows){ptyWinFitting=t;try{t.resize(o,s)}finally{ptyWinFitting=null}}return{cols:o,rows:s}}function ptyWinFontFamily(){return getComputedStyle(document.documentElement).getPropertyValue("--font-mono").trim()||"ui-monospace, SFMono-Regular, Menlo, monospace"}function ptyWinActivate(t){if(t&&!t.closed){for(const e of ptyWinSessions.values()){const n=e===t;e.slot&&(e.slot.hidden=!n),e.tab&&(e.tab.classList.toggle("is-active",n),e.tab.setAttribute("aria-selected",n?"true":"false"))}if(ptyWinActive=t.id,t.term&&t.slot){const e=t.term,n=t.slot;requestAnimationFrame(()=>{t.closed||ptyWinFit(e,n)})}t.term&&t.term.focus()}}function ptyWinTeardown(t){if(t){t.closed=!0;try{t.unsubscribe&&t.unsubscribe()}catch{}try{t.ro&&t.ro.disconnect()}catch{}try{window.aegis.pty.cancel(t.id)}catch{}if(ptyWinSessions.delete(t.id),t.tab&&t.tab.remove&&t.tab.remove(),t.slot&&t.slot.remove&&t.slot.remove(),ptyWinActive===t.id){const t=ptyWinSessions.values().next().value||null;ptyWinActive=null,t&&ptyWinActivate(t)}}}function ptyWinClose(t){const e=t?ptyWinSessions.get(t):ptyWinActive&&ptyWinSessions.get(ptyWinActive);e&&ptyWinTeardown(e),0===ptyWinSessions.size&&window.aegis&&"function"==typeof window.aegis.closePtyWindow&&window.aegis.closePtyWindow()}function ptyWinFail(t,e){const n=document.createElement("div");n.className="pty-win-note",n.textContent=e,t.slot&&t.slot.appendChild(n)}function ptyWinStart(){if("undefined"==typeof window||!window.aegis||!window.aegis.pty)return document.getElementById("pty-win-body").innerHTML='<div class="pty-win-note">the terminal bridge is not available in this build</div>',null;if("function"!=typeof window.Terminal)return document.getElementById("pty-win-body").innerHTML='<div class="pty-win-note">xterm.js is missing from this build — the terminal cannot render</div>',null;const t=document.getElementById("pty-win-tabs"),e=document.getElementById("pty-win-body"),n=ptyWinId(),i=String(ptyWinNextLabel++),o=document.createElement("button");o.type="button",o.className="pty-win-tab",o.setAttribute("role","tab"),o.textContent=i,o.title=`Terminal ${i} — click to switch, middle-click to close`;const s=document.createElement("div");s.className="pty-win-slot",s.hidden=!0;const r={id:n,label:i,tab:o,slot:s,term:null,unsubscribe:null,ro:null,closed:!1};ptyWinSessions.set(n,r),o.addEventListener("click",()=>ptyWinActivate(r)),o.addEventListener("auxclick",t=>{1===t.button&&(t.preventDefault(),ptyWinClose(n))}),t.appendChild(o),e.appendChild(s);const l=new window.Terminal({convertEol:!0,cursorBlink:!1,fontSize:13,fontFamily:ptyWinFontFamily(),allowProposedApi:!0});return r.term=l,l.open(s),ptyWinFit(l,s),r.unsubscribe=window.aegis.pty.onEvent(n,t=>{const e=t&&t.p;e&&("data"===e.kind?l.write(e.chunk):"exit"===e.kind&&l.write("\r\n[process exited]\r\n"))}),"function"==typeof ResizeObserver&&(r.ro=new ResizeObserver(()=>{ptyWinFitting!==l&&ptyWinFit(l,s)}),r.ro.observe(e)),l.onData(t=>window.aegis.pty.write(n,t)),l.onResize(({cols:t,rows:e})=>window.aegis.pty.resize(n,t,e)),window.aegis.pty.exec(n,{cols:l.cols,rows:l.rows}).then(t=>{t&&t.ok||l.write(`\r\n[could not start: ${t&&t.e&&t.e.msg||"unknown error"}]\r\n`)}),ptyWinActivate(r),r}window.addEventListener("DOMContentLoaded",()=>{const t=document.getElementById("pty-win-new");t&&t.addEventListener("click",()=>ptyWinStart()),window.addEventListener("keydown",t=>{t.ctrlKey&&t.shiftKey&&("T"===t.key||"t"===t.key)?(t.preventDefault(),ptyWinStart()):t.ctrlKey&&t.shiftKey&&("W"===t.key||"w"===t.key)&&(t.preventDefault(),ptyWinClose())}),ptyWinStart()}),window.aegisPtyWindow={start:ptyWinStart,close:ptyWinClose,count:()=>ptyWinSessions.size,active:()=>ptyWinActive};
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aegiscode",
3
3
  "productName": "AEGIS Code",
4
- "version": "7.0.58",
4
+ "version": "7.0.59",
5
5
  "description": "aegiscode — the command-line version of AEGIS One. The shared tool surface in your shell, over the same thin transport and tool registry as the MCP plugin and the desktop app. Ships transport + UI only; no brain.",
6
6
  "author": {
7
7
  "name": "AEGIS Code",
@@ -1,3 +1,3 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  // Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
3
- "use strict";const ANSI_RE=/\x1b\[[0-9;]*[A-Za-z]/g,{caps:caps,cellWidth:cellWidth}=require("./caps.js"),cwidth=t=>cellWidth(t);function stripAnsi(t){return String(t).replace(ANSI_RE,"")}function w(t){let e=0;for(const o of stripAnsi(t))e+=cwidth(o);return e}function clip(t,e){if(w(t)<=e)return t;let o="",i=0;for(const n of String(t)){const t=cwidth(n);if(i+t>e)break;o+=n,i+=t}return o}function pad(t,e){const o=clip(t,e);return o+" ".repeat(Math.max(0,e-w(o)))}function padStart(t,e){const o=clip(t,e);return" ".repeat(Math.max(0,e-w(o)))+o}function span(t,e){return{t:e,s:t,w:w(e)}}const lineWidth=t=>t.reduce((t,e)=>t+e.w,0);function padLine(t,e){let o=0;const i=[];for(const n of t){if(o>=e)break;let t=n.t,s=n.w;if(o+s>e){const i=e-o;let n="",r=0;for(const e of[...t]){const t=w(e);if(r+t>i)break;n+=e,r+=t}t=n,s=r}i.push({t:t,s:n.s,w:s}),o+=s}return o<e&&i.push(span(""," ".repeat(e-o))),i}const getSize=()=>{const t=caps();return{cols:t.cols,rows:t.rows}};function wrapLine(t,e,o=""){const i=Math.max(8,e);if(w(t)<=i)return[t];const n=t.split(" "),s=[];let r="";for(const t of n){const e=r?`${r} ${t}`:t;if(w(e)<=i){r=e;continue}if(r&&s.push(r),w(t)<=i){r=t;continue}let o=t;for(;w(o)>i;){const t=clip(o,i);s.push(t),o=o.slice(t.length)}r=o}return!r&&s.length||s.push(r),s}function wrapBlock(t,e,o="",i=!1){const n=[];for(const i of String(t).split("\n"))""!==i?wrapLine(i,e-w(o)).forEach(t=>n.push(o+t)):n.push("");return n}const ESC={hideCursor:"[?25l",showCursor:"[?25h",clearToEnd:"",clearLine:"",clearScreen:"",up:t=>t>0?`[${t}A`:"",down:t=>t>0?`[${t}B`:"",col:t=>`[${t}G`},hideCursor=()=>process.stdout.write("[?25l"),showCursor=()=>process.stdout.write("[?25h"),moveTo=(t,e)=>process.stdout.write(`[${t};${e}H`);function clearScreen(){process.stdout.write("")}let inAlt=!1;function enterAltScreen(){inAlt||(inAlt=!0,process.stdout.write("[?1049h"))}function leaveAltScreen(){inAlt&&(inAlt=!1,process.stdout.write("[?1049l"),flushExitNotice())}let exitNotice=null;function queueExitNotice(t){exitNotice=t}function flushExitNotice(){if(null===exitNotice)return;const t=exitNotice;exitNotice=null,process.stdout.write(t)}const hasExitNotice=()=>null!==exitNotice,isAltScreen=()=>inAlt,enableBracketedPaste=()=>process.stdout.write("[?2004h"),disableBracketedPaste=()=>process.stdout.write("[?2004l"),enableMouseTracking=()=>process.stdout.write("[?1000h[?1002h[?1006h"),disableMouseTracking=()=>process.stdout.write("[?1000l[?1002l[?1006l"),SELECT_ON="",SELECT_OFF="";function selectionRange(t,e){return t.row<e.row||t.row===e.row&&t.col<=e.col?{startRow:t.row,startCol:t.col,endRow:e.row,endCol:e.col}:{startRow:e.row,startCol:e.col,endRow:t.row,endCol:t.col}}function sliceLine(t,e,o){const i=[];let n=0;for(const s of t){const t=n;if(n+=s.w,n<=e||t>=o)continue;let r=s.t,c=t;if(c<e){const t=e-c;let o=0,i=0;for(const e of r){if(o>=t)break;o+=w(e),i+=e.length}r=r.slice(i),c+=o}if(c+w(r)>o){let t=0,e="";for(const i of r){const n=w(i);if(c+t+n>o)break;e+=i,t+=n}r=e}r&&i.push({t:r,s:s.s,w:w(r)})}return i}function selectionText(t,e){const o=[];for(let i=e.startRow;i<=e.endRow;i++){const n=t[i]||[],s=i===e.startRow?e.startCol:0,r=i===e.endRow?e.endCol:1/0;o.push(sliceLine(n,s,r).map(t=>t.t).join("").replace(/[ \t]+$/,""))}for(;o.length&&""===o[0];)o.shift();for(;o.length&&""===o[o.length-1];)o.pop();return o.join("\n")}function applySelection(t,e,o){const i=t.slice();for(let t=e.startRow;t<=e.endRow;t++){if(t<0||t>=i.length)continue;const n=padLine(i[t]||[],o),s=t===e.startRow?e.startCol:0,r=t===e.endRow?e.endCol:o,c=sliceLine(n,s,r);c.length&&(i[t]=[...sliceLine(n,0,s),{t:"",s:"",w:0},...c,{t:"",s:"",w:0},...sliceLine(n,r,o)])}return i}function paint(t){const{rows:e,cols:o}=getSize();let i="";for(let n=0;n<e;n++){i+="";const s=t[n];if(s){const t=padLine(s,o);for(const e of t)i+=e.s+e.t;i+=""}else i+="";n<e-1&&(i+="\n")}i+="",process.stdout.write(i)}function paintFrom(t,e){const{rows:o,cols:i}=getSize();let n="";for(let s=0;s<o-e;s++){const o=t[e+s];if(s>0&&(n+="\n"),n+="",n+="",o){const t=padLine(o,i);for(const e of t)n+=e.s+e.t}}n+="",process.stdout.write(n)}function termWidth(t=80){const{cols:e}=getSize();return e>0?e:Math.max(20,t)}class LiveRegion{constructor(t=process.stdout){this.out=t,this.rows=0,this.active=!1}update(t){const e=t.map(t=>t+ESC.clearToEnd).join("\n");this.active?this.out.write(ESC.col(1)+ESC.up(this.rows)+e+"\n"+ESC.col(1)+ESC.up(1)):(this.out.write(e),this.active=!0);const o=Math.max(1,getSize().cols);this.rows=t.reduce((t,e)=>t+Math.max(1,Math.ceil(w(e)/o)),0)}clear(){if(this.active){this.out.write(ESC.col(1)+ESC.clearLine);for(let t=1;t<this.rows;t++)this.out.write(`\n${ESC.clearLine}`);this.out.write(ESC.up(this.rows-1)+ESC.col(1)),this.rows=0,this.active=!1}}}module.exports={queueExitNotice:queueExitNotice,flushExitNotice:flushExitNotice,hasExitNotice:hasExitNotice,w:w,clip:clip,pad:pad,padStart:padStart,stripAnsi:stripAnsi,wrapLine:wrapLine,wrapBlock:wrapBlock,span:span,lineWidth:lineWidth,padLine:padLine,paint:paint,paintFrom:paintFrom,getSize:getSize,EC:ESC,hideCursor:hideCursor,showCursor:showCursor,moveTo:moveTo,clearScreen:clearScreen,enterAltScreen:enterAltScreen,leaveAltScreen:leaveAltScreen,isAltScreen:isAltScreen,enableBracketedPaste:enableBracketedPaste,disableBracketedPaste:disableBracketedPaste,enableMouseTracking:enableMouseTracking,disableMouseTracking:disableMouseTracking,SELECT_ON:"",SELECT_OFF:"",selectionRange:selectionRange,sliceLine:sliceLine,selectionText:selectionText,applySelection:applySelection,LiveRegion:LiveRegion,termWidth:termWidth};
3
+ "use strict";const ANSI_RE=/\x1b\[[0-9;]*[A-Za-z]/g,{caps:caps,cellWidth:cellWidth}=require("./caps.js"),cwidth=t=>cellWidth(t);function stripAnsi(t){return String(t).replace(ANSI_RE,"")}function w(t){let e=0;for(const o of stripAnsi(t))e+=cwidth(o);return e}function clip(t,e){if(w(t)<=e)return t;let o="",n=0;for(const i of String(t)){const t=cwidth(i);if(n+t>e)break;o+=i,n+=t}return o}function pad(t,e){const o=clip(t,e);return o+" ".repeat(Math.max(0,e-w(o)))}function padStart(t,e){const o=clip(t,e);return" ".repeat(Math.max(0,e-w(o)))+o}function span(t,e){return{t:e,s:t,w:w(e)}}const lineWidth=t=>t.reduce((t,e)=>t+e.w,0);function padLine(t,e){let o=0;const n=[];for(const i of t){if(o>=e)break;let t=i.t,s=i.w;if(o+s>e){const n=e-o;let i="",r=0;for(const e of[...t]){const t=w(e);if(r+t>n)break;i+=e,r+=t}t=i,s=r}n.push({t:t,s:i.s,w:s}),o+=s}return o<e&&n.push(span(""," ".repeat(e-o))),n}const getSize=()=>{const t=caps();return{cols:t.cols,rows:t.rows}};function wrapLine(t,e,o=""){const n=Math.max(8,e);if(w(t)<=n)return[t];const i=t.split(" "),s=[];let r="";for(const t of i){const e=r?`${r} ${t}`:t;if(w(e)<=n){r=e;continue}if(r&&s.push(r),w(t)<=n){r=t;continue}let o=t;for(;w(o)>n;){const t=clip(o,n);s.push(t),o=o.slice(t.length)}r=o}return!r&&s.length||s.push(r),s}function wrapBlock(t,e,o="",n=!1){const i=[];for(const n of String(t).split("\n"))""!==n?wrapLine(n,e-w(o)).forEach(t=>i.push(o+t)):i.push("");return i}const ESC={hideCursor:"[?25l",showCursor:"[?25h",clearToEnd:"",clearLine:"",clearScreen:"",up:t=>t>0?`[${t}A`:"",down:t=>t>0?`[${t}B`:"",col:t=>`[${t}G`,eraseDown:""},hideCursor=()=>process.stdout.write("[?25l"),showCursor=()=>process.stdout.write("[?25h"),moveTo=(t,e)=>process.stdout.write(`[${t};${e}H`);function clearScreen(){process.stdout.write("")}let inAlt=!1;function enterAltScreen(){inAlt||(inAlt=!0,process.stdout.write("[?1049h"))}function leaveAltScreen(){inAlt&&(inAlt=!1,process.stdout.write("[?1049l"),flushExitNotice())}let exitNotice=null;function queueExitNotice(t){exitNotice=t}function flushExitNotice(){if(null===exitNotice)return;const t=exitNotice;exitNotice=null,process.stdout.write(t)}const hasExitNotice=()=>null!==exitNotice,isAltScreen=()=>inAlt,enableBracketedPaste=()=>process.stdout.write("[?2004h"),disableBracketedPaste=()=>process.stdout.write("[?2004l"),enableMouseTracking=()=>process.stdout.write("[?1000h[?1002h[?1006h"),disableMouseTracking=()=>process.stdout.write("[?1000l[?1002l[?1006l"),SELECT_ON="",SELECT_OFF="";function selectionRange(t,e){return t.row<e.row||t.row===e.row&&t.col<=e.col?{startRow:t.row,startCol:t.col,endRow:e.row,endCol:e.col}:{startRow:e.row,startCol:e.col,endRow:t.row,endCol:t.col}}function sliceLine(t,e,o){const n=[];let i=0;for(const s of t){const t=i;if(i+=s.w,i<=e||t>=o)continue;let r=s.t,c=t;if(c<e){const t=e-c;let o=0,n=0;for(const e of r){if(o>=t)break;o+=w(e),n+=e.length}r=r.slice(n),c+=o}if(c+w(r)>o){let t=0,e="";for(const n of r){const i=w(n);if(c+t+i>o)break;e+=n,t+=i}r=e}r&&n.push({t:r,s:s.s,w:w(r)})}return n}function selectionText(t,e){const o=[];for(let n=e.startRow;n<=e.endRow;n++){const i=t[n]||[],s=n===e.startRow?e.startCol:0,r=n===e.endRow?e.endCol:1/0;o.push(sliceLine(i,s,r).map(t=>t.t).join("").replace(/[ \t]+$/,""))}for(;o.length&&""===o[0];)o.shift();for(;o.length&&""===o[o.length-1];)o.pop();return o.join("\n")}function applySelection(t,e,o){const n=t.slice();for(let t=e.startRow;t<=e.endRow;t++){if(t<0||t>=n.length)continue;const i=padLine(n[t]||[],o),s=t===e.startRow?e.startCol:0,r=t===e.endRow?e.endCol:o,c=sliceLine(i,s,r);c.length&&(n[t]=[...sliceLine(i,0,s),{t:"",s:"",w:0},...c,{t:"",s:"",w:0},...sliceLine(i,r,o)])}return n}function paint(t){const{rows:e,cols:o}=getSize();let n="";for(let i=0;i<e;i++){n+="";const s=t[i];if(s){const t=padLine(s,o);for(const e of t)n+=e.s+e.t;n+=""}else n+="";i<e-1&&(n+="\n")}n+="",process.stdout.write(n)}function paintFrom(t,e){const{rows:o,cols:n}=getSize();let i="";for(let s=0;s<o-e;s++){const o=t[e+s];if(s>0&&(i+="\n"),i+="",i+="",o){const t=padLine(o,n);for(const e of t)i+=e.s+e.t}}i+="",process.stdout.write(i)}function termWidth(t=80){const{cols:e}=getSize();return e>0?e:Math.max(20,t)}class LiveRegion{constructor(t=process.stdout){this.out=t,this.rows=0,this.active=!1}update(t){const e=Math.max(1,getSize().cols),o=t.reduce((t,o)=>t+Math.max(1,Math.ceil(w(o)/e)),0),n=t.map(t=>ESC.col(1)+t+ESC.clearToEnd).join("\n");this.active?this.out.write(ESC.col(1)+ESC.up(this.rows-1)+ESC.eraseDown+n):(this.out.write(n),this.active=!0),this.rows=o}clear(){this.active&&(this.out.write(ESC.col(1)+ESC.up(this.rows-1)+ESC.eraseDown),this.rows=0,this.active=!1)}}module.exports={queueExitNotice:queueExitNotice,flushExitNotice:flushExitNotice,hasExitNotice:hasExitNotice,w:w,clip:clip,pad:pad,padStart:padStart,stripAnsi:stripAnsi,wrapLine:wrapLine,wrapBlock:wrapBlock,span:span,lineWidth:lineWidth,padLine:padLine,paint:paint,paintFrom:paintFrom,getSize:getSize,EC:ESC,hideCursor:hideCursor,showCursor:showCursor,moveTo:moveTo,clearScreen:clearScreen,enterAltScreen:enterAltScreen,leaveAltScreen:leaveAltScreen,isAltScreen:isAltScreen,enableBracketedPaste:enableBracketedPaste,disableBracketedPaste:disableBracketedPaste,enableMouseTracking:enableMouseTracking,disableMouseTracking:disableMouseTracking,SELECT_ON:"",SELECT_OFF:"",selectionRange:selectionRange,sliceLine:sliceLine,selectionText:selectionText,applySelection:applySelection,LiveRegion:LiveRegion,termWidth:termWidth};