konoha-mcp 2.1.15 → 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 +165 -0
- package/.agents/skills/konoha/SKILL.md +32 -3
- package/.agents/skills.fingerprint +1 -1
- package/README.md +188 -221
- 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.BuH1S-Sa.js +2 -0
- 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/persona/_page.svelte.js +16 -9
- package/apps/web/build/server/entries/pages/persona/_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 +465 -32
- package/docs/ALL-WORKFLOW-DIAGRAMS.md +135 -0
- package/docs/ARCHITECTURE.md +28 -6
- package/docs/BENCHMARK.md +55 -26
- package/docs/CLOUDFLARE_TUNNEL_GUIDE.md +119 -0
- package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.16_2026-10-08.md +69 -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/TROUBLESHOOTING.md +2 -2
- package/docs/architecture/CANONICAL-API.md +4 -1
- package/docs/architecture/TOKEN-BASELINE.md +6 -6
- 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/canonical_skills.js +2 -0
- package/src/crypto_vault.js +157 -0
- package/src/db.js +186 -65
- package/src/db_agents.js +1 -1
- package/src/deploy_utils.js +4 -3
- package/src/file_tools_router.js +2 -1
- package/src/mcp/memory_reporting.js +19 -0
- package/src/mcp/skills.js +17 -15
- package/src/mcp/tool_dispatch.js +11 -0
- package/src/mcp/workflow.js +38 -0
- package/src/mcp_tool_manifest.json +22 -0
- package/src/migrate.js +74 -6
- package/src/persona_memory.js +133 -1
- package/src/pi_manager.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 +165 -0
- package/src/templates/skills/konoha/SKILL.md +32 -3
- 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 +377 -10
- package/apps/web/build/client/_app/immutable/assets/0.CASgEURp.css +0 -2
- package/apps/web/build/client/_app/immutable/assets/0.CASgEURp.css.br +0 -0
- package/apps/web/build/client/_app/immutable/assets/0.CASgEURp.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.BDzkoHRK.js +0 -2
- package/apps/web/build/client/_app/immutable/entry/app.BDzkoHRK.js.br +0 -0
- package/apps/web/build/client/_app/immutable/entry/app.BDzkoHRK.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.u4hg-Zwy.js +0 -2
- package/apps/web/build/client/_app/immutable/nodes/0.u4hg-Zwy.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/0.u4hg-Zwy.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.DFglFW_i.js +0 -1
- package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js.br +0 -0
- package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.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.CASgEURp.css +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","names":[],"sources":["../../../src/lib/api.js"],"sourcesContent":["// Client API helper with CSRF token support.\n// Token delivery: HttpOnly cookie (server-set) + GET /api/v1/csrf (same-origin).\n// Never read from HTML meta tags or document.cookie — the token must not be\n// present in page source, and the cookie is HttpOnly by design.\nlet memoryToken = '';\n\nfunction getToken() {\n return memoryToken;\n}\n\nexport async function initToken() {\n if (typeof window === 'undefined') return '';\n try {\n const csrfRes = await fetch('/api/v1/csrf');\n if (csrfRes.ok) {\n const csrfData = await csrfRes.json();\n if (csrfData && csrfData.token) {\n memoryToken = csrfData.token;\n return memoryToken;\n }\n }\n } catch (_) {\n // CSRF fetch failed — leave token empty; request will fail with 403 and retry\n }\n return getToken();\n}\n\nexport async function apiRequest(endpoint, options = {}) {\n let token = getToken();\n const method = (options.method || 'GET').toUpperCase();\n const isMutating = ['POST', 'PUT', 'PATCH', 'DELETE'].includes(method);\n\n if (!token && isMutating) {\n token = await initToken();\n }\n\n const headers = {\n 'Content-Type': 'application/json',\n ...(token ? { 'X-Konoha-Web-Token': token } : {}),\n ...(options.headers)\n };\n\n let res = await fetch(endpoint, {\n ...options,\n headers\n });\n\n // Automatic retry with fresh CSRF token if 403 Forbidden received\n if (res.status === 403 && isMutating && !options._retried) {\n memoryToken = '';\n const freshToken = await initToken();\n if (freshToken) {\n const retryHeaders = {\n 'Content-Type': 'application/json',\n 'X-Konoha-Web-Token': freshToken,\n ...(options.headers)\n };\n res = await fetch(endpoint, {\n ...options,\n _retried: true,\n headers: retryHeaders\n });\n }\n }\n\n const contentType = res.headers.get('content-type') || '';\n let data;\n if (contentType.includes('application/json')) {\n data = await res.json();\n } else {\n data = await res.text();\n }\n\n if (!res.ok) {\n const errorMsg = (data && data.error) ? data.error : ('Request failed with status ' + res.status);\n throw new Error(errorMsg);\n }\n\n return data;\n}\n\nexport const api = {\n get: (url) => apiRequest(url, { method: 'GET' }),\n post: (url, body) => apiRequest(url, { method: 'POST', body: JSON.stringify(body) }),\n patch: (url, body) => apiRequest(url, { method: 'PATCH', body: JSON.stringify(body) }),\n delete: (url) => apiRequest(url, { method: 'DELETE' }),\n del: (url) => apiRequest(url, { method: 'DELETE' })\n};\n"],"mappings":";AAIA,IAAI,cAAc;AAElB,SAAS,WAAW;CAClB,OAAO;AACT;AAEA,eAAsB,YAAY;CAChC,IAAI,OAAO,WAAW,aAAa,OAAO;CAC1C,IAAI;EACF,MAAM,UAAU,MAAM,MAAM,cAAc;EAC1C,IAAI,QAAQ,IAAI;GACd,MAAM,WAAW,MAAM,QAAQ,KAAK;GACpC,IAAI,YAAY,SAAS,OAAO;IAC9B,cAAc,SAAS;IACvB,OAAO;GACT;EACF;CACF,SAAS,GAAG,CAEZ;CACA,OAAO,SAAS;AAClB;AAEA,eAAsB,WAAW,UAAU,UAAU,CAAC,GAAG;CACvD,IAAI,QAAQ,SAAS;CACrB,MAAM,UAAU,QAAQ,UAAU,MAAA,CAAO,YAAY;CACrD,MAAM,aAAa;EAAC;EAAQ;EAAO;EAAS;CAAQ,CAAC,CAAC,SAAS,MAAM;CAErE,IAAI,CAAC,SAAS,YACZ,QAAQ,MAAM,UAAU;CAG1B,MAAM,UAAU;EACd,gBAAgB;EAChB,GAAI,QAAQ,EAAE,sBAAsB,MAAM,IAAI,CAAC;EAC/C,GAAI,QAAQ;CACd;CAEA,IAAI,MAAM,MAAM,MAAM,UAAU;EAC9B,GAAG;EACH;CACF,CAAC;CAGD,IAAI,IAAI,WAAW,OAAO,cAAc,CAAC,QAAQ,UAAU;EACzD,cAAc;EACd,MAAM,aAAa,MAAM,UAAU;EACnC,IAAI,YAAY;GACd,MAAM,eAAe;IACnB,gBAAgB;IAChB,sBAAsB;IACtB,GAAI,QAAQ;GACd;GACA,MAAM,MAAM,MAAM,UAAU;IAC1B,GAAG;IACH,UAAU;IACV,SAAS;GACX,CAAC;EACH;CACF;CAEA,MAAM,cAAc,IAAI,QAAQ,IAAI,cAAc,KAAK;CACvD,IAAI;CACJ,IAAI,YAAY,SAAS,kBAAkB,GACzC,OAAO,MAAM,IAAI,KAAK;MAEtB,OAAO,MAAM,IAAI,KAAK;CAGxB,IAAI,CAAC,IAAI,IAAI;EACX,MAAM,WAAY,QAAQ,KAAK,QAAS,KAAK,QAAS,gCAAgC,IAAI;EAC1F,MAAM,IAAI,MAAM,QAAQ;CAC1B;CAEA,OAAO;AACT;AAEA,IAAa,MAAM;CACjB,MAAM,QAAQ,WAAW,KAAK,EAAE,QAAQ,MAAM,CAAC;CAC/C,OAAO,KAAK,SAAS,WAAW,KAAK;EAAE,QAAQ;EAAQ,MAAM,KAAK,UAAU,IAAI;CAAE,CAAC;CACnF,QAAQ,KAAK,SAAS,WAAW,KAAK;EAAE,QAAQ;EAAS,MAAM,KAAK,UAAU,IAAI;CAAE,CAAC;CACrF,SAAS,QAAQ,WAAW,KAAK,EAAE,QAAQ,SAAS,CAAC;CACrD,MAAM,QAAQ,WAAW,KAAK,EAAE,QAAQ,SAAS,CAAC;AACpD"}
|
|
1
|
+
{"version":3,"file":"api.js","names":[],"sources":["../../../src/lib/api.js"],"sourcesContent":["// Client API helper with CSRF token support.\n// Token delivery: HttpOnly cookie (server-set) + GET /api/v1/csrf (same-origin).\n// Never read from HTML meta tags or document.cookie — the token must not be\n// present in page source, and the cookie is HttpOnly by design.\nlet memoryToken = '';\n\nfunction getToken() {\n return memoryToken;\n}\n\nexport async function initToken() {\n if (typeof window === 'undefined') return '';\n try {\n const csrfRes = await fetch('/api/v1/csrf');\n if (csrfRes.ok) {\n const csrfData = await csrfRes.json();\n if (csrfData && csrfData.token) {\n memoryToken = csrfData.token;\n return memoryToken;\n }\n }\n } catch (_) {\n // CSRF fetch failed — leave token empty; request will fail with 403 and retry\n }\n return getToken();\n}\n\nexport async function apiRequest(endpoint, options = {}) {\n let token = getToken();\n const method = (options.method || 'GET').toUpperCase();\n const isMutating = ['POST', 'PUT', 'PATCH', 'DELETE'].includes(method);\n\n if (!token && isMutating) {\n token = await initToken();\n }\n\n const headers = {\n 'Content-Type': 'application/json',\n ...(token ? { 'X-Konoha-Web-Token': token } : {}),\n ...(options.headers)\n };\n\n let res = await fetch(endpoint, {\n ...options,\n headers\n });\n\n // Automatic retry with fresh CSRF token if 403 Forbidden received\n if (res.status === 403 && isMutating && !options._retried) {\n memoryToken = '';\n const freshToken = await initToken();\n if (freshToken) {\n const retryHeaders = {\n 'Content-Type': 'application/json',\n 'X-Konoha-Web-Token': freshToken,\n ...(options.headers)\n };\n res = await fetch(endpoint, {\n ...options,\n _retried: true,\n headers: retryHeaders\n });\n }\n }\n\n const contentType = res.headers.get('content-type') || '';\n let data;\n if (contentType.includes('application/json')) {\n data = await res.json();\n } else {\n data = await res.text();\n }\n\n if (!res.ok) {\n const errorMsg = (data && data.error) ? data.error : ('Request failed with status ' + res.status);\n throw new Error(errorMsg);\n }\n\n return data;\n}\n\nexport const api = {\n get: (url) => apiRequest(url, { method: 'GET' }),\n post: (url, body) => apiRequest(url, { method: 'POST', body: JSON.stringify(body) }),\n put: (url, body) => apiRequest(url, { method: 'PUT', body: JSON.stringify(body) }),\n patch: (url, body) => apiRequest(url, { method: 'PATCH', body: JSON.stringify(body) }),\n delete: (url) => apiRequest(url, { method: 'DELETE' }),\n del: (url) => apiRequest(url, { method: 'DELETE' })\n};\n"],"mappings":";AAIA,IAAI,cAAc;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QAAS,gCAAgC,IAAI;EAC1F,MAAM,IAAI,MAAM,QAAQ;CAC1B;CAEA,OAAO;AACT;AAEA,IAAa,MAAM;CACjB,MAAM,QAAQ,WAAW,KAAK,EAAE,QAAQ,MAAM,CAAC;CAC/C,OAAO,KAAK,SAAS,WAAW,KAAK;EAAE,QAAQ;EAAQ,MAAM,KAAK,UAAU,IAAI;CAAE,CAAC;CACnF,MAAM,KAAK,SAAS,WAAW,KAAK;EAAE,QAAQ;EAAO,MAAM,KAAK,UAAU,IAAI;CAAE,CAAC;CACjF,QAAQ,KAAK,SAAS,WAAW,KAAK;EAAE,QAAQ;EAAS,MAAM,KAAK,UAAU,IAAI;CAAE,CAAC;CACrF,SAAS,QAAQ,WAAW,KAAK,EAAE,QAAQ,SAAS,CAAC;CACrD,MAAM,QAAQ,WAAW,KAAK,EAAE,QAAQ,SAAS,CAAC;AACpD"}
|
|
@@ -248,7 +248,7 @@ function server_data_serializer(event, state) {
|
|
|
248
248
|
let promise_id = 1;
|
|
249
249
|
let max_nodes = -1;
|
|
250
250
|
const iterator = create_async_iterator();
|
|
251
|
-
const global = "
|
|
251
|
+
const global = "__sveltekit_kcrp2z";
|
|
252
252
|
/** @param {number} index */
|
|
253
253
|
function get_replacer(index) {
|
|
254
254
|
/** @param {any} thing */
|
|
@@ -1498,7 +1498,7 @@ async function render_response({ branch, fetched, page_config, status, error = n
|
|
|
1498
1498
|
"crossorigin"
|
|
1499
1499
|
]);
|
|
1500
1500
|
}
|
|
1501
|
-
const global = "
|
|
1501
|
+
const global = "__sveltekit_kcrp2z";
|
|
1502
1502
|
const { data, chunks } = data_serializer.get_data(csp);
|
|
1503
1503
|
if (page_config.ssr && page_config.csr) body += `\n\t\t\t${fetched.map((item) => serialize_data(item, resolve_opts.filterSerializedResponseHeaders, !!(state.prerendering || state.prerender_default === true))).join("\n ")}`;
|
|
1504
1504
|
if (page_config.csr && client) {
|
|
@@ -1522,7 +1522,7 @@ async function render_response({ branch, fetched, page_config, status, error = n
|
|
|
1522
1522
|
}
|
|
1523
1523
|
}
|
|
1524
1524
|
const blocks = [];
|
|
1525
|
-
const properties = [`base: ${base_expression}`, `version: ${s("
|
|
1525
|
+
const properties = [`base: ${base_expression}`, `version: ${s("1791555552654")}`];
|
|
1526
1526
|
if (assets) properties.push(`assets: ${s(assets)}`);
|
|
1527
1527
|
if (client.uses_env_dynamic_public) properties.push(`env: ${load_env_eagerly ? "null" : uneval$1(rendered_env)}`);
|
|
1528
1528
|
if (chunks) {
|
|
@@ -2017,7 +2017,7 @@ function redirect_response(status, location) {
|
|
|
2017
2017
|
* @param {Response} response
|
|
2018
2018
|
*/
|
|
2019
2019
|
function with_version_header(response) {
|
|
2020
|
-
response.headers.set("x-sveltekit-version", "
|
|
2020
|
+
response.headers.set("x-sveltekit-version", "1791555552654");
|
|
2021
2021
|
return response;
|
|
2022
2022
|
}
|
|
2023
2023
|
/**
|
|
@@ -353,6 +353,13 @@ function _layout($$renderer, $$props) {
|
|
|
353
353
|
label: "AI Detector",
|
|
354
354
|
iconSvg: "M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c.5.633 1.2 1 2 1s1.5-.367 2-1m2-3a2 2 0 100-4 2 2 0 000 4z",
|
|
355
355
|
badge: "Web & Docs"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
id: "remote",
|
|
359
|
+
path: "/remote",
|
|
360
|
+
label: "Remote Access",
|
|
361
|
+
iconSvg: "M13 10V3L4 14h7v7l9-11h-7z",
|
|
362
|
+
badge: "Telegram"
|
|
356
363
|
}
|
|
357
364
|
]
|
|
358
365
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_layout.svelte.js","names":["$.attr","$.stringify","$.escape","$.ensure_array_like","$.attr_class","$.escape","$.ensure_array_like","$.attr_style","$.attr"],"sources":["../../../../src/lib/state/themeState.svelte.js","../../../../src/components/ThemeSwitcher.svelte","../../../../src/components/SweetAlertModal.svelte","../../../../src/routes/+layout.svelte"],"sourcesContent":["/* eslint-disable no-undef */\n// Svelte 5 Runes State for Konoha 10-Theme System\n\nexport const THEMES = [\n { id: 'chidori', name: 'Chidori Azure Light', description: 'Crackling sky-blue precision with lightning focus', color: '#0284c7', accent: '#06b6d4', gradient: ['#0284c7', '#06b6d4', '#38bdf8', '#818cf8'], glow: 'rgba(2,132,199,0.12)', bg: '#f0f9ff', surface: '#ffffff', border: '#bae6fd', light: true },\n { id: 'byakugan', name: 'Byakugan Pure Light', description: 'Violet focus with 360° clarity', color: '#7c3aed', accent: '#6366f1', gradient: ['#7c3aed', '#6366f1', '#8b5cf6', '#a855f7'], glow: 'rgba(124,58,237,0.12)', bg: '#f8fafc', surface: '#ffffff', border: '#e2e8f0', light: true },\n { id: 'konoha-leaf', name: 'Konoha Emerald Light', description: 'Hidden leaf green serenity', color: '#059669', accent: '#14b8a6', gradient: ['#059669', '#10b981', '#14b8a6', '#34d399'], glow: 'rgba(5,150,105,0.12)', bg: '#f0fdf4', surface: '#ffffff', border: '#bbf7d0', light: true },\n { id: 'rasengan', name: 'Rasengan Breeze Light', description: 'Spiralling royal-blue energy', color: '#2563eb', accent: '#3b82f6', gradient: ['#1d4ed8', '#2563eb', '#3b82f6', '#60a5fa'], glow: 'rgba(37,99,235,0.12)', bg: '#eff6ff', surface: '#ffffff', border: '#bfdbfe', light: true },\n { id: 'sharingan', name: 'Sharingan Rose Light', description: 'Crimson perception, softly lit', color: '#dc2626', accent: '#f43f5e', gradient: ['#be123c', '#dc2626', '#e11d48', '#f43f5e'], glow: 'rgba(220,38,38,0.12)', bg: '#fff1f2', surface: '#ffffff', border: '#fecdd3', light: true },\n { id: 'hokage-gold', name: 'Hokage Amber Light', description: 'Warm gold of the village leader', color: '#d97706', accent: '#f59e0b', gradient: ['#b45309', '#d97706', '#f59e0b', '#fbbf24'], glow: 'rgba(217,119,6,0.12)', bg: '#fffbeb', surface: '#ffffff', border: '#fde68a', light: true },\n { id: 'anbu-shadow', name: 'Anbu Platinum Light', description: 'Cool steel-grey operative tone', color: '#475569', accent: '#64748b', gradient: ['#334155', '#475569', '#64748b', '#94a3b8'], glow: 'rgba(71,85,105,0.12)', bg: '#f8fafc', surface: '#ffffff', border: '#cbd5e1', light: true },\n { id: 'sage-mode', name: 'Sage Coral Light', description: 'Natural orange toad-sage warmth', color: '#ea580c', accent: '#f97316', gradient: ['#c2410c', '#ea580c', '#f97316', '#fb923c'], glow: 'rgba(234,88,12,0.12)', bg: '#fff7ed', surface: '#ffffff', border: '#fed7aa', light: true },\n { id: 'sound-village', name: 'Sound Orchid Light', description: 'Orchid purple with sonic depth', color: '#9333ea', accent: '#a855f7', gradient: ['#7e22ce', '#9333ea', '#a855f7', '#c084fc'], glow: 'rgba(147,51,234,0.12)', bg: '#faf5ff', surface: '#ffffff', border: '#e9d5ff', light: true },\n { id: 'akatsuki', name: 'Akatsuki Dusk Plum Light', description: 'Mysterious plum dusk with rogue ninja cloak aura', color: '#86198f', accent: '#c026d3', gradient: ['#581c87', '#701a75', '#86198f', '#c026d3'], glow: 'rgba(134,25,143,0.12)', bg: '#fdf4ff', surface: '#ffffff', border: '#f5d0fe', light: true }\n];\n\nexport function createThemeState() {\n let currentTheme = $state('chidori');\n let isModalOpen = $state(false);\n\n function applyTheme(themeId) {\n currentTheme = themeId;\n const found = THEMES.find(t => t.id === themeId) || THEMES[0];\n if (typeof document !== 'undefined') {\n document.documentElement.setAttribute('data-theme', themeId);\n document.documentElement.style.setProperty('--color-primary', found.color);\n document.documentElement.style.setProperty('--color-accent', found.accent);\n document.documentElement.style.setProperty('--color-primary-glow', found.glow);\n document.documentElement.style.setProperty('--color-bg', found.bg);\n document.documentElement.style.setProperty('--color-surface', found.surface);\n document.documentElement.style.setProperty('--color-border', found.border);\n document.documentElement.classList.add('theme-light');\n document.documentElement.classList.remove('theme-dark');\n document.documentElement.style.setProperty('--color-text', '#0f172a');\n document.documentElement.style.setProperty('--color-text-muted', '#334155');\n document.documentElement.style.setProperty('--color-card-bg', '#ffffff');\n document.documentElement.style.setProperty('--color-card-border', found.border);\n if (found.gradient && found.gradient.length >= 4) {\n document.documentElement.style.setProperty('--theme-grad-1', found.gradient[0]);\n document.documentElement.style.setProperty('--theme-grad-2', found.gradient[1]);\n document.documentElement.style.setProperty('--theme-grad-3', found.gradient[2]);\n document.documentElement.style.setProperty('--theme-grad-4', found.gradient[3]);\n document.documentElement.style.setProperty('--theme-4gradient', `linear-gradient(135deg, ${found.gradient[0]} 0%, ${found.gradient[1]} 33%, ${found.gradient[2]} 66%, ${found.gradient[3]} 100%)`);\n document.documentElement.style.setProperty('--theme-4gradient-bar', `linear-gradient(90deg, ${found.gradient[0]}, ${found.gradient[1]}, ${found.gradient[2]}, ${found.gradient[3]})`);\n document.documentElement.style.setProperty('--theme-4gradient-subtle', `linear-gradient(135deg, ${found.gradient[0]}22 0%, ${found.gradient[1]}22 33%, ${found.gradient[2]}22 66%, ${found.gradient[3]}22 100%)`);\n }\n try {\n localStorage.setItem('konoha-theme', themeId);\n } catch (_) {\n // Ignore localStorage errors in SSR or restricted environments\n }\n }\n }\n\n function init() {\n if (typeof window !== 'undefined') {\n let saved = 'chidori';\n try {\n saved = localStorage.getItem('konoha-theme') || 'chidori';\n } catch (_) {\n // Fallback to default theme if storage is unavailable\n }\n applyTheme(saved);\n }\n }\n\n return {\n get currentTheme() { return currentTheme; },\n get isModalOpen() { return isModalOpen; },\n set isModalOpen(val) { isModalOpen = val; },\n applyTheme,\n init,\n themes: THEMES\n };\n}\n\nexport const themeState = createThemeState();\n","<script>\n import { themeState, THEMES } from '../lib/state/themeState.svelte.js';\n import { useScrollLock } from '#lib/scrollLock.svelte.js';\n\n let isModalOpen = $state(false);\n\n useScrollLock(() => isModalOpen);\n\n function selectTheme(id) {\n themeState.applyTheme(id);\n isModalOpen = false;\n }\n\n function toggleModal() {\n isModalOpen = !isModalOpen;\n }\n\n function handleModalKeydown(e) {\n if (e.key === 'Escape' && isModalOpen) isModalOpen = false;\n }\n</script>\n\n<svelte:window onkeydown={handleModalKeydown} />\n\n<!-- Floating Bottom-Left Theme Switcher Button (FAB) -->\n<div class=\"fixed bottom-20 left-5 lg:bottom-6 lg:left-6 z-50\">\n <button\n type=\"button\"\n onclick={toggleModal}\n class=\"w-11 h-11 rounded-full border shadow-2xl flex items-center justify-center transition-all duration-200 hover:scale-110 active:scale-95 cursor-pointer group\"\n style=\"background-color: var(--color-surface); border-color: var(--color-border); color: var(--color-text); box-shadow: var(--shadow-3d);\"\n title=\"Switch Theme ({themeState.currentTheme.replace('-', ' ')})\"\n aria-label=\"Toggle Theme Selection Modal\"\n >\n <span\n class=\"w-4.5 h-4.5 rounded-full shadow-md transition-transform duration-200 group-hover:scale-110\"\n style=\"background: linear-gradient(135deg, var(--color-primary, #7c3aed), var(--color-accent, #6366f1));\"\n ></span>\n </button>\n</div>\n\n<!-- Shared Full Popup Modal (Fixed Center Overlay for Both Desktop & Mobile) -->\n{#if isModalOpen}\n <!-- svelte-ignore a11y_click_events_have_key_events -->\n <!-- svelte-ignore a11y_no_static_element_interactions -->\n <div\n class=\"fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-900/35 backdrop-blur-sm animate-in fade-in duration-150\"\n onclick={() => isModalOpen = false}\n >\n <!-- Centered Modal Popup Dialog -->\n <div\n class=\"modal-card w-full max-w-lg p-6 rounded-[5px] border shadow-2xl space-y-4 animate-in zoom-in-95 duration-150 glass-frost-strong\"\n style=\"background-color: var(--color-surface); border-color: var(--color-border); color: var(--color-text); box-shadow: var(--shadow-3d);\"\n onclick={(e) => e.stopPropagation()}\n >\n <!-- Header -->\n <div class=\"flex items-center justify-between pb-3 border-b\" style=\"border-color: var(--color-border);\">\n <div class=\"flex items-center gap-2.5\">\n <div class=\"w-8 h-8 rounded-[5px] flex items-center justify-center border\" style=\"background: var(--theme-4gradient, linear-gradient(135deg, var(--color-primary), var(--color-accent))); border-color: var(--color-primary); color: #ffffff;\">\n <svg class=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01\" />\n </svg>\n </div>\n <div>\n <h3 class=\"text-sm font-bold tracking-tight\" style=\"color: var(--color-text);\">Konoha 4-Gradient Theme Palette</h3>\n <p class=\"text-[11px]\" style=\"color: var(--color-text-muted);\">10 Light-Mode calibrated palettes with 4-stop vibrant gradients</p>\n </div>\n </div>\n <button\n type=\"button\"\n onclick={() => isModalOpen = false}\n class=\"w-7 h-7 rounded-[5px] flex items-center justify-center text-xs font-bold border transition-colors hover:scale-105\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text-muted);\"\n >\n ✕\n </button>\n </div>\n\n <!-- 10 Themes Grid (2 Columns) -->\n <div class=\"grid grid-cols-1 sm:grid-cols-2 gap-2.5 max-h-[60vh] overflow-y-auto pr-1\">\n {#each THEMES as t}\n {@const isCurrent = themeState.currentTheme === t.id}\n {@const gradBg = t.gradient ? `linear-gradient(135deg, ${t.gradient[0]} 0%, ${t.gradient[1]} 33%, ${t.gradient[2]} 66%, ${t.gradient[3]} 100%)` : `linear-gradient(135deg, ${t.color}, ${t.accent})`}\n <button\n type=\"button\"\n class=\"w-full flex items-center gap-3 p-3 rounded-[5px] border text-left transition-all duration-150 hover:scale-[1.02] cursor-pointer\"\n style=\"{isCurrent\n ? 'border-color: var(--color-primary); background-color: var(--color-primary-glow); box-shadow: 0 0 0 1.5px var(--color-primary);'\n : 'border-color: var(--color-border); background-color: var(--color-surface);'}\"\n onclick={() => selectTheme(t.id)}\n >\n <div class=\"relative shrink-0\">\n <span class=\"w-8 h-8 rounded-[5px] flex items-center justify-center shadow-md border border-black/10\" style=\"background: {gradBg};\">\n {#if isCurrent}\n <span class=\"w-2.5 h-2.5 rounded-full bg-white shadow-sm ring-1 ring-black/20\"></span>\n {/if}\n </span>\n </div>\n <div class=\"flex flex-col min-w-0 flex-1\">\n <div class=\"flex items-center justify-between gap-1\">\n <span class=\"text-xs font-black truncate\" style=\"color: var(--color-text);\">{t.name}</span>\n {#if isCurrent}\n <span class=\"text-[10px] font-bold px-1.5 py-0.5 rounded-[5px] border text-sky-700 dark:text-sky-300 border-sky-500/30 bg-sky-500/10 shrink-0\">Active</span>\n {/if}\n </div>\n <span class=\"text-[10px] truncate\" style=\"color: var(--color-text-muted);\">{t.description}</span>\n {#if t.gradient}\n <div class=\"flex items-center gap-1 pt-1.5\">\n {#each t.gradient as colorHex}\n <span class=\"w-2.5 h-2 rounded-[2px] shadow-xs\" style=\"background-color: {colorHex};\"></span>\n {/each}\n </div>\n {/if}\n </div>\n </button>\n {/each}\n </div>\n </div>\n </div>\n{/if}\n","<script>\n import { sweetAlert } from \"#lib/sweetAlert.svelte.js\";\n import { useScrollLock } from \"#lib/scrollLock.svelte.js\";\n\n useScrollLock(() => sweetAlert.isOpen);\n</script>\n\n<svelte:window onkeydown={(e) => { if (e.key === 'Escape' && sweetAlert.isOpen) sweetAlert.handleCancel(); }} />\n\n{#if sweetAlert.isOpen}\n <!-- svelte-ignore a11y_click_events_have_key_events -->\n <!-- svelte-ignore a11y_no_static_element_interactions -->\n <div\n class=\"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-slate-900/40 backdrop-blur-md animate-in fade-in duration-200\"\n onclick={(e) => { if (e.target === e.currentTarget) sweetAlert.handleCancel(); }}\n >\n <!-- 3D Perspective Modal Card -->\n <div\n class=\"modal-card relative w-full max-w-lg rounded-[5px] p-6 sm:p-8 border shadow-2xl transition-all duration-300 transform scale-100 overflow-hidden\"\n style=\"background: var(--glass-card); border-color: var(--color-border); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 1);\"\n role=\"alertdialog\"\n aria-modal=\"true\"\n >\n <button\n type=\"button\"\n onclick={sweetAlert.handleCancel}\n class=\"absolute top-3 right-3 p-1.5 rounded-full text-slate-400 hover:text-slate-700 hover:bg-slate-100 transition-colors cursor-pointer z-10\"\n aria-label=\"Close dialog\"\n >\n <svg class=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n\n <!-- 3D Animated Icon Header -->\n <div class=\"flex justify-center mb-5\">\n {#if sweetAlert.icon === \"success\"}\n <div class=\"w-16 h-16 rounded-[5px] flex items-center justify-center shadow-xl border border-emerald-200 bg-emerald-50 text-emerald-600 transition-transform duration-300 hover:scale-105\">\n <svg class=\"w-9 h-9\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </div>\n {:else if sweetAlert.icon === \"error\"}\n <div class=\"w-16 h-16 rounded-[5px] flex items-center justify-center shadow-xl border border-rose-200 bg-rose-50 text-rose-600 transition-transform duration-300 hover:scale-105\">\n <svg class=\"w-9 h-9\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </div>\n {:else if sweetAlert.icon === \"warning\"}\n <div class=\"w-16 h-16 rounded-[5px] flex items-center justify-center shadow-xl border border-amber-200 bg-amber-50 text-amber-600 transition-transform duration-300 hover:scale-105\">\n <svg class=\"w-9 h-9\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\" />\n </svg>\n </div>\n {:else}\n <div class=\"w-16 h-16 rounded-[5px] flex items-center justify-center shadow-xl border border-sky-200 bg-sky-50 text-sky-600 transition-transform duration-300 hover:scale-105\">\n <svg class=\"w-9 h-9\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" d=\"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n </div>\n {/if}\n </div>\n\n <!-- Content Area with High Contrast Typography -->\n <div class=\"text-center space-y-3 mb-6 w-full max-w-full overflow-hidden px-1\">\n <h3 class=\"text-xl font-extrabold text-slate-900 tracking-tight break-words [overflow-wrap:anywhere]\">\n {sweetAlert.title}\n </h3>\n {#if sweetAlert.text}\n <div class=\"text-sm font-medium text-slate-700 leading-relaxed max-w-full mx-auto space-y-2.5\">\n {#each sweetAlert.text.split('\\n') as line}\n {#if line.trim().startsWith('/') || line.trim().startsWith('C:\\\\') || line.trim().startsWith('~')}\n <div class=\"font-mono text-xs p-2.5 rounded-[5px] bg-slate-900/5 text-slate-800 border border-slate-200/80 break-all select-all text-left shadow-inner max-h-32 overflow-y-auto\">\n {line.trim()}\n </div>\n {:else if line.trim()}\n <p class=\"break-words [overflow-wrap:anywhere] whitespace-pre-line\">\n {line}\n </p>\n {/if}\n {/each}\n </div>\n {/if}\n </div>\n\n <!-- 3D Actions with Tactile Depth -->\n <div class=\"flex items-center justify-center gap-3\">\n {#if sweetAlert.showCancel}\n <button\n type=\"button\"\n onclick={sweetAlert.handleCancel}\n class=\"btn-3d px-5 py-2.5 rounded-[5px] text-xs font-bold text-slate-700 bg-slate-100 hover:bg-slate-200 border border-slate-300 transition-all cursor-pointer\"\n >\n {sweetAlert.cancelText}\n </button>\n {/if}\n <button\n type=\"button\"\n onclick={sweetAlert.handleConfirm}\n class=\"btn-3d px-6 py-2.5 rounded-[5px] text-xs font-bold text-white transition-all cursor-pointer shadow-lg\"\n style=\"background-color: var(--color-primary, #7c3aed);\"\n >\n {sweetAlert.confirmText}\n </button>\n </div>\n </div>\n </div>\n{/if}\n","<script>\n import '../app.css';\n import { page } from '$app/state';\n import { onMount } from 'svelte';\n import { apiRequest, initToken } from '#lib/api.js';\n import { uiState } from '#lib/state/uiState.svelte.js';\n import { themeState } from '#lib/state/themeState.svelte.js';\n import ThemeSwitcher from '../components/ThemeSwitcher.svelte';\n import SweetAlertModal from '../components/SweetAlertModal.svelte';\n\n let { children } = $props();\n\n let health = $state({ status: 'checking', port: 1404, version: '2.1.0' });\n\n const navSections = [\n {\n title: 'Overview',\n items: [\n { id: 'dashboard', path: '/dashboard', label: 'Dashboard', iconSvg: 'M3 3v7h7M21 21v-7h-7M3 10a9 9 0 0115-5.7L21 8M21 14a9 9 0 01-15 5.7L3 16' }\n ]\n },\n {\n title: 'Clients & Finance',\n items: [\n { id: 'clients', path: '/clients', label: 'Clients', iconSvg: 'M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' },\n { id: 'savings', path: '/savings', label: 'Savings', iconSvg: 'M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z' },\n { id: 'bridges', path: '/bridges', label: 'Bridges', iconSvg: 'M8 9l4-4 4 4m0 6l-4 4-4-4' }\n ]\n },\n {\n title: 'Tools & Integrations',\n items: [\n { id: 'search', path: '/search', label: 'Web Search', iconSvg: 'M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z', badge: 'SearXNG' },\n { id: 'semble', path: '/semble', label: 'Semble MCP', iconSvg: 'M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4', badge: '98%' },\n { id: 'detector', path: '/detector', label: 'AI Detector', iconSvg: 'M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c.5.633 1.2 1 2 1s1.5-.367 2-1m2-3a2 2 0 100-4 2 2 0 000 4z', badge: 'Web & Docs' }\n ]\n },\n {\n title: 'Configuration',\n items: [\n { id: 'persona', path: '/persona', label: 'Persona', iconSvg: 'M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z' },\n { id: 'context', path: '/context', label: 'Context', iconSvg: 'M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10' },\n { id: 'agents', path: '/agents', label: 'Agents', iconSvg: 'M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z' },\n { id: 'skills', path: '/skills', label: 'Skills', iconSvg: 'M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253' }\n ]\n },\n {\n title: 'Operations',\n items: [\n { id: 'tasks', path: '/tasks', label: 'SDLC Tasks', iconSvg: 'M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4' },\n { id: 'doctor', path: '/doctor', label: 'Doctor', iconSvg: 'M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z' }\n ]\n },\n {\n title: 'Resources',\n items: [\n { id: 'docs', path: '/docs', label: 'Documentation', iconSvg: 'M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253' }\n ]\n }\n ];\n\n const allNavItems = navSections.flatMap(s => s.items);\n\n let isSidebarOpen = $state(true);\n let openSections = $state(new Set(navSections.map(s => s.title)));\n\n function toggleSection(title) {\n if (openSections.has(title)) {\n openSections.delete(title);\n } else {\n openSections.add(title);\n }\n openSections = new Set(openSections);\n }\n\n function toggleSidebar() {\n isSidebarOpen = !isSidebarOpen;\n }\n\n $effect(() => {\n const activeSection = navSections.find(s =>\n s.items.some(it => page.url.pathname === it.path || (it.path === '/dashboard' && page.url.pathname === '/'))\n );\n if (activeSection && !openSections.has(activeSection.title)) {\n openSections.add(activeSection.title);\n openSections = new Set(openSections);\n }\n });\n\n async function checkHealth() {\n try {\n const data = await apiRequest('/api/v1/health');\n health = data;\n uiState.isConnected = true;\n } catch (_) {\n uiState.isConnected = false;\n }\n }\n\n onMount(() => {\n themeState.init();\n initToken();\n checkHealth();\n const interval = setInterval(checkHealth, 10000);\n\n let eventSource;\n try {\n eventSource = new EventSource('/api/v1/events');\n eventSource.onopen = () => { uiState.isConnected = true; };\n eventSource.onerror = () => { uiState.isConnected = false; };\n eventSource.addEventListener('bridge_status', (e) => {\n try {\n const payload = JSON.parse(e.data);\n uiState.addNotification(`Bridge ${payload.name || ''} updated`, 'info');\n } catch (_) {}\n });\n } catch (_) {}\n\n return () => {\n clearInterval(interval);\n if (eventSource) eventSource.close();\n };\n });\n</script>\n\n<div class=\"flex h-screen overflow-hidden font-sans transition-colors duration-200\" style=\"background-color: var(--color-bg); color: var(--color-text);\">\n <!-- Desktop Fixed Left Sidebar (Collapsible for Maximum Center Space) -->\n <aside\n class=\"glass-frost hidden lg:flex border-r flex-col shrink-0 transition-all duration-300 ease-in-out overflow-hidden {isSidebarOpen ? 'w-64' : 'w-0 border-r-0 opacity-0 pointer-events-none'}\"\n style=\"background: var(--glass-sidebar), var(--glass-tint); border-color: var(--color-border); color: var(--color-text);\"\n >\n <div class=\"flex-1 overflow-y-auto scrollbar-thin w-64\">\n <!-- Brand Header (Far-Left Logo + Sidebar Collapse Button) -->\n <div class=\"p-4 border-b flex items-center justify-between sticky top-0 z-10 glass-frost\" style=\"border-color: var(--color-border); background: var(--glass-sidebar), var(--glass-tint);\">\n <div class=\"flex items-center gap-3 min-w-0\">\n <div class=\"w-9 h-9 rounded-[5px] overflow-hidden flex items-center justify-center shadow-md border bg-white shrink-0\" style=\"border-color: var(--color-primary);\">\n <img src=\"/fox_kyubi_192.png\" alt=\"Konoha Kyubi logo\" class=\"w-full h-full object-cover\" width=\"36\" height=\"36\" loading=\"eager\" />\n </div>\n <div class=\"min-w-0\">\n <h1 class=\"text-sm font-extrabold tracking-tight flex items-center gap-1.5\" style=\"color: var(--color-text);\">\n Konoha <span class=\"text-[9px] px-1.5 py-0.5 rounded-[5px] font-mono border\" style=\"color: var(--color-primary); background-color: var(--color-primary-glow); border-color: var(--color-primary);\">v{health.version || '2.0.0'}</span>\n </h1>\n <p class=\"text-[10px] font-medium truncate\" style=\"color: var(--color-text-muted);\">Ninja Agent Village</p>\n </div>\n </div>\n <button\n type=\"button\"\n onclick={toggleSidebar}\n class=\"w-7 h-7 rounded-[5px] border flex items-center justify-center text-xs transition-colors hover:bg-slate-200/50 dark:hover:bg-slate-800/50 cursor-pointer shrink-0\"\n style=\"border-color: var(--color-border); color: var(--color-text-muted);\"\n title=\"Collapse sidebar to give more space in center\"\n aria-label=\"Collapse sidebar\"\n >\n <svg class=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M11 19l-7-7 7-7m8 14l-7-7 7-7\" />\n </svg>\n </button>\n </div>\n\n <!-- Grouped Navigation with Clickable Sub-menu Accordions -->\n <nav class=\"p-2 space-y-1.5\">\n {#each navSections as section}\n {@const isExpanded = openSections.has(section.title)}\n {@const hasActiveChild = section.items.some(it => page.url.pathname === it.path || (it.path === '/dashboard' && page.url.pathname === '/'))}\n <div class=\"rounded-[5px] overflow-hidden border border-transparent transition-colors {hasActiveChild ? 'bg-sky-500/5 dark:bg-sky-500/10 border-sky-500/20' : ''}\">\n <button\n type=\"button\"\n onclick={() => toggleSection(section.title)}\n class=\"w-full flex items-center justify-between px-3 py-1.5 text-[11px] font-bold uppercase tracking-wider select-none hover:bg-black/5 dark:hover:bg-white/5 rounded-[5px] transition-colors cursor-pointer\"\n style=\"color: {hasActiveChild ? 'var(--color-primary)' : 'var(--color-text-muted)'};\"\n aria-expanded={isExpanded}\n >\n <div class=\"flex items-center gap-1.5\">\n <span class=\"w-1.5 h-1.5 rounded-full {hasActiveChild ? 'bg-sky-500' : 'bg-slate-400/40'}\"></span>\n <span>{section.title}</span>\n </div>\n <svg class=\"w-3.5 h-3.5 transition-transform duration-200 {isExpanded ? 'rotate-90' : 'rotate-0'}\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 5l7 7-7 7\" />\n </svg>\n </button>\n\n {#if isExpanded}\n <div class=\"space-y-0.5 pt-0.5 pb-1 pl-1 transition-all duration-200\">\n {#each section.items as item}\n {@const isActive = page.url.pathname === item.path || (item.path === '/dashboard' && page.url.pathname === '/')}\n <a\n href={item.path}\n class=\"nav-depth flex items-center justify-between px-2.5 py-1.5 rounded-[5px] text-xs font-semibold transition-all duration-150\"\n style=\"{isActive ? 'color: var(--color-primary); background-color: var(--color-primary-glow); border: 1.5px solid var(--color-primary); box-shadow: 0 0 12px var(--color-primary-glow);' : 'color: var(--color-text-muted);'}\"\n >\n <div class=\"flex items-center gap-2 min-w-0\">\n <svg class=\"w-3.5 h-3.5 shrink-0\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d={item.iconSvg} />\n </svg>\n <span class=\"truncate\">{item.label}</span>\n </div>\n {#if item.badge}\n <span class=\"px-1.5 py-0.5 rounded-[5px] text-[9px] font-mono bg-emerald-500/20 text-emerald-600 dark:text-emerald-400 border border-emerald-500/30 shrink-0\">{item.badge}</span>\n {/if}\n </a>\n {/each}\n </div>\n {/if}\n </div>\n {/each}\n </nav>\n </div>\n\n <!-- System Status Footer: Live MCP Gateway -->\n <div class=\"p-4 border-t shrink-0 transition-colors duration-200 w-64\" style=\"border-color: var(--color-border); background-color: var(--color-bg);\">\n <div class=\"flex items-center justify-between text-xs mb-2\" style=\"color: var(--color-text-muted);\">\n <span class=\"flex items-center gap-2\">\n <span class=\"w-2 h-2 rounded-full {uiState.isConnected ? 'bg-emerald-400 shadow-[0_0_8px_rgba(52,211,153,0.8)]' : 'bg-rose-500'}\"></span>\n <span class=\"text-xs font-medium\">{uiState.isConnected ? 'Live MCP Gateway' : 'Disconnected'}</span>\n </span>\n <span class=\"font-mono text-[11px]\" style=\"color: var(--color-text-muted);\">:{health.port || 1404}</span>\n </div>\n <div class=\"text-[10px] flex justify-between pt-1\" style=\"color: var(--color-text-muted);\">\n <span>SQLite FTS5 + Semble</span>\n <span>Localhost</span>\n </div>\n </div>\n </aside>\n\n <!-- Main Content Stage (Expands to Full Width When Sidebar is Collapsed) -->\n <main class=\"flex-1 flex flex-col overflow-hidden pb-16 lg:pb-0 transition-all duration-300 ease-in-out\" style=\"background-color: var(--color-bg); color: var(--color-text);\">\n <!-- Top 4-Gradient Vibrant Accent Stripe -->\n <div class=\"h-1 w-full shrink-0\" style=\"background: var(--theme-4gradient-bar);\"></div>\n\n <!-- Top Header: Brand Logo on Far LEFT + Sidebar Toggle (Mandatory Invariant) -->\n <header class=\"glass-frost h-14 border-b px-4 lg:px-6 flex items-center justify-between shrink-0 transition-colors duration-200\" style=\"background: var(--glass-header), var(--glass-tint); border-color: var(--color-border);\">\n <!-- Far-Left Logo & Title + Sidebar Open/Close Toggle Button -->\n <div class=\"flex items-center gap-3\">\n <!-- Desktop Sidebar Toggle Button -->\n <button\n type=\"button\"\n onclick={toggleSidebar}\n class=\"hidden lg:flex w-8 h-8 rounded-[5px] border items-center justify-center text-xs transition-all hover:scale-105 cursor-pointer shrink-0\"\n style=\"border-color: var(--color-border); background-color: var(--color-surface); color: var(--color-text);\"\n title={isSidebarOpen ? \"Close sidebar to give more space in center\" : \"Open sidebar\"}\n aria-label=\"Toggle sidebar\"\n >\n <svg class=\"w-4 h-4 transition-transform duration-200 {isSidebarOpen ? '' : 'rotate-180'}\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 6h16M4 12h16M4 18h7\" />\n </svg>\n </button>\n\n <div class=\"lg:hidden flex items-center gap-2\">\n <img src=\"/fox_kyubi_64.png\" alt=\"Konoha\" class=\"w-7 h-7 rounded-[5px] border object-cover bg-white\" style=\"border-color: var(--color-primary);\" width=\"28\" height=\"28\" loading=\"eager\" />\n <span class=\"text-sm font-bold tracking-tight\" style=\"color: var(--color-text);\">Konoha</span>\n </div>\n <div class=\"hidden sm:flex items-center gap-2 text-xs\">\n <span class=\"uppercase tracking-widest text-[10px] font-bold\" style=\"color: var(--color-text-muted);\">Dashboard</span>\n <span style=\"color: var(--color-border);\">/</span>\n <span class=\"font-semibold capitalize\" style=\"color: var(--color-primary);\">{page.url.pathname.replace('/', '') || 'dashboard'}</span>\n </div>\n </div>\n\n <!-- Action Buttons & Status -->\n <div class=\"flex items-center gap-3\">\n <div class=\"hidden sm:flex items-center gap-2 px-3 py-1 rounded-[5px] border text-[11px] font-mono\" style=\"background-color: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\">\n <span class=\"w-1.5 h-1.5 rounded-full bg-emerald-400\"></span>\n <span>127.0.0.1:{health.port || 1404}</span>\n </div>\n <span class=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-[5px] text-[11px] font-semibold bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20\">\n SSE Active\n </span>\n </div>\n </header>\n\n <!-- Page Body (extra bottom padding clears the mobile dock + theme FAB) -->\n <div class=\"flex-1 overflow-y-auto p-6 pb-28 lg:p-8 lg:pb-8 transition-colors duration-200\" style=\"background-color: var(--color-bg);\">\n {@render children()}\n </div>\n </main>\n\n <!-- Mobile Navigation Dock (Mandatory Invariant — Zero Hamburger Menu in Header) -->\n <nav class=\"glass-frost lg:hidden fixed bottom-0 inset-x-0 z-40 border-t flex flex-nowrap items-center gap-1 overflow-x-auto scrollbar-none py-2 px-2 shadow-2xl transition-colors duration-200\" style=\"background: var(--glass-dock), var(--glass-tint); border-color: var(--color-border); padding-bottom: max(0.5rem, env(safe-area-inset-bottom));\">\n {#each allNavItems as item}\n {@const isActive = page.url.pathname === item.path || (item.path === '/dashboard' && page.url.pathname === '/')}\n <a\n href={item.path}\n class=\"nav-depth flex flex-col items-center gap-1 py-1 px-2.5 rounded-[5px] text-[10px] font-semibold transition-all shrink-0\"\n style=\"{isActive ? 'color: var(--color-primary); background-color: var(--color-primary-glow);' : 'color: var(--color-text-muted);'}\"\n >\n <svg class=\"w-4 h-4 shrink-0\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d={item.iconSvg} />\n </svg>\n <span class=\"whitespace-nowrap\">{item.label}</span>\n </a>\n {/each}\n </nav>\n\n <!-- Floating Theme Switcher Button -->\n <ThemeSwitcher />\n\n <!-- Global 3D SweetAlert Modal -->\n <SweetAlertModal />\n\n <!-- Global Notification Toasts (lifted above the mobile dock on small screens) -->\n {#if uiState.notifications.length > 0}\n <div class=\"fixed bottom-20 right-5 z-[90] lg:bottom-6 lg:right-6 space-y-2 max-w-[calc(100vw-2.5rem)]\">\n {#each uiState.notifications as n (n.id)}\n <div class=\"px-4 py-3 rounded-[5px] text-xs font-semibold shadow-2xl border backdrop-blur-2xl bg-slate-900/95 text-white border-sky-500/50 flex items-center gap-2\">\n <span class=\"w-2 h-2 rounded-full bg-sky-400 animate-ping\"></span>\n <span>{n.text}</span>\n </div>\n {/each}\n </div>\n {/if}\n</div>\n"],"mappings":";;;;;;;;AAGA,IAAa,SAAS;CACpB;EAAE,IAAI;EAAW,MAAM;EAAuB,aAAa;EAAqD,OAAO;EAAW,QAAQ;EAAW,UAAU;GAAC;GAAW;GAAW;GAAW;EAAS;EAAG,MAAM;EAAwB,IAAI;EAAW,SAAS;EAAW,QAAQ;EAAW,OAAO;CAAM;CAC9S;EAAE,IAAI;EAAY,MAAM;EAAuB,aAAa;EAAkC,OAAO;EAAW,QAAQ;EAAW,UAAU;GAAC;GAAW;GAAW;GAAW;EAAS;EAAG,MAAM;EAAyB,IAAI;EAAW,SAAS;EAAW,QAA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Aa;GAEnG,WAAA,KAAA,KAAAE,KAAA,QAAA,KAAK,IAAI,EAAA,iIAAAD,WAEP,WAAW,8EAA8E,iCAAiC,EAAA,4JAAAC,KAAA,KAGvD,KAAK,OAAO,EAAA,iDAAAH,YAEtD,KAAK,KAAK,EAAA,YAAA;;;;;;;EAY5C,IAAA,QAAQ,cAAc,SAAS,GAAC;;GAE1B,MAAA,eAAAC,kBAAA,QAAQ,aAAa;;IAAI,IAAA,IAAC,aAAA;IAGtB,WAAA,KAAA,gPAAAD,YAAA,EAAE,IAAI,EAAA,cAAA;;;;;CAtLf,CAAA"}
|
|
1
|
+
{"version":3,"file":"_layout.svelte.js","names":["$.attr","$.stringify","$.escape","$.ensure_array_like","$.attr_class","$.escape","$.ensure_array_like","$.attr_style","$.attr"],"sources":["../../../../src/lib/state/themeState.svelte.js","../../../../src/components/ThemeSwitcher.svelte","../../../../src/components/SweetAlertModal.svelte","../../../../src/routes/+layout.svelte"],"sourcesContent":["/* eslint-disable no-undef */\n// Svelte 5 Runes State for Konoha 10-Theme System\n\nexport const THEMES = [\n { id: 'chidori', name: 'Chidori Azure Light', description: 'Crackling sky-blue precision with lightning focus', color: '#0284c7', accent: '#06b6d4', gradient: ['#0284c7', '#06b6d4', '#38bdf8', '#818cf8'], glow: 'rgba(2,132,199,0.12)', bg: '#f0f9ff', surface: '#ffffff', border: '#bae6fd', light: true },\n { id: 'byakugan', name: 'Byakugan Pure Light', description: 'Violet focus with 360° clarity', color: '#7c3aed', accent: '#6366f1', gradient: ['#7c3aed', '#6366f1', '#8b5cf6', '#a855f7'], glow: 'rgba(124,58,237,0.12)', bg: '#f8fafc', surface: '#ffffff', border: '#e2e8f0', light: true },\n { id: 'konoha-leaf', name: 'Konoha Emerald Light', description: 'Hidden leaf green serenity', color: '#059669', accent: '#14b8a6', gradient: ['#059669', '#10b981', '#14b8a6', '#34d399'], glow: 'rgba(5,150,105,0.12)', bg: '#f0fdf4', surface: '#ffffff', border: '#bbf7d0', light: true },\n { id: 'rasengan', name: 'Rasengan Breeze Light', description: 'Spiralling royal-blue energy', color: '#2563eb', accent: '#3b82f6', gradient: ['#1d4ed8', '#2563eb', '#3b82f6', '#60a5fa'], glow: 'rgba(37,99,235,0.12)', bg: '#eff6ff', surface: '#ffffff', border: '#bfdbfe', light: true },\n { id: 'sharingan', name: 'Sharingan Rose Light', description: 'Crimson perception, softly lit', color: '#dc2626', accent: '#f43f5e', gradient: ['#be123c', '#dc2626', '#e11d48', '#f43f5e'], glow: 'rgba(220,38,38,0.12)', bg: '#fff1f2', surface: '#ffffff', border: '#fecdd3', light: true },\n { id: 'hokage-gold', name: 'Hokage Amber Light', description: 'Warm gold of the village leader', color: '#d97706', accent: '#f59e0b', gradient: ['#b45309', '#d97706', '#f59e0b', '#fbbf24'], glow: 'rgba(217,119,6,0.12)', bg: '#fffbeb', surface: '#ffffff', border: '#fde68a', light: true },\n { id: 'anbu-shadow', name: 'Anbu Platinum Light', description: 'Cool steel-grey operative tone', color: '#475569', accent: '#64748b', gradient: ['#334155', '#475569', '#64748b', '#94a3b8'], glow: 'rgba(71,85,105,0.12)', bg: '#f8fafc', surface: '#ffffff', border: '#cbd5e1', light: true },\n { id: 'sage-mode', name: 'Sage Coral Light', description: 'Natural orange toad-sage warmth', color: '#ea580c', accent: '#f97316', gradient: ['#c2410c', '#ea580c', '#f97316', '#fb923c'], glow: 'rgba(234,88,12,0.12)', bg: '#fff7ed', surface: '#ffffff', border: '#fed7aa', light: true },\n { id: 'sound-village', name: 'Sound Orchid Light', description: 'Orchid purple with sonic depth', color: '#9333ea', accent: '#a855f7', gradient: ['#7e22ce', '#9333ea', '#a855f7', '#c084fc'], glow: 'rgba(147,51,234,0.12)', bg: '#faf5ff', surface: '#ffffff', border: '#e9d5ff', light: true },\n { id: 'akatsuki', name: 'Akatsuki Dusk Plum Light', description: 'Mysterious plum dusk with rogue ninja cloak aura', color: '#86198f', accent: '#c026d3', gradient: ['#581c87', '#701a75', '#86198f', '#c026d3'], glow: 'rgba(134,25,143,0.12)', bg: '#fdf4ff', surface: '#ffffff', border: '#f5d0fe', light: true }\n];\n\nexport function createThemeState() {\n let currentTheme = $state('chidori');\n let isModalOpen = $state(false);\n\n function applyTheme(themeId) {\n currentTheme = themeId;\n const found = THEMES.find(t => t.id === themeId) || THEMES[0];\n if (typeof document !== 'undefined') {\n document.documentElement.setAttribute('data-theme', themeId);\n document.documentElement.style.setProperty('--color-primary', found.color);\n document.documentElement.style.setProperty('--color-accent', found.accent);\n document.documentElement.style.setProperty('--color-primary-glow', found.glow);\n document.documentElement.style.setProperty('--color-bg', found.bg);\n document.documentElement.style.setProperty('--color-surface', found.surface);\n document.documentElement.style.setProperty('--color-border', found.border);\n document.documentElement.classList.add('theme-light');\n document.documentElement.classList.remove('theme-dark');\n document.documentElement.style.setProperty('--color-text', '#0f172a');\n document.documentElement.style.setProperty('--color-text-muted', '#334155');\n document.documentElement.style.setProperty('--color-card-bg', '#ffffff');\n document.documentElement.style.setProperty('--color-card-border', found.border);\n if (found.gradient && found.gradient.length >= 4) {\n document.documentElement.style.setProperty('--theme-grad-1', found.gradient[0]);\n document.documentElement.style.setProperty('--theme-grad-2', found.gradient[1]);\n document.documentElement.style.setProperty('--theme-grad-3', found.gradient[2]);\n document.documentElement.style.setProperty('--theme-grad-4', found.gradient[3]);\n document.documentElement.style.setProperty('--theme-4gradient', `linear-gradient(135deg, ${found.gradient[0]} 0%, ${found.gradient[1]} 33%, ${found.gradient[2]} 66%, ${found.gradient[3]} 100%)`);\n document.documentElement.style.setProperty('--theme-4gradient-bar', `linear-gradient(90deg, ${found.gradient[0]}, ${found.gradient[1]}, ${found.gradient[2]}, ${found.gradient[3]})`);\n document.documentElement.style.setProperty('--theme-4gradient-subtle', `linear-gradient(135deg, ${found.gradient[0]}22 0%, ${found.gradient[1]}22 33%, ${found.gradient[2]}22 66%, ${found.gradient[3]}22 100%)`);\n }\n try {\n localStorage.setItem('konoha-theme', themeId);\n } catch (_) {\n // Ignore localStorage errors in SSR or restricted environments\n }\n }\n }\n\n function init() {\n if (typeof window !== 'undefined') {\n let saved = 'chidori';\n try {\n saved = localStorage.getItem('konoha-theme') || 'chidori';\n } catch (_) {\n // Fallback to default theme if storage is unavailable\n }\n applyTheme(saved);\n }\n }\n\n return {\n get currentTheme() { return currentTheme; },\n get isModalOpen() { return isModalOpen; },\n set isModalOpen(val) { isModalOpen = val; },\n applyTheme,\n init,\n themes: THEMES\n };\n}\n\nexport const themeState = createThemeState();\n","<script>\n import { themeState, THEMES } from '../lib/state/themeState.svelte.js';\n import { useScrollLock } from '#lib/scrollLock.svelte.js';\n\n let isModalOpen = $state(false);\n\n useScrollLock(() => isModalOpen);\n\n function selectTheme(id) {\n themeState.applyTheme(id);\n isModalOpen = false;\n }\n\n function toggleModal() {\n isModalOpen = !isModalOpen;\n }\n\n function handleModalKeydown(e) {\n if (e.key === 'Escape' && isModalOpen) isModalOpen = false;\n }\n</script>\n\n<svelte:window onkeydown={handleModalKeydown} />\n\n<!-- Floating Bottom-Left Theme Switcher Button (FAB) -->\n<div class=\"fixed bottom-20 left-5 lg:bottom-6 lg:left-6 z-50\">\n <button\n type=\"button\"\n onclick={toggleModal}\n class=\"w-11 h-11 rounded-full border shadow-2xl flex items-center justify-center transition-all duration-200 hover:scale-110 active:scale-95 cursor-pointer group\"\n style=\"background-color: var(--color-surface); border-color: var(--color-border); color: var(--color-text); box-shadow: var(--shadow-3d);\"\n title=\"Switch Theme ({themeState.currentTheme.replace('-', ' ')})\"\n aria-label=\"Toggle Theme Selection Modal\"\n >\n <span\n class=\"w-4.5 h-4.5 rounded-full shadow-md transition-transform duration-200 group-hover:scale-110\"\n style=\"background: linear-gradient(135deg, var(--color-primary, #7c3aed), var(--color-accent, #6366f1));\"\n ></span>\n </button>\n</div>\n\n<!-- Shared Full Popup Modal (Fixed Center Overlay for Both Desktop & Mobile) -->\n{#if isModalOpen}\n <!-- svelte-ignore a11y_click_events_have_key_events -->\n <!-- svelte-ignore a11y_no_static_element_interactions -->\n <div\n class=\"fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-900/35 backdrop-blur-sm animate-in fade-in duration-150\"\n onclick={() => isModalOpen = false}\n >\n <!-- Centered Modal Popup Dialog -->\n <div\n class=\"modal-card w-full max-w-lg p-6 rounded-[5px] border shadow-2xl space-y-4 animate-in zoom-in-95 duration-150 glass-frost-strong\"\n style=\"background-color: var(--color-surface); border-color: var(--color-border); color: var(--color-text); box-shadow: var(--shadow-3d);\"\n onclick={(e) => e.stopPropagation()}\n >\n <!-- Header -->\n <div class=\"flex items-center justify-between pb-3 border-b\" style=\"border-color: var(--color-border);\">\n <div class=\"flex items-center gap-2.5\">\n <div class=\"w-8 h-8 rounded-[5px] flex items-center justify-center border\" style=\"background: var(--theme-4gradient, linear-gradient(135deg, var(--color-primary), var(--color-accent))); border-color: var(--color-primary); color: #ffffff;\">\n <svg class=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01\" />\n </svg>\n </div>\n <div>\n <h3 class=\"text-sm font-bold tracking-tight\" style=\"color: var(--color-text);\">Konoha 4-Gradient Theme Palette</h3>\n <p class=\"text-[11px]\" style=\"color: var(--color-text-muted);\">10 Light-Mode calibrated palettes with 4-stop vibrant gradients</p>\n </div>\n </div>\n <button\n type=\"button\"\n onclick={() => isModalOpen = false}\n class=\"w-7 h-7 rounded-[5px] flex items-center justify-center text-xs font-bold border transition-colors hover:scale-105\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text-muted);\"\n >\n ✕\n </button>\n </div>\n\n <!-- 10 Themes Grid (2 Columns) -->\n <div class=\"grid grid-cols-1 sm:grid-cols-2 gap-2.5 max-h-[60vh] overflow-y-auto pr-1\">\n {#each THEMES as t}\n {@const isCurrent = themeState.currentTheme === t.id}\n {@const gradBg = t.gradient ? `linear-gradient(135deg, ${t.gradient[0]} 0%, ${t.gradient[1]} 33%, ${t.gradient[2]} 66%, ${t.gradient[3]} 100%)` : `linear-gradient(135deg, ${t.color}, ${t.accent})`}\n <button\n type=\"button\"\n class=\"w-full flex items-center gap-3 p-3 rounded-[5px] border text-left transition-all duration-150 hover:scale-[1.02] cursor-pointer\"\n style=\"{isCurrent\n ? 'border-color: var(--color-primary); background-color: var(--color-primary-glow); box-shadow: 0 0 0 1.5px var(--color-primary);'\n : 'border-color: var(--color-border); background-color: var(--color-surface);'}\"\n onclick={() => selectTheme(t.id)}\n >\n <div class=\"relative shrink-0\">\n <span class=\"w-8 h-8 rounded-[5px] flex items-center justify-center shadow-md border border-black/10\" style=\"background: {gradBg};\">\n {#if isCurrent}\n <span class=\"w-2.5 h-2.5 rounded-full bg-white shadow-sm ring-1 ring-black/20\"></span>\n {/if}\n </span>\n </div>\n <div class=\"flex flex-col min-w-0 flex-1\">\n <div class=\"flex items-center justify-between gap-1\">\n <span class=\"text-xs font-black truncate\" style=\"color: var(--color-text);\">{t.name}</span>\n {#if isCurrent}\n <span class=\"text-[10px] font-bold px-1.5 py-0.5 rounded-[5px] border text-sky-700 dark:text-sky-300 border-sky-500/30 bg-sky-500/10 shrink-0\">Active</span>\n {/if}\n </div>\n <span class=\"text-[10px] truncate\" style=\"color: var(--color-text-muted);\">{t.description}</span>\n {#if t.gradient}\n <div class=\"flex items-center gap-1 pt-1.5\">\n {#each t.gradient as colorHex}\n <span class=\"w-2.5 h-2 rounded-[2px] shadow-xs\" style=\"background-color: {colorHex};\"></span>\n {/each}\n </div>\n {/if}\n </div>\n </button>\n {/each}\n </div>\n </div>\n </div>\n{/if}\n","<script>\n import { sweetAlert } from \"#lib/sweetAlert.svelte.js\";\n import { useScrollLock } from \"#lib/scrollLock.svelte.js\";\n\n useScrollLock(() => sweetAlert.isOpen);\n</script>\n\n<svelte:window onkeydown={(e) => { if (e.key === 'Escape' && sweetAlert.isOpen) sweetAlert.handleCancel(); }} />\n\n{#if sweetAlert.isOpen}\n <!-- svelte-ignore a11y_click_events_have_key_events -->\n <!-- svelte-ignore a11y_no_static_element_interactions -->\n <div\n class=\"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-slate-900/40 backdrop-blur-md animate-in fade-in duration-200\"\n onclick={(e) => { if (e.target === e.currentTarget) sweetAlert.handleCancel(); }}\n >\n <!-- 3D Perspective Modal Card -->\n <div\n class=\"modal-card relative w-full max-w-lg rounded-[5px] p-6 sm:p-8 border shadow-2xl transition-all duration-300 transform scale-100 overflow-hidden\"\n style=\"background: var(--glass-card); border-color: var(--color-border); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 1);\"\n role=\"alertdialog\"\n aria-modal=\"true\"\n >\n <button\n type=\"button\"\n onclick={sweetAlert.handleCancel}\n class=\"absolute top-3 right-3 p-1.5 rounded-full text-slate-400 hover:text-slate-700 hover:bg-slate-100 transition-colors cursor-pointer z-10\"\n aria-label=\"Close dialog\"\n >\n <svg class=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n\n <!-- 3D Animated Icon Header -->\n <div class=\"flex justify-center mb-5\">\n {#if sweetAlert.icon === \"success\"}\n <div class=\"w-16 h-16 rounded-[5px] flex items-center justify-center shadow-xl border border-emerald-200 bg-emerald-50 text-emerald-600 transition-transform duration-300 hover:scale-105\">\n <svg class=\"w-9 h-9\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </div>\n {:else if sweetAlert.icon === \"error\"}\n <div class=\"w-16 h-16 rounded-[5px] flex items-center justify-center shadow-xl border border-rose-200 bg-rose-50 text-rose-600 transition-transform duration-300 hover:scale-105\">\n <svg class=\"w-9 h-9\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </div>\n {:else if sweetAlert.icon === \"warning\"}\n <div class=\"w-16 h-16 rounded-[5px] flex items-center justify-center shadow-xl border border-amber-200 bg-amber-50 text-amber-600 transition-transform duration-300 hover:scale-105\">\n <svg class=\"w-9 h-9\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\" />\n </svg>\n </div>\n {:else}\n <div class=\"w-16 h-16 rounded-[5px] flex items-center justify-center shadow-xl border border-sky-200 bg-sky-50 text-sky-600 transition-transform duration-300 hover:scale-105\">\n <svg class=\"w-9 h-9\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" d=\"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n </div>\n {/if}\n </div>\n\n <!-- Content Area with High Contrast Typography -->\n <div class=\"text-center space-y-3 mb-6 w-full max-w-full overflow-hidden px-1\">\n <h3 class=\"text-xl font-extrabold text-slate-900 tracking-tight break-words [overflow-wrap:anywhere]\">\n {sweetAlert.title}\n </h3>\n {#if sweetAlert.text}\n <div class=\"text-sm font-medium text-slate-700 leading-relaxed max-w-full mx-auto space-y-2.5\">\n {#each sweetAlert.text.split('\\n') as line}\n {#if line.trim().startsWith('/') || line.trim().startsWith('C:\\\\') || line.trim().startsWith('~')}\n <div class=\"font-mono text-xs p-2.5 rounded-[5px] bg-slate-900/5 text-slate-800 border border-slate-200/80 break-all select-all text-left shadow-inner max-h-32 overflow-y-auto\">\n {line.trim()}\n </div>\n {:else if line.trim()}\n <p class=\"break-words [overflow-wrap:anywhere] whitespace-pre-line\">\n {line}\n </p>\n {/if}\n {/each}\n </div>\n {/if}\n </div>\n\n <!-- 3D Actions with Tactile Depth -->\n <div class=\"flex items-center justify-center gap-3\">\n {#if sweetAlert.showCancel}\n <button\n type=\"button\"\n onclick={sweetAlert.handleCancel}\n class=\"btn-3d px-5 py-2.5 rounded-[5px] text-xs font-bold text-slate-700 bg-slate-100 hover:bg-slate-200 border border-slate-300 transition-all cursor-pointer\"\n >\n {sweetAlert.cancelText}\n </button>\n {/if}\n <button\n type=\"button\"\n onclick={sweetAlert.handleConfirm}\n class=\"btn-3d px-6 py-2.5 rounded-[5px] text-xs font-bold text-white transition-all cursor-pointer shadow-lg\"\n style=\"background-color: var(--color-primary, #7c3aed);\"\n >\n {sweetAlert.confirmText}\n </button>\n </div>\n </div>\n </div>\n{/if}\n","<script>\n import '../app.css';\n import { page } from '$app/state';\n import { onMount } from 'svelte';\n import { apiRequest, initToken } from '#lib/api.js';\n import { uiState } from '#lib/state/uiState.svelte.js';\n import { themeState } from '#lib/state/themeState.svelte.js';\n import ThemeSwitcher from '../components/ThemeSwitcher.svelte';\n import SweetAlertModal from '../components/SweetAlertModal.svelte';\n\n let { children } = $props();\n\n let health = $state({ status: 'checking', port: 1404, version: '2.1.0' });\n\n const navSections = [\n {\n title: 'Overview',\n items: [\n { id: 'dashboard', path: '/dashboard', label: 'Dashboard', iconSvg: 'M3 3v7h7M21 21v-7h-7M3 10a9 9 0 0115-5.7L21 8M21 14a9 9 0 01-15 5.7L3 16' }\n ]\n },\n {\n title: 'Clients & Finance',\n items: [\n { id: 'clients', path: '/clients', label: 'Clients', iconSvg: 'M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' },\n { id: 'savings', path: '/savings', label: 'Savings', iconSvg: 'M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z' },\n { id: 'bridges', path: '/bridges', label: 'Bridges', iconSvg: 'M8 9l4-4 4 4m0 6l-4 4-4-4' }\n ]\n },\n {\n title: 'Tools & Integrations',\n items: [\n { id: 'search', path: '/search', label: 'Web Search', iconSvg: 'M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z', badge: 'SearXNG' },\n { id: 'semble', path: '/semble', label: 'Semble MCP', iconSvg: 'M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4', badge: '98%' },\n { id: 'detector', path: '/detector', label: 'AI Detector', iconSvg: 'M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c.5.633 1.2 1 2 1s1.5-.367 2-1m2-3a2 2 0 100-4 2 2 0 000 4z', badge: 'Web & Docs' },\n { id: 'remote', path: '/remote', label: 'Remote Access', iconSvg: 'M13 10V3L4 14h7v7l9-11h-7z', badge: 'Telegram' }\n ]\n },\n {\n title: 'Configuration',\n items: [\n { id: 'persona', path: '/persona', label: 'Persona', iconSvg: 'M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z' },\n { id: 'context', path: '/context', label: 'Context', iconSvg: 'M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10' },\n { id: 'agents', path: '/agents', label: 'Agents', iconSvg: 'M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z' },\n { id: 'skills', path: '/skills', label: 'Skills', iconSvg: 'M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253' }\n ]\n },\n {\n title: 'Operations',\n items: [\n { id: 'tasks', path: '/tasks', label: 'SDLC Tasks', iconSvg: 'M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4' },\n { id: 'doctor', path: '/doctor', label: 'Doctor', iconSvg: 'M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z' }\n ]\n },\n {\n title: 'Resources',\n items: [\n { id: 'docs', path: '/docs', label: 'Documentation', iconSvg: 'M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253' }\n ]\n }\n ];\n\n const allNavItems = navSections.flatMap(s => s.items);\n\n let isSidebarOpen = $state(true);\n let openSections = $state(new Set(navSections.map(s => s.title)));\n\n function toggleSection(title) {\n if (openSections.has(title)) {\n openSections.delete(title);\n } else {\n openSections.add(title);\n }\n openSections = new Set(openSections);\n }\n\n function toggleSidebar() {\n isSidebarOpen = !isSidebarOpen;\n }\n\n $effect(() => {\n const activeSection = navSections.find(s =>\n s.items.some(it => page.url.pathname === it.path || (it.path === '/dashboard' && page.url.pathname === '/'))\n );\n if (activeSection && !openSections.has(activeSection.title)) {\n openSections.add(activeSection.title);\n openSections = new Set(openSections);\n }\n });\n\n async function checkHealth() {\n try {\n const data = await apiRequest('/api/v1/health');\n health = data;\n uiState.isConnected = true;\n } catch (_) {\n uiState.isConnected = false;\n }\n }\n\n onMount(() => {\n themeState.init();\n initToken();\n checkHealth();\n const interval = setInterval(checkHealth, 10000);\n\n let eventSource;\n try {\n eventSource = new EventSource('/api/v1/events');\n eventSource.onopen = () => { uiState.isConnected = true; };\n eventSource.onerror = () => { uiState.isConnected = false; };\n eventSource.addEventListener('bridge_status', (e) => {\n try {\n const payload = JSON.parse(e.data);\n uiState.addNotification(`Bridge ${payload.name || ''} updated`, 'info');\n } catch (_) {}\n });\n } catch (_) {}\n\n return () => {\n clearInterval(interval);\n if (eventSource) eventSource.close();\n };\n });\n</script>\n\n<div class=\"flex h-screen overflow-hidden font-sans transition-colors duration-200\" style=\"background-color: var(--color-bg); color: var(--color-text);\">\n <!-- Desktop Fixed Left Sidebar (Collapsible for Maximum Center Space) -->\n <aside\n class=\"glass-frost hidden lg:flex border-r flex-col shrink-0 transition-all duration-300 ease-in-out overflow-hidden {isSidebarOpen ? 'w-64' : 'w-0 border-r-0 opacity-0 pointer-events-none'}\"\n style=\"background: var(--glass-sidebar), var(--glass-tint); border-color: var(--color-border); color: var(--color-text);\"\n >\n <div class=\"flex-1 overflow-y-auto scrollbar-thin w-64\">\n <!-- Brand Header (Far-Left Logo + Sidebar Collapse Button) -->\n <div class=\"p-4 border-b flex items-center justify-between sticky top-0 z-10 glass-frost\" style=\"border-color: var(--color-border); background: var(--glass-sidebar), var(--glass-tint);\">\n <div class=\"flex items-center gap-3 min-w-0\">\n <div class=\"w-9 h-9 rounded-[5px] overflow-hidden flex items-center justify-center shadow-md border bg-white shrink-0\" style=\"border-color: var(--color-primary);\">\n <img src=\"/fox_kyubi_192.png\" alt=\"Konoha Kyubi logo\" class=\"w-full h-full object-cover\" width=\"36\" height=\"36\" loading=\"eager\" />\n </div>\n <div class=\"min-w-0\">\n <h1 class=\"text-sm font-extrabold tracking-tight flex items-center gap-1.5\" style=\"color: var(--color-text);\">\n Konoha <span class=\"text-[9px] px-1.5 py-0.5 rounded-[5px] font-mono border\" style=\"color: var(--color-primary); background-color: var(--color-primary-glow); border-color: var(--color-primary);\">v{health.version || '2.0.0'}</span>\n </h1>\n <p class=\"text-[10px] font-medium truncate\" style=\"color: var(--color-text-muted);\">Ninja Agent Village</p>\n </div>\n </div>\n <button\n type=\"button\"\n onclick={toggleSidebar}\n class=\"w-7 h-7 rounded-[5px] border flex items-center justify-center text-xs transition-colors hover:bg-slate-200/50 dark:hover:bg-slate-800/50 cursor-pointer shrink-0\"\n style=\"border-color: var(--color-border); color: var(--color-text-muted);\"\n title=\"Collapse sidebar to give more space in center\"\n aria-label=\"Collapse sidebar\"\n >\n <svg class=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M11 19l-7-7 7-7m8 14l-7-7 7-7\" />\n </svg>\n </button>\n </div>\n\n <!-- Grouped Navigation with Clickable Sub-menu Accordions -->\n <nav class=\"p-2 space-y-1.5\">\n {#each navSections as section}\n {@const isExpanded = openSections.has(section.title)}\n {@const hasActiveChild = section.items.some(it => page.url.pathname === it.path || (it.path === '/dashboard' && page.url.pathname === '/'))}\n <div class=\"rounded-[5px] overflow-hidden border border-transparent transition-colors {hasActiveChild ? 'bg-sky-500/5 dark:bg-sky-500/10 border-sky-500/20' : ''}\">\n <button\n type=\"button\"\n onclick={() => toggleSection(section.title)}\n class=\"w-full flex items-center justify-between px-3 py-1.5 text-[11px] font-bold uppercase tracking-wider select-none hover:bg-black/5 dark:hover:bg-white/5 rounded-[5px] transition-colors cursor-pointer\"\n style=\"color: {hasActiveChild ? 'var(--color-primary)' : 'var(--color-text-muted)'};\"\n aria-expanded={isExpanded}\n >\n <div class=\"flex items-center gap-1.5\">\n <span class=\"w-1.5 h-1.5 rounded-full {hasActiveChild ? 'bg-sky-500' : 'bg-slate-400/40'}\"></span>\n <span>{section.title}</span>\n </div>\n <svg class=\"w-3.5 h-3.5 transition-transform duration-200 {isExpanded ? 'rotate-90' : 'rotate-0'}\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 5l7 7-7 7\" />\n </svg>\n </button>\n\n {#if isExpanded}\n <div class=\"space-y-0.5 pt-0.5 pb-1 pl-1 transition-all duration-200\">\n {#each section.items as item}\n {@const isActive = page.url.pathname === item.path || (item.path === '/dashboard' && page.url.pathname === '/')}\n <a\n href={item.path}\n class=\"nav-depth flex items-center justify-between px-2.5 py-1.5 rounded-[5px] text-xs font-semibold transition-all duration-150\"\n style=\"{isActive ? 'color: var(--color-primary); background-color: var(--color-primary-glow); border: 1.5px solid var(--color-primary); box-shadow: 0 0 12px var(--color-primary-glow);' : 'color: var(--color-text-muted);'}\"\n >\n <div class=\"flex items-center gap-2 min-w-0\">\n <svg class=\"w-3.5 h-3.5 shrink-0\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d={item.iconSvg} />\n </svg>\n <span class=\"truncate\">{item.label}</span>\n </div>\n {#if item.badge}\n <span class=\"px-1.5 py-0.5 rounded-[5px] text-[9px] font-mono bg-emerald-500/20 text-emerald-600 dark:text-emerald-400 border border-emerald-500/30 shrink-0\">{item.badge}</span>\n {/if}\n </a>\n {/each}\n </div>\n {/if}\n </div>\n {/each}\n </nav>\n </div>\n\n <!-- System Status Footer: Live MCP Gateway -->\n <div class=\"p-4 border-t shrink-0 transition-colors duration-200 w-64\" style=\"border-color: var(--color-border); background-color: var(--color-bg);\">\n <div class=\"flex items-center justify-between text-xs mb-2\" style=\"color: var(--color-text-muted);\">\n <span class=\"flex items-center gap-2\">\n <span class=\"w-2 h-2 rounded-full {uiState.isConnected ? 'bg-emerald-400 shadow-[0_0_8px_rgba(52,211,153,0.8)]' : 'bg-rose-500'}\"></span>\n <span class=\"text-xs font-medium\">{uiState.isConnected ? 'Live MCP Gateway' : 'Disconnected'}</span>\n </span>\n <span class=\"font-mono text-[11px]\" style=\"color: var(--color-text-muted);\">:{health.port || 1404}</span>\n </div>\n <div class=\"text-[10px] flex justify-between pt-1\" style=\"color: var(--color-text-muted);\">\n <span>SQLite FTS5 + Semble</span>\n <span>Localhost</span>\n </div>\n </div>\n </aside>\n\n <!-- Main Content Stage (Expands to Full Width When Sidebar is Collapsed) -->\n <main class=\"flex-1 flex flex-col overflow-hidden pb-16 lg:pb-0 transition-all duration-300 ease-in-out\" style=\"background-color: var(--color-bg); color: var(--color-text);\">\n <!-- Top 4-Gradient Vibrant Accent Stripe -->\n <div class=\"h-1 w-full shrink-0\" style=\"background: var(--theme-4gradient-bar);\"></div>\n\n <!-- Top Header: Brand Logo on Far LEFT + Sidebar Toggle (Mandatory Invariant) -->\n <header class=\"glass-frost h-14 border-b px-4 lg:px-6 flex items-center justify-between shrink-0 transition-colors duration-200\" style=\"background: var(--glass-header), var(--glass-tint); border-color: var(--color-border);\">\n <!-- Far-Left Logo & Title + Sidebar Open/Close Toggle Button -->\n <div class=\"flex items-center gap-3\">\n <!-- Desktop Sidebar Toggle Button -->\n <button\n type=\"button\"\n onclick={toggleSidebar}\n class=\"hidden lg:flex w-8 h-8 rounded-[5px] border items-center justify-center text-xs transition-all hover:scale-105 cursor-pointer shrink-0\"\n style=\"border-color: var(--color-border); background-color: var(--color-surface); color: var(--color-text);\"\n title={isSidebarOpen ? \"Close sidebar to give more space in center\" : \"Open sidebar\"}\n aria-label=\"Toggle sidebar\"\n >\n <svg class=\"w-4 h-4 transition-transform duration-200 {isSidebarOpen ? '' : 'rotate-180'}\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 6h16M4 12h16M4 18h7\" />\n </svg>\n </button>\n\n <div class=\"lg:hidden flex items-center gap-2\">\n <img src=\"/fox_kyubi_64.png\" alt=\"Konoha\" class=\"w-7 h-7 rounded-[5px] border object-cover bg-white\" style=\"border-color: var(--color-primary);\" width=\"28\" height=\"28\" loading=\"eager\" />\n <span class=\"text-sm font-bold tracking-tight\" style=\"color: var(--color-text);\">Konoha</span>\n </div>\n <div class=\"hidden sm:flex items-center gap-2 text-xs\">\n <span class=\"uppercase tracking-widest text-[10px] font-bold\" style=\"color: var(--color-text-muted);\">Dashboard</span>\n <span style=\"color: var(--color-border);\">/</span>\n <span class=\"font-semibold capitalize\" style=\"color: var(--color-primary);\">{page.url.pathname.replace('/', '') || 'dashboard'}</span>\n </div>\n </div>\n\n <!-- Action Buttons & Status -->\n <div class=\"flex items-center gap-3\">\n <div class=\"hidden sm:flex items-center gap-2 px-3 py-1 rounded-[5px] border text-[11px] font-mono\" style=\"background-color: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\">\n <span class=\"w-1.5 h-1.5 rounded-full bg-emerald-400\"></span>\n <span>127.0.0.1:{health.port || 1404}</span>\n </div>\n <span class=\"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-[5px] text-[11px] font-semibold bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20\">\n SSE Active\n </span>\n </div>\n </header>\n\n <!-- Page Body (extra bottom padding clears the mobile dock + theme FAB) -->\n <div class=\"flex-1 overflow-y-auto p-6 pb-28 lg:p-8 lg:pb-8 transition-colors duration-200\" style=\"background-color: var(--color-bg);\">\n {@render children()}\n </div>\n </main>\n\n <!-- Mobile Navigation Dock (Mandatory Invariant — Zero Hamburger Menu in Header) -->\n <nav class=\"glass-frost lg:hidden fixed bottom-0 inset-x-0 z-40 border-t flex flex-nowrap items-center gap-1 overflow-x-auto scrollbar-none py-2 px-2 shadow-2xl transition-colors duration-200\" style=\"background: var(--glass-dock), var(--glass-tint); border-color: var(--color-border); padding-bottom: max(0.5rem, env(safe-area-inset-bottom));\">\n {#each allNavItems as item}\n {@const isActive = page.url.pathname === item.path || (item.path === '/dashboard' && page.url.pathname === '/')}\n <a\n href={item.path}\n class=\"nav-depth flex flex-col items-center gap-1 py-1 px-2.5 rounded-[5px] text-[10px] font-semibold transition-all shrink-0\"\n style=\"{isActive ? 'color: var(--color-primary); background-color: var(--color-primary-glow);' : 'color: var(--color-text-muted);'}\"\n >\n <svg class=\"w-4 h-4 shrink-0\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d={item.iconSvg} />\n </svg>\n <span class=\"whitespace-nowrap\">{item.label}</span>\n </a>\n {/each}\n </nav>\n\n <!-- Floating Theme Switcher Button -->\n <ThemeSwitcher />\n\n <!-- Global 3D SweetAlert Modal -->\n <SweetAlertModal />\n\n <!-- Global Notification Toasts (lifted above the mobile dock on small screens) -->\n {#if uiState.notifications.length > 0}\n <div class=\"fixed bottom-20 right-5 z-[90] lg:bottom-6 lg:right-6 space-y-2 max-w-[calc(100vw-2.5rem)]\">\n {#each uiState.notifications as n (n.id)}\n <div class=\"px-4 py-3 rounded-[5px] text-xs font-semibold shadow-2xl border backdrop-blur-2xl bg-slate-900/95 text-white border-sky-500/50 flex items-center gap-2\">\n <span class=\"w-2 h-2 rounded-full bg-sky-400 animate-ping\"></span>\n <span>{n.text}</span>\n </div>\n {/each}\n </div>\n {/if}\n</div>\n"],"mappings":";;;;;;;;AAGA,IAAa,SAAS;CACpB;EAAE,IAAI;EAAW,MAAM;EAAuB,aAAa;EAAqD,OAAO;EAAW,QAAQ;EAAW,UAAU;GAAC;GAAW;GAAW;GAAW;EAAS;EAAG,MAAM;EAAwB,IAAI;EAAW,SAAS;EAAW,QAAQ;EAAW,OAAO;CAAM;CAC9S;EAAE,IAAI;EAAY,MAAM;EAAuB,aAAa;EAAkC,OAAO;EAAW,QAAQ;EAAW,UAAU;GAAC;GAAW;GAAW;GAAW;EAAS;EAAG,MAAM;EAAyB,IAAI;EAAW,SAAS;EAAW,QAAQ;EAAW,OAAO;CAAM;CAC7R;EAAE,IAAI;EAAe,MAAM;EAAwB,aAAa;EAA8B,OAAO;EAAW,QAAQ;EAAW,UAAU;GAAC;GAAW;GAAW;GAAW;EAAS;EAAG,MAAM;EAAwB,IAAI;EAAW,SAAS;EAAW,QAAQ;EAAW,OAAO;CAAM;CAC5R;EAAE,IAAI;EAAY,MAAM;EAAyB,aAAa;EAAgC,OAAO;EAAW,QAAQ;EAAW,UAAU;GAAC;GAAW;GAAW;GAAW;EAAS;EAAG,MAAM;EAAwB,IAAI;EAAW,SAAS;EAAW,QAAQ;EAAW,OAAO;CAAM;CAC5R;EAAE,IAAI;EAAa,MAAM;EAAwB,aAAa;EAAkC,OAAO;EAAW,QAAQ;EAAW,UAAU;GAAC;GAAW;GAAW;GAAW;EAAS;EAAG,MAAM;EAAwB,IAAI;EAAW,SAAS;EAAW,QAAQ;EAAW,OAAO;CAAM;CAC9R;EAAE,IAAI;EAAe,MAAM;EAAsB,aAAa;EAAmC,OAAO;EAAW,QAAQ;EAAW,UAAU;GAAC;GAAW;G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A,wCAAAH,YAE/D,KAAK,KAAK,EAAA,eAAA;KAE/B,IAAA,KAAK,OACuJ,WAAA,KAAA,0KAAAA,YAAA,KAAK,KAAK,EAAA,QAAA;;;;;;;;EAelJ,WAAA,KAAA,4TAAAD,WAAA,wBAAA,QAAQ,cAAc,yDAAyD,eAAa,EAAA,6CAAAC,YAC5F,QAAQ,cAAc,qBAAqB,cAAc,EAAA,8FAAAA,YAEhB,OAAO,QAAQ,IAAI,EAAA,o9BAAAG,KAAA,SAwBxE,4CAA6D,EAAA,mCAAAJ,WAAA,4CAGI,EAAA,4yBAAAC,YAYX,KAAK,IAAI,SAAS,QAAQ,KAAK,EAAE,KAAK,WAAW,EAAA,0VAAAA,YAQ7G,OAAO,QAAQ,IAAI,EAAA,gXAAA;EAU/B,SAAQ,UAAA;;EAMZ,MAAA,eAAAC,kBAAA,WAAW;;GAAI,IAAA,OAAI,aAAA;GAChB,MAAA,WAAW,KAAK,IAAI,aAAa,KAAK,QAAS,KAAK,SAAS,gBAAgB,KAAK,IAAI,aAAa;GAEnG,WAAA,KAAA,KAAAE,KAAA,QAAA,KAAK,IAAI,EAAA,iIAAAD,WAEP,WAAW,8EAA8E,iCAAiC,EAAA,4JAAAC,KAAA,KAGvD,KAAK,OAAO,EAAA,iDAAAH,YAEtD,KAAK,KAAK,EAAA,YAAA;;;;;;;EAY5C,IAAA,QAAQ,cAAc,SAAS,GAAC;;GAE1B,MAAA,eAAAC,kBAAA,QAAQ,aAAa;;IAAI,IAAA,IAAC,aAAA;IAGtB,WAAA,KAAA,gPAAAD,YAAA,EAAE,IAAI,EAAA,cAAA;;;;;CAtLf,CAAA"}
|
|
@@ -5,11 +5,15 @@ import "../../../chunks/sweetAlert.svelte.js";
|
|
|
5
5
|
//#region src/components/Agents.svelte
|
|
6
6
|
function Agents($$renderer, $$props) {
|
|
7
7
|
$$renderer.component(($$renderer) => {
|
|
8
|
-
$$renderer.push(`<div class="space-y-8 max-w-7xl mx-auto"><div class="
|
|
8
|
+
$$renderer.push(`<div class="space-y-8 max-w-7xl mx-auto"><div class="glass-card-3d relative overflow-hidden rounded-[5px] p-8 border transition-all duration-300" style="background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.85) 100%), var(--color-primary-glow); border-color: var(--color-border); box-shadow: var(--shadow-3d);"><div class="relative z-10 flex flex-col md:flex-row md:items-center justify-between gap-6"><div class="space-y-2"><div class="inline-flex items-center gap-2 px-3 py-1 rounded-[5px] text-xs font-bold border" style="background-color: var(--color-primary-glow); color: var(--color-primary); border-color: var(--color-primary);"><svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path></svg> Official Subagent Roster</div> <h2 class="text-2xl lg:text-3xl font-black tracking-tight" style="color: var(--color-text);">Ninja Subagents (Protected Village Roster)</h2> <p class="text-sm font-semibold max-w-2xl leading-relaxed" style="color: var(--color-text-muted);">Autonomous specialized agents orchestrating tasks, audits, research, and frontend builds. Official ninjas are permanently protected against deletion.</p></div> <div class="flex flex-wrap items-center gap-3 shrink-0"><button type="button" class="btn-3d px-4 py-3 rounded-[5px] text-xs font-bold text-white flex items-center gap-2 cursor-pointer transition-colors shadow-md" style="background: var(--color-primary);"><svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path></svg> Add Custom Ninja</button> <div class="glass-card-3d px-4 py-3 rounded-[5px] border text-center" style="background: var(--color-surface); border-color: var(--color-border);"><div class="text-xs font-bold" style="color: var(--color-text-muted);">Official Roster</div> <div class="text-xl font-black text-emerald-600">7 Protected</div></div> <div class="glass-card-3d px-4 py-3 rounded-[5px] border text-center" style="background: var(--color-surface); border-color: var(--color-border);"><div class="text-xs font-bold" style="color: var(--color-text-muted);">Skills Bound</div> <div class="text-xl font-black text-purple-600">${escape_html(0)} Indexed</div></div></div></div></div> `);
|
|
9
9
|
$$renderer.push("<!--[-1-->");
|
|
10
10
|
$$renderer.push(`<!--]--> `);
|
|
11
11
|
$$renderer.push(`<!--[0--><div class="flex items-center justify-center py-16 text-slate-600 text-sm font-semibold"><div class="flex items-center gap-3"><svg class="animate-spin w-5 h-5 text-purple-600" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8v8H4z"></path></svg> <span>Loading Ninja roster...</span></div></div>`);
|
|
12
|
-
$$renderer.push(`<!--]--></div
|
|
12
|
+
$$renderer.push(`<!--]--></div> `);
|
|
13
|
+
$$renderer.push("<!--[-1-->");
|
|
14
|
+
$$renderer.push(`<!--]--> `);
|
|
15
|
+
$$renderer.push("<!--[-1-->");
|
|
16
|
+
$$renderer.push(`<!--]-->`);
|
|
13
17
|
});
|
|
14
18
|
}
|
|
15
19
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_page.svelte.js","names":["$.escape","$.ensure_array_like","$.attr","$.attr_class"],"sources":["../../../../../src/components/Agents.svelte","../../../../../src/routes/agents/+page.svelte"],"sourcesContent":["<script>\n import { onMount } from \"svelte\";\n import { api } from \"#lib/api.js\";\n import { sweetAlert } from \"#lib/sweetAlert.svelte.js\";\n\n let agents = $state([]);\n let allSkills = $state([]);\n let bridgeModels = $state([]);\n let loading = $state(true);\n let error = $state(\"\");\n\n const rankIcons = {\n sannin: \"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z\",\n kage: \"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z\",\n jonin: \"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01\",\n anbu: \"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\",\n chunin: \"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9\",\n genin: \"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\",\n \"tokubetsu-jonin\": \"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\"\n };\n\n const OFFICIAL_SKILLS = [\n \"sannin-skill\",\n \"genin-skill\",\n \"kage-skill\",\n \"chunin-skill\",\n \"jonin-skill\",\n \"anbu-skill\",\n \"tokubetsu-jonin-skill\",\n \"konoha\",\n \"antislop\",\n \"i-have-adhd\"\n ];\n\n function getSkillsForAgent(agent) {\n const activeList = agent.skills || [];\n const activeSet = new Set(activeList);\n const result = [...activeList];\n OFFICIAL_SKILLS.forEach(s => {\n if (!activeSet.has(s)) {\n result.push(s);\n }\n });\n return result;\n }\n\n async function loadData() {\n loading = true;\n error = \"\";\n try {\n agents = await api.get(\"/api/v1/agents\");\n const skills = await api.get(\"/api/v1/skills?limit=1000\");\n const set = new Set(OFFICIAL_SKILLS);\n (skills || []).forEach(s => {\n if (s.name) set.add(s.name);\n if (s.skill_name) set.add(s.skill_name);\n });\n (agents || []).forEach(a => {\n (a.skills || []).forEach(s => set.add(s));\n });\n allSkills = Array.from(set).sort();\n try {\n const modelsRes = await api.get(\"/api/v1/bridges/models\");\n bridgeModels = modelsRes.models || [];\n } catch (_) {\n bridgeModels = [];\n }\n } catch (err) {\n error = err.message;\n } finally {\n loading = false;\n }\n }\n\n async function toggleSkill(agent, skillName, currentChecked) {\n const targetState = !currentChecked;\n try {\n await api.patch(\n \"/api/v1/agents/\" + encodeURIComponent(agent.name) + \"/skills/\" + encodeURIComponent(skillName),\n { embedded: targetState }\n );\n if (targetState) {\n if (!agent.skills) agent.skills = [];\n if (!agent.skills.includes(skillName)) agent.skills.push(skillName);\n } else if (agent.skills) {\n agent.skills = agent.skills.filter(s => s !== skillName);\n }\n agents = [...agents];\n } catch (err) {\n await sweetAlert.fire({\n title: \"Toggle Failed\",\n text: err.message,\n icon: \"error\"\n });\n }\n }\n\n async function setAgentModel(agent, modelId) {\n const target = modelId === \"\" ? null : modelId;\n try {\n await api.patch(\n \"/api/v1/agents/\" + encodeURIComponent(agent.name) + \"/model\",\n { model: target }\n );\n if (target) {\n agent.model = target;\n } else {\n delete agent.model;\n }\n agents = [...agents];\n } catch (err) {\n await sweetAlert.fire({\n title: \"Model Assignment Failed\",\n text: err.message,\n icon: \"error\"\n });\n }\n }\n\n onMount(loadData);\n</script>\n\n<div class=\"space-y-8 max-w-7xl mx-auto\">\n <!-- Hero Section with Light Glass Gradient & High Contrast Typography -->\n <div\n class=\"rise-3d relative overflow-hidden rounded-3xl p-8 border shadow-xl transition-all duration-300\"\n style=\"background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.82) 100%), var(--color-primary-glow); border-color: var(--color-border); box-shadow: var(--shadow-3d);\"\n >\n <div class=\"relative z-10 flex flex-col md:flex-row md:items-center justify-between gap-6\">\n <div class=\"space-y-2\">\n <div class=\"inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold border\" style=\"background-color: var(--color-primary-glow); color: var(--color-primary); border-color: var(--color-primary);\">\n <svg class=\"w-3.5 h-3.5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z\" />\n </svg>\n Official Subagent Roster\n </div>\n <h2 class=\"text-2xl lg:text-3xl font-black text-slate-900 tracking-tight\">\n Ninja Subagents (7 Ranks)\n </h2>\n <p class=\"text-sm font-semibold text-slate-700 max-w-2xl leading-relaxed\">\n Autonomous specialized agents orchestrating tasks, audits, research, and frontend builds. Each rank embeds specialized SQLite skill references.\n </p>\n </div>\n\n <div class=\"flex flex-wrap items-center gap-3 shrink-0\">\n <div class=\"glass-card-3d px-4 py-3 rounded-2xl border text-center\">\n <div class=\"text-xs font-bold text-slate-600\">Total Ranks</div>\n <div class=\"text-xl font-black text-emerald-600\">7 Active</div>\n </div>\n <div class=\"glass-card-3d px-4 py-3 rounded-2xl border text-center\">\n <div class=\"text-xs font-bold text-slate-600\">Skills Bound</div>\n <div class=\"text-xl font-black text-purple-600\">{allSkills.length} Indexed</div>\n </div>\n </div>\n </div>\n </div>\n\n {#if error}\n <div class=\"p-4 rounded-2xl border border-rose-200 bg-rose-50 text-rose-800 text-xs font-semibold\">\n {error}\n </div>\n {/if}\n\n {#if loading}\n <div class=\"flex items-center justify-center py-16 text-slate-600 text-sm font-semibold\">\n <div class=\"flex items-center gap-3\">\n <svg class=\"animate-spin w-5 h-5 text-purple-600\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path class=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8v8H4z\"></path>\n </svg>\n <span>Loading Ninja roster...</span>\n </div>\n </div>\n {:else}\n <div class=\"scene-3d grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6\">\n {#each agents as agent}\n <div class=\"glass-card-3d tilt-3d flex flex-col justify-between p-6 rounded-3xl border\">\n <div>\n <!-- Agent Header -->\n <div class=\"flex items-start justify-between gap-4 mb-4\">\n <div class=\"flex items-center gap-3\">\n <div class=\"w-12 h-12 rounded-2xl bg-purple-50 border border-purple-200 flex items-center justify-center text-purple-700 shadow-sm shrink-0\">\n <svg class=\"w-6 h-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d={rankIcons[agent.name] || \"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z\"} />\n </svg>\n </div>\n <div>\n <h3 class=\"text-base font-black text-slate-900 tracking-tight\">\n @{agent.name}\n </h3>\n <span class=\"inline-block text-[11px] font-bold text-purple-700 uppercase tracking-wider\">\n {agent.title || \"Ninja Subagent\"}\n </span>\n </div>\n </div>\n <span class=\"px-2.5 py-0.5 rounded-full text-[10px] font-mono font-bold bg-slate-100 text-slate-700 border border-slate-200 shrink-0\">\n {agent.skills ? agent.skills.length : 0} skills\n </span>\n </div>\n\n <p class=\"text-xs font-semibold text-slate-700 mb-4 leading-relaxed\">\n {agent.description}\n </p>\n\n <!-- Model Assignment Section (bridge-served models) -->\n <div class=\"space-y-2 mb-6\">\n <div class=\"flex items-center justify-between text-xs font-bold text-slate-800\">\n <span>Model Assignment</span>\n {#if agent.model}\n <span class=\"px-2 py-0.5 rounded-full text-[10px] font-mono font-bold bg-emerald-50 text-emerald-700 border border-emerald-200\">\n assigned\n </span>\n {:else}\n <span class=\"px-2 py-0.5 rounded-full text-[10px] font-mono font-bold bg-slate-100 text-slate-500 border border-slate-200\">\n inherit\n </span>\n {/if}\n </div>\n {#if bridgeModels.length > 0}\n <select\n value={agent.model || \"\"}\n onchange={(e) => setAgentModel(agent, e.currentTarget.value)}\n class=\"w-full p-2 rounded-xl border border-slate-200 bg-white/70 text-xs font-mono font-bold text-slate-700 cursor-pointer focus:ring-purple-500 focus:border-purple-400\"\n >\n <option value=\"\">⤺ Inherit (host client default)</option>\n {#each bridgeModels as m}\n <option value={m.id}>{m.id}</option>\n {/each}\n </select>\n {:else}\n <p class=\"p-2 rounded-xl border border-dashed border-slate-200 bg-white/50 text-[11px] font-semibold text-slate-500\">\n {agent.model || \"inherit\"} — no bridge-served models available. Start a bridge in the Bridges page to pick models.\n </p>\n {/if}\n </div>\n\n <!-- Embedded Skills Section -->\n <div class=\"space-y-3 pt-4 border-t border-slate-200\">\n <div class=\"flex items-center justify-between text-xs font-bold text-slate-800\">\n <span>Embedded Skill References</span>\n <span class=\"text-slate-500 font-mono text-[11px]\">{agent.skills ? agent.skills.length : 0} active</span>\n </div>\n\n <div class=\"space-y-1.5 max-h-56 overflow-y-auto pr-1\">\n {#each getSkillsForAgent(agent) as skill}\n {@const isChecked = agent.skills && agent.skills.includes(skill)}\n <label class=\"flex items-center justify-between p-2 rounded-xl border border-slate-200 bg-white/70 hover:bg-purple-50/50 transition-colors cursor-pointer text-xs\">\n <div class=\"flex items-center gap-2 min-w-0 pr-2\">\n <span class=\"font-mono text-xs font-bold {isChecked ? 'text-slate-900' : 'text-slate-400'} truncate\" title={skill}>\n {skill}\n </span>\n {#if isChecked}\n <span class=\"px-1.5 py-0.5 rounded text-[9px] font-mono font-bold bg-purple-50 text-purple-700 border border-purple-200 shrink-0\">\n active\n </span>\n {/if}\n </div>\n <input\n type=\"checkbox\"\n checked={isChecked}\n onchange={() => toggleSkill(agent, skill, isChecked)}\n class=\"rounded border-slate-300 text-purple-600 focus:ring-purple-500 w-4 h-4 cursor-pointer shrink-0 ml-2\"\n />\n </label>\n {/each}\n </div>\n </div>\n </div>\n </div>\n {/each}\n </div>\n {/if}\n</div>\n","<script>\n import Agents from '../../components/Agents.svelte';\n</script>\n\n<Agents />\n"],"mappings":";;;;;;CAAA,WAAA,WAAA,eAAA;EAuJ2D,WAAA,KAAA,m3DAAAA,YAAA,CAAgB,EAAA,wCAAA;;;EAYpE,WAAA,KAAA,mcAAA;;CA3CC,CAAA;;;;ACxHR,SAAA,MAAA,YAAA;;AAEQ"}
|
|
1
|
+
{"version":3,"file":"_page.svelte.js","names":["$.escape","$.ensure_array_like","$.attr","$.attr_class"],"sources":["../../../../../src/components/Agents.svelte","../../../../../src/routes/agents/+page.svelte"],"sourcesContent":["<script>\n import { onMount } from \"svelte\";\n import { api, apiRequest } from \"#lib/api.js\";\n import { sweetAlert } from \"#lib/sweetAlert.svelte.js\";\n\n let agents = $state([]);\n let allSkills = $state([]);\n let bridgeModels = $state([]);\n let loading = $state(true);\n let error = $state(\"\");\n\n const rankIcons = {\n sannin: \"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z\",\n kage: \"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z\",\n jonin: \"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01\",\n anbu: \"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\",\n chunin: \"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9\",\n genin: \"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\",\n \"tokubetsu-jonin\": \"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\"\n };\n\n const OFFICIAL_AGENTS = new Set([\n 'sannin',\n 'genin',\n 'kage',\n 'chunin',\n 'jonin',\n 'anbu',\n 'tokubetsu-jonin'\n ]);\n\n function isOfficialAgent(name) {\n if (!name) return false;\n const clean = String(name).toLowerCase().replace(/^(mcp_|_mcp_|mcp-)/, '');\n return OFFICIAL_AGENTS.has(clean);\n }\n\n const OFFICIAL_SKILLS = [\n \"sannin-skill\",\n \"genin-skill\",\n \"kage-skill\",\n \"chunin-skill\",\n \"jonin-skill\",\n \"anbu-skill\",\n \"tokubetsu-jonin-skill\",\n \"konoha\",\n \"antislop\",\n \"i-have-adhd\"\n ];\n\n function getSkillsForAgent(agent) {\n const activeList = agent.skills || [];\n const activeSet = new Set(activeList);\n const result = [...activeList];\n OFFICIAL_SKILLS.forEach(s => {\n if (!activeSet.has(s)) {\n result.push(s);\n }\n });\n return result;\n }\n\n async function loadData() {\n loading = true;\n error = \"\";\n try {\n agents = await api.get(\"/api/v1/agents\");\n const skills = await api.get(\"/api/v1/skills?limit=1000\");\n const set = new Set(OFFICIAL_SKILLS);\n (skills || []).forEach(s => {\n if (s.name) set.add(s.name);\n if (s.skill_name) set.add(s.skill_name);\n });\n (agents || []).forEach(a => {\n (a.skills || []).forEach(s => set.add(s));\n });\n allSkills = Array.from(set).sort();\n try {\n const modelsRes = await api.get(\"/api/v1/bridges/models\");\n bridgeModels = modelsRes.models || [];\n } catch (_) {\n bridgeModels = [];\n }\n } catch (err) {\n error = err.message;\n } finally {\n loading = false;\n }\n }\n\n async function toggleSkill(agent, skillName, currentChecked) {\n const targetState = !currentChecked;\n try {\n await api.patch(\n \"/api/v1/agents/\" + encodeURIComponent(agent.name) + \"/skills/\" + encodeURIComponent(skillName),\n { embedded: targetState }\n );\n if (targetState) {\n if (!agent.skills) agent.skills = [];\n if (!agent.skills.includes(skillName)) agent.skills.push(skillName);\n } else if (agent.skills) {\n agent.skills = agent.skills.filter(s => s !== skillName);\n }\n agents = [...agents];\n } catch (err) {\n await sweetAlert.fire({\n title: \"Toggle Failed\",\n text: err.message,\n icon: \"error\"\n });\n }\n }\n\n async function setAgentModel(agent, modelId) {\n const target = modelId === \"\" ? null : modelId;\n try {\n await api.patch(\n \"/api/v1/agents/\" + encodeURIComponent(agent.name) + \"/model\",\n { model: target }\n );\n if (target) {\n agent.model = target;\n } else {\n delete agent.model;\n }\n agents = [...agents];\n } catch (err) {\n await sweetAlert.fire({\n title: \"Model Assignment Failed\",\n text: err.message,\n icon: \"error\"\n });\n }\n }\n\n let showCreateModal = $state(false);\n let createName = $state(\"\");\n let createTitle = $state(\"\");\n let createPurpose = $state(\"\");\n let createDescription = $state(\"\");\n let createInstructions = $state(\"\");\n let createModel = $state(\"\");\n let createSubmitting = $state(false);\n\n let showEditModal = $state(false);\n let editAgentTarget = $state(null);\n let editTitle = $state(\"\");\n let editPurpose = $state(\"\");\n let editDescription = $state(\"\");\n let editInstructions = $state(\"\");\n let editModel = $state(\"\");\n let editSubmitting = $state(false);\n\n function openCreateModal() {\n createName = \"\";\n createTitle = \"\";\n createPurpose = \"\";\n createDescription = \"\";\n createInstructions = \"\";\n createModel = \"\";\n showCreateModal = true;\n }\n\n function openEditModal(agent) {\n if (isOfficialAgent(agent.name)) {\n sweetAlert.fire({\n title: \"Protected Official Ninja\",\n text: `Subagent \"@${agent.name}\" is a protected official Konoha ninja agent. Core attributes are immutable. You can toggle models and skills directly on the card.`,\n icon: \"info\"\n });\n return;\n }\n editAgentTarget = agent;\n editTitle = agent.title || \"\";\n editPurpose = agent.purpose || \"\";\n editDescription = agent.description || \"\";\n editInstructions = agent.instructions || \"\";\n editModel = agent.model || \"\";\n showEditModal = true;\n }\n\n async function handleCreateAgent() {\n if (!createName.trim()) {\n await sweetAlert.fire({ title: \"Name Required\", text: \"Please enter a name for the custom ninja.\", icon: \"warning\" });\n return;\n }\n createSubmitting = true;\n try {\n await api.post(\"/api/v1/agents\", {\n name: createName.trim(),\n title: createTitle.trim() || undefined,\n purpose: createPurpose.trim() || undefined,\n description: createDescription.trim() || undefined,\n instructions: createInstructions.trim() || undefined,\n model: createModel.trim() || null\n });\n await sweetAlert.fire({ title: \"Ninja Created\", text: `Custom subagent \"@${createName.trim()}\" has been created.`, icon: \"success\" });\n showCreateModal = false;\n await loadData();\n } catch (err) {\n await sweetAlert.fire({ title: \"Creation Failed\", text: err.message, icon: \"error\" });\n } finally {\n createSubmitting = false;\n }\n }\n\n async function handleUpdateAgent() {\n if (!editAgentTarget) return;\n editSubmitting = true;\n try {\n await api.put(`/api/v1/agents/${encodeURIComponent(editAgentTarget.name)}`, {\n title: editTitle.trim(),\n purpose: editPurpose.trim(),\n description: editDescription.trim(),\n instructions: editInstructions.trim(),\n model: editModel.trim() || null\n });\n await sweetAlert.fire({ title: \"Ninja Updated\", text: `Custom subagent \"@${editAgentTarget.name}\" updated successfully.`, icon: \"success\" });\n showEditModal = false;\n await loadData();\n } catch (err) {\n await sweetAlert.fire({ title: \"Update Failed\", text: err.message, icon: \"error\" });\n } finally {\n editSubmitting = false;\n }\n }\n\n async function deleteCustomAgent(name) {\n if (isOfficialAgent(name)) {\n await sweetAlert.fire({\n title: \"Protected Official Ninja\",\n text: `Subagent \"@${name}\" is a protected official Konoha ninja agent and cannot be deleted.`,\n icon: \"warning\"\n });\n return;\n }\n\n const confirmed = await sweetAlert.fire({\n title: \"Delete Custom Agent?\",\n text: `Are you sure you want to delete custom agent \"@${name}\"?`,\n icon: \"warning\",\n showCancelButton: true,\n confirmButtonText: \"Delete\",\n cancelButtonText: \"Cancel\"\n });\n\n if (!confirmed) return;\n\n try {\n await api.delete(`/api/v1/agents/${encodeURIComponent(name)}`);\n await sweetAlert.fire({\n title: \"Agent Deleted\",\n text: `Custom agent \"@${name}\" has been deleted.`,\n icon: \"success\"\n });\n await loadData();\n } catch (err) {\n await sweetAlert.fire({\n title: \"Deletion Failed\",\n text: err.message,\n icon: \"error\"\n });\n }\n }\n\n onMount(loadData);\n</script>\n\n<div class=\"space-y-8 max-w-7xl mx-auto\">\n <!-- Hero Section with Light Glass Gradient & High Contrast Typography -->\n <div\n class=\"glass-card-3d relative overflow-hidden rounded-[5px] p-8 border transition-all duration-300\"\n style=\"background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.85) 100%), var(--color-primary-glow); border-color: var(--color-border); box-shadow: var(--shadow-3d);\"\n >\n <div class=\"relative z-10 flex flex-col md:flex-row md:items-center justify-between gap-6\">\n <div class=\"space-y-2\">\n <div class=\"inline-flex items-center gap-2 px-3 py-1 rounded-[5px] text-xs font-bold border\" style=\"background-color: var(--color-primary-glow); color: var(--color-primary); border-color: var(--color-primary);\">\n <svg class=\"w-3.5 h-3.5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z\" />\n </svg>\n Official Subagent Roster\n </div>\n <h2 class=\"text-2xl lg:text-3xl font-black tracking-tight\" style=\"color: var(--color-text);\">\n Ninja Subagents (Protected Village Roster)\n </h2>\n <p class=\"text-sm font-semibold max-w-2xl leading-relaxed\" style=\"color: var(--color-text-muted);\">\n Autonomous specialized agents orchestrating tasks, audits, research, and frontend builds. Official ninjas are permanently protected against deletion.\n </p>\n </div>\n\n <div class=\"flex flex-wrap items-center gap-3 shrink-0\">\n <button\n type=\"button\"\n onclick={openCreateModal}\n class=\"btn-3d px-4 py-3 rounded-[5px] text-xs font-bold text-white flex items-center gap-2 cursor-pointer transition-colors shadow-md\"\n style=\"background: var(--color-primary);\"\n >\n <svg class=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 4v16m8-8H4\" />\n </svg>\n Add Custom Ninja\n </button>\n <div class=\"glass-card-3d px-4 py-3 rounded-[5px] border text-center\" style=\"background: var(--color-surface); border-color: var(--color-border);\">\n <div class=\"text-xs font-bold\" style=\"color: var(--color-text-muted);\">Official Roster</div>\n <div class=\"text-xl font-black text-emerald-600\">7 Protected</div>\n </div>\n <div class=\"glass-card-3d px-4 py-3 rounded-[5px] border text-center\" style=\"background: var(--color-surface); border-color: var(--color-border);\">\n <div class=\"text-xs font-bold\" style=\"color: var(--color-text-muted);\">Skills Bound</div>\n <div class=\"text-xl font-black text-purple-600\">{allSkills.length} Indexed</div>\n </div>\n </div>\n </div>\n </div>\n\n {#if error}\n <div class=\"p-4 rounded-[5px] border border-rose-200 bg-rose-50 text-rose-800 text-xs font-semibold\">\n {error}\n </div>\n {/if}\n\n {#if loading}\n <div class=\"flex items-center justify-center py-16 text-slate-600 text-sm font-semibold\">\n <div class=\"flex items-center gap-3\">\n <svg class=\"animate-spin w-5 h-5 text-purple-600\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path class=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8v8H4z\"></path>\n </svg>\n <span>Loading Ninja roster...</span>\n </div>\n </div>\n {:else}\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6\">\n {#each agents as agent}\n <div\n class=\"glass-card-3d flex flex-col justify-between p-6 rounded-[5px] border\"\n style=\"background: var(--glass-card); border-color: var(--color-border); box-shadow: var(--shadow-3d);\"\n >\n <div>\n <!-- Agent Header -->\n <div class=\"flex items-start justify-between gap-4 mb-4\">\n <div class=\"flex items-center gap-3\">\n <div class=\"w-11 h-11 rounded-[5px] border flex items-center justify-center shadow-sm shrink-0\" style=\"background: var(--color-primary-glow); border-color: var(--color-primary); color: var(--color-primary);\">\n <svg class=\"w-5 h-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d={rankIcons[agent.name] || \"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z\"} />\n </svg>\n </div>\n <div>\n <h3 class=\"text-base font-black tracking-tight\" style=\"color: var(--color-text);\">\n @{agent.name}\n </h3>\n <span class=\"inline-block text-[11px] font-bold uppercase tracking-wider\" style=\"color: var(--color-primary);\">\n {agent.title || \"Ninja Subagent\"}\n </span>\n </div>\n </div>\n\n <div class=\"flex flex-col items-end gap-1\">\n {#if isOfficialAgent(agent.name)}\n <span class=\"px-2 py-0.5 rounded-[5px] text-[10px] font-bold bg-amber-50 text-amber-700 border border-amber-300\" title=\"Protected Village Ninja - Cannot be deleted\">\n 🛡️ Protected\n </span>\n {:else}\n <div class=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onclick={() => openEditModal(agent)}\n class=\"p-1 rounded-[5px] text-slate-400 hover:text-blue-600 hover:bg-blue-50 transition-colors cursor-pointer\"\n title=\"Edit custom ninja\"\n >\n <svg class=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z\" />\n </svg>\n </button>\n <button\n type=\"button\"\n onclick={() => deleteCustomAgent(agent.name)}\n class=\"p-1 rounded-[5px] text-slate-400 hover:text-rose-600 hover:bg-rose-50 transition-colors cursor-pointer\"\n title=\"Delete custom agent\"\n >\n <svg class=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" />\n </svg>\n </button>\n </div>\n {/if}\n <span class=\"px-2 py-0.5 rounded-[5px] text-[10px] font-mono font-bold border\" style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text-muted);\">\n {agent.skills ? agent.skills.length : 0} skills\n </span>\n </div>\n </div>\n\n <p class=\"text-xs font-semibold mb-4 leading-relaxed\" style=\"color: var(--color-text-muted);\">\n {agent.description}\n </p>\n\n <!-- Model Assignment Section (bridge-served models) -->\n <div class=\"space-y-2 mb-6\">\n <div class=\"flex items-center justify-between text-xs font-bold\" style=\"color: var(--color-text);\">\n <span>Model Assignment</span>\n {#if agent.model}\n <span class=\"px-2 py-0.5 rounded-[5px] text-[10px] font-mono font-bold bg-emerald-50 text-emerald-700 border border-emerald-300\">\n assigned\n </span>\n {:else}\n <span class=\"px-2 py-0.5 rounded-[5px] text-[10px] font-mono font-bold border\" style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text-muted);\">\n inherit\n </span>\n {/if}\n </div>\n {#if bridgeModels.length > 0}\n <select\n value={agent.model || \"\"}\n onchange={(e) => setAgentModel(agent, e.currentTarget.value)}\n class=\"w-full p-2 rounded-[5px] border text-xs font-mono font-bold cursor-pointer\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n >\n <option value=\"\">⤺ Inherit (host client default)</option>\n {#each bridgeModels as m}\n <option value={m.id}>{m.id}</option>\n {/each}\n </select>\n {:else}\n <p class=\"p-2 rounded-[5px] border border-dashed text-[11px] font-semibold\" style=\"border-color: var(--color-border); color: var(--color-text-muted); background: rgba(0, 0, 0, 0.02);\">\n {agent.model || \"inherit\"} — no bridge models active.\n </p>\n {/if}\n </div>\n\n <!-- Embedded Skills Section -->\n <div class=\"space-y-3 pt-4 border-t\" style=\"border-color: var(--color-border);\">\n <div class=\"flex items-center justify-between text-xs font-bold\" style=\"color: var(--color-text);\">\n <span>Embedded Skill References</span>\n <span class=\"font-mono text-[11px]\" style=\"color: var(--color-text-muted);\">{agent.skills ? agent.skills.length : 0} active</span>\n </div>\n\n <div class=\"space-y-1.5 max-h-56 overflow-y-auto pr-1\">\n {#each getSkillsForAgent(agent) as skill}\n {@const isChecked = agent.skills && agent.skills.includes(skill)}\n <label class=\"flex items-center justify-between p-2 rounded-[5px] border cursor-pointer text-xs transition-colors hover:bg-black/5\" style=\"background: var(--color-surface); border-color: var(--color-border);\">\n <div class=\"flex items-center gap-2 min-w-0 pr-2\">\n <span class=\"font-mono text-xs font-bold truncate {isChecked ? '' : 'opacity-50'}\" style=\"color: var(--color-text);\" title={skill}>\n {skill}\n </span>\n {#if isChecked}\n <span class=\"px-1.5 py-0.5 rounded-[5px] text-[9px] font-mono font-bold bg-purple-50 text-purple-700 border border-purple-200 shrink-0\">\n active\n </span>\n {/if}\n </div>\n <input\n type=\"checkbox\"\n checked={isChecked}\n onchange={() => toggleSkill(agent, skill, isChecked)}\n class=\"rounded-[3px] w-4 h-4 cursor-pointer shrink-0 ml-2\"\n style=\"accent-color: var(--color-primary);\"\n />\n </label>\n {/each}\n </div>\n </div>\n </div>\n </div>\n {/each}\n </div>\n {/if}\n</div>\n\n<!-- Create Custom Ninja Modal -->\n{#if showCreateModal}\n <!-- svelte-ignore a11y_click_events_have_key_events -->\n <!-- svelte-ignore a11y_no_static_element_interactions -->\n <div\n role=\"presentation\"\n class=\"fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-900/35 backdrop-blur-sm animate-in fade-in duration-150\"\n onclick={(e) => { if (e.target === e.currentTarget) showCreateModal = false; }}\n >\n <div\n class=\"modal-card w-full max-w-lg max-h-[90vh] overflow-y-auto p-6 sm:p-8 rounded-[5px] border shadow-2xl space-y-5 animate-in zoom-in-95 duration-150 glass-frost-strong\"\n style=\"background-color: var(--color-surface); border-color: var(--color-border); color: var(--color-text); box-shadow: var(--shadow-3d);\"\n onclick={(e) => e.stopPropagation()}\n >\n <div class=\"flex items-center justify-between pb-3 border-b\" style=\"border-color: var(--color-border);\">\n <div class=\"flex items-center gap-2.5\">\n <div class=\"w-8 h-8 rounded-[5px] flex items-center justify-center font-bold text-xs text-white\" style=\"background: var(--color-primary);\">\n 🥷\n </div>\n <div>\n <h3 class=\"text-base font-bold\" style=\"color: var(--color-text);\">Create Custom Ninja Subagent</h3>\n <p class=\"text-xs\" style=\"color: var(--color-text-muted);\">Configure name, role, and custom instructions</p>\n </div>\n </div>\n <button\n type=\"button\"\n onclick={() => { showCreateModal = false; }}\n class=\"w-7 h-7 rounded-[5px] flex items-center justify-center text-xs font-bold border transition-colors hover:scale-105 cursor-pointer\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text-muted);\"\n >\n ✕\n </button>\n </div>\n\n <div class=\"space-y-4 text-xs\">\n <div>\n <label for=\"create-ninja-name\" class=\"font-bold block mb-1\" style=\"color: var(--color-text);\">\n Subagent Name <span class=\"text-rose-500\">*</span>\n </label>\n <input\n id=\"create-ninja-name\"\n type=\"text\"\n bind:value={createName}\n placeholder=\"e.g. shinobi, auditor, visualizer\"\n class=\"w-full px-3 py-2 text-xs rounded-[5px] border focus:outline-hidden\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n />\n <p class=\"text-[11px] mt-1\" style=\"color: var(--color-text-muted);\">\n Unique identifier. Alphanumeric, underscores, or hyphens.\n </p>\n </div>\n\n <div>\n <label for=\"create-ninja-title\" class=\"font-bold block mb-1\" style=\"color: var(--color-text);\">Title</label>\n <input\n id=\"create-ninja-title\"\n type=\"text\"\n bind:value={createTitle}\n placeholder=\"e.g. Visual Ninja Specialist\"\n class=\"w-full px-3 py-2 text-xs rounded-[5px] border focus:outline-hidden\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n />\n </div>\n\n <div>\n <label for=\"create-ninja-purpose\" class=\"font-bold block mb-1\" style=\"color: var(--color-text);\">Purpose</label>\n <input\n id=\"create-ninja-purpose\"\n type=\"text\"\n bind:value={createPurpose}\n placeholder=\"e.g. Specialized UI component generator\"\n class=\"w-full px-3 py-2 text-xs rounded-[5px] border focus:outline-hidden\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n />\n </div>\n\n <div>\n <label for=\"create-ninja-desc\" class=\"font-bold block mb-1\" style=\"color: var(--color-text);\">Description</label>\n <textarea\n id=\"create-ninja-desc\"\n rows=\"2\"\n bind:value={createDescription}\n placeholder=\"Brief explanation of when to dispatch this subagent...\"\n class=\"w-full px-3 py-2 text-xs rounded-[5px] border focus:outline-hidden resize-y\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n ></textarea>\n </div>\n\n <div>\n <label for=\"create-ninja-inst\" class=\"font-bold block mb-1\" style=\"color: var(--color-text);\">System Instructions</label>\n <textarea\n id=\"create-ninja-inst\"\n rows=\"3\"\n bind:value={createInstructions}\n placeholder=\"Prompt and standard operating procedures for this agent...\"\n class=\"w-full px-3 py-2 text-xs font-mono rounded-[5px] border focus:outline-hidden resize-y\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n ></textarea>\n </div>\n\n {#if bridgeModels.length > 0}\n <div>\n <label for=\"create-ninja-model\" class=\"font-bold block mb-1\" style=\"color: var(--color-text);\">Default Model (Optional)</label>\n <select\n id=\"create-ninja-model\"\n bind:value={createModel}\n class=\"w-full px-3 py-2 text-xs rounded-[5px] border focus:outline-hidden\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n >\n <option value=\"\">(Inherit parent model)</option>\n {#each bridgeModels as m}\n <option value={m.id}>{m.id} ({m.provider})</option>\n {/each}\n </select>\n </div>\n {/if}\n </div>\n\n <div class=\"flex justify-end gap-2.5 pt-3 border-t\" style=\"border-color: var(--color-border);\">\n <button\n type=\"button\"\n onclick={() => { showCreateModal = false; }}\n class=\"btn-3d px-4 py-2 text-xs font-bold rounded-[5px] border cursor-pointer\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n disabled={createSubmitting}\n onclick={handleCreateAgent}\n class=\"btn-3d px-4 py-2 text-xs font-bold rounded-[5px] text-white cursor-pointer\"\n style=\"background: var(--color-primary);\"\n >\n {createSubmitting ? \"Creating...\" : \"Create Ninja\"}\n </button>\n </div>\n </div>\n </div>\n{/if}\n\n<!-- Edit Custom Ninja Modal -->\n{#if showEditModal && editAgentTarget}\n <!-- svelte-ignore a11y_click_events_have_key_events -->\n <!-- svelte-ignore a11y_no_static_element_interactions -->\n <div\n role=\"presentation\"\n class=\"fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-900/35 backdrop-blur-sm animate-in fade-in duration-150\"\n onclick={(e) => { if (e.target === e.currentTarget) showEditModal = false; }}\n >\n <div\n class=\"modal-card w-full max-w-lg max-h-[90vh] overflow-y-auto p-6 sm:p-8 rounded-[5px] border shadow-2xl space-y-5 animate-in zoom-in-95 duration-150 glass-frost-strong\"\n style=\"background-color: var(--color-surface); border-color: var(--color-border); color: var(--color-text); box-shadow: var(--shadow-3d);\"\n onclick={(e) => e.stopPropagation()}\n >\n <div class=\"flex items-center justify-between pb-3 border-b\" style=\"border-color: var(--color-border);\">\n <div class=\"flex items-center gap-2.5\">\n <div class=\"w-8 h-8 rounded-[5px] flex items-center justify-center font-bold text-xs text-white\" style=\"background: var(--color-primary);\">\n ✏️\n </div>\n <div>\n <h3 class=\"text-base font-bold\" style=\"color: var(--color-text);\">Edit Custom Ninja @{editAgentTarget.name}</h3>\n <p class=\"text-xs\" style=\"color: var(--color-text-muted);\">Update custom title, role, and instructions</p>\n </div>\n </div>\n <button\n type=\"button\"\n onclick={() => { showEditModal = false; }}\n class=\"w-7 h-7 rounded-[5px] flex items-center justify-center text-xs font-bold border transition-colors hover:scale-105 cursor-pointer\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text-muted);\"\n >\n ✕\n </button>\n </div>\n\n <div class=\"space-y-4 text-xs\">\n <div>\n <label for=\"edit-ninja-title\" class=\"font-bold block mb-1\" style=\"color: var(--color-text);\">Title</label>\n <input\n id=\"edit-ninja-title\"\n type=\"text\"\n bind:value={editTitle}\n placeholder=\"e.g. Visual Ninja Specialist\"\n class=\"w-full px-3 py-2 text-xs rounded-[5px] border focus:outline-hidden\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n />\n </div>\n\n <div>\n <label for=\"edit-ninja-purpose\" class=\"font-bold block mb-1\" style=\"color: var(--color-text);\">Purpose</label>\n <input\n id=\"edit-ninja-purpose\"\n type=\"text\"\n bind:value={editPurpose}\n placeholder=\"e.g. Specialized UI component generator\"\n class=\"w-full px-3 py-2 text-xs rounded-[5px] border focus:outline-hidden\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n />\n </div>\n\n <div>\n <label for=\"edit-ninja-desc\" class=\"font-bold block mb-1\" style=\"color: var(--color-text);\">Description</label>\n <textarea\n id=\"edit-ninja-desc\"\n rows=\"2\"\n bind:value={editDescription}\n placeholder=\"Brief explanation of when to dispatch this subagent...\"\n class=\"w-full px-3 py-2 text-xs rounded-[5px] border focus:outline-hidden resize-y\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n ></textarea>\n </div>\n\n <div>\n <label for=\"edit-ninja-inst\" class=\"font-bold block mb-1\" style=\"color: var(--color-text);\">System Instructions</label>\n <textarea\n id=\"edit-ninja-inst\"\n rows=\"3\"\n bind:value={editInstructions}\n placeholder=\"Prompt and standard operating procedures for this agent...\"\n class=\"w-full px-3 py-2 text-xs font-mono rounded-[5px] border focus:outline-hidden resize-y\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n ></textarea>\n </div>\n </div>\n\n <div class=\"flex justify-end gap-2.5 pt-3 border-t\" style=\"border-color: var(--color-border);\">\n <button\n type=\"button\"\n onclick={() => { showEditModal = false; }}\n class=\"btn-3d px-4 py-2 text-xs font-bold rounded-[5px] border cursor-pointer\"\n style=\"background: var(--color-surface); border-color: var(--color-border); color: var(--color-text);\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n disabled={editSubmitting}\n onclick={handleUpdateAgent}\n class=\"btn-3d px-4 py-2 text-xs font-bold rounded-[5px] text-white cursor-pointer\"\n style=\"background: var(--color-primary);\"\n >\n {editSubmitting ? \"Updating...\" : \"Save Changes\"}\n </button>\n </div>\n </div>\n </div>\n{/if}\n","<script>\n import Agents from '../../components/Agents.svelte';\n</script>\n\n<Agents />\n"],"mappings":";;;;;;CAAA,WAAA,WAAA,eAAA;EAoT2D,WAAA,KAAA,+hFAAAA,YAAA,CAAgB,EAAA,wCAAA;;;EAYpE,WAAA,KAAA,mcAAA;;;;;;CAtDC,CAAA;;;;AC1QR,SAAA,MAAA,YAAA;;AAEQ"}
|