agentix-cli 0.130.0 → 0.132.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-DWSHIDN6.js → App-VPYWOTTH.js} +2 -2
- package/dist/{ChatApp-CROSI7JM.js → ChatApp-SNED4KJB.js} +2 -2
- package/dist/absorb-eval-WGO4JWTO.js +2 -0
- package/dist/{agent-4AQOFPRD.js → agent-HXQYYLWZ.js} +2 -2
- package/dist/article-sync-4NOPOQU7.js +2 -0
- package/dist/{board-dashboard-54A3XTV5.js → board-dashboard-44JPXA7J.js} +330 -235
- package/dist/board-dashboard-44JPXA7J.js.map +1 -0
- package/dist/{builtin-W6KNX7RS.js → builtin-YD7MC572.js} +2 -2
- package/dist/chunk-2ZDV3DCT.js +52 -0
- package/dist/chunk-2ZDV3DCT.js.map +1 -0
- package/dist/{chunk-QXZLYCEZ.js → chunk-3K35L73A.js} +3 -3
- package/dist/chunk-3K35L73A.js.map +1 -0
- package/dist/chunk-3UOTLMXD.js +4 -0
- package/dist/chunk-3UOTLMXD.js.map +1 -0
- package/dist/{chunk-LJWEJ6UZ.js → chunk-3WYLK3SX.js} +2 -2
- package/dist/chunk-5BI2T3WD.js +3 -0
- package/dist/chunk-5BI2T3WD.js.map +1 -0
- package/dist/{chunk-UBA2QJCY.js → chunk-62NXS7PT.js} +272 -247
- package/dist/chunk-62NXS7PT.js.map +1 -0
- package/dist/chunk-6TURWSMN.js +3 -0
- package/dist/{chunk-VD7IO653.js.map → chunk-6TURWSMN.js.map} +1 -1
- package/dist/{chunk-I4GT27UO.js → chunk-724IBN5Y.js} +2 -2
- package/dist/{chunk-NR7WLMNI.js → chunk-74LPAKQY.js} +2 -2
- package/dist/chunk-7D3RJSN4.js +156 -0
- package/dist/chunk-7D3RJSN4.js.map +1 -0
- package/dist/{chunk-BGG3ZSMW.js → chunk-7LN4VKDU.js} +14 -16
- package/dist/chunk-7LN4VKDU.js.map +1 -0
- package/dist/chunk-7VLLZQ3N.js +2 -0
- package/dist/chunk-7VLLZQ3N.js.map +1 -0
- package/dist/{chunk-LLLBH2HH.js → chunk-A6QJ4VFT.js} +2 -2
- package/dist/{chunk-SCJ5ZXEN.js → chunk-B2QYMUTD.js} +2 -2
- package/dist/{chunk-SCJ5ZXEN.js.map → chunk-B2QYMUTD.js.map} +1 -1
- package/dist/chunk-BIJHMWXK.js +21 -0
- package/dist/chunk-BIJHMWXK.js.map +1 -0
- package/dist/{chunk-4VDA4UM7.js → chunk-BKHIR2YJ.js} +2 -2
- package/dist/{chunk-5VKFIBXY.js → chunk-CM74OUXW.js} +2 -2
- package/dist/chunk-EQ33PFXP.js +55 -0
- package/dist/chunk-EQ33PFXP.js.map +1 -0
- package/dist/chunk-HF5EF335.js +8 -0
- package/dist/chunk-HF5EF335.js.map +1 -0
- package/dist/chunk-IMLAPB7G.js +4 -0
- package/dist/chunk-IMLAPB7G.js.map +1 -0
- package/dist/{chunk-U2EHJZAZ.js → chunk-JNKATLF7.js} +2 -2
- package/dist/{chunk-3PGPN323.js → chunk-JP5OAMWQ.js} +1 -1
- package/dist/chunk-JP5OAMWQ.js.map +1 -0
- package/dist/chunk-JRVJXAVC.js +861 -0
- package/dist/chunk-JRVJXAVC.js.map +1 -0
- package/dist/{chunk-J4I5ZJ2V.js → chunk-KDQI5S7F.js} +2 -2
- package/dist/chunk-KFIJDLQ5.js +3 -0
- package/dist/chunk-KFIJDLQ5.js.map +1 -0
- package/dist/{chunk-MZJY26FW.js → chunk-KKQPV6SO.js} +2 -2
- package/dist/{chunk-WX67I2KN.js → chunk-KQH4LPYC.js} +2 -2
- package/dist/chunk-MCBTVNPX.js +152 -0
- package/dist/chunk-MCBTVNPX.js.map +1 -0
- package/dist/{chunk-YHCPBMRH.js → chunk-MDGYSHO5.js} +2 -2
- package/dist/chunk-MRIVENBY.js +2 -0
- package/dist/{article-sync-TLZTHRZB.js.map → chunk-MRIVENBY.js.map} +1 -1
- package/dist/{chunk-242MPMJX.js → chunk-QNKSRROH.js} +2 -2
- package/dist/{chunk-GLQLCBJS.js → chunk-QSKG754X.js} +6 -3
- package/dist/chunk-QSKG754X.js.map +1 -0
- package/dist/{chunk-HF4OXA5L.js → chunk-RH3J4LCP.js} +3 -3
- package/dist/{chunk-QPYN2UTV.js → chunk-RYGVTAP4.js} +2 -2
- package/dist/chunk-S2RRPTS3.js +54 -0
- package/dist/chunk-S2RRPTS3.js.map +1 -0
- package/dist/{chunk-5KKXJZZ4.js → chunk-UDMI4TYM.js} +2 -2
- package/dist/{chunk-TJDNS5G6.js → chunk-VCQVF44A.js} +2 -2
- package/dist/{chunk-TN5A7PLU.js → chunk-WWNZL7XB.js} +2 -2
- package/dist/{chunk-Q5FEWCS5.js → chunk-XWVBLISN.js} +2 -2
- package/dist/{chunk-AD4QZZVN.js → chunk-YXFTUOZR.js} +2 -2
- package/dist/{chunk-RKB7FQJF.js → chunk-Z7RJ3K3J.js} +2 -2
- package/dist/{chunk-N2YSVZML.js → chunk-ZG4G6BFP.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-KGWYROLX.js → client-TXZF32NO.js} +2 -2
- package/dist/config-ZIXIH23X.js +2 -0
- package/dist/{config-mutate-7BLOYRZF.js → config-mutate-KDBXIN7R.js} +2 -2
- package/dist/config-mutator-HKFGPJMG.js +2 -0
- package/dist/{contributions-DLUQEAGL.js → contributions-FBVULRR4.js} +2 -2
- package/dist/{contributions-DLUQEAGL.js.map → contributions-FBVULRR4.js.map} +1 -1
- package/dist/{doctor-32YP26SJ.js → doctor-NBWYG743.js} +2 -2
- package/dist/enrich-NH3WHKD6.js +16 -0
- package/dist/enrich-NH3WHKD6.js.map +1 -0
- package/dist/{failure-candidates-JNGUVBDG.js → failure-candidates-XZSZP4HT.js} +2 -2
- package/dist/{follow-up-tool-AQ7NYZZR.js → follow-up-tool-E5XKSPKA.js} +2 -2
- package/dist/graph-EXDH7EPZ.js +2 -0
- package/dist/hub-3QTJ7E3O.js +2 -0
- package/dist/index.d.ts +577 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/load-5DNMGHFW.js +2 -0
- package/dist/model-call-BGTDPWZD.js +2 -0
- package/dist/notes-WJJEJ4CJ.js +2 -0
- package/dist/processes-M3N3S7V5.js +2 -0
- package/dist/program-SA5O6IQ3.js +776 -0
- package/dist/program-SA5O6IQ3.js.map +1 -0
- package/dist/{promote-R7FKN5SY.js → promote-4XHYWHLA.js} +2 -2
- package/dist/query-ZGD32CE2.js +2 -0
- package/dist/query-settings-BSDXFS3V.js +3 -0
- package/dist/query-settings-BSDXFS3V.js.map +1 -0
- package/dist/registry-LM35AE2P.js +2 -0
- package/dist/{request-planner-LEUMSI2K.js → request-planner-4BAAOUBH.js} +2 -2
- package/dist/{review-candidates-MOSGA4IS.js → review-candidates-TM53WR7G.js} +2 -2
- package/dist/roster-IRXP32XF.js +2 -0
- package/dist/{rotation-memo-7VLREGS6.js → rotation-memo-2G6N3VF3.js} +2 -2
- package/dist/{routing-FSJ42RZH.js → routing-QLS6UMLM.js} +2 -2
- package/dist/schedule-tool-TTCWBAQ4.js +2 -0
- package/dist/{scheduler-6AQDHQI4.js → scheduler-PVXLF2VJ.js} +2 -2
- package/dist/scheduler-PVXLF2VJ.js.map +1 -0
- package/dist/{seat-O37EQRHE.js → seat-OUUN3F45.js} +2 -2
- package/dist/seat-OUUN3F45.js.map +1 -0
- package/dist/{select-XO2STSQN.js → select-D7UUSODY.js} +2 -2
- package/dist/{set-enabled-ZNEPEFGF.js → set-enabled-FDNS6KW6.js} +2 -2
- package/dist/summaries-BIRSNWGH.js +2 -0
- package/dist/summaries-BIRSNWGH.js.map +1 -0
- package/dist/{tool-PH45YCO5.js → tool-J5FM3OPM.js} +2 -2
- package/dist/{tool-6KMEAY4U.js → tool-SCBQYDI3.js} +2 -2
- package/dist/wiki-IGRRQL6H.js +2 -0
- package/dist/wiki-IGRRQL6H.js.map +1 -0
- package/dist/workspace-env-ROH45HXN.js +2 -0
- package/dist/workspace-env-ROH45HXN.js.map +1 -0
- package/package.json +1 -1
- package/dist/absorb-eval-MNGQ752C.js +0 -2
- package/dist/article-sync-TLZTHRZB.js +0 -2
- package/dist/board-dashboard-54A3XTV5.js.map +0 -1
- package/dist/chunk-3PGPN323.js.map +0 -1
- package/dist/chunk-76Z4VHDX.js +0 -8
- package/dist/chunk-76Z4VHDX.js.map +0 -1
- package/dist/chunk-AERIU4AH.js +0 -892
- package/dist/chunk-AERIU4AH.js.map +0 -1
- package/dist/chunk-BGG3ZSMW.js.map +0 -1
- package/dist/chunk-EO4DEEXL.js +0 -2
- package/dist/chunk-EO4DEEXL.js.map +0 -1
- package/dist/chunk-GLQLCBJS.js.map +0 -1
- package/dist/chunk-I4OQQRY2.js +0 -55
- package/dist/chunk-I4OQQRY2.js.map +0 -1
- package/dist/chunk-JE5EJGGD.js +0 -4
- package/dist/chunk-JE5EJGGD.js.map +0 -1
- package/dist/chunk-QX2B4TJU.js +0 -3
- package/dist/chunk-QX2B4TJU.js.map +0 -1
- package/dist/chunk-QXZLYCEZ.js.map +0 -1
- package/dist/chunk-UBA2QJCY.js.map +0 -1
- package/dist/chunk-UUFJQMHE.js +0 -54
- package/dist/chunk-UUFJQMHE.js.map +0 -1
- package/dist/chunk-VD7IO653.js +0 -3
- package/dist/chunk-W2HEJKJR.js +0 -156
- package/dist/chunk-W2HEJKJR.js.map +0 -1
- package/dist/config-FNTLKUGA.js +0 -2
- package/dist/config-mutator-NCLHYPJ3.js +0 -2
- package/dist/graph-5ZJ7YACP.js +0 -2
- package/dist/hub-Q3I4ALQ2.js +0 -2
- package/dist/load-NK3MIYXP.js +0 -2
- package/dist/notes-TMAGEDUS.js +0 -2
- package/dist/processes-5MP32QZT.js +0 -2
- package/dist/program-FESSM5TY.js +0 -766
- package/dist/program-FESSM5TY.js.map +0 -1
- package/dist/query-YTKTNXCQ.js +0 -2
- package/dist/registry-7L4RUATA.js +0 -2
- package/dist/schedule-tool-4T2VZIDW.js +0 -2
- package/dist/wiki-4HD4FZ4W.js +0 -2
- /package/dist/{App-DWSHIDN6.js.map → App-VPYWOTTH.js.map} +0 -0
- /package/dist/{ChatApp-CROSI7JM.js.map → ChatApp-SNED4KJB.js.map} +0 -0
- /package/dist/{absorb-eval-MNGQ752C.js.map → absorb-eval-WGO4JWTO.js.map} +0 -0
- /package/dist/{agent-4AQOFPRD.js.map → agent-HXQYYLWZ.js.map} +0 -0
- /package/dist/{builtin-W6KNX7RS.js.map → article-sync-4NOPOQU7.js.map} +0 -0
- /package/dist/{client-KGWYROLX.js.map → builtin-YD7MC572.js.map} +0 -0
- /package/dist/{chunk-LJWEJ6UZ.js.map → chunk-3WYLK3SX.js.map} +0 -0
- /package/dist/{chunk-I4GT27UO.js.map → chunk-724IBN5Y.js.map} +0 -0
- /package/dist/{chunk-NR7WLMNI.js.map → chunk-74LPAKQY.js.map} +0 -0
- /package/dist/{chunk-LLLBH2HH.js.map → chunk-A6QJ4VFT.js.map} +0 -0
- /package/dist/{chunk-4VDA4UM7.js.map → chunk-BKHIR2YJ.js.map} +0 -0
- /package/dist/{chunk-5VKFIBXY.js.map → chunk-CM74OUXW.js.map} +0 -0
- /package/dist/{chunk-U2EHJZAZ.js.map → chunk-JNKATLF7.js.map} +0 -0
- /package/dist/{chunk-J4I5ZJ2V.js.map → chunk-KDQI5S7F.js.map} +0 -0
- /package/dist/{chunk-MZJY26FW.js.map → chunk-KKQPV6SO.js.map} +0 -0
- /package/dist/{chunk-WX67I2KN.js.map → chunk-KQH4LPYC.js.map} +0 -0
- /package/dist/{chunk-YHCPBMRH.js.map → chunk-MDGYSHO5.js.map} +0 -0
- /package/dist/{chunk-242MPMJX.js.map → chunk-QNKSRROH.js.map} +0 -0
- /package/dist/{chunk-HF4OXA5L.js.map → chunk-RH3J4LCP.js.map} +0 -0
- /package/dist/{chunk-QPYN2UTV.js.map → chunk-RYGVTAP4.js.map} +0 -0
- /package/dist/{chunk-5KKXJZZ4.js.map → chunk-UDMI4TYM.js.map} +0 -0
- /package/dist/{chunk-TJDNS5G6.js.map → chunk-VCQVF44A.js.map} +0 -0
- /package/dist/{chunk-TN5A7PLU.js.map → chunk-WWNZL7XB.js.map} +0 -0
- /package/dist/{chunk-Q5FEWCS5.js.map → chunk-XWVBLISN.js.map} +0 -0
- /package/dist/{chunk-AD4QZZVN.js.map → chunk-YXFTUOZR.js.map} +0 -0
- /package/dist/{chunk-RKB7FQJF.js.map → chunk-Z7RJ3K3J.js.map} +0 -0
- /package/dist/{chunk-N2YSVZML.js.map → chunk-ZG4G6BFP.js.map} +0 -0
- /package/dist/{config-FNTLKUGA.js.map → client-TXZF32NO.js.map} +0 -0
- /package/dist/{config-mutate-7BLOYRZF.js.map → config-ZIXIH23X.js.map} +0 -0
- /package/dist/{config-mutator-NCLHYPJ3.js.map → config-mutate-KDBXIN7R.js.map} +0 -0
- /package/dist/{doctor-32YP26SJ.js.map → config-mutator-HKFGPJMG.js.map} +0 -0
- /package/dist/{failure-candidates-JNGUVBDG.js.map → doctor-NBWYG743.js.map} +0 -0
- /package/dist/{graph-5ZJ7YACP.js.map → failure-candidates-XZSZP4HT.js.map} +0 -0
- /package/dist/{follow-up-tool-AQ7NYZZR.js.map → follow-up-tool-E5XKSPKA.js.map} +0 -0
- /package/dist/{hub-Q3I4ALQ2.js.map → graph-EXDH7EPZ.js.map} +0 -0
- /package/dist/{load-NK3MIYXP.js.map → hub-3QTJ7E3O.js.map} +0 -0
- /package/dist/{notes-TMAGEDUS.js.map → load-5DNMGHFW.js.map} +0 -0
- /package/dist/{processes-5MP32QZT.js.map → model-call-BGTDPWZD.js.map} +0 -0
- /package/dist/{promote-R7FKN5SY.js.map → notes-WJJEJ4CJ.js.map} +0 -0
- /package/dist/{query-YTKTNXCQ.js.map → processes-M3N3S7V5.js.map} +0 -0
- /package/dist/{registry-7L4RUATA.js.map → promote-4XHYWHLA.js.map} +0 -0
- /package/dist/{routing-FSJ42RZH.js.map → query-ZGD32CE2.js.map} +0 -0
- /package/dist/{schedule-tool-4T2VZIDW.js.map → registry-LM35AE2P.js.map} +0 -0
- /package/dist/{request-planner-LEUMSI2K.js.map → request-planner-4BAAOUBH.js.map} +0 -0
- /package/dist/{review-candidates-MOSGA4IS.js.map → review-candidates-TM53WR7G.js.map} +0 -0
- /package/dist/{scheduler-6AQDHQI4.js.map → roster-IRXP32XF.js.map} +0 -0
- /package/dist/{rotation-memo-7VLREGS6.js.map → rotation-memo-2G6N3VF3.js.map} +0 -0
- /package/dist/{seat-O37EQRHE.js.map → routing-QLS6UMLM.js.map} +0 -0
- /package/dist/{wiki-4HD4FZ4W.js.map → schedule-tool-TTCWBAQ4.js.map} +0 -0
- /package/dist/{select-XO2STSQN.js.map → select-D7UUSODY.js.map} +0 -0
- /package/dist/{set-enabled-ZNEPEFGF.js.map → set-enabled-FDNS6KW6.js.map} +0 -0
- /package/dist/{tool-PH45YCO5.js.map → tool-J5FM3OPM.js.map} +0 -0
- /package/dist/{tool-6KMEAY4U.js.map → tool-SCBQYDI3.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/markdown-html.ts"],"sourcesContent":["// --- Markdown to HTML, shared -------------------------------------------\n//\n// One renderer for the wiki, the dashboard's ask-an-agent drawer and the task\n// conversation view. It escapes first and only then adds markup, because\n// everything it renders — wiki articles, agent replies — is written by\n// someone or something other than the person reading it.\n//\n// Deliberately small: headings, bold/italic, code, links, lists, tables,\n// blockquotes and rules, and pictures for a caller that asks. Anything it\n// does not know stays as text.\n\nexport interface MarkdownOptions {\n /** Resolve [[wikilinks]]. Omitted, they render as their display text. */\n wikilink?: (target: string, display: string) => string\n /** Render `` as a picture: `true` for up to 8, or the\n * most to show. Web addresses only; pictures past the limit become links.\n * Omitted, a picture stays a link, as it always was. */\n images?: boolean | number\n}\n\nexport function markdownToHtml(text: string, opts: MarkdownOptions = {}): string {\n // Strip section-tag HTML comments before escaping so they don't render\n // as literal \"<!-- tags: ... -->\" in the output.\n // Inlined rather than a module-scope helper: this function is stringified\n // and shipped to the browser, where the minifier renames such a helper and\n // module scope does not travel with the source.\n let html = String(text ?? \"\")\n .replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\")\n .replace(/\"/g, \""\").replace(/'/g, \"'\")\n\n // Code blocks (fenced)\n html = html.replace(/```(\\w*)\\n([\\s\\S]*?)```/g, (_m, lang, code) =>\n `<pre><code class=\"lang-${lang}\">${code.trim()}</code></pre>`)\n\n // Inline code\n html = html.replace(/`([^`]+)`/g, '<code>$1</code>')\n\n // Pictures, only for a caller that opts in. Code is left alone. Each\n // picture waits as a placeholder of plain letters and digits until every\n // other rule has run, so no later rule can take its markup apart; one\n // that ends up inside a tag (say, a link's address) becomes its alt text.\n // The text is escaped already, so the address and alt hold no quotes.\n const pics: string[] = []\n const alts: string[] = []\n const mark = opts.images ? \"axpic\" + Math.random().toString(36).slice(2, 10) + \"n\" : \"\"\n if (opts.images) {\n const most = typeof opts.images === \"number\" ? opts.images : 8\n html = html.replace(/<code[^>]*>[\\s\\S]*?<\\/code>|!\\[([^\\]\\n]*)\\]\\(([^)\\s]+)\\)/g, (m: string, alt?: string, src?: string) => {\n if (alt === undefined || src === undefined) return m\n if (!/^https?:\\/\\/[^\\s]+$/i.test(src)) return alt\n if (pics.length >= most) return `[${alt || src}](${src})`\n pics.push(`<img src=\"${src}\" alt=\"${alt}\" loading=\"lazy\" referrerpolicy=\"no-referrer\">`)\n alts.push(alt)\n return mark + (pics.length - 1) + \"z\"\n })\n }\n\n // Tables\n html = html.replace(/^(\\|.+\\|)\\n(\\|[-| :]+\\|)\\n((?:\\|.+\\|\\n?)*)/gm, (_m, header, _sep, body) => {\n const ths = header.split(\"|\").filter((c: string) => c.trim()).map((c: string) => `<th>${c.trim()}</th>`).join(\"\")\n const rows = body.trim().split(\"\\n\").map((row: string) => {\n const tds = row.split(\"|\").filter((c: string) => c.trim()).map((c: string) => `<td>${c.trim()}</td>`).join(\"\")\n return `<tr>${tds}</tr>`\n }).join(\"\")\n return `<table><thead><tr>${ths}</tr></thead><tbody>${rows}</tbody></table>`\n })\n\n // Headings\n html = html.replace(/^#### (.+)$/gm, '<h4>$1</h4>')\n html = html.replace(/^### (.+)$/gm, '<h3>$1</h3>')\n html = html.replace(/^## (.+)$/gm, '<h2>$1</h2>')\n html = html.replace(/^# (.+)$/gm, '<h1>$1</h1>')\n\n // Bold and italic\n html = html.replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>')\n html = html.replace(/\\*(.+?)\\*/g, '<em>$1</em>')\n\n // Wikilinks — support three forms for the [[...]] body:\n // [[Title]] exact article title\n // [[path/to/article]] path without .md (e.g. \"people/alex\")\n // [[path/to/article.md]] full relative path\n // [[Title|custom display text]] optional display override (Obsidian-style)\n html = html.replace(/\\[\\[([^\\]]+)\\]\\]/g, (_m, inner: string) => {\n const [rawTarget, rawDisplay] = inner.split(\"|\", 2)\n const target = rawTarget.trim().replace(/^\\//, \"\")\n const display = (rawDisplay || rawTarget).trim()\n // Without a resolver a wikilink is just words — better than a dead link.\n return opts.wikilink ? opts.wikilink(target, display) : display\n })\n\n // External links\n html = html.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g, '<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>')\n\n // Blockquotes (consecutive `> ` lines → one <blockquote>)\n html = html.replace(/^(>\\s?.*(?:\\n>\\s?.*)*)/gm, (block: string) => {\n const inner = block.split(\"\\n\").map(l => l.replace(/^>\\s?/, \"\")).join(\"<br>\")\n return `<blockquote>${inner}</blockquote>`\n })\n\n // Task-list items (render as plain text with unicode checkbox)\n html = html.replace(/^[-*] \\[( |x|X)\\] (.+)$/gm, (_m, chk, rest) =>\n `<li class=\"task\">${chk.toLowerCase() === \"x\" ? \"☑\" : \"☐\"} ${rest}</li>`)\n\n // Unordered lists\n html = html.replace(/^[-*] (.+)$/gm, '<li>$1</li>')\n\n // Ordered lists — match lines like \"1. foo\" (number, dot, space)\n html = html.replace(/^\\d+\\. (.+)$/gm, '<li data-ordered=\"1\">$1</li>')\n\n // Wrap consecutive ordered <li>s into <ol>. Keep the data-ordered marker\n // on each <li> inside the <ol> so the subsequent <ul> regex below can\n // correctly skip them via negative lookahead. Marker is stripped once all\n // list-wrapping is done.\n html = html.replace(/(<li data-ordered=\"1\">.*?<\\/li>(?:\\n?<li data-ordered=\"1\">.*?<\\/li>)*)/g, '<ol>$1</ol>')\n\n // Wrap consecutive unordered <li>s — the negative lookahead `(?! data-ordered)`\n // ensures ordered <li>s inside the <ol> above are NOT re-wrapped in <ul>.\n html = html.replace(/((?:<li(?! data-ordered)[^>]*>.*?<\\/li>\\n?)+)/g, '<ul>$1</ul>')\n\n // Clean up the ordered marker now that wrapping is settled.\n html = html.replace(/ data-ordered=\"1\"/g, \"\")\n\n // Horizontal rules\n html = html.replace(/^---$/gm, '<hr>')\n\n // Paragraphs — only wrap non-block lines. A paragraph is a run of\n // text that isn't already wrapped in a block-level tag.\n html = html.replace(/\\n\\n+/g, '</p><p>')\n html = `<p>${html}</p>`\n // Unwrap <p>...</p> that now contain block-level elements.\n html = html.replace(/<p>\\s*(<(?:h[1-6]|ul|ol|blockquote|table|pre|hr)\\b[^>]*>[\\s\\S]*?<\\/(?:h[1-6]|ul|ol|blockquote|table|pre)>)\\s*<\\/p>/g, \"$1\")\n html = html.replace(/<p>\\s*<hr>\\s*<\\/p>/g, \"<hr>\")\n // Drop empty paragraphs that remain.\n html = html.replace(/<p>\\s*<\\/p>/g, \"\")\n\n html = html.replace(/<p>(<(?:h[1-4]|pre|table|ul|hr|div))/g, '$1')\n html = html.replace(/(<\\/(?:h[1-4]|pre|table|ul|hr|div)>)<\\/p>/g, '$1')\n html = html.replace(/<p>\\s*<\\/p>/g, '')\n\n if (pics.length) {\n const at = new RegExp(mark + \"(\\\\d+)z\", \"g\")\n html = html.split(/(<[^>]*>)/).map((part) => part.charAt(0) === \"<\"\n ? part.replace(at, (_m, i) => alts[Number(i)])\n : part.replace(at, (_m, i) => pics[Number(i)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,EAAE,EAG5CA,EAAOA,EAAK,QAAQ,UAAW,MAAM,EAIrCA,EAAOA,EAAK,QAAQ,SAAU,SAAS,EACvCA,EAAO,MAAMA,QAEbA,EAAOA,EAAK,QAAQ,sHAAuH,IAAI,EAC/IA,EAAOA,EAAK,QAAQ,sBAAuB,MAAM,EAEjDA,EAAOA,EAAK,QAAQ,eAAgB,EAAE,EAEtCA,EAAOA,EAAK,QAAQ,wCAAyC,IAAI,EACjEA,EAAOA,EAAK,QAAQ,6CAA8C,IAAI,EACtEA,EAAOA,EAAK,QAAQ,eAAgB,EAAE,EAElCI,EAAK,OAAQ,CACf,IAAMuB,EAAK,IAAI,OAAOrB,EAAO,UAAW,GAAG,EAC3CN,EAAOA,EAAK,MAAM,WAAW,EAAE,IAAK4B,GAASA,EAAK,OAAO,CAAC,IAAM,IAC5DA,EAAK,QAAQD,EAAI,CAAC1B,EAAI4B,IAAMxB,EAAK,OAAOwB,CAAC,CAAC,CAAC,EAC3CD,EAAK,QAAQD,EAAI,CAAC1B,EAAI4B,IAAMzB,EAAK,OAAOyB,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAG3D,OAAO7B,CACT","names":["markdownToHtml","text","opts","html","_m","lang","code","pics","alts","mark","most","m","alt","src","header","_sep","body","ths","c","rows","row","inner","rawTarget","rawDisplay","target","display","block","l","chk","rest","at","part","i"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as D,b as _}from"./chunk-RKPAVWXF.js";import{a as R,b as q,c as O,d as B,f as k,g as v,h as E,i as w,j as y}from"./chunk-
|
|
1
|
+
import{a as D,b as _}from"./chunk-RKPAVWXF.js";import{a as R,b as q,c as O,d as B,f as k,g as v,h as E,i as w,j as y}from"./chunk-QNKSRROH.js";import{a as T,b as C,c as I,d as x,e as P}from"./chunk-KDQI5S7F.js";import{existsSync as X,readFileSync as F}from"fs";var J=new Set(["cron","heartbeat","api","a2a","mesh"]),M=160;function s(n){return typeof n=="string"&&n.trim()?n.trim():void 0}function S(n,e=M){let t=n.replace(/\s+/g," ").trim();return t.length>e?`${t.slice(0,e-1)}\u2026`:t}function V(n){let e=T(n);if(!X(e))throw new Error(`config not found at ${e}`);return JSON.parse(F(e,"utf-8"))}function W(n,e){return n?.agents?.[e]?.admin===!0}function Y(n,e,t){return W(n,t.agentId)||e?.createdBy===t.agentId}function Z(n,e){let t=e?.createdBy?`agent "${e.createdBy}"`:"the operator";return`Not allowed: "${n}" was created by ${t}. Agents manage only schedules they created (unless configured admin).`}function K(n,e){let t=s(n.notify);if(t!=="none"){if(t&&t!=="here"){let r=t.split(":");return r.length<2||!r[0]||!r[1]?"invalid":{channel:r[0],chatId:r.slice(1).join(":")}}if(e.channel&&e.chatId&&!J.has(e.channel))return{channel:e.channel,chatId:e.chatId,...e.accountId?{accountId:e.accountId}:{}}}}function Q(n,e,t){let r=e.timezone||"UTC",d=e.enabled&&!y(e)?w(E(e.schedule,r,t),r):"\u2014",h=e.approval?`pending ${e.approval.action} approval`:e.enabled?"active":"paused",f=[`- ${n} [${h}] ${e.schedule} \u2014 ${v(e.schedule)} (${r})`,` agent: ${e.agent}; created by: ${e.createdBy||"operator"}; next: ${d}`];return e.notify&&f.push(` notify: ${e.notify.channel} ${e.notify.chatId}${e.deliverResult===!1?" (failures only)":" (results and failures)"}`),e.command?f.push(` command: ${S(String(e.command))}`):e.prompt&&f.push(` prompt: ${S(String(e.prompt))}`),f.join(`
|
|
2
2
|
`)}async function b(n,e,t){let r=n?.notifications?.destination;if(!r?.channel||!r?.chatId)return"No operator notification destination is configured (notifications.destination); the operator must check `agentx schedule list`.";if(!e.notifyOperator)return"Operator notification is unavailable in this context.";try{return await e.notifyOperator({channel:r.channel,chatId:r.chatId,accountId:r.accountId},t),"The operator has been notified."}catch(d){return`Could not notify the operator (${d?.message??d}); the request is still recorded.`}}async function re(n,e,t={}){let r=(s(n.action)||"list").toLowerCase(),d=t.now?t.now():new Date,h;try{h=V(t.configPath)}catch(a){return`Error: ${a.message}`}let f=h.crons||{};if(r==="list"){let a=n.mine===!0,l=Object.entries(f).filter(([,i])=>!a||e&&i?.createdBy===e.agentId);return l.length?l.map(([i,p])=>Q(i,p,d)).join(`
|
|
3
3
|
`):a?"You have no schedules.":"No schedules."}if(!e?.agentId)return"Error: caller agent is unknown (AGENTX_AGENT_ID not set). Pass callerAgentId.";if(!h.agents?.[e.agentId])return`Error: caller "${e.agentId}" is not an agent on this node.`;let o=s(n.id),m=a=>C(a,{configPath:t.configPath,reload:t.reload});if(r==="create"){let a=s(n.when),l=s(n.prompt);if(!a||!l)return"Error: create needs `when` (plain English) and `prompt`.";let i=D(a);if(!i)return`Error: couldn't parse "${a}". ${q}.`;let p=s(n.agent)||e.agentId;if(!h.agents?.[p])return`Error: agent "${p}" not found on this node.`;let g=s(n.timezone)||R;if(!B(g))return`Error: unknown timezone "${g}".`;let u=o||_(i.matched,p);if(!O(u))return`Error: invalid id "${u}" (letters, digits, "-" and "_" only).`;if(f[u])return`Error: a schedule "${u}" already exists. Pick another \`id\`.`;let $=K(n,e);if($==="invalid")return'Error: `notify` must be "here", "none", or "channel:chatId".';let z={action:"create",requestedBy:e.agentId,requestedAt:d.toISOString()},L=k({parsed:i,agent:p,prompt:l,timezone:g,notify:$,enabled:!1,createdBy:e.agentId,approval:z}),A=await m(U=>I(U,`crons.${u}`,L));if(!A.success)return`Error: ${A.error}`;let N=w(E(i.cron,g,d),g),G=[`Schedule approval requested by ${e.agentId}`,`Create: ${u}`,`When: ${i.human} \u2014 cron \`${i.cron}\` (${g})`,`Next fire: ${N}`,`Agent: ${p}`,$?`Results and failures go to: ${$.channel} ${$.chatId}${$.channel==="voice"?" (as a push notification)":""}`:"Results go to: run log only (no chat)",`Prompt: ${S(l,400)}`,"",`Approve: agentx schedule approve ${u}`,`Reject: agentx schedule reject ${u}`].join(`
|
|
4
4
|
`),H=await b(h,t,G);return[`Requested schedule "${u}": ${i.human} (cron ${i.cron}, ${g}); next fire would be ${N}.`,"It is saved DISABLED and will not run until the operator approves it.",H].join(`
|
|
5
5
|
`)}if(!o)return`Error: ${r} needs \`id\`.`;let c=f[o];if(!c)return`Error: schedule "${o}" not found.`;if(!Y(h,c,e))return Z(o,c);if(r==="pause"||r==="resume"){let a=r==="resume";if(a&&y(c))return`"${o}" is still awaiting operator approval; it can't be resumed until approved.`;if(c.enabled===a)return`"${o}" is already ${a?"active":"paused"}.`;let l=await m(i=>I(i,`crons.${o}.enabled`,a));return l.success?`"${o}" ${a?"resumed":"paused"}.`:`Error: ${l.error}`}if(r==="delete"){if(y(c)&&c.approval.requestedBy===e.agentId){let u=await m($=>P($,`crons.${o}`));return u.success?`Withdrew the pending request "${o}".`:`Error: ${u.error}`}if(y(c))return`"${o}" is a creation request still awaiting approval; only its requester or the operator (\`agentx schedule reject ${o}\`) can drop it.`;if(c.approval?.action==="delete")return`Deletion of "${o}" is already awaiting approval.`;let a={action:"delete",requestedBy:e.agentId,requestedAt:d.toISOString()},l=await m(u=>{if(!x(u,`crons.${o}`))throw new Error(`schedule "${o}" not found`);I(u,`crons.${o}.approval`,a)});if(!l.success)return`Error: ${l.error}`;let i=c.timezone||"UTC",p=[`Schedule approval requested by ${e.agentId}`,`Delete: ${o}`,`When: ${v(c.schedule)} \u2014 cron \`${c.schedule}\` (${i})`,`Next fire: ${c.enabled?w(E(c.schedule,i,d),i):"\u2014 (paused)"}`,`Agent: ${c.agent}`,"",`Approve: agentx schedule approve ${o}`,`Reject: agentx schedule reject ${o}`].join(`
|
|
6
6
|
`),g=await b(h,t,p);return[`Deletion of "${o}" requested. It keeps its current state until the operator approves.`,g].join(`
|
|
7
7
|
`)}return`Error: unknown action "${r}". Use list, create, pause, resume or delete.`}function oe(n,e=process.env){let t=s(e.AGENTX_AGENT_ID)||s(n.callerAgentId);if(!t)return null;let r=!!(s(e.AGENTX_CHANNEL)&&s(e.AGENTX_CHAT_ID)),d=s(r?e.AGENTX_CHANNEL:n.channel),h=s(r?e.AGENTX_CHAT_ID:n.chatId),f=s(n.accountId);return{agentId:t,channel:d,chatId:h,...f?{accountId:f}:{}}}export{re as a,oe as b};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-JNKATLF7.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var e=["minor","normal","major"];export{e as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-JP5OAMWQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/wiki/ontology/types.ts"],"sourcesContent":["// --- Wiki ontology types (#811) ---\n//\n// The ontology says what kinds of things the wiki holds (types grouped\n// into pillars), how they relate (properties), how important an event is,\n// and how each type's page is viewed (lenses). Every value here comes\n// from `ontology.yaml` in the wiki root, falling back to the generic\n// defaults in `defaults.ts`. Nothing about a particular organisation\n// belongs in code.\n\nexport type Importance = \"minor\" | \"normal\" | \"major\"\n\nexport const IMPORTANCE_LEVELS: readonly Importance[] = [\"minor\", \"normal\", \"major\"] as const\n\nexport interface PillarDef {\n id: string\n label: string\n /** One line under the pillar title. */\n description?: string\n /** Icon name from the view's small built-in icon set. */\n icon?: string\n /** Shown in the sidebar. A fallback pillar such as Topics sets false. */\n sidebar?: boolean\n}\n\nexport interface TypeDef {\n id: string\n label: string\n plural?: string\n pillar: string\n /** schema.org class, shown as a hint on the page. */\n schema?: string\n icon?: string\n /** Panels the page opens with, in order. */\n lens?: LensPanel[]\n}\n\nexport interface PropertyDef {\n id: string\n /** Read from the subject: \"Person — role at → Organization\". */\n label: string\n /** Read from the value's side: \"Organization — people ← Person\". */\n inverse?: string\n /** Wikidata property id, kept as a mapping hint. */\n wikidata?: string\n /** Types the value is expected to be. Informational. */\n range?: string[]\n /** Types the subject may be. A lens shows other subjects' statements\n * through the inverse; `wiki enrich` writes it only on these (#820). */\n domain?: string[]\n}\n\nexport type PanelSource = \"statements\" | \"linked\" | \"history\" | \"discussed\" | \"readings\" | \"notes\"\n\nexport interface LensPanel {\n /** Panel id. Used in the zoom URL, so keep it short and stable. */\n panel: string\n title?: string\n /** Where items come from. Inferred from the other fields when omitted. */\n source?: PanelSource\n /** Properties to show (statements panels). `related` covers plain links. */\n from?: string | string[]\n /** Keep only items whose other end has one of these types. */\n types?: string[]\n /** Items shown at the overview level (Z2). The full list is Z3. */\n show?: number\n group_by?: \"role\" | \"property\"\n display?: \"list\" | \"timeline\"\n /** History: importance levels shown unfolded. */\n importance?: Importance[]\n /** History: levels folded under a count. */\n fold?: Importance\n /** History: repeated minor events shown as one recurring line. */\n rollup?: { min: number; days: number }\n /** Readings: only the latest value per metric. */\n latest?: boolean\n /** `owner` marks the panel as private to the owner. */\n access?: \"owner\"\n}\n\nexport interface ClassifyRule {\n /** Type the matching page gets. */\n type: string\n /** Match when the page's legacy `type` is one of these. */\n legacy?: string[]\n /** Match when the page path starts with one of these folders. */\n path?: string[]\n /** Match when the page has any of these tags. */\n tags?: string[]\n /** Case-insensitive regular expression on the title. */\n title?: string\n}\n\nexport interface Ontology {\n version: number\n pillars: PillarDef[]\n types: TypeDef[]\n properties: PropertyDef[]\n importance: {\n default: Importance\n /** Who may set `major`: \"owner\" means agents can only propose it. */\n major_set_by: \"owner\" | \"anyone\"\n rollup: { min: number; days: number }\n }\n sidebar: {\n pins_max: number\n /** Page titles the owner pinned, in order. */\n pins: string[]\n }\n /** Rules that give a page a type, tried in order. The first match wins. */\n classify: ClassifyRule[]\n /** Type for pages no rule matches. */\n fallback_type: string\n /** Extra names of the fleet's agents, for agents that run on another\n * node or answer to a persona name (#819). The node's own agent ids,\n * configured names and persona names are found without this. */\n agent_names?: string[]\n}\n\n/** One typed fact about a page: subject (the page) → property → value. */\nexport interface WikiStatement {\n property: string\n /** A page title (becomes a link) or a literal value. */\n value: string\n role?: string\n since?: string\n until?: string\n /** Metric name for readings (disk_used, uptime). */\n metric?: string\n /** When a reading was taken. */\n at?: string\n /** Where it comes from: entry id, document, gazette reference, article. */\n source?: string\n access?: \"public\" | \"shared\" | \"private\"\n status?: \"proposed\" | \"confirmed\"\n confirmed_by?: string\n checked_at?: string\n /** The job that wrote it, e.g. \"wiki-enrich\"; its next run replaces it. */\n by?: string\n note?: string\n}\n"],"mappings":"AAWO,IAAMA,EAA2C,CAAC,QAAS,SAAU,OAAO","names":["IMPORTANCE_LEVELS"]}
|