aegiscode 5.2.16 → 5.2.18
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/bin/cli.js +2 -2
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -1243,7 +1243,7 @@ ${W}`,metadata:{serverName:I,toolName:G.name,mcpResult:b}}}catch(b){let Z=b.mess
|
|
|
1243
1243
|
`;await md.appendFile(this.filePath,G,"utf-8")}async appendBatch(I){if(I.length===0)return;await md.mkdir(UcI.dirname(this.filePath),{recursive:!0});let G=I.map(c=>JSON.stringify(c)).join(`
|
|
1244
1244
|
`)+`
|
|
1245
1245
|
`;await md.appendFile(this.filePath,G,"utf-8")}async readAll(){if(!this.exists())return[];let G=(await md.readFile(this.filePath,"utf-8")).split(`
|
|
1246
|
-
`).filter(e=>e.trim().length>0),c=[];for(let e of G)try{c.push(JSON.parse(e))}catch{console.warn(`[JSONLStore] \u89E3\u6790 JSON \u884C\u5931\u8D25: ${e.substring(0,100)}...`)}return c}async readStream(I){return new Promise((G,c)=>{if(!this.exists()){G();return}let e=xal(this.filePath,{encoding:"utf-8"}),t=Bal({input:e,crlfDelay:Number.POSITIVE_INFINITY}),n=async b=>{let Z=b.trim();if(Z.length!==0)try{let W=JSON.parse(Z);await I(W)}catch{console.warn(`[JSONLStore] \u89E3\u6790\u5931\u8D25: ${Z.substring(0,50)}...`)}};t.on("line",b=>{n(b).catch(c)}),t.on("close",()=>G()),t.on("error",c),e.on("error",c)})}async readLast(I){return(await this.readAll()).slice(-I)}async filter(I){return(await this.readAll()).filter(I)}async count(){if(!this.exists())return 0;let I=0;return await this.readStream(()=>{I++}),I}async readAfterCompaction(){let I=await this.readAll(),G=-1;for(let c=I.length-1;c>=0;c--)if(I[c].subtype==="compact_boundary"){G=c;break}return G===-1?I:I.slice(G)}async clear(){this.exists()&&await md.writeFile(this.filePath,"","utf-8")}async delete(){this.exists()&&await md.unlink(this.filePath)}async getFileSize(){return this.exists()?(await md.stat(this.filePath)).size:0}}});var myI={};xG(myI,{default:()=>McI});var McI,OcI=y(()=>{McI={name:"aegiscode",version:"5.2.
|
|
1246
|
+
`).filter(e=>e.trim().length>0),c=[];for(let e of G)try{c.push(JSON.parse(e))}catch{console.warn(`[JSONLStore] \u89E3\u6790 JSON \u884C\u5931\u8D25: ${e.substring(0,100)}...`)}return c}async readStream(I){return new Promise((G,c)=>{if(!this.exists()){G();return}let e=xal(this.filePath,{encoding:"utf-8"}),t=Bal({input:e,crlfDelay:Number.POSITIVE_INFINITY}),n=async b=>{let Z=b.trim();if(Z.length!==0)try{let W=JSON.parse(Z);await I(W)}catch{console.warn(`[JSONLStore] \u89E3\u6790\u5931\u8D25: ${Z.substring(0,50)}...`)}};t.on("line",b=>{n(b).catch(c)}),t.on("close",()=>G()),t.on("error",c),e.on("error",c)})}async readLast(I){return(await this.readAll()).slice(-I)}async filter(I){return(await this.readAll()).filter(I)}async count(){if(!this.exists())return 0;let I=0;return await this.readStream(()=>{I++}),I}async readAfterCompaction(){let I=await this.readAll(),G=-1;for(let c=I.length-1;c>=0;c--)if(I[c].subtype==="compact_boundary"){G=c;break}return G===-1?I:I.slice(G)}async clear(){this.exists()&&await md.writeFile(this.filePath,"","utf-8")}async delete(){this.exists()&&await md.unlink(this.filePath)}async getFileSize(){return this.exists()?(await md.stat(this.filePath)).size:0}}});var myI={};xG(myI,{default:()=>McI});var McI,OcI=y(()=>{McI={name:"aegiscode",version:"5.2.18",description:"AEGIS CLI \u2014 AI-powered coding assistant",type:"module",bin:{aegis:"bin/cli.js","aegis-cli":"bin/cli.js",aegiscli:"bin/cli.js",aegiscode:"bin/cli.js"},scripts:{preinstall:"node scripts/ensure-node-version.mjs",build:"node esbuild.mjs","build:publish":"npm run build && node scripts/make-bin.mjs",dev:"NODE_NO_WARNINGS=1 tsx src/main.tsx",start:"node --no-deprecation dist/main.js",typecheck:"tsc --noEmit","test:prompts":"tsx src/prompts/test.ts","test:tools":"tsx src/tools/test.ts","test:pipeline":"tsx src/tools/execution/test.ts","test:context":"tsx src/context/test.ts","test:mcp":"tsx src/mcp/test.ts","test:store":"tsx src/store/test.ts"},keywords:["cli","ai","coding-agent","llm","openai","gpt","claude","copilot","assistant","terminal","developer-tools"],author:"Niklas Borneklint",license:"MIT",repository:{type:"git",url:"git+https://github.com/aegisinfo/aegiscode.git"},homepage:"https://github.com/aegisinfo/aegiscode#readme",bugs:{url:"https://github.com/aegisinfo/aegiscode/issues"},files:["bin/","scripts/","README.md","LICENSE"],engines:{node:">=18.0.0"},dependencies:{"@huggingface/transformers":"^4.2.0","@modelcontextprotocol/sdk":"^1.30.0",chalk:"^6.0.0",dotenv:"^17.4.2","fuse.js":"^7.4.1",glob:"^13.0.0",ink:"^7.1.1","ink-text-input":"^6.0.0","js-tiktoken":"^1.0.21",lowlight:"^3.3.0",minimatch:"^10.2.6",nanoid:"^6.0.0",openai:"^7.3.0",react:"^19.2.8","react-dom":"^19.2.8","sql.js":"^1.14.1","string-width":"^8.2.2",uuid:"^14.0.0",yaml:"^2.8.2",yargs:"^18.1.0",zod:"^4.4.3","zod-to-json-schema":"^3.25.2",zustand:"^5.0.14"},devDependencies:{"@types/node":"^26.1.2","@types/react":"^19.2.18","@types/sql.js":"^1.4.11","@types/yargs":"^17.0.35",esbuild:"^0.28.0",tsx:"^4.23.4",typescript:"^7.0.2"},overrides:{"string-width":"^8.2.2","slice-ansi":"^7.1.2","cli-truncate":"^4.0.0","cli-boxes":"^3.0.0"}}});var syI,aV,WyI=y(async()=>{"use strict";is();fcI();jy();syI="0.1.0";try{syI=(await Promise.resolve().then(()=>(OcI(),myI))).default.version||"0.1.0"}catch{}aV=class{projectPath;maxSessions;version;constructor(I=process.cwd(),G=100){this.projectPath=I,this.maxSessions=G,this.version=syI}getStore(I){let G=fy(this.projectPath,I);return new nV(G)}async saveMessage(I,G,c,e=null,t){let n=this.getStore(I),b={uuid:Ne(),parentUuid:e,sessionId:I,timestamp:new Date().toISOString(),type:G,cwd:this.projectPath,gitBranch:EW(this.projectPath),version:this.version,message:{role:G,content:c,...t||{}}};return await n.append(b),b.uuid}async saveToolUse(I,G,c,e,t=null){let n=this.getStore(I),b={uuid:Ne(),parentUuid:t,sessionId:I,timestamp:new Date().toISOString(),type:"tool_use",cwd:this.projectPath,gitBranch:EW(this.projectPath),version:this.version,message:{role:"assistant",content:""},tool:{id:G,name:c,input:e}};return await n.append(b),b.uuid}async saveToolResult(I,G,c,e,t=null){let n=this.getStore(I),b={uuid:Ne(),parentUuid:t,sessionId:I,timestamp:new Date().toISOString(),type:"tool_result",cwd:this.projectPath,gitBranch:EW(this.projectPath),version:this.version,message:{role:"assistant",content:""},toolResult:{id:G,output:c,error:e}};return await n.append(b),b.uuid}async saveCompaction(I,G,c,e=null){let t=this.getStore(I),n={uuid:Ne(),parentUuid:e,sessionId:I,timestamp:new Date().toISOString(),type:"system",subtype:"compact_boundary",cwd:this.projectPath,gitBranch:EW(this.projectPath),version:this.version,message:{role:"system",content:"=== \u4E0A\u4E0B\u6587\u538B\u7F29\u8FB9\u754C ==="},compactMetadata:c};await t.append(n);let b={uuid:Ne(),parentUuid:n.uuid,sessionId:I,timestamp:new Date().toISOString(),type:"user",isCompactSummary:!0,cwd:this.projectPath,version:this.version,message:{role:"user",content:G},compactMetadata:c};return await t.append(b),b.uuid}async loadSession(I){let G=this.getStore(I);if(!G.exists())return null;let c=await G.readAll();if(c.length===0)return null;let e=c[0];return{sessionId:I,preferences:{},startTime:new Date(e.timestamp).getTime()}}async loadConversation(I){let G=this.getStore(I);if(!G.exists())return null;let c=await G.readAfterCompaction(),e=[],t=0;for(let n of c){let b=new Date(n.timestamp).getTime();b>t&&(t=b),n.subtype!=="compact_boundary"&&(n.type==="user"||n.type==="assistant"||n.type==="system")&&e.push({id:n.uuid,role:n.message.role,content:typeof n.message.content=="string"?n.message.content:JSON.stringify(n.message.content),timestamp:b,metadata:n.isCompactSummary?{isCompactSummary:!0}:void 0})}return{messages:e,topics:[],lastActivity:t}}async listSessions(){let{readdir:I}=await import("node:fs/promises"),{getProjectStoragePath:G}=await Promise.resolve().then(()=>(jy(),KQI)),c=G(this.projectPath);try{return(await I(c)).filter(t=>t.endsWith(".jsonl")).map(t=>t.replace(".jsonl",""))}catch{return[]}}async deleteSession(I){await this.getStore(I).delete()}async getSessionStats(I){let G=this.getStore(I);if(!G.exists())return null;let c=await G.readAll(),e=await G.getFileSize();return c.length===0?{messageCount:0,fileSize:e,createdAt:null,lastUpdatedAt:null}:{messageCount:c.length,fileSize:e,createdAt:new Date(c[0].timestamp),lastUpdatedAt:new Date(c[c.length-1].timestamp)}}}});var bV,oyI=y(()=>{"use strict";bV=class{cache=new Map;maxSize;defaultTtl;constructor(I=100,G=300*1e3){this.maxSize=I,this.defaultTtl=G}set(I,G,c){this.cache.size>=this.maxSize&&!this.cache.has(I)&&this.evictLRU();let e=Date.now();this.cache.set(I,{value:G,createdAt:e,lastAccessedAt:e,ttl:c??this.defaultTtl})}get(I){let G=this.cache.get(I);if(!G)return;let c=Date.now();if(c-G.createdAt>G.ttl){this.cache.delete(I);return}return G.lastAccessedAt=c,G.value}has(I){let G=this.cache.get(I);return G?Date.now()-G.createdAt>G.ttl?(this.cache.delete(I),!1):!0:!1}delete(I){return this.cache.delete(I)}async getOrSet(I,G,c){let e=this.get(I);if(e!==void 0)return e;let t=await G();return this.set(I,t,c),t}evictLRU(){let I=null,G=1/0;for(let[c,e]of this.cache)e.lastAccessedAt<G&&(G=e.lastAccessedAt,I=c);I&&this.cache.delete(I)}cleanup(){let I=Date.now(),G=0;for(let[c,e]of this.cache)I-e.createdAt>e.ttl&&(this.cache.delete(c),G++);return G}clear(){this.cache.clear()}get size(){return this.cache.size}keys(){return Array.from(this.cache.keys())}getStats(){return{size:this.cache.size,maxSize:this.maxSize}}}});var jcI=y(async()=>{"use strict";ZyI();await WyI();oyI();fcI();jy()});import*as b1 from"node:fs/promises";import{existsSync as ScI}from"node:fs";import*as Ni from"node:path";var dV,KcI=y(()=>{"use strict";dV=class{static MAX_FILES=5;static MAX_LINES_PER_FILE=1e3;static MAX_CHARS_PER_FILE=5e4;static analyzeFiles(I){let G=new Map;return I.forEach((c,e)=>{if(c.content){let t=typeof c.content=="string"?c.content:JSON.stringify(c.content);this.extractFilePathsFromContent(t).forEach(b=>{this.updateFileReference(G,b,e,!1)})}if(c.tool_calls&&Array.isArray(c.tool_calls))for(let t of c.tool_calls){let n=this.extractFilePathsFromToolCall(t),b=["Write","Edit"].includes(t.function?.name||"");n.forEach(Z=>{this.updateFileReference(G,Z,e,b)})}}),Array.from(G.values()).filter(c=>this.isValidFilePath(c.path)).sort((c,e)=>c.wasModified!==e.wasModified?c.wasModified?-1:1:c.mentions!==e.mentions?e.mentions-c.mentions:e.lastMentioned-c.lastMentioned).slice(0,this.MAX_FILES)}static extractFilePathsFromContent(I){let G=[],c=[/(?:^|\s|["'`])(\/?(?:[\w.-]+\/)+[\w.-]+\.[a-zA-Z]{1,10})(?:\s|$|["'`]|:)/gm,/(?:^|\s|["'`])(\.\/(?:[\w.-]+\/)*[\w.-]+\.[a-zA-Z]{1,10})(?:\s|$|["'`]|:)/gm,/```\d+:\d+:([\w./-]+)/gm];for(let e of c){let t;for(;(t=e.exec(I))!==null;){let n=t[1];n&&!G.includes(n)&&G.push(n)}}return G}static extractFilePathsFromToolCall(I){let G=[],c=I.function?.name,e={};try{typeof I.function?.arguments=="string"?e=JSON.parse(I.function.arguments):I.function?.arguments&&(e=I.function.arguments)}catch{return G}if(["Read","Write","Edit","Glob","Grep","NotebookEdit"].includes(c||"")){let n=["file_path","path","notebook_path","filePath"];for(let b of n)e[b]&&typeof e[b]=="string"&&G.push(e[b])}return G}static updateFileReference(I,G,c,e){let t=I.get(G);t?(t.mentions++,t.lastMentioned=Math.max(t.lastMentioned,c),t.wasModified=t.wasModified||e):I.set(G,{path:G,mentions:1,lastMentioned:c,wasModified:e})}static isValidFilePath(I){let G=[/^https?:\/\//,/^node_modules\//,/^\.git\//,/\.(png|jpg|jpeg|gif|svg|ico|webp|mp4|mp3|wav|pdf|zip|tar|gz)$/i];for(let c of G)if(c.test(I))return!1;try{let c=Ni.isAbsolute(I)?I:Ni.join(process.cwd(),I);return ScI(c)}catch{return!1}}static async readFilesContent(I){let G=[];for(let c of I)try{let e=Ni.isAbsolute(c)?c:Ni.join(process.cwd(),c);if(!ScI(e))continue;let t=await b1.readFile(e,"utf-8"),n=t.split(`
|
|
1247
1247
|
`),b=!1,Z=t;n.length>this.MAX_LINES_PER_FILE&&(Z=n.slice(0,this.MAX_LINES_PER_FILE).join(`
|
|
1248
1248
|
`),b=!0),Z.length>this.MAX_CHARS_PER_FILE&&(Z=Z.substring(0,this.MAX_CHARS_PER_FILE),b=!0),b&&(Z+=`
|
|
1249
1249
|
|
|
@@ -1572,7 +1572,7 @@ Report: which test framework is used, where tests live, existing test patterns.`
|
|
|
1572
1572
|
For each function/module: describe the happy path, error cases, edge cases, and any setup/teardown needed.
|
|
1573
1573
|
Prioritize: critical business logic > utilities > edge cases. Be specific about assertions.`},{name:"writer",role:"Test Writer",tools:["Read","Write","Edit","Grep"],prompt:`You are a Test Writer. Generate the actual test files following the test designer's plan.
|
|
1574
1574
|
Match the project's existing test patterns (framework, naming, directory structure).
|
|
1575
|
-
Write complete, runnable tests. Use Write to create new test files.`}]}},WV=class{def={};agents=[];_prompts;constructor(I,G){this.def.id=I,this.def.name=G,this.def.modelConfig=ya,this.def.concurrency=4}describe(I){return this.def.description=I,this}use(I){return this.def.usage=I,this}examples(I){return this.def.examples=I,this}model(I){return this.def.modelConfig=I,this}concurrency(I){return this.def.concurrency=I,this}synthesizer(I){return this.def.synthesizer=I,this}agent(I,G,c,e){return this.agents.push({name:I,role:G,systemPrompt:c,config:{},tools:e}),this}fromTemplate(I,G){let c=VeI[I];if(!c)throw new Error(`Unknown app template: "${I}". Available: ${Object.keys(VeI).join(", ")}`);this.def.name=G?.name||c.name,this.def.description=G?.description||c.description,this.def.usage=`/${this.def.id||I} <task>`,this.def.examples=[`/${this.def.id||I} Audit the login module`,`/${this.def.id||I} Check package.json for vulnerabilities`],this._prompts={template:I,subTaskTemplates:{}};for(let e of c.agents){let t=G?.agentPrompts?.[e.name];this.agent(e.name,e.role,t||e.prompt,e.tools)}return this}register(){if(!this.def.id)throw new Error("AppBuilder: id is required");if(this.def.description||(this.def.description=""),this.agents.length===0)throw new Error("AppBuilder: at least one agent required");let I={id:this.def.id,name:this.def.name||this.def.id,description:this.def.description,usage:this.def.usage||`/${this.def.id} <task>`,examples:this.def.examples||[`/${this.def.id} ...`],modelConfig:this.def.modelConfig||ya,agents:this.agents,synthesizer:this.def.synthesizer||this.agents[this.agents.length-1]?.name,concurrency:this.def.concurrency||4};return h1.set(I.id,I),I}},h1=new Map});var mAI=y(()=>{"use strict";IX();D$();Kx();ZAI();GX()});async function i1(l){let{execSync:I}=await import("child_process"),G=process.platform;try{if(G==="darwin"){I("pbcopy",{input:l});return}if(G==="win32"){I("clip",{input:l});return}if(G==="linux")try{I("xclip -selection clipboard",{input:l});return}catch{I("xsel --clipboard --input",{input:l});return}}catch{}idl(l)}function idl(l){let G=`\x1B]52;c;${Buffer.from(l,"utf8").toString("base64")}\x07`,c=process.env.TMUX?`\x1BPtmux;\x1B${G}\x1B\\`:G;process.stdout.write(c)}var QeI=y(()=>{"use strict"});var qx={};xG(qx,{getRouterStats:()=>pdl,pickByOutcomes:()=>geI,recordRouterOutcome:()=>rdl});import*as IH from"node:fs";import*as Dx from"node:path";import*as sAI from"node:os";function veI(){if($X)return $X;try{$X=JSON.parse(IH.readFileSync(XeI,"utf8"))}catch{$X={}}return $X}function Ydl(l){$X=l;try{IH.mkdirSync(Dx.dirname(XeI),{recursive:!0}),IH.writeFileSync(XeI,JSON.stringify(l,null,2))}catch{}}function rdl(l,I,G){let c=veI(),e=c[l]||(c[l]={}),t=e[I]||(e[I]={success:0,failure:0});G?t.success+=1:t.failure+=1,Ydl(c)}function pdl(){return veI()}function HeI(l){if(l<1){let c=Math.random();return HeI(l+1)*Math.pow(c,1/l)}let I=l-1/3,G=1/Math.sqrt(9*I);for(;;){let c,e;do{let n=Math.random()||Number.EPSILON,b=Math.random();c=Math.sqrt(-2*Math.log(n))*Math.cos(2*Math.PI*b),e=1+G*c}while(e<=0);e=e*e*e;let t=Math.random();if(t<1-.0331*(c*c)*(c*c)||Math.log(t)<.5*c*c+I*(1-e+Math.log(e)))return I*e}}function Vdl(l,I){let G=HeI(l),c=HeI(I);return G/(G+c)}function geI(l,I){let G=I.length;if(G===0)return;if(G===1)return I[0];let e=veI()[l]||{},t,n=-1/0;return I.forEach((b,Z)=>{let W=(G-1-Z)*3,N=e[b],u=Vdl(1+W+(N?.success??0),1+(N?.failure??0));u>n&&(n=u,t=b)}),t}var XeI,$X,Y1=y(()=>{"use strict";XeI=Dx.join(sAI.homedir(),".aegiscode","router-stats.json"),$X=null});var WAI=y(()=>{"use strict"});var oAI,Rdl,Fdl,vs,r1=y(()=>{"use strict";oAI={primary:"#00e5c0",secondary:"#7c6fd4",accent:"#00e5c0",success:"#22c55e",warning:"#f59e0b",error:"#ef4444",info:"#00e5c0",text:{primary:"#e8e6f4",secondary:"#8882a4",muted:"#44405a",light:"#e8e6f4"},background:{primary:"#04040c",secondary:"#181828",dark:"#0c0c16"},border:{light:"#1a1a2a",dark:"#1a1a2a"},syntax:{keyword:"#00e5c0",string:"#7c6fd4",number:"#f59e0b",comment:"#44405a",function:"#f472b6",variable:"#e8e6f4",operator:"#89DDFF",type:"#FFCB6B",tag:"#F07178",attr:"#C3E88D",default:"#A6ACCD"}},Rdl={xs:0,sm:1,md:2,lg:3,xl:4},Fdl={elevation:{flat:"rgba(0,0,0,0)",raised:"rgba(0, 229, 192, 0.08)",overlay:"rgba(0, 0, 0, 0.4)",sticky:"rgba(0, 229, 192, 0.12)"},radius:{sm:0,md:1,lg:2,full:0},animation:{fast:80,normal:150,slow:300,easing:"ease-out"},semantic:{interactive:{idle:oAI.primary,hover:"#33ffd9",active:"#00bfa0",disabled:"#44405a"},focus:{ring:"#00e5c0",glow:"rgba(0, 229, 192, 0.3)"},code:{background:"#08080f",border:"#1a1a2a"}}},vs={name:"default",colors:oAI,spacing:Rdl,tokens:Fdl}});var Qdl,UW,weI=y(()=>{"use strict";r1();Qdl={elevation:{flat:"rgba(0,0,0,0)",raised:"rgba(96, 165, 250, 0.08)",overlay:"rgba(0, 0, 0, 0.4)",sticky:"rgba(96, 165, 250, 0.12)"},radius:{sm:0,md:1,lg:2,full:0},animation:{fast:80,normal:150,slow:300,easing:"ease-out"},semantic:{interactive:{idle:"#60a5fa",hover:"#93c5fd",active:"#3b82f6",disabled:"#9ca3af"},focus:{ring:"#60a5fa",glow:"rgba(96, 165, 250, 0.3)"},code:{background:"#1f2937",border:"#374151"}}},UW={...vs,name:"dark",tokens:Qdl,colors:{...vs.colors,primary:"#60a5fa",secondary:"#818cf8",accent:"#a78bfa",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee",text:{primary:"#f9fafb",secondary:"#e5e7eb",muted:"#9ca3af",light:"#111827"},background:{primary:"#111827",secondary:"#374151",dark:"#030712"},border:{light:"#374151",dark:"#1f2937"},syntax:{comment:"#9ca3af",string:"#34d399",number:"#f472b6",keyword:"#a78bfa",function:"#60a5fa",variable:"#e5e7eb",operator:"#fbbf24",type:"#22d3ee",tag:"#fb7185",attr:"#facc15",default:"#f9fafb"}}}});var Xdl,Px,EeI=y(()=>{"use strict";r1();Xdl={elevation:{flat:"rgba(0,0,0,0)",raised:"rgba(37, 99, 235, 0.06)",overlay:"rgba(0, 0, 0, 0.15)",sticky:"rgba(37, 99, 235, 0.1)"},radius:{sm:0,md:1,lg:2,full:0},animation:{fast:80,normal:150,slow:300,easing:"ease-out"},semantic:{interactive:{idle:"#2563eb",hover:"#1d4ed8",active:"#1e40af",disabled:"#9ca3af"},focus:{ring:"#2563eb",glow:"rgba(37, 99, 235, 0.25)"},code:{background:"#f9fafb",border:"#d1d5db"}}},Px={...vs,name:"light",tokens:Xdl,colors:{...vs.colors,primary:"#2563eb",secondary:"#4f46e5",accent:"#7c3aed",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2",text:{primary:"#111827",secondary:"#374151",muted:"#6b7280",light:"#f9fafb"},background:{primary:"#ffffff",secondary:"#e5e7eb",dark:"#111827"},border:{light:"#d1d5db",dark:"#6b7280"},syntax:{comment:"#6b7280",string:"#047857",number:"#be185d",keyword:"#6d28d9",function:"#1d4ed8",variable:"#111827",operator:"#b45309",type:"#0e7490",tag:"#b91c1c",attr:"#a16207",default:"#111827"}}}});var NAI,Hdl,vdl,_x,yeI=y(()=>{"use strict";NAI={primary:"#00e5c0",secondary:"#7c6fd4",accent:"#00e5c0",success:"#22c55e",warning:"#f59e0b",error:"#ef4444",info:"#00e5c0",text:{primary:"#e8e6f4",secondary:"#8882a4",muted:"#44405a",light:"#e8e6f4"},background:{primary:"#04040c",secondary:"#181828",dark:"#0c0c16"},border:{light:"rgba(255,255,255,0.06)",dark:"#1a1a2a"},syntax:{keyword:"#00e5c0",string:"#7c6fd4",number:"#f59e0b",comment:"#44405a",function:"#f472b6",variable:"#e8e6f4",operator:"#89DDFF",type:"#FFCB6B",tag:"#F07178",attr:"#C3E88D",default:"#A6ACCD"}},Hdl={xs:0,sm:1,md:2,lg:3,xl:4},vdl={elevation:{flat:"rgba(0,0,0,0)",raised:"rgba(0, 229, 192, 0.08)",overlay:"rgba(0, 0, 0, 0.5)",sticky:"rgba(0, 229, 192, 0.15)"},radius:{sm:0,md:1,lg:2,full:0},animation:{fast:80,normal:150,slow:300,easing:"ease-out"},semantic:{interactive:{idle:NAI.primary,hover:"#33ffd9",active:"#00bfa0",disabled:"#44405a"},focus:{ring:"#00e5c0",glow:"rgba(0, 229, 192, 0.3)"},code:{background:"#08080f",border:"#1a1a2a"}}},_x={name:"aegis",colors:NAI,spacing:Hdl,tokens:vdl}});import{execSync as gdl}from"node:child_process";function uAI(){if(process.platform==="darwin")try{if(gdl("defaults read -g AppleInterfaceStyle 2>/dev/null",{encoding:"utf-8",timeout:1e3}).trim()==="Dark")return"dark"}catch{return"light"}let l=process.env.COLORFGBG;if(l){let G=l.split(";");if(G.length>=2){let c=parseInt(G[G.length-1],10);if(!isNaN(c)){if(c===0||c<=6)return"dark";if(c===7||c>=8)return"light"}}}let I=process.env.TERM_PROGRAM?.toLowerCase();if(I&&I==="vscode"){let G=process.env.VSCODE_THEME_KIND;if(G==="vscode-dark"||G==="vscode-high-contrast")return"dark";if(G==="vscode-light"||G==="vscode-high-contrast-light")return"light"}return"unknown"}var hAI,p1,mc,iAI=y(()=>{"use strict";r1();weI();EeI();yeI();hW();hAI=[{id:"default",name:"Default",description:"Balanced theme (works on most terminals)",theme:vs},{id:"aegis",name:"\xC6GIS",description:"\xC6GIS teal \u2014 the signature brand theme",theme:_x},{id:"light",name:"Light",description:"Optimized for light/white terminal backgrounds",theme:Px},{id:"dark",name:"Dark",description:"Dark theme for dark terminal backgrounds",theme:UW},{id:"ocean",name:"Ocean",description:"Deep blue ocean theme",theme:{...UW,name:"ocean",colors:{...UW.colors,primary:"#0ea5e9",secondary:"#06b6d4",accent:"#14b8a6",background:{primary:"#0c4a6e",secondary:"#075985",dark:"#082f49"}}}},{id:"forest",name:"Forest",description:"Natural green forest theme",theme:{...UW,name:"forest",colors:{...UW.colors,primary:"#22c55e",secondary:"#16a34a",accent:"#84cc16",background:{primary:"#14532d",secondary:"#166534",dark:"#052e16"}}}},{id:"sunset",name:"Sunset",description:"Warm sunset colors",theme:{...UW,name:"sunset",colors:{...UW.colors,primary:"#f97316",secondary:"#ea580c",accent:"#eab308",background:{primary:"#7c2d12",secondary:"#9a3412",dark:"#431407"}}}}],p1=class{currentTheme=vs;themes=new Map;initialized=!1;constructor(){for(let I of hAI)this.themes.set(I.id,I.theme)}initializeFromConfig(){if(!this.initialized)try{let I=le.getTheme();if(I&&this.themes.has(I)){this.currentTheme=this.themes.get(I),this.initialized=!0;return}let G=uAI();G==="dark"?this.currentTheme=this.themes.get("dark"):G==="light"&&(this.currentTheme=this.themes.get("light")),this.initialized=!0}catch{this.initialized=!0}}getDetectedColorMode(){return uAI()}setTheme(I,G=!0){let c=this.themes.get(I);if(c){if(this.currentTheme=c,G)try{le.saveTheme(I)}catch{}}else throw new Error(`Theme '${I}' not found`)}getTheme(){return this.currentTheme}getCurrentThemeName(){return this.currentTheme.name}hasTheme(I){return this.themes.has(I)}getAvailableThemes(){return Array.from(this.themes.keys())}getThemePresets(){return hAI}registerTheme(I,G){this.themes.set(I,G)}getRoleStyle(I){let G=this.currentTheme.colors;switch(I){case"user":return{color:G.text.muted,prefix:"",bold:!1};case"assistant":return{color:G.primary,prefix:"",bold:!1};case"system":return{color:G.warning,prefix:"!",bold:!0};case"tool":return{color:G.info,prefix:"",bold:!1};default:return{color:G.text.primary,prefix:""}}}},mc=new p1});var YAI={};xG(YAI,{ThemeManager:()=>p1,aegisTheme:()=>_x,darkTheme:()=>UW,defaultTheme:()=>vs,lightTheme:()=>Px,themeManager:()=>mc});var za=y(()=>{"use strict";WAI();r1();weI();EeI();iAI();yeI()});var IB={};xG(IB,{parseMarkdown:()=>oV,stripMarkdown:()=>Adl});function wdl(l){if(!l)return{};let I=l.match(/^(\d+):(\d+):(.+)$/);if(I){let c=I[3],e=c.split(".").pop()?.toLowerCase();return{language:e&&$x.has(e)?e:void 0,filePath:c,startLine:parseInt(I[1],10)}}let G=l.indexOf(":");if(G>0){let c=l.slice(0,G).toLowerCase(),e=l.slice(G+1);if($x.has(c)&&e.length>0)return{language:c,filePath:e}}if($x.has(l.toLowerCase()))return{language:l.toLowerCase()};if(l.includes("/")||l.includes(".")){let c=l.split(".").pop()?.toLowerCase();return{language:c&&$x.has(c)?c:void 0,filePath:l}}return{language:l}}function oV(l){let I=[],G=l.split(/\r?\n/),c=!1,e=[],t={},n=0,b=!1,Z=[],W=[],N=[];for(let u=0;u<G.length;u++){let h=G[u];if(c){let E=h.match(fW.codeBlock);if(E&&E[2]===void 0)I.push({type:"code",content:e.join(`
|
|
1575
|
+
Write complete, runnable tests. Use Write to create new test files.`}]}},WV=class{def={};agents=[];_prompts;constructor(I,G){this.def.id=I,this.def.name=G,this.def.modelConfig=ya,this.def.concurrency=4}describe(I){return this.def.description=I,this}use(I){return this.def.usage=I,this}examples(I){return this.def.examples=I,this}model(I){return this.def.modelConfig=I,this}concurrency(I){return this.def.concurrency=I,this}synthesizer(I){return this.def.synthesizer=I,this}agent(I,G,c,e){return this.agents.push({name:I,role:G,systemPrompt:c,config:{},tools:e}),this}fromTemplate(I,G){let c=VeI[I];if(!c)throw new Error(`Unknown app template: "${I}". Available: ${Object.keys(VeI).join(", ")}`);this.def.name=G?.name||c.name,this.def.description=G?.description||c.description,this.def.usage=`/${this.def.id||I} <task>`,this.def.examples=[`/${this.def.id||I} Audit the login module`,`/${this.def.id||I} Check package.json for vulnerabilities`],this._prompts={template:I,subTaskTemplates:{}};for(let e of c.agents){let t=G?.agentPrompts?.[e.name];this.agent(e.name,e.role,t||e.prompt,e.tools)}return this}register(){if(!this.def.id)throw new Error("AppBuilder: id is required");if(this.def.description||(this.def.description=""),this.agents.length===0)throw new Error("AppBuilder: at least one agent required");let I={id:this.def.id,name:this.def.name||this.def.id,description:this.def.description,usage:this.def.usage||`/${this.def.id} <task>`,examples:this.def.examples||[`/${this.def.id} ...`],modelConfig:this.def.modelConfig||ya,agents:this.agents,synthesizer:this.def.synthesizer||this.agents[this.agents.length-1]?.name,concurrency:this.def.concurrency||4};return h1.set(I.id,I),I}},h1=new Map});var mAI=y(()=>{"use strict";IX();D$();Kx();ZAI();GX()});async function i1(l){let{execSync:I}=await import("child_process"),G=process.platform;try{if(G==="darwin"){I("pbcopy",{input:l});return}if(G==="win32"){I("clip",{input:l});return}if(G==="linux")try{I("xclip -selection clipboard",{input:l});return}catch{I("xsel --clipboard --input",{input:l});return}}catch{}idl(l)}function idl(l){let G=`\x1B]52;c;${Buffer.from(l,"utf8").toString("base64")}\x07`,c=process.env.TMUX?`\x1BPtmux;\x1B${G}\x1B\\`:G;process.stdout.write(c)}var QeI=y(()=>{"use strict"});var qx={};xG(qx,{getRouterStats:()=>pdl,pickByOutcomes:()=>geI,recordRouterOutcome:()=>rdl});import*as IH from"node:fs";import*as Dx from"node:path";import*as sAI from"node:os";function veI(){if($X)return $X;try{$X=JSON.parse(IH.readFileSync(XeI,"utf8"))}catch{$X={}}return $X}function Ydl(l){$X=l;try{IH.mkdirSync(Dx.dirname(XeI),{recursive:!0}),IH.writeFileSync(XeI,JSON.stringify(l,null,2))}catch{}}function rdl(l,I,G){let c=veI(),e=c[l]||(c[l]={}),t=e[I]||(e[I]={success:0,failure:0});G?t.success+=1:t.failure+=1,Ydl(c)}function pdl(){return veI()}function HeI(l){if(l<1){let c=Math.random();return HeI(l+1)*Math.pow(c,1/l)}let I=l-1/3,G=1/Math.sqrt(9*I);for(;;){let c,e;do{let n=Math.random()||Number.EPSILON,b=Math.random();c=Math.sqrt(-2*Math.log(n))*Math.cos(2*Math.PI*b),e=1+G*c}while(e<=0);e=e*e*e;let t=Math.random();if(t<1-.0331*(c*c)*(c*c)||Math.log(t)<.5*c*c+I*(1-e+Math.log(e)))return I*e}}function Vdl(l,I){let G=HeI(l),c=HeI(I);return G/(G+c)}function geI(l,I){let G=I.length;if(G===0)return;if(G===1)return I[0];let e=veI()[l]||{},t,n=-1/0;return I.forEach((b,Z)=>{let W=(G-1-Z)*3,N=e[b],u=Vdl(1+W+(N?.success??0),1+(N?.failure??0));u>n&&(n=u,t=b)}),t}var XeI,$X,Y1=y(()=>{"use strict";XeI=Dx.join(sAI.homedir(),".aegiscode","router-stats.json"),$X=null});var WAI=y(()=>{"use strict"});var oAI,Rdl,Fdl,vs,r1=y(()=>{"use strict";oAI={primary:"#00e5c0",secondary:"#7c6fd4",accent:"#00e5c0",success:"#22c55e",warning:"#f59e0b",error:"#ef4444",info:"#00e5c0",text:{primary:"#e8e6f4",secondary:"#8882a4",muted:"#9ca3af",light:"#e8e6f4"},background:{primary:"#04040c",secondary:"#181828",dark:"#0c0c16"},border:{light:"#1a1a2a",dark:"#1a1a2a"},syntax:{keyword:"#00e5c0",string:"#7c6fd4",number:"#f59e0b",comment:"#6b7280",function:"#f472b6",variable:"#e8e6f4",operator:"#89DDFF",type:"#FFCB6B",tag:"#F07178",attr:"#C3E88D",default:"#A6ACCD"}},Rdl={xs:0,sm:1,md:2,lg:3,xl:4},Fdl={elevation:{flat:"rgba(0,0,0,0)",raised:"rgba(0, 229, 192, 0.08)",overlay:"rgba(0, 0, 0, 0.4)",sticky:"rgba(0, 229, 192, 0.12)"},radius:{sm:0,md:1,lg:2,full:0},animation:{fast:80,normal:150,slow:300,easing:"ease-out"},semantic:{interactive:{idle:oAI.primary,hover:"#33ffd9",active:"#00bfa0",disabled:"#44405a"},focus:{ring:"#00e5c0",glow:"rgba(0, 229, 192, 0.3)"},code:{background:"#08080f",border:"#1a1a2a"}}},vs={name:"default",colors:oAI,spacing:Rdl,tokens:Fdl}});var Qdl,UW,weI=y(()=>{"use strict";r1();Qdl={elevation:{flat:"rgba(0,0,0,0)",raised:"rgba(96, 165, 250, 0.08)",overlay:"rgba(0, 0, 0, 0.4)",sticky:"rgba(96, 165, 250, 0.12)"},radius:{sm:0,md:1,lg:2,full:0},animation:{fast:80,normal:150,slow:300,easing:"ease-out"},semantic:{interactive:{idle:"#60a5fa",hover:"#93c5fd",active:"#3b82f6",disabled:"#9ca3af"},focus:{ring:"#60a5fa",glow:"rgba(96, 165, 250, 0.3)"},code:{background:"#1f2937",border:"#374151"}}},UW={...vs,name:"dark",tokens:Qdl,colors:{...vs.colors,primary:"#60a5fa",secondary:"#818cf8",accent:"#a78bfa",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee",text:{primary:"#f9fafb",secondary:"#e5e7eb",muted:"#9ca3af",light:"#111827"},background:{primary:"#111827",secondary:"#374151",dark:"#030712"},border:{light:"#374151",dark:"#1f2937"},syntax:{comment:"#9ca3af",string:"#34d399",number:"#f472b6",keyword:"#a78bfa",function:"#60a5fa",variable:"#e5e7eb",operator:"#fbbf24",type:"#22d3ee",tag:"#fb7185",attr:"#facc15",default:"#f9fafb"}}}});var Xdl,Px,EeI=y(()=>{"use strict";r1();Xdl={elevation:{flat:"rgba(0,0,0,0)",raised:"rgba(37, 99, 235, 0.06)",overlay:"rgba(0, 0, 0, 0.15)",sticky:"rgba(37, 99, 235, 0.1)"},radius:{sm:0,md:1,lg:2,full:0},animation:{fast:80,normal:150,slow:300,easing:"ease-out"},semantic:{interactive:{idle:"#2563eb",hover:"#1d4ed8",active:"#1e40af",disabled:"#9ca3af"},focus:{ring:"#2563eb",glow:"rgba(37, 99, 235, 0.25)"},code:{background:"#f9fafb",border:"#d1d5db"}}},Px={...vs,name:"light",tokens:Xdl,colors:{...vs.colors,primary:"#2563eb",secondary:"#4f46e5",accent:"#7c3aed",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2",text:{primary:"#111827",secondary:"#374151",muted:"#6b7280",light:"#f9fafb"},background:{primary:"#ffffff",secondary:"#e5e7eb",dark:"#111827"},border:{light:"#d1d5db",dark:"#6b7280"},syntax:{comment:"#6b7280",string:"#047857",number:"#be185d",keyword:"#6d28d9",function:"#1d4ed8",variable:"#111827",operator:"#b45309",type:"#0e7490",tag:"#b91c1c",attr:"#a16207",default:"#111827"}}}});var NAI,Hdl,vdl,_x,yeI=y(()=>{"use strict";NAI={primary:"#00e5c0",secondary:"#7c6fd4",accent:"#00e5c0",success:"#22c55e",warning:"#f59e0b",error:"#ef4444",info:"#00e5c0",text:{primary:"#e8e6f4",secondary:"#8882a4",muted:"#9ca3af",light:"#e8e6f4"},background:{primary:"#04040c",secondary:"#181828",dark:"#0c0c16"},border:{light:"rgba(255,255,255,0.06)",dark:"#1a1a2a"},syntax:{keyword:"#00e5c0",string:"#7c6fd4",number:"#f59e0b",comment:"#6b7280",function:"#f472b6",variable:"#e8e6f4",operator:"#89DDFF",type:"#FFCB6B",tag:"#F07178",attr:"#C3E88D",default:"#A6ACCD"}},Hdl={xs:0,sm:1,md:2,lg:3,xl:4},vdl={elevation:{flat:"rgba(0,0,0,0)",raised:"rgba(0, 229, 192, 0.08)",overlay:"rgba(0, 0, 0, 0.5)",sticky:"rgba(0, 229, 192, 0.15)"},radius:{sm:0,md:1,lg:2,full:0},animation:{fast:80,normal:150,slow:300,easing:"ease-out"},semantic:{interactive:{idle:NAI.primary,hover:"#33ffd9",active:"#00bfa0",disabled:"#44405a"},focus:{ring:"#00e5c0",glow:"rgba(0, 229, 192, 0.3)"},code:{background:"#08080f",border:"#1a1a2a"}}},_x={name:"aegis",colors:NAI,spacing:Hdl,tokens:vdl}});import{execSync as gdl}from"node:child_process";function uAI(){if(process.platform==="darwin")try{if(gdl("defaults read -g AppleInterfaceStyle 2>/dev/null",{encoding:"utf-8",timeout:1e3}).trim()==="Dark")return"dark"}catch{return"light"}let l=process.env.COLORFGBG;if(l){let G=l.split(";");if(G.length>=2){let c=parseInt(G[G.length-1],10);if(!isNaN(c)){if(c===0||c<=6)return"dark";if(c===7||c>=8)return"light"}}}let I=process.env.TERM_PROGRAM?.toLowerCase();if(I&&I==="vscode"){let G=process.env.VSCODE_THEME_KIND;if(G==="vscode-dark"||G==="vscode-high-contrast")return"dark";if(G==="vscode-light"||G==="vscode-high-contrast-light")return"light"}return"unknown"}var hAI,p1,mc,iAI=y(()=>{"use strict";r1();weI();EeI();yeI();hW();hAI=[{id:"default",name:"Default",description:"Balanced theme (works on most terminals)",theme:vs},{id:"aegis",name:"\xC6GIS",description:"\xC6GIS teal \u2014 the signature brand theme",theme:_x},{id:"light",name:"Light",description:"Optimized for light/white terminal backgrounds",theme:Px},{id:"dark",name:"Dark",description:"Dark theme for dark terminal backgrounds",theme:UW},{id:"ocean",name:"Ocean",description:"Deep blue ocean theme",theme:{...UW,name:"ocean",colors:{...UW.colors,primary:"#0ea5e9",secondary:"#06b6d4",accent:"#14b8a6",background:{primary:"#0c4a6e",secondary:"#075985",dark:"#082f49"}}}},{id:"forest",name:"Forest",description:"Natural green forest theme",theme:{...UW,name:"forest",colors:{...UW.colors,primary:"#22c55e",secondary:"#16a34a",accent:"#84cc16",background:{primary:"#14532d",secondary:"#166534",dark:"#052e16"}}}},{id:"sunset",name:"Sunset",description:"Warm sunset colors",theme:{...UW,name:"sunset",colors:{...UW.colors,primary:"#f97316",secondary:"#ea580c",accent:"#eab308",background:{primary:"#7c2d12",secondary:"#9a3412",dark:"#431407"}}}}],p1=class{currentTheme=vs;themes=new Map;initialized=!1;constructor(){for(let I of hAI)this.themes.set(I.id,I.theme)}initializeFromConfig(){if(!this.initialized)try{let I=le.getTheme();if(I&&this.themes.has(I)){this.currentTheme=this.themes.get(I),this.initialized=!0;return}let G=uAI();G==="dark"?this.currentTheme=this.themes.get("dark"):G==="light"&&(this.currentTheme=this.themes.get("light")),this.initialized=!0}catch{this.initialized=!0}}getDetectedColorMode(){return uAI()}setTheme(I,G=!0){let c=this.themes.get(I);if(c){if(this.currentTheme=c,G)try{le.saveTheme(I)}catch{}}else throw new Error(`Theme '${I}' not found`)}getTheme(){return this.currentTheme}getCurrentThemeName(){return this.currentTheme.name}hasTheme(I){return this.themes.has(I)}getAvailableThemes(){return Array.from(this.themes.keys())}getThemePresets(){return hAI}registerTheme(I,G){this.themes.set(I,G)}getRoleStyle(I){let G=this.currentTheme.colors;switch(I){case"user":return{color:G.text.muted,prefix:"",bold:!1};case"assistant":return{color:G.primary,prefix:"",bold:!1};case"system":return{color:G.warning,prefix:"!",bold:!0};case"tool":return{color:G.info,prefix:"",bold:!1};default:return{color:G.text.primary,prefix:""}}}},mc=new p1});var YAI={};xG(YAI,{ThemeManager:()=>p1,aegisTheme:()=>_x,darkTheme:()=>UW,defaultTheme:()=>vs,lightTheme:()=>Px,themeManager:()=>mc});var za=y(()=>{"use strict";WAI();r1();weI();EeI();iAI();yeI()});var IB={};xG(IB,{parseMarkdown:()=>oV,stripMarkdown:()=>Adl});function wdl(l){if(!l)return{};let I=l.match(/^(\d+):(\d+):(.+)$/);if(I){let c=I[3],e=c.split(".").pop()?.toLowerCase();return{language:e&&$x.has(e)?e:void 0,filePath:c,startLine:parseInt(I[1],10)}}let G=l.indexOf(":");if(G>0){let c=l.slice(0,G).toLowerCase(),e=l.slice(G+1);if($x.has(c)&&e.length>0)return{language:c,filePath:e}}if($x.has(l.toLowerCase()))return{language:l.toLowerCase()};if(l.includes("/")||l.includes(".")){let c=l.split(".").pop()?.toLowerCase();return{language:c&&$x.has(c)?c:void 0,filePath:l}}return{language:l}}function oV(l){let I=[],G=l.split(/\r?\n/),c=!1,e=[],t={},n=0,b=!1,Z=[],W=[],N=[];for(let u=0;u<G.length;u++){let h=G[u];if(c){let E=h.match(fW.codeBlock);if(E&&E[2]===void 0)I.push({type:"code",content:e.join(`
|
|
1576
1576
|
`),language:t.language,filePath:t.filePath}),c=!1,e=[],t={},n=0;else{let A=n>0&&h.startsWith(" ".repeat(n))?h.slice(n):h;e.push(A)}continue}let r=h.match(fW.codeBlock);if(r){b&&(I.push(AeI(Z,W,N)),b=!1,Z=[],W=[],N=[]),c=!0,n=r[1]?.length||0,t=wdl(r[2]||null);continue}if(fW.table.test(h)){let E=Edl(h);if(!b){Z=E,b=!0;continue}if(fW.tableSeparator.test(h)){N=ydl(h);continue}W.push(E);continue}else b&&(I.push(AeI(Z,W,N)),b=!1,Z=[],W=[],N=[]);if(fW.empty.test(h)){I.push({type:"empty",content:""});continue}if(fW.hr.test(h)){I.push({type:"hr",content:""});continue}let R=h.match(fW.heading);if(R){I.push({type:"heading",content:R[2],level:R[1].length});continue}let F=h.match(fW.ulItem);if(F){I.push({type:"list",content:F[3],listType:"ul",marker:F[2],indent:F[1].length});continue}let X=h.match(fW.olItem);if(X){I.push({type:"list",content:X[3],listType:"ol",marker:X[2]+".",indent:X[1].length});continue}let v=h.match(fW.blockquote);if(v){I.push({type:"blockquote",content:v[1]});continue}I.push({type:"text",content:h})}return c&&e.length>0&&I.push({type:"code",content:e.join(`
|
|
1577
1577
|
`),language:t.language,filePath:t.filePath}),b&&Z.length>0&&I.push(AeI(Z,W,N)),I}function Edl(l){return l.slice(1,-1).split("|").map(I=>I.trim())}function ydl(l){return l.slice(1,-1).split("|").map(I=>{let G=I.trim();return G.startsWith(":")&&G.endsWith(":")?"center":G.endsWith(":")?"right":"left"})}function AeI(l,I,G){return{type:"table",content:"",tableData:{headers:l,rows:I,alignments:G.length>0?G:l.map(()=>"left")}}}function Adl(l){return l.replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/~~(.+?)~~/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1")}var $x,fW,V1=y(()=>{"use strict";$x=new Set(["javascript","js","typescript","ts","tsx","jsx","python","py","ruby","rb","go","rust","rs","java","kotlin","kt","scala","swift","c","cpp","h","csharp","cs","php","lua","perl","r","sql","html","css","scss","sass","less","json","yaml","yml","toml","xml","ini","env","bash","sh","zsh","fish","powershell","ps1","markdown","md","text","txt","plain","diff","patch","dockerfile","makefile","cmake","graphql","gql","proto","protobuf","vim","elixir","ex","erlang","haskell","hs","ocaml","ml","fsharp","clojure","lisp","scheme","dart","zig","nim","v","wasm","solidity","sol"]);fW={codeBlock:/^(\s*)```([^\s]*?)?\s*$/,heading:/^(#{1,6})\s+(.+)/,ulItem:/^(\s*)([-*+])\s+(.+)/,olItem:/^(\s*)(\d+)\.\s+(.+)/,hr:/^[-*_]{3,}\s*$/,table:/^\|(.+)\|$/,tableSeparator:/^\|[\s]*:?-+:?[\s]*(\|[\s]*:?-+:?[\s]*)+\|?$/,blockquote:/^>\s*(.*)$/,empty:/^\s*$/}});import{spawn as rAI}from"node:child_process";function lB(l){if(process.platform==="win32"){rAI("cmd",["/c","start",'""',`"${l}"`],{detached:!0,stdio:"ignore",windowsVerbatimArguments:!0}).unref();return}let I=process.platform==="darwin"?"open":"xdg-open";rAI(I,[l],{detached:!0,stdio:"ignore"}).unref()}var CeI=y(()=>{"use strict"});var VAI={};xG(VAI,{runBilling:()=>Cdl});async function Cdl(l){let I=l.trim().toLowerCase(),G=pAI.find(e=>e.id===I);if(G)return lB(G.url),`Opening ${G.name}...
|
|
1578
1578
|
${G.url}`;let c=["## \u2B21 API Billing","","> AEGIS CLI uses auto-routing \u2014 cheapest provider selected per request.","> Pricing includes a margin on provider cost.",""];for(let e of pAI){let t=e.recommend?" \u2605 recommended":"";c.push(`**${e.name}**${t}`),c.push(`${e.description}`),c.push(`${e.pricing}`),c.push(`${e.url}`),c.push("")}return c.push("---"),c.push("Run `/billing subscribe` \xB7 `/billing claude` \xB7 `/billing deepseek` \xB7 `/billing groq` to open billing page"),c.push("After subscribing, activate with: `/memory activate <token>`"),c.join(`
|