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
|
@@ -10,7 +10,7 @@ return {
|
|
|
10
10
|
app_path: "_app",
|
|
11
11
|
assets: new Set(["apple-touch-icon.png","favicon.ico","fox_kyubi_192.png","fox_kyubi_32.png","fox_kyubi_512.png","fox_kyubi_64.png","manifest.webmanifest"]),
|
|
12
12
|
mime_types: {".png":"image/png",".ico":"image/x-icon",".webmanifest":"application/manifest+json"},
|
|
13
|
-
client: {start:"_app/immutable/entry/start.
|
|
13
|
+
client: {start:"_app/immutable/entry/start.CJ1ccVCA.js",app:"_app/immutable/entry/app.cdLMQHsN.js",imports:["_app/immutable/entry/start.CJ1ccVCA.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/BaNbYf_w.js","_app/immutable/chunks/ChmznE4L.js","_app/immutable/chunks/C7jhkUmC.js","_app/immutable/chunks/Dek69VGa.js","_app/immutable/chunks/2WlqNq2Q.js","_app/immutable/chunks/Cg3pm-K7.js","_app/immutable/entry/app.cdLMQHsN.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
|
14
14
|
|
|
15
15
|
nodes: [
|
|
16
16
|
__memo(() => import('./nodes/0.js')),
|
|
@@ -29,7 +29,8 @@ return {
|
|
|
29
29
|
__memo(() => import('./nodes/13.js')),
|
|
30
30
|
__memo(() => import('./nodes/14.js')),
|
|
31
31
|
__memo(() => import('./nodes/15.js')),
|
|
32
|
-
__memo(() => import('./nodes/16.js'))
|
|
32
|
+
__memo(() => import('./nodes/16.js')),
|
|
33
|
+
__memo(() => import('./nodes/17.js'))
|
|
33
34
|
],
|
|
34
35
|
remotes: {
|
|
35
36
|
|
|
@@ -105,39 +106,46 @@ return {
|
|
|
105
106
|
page: { layouts: [0,], errors: [1,], leaf: 11 },
|
|
106
107
|
endpoint: null
|
|
107
108
|
},
|
|
109
|
+
{
|
|
110
|
+
id: "/remote",
|
|
111
|
+
pattern: /^\/remote\/?$/,
|
|
112
|
+
params: [],
|
|
113
|
+
page: { layouts: [0,], errors: [1,], leaf: 12 },
|
|
114
|
+
endpoint: null
|
|
115
|
+
},
|
|
108
116
|
{
|
|
109
117
|
id: "/savings",
|
|
110
118
|
pattern: /^\/savings\/?$/,
|
|
111
119
|
params: [],
|
|
112
|
-
page: { layouts: [0,], errors: [1,], leaf:
|
|
120
|
+
page: { layouts: [0,], errors: [1,], leaf: 13 },
|
|
113
121
|
endpoint: null
|
|
114
122
|
},
|
|
115
123
|
{
|
|
116
124
|
id: "/search",
|
|
117
125
|
pattern: /^\/search\/?$/,
|
|
118
126
|
params: [],
|
|
119
|
-
page: { layouts: [0,], errors: [1,], leaf:
|
|
127
|
+
page: { layouts: [0,], errors: [1,], leaf: 14 },
|
|
120
128
|
endpoint: null
|
|
121
129
|
},
|
|
122
130
|
{
|
|
123
131
|
id: "/semble",
|
|
124
132
|
pattern: /^\/semble\/?$/,
|
|
125
133
|
params: [],
|
|
126
|
-
page: { layouts: [0,], errors: [1,], leaf:
|
|
134
|
+
page: { layouts: [0,], errors: [1,], leaf: 15 },
|
|
127
135
|
endpoint: null
|
|
128
136
|
},
|
|
129
137
|
{
|
|
130
138
|
id: "/skills",
|
|
131
139
|
pattern: /^\/skills\/?$/,
|
|
132
140
|
params: [],
|
|
133
|
-
page: { layouts: [0,], errors: [1,], leaf:
|
|
141
|
+
page: { layouts: [0,], errors: [1,], leaf: 16 },
|
|
134
142
|
endpoint: null
|
|
135
143
|
},
|
|
136
144
|
{
|
|
137
145
|
id: "/tasks",
|
|
138
146
|
pattern: /^\/tasks\/?$/,
|
|
139
147
|
params: [],
|
|
140
|
-
page: { layouts: [0,], errors: [1,], leaf:
|
|
148
|
+
page: { layouts: [0,], errors: [1,], leaf: 17 },
|
|
141
149
|
endpoint: null
|
|
142
150
|
}
|
|
143
151
|
],
|
package/apps/web/package.json
CHANGED
package/bin/cli.js
CHANGED
|
@@ -250,7 +250,8 @@ function truncateVisual(str, maxLen) {
|
|
|
250
250
|
const visLen = getVisualLength(clean);
|
|
251
251
|
if (visLen <= maxLen) return clean;
|
|
252
252
|
|
|
253
|
-
|
|
253
|
+
// Pre-truncate if clean is significantly longer than maxLen to avoid O(N^2) loop on large strings
|
|
254
|
+
let truncated = clean.length > maxLen + 8 ? clean.slice(0, maxLen + 8) : clean;
|
|
254
255
|
while (getVisualLength(truncated + '...') > maxLen && truncated.length > 0) {
|
|
255
256
|
const lastChar = truncated.charCodeAt(truncated.length - 1);
|
|
256
257
|
if (lastChar >= 0xDC00 && lastChar <= 0xDFFF && truncated.length > 1) {
|
|
@@ -283,10 +284,13 @@ function stripAnsi(str) {
|
|
|
283
284
|
function computeTableWidths(headers, rows, options = {}) {
|
|
284
285
|
const { minWidths = [], maxWidths = [] } = options;
|
|
285
286
|
return headers.map((header, colIdx) => {
|
|
287
|
+
const maxBound = maxWidths[colIdx] != null ? maxWidths[colIdx] * 2 : Infinity;
|
|
286
288
|
let max = getVisualLength(stripAnsi(header));
|
|
287
289
|
rows.forEach((row) => {
|
|
288
290
|
const cell = row[colIdx] != null ? row[colIdx] : '';
|
|
289
|
-
|
|
291
|
+
const cellStr = stripAnsi(cell);
|
|
292
|
+
const boundedCell = cellStr.length > maxBound ? cellStr.slice(0, maxBound) : cellStr;
|
|
293
|
+
max = Math.max(max, getVisualLength(boundedCell));
|
|
290
294
|
});
|
|
291
295
|
if (minWidths[colIdx] != null) max = Math.max(max, minWidths[colIdx]);
|
|
292
296
|
if (maxWidths[colIdx] != null) max = Math.min(max, maxWidths[colIdx]);
|
|
@@ -794,8 +798,20 @@ async function cmdAgentModels(subArgs) {
|
|
|
794
798
|
return;
|
|
795
799
|
}
|
|
796
800
|
|
|
797
|
-
// Non-TTY: print current assignments + guidance
|
|
798
|
-
|
|
801
|
+
// Non-TTY / Non-interactive: print current assignments + guidance
|
|
802
|
+
const isPlainModels = subArgs.includes('--plain') || subArgs.includes('--table') || subArgs.includes('--no-tui');
|
|
803
|
+
const isInteractiveModels = Boolean(
|
|
804
|
+
process.stdin &&
|
|
805
|
+
process.stdin.isTTY &&
|
|
806
|
+
process.stdout &&
|
|
807
|
+
process.stdout.isTTY &&
|
|
808
|
+
typeof process.stdin.setRawMode === 'function' &&
|
|
809
|
+
!isPlainModels &&
|
|
810
|
+
!process.env.CI &&
|
|
811
|
+
!process.env.NON_INTERACTIVE
|
|
812
|
+
);
|
|
813
|
+
|
|
814
|
+
if (!isInteractiveModels) {
|
|
799
815
|
header('Subagent Model Assignments');
|
|
800
816
|
const headers = ['Subagent', 'Title', 'Current Model'];
|
|
801
817
|
const rows = (targetAgent ? [targetAgent] : agents).map(a => [
|
|
@@ -4262,7 +4278,9 @@ async function cmdStatus(args = []) {
|
|
|
4262
4278
|
agents.forEach(a => {
|
|
4263
4279
|
const icon = a.icon || iconMap[a.name] || '👤';
|
|
4264
4280
|
const displayName = `${icon} ${a.name.charAt(0).toUpperCase() + a.name.slice(1)}`;
|
|
4265
|
-
const activeSkills = a.skills && a.skills.length > 0
|
|
4281
|
+
const activeSkills = a.skills && a.skills.length > 0
|
|
4282
|
+
? (a.skills.length > 6 ? `${a.skills.slice(0, 6).join(', ')} (+${a.skills.length - 6} more)` : a.skills.join(', '))
|
|
4283
|
+
: 'None';
|
|
4266
4284
|
|
|
4267
4285
|
subRows.push([displayName, activeSkills]);
|
|
4268
4286
|
subRowColors.push(['', '']);
|
|
@@ -6204,7 +6222,10 @@ async function cmdAgent(args) {
|
|
|
6204
6222
|
break;
|
|
6205
6223
|
}
|
|
6206
6224
|
|
|
6207
|
-
|
|
6225
|
+
const wantsTui = (subArgs.includes('--tui') || subArgs.includes('--interactive') || subArgs.includes('-i')) &&
|
|
6226
|
+
process.stdin && process.stdin.isTTY && process.stdout && process.stdout.isTTY && typeof process.stdin.setRawMode === 'function';
|
|
6227
|
+
|
|
6228
|
+
if (!wantsTui) {
|
|
6208
6229
|
header('Subagents List');
|
|
6209
6230
|
const headers = ['Subagent', 'Title', 'Active Skills'];
|
|
6210
6231
|
const aligns = ['left', 'left', 'left'];
|
|
@@ -7057,33 +7078,39 @@ ${C.bold}USAGE${C.reset}
|
|
|
7057
7078
|
konoha <command> [options]
|
|
7058
7079
|
|
|
7059
7080
|
${C.bold}CORE COMMANDS${C.reset}
|
|
7060
|
-
${C.cyan}init${C.reset}
|
|
7061
|
-
${C.cyan}migrate${C.reset}
|
|
7062
|
-
${C.cyan}embed${C.reset}
|
|
7063
|
-
${C.cyan}test${C.reset}
|
|
7064
|
-
${C.cyan}status${C.reset}
|
|
7065
|
-
${C.cyan}version${C.reset} ✨ Display current version and check for updates from npm registry.
|
|
7066
|
-
${C.cyan}upgrade${C.reset}
|
|
7067
|
-
${C.cyan}savings${C.reset}
|
|
7068
|
-
${C.cyan}
|
|
7069
|
-
${C.cyan}
|
|
7070
|
-
${C.cyan}
|
|
7071
|
-
${C.cyan}
|
|
7072
|
-
${C.cyan}
|
|
7073
|
-
${C.cyan}
|
|
7074
|
-
${C.cyan}
|
|
7075
|
-
${C.cyan}
|
|
7076
|
-
${C.cyan}
|
|
7077
|
-
${C.cyan}
|
|
7081
|
+
${C.cyan}init, setup${C.reset} 🚀 Setup MCP servers, migrate local skills, and configure supported clients.
|
|
7082
|
+
${C.cyan}migrate${C.reset} 🔄 Re-index/migrate your custom skills database (run after editing skills).
|
|
7083
|
+
${C.cyan}embed${C.reset} ⚡ Rebuild vector embeddings for all skills (hybrid search & neural RAG).
|
|
7084
|
+
${C.cyan}test${C.reset} 🧪 Perform verification tests on the MCP server.
|
|
7085
|
+
${C.cyan}status${C.reset} 🩺 Check installation health, database size, and loaded skills.
|
|
7086
|
+
${C.cyan}version, -v${C.reset} ✨ Display current version and check for updates from npm registry.
|
|
7087
|
+
${C.cyan}upgrade, update${C.reset} 🔄 Upgrade Konoha CLI to the latest version from npm registry.
|
|
7088
|
+
${C.cyan}savings, saving${C.reset} 📊 View your total token savings (Today, 7 days, All time).
|
|
7089
|
+
${C.cyan}detect-ai${C.reset} 🛡️ Scan website URL or project files for AI fingerprints (Human-Built Index).
|
|
7090
|
+
${C.cyan}detect-docs${C.reset} 📄 Scan prose documents or text for AI generation markers (ZeroGPT defense).
|
|
7091
|
+
${C.cyan}project, context${C.reset} 📁 Manage persistent project workspaces, detected stacks, and invariants.
|
|
7092
|
+
${C.cyan}task, sdlc${C.reset} 📋 Native SDLC governance tasks, readiness gates, and audits.
|
|
7093
|
+
${C.cyan}data, persona${C.reset} 🧠 Manage SQLite active session history, persona memories, and database size.
|
|
7094
|
+
${C.cyan}soul${C.reset} 🔥 Display Village Soul / Will of Fire doctrine, tenets, and archetype spirits.
|
|
7095
|
+
${C.cyan}doctor${C.reset} 🩺 Run environment diagnostics to detect/fix integration issues.
|
|
7096
|
+
${C.cyan}bridge${C.reset} 🌉 Manage Konoha Bridge Router (status, list, create, delete, enable, disable).
|
|
7097
|
+
${C.cyan}search, searxng${C.reset} 🔍 Zero-API-key multi-source web search (SearXNG, DuckDuckGo, Wikipedia).
|
|
7098
|
+
${C.cyan}ui, web${C.reset} 🌐 Manage local Web Configuration UI (start, stop, restart, status; port 1404).
|
|
7099
|
+
${C.cyan}service${C.reset} ⚙️ Manage background system daemon service (systemd / launchd) for Web UI.
|
|
7100
|
+
${C.cyan}telegram, tg${C.reset} ✈️ Manage Telegram bot task reporting and two-way remote prompting.
|
|
7101
|
+
${C.cyan}tunnel, tunnels${C.reset} 🚇 Manage Cloudflare and ngrok public ingress tunnels.
|
|
7102
|
+
${C.cyan}clean, prune${C.reset} 🧹 Clean stale backups, dead PIDs, and reclaim disk space in ~/.konoha.
|
|
7103
|
+
${C.cyan}uninstall${C.reset} 🗑️ Safely remove Konoha MCP server (leaves custom skill files intact).
|
|
7078
7104
|
|
|
7079
7105
|
${C.bold}SUBAGENT & SKILL MANAGEMENT COMMANDS${C.reset}
|
|
7080
|
-
${C.cyan}skill${C.reset}
|
|
7081
|
-
${C.cyan}agent${C.reset}
|
|
7082
|
-
${C.cyan}help${C.reset} ❓ Show this educational help menu.
|
|
7106
|
+
${C.cyan}skill${C.reset} 📚 Manage skills (list installed, search the public registry, add/remove).
|
|
7107
|
+
${C.cyan}agent, agents${C.reset} 👤 Configure Ninja subagents (list, create, toggle skills, models config, delete, status).
|
|
7108
|
+
${C.cyan}help, -h${C.reset} ❓ Show this educational help menu.
|
|
7083
7109
|
|
|
7084
7110
|
${C.bold}GLOBAL OPTIONS${C.reset}
|
|
7085
|
-
${C.dim}--force${C.reset}
|
|
7086
|
-
${C.dim}--skills-dir${C.reset}
|
|
7111
|
+
${C.dim}--force${C.reset} Force clean re-installation (used with init).
|
|
7112
|
+
${C.dim}--skills-dir${C.reset} Specify a custom directory to scan for skill folders (used with migrate).
|
|
7113
|
+
${C.dim}--clean${C.reset} Clean stale records before re-indexing (used with migrate).
|
|
7087
7114
|
|
|
7088
7115
|
${C.bold}QUICK-START EXAMPLES FOR BEGINNERS${C.reset}
|
|
7089
7116
|
${C.dim}1. Setup everything for the first time:${C.reset}
|
|
@@ -7095,18 +7122,29 @@ ${C.bold}QUICK-START EXAMPLES FOR BEGINNERS${C.reset}
|
|
|
7095
7122
|
${C.dim}3. Verify MCP server connection:${C.reset}
|
|
7096
7123
|
konoha test
|
|
7097
7124
|
|
|
7098
|
-
${C.dim}4. Search for a custom skill
|
|
7125
|
+
${C.dim}4. Search for a custom skill on the registry and install it:${C.reset}
|
|
7099
7126
|
konoha skill search golang
|
|
7100
7127
|
|
|
7101
|
-
${C.dim}5. Interactively
|
|
7128
|
+
${C.dim}5. Interactively configure subagent skills:${C.reset}
|
|
7102
7129
|
konoha agent skill genin
|
|
7103
7130
|
|
|
7104
|
-
${C.dim}6. View
|
|
7131
|
+
${C.dim}6. View byte-weighted token savings metrics:${C.reset}
|
|
7105
7132
|
konoha savings
|
|
7106
7133
|
|
|
7107
|
-
${C.dim}
|
|
7134
|
+
${C.dim}7. Inspect database storage and session history:${C.reset}
|
|
7108
7135
|
konoha data view
|
|
7109
7136
|
|
|
7137
|
+
${C.dim}8. Scan a website or document for AI markers:${C.reset}
|
|
7138
|
+
konoha detect-ai https://example.com
|
|
7139
|
+
konoha detect-docs report.pdf
|
|
7140
|
+
|
|
7141
|
+
${C.dim}9. Configure Telegram remote task notifications:${C.reset}
|
|
7142
|
+
konoha telegram config --token <BOT_TOKEN> --chat-id <CHAT_ID>
|
|
7143
|
+
konoha telegram test
|
|
7144
|
+
|
|
7145
|
+
${C.dim}10. Start Cloudflare public tunnel for remote Web UI access:${C.reset}
|
|
7146
|
+
konoha tunnel start
|
|
7147
|
+
|
|
7110
7148
|
`);
|
|
7111
7149
|
}
|
|
7112
7150
|
|
|
@@ -8819,6 +8857,320 @@ async function cmdSearch(args = []) {
|
|
|
8819
8857
|
}
|
|
8820
8858
|
}
|
|
8821
8859
|
|
|
8860
|
+
async function cmdTelegram(args) {
|
|
8861
|
+
const sub = args[0] || 'status';
|
|
8862
|
+
const subArgs = args.slice(1);
|
|
8863
|
+
const tgConfig = require('../src/telegram/config');
|
|
8864
|
+
const tgNotifier = require('../src/telegram/notifier');
|
|
8865
|
+
const tgPoller = require('../src/telegram/poller');
|
|
8866
|
+
|
|
8867
|
+
if (sub === 'help' || sub === '--help' || sub === '-h') {
|
|
8868
|
+
info('Usage: konoha telegram <command>');
|
|
8869
|
+
info('Commands:');
|
|
8870
|
+
info(' status Show current Telegram integration status');
|
|
8871
|
+
info(' config [options] Configure bot token, chat ID, and mode');
|
|
8872
|
+
info(' --token <bot_token> Set Telegram Bot API token');
|
|
8873
|
+
info(' --chat-id <id> Set authorized recipient chat ID');
|
|
8874
|
+
info(' --mode <one_way|two_way> Set operating mode (one_way or two_way)');
|
|
8875
|
+
info(' test Send an immediate verification test message');
|
|
8876
|
+
info(' enable Enable Telegram notifications');
|
|
8877
|
+
info(' disable Disable Telegram notifications');
|
|
8878
|
+
info(' start-poller Start Two-Way inbound polling listener');
|
|
8879
|
+
info(' stop-poller Stop inbound polling listener');
|
|
8880
|
+
return;
|
|
8881
|
+
}
|
|
8882
|
+
|
|
8883
|
+
if (sub === 'status') {
|
|
8884
|
+
const cfg = tgConfig.getTelegramConfig();
|
|
8885
|
+
header('Telegram Bot Integration Status');
|
|
8886
|
+
info(`Enabled: ${cfg.enabled ? 'Yes [ACTIVE]' : 'No [DISABLED]'}`);
|
|
8887
|
+
info(`Mode: ${cfg.mode === 'two_way' ? 'Two-Way (Alerts + Inbound Prompting)' : 'One-Way (Alerts Only)'}`);
|
|
8888
|
+
info(`Transport: ${cfg.transport}`);
|
|
8889
|
+
info(`Bot Token: ${cfg.bot_token ? `${cfg.bot_token.slice(0, 10)}...` : '(not configured)'}`);
|
|
8890
|
+
info(`Chat ID: ${cfg.chat_id || '(not configured)'}`);
|
|
8891
|
+
info(`Poller: ${tgPoller.isPollerRunning() ? 'Running' : 'Stopped'}`);
|
|
8892
|
+
info(`Last Notified: ${cfg.last_notified_at || 'Never'}`);
|
|
8893
|
+
return;
|
|
8894
|
+
}
|
|
8895
|
+
|
|
8896
|
+
if (sub === 'config' || sub === 'edit') {
|
|
8897
|
+
let token = undefined;
|
|
8898
|
+
let chatId = undefined;
|
|
8899
|
+
let mode = undefined;
|
|
8900
|
+
let transport = undefined;
|
|
8901
|
+
let enableFlag = undefined;
|
|
8902
|
+
|
|
8903
|
+
for (let i = 0; i < subArgs.length; i++) {
|
|
8904
|
+
if ((subArgs[i] === '--token' || subArgs[i] === '-t') && subArgs[i + 1]) {
|
|
8905
|
+
token = subArgs[++i];
|
|
8906
|
+
} else if ((subArgs[i] === '--chat-id' || subArgs[i] === '-c') && subArgs[i + 1]) {
|
|
8907
|
+
chatId = subArgs[++i];
|
|
8908
|
+
} else if ((subArgs[i] === '--mode' || subArgs[i] === '-m') && subArgs[i + 1]) {
|
|
8909
|
+
mode = subArgs[++i];
|
|
8910
|
+
} else if (subArgs[i] === '--transport' && subArgs[i + 1]) {
|
|
8911
|
+
transport = subArgs[++i];
|
|
8912
|
+
} else if (subArgs[i] === '--enable') {
|
|
8913
|
+
enableFlag = true;
|
|
8914
|
+
} else if (subArgs[i] === '--disable') {
|
|
8915
|
+
enableFlag = false;
|
|
8916
|
+
}
|
|
8917
|
+
}
|
|
8918
|
+
|
|
8919
|
+
const updated = tgConfig.saveTelegramConfig({
|
|
8920
|
+
bot_token: token,
|
|
8921
|
+
chat_id: chatId,
|
|
8922
|
+
mode: mode,
|
|
8923
|
+
transport: transport,
|
|
8924
|
+
enabled: enableFlag
|
|
8925
|
+
});
|
|
8926
|
+
|
|
8927
|
+
success('Telegram configuration updated successfully.');
|
|
8928
|
+
info(`Mode: ${updated.mode} | Enabled: ${updated.enabled ? 'Yes' : 'No'} | Chat ID: ${updated.chat_id || '(none)'}`);
|
|
8929
|
+
return;
|
|
8930
|
+
}
|
|
8931
|
+
|
|
8932
|
+
if (sub === 'enable') {
|
|
8933
|
+
tgConfig.setTelegramEnabled(true);
|
|
8934
|
+
success('Telegram integration enabled.');
|
|
8935
|
+
return;
|
|
8936
|
+
}
|
|
8937
|
+
|
|
8938
|
+
if (sub === 'disable') {
|
|
8939
|
+
tgConfig.setTelegramEnabled(false);
|
|
8940
|
+
tgPoller.stopPoller();
|
|
8941
|
+
success('Telegram integration disabled.');
|
|
8942
|
+
return;
|
|
8943
|
+
}
|
|
8944
|
+
|
|
8945
|
+
if (sub === 'test') {
|
|
8946
|
+
info('Dispatching test notification to configured Telegram chat...');
|
|
8947
|
+
const res = await tgNotifier.sendTestPing();
|
|
8948
|
+
if (res.ok) {
|
|
8949
|
+
success('Test message sent successfully! Check your Telegram chat.');
|
|
8950
|
+
} else {
|
|
8951
|
+
error(`Failed to send test message: ${res.error || 'Unknown error'}`);
|
|
8952
|
+
}
|
|
8953
|
+
return;
|
|
8954
|
+
}
|
|
8955
|
+
|
|
8956
|
+
if (sub === 'notify-kage' || sub === 'test-gate') {
|
|
8957
|
+
info('Dispatching Kage final gate review notification to Telegram...');
|
|
8958
|
+
const summaryArg = subArgs.join(' ') || 'Kage Review Gate verified: APPROVED (100% confidence, 0 AI slop findings).';
|
|
8959
|
+
const res = await tgNotifier.notifyKageReviewPassed({
|
|
8960
|
+
title: 'Kage Final Gate Review: APPROVED',
|
|
8961
|
+
summary: summaryArg,
|
|
8962
|
+
kageScore: 100,
|
|
8963
|
+
slopFindings: 0
|
|
8964
|
+
});
|
|
8965
|
+
if (res.ok) {
|
|
8966
|
+
success('Kage review gate notification delivered to Telegram!');
|
|
8967
|
+
} else {
|
|
8968
|
+
error(`Failed to send gate notification: ${res.error || 'Unknown error'}`);
|
|
8969
|
+
}
|
|
8970
|
+
return;
|
|
8971
|
+
}
|
|
8972
|
+
|
|
8973
|
+
if (sub === 'start-poller') {
|
|
8974
|
+
tgPoller.startPoller();
|
|
8975
|
+
success('Telegram polling listener started.');
|
|
8976
|
+
return;
|
|
8977
|
+
}
|
|
8978
|
+
|
|
8979
|
+
if (sub === 'stop-poller') {
|
|
8980
|
+
tgPoller.stopPoller();
|
|
8981
|
+
success('Telegram polling listener stopped.');
|
|
8982
|
+
return;
|
|
8983
|
+
}
|
|
8984
|
+
|
|
8985
|
+
error(`Unknown telegram command: ${sub}. Run "konoha telegram help" for usage.`);
|
|
8986
|
+
}
|
|
8987
|
+
|
|
8988
|
+
async function cmdTunnel(args) {
|
|
8989
|
+
const sub = args[0] || 'status';
|
|
8990
|
+
const subArgs = args.slice(1);
|
|
8991
|
+
const tunnelMgr = require('../src/tunnel/manager');
|
|
8992
|
+
const tunnelCfg = require('../src/tunnel/config');
|
|
8993
|
+
|
|
8994
|
+
if (sub === 'help' || sub === '--help' || sub === '-h') {
|
|
8995
|
+
info('Usage: konoha tunnel <command>');
|
|
8996
|
+
info('Commands:');
|
|
8997
|
+
info(' status Show active tunnel status and public URL');
|
|
8998
|
+
info(' start [options] Start public ingress tunnel (default: cloudflare)');
|
|
8999
|
+
info(' --token <token> Cloudflare Tunnel token (run via cloudflared tunnel run --token <token>)');
|
|
9000
|
+
info(' --provider <cf|ngrok> Select provider (cloudflare or ngrok)');
|
|
9001
|
+
info(' --port <port> Target local port (default: 1404)');
|
|
9002
|
+
info(' --domain <domain> Named custom domain');
|
|
9003
|
+
info(' --pin <pin> Optional security PIN');
|
|
9004
|
+
info(' stop Stop active ingress tunnel');
|
|
9005
|
+
info(' config [options] Configure tunnel options');
|
|
9006
|
+
info(' --token <token> Set default tunnel token');
|
|
9007
|
+
return;
|
|
9008
|
+
}
|
|
9009
|
+
|
|
9010
|
+
if (sub === 'status') {
|
|
9011
|
+
const status = tunnelMgr.getTunnelStatus();
|
|
9012
|
+
header('Public Ingress Tunnel Status');
|
|
9013
|
+
info(`Status: ${status.enabled ? 'Active [CONNECTED]' : 'Inactive [STOPPED]'}`);
|
|
9014
|
+
info(`Provider: ${status.provider}`);
|
|
9015
|
+
info(`Public URL: ${status.public_url || '(none)'}`);
|
|
9016
|
+
info(`PID: ${status.active_pid || 0}`);
|
|
9017
|
+
return;
|
|
9018
|
+
}
|
|
9019
|
+
|
|
9020
|
+
if (sub === 'start') {
|
|
9021
|
+
let provider = 'cloudflare';
|
|
9022
|
+
let port = 1404;
|
|
9023
|
+
let customDomain = undefined;
|
|
9024
|
+
let pin = undefined;
|
|
9025
|
+
let token = undefined;
|
|
9026
|
+
|
|
9027
|
+
for (let i = 0; i < subArgs.length; i++) {
|
|
9028
|
+
if ((subArgs[i] === '--provider' || subArgs[i] === '-p') && subArgs[i + 1]) {
|
|
9029
|
+
provider = subArgs[++i];
|
|
9030
|
+
} else if (subArgs[i] === '--port' && subArgs[i + 1]) {
|
|
9031
|
+
port = parseInt(subArgs[++i], 10) || 1404;
|
|
9032
|
+
} else if (subArgs[i] === '--domain' && subArgs[i + 1]) {
|
|
9033
|
+
customDomain = subArgs[++i];
|
|
9034
|
+
} else if (subArgs[i] === '--pin' && subArgs[i + 1]) {
|
|
9035
|
+
pin = subArgs[++i];
|
|
9036
|
+
} else if ((subArgs[i] === '--token' || subArgs[i] === '-t') && subArgs[i + 1]) {
|
|
9037
|
+
token = subArgs[++i];
|
|
9038
|
+
}
|
|
9039
|
+
}
|
|
9040
|
+
|
|
9041
|
+
if (customDomain || pin || token) {
|
|
9042
|
+
tunnelCfg.saveTunnelConfig({
|
|
9043
|
+
custom_domain: customDomain,
|
|
9044
|
+
auth_pin: pin,
|
|
9045
|
+
token: token
|
|
9046
|
+
});
|
|
9047
|
+
}
|
|
9048
|
+
|
|
9049
|
+
info(`Starting ${provider} tunnel...`);
|
|
9050
|
+
try {
|
|
9051
|
+
const res = await tunnelMgr.startTunnel({ provider, port, token, domain: customDomain });
|
|
9052
|
+
success('Tunnel established successfully!');
|
|
9053
|
+
if (res.public_url) {
|
|
9054
|
+
info(`Public URL: ${res.public_url}`);
|
|
9055
|
+
}
|
|
9056
|
+
} catch (err) {
|
|
9057
|
+
error(`Failed to start tunnel: ${err.message}`);
|
|
9058
|
+
}
|
|
9059
|
+
return;
|
|
9060
|
+
}
|
|
9061
|
+
|
|
9062
|
+
if (sub === 'stop') {
|
|
9063
|
+
tunnelMgr.stopTunnel();
|
|
9064
|
+
success('Tunnel stopped.');
|
|
9065
|
+
return;
|
|
9066
|
+
}
|
|
9067
|
+
|
|
9068
|
+
if (sub === 'config') {
|
|
9069
|
+
let provider = undefined;
|
|
9070
|
+
let customDomain = undefined;
|
|
9071
|
+
let pin = undefined;
|
|
9072
|
+
let token = undefined;
|
|
9073
|
+
|
|
9074
|
+
for (let i = 0; i < subArgs.length; i++) {
|
|
9075
|
+
if (subArgs[i] === '--provider' && subArgs[i + 1]) provider = subArgs[++i];
|
|
9076
|
+
else if (subArgs[i] === '--domain' && subArgs[i + 1]) customDomain = subArgs[++i];
|
|
9077
|
+
else if (subArgs[i] === '--pin' && subArgs[i + 1]) pin = subArgs[++i];
|
|
9078
|
+
else if (subArgs[i] === '--token' && subArgs[i + 1]) token = subArgs[++i];
|
|
9079
|
+
}
|
|
9080
|
+
|
|
9081
|
+
tunnelCfg.saveTunnelConfig({
|
|
9082
|
+
provider,
|
|
9083
|
+
custom_domain: customDomain,
|
|
9084
|
+
auth_pin: pin,
|
|
9085
|
+
token
|
|
9086
|
+
});
|
|
9087
|
+
success('Tunnel configuration updated.');
|
|
9088
|
+
return;
|
|
9089
|
+
}
|
|
9090
|
+
|
|
9091
|
+
error(`Unknown tunnel command: ${sub}. Run "konoha tunnel help" for usage.`);
|
|
9092
|
+
}
|
|
9093
|
+
|
|
9094
|
+
async function cmdQueue(args) {
|
|
9095
|
+
const sub = args[0] || 'list';
|
|
9096
|
+
const inbox = require('../src/queue/inbox');
|
|
9097
|
+
|
|
9098
|
+
if (sub === 'help' || sub === '--help' || sub === '-h') {
|
|
9099
|
+
info('Usage: konoha queue <command>');
|
|
9100
|
+
info('Commands:');
|
|
9101
|
+
info(' list List recent prompt queue tasks');
|
|
9102
|
+
info(' next Print next pending prompt for execution');
|
|
9103
|
+
info(' run Process and execute next pending prompt');
|
|
9104
|
+
info(' start-worker Run autonomous background queue worker');
|
|
9105
|
+
info(' complete <id> [summary] Mark prompt task as completed');
|
|
9106
|
+
info(' cancel <id> Cancel a pending task');
|
|
9107
|
+
return;
|
|
9108
|
+
}
|
|
9109
|
+
|
|
9110
|
+
if (sub === 'run') {
|
|
9111
|
+
const worker = require('../src/queue/worker');
|
|
9112
|
+
await worker.pollAndExecute();
|
|
9113
|
+
success('Queue execution tick finished.');
|
|
9114
|
+
return;
|
|
9115
|
+
}
|
|
9116
|
+
|
|
9117
|
+
if (sub === 'start-worker') {
|
|
9118
|
+
const worker = require('../src/queue/worker');
|
|
9119
|
+
worker.startWorker();
|
|
9120
|
+
success('Autonomous queue worker started. Press Ctrl+C to exit.');
|
|
9121
|
+
return;
|
|
9122
|
+
}
|
|
9123
|
+
|
|
9124
|
+
if (sub === 'list') {
|
|
9125
|
+
const prompts = inbox.listPrompts({ limit: 20 });
|
|
9126
|
+
header('Inbound Prompt Queue');
|
|
9127
|
+
if (prompts.length === 0) {
|
|
9128
|
+
info('No prompts in queue.');
|
|
9129
|
+
return;
|
|
9130
|
+
}
|
|
9131
|
+
prompts.forEach(p => {
|
|
9132
|
+
const statusColor = p.status === 'completed' ? C.green : (p.status === 'pending' ? C.yellow : C.red);
|
|
9133
|
+
log(` ${C.cyan}${p.id}${C.reset} [${statusColor}${p.status.toUpperCase()}${C.reset}] (${p.source}): ${p.prompt.slice(0, 60)}...`);
|
|
9134
|
+
});
|
|
9135
|
+
return;
|
|
9136
|
+
}
|
|
9137
|
+
|
|
9138
|
+
if (sub === 'next') {
|
|
9139
|
+
const next = inbox.getNextPendingPrompt();
|
|
9140
|
+
if (!next) {
|
|
9141
|
+
info('No pending prompts in queue.');
|
|
9142
|
+
return;
|
|
9143
|
+
}
|
|
9144
|
+
log(JSON.stringify(next, null, 2));
|
|
9145
|
+
return;
|
|
9146
|
+
}
|
|
9147
|
+
|
|
9148
|
+
if (sub === 'complete') {
|
|
9149
|
+
const id = args[1];
|
|
9150
|
+
if (!id) {
|
|
9151
|
+
error('Usage: konoha queue complete <task_id> [result_summary]');
|
|
9152
|
+
return;
|
|
9153
|
+
}
|
|
9154
|
+
const summary = args.slice(2).join(' ') || 'Completed via CLI';
|
|
9155
|
+
inbox.completePrompt(id, { status: 'completed', result_summary: summary });
|
|
9156
|
+
success(`Task ${id} marked as completed.`);
|
|
9157
|
+
return;
|
|
9158
|
+
}
|
|
9159
|
+
|
|
9160
|
+
if (sub === 'cancel') {
|
|
9161
|
+
const id = args[1];
|
|
9162
|
+
if (!id) {
|
|
9163
|
+
error('Usage: konoha queue cancel <task_id>');
|
|
9164
|
+
return;
|
|
9165
|
+
}
|
|
9166
|
+
inbox.completePrompt(id, { status: 'cancelled', result_summary: 'Cancelled via CLI' });
|
|
9167
|
+
success(`Task ${id} cancelled.`);
|
|
9168
|
+
return;
|
|
9169
|
+
}
|
|
9170
|
+
|
|
9171
|
+
error(`Unknown queue command: ${sub}. Run "konoha queue help" for usage.`);
|
|
9172
|
+
}
|
|
9173
|
+
|
|
8822
9174
|
// ─── Main ────────────────────────────────────────────────────────────────────
|
|
8823
9175
|
|
|
8824
9176
|
const command = process.argv[2];
|
|
@@ -8952,6 +9304,18 @@ async function main() {
|
|
|
8952
9304
|
case 'web-search':
|
|
8953
9305
|
await cmdSearch(args);
|
|
8954
9306
|
break;
|
|
9307
|
+
case 'telegram':
|
|
9308
|
+
case 'tg':
|
|
9309
|
+
await cmdTelegram(args);
|
|
9310
|
+
break;
|
|
9311
|
+
case 'tunnel':
|
|
9312
|
+
case 'tunnels':
|
|
9313
|
+
await cmdTunnel(args);
|
|
9314
|
+
break;
|
|
9315
|
+
case 'queue':
|
|
9316
|
+
case 'inbox':
|
|
9317
|
+
await cmdQueue(args);
|
|
9318
|
+
break;
|
|
8955
9319
|
case 'help':
|
|
8956
9320
|
case '--help':
|
|
8957
9321
|
case '-h':
|