agentix-cli 0.169.0 → 0.170.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/README.md +2 -1
- package/dist/{App-GK5F6QMB.js → App-BT67QQ5H.js} +2 -2
- package/dist/{ChatApp-4HHJB4HM.js → ChatApp-64WRBUKX.js} +2 -2
- package/dist/{absorb-eval-PO7TUGT2.js → absorb-eval-IHNCDJTM.js} +2 -2
- package/dist/adapter-URLHEV3F.js +12 -0
- package/dist/adapter-URLHEV3F.js.map +1 -0
- package/dist/{agent-6WKET7JZ.js → agent-Q73VAOJR.js} +2 -2
- package/dist/{board-dashboard-NEYLE6NJ.js → board-dashboard-VZYUXVP6.js} +379 -294
- package/dist/board-dashboard-VZYUXVP6.js.map +1 -0
- package/dist/{chunk-CBXPIKPJ.js → chunk-3Y6QTM4Z.js} +2 -2
- package/dist/{chunk-6VKWJQOX.js → chunk-4BVISFOC.js} +170 -170
- package/dist/chunk-4BVISFOC.js.map +1 -0
- package/dist/{chunk-UKKOBMOP.js → chunk-5P5TRMTT.js} +2 -2
- package/dist/{chunk-BRQKV4FC.js → chunk-7JX766OQ.js} +2 -2
- package/dist/{chunk-E67Z6OYF.js → chunk-7TEJJM24.js} +2 -2
- package/dist/{chunk-UF5TWOKL.js → chunk-AKL5ZKJO.js} +12 -12
- package/dist/chunk-AKL5ZKJO.js.map +1 -0
- package/dist/{chunk-5QI7XFTA.js → chunk-CLH4QJAO.js} +2 -2
- package/dist/{chunk-U4PICSLC.js → chunk-CQBWWH2B.js} +2 -2
- package/dist/{chunk-KWY5IBII.js → chunk-CWYCCQ57.js} +2 -2
- package/dist/{chunk-YQM6VR6U.js → chunk-CX6HUPUZ.js} +2 -2
- package/dist/{chunk-LXW7H4D4.js → chunk-E7VJU7FI.js} +2 -2
- package/dist/{chunk-Z6ZR2ELO.js → chunk-EYC5DJR2.js} +2 -2
- package/dist/{chunk-ZTIOHZIL.js → chunk-FAU6WDVT.js} +2 -2
- package/dist/{chunk-PIJ6ECBC.js → chunk-FP4DT6D5.js} +2 -2
- package/dist/{chunk-FEA3XMVU.js → chunk-FWT23FGY.js} +67 -67
- package/dist/chunk-FWT23FGY.js.map +1 -0
- package/dist/{chunk-DCJHCUEQ.js → chunk-GKE7IP3T.js} +2 -2
- package/dist/{chunk-S34KFBMJ.js → chunk-I4VNUTLL.js} +3 -3
- package/dist/{chunk-TVGVQABC.js → chunk-IZDFUFAQ.js} +2 -2
- package/dist/{chunk-COMJ7R5T.js → chunk-JXGREJDJ.js} +2 -2
- package/dist/{chunk-JKMFMW3E.js → chunk-K4HQYC5M.js} +2 -2
- package/dist/chunk-OJ2XT27M.js +3 -0
- package/dist/chunk-OJ2XT27M.js.map +1 -0
- package/dist/{chunk-EEM433JK.js → chunk-OMD44DQ6.js} +2 -2
- package/dist/{chunk-KMPUUH5R.js → chunk-OV77U4GH.js} +2 -2
- package/dist/{chunk-E7Y4G3FK.js → chunk-RE5XFWBY.js} +5 -5
- package/dist/{chunk-U5SJLLXH.js → chunk-SEQXJWSD.js} +2 -2
- package/dist/chunk-U5P7VICU.js +92 -0
- package/dist/chunk-U5P7VICU.js.map +1 -0
- package/dist/{chunk-BRK6M6LA.js → chunk-VJ5HC63R.js} +2 -2
- package/dist/chunk-VJ5HC63R.js.map +1 -0
- package/dist/{chunk-HFSPH5WM.js → chunk-WWH3SKMB.js} +2 -2
- package/dist/{chunk-5PEXL5LD.js → chunk-XGREDHJY.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-DOIYODET.js → client-WPOAEQSW.js} +2 -2
- package/dist/config-7MCC4L7E.js +2 -0
- package/dist/config-mutate-GLF2MEW4.js +2 -0
- package/dist/config-mutator-KWUDF36N.js +2 -0
- package/dist/{contributions-2CJFYRZ7.js → contributions-A3JV2JW6.js} +2 -2
- package/dist/{doctor-OQZMDL5S.js → doctor-XWGGS3MM.js} +2 -2
- package/dist/{facts-ROUMKS7I.js → facts-ALJBF7IA.js} +2 -2
- package/dist/{follow-up-tool-PQUPXQQT.js → follow-up-tool-TPR3BCCK.js} +2 -2
- package/dist/hub-RBVAC7NA.js +2 -0
- package/dist/index.d.ts +263 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{program-URGH65VO.js → program-OBTSSEUB.js} +290 -288
- package/dist/program-OBTSSEUB.js.map +1 -0
- package/dist/{promote-ZWQAL3RE.js → promote-KMDLBVCS.js} +2 -2
- package/dist/{query-N4EJ24LW.js → query-PC2V2M2H.js} +2 -2
- package/dist/{query-settings-RZV5ELLC.js → query-settings-FK5QR7MM.js} +2 -2
- package/dist/{registry-EBYOZK3P.js → registry-TDZCAQAS.js} +2 -2
- package/dist/{request-planner-KCG6QB6M.js → request-planner-OYY36H2K.js} +2 -2
- package/dist/{review-candidates-3GHWVJQ3.js → review-candidates-STVUGCVM.js} +2 -2
- package/dist/routing-SHHD6M67.js +2 -0
- package/dist/schedule-tool-O6OIDKNV.js +2 -0
- package/dist/{scheduler-SCVCNKJC.js → scheduler-CIOGE7UG.js} +2 -2
- package/dist/{seat-PD7W3KAN.js → seat-LWJS5BKD.js} +2 -2
- package/dist/{select-Z3YXBGUP.js → select-VYBDUP4R.js} +2 -2
- package/dist/{set-enabled-NJYJWDWH.js → set-enabled-KBLEBANS.js} +2 -2
- package/dist/{sprint-tool-OLHZZAK3.js → sprint-tool-TCASE2O7.js} +2 -2
- package/dist/{tool-XH5QN6JM.js → tool-LSDMU5OX.js} +2 -2
- package/dist/{tool-EVQBMGJV.js → tool-RQX6IEY7.js} +2 -2
- package/dist/{tool-7IKZO33P.js → tool-YMWIUVOK.js} +2 -2
- package/dist/{wiki-BPOTYAQV.js → wiki-IIAPP6RU.js} +2 -2
- package/dist/wiki-enrich-HNC76QED.js +2 -0
- package/package.json +5 -1
- package/dist/board-dashboard-NEYLE6NJ.js.map +0 -1
- package/dist/chunk-6VKWJQOX.js.map +0 -1
- package/dist/chunk-BRK6M6LA.js.map +0 -1
- package/dist/chunk-FEA3XMVU.js.map +0 -1
- package/dist/chunk-NKCS6EZ7.js +0 -92
- package/dist/chunk-NKCS6EZ7.js.map +0 -1
- package/dist/chunk-UF5TWOKL.js.map +0 -1
- package/dist/config-3UBJRE5R.js +0 -2
- package/dist/config-mutate-ZRPDYJKN.js +0 -2
- package/dist/config-mutator-B5MR3V4B.js +0 -2
- package/dist/hub-LOW7KS5N.js +0 -2
- package/dist/program-URGH65VO.js.map +0 -1
- package/dist/routing-XULOU6BI.js +0 -2
- package/dist/schedule-tool-ALZXDGGC.js +0 -2
- package/dist/wiki-enrich-JCNGRYQZ.js +0 -2
- /package/dist/{App-GK5F6QMB.js.map → App-BT67QQ5H.js.map} +0 -0
- /package/dist/{ChatApp-4HHJB4HM.js.map → ChatApp-64WRBUKX.js.map} +0 -0
- /package/dist/{absorb-eval-PO7TUGT2.js.map → absorb-eval-IHNCDJTM.js.map} +0 -0
- /package/dist/{agent-6WKET7JZ.js.map → agent-Q73VAOJR.js.map} +0 -0
- /package/dist/{chunk-CBXPIKPJ.js.map → chunk-3Y6QTM4Z.js.map} +0 -0
- /package/dist/{chunk-UKKOBMOP.js.map → chunk-5P5TRMTT.js.map} +0 -0
- /package/dist/{chunk-BRQKV4FC.js.map → chunk-7JX766OQ.js.map} +0 -0
- /package/dist/{chunk-E67Z6OYF.js.map → chunk-7TEJJM24.js.map} +0 -0
- /package/dist/{chunk-5QI7XFTA.js.map → chunk-CLH4QJAO.js.map} +0 -0
- /package/dist/{chunk-U4PICSLC.js.map → chunk-CQBWWH2B.js.map} +0 -0
- /package/dist/{chunk-KWY5IBII.js.map → chunk-CWYCCQ57.js.map} +0 -0
- /package/dist/{chunk-YQM6VR6U.js.map → chunk-CX6HUPUZ.js.map} +0 -0
- /package/dist/{chunk-LXW7H4D4.js.map → chunk-E7VJU7FI.js.map} +0 -0
- /package/dist/{chunk-Z6ZR2ELO.js.map → chunk-EYC5DJR2.js.map} +0 -0
- /package/dist/{chunk-ZTIOHZIL.js.map → chunk-FAU6WDVT.js.map} +0 -0
- /package/dist/{chunk-PIJ6ECBC.js.map → chunk-FP4DT6D5.js.map} +0 -0
- /package/dist/{chunk-DCJHCUEQ.js.map → chunk-GKE7IP3T.js.map} +0 -0
- /package/dist/{chunk-S34KFBMJ.js.map → chunk-I4VNUTLL.js.map} +0 -0
- /package/dist/{chunk-TVGVQABC.js.map → chunk-IZDFUFAQ.js.map} +0 -0
- /package/dist/{chunk-COMJ7R5T.js.map → chunk-JXGREJDJ.js.map} +0 -0
- /package/dist/{chunk-JKMFMW3E.js.map → chunk-K4HQYC5M.js.map} +0 -0
- /package/dist/{chunk-EEM433JK.js.map → chunk-OMD44DQ6.js.map} +0 -0
- /package/dist/{chunk-KMPUUH5R.js.map → chunk-OV77U4GH.js.map} +0 -0
- /package/dist/{chunk-E7Y4G3FK.js.map → chunk-RE5XFWBY.js.map} +0 -0
- /package/dist/{chunk-U5SJLLXH.js.map → chunk-SEQXJWSD.js.map} +0 -0
- /package/dist/{chunk-HFSPH5WM.js.map → chunk-WWH3SKMB.js.map} +0 -0
- /package/dist/{chunk-5PEXL5LD.js.map → chunk-XGREDHJY.js.map} +0 -0
- /package/dist/{client-DOIYODET.js.map → client-WPOAEQSW.js.map} +0 -0
- /package/dist/{config-3UBJRE5R.js.map → config-7MCC4L7E.js.map} +0 -0
- /package/dist/{config-mutate-ZRPDYJKN.js.map → config-mutate-GLF2MEW4.js.map} +0 -0
- /package/dist/{config-mutator-B5MR3V4B.js.map → config-mutator-KWUDF36N.js.map} +0 -0
- /package/dist/{contributions-2CJFYRZ7.js.map → contributions-A3JV2JW6.js.map} +0 -0
- /package/dist/{doctor-OQZMDL5S.js.map → doctor-XWGGS3MM.js.map} +0 -0
- /package/dist/{facts-ROUMKS7I.js.map → facts-ALJBF7IA.js.map} +0 -0
- /package/dist/{follow-up-tool-PQUPXQQT.js.map → follow-up-tool-TPR3BCCK.js.map} +0 -0
- /package/dist/{hub-LOW7KS5N.js.map → hub-RBVAC7NA.js.map} +0 -0
- /package/dist/{promote-ZWQAL3RE.js.map → promote-KMDLBVCS.js.map} +0 -0
- /package/dist/{query-N4EJ24LW.js.map → query-PC2V2M2H.js.map} +0 -0
- /package/dist/{query-settings-RZV5ELLC.js.map → query-settings-FK5QR7MM.js.map} +0 -0
- /package/dist/{registry-EBYOZK3P.js.map → registry-TDZCAQAS.js.map} +0 -0
- /package/dist/{request-planner-KCG6QB6M.js.map → request-planner-OYY36H2K.js.map} +0 -0
- /package/dist/{review-candidates-3GHWVJQ3.js.map → review-candidates-STVUGCVM.js.map} +0 -0
- /package/dist/{routing-XULOU6BI.js.map → routing-SHHD6M67.js.map} +0 -0
- /package/dist/{schedule-tool-ALZXDGGC.js.map → schedule-tool-O6OIDKNV.js.map} +0 -0
- /package/dist/{scheduler-SCVCNKJC.js.map → scheduler-CIOGE7UG.js.map} +0 -0
- /package/dist/{seat-PD7W3KAN.js.map → seat-LWJS5BKD.js.map} +0 -0
- /package/dist/{select-Z3YXBGUP.js.map → select-VYBDUP4R.js.map} +0 -0
- /package/dist/{set-enabled-NJYJWDWH.js.map → set-enabled-KBLEBANS.js.map} +0 -0
- /package/dist/{sprint-tool-OLHZZAK3.js.map → sprint-tool-TCASE2O7.js.map} +0 -0
- /package/dist/{tool-XH5QN6JM.js.map → tool-LSDMU5OX.js.map} +0 -0
- /package/dist/{tool-EVQBMGJV.js.map → tool-RQX6IEY7.js.map} +0 -0
- /package/dist/{tool-7IKZO33P.js.map → tool-YMWIUVOK.js.map} +0 -0
- /package/dist/{wiki-BPOTYAQV.js.map → wiki-IIAPP6RU.js.map} +0 -0
- /package/dist/{wiki-enrich-JCNGRYQZ.js.map → wiki-enrich-HNC76QED.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-QIJLFPWE.js";function r(n){if(!n||typeof n!="object")return null;let t=n;if(t.kind!=="human"&&t.kind!=="agent"||typeof t.channel!="string"||!t.channel)return null;let e={kind:t.kind,channel:t.channel.slice(0,40)};return typeof t.chatId=="string"&&(e.chatId=t.chatId.slice(0,200)),typeof t.sender=="string"&&(e.sender=t.sender.slice(0,120)),typeof t.agentId=="string"&&(e.agentId=t.agentId.slice(0,80)),typeof t.person=="string"&&t.person&&(e.person=t.person.slice(0,40)),e}function p(n){return r(n?.initiator)}function d(n){if(typeof n!="string")return!1;let t=n.trim().toLowerCase();return t==="agent"||u.some(e=>t.startsWith(e))}function o(n){let t=r(n?.initiator);if(t)return t.kind;let e=(n?.channel||"api").toLowerCase();return l.has(e)||d(n?.sender)?"agent":s.has(e)?"human":"agent"}function c(n,t){let e=r(n?.initiator);if(e)return e;let i={kind:o(n),channel:n?.channel||"api"};return n?.chatId&&(i.chatId=String(n.chatId)),n?.sender&&(i.sender=String(n.sender)),t&&(i.agentId=t),typeof n?.person=="string"&&n.person&&(i.person=n.person),i}function f(n){return n?r(n.initiator)!==null||!!n.delegation:!1}function h(n){return!n||f(n)?!1:o(n)==="human"}var s,l,u,g=a(()=>{"use strict";s=new Set(["telegram","whatsapp","slack","discord","gitlab","github","app","voice","dashboard","webrtc"]),l=new Set(["a2a","mcp","mesh","api","cron","workflow","events","reminder","heartbeat","system","internal","business","guest"]),u=["agent:","cron:","workflow:","mesh:","system:","internal:"]});export{s as a,p as b,d as c,o as d,c as e,f,h as g,g as h};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-QIJLFPWE.js";function r(n){if(!n||typeof n!="object")return null;let t=n;if(t.kind!=="human"&&t.kind!=="agent"||typeof t.channel!="string"||!t.channel)return null;let e={kind:t.kind,channel:t.channel.slice(0,40)};return typeof t.chatId=="string"&&(e.chatId=t.chatId.slice(0,200)),typeof t.sender=="string"&&(e.sender=t.sender.slice(0,120)),typeof t.agentId=="string"&&(e.agentId=t.agentId.slice(0,80)),typeof t.person=="string"&&t.person&&(e.person=t.person.slice(0,40)),e}function p(n){return r(n?.initiator)}function d(n){if(typeof n!="string")return!1;let t=n.trim().toLowerCase();return t==="agent"||u.some(e=>t.startsWith(e))}function o(n){let t=r(n?.initiator);if(t)return t.kind;let e=(n?.channel||"api").toLowerCase();return l.has(e)||d(n?.sender)?"agent":s.has(e)?"human":"agent"}function c(n,t){let e=r(n?.initiator);if(e)return e;let i={kind:o(n),channel:n?.channel||"api"};return n?.chatId&&(i.chatId=String(n.chatId)),n?.sender&&(i.sender=String(n.sender)),t&&(i.agentId=t),typeof n?.person=="string"&&n.person&&(i.person=n.person),i}function f(n){return n?r(n.initiator)!==null||!!n.delegation:!1}function h(n){return!n||f(n)?!1:o(n)==="human"}var s,l,u,g=a(()=>{"use strict";s=new Set(["telegram","whatsapp","slack","discord","email","gitlab","github","app","voice","dashboard","webrtc"]),l=new Set(["a2a","mcp","mesh","api","cron","workflow","events","reminder","heartbeat","system","internal","business","guest"]),u=["agent:","cron:","workflow:","mesh:","system:","internal:"]});export{s as a,p as b,d as c,o as d,c as e,f,h as g,g as h};
|
|
2
|
+
//# sourceMappingURL=chunk-VJ5HC63R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/a2a/initiator.ts"],"sourcesContent":["// --- Who started this work: a person or an agent ---\n//\n// One place answers \"is the root of this chain a human?\" so every caller\n// (A2A delegation today, the activity graph and ledger next) agrees. Keep\n// all human-vs-agent detection here; do not re-derive it from\n// `senderAgentId` at call sites, because relays such as the phone app set\n// fields that look agent-shaped for a turn a person started.\n//\n// The rules, in order:\n// 1. A propagated root (`context.initiator`) wins. It is stamped on the\n// first hop of a delegation and travels with the context, including\n// across mesh peers (sendTask forwards the context verbatim).\n// 2. Machine channels (cron, workflow, a2a, mcp, mesh, api, ...) are agent.\n// 3. A machine-shaped sender (\"agent:x\", \"cron:y\", ...) is agent. This is\n// how router bot-to-bot chains and callback turns are marked, and how\n// the GitHub/GitLab adapters mark an agent's comment posted with a\n// person's account (forgeSender in channels/outbound-marker.ts).\n// 4. Channels a person types or speaks on are human.\n// 5. Anything else is agent: unknown traffic keeps today's behaviour.\n\nexport type InitiatorKind = \"human\" | \"agent\"\n\n/** The root of a chain, carried in `context.initiator` on every hop after\n * the first. Only small identifying fields: it crosses the mesh. */\nexport interface RootInitiator {\n kind: InitiatorKind\n /** Channel the root turn arrived on (telegram, app, cron, ...). */\n channel: string\n chatId?: string\n sender?: string\n /** The agent that was talking to the person when the chain started. */\n agentId?: string\n /** The known person behind the root turn (people, #384). */\n person?: string\n}\n\n/** The subset of AgentTask.context this module reads. */\nexport interface InitiatorContext {\n channel?: string\n chatId?: string\n sender?: string\n initiator?: unknown\n delegation?: unknown\n person?: unknown\n [k: string]: unknown\n}\n\n/** Channels a person writes or speaks on. */\nexport const HUMAN_CHANNELS: ReadonlySet<string> = new Set([\n \"telegram\", \"whatsapp\", \"slack\", \"discord\", \"email\",\n \"gitlab\", \"github\",\n \"app\", \"voice\", \"dashboard\", \"webrtc\",\n])\n\n/** Channels only software writes on. `api` is here on purpose: a bare API\n * call has no conversation to come back to. */\nexport const AGENT_CHANNELS: ReadonlySet<string> = new Set([\n \"a2a\", \"mcp\", \"mesh\", \"api\",\n \"cron\", \"workflow\", \"events\", \"reminder\", \"heartbeat\",\n \"system\", \"internal\", \"business\",\n // A guest mesh's turn (#380): another organisation asks, this node's\n // agent acts. Not a person of this node.\n \"guest\",\n])\n\nconst AGENT_SENDER_PREFIXES = [\"agent:\", \"cron:\", \"workflow:\", \"mesh:\", \"system:\", \"internal:\"]\n\nfunction validRoot(v: unknown): RootInitiator | null {\n if (!v || typeof v !== \"object\") return null\n const o = v as Record<string, unknown>\n if (o.kind !== \"human\" && o.kind !== \"agent\") return null\n if (typeof o.channel !== \"string\" || !o.channel) return null\n const root: RootInitiator = { kind: o.kind, channel: o.channel.slice(0, 40) }\n if (typeof o.chatId === \"string\") root.chatId = o.chatId.slice(0, 200)\n if (typeof o.sender === \"string\") root.sender = o.sender.slice(0, 120)\n if (typeof o.agentId === \"string\") root.agentId = o.agentId.slice(0, 80)\n if (typeof o.person === \"string\" && o.person) root.person = o.person.slice(0, 40)\n return root\n}\n\n/** The root a delegated hop carries in `context.initiator`, or null on a\n * turn that is itself a root (read-only views such as the activity map). */\nexport function propagatedRootOf(ctx: InitiatorContext | undefined | null): RootInitiator | null {\n return validRoot(ctx?.initiator)\n}\n\n/** True for senders that name software rather than a person. */\nexport function isAgentSender(sender: unknown): boolean {\n if (typeof sender !== \"string\") return false\n const s = sender.trim().toLowerCase()\n return s === \"agent\" || AGENT_SENDER_PREFIXES.some((p) => s.startsWith(p))\n}\n\n/** Human or agent, for the chain this turn belongs to. */\nexport function classifyInitiator(ctx: InitiatorContext | undefined | null): InitiatorKind {\n const root = validRoot(ctx?.initiator)\n if (root) return root.kind\n const channel = (ctx?.channel || \"api\").toLowerCase()\n if (AGENT_CHANNELS.has(channel)) return \"agent\"\n if (isAgentSender(ctx?.sender)) return \"agent\"\n if (HUMAN_CHANNELS.has(channel)) return \"human\"\n return \"agent\"\n}\n\n/** The root to stamp on the next hop. An existing root is passed on\n * unchanged; otherwise this turn is the root. */\nexport function rootInitiatorOf(ctx: InitiatorContext | undefined | null, agentId?: string): RootInitiator {\n const existing = validRoot(ctx?.initiator)\n if (existing) return existing\n const root: RootInitiator = { kind: classifyInitiator(ctx), channel: ctx?.channel || \"api\" }\n if (ctx?.chatId) root.chatId = String(ctx.chatId)\n if (ctx?.sender) root.sender = String(ctx.sender)\n if (agentId) root.agentId = agentId\n if (typeof ctx?.person === \"string\" && ctx.person) root.person = ctx.person\n return root\n}\n\n/** True for a delegated hop (it carries a valid root) or a callback turn\n * (it carries `delegation`). Neither may hand work off asynchronously:\n * a hop has a caller waiting on its answer, and a callback must not fan\n * out into another callback. */\nexport function isInsideDelegation(ctx: InitiatorContext | undefined | null): boolean {\n if (!ctx) return false\n return validRoot(ctx.initiator) !== null || !!ctx.delegation\n}\n\n/** Is this turn the one talking to the person? Only that turn may hand\n * work off and end: a delegated turn (it carries a root) has a caller\n * waiting on its answer, and a callback turn (it carries `delegation`)\n * must not fan out again. */\nexport function isHumanFacingTurn(ctx: InitiatorContext | undefined | null): boolean {\n if (!ctx || isInsideDelegation(ctx)) return false\n return classifyInitiator(ctx) === \"human\"\n}\n"],"mappings":"mCAmEA,SAASA,EAAUC,EAAkC,CACnD,GAAI,CAACA,GAAK,OAAOA,GAAM,SAAU,OAAO,KACxC,IAAMC,EAAID,EAEV,GADIC,EAAE,OAAS,SAAWA,EAAE,OAAS,SACjC,OAAOA,EAAE,SAAY,UAAY,CAACA,EAAE,QAAS,OAAO,KACxD,IAAMC,EAAsB,CAAE,KAAMD,EAAE,KAAM,QAASA,EAAE,QAAQ,MAAM,EAAG,EAAE,CAAE,EAC5E,OAAI,OAAOA,EAAE,QAAW,WAAUC,EAAK,OAASD,EAAE,OAAO,MAAM,EAAG,GAAG,GACjE,OAAOA,EAAE,QAAW,WAAUC,EAAK,OAASD,EAAE,OAAO,MAAM,EAAG,GAAG,GACjE,OAAOA,EAAE,SAAY,WAAUC,EAAK,QAAUD,EAAE,QAAQ,MAAM,EAAG,EAAE,GACnE,OAAOA,EAAE,QAAW,UAAYA,EAAE,SAAQC,EAAK,OAASD,EAAE,OAAO,MAAM,EAAG,EAAE,GACzEC,CACT,CAIO,SAASC,EAAiBC,EAAgE,CAC/F,OAAOL,EAAUK,GAAK,SAAS,CACjC,CAGO,SAASC,EAAcC,EAA0B,CACtD,GAAI,OAAOA,GAAW,SAAU,MAAO,GACvC,IAAMC,EAAID,EAAO,KAAK,EAAE,YAAY,EACpC,OAAOC,IAAM,SAAWC,EAAsB,KAAMC,GAAMF,EAAE,WAAWE,CAAC,CAAC,CAC3E,CAGO,SAASC,EAAkBN,EAAyD,CACzF,IAAMF,EAAOH,EAAUK,GAAK,SAAS,EACrC,GAAIF,EAAM,OAAOA,EAAK,KACtB,IAAMS,GAAWP,GAAK,SAAW,OAAO,YAAY,EAEpD,OADIQ,EAAe,IAAID,CAAO,GAC1BN,EAAcD,GAAK,MAAM,EAAU,QACnCS,EAAe,IAAIF,CAAO,EAAU,QACjC,OACT,CAIO,SAASG,EAAgBV,EAA0CW,EAAiC,CACzG,IAAMC,EAAWjB,EAAUK,GAAK,SAAS,EACzC,GAAIY,EAAU,OAAOA,EACrB,IAAMd,EAAsB,CAAE,KAAMQ,EAAkBN,CAAG,EAAG,QAASA,GAAK,SAAW,KAAM,EAC3F,OAAIA,GAAK,SAAQF,EAAK,OAAS,OAAOE,EAAI,MAAM,GAC5CA,GAAK,SAAQF,EAAK,OAAS,OAAOE,EAAI,MAAM,GAC5CW,IAASb,EAAK,QAAUa,GACxB,OAAOX,GAAK,QAAW,UAAYA,EAAI,SAAQF,EAAK,OAASE,EAAI,QAC9DF,CACT,CAMO,SAASe,EAAmBb,EAAmD,CACpF,OAAKA,EACEL,EAAUK,EAAI,SAAS,IAAM,MAAQ,CAAC,CAACA,EAAI,WADjC,EAEnB,CAMO,SAASc,EAAkBd,EAAmD,CACnF,MAAI,CAACA,GAAOa,EAAmBb,CAAG,EAAU,GACrCM,EAAkBN,CAAG,IAAM,OACpC,CArIA,IAgDaS,EAQAD,EASPJ,EAjENW,EAAAC,EAAA,kBAgDaP,EAAsC,IAAI,IAAI,CACzD,WAAY,WAAY,QAAS,UAAW,QAC5C,SAAU,SACV,MAAO,QAAS,YAAa,QAC/B,CAAC,EAIYD,EAAsC,IAAI,IAAI,CACzD,MAAO,MAAO,OAAQ,MACtB,OAAQ,WAAY,SAAU,WAAY,YAC1C,SAAU,WAAY,WAGtB,OACF,CAAC,EAEKJ,EAAwB,CAAC,SAAU,QAAS,YAAa,QAAS,UAAW,WAAW","names":["validRoot","v","o","root","propagatedRootOf","ctx","isAgentSender","sender","s","AGENT_SENDER_PREFIXES","p","classifyInitiator","channel","AGENT_CHANNELS","HUMAN_CHANNELS","rootInitiatorOf","agentId","existing","isInsideDelegation","isHumanFacingTurn","init_initiator","__esmMin"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{kb as b,lb as k,nb as x,vb as S}from"./chunk-U5P7VICU.js";S();import{readFileSync as w,writeFileSync as v,existsSync as P}from"fs";import{resolve as d}from"path";function O(r){if(r)return d(r);let e=[d(process.cwd(),"agentx.json"),d(process.cwd(),".agentx/config.json")];for(let n of e)if(P(n))return n;return e[0]}function R(r){return JSON.parse(JSON.stringify(r))}async function C(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 N(r,e={}){let{validate:n=!0,dryRun:t=!1,reload:s=!0,configPath:l,daemonUrl:c}=e,o=O(l);if(!P(o))return{success:!1,path:o,error:`Config not found at ${o}. Run \`agentx init\` first.`};let g;try{g=w(o,"utf-8")}catch(a){return{success:!1,path:o,error:`Cannot read ${o}: ${a.message}`}}let p;try{p=JSON.parse(g)}catch(a){return{success:!1,path:o,error:`Invalid JSON in ${o}: ${a.message}`}}let i=R(p);try{await r(i)}catch(a){return{success:!1,path:o,error:`Mutator threw: ${a.message}`}}if(n){let a=k(i),u=b.safeParse(a);if(!u.success){let f=u.error.issues.map($=>` ${$.path.join(".")||"<root>"}: ${$.message}`).join(`
|
|
2
2
|
`);return{success:!1,path:o,error:`Validation failed:
|
|
3
3
|
${f}`,after:i}}let m=x(u.data);if(m.length)return{success:!1,path:o,error:`Validation failed:
|
|
4
4
|
${m.map(f=>` ${f}`).join(`
|
|
5
5
|
`)}`,after:i}}if(t)return{success:!0,path:o,after:i,dryRun:!0};try{v(o,JSON.stringify(i,null,2)+`
|
|
6
6
|
`)}catch(a){return{success:!1,path:o,error:`Write failed: ${a.message}`,after:i}}let h=!1,y;if(s){let a=c||M(i),u=await C(a);u.ok?h=!0:y=u.reason}return{success:!0,path:o,after:i,reloaded:h,reloadSkipped:y}}function M(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 A(r,e,n){let t=e.split("."),s=r;for(let l=0;l<t.length-1;l++){let c=t[l];(s[c]===void 0||s[c]===null)&&(s[c]={}),s=s[c]}s[t[t.length-1]]=n}function F(r,e){let n=e.split("."),t=r;for(let s of n){if(t==null)return;t=t[s]}return t}function U(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{O as a,N as b,A as c,F as d,U as e};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-WWH3SKMB.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-TDZCAQAS.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-XGREDHJY.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as o}from"./chunk-OSH2PEBH.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-
|
|
2
|
+
import{b as o}from"./chunk-OSH2PEBH.js";import"./chunk-QIJLFPWE.js";var e=o(process.versions.node);e&&(console.error(e),process.exit(1));var{buildProgram:s}=await import("./program-OBTSSEUB.js"),{installCliSignalExit:r}=await import("./signal-exit-WL7G3EEZ.js"),{applyConnectAttemptTimeout:i,configPathFromArgv:a,readConnectAttemptTimeout:n}=await import("./net-family-X2P3OVDP.js");r();i(n(process.cwd(),a(process.argv.slice(2))));var t=await s();process.argv.slice(2).length===0?t.outputHelp():t.parse();
|
|
3
3
|
//# sourceMappingURL=cli.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=client-
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-CLH4QJAO.js";import"./chunk-U5P7VICU.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";export{b as fetchAgents,d as fetchCrons,c as fetchProcesses,e as killProcess,a as resolveConn,f as sendTask,g as streamTask};
|
|
2
|
+
//# sourceMappingURL=client-WPOAEQSW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$a as h,Ua as a,Va as b,Wa as c,Xa as d,Ya as e,Za as f,_a as g,ab as i,bb as j,cb as k,db as l,eb as m,fb as n,gb as o,hb as p,ib as q,jb as r,kb as s,lb as t,mb as u,nb as v,ob as w,pb as x,qb as y,rb as z,sb as A,tb as B,vb as C}from"./chunk-U5P7VICU.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";C();export{a as INTEGRATION_KINDS,x as WIKI_CONTRIBUTE_JOB,y as WIKI_CONTRIBUTE_MERGE_JOB,A as WIKI_SUMMARIZE_JOB,q as approvalsConfigSchema,f as callsSchema,d as cameraBotSchema,v as crossFieldProblems,s as daemonConfigSchema,c as emailAccountSchema,b as eventSubscriptionSchema,t as expandEnvVars,e as isCronExpression,u as loadDaemonConfig,n as membersConfigSchema,i as mergePolicyConfigSchema,m as peopleConfigSchema,l as personSchema,p as qualityReportConfigSchema,o as requestStatusConfigSchema,k as requestsConfigSchema,g as reviewGateConfigSchema,h as trackersConfigSchema,w as validateWorkspaces,r as wallConfigSchema,j as watchersConfigSchema,z as withContributionJobs,B as withSummariesJob};
|
|
2
|
+
//# sourceMappingURL=config-7MCC4L7E.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"./chunk-3Y6QTM4Z.js";import"./chunk-U5P7VICU.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";export{a as mutateAgentxConfig,b as writeAgentxConfig};
|
|
2
|
+
//# sourceMappingURL=config-mutate-GLF2MEW4.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-WWH3SKMB.js";import"./chunk-U5P7VICU.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";export{b as applyConfigMutation,a as findConfigPath,d as getAtPath,c as setAtPath,e as unsetAtPath};
|
|
2
|
+
//# sourceMappingURL=config-mutator-KWUDF36N.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-
|
|
1
|
+
import{a as ee}from"./chunk-7TEJJM24.js";import"./chunk-JXGREJDJ.js";import{f as Q,k as V}from"./chunk-VJVXEVZ7.js";import{b as O}from"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-OWNQ2FD4.js";import{b as X}from"./chunk-KEXBEUSU.js";import"./chunk-I4VNUTLL.js";import"./chunk-JTFCU5LH.js";import"./chunk-K4HQYC5M.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-EYC5DJR2.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-BERWTVG2.js";import{b as N,c as H}from"./chunk-QOYAX2FT.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-U5P7VICU.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";import{createHash as le}from"crypto";import{existsSync as z,mkdirSync as ne,readdirSync as re,readFileSync as ge,renameSync as se,writeFileSync as pe}from"fs";import{resolve as w}from"path";var _={maxPatches:30,maxCostUsd:.5,maxItems:60},he=12,fe=2e3,me=1500,M=8,U=300,be=12,B="## Checked facts";function S(n){return w(n,"_contributions")}function E(n,r){if(!z(n))return r;try{return JSON.parse(ge(n,"utf-8"))}catch(t){throw new Error(`${n} is not valid JSON: ${t.message}`)}}function L(n,r){ne(w(n,".."),{recursive:!0});let t=`${n}.${process.pid}.tmp`;pe(t,`${JSON.stringify(r,null,2)}
|
|
2
2
|
`),se(t,n)}function ie(n){return{agents:E(w(S(n),"state.json"),{agents:{}}).agents??{}}}function ye(n){let r=w(S(n),"pending");return z(r)?re(r).filter(t=>t.endsWith(".json")).sort().map(t=>E(w(r,t),null)).filter(t=>!!t):[]}function G(n){return w(S(n),"held.json")}function K(n,r={}){let t=E(G(n),[]);return r.all?t:t.filter(a=>a.status==="held")}function _e(n){let r=w(S(n),"reports");if(!z(r))return null;let t=re(r).filter(a=>a.endsWith(".json")).sort().pop();return t?E(w(r,t),null):null}function ke(n,r,t,a={}){let o=ie(r).agents[t],c=a.now??Date.now(),e=a.since??o?.lastRunAt??new Date(c-864e5).toISOString(),d=e.slice(0,10),u=new Set(o?.processed??[]),s=[];for(let g of n.getAgentEntries(t))g.date<d||u.has(g.id)||s.push({id:g.id,at:g.date,kind:"chat",title:[g.source,g.sourceContext].filter(Boolean).join(" \xB7 "),text:g.content});if(a.db){let g=Date.parse(e);for(let l of V(a.db,{agentId:t,since:Number.isFinite(g)?g:void 0,limit:500})){if(l.status==="in-flight"||u.has(l.taskId))continue;let k=(Q(a.db,l.taskId)?.steps??[]).filter(b=>b.name==="tool_use"||b.action).slice(0,be).map(b=>`- ${b.action??b.name}${b.inputSummary?` ${x(b.inputSummary,160)}`:""}${b.outputSummary?` \u2192 ${x(b.outputSummary,240)}`:""}${b.error?` \u2717 ${x(b.error,120)}`:""}`),y=[`Request: ${x(l.originalMessage??l.messagePreview??"",600)}`,k.length?`Tool calls:
|
|
3
3
|
${k.join(`
|
|
4
4
|
`)}`:"",l.finalResponse?`Reply: ${x(l.finalResponse,800)}`:""].filter(Boolean).join(`
|
|
@@ -54,4 +54,4 @@ _Sources: ${t.sources.join("; ")}._`,a);return n.writeArticle(r,{title:t.title,.
|
|
|
54
54
|
`).replace(/\n{3,}/g,`
|
|
55
55
|
|
|
56
56
|
`).trim(),superseded:d}}function Ce(n){let r=n.previous?` (previously: ${n.previous})`:"";return`- **${n.attribute}:** ${n.value} \u2014 ${n.source}; checked ${n.checkedAt.slice(0,10)} by ${n.by}${r}`}function Re(n){let r=n.match(/^- \*\*.+?:\*\* (.*?) — .*?; checked (\S+) by \S+(?: \(previously: (.*)\))?$/);return r?{value:r[1],checkedAt:r[2],...r[3]?{previous:r[3]}:{}}:void 0}function J(n,r){return`contribution:${n}@${r.slice(0,10)}`}var Te={person:"people",project:"projects",place:"places",concept:"concepts",event:"events",decision:"decisions",pattern:"patterns"};function de(n,r,t){let a=r.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"page",o=t?Te[t]:"contributions",c=`${o}/${a}.md`;for(let e=2;n.readArticle(c);e++)c=`${o}/${a}-${e}.md`;return c}export{_ as DEFAULT_CONTRIBUTION_LIMITS,B as FACTS_HEADING,ue as applyFactLines,De as approveHeld,xe as buildContributionPrompt,S as contributionsDir,_e as latestReport,K as listHeld,ye as listPendingBatches,Be as mergeContributions,W as pageKey,Ae as parseContributionPatches,ke as pendingWork,Se as possibleDuplicate,Fe as rejectHeld,ce as replaceOnce,Me as runContribution};
|
|
57
|
-
//# sourceMappingURL=contributions-
|
|
57
|
+
//# sourceMappingURL=contributions-A3JV2JW6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=doctor-
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-7JX766OQ.js";import"./chunk-FP4DT6D5.js";import"./chunk-IMLAPB7G.js";import"./chunk-LQS27HSV.js";import"./chunk-MNG2AMKZ.js";import"./chunk-QPABR72X.js";import"./chunk-KP7KDLZ2.js";import"./chunk-OSH2PEBH.js";import"./chunk-U5P7VICU.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";export{i as daemonVoiceCheck,b as doctor,g as meshPeerTokenChecks,h as meshTokenChecksFromConfig,a as runDoctorChecks,e as runMirrorChecks,d as runNativeChecks,c as runNotificationChecks,f as runReminderChecks};
|
|
2
|
+
//# sourceMappingURL=doctor-XWGGS3MM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as g,b as y}from"./chunk-GTJIKXDB.js";import{c as F,h as G}from"./chunk-
|
|
1
|
+
import{a as g,b as y}from"./chunk-GTJIKXDB.js";import{c as F,h as G}from"./chunk-VJ5HC63R.js";import"./chunk-QIJLFPWE.js";import{existsSync as E,readFileSync as P}from"fs";import{resolve as M}from"path";var I=[["216","Tunisia"],["966","Saudi Arabia"],["971","UAE"],["974","Qatar"],["965","Kuwait"],["973","Bahrain"],["968","Oman"],["962","Jordan"],["961","Lebanon"],["212","Morocco"],["213","Algeria"],["218","Libya"],["249","Sudan"],["20","Egypt"],["90","Turkey"],["33","France"],["49","Germany"],["39","Italy"],["34","Spain"],["44","United Kingdom"],["31","Netherlands"],["32","Belgium"],["41","Switzerland"],["1","US/Canada"]];function p(n){let t=n.replace(/\D/g,""),o,e=0;for(let[r,a]of I)t.startsWith(r)&&r.length>e&&(o=a,e=r.length);return o}function A(n){let t=[];for(let o of n.split(`
|
|
2
2
|
`)){let e=o.trim();if(!e||e.startsWith("ALIAS"))continue;let r=e.split(/\s{2,}/).filter(Boolean);if(r.length<2)continue;let a=r[r.length-1];if(!a.includes("@"))continue;let i=r[r.length-2],s=r.length>=3?r[r.length-3]:"";if(!s||!/\d/.test(i))continue;let l=p(i);t.push({name:s,source:"wacli",fields:{phone:`+${i.replace(/\D/g,"")}`,whatsapp:a,...l?{country:l}:{}}})}return t}function w(){return{name:"wacli",provides:["contact value","country"],async available(){if(!await y("wacli"))return{kind:"not-installed",hint:"brew install wacli \u2014 see https://wacli.sh"};let{stdout:n,stderr:t,code:o}=await g("wacli",["contacts","search","__agentx_probe__"],{timeoutMs:1e4});return o!==0&&/auth|not logged in|no session|login/i.test(n+t)?{kind:"not-configured",hint:"wacli auth \u2014 scan the QR to link the account"}:null},async lookup(n,t){let o=[],e=new Set;for(let r of n)for(let a of T(r.name)){let{stdout:i,code:s}=await g("wacli",["contacts","search",a],{signal:t,timeoutMs:15e3});if(s!==0)continue;let l=A(i).filter(u=>C(u.name,r.name));if(l.length!==0){for(let u of l){let c=u.fields.whatsapp;e.has(c)||(e.add(c),o.push({...u,fuzzy:!j(u.name,r.name)}))}break}}return o}}}var h=n=>n.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9 ]/g,"").trim(),j=(n,t)=>h(n)===h(t);function T(n){let t=h(n).split(/\s+/).filter(o=>o.length>2);return t.length>1?[n,t[t.length-1]]:[n]}function C(n,t){let o=h(n).split(/\s+/).filter(Boolean),e=h(t).split(/\s+/).filter(Boolean);if(o.length===0||e.length===0)return!1;let[r,a]=o.length<=e.length?[o,e]:[e,o];return r.every(i=>a.includes(i))}var D={whatsapp:"whatsapp",telegram:"telegram",gitlab:"gitlab",github:"github",email:"email",phone:"phone",slack:"slack",discord:"discord"};function z(n=".agentx"){return M(process.cwd(),n,"contacts.json")}function S(n){if(!E(n))return[];try{let t=JSON.parse(P(n,"utf-8"));return Array.isArray(t?.contacts)?t.contacts:[]}catch{return[]}}var b=n=>n.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9 ]/g,"").trim();function _(n){return[n.name,n.id,...n.aliases??[]].filter(t=>!!(t&&t.trim())).map(b)}function L(n){let t={};for(let[o,e]of Object.entries(n.channels??{})){let r=String(e??"").trim();if(!r)continue;let a=D[o.toLowerCase()]??o.toLowerCase();if(a==="whatsapp"){let i=r.split("@")[0].replace(/\D/g,"");if(t.whatsapp=r.includes("@")?r:`${i}@s.whatsapp.net`,i){t.phone??=`+${i}`;let s=p(i);s&&(t.country??=s)}continue}if(a==="phone"){let i=r.replace(/\D/g,"");t.phone=r.startsWith("+")?r:`+${i}`;let s=p(i);s&&(t.country??=s);continue}if(a==="telegram"&&/^\d+$/.test(r)){t.telegramId=r;continue}t[a]=a==="gitlab"||a==="github"?r.startsWith("@")?r:`@${r}`:r}return t}function k(n={}){let t=n.path??z();return{name:"contacts",provides:["contact value","handles","country"],async available(){return E(t)?S(t).length>0?null:{kind:"not-configured",hint:`${t} has no contacts`}:{kind:"not-configured",hint:`no ${t} \u2014 add {"contacts":[{"name":"\u2026","aliases":[],"channels":{"whatsapp":"\u2026"}}]}`}},async lookup(o){let e=S(t);if(e.length===0)return[];let r=new Map;for(let s of e)for(let l of _(s))l&&r.set(l,s);let a=[],i=new Set;for(let s of o){let l=r.get(b(s.name));if(!l||i.has(l))continue;i.add(l);let u=L(l);Object.keys(u).length!==0&&a.push({name:l.name??s.name,source:"contacts",fields:u,fuzzy:b(l.name??"")!==b(s.name)})}return a}}}function v(n={}){let t=(n.baseUrl??process.env.GITLAB_URL??"").replace(/\/+$/,""),o=n.token??process.env.GITLAB_ADMIN_TOKEN??process.env.GITLAB_TOKEN;return{name:"gitlab",provides:["email","handle","profile URL"],async available(){if(!t)return{kind:"not-configured",hint:"export GITLAB_URL=https://<your-gitlab-host>"};if(!o)return{kind:"not-configured",hint:"export GITLAB_ADMIN_TOKEN=<PAT> (read_api scope is enough)"};try{let e=await fetch(`${t}/api/v4/user`,{headers:{"PRIVATE-TOKEN":o}});if(e.status===401||e.status===403)return{kind:"not-configured",hint:`GitLab rejected the token (${e.status}) \u2014 set a valid GITLAB_ADMIN_TOKEN`};if(!e.ok)return{kind:"failed",hint:`GitLab returned ${e.status} for the auth probe`}}catch(e){return{kind:"failed",hint:`cannot reach ${t}: ${String(e?.message??e)}`}}return null},async lookup(e,r){if(!o||!t)return[];let a=[],i=new Set;for(let s of e){let l=`${t}/api/v4/users?search=${encodeURIComponent(s.name)}&per_page=5`,u;try{let c=await fetch(l,{headers:{"PRIVATE-TOKEN":o},signal:r});if(!c.ok)continue;u=await c.json()}catch{continue}if(Array.isArray(u))for(let c of u){let d=c.username??c.web_url??"";if(!d||i.has(d))continue;i.add(d);let f={},m=c.email||c.public_email;m&&(f.email=m),c.username&&(f.gitlab=`@${c.username}`),c.web_url&&(f.profile=c.web_url),c.organization&&(f.organisation=c.organization),c.job_title&&(f.role=c.job_title),c.state&&c.state!=="active"&&(f.accountState=c.state),Object.keys(f).length!==0&&a.push({name:c.name??s.name,source:"gitlab",fields:f,fuzzy:(c.name??"").toLowerCase()!==s.name.toLowerCase()})}}return a}}}function x(){return{name:"gog",provides:["contact value","email","organisation","role","country"],async available(){if(!await y("gog"))return{kind:"not-installed",hint:"brew install gog \u2014 Google CLI"};let{stdout:n,stderr:t}=await g("gog",["contacts","list","-j"],{timeoutMs:2e4}),o=n+t;return/unknown flag|Run with --help/i.test(o)?{kind:"failed",hint:`gog rejected the probe: ${o.split(`
|
|
3
3
|
`)[0]}`}:/accessNotConfigured|has not been used in project/i.test(o)?{kind:"not-configured",hint:"enable the People API on the gog OAuth project, then retry (console.developers.google.com \u2192 APIs \u2192 People API)"}:/invalid_grant|PERMISSION_DENIED|unauthenticated/i.test(o)?{kind:"not-configured",hint:"gog auth login \u2014 the stored token is expired or lacks contacts scope"}:null},async lookup(n,t){let o=[];for(let e of n){let{stdout:r,code:a}=await g("gog",["contacts","search",e.name,"-j","--results-only"],{signal:t,timeoutMs:2e4});if(a!==0)continue;let i;try{i=JSON.parse(r)}catch{continue}let s=Array.isArray(i)?i:i?.results??i?.people??[];for(let l of s){let u={},c=l.phoneNumbers?.[0]?.value,d=l.emailAddresses?.[0]?.value,f=l.organizations?.[0];c&&(u.phone=c),d&&(u.email=d),f?.name&&(u.organisation=f.name),f?.title&&(u.role=f.title);let m=l.addresses?.[0]?.country;m&&(u.country=m),Object.keys(u).length!==0&&o.push({name:l.names?.[0]?.displayName??e.name,source:"gog",fields:u})}}return o}}}G();var R=n=>typeof n=="string"&&n.trim()?n.trim():void 0;function $(n){return String(n??"").split("@")[0].split(":")[0].toLowerCase()}function U(n){let t=new Map;for(let o of n){let e=R(o.meta?.sender);if(!e||F(e))continue;let r=R(o.meta?.senderId),a=R(o.meta?.senderUsername),i=$(o.source),s={};if(r&&/@s\.whatsapp\.net$/.test(r)){let c=r.split("@")[0].replace(/\D/g,"");if(c){s.phone=`+${c}`,s.whatsapp=r;let d=p(c);d&&(s.country=d)}}else if(i==="whatsapp"&&r&&/^\d{6,}$/.test(r)){s.phone=`+${r}`,s.whatsapp=`${r}@s.whatsapp.net`;let c=p(r);c&&(s.country=c)}if(a){let c=a.startsWith("@")?a:`@${a}`;i==="gitlab"?s.gitlab=c:i==="github"?s.github=c:i==="telegram"?s.telegram=c:s.handle=c}if(r&&!s.phone&&!a&&(s[`${i||"platform"}Id`]=r),Object.keys(s).length===0)continue;let l=e.toLowerCase(),u=t.get(l);if(!u){t.set(l,{name:e,source:"entries",fields:s});continue}for(let[c,d]of Object.entries(s))u.fields[c]??=d}return Array.from(t.values())}function H(n){let t;return{...n,available:()=>t??=n.available(),lookup:(o,e)=>n.lookup(o,e)}}function N(){return[k(),w(),v(),x()].map(H)}function ct(n,t={}){let o=t.max??25,e=new Map;for(let a of n){let i=(a.sender??"").trim();i&&O(i)&&e.set(i.toLowerCase(),{name:i,origin:"sender",type:"person"})}for(let a of n){let i=(a.context??"").trim();if(!O(i))continue;let s=i.toLowerCase();e.has(s)||e.set(s,{name:i,origin:"context"})}let r=(t.known??[]).filter(a=>a.trim().length>2);if(r.length>0){let a=n.map(i=>i.content??"").join(`
|
|
4
4
|
`).toLowerCase();for(let i of r){let s=i.toLowerCase().trim();e.has(s)||a.includes(s)&&e.set(s,{name:i,origin:"body",type:"person"})}}return Array.from(e.values()).slice(0,o)}var B=new Set(["me","user","system","cron","unknown","anonymous","bot","agent","self","test","admin","none","null","n/a"]),W=new Set(["group","team","chat","channel","squad","crew","room","family","project","board","committee","club","staff","office","dept","department","support","sales","ops","admins","everyone","all"]);function O(n){let t=n.trim();if(!t||t.length>48||B.has(t.toLowerCase())||/[\d@/\\#:|_]/.test(t))return!1;let o=t.split(/\s+/);return o.length<2||o.length>4||o.some(e=>W.has(e.toLowerCase()))?!1:o.every(e=>/^[\p{Lu}][\p{L}'’.-]*$/u.test(e))}async function lt(n,t={}){let o=t.sources??N(),e=n.slice(0,t.maxEntities??25);if(e.length===0)return{records:[],results:[]};let r=new AbortController,a=setTimeout(()=>r.abort(),t.timeoutMs??12e4);try{let i=await Promise.all(o.map(async s=>{let l=Date.now();try{let u=await s.available();if(u)return{source:s.name,records:[],unavailable:u,ms:Date.now()-l};let c=await s.lookup(e,r.signal);return{source:s.name,records:c,ms:Date.now()-l}}catch(u){return{source:s.name,records:[],unavailable:{kind:"failed",hint:String(u?.message??u)},ms:Date.now()-l}}}));for(let s of i)t.onResult?.(s);return{records:i.flatMap(s=>s.records),results:i}}finally{clearTimeout(a)}}function ut(n,t=N()){let o=new Map(t.map(e=>[e.name,e.provides]));return n.filter(e=>e.unavailable&&e.unavailable.kind!=="failed").map(e=>({source:e.source,kind:e.unavailable.kind,hint:e.unavailable.hint,provides:o.get(e.source)??[]}))}function ft(n){let t=new Map;for(let o of n){let e=o.name.toLowerCase().trim(),r=t.get(e);r||(r={name:o.name,fields:{}},t.set(e,r));for(let[a,i]of Object.entries(o.fields)){if(!i?.trim())continue;let s=r.fields[a];if(!s){r.fields[a]={value:i,source:o.source};continue}s.value!==i&&(r.fields[`${a} (${o.source})`]??={value:i,source:o.source})}}return Array.from(t.values())}function dt(n){if(n.length===0)return"";let t=n.filter(o=>Object.keys(o.fields).length>0).map(o=>{let e=Object.entries(o.fields).map(([r,a])=>` - ${r}: \`${a.value}\` _(${a.source})_`).join(`
|
|
@@ -19,4 +19,4 @@ contradicts the entries, this wins and the entry is stale.
|
|
|
19
19
|
${t.join(`
|
|
20
20
|
`)}
|
|
21
21
|
`}export{p as countryFromPhone,k as createContactsSource,v as createGitlabSource,x as createGogSource,w as createWacliSource,N as defaultSources,ct as extractHints,L as factsFrom,ut as installPrompts,O as isPersonName,S as loadContacts,H as memoizeAvailability,ft as mergeRecords,_ as namesOf,A as parseContactsTable,$ as platformOf,C as plausible,U as recordsFromEntries,dt as renderFactsBlock,lt as resolveFacts};
|
|
22
|
-
//# sourceMappingURL=facts-
|
|
22
|
+
//# sourceMappingURL=facts-ALJBF7IA.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{b as h}from"./chunk-
|
|
1
|
+
import{b as h}from"./chunk-5P5TRMTT.js";import"./chunk-RKPAVWXF.js";import"./chunk-E7VJU7FI.js";import{b as I}from"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import"./chunk-OV77U4GH.js";import"./chunk-WWH3SKMB.js";import"./chunk-3UOTLMXD.js";import"./chunk-FCPTN6NF.js";import"./chunk-7I7IEX4S.js";import"./chunk-U5P7VICU.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";var p=t=>typeof t=="string"?t.trim():"";function $(t){return[`Run ${t.runId} "${t.title}" [${t.status}] on step ${t.step}: waiting on ${t.waitingOn}.`,t.tags?.length?`Tags: ${t.tags.join(", ")}`:"",...(t.steps??[]).slice(-8).map(s=>`- ${String(s.at).slice(0,16).replace("T"," ")} ${s.step} ${s.status}${s.note?`: ${s.note}`:""}`)].filter(Boolean).join(`
|
|
2
2
|
`)}async function T(t,c){let s=c.fetch??fetch,m=c.daemonUrl.replace(/\/$/,""),r=(p(t.action)||"list").toLowerCase(),f=c.env??process.env,w=async i=>{let l=await s(`${m}${i}`,{signal:AbortSignal.timeout(1e4)}),n=await l.json().catch(()=>({}));return{ok:l.ok,status:l.status,data:n}};try{if(r==="list"){let e=await w("/follow-up");if(!e.ok)return`Error: ${e.data?.error||`HTTP ${e.status}`}`;let o=e.data.groups??[];return o.length?o.map(d=>[`${d.tag}:`,...d.rows.map(a=>`- ${a.runId} "${a.title}" on ${a.step}: waiting on ${a.waitingOn} (since ${String(a.since).slice(0,16).replace("T"," ")} UTC)`)].join(`
|
|
3
3
|
`)).join(`
|
|
4
4
|
`):"No follow-up workflows are running."}if(r==="match"){let e=p(t.request)||p(t.title);if(!e)return"Error: match needs `request`: the owner's request in their words.";let o=h(t,f),d=await w(`/follow-up/match?q=${encodeURIComponent(e)}${o?`&agentId=${encodeURIComponent(o.agentId)}`:""}`);if(!d.ok)return`Error: ${d.data?.error||`HTTP ${d.status}`}`;let a=d.data.matches??[];return a.length?["Saved workflows, best fit first (confidence 0-1):",...a.map(u=>`- ${u.workflowId} "${u.title}" (${u.confidence}${u.autoStart?", starts without asking":""}): ${u.steps.map(k=>k.id).join(" \u2192 ")}`),'Start one with {action:"start", workflowId:"<id>", title:"\u2026", tags:["client:<name>"]}. Run its steps through the workflow, not by hand.'].join(`
|
|
5
5
|
`):"No saved workflow fits. If the request has several steps, build one: start with title and steps."}if(r==="status"){let e=p(t.runId);if(!e)return"Error: status needs runId.";let o=await w(`/follow-up/${encodeURIComponent(e)}`);return o.ok?$(o.data.run):`Error: ${o.data?.error||`HTTP ${o.status}`}`}let i=h(t,f);if(!i)return"Error: couldn't tell which agent you are. Pass callerAgentId.";let l=await s(`${m}/follow-up`,{method:"POST",headers:{"Content-Type":"application/json",...I(f)},body:JSON.stringify({action:r,agentId:i.agentId,workflowId:t.workflowId,title:t.title,description:t.description,tags:t.tags,inputs:t.inputs,steps:t.steps,edges:t.edges,approval:t.approval,autoStart:t.autoStart,requestId:t.requestId,runId:t.runId,step:t.step,evidence:t.evidence,note:t.note,reason:t.reason,fromRun:t.fromRun,status:t.status}),signal:AbortSignal.timeout(2e4)}),n=await l.json().catch(()=>({}));if(!l.ok)return`Error: ${n?.error||`HTTP ${l.status}`}`;if(r==="start"){let e=n.run;return[`Started run ${e.runId} "${e.title}"${n.built?" (built from the steps you gave; propose it with fromRun to keep it)":""}.`,n.awaitingApproval?"It waits for the owner's approval before the first step.":`It is on step ${e.step}: ${e.waitingOn}.`,"AgentX follows it from here: it starts each step, reminds whoever is slow, and tells the owner when it ends. Do not run its steps by hand.",...n.warning?[`Note: ${n.warning}`]:[]].join(" ")}return r==="plan"?[`Plan recorded on run ${n.run?.runId??t.runId}:`,...(n.plan??[]).map(e=>`- ${e.id} ${e.title}`),'Report each step with {action:"step", runId, step:"<id>", status:"started"|"done"|"failed"}.'].join(`
|
|
6
6
|
`):r==="step"?`Step recorded. ${n.run?$(n.run):""}`.trim():r==="done"?`Step recorded as done. ${n.run?$(n.run):""}`.trim():r==="blocked"?"The step is marked blocked and the owner is told. Nothing more happens on it until it is sorted.":`Saved ${n.workflowId} switched off, and asked the owner (card ${n.cardId}) whether to keep it as a reusable workflow.`}catch(i){return`Error: couldn't reach the daemon (${i?.message??i}).`}}export{T as runWorkflowTool};
|
|
7
|
-
//# sourceMappingURL=follow-up-tool-
|
|
7
|
+
//# sourceMappingURL=follow-up-tool-TPR3BCCK.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-CQBWWH2B.js";import"./chunk-IZDFUFAQ.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-K4HQYC5M.js";import"./chunk-WPNRDEHW.js";import"./chunk-EYC5DJR2.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QOYAX2FT.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-U5P7VICU.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{a as WikiHub};
|
|
2
|
+
//# sourceMappingURL=hub-RBVAC7NA.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -4065,6 +4065,161 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4065
4065
|
contact?: string | undefined;
|
|
4066
4066
|
}[] | undefined;
|
|
4067
4067
|
}>>;
|
|
4068
|
+
/** Email (#1287): IMAP in, SMTP out, one account per mailbox. */
|
|
4069
|
+
email: z.ZodDefault<z.ZodObject<{
|
|
4070
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
4071
|
+
accounts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4072
|
+
/** The agent that answers mail sent to this address. */
|
|
4073
|
+
agent: z.ZodString;
|
|
4074
|
+
/** The address customers write to; replies come from it. */
|
|
4075
|
+
address: z.ZodString;
|
|
4076
|
+
/** Display name on replies. Default: the agent's name. */
|
|
4077
|
+
name: z.ZodOptional<z.ZodString>;
|
|
4078
|
+
imap: z.ZodObject<{
|
|
4079
|
+
host: z.ZodString;
|
|
4080
|
+
secure: z.ZodDefault<z.ZodBoolean>;
|
|
4081
|
+
user: z.ZodOptional<z.ZodString>;
|
|
4082
|
+
password: z.ZodOptional<z.ZodString>;
|
|
4083
|
+
} & {
|
|
4084
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
4085
|
+
}, "strip", z.ZodTypeAny, {
|
|
4086
|
+
port: number;
|
|
4087
|
+
host: string;
|
|
4088
|
+
secure: boolean;
|
|
4089
|
+
user?: string | undefined;
|
|
4090
|
+
password?: string | undefined;
|
|
4091
|
+
}, {
|
|
4092
|
+
host: string;
|
|
4093
|
+
user?: string | undefined;
|
|
4094
|
+
password?: string | undefined;
|
|
4095
|
+
port?: number | undefined;
|
|
4096
|
+
secure?: boolean | undefined;
|
|
4097
|
+
}>;
|
|
4098
|
+
/** Default: the IMAP login and password. */
|
|
4099
|
+
smtp: z.ZodObject<{
|
|
4100
|
+
host: z.ZodString;
|
|
4101
|
+
secure: z.ZodDefault<z.ZodBoolean>;
|
|
4102
|
+
user: z.ZodOptional<z.ZodString>;
|
|
4103
|
+
password: z.ZodOptional<z.ZodString>;
|
|
4104
|
+
} & {
|
|
4105
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
4106
|
+
}, "strip", z.ZodTypeAny, {
|
|
4107
|
+
port: number;
|
|
4108
|
+
host: string;
|
|
4109
|
+
secure: boolean;
|
|
4110
|
+
user?: string | undefined;
|
|
4111
|
+
password?: string | undefined;
|
|
4112
|
+
}, {
|
|
4113
|
+
host: string;
|
|
4114
|
+
user?: string | undefined;
|
|
4115
|
+
password?: string | undefined;
|
|
4116
|
+
port?: number | undefined;
|
|
4117
|
+
secure?: boolean | undefined;
|
|
4118
|
+
}>;
|
|
4119
|
+
mailbox: z.ZodDefault<z.ZodString>;
|
|
4120
|
+
/** How often new mail is fetched. */
|
|
4121
|
+
pollSeconds: z.ZodDefault<z.ZodNumber>;
|
|
4122
|
+
/** Who may reach the agent: addresses, `@domain`, or `*`. Unset: nobody. */
|
|
4123
|
+
allowFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
4124
|
+
/** `approve`: each reply waits in the Approvals inbox until you say yes.
|
|
4125
|
+
* `auto`: replies are sent as soon as the agent writes them. */
|
|
4126
|
+
send: z.ZodDefault<z.ZodEnum<["approve", "auto"]>>;
|
|
4127
|
+
}, "strip", z.ZodTypeAny, {
|
|
4128
|
+
agent: string;
|
|
4129
|
+
send: "auto" | "approve";
|
|
4130
|
+
smtp: {
|
|
4131
|
+
port: number;
|
|
4132
|
+
host: string;
|
|
4133
|
+
secure: boolean;
|
|
4134
|
+
user?: string | undefined;
|
|
4135
|
+
password?: string | undefined;
|
|
4136
|
+
};
|
|
4137
|
+
address: string;
|
|
4138
|
+
imap: {
|
|
4139
|
+
port: number;
|
|
4140
|
+
host: string;
|
|
4141
|
+
secure: boolean;
|
|
4142
|
+
user?: string | undefined;
|
|
4143
|
+
password?: string | undefined;
|
|
4144
|
+
};
|
|
4145
|
+
mailbox: string;
|
|
4146
|
+
pollSeconds: number;
|
|
4147
|
+
name?: string | undefined;
|
|
4148
|
+
allowFrom?: string[] | undefined;
|
|
4149
|
+
}, {
|
|
4150
|
+
agent: string;
|
|
4151
|
+
smtp: {
|
|
4152
|
+
host: string;
|
|
4153
|
+
user?: string | undefined;
|
|
4154
|
+
password?: string | undefined;
|
|
4155
|
+
port?: number | undefined;
|
|
4156
|
+
secure?: boolean | undefined;
|
|
4157
|
+
};
|
|
4158
|
+
address: string;
|
|
4159
|
+
imap: {
|
|
4160
|
+
host: string;
|
|
4161
|
+
user?: string | undefined;
|
|
4162
|
+
password?: string | undefined;
|
|
4163
|
+
port?: number | undefined;
|
|
4164
|
+
secure?: boolean | undefined;
|
|
4165
|
+
};
|
|
4166
|
+
name?: string | undefined;
|
|
4167
|
+
send?: "auto" | "approve" | undefined;
|
|
4168
|
+
allowFrom?: string[] | undefined;
|
|
4169
|
+
mailbox?: string | undefined;
|
|
4170
|
+
pollSeconds?: number | undefined;
|
|
4171
|
+
}>>>;
|
|
4172
|
+
}, "strip", z.ZodTypeAny, {
|
|
4173
|
+
enabled: boolean;
|
|
4174
|
+
accounts: Record<string, {
|
|
4175
|
+
agent: string;
|
|
4176
|
+
send: "auto" | "approve";
|
|
4177
|
+
smtp: {
|
|
4178
|
+
port: number;
|
|
4179
|
+
host: string;
|
|
4180
|
+
secure: boolean;
|
|
4181
|
+
user?: string | undefined;
|
|
4182
|
+
password?: string | undefined;
|
|
4183
|
+
};
|
|
4184
|
+
address: string;
|
|
4185
|
+
imap: {
|
|
4186
|
+
port: number;
|
|
4187
|
+
host: string;
|
|
4188
|
+
secure: boolean;
|
|
4189
|
+
user?: string | undefined;
|
|
4190
|
+
password?: string | undefined;
|
|
4191
|
+
};
|
|
4192
|
+
mailbox: string;
|
|
4193
|
+
pollSeconds: number;
|
|
4194
|
+
name?: string | undefined;
|
|
4195
|
+
allowFrom?: string[] | undefined;
|
|
4196
|
+
}>;
|
|
4197
|
+
}, {
|
|
4198
|
+
enabled?: boolean | undefined;
|
|
4199
|
+
accounts?: Record<string, {
|
|
4200
|
+
agent: string;
|
|
4201
|
+
smtp: {
|
|
4202
|
+
host: string;
|
|
4203
|
+
user?: string | undefined;
|
|
4204
|
+
password?: string | undefined;
|
|
4205
|
+
port?: number | undefined;
|
|
4206
|
+
secure?: boolean | undefined;
|
|
4207
|
+
};
|
|
4208
|
+
address: string;
|
|
4209
|
+
imap: {
|
|
4210
|
+
host: string;
|
|
4211
|
+
user?: string | undefined;
|
|
4212
|
+
password?: string | undefined;
|
|
4213
|
+
port?: number | undefined;
|
|
4214
|
+
secure?: boolean | undefined;
|
|
4215
|
+
};
|
|
4216
|
+
name?: string | undefined;
|
|
4217
|
+
send?: "auto" | "approve" | undefined;
|
|
4218
|
+
allowFrom?: string[] | undefined;
|
|
4219
|
+
mailbox?: string | undefined;
|
|
4220
|
+
pollSeconds?: number | undefined;
|
|
4221
|
+
}> | undefined;
|
|
4222
|
+
}>>;
|
|
4068
4223
|
gitlab: z.ZodDefault<z.ZodObject<{
|
|
4069
4224
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
4070
4225
|
webhookPort: z.ZodDefault<z.ZodNumber>;
|
|
@@ -4627,6 +4782,32 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4627
4782
|
subject?: string | undefined;
|
|
4628
4783
|
relayTo?: string | undefined;
|
|
4629
4784
|
};
|
|
4785
|
+
email: {
|
|
4786
|
+
enabled: boolean;
|
|
4787
|
+
accounts: Record<string, {
|
|
4788
|
+
agent: string;
|
|
4789
|
+
send: "auto" | "approve";
|
|
4790
|
+
smtp: {
|
|
4791
|
+
port: number;
|
|
4792
|
+
host: string;
|
|
4793
|
+
secure: boolean;
|
|
4794
|
+
user?: string | undefined;
|
|
4795
|
+
password?: string | undefined;
|
|
4796
|
+
};
|
|
4797
|
+
address: string;
|
|
4798
|
+
imap: {
|
|
4799
|
+
port: number;
|
|
4800
|
+
host: string;
|
|
4801
|
+
secure: boolean;
|
|
4802
|
+
user?: string | undefined;
|
|
4803
|
+
password?: string | undefined;
|
|
4804
|
+
};
|
|
4805
|
+
mailbox: string;
|
|
4806
|
+
pollSeconds: number;
|
|
4807
|
+
name?: string | undefined;
|
|
4808
|
+
allowFrom?: string[] | undefined;
|
|
4809
|
+
}>;
|
|
4810
|
+
};
|
|
4630
4811
|
gitlab: {
|
|
4631
4812
|
enabled: boolean;
|
|
4632
4813
|
host: string;
|
|
@@ -4779,6 +4960,32 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
4779
4960
|
keepRecent?: number | undefined;
|
|
4780
4961
|
allowedHosts?: string[] | undefined;
|
|
4781
4962
|
} | undefined;
|
|
4963
|
+
email?: {
|
|
4964
|
+
enabled?: boolean | undefined;
|
|
4965
|
+
accounts?: Record<string, {
|
|
4966
|
+
agent: string;
|
|
4967
|
+
smtp: {
|
|
4968
|
+
host: string;
|
|
4969
|
+
user?: string | undefined;
|
|
4970
|
+
password?: string | undefined;
|
|
4971
|
+
port?: number | undefined;
|
|
4972
|
+
secure?: boolean | undefined;
|
|
4973
|
+
};
|
|
4974
|
+
address: string;
|
|
4975
|
+
imap: {
|
|
4976
|
+
host: string;
|
|
4977
|
+
user?: string | undefined;
|
|
4978
|
+
password?: string | undefined;
|
|
4979
|
+
port?: number | undefined;
|
|
4980
|
+
secure?: boolean | undefined;
|
|
4981
|
+
};
|
|
4982
|
+
name?: string | undefined;
|
|
4983
|
+
send?: "auto" | "approve" | undefined;
|
|
4984
|
+
allowFrom?: string[] | undefined;
|
|
4985
|
+
mailbox?: string | undefined;
|
|
4986
|
+
pollSeconds?: number | undefined;
|
|
4987
|
+
}> | undefined;
|
|
4988
|
+
} | undefined;
|
|
4782
4989
|
gitlab?: {
|
|
4783
4990
|
enabled?: boolean | undefined;
|
|
4784
4991
|
token?: string | undefined;
|
|
@@ -7391,14 +7598,14 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
7391
7598
|
}, "strip", z.ZodTypeAny, {
|
|
7392
7599
|
enabled: boolean;
|
|
7393
7600
|
command: string;
|
|
7394
|
-
lists: string[];
|
|
7395
7601
|
pollSeconds: number;
|
|
7602
|
+
lists: string[];
|
|
7396
7603
|
lookbackHours: number;
|
|
7397
7604
|
}, {
|
|
7398
7605
|
enabled?: boolean | undefined;
|
|
7399
7606
|
command?: string | undefined;
|
|
7400
|
-
lists?: string[] | undefined;
|
|
7401
7607
|
pollSeconds?: number | undefined;
|
|
7608
|
+
lists?: string[] | undefined;
|
|
7402
7609
|
lookbackHours?: number | undefined;
|
|
7403
7610
|
}>>;
|
|
7404
7611
|
/** The OS layer (src/native, #1062): banners, sounds, Focus and the OS
|
|
@@ -10452,6 +10659,32 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
10452
10659
|
subject?: string | undefined;
|
|
10453
10660
|
relayTo?: string | undefined;
|
|
10454
10661
|
};
|
|
10662
|
+
email: {
|
|
10663
|
+
enabled: boolean;
|
|
10664
|
+
accounts: Record<string, {
|
|
10665
|
+
agent: string;
|
|
10666
|
+
send: "auto" | "approve";
|
|
10667
|
+
smtp: {
|
|
10668
|
+
port: number;
|
|
10669
|
+
host: string;
|
|
10670
|
+
secure: boolean;
|
|
10671
|
+
user?: string | undefined;
|
|
10672
|
+
password?: string | undefined;
|
|
10673
|
+
};
|
|
10674
|
+
address: string;
|
|
10675
|
+
imap: {
|
|
10676
|
+
port: number;
|
|
10677
|
+
host: string;
|
|
10678
|
+
secure: boolean;
|
|
10679
|
+
user?: string | undefined;
|
|
10680
|
+
password?: string | undefined;
|
|
10681
|
+
};
|
|
10682
|
+
mailbox: string;
|
|
10683
|
+
pollSeconds: number;
|
|
10684
|
+
name?: string | undefined;
|
|
10685
|
+
allowFrom?: string[] | undefined;
|
|
10686
|
+
}>;
|
|
10687
|
+
};
|
|
10455
10688
|
gitlab: {
|
|
10456
10689
|
enabled: boolean;
|
|
10457
10690
|
host: string;
|
|
@@ -10904,8 +11137,8 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
10904
11137
|
reminders: {
|
|
10905
11138
|
enabled: boolean;
|
|
10906
11139
|
command: string;
|
|
10907
|
-
lists: string[];
|
|
10908
11140
|
pollSeconds: number;
|
|
11141
|
+
lists: string[];
|
|
10909
11142
|
lookbackHours: number;
|
|
10910
11143
|
};
|
|
10911
11144
|
meshVoices: Record<string, {
|
|
@@ -11769,6 +12002,32 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
11769
12002
|
keepRecent?: number | undefined;
|
|
11770
12003
|
allowedHosts?: string[] | undefined;
|
|
11771
12004
|
} | undefined;
|
|
12005
|
+
email?: {
|
|
12006
|
+
enabled?: boolean | undefined;
|
|
12007
|
+
accounts?: Record<string, {
|
|
12008
|
+
agent: string;
|
|
12009
|
+
smtp: {
|
|
12010
|
+
host: string;
|
|
12011
|
+
user?: string | undefined;
|
|
12012
|
+
password?: string | undefined;
|
|
12013
|
+
port?: number | undefined;
|
|
12014
|
+
secure?: boolean | undefined;
|
|
12015
|
+
};
|
|
12016
|
+
address: string;
|
|
12017
|
+
imap: {
|
|
12018
|
+
host: string;
|
|
12019
|
+
user?: string | undefined;
|
|
12020
|
+
password?: string | undefined;
|
|
12021
|
+
port?: number | undefined;
|
|
12022
|
+
secure?: boolean | undefined;
|
|
12023
|
+
};
|
|
12024
|
+
name?: string | undefined;
|
|
12025
|
+
send?: "auto" | "approve" | undefined;
|
|
12026
|
+
allowFrom?: string[] | undefined;
|
|
12027
|
+
mailbox?: string | undefined;
|
|
12028
|
+
pollSeconds?: number | undefined;
|
|
12029
|
+
}> | undefined;
|
|
12030
|
+
} | undefined;
|
|
11772
12031
|
gitlab?: {
|
|
11773
12032
|
enabled?: boolean | undefined;
|
|
11774
12033
|
token?: string | undefined;
|
|
@@ -12221,8 +12480,8 @@ declare const daemonConfigSchema: z.ZodObject<{
|
|
|
12221
12480
|
reminders?: {
|
|
12222
12481
|
enabled?: boolean | undefined;
|
|
12223
12482
|
command?: string | undefined;
|
|
12224
|
-
lists?: string[] | undefined;
|
|
12225
12483
|
pollSeconds?: number | undefined;
|
|
12484
|
+
lists?: string[] | undefined;
|
|
12226
12485
|
lookbackHours?: number | undefined;
|
|
12227
12486
|
} | undefined;
|
|
12228
12487
|
meshVoices?: Record<string, {
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Ia as Tt,Ja as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt}from"./chunk-
|
|
1
|
+
import{Ia as Tt,Ja as Mt,a as St,b as kt,c as vt,d as xt,e as $t,f as Ct,g as Pt,h as bt}from"./chunk-4BVISFOC.js";import"./chunk-FWT23FGY.js";import"./chunk-GTJIKXDB.js";import"./chunk-CWYCCQ57.js";import"./chunk-ZVP6GB4G.js";import"./chunk-FP4DT6D5.js";import"./chunk-EKJG63EJ.js";import"./chunk-OJ2XT27M.js";import"./chunk-VUEQ4SL5.js";import"./chunk-IMLAPB7G.js";import"./chunk-6V5JBHUN.js";import"./chunk-2VDO2HEK.js";import"./chunk-5HLD66CW.js";import"./chunk-LQE73AZR.js";import"./chunk-2D3RYIDU.js";import"./chunk-MRIVENBY.js";import"./chunk-VD2P4GWU.js";import"./chunk-LQS27HSV.js";import"./chunk-PPUN7YHA.js";import"./chunk-VZLIBDLH.js";import"./chunk-A5GYG56I.js";import"./chunk-FAU6WDVT.js";import"./chunk-2AXFYDWF.js";import"./chunk-AQASR6KR.js";import"./chunk-UKUH662W.js";import"./chunk-JWDJMFU6.js";import"./chunk-IS2IWRP7.js";import"./chunk-MNG2AMKZ.js";import"./chunk-RX5O5637.js";import"./chunk-X7UQY7CH.js";import"./chunk-QPABR72X.js";import"./chunk-E7VJU7FI.js";import"./chunk-PYHR4HXO.js";import"./chunk-KP7KDLZ2.js";import{m as lt,n as ct,o as dt,p as mt,q as pt,ta as yt}from"./chunk-RE5XFWBY.js";import"./chunk-OMD44DQ6.js";import"./chunk-MEFPXHQJ.js";import{a as L}from"./chunk-BAXGL6TY.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-XGREDHJY.js";import{a as B,b as M,c as F}from"./chunk-SFQUP3BP.js";import"./chunk-6TTGRTDO.js";import"./chunk-SZDACK6O.js";import"./chunk-VE3SSOQX.js";import"./chunk-W4YR2RO2.js";import"./chunk-AFRHKA7B.js";import"./chunk-VJVXEVZ7.js";import{t as ut}from"./chunk-OV77U4GH.js";import"./chunk-WWH3SKMB.js";import"./chunk-3UOTLMXD.js";import"./chunk-BE64IJWM.js";import"./chunk-PE5V2LI7.js";import"./chunk-GQ76J72O.js";import"./chunk-ILEC3IAV.js";import"./chunk-J3SOEFRE.js";import"./chunk-SIU6STB2.js";import"./chunk-X5C5W3E4.js";import"./chunk-GV7S5BAX.js";import"./chunk-GSX4NK2N.js";import"./chunk-VWTBHLMX.js";import"./chunk-CQBWWH2B.js";import{a as ht}from"./chunk-IZDFUFAQ.js";import"./chunk-OWNQ2FD4.js";import"./chunk-KEXBEUSU.js";import"./chunk-ROLSSYXE.js";import"./chunk-I4VNUTLL.js";import"./chunk-JTFCU5LH.js";import{f as gt,g as ft}from"./chunk-K4HQYC5M.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-GKE7IP3T.js";import{j as it,k as rt,l as at}from"./chunk-EYC5DJR2.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-MYVHVJWZ.js";import"./chunk-QUFIUXMQ.js";import"./chunk-AV7T3SYT.js";import"./chunk-LE3BXIUF.js";import"./chunk-BERWTVG2.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-DCIYOPJF.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{kb as tt,mb as st,ob as ot,vb as nt}from"./chunk-U5P7VICU.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.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).
|