agentix-cli 0.86.0 → 0.88.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/dist/{App-NLEBAGQK.js → App-BSGDYHRD.js} +2 -2
- package/dist/{ChatApp-JN2WJ7ZK.js → ChatApp-K57DBCDT.js} +2 -2
- package/dist/{agent-QORMJHWT.js → agent-6MTUM5DR.js} +2 -2
- package/dist/{board-dashboard-YG3MBOXP.js → board-dashboard-MHMXII6V.js} +414 -220
- package/dist/board-dashboard-MHMXII6V.js.map +1 -0
- package/dist/{chunk-YK6VYYHC.js → chunk-2FLVU2QW.js} +2 -2
- package/dist/{chunk-GO57OXET.js → chunk-54VYZE7A.js} +10 -10
- package/dist/{chunk-GO57OXET.js.map → chunk-54VYZE7A.js.map} +1 -1
- package/dist/{chunk-CZ4CWVDE.js → chunk-7ADEEHZQ.js} +2 -2
- package/dist/{chunk-AXW5U32B.js → chunk-7K5SJJUI.js} +2 -2
- package/dist/{chunk-5PEOSZ44.js → chunk-7OEFPYQJ.js} +2 -2
- package/dist/{chunk-VQVN3VSJ.js → chunk-7QDAGGOD.js} +2 -2
- package/dist/{chunk-CPXZWVKN.js → chunk-BFY4D4RH.js} +2 -2
- package/dist/{chunk-RLSRENAO.js → chunk-BOENB3IK.js} +2 -2
- package/dist/{chunk-NY7ZZGT3.js → chunk-BUELCBBV.js} +27 -27
- package/dist/{chunk-NY7ZZGT3.js.map → chunk-BUELCBBV.js.map} +1 -1
- package/dist/{chunk-KK6HPN3U.js → chunk-C3VCIEZS.js} +6 -6
- package/dist/chunk-C3VCIEZS.js.map +1 -0
- package/dist/{chunk-CL53UVOF.js → chunk-DWZYVYZS.js} +2 -2
- package/dist/chunk-DWZYVYZS.js.map +1 -0
- package/dist/{chunk-WBJLVFBW.js → chunk-ECCPLASB.js} +2 -2
- package/dist/{chunk-WLKQFYUM.js → chunk-EUXF2GJY.js} +2 -2
- package/dist/{chunk-QIJOGYK5.js → chunk-HOXHUFZB.js} +2 -2
- package/dist/{chunk-TICACOQG.js → chunk-HQWMWSSE.js} +2 -2
- package/dist/{chunk-SPSICIEA.js → chunk-I6HCIQCQ.js} +2 -2
- package/dist/{chunk-FRWV3XOV.js → chunk-KIXDJEGA.js} +2 -2
- package/dist/{chunk-FORTAGGM.js → chunk-L6BO76GK.js} +161 -161
- package/dist/chunk-L6BO76GK.js.map +1 -0
- package/dist/{chunk-NNAMMKT7.js → chunk-MZQ5PCLA.js} +2 -2
- package/dist/{chunk-ANJ2BO7D.js → chunk-N4HFUAPN.js} +2 -2
- package/dist/{chunk-O5U5NVLR.js → chunk-OAA7TNB6.js} +2 -2
- package/dist/{chunk-YSV53UFR.js → chunk-TNR7AI4H.js} +5 -5
- package/dist/{chunk-DTXI7LEI.js → chunk-X2F3AVGR.js} +2 -2
- package/dist/{chunk-M457SOS3.js → chunk-XVDASTUX.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-5Z4IVYAH.js → client-UKLOVDZB.js} +2 -2
- package/dist/config-WUDWHRT6.js +2 -0
- package/dist/config-mutator-UPLM7KGO.js +2 -0
- package/dist/{doctor-UKWJO3TG.js → doctor-COAIIKLV.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/processes-TXEWMXXJ.js +2 -0
- package/dist/{program-PUG7P7TC.js → program-VX4XZAE6.js} +14 -14
- package/dist/{promote-3R56RJQD.js → promote-B7FGHUFA.js} +2 -2
- package/dist/{query-6ZTEUTKC.js → query-ZSVAGGSM.js} +2 -2
- package/dist/{registry-KJZDXHKL.js → registry-4DWWYWDR.js} +2 -2
- package/dist/{request-planner-JFES5YW2.js → request-planner-DSXXT75B.js} +2 -2
- package/dist/{review-candidates-OR375PHS.js → review-candidates-34S6R3DJ.js} +2 -2
- package/dist/{routing-W2E52LYP.js → routing-HWGNYIF3.js} +2 -2
- package/dist/schedule-tool-JLIS2GQU.js +2 -0
- package/dist/scheduler-F6NRVZ7W.js +2 -0
- package/dist/{seat-GAS7YKQA.js → seat-OQZY3CW7.js} +2 -2
- package/dist/{select-UYFJH4V5.js → select-BBTWL7FN.js} +2 -2
- package/dist/{set-enabled-PFMELM3V.js → set-enabled-OC3YT4D4.js} +2 -2
- package/dist/{tool-BGEHMLJ3.js → tool-P4AHNZ5O.js} +2 -2
- package/dist/{tool-W4NSPPXO.js → tool-R36FDI6E.js} +2 -2
- package/dist/wiki-5E4AGLKY.js +2 -0
- package/package.json +1 -1
- package/dist/board-dashboard-YG3MBOXP.js.map +0 -1
- package/dist/chunk-CL53UVOF.js.map +0 -1
- package/dist/chunk-FORTAGGM.js.map +0 -1
- package/dist/chunk-KK6HPN3U.js.map +0 -1
- package/dist/config-2SRJEOO7.js +0 -2
- package/dist/config-mutator-RKEMP53O.js +0 -2
- package/dist/processes-5EXCTSD5.js +0 -2
- package/dist/schedule-tool-XZL5AKFB.js +0 -2
- package/dist/scheduler-BOQJMSJE.js +0 -2
- package/dist/wiki-L5FJ5RYE.js +0 -2
- /package/dist/{App-NLEBAGQK.js.map → App-BSGDYHRD.js.map} +0 -0
- /package/dist/{ChatApp-JN2WJ7ZK.js.map → ChatApp-K57DBCDT.js.map} +0 -0
- /package/dist/{agent-QORMJHWT.js.map → agent-6MTUM5DR.js.map} +0 -0
- /package/dist/{chunk-YK6VYYHC.js.map → chunk-2FLVU2QW.js.map} +0 -0
- /package/dist/{chunk-CZ4CWVDE.js.map → chunk-7ADEEHZQ.js.map} +0 -0
- /package/dist/{chunk-AXW5U32B.js.map → chunk-7K5SJJUI.js.map} +0 -0
- /package/dist/{chunk-5PEOSZ44.js.map → chunk-7OEFPYQJ.js.map} +0 -0
- /package/dist/{chunk-VQVN3VSJ.js.map → chunk-7QDAGGOD.js.map} +0 -0
- /package/dist/{chunk-CPXZWVKN.js.map → chunk-BFY4D4RH.js.map} +0 -0
- /package/dist/{chunk-RLSRENAO.js.map → chunk-BOENB3IK.js.map} +0 -0
- /package/dist/{chunk-WBJLVFBW.js.map → chunk-ECCPLASB.js.map} +0 -0
- /package/dist/{chunk-WLKQFYUM.js.map → chunk-EUXF2GJY.js.map} +0 -0
- /package/dist/{chunk-QIJOGYK5.js.map → chunk-HOXHUFZB.js.map} +0 -0
- /package/dist/{chunk-TICACOQG.js.map → chunk-HQWMWSSE.js.map} +0 -0
- /package/dist/{chunk-SPSICIEA.js.map → chunk-I6HCIQCQ.js.map} +0 -0
- /package/dist/{chunk-FRWV3XOV.js.map → chunk-KIXDJEGA.js.map} +0 -0
- /package/dist/{chunk-NNAMMKT7.js.map → chunk-MZQ5PCLA.js.map} +0 -0
- /package/dist/{chunk-ANJ2BO7D.js.map → chunk-N4HFUAPN.js.map} +0 -0
- /package/dist/{chunk-O5U5NVLR.js.map → chunk-OAA7TNB6.js.map} +0 -0
- /package/dist/{chunk-YSV53UFR.js.map → chunk-TNR7AI4H.js.map} +0 -0
- /package/dist/{chunk-DTXI7LEI.js.map → chunk-X2F3AVGR.js.map} +0 -0
- /package/dist/{chunk-M457SOS3.js.map → chunk-XVDASTUX.js.map} +0 -0
- /package/dist/{client-5Z4IVYAH.js.map → client-UKLOVDZB.js.map} +0 -0
- /package/dist/{config-2SRJEOO7.js.map → config-WUDWHRT6.js.map} +0 -0
- /package/dist/{config-mutator-RKEMP53O.js.map → config-mutator-UPLM7KGO.js.map} +0 -0
- /package/dist/{doctor-UKWJO3TG.js.map → doctor-COAIIKLV.js.map} +0 -0
- /package/dist/{processes-5EXCTSD5.js.map → processes-TXEWMXXJ.js.map} +0 -0
- /package/dist/{program-PUG7P7TC.js.map → program-VX4XZAE6.js.map} +0 -0
- /package/dist/{promote-3R56RJQD.js.map → promote-B7FGHUFA.js.map} +0 -0
- /package/dist/{query-6ZTEUTKC.js.map → query-ZSVAGGSM.js.map} +0 -0
- /package/dist/{registry-KJZDXHKL.js.map → registry-4DWWYWDR.js.map} +0 -0
- /package/dist/{request-planner-JFES5YW2.js.map → request-planner-DSXXT75B.js.map} +0 -0
- /package/dist/{review-candidates-OR375PHS.js.map → review-candidates-34S6R3DJ.js.map} +0 -0
- /package/dist/{routing-W2E52LYP.js.map → routing-HWGNYIF3.js.map} +0 -0
- /package/dist/{schedule-tool-XZL5AKFB.js.map → schedule-tool-JLIS2GQU.js.map} +0 -0
- /package/dist/{scheduler-BOQJMSJE.js.map → scheduler-F6NRVZ7W.js.map} +0 -0
- /package/dist/{seat-GAS7YKQA.js.map → seat-OQZY3CW7.js.map} +0 -0
- /package/dist/{select-UYFJH4V5.js.map → select-BBTWL7FN.js.map} +0 -0
- /package/dist/{set-enabled-PFMELM3V.js.map → set-enabled-OC3YT4D4.js.map} +0 -0
- /package/dist/{tool-BGEHMLJ3.js.map → tool-P4AHNZ5O.js.map} +0 -0
- /package/dist/{tool-W4NSPPXO.js.map → tool-R36FDI6E.js.map} +0 -0
- /package/dist/{wiki-L5FJ5RYE.js.map → wiki-5E4AGLKY.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ba as m,ca as $,ga as x}from"./chunk-54VYZE7A.js";x();import{readFileSync as S,writeFileSync as P,existsSync as b}from"fs";import{resolve as f}from"path";function w(r){if(r)return f(r);let e=[f(process.cwd(),"agentx.json"),f(process.cwd(),".agentx/config.json")];for(let n of e)if(b(n))return n;return e[0]}function v(r){return JSON.parse(JSON.stringify(r))}async function O(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/reload`,{method:"POST",signal:AbortSignal.timeout(3e3)});return e.ok?{ok:!0}:{ok:!1,reason:`HTTP ${e.status}`}}catch(e){return{ok:!1,reason:e?.cause?.code||e?.message||"unreachable"}}}async function J(r,e={}){let{validate:n=!0,dryRun:t=!1,reload:s=!0,configPath:u,daemonUrl:c}=e,o=w(u);if(!b(o))return{success:!1,path:o,error:`Config not found at ${o}. Run \`agentx init\` first.`};let d;try{d=S(o,"utf-8")}catch(a){return{success:!1,path:o,error:`Cannot read ${o}: ${a.message}`}}let g;try{g=JSON.parse(d)}catch(a){return{success:!1,path:o,error:`Invalid JSON in ${o}: ${a.message}`}}let i=v(g);try{await r(i)}catch(a){return{success:!1,path:o,error:`Mutator threw: ${a.message}`}}if(n){let a=$(i),l=m.safeParse(a);if(!l.success){let k=l.error.issues.map(y=>` ${y.path.join(".")||"<root>"}: ${y.message}`).join(`
|
|
2
2
|
`);return{success:!1,path:o,error:`Validation failed:
|
|
3
3
|
${k}`,after:i}}}if(t)return{success:!0,path:o,after:i,dryRun:!0};try{P(o,JSON.stringify(i,null,2)+`
|
|
4
4
|
`)}catch(a){return{success:!1,path:o,error:`Write failed: ${a.message}`,after:i}}let p=!1,h;if(s){let a=c||R(i),l=await O(a);l.ok?p=!0:h=l.reason}return{success:!0,path:o,after:i,reloaded:p,reloadSkipped:h}}function R(r){let e=r?.node?.bind;if(!e)return"http://127.0.0.1:18800";let[n,t]=e.split(":");return`http://${n==="0.0.0.0"||n==="::"?"127.0.0.1":n}:${t}`}function N(r,e,n){let t=e.split("."),s=r;for(let u=0;u<t.length-1;u++){let c=t[u];(s[c]===void 0||s[c]===null)&&(s[c]={}),s=s[c]}s[t[t.length-1]]=n}function j(r,e){let n=e.split("."),t=r;for(let s of n){if(t==null)return;t=t[s]}return t}function A(r,e){let n=e.split("."),t=r;for(let s=0;s<n.length-1;s++){if(t==null)return;t=t[n[s]]}t!=null&&delete t[n[n.length-1]]}export{w as a,J as b,N as c,j as d,A as e};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-I6HCIQCQ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as tt,c as nt}from"./chunk-GLQLCBJS.js";import{c as Ze}from"./chunk-SZDACK6O.js";import{b as ce}from"./chunk-AFRHKA7B.js";import{b as qe,e as Ye,f as Ge,i as Qe,k as Xe,l as et,q as rt}from"./chunk-
|
|
1
|
+
import{b as tt,c as nt}from"./chunk-GLQLCBJS.js";import{c as Ze}from"./chunk-SZDACK6O.js";import{b as ce}from"./chunk-AFRHKA7B.js";import{b as qe,e as Ye,f as Ge,i as Qe,k as Xe,l as et,q as rt}from"./chunk-HQWMWSSE.js";import{c as Ke,e as ze,f as Je}from"./chunk-KA2UIZXG.js";import{e as He,g as Ue,h as Be,i as de}from"./chunk-GQ76J72O.js";import{a as Ve}from"./chunk-GV7S5BAX.js";import{a as _e,b as oe,c as se,d as Le,e as ae}from"./chunk-QD6IICK7.js";import{v as Ce,w as hn}from"./chunk-ECCPLASB.js";import{b as Me,f as mn}from"./chunk-72SZI2UW.js";import{c as We,d as je}from"./chunk-QOYAX2FT.js";import{a as ie,i as gn}from"./chunk-PN6XHTG5.js";import{existsSync as yn,mkdirSync as it,readFileSync as wn,writeFileSync as kn,renameSync as bn}from"fs";import{resolve as ot,dirname as vn}from"path";var st=class{filePath;log;constructor(e={}){let t=e.baseDir??ot(process.cwd(),".agentx");this.filePath=ot(t,"handover.json"),this.log=e.log??console.error.bind(console,"[handover]"),it(t,{recursive:!0})}key(e,t,n){return`${e}::${t}::${n||"-"}`}load(){if(!yn(this.filePath))return{version:1,overrides:{}};try{let e=wn(this.filePath,"utf-8"),t=JSON.parse(e);return!t||typeof t!="object"?{version:1,overrides:{}}:(t.overrides||(t.overrides={}),t)}catch(e){return this.log(`load failed, starting empty: ${e?.message||e}`),{version:1,overrides:{}}}}save(e){it(vn(this.filePath),{recursive:!0});let t=`${this.filePath}.tmp-${process.pid}`;kn(t,JSON.stringify(e,null,2)),bn(t,this.filePath)}get(e,t,n){let o=this.load().overrides[this.key(e,t,n)];if(o&&!(o.expiresAt&&Date.parse(o.expiresAt)<Date.now()))return o}set(e){if(!e.channel||!e.chatId||!e.toAgent)throw new Error("channel, chatId and toAgent are required");let t=this.load(),n={...e,createdAt:e.createdAt??new Date().toISOString()};return t.overrides[this.key(n.channel,n.chatId,n.accountId)]=n,this.save(t),n}remove(e,t,n){let i=this.load(),o=this.key(e,t,n);return o in i.overrides?(delete i.overrides[o],this.save(i),!0):!1}consumeSummary(e,t,n){let i=this.load(),o=i.overrides[this.key(e,t,n)];if(!o||!o.summary||o.summaryConsumedAt)return;let s=o.summary;return o.summaryConsumedAt=new Date().toISOString(),this.save(i),s}listActive(){let e=this.load(),t=Date.now();return Object.values(e.overrides).filter(n=>!n.expiresAt||Date.parse(n.expiresAt)>=t)}listByAgent(e){let t=this.listActive();return{incoming:t.filter(n=>n.toAgent===e),outgoing:t.filter(n=>n.fromAgent===e)}}};import{readFileSync as ut,writeFileSync as le,appendFileSync as Rn,mkdirSync as $n,existsSync as pt,statSync as xn}from"fs";import{resolve as U}from"path";var at="[Agent Memory \u2014 persistent facts from past conversations]",Sn=2400;function dt(r,e){return r?`UNVERIFIED (${e===null?"age unknown":`${e}d old`}) `:""}function In(r,e=Date.now()){let t=ze(r,e),n=r.undated?"UNVERIFIED (never checked) ":dt(t,He(r.verifiedAt,e));return{line:`- [wiki ${r.id}] ${n}${r.subject} \xB7 ${r.attribute}: ${r.value} (${r.source}, checked ${r.verifiedAt.slice(0,10)} by ${r.verifiedBy})`,unverified:t}}function An(r,e){let n=!r.source.chatId.startsWith("-")&&/^\d+$/.test(r.source.chatId)?"DM":r.source.chatId,i=Be(r,e);return{line:`- [${r.category}] ${dt(i,Ue(r,e))}${r.content} (${n}, ${r.source.date})`,unverified:i}}function ct(r,e=[],t=Date.now()){let n=[],i=new Set,o=at.length,s=!1;for(let a of r){let d=e.length>0?Je(a.content,e):null,c,u,p=d&&Date.parse(a.createdAt)>Date.parse(d.verifiedAt)&&!a.content.toLowerCase().includes(d.value.toLowerCase());if(d&&!p){if(i.has(d.id))continue;i.add(d.id),c=In(d,t),u=d.id}else c=An(a,t),d&&(c.line+=` [differs from wiki ${d.id}]`);let f=c.unverified&&!s?de.length:0;if(o+f+c.line.length>Sn)break;n.push({fact:a,...c,...u?{wikiRef:u}:{}}),o+=f+c.line.length,f&&(s=!0)}return n}function lt(r){if(r.length===0)return"";let e=r.some(t=>t.unverified)?[de]:[];return[at,...e,...r.map(t=>t.line),"[End Memory]"].join(`
|
|
2
2
|
`)}var ft=200,Pn=7,gt=class{memoryDir;ledger;constructor(e=process.cwd()){this.memoryDir=U(e,".agentx/memory"),this.ledger=new Ke(U(e,".agentx/wiki")),pt(this.memoryDir)||$n(this.memoryDir,{recursive:!0})}filePath(e){return U(this.memoryDir,`${e}.jsonl`)}addMemory(e,t){if(t.category==="secret"||oe(t.content))return!1;let n=t.source.trust??_e(t.source.channel),i=t.review??Le(n),o={...t,source:{...t.source,trust:n},...i?{review:i}:{},id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,createdAt:new Date().toISOString()};return Rn(this.filePath(e),JSON.stringify(o)+`
|
|
3
3
|
`),!0}parsedCache=new Map;getAll(e){let t=this.filePath(e);if(!pt(t))return[];try{let{mtimeMs:n,size:i}=xn(t),o=this.parsedCache.get(t);if(o&&o.mtimeMs===n&&o.size===i)return o.facts.slice();let a=ut(t,"utf-8").split(`
|
|
4
4
|
`).filter(d=>d.trim()).map(d=>{try{return JSON.parse(d)}catch{return null}}).filter(d=>d!==null);return this.parsedCache.set(t,{mtimeMs:n,size:i,facts:a}),a.slice()}catch{return[]}}findRelevant(e,t,n=8){let i=this.getAll(t).filter(ae);if(i.length===0)return[];let o=i.map(g=>`${g.keywords.join(" ")} ${g.content}`),s=U(this.memoryDir,`${t}_bm25_cache.json`),a=je(o,s),d=We(e,a),c=new Map(d.map(g=>[g.docIndex,g.score])),p=i.map((g,h)=>{let m=c.get(h)??0;return g.category==="commitment"&&(m+=1),{memory:g,score:m}}).filter(g=>g.score>0);if(p.length===0)return i.slice(-n);let f=p.sort((g,h)=>h.score-g.score).slice(0,n).map(g=>g.memory);if(f.length>0)try{this.recordAccess(t,f.map(g=>g.id))}catch{}return f}buildContext(e){return lt(this.contextLines(e))}contextFacts(e){return this.contextLines(e).map(t=>t.fact)}contextLines(e){let t=[];try{t=this.ledger.list()}catch{}return ct(e,t)}recordAccess(e,t){if(t.length===0)return;let n=this.getAll(e),i=new Set(t),o=!1;for(let s of n)if(i.has(s.id)){s.accessCount=(s.accessCount||0)+1,s.lastAccessed=new Date().toISOString();let a=s.intervalDays||1;s.intervalDays=Math.min(a*2,30),s.nextReview=new Date(Date.now()+s.intervalDays*864e5).toISOString(),o=!0}o&&le(this.filePath(e),n.map(s=>JSON.stringify(s)).join(`
|
|
@@ -25,4 +25,4 @@ import{b as tt,c as nt}from"./chunk-GLQLCBJS.js";import{c as Ze}from"./chunk-SZD
|
|
|
25
25
|
`).filter(Boolean),i=[];for(let o=n.length-1;o>=0&&i.length<t;o--)try{let s=JSON.parse(n[o]);(!e||s.person===e)&&i.push(s)}catch{}return i}load(){if(Oe(this.file))try{let e=JSON.parse(Ne(this.file,"utf-8"));if(e&&Array.isArray(e.devices))return e}catch{}return{devices:[]}}save(e){Gt(Qt(this.file),{recursive:!0});let t=`${this.file}.${process.pid}.${en(4).toString("hex")}.tmp`;Zt(t,JSON.stringify(e,null,2)+`
|
|
26
26
|
`,{encoding:"utf-8",mode:384}),Vt(t,this.file)}};import{extname as ui}from"path";var nn=/<agentx-artifact>([\s\S]*?)<\/agentx-artifact>/gi,rn=/<agentx-artifact>[\s\S]*$/i;function Ps(r,e=1/0,t=!1){let n=[],i=String(r??"");if(!/<agentx-artifact>/i.test(i))return{text:i,artifacts:n};let o=i.replace(nn,(s,a)=>{try{let d=JSON.parse(a.trim());if(d&&typeof d.filename=="string"&&typeof d.mime=="string"&&n.length<e){let c=d.mime,u=c.startsWith("image/")?"image":c==="application/pdf"?"pdf":c.startsWith("text/")?"text":"file";n.push({type:u,filename:d.filename,mime:c})}}catch{}return""});return{text:(t?o.replace(rn,""):o).trim(),artifacts:n}}function Ts(r,e=!1){let t=String(r??""),n=t;if(/<agentx-artifact>/i.test(t)){let i=t.replace(nn,(o,s)=>{try{let a=JSON.parse(s.trim());return a&&typeof a.filename=="string"?a.filename:""}catch{return""}});n=(e?i.replace(rn,""):i).trim()}return n.replace(/```[\s\S]*?```|`[^`\n]*`|!\[([^\]\n]*)\]\(([^)\s]+)\)/g,(i,o,s)=>o===void 0||s===void 0?i:`[${o||s}](${s})`)}var pi={".png":{mime:"image/png",kind:"image"},".jpg":{mime:"image/jpeg",kind:"image"},".jpeg":{mime:"image/jpeg",kind:"image"},".gif":{mime:"image/gif",kind:"image"},".webp":{mime:"image/webp",kind:"image"},".svg":{mime:"image/svg+xml",kind:"file"},".pdf":{mime:"application/pdf",kind:"file"},".txt":{mime:"text/plain; charset=utf-8",kind:"file"},".md":{mime:"text/markdown; charset=utf-8",kind:"file"},".csv":{mime:"text/csv; charset=utf-8",kind:"file"},".json":{mime:"application/json",kind:"file"},".mp3":{mime:"audio/mpeg",kind:"audio"},".m4a":{mime:"audio/mp4",kind:"audio"},".wav":{mime:"audio/wav",kind:"audio"},".mp4":{mime:"video/mp4",kind:"video"},".webm":{mime:"video/webm",kind:"video"}},Os={bytes:20*1024*1024,perMessage:20,pathChars:512};function Ns(r){return pi[ui(r).toLowerCase()]??null}var fi=["[Phone app: showing files]","To show the owner a file you created (a chart, a screenshot, a PDF, a recording), save or copy it into .agentx/outbox/ in your workspace and end your reply with one line per file:",'<agentx-artifact>{"filename":".agentx/outbox/<name.ext>","mime":"<mime/type>"}</agentx-artifact>',"Files outside your workspace (/tmp, your home folder) are refused. Outbox files are removed after 7 days.","The line is removed from the text. Images show in the reply, audio and video get a player, other files an Open link. Allowed: png, jpg, gif, webp, svg, pdf, txt, md, csv, json, mp3, m4a, wav, mp4, webm; up to 20 MB and 20 files per reply.","A picture already on the web can go inline as ."].join(`
|
|
27
27
|
`);function Ds(r,e,t){return r==="app"&&e&&t!==!1?fi:void 0}import{lstatSync as Ee,mkdirSync as gi,readdirSync as mi,realpathSync as De,unlinkSync as hi}from"fs";import{join as ne,resolve as on}from"path";var sn=".agentx/outbox",yi=7*24*60*60*1e3;function wi(r,e){try{let t=De(on(e,r)),n=ne(t,sn);return De(n)===n&&Ee(n).isDirectory()?n:null}catch{return null}}function js(r,e={}){let t=e.cwd??process.cwd();if(e.create!==!1)try{let i=De(on(t,r));Ee(ne(i,".agentx"),{throwIfNoEntry:!1})?.isSymbolicLink()||gi(ne(i,sn),{recursive:!0})}catch{return 0}let n=wi(r,t);return n?an(n,(e.now??Date.now())-(e.maxAgeMs??yi)):0}function an(r,e){let t=0;for(let n of mi(r)){let i=ne(r,n);try{let o=Ee(i);o.isDirectory()?t+=an(i,e):Math.max(o.mtimeMs,o.ctimeMs)<e&&(hi(i),t++)}catch{}}return t}export{st as a,gt as b,mt as c,Fi as d,Nn as e,Wi as f,$ as g,pe as h,v as i,B as j,Bn as k,he as l,we as m,be as n,xe as o,Hr as p,qr as q,Te as r,ar as s,ai as t,tn as u,Ps as v,Ts as w,Os as x,Ns as y,Ds as z,sn as A,js as B};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-KIXDJEGA.js.map
|