agentix-cli 0.92.3 → 0.92.4
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/{board-dashboard-KE765RZZ.js → board-dashboard-MHMYOBKA.js} +5 -4
- package/dist/board-dashboard-MHMYOBKA.js.map +1 -0
- package/dist/{chunk-KB2FN3G7.js → chunk-GWOJJ7FE.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{program-WWHLK63O.js → program-IAOEFLZP.js} +4 -4
- package/package.json +1 -1
- package/dist/board-dashboard-KE765RZZ.js.map +0 -1
- /package/dist/{chunk-KB2FN3G7.js.map → chunk-GWOJJ7FE.js.map} +0 -0
- /package/dist/{program-WWHLK63O.js.map → program-IAOEFLZP.js.map} +0 -0
|
@@ -1046,7 +1046,7 @@ body { margin: 0; overflow: hidden; }
|
|
|
1046
1046
|
text-align: center;
|
|
1047
1047
|
}
|
|
1048
1048
|
`;import{createServer as Im}from"http";import{appendFileSync as Mm,existsSync as fl,mkdirSync as Lm}from"fs";import{readFile as Rm}from"fs/promises";import{fileURLToPath as $m}from"url";import{dirname as Pm,resolve as at}from"path";Al();function He(t,e){if(!t)return"absent";let a=Ln(t),n=e.list().find(r=>r.hash===a);return n&&(n.revokedAt||n.expiresAt&&Date.parse(n.expiresAt)<Date.now())?"revoked":"invalid"}var Ee=class{constructor(e=r=>console.log(r),a=Date.now,n=6e4){this.log=e;this.now=a;this.everyMs=n}last=new Map;record(e,a){let n=Object.entries(a).map(([i,l])=>`${i}=${l}`).join(" "),r=`${e} ${a.cookie??""} ${a.bearer??""}`,o=this.now(),s=this.last.get(r);s!==void 0&&o-s<this.everyMs||(this.last.size>500&&this.prune(o),this.last.set(r,o),this.log(`[app] unauthenticated ${e} ${n}`))}prune(e){for(let[a,n]of this.last)e-n>=this.everyMs&&this.last.delete(a);this.last.size>500&&this.last.clear()}};function $t(t,e,a){let n={cookie:e};return a&&(n.bearer=a),n.mode=jr(t.headers["sec-fetch-mode"]),n.site=jr(t.headers["sec-fetch-site"]),n}function jr(t){let e=Array.isArray(t)?t[0]:t;return e&&/^[a-z-]{1,20}$/.test(e)?e:"-"}import{deflateSync as Bl}from"zlib";var zl=[41,121,255],ql=[255,255,255],Or=new Map;function Be(t){let e=Or.get(t);return e||(e=Ul(t,Fl(t)),Or.set(t,e)),e}function Fl(t){let e=1+t*3,a=Buffer.alloc(e*t),n=t/2,r=t*.22;for(let o=0;o<t;o++)for(let s=0;s<t;s++){let i=s+.5-n,l=o+.5-n,c=i*i+l*l<=r*r?ql:zl;a.set(c,o*e+1+s*3)}return a}function Ul(t,e){let a=Buffer.alloc(13);return a.writeUInt32BE(t,0),a.writeUInt32BE(t,4),a[8]=8,a[9]=2,Buffer.concat([Buffer.from([137,80,78,71,13,10,26,10]),pa("IHDR",a),pa("IDAT",Bl(e)),pa("IEND",Buffer.alloc(0))])}function pa(t,e){let a=Buffer.alloc(4);a.writeUInt32BE(e.length);let n=Buffer.concat([Buffer.from(t,"ascii"),e]),r=Buffer.alloc(4);return r.writeUInt32BE(Gl(n)),Buffer.concat([a,n,r])}var Wl=Array.from({length:256},(t,e)=>{let a=e;for(let n=0;n<8;n++)a=a&1?3988292384^a>>>1:a>>>1;return a>>>0});function Gl(t){let e=4294967295;for(let a of t)e=Wl[(e^a)&255]^e>>>8;return(e^4294967295)>>>0}lt();Tl();var Xl=7,Kl={gitlab:"GitLab",github:"GitHub",telegram:"Telegram",whatsapp:"WhatsApp",slack:"Slack",discord:"Discord",voice:"Voice",app:"Phone app",dashboard:"Dashboard",webrtc:"Call"};function Jl(t,e){let a=t.toLowerCase().split("@")[0],n=Kl[a]??t,r=/^(.+):(issue|merge_request|pull):(\d+)$/.exec(e);if(r){let o=r[2]==="issue"?"issue":r[2]==="pull"?"pull request":"merge request";return`${n} ${o} #${r[3]} in ${r[1]}`}return n}function Nr(t,e,a){let n=t.toLowerCase().split("@")[0],r=/^(.+):(issue|merge_request|pull):(\d+)$/.exec(e);if(!r)return null;let[,o,s,i]=r;return n==="gitlab"?`${(a.gitlab||"https://gitlab.com").replace(/\/+$/,"")}/${o}/-/${s==="issue"?"issues":"merge_requests"}/${i}`:n==="github"?`${(a.github||"https://github.com").replace(/\/+$/,"")}/${o}/${s==="issue"?"issues":"pull"}/${i}`:null}function Dr(t,e,a={}){let n=a.now??Date.now(),s=(t.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'requests'").get()?t.prepare("PRAGMA table_info(requests)").all():[]).some(u=>u.name==="person"),i=u=>({id:u.id,state:u.state,agentId:u.agent_id,text:u.text,channel:u.channel,chatId:u.chat_id,createdAt:u.created_at,updatedAt:u.updated_at,closedAt:u.closed_at??null,question:u.question??null,attentionReason:u.attention_reason??null,evidence:u.evidence??null,where:{label:Jl(u.channel,u.chat_id),url:a.linkFor?.(u.channel,u.chat_id)??null}}),l=s?t.prepare(`SELECT * FROM requests WHERE person = ? AND state IN (${aa.map(()=>"?").join(",")}) ORDER BY created_at, rowid`).all(e,...aa).map(i):[],c=s?t.prepare(`SELECT * FROM requests WHERE person = ? AND state IN (${na.map(()=>"?").join(",")}) AND COALESCE(closed_at, updated_at) >= ?
|
|
1049
|
-
ORDER BY COALESCE(closed_at, updated_at) DESC LIMIT 50`).all(e,...na,n-Xl*864e5).map(i):[],p=[];try{p=It(t,e,10)}catch{}return{open:l,recent:c,runs:p}}function Hr(t){return t>=200&&t<300?"retry":t===401?"lock":"keep"}function Br(t,e){return!t||e-t>=3e4||t>e}function Pt(t,e){let a="23456789ABCDEFGHJKMNPQRSTUVWXYZ",n=String(t||"").toUpperCase(),r=Math.max(0,Math.min(Number(e)||0,n.length)),o="",s=0;for(let l=0;l<n.length&&o.length<8;l++)a.indexOf(n.charAt(l))<0||(o+=n.charAt(l),l<r&&s++);let i=o.length>4?o.slice(0,4)+"-"+o.slice(4):o;return{value:i,caret:Math.min(s>4?s+1:s,i.length)}}function zr(t){let e=String(t||"").trim(),a=/^https?:[/][/][^/#?]+[/]app[/]pair[/]?#(.*)$/i.exec(e);if(a){let r=a[1].split("&");for(let o=0;o<r.length;o++){if(r[o].indexOf("token=")!==0)continue;let s="";try{s=decodeURIComponent(r[o].slice(6))}catch{return{kind:"none"}}return/^agx_live_[0-9a-f]{64}$/.test(s)?{kind:"token",token:s}:{kind:"none"}}return{kind:"none"}}let n=e.toUpperCase();return/^[A-Z0-9]{4}-?[A-Z0-9]{4}$/.test(n)?{kind:"code",code:n.slice(0,4)+"-"+n.slice(-4)}:{kind:"none"}}function qr(t,e,a,n){return e?
|
|
1049
|
+
ORDER BY COALESCE(closed_at, updated_at) DESC LIMIT 50`).all(e,...na,n-Xl*864e5).map(i):[],p=[];try{p=It(t,e,10)}catch{}return{open:l,recent:c,runs:p}}function Hr(t){return t>=200&&t<300?"retry":t===401?"lock":"keep"}function Br(t,e){return!t||e-t>=3e4||t>e}function Pt(t,e){let a="23456789ABCDEFGHJKMNPQRSTUVWXYZ",n=String(t||"").toUpperCase(),r=Math.max(0,Math.min(Number(e)||0,n.length)),o="",s=0;for(let l=0;l<n.length&&o.length<8;l++)a.indexOf(n.charAt(l))<0||(o+=n.charAt(l),l<r&&s++);let i=o.length>4?o.slice(0,4)+"-"+o.slice(4):o;return{value:i,caret:Math.min(s>4?s+1:s,i.length)}}function zr(t){let e=String(t||"").trim(),a=/^https?:[/][/][^/#?]+[/]app[/]pair[/]?#(.*)$/i.exec(e);if(a){let r=a[1].split("&");for(let o=0;o<r.length;o++){if(r[o].indexOf("token=")!==0)continue;let s="";try{s=decodeURIComponent(r[o].slice(6))}catch{return{kind:"none"}}return/^agx_live_[0-9a-f]{64}$/.test(s)?{kind:"token",token:s}:{kind:"none"}}return{kind:"none"}}let n=e.toUpperCase();return/^[A-Z0-9]{4}-?[A-Z0-9]{4}$/.test(n)?{kind:"code",code:n.slice(0,4)+"-"+n.slice(-4)}:{kind:"none"}}function qr(t,e,a,n){return t?e?{text:"Can't reach the server. "+(n?"Showing what was last loaded. ":"")+"Trying again every "+a+" seconds.",retry:!0}:{text:"Offline. Showing what was last loaded; live state needs a connection.",retry:!1}:null}function Fr(t){return String(t??"").replace(/```[\w-]*|`/g,"").replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[ \t]*(?:#{1,6}|>+|[-*+]|\d+[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/gm,"").replace(/\*\*|~~/g,"").replace(/(^|[\s(])\*(\S(?:[^*\n]*\S)?)\*(?=[\s).,;:!?]|$)/gm,"$1$2").replace(/\s+/g," ").trim()}var Ur=`
|
|
1050
1050
|
(function () {
|
|
1051
1051
|
var POLL_S = 30, RETRY_S = 20, GIVE_UP_MS = 15000;
|
|
1052
1052
|
var who = document.getElementById('who');
|
|
@@ -1056,7 +1056,8 @@ body { margin: 0; overflow: hidden; }
|
|
|
1056
1056
|
var install = document.getElementById('install');
|
|
1057
1057
|
var updated = document.getElementById('updated');
|
|
1058
1058
|
var theme = document.getElementById('theme');
|
|
1059
|
-
|
|
1059
|
+
// No network counts as a failed load until a load works (#496).
|
|
1060
|
+
var failed = navigator.onLine === false, loaded = false, named = false, busy = false, timer = null;
|
|
1060
1061
|
theme.addEventListener('click', function () {
|
|
1061
1062
|
var cur = document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';
|
|
1062
1063
|
document.documentElement.setAttribute('data-theme', cur);
|
|
@@ -1075,7 +1076,7 @@ body { margin: 0; overflow: hidden; }
|
|
|
1075
1076
|
retry.hidden = !note.retry;
|
|
1076
1077
|
}
|
|
1077
1078
|
window.addEventListener('online', function () { failed = false; showConn(); load(); });
|
|
1078
|
-
window.addEventListener('offline', showConn);
|
|
1079
|
+
window.addEventListener('offline', function () { failed = true; showConn(); });
|
|
1079
1080
|
retry.addEventListener('click', function () { load(); });
|
|
1080
1081
|
// A 401 or 403 means this machine's key ended: /member then shows the pairing page.
|
|
1081
1082
|
function get(url) {
|
|
@@ -19345,4 +19346,4 @@ data: ${h.replace(/\n/g," ")}
|
|
|
19345
19346
|
`)}catch{}}};s.stdout?.on("data",l),s.stderr?.on("data",l);let c=setInterval(()=>{try{e.write(`: hb
|
|
19346
19347
|
|
|
19347
19348
|
`)}catch{}},15e3),p=()=>{clearInterval(c);try{s.kill()}catch{}try{e.end()}catch{}};t.on("close",p),s.on("exit",p),s.on("error",p)}async function ml(t,e,a,n){let r=a.url+n,o=(t.method||"GET").toUpperCase(),i=o!=="GET"&&o!=="HEAD"?await new Promise((u,f)=>{let h=[];t.on("data",k=>h.push(k)),t.on("end",()=>u(Buffer.concat(h))),t.on("error",f)}):void 0,l={},c=t.headers["content-type"];c&&(l["Content-Type"]=Array.isArray(c)?c[0]:c);let p=t.headers["x-requested-with"];p&&(l["X-Requested-With"]=Array.isArray(p)?p[0]:p),a.token&&(l.Authorization=`Bearer ${a.token}`),l["X-Agentx-Peer"]="primary";try{let u=await fetch(r,{method:o,headers:l,body:i&&i.length>0?i:void 0}),f=Buffer.from(await u.arrayBuffer());e.writeHead(u.status,{"Content-Type":u.headers.get("content-type")||"application/json","Cache-Control":"no-store"}),e.end(f)}catch(u){b(e,502,{error:`proxy to peer failed: ${u?.message||u}`,target:r})}}function nt(t,e){let a=t.replace(/\/+$/,""),n=(e.dashboard?.daemons||[]).find(r=>r.url.replace(/\/+$/,"")===a);return n?{url:bl(n),token:n.dashboardToken||n.token}:null}export{Jm as applyAttachSessions,qm as fetchDaemonAgents,Om as handleBoardRequest,Qy as resetLiveCaches,we as resolveNodeTargets,Yy as startBoardDashboard,Km as withLastGood};
|
|
19348
|
-
//# sourceMappingURL=board-dashboard-
|
|
19349
|
+
//# sourceMappingURL=board-dashboard-MHMYOBKA.js.map
|