agentix-cli 0.137.1 → 0.137.3

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 (42) hide show
  1. package/dist/{board-dashboard-VXQYQY22.js → board-dashboard-2A6VSQ7V.js} +2 -2
  2. package/dist/{chunk-BWXRAPTX.js → chunk-5HLD66CW.js} +2 -2
  3. package/dist/chunk-A5GYG56I.js +2 -0
  4. package/dist/chunk-A5GYG56I.js.map +1 -0
  5. package/dist/{chunk-ADQUFEPJ.js → chunk-ID4DCD2T.js} +67 -67
  6. package/dist/chunk-ID4DCD2T.js.map +1 -0
  7. package/dist/chunk-IS2IWRP7.js +4 -0
  8. package/dist/chunk-IS2IWRP7.js.map +1 -0
  9. package/dist/{chunk-LK4YO2FE.js → chunk-PNITKKDR.js} +2 -2
  10. package/dist/{chunk-K6UV4A2T.js → chunk-QY5YUHGW.js} +2 -2
  11. package/dist/{chunk-Z5OD225A.js → chunk-TEM7IIDC.js} +2 -2
  12. package/dist/{chunk-36HFRKIH.js → chunk-VDG6Y5L3.js} +1 -1
  13. package/dist/cli.js +1 -1
  14. package/dist/cli.js.map +1 -1
  15. package/dist/index.js +1 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/net-family-X2P3OVDP.js +2 -0
  18. package/dist/ntfy-Q4YHFKWW.js +2 -0
  19. package/dist/{program-MJ6S6X6T.js → program-3TO4YAY7.js} +5 -5
  20. package/dist/{program-MJ6S6X6T.js.map → program-3TO4YAY7.js.map} +1 -1
  21. package/dist/push-PRFZMCIK.js +2 -0
  22. package/dist/push-bridge-HNQG2TOI.js +2 -0
  23. package/dist/wiki-enrich-6776OMUB.js +2 -0
  24. package/dist/wiki-enrich-6776OMUB.js.map +1 -0
  25. package/package.json +1 -1
  26. package/dist/chunk-ADQUFEPJ.js.map +0 -1
  27. package/dist/chunk-KQ7KWFZY.js +0 -4
  28. package/dist/chunk-KQ7KWFZY.js.map +0 -1
  29. package/dist/ntfy-ZDNBUEIX.js +0 -2
  30. package/dist/push-HVGOC4VN.js +0 -2
  31. package/dist/push-bridge-NAQ7WQJX.js +0 -2
  32. package/dist/wiki-enrich-6CSUPULH.js +0 -2
  33. /package/dist/{board-dashboard-VXQYQY22.js.map → board-dashboard-2A6VSQ7V.js.map} +0 -0
  34. /package/dist/{chunk-BWXRAPTX.js.map → chunk-5HLD66CW.js.map} +0 -0
  35. /package/dist/{chunk-LK4YO2FE.js.map → chunk-PNITKKDR.js.map} +0 -0
  36. /package/dist/{chunk-K6UV4A2T.js.map → chunk-QY5YUHGW.js.map} +0 -0
  37. /package/dist/{chunk-Z5OD225A.js.map → chunk-TEM7IIDC.js.map} +0 -0
  38. /package/dist/{chunk-36HFRKIH.js.map → chunk-VDG6Y5L3.js.map} +0 -0
  39. /package/dist/{ntfy-ZDNBUEIX.js.map → net-family-X2P3OVDP.js.map} +0 -0
  40. /package/dist/{push-HVGOC4VN.js.map → ntfy-Q4YHFKWW.js.map} +0 -0
  41. /package/dist/{push-bridge-NAQ7WQJX.js.map → push-PRFZMCIK.js.map} +0 -0
  42. /package/dist/{wiki-enrich-6CSUPULH.js.map → push-bridge-HNQG2TOI.js.map} +0 -0
@@ -1,4 +0,0 @@
1
- var $=[1e3,3e3,8e3];function w(e){let t=e,n=t?.message??String(e),s=t?.cause;return s?.code?`${n} code=${s.code}`:s?.message&&s.message!==n?`${n} (${s.message})`:n}function b(e){return e===429||e>=500}function u(e){return/^[\x20-\x7E]*$/.test(e)?e:`=?UTF-8?B?${Buffer.from(e,"utf8").toString("base64")}?=`}function v(e){let t=e.split(`
2
- `),n=(t[0]??"").trim(),s=t.slice(1).join(`
3
- `).trim();return s?n.length===0||n.length>80?{body:e.trim()}:{title:n,body:s}:{body:e.trim()}}var h=class{name="ntfy";config;log;constructor(t,n=console.error.bind(console,"[ntfy]")){this.config=t,this.log=n}async start(){this.log(`ntfy: ready (${this.serverUrl()}/${this.config.topic})`)}async stop(){}onMessage(t){}serverUrl(){return(this.config.server||"https://ntfy.sh").replace(/\/+$/,"")}async send(t){let n=(t.chatId||"").trim(),s=n&&n!=="default"?n:this.config.topic;if(!s)throw new Error("ntfy: no topic (pass chatId, or set channels.ntfy.topic)");let f=v(t.text||""),y=f.title||this.config.defaultTitle||"AgentX",c={"Content-Type":"text/plain; charset=utf-8",Title:u(y),Priority:String(this.config.defaultPriority??3)};if(this.config.token&&(c.Authorization=`Bearer ${this.config.token}`),t.parseMode==="markdown"&&(c.Markdown="yes"),t.buttons?.length){let i=t.buttons.slice(0,3).map(r=>`view, ${r.label.replace(/[,;]/g," ")}, ${r.url}`).join("; ");c.Actions=u(i)}let m=`${this.serverUrl()}/${encodeURIComponent(s)}`,p=f.body||t.text||"",l=this.config.retryDelaysMs??$,g=l.length+1;for(let i=1;;i++){let r,o;try{r=await fetch(m,{method:"POST",headers:c,body:p})}catch(a){o=new Error(`ntfy: ${w(a)}`,{cause:a})}if(r){if(r.ok)return(await r.json().catch(()=>null))?.id;let a=await r.text().catch(()=>"");if(o=new Error(`ntfy: ${r.status} ${a.slice(0,200)}`),!b(r.status))throw o}if(i>=g)throw this.log(`ntfy: send failed after ${g} attempt(s): ${o.message}`),o;let d=l[i-1];this.log(`ntfy: attempt ${i}/${g} failed (${o.message}); retrying in ${d} ms`),await new Promise(a=>setTimeout(a,d))}}};export{w as a,v as b,h as c};
4
- //# sourceMappingURL=chunk-KQ7KWFZY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/channels/ntfy.ts"],"sourcesContent":["import type { ChannelAdapter, IncomingMessage, OutgoingMessage } from \"./types\"\n\n// --- ntfy channel — push notifications to the operator's phone ---\n//\n// Outbound only. ntfy has an inbound side (SSE subscribe), but nothing here\n// wants it: a push notification is a one-way tap on the shoulder, and replies\n// come back through the channels that already carry conversation (Telegram,\n// WhatsApp) or through POST /ask when Siri asks a follow-up.\n//\n// Registering it as a ChannelAdapter rather than a bespoke notifier is what\n// makes it free everywhere: notifications.destination, POST /send, cron\n// failure pings, and the agent-facing `channel` action all funnel through\n// router.sendOutbound() and already know how to address a channel + chatId.\n//\n// Addressing: `chatId` is the ntfy topic. The literal `\"default\"` (and an\n// empty string) resolve to the configured topic instead. That indirection\n// exists so agents never have to carry the topic in their prompts — on the\n// public ntfy.sh the topic IS the credential, and every caller that funnels\n// through the router (POST /send, channel.reply) requires a non-empty chatId.\n\nexport interface NtfyConfig {\n /** Base URL of the ntfy server. Default is the public ntfy.sh. */\n server?: string\n /** Default topic when an OutgoingMessage carries no chatId. */\n topic: string\n /** Access token for protected topics (ntfy `Authorization: Bearer`). */\n token?: string\n /** 1 (min) .. 5 (max). ntfy's default is 3. */\n defaultPriority?: number\n /** Notification title. Per-message titles override it. */\n defaultTitle?: string\n /** Waits between attempts when a publish fails on the network or with a\n * 429/5xx. One attempt more than there are entries. */\n retryDelaysMs?: number[]\n}\n\nconst DEFAULT_RETRY_DELAYS_MS = [1000, 3000, 8000]\n\n/** `fetch failed` hides the reason in `cause`; surface its code so a log\n * line says ETIMEDOUT or ECONNREFUSED rather than nothing useful (#930). */\nexport function describeFetchError(e: unknown): string {\n const err = e as { message?: string; cause?: { code?: string; message?: string } }\n const message = err?.message ?? String(e)\n const cause = err?.cause\n if (cause?.code) return `${message} code=${cause.code}`\n if (cause?.message && cause.message !== message) return `${message} (${cause.message})`\n return message\n}\n\nfunction isRetryableStatus(status: number): boolean {\n return status === 429 || status >= 500\n}\n\n/**\n * ntfy requires header values to be ASCII. Titles and tags routinely aren't\n * (French accents, Arabic), so non-ASCII values go out as RFC 2047 encoded\n * words, which ntfy decodes. Pure-ASCII values are passed through untouched\n * so the common case stays readable in logs.\n */\nfunction encodeHeader(value: string): string {\n // eslint-disable-next-line no-control-regex\n if (/^[\\x20-\\x7E]*$/.test(value)) return value\n return `=?UTF-8?B?${Buffer.from(value, \"utf8\").toString(\"base64\")}?=`\n}\n\n/** First line of the body, when it reads like a title (short, no trailing\n * punctuation that implies a sentence continues). Lets an agent write a\n * single blob and still get a well-formed notification. */\nexport function splitTitle(text: string): { title?: string; body: string } {\n const lines = text.split(\"\\n\")\n const first = (lines[0] ?? \"\").trim()\n const rest = lines.slice(1).join(\"\\n\").trim()\n if (!rest) return { body: text.trim() }\n if (first.length === 0 || first.length > 80) return { body: text.trim() }\n return { title: first, body: rest }\n}\n\nexport class NtfyAdapter implements ChannelAdapter {\n readonly name = \"ntfy\"\n private config: NtfyConfig\n private log: (...args: unknown[]) => void\n\n constructor(config: NtfyConfig, log: (...args: unknown[]) => void = console.error.bind(console, \"[ntfy]\")) {\n this.config = config\n this.log = log\n }\n\n async start(): Promise<void> {\n this.log(`ntfy: ready (${this.serverUrl()}/${this.config.topic})`)\n }\n\n async stop(): Promise<void> {}\n\n /** No inbound side — the handler is accepted and never invoked, which\n * satisfies router.addChannel() without pretending to poll. */\n onMessage(_handler: (msg: IncomingMessage) => Promise<void>): void {}\n\n private serverUrl(): string {\n return (this.config.server || \"https://ntfy.sh\").replace(/\\/+$/, \"\")\n }\n\n async send(msg: OutgoingMessage): Promise<string | void> {\n const requested = (msg.chatId || \"\").trim()\n const topic = requested && requested !== \"default\" ? requested : this.config.topic\n if (!topic) throw new Error(\"ntfy: no topic (pass chatId, or set channels.ntfy.topic)\")\n\n const split = splitTitle(msg.text || \"\")\n const title = split.title || this.config.defaultTitle || \"AgentX\"\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"text/plain; charset=utf-8\",\n \"Title\": encodeHeader(title),\n \"Priority\": String(this.config.defaultPriority ?? 3),\n }\n if (this.config.token) headers[\"Authorization\"] = `Bearer ${this.config.token}`\n if (msg.parseMode === \"markdown\") headers[\"Markdown\"] = \"yes\"\n\n // URL buttons map onto ntfy's view actions, so an alert can carry\n // \"open the MR\" without the operator hunting for it.\n if (msg.buttons?.length) {\n const actions = msg.buttons\n .slice(0, 3) // ntfy caps at 3\n .map(b => `view, ${b.label.replace(/[,;]/g, \" \")}, ${b.url}`)\n .join(\"; \")\n headers[\"Actions\"] = encodeHeader(actions)\n }\n\n const url = `${this.serverUrl()}/${encodeURIComponent(topic)}`\n const body = split.body || msg.text || \"\"\n const delays = this.config.retryDelaysMs ?? DEFAULT_RETRY_DELAYS_MS\n const attempts = delays.length + 1\n\n // A slow or flapping link loses pushes that a few seconds later would\n // go through. Retry network failures and server-side errors; a 4xx is\n // the request itself and fails at once.\n for (let attempt = 1; ; attempt++) {\n let res: Response | undefined\n let failure!: Error\n try {\n res = await fetch(url, { method: \"POST\", headers, body })\n } catch (e) {\n failure = new Error(`ntfy: ${describeFetchError(e)}`, { cause: e })\n }\n if (res) {\n if (res.ok) {\n const json = await res.json().catch(() => null) as { id?: string } | null\n return json?.id\n }\n const detail = await res.text().catch(() => \"\")\n failure = new Error(`ntfy: ${res.status} ${detail.slice(0, 200)}`)\n if (!isRetryableStatus(res.status)) throw failure\n }\n if (attempt >= attempts) {\n this.log(`ntfy: send failed after ${attempts} attempt(s): ${failure.message}`)\n throw failure\n }\n const wait = delays[attempt - 1]\n this.log(`ntfy: attempt ${attempt}/${attempts} failed (${failure.message}); retrying in ${wait} ms`)\n await new Promise(r => setTimeout(r, wait))\n }\n }\n}\n"],"mappings":"AAoCA,IAAMA,EAA0B,CAAC,IAAM,IAAM,GAAI,EAI1C,SAASC,EAAmB,EAAoB,CACrD,IAAMC,EAAM,EACNC,EAAUD,GAAK,SAAW,OAAO,CAAC,EAClCE,EAAQF,GAAK,MACnB,OAAIE,GAAO,KAAa,GAAGD,UAAgBC,EAAM,OAC7CA,GAAO,SAAWA,EAAM,UAAYD,EAAgB,GAAGA,MAAYC,EAAM,WACtED,CACT,CAEA,SAASE,EAAkBC,EAAyB,CAClD,OAAOA,IAAW,KAAOA,GAAU,GACrC,CAQA,SAASC,EAAaC,EAAuB,CAE3C,MAAI,iBAAiB,KAAKA,CAAK,EAAUA,EAClC,aAAa,OAAO,KAAKA,EAAO,MAAM,EAAE,SAAS,QAAQ,KAClE,CAKO,SAASC,EAAWC,EAAgD,CACzE,IAAMC,EAAQD,EAAK,MAAM;AAAA,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ACV,IAAIO,GAAK,SAASA,EAAE,MAAM,QAAQ,QAAS,GAAG,MAAMA,EAAE,KAAK,EAC3D,KAAK,IAAI,EACZF,EAAQ,QAAahB,EAAaiB,CAAO,EAG3C,IAAME,EAAM,GAAG,KAAK,UAAU,KAAK,mBAAmBN,CAAK,IACrDO,EAAON,EAAM,MAAQH,EAAI,MAAQ,GACjCU,EAAS,KAAK,OAAO,eAAiB5B,EACtC6B,EAAWD,EAAO,OAAS,EAKjC,QAASE,EAAU,GAAKA,IAAW,CACjC,IAAIC,EACAC,EACJ,GAAI,CACFD,EAAM,MAAM,MAAML,EAAK,CAAE,OAAQ,OAAQ,QAAAH,EAAS,KAAAI,CAAK,CAAC,CAC1D,OAASM,EAAP,CACAD,EAAU,IAAI,MAAM,SAAS/B,EAAmBgC,CAAC,IAAK,CAAE,MAAOA,CAAE,CAAC,CACpE,CACA,GAAIF,EAAK,CACP,GAAIA,EAAI,GAEN,OADa,MAAMA,EAAI,KAAK,EAAE,MAAM,IAAM,IAAI,IACjC,GAEf,IAAMG,EAAS,MAAMH,EAAI,KAAK,EAAE,MAAM,IAAM,EAAE,EAE9C,GADAC,EAAU,IAAI,MAAM,SAASD,EAAI,UAAUG,EAAO,MAAM,EAAG,GAAG,GAAG,EAC7D,CAAC7B,EAAkB0B,EAAI,MAAM,EAAG,MAAMC,EAE5C,GAAIF,GAAWD,EACb,WAAK,IAAI,2BAA2BA,iBAAwBG,EAAQ,SAAS,EACvEA,EAER,IAAMG,EAAOP,EAAOE,EAAU,CAAC,EAC/B,KAAK,IAAI,iBAAiBA,KAAWD,aAAoBG,EAAQ,yBAAyBG,MAAS,EACnG,MAAM,IAAI,QAAQC,GAAK,WAAWA,EAAGD,CAAI,CAAC,EAE9C,CACF","names":["DEFAULT_RETRY_DELAYS_MS","describeFetchError","err","message","cause","isRetryableStatus","status","encodeHeader","value","splitTitle","text","lines","first","rest","NtfyAdapter","config","log","_handler","msg","requested","topic","split","title","headers","actions","b","url","body","delays","attempts","attempt","res","failure","e","detail","wait","r"]}
@@ -1,2 +0,0 @@
1
- import{a,b,c}from"./chunk-KQ7KWFZY.js";import"./chunk-QIJLFPWE.js";export{c as NtfyAdapter,a as describeFetchError,b as splitTitle};
2
- //# sourceMappingURL=ntfy-ZDNBUEIX.js.map
@@ -1,2 +0,0 @@
1
- import{a,b,c,d,e,f,g}from"./chunk-BWXRAPTX.js";import"./chunk-KQ7KWFZY.js";import"./chunk-QIJLFPWE.js";export{c as DEFAULT_OPEN_URL,d as MAX_PAYLOAD_BYTES,f as PushAdapter,g as PushRelayAdapter,e as buildPushPayload,b as isRemoteDevice,a as remoteDeviceId};
2
- //# sourceMappingURL=push-HVGOC4VN.js.map
@@ -1,2 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk-Z5OD225A.js";import"./chunk-WCXXXAHV.js";import"./chunk-JWDJMFU6.js";import"./chunk-BWXRAPTX.js";import"./chunk-KQ7KWFZY.js";import"./chunk-QIJLFPWE.js";export{i as PushRosterSync,a as ROSTER_CHECK_MS,b as ROSTER_RESEND_MS,h as handlePushBridge,g as peerOrigins,d as pushBridgeCaller,c as pushOrigin,f as relayTokenProblem,e as scopedPushTarget};
2
- //# sourceMappingURL=push-bridge-NAQ7WQJX.js.map
@@ -1,2 +0,0 @@
1
- import{a,b}from"./chunk-36HFRKIH.js";import"./chunk-QIJLFPWE.js";export{a as claudeCall,b as registerWikiEnrich};
2
- //# sourceMappingURL=wiki-enrich-6CSUPULH.js.map