agentix-cli 0.90.0 → 0.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/mac-voice/Sources/AgentXVoice/Character.swift +152 -0
- package/apps/mac-voice/Sources/AgentXVoice/CharacterDraw.swift +218 -0
- package/apps/mac-voice/Sources/AgentXVoice/CharacterMath.swift +145 -0
- package/apps/mac-voice/Sources/AgentXVoice/CharacterSim.swift +241 -0
- package/apps/mac-voice/Sources/AgentXVoice/Panel.swift +35 -3
- package/apps/mac-voice/Sources/AgentXVoice/SettingsLook.swift +19 -0
- package/apps/mac-voice/Sources/AgentXVoice/SettingsWindow.swift +4 -0
- package/apps/mac-voice/Sources/AgentXVoice/VoiceSettings.swift +7 -2
- package/apps/mac-voice/Sources/AgentXVoice/main.swift +11 -0
- package/dist/{App-LC34QQPN.js → App-PBPYFVBE.js} +2 -2
- package/dist/{ChatApp-FB72AK7M.js → ChatApp-QC7QAQEW.js} +2 -2
- package/dist/{agent-OZ4XFAD4.js → agent-BQEENICU.js} +2 -2
- package/dist/{board-dashboard-YBWSJ7J2.js → board-dashboard-ZLDVYPZ4.js} +4 -4
- package/dist/{chunk-XSVGD64O.js → chunk-24P6UR3L.js} +12 -12
- package/dist/chunk-24P6UR3L.js.map +1 -0
- package/dist/{chunk-RLXEF2X6.js → chunk-4SHWIGTM.js} +5 -5
- package/dist/{chunk-A5DFX47N.js → chunk-4TKGR3XF.js} +2 -2
- package/dist/{chunk-JVQXD35E.js → chunk-7RDNVR5I.js} +172 -172
- package/dist/{chunk-JVQXD35E.js.map → chunk-7RDNVR5I.js.map} +1 -1
- package/dist/{chunk-UWH7NTGV.js → chunk-AVA245WL.js} +2 -2
- package/dist/{chunk-ISIJAZGO.js → chunk-EBHHMJZX.js} +2 -2
- package/dist/{chunk-3SEFVZA7.js → chunk-EJPQPU5J.js} +2 -2
- package/dist/{chunk-QYFF2WJ2.js → chunk-ES2NYGS2.js} +2 -2
- package/dist/{chunk-N2OMSKIQ.js → chunk-HXM35HRM.js} +2 -2
- package/dist/{chunk-LCWE2GHC.js → chunk-HY6ILQ4T.js} +2 -2
- package/dist/{chunk-MU4S6LQA.js → chunk-L73YON3H.js} +2 -2
- package/dist/{chunk-64UK5VG4.js → chunk-NIQEKVWY.js} +2 -2
- package/dist/{chunk-LS6KXRXY.js → chunk-OKT5RCXP.js} +2 -2
- package/dist/{chunk-BEJCSZOQ.js → chunk-OS34M3FV.js} +2 -2
- package/dist/{chunk-JF5UGNMG.js → chunk-PJZ4ZHQS.js} +2 -2
- package/dist/{chunk-TA2BYYNZ.js → chunk-RS6BNRVF.js} +2 -2
- package/dist/{chunk-3GN255MT.js → chunk-S4JD5FEE.js} +2 -2
- package/dist/{chunk-MBVRADNG.js → chunk-SH5Y7N4W.js} +2 -2
- package/dist/{chunk-JLCYQZRT.js → chunk-SQOBKSP3.js} +2 -2
- package/dist/{chunk-TS7JDPOY.js → chunk-URVWZ5FM.js} +2 -2
- package/dist/{chunk-26UFDYRZ.js → chunk-ZVXKCXTP.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-IPZRCNE7.js → client-WFEXHCNH.js} +2 -2
- package/dist/config-PPYPER75.js +2 -0
- package/dist/config-mutator-QQDBVKWM.js +2 -0
- package/dist/{doctor-BTHIQN7F.js → doctor-NRKGBTVD.js} +2 -2
- package/dist/index.d.ts +17 -2
- package/dist/index.js +1 -1
- package/dist/{program-PURSFZBM.js → program-7YKH5WTC.js} +165 -165
- package/dist/program-7YKH5WTC.js.map +1 -0
- package/dist/{promote-RDXNGZKX.js → promote-PY73YR6C.js} +2 -2
- package/dist/{query-OGMNU45Y.js → query-F3R5KXA7.js} +2 -2
- package/dist/{registry-LKIOKDIG.js → registry-YBMYCRQH.js} +2 -2
- package/dist/{request-planner-EP6QJAK5.js → request-planner-CVNEV6NJ.js} +2 -2
- package/dist/{review-candidates-BJPY54JI.js → review-candidates-5QTF5JRG.js} +2 -2
- package/dist/{routing-PZNFU3OV.js → routing-BJLETKHZ.js} +2 -2
- package/dist/schedule-tool-E2PRGDLW.js +2 -0
- package/dist/scheduler-53POJWDI.js +2 -0
- package/dist/{seat-4OONQEDH.js → seat-OORCKWER.js} +2 -2
- package/dist/{select-BR3NBXW7.js → select-OGMDS37Y.js} +2 -2
- package/dist/{set-enabled-Z3NKON2M.js → set-enabled-IKSHTUUF.js} +2 -2
- package/dist/{tool-SV55IZS3.js → tool-6FVBXUTV.js} +2 -2
- package/dist/{tool-DWMZ5OWI.js → tool-CKIO3NBX.js} +2 -2
- package/dist/wiki-4CPXUAPW.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-XSVGD64O.js.map +0 -1
- package/dist/config-HZTKLB6A.js +0 -2
- package/dist/config-mutator-6S4X6WMU.js +0 -2
- package/dist/program-PURSFZBM.js.map +0 -1
- package/dist/schedule-tool-C3CE6GJG.js +0 -2
- package/dist/scheduler-PJMGEJMR.js +0 -2
- package/dist/wiki-EWEJOKP7.js +0 -2
- /package/dist/{App-LC34QQPN.js.map → App-PBPYFVBE.js.map} +0 -0
- /package/dist/{ChatApp-FB72AK7M.js.map → ChatApp-QC7QAQEW.js.map} +0 -0
- /package/dist/{agent-OZ4XFAD4.js.map → agent-BQEENICU.js.map} +0 -0
- /package/dist/{board-dashboard-YBWSJ7J2.js.map → board-dashboard-ZLDVYPZ4.js.map} +0 -0
- /package/dist/{chunk-RLXEF2X6.js.map → chunk-4SHWIGTM.js.map} +0 -0
- /package/dist/{chunk-A5DFX47N.js.map → chunk-4TKGR3XF.js.map} +0 -0
- /package/dist/{chunk-UWH7NTGV.js.map → chunk-AVA245WL.js.map} +0 -0
- /package/dist/{chunk-ISIJAZGO.js.map → chunk-EBHHMJZX.js.map} +0 -0
- /package/dist/{chunk-3SEFVZA7.js.map → chunk-EJPQPU5J.js.map} +0 -0
- /package/dist/{chunk-QYFF2WJ2.js.map → chunk-ES2NYGS2.js.map} +0 -0
- /package/dist/{chunk-N2OMSKIQ.js.map → chunk-HXM35HRM.js.map} +0 -0
- /package/dist/{chunk-LCWE2GHC.js.map → chunk-HY6ILQ4T.js.map} +0 -0
- /package/dist/{chunk-MU4S6LQA.js.map → chunk-L73YON3H.js.map} +0 -0
- /package/dist/{chunk-64UK5VG4.js.map → chunk-NIQEKVWY.js.map} +0 -0
- /package/dist/{chunk-LS6KXRXY.js.map → chunk-OKT5RCXP.js.map} +0 -0
- /package/dist/{chunk-BEJCSZOQ.js.map → chunk-OS34M3FV.js.map} +0 -0
- /package/dist/{chunk-JF5UGNMG.js.map → chunk-PJZ4ZHQS.js.map} +0 -0
- /package/dist/{chunk-TA2BYYNZ.js.map → chunk-RS6BNRVF.js.map} +0 -0
- /package/dist/{chunk-3GN255MT.js.map → chunk-S4JD5FEE.js.map} +0 -0
- /package/dist/{chunk-MBVRADNG.js.map → chunk-SH5Y7N4W.js.map} +0 -0
- /package/dist/{chunk-JLCYQZRT.js.map → chunk-SQOBKSP3.js.map} +0 -0
- /package/dist/{chunk-TS7JDPOY.js.map → chunk-URVWZ5FM.js.map} +0 -0
- /package/dist/{chunk-26UFDYRZ.js.map → chunk-ZVXKCXTP.js.map} +0 -0
- /package/dist/{client-IPZRCNE7.js.map → client-WFEXHCNH.js.map} +0 -0
- /package/dist/{config-HZTKLB6A.js.map → config-PPYPER75.js.map} +0 -0
- /package/dist/{config-mutator-6S4X6WMU.js.map → config-mutator-QQDBVKWM.js.map} +0 -0
- /package/dist/{doctor-BTHIQN7F.js.map → doctor-NRKGBTVD.js.map} +0 -0
- /package/dist/{promote-RDXNGZKX.js.map → promote-PY73YR6C.js.map} +0 -0
- /package/dist/{query-OGMNU45Y.js.map → query-F3R5KXA7.js.map} +0 -0
- /package/dist/{registry-LKIOKDIG.js.map → registry-YBMYCRQH.js.map} +0 -0
- /package/dist/{request-planner-EP6QJAK5.js.map → request-planner-CVNEV6NJ.js.map} +0 -0
- /package/dist/{review-candidates-BJPY54JI.js.map → review-candidates-5QTF5JRG.js.map} +0 -0
- /package/dist/{routing-PZNFU3OV.js.map → routing-BJLETKHZ.js.map} +0 -0
- /package/dist/{schedule-tool-C3CE6GJG.js.map → schedule-tool-E2PRGDLW.js.map} +0 -0
- /package/dist/{scheduler-PJMGEJMR.js.map → scheduler-53POJWDI.js.map} +0 -0
- /package/dist/{seat-4OONQEDH.js.map → seat-OORCKWER.js.map} +0 -0
- /package/dist/{select-BR3NBXW7.js.map → select-OGMDS37Y.js.map} +0 -0
- /package/dist/{set-enabled-Z3NKON2M.js.map → set-enabled-IKSHTUUF.js.map} +0 -0
- /package/dist/{tool-SV55IZS3.js.map → tool-6FVBXUTV.js.map} +0 -0
- /package/dist/{tool-DWMZ5OWI.js.map → tool-CKIO3NBX.js.map} +0 -0
- /package/dist/{wiki-EWEJOKP7.js.map → wiki-4CPXUAPW.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{v as l,w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{v as l,w}from"./chunk-ZVXKCXTP.js";import{a as i,f as p}from"./chunk-72SZI2UW.js";w();p();var d="task-tier";function u(e){return{task:m(e.message,2e3),agent:e.agent,channel:e.channel??null,continuesExistingSession:e.isFollowUp??!1,...e.toolsAvailable?{toolsAvailable:e.toolsAvailable}:{}}}var c={needsFlagship:i("This task needs the strongest available model to be done correctly.",{true:"Doing it well takes real reasoning: writing or reviewing code, diagnosing a failure, planning work across several steps, weighing a judgement, handling money, touching production or anything irreversible, following a long or ambiguous instruction, or work where being subtly wrong would not be noticed. Anything where a weaker model would produce something that LOOKS right belongs here.",false:"It is mechanical and its result is obvious on sight: acknowledging or confirming a message, restating or formatting something already written, a greeting, a status echo, reading one file and reporting what it says, a lookup with one right answer, a scheduled heartbeat with nothing to decide."})};function g(e){return e.needsFlagship.noul}function m(e,n){return e.length>n?`${e.slice(0,n)}\u2026`:e}var h=.2,T=60*60*1e3;function F(e,n){if(e==="claude-code"){let t=n?.cheapModels?.[e]??n?.cheapModel;return t&&/^(claude-|haiku$|sonnet$|opus$)/.test(t)?t:void 0}if(e==="codex-cli"){let t=n?.cheapModels?.[e];return t&&/^(gpt-|o\d)/.test(t)?t:void 0}}async function _(e){let n=(s,r=null)=>({downgraded:!1,needsFlagship:r,reason:s});if(e.channel==="voice"||e.channel==="desktop"||e.channel==="opencode")return n(`${e.channel} requests retain the configured model`);if(!e.cheapModel)return n("no cheaper model configured");if(e.isFollowUp){let s=e.sessionIdleMs??0,r=e.cacheTtlMs??T;if(s<r)return n(`follow-up on a warm cache (idle ${Math.round(s/1e3)}s) \u2014 swapping would cost more than it saves`)}let t;try{t=await l(d,u(e),c,{incumbent:{needsFlagship:1},features:{agent:e.agent,channel:e.channel??"unknown"},timeoutMs:1500})}catch{return n("routing seat threw \u2014 keeping the flagship")}if(!t)return n("routing seat unavailable \u2014 keeping the flagship");let o=g(t.answers);if(t.mode!=="active")return n(`shadow \u2014 would ${o<(e.threshold??h)?"downgrade":"keep"} (${o.toFixed(2)})`,o);let a=e.threshold??h;return o>=a?n(`needs the flagship (${o.toFixed(2)})`,o):{model:e.cheapModel,downgraded:!0,needsFlagship:o,reason:`mechanical task (${o.toFixed(2)} below ${a}) \u2192 ${e.cheapModel}`}}export{F as a,_ as b};
|
|
2
|
+
//# sourceMappingURL=chunk-SQOBKSP3.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as j,b as O,c as T,d as D,e as _,j as N}from"./chunk-
|
|
1
|
+
import{a as j,b as O,c as T,d as D,e as _,j as N}from"./chunk-OS34M3FV.js";import{b as R}from"./chunk-2GIDVZ4H.js";import{v as C,w as I}from"./chunk-ZVXKCXTP.js";import{b as v,c as W}from"./chunk-QOYAX2FT.js";import{readFileSync as Y,existsSync as B}from"fs";I();import{resolve as x}from"path";import{execSync as L}from"child_process";async function nt(n,a,o,t={}){let u=t.selectorModel??"haiku",g=t.synthModel??"sonnet",l=t.maxCandidates??3,r=t.maxHops??2,s=t.maxArticles??8,h=t.timeoutMs??6e4,p=t.log??console.error.bind(console,"[wiki-query]"),m=t.messagePath?.length?t.messagePath:void 0,w=t.graphWeight??$,i=x(a.baseDir,"_index.md");if(!B(i))return A("no-catalog",n,"No _index.md found \u2014 run `agentx wiki status` to rebuild.");let e=Y(i,"utf-8"),d=Date.now(),f=[],y="";try{let c=await G(n,a,o,l,m,w);c?(f=c,y=`[wiki-rerank seat] ${c.map(k=>k.title).join(" | ")}`):(y=await Q(q(n,e,l,m),u,h),f=K(y))}catch(c){return p("selector failed:",c?.message),{...A("error",n,`Selector: ${c?.message||"unknown"}`),trace:{selectorMs:Date.now()-d,synthesisMs:0,selectorOutput:y}}}let S=Date.now()-d;if(f.length===0)return{...A("no-candidates",n,"Selector returned no candidates."),trace:{selectorMs:S,synthesisMs:0,selectorOutput:y}};let b=F(f,a,o,r,s);if(b.length===0)return{...A("no-candidates",n,"Candidates did not resolve to readable articles."),candidates:f,trace:{selectorMs:S,synthesisMs:0,selectorOutput:y}};let M=Date.now(),P="";try{P=await Q(J(n,b),g,h*2)}catch(c){return p("synthesis failed:",c?.message),{...A("error",n,`Synthesis: ${c?.message||"unknown"}`),candidates:f,walked:b.map(k=>({title:k.meta.title,path:k.path,type:k.meta.type,hop:k.hop??0})),trace:{selectorMs:S,synthesisMs:Date.now()-M,selectorOutput:y}}}let E=Date.now()-M;return{answer:P.trim(),citations:b.map(c=>({title:c.meta.title,path:c.path,type:c.meta.type})),candidates:f,walked:b.map(c=>({title:c.meta.title,path:c.path,type:c.meta.type,hop:c.hop??0})),status:"ok",trace:{selectorMs:S,synthesisMs:E,selectorOutput:y}}}function A(n,a,o){return{answer:"",citations:[],candidates:[],walked:[],status:n,error:o}}function F(n,a,o,t,u){let g=new Map;for(let s of a.listArticles(o||""))g.set(s.meta.title.toLowerCase(),s.path);let l=new Map,r=[];for(let s of n)l.has(s.path)||r.push({path:s.path,hop:0});for(;r.length&&l.size<u;){let s=r.shift();if(l.has(s.path)||s.hop>t)continue;let h=o?a.readArticleAs(s.path,o):a.readArticle(s.path);if(h&&(l.set(s.path,{...h,hop:s.hop}),!(s.hop>=t)))for(let p of h.meta.related||[]){let m=g.get(p.toLowerCase());m&&!l.has(m)&&r.push({path:m,hop:s.hop+1})}}return Array.from(l.values())}async function G(n,a,o,t,u,g=$){try{let r=(a.rebuildIndex().articles??[]).filter(i=>i.path&&!i.path.includes("/_versions/"));if(r.length<2)return null;let h=H(n,r,u,g).slice(0,O).map(i=>({id:`k${i}`,title:r[i].title||r[i].path,tags:r[i].tags,excerpt:[r[i].type?`type: ${r[i].type}`:"",(r[i].related??[]).length?`related: ${(r[i].related??[]).join(", ")}`:"",(r[i].graphPath??[]).length?`graph: ${(r[i].graphPath??[]).join(" \u203A ")}`:""].filter(Boolean).join(" \xB7 ")})),p=await C(j,T({query:n,candidates:h,excerptChars:300}),D(h),{features:{agent:o??"unknown",stage:"catalog-selector"}});if(!p||p.mode!=="active")return null;let w=_(p.answers,h).ranked.slice(0,t).map(i=>r[Number(i.slice(1))]).filter(Boolean).map(i=>({title:i.title,path:i.path}));return w.length>0?w:null}catch{return null}}var $=.6;function H(n,a,o,t=$){let u=a.map(e=>[e.title,(e.tags??[]).join(" "),(e.related??[]).join(" ")].join(" ")),g=W(n,v(u)),l=g.reduce((e,d)=>Math.max(e,d.score),0),r=new Map(g.map(e=>[e.docIndex,l>0?e.score/l:0])),s=!!o?.length,h=e=>s&&e.graphPath?.length?N(o,e.graphPath):0,p=(e,d)=>d.score-e.score||e.i-d.i,m=a.map((e,d)=>({i:d,score:(r.get(d)??0)*(1+t*h(e))})).filter(e=>r.has(e.i)).sort(p),w=a.map((e,d)=>({i:d,score:h(e)})).filter(e=>!r.has(e.i)&&e.score>0).sort(p),i=[...m,...w].map(e=>e.i);for(let e=0;e<a.length;e++)i.includes(e)||i.push(e);return i}function q(n,a,o,t){let u=t?.length?`
|
|
2
2
|
## Intent
|
|
3
3
|
|
|
4
4
|
The request was classified under the intent-graph path "${t.join(" \u203A ")}". Prefer articles filed under the same branch when their titles are equally plausible.
|
|
@@ -46,4 +46,4 @@ ${o}
|
|
|
46
46
|
Answer the question in 2\u20136 sentences. Cite articles by their title in square brackets like [Article Title]. If the articles do not answer the question, say so plainly (do not invent). Prefer concrete facts over hedging.
|
|
47
47
|
|
|
48
48
|
Output ONLY the answer \u2014 no preamble, no "here is my answer:", no markdown fencing.`}function K(n){let a=n.match(/\[[\s\S]*?\]/);if(!a)return[];try{let o=JSON.parse(a[0]);return Array.isArray(o)?o.filter(t=>t&&typeof t.title=="string"&&typeof t.path=="string").map(t=>({title:t.title,path:t.path})):[]}catch{return[]}}async function Q(n,a,o){let{writeFileSync:t,mkdirSync:u,rmSync:g}=await import("fs"),{tmpdir:l}=await import("os"),r=x(l(),`agentx-wiki-query-${process.pid}`);u(r,{recursive:!0});let s=x(r,`prompt-${Date.now()}.txt`);t(s,n);try{let h=`cat '${s}' | claude -p - --output-format json --max-turns 1 --model ${a} --disallowedTools "Bash Read Write Edit Glob Grep Agent WebSearch WebFetch NotebookEdit"`,p=L(h,{env:R({...process.env}),encoding:"utf-8",timeout:o,maxBuffer:4*1024*1024});try{let m=JSON.parse(p);return String(m.result||m.content||"")}catch{return p}}finally{try{g(s,{force:!0})}catch{}}}export{nt as a,$ as b,H as c};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-URVWZ5FM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as tt,b as nt,c as rt,d as S,e as A,f as v}from"./chunk-72SZI2UW.js";import{a as Te,b as gt}from"./chunk-FX3D7YON.js";import{a as ne,b as We}from"./chunk-FCPTN6NF.js";import{o as we,p as He}from"./chunk-5MUJZODV.js";import{
|
|
1
|
+
import{a as tt,b as nt,c as rt,d as S,e as A,f as v}from"./chunk-72SZI2UW.js";import{a as Te,b as gt}from"./chunk-FX3D7YON.js";import{a as ne,b as We}from"./chunk-FCPTN6NF.js";import{o as we,p as He}from"./chunk-5MUJZODV.js";import{ga as Ze,ha as et}from"./chunk-24P6UR3L.js";import{a as ot,b as st,c as it,d as at,e as ct,f as ut,g as lt,h as dt,i as pt,j as mt,k as bt,l as ft}from"./chunk-RGDKHYY2.js";import{a as E,b as Ke,c as he}from"./chunk-QIJLFPWE.js";function R(e,t){$.set(e,t),X.delete(e)}function D(e){let t=X.get(e);if(t)return t;let r=$.get(e);if(!r){let o=Ee();throw new Error(`unknown decision backend "${e}"`+(o.length>0?` \u2014 registered: ${o.join(", ")}`:" \u2014 none registered"))}let n=r();return X.set(e,n),n}function Ee(){return[...$.keys()].sort()}function yt(){$.clear(),X.clear()}var $,X,C=E(()=>{"use strict";$=new Map,X=new Map});import ht from"better-sqlite3";import{createHash as wt}from"crypto";import{mkdirSync as Tt}from"fs";import{dirname as Et,resolve as kt}from"path";function Q(e){if(e.type==="noul"){let r=e.noul,n={yes:r,no:1-r},o=r>=.5?"yes":"no",s=Math.abs(r-.5)*2;return{predicted:o,confidence:s,probabilities:n,topLabel:o,topProb:Math.max(r,1-r),expectedScore:null,pMax:Math.max(r,1-r),negEntropy:s}}if(e.type==="choice")return{predicted:e.choice,confidence:e.confidence,probabilities:{...e.probabilities},topLabel:e.choice,topProb:e.probabilities[e.choice]??0,expectedScore:null,pMax:e.pMax,negEntropy:e.negEntropy};let t=String(Math.round(e.score));return{predicted:t,confidence:e.confidence,probabilities:{...e.probabilities},topLabel:t,topProb:e.probabilities[t]??0,expectedScore:e.score,pMax:e.pMax,negEntropy:e.negEntropy}}function xt(e){if(typeof e!="string"||e.length===0)return{};try{let t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function St(e){e.exec("CREATE TABLE IF NOT EXISTS schema_version (v INTEGER PRIMARY KEY);");let t=e.prepare("SELECT MAX(v) AS v FROM schema_version").get().v??0;t<1&&_t(e),t<2&&Rt(e),t<3&&At(e)}function At(e){e.exec(`
|
|
2
2
|
ALTER TABLE decision_calls ADD COLUMN features_json TEXT;
|
|
3
3
|
INSERT INTO schema_version (v) VALUES (3);
|
|
4
4
|
`)}function Rt(e){e.exec(`
|
|
@@ -111,4 +111,4 @@ import{a as tt,b as nt,c as rt,d as S,e as A,f as v}from"./chunk-72SZI2UW.js";im
|
|
|
111
111
|
`)}if(!m)throw new Error(`local decision backend could not get a valid answer after ${f+1} attempt(s): ${h}`);let M={},L=!1;for(let[k,q]of Object.entries(s.questions)){let x=_(q,m[k],{normalize:e.normalizeProbabilities??!0});M[k]=x.answer,x.repaired&&(L=!0)}return{model:a,answers:M,usage:y,meta:{backend:"local",structureMode:c,answerMode:"probabilities",repaired:L,retries:f,stateTruncated:l.truncated,latencyMs:Date.now()-i}}}finally{b()}}}}async function Vt(e,t,r,n,o){if(!e.generateRaw)throw new Error(`provider "${e.name}" has no generateRaw(); use structureMode "text"`);let s=[{role:"user",content:r},...n?[{role:"user",content:n}]:[]],i=await e.generateRaw(s,J,[{name:U,description:"Report a probability distribution for every question.",input_schema:se(t)}],{...o,toolChoice:{type:"tool",name:U}}),a=i.content.find(c=>c.type==="tool_use"&&c.name===U),u=a&&a.type==="tool_use"?a.input:null;return{answers:Be(u),usage:{inputTokens:i.usage.input_tokens,outputTokens:i.usage.output_tokens}}}async function zt(e,t,r,n,o){let s=[r,ae(t)].join(`
|
|
112
112
|
`),i=[{role:"system",content:J},{role:"user",content:s},...n?[{role:"user",content:n}]:[]],a=await e.generate(i,o);return{answers:Be(Te(a.content??"")),usage:{inputTokens:0,outputTokens:a.tokensUsed??0}}}function Be(e){if(e&&typeof e=="object"&&!Array.isArray(e)){let t=e;if(t.answers&&typeof t.answers=="object")return t.answers}return e}function Jt(e,t){return e!=="auto"?e:t.generateRaw&&me[t.name]?.structuredOutput?"tool":"text"}function Gt(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(new Error(`decision timed out after ${t}ms`)),t),o=()=>r.abort(e?.reason);return e&&(e.aborted?o():e.addEventListener("abort",o,{once:!0})),{signal:r.signal,dispose:()=>{clearTimeout(n),e?.removeEventListener("abort",o)}}}var Bt,qt,Xt,Ue,$t,be=E(()=>{"use strict";He();Fe();gt();j();Y();v();z();Bt="claude-code",qt="claude-haiku-4-5-20251001",Xt=24e3,Ue=2e3,$t=3e4});import{readFileSync as Yt}from"fs";import{homedir as Kt}from"os";import{join as Ht}from"path";function N(e={}){let t=(e.baseUrl??Wt).replace(/\/+$/,""),r=e.path??"/classifier",n=e.name??"simple-jev",o=e.maxStateChars??en,s=e.maxChoiceOptions??tn,i={probabilitySource:e.probabilitySource??"logits",calibratedProbabilities:!1,maxChoiceOptions:s,maxStateChars:o,parallelQuestions:!0,images:!1};return{name:n,capabilities:i,async decide(a){A(a.questions),sn(a.questions,s);let u=Date.now(),c=a.model??e.model;if(!c)throw new Error("simple-jev backend needs a model id");let l=G(a.state,o),p=e.fetchImpl??fetch,{signal:g,dispose:d}=an(a.abortSignal,a.timeoutMs??e.timeoutMs??Zt);try{let b={"Content-Type":"application/json"},y=on(e.apiKeyEnv,e.apiKeyFile);y&&(b.Authorization=`Bearer ${y}`);let w=await qe(p(`${t}${r}`,{method:"POST",headers:b,body:JSON.stringify({model:c,state:l.text,questions:rn(a.questions)}),signal:g}),g);if(!w.ok){let k=await w.text().catch(()=>"");throw new Error(`${n} ${w.status}: ${k.slice(0,300)}`)}let f=await qe(w.json(),g),m=P(a.questions).safeParse(f.answers);if(!m.success)throw new Error(`${n} returned a response that does not match the requested questions (contract drift, not a model slip \u2014 retrying will not help):
|
|
113
113
|
${F(m.error)}`);let h=m.data,M={},L=!1;for(let[k,q]of Object.entries(a.questions)){let x=_(q,h[k]);M[k]=x.answer,x.repaired&&(L=!0)}return{model:f.model??c,answers:M,usage:{inputTokens:f.usage?.input_tokens??0,outputTokens:f.usage?.output_tokens??0},meta:{backend:n,structureMode:i.probabilitySource==="native"?"native":"logprobs",answerMode:"probabilities",repaired:L,retries:0,stateTruncated:l.truncated,latencyMs:Date.now()-u}}}finally{d()}}}}function rn(e){let t={};for(let[r,n]of Object.entries(e))t[r]=n.instructions?n:{...n,instructions:nn[n.type]};return t}function on(e,t){let r=e?process.env[e]:void 0;if(r)return r;if(!t)return;let n=t.startsWith("~/")?Ht(Kt(),t.slice(2)):t;if(!Z.has(n))try{let o=Yt(n,"utf-8").trim();Z.set(n,o.length>0?o:null)}catch{Z.set(n,null)}return Z.get(n)??void 0}function sn(e,t){for(let[r,n]of Object.entries(e))if(n.type==="choice"){let o=Object.keys(n.criteria).length;if(o>t)throw new Error(`question "${r}": accepts at most ${t} choice options, got ${o}`)}else if(n.type==="score"&&n.criteria.length>t)throw new Error(`question "${r}": accepts at most ${t} score levels, got ${n.criteria.length}`)}function qe(e,t){return t.aborted?Promise.reject(t.reason??new Error("aborted")):new Promise((r,n)=>{let o=()=>n(t.reason??new Error("aborted"));t.addEventListener("abort",o,{once:!0}),e.then(s=>{t.removeEventListener("abort",o),r(s)},s=>{t.removeEventListener("abort",o),n(s)})})}function an(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(new Error(`decision timed out after ${t}ms`)),t),o=()=>r.abort(e?.reason);return e&&(e.aborted?o():e.addEventListener("abort",o,{once:!0})),{signal:r.signal,dispose:()=>{clearTimeout(n),e?.removeEventListener("abort",o)}}}var Wt,Zt,en,tn,nn,Z,fe=E(()=>{"use strict";j();v();z();Y();Wt="http://127.0.0.1:8000/v1",Zt=3e4,en=6e3,tn=50;nn={choice:"Which option best fits?",score:"Which level best fits?",noul:"Is this true of the state?"};Z=new Map});var Xe={};Ke(Xe,{DecisionStore:()=>I,MAX_CHOICE_OPTIONS:()=>MAX_CHOICE_OPTIONS,SYSTEM_PROMPT:()=>J,TOOL_NAME:()=>U,UNCERTAINTY_HIGH:()=>Ce,UNCERTAINTY_LOW:()=>De,_resetDecisionBackendsForTesting:()=>yt,agreement:()=>ot,answerView:()=>Q,applyRecalibrator:()=>ue,applyTemperature:()=>dt,askSeat:()=>mn,band:()=>Ie,bootstrapInterval:()=>mt,brier:()=>ct,buildDesign:()=>ve,calibrationReport:()=>bt,choice:()=>nt,compareCalibrators:()=>Dt,confidenceFor:()=>re,configureDecisions:()=>un,coverageCurve:()=>lt,createLocalDecisionBackend:()=>W,createMockDecisionBackend:()=>H,createSimpleJevBackend:()=>N,decisionsRuntime:()=>dn,describeIssues:()=>F,ece:()=>it,expectedScore:()=>Ae,finalizeAnswer:()=>_,fitLogistic:()=>Ne,fitRecalibrator:()=>B,fitTemperature:()=>pt,getDecisionBackend:()=>D,getSeatMode:()=>ze,labelsOf:()=>S,listDecisionBackends:()=>Ee,logLoss:()=>ut,logit:()=>le,mce:()=>at,measureConsistency:()=>jt,normalizeDistribution:()=>xe,normalizedNegEntropy:()=>oe,noul:()=>tt,pMax:()=>Se,parseSeatMode:()=>ge,rawAnswerSchema:()=>Re,rawAnswersSchema:()=>P,recordSeatOutcome:()=>pn,registerBuiltinDecisionBackends:()=>cn,registerDecisionBackend:()=>R,reliabilityBins:()=>st,renderQuestions:()=>_e,renderShapeInstructions:()=>ae,renderState:()=>G,renderUserPrompt:()=>ie,resetDecisionsRuntime:()=>ln,score:()=>rt,seatEnvVar:()=>Ve,sigmoid:()=>de,toolInputSchema:()=>se,validateQuestions:()=>A,withUid:()=>Qe});function cn(e={},t={},r={},n={}){R("mock",()=>H()),R("local",()=>W(e)),R("simple-jev",()=>N(t)),R("jev",()=>N({name:"jev",baseUrl:"https://openrouter.ai/api/alpha",path:"/decisions",model:"jev-latest",apiKeyEnv:"OPENROUTER_API_KEY",apiKeyFile:"~/.agentx/openrouter-key.txt",probabilitySource:"native",maxChoiceOptions:255,maxStateChars:9e4,...r})),R("typesafe",()=>N({name:"typesafe",baseUrl:"https://api.typesafe.ai/v1",path:"/systemone",model:"jev-latest",apiKeyEnv:"TYPESAFE_API_KEY",apiKeyFile:"~/.agentx/typesafe-key.txt",probabilitySource:"native",maxChoiceOptions:255,maxStateChars:9e4,...n}))}var $e=E(()=>{"use strict";ke();v();j();z();C();Y();V();ft();Me();je();Je();pe();be();fe();C();pe();be();fe()});function un(e){T={...ye,...T,...e},ee=!0}function ln(){T={...ye,seats:{}},ee=!1}function bn(){if(!ee){ee=!0;try{let{loadDaemonConfig:e}=(et(),he(Ze)),t=e()?.decisions;if(!t?.enabled)return;let{registerBuiltinDecisionBackends:r}=($e(),he(Xe)),n=t.backends??{};r(n.local,n.simpleJev,n.jev,n.typesafe);let o=null;try{o=new I({path:t.dbPath})}catch{}T={enabled:!0,defaultBackend:t.defaultBackend,store:o,seats:Object.fromEntries(Object.entries(t.seats??{}).map(([s,i])=>[s,{...i,redactState:t.redactState,keepStateRows:t.keepStateRows}]))}}catch{}}}function dn(){return T}function ge(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return fn.includes(t)?t:null}function Ve(e){return`AGENTX_DECISION_SEAT_${e.toUpperCase().replace(/[^A-Z0-9]+/g,"_")}`}function ze(e,t=process.env){bn();let r=ge(t[Ve(e)]);return r||(T.enabled?ge(T.seats[e]?.mode)??"off":"off")}function pn(e,t,r=!1){if(!(!e||!T.store))try{T.store.recordOutcome(e,t,r)}catch{}}async function mn(e,t,r,n={}){let o=ze(e);if(o==="off")return null;let s=T.seats[e]??{mode:o},i=n.backend??s.backend??T.defaultBackend,a=Date.now();try{let c=await D(i).decide({state:t,questions:r,model:n.model??s.model,abortSignal:n.signal,timeoutMs:n.timeoutMs??s.timeoutMs}),l=gn(e,o,t,r,c,n,s);return{answers:c.answers,callId:l,mode:o}}catch(u){return yn(e,o,t,r,i,n,s,a,u),hn(e,i,u),null}}function gn(e,t,r,n,o,s,i){if(!T.store)return null;try{return T.store.recordCall({seat:e,mode:t,backend:o.meta.backend,model:o.model,meta:o.meta,state:r,questions:n,answers:o.answers,usage:o.usage,incumbent:Ye(s.incumbent),links:s.links,features:s.features,keepState:!i.redactState})}catch{return null}}function yn(e,t,r,n,o,s,i,a,u){if(T.store)try{T.store.recordCall({seat:e,mode:t,backend:o,model:s.model??i.model??"unknown",meta:{structureMode:"text",answerMode:"probabilities",retries:0,stateTruncated:!1,latencyMs:Date.now()-a},state:r,questions:n,answers:{},incumbent:Ye(s.incumbent),links:s.links,features:s.features,error:String(u?.message??u).slice(0,500),keepState:!i.redactState})}catch{}}function Ye(e){if(!e)return;let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]={value:n});return t}function hn(e,t,r){let n=Date.now();n-Ge<6e4||(Ge=n,console.warn(`[decisions] seat "${e}" on backend "${t}" failed: ${r?.message??r}`))}var ye,T,ee,fn,Ge,Je=E(()=>{C();V();ye={enabled:!1,defaultBackend:"local",seats:{},store:null},T={...ye},ee=!1;fn=["off","shadow","active"];Ge=0});export{D as a,Ee as b,C as c,I as d,V as e,Dt as f,Me as g,jt as h,je as i,me as j,Un as k,Fe as l,cn as m,$e as n,un as o,ln as p,dn as q,ge as r,Ve as s,ze as t,pn as u,mn as v,Je as w};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-ZVXKCXTP.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as o}from"./chunk-JXF54PT7.js";import"./chunk-QIJLFPWE.js";var s=o(process.versions.node);s&&(console.error(s),process.exit(1));var{buildProgram:r}=await import("./program-
|
|
2
|
+
import{b as o}from"./chunk-JXF54PT7.js";import"./chunk-QIJLFPWE.js";var s=o(process.versions.node);s&&(console.error(s),process.exit(1));var{buildProgram:r}=await import("./program-7YKH5WTC.js"),{installCliSignalExit:i}=await import("./signal-exit-WL7G3EEZ.js");i();var e=await r();process.argv.slice(2).length===0?e.outputHelp():e.parse();
|
|
3
3
|
//# sourceMappingURL=cli.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=client-
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-OKT5RCXP.js";import"./chunk-24P6UR3L.js";import"./chunk-RJ7DASOU.js";import"./chunk-BRK6M6LA.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{b as fetchAgents,d as fetchCrons,c as fetchProcesses,e as killProcess,a as resolveConn,f as sendTask,g as streamTask};
|
|
2
|
+
//# sourceMappingURL=client-WFEXHCNH.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$ as h,U as a,V as b,W as c,X as d,Y as e,Z as f,_ as g,aa as i,ba as j,ca as k,da as l,ea as m,fa as n,ha as o}from"./chunk-24P6UR3L.js";import"./chunk-RJ7DASOU.js";import"./chunk-BRK6M6LA.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";o();export{a as INTEGRATION_KINDS,j as approvalsConfigSchema,d as callsSchema,c as cameraBotSchema,k as daemonConfigSchema,b as eventSubscriptionSchema,l as expandEnvVars,m as loadDaemonConfig,h as membersConfigSchema,g as peopleConfigSchema,f as personSchema,i as requestStatusConfigSchema,e as requestsConfigSchema,n as validateWorkspaces};
|
|
2
|
+
//# sourceMappingURL=config-PPYPER75.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-EBHHMJZX.js";import"./chunk-24P6UR3L.js";import"./chunk-RJ7DASOU.js";import"./chunk-BRK6M6LA.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{b as applyConfigMutation,a as findConfigPath,d as getAtPath,c as setAtPath,e as unsetAtPath};
|
|
2
|
+
//# sourceMappingURL=config-mutator-QQDBVKWM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=doctor-
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-ES2NYGS2.js";import"./chunk-S2GAEH2F.js";import"./chunk-JXF54PT7.js";import"./chunk-24P6UR3L.js";import"./chunk-RJ7DASOU.js";import"./chunk-BRK6M6LA.js";import"./chunk-2QNT5JDS.js";import"./chunk-QIJLFPWE.js";export{e as daemonVoiceCheck,b as doctor,a as runDoctorChecks,c as runNotificationChecks,d as runReminderChecks};
|
|
2
|
+
//# sourceMappingURL=doctor-NRKGBTVD.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -5156,6 +5156,10 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5156
5156
|
talk?: string | undefined;
|
|
5157
5157
|
paste?: string | undefined;
|
|
5158
5158
|
}>>;
|
|
5159
|
+
/** What shows the assistant's state in AgentX Voice: the "orb" at
|
|
5160
|
+
* the pill's head, or the "character", the orb grown into a small
|
|
5161
|
+
* creature that hovers above the bottom edge of the screen. */
|
|
5162
|
+
look: z.ZodDefault<z.ZodEnum<["orb", "character"]>>;
|
|
5159
5163
|
/** The answer text AgentX Voice shows inside its pill. */
|
|
5160
5164
|
card: z.ZodDefault<z.ZodObject<{
|
|
5161
5165
|
/** Seconds the answer stays open once it has been spoken; 0 keeps
|
|
@@ -5188,6 +5192,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5188
5192
|
talk: string;
|
|
5189
5193
|
paste: string;
|
|
5190
5194
|
};
|
|
5195
|
+
look: "orb" | "character";
|
|
5191
5196
|
system?: string | Record<string, string> | undefined;
|
|
5192
5197
|
listener?: string | undefined;
|
|
5193
5198
|
}, {
|
|
@@ -5210,9 +5215,15 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5210
5215
|
talk?: string | undefined;
|
|
5211
5216
|
paste?: string | undefined;
|
|
5212
5217
|
} | undefined;
|
|
5218
|
+
look?: "orb" | "character" | undefined;
|
|
5213
5219
|
}>>;
|
|
5214
5220
|
business: z.ZodOptional<z.ZodObject<{
|
|
5215
5221
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
5222
|
+
/**
|
|
5223
|
+
* Canonical kind list — for autocomplete + doctor validation. Open string
|
|
5224
|
+
* schema so new services drop in without a bump; doctor warns when a kind
|
|
5225
|
+
* is outside this list.
|
|
5226
|
+
*/
|
|
5216
5227
|
timezone: z.ZodDefault<z.ZodString>;
|
|
5217
5228
|
mainChannel: z.ZodObject<{
|
|
5218
5229
|
channel: z.ZodString;
|
|
@@ -5279,7 +5290,9 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5279
5290
|
reportsTo: z.ZodOptional<z.ZodString>;
|
|
5280
5291
|
schedule: z.ZodObject<{
|
|
5281
5292
|
days: z.ZodDefault<z.ZodArray<z.ZodEnum<["mon", "tue", "wed", "thu", "fri", "sat", "sun"]>, "many">>;
|
|
5282
|
-
start: z.ZodString;
|
|
5293
|
+
start: z.ZodString; /**
|
|
5294
|
+
* Load .env file into process.env (simple, no dependency).
|
|
5295
|
+
*/
|
|
5283
5296
|
end: z.ZodString;
|
|
5284
5297
|
lunch: z.ZodOptional<z.ZodObject<{
|
|
5285
5298
|
start: z.ZodString;
|
|
@@ -5569,7 +5582,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5569
5582
|
name: string;
|
|
5570
5583
|
description?: string | undefined;
|
|
5571
5584
|
color?: string | undefined;
|
|
5572
|
-
}>, "many">>;
|
|
5585
|
+
}>, "many">>; /** Service identifier — open string, well-known values in INTEGRATION_KINDS. */
|
|
5573
5586
|
columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
5574
5587
|
id: z.ZodString;
|
|
5575
5588
|
title: z.ZodString;
|
|
@@ -6624,6 +6637,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
6624
6637
|
talk: string;
|
|
6625
6638
|
paste: string;
|
|
6626
6639
|
};
|
|
6640
|
+
look: "orb" | "character";
|
|
6627
6641
|
system?: string | Record<string, string> | undefined;
|
|
6628
6642
|
listener?: string | undefined;
|
|
6629
6643
|
};
|
|
@@ -7390,6 +7404,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
7390
7404
|
talk?: string | undefined;
|
|
7391
7405
|
paste?: string | undefined;
|
|
7392
7406
|
} | undefined;
|
|
7407
|
+
look?: "orb" | "character" | undefined;
|
|
7393
7408
|
} | undefined;
|
|
7394
7409
|
dashboard?: {
|
|
7395
7410
|
enabled?: boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as St,b as kt,c as vt,d as xt,da as Tt,e as $t,ea as Mt,f as Ct,g as Pt,h as bt}from"./chunk-
|
|
1
|
+
import{a as St,b as kt,c as vt,d as xt,da as Tt,e as $t,ea as Mt,f as Ct,g as Pt,h as bt}from"./chunk-7RDNVR5I.js";import"./chunk-HXM35HRM.js";import"./chunk-GTJIKXDB.js";import"./chunk-PJZ4ZHQS.js";import"./chunk-3SZ4CU6G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S2GAEH2F.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-EJPQPU5J.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-ACFQBLPX.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-4L244AW4.js";import"./chunk-XIYWXCNU.js";import"./chunk-PPUN7YHA.js";import{Z as yt,m as lt,n as ct,o as dt,p as mt,q as pt}from"./chunk-4SHWIGTM.js";import"./chunk-SH5Y7N4W.js";import"./chunk-GLQLCBJS.js";import"./chunk-DP7RTNDM.js";import{a as L}from"./chunk-C245D4BZ.js";import{A as D,B as z,C as V,a as ye,b as we,c as Se,d as Ae,e as Ie,f as Oe,g as Ne,h as He,i as je,j as Ue,k as _e,l as I,m as q,n as Be,o as qe,p as Ye,q as O,r as ze,s as Ve,t as Xe,u as x,v as Y,w as Qe,x as Ze,y as et,z as wt}from"./chunk-NIQEKVWY.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-Y4CYQV7G.js";import"./chunk-LLNPKE7H.js";import"./chunk-SHEUCITK.js";import"./chunk-RS6BNRVF.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-S4JD5FEE.js";import"./chunk-EBHHMJZX.js";import"./chunk-VWTBHLMX.js";import"./chunk-4TKGR3XF.js";import{a as ht}from"./chunk-AVA245WL.js";import"./chunk-KA2UIZXG.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-SQOBKSP3.js";import"./chunk-MYVHVJWZ.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-URVWZ5FM.js";import{f as gt,g as ft}from"./chunk-OS34M3FV.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-ZVXKCXTP.js";import"./chunk-72SZI2UW.js";import"./chunk-FX3D7YON.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import{a as ke,b as ve,c as xe,d as $e,e as Ce,f as Pe,g as be,h as Te,i as Me,j as Re,l as Ee,m as Ge,o as T,p as W}from"./chunk-5MUJZODV.js";import{a as m,b as G}from"./chunk-7I7IEX4S.js";import{b as Fe,c as Le,d as A,e as De}from"./chunk-JHCI6XCJ.js";import{a as Ke,b as Je,e as We}from"./chunk-DSYKYZMT.js";import{ca as tt,ea as st,fa as ot,ha as nt}from"./chunk-24P6UR3L.js";import"./chunk-RJ7DASOU.js";import"./chunk-BRK6M6LA.js";import"./chunk-2QNT5JDS.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";W();G();import{execa as Rt}from"execa";import{existsSync as se,promises as X}from"fs";import S from"path";import ie from"node-fetch";async function Et(o,e){let t=o.split("/");if(t.length<2)throw new Error(`Invalid skill package ID: ${o}. Expected format: owner/repo`);let s=t[0],i=t[1],n=t[2];try{let a=n?`${s}/${i}/${n}`:`${s}/${i}`;await Rt("npx",["-y","skills","add",a],{cwd:e,stdio:"pipe"}),m.success(`Installed skill package: ${o}`);let r=S.resolve(e,".skills",`${s}_${i}`);if(se(r))return await ne(r,o);let d=S.resolve(e,".skills");return se(d)?await ne(d,o):[]}catch{return m.info(`Fetching skills directly from GitHub: ${s}/${i}`),await Gt(s,i,n,e)}}async function Gt(o,e,t,s){let i=[];try{let n=`https://api.github.com/repos/${o}/${e}/git/trees/main?recursive=1`,a=await ie(n);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let d=(await a.json()).tree.filter(p=>p.type==="blob"&&p.path.endsWith("SKILL.md"));if(t){let p=d.find(f=>f.path.includes(`/${t}/`)||f.path===`${t}/SKILL.md`);if(p){let f=await oe(o,e,p.path,s);f&&i.push(f)}}else for(let p of d){let f=await oe(o,e,p.path,s);f&&i.push(f)}}catch(n){m.error(`Failed to fetch skills from GitHub: ${n.message}`)}return i}async function oe(o,e,t,s){try{let i=`https://raw.githubusercontent.com/${o}/${e}/main/${t}`,n=await ie(i);if(!n.ok)return null;let a=await n.text(),r=A(a);if(r){r.source="remote",r.packageId=`${o}/${e}`;let d=S.dirname(t),p=S.resolve(s,".skills",`${o}_${e}`,d);await X.mkdir(p,{recursive:!0}),await X.writeFile(S.resolve(p,"SKILL.md"),a),r.path=S.resolve(p,"SKILL.md")}return r}catch{return null}}async function ne(o,e){let t=[],{default:s}=await import("fast-glob"),i=await s.glob("**/SKILL.md",{cwd:o,deep:5});for(let n of i)try{let a=S.resolve(o,n),r=await X.readFile(a,"utf8"),d=A(r);d&&(d.source="remote",d.path=a,d.packageId=e,t.push(d))}catch{}return t}async function At(o,e,t,s,i){let n=["---",`name: ${o}`,`description: ${e}`];if(s?.length){n.push("tags:");for(let a of s)n.push(` - ${a}`)}if(i?.length){n.push("globs:");for(let a of i)n.push(` - ${a}`)}return n.push("---"),`${n.join(`
|
|
2
2
|
`)}
|
|
3
3
|
|
|
4
4
|
${t}`}async function It(o){let{loadLocalSkills:e}=await import("./loader-YFVSSYSL.js");return e(o)}async function Ot(o,e,t,s,i){let a=[{role:"system",content:`You are a skill author for the Agent Skills ecosystem (skills.sh).
|