agentix-cli 0.90.0 → 0.91.1

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.
Files changed (108) hide show
  1. package/apps/mac-voice/Sources/AgentXVoice/Character.swift +152 -0
  2. package/apps/mac-voice/Sources/AgentXVoice/CharacterDraw.swift +218 -0
  3. package/apps/mac-voice/Sources/AgentXVoice/CharacterMath.swift +145 -0
  4. package/apps/mac-voice/Sources/AgentXVoice/CharacterSim.swift +241 -0
  5. package/apps/mac-voice/Sources/AgentXVoice/Panel.swift +35 -3
  6. package/apps/mac-voice/Sources/AgentXVoice/SettingsLook.swift +19 -0
  7. package/apps/mac-voice/Sources/AgentXVoice/SettingsWindow.swift +4 -0
  8. package/apps/mac-voice/Sources/AgentXVoice/VoiceSettings.swift +7 -2
  9. package/apps/mac-voice/Sources/AgentXVoice/main.swift +11 -0
  10. package/dist/{App-LC34QQPN.js → App-PBPYFVBE.js} +2 -2
  11. package/dist/{ChatApp-FB72AK7M.js → ChatApp-QC7QAQEW.js} +2 -2
  12. package/dist/{agent-OZ4XFAD4.js → agent-BQEENICU.js} +2 -2
  13. package/dist/{board-dashboard-YBWSJ7J2.js → board-dashboard-ZLDVYPZ4.js} +4 -4
  14. package/dist/{chunk-XSVGD64O.js → chunk-24P6UR3L.js} +12 -12
  15. package/dist/chunk-24P6UR3L.js.map +1 -0
  16. package/dist/{chunk-RLXEF2X6.js → chunk-4SHWIGTM.js} +5 -5
  17. package/dist/{chunk-A5DFX47N.js → chunk-4TKGR3XF.js} +2 -2
  18. package/dist/{chunk-UWH7NTGV.js → chunk-AVA245WL.js} +2 -2
  19. package/dist/{chunk-ISIJAZGO.js → chunk-EBHHMJZX.js} +2 -2
  20. package/dist/{chunk-3SEFVZA7.js → chunk-EJPQPU5J.js} +2 -2
  21. package/dist/{chunk-QYFF2WJ2.js → chunk-ES2NYGS2.js} +2 -2
  22. package/dist/{chunk-N2OMSKIQ.js → chunk-HXM35HRM.js} +2 -2
  23. package/dist/{chunk-LCWE2GHC.js → chunk-HY6ILQ4T.js} +2 -2
  24. package/dist/{chunk-MU4S6LQA.js → chunk-L73YON3H.js} +2 -2
  25. package/dist/{chunk-64UK5VG4.js → chunk-NIQEKVWY.js} +2 -2
  26. package/dist/{chunk-LS6KXRXY.js → chunk-OKT5RCXP.js} +2 -2
  27. package/dist/{chunk-BEJCSZOQ.js → chunk-OS34M3FV.js} +2 -2
  28. package/dist/{chunk-JF5UGNMG.js → chunk-PJZ4ZHQS.js} +2 -2
  29. package/dist/{chunk-TA2BYYNZ.js → chunk-RS6BNRVF.js} +2 -2
  30. package/dist/{chunk-3GN255MT.js → chunk-S4JD5FEE.js} +2 -2
  31. package/dist/{chunk-MBVRADNG.js → chunk-SH5Y7N4W.js} +2 -2
  32. package/dist/{chunk-JLCYQZRT.js → chunk-SQOBKSP3.js} +2 -2
  33. package/dist/{chunk-TS7JDPOY.js → chunk-URVWZ5FM.js} +2 -2
  34. package/dist/{chunk-JVQXD35E.js → chunk-VCO46KQZ.js} +172 -172
  35. package/dist/{chunk-JVQXD35E.js.map → chunk-VCO46KQZ.js.map} +1 -1
  36. package/dist/{chunk-26UFDYRZ.js → chunk-ZVXKCXTP.js} +2 -2
  37. package/dist/cli.js +1 -1
  38. package/dist/{client-IPZRCNE7.js → client-WFEXHCNH.js} +2 -2
  39. package/dist/config-PPYPER75.js +2 -0
  40. package/dist/config-mutator-QQDBVKWM.js +2 -0
  41. package/dist/{doctor-BTHIQN7F.js → doctor-NRKGBTVD.js} +2 -2
  42. package/dist/index.d.ts +17 -2
  43. package/dist/index.js +1 -1
  44. package/dist/{program-PURSFZBM.js → program-TIKUIL2G.js} +165 -165
  45. package/dist/program-TIKUIL2G.js.map +1 -0
  46. package/dist/{promote-RDXNGZKX.js → promote-PY73YR6C.js} +2 -2
  47. package/dist/{query-OGMNU45Y.js → query-F3R5KXA7.js} +2 -2
  48. package/dist/{registry-LKIOKDIG.js → registry-YBMYCRQH.js} +2 -2
  49. package/dist/{request-planner-EP6QJAK5.js → request-planner-CVNEV6NJ.js} +2 -2
  50. package/dist/{review-candidates-BJPY54JI.js → review-candidates-5QTF5JRG.js} +2 -2
  51. package/dist/{routing-PZNFU3OV.js → routing-BJLETKHZ.js} +2 -2
  52. package/dist/schedule-tool-E2PRGDLW.js +2 -0
  53. package/dist/scheduler-53POJWDI.js +2 -0
  54. package/dist/{seat-4OONQEDH.js → seat-OORCKWER.js} +2 -2
  55. package/dist/{select-BR3NBXW7.js → select-OGMDS37Y.js} +2 -2
  56. package/dist/{set-enabled-Z3NKON2M.js → set-enabled-IKSHTUUF.js} +2 -2
  57. package/dist/{tool-SV55IZS3.js → tool-6FVBXUTV.js} +2 -2
  58. package/dist/{tool-DWMZ5OWI.js → tool-CKIO3NBX.js} +2 -2
  59. package/dist/wiki-4CPXUAPW.js +2 -0
  60. package/package.json +2 -2
  61. package/dist/chunk-XSVGD64O.js.map +0 -1
  62. package/dist/config-HZTKLB6A.js +0 -2
  63. package/dist/config-mutator-6S4X6WMU.js +0 -2
  64. package/dist/program-PURSFZBM.js.map +0 -1
  65. package/dist/schedule-tool-C3CE6GJG.js +0 -2
  66. package/dist/scheduler-PJMGEJMR.js +0 -2
  67. package/dist/wiki-EWEJOKP7.js +0 -2
  68. /package/dist/{App-LC34QQPN.js.map → App-PBPYFVBE.js.map} +0 -0
  69. /package/dist/{ChatApp-FB72AK7M.js.map → ChatApp-QC7QAQEW.js.map} +0 -0
  70. /package/dist/{agent-OZ4XFAD4.js.map → agent-BQEENICU.js.map} +0 -0
  71. /package/dist/{board-dashboard-YBWSJ7J2.js.map → board-dashboard-ZLDVYPZ4.js.map} +0 -0
  72. /package/dist/{chunk-RLXEF2X6.js.map → chunk-4SHWIGTM.js.map} +0 -0
  73. /package/dist/{chunk-A5DFX47N.js.map → chunk-4TKGR3XF.js.map} +0 -0
  74. /package/dist/{chunk-UWH7NTGV.js.map → chunk-AVA245WL.js.map} +0 -0
  75. /package/dist/{chunk-ISIJAZGO.js.map → chunk-EBHHMJZX.js.map} +0 -0
  76. /package/dist/{chunk-3SEFVZA7.js.map → chunk-EJPQPU5J.js.map} +0 -0
  77. /package/dist/{chunk-QYFF2WJ2.js.map → chunk-ES2NYGS2.js.map} +0 -0
  78. /package/dist/{chunk-N2OMSKIQ.js.map → chunk-HXM35HRM.js.map} +0 -0
  79. /package/dist/{chunk-LCWE2GHC.js.map → chunk-HY6ILQ4T.js.map} +0 -0
  80. /package/dist/{chunk-MU4S6LQA.js.map → chunk-L73YON3H.js.map} +0 -0
  81. /package/dist/{chunk-64UK5VG4.js.map → chunk-NIQEKVWY.js.map} +0 -0
  82. /package/dist/{chunk-LS6KXRXY.js.map → chunk-OKT5RCXP.js.map} +0 -0
  83. /package/dist/{chunk-BEJCSZOQ.js.map → chunk-OS34M3FV.js.map} +0 -0
  84. /package/dist/{chunk-JF5UGNMG.js.map → chunk-PJZ4ZHQS.js.map} +0 -0
  85. /package/dist/{chunk-TA2BYYNZ.js.map → chunk-RS6BNRVF.js.map} +0 -0
  86. /package/dist/{chunk-3GN255MT.js.map → chunk-S4JD5FEE.js.map} +0 -0
  87. /package/dist/{chunk-MBVRADNG.js.map → chunk-SH5Y7N4W.js.map} +0 -0
  88. /package/dist/{chunk-JLCYQZRT.js.map → chunk-SQOBKSP3.js.map} +0 -0
  89. /package/dist/{chunk-TS7JDPOY.js.map → chunk-URVWZ5FM.js.map} +0 -0
  90. /package/dist/{chunk-26UFDYRZ.js.map → chunk-ZVXKCXTP.js.map} +0 -0
  91. /package/dist/{client-IPZRCNE7.js.map → client-WFEXHCNH.js.map} +0 -0
  92. /package/dist/{config-HZTKLB6A.js.map → config-PPYPER75.js.map} +0 -0
  93. /package/dist/{config-mutator-6S4X6WMU.js.map → config-mutator-QQDBVKWM.js.map} +0 -0
  94. /package/dist/{doctor-BTHIQN7F.js.map → doctor-NRKGBTVD.js.map} +0 -0
  95. /package/dist/{promote-RDXNGZKX.js.map → promote-PY73YR6C.js.map} +0 -0
  96. /package/dist/{query-OGMNU45Y.js.map → query-F3R5KXA7.js.map} +0 -0
  97. /package/dist/{registry-LKIOKDIG.js.map → registry-YBMYCRQH.js.map} +0 -0
  98. /package/dist/{request-planner-EP6QJAK5.js.map → request-planner-CVNEV6NJ.js.map} +0 -0
  99. /package/dist/{review-candidates-BJPY54JI.js.map → review-candidates-5QTF5JRG.js.map} +0 -0
  100. /package/dist/{routing-PZNFU3OV.js.map → routing-BJLETKHZ.js.map} +0 -0
  101. /package/dist/{schedule-tool-C3CE6GJG.js.map → schedule-tool-E2PRGDLW.js.map} +0 -0
  102. /package/dist/{scheduler-PJMGEJMR.js.map → scheduler-53POJWDI.js.map} +0 -0
  103. /package/dist/{seat-4OONQEDH.js.map → seat-OORCKWER.js.map} +0 -0
  104. /package/dist/{select-BR3NBXW7.js.map → select-OGMDS37Y.js.map} +0 -0
  105. /package/dist/{set-enabled-Z3NKON2M.js.map → set-enabled-IKSHTUUF.js.map} +0 -0
  106. /package/dist/{tool-SV55IZS3.js.map → tool-6FVBXUTV.js.map} +0 -0
  107. /package/dist/{tool-DWMZ5OWI.js.map → tool-CKIO3NBX.js.map} +0 -0
  108. /package/dist/{wiki-EWEJOKP7.js.map → wiki-4CPXUAPW.js.map} +0 -0
@@ -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{fa as Ze,ga as et}from"./chunk-XSVGD64O.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(`
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-26UFDYRZ.js.map
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-PURSFZBM.js"),{installCliSignalExit:i}=await import("./signal-exit-WL7G3EEZ.js");i();var e=await r();process.argv.slice(2).length===0?e.outputHelp():e.parse();
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-TIKUIL2G.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-LS6KXRXY.js";import"./chunk-XSVGD64O.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-IPZRCNE7.js.map
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-QYFF2WJ2.js";import"./chunk-S2GAEH2F.js";import"./chunk-JXF54PT7.js";import"./chunk-XSVGD64O.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-BTHIQN7F.js.map
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-JVQXD35E.js";import"./chunk-N2OMSKIQ.js";import"./chunk-GTJIKXDB.js";import"./chunk-JF5UGNMG.js";import"./chunk-3SZ4CU6G.js";import"./chunk-ZVP6GB4G.js";import"./chunk-S2GAEH2F.js";import"./chunk-VZLIBDLH.js";import"./chunk-EKJG63EJ.js";import"./chunk-3SEFVZA7.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-RLXEF2X6.js";import"./chunk-MBVRADNG.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-64UK5VG4.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-TA2BYYNZ.js";import"./chunk-SZDACK6O.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-3GN255MT.js";import"./chunk-ISIJAZGO.js";import"./chunk-VWTBHLMX.js";import"./chunk-A5DFX47N.js";import{a as ht}from"./chunk-UWH7NTGV.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-JLCYQZRT.js";import"./chunk-MYVHVJWZ.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-TS7JDPOY.js";import{f as gt,g as ft}from"./chunk-BEJCSZOQ.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-26UFDYRZ.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{ba as tt,da as st,ea as ot,ga as nt}from"./chunk-XSVGD64O.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(`
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-VCO46KQZ.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).