aegisone 1.0.80 → 1.0.81
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
package/bin/aegis.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
3
|
// Copyright (C) 2026 Niklas Borneklint — AEGIS Code (aegiscode) / Aegiscloud.
|
|
4
|
-
"use strict";const fs=require("node:fs"),path=require("node:path"),{spawnSync:spawnSync,spawn:spawn}=require("node:child_process"),{decide:decide,FACE:FACE}=require("../src/dispatch.js"),WIN=require("../src/iface/window.js"),probes=require("../src/probes.js"),electronRepair=require("../src/electron-repair.js"),release=require("../src/release.js"),productHelp=require("../src/producthelp.js"),productUpdate=require("../src/productupdate.js"),EXIT_USAGE=2,PRODUCT=require("../package.json");function faceManifestPaths(e,t){const r=t||__dirname;return[path.join(r,"..","vendor",e.dir,"package.json"),path.join(r,"..","..",e.dir,"package.json")]}function readFaceVersions(e){return release.FACE_LINES.map(t=>{for(const r of faceManifestPaths(t,e))try{return{package:t.package,version:JSON.parse(fs.readFileSync(r,"utf8")).version,source:r}}catch{}return{package:t.package,version:null,source:null}})}function write(e,t){try{e.write(t.endsWith("\n")?t:t+"\n")}catch{}}function runUpdate(e,t,r){const n=t||{},{stdout:s,stderr:i,input:o}=r,a=void 0!==n.installed?n.installed:isInstalledLayout(n.binDir),c=n.updatePlan?n.updatePlan():productUpdate.plan({installed:a,env:o&&o.env||{}});if(!c.ok)return write(i,`aegis: ${c.msg}`),2;const d=n.fetchLatest||defaultFetchLatest(n.binDir);return productUpdate.check({current:PRODUCT.version,action:e.action},{fetchImpl:d}).then(t=>{for(const e of t.lines)write(s,e);if("apply"!==e.action)return!0===t.upToDate?0:1;const r=productUpdate.apply(c,t,{runImpl:n.runInstall||defaultRunInstall,spawnSpec:n.spawnSpec||defaultSpawnSpec(n.binDir)});if(r.ok){write(s,r.lines?r.lines[0]:"Installed.");for(const e of String(r.output||"").split("\n").slice(-6))e.trim()&&write(s,` ${e}`);return 0}return r.skipped?(write(s,` ${r.msg}`),!0===t.upToDate?0:1):(write(i,`aegis: ${r.msg||"the install failed"}`),r.error&&write(i,`aegis: ${r.error}`),r.command&&write(i,`aegis: run it yourself: ${r.command}`),3)})}function isInstalledLayout(e){const t=e||__dirname,r=path.join(t,"..");try{return!fs.existsSync(path.join(r,"..","one","package.json"))}catch{return!0}}function defaultFetchLatest(e){const t=e||__dirname,r=path.join(t,".."),n=[path.join(r,"client","update.js"),path.join(r,"vendor","cli","vendor","client","update.js")];for(const e of n)try{const t=require(e);if("function"==typeof t.fetchLatestDetailed)return e=>t.fetchLatestDetailed({...e||{},pkg:productUpdate.PRODUCT_PKG});if("function"==typeof t.fetchLatest)return e=>t.fetchLatest({...e||{},pkg:productUpdate.PRODUCT_PKG})}catch{}return null}function defaultSpawnSpec(e){const t=e||__dirname,r=path.join(t,".."),n=[path.join(r,"client","update.js"),path.join(r,"vendor","cli","vendor","client","update.js")],s={command:"npm",args:["i","-g",`${productUpdate.PRODUCT_PKG}@latest`]};for(const e of n)try{const t=require(e);if("function"==typeof t.installSpawn){const e=t.installSpawn(s,{env:process.env});if(e&&e.command)return e}}catch{}return null}function defaultRunInstall(e){try{const t=spawnSync(e.command,e.args,{encoding:"utf8",timeout:18e4,stdio:["ignore","pipe","pipe"],shell:!0===e.shell,windowsHide:!0});return t.error?{ok:!1,error:String(t.error.message||t.error)}:0!==t.status?{ok:!1,error:String((t.stderr||t.stdout||"").trim()||`exited ${t.status}`)}:{ok:!0,output:String(t.stdout||"")}}catch(e){return{ok:!1,error:String(e&&e.message||e)}}}const WINDOW_STDERR_NOISE=[/libva (error|warning)/i,/^libva:/i,/vaGetDriverNameByIndex|vaInitialize/,/gpu_init\.cc.*Passthrough is not supported/i,/gpu_persistent_cache\.cc.*Persistent cache error/i,/ERROR:gpu\/command_buffer\/service\/gles2_cmd_decoder/,/swiftshader|llvmpipe|MESA-LOADER|libGL error|DRI3|MESA-VULKAN/i,/^MESA-(VOID|DRI|LOADER)/,/vulkan.*(incomplete|not supported|failed)/i];function forwardWindowStderr(e,t){let r="";e.setEncoding("utf8"),e.on("data",e=>{r+=e;const n=r.split("\n");r=n.pop()||"";for(const e of n)e.trim()&&(WINDOW_STDERR_NOISE.some(t=>t.test(e))||write(t,e))});const n=()=>{r.trim()&&!WINDOW_STDERR_NOISE.some(e=>e.test(r))&&write(t,r),r=""};e.on("end",n),e.on("close",n),e.on("error",()=>{})}function statusOf(e){return"number"==typeof e.status?e.status:"SIGINT"===e.signal?130:"SIGTERM"===e.signal?143:1}function run(e,t){const r=t||{},n=r.stderr||process.stderr,s=r.stdout||process.stdout,i=r.repair||electronRepair.repairElectron;if(!r.input&&"function"==typeof i)try{i({})}catch{}const o=r.input||probes.collect({argv:e}),a=Array.isArray(e)?{...o,argv:e}:o,c=release.versionRequest(a.argv);if(c){const e=c.verbose?r.readFaceVersions?r.readFaceVersions():readFaceVersions(r.binDir):null;return write(s,release.renderVersion({product:{name:PRODUCT.name,version:PRODUCT.version},faces:e})),0}if((r.helpRequest||productHelp.helpRequest)(a.argv))return write(s,productHelp.renderHelp({version:PRODUCT.version})),0;const d=(r.updateRequest||productUpdate.updateRequest)(a.argv);if(d&&"help"===d.action)return write(s,productUpdate.renderUsage(PRODUCT.version)),0;if(d)return runUpdate(d,r,{stdout:s,stderr:n,input:a});const p=(a.argv||[]).indexOf("doctor");if(-1!==p&&!(a.argv||[]).slice(0,p).some(e=>!e.startsWith("-"))){const e=r.doctor||require("../src/doctor.js"),t=Object.assign({env:a.env,stdout:s,electron:a._electron||r.electron||null,appBundle:a._appBundle||r.appBundle||null},r.doctorDeps||{}),n=e.main((a.argv||[]).slice(p+1),t);return"number"==typeof n?n:2}const u=decide(a);if(u.face===FACE.TUI&&!a._cliBin&&!r.cliBin)return write(n,"aegis: the terminal face is not installed beside aegisone."),write(n,"aegis: reinstall aegisone, or set AEGISONE_CLI_BIN to bin/aegiscode.js."),127;const l=r.permissions||require("../src/permissions.js"),f=(a.argv||[]).indexOf(l.SKIP_FLAG||"--dangerously-skip-permissions"),g=Boolean(a.tty&&a.tty.stdin&&a.tty.stdout),m=g?"interactive":"headless",h=r.stored||l.storedPermissionFacts(r.storedOpts||{}),w=l.resolvePosture({rules:void 0!==r.rules?r.rules:h.rules,gate:void 0!==r.gate?r.gate:h.confirmationsOn,permissionMode:void 0!==r.permissionMode?r.permissionMode:h.permissionMode,flag:-1!==f,env:a.env,interactive:g,childKind:m});w.warning&&write(n,`aegis: ${w.warning}`),w.skip&&w.skipFromFlag&&write(n,l.skipReport(w));const v=-1===f?u.args:u.args.filter(e=>e!==(l.SKIP_FLAG||"--dangerously-skip-permissions")),S=w.skipFromFlag?{AEGISONE_SKIP_PERMISSIONS:"1"}:{},I={AEGIS_INSTALL_METHOD:"npm"};if("1"===(a.env||{}).AEGISONE_PRINT_DECISION&&write(n,"aegis: decision "+JSON.stringify({face:u.face,kind:u.kind,reason:u.reason,args:v,skip:w.skip})),null===u.face)return write(n,`aegis: ${u.error}`),u.hint&&write(n,`aegis: ${u.hint}`),u.code||2;u.notice&&write(n,`aegis: ${u.notice} — running the terminal face.`);const _=r.spawnSync||spawnSync,O=r.spawn||spawn,E=Object.assign({},process.env,r.env||{});if(u.face===FACE.TUI){const e=a._cliBin||r.cliBin;return e?statusOf(_(process.execPath,[e,...v],{stdio:"inherit",env:Object.assign({},E,S,I),argv0:"aegiscode"})||{}):(write(n,"aegis: the terminal face is not installed beside aegisone."),write(n,"aegis: reinstall aegisone, or set AEGISONE_CLI_BIN to bin/aegiscode.js."),127)}const y=a._electron||r.electron,R=a._desktopMain||r.desktopMain,k=a._appBundle||r.appBundle||null,j=WIN.plan({decision:u,electron:Boolean(y)||Boolean(k),target:r.target||a.target});if(!j||!R&&!k)return write(n,"aegis: cannot open the window — Electron or the desktop entry point went missing after the check."),write(n,"aegis: Use --tui for the terminal face."),2;delete E.ELECTRON_RUN_AS_NODE;const D=WIN.open(j,{main:R,args:v,env:Object.assign({},E,S,I)},{openElectron:e=>{if(k
|
|
4
|
+
"use strict";const fs=require("node:fs"),path=require("node:path"),{spawnSync:spawnSync,spawn:spawn}=require("node:child_process"),{decide:decide,FACE:FACE}=require("../src/dispatch.js"),WIN=require("../src/iface/window.js"),probes=require("../src/probes.js"),electronRepair=require("../src/electron-repair.js"),release=require("../src/release.js"),productHelp=require("../src/producthelp.js"),productUpdate=require("../src/productupdate.js"),EXIT_USAGE=2,PRODUCT=require("../package.json");function faceManifestPaths(e,t){const r=t||__dirname;return[path.join(r,"..","vendor",e.dir,"package.json"),path.join(r,"..","..",e.dir,"package.json")]}function readFaceVersions(e){return release.FACE_LINES.map(t=>{for(const r of faceManifestPaths(t,e))try{return{package:t.package,version:JSON.parse(fs.readFileSync(r,"utf8")).version,source:r}}catch{}return{package:t.package,version:null,source:null}})}function write(e,t){try{e.write(t.endsWith("\n")?t:t+"\n")}catch{}}function runUpdate(e,t,r){const n=t||{},{stdout:s,stderr:i,input:o}=r,a=void 0!==n.installed?n.installed:isInstalledLayout(n.binDir),c=n.updatePlan?n.updatePlan():productUpdate.plan({installed:a,env:o&&o.env||{}});if(!c.ok)return write(i,`aegis: ${c.msg}`),2;const d=n.fetchLatest||defaultFetchLatest(n.binDir);return productUpdate.check({current:PRODUCT.version,action:e.action},{fetchImpl:d}).then(t=>{for(const e of t.lines)write(s,e);if("apply"!==e.action)return!0===t.upToDate?0:1;const r=productUpdate.apply(c,t,{runImpl:n.runInstall||defaultRunInstall,spawnSpec:n.spawnSpec||defaultSpawnSpec(n.binDir)});if(r.ok){write(s,r.lines?r.lines[0]:"Installed.");for(const e of String(r.output||"").split("\n").slice(-6))e.trim()&&write(s,` ${e}`);return 0}return r.skipped?(write(s,` ${r.msg}`),!0===t.upToDate?0:1):(write(i,`aegis: ${r.msg||"the install failed"}`),r.error&&write(i,`aegis: ${r.error}`),r.command&&write(i,`aegis: run it yourself: ${r.command}`),3)})}function isInstalledLayout(e){const t=e||__dirname,r=path.join(t,"..");try{return!fs.existsSync(path.join(r,"..","one","package.json"))}catch{return!0}}function defaultFetchLatest(e){const t=e||__dirname,r=path.join(t,".."),n=[path.join(r,"client","update.js"),path.join(r,"vendor","cli","vendor","client","update.js")];for(const e of n)try{const t=require(e);if("function"==typeof t.fetchLatestDetailed)return e=>t.fetchLatestDetailed({...e||{},pkg:productUpdate.PRODUCT_PKG});if("function"==typeof t.fetchLatest)return e=>t.fetchLatest({...e||{},pkg:productUpdate.PRODUCT_PKG})}catch{}return null}function defaultSpawnSpec(e){const t=e||__dirname,r=path.join(t,".."),n=[path.join(r,"client","update.js"),path.join(r,"vendor","cli","vendor","client","update.js")],s={command:"npm",args:["i","-g",`${productUpdate.PRODUCT_PKG}@latest`]};for(const e of n)try{const t=require(e);if("function"==typeof t.installSpawn){const e=t.installSpawn(s,{env:process.env});if(e&&e.command)return e}}catch{}return null}function defaultRunInstall(e){try{const t=spawnSync(e.command,e.args,{encoding:"utf8",timeout:18e4,stdio:["ignore","pipe","pipe"],shell:!0===e.shell,windowsHide:!0});return t.error?{ok:!1,error:String(t.error.message||t.error)}:0!==t.status?{ok:!1,error:String((t.stderr||t.stdout||"").trim()||`exited ${t.status}`)}:{ok:!0,output:String(t.stdout||"")}}catch(e){return{ok:!1,error:String(e&&e.message||e)}}}const WINDOW_STDERR_NOISE=[/libva (error|warning)/i,/^libva:/i,/vaGetDriverNameByIndex|vaInitialize/,/gpu_init\.cc.*Passthrough is not supported/i,/gpu_persistent_cache\.cc.*Persistent cache error/i,/ERROR:gpu\/command_buffer\/service\/gles2_cmd_decoder/,/swiftshader|llvmpipe|MESA-LOADER|libGL error|DRI3|MESA-VULKAN/i,/^MESA-(VOID|DRI|LOADER)/,/vulkan.*(incomplete|not supported|failed)/i];function forwardWindowStderr(e,t){let r="";e.setEncoding("utf8"),e.on("data",e=>{r+=e;const n=r.split("\n");r=n.pop()||"";for(const e of n)e.trim()&&(WINDOW_STDERR_NOISE.some(t=>t.test(e))||write(t,e))});const n=()=>{r.trim()&&!WINDOW_STDERR_NOISE.some(e=>e.test(r))&&write(t,r),r=""};e.on("end",n),e.on("close",n),e.on("error",()=>{})}function statusOf(e){return"number"==typeof e.status?e.status:"SIGINT"===e.signal?130:"SIGTERM"===e.signal?143:1}function run(e,t){const r=t||{},n=r.stderr||process.stderr,s=r.stdout||process.stdout,i=r.repair||electronRepair.repairElectron;if(!r.input&&"function"==typeof i)try{i({})}catch{}const o=r.input||probes.collect({argv:e}),a=Array.isArray(e)?{...o,argv:e}:o,c=release.versionRequest(a.argv);if(c){const e=c.verbose?r.readFaceVersions?r.readFaceVersions():readFaceVersions(r.binDir):null;return write(s,release.renderVersion({product:{name:PRODUCT.name,version:PRODUCT.version},faces:e})),0}if((r.helpRequest||productHelp.helpRequest)(a.argv))return write(s,productHelp.renderHelp({version:PRODUCT.version})),0;const d=(r.updateRequest||productUpdate.updateRequest)(a.argv);if(d&&"help"===d.action)return write(s,productUpdate.renderUsage(PRODUCT.version)),0;if(d)return runUpdate(d,r,{stdout:s,stderr:n,input:a});const p=(a.argv||[]).indexOf("doctor");if(-1!==p&&!(a.argv||[]).slice(0,p).some(e=>!e.startsWith("-"))){const e=r.doctor||require("../src/doctor.js"),t=Object.assign({env:a.env,stdout:s,electron:a._electron||r.electron||null,appBundle:a._appBundle||r.appBundle||null},r.doctorDeps||{}),n=e.main((a.argv||[]).slice(p+1),t);return"number"==typeof n?n:2}const u=decide(a);if(u.face===FACE.TUI&&!a._cliBin&&!r.cliBin)return write(n,"aegis: the terminal face is not installed beside aegisone."),write(n,"aegis: reinstall aegisone, or set AEGISONE_CLI_BIN to bin/aegiscode.js."),127;const l=r.permissions||require("../src/permissions.js"),f=(a.argv||[]).indexOf(l.SKIP_FLAG||"--dangerously-skip-permissions"),g=Boolean(a.tty&&a.tty.stdin&&a.tty.stdout),m=g?"interactive":"headless",h=r.stored||l.storedPermissionFacts(r.storedOpts||{}),w=l.resolvePosture({rules:void 0!==r.rules?r.rules:h.rules,gate:void 0!==r.gate?r.gate:h.confirmationsOn,permissionMode:void 0!==r.permissionMode?r.permissionMode:h.permissionMode,flag:-1!==f,env:a.env,interactive:g,childKind:m});w.warning&&write(n,`aegis: ${w.warning}`),w.skip&&w.skipFromFlag&&write(n,l.skipReport(w));const v=-1===f?u.args:u.args.filter(e=>e!==(l.SKIP_FLAG||"--dangerously-skip-permissions")),S=w.skipFromFlag?{AEGISONE_SKIP_PERMISSIONS:"1"}:{},I={AEGIS_INSTALL_METHOD:"npm"};if("1"===(a.env||{}).AEGISONE_PRINT_DECISION&&write(n,"aegis: decision "+JSON.stringify({face:u.face,kind:u.kind,reason:u.reason,args:v,skip:w.skip})),null===u.face)return write(n,`aegis: ${u.error}`),u.hint&&write(n,`aegis: ${u.hint}`),u.code||2;u.notice&&write(n,`aegis: ${u.notice} — running the terminal face.`);const _=r.spawnSync||spawnSync,O=r.spawn||spawn,E=Object.assign({},process.env,r.env||{});if(u.face===FACE.TUI){const e=a._cliBin||r.cliBin;return e?statusOf(_(process.execPath,[e,...v],{stdio:"inherit",env:Object.assign({},E,S,I),argv0:"aegiscode"})||{}):(write(n,"aegis: the terminal face is not installed beside aegisone."),write(n,"aegis: reinstall aegisone, or set AEGISONE_CLI_BIN to bin/aegiscode.js."),127)}const y=a._electron||r.electron,R=a._desktopMain||r.desktopMain,k=a._appBundle||r.appBundle||null,j=WIN.plan({decision:u,electron:Boolean(y)||Boolean(k),target:r.target||a.target});if(!j||!R&&!k)return write(n,"aegis: cannot open the window — Electron or the desktop entry point went missing after the check."),write(n,"aegis: Use --tui for the terminal face."),2;delete E.ELECTRON_RUN_AS_NODE;const D=WIN.open(j,{main:R,args:v,env:Object.assign({},E,S,I)},{openElectron:e=>{if(k){const t=O(k,e.args||[],{stdio:["ignore","ignore","pipe"],env:e.env,detached:!1});return t&&t.stderr&&forwardWindowStderr(t.stderr,n),t}const t=O(process.execPath,[e.main,...e.args],{stdio:["ignore","ignore","pipe"],env:e.env,detached:!1});return t&&t.stderr&&forwardWindowStderr(t.stderr,n),t}});if(!D||!D.ok)return write(n,`aegis: cannot open the window — ${D&&D.msg||"no usable window plan"}.`),write(n,"aegis: Use --tui for the terminal face."),2;const U=D.handle;return new Promise(e=>{U.on("error",t=>{write(n,`aegis: could not start the window: ${t&&t.message}`),e(1)}),U.on("exit",(t,r)=>e(statusOf({status:t,signal:r})))})}function main(e){const t=run(e);return"number"==typeof t?(process.exitCode=t,t):t.then(e=>(process.exitCode=e,e))}if(module.exports={main:main,run:run,statusOf:statusOf,EXIT_USAGE:2,isInstalledLayout:isInstalledLayout,defaultFetchLatest:defaultFetchLatest},require.main===module){const e=main(process.argv.slice(2));e&&"function"==typeof e.then&&e.catch(e=>{write(process.stderr,`aegis: ${e&&e.stack||e}`),process.exitCode=1})}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aegisone",
|
|
3
3
|
"productName": "AEGISONE",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.81",
|
|
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",
|
package/vendor/cli/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aegiscode",
|
|
3
3
|
"productName": "AEGIS Code",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.73",
|
|
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",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "aegis-desktop",
|
|
3
3
|
"productName": "aegis one",
|
|
4
4
|
"desktopName": "aegis-desktop",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.73",
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aegiscode",
|
|
3
3
|
"productName": "AEGIS Code",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.73",
|
|
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",
|