konoha-mcp 2.1.16 → 2.1.17
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/.agents/SOUL.md +1 -1
- package/.agents/skills/konoha/SKILL.md +30 -1
- package/.agents/skills.fingerprint +1 -1
- package/README.md +186 -219
- package/apps/web/build/adapter-node.js +1 -1
- package/apps/web/build/client/_app/immutable/assets/0.BGEsEaMd.css +2 -0
- package/apps/web/build/client/_app/immutable/assets/0.BGEsEaMd.css.br +0 -0
- package/apps/web/build/client/_app/immutable/assets/0.BGEsEaMd.css.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/{D-Kujhko.js → 2WlqNq2Q.js} +1 -1
- package/apps/web/build/client/_app/immutable/chunks/2WlqNq2Q.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/2WlqNq2Q.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/B9vY64pH.js +1 -0
- package/apps/web/build/client/_app/immutable/chunks/B9vY64pH.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/B9vY64pH.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/{Dzm74gVd.js → BPX4jQ9l.js} +1 -1
- package/apps/web/build/client/_app/immutable/chunks/BPX4jQ9l.js.br +2 -0
- package/apps/web/build/client/_app/immutable/chunks/BPX4jQ9l.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/{fbrtLByB.js → BXssplIZ.js} +1 -1
- package/apps/web/build/client/_app/immutable/chunks/BXssplIZ.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/BXssplIZ.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/C-3vSv0T.js +1 -0
- package/apps/web/build/client/_app/immutable/chunks/C-3vSv0T.js.br +2 -0
- package/apps/web/build/client/_app/immutable/chunks/C-3vSv0T.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/{PrdhfbrQ.js → C7jhkUmC.js} +1 -1
- package/apps/web/build/client/_app/immutable/chunks/C7jhkUmC.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/{PrdhfbrQ.js.gz → C7jhkUmC.js.gz} +0 -0
- package/apps/web/build/client/_app/immutable/chunks/{7LmsTWIo.js → CfrhQlXt.js} +1 -1
- package/apps/web/build/client/_app/immutable/chunks/CfrhQlXt.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/CfrhQlXt.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/CgzsRqh3.js +1 -0
- package/apps/web/build/client/_app/immutable/chunks/CgzsRqh3.js.br +1 -0
- package/apps/web/build/client/_app/immutable/chunks/CgzsRqh3.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/ChmznE4L.js +2 -0
- package/apps/web/build/client/_app/immutable/chunks/ChmznE4L.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/ChmznE4L.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/entry/app.cdLMQHsN.js +2 -0
- package/apps/web/build/client/_app/immutable/entry/app.cdLMQHsN.js.br +0 -0
- package/apps/web/build/client/_app/immutable/entry/app.cdLMQHsN.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/entry/{start.CNV5BTCO.js → start.CJ1ccVCA.js} +2 -2
- package/apps/web/build/client/_app/immutable/entry/start.CJ1ccVCA.js.br +0 -0
- package/apps/web/build/client/_app/immutable/entry/start.CJ1ccVCA.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/0.ijG9ltjt.js +2 -0
- package/apps/web/build/client/_app/immutable/nodes/0.ijG9ltjt.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/0.ijG9ltjt.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/1.i6MXc2Yb.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/1.i6MXc2Yb.js.br +2 -0
- package/apps/web/build/client/_app/immutable/nodes/1.i6MXc2Yb.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/10.B0F7UoZ4.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/10.B0F7UoZ4.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/10.B0F7UoZ4.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/{11.4dBWH00t.js → 11.BuH1S-Sa.js} +2 -2
- package/apps/web/build/client/_app/immutable/nodes/11.BuH1S-Sa.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/11.BuH1S-Sa.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/12.DVFmb_G-.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/12.DVFmb_G-.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/12.DVFmb_G-.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/13.0PJQyjqs.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/13.0PJQyjqs.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/13.0PJQyjqs.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/14.ljEGDzwO.js +3 -0
- package/apps/web/build/client/_app/immutable/nodes/14.ljEGDzwO.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/14.ljEGDzwO.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/15.DpXDNTPX.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/15.DpXDNTPX.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/15.DpXDNTPX.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/16.qIEBxyps.js +17 -0
- package/apps/web/build/client/_app/immutable/nodes/16.qIEBxyps.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/16.qIEBxyps.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/17.CmVvQa7x.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/17.CmVvQa7x.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/17.CmVvQa7x.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/{2.Dr646Vs5.js → 2.lx602Ou_.js} +1 -1
- package/apps/web/build/client/_app/immutable/nodes/2.lx602Ou_.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/2.lx602Ou_.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/3.B-axtlUy.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/3.B-axtlUy.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/3.B-axtlUy.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/4.Cp9WmMgk.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/4.Cp9WmMgk.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/4.Cp9WmMgk.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/5.CQxJe2vk.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/5.CQxJe2vk.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/5.CQxJe2vk.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/6.5S6pozqG.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/6.5S6pozqG.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/6.5S6pozqG.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/{7.CmbiPMU3.js → 7.B5ZeCLvS.js} +1 -1
- package/apps/web/build/client/_app/immutable/nodes/7.B5ZeCLvS.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/7.B5ZeCLvS.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/8.M3fxLxa9.js +1 -0
- package/apps/web/build/client/_app/immutable/nodes/8.M3fxLxa9.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/8.M3fxLxa9.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/9.CYkQmFMJ.js +21 -0
- package/apps/web/build/client/_app/immutable/nodes/9.CYkQmFMJ.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/9.CYkQmFMJ.js.gz +0 -0
- package/apps/web/build/client/_app/version.json +1 -1
- package/apps/web/build/client/_app/version.json.br +0 -0
- package/apps/web/build/client/_app/version.json.gz +0 -0
- package/apps/web/build/server/.vite/manifest.json +15 -1
- package/apps/web/build/server/_app/immutable/assets/_layout.BGEsEaMd.css +2 -0
- package/apps/web/build/server/chunks/api.js +4 -0
- package/apps/web/build/server/chunks/api.js.map +1 -1
- package/apps/web/build/server/chunks/instance.js +3 -3
- package/apps/web/build/server/chunks/internal.js +1 -1
- package/apps/web/build/server/entries/pages/_layout.svelte.js +7 -0
- package/apps/web/build/server/entries/pages/_layout.svelte.js.map +1 -1
- package/apps/web/build/server/entries/pages/agents/_page.svelte.js +6 -2
- package/apps/web/build/server/entries/pages/agents/_page.svelte.js.map +1 -1
- package/apps/web/build/server/entries/pages/docs/_page.svelte.js +86 -2
- package/apps/web/build/server/entries/pages/docs/_page.svelte.js.map +1 -1
- package/apps/web/build/server/entries/pages/remote/_page.svelte.js +73 -0
- package/apps/web/build/server/entries/pages/remote/_page.svelte.js.map +1 -0
- package/apps/web/build/server/manifest-full.js +15 -7
- package/apps/web/build/server/manifest.js +15 -7
- package/apps/web/build/server/nodes/0.js +2 -2
- package/apps/web/build/server/nodes/1.js +1 -1
- package/apps/web/build/server/nodes/10.js +1 -1
- package/apps/web/build/server/nodes/11.js +1 -1
- package/apps/web/build/server/nodes/12.js +2 -2
- package/apps/web/build/server/nodes/13.js +2 -2
- package/apps/web/build/server/nodes/14.js +2 -2
- package/apps/web/build/server/nodes/15.js +2 -2
- package/apps/web/build/server/nodes/16.js +2 -2
- package/apps/web/build/server/nodes/17.js +8 -0
- package/apps/web/build/server/nodes/2.js +1 -1
- package/apps/web/build/server/nodes/3.js +1 -1
- package/apps/web/build/server/nodes/4.js +1 -1
- package/apps/web/build/server/nodes/5.js +1 -1
- package/apps/web/build/server/nodes/6.js +1 -1
- package/apps/web/build/server/nodes/7.js +1 -1
- package/apps/web/build/server/nodes/8.js +1 -1
- package/apps/web/build/server/nodes/9.js +1 -1
- package/apps/web/build/server/server.js +15 -7
- package/apps/web/package.json +1 -1
- package/bin/cli.js +397 -33
- package/docs/ALL-WORKFLOW-DIAGRAMS.md +135 -0
- package/docs/ARCHITECTURE.md +23 -1
- package/docs/BENCHMARK.md +53 -33
- package/docs/CLOUDFLARE_TUNNEL_GUIDE.md +119 -0
- package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.17_2026-10-08.md +87 -0
- package/docs/TELEGRAM_INTEGRATION_GUIDE.md +146 -0
- package/docs/diagrams/README.md +6 -2
- package/docs/diagrams/konoha-architecture.drawio +121 -0
- package/docs/diagrams/konoha-enterprise-architecture.drawio +121 -0
- package/package.json +1 -1
- package/src/agent_manager.js +75 -8
- package/src/crypto_vault.js +157 -0
- package/src/db.js +186 -65
- package/src/db_agents.js +1 -1
- package/src/mcp/memory_reporting.js +19 -0
- package/src/mcp/skills.js +17 -15
- package/src/mcp/workflow.js +38 -0
- package/src/migrate.js +74 -6
- package/src/persona_memory.js +1 -1
- package/src/prompt_hook.js +40 -1
- package/src/queue/inbox.js +243 -0
- package/src/queue/worker.js +413 -0
- package/src/telegram/config.js +101 -0
- package/src/telegram/notifier.js +359 -0
- package/src/telegram/poller.js +548 -0
- package/src/telegram/session_manager.js +583 -0
- package/src/templates/SOUL.md +1 -1
- package/src/templates/skills/konoha/SKILL.md +30 -1
- package/src/tunnel/config.js +89 -0
- package/src/tunnel/manager.js +216 -0
- package/src/tunnel/security.js +225 -0
- package/src/vector_search.js +21 -11
- package/src/web_server.js +358 -10
- package/apps/web/build/client/_app/immutable/assets/0.Ch0v37a-.css +0 -2
- package/apps/web/build/client/_app/immutable/assets/0.Ch0v37a-.css.br +0 -0
- package/apps/web/build/client/_app/immutable/assets/0.Ch0v37a-.css.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/7LmsTWIo.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/7LmsTWIo.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js +0 -1
- package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js.br +0 -2
- package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js +0 -1
- package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js.br +0 -1
- package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/CBY268r4.js +0 -1
- package/apps/web/build/client/_app/immutable/chunks/CBY268r4.js.br +0 -3
- package/apps/web/build/client/_app/immutable/chunks/CBY268r4.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/D-Kujhko.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/D-Kujhko.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/Dzm74gVd.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/Dzm74gVd.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js +0 -2
- package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/chunks/PrdhfbrQ.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/fbrtLByB.js.br +0 -0
- package/apps/web/build/client/_app/immutable/chunks/fbrtLByB.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/entry/app.BeU4olDP.js +0 -2
- package/apps/web/build/client/_app/immutable/entry/app.BeU4olDP.js.br +0 -0
- package/apps/web/build/client/_app/immutable/entry/app.BeU4olDP.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/entry/start.CNV5BTCO.js.br +0 -0
- package/apps/web/build/client/_app/immutable/entry/start.CNV5BTCO.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/0.CdOP7y9P.js +0 -2
- package/apps/web/build/client/_app/immutable/nodes/0.CdOP7y9P.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/0.CdOP7y9P.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/1.BZu6jsAH.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/1.BZu6jsAH.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/1.BZu6jsAH.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/10.CZKScTFN.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/10.CZKScTFN.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/10.CZKScTFN.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/11.4dBWH00t.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/11.4dBWH00t.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/12.CSShcv5z.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/12.CSShcv5z.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/12.CSShcv5z.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/13.jWUWoBcs.js +0 -3
- package/apps/web/build/client/_app/immutable/nodes/13.jWUWoBcs.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/13.jWUWoBcs.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/14.H-jSqqen.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/14.H-jSqqen.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/14.H-jSqqen.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/15.CpAoyhzV.js +0 -17
- package/apps/web/build/client/_app/immutable/nodes/15.CpAoyhzV.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/15.CpAoyhzV.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/16.DT_-MxCT.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/16.DT_-MxCT.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/16.DT_-MxCT.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/2.Dr646Vs5.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/2.Dr646Vs5.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/3.Cgc-xN3x.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/3.Cgc-xN3x.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/3.Cgc-xN3x.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/4.CYJQ4bWz.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/4.CYJQ4bWz.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/4.CYJQ4bWz.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/5.DbHL-3Es.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/5.DbHL-3Es.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/5.DbHL-3Es.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/6.BvWH2qas.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/6.BvWH2qas.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/6.BvWH2qas.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/7.CmbiPMU3.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/7.CmbiPMU3.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/8.B9897Zm9.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/8.B9897Zm9.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/8.B9897Zm9.js.gz +0 -0
- package/apps/web/build/client/_app/immutable/nodes/9.CGMmeMVC.js +0 -14
- package/apps/web/build/client/_app/immutable/nodes/9.CGMmeMVC.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/9.CGMmeMVC.js.gz +0 -0
- package/apps/web/build/server/_app/immutable/assets/_layout.Ch0v37a-.css +0 -2
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Telegram Bot Integration Guide: Remote Notifications & Inbound Prompting
|
|
2
|
+
|
|
3
|
+
**Konoha MCP Version:** v2.1.17
|
|
4
|
+
**Module:** `src/telegram/`
|
|
5
|
+
**CLI Interface:** `konoha telegram <command>`
|
|
6
|
+
**Web UI Route:** `/remote`
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 1. Overview
|
|
11
|
+
|
|
12
|
+
Konoha's Telegram integration provides remote visibility and control over your local coding agent directly from your smartphone or desktop Telegram app.
|
|
13
|
+
|
|
14
|
+
### Key Capabilities
|
|
15
|
+
- **One-Way Notification Mode**: Automatically delivers real-time task completion reports, execution duration, token savings telemetry (83%-98%), and Kage Reviewer confidence scores. When you work locally on your laptop, terminal, or IDE, any task that passes Kage Final Gate Review (`APPROVED` with 100/100 zero-slop score and ≥98% confidence) automatically dispatches an outbound Telegram notification to your phone.
|
|
16
|
+
- **Two-Way Remote Prompting Mode**: Fully prompt and control your workstation from Telegram chat. Accepts commands (`/run <task>`, `/sh <cmd>`, `/session`, `/kage`, `/status`, `/savings`, `/cancel`) via Native Long Polling and forwards prompts to your active terminal agent.
|
|
17
|
+
- **Zero-Port Security**: Uses outbound HTTPS Long Polling (`getUpdates`) directly to `api.telegram.org`. No public ports or incoming webhooks are opened on your workstation.
|
|
18
|
+
- **Chat ID Whitelist Invariant**: Drops all unauthorized messages immediately. Only your verified numeric Telegram ID can trigger tasks.
|
|
19
|
+
- **Zero Emojis Standard**: All notifications use clean bracketed tags (`[KONOHA TASK REPORT]`, `[SUCCESS]`, `[QUEUED]`, `[KAGE REVIEW GATE PASSED]`).
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<img src="../assets/konoha-telegram-flow.gif" alt="Telegram Remote Workflow & Kage Gate Notifier" width="100%" />
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. Initial Setup: Bot Token & Chat ID
|
|
28
|
+
|
|
29
|
+
### Step 1: Create Your Bot with @BotFather
|
|
30
|
+
1. Open Telegram and search for `@BotFather`.
|
|
31
|
+
2. Send `/newbot`.
|
|
32
|
+
3. Choose a friendly display name (e.g., `My Konoha Worker`).
|
|
33
|
+
4. Choose a unique username ending in `bot` (e.g., `my_konoha_worker_bot`).
|
|
34
|
+
5. BotFather will provide your **HTTP API Token** (e.g. `123456789:AAExampleBotTokenPlaceholder...`).
|
|
35
|
+
|
|
36
|
+
### Step 2: Retrieve Your Personal Numeric Chat ID
|
|
37
|
+
1. Search for `@userinfobot` in Telegram and send `/start`.
|
|
38
|
+
2. It will reply with your personal numeric user ID (e.g. `123456789`).
|
|
39
|
+
3. **Important**: Open your newly created bot in Telegram and tap **Start** (or send `hello`). This grants the bot permission to message you.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 3. Configuration
|
|
44
|
+
|
|
45
|
+
### Via CLI
|
|
46
|
+
```bash
|
|
47
|
+
# Configure credentials and mode
|
|
48
|
+
konoha telegram config --token "<BOT_TOKEN>" --chat-id "<YOUR_NUMERIC_ID>" --mode two_way
|
|
49
|
+
|
|
50
|
+
# Enable integration
|
|
51
|
+
konoha telegram enable
|
|
52
|
+
|
|
53
|
+
# Send a verification test ping to your phone
|
|
54
|
+
konoha telegram test
|
|
55
|
+
|
|
56
|
+
# Test outbound Kage review gate notification
|
|
57
|
+
konoha telegram notify-kage "Kage Review Gate verified: APPROVED (100% confidence, 0 AI slop findings)."
|
|
58
|
+
|
|
59
|
+
# Inspect current status
|
|
60
|
+
konoha telegram status
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Via Web UI
|
|
64
|
+
1. Navigate to `http://localhost:1404/remote`.
|
|
65
|
+
2. Under **Telegram Bot**:
|
|
66
|
+
- Choose **One-Way** (Alerts Only) or **Two-Way** (Alerts + Inbound Prompting).
|
|
67
|
+
- Enter your Bot Token and Authorized Chat ID.
|
|
68
|
+
- Click **Save Settings** and **Enable Integration**.
|
|
69
|
+
- Click **Send Test Ping** to verify delivery.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 4. Prompting from Telegram (Two-Way Mode)
|
|
74
|
+
|
|
75
|
+
When configured in **Two-Way Mode**, you can send tasks to your workstation using standard messages or commands:
|
|
76
|
+
|
|
77
|
+
### Natural Language Prompt
|
|
78
|
+
Send any plain message directly to the bot:
|
|
79
|
+
```text
|
|
80
|
+
fix type error in src/auth/jwt.ts and run vitest
|
|
81
|
+
```
|
|
82
|
+
*Konoha responds immediately:*
|
|
83
|
+
```text
|
|
84
|
+
[QUEUED #task_m1n4b] Task accepted.
|
|
85
|
+
Prompt: "fix type error in src/auth/jwt.ts and run vitest"
|
|
86
|
+
Status: Forwarded to local terminal agent.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Dedicated Slash Commands
|
|
90
|
+
| Command | Description | Example |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| `/session` | View numbered list of active client workspaces & sessions | `/session` |
|
|
93
|
+
| `/session <number>` | Switch target client session & workspace | `/session 2` |
|
|
94
|
+
| `/session create <client> <path>` | Register and target a client session & directory | `/session create agy /home/user/projectA` |
|
|
95
|
+
| `/sh <cmd>` | Execute a shell command via interactive shell (`bash -i -c`) with `~/.bashrc` aliases | `/sh kctenhw get namespace` |
|
|
96
|
+
| `/kage <prompt>` | Direct dispatch to Village Leader (Architecture & security audit) | `/kage audit auth flow` |
|
|
97
|
+
| `/anbu <prompt>` | Direct dispatch to Black Ops (Backend, DevOps, bug fixing) | `/anbu fix connection leak` |
|
|
98
|
+
| `/jonin <prompt>` | Direct dispatch to Elite Builder (UI/UX, frontend components) | `/jonin build hero carousel` |
|
|
99
|
+
| `/genin <prompt>` | Direct dispatch to Scout (Codebase exploration & dependency mapping) | `/genin trace session flow` |
|
|
100
|
+
| `/chunin <prompt>` | Direct dispatch to Intel Ninja (Web research & docs lookup) | `/chunin research cloudflare api` |
|
|
101
|
+
| `/tokubetsu_jonin <prompt>` | Direct dispatch to Scribe (Tech docs, API specs & reports) | `/tokubetsu_jonin update api docs` |
|
|
102
|
+
| `/sannin <prompt>` | Direct dispatch to Master Orchestrator (Triage & planning) | `/sannin plan refactoring` |
|
|
103
|
+
| `/run <task>` | Explicitly dispatch an autonomous coding prompt | `/run optimize sqlite query index` |
|
|
104
|
+
| `/status` | View recent workspace tasks and active status | `/status` |
|
|
105
|
+
| `/savings` | Check today's token reduction metrics | `/savings` |
|
|
106
|
+
| `/cancel` | Cancel currently pending queued task | `/cancel` |
|
|
107
|
+
| `/help` | View command cheatsheet | `/help` |
|
|
108
|
+
|
|
109
|
+
> [!NOTE]
|
|
110
|
+
> **Plain Text Prompts**: Any plain text message sent without a slash prefix is automatically treated as an autonomous task prompt and enqueued for execution.
|
|
111
|
+
>
|
|
112
|
+
> **Shell Alias Support (`/sh`)**: Commands execute in your user shell (`bash -i -c`), enabling full access to your custom `~/.bashrc` aliases (e.g. `kctenhw`, `kcishw`, `kubectl` context wrappers, etc.).
|
|
113
|
+
>
|
|
114
|
+
> **Security Guardrails**: Dangerous commands (`rm -rf /`, `mkfs`, `dd`, `drop database`, `truncate table`, etc.) are unconditionally blocked by the `isDangerousCommand` safety gate.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 5. Sample Task Completion Report
|
|
119
|
+
|
|
120
|
+
Once your local agent finishes execution and passes Kage verification, Telegram delivers the completion report:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
[KONOHA TASK REPORT]
|
|
124
|
+
Task: Rate limiting added to /api/auth
|
|
125
|
+
Status: [SUCCESS]
|
|
126
|
+
Duration: 4.8s
|
|
127
|
+
Files Modified:
|
|
128
|
+
- src/web_server.js
|
|
129
|
+
- tests/test_rate_limit.js
|
|
130
|
+
Token Reduction: 96.2% Saved
|
|
131
|
+
Kage Confidence: 100% Passed
|
|
132
|
+
AI Slop Findings: 0 (100/100 Gate)
|
|
133
|
+
|
|
134
|
+
Remote Dashboard: https://konoha.yourdomain.com
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 6. Architecture & Security Invariants
|
|
140
|
+
|
|
141
|
+
1. **Outbound HTTPS Only**:
|
|
142
|
+
Konoha connects to Telegram via outbound TLS calls (`getUpdates`). No inbound firewall holes or port forwarding needed.
|
|
143
|
+
2. **Whitelist Protection**:
|
|
144
|
+
`chat_id` validation occurs before message parsing. Unrecognized senders are silently ignored.
|
|
145
|
+
3. **Queue Resilience**:
|
|
146
|
+
Incoming prompts are stored in SQLite `prompt_queue` and mirrored to `~/.konoha/inbox/<session>.json`. If your workstation sleeps, prompts are preserved and processed upon wake-up.
|
package/docs/diagrams/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Konoha diagrams
|
|
2
2
|
|
|
3
|
-
`konoha-architecture.drawio` is the canonical editable source for the repository architecture diagrams. It contains
|
|
3
|
+
`konoha-architecture.drawio` is the canonical editable source for the repository architecture diagrams. It contains fifteen pages covering every logical diagram embedded in the README and documentation. Each owner also keeps a synchronized Mermaid companion for native Markdown rendering and text review.
|
|
4
4
|
|
|
5
5
|
**Format policy:** Draw.io owns editable geometry, page layout, and presentation routing. Mermaid owns Markdown-native rendering. The two formats must keep the same semantic nodes, relationships, titles, and implementation anchors; their visual layouts may differ.
|
|
6
6
|
|
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
| 11 Kage Pre-Delivery Reviewer Workflow Gate | 8-phase orchestration state machine, Native SDLC Governance (Definition-of-Readiness DoR pre-dispatch gate, cross-provider second opinion, SDLC task status block gate), Zero-AI-Slop Pre-Gate with `CircuitBreaker` fail-safe degrade (threshold=2, recovery=120s, SIGTERM) and dynamic mtime cache invalidation, Autonomous Kage → Anbu Remediation Loop, 98% Minimum Confidence Gate (≥ 98%), 100% task execution verification, clean evidence validation, security & CVE audit | `docs/ARCHITECTURE.md`, `docs/ALL-WORKFLOW-DIAGRAMS.md` | `src/mcp/workflow.js`, `src/sdlc_manager.js`, `src/circuit_breaker.js`, `tests/test_anti_slop_gate.js` |
|
|
31
31
|
| 12 CLI Upgrade & Progress Engine | 7-stage interactive upgrade pipeline, KonohaProgressBar with live pulse timers, animated braille spinner (startSpinner, TTY-only), non-destructive user skill & config preservation (zero pruning of pre-existing skills, additive-only sync, managed boundary injection, custom agent union-merge), in-process runtime sync, cross-client MCP auto-registration | `docs/ARCHITECTURE.md` | `bin/cli.js:cmdUpgrade`, `bin/cli.js:KonohaProgressBar`, `bin/cli.js:cmdInit`, `src/deploy_utils.js` |
|
|
32
32
|
| 13 QA Automation Workflow | Bounded token-preserving pipeline, `agent-browser` scoped exploration, flow declaration (`tests/e2e/flows/*.json`), deterministic `qa_codify`, `qa_e2e_run` RED/GREEN loop, remediation fix branches (Anbu backend / Jonin UI), Zero-AI-Slop gate, Anbu QA evidence (`run_id`), Kage review gate | `docs/QA-AUTOMATION.md` | `src/qa_tools.js`, `src/file_tools_router.js`, `docs/QA-AUTOMATION.md`, `tests/e2e/` |
|
|
33
|
+
| 14 Remote Access & Telegram Inbound/Outbound | Zero-emoji task reporting, whitelisted long polling daemon (`/run`, `/status`, `/savings`, `/kage`), chat ID gating | `docs/TELEGRAM_INTEGRATION_GUIDE.md`, `docs/ALL-WORKFLOW-DIAGRAMS.md` | `src/telegram/notifier.js`, `src/telegram/poller.js`, `bin/cli.js:cmdTelegram` |
|
|
34
|
+
| 15 Cloudflare Zero Trust Ingress & Prompt Queue | Cloudflare Quick Tunnel supervisor, edge identity Mode A authentication (`Cf-Access-Authenticated-User-Email`), SQLite prompt queue & atomic inbox mirror, SvelteKit Remote Access dashboard | `docs/CLOUDFLARE_TUNNEL_GUIDE.md`, `docs/ALL-WORKFLOW-DIAGRAMS.md` | `src/tunnel/manager.js`, `src/tunnel/security.js`, `src/queue/inbox.js`, `apps/web/src/components/RemoteAccess.svelte` |
|
|
33
35
|
|
|
34
36
|
## Enterprise Cloud Architecture Diagrams (Official AWS / GCP / Azure Style)
|
|
35
37
|
|
|
36
|
-
In addition to `konoha-architecture.drawio`, `konoha-enterprise-architecture.drawio` provides a dedicated
|
|
38
|
+
In addition to `konoha-architecture.drawio`, `konoha-enterprise-architecture.drawio` provides a dedicated 15-page professional cloud architecture edition modeled in official industry cloud architecture styling (AWS 2024 / GCP / Azure official stencils and group containers). Every page mirrors the 15 canonical pages with zero generic boxes, using official cloud palettes, VPC and Security Group containers, and crisp orthogonal connectors:
|
|
37
39
|
|
|
38
40
|
| Page | Scope | Cloud Architecture Stencils | Systems Covered |
|
|
39
41
|
|---|---|---|---|
|
|
@@ -50,6 +52,8 @@ In addition to `konoha-architecture.drawio`, `konoha-enterprise-architecture.dra
|
|
|
50
52
|
| 11 Kage Pre-Delivery Reviewer Workflow Gate | 8-phase SDLC state machine, DoR gate, Zero-AI-Slop gate, and 98% confidence firewall | AWS Shield, WAF, Audit Manager, Security Hub | SDLC Governance Gate |
|
|
51
53
|
| 12 CLI Upgrade & Progress Engine | 7-stage interactive upgrade pipeline, pulse timers, and atomic client sync | AWS Systems Manager, CodeDeploy, CloudWatch | CLI Upgrade Pipeline |
|
|
52
54
|
| 13 QA Automation Workflow | Bounded token QA pipeline, agent-browser explorer, Playwright codifier, and RED/GREEN loop | AWS Systems Manager, Device Farm, Lambda, S3 | QA Automation Pipeline |
|
|
55
|
+
| 14 Remote Access & Telegram Inbound/Outbound | Zero-emoji task reporting, whitelisted long polling, bi-directional command ingress, and session switcher | AWS API Gateway, SQS, SNS, Lambda, DynamoDB | Telegram Remote Ingress |
|
|
56
|
+
| 15 Cloudflare Zero Trust Ingress & Prompt Queue | Cloudflare Quick Tunnel supervisor, edge identity header validation, and SQLite prompt_queue | Cloudflare Access, AWS API Gateway, SQS, DynamoDB | Zero Trust Ingress & Queue |
|
|
53
57
|
|
|
54
58
|
## Source policy
|
|
55
59
|
|
|
@@ -1155,4 +1155,125 @@
|
|
|
1155
1155
|
</root>
|
|
1156
1156
|
</mxGraphModel>
|
|
1157
1157
|
</diagram>
|
|
1158
|
+
<diagram id="remote-access-telegram" name="14 Remote Access & Telegram Inbound/Outbound">
|
|
1159
|
+
<mxGraphModel grid="1" page="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" pageScale="1" pageWidth="1250" pageHeight="850" background="#ffffff" math="0" shadow="0">
|
|
1160
|
+
<root>
|
|
1161
|
+
<mxCell id="0"/>
|
|
1162
|
+
<mxCell id="1" parent="0"/>
|
|
1163
|
+
<mxCell id="p14-title" parent="1" style="text;html=1;fontSize=18;fontStyle=1;fontColor=#0f172a;" value="14 Remote Access &amp; Telegram Bi-Directional Engine" vertex="1">
|
|
1164
|
+
<mxGeometry height="30" width="800" x="40" y="20" as="geometry"/>
|
|
1165
|
+
</mxCell>
|
|
1166
|
+
<mxCell id="p14-sub1" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8fafc;strokeColor=#0284c7;strokeWidth=2;verticalAlign=top;fontStyle=1;fontColor=#0369a1;" value="Outbound Task Status Reporter (src/telegram/notifier.js)" vertex="1">
|
|
1167
|
+
<mxGeometry height="240" width="1160" x="40" y="70" as="geometry"/>
|
|
1168
|
+
</mxCell>
|
|
1169
|
+
<mxCell id="p14-task-event" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eff6ff;strokeColor=#2563eb;fontColor=#1e3a8a;" value="SDLC Task Event
Completed / Failed / Queued" vertex="1">
|
|
1170
|
+
<mxGeometry height="60" width="200" x="70" y="120" as="geometry"/>
|
|
1171
|
+
</mxCell>
|
|
1172
|
+
<mxCell id="p14-format" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="Format Zero-Emoji Report
• [KONOHA TASK REPORT]
• Duration &amp; Kage Confidence
• Token Telemetry (83-98%)" vertex="1">
|
|
1173
|
+
<mxGeometry height="80" width="220" x="330" y="110" as="geometry"/>
|
|
1174
|
+
</mxCell>
|
|
1175
|
+
<mxCell id="p14-check" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fffbeb;strokeColor=#d97706;fontColor=#92400e;" value="telegram_config
enabled == 1?" vertex="1">
|
|
1176
|
+
<mxGeometry height="80" width="140" x="620" y="110" as="geometry"/>
|
|
1177
|
+
</mxCell>
|
|
1178
|
+
<mxCell id="p14-post" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d1fae5;strokeColor=#059669;fontColor=#065f46;fontStyle=1;" value="HTTPS POST api.telegram.org
/bot&lt;TOKEN&gt;/sendMessage
Target: authorized chat_id" vertex="1">
|
|
1179
|
+
<mxGeometry height="70" width="240" x="840" y="115" as="geometry"/>
|
|
1180
|
+
</mxCell>
|
|
1181
|
+
<mxCell id="p14-sub2" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8fafc;strokeColor=#2563eb;strokeWidth=2;verticalAlign=top;fontStyle=1;fontColor=#1e3a8a;" value="Inbound Long Polling &amp; Command Router (src/telegram/poller.js)" vertex="1">
|
|
1182
|
+
<mxGeometry height="460" width="1160" x="40" y="340" as="geometry"/>
|
|
1183
|
+
</mxCell>
|
|
1184
|
+
<mxCell id="p14-poll-loop" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eff6ff;strokeColor=#2563eb;fontColor=#1e3a8a;" value="Long Poller Loop
GET /getUpdates?offset=N&amp;timeout=15" vertex="1">
|
|
1185
|
+
<mxGeometry height="60" width="220" x="70" y="390" as="geometry"/>
|
|
1186
|
+
</mxCell>
|
|
1187
|
+
<mxCell id="p14-whitelist" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fffbeb;strokeColor=#d97706;fontColor=#92400e;" value="chat.id ==
allowed chat_id?" vertex="1">
|
|
1188
|
+
<mxGeometry height="80" width="140" x="350" y="380" as="geometry"/>
|
|
1189
|
+
</mxCell>
|
|
1190
|
+
<mxCell id="p14-router" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ede9fe;strokeColor=#7c3aed;fontColor=#5b21b6;fontStyle=1;" value="Command
Type?" vertex="1">
|
|
1191
|
+
<mxGeometry height="80" width="120" x="560" y="380" as="geometry"/>
|
|
1192
|
+
</mxCell>
|
|
1193
|
+
<mxCell id="p14-cmd-session" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="/session [number] | create
Multi-Client Switcher
(session_manager.js)" vertex="1">
|
|
1194
|
+
<mxGeometry height="60" width="190" x="750" y="360" as="geometry"/>
|
|
1195
|
+
</mxCell>
|
|
1196
|
+
<mxCell id="p14-cmd-sh" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="/sh &lt;command&gt;
Interactive Shell (bash -i -c)
isDangerousCommand Gate" vertex="1">
|
|
1197
|
+
<mxGeometry height="60" width="190" x="750" y="440" as="geometry"/>
|
|
1198
|
+
</mxCell>
|
|
1199
|
+
<mxCell id="p14-cmd-subagents" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="/kage, /anbu, /jonin...
Direct Subagent Dispatch
Enqueue prompt_queue" vertex="1">
|
|
1200
|
+
<mxGeometry height="60" width="190" x="750" y="520" as="geometry"/>
|
|
1201
|
+
</mxCell>
|
|
1202
|
+
<mxCell id="p14-cmd-queue" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="/run &lt;prompt&gt; | Plain Text
Autonomous Queue Task
Dispatched to worker.js" vertex="1">
|
|
1203
|
+
<mxGeometry height="60" width="190" x="750" y="600" as="geometry"/>
|
|
1204
|
+
</mxCell>
|
|
1205
|
+
<mxCell id="p14-worker" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d1fae5;strokeColor=#059669;fontColor=#065f46;fontStyle=1;" value="Autonomous Queue Worker
• Operational: bash -i -c (0 LLM Tokens)
• AI Coding: agy -p (Kage Gate Review)" vertex="1">
|
|
1206
|
+
<mxGeometry height="80" width="180" x="990" y="530" as="geometry"/>
|
|
1207
|
+
</mxCell>
|
|
1208
|
+
<mxCell id="p14-e1" parent="1" edge="1" source="p14-task-event" target="p14-format" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1209
|
+
<mxCell id="p14-e2" parent="1" edge="1" source="p14-format" target="p14-check" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1210
|
+
<mxCell id="p14-e3" parent="1" edge="1" source="p14-check" target="p14-post" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1211
|
+
<mxCell id="p14-e4" parent="1" edge="1" source="p14-poll-loop" target="p14-whitelist" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1212
|
+
<mxCell id="p14-e5" parent="1" edge="1" source="p14-whitelist" target="p14-router" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1213
|
+
<mxCell id="p14-e6" parent="1" edge="1" source="p14-router" target="p14-cmd-session" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1214
|
+
<mxCell id="p14-e7" parent="1" edge="1" source="p14-router" target="p14-cmd-sh" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1215
|
+
<mxCell id="p14-e8" parent="1" edge="1" source="p14-router" target="p14-cmd-subagents" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0;entryY=0.5;"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="620" y="550"/></Array></mxGeometry></mxCell>
|
|
1216
|
+
<mxCell id="p14-e9" parent="1" edge="1" source="p14-router" target="p14-cmd-queue" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.3;exitY=1;entryX=0;entryY=0.5;"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="596" y="630"/></Array></mxGeometry></mxCell>
|
|
1217
|
+
<mxCell id="p14-e10" parent="1" edge="1" source="p14-cmd-subagents" target="p14-worker" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1218
|
+
<mxCell id="p14-e11" parent="1" edge="1" source="p14-cmd-queue" target="p14-worker" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1219
|
+
</root>
|
|
1220
|
+
</mxGraphModel>
|
|
1221
|
+
</diagram>
|
|
1222
|
+
<diagram id="cloudflare-ingress-prompt-queue" name="15 Cloudflare Zero Trust Ingress & Prompt Queue">
|
|
1223
|
+
<mxGraphModel grid="1" page="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" pageScale="1" pageWidth="1250" pageHeight="850" background="#ffffff" math="0" shadow="0">
|
|
1224
|
+
<root>
|
|
1225
|
+
<mxCell id="0"/>
|
|
1226
|
+
<mxCell id="1" parent="0"/>
|
|
1227
|
+
<mxCell id="p15-title" parent="1" style="text;html=1;fontSize=18;fontStyle=1;fontColor=#0f172a;" value="15 Cloudflare Zero Trust Ingress &amp; Prompt Queue Engine" vertex="1">
|
|
1228
|
+
<mxGeometry height="30" width="800" x="40" y="20" as="geometry"/>
|
|
1229
|
+
</mxCell>
|
|
1230
|
+
<mxCell id="p15-sub1" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8fafc;strokeColor=#f59e0b;strokeWidth=2;verticalAlign=top;fontStyle=1;fontColor=#b45309;" value="Public Ingress Layer (src/tunnel/manager.js &amp; security.js)" vertex="1">
|
|
1231
|
+
<mxGeometry height="240" width="1160" x="40" y="70" as="geometry"/>
|
|
1232
|
+
</mxCell>
|
|
1233
|
+
<mxCell id="p15-user" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eff6ff;strokeColor=#2563eb;fontColor=#1e3a8a;" value="User Mobile / Browser
Public Ingress Access" vertex="1">
|
|
1234
|
+
<mxGeometry height="60" width="180" x="70" y="120" as="geometry"/>
|
|
1235
|
+
</mxCell>
|
|
1236
|
+
<mxCell id="p15-edge" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fffbeb;strokeColor=#d97706;fontColor=#92400e;" value="Cloudflare Edge Network
Zero Trust Access Application
(Google SSO / Email OTP)" vertex="1">
|
|
1237
|
+
<mxGeometry height="70" width="210" x="300" y="115" as="geometry"/>
|
|
1238
|
+
</mxCell>
|
|
1239
|
+
<mxCell id="p15-cloudflared" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="cloudflared Tunnel Daemon
trycloudflare.com / Named
Supervisor: src/tunnel/manager.js" vertex="1">
|
|
1240
|
+
<mxGeometry height="70" width="220" x="560" y="115" as="geometry"/>
|
|
1241
|
+
</mxCell>
|
|
1242
|
+
<mxCell id="p15-webui" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d1fae5;strokeColor=#059669;fontColor=#065f46;fontStyle=1;" value="Local Web UI (Port 1404)
Mode A: Header Validation
Cf-Access-Authenticated-User-Email" vertex="1">
|
|
1243
|
+
<mxGeometry height="70" width="240" x="840" y="115" as="geometry"/>
|
|
1244
|
+
</mxCell>
|
|
1245
|
+
<mxCell id="p15-sub2" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8fafc;strokeColor=#059669;strokeWidth=2;verticalAlign=top;fontStyle=1;fontColor=#065f46;" value="Unified Inbound Prompt Queue &amp; Storage (src/queue/ &amp; src/db.js)" vertex="1">
|
|
1246
|
+
<mxGeometry height="460" width="1160" x="40" y="340" as="geometry"/>
|
|
1247
|
+
</mxCell>
|
|
1248
|
+
<mxCell id="p15-inbox-sqlite" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eff6ff;strokeColor=#2563eb;fontColor=#1e3a8a;" value="SQLite prompt_queue
Atomic state machine:
pending -&gt; processing -&gt; completed" vertex="1">
|
|
1249
|
+
<mxGeometry height="70" width="210" x="70" y="390" as="geometry"/>
|
|
1250
|
+
</mxCell>
|
|
1251
|
+
<mxCell id="p15-fs-mirror" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="Filesystem Mirror Engine
~/.konoha/inbox/&lt;session&gt;.json
Atomic fsync persistence" vertex="1">
|
|
1252
|
+
<mxGeometry height="70" width="200" x="330" y="390" as="geometry"/>
|
|
1253
|
+
</mxCell>
|
|
1254
|
+
<mxCell id="p15-worker-exec" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ede9fe;strokeColor=#7c3aed;fontColor=#5b21b6;fontStyle=1;" value="Autonomous Queue Worker
(src/queue/worker.js)
Zero Token Idle Polling" vertex="1">
|
|
1255
|
+
<mxGeometry height="70" width="200" x="580" y="390" as="geometry"/>
|
|
1256
|
+
</mxCell>
|
|
1257
|
+
<mxCell id="p15-branch-op" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d1fae5;strokeColor=#059669;fontColor=#065f46;" value="Branch A: Operational Command
kubectl, helm, git, /sh (bash -i -c)
100% Token Reduction (0 LLM Tokens)" vertex="1">
|
|
1258
|
+
<mxGeometry height="70" width="240" x="840" y="360" as="geometry"/>
|
|
1259
|
+
</mxCell>
|
|
1260
|
+
<mxCell id="p15-branch-ai" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fef3c7;strokeColor=#d97706;fontColor=#92400e;" value="Branch B: Autonomous AI Task
Headless agy -p &lt;prompt&gt;
Kage Reviewer Confidence Gate" vertex="1">
|
|
1261
|
+
<mxGeometry height="70" width="240" x="840" y="460" as="geometry"/>
|
|
1262
|
+
</mxCell>
|
|
1263
|
+
<mxCell id="p15-notify" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eff6ff;strokeColor=#2563eb;fontColor=#1e3a8a;fontStyle=1;" value="Outbound Telegram Report
Message delivered to authorized chat_id
Zero-Emoji Structured Notification" vertex="1">
|
|
1264
|
+
<mxGeometry height="70" width="240" x="840" y="560" as="geometry"/>
|
|
1265
|
+
</mxCell>
|
|
1266
|
+
<mxCell id="p15-e1" parent="1" edge="1" source="p15-user" target="p15-edge" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1267
|
+
<mxCell id="p15-e2" parent="1" edge="1" source="p15-edge" target="p15-cloudflared" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1268
|
+
<mxCell id="p15-e3" parent="1" edge="1" source="p15-cloudflared" target="p15-webui" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1269
|
+
<mxCell id="p15-e4" parent="1" edge="1" source="p15-inbox-sqlite" target="p15-fs-mirror" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1270
|
+
<mxCell id="p15-e5" parent="1" edge="1" source="p15-inbox-sqlite" target="p15-worker-exec" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="175" y="500"/><mxPoint x="680" y="500"/></Array></mxGeometry></mxCell>
|
|
1271
|
+
<mxCell id="p15-e6" parent="1" edge="1" source="p15-worker-exec" target="p15-branch-op" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1272
|
+
<mxCell id="p15-e7" parent="1" edge="1" source="p15-worker-exec" target="p15-branch-ai" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1273
|
+
<mxCell id="p15-e8" parent="1" edge="1" source="p15-branch-op" target="p15-notify" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="1110" y="395"/><mxPoint x="1110" y="595"/></Array></mxGeometry></mxCell>
|
|
1274
|
+
<mxCell id="p15-e9" parent="1" edge="1" source="p15-branch-ai" target="p15-notify" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1275
|
+
</root>
|
|
1276
|
+
</mxGraphModel>
|
|
1277
|
+
</diagram>
|
|
1278
|
+
|
|
1158
1279
|
</mxfile>
|
|
@@ -1155,4 +1155,125 @@
|
|
|
1155
1155
|
</root>
|
|
1156
1156
|
</mxGraphModel>
|
|
1157
1157
|
</diagram>
|
|
1158
|
+
<diagram id="remote-access-telegram" name="14 Remote Access & Telegram Inbound/Outbound">
|
|
1159
|
+
<mxGraphModel grid="1" page="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" pageScale="1" pageWidth="1250" pageHeight="850" background="#ffffff" math="0" shadow="0">
|
|
1160
|
+
<root>
|
|
1161
|
+
<mxCell id="0"/>
|
|
1162
|
+
<mxCell id="1" parent="0"/>
|
|
1163
|
+
<mxCell id="p14-title" parent="1" style="text;html=1;fontSize=18;fontStyle=1;fontColor=#0f172a;" value="14 Remote Access &amp; Telegram Bi-Directional Engine" vertex="1">
|
|
1164
|
+
<mxGeometry height="30" width="800" x="40" y="20" as="geometry"/>
|
|
1165
|
+
</mxCell>
|
|
1166
|
+
<mxCell id="p14-sub1" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8fafc;strokeColor=#0284c7;strokeWidth=2;verticalAlign=top;fontStyle=1;fontColor=#0369a1;" value="Outbound Task Status Reporter (src/telegram/notifier.js)" vertex="1">
|
|
1167
|
+
<mxGeometry height="240" width="1160" x="40" y="70" as="geometry"/>
|
|
1168
|
+
</mxCell>
|
|
1169
|
+
<mxCell id="p14-task-event" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eff6ff;strokeColor=#2563eb;fontColor=#1e3a8a;" value="SDLC Task Event
Completed / Failed / Queued" vertex="1">
|
|
1170
|
+
<mxGeometry height="60" width="200" x="70" y="120" as="geometry"/>
|
|
1171
|
+
</mxCell>
|
|
1172
|
+
<mxCell id="p14-format" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="Format Zero-Emoji Report
• [KONOHA TASK REPORT]
• Duration &amp; Kage Confidence
• Token Telemetry (83-98%)" vertex="1">
|
|
1173
|
+
<mxGeometry height="80" width="220" x="330" y="110" as="geometry"/>
|
|
1174
|
+
</mxCell>
|
|
1175
|
+
<mxCell id="p14-check" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fffbeb;strokeColor=#d97706;fontColor=#92400e;" value="telegram_config
enabled == 1?" vertex="1">
|
|
1176
|
+
<mxGeometry height="80" width="140" x="620" y="110" as="geometry"/>
|
|
1177
|
+
</mxCell>
|
|
1178
|
+
<mxCell id="p14-post" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d1fae5;strokeColor=#059669;fontColor=#065f46;fontStyle=1;" value="HTTPS POST api.telegram.org
/bot&lt;TOKEN&gt;/sendMessage
Target: authorized chat_id" vertex="1">
|
|
1179
|
+
<mxGeometry height="70" width="240" x="840" y="115" as="geometry"/>
|
|
1180
|
+
</mxCell>
|
|
1181
|
+
<mxCell id="p14-sub2" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8fafc;strokeColor=#2563eb;strokeWidth=2;verticalAlign=top;fontStyle=1;fontColor=#1e3a8a;" value="Inbound Long Polling &amp; Command Router (src/telegram/poller.js)" vertex="1">
|
|
1182
|
+
<mxGeometry height="460" width="1160" x="40" y="340" as="geometry"/>
|
|
1183
|
+
</mxCell>
|
|
1184
|
+
<mxCell id="p14-poll-loop" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eff6ff;strokeColor=#2563eb;fontColor=#1e3a8a;" value="Long Poller Loop
GET /getUpdates?offset=N&amp;timeout=15" vertex="1">
|
|
1185
|
+
<mxGeometry height="60" width="220" x="70" y="390" as="geometry"/>
|
|
1186
|
+
</mxCell>
|
|
1187
|
+
<mxCell id="p14-whitelist" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fffbeb;strokeColor=#d97706;fontColor=#92400e;" value="chat.id ==
allowed chat_id?" vertex="1">
|
|
1188
|
+
<mxGeometry height="80" width="140" x="350" y="380" as="geometry"/>
|
|
1189
|
+
</mxCell>
|
|
1190
|
+
<mxCell id="p14-router" parent="1" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ede9fe;strokeColor=#7c3aed;fontColor=#5b21b6;fontStyle=1;" value="Command
Type?" vertex="1">
|
|
1191
|
+
<mxGeometry height="80" width="120" x="560" y="380" as="geometry"/>
|
|
1192
|
+
</mxCell>
|
|
1193
|
+
<mxCell id="p14-cmd-session" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="/session [number] | create
Multi-Client Switcher
(session_manager.js)" vertex="1">
|
|
1194
|
+
<mxGeometry height="60" width="190" x="750" y="360" as="geometry"/>
|
|
1195
|
+
</mxCell>
|
|
1196
|
+
<mxCell id="p14-cmd-sh" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="/sh &lt;command&gt;
Interactive Shell (bash -i -c)
isDangerousCommand Gate" vertex="1">
|
|
1197
|
+
<mxGeometry height="60" width="190" x="750" y="440" as="geometry"/>
|
|
1198
|
+
</mxCell>
|
|
1199
|
+
<mxCell id="p14-cmd-subagents" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="/kage, /anbu, /jonin...
Direct Subagent Dispatch
Enqueue prompt_queue" vertex="1">
|
|
1200
|
+
<mxGeometry height="60" width="190" x="750" y="520" as="geometry"/>
|
|
1201
|
+
</mxCell>
|
|
1202
|
+
<mxCell id="p14-cmd-queue" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="/run &lt;prompt&gt; | Plain Text
Autonomous Queue Task
Dispatched to worker.js" vertex="1">
|
|
1203
|
+
<mxGeometry height="60" width="190" x="750" y="600" as="geometry"/>
|
|
1204
|
+
</mxCell>
|
|
1205
|
+
<mxCell id="p14-worker" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d1fae5;strokeColor=#059669;fontColor=#065f46;fontStyle=1;" value="Autonomous Queue Worker
• Operational: bash -i -c (0 LLM Tokens)
• AI Coding: agy -p (Kage Gate Review)" vertex="1">
|
|
1206
|
+
<mxGeometry height="80" width="180" x="990" y="530" as="geometry"/>
|
|
1207
|
+
</mxCell>
|
|
1208
|
+
<mxCell id="p14-e1" parent="1" edge="1" source="p14-task-event" target="p14-format" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1209
|
+
<mxCell id="p14-e2" parent="1" edge="1" source="p14-format" target="p14-check" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1210
|
+
<mxCell id="p14-e3" parent="1" edge="1" source="p14-check" target="p14-post" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1211
|
+
<mxCell id="p14-e4" parent="1" edge="1" source="p14-poll-loop" target="p14-whitelist" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1212
|
+
<mxCell id="p14-e5" parent="1" edge="1" source="p14-whitelist" target="p14-router" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1213
|
+
<mxCell id="p14-e6" parent="1" edge="1" source="p14-router" target="p14-cmd-session" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1214
|
+
<mxCell id="p14-e7" parent="1" edge="1" source="p14-router" target="p14-cmd-sh" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1215
|
+
<mxCell id="p14-e8" parent="1" edge="1" source="p14-router" target="p14-cmd-subagents" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.5;exitY=1;entryX=0;entryY=0.5;"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="620" y="550"/></Array></mxGeometry></mxCell>
|
|
1216
|
+
<mxCell id="p14-e9" parent="1" edge="1" source="p14-router" target="p14-cmd-queue" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;exitX=0.3;exitY=1;entryX=0;entryY=0.5;"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="596" y="630"/></Array></mxGeometry></mxCell>
|
|
1217
|
+
<mxCell id="p14-e10" parent="1" edge="1" source="p14-cmd-subagents" target="p14-worker" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1218
|
+
<mxCell id="p14-e11" parent="1" edge="1" source="p14-cmd-queue" target="p14-worker" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1219
|
+
</root>
|
|
1220
|
+
</mxGraphModel>
|
|
1221
|
+
</diagram>
|
|
1222
|
+
<diagram id="cloudflare-ingress-prompt-queue" name="15 Cloudflare Zero Trust Ingress & Prompt Queue">
|
|
1223
|
+
<mxGraphModel grid="1" page="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" pageScale="1" pageWidth="1250" pageHeight="850" background="#ffffff" math="0" shadow="0">
|
|
1224
|
+
<root>
|
|
1225
|
+
<mxCell id="0"/>
|
|
1226
|
+
<mxCell id="1" parent="0"/>
|
|
1227
|
+
<mxCell id="p15-title" parent="1" style="text;html=1;fontSize=18;fontStyle=1;fontColor=#0f172a;" value="15 Cloudflare Zero Trust Ingress &amp; Prompt Queue Engine" vertex="1">
|
|
1228
|
+
<mxGeometry height="30" width="800" x="40" y="20" as="geometry"/>
|
|
1229
|
+
</mxCell>
|
|
1230
|
+
<mxCell id="p15-sub1" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8fafc;strokeColor=#f59e0b;strokeWidth=2;verticalAlign=top;fontStyle=1;fontColor=#b45309;" value="Public Ingress Layer (src/tunnel/manager.js &amp; security.js)" vertex="1">
|
|
1231
|
+
<mxGeometry height="240" width="1160" x="40" y="70" as="geometry"/>
|
|
1232
|
+
</mxCell>
|
|
1233
|
+
<mxCell id="p15-user" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eff6ff;strokeColor=#2563eb;fontColor=#1e3a8a;" value="User Mobile / Browser
Public Ingress Access" vertex="1">
|
|
1234
|
+
<mxGeometry height="60" width="180" x="70" y="120" as="geometry"/>
|
|
1235
|
+
</mxCell>
|
|
1236
|
+
<mxCell id="p15-edge" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fffbeb;strokeColor=#d97706;fontColor=#92400e;" value="Cloudflare Edge Network
Zero Trust Access Application
(Google SSO / Email OTP)" vertex="1">
|
|
1237
|
+
<mxGeometry height="70" width="210" x="300" y="115" as="geometry"/>
|
|
1238
|
+
</mxCell>
|
|
1239
|
+
<mxCell id="p15-cloudflared" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="cloudflared Tunnel Daemon
trycloudflare.com / Named
Supervisor: src/tunnel/manager.js" vertex="1">
|
|
1240
|
+
<mxGeometry height="70" width="220" x="560" y="115" as="geometry"/>
|
|
1241
|
+
</mxCell>
|
|
1242
|
+
<mxCell id="p15-webui" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d1fae5;strokeColor=#059669;fontColor=#065f46;fontStyle=1;" value="Local Web UI (Port 1404)
Mode A: Header Validation
Cf-Access-Authenticated-User-Email" vertex="1">
|
|
1243
|
+
<mxGeometry height="70" width="240" x="840" y="115" as="geometry"/>
|
|
1244
|
+
</mxCell>
|
|
1245
|
+
<mxCell id="p15-sub2" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8fafc;strokeColor=#059669;strokeWidth=2;verticalAlign=top;fontStyle=1;fontColor=#065f46;" value="Unified Inbound Prompt Queue &amp; Storage (src/queue/ &amp; src/db.js)" vertex="1">
|
|
1246
|
+
<mxGeometry height="460" width="1160" x="40" y="340" as="geometry"/>
|
|
1247
|
+
</mxCell>
|
|
1248
|
+
<mxCell id="p15-inbox-sqlite" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eff6ff;strokeColor=#2563eb;fontColor=#1e3a8a;" value="SQLite prompt_queue
Atomic state machine:
pending -&gt; processing -&gt; completed" vertex="1">
|
|
1249
|
+
<mxGeometry height="70" width="210" x="70" y="390" as="geometry"/>
|
|
1250
|
+
</mxCell>
|
|
1251
|
+
<mxCell id="p15-fs-mirror" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#475569;fontColor=#0f172a;" value="Filesystem Mirror Engine
~/.konoha/inbox/&lt;session&gt;.json
Atomic fsync persistence" vertex="1">
|
|
1252
|
+
<mxGeometry height="70" width="200" x="330" y="390" as="geometry"/>
|
|
1253
|
+
</mxCell>
|
|
1254
|
+
<mxCell id="p15-worker-exec" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ede9fe;strokeColor=#7c3aed;fontColor=#5b21b6;fontStyle=1;" value="Autonomous Queue Worker
(src/queue/worker.js)
Zero Token Idle Polling" vertex="1">
|
|
1255
|
+
<mxGeometry height="70" width="200" x="580" y="390" as="geometry"/>
|
|
1256
|
+
</mxCell>
|
|
1257
|
+
<mxCell id="p15-branch-op" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d1fae5;strokeColor=#059669;fontColor=#065f46;" value="Branch A: Operational Command
kubectl, helm, git, /sh (bash -i -c)
100% Token Reduction (0 LLM Tokens)" vertex="1">
|
|
1258
|
+
<mxGeometry height="70" width="240" x="840" y="360" as="geometry"/>
|
|
1259
|
+
</mxCell>
|
|
1260
|
+
<mxCell id="p15-branch-ai" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fef3c7;strokeColor=#d97706;fontColor=#92400e;" value="Branch B: Autonomous AI Task
Headless agy -p &lt;prompt&gt;
Kage Reviewer Confidence Gate" vertex="1">
|
|
1261
|
+
<mxGeometry height="70" width="240" x="840" y="460" as="geometry"/>
|
|
1262
|
+
</mxCell>
|
|
1263
|
+
<mxCell id="p15-notify" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#eff6ff;strokeColor=#2563eb;fontColor=#1e3a8a;fontStyle=1;" value="Outbound Telegram Report
Message delivered to authorized chat_id
Zero-Emoji Structured Notification" vertex="1">
|
|
1264
|
+
<mxGeometry height="70" width="240" x="840" y="560" as="geometry"/>
|
|
1265
|
+
</mxCell>
|
|
1266
|
+
<mxCell id="p15-e1" parent="1" edge="1" source="p15-user" target="p15-edge" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1267
|
+
<mxCell id="p15-e2" parent="1" edge="1" source="p15-edge" target="p15-cloudflared" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1268
|
+
<mxCell id="p15-e3" parent="1" edge="1" source="p15-cloudflared" target="p15-webui" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1269
|
+
<mxCell id="p15-e4" parent="1" edge="1" source="p15-inbox-sqlite" target="p15-fs-mirror" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1270
|
+
<mxCell id="p15-e5" parent="1" edge="1" source="p15-inbox-sqlite" target="p15-worker-exec" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="175" y="500"/><mxPoint x="680" y="500"/></Array></mxGeometry></mxCell>
|
|
1271
|
+
<mxCell id="p15-e6" parent="1" edge="1" source="p15-worker-exec" target="p15-branch-op" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1272
|
+
<mxCell id="p15-e7" parent="1" edge="1" source="p15-worker-exec" target="p15-branch-ai" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1273
|
+
<mxCell id="p15-e8" parent="1" edge="1" source="p15-branch-op" target="p15-notify" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="1110" y="395"/><mxPoint x="1110" y="595"/></Array></mxGeometry></mxCell>
|
|
1274
|
+
<mxCell id="p15-e9" parent="1" edge="1" source="p15-branch-ai" target="p15-notify" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;"><mxGeometry relative="1" as="geometry"/></mxCell>
|
|
1275
|
+
</root>
|
|
1276
|
+
</mxGraphModel>
|
|
1277
|
+
</diagram>
|
|
1278
|
+
|
|
1158
1279
|
</mxfile>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "konoha-mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.17",
|
|
4
4
|
"description": "Token-efficient MCP skill server with SQLite FTS5 and specialist agent routing",
|
|
5
5
|
"homepage": "https://github.com/andycungkrinx91/konoha#readme",
|
|
6
6
|
"bugs": "https://github.com/andycungkrinx91/konoha/issues",
|
package/src/agent_manager.js
CHANGED
|
@@ -321,8 +321,7 @@ function loadAgents(reloadDefaults = false, silent = false) {
|
|
|
321
321
|
'chunin': ['antislop', 'antislop-human', 'antislop-code'],
|
|
322
322
|
'jonin': ['antislop', 'antislop-ui', 'antislop-human', 'antislop-layoutmobile', 'antislop-code'],
|
|
323
323
|
'anbu': ['antislop', 'antislop-human', 'antislop-code'],
|
|
324
|
-
'tokubetsu-jonin': ['antislop', 'antislop-copywriting', 'antislop-human', 'antislop-code']
|
|
325
|
-
'tokubetsu_jonin': ['antislop', 'antislop-copywriting', 'antislop-human', 'antislop-code']
|
|
324
|
+
'tokubetsu-jonin': ['antislop', 'antislop-copywriting', 'antislop-human', 'antislop-code']
|
|
326
325
|
};
|
|
327
326
|
|
|
328
327
|
const mandatory = MANDATORY_AGENT_ANTISLOP_SKILLS[a.name];
|
|
@@ -443,6 +442,7 @@ function saveAgents(agents) {
|
|
|
443
442
|
|
|
444
443
|
// 3. Invalidate cache so next loadAgents reads the fresh state
|
|
445
444
|
__cachedAgents = null;
|
|
445
|
+
__cachedAgentsTs = null;
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
function buildAgentReferenceList(agents) {
|
|
@@ -1163,8 +1163,7 @@ function createSubagent(name, options = {}) {
|
|
|
1163
1163
|
throw new Error(`Subagent creation locked: "${name}" is not an official subagent. Auto-creation of custom subagents is strictly prohibited by system guardrails. To override this manually, you must pass the --manual flag.`);
|
|
1164
1164
|
}
|
|
1165
1165
|
|
|
1166
|
-
|
|
1167
|
-
const displayName = lowerName.startsWith('mcp_') ? lowerName : `mcp_${lowerName}`;
|
|
1166
|
+
const displayName = lowerName.replace(/^(mcp_|_mcp_|mcp-)/, '');
|
|
1168
1167
|
|
|
1169
1168
|
if (agents.some(a => a.name === lowerName || a.name === displayName)) {
|
|
1170
1169
|
throw new Error(`Subagent with name "${name}" already exists.`);
|
|
@@ -1277,14 +1276,29 @@ function updateAgentModel(agentName, modelId) {
|
|
|
1277
1276
|
return true;
|
|
1278
1277
|
}
|
|
1279
1278
|
|
|
1279
|
+
const CANONICAL_OFFICIAL_NINJAS = [
|
|
1280
|
+
'sannin',
|
|
1281
|
+
'genin',
|
|
1282
|
+
'kage',
|
|
1283
|
+
'chunin',
|
|
1284
|
+
'jonin',
|
|
1285
|
+
'anbu',
|
|
1286
|
+
'tokubetsu-jonin'
|
|
1287
|
+
];
|
|
1288
|
+
|
|
1280
1289
|
function getOfficialAgentNames() {
|
|
1281
|
-
|
|
1290
|
+
const names = new Set(CANONICAL_OFFICIAL_NINJAS);
|
|
1282
1291
|
if (fs.existsSync(DEFAULT_AGENTS_YAML_PATH)) {
|
|
1283
1292
|
try {
|
|
1284
|
-
defaults = parseYaml(fs.readFileSync(DEFAULT_AGENTS_YAML_PATH, 'utf-8'));
|
|
1293
|
+
const defaults = parseYaml(fs.readFileSync(DEFAULT_AGENTS_YAML_PATH, 'utf-8'));
|
|
1294
|
+
if (Array.isArray(defaults)) {
|
|
1295
|
+
defaults.forEach((a) => {
|
|
1296
|
+
if (a && a.name) names.add(a.name.toLowerCase());
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1285
1299
|
} catch (_) { /* intentional best-effort fallback: failure here must never crash the CLI/MCP runtime */ }
|
|
1286
1300
|
}
|
|
1287
|
-
return
|
|
1301
|
+
return Array.from(names);
|
|
1288
1302
|
}
|
|
1289
1303
|
|
|
1290
1304
|
// Delete a subagent entirely
|
|
@@ -1300,7 +1314,7 @@ function deleteAgent(name) {
|
|
|
1300
1314
|
|
|
1301
1315
|
if (isOfficial) {
|
|
1302
1316
|
throw new Error(
|
|
1303
|
-
`Subagent "${name}" is a protected
|
|
1317
|
+
`Subagent "${name}" is a protected official Konoha ninja agent and cannot be deleted.`
|
|
1304
1318
|
);
|
|
1305
1319
|
}
|
|
1306
1320
|
|
|
@@ -1316,16 +1330,69 @@ function deleteAgent(name) {
|
|
|
1316
1330
|
throw new Error(`Subagent "${name}" not found.`);
|
|
1317
1331
|
}
|
|
1318
1332
|
|
|
1333
|
+
try {
|
|
1334
|
+
const dbAgents = require('./db_agents');
|
|
1335
|
+
dbAgents.deleteAgent(searchName);
|
|
1336
|
+
dbAgents.deleteAgent(name);
|
|
1337
|
+
} catch (_) { /* intentional best-effort fallback: failure here must never crash the CLI/MCP runtime */ }
|
|
1338
|
+
|
|
1319
1339
|
saveAgents(filtered);
|
|
1320
1340
|
regenerateAndDeploy();
|
|
1321
1341
|
return true;
|
|
1322
1342
|
}
|
|
1323
1343
|
|
|
1344
|
+
// Update a custom subagent
|
|
1345
|
+
function updateAgent(name, updates = {}) {
|
|
1346
|
+
const lowerName = name.toLowerCase();
|
|
1347
|
+
const searchName = lowerName.replace(/^(mcp_|_mcp_|mcp-)/, '');
|
|
1348
|
+
const official = getOfficialAgentNames();
|
|
1349
|
+
|
|
1350
|
+
const isOfficial = official.some(oName => {
|
|
1351
|
+
const oBare = oName.toLowerCase().replace(/^(mcp_|_mcp_|mcp-)/, '');
|
|
1352
|
+
return oName.toLowerCase() === lowerName || oBare === searchName;
|
|
1353
|
+
});
|
|
1354
|
+
|
|
1355
|
+
if (isOfficial) {
|
|
1356
|
+
throw new Error(
|
|
1357
|
+
`Subagent "${name}" is a protected official Konoha ninja agent and cannot be modified directly.`
|
|
1358
|
+
);
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
const agents = loadAgents();
|
|
1362
|
+
const agent = agents.find(a => {
|
|
1363
|
+
const aName = a.name.toLowerCase();
|
|
1364
|
+
const aBare = aName.replace(/^(mcp_|_mcp_|mcp-)/, '');
|
|
1365
|
+
return aName === lowerName || aBare === searchName;
|
|
1366
|
+
});
|
|
1367
|
+
|
|
1368
|
+
if (!agent) {
|
|
1369
|
+
throw new Error(`Subagent "${name}" not found.`);
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
if (updates.title) agent.title = String(updates.title).trim();
|
|
1373
|
+
if (updates.purpose) agent.purpose = String(updates.purpose).trim();
|
|
1374
|
+
if (updates.description) agent.description = String(updates.description).trim();
|
|
1375
|
+
if (updates.instructions) agent.instructions = String(updates.instructions).trim();
|
|
1376
|
+
if (updates.icon) agent.icon = String(updates.icon).trim();
|
|
1377
|
+
if (updates.model !== undefined) {
|
|
1378
|
+
if (updates.model) agent.model = String(updates.model).trim();
|
|
1379
|
+
else delete agent.model;
|
|
1380
|
+
}
|
|
1381
|
+
if (Array.isArray(updates.skills)) {
|
|
1382
|
+
agent.skills = updates.skills.map(s => String(s).trim()).filter(Boolean);
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
saveAgents(agents);
|
|
1386
|
+
regenerateAndDeploy();
|
|
1387
|
+
return agent;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1324
1390
|
module.exports = {
|
|
1325
1391
|
loadAgents,
|
|
1326
1392
|
saveAgents,
|
|
1327
1393
|
regenerateAndDeploy,
|
|
1328
1394
|
createSubagent,
|
|
1395
|
+
updateAgent,
|
|
1329
1396
|
embedSkill,
|
|
1330
1397
|
unembedSkill,
|
|
1331
1398
|
updateAgentModel,
|