agentix-cli 0.70.1 → 0.72.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/CallModel.swift +55 -0
- package/apps/mac-voice/Sources/AgentXVoice/Calls.swift +172 -0
- package/apps/mac-voice/Sources/AgentXVoice/Panel.swift +28 -3
- package/apps/mac-voice/Sources/AgentXVoice/StatusMenu.swift +2 -0
- package/apps/mac-voice/Sources/AgentXVoice/main.swift +108 -4
- package/dist/{App-LFQTOADB.js → App-244WEQJR.js} +2 -2
- package/dist/{ChatApp-RNMG2HWX.js → ChatApp-SFP6SHUU.js} +2 -2
- package/dist/{agent-7IW6472I.js → agent-PMNBXRFW.js} +2 -2
- package/dist/{board-dashboard-MYWXVYU3.js → board-dashboard-J34PSEJS.js} +491 -217
- package/dist/board-dashboard-J34PSEJS.js.map +1 -0
- package/dist/{chunk-4HCQEGXO.js → chunk-335JCO5R.js} +184 -179
- package/dist/chunk-335JCO5R.js.map +1 -0
- package/dist/{chunk-FEQ4W4XA.js → chunk-55N4VTWX.js} +2 -2
- package/dist/{chunk-5FD7HE2J.js → chunk-576L7ZFD.js} +2 -2
- package/dist/{chunk-D3RJMC37.js → chunk-7XR5LGLD.js} +2 -2
- package/dist/{chunk-YFROK44Z.js → chunk-DMWFRKWR.js} +2 -2
- package/dist/{chunk-7334DGUO.js → chunk-FMUOVVXX.js} +2 -2
- package/dist/chunk-FWQVXZ5T.js +154 -0
- package/dist/chunk-FWQVXZ5T.js.map +1 -0
- package/dist/{chunk-KTGPH77J.js → chunk-J6RZOP7Z.js} +2 -2
- package/dist/{chunk-DXAWW7ZQ.js → chunk-MESWF2ZM.js} +2 -2
- package/dist/chunk-MYVHVJWZ.js +2 -0
- package/dist/chunk-MYVHVJWZ.js.map +1 -0
- package/dist/{chunk-2DWDXT7G.js → chunk-OSHG52OO.js} +65 -65
- package/dist/chunk-OSHG52OO.js.map +1 -0
- package/dist/{chunk-MTPCD4NV.js → chunk-OWRPCMGW.js} +236 -211
- package/dist/chunk-OWRPCMGW.js.map +1 -0
- package/dist/{chunk-RKZGENSE.js → chunk-PBRI3MTE.js} +2 -2
- package/dist/{chunk-KTNOY4LW.js → chunk-PC5LKW3L.js} +2 -2
- package/dist/{chunk-4J4YVJFH.js → chunk-PHSYP22H.js} +2 -2
- package/dist/{chunk-7PWXCN22.js → chunk-PY54XYAG.js} +2 -2
- package/dist/{chunk-LKA5UUGT.js → chunk-QKV7FN67.js} +2 -2
- package/dist/chunk-RAYOK4GI.js +15 -0
- package/dist/chunk-RAYOK4GI.js.map +1 -0
- package/dist/{chunk-RN7G3D53.js → chunk-TT4T6CB3.js} +2 -2
- package/dist/{chunk-3ZRFES25.js → chunk-UFPWMNUW.js} +2 -2
- package/dist/{chunk-MOUSATFW.js → chunk-VWMO4C72.js} +2 -2
- package/dist/{chunk-O2QVQVOV.js → chunk-YVLFX35J.js} +2 -2
- package/dist/{chunk-N4EIYNN4.js → chunk-Z5TXWHDN.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client-L4JAPXTE.js +2 -0
- package/dist/config-X7BHZ75G.js +2 -0
- package/dist/config-mutator-R2KBGTZJ.js +2 -0
- package/dist/doctor-5VFQVAVC.js +2 -0
- package/dist/index.d.ts +151 -11
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/opencode-launch-ECMEY2QZ.js +2 -0
- package/dist/opencode-launch-ECMEY2QZ.js.map +1 -0
- package/dist/opencode-process-ENS4MXHM.js +2 -0
- package/dist/program-6C3G65YA.js +2 -0
- package/dist/{promote-USGFU5NN.js → promote-36XF4LH7.js} +2 -2
- package/dist/{query-NLSKOIWJ.js → query-YFZ6GWHU.js} +2 -2
- package/dist/registry-WJSGG62F.js +2 -0
- package/dist/{request-planner-VOWMXWRI.js → request-planner-OXRWVBXI.js} +2 -2
- package/dist/{review-candidates-F6RLNHS2.js → review-candidates-5XZWP2BN.js} +2 -2
- package/dist/{routing-2LAWEIUG.js → routing-XEPCPLVM.js} +2 -2
- package/dist/schedule-tool-WQCO2YUG.js +2 -0
- package/dist/scheduler-4NQ62XDK.js +2 -0
- package/dist/{seat-4LLK2XBM.js → seat-FGFHW363.js} +2 -2
- package/dist/{select-NJHTHKEQ.js → select-N6CIZF2S.js} +2 -2
- package/dist/{set-enabled-HPR6VJCG.js → set-enabled-L7Z6H7EG.js} +2 -2
- package/dist/{tool-XQMGKZP5.js → tool-OSH6GHIF.js} +2 -2
- package/dist/wiki-E46QDRS7.js +2 -0
- package/dist/wiki-E46QDRS7.js.map +1 -0
- package/package.json +1 -1
- package/dist/board-dashboard-MYWXVYU3.js.map +0 -1
- package/dist/chunk-2DWDXT7G.js.map +0 -1
- package/dist/chunk-4HCQEGXO.js.map +0 -1
- package/dist/chunk-E6CYC4HQ.js +0 -131
- package/dist/chunk-E6CYC4HQ.js.map +0 -1
- package/dist/chunk-MTPCD4NV.js.map +0 -1
- package/dist/chunk-XXBW7CFN.js +0 -15
- package/dist/chunk-XXBW7CFN.js.map +0 -1
- package/dist/client-IQIBHXVS.js +0 -2
- package/dist/config-7AK5TI2D.js +0 -2
- package/dist/config-mutator-EI5JNMY4.js +0 -2
- package/dist/doctor-CTWQODQG.js +0 -2
- package/dist/program-ZKGWGTPV.js +0 -2
- package/dist/registry-T7SCVP55.js +0 -2
- package/dist/schedule-tool-GOQFT2XQ.js +0 -2
- package/dist/scheduler-GJVRJQ7K.js +0 -2
- package/dist/wiki-RQ5P4WWJ.js +0 -2
- /package/dist/{App-LFQTOADB.js.map → App-244WEQJR.js.map} +0 -0
- /package/dist/{ChatApp-RNMG2HWX.js.map → ChatApp-SFP6SHUU.js.map} +0 -0
- /package/dist/{agent-7IW6472I.js.map → agent-PMNBXRFW.js.map} +0 -0
- /package/dist/{chunk-FEQ4W4XA.js.map → chunk-55N4VTWX.js.map} +0 -0
- /package/dist/{chunk-5FD7HE2J.js.map → chunk-576L7ZFD.js.map} +0 -0
- /package/dist/{chunk-D3RJMC37.js.map → chunk-7XR5LGLD.js.map} +0 -0
- /package/dist/{chunk-YFROK44Z.js.map → chunk-DMWFRKWR.js.map} +0 -0
- /package/dist/{chunk-7334DGUO.js.map → chunk-FMUOVVXX.js.map} +0 -0
- /package/dist/{chunk-KTGPH77J.js.map → chunk-J6RZOP7Z.js.map} +0 -0
- /package/dist/{chunk-DXAWW7ZQ.js.map → chunk-MESWF2ZM.js.map} +0 -0
- /package/dist/{chunk-RKZGENSE.js.map → chunk-PBRI3MTE.js.map} +0 -0
- /package/dist/{chunk-KTNOY4LW.js.map → chunk-PC5LKW3L.js.map} +0 -0
- /package/dist/{chunk-4J4YVJFH.js.map → chunk-PHSYP22H.js.map} +0 -0
- /package/dist/{chunk-7PWXCN22.js.map → chunk-PY54XYAG.js.map} +0 -0
- /package/dist/{chunk-LKA5UUGT.js.map → chunk-QKV7FN67.js.map} +0 -0
- /package/dist/{chunk-RN7G3D53.js.map → chunk-TT4T6CB3.js.map} +0 -0
- /package/dist/{chunk-3ZRFES25.js.map → chunk-UFPWMNUW.js.map} +0 -0
- /package/dist/{chunk-MOUSATFW.js.map → chunk-VWMO4C72.js.map} +0 -0
- /package/dist/{chunk-O2QVQVOV.js.map → chunk-YVLFX35J.js.map} +0 -0
- /package/dist/{chunk-N4EIYNN4.js.map → chunk-Z5TXWHDN.js.map} +0 -0
- /package/dist/{client-IQIBHXVS.js.map → client-L4JAPXTE.js.map} +0 -0
- /package/dist/{config-7AK5TI2D.js.map → config-X7BHZ75G.js.map} +0 -0
- /package/dist/{config-mutator-EI5JNMY4.js.map → config-mutator-R2KBGTZJ.js.map} +0 -0
- /package/dist/{doctor-CTWQODQG.js.map → doctor-5VFQVAVC.js.map} +0 -0
- /package/dist/{program-ZKGWGTPV.js.map → opencode-process-ENS4MXHM.js.map} +0 -0
- /package/dist/{promote-USGFU5NN.js.map → program-6C3G65YA.js.map} +0 -0
- /package/dist/{query-NLSKOIWJ.js.map → promote-36XF4LH7.js.map} +0 -0
- /package/dist/{registry-T7SCVP55.js.map → query-YFZ6GWHU.js.map} +0 -0
- /package/dist/{routing-2LAWEIUG.js.map → registry-WJSGG62F.js.map} +0 -0
- /package/dist/{request-planner-VOWMXWRI.js.map → request-planner-OXRWVBXI.js.map} +0 -0
- /package/dist/{review-candidates-F6RLNHS2.js.map → review-candidates-5XZWP2BN.js.map} +0 -0
- /package/dist/{schedule-tool-GOQFT2XQ.js.map → routing-XEPCPLVM.js.map} +0 -0
- /package/dist/{scheduler-GJVRJQ7K.js.map → schedule-tool-WQCO2YUG.js.map} +0 -0
- /package/dist/{seat-4LLK2XBM.js.map → scheduler-4NQ62XDK.js.map} +0 -0
- /package/dist/{wiki-RQ5P4WWJ.js.map → seat-FGFHW363.js.map} +0 -0
- /package/dist/{select-NJHTHKEQ.js.map → select-N6CIZF2S.js.map} +0 -0
- /package/dist/{set-enabled-HPR6VJCG.js.map → set-enabled-L7Z6H7EG.js.map} +0 -0
- /package/dist/{tool-XQMGKZP5.js.map → tool-OSH6GHIF.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Te,b as ft}from"./chunk-FX3D7YON.js";import{a as et,b as tt,c as nt,d as S,e as A,f as N}from"./chunk-72SZI2UW.js";import{a as ne,b as He}from"./chunk-FCPTN6NF.js";import{o as we,p as Ke}from"./chunk-5MUJZODV.js";import{
|
|
1
|
+
import{a as Te,b as ft}from"./chunk-FX3D7YON.js";import{a as et,b as tt,c as nt,d as S,e as A,f as N}from"./chunk-72SZI2UW.js";import{a as ne,b as He}from"./chunk-FCPTN6NF.js";import{o as we,p as Ke}from"./chunk-5MUJZODV.js";import{A as Ze,z as We}from"./chunk-RAYOK4GI.js";import{a as rt,b as ot,c as st,d as it,e as at,f as ct,g as ut,h as lt,i as dt,j as pt,k as mt,l as bt}from"./chunk-RGDKHYY2.js";import{a as E,b as Ye,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 gt(){$.clear(),X.clear()}var $,X,C=E(()=>{"use strict";$=new Map,X=new Map});import yt from"better-sqlite3";import{createHash as ht}from"crypto";import{mkdirSync as wt}from"fs";import{dirname as Tt,resolve as Et}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 kt(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 xt(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&&Rt(e),t<2&&At(e),t<3&&St(e)}function St(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 At(e){e.exec(`
|
|
@@ -111,4 +111,4 @@ import{a as Te,b as ft}from"./chunk-FX3D7YON.js";import{a as et,b as tt,c as nt,
|
|
|
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:g,meta:{backend:"local",structureMode:c,answerMode:"probabilities",repaired:L,retries:f,stateTruncated:l.truncated,latencyMs:Date.now()-i}}}finally{b()}}}}async function $t(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:B,description:"Report a probability distribution for every question.",input_schema:se(t)}],{...o,toolChoice:{type:"tool",name:B}}),a=i.content.find(c=>c.type==="tool_use"&&c.name===B),u=a&&a.type==="tool_use"?a.input:null;return{answers:Pe(u),usage:{inputTokens:i.usage.input_tokens,outputTokens:i.usage.output_tokens}}}async function Vt(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:Pe(Te(a.content??"")),usage:{inputTokens:0,outputTokens:a.tokensUsed??0}}}function Pe(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 zt(e,t){return e!=="auto"?e:t.generateRaw&&me[t.name]?.structuredOutput?"tool":"text"}function Jt(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,Pt,qt,Be,Xt,be=E(()=>{"use strict";Ke();Ue();ft();j();Y();N();z();Bt="claude-code",Pt="claude-haiku-4-5-20251001",qt=24e3,Be=2e3,Xt=3e4});import{readFileSync as Gt}from"fs";import{homedir as Yt}from"os";import{join as Kt}from"path";function v(e={}){let t=(e.baseUrl??Ht).replace(/\/+$/,""),r=e.path??"/classifier",n=e.name??"simple-jev",o=e.maxStateChars??Zt,s=e.maxChoiceOptions??en,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),on(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:y,dispose:d}=sn(a.abortSignal,a.timeoutMs??e.timeoutMs??Wt);try{let b={"Content-Type":"application/json"},g=rn(e.apiKeyEnv,e.apiKeyFile);g&&(b.Authorization=`Bearer ${g}`);let w=await p(`${t}${r}`,{method:"POST",headers:b,body:JSON.stringify({model:c,state:l.text,questions:nn(a.questions)}),signal:y});if(!w.ok){let k=await w.text().catch(()=>"");throw new Error(`${n} ${w.status}: ${k.slice(0,300)}`)}let f=await w.json(),m=F(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
|
${U(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 nn(e){let t={};for(let[r,n]of Object.entries(e))t[r]=n.instructions?n:{...n,instructions:tn[n.type]};return t}function rn(e,t){let r=e?process.env[e]:void 0;if(r)return r;if(!t)return;let n=t.startsWith("~/")?Kt(Yt(),t.slice(2)):t;if(!Z.has(n))try{let o=Gt(n,"utf-8").trim();Z.set(n,o.length>0?o:null)}catch{Z.set(n,null)}return Z.get(n)??void 0}function on(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 sn(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 Ht,Wt,Zt,en,tn,Z,fe=E(()=>{"use strict";j();N();z();Y();Ht="http://127.0.0.1:8000/v1",Wt=3e4,Zt=6e3,en=50;tn={choice:"Which option best fits?",score:"Which level best fits?",noul:"Is this true of the state?"};Z=new Map});var qe={};Ye(qe,{DecisionStore:()=>I,MAX_CHOICE_OPTIONS:()=>MAX_CHOICE_OPTIONS,SYSTEM_PROMPT:()=>J,TOOL_NAME:()=>B,UNCERTAINTY_HIGH:()=>Ce,UNCERTAINTY_LOW:()=>De,_resetDecisionBackendsForTesting:()=>gt,agreement:()=>rt,answerView:()=>Q,applyRecalibrator:()=>ue,applyTemperature:()=>lt,askSeat:()=>pn,band:()=>Ie,bootstrapInterval:()=>pt,brier:()=>at,buildDesign:()=>Ne,calibrationReport:()=>mt,choice:()=>tt,compareCalibrators:()=>Lt,confidenceFor:()=>re,configureDecisions:()=>cn,coverageCurve:()=>ut,createLocalDecisionBackend:()=>W,createMockDecisionBackend:()=>H,createSimpleJevBackend:()=>v,decisionsRuntime:()=>ln,describeIssues:()=>U,ece:()=>st,expectedScore:()=>Ae,finalizeAnswer:()=>_,fitLogistic:()=>ve,fitRecalibrator:()=>P,fitTemperature:()=>dt,getDecisionBackend:()=>D,getSeatMode:()=>Ve,labelsOf:()=>S,listDecisionBackends:()=>Ee,logLoss:()=>ct,logit:()=>le,mce:()=>it,measureConsistency:()=>Qt,normalizeDistribution:()=>xe,normalizedNegEntropy:()=>oe,noul:()=>et,pMax:()=>Se,parseSeatMode:()=>ge,rawAnswerSchema:()=>Re,rawAnswersSchema:()=>F,recordSeatOutcome:()=>dn,registerBuiltinDecisionBackends:()=>an,registerDecisionBackend:()=>R,reliabilityBins:()=>ot,renderQuestions:()=>_e,renderShapeInstructions:()=>ae,renderState:()=>G,renderUserPrompt:()=>ie,resetDecisionsRuntime:()=>un,score:()=>nt,seatEnvVar:()=>$e,sigmoid:()=>de,toolInputSchema:()=>se,validateQuestions:()=>A,withUid:()=>Qe});function an(e={},t={},r={},n={}){R("mock",()=>H()),R("local",()=>W(e)),R("simple-jev",()=>v(t)),R("jev",()=>v({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",()=>v({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 Xe=E(()=>{"use strict";ke();N();j();z();C();Y();V();bt();Me();je();ze();pe();be();fe();C();pe();be();fe()});function cn(e){T={...ye,...T,...e},ee=!0}function un(){T={...ye,seats:{}},ee=!1}function mn(){if(!ee){ee=!0;try{let{loadDaemonConfig:e}=(Ze(),he(We)),t=e()?.decisions;if(!t?.enabled)return;let{registerBuiltinDecisionBackends:r}=(Xe(),he(qe)),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 ln(){return T}function ge(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return bn.includes(t)?t:null}function $e(e){return`AGENTX_DECISION_SEAT_${e.toUpperCase().replace(/[^A-Z0-9]+/g,"_")}`}function Ve(e,t=process.env){mn();let r=ge(t[$e(e)]);return r||(T.enabled?ge(T.seats[e]?.mode)??"off":"off")}function dn(e,t,r=!1){if(!(!e||!T.store))try{T.store.recordOutcome(e,t,r)}catch{}}async function pn(e,t,r,n={}){let o=Ve(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=fn(e,o,t,r,c,n,s);return{answers:c.answers,callId:l,mode:o}}catch(u){return gn(e,o,t,r,i,n,s,a,u),yn(e,i,u),null}}function fn(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:Ge(s.incumbent),links:s.links,features:s.features,keepState:!i.redactState})}catch{return null}}function gn(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:Ge(s.incumbent),links:s.links,features:s.features,error:String(u?.message??u).slice(0,500),keepState:!i.redactState})}catch{}}function Ge(e){if(!e)return;let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]={value:n});return t}function yn(e,t,r){let n=Date.now();n-Je<6e4||(Je=n,console.warn(`[decisions] seat "${e}" on backend "${t}" failed: ${r?.message??r}`))}var ye,T,ee,bn,Je,ze=E(()=>{C();V();ye={enabled:!1,defaultBackend:"local",seats:{},store:null},T={...ye},ee=!1;bn=["off","shadow","active"];Je=0});export{D as a,Ee as b,C as c,I as d,V as e,Lt as f,Me as g,Qt as h,je as i,me as j,Un as k,Ue as l,an as m,Xe as n,cn as o,un as p,ln as q,ge as r,$e as s,Ve as t,dn as u,pn as v,ze as w};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-YVLFX35J.js.map
|
|
@@ -48,7 +48,7 @@ The "modified" field is optional and can contain updated values to pass forward.
|
|
|
48
48
|
... (output truncated)`:i;return s.exitCode!==0?{tool_use_id:e.id,content:`Command exited with code ${s.exitCode}:
|
|
49
49
|
${c}`,is_error:!0}:{tool_use_id:e.id,content:c||"(no output)"}}async editFile(e){let t=String(e.input.path||""),o=e.input.edits,n=ge.resolve(this.cwd,t);if(!o||o.length===0)return{tool_use_id:e.id,content:"No edits provided.",is_error:!0};let s=await W.checkFileWrite(t);if(s==="deny")return{tool_use_id:e.id,content:`File write blocked by permissions: ${t}`,is_error:!0};if(s==="skip")return{tool_use_id:e.id,content:`File write skipped (plan mode): ${t}`};if(f.has("pre:file-write")){let a=await f.execute("pre:file-write",{event:"pre:file-write",file:n,cwd:this.cwd});if(a.blocked)return{tool_use_id:e.id,content:a.message||`File edit blocked by pre:file-write hook: ${t}`,is_error:!0}}let i=await re.readFile(n,"utf8"),c=[];for(let a of o)i.includes(a.old_text)?(i=i.replace(a.old_text,a.new_text),c.push(`Replaced: "${a.old_text.slice(0,40)}..."`)):c.push(`Not found: "${a.old_text.slice(0,40)}..."`);return this.options.dryRun||await re.writeFile(n,i,"utf8"),f.has("post:file-write")&&await f.execute("post:file-write",{event:"post:file-write",file:n,fileContent:i,cwd:this.cwd}),{tool_use_id:e.id,content:`Edited ${t}:
|
|
50
50
|
${c.join(`
|
|
51
|
-
`)}`}}async createFiles(e){let t=e.input,o=t.files||[];return{tool_use_id:e.id,content:t.summary||`Queued ${o.length} file(s) for creation.`,files:o}}async spawnAgent(e){let t=String(e.input.agent_id||""),o=String(e.input.prompt||""),n=Number(e.input.timeout_seconds)||300;if(!t||!o)return{tool_use_id:e.id,content:"agent_id and prompt are required.",is_error:!0};try{let{SubAgentManager:s}=await import("./subagent-XY5N7TUU.js"),{getGlobalRegistry:i}=await import("./registry-
|
|
51
|
+
`)}`}}async createFiles(e){let t=e.input,o=t.files||[];return{tool_use_id:e.id,content:t.summary||`Queued ${o.length} file(s) for creation.`,files:o}}async spawnAgent(e){let t=String(e.input.agent_id||""),o=String(e.input.prompt||""),n=Number(e.input.timeout_seconds)||300;if(!t||!o)return{tool_use_id:e.id,content:"agent_id and prompt are required.",is_error:!0};try{let{SubAgentManager:s}=await import("./subagent-XY5N7TUU.js"),{getGlobalRegistry:i}=await import("./registry-WJSGG62F.js"),c=i();if(!c)return{tool_use_id:e.id,content:"Sub-agent spawning requires the daemon to be running.",is_error:!0};let p=await new s(c).spawn({targetAgentId:t,prompt:o,parentAgentId:"orchestrator",timeout:n*1e3});return p.success?{tool_use_id:e.id,content:`Sub-agent "${t}" completed (${Math.round(p.duration/1e3)}s):
|
|
52
52
|
|
|
53
53
|
${p.content}`}:{tool_use_id:e.id,content:`Sub-agent "${t}" failed: ${p.error}`,is_error:!0}}catch(s){return{tool_use_id:e.id,content:`Failed to spawn sub-agent: ${s.message}`,is_error:!0}}}async askUser(e){let t=String(e.input.question||""),o=e.input.options,n=t;return o?.length&&(n+=`
|
|
54
54
|
Options: ${o.join(", ")}`),{tool_use_id:e.id,content:"Question sent to user.",followUp:n}}};async function Ae(r){let{provider:e,systemPrompt:t,messages:o,providerOptions:n,cwd:s,maxIterations:i=20,enabledTools:c,interactive:a=!0,overwrite:p=!1,dryRun:l=!1,onProgress:d,abortSignal:u}=r,m=u?{...n,abortSignal:u}:n;if(!e.generateRaw)return dt(r);let I=new se(s,{interactive:a,overwrite:p,dryRun:l,acmeContext:r.acmeContext,abortSignal:u}),D=be(c);if(r.acmeContext)for(let g of at)D.push({name:g.name,description:g.description,input_schema:g.input_schema});let E=new Set;if(r.mcpTools?.length)for(let g of r.mcpTools)D.push({name:g.name,description:g.description,input_schema:g.input_schema}),E.add(g.name);let C=o.filter(g=>g.role!=="system").map(g=>({role:g.role,content:g.content})),B=[],G=0,F=0,A=0,O="",j,_=0;for(;_<i;){if(_++,u?.aborted)throw new Error("cancelled");d?.({type:"iteration_start",iteration:_}),b.step(_,`Agentic loop iteration (${D.length} tools available)`);let g,M=!!e.generateRawStream&&!!d;try{if(M){let T=null,U=null,v="";for await(let x of e.generateRawStream(C,t,D,m))x.type==="text_delta"?(v+=x.text,d?.({type:"text_delta",text:x.text})):x.type==="thinking_delta"?d?.({type:"thinking_delta",text:x.text}):x.type==="raw_result"?T=x.result:x.type==="error"&&(U=x.error);if(U&&!T)throw new Error(U);if(!T)throw new Error("generateRawStream returned no raw_result event");g=T,g._streamedText=v}else g=await e.generateRaw(C,t,D,m)}catch(T){if(T.message?.includes("not available"))return dt(r);throw T}G+=g.usage.input_tokens+g.usage.output_tokens,F+=g.usage.input_tokens,A+=g.usage.output_tokens;let P=g._streamedText;for(let T of g.content)T.type==="text"&&(O+=T.text,P===void 0&&d?.({type:"text_delta",text:T.text}));if(P!==void 0&&delete g._streamedText,g.stop_reason==="end_turn"||g.stop_reason==="max_tokens")break;if(g.stop_reason==="tool_use"){let T=g.content.filter(v=>v.type==="tool_use");if(T.length===0)break;C.push({role:"assistant",content:g.content});let U=[];for(let v of T){d?.({type:"tool_call",name:v.name,id:v.id,input:v.input}),b.step(_,`Tool call: ${v.name}`);let x;if(E.has(v.name)&&r.mcpDispatch){let h=await r.mcpDispatch(v.name,v.input);x={tool_use_id:v.id,content:h.content,is_error:h.isError}}else x=await I.execute({name:v.name,id:v.id,input:v.input});d?.({type:"tool_result",name:v.name,id:v.id,content:x.content.slice(0,200),is_error:x.is_error}),x.files?.length&&(B.push(...x.files),d?.({type:"files_created",files:x.files})),x.followUp&&(j=x.followUp),U.push({type:"tool_result",tool_use_id:x.tool_use_id,content:x.content,is_error:x.is_error})}if(C.push({role:"user",content:U}),j)break;continue}break}return d?.({type:"complete",iterations:_,totalTokens:G}),{files:B,content:O,followUp:j,tokensUsed:G,inputTokens:F||void 0,outputTokens:A||void 0,iterations:_}}async function dt(r){let{provider:e,systemPrompt:t,messages:o,providerOptions:n,maxIterations:s=5}=r,c=[{role:"system",content:t+`
|
|
@@ -123,4 +123,4 @@ ${r.projectInstructions}`),r.memoryContext&&o.push(r.memoryContext),o.push(`# Ou
|
|
|
123
123
|
Generate output appropriate for: ${e}. Use the \`create_files\` tool to output all files.`),o.join(`
|
|
124
124
|
|
|
125
125
|
`)}export{qe as a,Vt as b,Yt as c,We as d,ze as e,Ve as f,Ye as g,Pe as h,ee as i,Re as j,le as k,te as l,Tt as m,oe as n,Mt as o,f as p,et as q,tt as r,Me as s,de as t,W as u,ne as v,it as w,Ee as x,$e as y,se as z,mt as A,Zn as B,er as C};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
126
|
+
//# sourceMappingURL=chunk-Z5TXWHDN.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as n}from"./chunk-
|
|
2
|
+
import{a as n}from"./chunk-335JCO5R.js";import"./chunk-7XR5LGLD.js";import"./chunk-PC5LKW3L.js";import"./chunk-J6RZOP7Z.js";import"./chunk-Z3IP66SL.js";import"./chunk-C4CDVE2E.js";import"./chunk-RKPAVWXF.js";import"./chunk-SZDACK6O.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-OWRPCMGW.js";import"./chunk-FWQVXZ5T.js";import"./chunk-PY54XYAG.js";import"./chunk-BYJ3A55Y.js";import"./chunk-NMFXY3QU.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-VWMO4C72.js";import"./chunk-AQASR6KR.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import"./chunk-OSHG52OO.js";import"./chunk-PBRI3MTE.js";import"./chunk-WP6KLXTP.js";import"./chunk-N6EWZGIX.js";import"./chunk-DP7RTNDM.js";import"./chunk-Z5TXWHDN.js";import"./chunk-SFQUP3BP.js";import"./chunk-576L7ZFD.js";import"./chunk-2AXFYDWF.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-DMWFRKWR.js";import"./chunk-55N4VTWX.js";import"./chunk-VWTBHLMX.js";import"./chunk-QKV7FN67.js";import"./chunk-PHSYP22H.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-UFPWMNUW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-MESWF2ZM.js";import"./chunk-TT4T6CB3.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import"./chunk-YVLFX35J.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-QOYAX2FT.js";import"./chunk-5MUJZODV.js";import"./chunk-7I7IEX4S.js";import"./chunk-JHCI6XCJ.js";import"./chunk-DSYKYZMT.js";import"./chunk-RAYOK4GI.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";var r=["SIGINT","SIGTERM"];function o(t=process){for(let i of r)t.on(i,()=>{t.listenerCount(i)<=1&&t.exit(0)})}o();async function s(){let t=await n();if(process.argv.slice(2).length===0){t.outputHelp();return}t.parse()}s();
|
|
3
3
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/signal-exit.ts","../src/cli.ts"],"sourcesContent":["// --- Ctrl-C / SIGTERM for CLI commands ---\n//\n// Short commands should exit at once when stopped. Long-running ones (the\n// daemon above all) install their own handler to finish in-flight work first.\n// The CLI's quick exit used to be registered unconditionally, before the\n// daemon's, and Node runs listeners in registration order — so every stop\n// exited the process before the daemon's drain began and killed in-flight\n// agent tasks mid-turn (#103). Now the quick exit only fires when nobody\n// else handles the signal.\n\ntype SignalTarget = Pick<NodeJS.Process, \"on\" | \"listenerCount\" | \"exit\">\n\nexport const CLI_EXIT_SIGNALS = [\"SIGINT\", \"SIGTERM\"] as const\n\nexport function installCliSignalExit(proc: SignalTarget = process): void {\n for (const sig of CLI_EXIT_SIGNALS) {\n proc.on(sig, () => {\n // This listener is always one of them; anything more means a command\n // is handling the stop itself.\n if (proc.listenerCount(sig) <= 1) proc.exit(0)\n })\n }\n}\n","#!/usr/bin/env node\nimport { buildProgram } from \"@/program\"\nimport { installCliSignalExit } from \"@/utils/signal-exit\"\n\ninstallCliSignalExit()\n\nasync function main() {\n const program = await buildProgram()\n\n const args = process.argv.slice(2)\n if (args.length === 0) {\n program.outputHelp()\n return\n }\n\n program.parse()\n}\n\nmain()\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../src/utils/signal-exit.ts","../src/cli.ts"],"sourcesContent":["// --- Ctrl-C / SIGTERM for CLI commands ---\n//\n// Short commands should exit at once when stopped. Long-running ones (the\n// daemon above all) install their own handler to finish in-flight work first.\n// The CLI's quick exit used to be registered unconditionally, before the\n// daemon's, and Node runs listeners in registration order — so every stop\n// exited the process before the daemon's drain began and killed in-flight\n// agent tasks mid-turn (#103). Now the quick exit only fires when nobody\n// else handles the signal.\n\ntype SignalTarget = Pick<NodeJS.Process, \"on\" | \"listenerCount\" | \"exit\">\n\nexport const CLI_EXIT_SIGNALS = [\"SIGINT\", \"SIGTERM\"] as const\n\nexport function installCliSignalExit(proc: SignalTarget = process): void {\n for (const sig of CLI_EXIT_SIGNALS) {\n proc.on(sig, () => {\n // This listener is always one of them; anything more means a command\n // is handling the stop itself.\n if (proc.listenerCount(sig) <= 1) proc.exit(0)\n })\n }\n}\n","#!/usr/bin/env node\nimport { buildProgram } from \"@/program\"\nimport { installCliSignalExit } from \"@/utils/signal-exit\"\n\ninstallCliSignalExit()\n\nasync function main() {\n const program = await buildProgram()\n\n const args = process.argv.slice(2)\n if (args.length === 0) {\n program.outputHelp()\n return\n }\n\n program.parse()\n}\n\nmain()\n"],"mappings":";o0DAYO,IAAMA,EAAmB,CAAC,SAAU,SAAS,EAE7C,SAASC,EAAqBC,EAAqB,QAAe,CACvE,QAAWC,KAAOH,EAChBE,EAAK,GAAGC,EAAK,IAAM,CAGbD,EAAK,cAAcC,CAAG,GAAK,GAAGD,EAAK,KAAK,CAAC,CAC/C,CAAC,CAEL,CClBAE,EAAqB,EAErB,eAAeC,GAAO,CACpB,IAAMC,EAAU,MAAMC,EAAa,EAGnC,GADa,QAAQ,KAAK,MAAM,CAAC,EACxB,SAAW,EAAG,CACrBD,EAAQ,WAAW,EACnB,OAGFA,EAAQ,MAAM,CAChB,CAEAD,EAAK","names":["CLI_EXIT_SIGNALS","installCliSignalExit","proc","sig","installCliSignalExit","main","program","buildProgram"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as i,r as a,s as b,t as c,u as d,v as e,w as f,x as g,y as h}from"./chunk-RAYOK4GI.js";import"./chunk-QIJLFPWE.js";i();export{a as INTEGRATION_KINDS,d as approvalsConfigSchema,c as callsSchema,e as daemonConfigSchema,b as eventSubscriptionSchema,f as expandEnvVars,g as loadDaemonConfig,h as validateWorkspaces};
|
|
2
|
+
//# sourceMappingURL=config-X7BHZ75G.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-PC5LKW3L.js";import"./chunk-BYJ3A55Y.js";import"./chunk-RAYOK4GI.js";import"./chunk-QIJLFPWE.js";export{e as daemonVoiceCheck,b as doctor,a as runDoctorChecks,c as runNotificationChecks,d as runReminderChecks};
|
|
2
|
+
//# sourceMappingURL=doctor-5VFQVAVC.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1767,6 +1767,10 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1767
1767
|
/** See systemVoiceSchema. Unset: one is assigned, of the agent's
|
|
1768
1768
|
* gender when set, different from every other agent's. */
|
|
1769
1769
|
system: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
1770
|
+
/** Voices to try, in order, when `system` names one that is not
|
|
1771
|
+
* installed (e.g. ["Ava (Premium)", "Allison"]). Unset, or none
|
|
1772
|
+
* installed: the best installed voice of its language and gender. */
|
|
1773
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1770
1774
|
elevenlabsVoiceId: z.ZodOptional<z.ZodString>;
|
|
1771
1775
|
gender: z.ZodOptional<z.ZodEnum<["female", "male", "neutral"]>>;
|
|
1772
1776
|
/** A few words on manner, e.g. "warm, upbeat, a little playful". */
|
|
@@ -1790,6 +1794,7 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1790
1794
|
provider?: "system" | "elevenlabs" | undefined;
|
|
1791
1795
|
style?: string | undefined;
|
|
1792
1796
|
priority?: "high" | "normal" | "low" | undefined;
|
|
1797
|
+
fallbacks?: string[] | undefined;
|
|
1793
1798
|
elevenlabsVoiceId?: string | undefined;
|
|
1794
1799
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
1795
1800
|
intro?: string | undefined;
|
|
@@ -1801,6 +1806,7 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1801
1806
|
provider?: "system" | "elevenlabs" | undefined;
|
|
1802
1807
|
style?: string | undefined;
|
|
1803
1808
|
priority?: "high" | "normal" | "low" | undefined;
|
|
1809
|
+
fallbacks?: string[] | undefined;
|
|
1804
1810
|
elevenlabsVoiceId?: string | undefined;
|
|
1805
1811
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
1806
1812
|
intro?: string | undefined;
|
|
@@ -1908,6 +1914,7 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1908
1914
|
provider?: "system" | "elevenlabs" | undefined;
|
|
1909
1915
|
style?: string | undefined;
|
|
1910
1916
|
priority?: "high" | "normal" | "low" | undefined;
|
|
1917
|
+
fallbacks?: string[] | undefined;
|
|
1911
1918
|
elevenlabsVoiceId?: string | undefined;
|
|
1912
1919
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
1913
1920
|
intro?: string | undefined;
|
|
@@ -1993,6 +2000,7 @@ declare const agentConfigSchema: z.ZodObject<{
|
|
|
1993
2000
|
provider?: "system" | "elevenlabs" | undefined;
|
|
1994
2001
|
style?: string | undefined;
|
|
1995
2002
|
priority?: "high" | "normal" | "low" | undefined;
|
|
2003
|
+
fallbacks?: string[] | undefined;
|
|
1996
2004
|
elevenlabsVoiceId?: string | undefined;
|
|
1997
2005
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
1998
2006
|
intro?: string | undefined;
|
|
@@ -2568,6 +2576,10 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2568
2576
|
/** See systemVoiceSchema. Unset: one is assigned, of the agent's
|
|
2569
2577
|
* gender when set, different from every other agent's. */
|
|
2570
2578
|
system: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
2579
|
+
/** Voices to try, in order, when `system` names one that is not
|
|
2580
|
+
* installed (e.g. ["Ava (Premium)", "Allison"]). Unset, or none
|
|
2581
|
+
* installed: the best installed voice of its language and gender. */
|
|
2582
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2571
2583
|
elevenlabsVoiceId: z.ZodOptional<z.ZodString>;
|
|
2572
2584
|
gender: z.ZodOptional<z.ZodEnum<["female", "male", "neutral"]>>;
|
|
2573
2585
|
/** A few words on manner, e.g. "warm, upbeat, a little playful". */
|
|
@@ -2591,6 +2603,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2591
2603
|
provider?: "system" | "elevenlabs" | undefined;
|
|
2592
2604
|
style?: string | undefined;
|
|
2593
2605
|
priority?: "high" | "normal" | "low" | undefined;
|
|
2606
|
+
fallbacks?: string[] | undefined;
|
|
2594
2607
|
elevenlabsVoiceId?: string | undefined;
|
|
2595
2608
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
2596
2609
|
intro?: string | undefined;
|
|
@@ -2602,6 +2615,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2602
2615
|
provider?: "system" | "elevenlabs" | undefined;
|
|
2603
2616
|
style?: string | undefined;
|
|
2604
2617
|
priority?: "high" | "normal" | "low" | undefined;
|
|
2618
|
+
fallbacks?: string[] | undefined;
|
|
2605
2619
|
elevenlabsVoiceId?: string | undefined;
|
|
2606
2620
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
2607
2621
|
intro?: string | undefined;
|
|
@@ -2709,6 +2723,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2709
2723
|
provider?: "system" | "elevenlabs" | undefined;
|
|
2710
2724
|
style?: string | undefined;
|
|
2711
2725
|
priority?: "high" | "normal" | "low" | undefined;
|
|
2726
|
+
fallbacks?: string[] | undefined;
|
|
2712
2727
|
elevenlabsVoiceId?: string | undefined;
|
|
2713
2728
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
2714
2729
|
intro?: string | undefined;
|
|
@@ -2794,6 +2809,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
2794
2809
|
provider?: "system" | "elevenlabs" | undefined;
|
|
2795
2810
|
style?: string | undefined;
|
|
2796
2811
|
priority?: "high" | "normal" | "low" | undefined;
|
|
2812
|
+
fallbacks?: string[] | undefined;
|
|
2797
2813
|
elevenlabsVoiceId?: string | undefined;
|
|
2798
2814
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
2799
2815
|
intro?: string | undefined;
|
|
@@ -3377,6 +3393,25 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
3377
3393
|
} | undefined;
|
|
3378
3394
|
maxCallMinutes?: number | undefined;
|
|
3379
3395
|
}>>;
|
|
3396
|
+
/** The phone app's Share camera (#325). The phone asks for this size and
|
|
3397
|
+
* rate; the browser picks the nearest the camera supports. The share
|
|
3398
|
+
* stops by itself after maxSeconds. */
|
|
3399
|
+
camera: z.ZodDefault<z.ZodObject<{
|
|
3400
|
+
width: z.ZodDefault<z.ZodNumber>;
|
|
3401
|
+
height: z.ZodDefault<z.ZodNumber>;
|
|
3402
|
+
frameRate: z.ZodDefault<z.ZodNumber>;
|
|
3403
|
+
maxSeconds: z.ZodDefault<z.ZodNumber>;
|
|
3404
|
+
}, "strip", z.ZodTypeAny, {
|
|
3405
|
+
width: number;
|
|
3406
|
+
height: number;
|
|
3407
|
+
frameRate: number;
|
|
3408
|
+
maxSeconds: number;
|
|
3409
|
+
}, {
|
|
3410
|
+
width?: number | undefined;
|
|
3411
|
+
height?: number | undefined;
|
|
3412
|
+
frameRate?: number | undefined;
|
|
3413
|
+
maxSeconds?: number | undefined;
|
|
3414
|
+
}>>;
|
|
3380
3415
|
}, "strip", z.ZodTypeAny, {
|
|
3381
3416
|
enabled: boolean;
|
|
3382
3417
|
stunServers: string[];
|
|
@@ -3405,6 +3440,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
3405
3440
|
accountId?: string | undefined;
|
|
3406
3441
|
} | undefined;
|
|
3407
3442
|
};
|
|
3443
|
+
camera: {
|
|
3444
|
+
width: number;
|
|
3445
|
+
height: number;
|
|
3446
|
+
frameRate: number;
|
|
3447
|
+
maxSeconds: number;
|
|
3448
|
+
};
|
|
3408
3449
|
callUrlBase?: string | undefined;
|
|
3409
3450
|
}, {
|
|
3410
3451
|
enabled?: boolean | undefined;
|
|
@@ -3435,6 +3476,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
3435
3476
|
} | undefined;
|
|
3436
3477
|
maxCallMinutes?: number | undefined;
|
|
3437
3478
|
} | undefined;
|
|
3479
|
+
camera?: {
|
|
3480
|
+
width?: number | undefined;
|
|
3481
|
+
height?: number | undefined;
|
|
3482
|
+
frameRate?: number | undefined;
|
|
3483
|
+
maxSeconds?: number | undefined;
|
|
3484
|
+
} | undefined;
|
|
3438
3485
|
}>>;
|
|
3439
3486
|
}, "strip", z.ZodTypeAny, {
|
|
3440
3487
|
push: {
|
|
@@ -3565,6 +3612,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
3565
3612
|
accountId?: string | undefined;
|
|
3566
3613
|
} | undefined;
|
|
3567
3614
|
};
|
|
3615
|
+
camera: {
|
|
3616
|
+
width: number;
|
|
3617
|
+
height: number;
|
|
3618
|
+
frameRate: number;
|
|
3619
|
+
maxSeconds: number;
|
|
3620
|
+
};
|
|
3568
3621
|
callUrlBase?: string | undefined;
|
|
3569
3622
|
};
|
|
3570
3623
|
}, {
|
|
@@ -3697,6 +3750,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
3697
3750
|
} | undefined;
|
|
3698
3751
|
maxCallMinutes?: number | undefined;
|
|
3699
3752
|
} | undefined;
|
|
3753
|
+
camera?: {
|
|
3754
|
+
width?: number | undefined;
|
|
3755
|
+
height?: number | undefined;
|
|
3756
|
+
frameRate?: number | undefined;
|
|
3757
|
+
maxSeconds?: number | undefined;
|
|
3758
|
+
} | undefined;
|
|
3700
3759
|
} | undefined;
|
|
3701
3760
|
}>>;
|
|
3702
3761
|
crons: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
@@ -4082,6 +4141,38 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4082
4141
|
accountId?: string | undefined;
|
|
4083
4142
|
} | undefined;
|
|
4084
4143
|
}>>;
|
|
4144
|
+
calls: z.ZodDefault<z.ZodObject<{
|
|
4145
|
+
/** Agents allowed to call: ids, or "*" for every agent on this node.
|
|
4146
|
+
* Empty: nobody can call until the owner allows it. */
|
|
4147
|
+
allow: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
4148
|
+
/** Most calls one agent may place in an hour. */
|
|
4149
|
+
maxPerHour: z.ZodDefault<z.ZodNumber>;
|
|
4150
|
+
/** How long a call rings before it counts as missed. */
|
|
4151
|
+
ringSeconds: z.ZodDefault<z.ZodNumber>;
|
|
4152
|
+
/** An answered call nobody hung up (widget quit or crashed, the Mac
|
|
4153
|
+
* slept, `agentx call answer` without a conversation) ends after this,
|
|
4154
|
+
* so the agent can call again. */
|
|
4155
|
+
maxCallMinutes: z.ZodDefault<z.ZodNumber>;
|
|
4156
|
+
/** Ring sound: a name from /System/Library/Sounds, without the extension. */
|
|
4157
|
+
ringSound: z.ZodDefault<z.ZodString>;
|
|
4158
|
+
/** After hang-up, ask the agent for a short summary and file it in the
|
|
4159
|
+
* dashboard's conversation history. */
|
|
4160
|
+
summary: z.ZodDefault<z.ZodBoolean>;
|
|
4161
|
+
}, "strip", z.ZodTypeAny, {
|
|
4162
|
+
summary: boolean;
|
|
4163
|
+
allow: string[];
|
|
4164
|
+
maxPerHour: number;
|
|
4165
|
+
maxCallMinutes: number;
|
|
4166
|
+
ringSeconds: number;
|
|
4167
|
+
ringSound: string;
|
|
4168
|
+
}, {
|
|
4169
|
+
summary?: boolean | undefined;
|
|
4170
|
+
allow?: string[] | undefined;
|
|
4171
|
+
maxPerHour?: number | undefined;
|
|
4172
|
+
maxCallMinutes?: number | undefined;
|
|
4173
|
+
ringSeconds?: number | undefined;
|
|
4174
|
+
ringSound?: string | undefined;
|
|
4175
|
+
}>>;
|
|
4085
4176
|
approvals: z.ZodDefault<z.ZodObject<{
|
|
4086
4177
|
/** A card without an `expires` gets this many days. */
|
|
4087
4178
|
defaultExpiryDays: z.ZodDefault<z.ZodNumber>;
|
|
@@ -4286,15 +4377,15 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4286
4377
|
width: z.ZodNumber;
|
|
4287
4378
|
height: z.ZodNumber;
|
|
4288
4379
|
}, "strip", z.ZodTypeAny, {
|
|
4289
|
-
x: number;
|
|
4290
|
-
y: number;
|
|
4291
4380
|
width: number;
|
|
4292
4381
|
height: number;
|
|
4293
|
-
}, {
|
|
4294
4382
|
x: number;
|
|
4295
4383
|
y: number;
|
|
4384
|
+
}, {
|
|
4296
4385
|
width: number;
|
|
4297
4386
|
height: number;
|
|
4387
|
+
x: number;
|
|
4388
|
+
y: number;
|
|
4298
4389
|
}>>>;
|
|
4299
4390
|
/** The last few seconds of a region, kept in memory by the daemon. Off
|
|
4300
4391
|
* unless enabled; frames are written out only when asked for. */
|
|
@@ -4324,10 +4415,10 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4324
4415
|
changeThreshold: number;
|
|
4325
4416
|
stableMs: number;
|
|
4326
4417
|
regions: Record<string, {
|
|
4327
|
-
x: number;
|
|
4328
|
-
y: number;
|
|
4329
4418
|
width: number;
|
|
4330
4419
|
height: number;
|
|
4420
|
+
x: number;
|
|
4421
|
+
y: number;
|
|
4331
4422
|
}>;
|
|
4332
4423
|
buffer: {
|
|
4333
4424
|
enabled: boolean;
|
|
@@ -4343,10 +4434,10 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4343
4434
|
changeThreshold?: number | undefined;
|
|
4344
4435
|
stableMs?: number | undefined;
|
|
4345
4436
|
regions?: Record<string, {
|
|
4346
|
-
x: number;
|
|
4347
|
-
y: number;
|
|
4348
4437
|
width: number;
|
|
4349
4438
|
height: number;
|
|
4439
|
+
x: number;
|
|
4440
|
+
y: number;
|
|
4350
4441
|
}> | undefined;
|
|
4351
4442
|
buffer?: {
|
|
4352
4443
|
enabled?: boolean | undefined;
|
|
@@ -4486,6 +4577,10 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4486
4577
|
/** See systemVoiceSchema. Unset: one is assigned, of the agent's
|
|
4487
4578
|
* gender when set, different from every other agent's. */
|
|
4488
4579
|
system: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
4580
|
+
/** Voices to try, in order, when `system` names one that is not
|
|
4581
|
+
* installed (e.g. ["Ava (Premium)", "Allison"]). Unset, or none
|
|
4582
|
+
* installed: the best installed voice of its language and gender. */
|
|
4583
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
4489
4584
|
elevenlabsVoiceId: z.ZodOptional<z.ZodString>;
|
|
4490
4585
|
gender: z.ZodOptional<z.ZodEnum<["female", "male", "neutral"]>>;
|
|
4491
4586
|
/** A few words on manner, e.g. "warm, upbeat, a little playful". */
|
|
@@ -4512,6 +4607,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4512
4607
|
provider?: "system" | "elevenlabs" | undefined;
|
|
4513
4608
|
name?: string | undefined;
|
|
4514
4609
|
style?: string | undefined;
|
|
4610
|
+
fallbacks?: string[] | undefined;
|
|
4515
4611
|
elevenlabsVoiceId?: string | undefined;
|
|
4516
4612
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
4517
4613
|
intro?: string | undefined;
|
|
@@ -4521,6 +4617,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4521
4617
|
provider?: "system" | "elevenlabs" | undefined;
|
|
4522
4618
|
name?: string | undefined;
|
|
4523
4619
|
style?: string | undefined;
|
|
4620
|
+
fallbacks?: string[] | undefined;
|
|
4524
4621
|
elevenlabsVoiceId?: string | undefined;
|
|
4525
4622
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
4526
4623
|
intro?: string | undefined;
|
|
@@ -5972,6 +6069,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
5972
6069
|
provider?: "system" | "elevenlabs" | undefined;
|
|
5973
6070
|
style?: string | undefined;
|
|
5974
6071
|
priority?: "high" | "normal" | "low" | undefined;
|
|
6072
|
+
fallbacks?: string[] | undefined;
|
|
5975
6073
|
elevenlabsVoiceId?: string | undefined;
|
|
5976
6074
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
5977
6075
|
intro?: string | undefined;
|
|
@@ -6070,10 +6168,10 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
6070
6168
|
changeThreshold: number;
|
|
6071
6169
|
stableMs: number;
|
|
6072
6170
|
regions: Record<string, {
|
|
6073
|
-
x: number;
|
|
6074
|
-
y: number;
|
|
6075
6171
|
width: number;
|
|
6076
6172
|
height: number;
|
|
6173
|
+
x: number;
|
|
6174
|
+
y: number;
|
|
6077
6175
|
}>;
|
|
6078
6176
|
buffer: {
|
|
6079
6177
|
enabled: boolean;
|
|
@@ -6218,6 +6316,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
6218
6316
|
accountId?: string | undefined;
|
|
6219
6317
|
} | undefined;
|
|
6220
6318
|
};
|
|
6319
|
+
camera: {
|
|
6320
|
+
width: number;
|
|
6321
|
+
height: number;
|
|
6322
|
+
frameRate: number;
|
|
6323
|
+
maxSeconds: number;
|
|
6324
|
+
};
|
|
6221
6325
|
callUrlBase?: string | undefined;
|
|
6222
6326
|
};
|
|
6223
6327
|
};
|
|
@@ -6284,6 +6388,14 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
6284
6388
|
accountId?: string | undefined;
|
|
6285
6389
|
} | undefined;
|
|
6286
6390
|
};
|
|
6391
|
+
calls: {
|
|
6392
|
+
summary: boolean;
|
|
6393
|
+
allow: string[];
|
|
6394
|
+
maxPerHour: number;
|
|
6395
|
+
maxCallMinutes: number;
|
|
6396
|
+
ringSeconds: number;
|
|
6397
|
+
ringSound: string;
|
|
6398
|
+
};
|
|
6287
6399
|
approvals: {
|
|
6288
6400
|
digest: {
|
|
6289
6401
|
enabled: boolean;
|
|
@@ -6318,6 +6430,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
6318
6430
|
provider?: "system" | "elevenlabs" | undefined;
|
|
6319
6431
|
name?: string | undefined;
|
|
6320
6432
|
style?: string | undefined;
|
|
6433
|
+
fallbacks?: string[] | undefined;
|
|
6321
6434
|
elevenlabsVoiceId?: string | undefined;
|
|
6322
6435
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
6323
6436
|
intro?: string | undefined;
|
|
@@ -6636,6 +6749,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
6636
6749
|
provider?: "system" | "elevenlabs" | undefined;
|
|
6637
6750
|
style?: string | undefined;
|
|
6638
6751
|
priority?: "high" | "normal" | "low" | undefined;
|
|
6752
|
+
fallbacks?: string[] | undefined;
|
|
6639
6753
|
elevenlabsVoiceId?: string | undefined;
|
|
6640
6754
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
6641
6755
|
intro?: string | undefined;
|
|
@@ -6728,10 +6842,10 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
6728
6842
|
changeThreshold?: number | undefined;
|
|
6729
6843
|
stableMs?: number | undefined;
|
|
6730
6844
|
regions?: Record<string, {
|
|
6731
|
-
x: number;
|
|
6732
|
-
y: number;
|
|
6733
6845
|
width: number;
|
|
6734
6846
|
height: number;
|
|
6847
|
+
x: number;
|
|
6848
|
+
y: number;
|
|
6735
6849
|
}> | undefined;
|
|
6736
6850
|
buffer?: {
|
|
6737
6851
|
enabled?: boolean | undefined;
|
|
@@ -6877,6 +6991,12 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
6877
6991
|
} | undefined;
|
|
6878
6992
|
maxCallMinutes?: number | undefined;
|
|
6879
6993
|
} | undefined;
|
|
6994
|
+
camera?: {
|
|
6995
|
+
width?: number | undefined;
|
|
6996
|
+
height?: number | undefined;
|
|
6997
|
+
frameRate?: number | undefined;
|
|
6998
|
+
maxSeconds?: number | undefined;
|
|
6999
|
+
} | undefined;
|
|
6880
7000
|
} | undefined;
|
|
6881
7001
|
} | undefined;
|
|
6882
7002
|
crons?: Record<string, {
|
|
@@ -6942,6 +7062,14 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
6942
7062
|
accountId?: string | undefined;
|
|
6943
7063
|
} | undefined;
|
|
6944
7064
|
} | undefined;
|
|
7065
|
+
calls?: {
|
|
7066
|
+
summary?: boolean | undefined;
|
|
7067
|
+
allow?: string[] | undefined;
|
|
7068
|
+
maxPerHour?: number | undefined;
|
|
7069
|
+
maxCallMinutes?: number | undefined;
|
|
7070
|
+
ringSeconds?: number | undefined;
|
|
7071
|
+
ringSound?: string | undefined;
|
|
7072
|
+
} | undefined;
|
|
6945
7073
|
approvals?: {
|
|
6946
7074
|
digest?: {
|
|
6947
7075
|
enabled?: boolean | undefined;
|
|
@@ -6976,6 +7104,7 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
6976
7104
|
provider?: "system" | "elevenlabs" | undefined;
|
|
6977
7105
|
name?: string | undefined;
|
|
6978
7106
|
style?: string | undefined;
|
|
7107
|
+
fallbacks?: string[] | undefined;
|
|
6979
7108
|
elevenlabsVoiceId?: string | undefined;
|
|
6980
7109
|
gender?: "neutral" | "female" | "male" | undefined;
|
|
6981
7110
|
intro?: string | undefined;
|
|
@@ -7800,6 +7929,7 @@ declare class AgentXDaemon {
|
|
|
7800
7929
|
private business?;
|
|
7801
7930
|
private httpServer?;
|
|
7802
7931
|
private attachSweep?;
|
|
7932
|
+
private callSweep?;
|
|
7803
7933
|
private webhooks;
|
|
7804
7934
|
private github?;
|
|
7805
7935
|
private webrtc?;
|
|
@@ -7810,6 +7940,8 @@ declare class AgentXDaemon {
|
|
|
7810
7940
|
private wfHealth?;
|
|
7811
7941
|
/** Shares the daemon's SQLite handle; absent when running without one. */
|
|
7812
7942
|
private _assistant?;
|
|
7943
|
+
/** Agents ringing the owner (src/calls); needs SQLite. */
|
|
7944
|
+
private calls?;
|
|
7813
7945
|
private assistantStore;
|
|
7814
7946
|
/** Workflow health for the monitor. Cached for a minute: the dashboard
|
|
7815
7947
|
* polls every 15s and dormancy does not change on that timescale. */
|
|
@@ -7830,6 +7962,7 @@ declare class AgentXDaemon {
|
|
|
7830
7962
|
private screenBuffer?;
|
|
7831
7963
|
/** Voice for agents on mesh peers: see src/daemon/voice-mesh-proxy.ts. */
|
|
7832
7964
|
private voiceMesh;
|
|
7965
|
+
private voiceHealth?;
|
|
7833
7966
|
/** Persistent-claude process registry. Null when no agent has
|
|
7834
7967
|
* persistentProcess: true (legacy spawn-per-task path). */
|
|
7835
7968
|
private sessionMonitor?;
|
|
@@ -7849,6 +7982,9 @@ declare class AgentXDaemon {
|
|
|
7849
7982
|
constructor(configPath?: string);
|
|
7850
7983
|
start(): Promise<void>;
|
|
7851
7984
|
stop(): Promise<void>;
|
|
7985
|
+
/** Deliver a notice to the owner through the channel router: the
|
|
7986
|
+
* address it was given, else notifications.channel (push or ntfy). */
|
|
7987
|
+
private ownerSender;
|
|
7852
7988
|
/** In-flight work the drain waits for: local agent tasks + mesh forwards. */
|
|
7853
7989
|
private inflightCounts;
|
|
7854
7990
|
/** Set by start(): the same graceful path a SIGTERM takes. */
|
|
@@ -7953,6 +8089,10 @@ declare class AgentXDaemon {
|
|
|
7953
8089
|
* this `callId` to the stream.
|
|
7954
8090
|
*/
|
|
7955
8091
|
private handleWebRtcSSE;
|
|
8092
|
+
/** Calls from agents to the owner (#321). The notice path is notify's:
|
|
8093
|
+
* Focus holds a non-urgent one; the push goes through the router with
|
|
8094
|
+
* its title as the first line, as `agentx notify` sends it. */
|
|
8095
|
+
private createCallService;
|
|
7956
8096
|
/**
|
|
7957
8097
|
* Serve the minimal browser call page. Static HTML; no framework.
|
|
7958
8098
|
* The page does getUserMedia, RTCPeerConnection, and POSTs/listens signals.
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as L}from"./chunk-C245D4BZ.js";import{
|
|
1
|
+
import{a as L}from"./chunk-C245D4BZ.js";import{d as St,e as kt,ea as Tt,f as vt,fa as Mt,g as xt,h as $t,i as Ct,j as Pt,k as bt}from"./chunk-OWRPCMGW.js";import"./chunk-FWQVXZ5T.js";import"./chunk-PY54XYAG.js";import"./chunk-BYJ3A55Y.js";import"./chunk-NMFXY3QU.js";import"./chunk-LQRBGQIR.js";import"./chunk-ZVP6GB4G.js";import"./chunk-VWMO4C72.js";import"./chunk-AQASR6KR.js";import"./chunk-2D3RYIDU.js";import"./chunk-EKJG63EJ.js";import{R as yt,k as lt,l as ct,m as dt,n as mt,o as pt}from"./chunk-OSHG52OO.js";import"./chunk-PBRI3MTE.js";import"./chunk-WP6KLXTP.js";import"./chunk-N6EWZGIX.js";import"./chunk-DP7RTNDM.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-Z5TXWHDN.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-576L7ZFD.js";import"./chunk-2AXFYDWF.js";import"./chunk-76Z4VHDX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import{s as ut}from"./chunk-DMWFRKWR.js";import"./chunk-55N4VTWX.js";import"./chunk-VWTBHLMX.js";import"./chunk-QKV7FN67.js";import{a as ht}from"./chunk-PHSYP22H.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-UFPWMNUW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-DWADWDMU.js";import"./chunk-23A5K5UW.js";import"./chunk-QD6IICK7.js";import"./chunk-CECHWYJ2.js";import"./chunk-MESWF2ZM.js";import{f as gt,g as ft}from"./chunk-TT4T6CB3.js";import"./chunk-WPNRDEHW.js";import"./chunk-2GIDVZ4H.js";import{j as it,k as rt,l as at}from"./chunk-YVLFX35J.js";import"./chunk-FX3D7YON.js";import"./chunk-72SZI2UW.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{A as nt,v as tt,x as st,y as ot}from"./chunk-RAYOK4GI.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).
|