kindflow 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +222 -0
- package/agent-runner.js +190 -0
- package/agent-runner.js.map +1 -0
- package/chunk-2UX7Z5TH.js +95 -0
- package/chunk-2UX7Z5TH.js.map +1 -0
- package/chunk-2YT53FBK.js +38 -0
- package/chunk-2YT53FBK.js.map +1 -0
- package/chunk-3AMW7NXZ.js +688 -0
- package/chunk-3AMW7NXZ.js.map +1 -0
- package/chunk-GZFR7ELC.js +98 -0
- package/chunk-GZFR7ELC.js.map +1 -0
- package/chunk-P5P73L35.js +17 -0
- package/chunk-P5P73L35.js.map +1 -0
- package/chunk-UGIMNC7O.js +3134 -0
- package/chunk-UGIMNC7O.js.map +1 -0
- package/cli.js +153 -0
- package/cli.js.map +1 -0
- package/cron-runner.js +89 -0
- package/cron-runner.js.map +1 -0
- package/daemon.js +12 -0
- package/daemon.js.map +1 -0
- package/database.js +7 -0
- package/database.js.map +1 -0
- package/imap-runner.js +123 -0
- package/imap-runner.js.map +1 -0
- package/package.json +58 -0
- package/postgresql-TRH2S2OL.js +67 -0
- package/postgresql-TRH2S2OL.js.map +1 -0
- package/s3.js +7 -0
- package/s3.js.map +1 -0
- package/sqlite-HPBUYY7A.js +52 -0
- package/sqlite-HPBUYY7A.js.map +1 -0
- package/telegram-client.js +7 -0
- package/telegram-client.js.map +1 -0
- package/telegram-runner.js +156 -0
- package/telegram-runner.js.map +1 -0
- package/templates/agent/agent/.claude/settings.json +12 -0
- package/templates/agent/agent/CLAUDE.md +34 -0
- package/templates/agent/agent/capabilities/.gitkeep +0 -0
- package/templates/agent/agent/config.json +7 -0
- package/templates/agent/agent/data/.gitkeep +0 -0
- package/templates/agent/agent/resources/.gitkeep +0 -0
- package/templates/agent/agent/scripts/.gitkeep +0 -0
- package/templates/agent/master/.claude/commands/build-commands.md +10 -0
- package/templates/agent/master/.claude/commands/build-identity.md +7 -0
- package/templates/agent/master/.claude/commands/build-scripts.md +7 -0
- package/templates/agent/master/.claude/commands/discovery.md +46 -0
- package/templates/agent/master/.claude/commands/review-agent.md +57 -0
- package/templates/agent/master/.claude/commands/setup-database.md +12 -0
- package/templates/agent/master/.claude/commands/setup-s3.md +12 -0
- package/templates/agent/master/.claude/commands/setup-telegram.md +16 -0
- package/templates/agent/master/.claude/settings.json +13 -0
- package/templates/agent/master/CLAUDE.md +52 -0
- package/templates/agent/master/resources/agent-structure.md +24 -0
- package/templates/agent/master/resources/capabilities.md +209 -0
- package/types.js +1 -0
- package/types.js.map +1 -0
- package/web/standalone/.next/static/chunks/0.rhx-_tszlu4.js +6 -0
- package/web/standalone/.next/static/chunks/03ezf5l-_j4jg.js +1 -0
- package/web/standalone/.next/static/chunks/03~yq9q893hmn.js +1 -0
- package/web/standalone/.next/static/chunks/04ck6i02nzj~g.js +1 -0
- package/web/standalone/.next/static/chunks/059v8r-yfkdzg.js +1 -0
- package/web/standalone/.next/static/chunks/07m3a24dcvltn.js +1 -0
- package/web/standalone/.next/static/chunks/0846ex_9lje66.js +1 -0
- package/web/standalone/.next/static/chunks/09auzhh4.kw6i.js +1 -0
- package/web/standalone/.next/static/chunks/0cs-bbn7o_z8t.js +1 -0
- package/web/standalone/.next/static/chunks/0cz5_xjqg2kbi.js +1 -0
- package/web/standalone/.next/static/chunks/0d14tm~hn93.2.js +1 -0
- package/web/standalone/.next/static/chunks/0dbly4ik_4oyh.css +3 -0
- package/web/standalone/.next/static/chunks/0ecr_h8tt8vw7.js +1 -0
- package/web/standalone/.next/static/chunks/0emphvehnoi1-.js +2 -0
- package/web/standalone/.next/static/chunks/0gpetx3.4k6b4.js +1 -0
- package/web/standalone/.next/static/chunks/0hfzu1auqc8ou.js +4 -0
- package/web/standalone/.next/static/chunks/0hjgvrv57vh99.js +1 -0
- package/web/standalone/.next/static/chunks/0nwzqd02b0bz9.js +1 -0
- package/web/standalone/.next/static/chunks/0oja3muheolaf.js +1 -0
- package/web/standalone/.next/static/chunks/0qxvztkmx2jf8.js +1 -0
- package/web/standalone/.next/static/chunks/0rsdytxfylxaw.js +1 -0
- package/web/standalone/.next/static/chunks/0t3kxrf329vtx.js +31 -0
- package/web/standalone/.next/static/chunks/0tj~6ee-vyqtu.js +1 -0
- package/web/standalone/.next/static/chunks/0vu.7k.x708cp.js +18 -0
- package/web/standalone/.next/static/chunks/0yt_9qbiz6hzr.js +1 -0
- package/web/standalone/.next/static/chunks/0~6eav_b2pgm..js +1 -0
- package/web/standalone/.next/static/chunks/11c0vsuj8ueva.js +1 -0
- package/web/standalone/.next/static/chunks/11zn_gydr7w.9.js +1 -0
- package/web/standalone/.next/static/chunks/12dnb1g.3zjtg.js +1 -0
- package/web/standalone/.next/static/chunks/12~poxkd72k~o.js +1 -0
- package/web/standalone/.next/static/chunks/14_1rc6rwie3u.js +1 -0
- package/web/standalone/.next/static/chunks/14kp_3wlgnkxp.js +1 -0
- package/web/standalone/.next/static/chunks/16hbu0vikyrj2.js +1 -0
- package/web/standalone/.next/static/chunks/17irh9suob_1s.js +1 -0
- package/web/standalone/.next/static/chunks/17oc2l.ekcs8b.css +1 -0
- package/web/standalone/.next/static/chunks/turbopack-03.6m4zxjzd-b.js +1 -0
- package/web/standalone/.next/static/media/4fa387ec64143e14-s.0q3udbd2bu5yp.woff2 +0 -0
- package/web/standalone/.next/static/media/7178b3e590c64307-s.11.cyxs5p-0z~.woff2 +0 -0
- package/web/standalone/.next/static/media/797e433ab948586e-s.p.0.q-h669a_dqa.woff2 +0 -0
- package/web/standalone/.next/static/media/8a480f0b521d4e75-s.06d3mdzz5bre_.woff2 +0 -0
- package/web/standalone/.next/static/media/bbc41e54d2fcbd21-s.0gw~uztddq1df.woff2 +0 -0
- package/web/standalone/.next/static/media/caa3a2e1cccd8315-s.p.16t1db8_9y2o~.woff2 +0 -0
- package/web/standalone/.next/static/media/favicon.0x3dzn~oxb6tn.ico +0 -0
- package/web/standalone/.next/static/rP40PaqmfSDCp0BXJLoC8/_buildManifest.js +11 -0
- package/web/standalone/.next/static/rP40PaqmfSDCp0BXJLoC8/_clientMiddlewareManifest.js +1 -0
- package/web/standalone/.next/static/rP40PaqmfSDCp0BXJLoC8/_ssgManifest.js +1 -0
- package/web/standalone/apps/web/.next/BUILD_ID +1 -0
- package/web/standalone/apps/web/.next/app-path-routes-manifest.json +26 -0
- package/web/standalone/apps/web/.next/build-manifest.json +21 -0
- package/web/standalone/apps/web/.next/package.json +1 -0
- package/web/standalone/apps/web/.next/prerender-manifest.json +378 -0
- package/web/standalone/apps/web/.next/required-server-files.json +333 -0
- package/web/standalone/apps/web/.next/routes-manifest.json +208 -0
- package/web/standalone/apps/web/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/_global-error/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
- package/web/standalone/apps/web/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/_global-error/page.js +10 -0
- package/web/standalone/apps/web/.next/server/app/_global-error/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/_global-error.html +1 -0
- package/web/standalone/apps/web/.next/server/app/_global-error.meta +15 -0
- package/web/standalone/apps/web/.next/server/app/_global-error.rsc +15 -0
- package/web/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +15 -0
- package/web/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/web/standalone/apps/web/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/_not-found/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/_not-found/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/_not-found/page.js +13 -0
- package/web/standalone/apps/web/.next/server/app/_not-found/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/_not-found.html +1 -0
- package/web/standalone/apps/web/.next/server/app/_not-found.meta +16 -0
- package/web/standalone/apps/web/.next/server/app/_not-found.rsc +17 -0
- package/web/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +17 -0
- package/web/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/agents/new/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/agents/new/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/agents/new/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/agents/new/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/new/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/agents/new/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/agents/new/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/agents/new/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/new/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/agents/new.html +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/new.meta +16 -0
- package/web/standalone/apps/web/.next/server/app/agents/new.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/agents/new.segments/_full.segment.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/agents/new.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/agents/new.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/agents/new.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/agents/new.segments/agents/new/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/agents/new.segments/agents/new.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/agents/new.segments/agents.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/agents/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/agents/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/agents/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/agents/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/agents/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/agents/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/agents/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/agents/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/agents.html +1 -0
- package/web/standalone/apps/web/.next/server/app/agents.meta +15 -0
- package/web/standalone/apps/web/.next/server/app/agents.rsc +23 -0
- package/web/standalone/apps/web/.next/server/app/agents.segments/_full.segment.rsc +23 -0
- package/web/standalone/apps/web/.next/server/app/agents.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/agents.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/agents.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/agents.segments/agents/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/agents.segments/agents.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron.html +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron.meta +16 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/_full.segment.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/capabilities/cron/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/capabilities/cron.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/capabilities.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database.html +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database.meta +16 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/_full.segment.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/capabilities/database/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/capabilities/database.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/capabilities.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email.html +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email.meta +16 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/_full.segment.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/capabilities/email/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/capabilities/email.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/capabilities.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http.html +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http.meta +16 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/_full.segment.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/capabilities/http/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/capabilities/http.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/capabilities.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3.html +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3.meta +16 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/_full.segment.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/capabilities/s3/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/capabilities/s3.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/capabilities.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram.html +1 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram.meta +16 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/_full.segment.rsc +25 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/capabilities/telegram/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/capabilities/telegram.segment.rsc +5 -0
- package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/capabilities.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/dashboard/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/dashboard/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/dashboard/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/dashboard/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/dashboard/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/dashboard/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/dashboard/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/dashboard/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/dashboard/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/dashboard.html +1 -0
- package/web/standalone/apps/web/.next/server/app/dashboard.meta +15 -0
- package/web/standalone/apps/web/.next/server/app/dashboard.rsc +23 -0
- package/web/standalone/apps/web/.next/server/app/dashboard.segments/_full.segment.rsc +23 -0
- package/web/standalone/apps/web/.next/server/app/dashboard.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/dashboard.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/dashboard.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/dashboard.segments/dashboard.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/favicon.ico/route/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/favicon.ico/route/build-manifest.json +9 -0
- package/web/standalone/apps/web/.next/server/app/favicon.ico/route.js +6 -0
- package/web/standalone/apps/web/.next/server/app/favicon.ico/route.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/favicon.ico/route.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/favicon.ico.body +0 -0
- package/web/standalone/apps/web/.next/server/app/favicon.ico.meta +1 -0
- package/web/standalone/apps/web/.next/server/app/index.html +1 -0
- package/web/standalone/apps/web/.next/server/app/index.meta +14 -0
- package/web/standalone/apps/web/.next/server/app/index.rsc +18 -0
- package/web/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +18 -0
- package/web/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/page.js +14 -0
- package/web/standalone/apps/web/.next/server/app/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/processes/[id]/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/processes/[id]/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/processes/[id]/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/processes/[id]/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/processes/[id]/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/processes/[id]/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/processes/[id]/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/processes/[id]/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/processes/[id]/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/processes/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/processes/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/processes/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/processes/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/processes/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/processes/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/processes/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/processes/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/processes/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/processes.html +1 -0
- package/web/standalone/apps/web/.next/server/app/processes.meta +15 -0
- package/web/standalone/apps/web/.next/server/app/processes.rsc +23 -0
- package/web/standalone/apps/web/.next/server/app/processes.segments/_full.segment.rsc +23 -0
- package/web/standalone/apps/web/.next/server/app/processes.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/processes.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/processes.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/processes.segments/processes/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/processes.segments/processes.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/settings/page/app-paths-manifest.json +3 -0
- package/web/standalone/apps/web/.next/server/app/settings/page/build-manifest.json +17 -0
- package/web/standalone/apps/web/.next/server/app/settings/page/next-font-manifest.json +11 -0
- package/web/standalone/apps/web/.next/server/app/settings/page/react-loadable-manifest.json +1 -0
- package/web/standalone/apps/web/.next/server/app/settings/page/server-reference-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/app/settings/page.js +15 -0
- package/web/standalone/apps/web/.next/server/app/settings/page.js.map +5 -0
- package/web/standalone/apps/web/.next/server/app/settings/page.js.nft.json +1 -0
- package/web/standalone/apps/web/.next/server/app/settings/page_client-reference-manifest.js +3 -0
- package/web/standalone/apps/web/.next/server/app/settings.html +1 -0
- package/web/standalone/apps/web/.next/server/app/settings.meta +15 -0
- package/web/standalone/apps/web/.next/server/app/settings.rsc +23 -0
- package/web/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +23 -0
- package/web/standalone/apps/web/.next/server/app/settings.segments/_head.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/settings.segments/_index.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +4 -0
- package/web/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +9 -0
- package/web/standalone/apps/web/.next/server/app/settings.segments/settings.segment.rsc +6 -0
- package/web/standalone/apps/web/.next/server/app-paths-manifest.json +26 -0
- package/web/standalone/apps/web/.next/server/chunks/[externals]_next_dist_0arv.vj._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0~3j_ga._.js +13 -0
- package/web/standalone/apps/web/.next/server/chunks/[turbopack]_runtime.js +903 -0
- package/web/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_favicon_ico_route_actions_0h5n1et.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/02dz_web__next-internal_server_app_capabilities_database_[id]_page_actions_0.-c3vs.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/02dz_web__next-internal_server_app_capabilities_telegram_[id]_page_actions_00x92aq.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_0f4v1z5._.js +6 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_05v-uws._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_0kt-.cm._.js +6 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_client_components_04~l9~b._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_client_components_builtin_forbidden_0a6wr8l.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_client_components_builtin_global-error_109gj6..js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_client_components_builtin_unauthorized_08_5kf-.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0-uhk21.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0.3kkc_.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_016gfnx.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_01mctzl.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_02e3oga.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_02y4i-c.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_05ygn2~.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0_~wwe5.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0b4dx3w.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0du38rd.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0e8g9q0.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0f2-c.e.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0gdgxa7.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0i5zrqw.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0ljd49j.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0mi9cdx.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0oq8du3.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0pl_g7l.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0wg3p4e.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0yc3j~6.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0yi0vqi.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0z1d.gu.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_13slyfs.js +4 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__01j9ea3._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__01l01-8._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__02p4wbs._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__04v6.qm._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__06czjj7._.js +33 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__072vzf1._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__08_g-x7._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_b.9lv._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_jvn9i._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0bgnjx2._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0cy-jpt._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0djkqf8._.js +19 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0djyuc4._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0hln-za._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ktr_dg._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0m19rl3._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0m9l~vh._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ogkk8r._.js +33 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0q.cram._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0rnwev6._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0s9xit3._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0s~z9ow._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ulv~qj._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0xnq8g-._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0zuw_7g._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~9h4iq._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~mjqf7._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__12e7-gz._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/[turbopack]_runtime.js +903 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0.bdnad._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_00a5evk._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_04--tsw._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_05lesu9._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_05sycvg._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_07a_7z8._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0fxpl8-._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0i3-r5p._.js +8 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0j04ujl._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0neh~vy._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0pixn7s._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0u3ezmt._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0xkzxjy._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0xpz1yw._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0yrq69.._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_0z_z7lg._.js +33 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_12.8jw7._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/_12ou3y3._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app__global-error_page_actions_0.u5cfa.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app__not-found_page_actions_0appun9.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_agents_[id]_edit_page_actions_0_lcg_e.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_agents_[id]_page_actions_0sxkzxu.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_agents_[id]_terminal_page_actions_0x5.gii.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_agents_new_page_actions_077_d8h.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_agents_page_actions_0fcm22n.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_cron_[id]_page_actions_03ri~.h.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_cron_page_actions_0i6638x.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_database_page_actions_084olu1.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_email_page_actions_0y_8jvo.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_http_[id]_page_actions_0w_nads.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_http_page_actions_08q~6ps.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_s3_[id]_page_actions_0b1va89.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_s3_page_actions_01-rjn5.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_telegram_page_actions_0~n0cvz.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_dashboard_page_actions_0d7kn4j.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_page_actions_0rm5_5w.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_processes_[id]_page_actions_00kaa~m.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_processes_page_actions_01mh_2n.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_settings_page_actions_0f6epye.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0.swnkn._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_06~qvaf._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_07amn01._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_07juq0h._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0_glyv-._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0f3e-_6._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0ipwebe._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0t.jg~x._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0ug8ln8._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_capabilities_database_page_tsx_0331n3m._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_capabilities_email_page_tsx_0sdgf9o._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_processes_[id]_page_tsx_03n8i7e._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_settings_page_tsx_0i6itlb._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/node_modules_@xterm_addon-fit_lib_addon-fit_mjs_0qsj~me._.js +3 -0
- package/web/standalone/apps/web/.next/server/chunks/ssr/node_modules_@xterm_xterm_lib_xterm_mjs_0ruzhkb._.js +20 -0
- package/web/standalone/apps/web/.next/server/functions-config-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/middleware-build-manifest.js +21 -0
- package/web/standalone/apps/web/.next/server/middleware-manifest.json +6 -0
- package/web/standalone/apps/web/.next/server/next-font-manifest.js +1 -0
- package/web/standalone/apps/web/.next/server/next-font-manifest.json +95 -0
- package/web/standalone/apps/web/.next/server/pages/404.html +1 -0
- package/web/standalone/apps/web/.next/server/pages/500.html +1 -0
- package/web/standalone/apps/web/.next/server/pages-manifest.json +4 -0
- package/web/standalone/apps/web/.next/server/prefetch-hints.json +1 -0
- package/web/standalone/apps/web/.next/server/server-reference-manifest.js +1 -0
- package/web/standalone/apps/web/.next/server/server-reference-manifest.json +5 -0
- package/web/standalone/apps/web/node_modules/@next/env/dist/index.js +1 -0
- package/web/standalone/apps/web/node_modules/@next/env/package.json +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/adapter/setup-node-env.external.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/define-env.js +255 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/duration-to-string.js +99 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/get-supported-browsers.js +38 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/next-config-ts/require-hook.js +85 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/next-config-ts/transpile-config.js +251 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/output/format.js +84 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/output/log.js +135 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/segment-config/app/app-segment-config.js +162 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/segment-config/app/app-segments.js +137 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/segment-config/app/collect-root-param-keys.js +52 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/static-paths/app/extract-pathname-route-param-segments-from-loader-tree.js +137 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/static-paths/app.js +735 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/static-paths/pages.js +169 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/static-paths/utils.js +119 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/swc/helpers.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/swc/index.js +1348 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/swc/install-bindings.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/swc/jest-transformer.js +76 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/swc/loaderWorkerPool.js +40 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/swc/options.js +403 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/swc/types.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/build/utils.js +1215 -0
- package/web/standalone/apps/web/node_modules/next/dist/cli/next-test.js +170 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/add-base-path.js +24 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/app-call-server.js +34 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/app-find-source-map-url.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/assign-location.js +29 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/app-router-announcer.js +78 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/app-router-headers.js +138 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/app-router-instance.js +397 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/app-router-utils.js +62 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/app-router.js +514 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/builtin/default.js +35 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/builtin/error-styles.js +165 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/builtin/global-error.js +100 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/dev-root-http-access-fallback-boundary.js +52 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/error-boundary.js +144 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/errors/graceful-degrade-boundary.js +86 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/errors/root-error-boundary.js +41 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/forbidden.js +48 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/handle-isr-error.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/hooks-server-context.js +42 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js +125 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/http-access-fallback/http-access-fallback.js +72 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/is-next-router-error.js +23 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/links.js +299 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/match-segments.js +32 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/nav-failure-handler.js +61 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/navigation-devtools.js +126 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/navigation-untracked.js +67 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/navigation.js +225 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/navigation.react-server.js +75 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/not-found.js +42 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/readonly-url-search-params.js +41 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/redirect-boundary.js +107 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/redirect-error.js +43 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/redirect-status-code.js +24 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/redirect.js +91 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/compute-changed-path.js +201 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js +21 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/create-initial-router-state.js +153 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/create-router-cache-key.js +32 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +457 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/is-navigating-to-new-root-layout.js +59 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js +1341 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/committed-state.js +49 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/find-head-in-cache.js +63 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/has-interception-route-in-current-tree.js +38 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/hmr-refresh-reducer.js +23 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js +56 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/refresh-reducer.js +83 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/restore-reducer.js +62 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/server-action-reducer.js +320 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/server-patch-reducer.js +58 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js +70 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/router-reducer.js +66 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/set-cache-busting-search-param.js +60 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/bfcache.js +128 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/cache-key.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/cache-map.js +305 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/cache.js +1933 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/lru.js +152 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/navigation-testing-lock.js +194 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/navigation.js +597 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/optimistic-routes.js +543 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/prefetch.js +31 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/scheduler.js +1249 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/types.js +69 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/vary-path.js +278 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/static-generation-bailout.js +42 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/unauthorized.js +49 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/unrecognized-action-error.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/unresolved-thenable.js +23 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/unstable-rethrow.browser.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/unstable-rethrow.js +25 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/unstable-rethrow.server.js +32 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/components/use-action-queue.js +148 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/dev/debug-channel.js +72 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/flight-data-helpers.js +232 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/has-base-path.js +23 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/lib/console.js +177 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/lib/javascript-url.js +32 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/navigation-build-id.js +53 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/normalize-trailing-slash.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/remove-base-path.js +32 -0
- package/web/standalone/apps/web/node_modules/next/dist/client/route-params.js +230 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js +339 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/cookies/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/ponyfill/index.js +46 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/ponyfill/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/abort-controller.js.text.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/console.js.text.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/events.js.text.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/index.js +5 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/load.js +18713 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/stream.js +44 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/timers.js.text.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/url.js.text.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@hapi/accept/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@hapi/accept/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@napi-rs/triples/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@napi-rs/triples/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@opentelemetry/api/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/@opentelemetry/api/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/async-retry/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/async-retry/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/async-sema/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/async-sema/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/busboy/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/busboy/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/bytes/index.js +8 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/bytes/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/ci-info/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/ci-info/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/commander/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/commander/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/comment-json/index.js +7 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/comment-json/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/compression/index.js +58 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/compression/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/conf/index.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/conf/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/content-disposition/index.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/content-disposition/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/cookie/index.js +7 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/cookie/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/cross-spawn/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/cross-spawn/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/debug/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/debug/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/edge-runtime/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/edge-runtime/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/find-up/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/find-up/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/fresh/index.js +8 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/fresh/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/http-proxy/index.js +34 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/http-proxy/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/image-detector/detector.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/image-size/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/image-size/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/ipaddr.js/ipaddr.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/ipaddr.js/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/is-animated/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/is-animated/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/is-docker/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/is-docker/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/is-wsl/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/is-wsl/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/jsonwebtoken/index.js +11 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/jsonwebtoken/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/nanoid/index.cjs +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/nanoid/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +54 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +54 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/p-limit/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/p-limit/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/p-queue/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/p-queue/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/path-browserify/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/path-browserify/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/path-to-regexp/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/path-to-regexp/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/picomatch/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/picomatch/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/react-is/cjs/react-is.development.js +133 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/react-is/cjs/react-is.production.js +130 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/react-is/index.js +7 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/react-is/package.json +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/regenerator-runtime/package.json +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/regenerator-runtime/runtime.js +729 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/semver/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/semver/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/send/index.js +70 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/send/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/source-map/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/source-map/source-map.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/stacktrace-parser/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/string-hash/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/string-hash/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/strip-ansi/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/strip-ansi/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/superstruct/index.cjs +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/superstruct/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/tar/index.min.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/tar/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/text-table/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/text-table/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/watchpack/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/watchpack/watchpack.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/ws/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/ws/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/zod/index.cjs +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/zod/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/zod-validation-error/index.js +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/compiled/zod-validation-error/package.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/experimental/testmode/context.js +57 -0
- package/web/standalone/apps/web/node_modules/next/dist/experimental/testmode/fetch.js +142 -0
- package/web/standalone/apps/web/node_modules/next/dist/experimental/testmode/httpget.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/experimental/testmode/server-edge.js +32 -0
- package/web/standalone/apps/web/node_modules/next/dist/experimental/testmode/server.js +62 -0
- package/web/standalone/apps/web/node_modules/next/dist/export/helpers/create-incremental-cache.js +61 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/batcher.js +65 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/build-custom-route.js +46 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/bundler.js +97 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/client-and-server-references.js +54 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/coalesced-function.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/compile-error.js +14 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/constants.js +420 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/create-client-router-filter.js +67 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/default-transpiled-packages.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/detached-promise.js +32 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/detect-typo.js +51 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/download-swc.js +183 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/error-telemetry-utils.js +42 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/fallback.js +100 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/fatal-error.js +14 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/file-exists.js +53 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/find-config.js +102 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/find-pages-dir.js +65 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/find-root.js +126 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/format-cli-help-output.js +84 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/format-dynamic-import-path.js +24 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/format-server-error.js +75 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/framework/boundary-components.js +62 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/framework/boundary-constants.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/fs/rename.js +87 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/fs/write-atomic.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/generate-interception-routes-rewrites.js +52 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/get-files-in-dir.js +33 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/get-network-host.js +44 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/get-package-version.js +118 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/get-project-dir.js +51 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/has-necessary-dependencies.js +49 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-cache-directory.js +66 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-npx-command.js +29 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-online.js +50 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-pkg-manager.js +63 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-registry.js +45 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-reserved-port.js +116 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/install.js +83 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/import-next-warning.js +50 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/inline-static-env.js +112 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/install-dependencies.js +40 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/interop-default.js +16 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/is-api-route.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/is-app-page-route.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/is-app-route-route.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/is-edge-runtime.js +16 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/is-error.js +78 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/is-interception-route-rewrite.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/is-internal-component.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/is-serializable-props.js +106 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/known-edge-safe-packages.json +1 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/load-custom-routes.js +594 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/memory/gc-observer.js +53 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/memory/shutdown.js +29 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/memory/startup.js +47 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/memory/trace.js +109 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/constants.js +40 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/default-metadata.js +82 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/generate/icon-mark.js +22 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/generate/utils.js +52 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/get-metadata-route.js +123 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/is-metadata-route.js +221 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/metadata-context.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/metadata.js +1686 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolve-metadata.js +884 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolvers/resolve-basics.js +232 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolvers/resolve-icons.js +56 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolvers/resolve-opengraph.js +199 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolvers/resolve-title.js +40 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolvers/resolve-url.js +135 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/alternative-urls-types.js +7 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/extra-types.js +9 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/icons.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/manifest-types.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/metadata-interface.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/metadata-types.js +10 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/opengraph-types.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/resolvers.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/twitter-types.js +7 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/mime-type.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/mkcert.js +204 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/multi-file-writer.js +75 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/needs-experimental-react.js +16 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/non-nullable.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/normalize-path.js +21 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/oxford-comma-list.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/page-types.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/patch-incorrect-lockfile.js +185 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/pick.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/picocolors.js +177 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/pretty-bytes.js +74 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/realpath.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/recursive-copy.js +76 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/recursive-delete.js +137 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/recursive-readdir.js +124 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/redirect-status.js +46 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/require-instrumentation-client.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/resolve-build-paths.js +154 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/resolve-from.js +65 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/route-pattern-normalizer.js +107 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/scheduler.js +64 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/semver-noop.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/server-external-packages.jsonc +103 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/setup-exception-listeners.js +11 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/static-env.js +92 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/try-to-parse-path.js +67 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/turbopack-warning.js +185 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/diagnosticFormatter.js +243 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/getTypeScriptConfiguration.js +73 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/getTypeScriptIntent.js +52 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/missingDependencyError.js +27 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/runTypeCheck.js +149 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/type-paths.js +51 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/writeAppTypeDeclarations.js +75 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/writeConfigurationDefaults.js +391 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/url.js +75 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/verify-partytown-setup.js +115 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/verify-root-layout.js +165 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/verify-typescript-setup.js +228 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/wait.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/with-promise-cache.js +24 -0
- package/web/standalone/apps/web/node_modules/next/dist/lib/worker.js +234 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/ReactDOMServerPages.js +16 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/accept-header.js +132 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/after/after-context.js +140 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/after/after.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/after/awaiter.js +74 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/after/builtin-request-context.js +38 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/after/index.js +21 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/after/run-with-after.js +35 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/get-cookie-parser.js +22 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/index.js +201 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/node/api-resolver.js +395 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/node/parse-body.js +79 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/node/try-get-preview-data.js +86 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/web.js +17 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/action-async-storage-instance.js +14 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/action-async-storage.external.js +13 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/action-handler.js +1020 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js +14 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/after-task-async-storage.external.js +13 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/app-render-prerender-utils.js +167 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/app-render-render-utils.js +76 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/app-render-scheduling.js +188 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/app-render.js +4469 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/async-local-storage.js +76 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/cache-signal.js +181 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/collect-segment-data.js +600 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/console-async-storage-instance.js +14 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/console-async-storage.external.js +13 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/create-component-styles-and-scripts.js +33 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/create-component-tree.js +840 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/create-error-handler.js +189 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/create-flight-router-state-from-loader-tree.js +102 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/csrf-protection.js +86 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/debug-channel-server.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/debug-channel-server.web.js +71 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js +14 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js +13 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/dynamic-rendering.js +1144 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/encryption-utils-server.js +114 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/encryption-utils.js +93 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/encryption.js +259 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/entry-base.js +256 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/flight-render-result.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-asset-query-string.js +29 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-css-inlined-link-tags.js +49 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-layer-assets.js +65 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-preloadable-fonts.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-script-nonce-from-header.js +44 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-short-dynamic-param-type.js +25 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/has-loading-component-in-tree.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js +13 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/boundary-impl.js +103 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/boundary-tracking.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/instant-config.js +181 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/instant-samples-client.js +128 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/instant-samples.js +432 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/instant-validation-error.js +33 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/instant-validation.js +713 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/stream-utils.js +96 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/interop-default.js +17 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/make-get-server-inserted-html.js +92 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/manifests-singleton.js +264 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/metadata-insertion/create-server-inserted-metadata.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/module-loading/track-dynamic-import.js +57 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js +32 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js +66 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/parse-and-validate-flight-router-state.js +49 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/postponed-state.js +157 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/prospective-render-utils.js +74 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/react-large-shell-error.js +17 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/react-server.node.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/render-css-resource.js +52 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/required-scripts.js +76 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/rsc/postpone.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/rsc/preloads.js +74 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/rsc/taint.js +79 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/segment-explorer-path.js +128 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/server-inserted-html.js +77 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/staged-rendering.js +343 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/stale-time.js +111 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/stream-ops.js +106 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/stream-ops.web.js +163 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/strip-flight-headers.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/types.js +65 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/use-flight-response.js +214 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/vary-params.js +336 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/walk-tree-with-flight-router-state.js +232 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/work-async-storage-instance.js +14 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/work-async-storage.external.js +13 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js +14 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/app-render/work-unit-async-storage.external.js +280 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/async-storage/draft-mode-provider.js +62 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/async-storage/request-store.js +144 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/async-storage/with-store.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/async-storage/work-store.js +91 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/base-http/helpers.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/base-http/index.js +54 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/base-http/node.js +147 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/base-http/web.js +124 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/base-server.js +1874 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/body-streams.js +114 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/cache-dir.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/capsize-font-metrics.json +181516 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/ci-info.js +41 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/client-component-renderer-logger.js +70 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/config-schema.js +717 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/config-shared.js +369 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/config-utils.js +185 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/config.js +1545 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js +96 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/crypto-utils.js +70 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/browser-logs/file-logger.js +186 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/browser-logs/receive-logs.js +558 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/browser-logs/source-map.js +222 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/debug-channel.js +87 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/dev-indicator-server-state.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/get-source-map-from-file.js +100 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-middleware.js +274 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-reloader-rspack.js +171 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-reloader-shared-utils.js +56 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +1478 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-reloader-types.js +58 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1386 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/log-requests.js +149 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/messages.js +74 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/middleware-turbopack.js +403 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/middleware-webpack.js +483 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/node-stack-frames.js +72 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/on-demand-entry-handler.js +773 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/parse-version-info.js +108 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/require-cache.js +79 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/serialized-errors.js +67 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/server-action-logger.js +37 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/static-paths-worker.js +104 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dev/turbopack-utils.js +687 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/dynamic-rendering-utils.js +108 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/font-utils.js +43 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/get-app-route-from-entrypoint.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/get-page-files.js +23 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/get-route-from-entrypoint.js +35 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/htmlescape.js +37 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/image-optimizer.js +1220 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/instrumentation/types.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/instrumentation/utils.js +21 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/internal-utils.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/is-private-ip.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/app-dir-module.js +59 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/app-info-log.js +132 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/async-callback-set.js +29 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/cache-control.js +22 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/cache-handlers/default.external.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/cache-handlers/default.js +160 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/cache-handlers/types.js +8 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/chrome-devtools-workspace.js +116 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/clone-response.js +77 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/cpu-profile.js +59 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/decode-query-path-parameter.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/dedupe-fetch.js +163 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/dev-bundler-service.js +95 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/disk-lru-cache.external.js +57 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/etag.js +56 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/experimental/create-env-definitions.js +48 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/experimental/ppr.js +47 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/find-page-file.js +147 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/fix-mojibake.js +25 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/format-hostname.js +16 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/i18n-provider.js +129 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/implicit-tags.js +77 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +335 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/incremental-cache/index.js +501 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js +57 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js +73 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js +55 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/install-code-frame.js +22 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/is-ipv6.js +41 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/lazy-result.js +46 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/lru-cache.js +191 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/match-next-data-pathname.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/mock-request.js +416 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/module-loader/module-loader.js +8 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/module-loader/node-module-loader.js +25 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/module-loader/route-module-loader.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/node-fs-methods.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/parse-stack.js +46 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/patch-fetch.js +978 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/patch-set-header.js +38 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/postponed-request-body.js +64 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/render-server.js +155 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-server.js +683 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/block-cross-site-dev.js +110 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/build-data-route.js +48 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/build-prefetch-segment-data-route.js +50 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/cache-life-type-utils.js +211 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/decode-path-params.js +42 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/filesystem.js +591 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js +89 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js +96 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/is-postpone.js +16 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/proxy-request.js +118 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +629 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/route-types-utils.js +286 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/router-server-context.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/typegen.js +858 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/types.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/server-action-request-meta.js +53 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/server-ipc/utils.js +81 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/source-maps.js +196 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/start-server.js +494 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/streaming-metadata.js +38 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/to-route.js +37 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/trace/constants.js +203 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/trace/tracer.js +280 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/trace/utils.js +16 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/types.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/utils.js +278 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/lib/worker-utils.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/load-components.js +179 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/load-default-error-components.js +41 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/load-manifest.external.js +117 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/match-bundle.js +25 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/get-mcp-middleware.js +49 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/get-or-create-mcp-server.js +41 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/mcp-telemetry-tracker.js +82 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-errors.js +114 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-logs.js +67 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-page-metadata.js +188 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-project-metadata.js +59 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-routes.js +136 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-server-action-by-id.js +121 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/next-instance-error-state.js +31 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/utils/browser-communication.js +90 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/utils/format-errors.js +137 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/next-server.js +1429 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/next-typescript.js +13 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/next.js +455 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-baseline.js +25 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/console-dim.external.js +301 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/console-exit.js +49 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/console-file.js +56 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/date.js +52 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/error-inspect.js +8 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js +577 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/global-behaviors.js +33 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/io-utils.js +195 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/node-crypto.js +103 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/process-error-handlers.js +91 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/random.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js +508 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/web-crypto.js +45 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-environment.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/node-polyfill-crypto.js +21 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/absolute-filename-normalizer.js +33 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/app/app-bundle-path-normalizer.js +54 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/app/app-filename-normalizer.js +22 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/app/app-page-normalizer.js +40 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/app/app-pathname-normalizer.js +55 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/app/index.js +42 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/pages/index.js +44 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/pages/pages-bundle-path-normalizer.js +55 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/pages/pages-filename-normalizer.js +22 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/pages/pages-page-normalizer.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/pages/pages-pathname-normalizer.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/locale-route-normalizer.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/normalizer.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/normalizers.js +23 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/prefixing-normalizer.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/base-path.js +25 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/next-data.js +38 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/pathname-normalizer.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/prefix.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/rsc.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/segment-prefix-rsc.js +33 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/suffix.js +27 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/underscore-normalizer.js +17 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/wrap-normalizer-fn.js +17 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/og/image-response.js +53 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/patch-error-inspect.js +453 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/pipe-readable.js +140 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/post-process.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/render-result.js +204 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/render.js +1140 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request/connection.js +133 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request/cookies.js +235 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request/draft-mode.js +230 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request/fallback-params.js +69 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request/headers.js +229 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request/params.js +527 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request/pathname.js +119 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request/root-params.js +194 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request/search-params.js +526 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request/utils.js +51 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/request-meta.js +55 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/require-hook.js +82 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/require.js +109 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/response-cache/index.js +311 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/response-cache/types.js +41 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/response-cache/utils.js +104 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/response-cache/web.js +101 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/resume-data-cache/cache-store.js +96 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/resume-data-cache/resume-data-cache.js +124 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/revalidation-utils.js +157 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/app-page-route-definition.js +16 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/app-route-route-definition.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/locale-route-definition.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/pages-api-route-definition.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/pages-route-definition.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/route-definition.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-kind.js +32 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-managers/default-route-matcher-manager.js +239 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-managers/dev-route-matcher-manager.js +120 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-managers/route-matcher-manager.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/app-page-route-matcher-provider.js +55 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/app-route-route-matcher-provider.js +43 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/dev-app-page-route-matcher-provider.js +91 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/dev-app-route-route-matcher-provider.js +112 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/dev-pages-api-route-matcher-provider.js +77 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/dev-pages-route-matcher-provider.js +77 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/file-cache-route-matcher-provider.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/batched-file-reader.js +106 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/default-file-reader.js +42 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/file-reader.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/helpers/cached-route-matcher-provider.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/manifest-loader.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/node-manifest-loader.js +34 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/server-manifest-loader.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/manifest-route-matcher-provider.js +21 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/pages-api-route-matcher-provider.js +55 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/pages-route-matcher-provider.js +64 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/route-matcher-provider.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/app-page-route-matcher.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/app-route-route-matcher.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/locale-route-matcher.js +68 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/pages-api-route-matcher.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/pages-route-matcher.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/route-matcher.js +54 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/app-page-route-match.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/app-route-route-match.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/locale-route-match.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/pages-api-route-match.js +16 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/pages-route-match.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/route-match.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/helpers/prerender-manifest-matcher.js +51 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/module.compiled.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/module.js +162 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/module.render.js +24 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/normalize-request-url.js +25 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/app-router-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/entrypoints.js +87 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/head-manager-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/hooks-client-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/image-config-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/router-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/server-inserted-html.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/entrypoints.js +140 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtime.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-dom.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-turbopack-server.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-turbopack-static.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-static.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/entrypoints.js +125 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom-server.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/helpers/auto-implement-methods.js +85 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/helpers/clean-url.js +24 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js +29 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/helpers/is-static-gen-enabled.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/helpers/parsed-url-query-to-params.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/module.compiled.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/module.js +899 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/shared-modules.js +56 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/checks.js +45 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/builtin/_error.js +100 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/module.compiled.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/module.js +92 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/module.render.js +24 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/pages-handler.js +545 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/app-router-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/entrypoints.js +102 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/head-manager-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/hooks-client-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/html-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/image-config-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/loadable-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/loadable.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/router-context.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/server-inserted-html.js +4 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages-api/module.compiled.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages-api/module.js +58 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/route-module.js +650 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/runtime-reacts.external.js +46 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/send-payload.js +88 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/send-response.js +70 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/serve-static.js +66 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/server-route-utils.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/server-utils.js +323 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/setup-http-agent-env.js +31 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/stream-utils/encoded-tags.js +122 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +918 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/stream-utils/uint8array-helpers.js +74 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/typescript/constant.js +98 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/typescript/index.js +199 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/client-boundary.js +97 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/config.js +512 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/entry.js +149 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/error.js +38 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/metadata.js +234 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/server-boundary.js +115 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/server.js +79 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/typescript/utils.js +212 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/cache-life.js +163 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/cache-tag.js +52 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/constants.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/handlers.js +121 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/use-cache-errors.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +1588 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/utils.js +73 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/adapter.js +392 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/edge-route-module-wrapper.js +123 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/error.js +54 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/exports/index.js +56 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/get-edge-preview-props.js +23 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/globals.js +128 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/http.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/internal-edge-wait-until.js +64 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/next-url.js +199 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/sandbox/context.js +462 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/sandbox/fetch-inline-assets.js +35 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/sandbox/index.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/sandbox/resource-managers.js +88 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/sandbox/sandbox.js +137 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/adapters/headers.js +192 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/adapters/next-request.js +142 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +211 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/cookies.js +29 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/fetch-event.js +98 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/image-response.js +22 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/request.js +99 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/response.js +136 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/revalidate.js +214 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/unstable-cache.js +289 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/unstable-no-store.js +51 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/url-pattern.js +14 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/user-agent.js +46 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/types.js +6 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/utils.js +151 -0
- package/web/standalone/apps/web/node_modules/next/dist/server/web/web-on-close.js +87 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/action-revalidation-kind.js +31 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js +50 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/app-router-types.js +46 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/constants.js +448 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/deep-freeze.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/deployment-id.js +63 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/dset.js +34 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/encode-uri-path.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/entry-constants.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/error-source.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/errors/code-frame.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/errors/constants.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/errors/empty-generate-static-params-error.js +24 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/errors/hard-deprecated-config-error.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/escape-regexp.js +22 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/get-hostname.js +23 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/hash.js +42 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/head.js +163 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js +60 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/html-context.shared-runtime.js +40 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +25 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/i18n/get-locale-redirect.js +59 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +54 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/image-blur-svg.js +22 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/image-config-context.shared-runtime.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/image-config.js +77 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/invariant-error.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/is-plain-object.js +42 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/is-thenable.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/isomorphic/path.js +14 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js +37 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/loadable-context.shared-runtime.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/loadable.shared-runtime.js +246 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/match-local-pattern.js +46 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/match-remote-pattern.js +63 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/modern-browserslist-target.js +15 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/no-fallback-error.external.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/normalized-asset-prefix.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/absolute-path-to-page.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/get-page-paths.js +40 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/normalize-data-path.js +23 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/normalize-page-path.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/remove-page-path-tail.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/promise-with-resolvers.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/adapters.js +136 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/routes/app.js +122 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/add-locale.js +28 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/app-paths.js +62 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/as-path-to-search-params.js +17 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/cache-busting-search-param.js +24 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js +16 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js +27 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/format-url.js +111 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +174 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js +52 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/get-route-from-asset-path.js +25 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +90 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/html-bots.js +17 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/index.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/interception-prefix-from-param-type.js +33 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/interception-routes.js +108 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/is-bot.js +57 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +26 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/middleware-route-matcher.js +31 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js +30 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/parse-path.js +33 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js +43 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/parse-url.js +38 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +20 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/path-match.js +49 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +292 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/querystring.js +79 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/relativize-url.js +40 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +21 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/resolve-param-value.js +116 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/route-match-utils.js +113 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +45 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/route-regex.js +256 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +244 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +18 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/segment-cache/segment-value-encoding.js +99 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/segment-cache/vary-params-decoding.js +32 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/segment.js +102 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/server-inserted-html.shared-runtime.js +35 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/server-reference-info.js +56 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/side-effect.js +63 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/size-limit.js +40 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/turbopack/internal-error.js +53 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/utils/reflect-utils.js +69 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/utils/warn-once.js +22 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/utils.js +207 -0
- package/web/standalone/apps/web/node_modules/next/dist/shared/lib/zod.js +101 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/anonymous-meta.js +89 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/detached-flush.js +56 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/events/build.js +174 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/events/index.js +41 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/events/plugins.js +51 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/events/swc-load-failure.js +55 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/events/version.js +66 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/flush-telemetry.js +19 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/post-telemetry-payload.js +48 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/project-id.js +48 -0
- package/web/standalone/apps/web/node_modules/next/dist/telemetry/storage.js +301 -0
- package/web/standalone/apps/web/node_modules/next/dist/trace/index.js +58 -0
- package/web/standalone/apps/web/node_modules/next/dist/trace/report/index.js +37 -0
- package/web/standalone/apps/web/node_modules/next/dist/trace/report/to-json-build.js +40 -0
- package/web/standalone/apps/web/node_modules/next/dist/trace/report/to-json.js +165 -0
- package/web/standalone/apps/web/node_modules/next/dist/trace/report/to-telemetry.js +36 -0
- package/web/standalone/apps/web/node_modules/next/dist/trace/shared.js +39 -0
- package/web/standalone/apps/web/node_modules/next/dist/trace/trace.js +211 -0
- package/web/standalone/apps/web/node_modules/next/package.json +378 -0
- package/web/standalone/apps/web/package.json +33 -0
- package/web/standalone/apps/web/server.js +38 -0
- package/web/standalone/node_modules/@img/colour/color.cjs +1596 -0
- package/web/standalone/node_modules/@img/colour/index.cjs +1 -0
- package/web/standalone/node_modules/@img/colour/package.json +58 -0
- package/web/standalone/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
- package/web/standalone/node_modules/@img/sharp-darwin-arm64/package.json +40 -0
- package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/README.md +46 -0
- package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/lib/glib-2.0/include/glibconfig.h +220 -0
- package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/lib/index.js +1 -0
- package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib +0 -0
- package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/package.json +36 -0
- package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +30 -0
- package/web/standalone/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +6 -0
- package/web/standalone/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +38 -0
- package/web/standalone/node_modules/@swc/helpers/package.json +471 -0
- package/web/standalone/node_modules/client-only/index.js +0 -0
- package/web/standalone/node_modules/client-only/package.json +19 -0
- package/web/standalone/node_modules/detect-libc/lib/detect-libc.js +313 -0
- package/web/standalone/node_modules/detect-libc/lib/elf.js +39 -0
- package/web/standalone/node_modules/detect-libc/lib/filesystem.js +51 -0
- package/web/standalone/node_modules/detect-libc/lib/process.js +24 -0
- package/web/standalone/node_modules/detect-libc/package.json +44 -0
- package/web/standalone/node_modules/react/cjs/react-compiler-runtime.production.js +16 -0
- package/web/standalone/node_modules/react/cjs/react-jsx-dev-runtime.production.js +14 -0
- package/web/standalone/node_modules/react/cjs/react-jsx-runtime.production.js +34 -0
- package/web/standalone/node_modules/react/cjs/react.development.js +1284 -0
- package/web/standalone/node_modules/react/cjs/react.production.js +542 -0
- package/web/standalone/node_modules/react/compiler-runtime.js +14 -0
- package/web/standalone/node_modules/react/index.js +7 -0
- package/web/standalone/node_modules/react/jsx-dev-runtime.js +7 -0
- package/web/standalone/node_modules/react/jsx-runtime.js +7 -0
- package/web/standalone/node_modules/react/package.json +51 -0
- package/web/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +6603 -0
- package/web/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +6692 -0
- package/web/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +7410 -0
- package/web/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +7512 -0
- package/web/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +7707 -0
- package/web/standalone/node_modules/react-dom/cjs/react-dom.production.js +210 -0
- package/web/standalone/node_modules/react-dom/index.js +38 -0
- package/web/standalone/node_modules/react-dom/package.json +117 -0
- package/web/standalone/node_modules/react-dom/server.browser.js +16 -0
- package/web/standalone/node_modules/react-dom/server.edge.js +17 -0
- package/web/standalone/node_modules/react-dom/server.node.js +18 -0
- package/web/standalone/node_modules/react-dom/static.node.js +14 -0
- package/web/standalone/node_modules/sharp/lib/channel.js +177 -0
- package/web/standalone/node_modules/sharp/lib/colour.js +195 -0
- package/web/standalone/node_modules/sharp/lib/composite.js +212 -0
- package/web/standalone/node_modules/sharp/lib/constructor.js +499 -0
- package/web/standalone/node_modules/sharp/lib/index.js +16 -0
- package/web/standalone/node_modules/sharp/lib/input.js +809 -0
- package/web/standalone/node_modules/sharp/lib/is.js +143 -0
- package/web/standalone/node_modules/sharp/lib/libvips.js +207 -0
- package/web/standalone/node_modules/sharp/lib/operation.js +1016 -0
- package/web/standalone/node_modules/sharp/lib/output.js +1666 -0
- package/web/standalone/node_modules/sharp/lib/resize.js +595 -0
- package/web/standalone/node_modules/sharp/lib/sharp.js +121 -0
- package/web/standalone/node_modules/sharp/lib/utility.js +291 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/classes/comparator.js +143 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/classes/range.js +557 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/classes/semver.js +333 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/cmp.js +54 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/coerce.js +62 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/compare.js +7 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/eq.js +5 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/gt.js +5 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/gte.js +5 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/lt.js +5 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/lte.js +5 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/neq.js +5 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/parse.js +18 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/functions/satisfies.js +12 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/internal/constants.js +37 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/internal/debug.js +11 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/internal/identifiers.js +29 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/internal/lrucache.js +42 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/internal/parse-options.js +17 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/internal/re.js +223 -0
- package/web/standalone/node_modules/sharp/node_modules/semver/package.json +78 -0
- package/web/standalone/node_modules/sharp/package.json +202 -0
- package/web/standalone/node_modules/styled-jsx/dist/index/index.js +499 -0
- package/web/standalone/node_modules/styled-jsx/index.js +1 -0
- package/web/standalone/node_modules/styled-jsx/package.json +132 -0
- package/web/standalone/node_modules/styled-jsx/style.js +1 -0
- package/web/standalone/public/file.svg +1 -0
- package/web/standalone/public/globe.svg +1 -0
- package/web/standalone/public/next.svg +1 -0
- package/web/standalone/public/vercel.svg +1 -0
- package/web/standalone/public/window.svg +1 -0
|
@@ -0,0 +1,3134 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ImapClient,
|
|
3
|
+
buildConsentUrl,
|
|
4
|
+
buildXOAuth2Token,
|
|
5
|
+
exchangeCodeForTokens,
|
|
6
|
+
refreshAccessToken
|
|
7
|
+
} from "./chunk-3AMW7NXZ.js";
|
|
8
|
+
import {
|
|
9
|
+
createTelegramClient
|
|
10
|
+
} from "./chunk-2YT53FBK.js";
|
|
11
|
+
import {
|
|
12
|
+
createIpcHub,
|
|
13
|
+
createMessage
|
|
14
|
+
} from "./chunk-2UX7Z5TH.js";
|
|
15
|
+
import {
|
|
16
|
+
createS3Bucket
|
|
17
|
+
} from "./chunk-GZFR7ELC.js";
|
|
18
|
+
import {
|
|
19
|
+
createDatabaseClient
|
|
20
|
+
} from "./chunk-P5P73L35.js";
|
|
21
|
+
|
|
22
|
+
// ../daemon/src/config/config-store.ts
|
|
23
|
+
import { join } from "path";
|
|
24
|
+
import { homedir } from "os";
|
|
25
|
+
|
|
26
|
+
// ../store/src/store.ts
|
|
27
|
+
import initSqlJs from "sql.js";
|
|
28
|
+
import { readFileSync, writeFileSync, mkdirSync } from "fs";
|
|
29
|
+
import { dirname } from "path";
|
|
30
|
+
|
|
31
|
+
// ../store/src/table.ts
|
|
32
|
+
var buildWhere = (where) => {
|
|
33
|
+
const keys = Object.keys(where);
|
|
34
|
+
if (keys.length === 0) return { clause: "", values: [] };
|
|
35
|
+
const conditions = keys.map((k) => `${k} = ?`);
|
|
36
|
+
const values = keys.map((k) => where[k]);
|
|
37
|
+
return { clause: `WHERE ${conditions.join(" AND ")}`, values };
|
|
38
|
+
};
|
|
39
|
+
var rowsToObjects = (columns, values) => values.map((row) => {
|
|
40
|
+
const obj = {};
|
|
41
|
+
columns.forEach((col, i) => {
|
|
42
|
+
obj[col] = row[i];
|
|
43
|
+
});
|
|
44
|
+
return obj;
|
|
45
|
+
});
|
|
46
|
+
var buildColumnSql = (col, def) => {
|
|
47
|
+
let sql = `${col} ${def.type.toUpperCase()}`;
|
|
48
|
+
if (def.primaryKey) sql += " PRIMARY KEY";
|
|
49
|
+
if (!def.nullable && !def.primaryKey) sql += " NOT NULL";
|
|
50
|
+
if (def.default !== void 0) {
|
|
51
|
+
sql += ` DEFAULT ${typeof def.default === "string" ? `'${def.default}'` : def.default}`;
|
|
52
|
+
}
|
|
53
|
+
if (def.check) {
|
|
54
|
+
sql += ` CHECK(${col} IN (${def.check.map((v) => `'${v}'`).join(", ")}))`;
|
|
55
|
+
}
|
|
56
|
+
return sql;
|
|
57
|
+
};
|
|
58
|
+
var createTable = (db, saveFn, name, schema) => {
|
|
59
|
+
const columns = Object.entries(schema).map(([col, def]) => buildColumnSql(col, def));
|
|
60
|
+
db.run(`CREATE TABLE IF NOT EXISTS ${name} (${columns.join(", ")})`);
|
|
61
|
+
return {
|
|
62
|
+
/** Insert a new row into the table. */
|
|
63
|
+
insert(row) {
|
|
64
|
+
const keys = Object.keys(row);
|
|
65
|
+
const placeholders = keys.map(() => "?").join(", ");
|
|
66
|
+
const values = keys.map((k) => row[k]);
|
|
67
|
+
db.run(`INSERT INTO ${name} (${keys.join(", ")}) VALUES (${placeholders})`, values);
|
|
68
|
+
saveFn();
|
|
69
|
+
},
|
|
70
|
+
/** Find rows matching an optional WHERE clause. Returns all rows if no clause given. */
|
|
71
|
+
findMany(clause) {
|
|
72
|
+
let result;
|
|
73
|
+
if (clause) {
|
|
74
|
+
const { clause: where, values } = buildWhere(clause.where);
|
|
75
|
+
result = db.exec(`SELECT * FROM ${name} ${where}`, values);
|
|
76
|
+
} else {
|
|
77
|
+
result = db.exec(`SELECT * FROM ${name}`);
|
|
78
|
+
}
|
|
79
|
+
if (result.length === 0) return [];
|
|
80
|
+
return rowsToObjects(result[0].columns, result[0].values);
|
|
81
|
+
},
|
|
82
|
+
/** Find a single row matching the WHERE clause. Returns undefined if not found. */
|
|
83
|
+
findOne(clause) {
|
|
84
|
+
const { clause: where, values } = buildWhere(clause.where);
|
|
85
|
+
const result = db.exec(`SELECT * FROM ${name} ${where} LIMIT 1`, values);
|
|
86
|
+
if (result.length === 0 || result[0].values.length === 0) return void 0;
|
|
87
|
+
return rowsToObjects(result[0].columns, result[0].values)[0];
|
|
88
|
+
},
|
|
89
|
+
/** Update rows matching the WHERE clause. Returns the number of modified rows. */
|
|
90
|
+
update(values, clause) {
|
|
91
|
+
const setKeys = Object.keys(values);
|
|
92
|
+
const setClause = setKeys.map((k) => `${k} = ?`).join(", ");
|
|
93
|
+
const setValues = setKeys.map((k) => values[k]);
|
|
94
|
+
const { clause: where, values: whereValues } = buildWhere(clause.where);
|
|
95
|
+
db.run(`UPDATE ${name} SET ${setClause} ${where}`, [...setValues, ...whereValues]);
|
|
96
|
+
const modified = db.getRowsModified();
|
|
97
|
+
saveFn();
|
|
98
|
+
return modified;
|
|
99
|
+
},
|
|
100
|
+
/** Delete rows matching the WHERE clause. Returns the number of deleted rows. */
|
|
101
|
+
deleteRows(clause) {
|
|
102
|
+
const { clause: where, values } = buildWhere(clause.where);
|
|
103
|
+
db.run(`DELETE FROM ${name} ${where}`, values);
|
|
104
|
+
const modified = db.getRowsModified();
|
|
105
|
+
saveFn();
|
|
106
|
+
return modified;
|
|
107
|
+
},
|
|
108
|
+
/** Return every row in the table. */
|
|
109
|
+
all() {
|
|
110
|
+
const result = db.exec(`SELECT * FROM ${name}`);
|
|
111
|
+
if (result.length === 0) return [];
|
|
112
|
+
return rowsToObjects(result[0].columns, result[0].values);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// ../store/src/store.ts
|
|
118
|
+
var createStore = async (options) => {
|
|
119
|
+
const SQL = await initSqlJs();
|
|
120
|
+
let db;
|
|
121
|
+
try {
|
|
122
|
+
const buffer = readFileSync(options.path);
|
|
123
|
+
db = new SQL.Database(buffer);
|
|
124
|
+
} catch {
|
|
125
|
+
mkdirSync(dirname(options.path), { recursive: true });
|
|
126
|
+
db = new SQL.Database();
|
|
127
|
+
}
|
|
128
|
+
const save = () => {
|
|
129
|
+
const data = db.export();
|
|
130
|
+
writeFileSync(options.path, Buffer.from(data));
|
|
131
|
+
};
|
|
132
|
+
const tables = /* @__PURE__ */ new Map();
|
|
133
|
+
for (const [name, schema] of Object.entries(options.tables)) {
|
|
134
|
+
tables.set(name, createTable(db, save, name, schema));
|
|
135
|
+
}
|
|
136
|
+
save();
|
|
137
|
+
return {
|
|
138
|
+
table(name) {
|
|
139
|
+
const t = tables.get(name);
|
|
140
|
+
if (!t) throw new Error(`Unknown table: ${name}`);
|
|
141
|
+
return t;
|
|
142
|
+
},
|
|
143
|
+
query(sql, params) {
|
|
144
|
+
const result = params ? db.exec(sql, params) : db.exec(sql);
|
|
145
|
+
if (result.length === 0) return [];
|
|
146
|
+
const { columns, values } = result[0];
|
|
147
|
+
return values.map((row) => {
|
|
148
|
+
const obj = {};
|
|
149
|
+
columns.forEach((col, i) => {
|
|
150
|
+
obj[col] = row[i];
|
|
151
|
+
});
|
|
152
|
+
return obj;
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
close() {
|
|
156
|
+
save();
|
|
157
|
+
db.close();
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// ../daemon/src/config/schema.ts
|
|
163
|
+
var configSchema = {
|
|
164
|
+
/**
|
|
165
|
+
* Singleton helper process configurations.
|
|
166
|
+
* The `kind` column is unique — only one helper per kind.
|
|
167
|
+
*/
|
|
168
|
+
helpers: {
|
|
169
|
+
id: { type: "text", primaryKey: true },
|
|
170
|
+
kind: { type: "text" },
|
|
171
|
+
name: { type: "text" },
|
|
172
|
+
config: { type: "text" },
|
|
173
|
+
auto_start: { type: "integer", default: 0 },
|
|
174
|
+
created_at: { type: "text" },
|
|
175
|
+
updated_at: { type: "text" }
|
|
176
|
+
},
|
|
177
|
+
/**
|
|
178
|
+
* Global S3 bucket profiles. Shared across all agents.
|
|
179
|
+
* Credentials are referenced by AWS profile name (stored in ~/.aws/credentials).
|
|
180
|
+
*/
|
|
181
|
+
s3_profiles: {
|
|
182
|
+
id: { type: "text", primaryKey: true },
|
|
183
|
+
name: { type: "text" },
|
|
184
|
+
bucket: { type: "text" },
|
|
185
|
+
region: { type: "text" },
|
|
186
|
+
aws_profile: { type: "text", nullable: true },
|
|
187
|
+
verified: { type: "integer", default: 0 },
|
|
188
|
+
created_at: { type: "text" }
|
|
189
|
+
},
|
|
190
|
+
/**
|
|
191
|
+
* Global key-value settings for the daemon (ports, etc.).
|
|
192
|
+
*/
|
|
193
|
+
settings: {
|
|
194
|
+
key: { type: "text", primaryKey: true },
|
|
195
|
+
value: { type: "text" }
|
|
196
|
+
},
|
|
197
|
+
/**
|
|
198
|
+
* Gmail accounts connected via OAuth.
|
|
199
|
+
* Refresh tokens are AES-256-CBC encrypted.
|
|
200
|
+
*/
|
|
201
|
+
email_accounts: {
|
|
202
|
+
id: { type: "text", primaryKey: true },
|
|
203
|
+
name: { type: "text" },
|
|
204
|
+
email: { type: "text" },
|
|
205
|
+
refresh_token: { type: "text" },
|
|
206
|
+
created_at: { type: "text" },
|
|
207
|
+
updated_at: { type: "text" }
|
|
208
|
+
},
|
|
209
|
+
/**
|
|
210
|
+
* Routing rules: email account -> target agent.
|
|
211
|
+
* When a new email arrives on the account, it is forwarded
|
|
212
|
+
* to the target agent via IPC prompt.
|
|
213
|
+
*/
|
|
214
|
+
email_connections: {
|
|
215
|
+
id: { type: "text", primaryKey: true },
|
|
216
|
+
account_id: { type: "text" },
|
|
217
|
+
target_agent: { type: "text" },
|
|
218
|
+
command: { type: "text" },
|
|
219
|
+
enabled: { type: "integer", default: 1 },
|
|
220
|
+
created_at: { type: "text" },
|
|
221
|
+
updated_at: { type: "text" }
|
|
222
|
+
},
|
|
223
|
+
/**
|
|
224
|
+
* Global database connection profiles. Shared across all agents.
|
|
225
|
+
* Passwords are AES-256-CBC encrypted.
|
|
226
|
+
*/
|
|
227
|
+
database_profiles: {
|
|
228
|
+
id: { type: "text", primaryKey: true },
|
|
229
|
+
name: { type: "text" },
|
|
230
|
+
db_type: { type: "text" },
|
|
231
|
+
host: { type: "text", nullable: true },
|
|
232
|
+
port: { type: "integer", nullable: true },
|
|
233
|
+
database: { type: "text" },
|
|
234
|
+
username: { type: "text", nullable: true },
|
|
235
|
+
password: { type: "text", nullable: true },
|
|
236
|
+
ssl_mode: { type: "text", nullable: true },
|
|
237
|
+
verified: { type: "integer", default: 0 },
|
|
238
|
+
created_at: { type: "text" }
|
|
239
|
+
},
|
|
240
|
+
/**
|
|
241
|
+
* OAuth client credentials (one row per provider, e.g. "gmail").
|
|
242
|
+
* Client secret is AES-256-CBC encrypted.
|
|
243
|
+
*/
|
|
244
|
+
oauth_credentials: {
|
|
245
|
+
key: { type: "text", primaryKey: true },
|
|
246
|
+
client_id: { type: "text" },
|
|
247
|
+
client_secret: { type: "text" }
|
|
248
|
+
},
|
|
249
|
+
/**
|
|
250
|
+
* Telegram bot profiles. Bot tokens are AES-256-CBC encrypted.
|
|
251
|
+
* Each bot can be connected to multiple agents via telegram_connections.
|
|
252
|
+
*/
|
|
253
|
+
telegram_bots: {
|
|
254
|
+
id: { type: "text", primaryKey: true },
|
|
255
|
+
name: { type: "text" },
|
|
256
|
+
token: { type: "text" },
|
|
257
|
+
bot_username: { type: "text" },
|
|
258
|
+
polling: { type: "integer", default: 1 },
|
|
259
|
+
webhook_url: { type: "text", nullable: true },
|
|
260
|
+
verified: { type: "integer", default: 0 },
|
|
261
|
+
created_at: { type: "text" }
|
|
262
|
+
},
|
|
263
|
+
/**
|
|
264
|
+
* Routing rules: Telegram bot + chat -> target agent.
|
|
265
|
+
* When a message arrives on the bot matching the chat_id,
|
|
266
|
+
* it is forwarded to the target agent via IPC prompt.
|
|
267
|
+
*/
|
|
268
|
+
telegram_connections: {
|
|
269
|
+
id: { type: "text", primaryKey: true },
|
|
270
|
+
bot_id: { type: "text" },
|
|
271
|
+
target_agent: { type: "text" },
|
|
272
|
+
chat_id: { type: "text" },
|
|
273
|
+
enabled: { type: "integer", default: 1 },
|
|
274
|
+
created_at: { type: "text" }
|
|
275
|
+
},
|
|
276
|
+
/**
|
|
277
|
+
* Global HTTP endpoints. Each endpoint exposes a unique URL path
|
|
278
|
+
* for external systems to trigger agents via POST /api/trigger/:path.
|
|
279
|
+
*/
|
|
280
|
+
http_endpoints: {
|
|
281
|
+
id: { type: "text", primaryKey: true },
|
|
282
|
+
name: { type: "text" },
|
|
283
|
+
path: { type: "text" },
|
|
284
|
+
api_key: { type: "text", nullable: true },
|
|
285
|
+
enabled: { type: "integer", default: 1 },
|
|
286
|
+
created_at: { type: "text" }
|
|
287
|
+
},
|
|
288
|
+
/**
|
|
289
|
+
* Routing rules: HTTP endpoint -> target agent.
|
|
290
|
+
* When a POST hits the endpoint, the request is forwarded
|
|
291
|
+
* to the target agent via IPC prompt.
|
|
292
|
+
*/
|
|
293
|
+
http_connections: {
|
|
294
|
+
id: { type: "text", primaryKey: true },
|
|
295
|
+
endpoint_id: { type: "text" },
|
|
296
|
+
target_agent: { type: "text" },
|
|
297
|
+
command: { type: "text", nullable: true },
|
|
298
|
+
enabled: { type: "integer", default: 1 },
|
|
299
|
+
created_at: { type: "text" }
|
|
300
|
+
},
|
|
301
|
+
/**
|
|
302
|
+
* Global cron jobs. Each job fires on a schedule and routes
|
|
303
|
+
* to one or more agents via cron_connections.
|
|
304
|
+
*/
|
|
305
|
+
cron_jobs: {
|
|
306
|
+
id: { type: "text", primaryKey: true },
|
|
307
|
+
name: { type: "text" },
|
|
308
|
+
schedule: { type: "text" },
|
|
309
|
+
enabled: { type: "integer", default: 1 },
|
|
310
|
+
created_at: { type: "text" }
|
|
311
|
+
},
|
|
312
|
+
/**
|
|
313
|
+
* Routing rules: cron job -> target agent.
|
|
314
|
+
* When a cron job fires, each enabled connection triggers
|
|
315
|
+
* the target agent with the configured command (or the job
|
|
316
|
+
* name as a free-form prompt if command is null).
|
|
317
|
+
*/
|
|
318
|
+
cron_connections: {
|
|
319
|
+
id: { type: "text", primaryKey: true },
|
|
320
|
+
cron_job_id: { type: "text" },
|
|
321
|
+
target_agent: { type: "text" },
|
|
322
|
+
command: { type: "text", nullable: true },
|
|
323
|
+
enabled: { type: "integer", default: 1 },
|
|
324
|
+
created_at: { type: "text" }
|
|
325
|
+
},
|
|
326
|
+
/**
|
|
327
|
+
* Routing rules: S3 profile -> target agent.
|
|
328
|
+
* Passive capability — no command, just a purpose description.
|
|
329
|
+
* Auto-generates a capability file in the agent directory.
|
|
330
|
+
*/
|
|
331
|
+
s3_connections: {
|
|
332
|
+
id: { type: "text", primaryKey: true },
|
|
333
|
+
profile_id: { type: "text" },
|
|
334
|
+
target_agent: { type: "text" },
|
|
335
|
+
purpose: { type: "text" },
|
|
336
|
+
enabled: { type: "integer", default: 1 },
|
|
337
|
+
created_at: { type: "text" }
|
|
338
|
+
},
|
|
339
|
+
/**
|
|
340
|
+
* Routing rules: database profile -> target agent.
|
|
341
|
+
* Passive capability — no command, just a purpose description.
|
|
342
|
+
* Auto-generates a capability file in the agent directory.
|
|
343
|
+
*/
|
|
344
|
+
database_connections: {
|
|
345
|
+
id: { type: "text", primaryKey: true },
|
|
346
|
+
profile_id: { type: "text" },
|
|
347
|
+
target_agent: { type: "text" },
|
|
348
|
+
purpose: { type: "text" },
|
|
349
|
+
enabled: { type: "integer", default: 1 },
|
|
350
|
+
created_at: { type: "text" }
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
// ../daemon/src/config/config-store.ts
|
|
355
|
+
var getDataDir = () => process.env["KINDFLOW_DATA_DIR"] ?? join(homedir(), ".kindflow");
|
|
356
|
+
var helperToRow = (helper) => ({
|
|
357
|
+
id: helper.id,
|
|
358
|
+
kind: helper.kind,
|
|
359
|
+
name: helper.name,
|
|
360
|
+
config: JSON.stringify(helper.config),
|
|
361
|
+
auto_start: helper.autoStart ? 1 : 0,
|
|
362
|
+
created_at: helper.createdAt,
|
|
363
|
+
updated_at: helper.updatedAt
|
|
364
|
+
});
|
|
365
|
+
var rowToHelper = (row) => ({
|
|
366
|
+
id: row["id"],
|
|
367
|
+
kind: row["kind"],
|
|
368
|
+
name: row["name"],
|
|
369
|
+
config: JSON.parse(row["config"]),
|
|
370
|
+
autoStart: row["auto_start"] === 1,
|
|
371
|
+
createdAt: row["created_at"],
|
|
372
|
+
updatedAt: row["updated_at"]
|
|
373
|
+
});
|
|
374
|
+
var emailAccountToRow = (account) => ({
|
|
375
|
+
id: account.id,
|
|
376
|
+
name: account.name,
|
|
377
|
+
email: account.email,
|
|
378
|
+
refresh_token: account.refreshToken,
|
|
379
|
+
created_at: account.createdAt,
|
|
380
|
+
updated_at: account.updatedAt
|
|
381
|
+
});
|
|
382
|
+
var rowToEmailAccount = (row) => ({
|
|
383
|
+
id: row["id"],
|
|
384
|
+
name: row["name"],
|
|
385
|
+
email: row["email"],
|
|
386
|
+
refreshToken: row["refresh_token"],
|
|
387
|
+
createdAt: row["created_at"],
|
|
388
|
+
updatedAt: row["updated_at"]
|
|
389
|
+
});
|
|
390
|
+
var emailConnectionToRow = (conn) => ({
|
|
391
|
+
id: conn.id,
|
|
392
|
+
account_id: conn.accountId,
|
|
393
|
+
target_agent: conn.targetAgent,
|
|
394
|
+
command: conn.command,
|
|
395
|
+
enabled: conn.enabled ? 1 : 0,
|
|
396
|
+
created_at: conn.createdAt,
|
|
397
|
+
updated_at: conn.updatedAt
|
|
398
|
+
});
|
|
399
|
+
var rowToEmailConnection = (row) => ({
|
|
400
|
+
id: row["id"],
|
|
401
|
+
accountId: row["account_id"],
|
|
402
|
+
targetAgent: row["target_agent"],
|
|
403
|
+
command: row["command"],
|
|
404
|
+
enabled: row["enabled"] === 1,
|
|
405
|
+
createdAt: row["created_at"],
|
|
406
|
+
updatedAt: row["updated_at"]
|
|
407
|
+
});
|
|
408
|
+
var rowToTelegramBot = (row) => ({
|
|
409
|
+
id: row["id"],
|
|
410
|
+
name: row["name"],
|
|
411
|
+
token: row["token"],
|
|
412
|
+
botUsername: row["bot_username"],
|
|
413
|
+
polling: row["polling"] === 1,
|
|
414
|
+
webhookUrl: row["webhook_url"] || null,
|
|
415
|
+
verified: row["verified"] === 1,
|
|
416
|
+
createdAt: row["created_at"]
|
|
417
|
+
});
|
|
418
|
+
var telegramBotToRow = (bot) => ({
|
|
419
|
+
id: bot.id,
|
|
420
|
+
name: bot.name,
|
|
421
|
+
token: bot.token,
|
|
422
|
+
bot_username: bot.botUsername,
|
|
423
|
+
polling: bot.polling ? 1 : 0,
|
|
424
|
+
webhook_url: bot.webhookUrl ?? "",
|
|
425
|
+
verified: bot.verified ? 1 : 0,
|
|
426
|
+
created_at: bot.createdAt
|
|
427
|
+
});
|
|
428
|
+
var rowToTelegramConnection = (row) => ({
|
|
429
|
+
id: row["id"],
|
|
430
|
+
botId: row["bot_id"],
|
|
431
|
+
targetAgent: row["target_agent"],
|
|
432
|
+
chatId: row["chat_id"],
|
|
433
|
+
enabled: row["enabled"] === 1,
|
|
434
|
+
createdAt: row["created_at"]
|
|
435
|
+
});
|
|
436
|
+
var telegramConnectionToRow = (conn) => ({
|
|
437
|
+
id: conn.id,
|
|
438
|
+
bot_id: conn.botId,
|
|
439
|
+
target_agent: conn.targetAgent,
|
|
440
|
+
chat_id: conn.chatId,
|
|
441
|
+
enabled: conn.enabled ? 1 : 0,
|
|
442
|
+
created_at: conn.createdAt
|
|
443
|
+
});
|
|
444
|
+
var rowToHttpEndpoint = (row) => ({
|
|
445
|
+
id: row["id"],
|
|
446
|
+
name: row["name"],
|
|
447
|
+
path: row["path"],
|
|
448
|
+
apiKey: row["api_key"] || null,
|
|
449
|
+
enabled: row["enabled"] === 1,
|
|
450
|
+
createdAt: row["created_at"]
|
|
451
|
+
});
|
|
452
|
+
var httpEndpointToRow = (endpoint) => ({
|
|
453
|
+
id: endpoint.id,
|
|
454
|
+
name: endpoint.name,
|
|
455
|
+
path: endpoint.path,
|
|
456
|
+
api_key: endpoint.apiKey ?? "",
|
|
457
|
+
enabled: endpoint.enabled ? 1 : 0,
|
|
458
|
+
created_at: endpoint.createdAt
|
|
459
|
+
});
|
|
460
|
+
var rowToHttpConnection = (row) => ({
|
|
461
|
+
id: row["id"],
|
|
462
|
+
endpointId: row["endpoint_id"],
|
|
463
|
+
targetAgent: row["target_agent"],
|
|
464
|
+
command: row["command"] || null,
|
|
465
|
+
enabled: row["enabled"] === 1,
|
|
466
|
+
createdAt: row["created_at"]
|
|
467
|
+
});
|
|
468
|
+
var httpConnectionToRow = (conn) => ({
|
|
469
|
+
id: conn.id,
|
|
470
|
+
endpoint_id: conn.endpointId,
|
|
471
|
+
target_agent: conn.targetAgent,
|
|
472
|
+
command: conn.command ?? "",
|
|
473
|
+
enabled: conn.enabled ? 1 : 0,
|
|
474
|
+
created_at: conn.createdAt
|
|
475
|
+
});
|
|
476
|
+
var rowToS3Connection = (row) => ({
|
|
477
|
+
id: row["id"],
|
|
478
|
+
profileId: row["profile_id"],
|
|
479
|
+
targetAgent: row["target_agent"],
|
|
480
|
+
purpose: row["purpose"],
|
|
481
|
+
enabled: row["enabled"] === 1,
|
|
482
|
+
createdAt: row["created_at"]
|
|
483
|
+
});
|
|
484
|
+
var s3ConnectionToRow = (conn) => ({
|
|
485
|
+
id: conn.id,
|
|
486
|
+
profile_id: conn.profileId,
|
|
487
|
+
target_agent: conn.targetAgent,
|
|
488
|
+
purpose: conn.purpose,
|
|
489
|
+
enabled: conn.enabled ? 1 : 0,
|
|
490
|
+
created_at: conn.createdAt
|
|
491
|
+
});
|
|
492
|
+
var rowToDatabaseConnection = (row) => ({
|
|
493
|
+
id: row["id"],
|
|
494
|
+
profileId: row["profile_id"],
|
|
495
|
+
targetAgent: row["target_agent"],
|
|
496
|
+
purpose: row["purpose"],
|
|
497
|
+
enabled: row["enabled"] === 1,
|
|
498
|
+
createdAt: row["created_at"]
|
|
499
|
+
});
|
|
500
|
+
var databaseConnectionToRow = (conn) => ({
|
|
501
|
+
id: conn.id,
|
|
502
|
+
profile_id: conn.profileId,
|
|
503
|
+
target_agent: conn.targetAgent,
|
|
504
|
+
purpose: conn.purpose,
|
|
505
|
+
enabled: conn.enabled ? 1 : 0,
|
|
506
|
+
created_at: conn.createdAt
|
|
507
|
+
});
|
|
508
|
+
var rowToCronJob = (row) => ({
|
|
509
|
+
id: row["id"],
|
|
510
|
+
name: row["name"],
|
|
511
|
+
schedule: row["schedule"],
|
|
512
|
+
enabled: row["enabled"] === 1,
|
|
513
|
+
createdAt: row["created_at"]
|
|
514
|
+
});
|
|
515
|
+
var cronJobToRow = (job) => ({
|
|
516
|
+
id: job.id,
|
|
517
|
+
name: job.name,
|
|
518
|
+
schedule: job.schedule,
|
|
519
|
+
enabled: job.enabled ? 1 : 0,
|
|
520
|
+
created_at: job.createdAt
|
|
521
|
+
});
|
|
522
|
+
var rowToCronConnection = (row) => ({
|
|
523
|
+
id: row["id"],
|
|
524
|
+
cronJobId: row["cron_job_id"],
|
|
525
|
+
targetAgent: row["target_agent"],
|
|
526
|
+
command: row["command"],
|
|
527
|
+
enabled: row["enabled"] === 1,
|
|
528
|
+
createdAt: row["created_at"]
|
|
529
|
+
});
|
|
530
|
+
var cronConnectionToRow = (conn) => ({
|
|
531
|
+
id: conn.id,
|
|
532
|
+
cron_job_id: conn.cronJobId,
|
|
533
|
+
target_agent: conn.targetAgent,
|
|
534
|
+
command: conn.command ?? "",
|
|
535
|
+
enabled: conn.enabled ? 1 : 0,
|
|
536
|
+
created_at: conn.createdAt
|
|
537
|
+
});
|
|
538
|
+
var createConfigStore = async (dataDir) => {
|
|
539
|
+
const dir = dataDir ?? getDataDir();
|
|
540
|
+
const dbPath = join(dir, "config.db");
|
|
541
|
+
const store = await createStore({
|
|
542
|
+
path: dbPath,
|
|
543
|
+
tables: configSchema
|
|
544
|
+
});
|
|
545
|
+
const helpers = store.table("helpers");
|
|
546
|
+
const s3Profiles = store.table("s3_profiles");
|
|
547
|
+
const dbProfiles = store.table("database_profiles");
|
|
548
|
+
const settings = store.table("settings");
|
|
549
|
+
const emailAccounts = store.table("email_accounts");
|
|
550
|
+
const emailConnections = store.table("email_connections");
|
|
551
|
+
const oauthCredentials = store.table("oauth_credentials");
|
|
552
|
+
const telegramBots = store.table("telegram_bots");
|
|
553
|
+
const telegramConnections = store.table("telegram_connections");
|
|
554
|
+
const httpEndpoints = store.table("http_endpoints");
|
|
555
|
+
const httpConnectionsTable = store.table("http_connections");
|
|
556
|
+
const cronJobsTable = store.table("cron_jobs");
|
|
557
|
+
const cronConnectionsTable = store.table("cron_connections");
|
|
558
|
+
const s3ConnectionsTable = store.table("s3_connections");
|
|
559
|
+
const databaseConnectionsTable = store.table("database_connections");
|
|
560
|
+
const rowToDb = (row) => ({
|
|
561
|
+
id: row["id"],
|
|
562
|
+
name: row["name"],
|
|
563
|
+
type: row["db_type"],
|
|
564
|
+
host: row["host"] || null,
|
|
565
|
+
port: row["port"] || null,
|
|
566
|
+
database: row["database"],
|
|
567
|
+
username: row["username"] || null,
|
|
568
|
+
password: row["password"] || null,
|
|
569
|
+
sslMode: row["ssl_mode"] || null,
|
|
570
|
+
verified: row["verified"] === 1,
|
|
571
|
+
createdAt: row["created_at"]
|
|
572
|
+
});
|
|
573
|
+
const rowToS3 = (row) => ({
|
|
574
|
+
id: row["id"],
|
|
575
|
+
name: row["name"],
|
|
576
|
+
bucket: row["bucket"],
|
|
577
|
+
region: row["region"],
|
|
578
|
+
awsProfile: row["aws_profile"] || null,
|
|
579
|
+
verified: row["verified"] === 1,
|
|
580
|
+
createdAt: row["created_at"]
|
|
581
|
+
});
|
|
582
|
+
return {
|
|
583
|
+
getHelpers: () => helpers.all().map(rowToHelper),
|
|
584
|
+
getHelper: (id) => {
|
|
585
|
+
const row = helpers.findOne({ where: { id } });
|
|
586
|
+
return row ? rowToHelper(row) : void 0;
|
|
587
|
+
},
|
|
588
|
+
saveHelper: (helper) => {
|
|
589
|
+
const existing = helpers.findOne({ where: { id: helper.id } });
|
|
590
|
+
const row = helperToRow(helper);
|
|
591
|
+
if (existing) {
|
|
592
|
+
helpers.update(row, { where: { id: helper.id } });
|
|
593
|
+
} else {
|
|
594
|
+
helpers.insert(row);
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
getS3Profiles: () => s3Profiles.all().map(rowToS3),
|
|
598
|
+
getS3Profile: (id) => {
|
|
599
|
+
const row = s3Profiles.findOne({ where: { id } });
|
|
600
|
+
return row ? rowToS3(row) : void 0;
|
|
601
|
+
},
|
|
602
|
+
saveS3Profile: (profile) => {
|
|
603
|
+
const existing = s3Profiles.findOne({ where: { id: profile.id } });
|
|
604
|
+
const row = { id: profile.id, name: profile.name, bucket: profile.bucket, region: profile.region, aws_profile: profile.awsProfile ?? "", verified: profile.verified ? 1 : 0, created_at: profile.createdAt };
|
|
605
|
+
if (existing) {
|
|
606
|
+
s3Profiles.update(row, { where: { id: profile.id } });
|
|
607
|
+
} else {
|
|
608
|
+
s3Profiles.insert(row);
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
deleteS3Profile: (id) => s3Profiles.deleteRows({ where: { id } }),
|
|
612
|
+
getS3Connections: () => s3ConnectionsTable.all().map((row) => rowToS3Connection(row)),
|
|
613
|
+
getS3ConnectionsForProfile: (profileId) => s3ConnectionsTable.findMany({ where: { profile_id: profileId } }).map((row) => rowToS3Connection(row)),
|
|
614
|
+
getS3ConnectionsForAgent: (agentId) => s3ConnectionsTable.findMany({ where: { target_agent: agentId } }).map((row) => rowToS3Connection(row)),
|
|
615
|
+
saveS3Connection: (connection) => {
|
|
616
|
+
const existing = s3ConnectionsTable.findOne({ where: { id: connection.id } });
|
|
617
|
+
const row = s3ConnectionToRow(connection);
|
|
618
|
+
if (existing) {
|
|
619
|
+
s3ConnectionsTable.update(row, { where: { id: connection.id } });
|
|
620
|
+
} else {
|
|
621
|
+
s3ConnectionsTable.insert(row);
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
deleteS3Connection: (id) => s3ConnectionsTable.deleteRows({ where: { id } }),
|
|
625
|
+
getDatabaseProfiles: () => dbProfiles.all().map((row) => rowToDb(row)),
|
|
626
|
+
getDatabaseProfile: (id) => {
|
|
627
|
+
const row = dbProfiles.findOne({ where: { id } });
|
|
628
|
+
return row ? rowToDb(row) : void 0;
|
|
629
|
+
},
|
|
630
|
+
saveDatabaseProfile: (profile) => {
|
|
631
|
+
const existing = dbProfiles.findOne({ where: { id: profile.id } });
|
|
632
|
+
const row = {
|
|
633
|
+
id: profile.id,
|
|
634
|
+
name: profile.name,
|
|
635
|
+
db_type: profile.type,
|
|
636
|
+
host: profile.host ?? "",
|
|
637
|
+
port: profile.port ?? 0,
|
|
638
|
+
database: profile.database,
|
|
639
|
+
username: profile.username ?? "",
|
|
640
|
+
password: profile.password ?? "",
|
|
641
|
+
ssl_mode: profile.sslMode ?? "",
|
|
642
|
+
verified: profile.verified ? 1 : 0,
|
|
643
|
+
created_at: profile.createdAt
|
|
644
|
+
};
|
|
645
|
+
if (existing) {
|
|
646
|
+
dbProfiles.update(row, { where: { id: profile.id } });
|
|
647
|
+
} else {
|
|
648
|
+
dbProfiles.insert(row);
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
deleteDatabaseProfile: (id) => dbProfiles.deleteRows({ where: { id } }),
|
|
652
|
+
getDatabaseConnections: () => databaseConnectionsTable.all().map((row) => rowToDatabaseConnection(row)),
|
|
653
|
+
getDatabaseConnectionsForProfile: (profileId) => databaseConnectionsTable.findMany({ where: { profile_id: profileId } }).map((row) => rowToDatabaseConnection(row)),
|
|
654
|
+
getDatabaseConnectionsForAgent: (agentId) => databaseConnectionsTable.findMany({ where: { target_agent: agentId } }).map((row) => rowToDatabaseConnection(row)),
|
|
655
|
+
saveDatabaseConnection: (connection) => {
|
|
656
|
+
const existing = databaseConnectionsTable.findOne({ where: { id: connection.id } });
|
|
657
|
+
const row = databaseConnectionToRow(connection);
|
|
658
|
+
if (existing) {
|
|
659
|
+
databaseConnectionsTable.update(row, { where: { id: connection.id } });
|
|
660
|
+
} else {
|
|
661
|
+
databaseConnectionsTable.insert(row);
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
deleteDatabaseConnection: (id) => databaseConnectionsTable.deleteRows({ where: { id } }),
|
|
665
|
+
getSetting: (key) => {
|
|
666
|
+
const row = settings.findOne({ where: { key } });
|
|
667
|
+
return row ? row["value"] : void 0;
|
|
668
|
+
},
|
|
669
|
+
setSetting: (key, value) => {
|
|
670
|
+
const existing = settings.findOne({ where: { key } });
|
|
671
|
+
if (existing) {
|
|
672
|
+
settings.update({ key, value }, { where: { key } });
|
|
673
|
+
} else {
|
|
674
|
+
settings.insert({ key, value });
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
getEmailAccounts: () => emailAccounts.all().map((row) => rowToEmailAccount(row)),
|
|
678
|
+
getEmailAccount: (id) => {
|
|
679
|
+
const row = emailAccounts.findOne({ where: { id } });
|
|
680
|
+
return row ? rowToEmailAccount(row) : void 0;
|
|
681
|
+
},
|
|
682
|
+
saveEmailAccount: (account) => {
|
|
683
|
+
const existing = emailAccounts.findOne({ where: { id: account.id } });
|
|
684
|
+
const row = emailAccountToRow(account);
|
|
685
|
+
if (existing) {
|
|
686
|
+
emailAccounts.update(row, { where: { id: account.id } });
|
|
687
|
+
} else {
|
|
688
|
+
emailAccounts.insert(row);
|
|
689
|
+
}
|
|
690
|
+
},
|
|
691
|
+
deleteEmailAccount: (id) => {
|
|
692
|
+
emailConnections.deleteRows({ where: { account_id: id } });
|
|
693
|
+
emailAccounts.deleteRows({ where: { id } });
|
|
694
|
+
},
|
|
695
|
+
getEmailConnections: () => emailConnections.all().map((row) => rowToEmailConnection(row)),
|
|
696
|
+
getEmailConnection: (id) => {
|
|
697
|
+
const row = emailConnections.findOne({ where: { id } });
|
|
698
|
+
return row ? rowToEmailConnection(row) : void 0;
|
|
699
|
+
},
|
|
700
|
+
getEmailConnectionsForAccount: (accountId) => emailConnections.findMany({ where: { account_id: accountId } }).map((row) => rowToEmailConnection(row)),
|
|
701
|
+
saveEmailConnection: (connection) => {
|
|
702
|
+
const existing = emailConnections.findOne({ where: { id: connection.id } });
|
|
703
|
+
const row = emailConnectionToRow(connection);
|
|
704
|
+
if (existing) {
|
|
705
|
+
emailConnections.update(row, { where: { id: connection.id } });
|
|
706
|
+
} else {
|
|
707
|
+
emailConnections.insert(row);
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
deleteEmailConnection: (id) => emailConnections.deleteRows({ where: { id } }),
|
|
711
|
+
getOAuthCredentials: (provider) => {
|
|
712
|
+
const row = oauthCredentials.findOne({ where: { key: provider } });
|
|
713
|
+
if (!row) return void 0;
|
|
714
|
+
const r = row;
|
|
715
|
+
return { clientId: r["client_id"], clientSecret: r["client_secret"] };
|
|
716
|
+
},
|
|
717
|
+
saveOAuthCredentials: (provider, creds) => {
|
|
718
|
+
const existing = oauthCredentials.findOne({ where: { key: provider } });
|
|
719
|
+
const row = { key: provider, client_id: creds.clientId, client_secret: creds.clientSecret };
|
|
720
|
+
if (existing) {
|
|
721
|
+
oauthCredentials.update(row, { where: { key: provider } });
|
|
722
|
+
} else {
|
|
723
|
+
oauthCredentials.insert(row);
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
getTelegramBots: () => telegramBots.all().map((row) => rowToTelegramBot(row)),
|
|
727
|
+
getTelegramBot: (id) => {
|
|
728
|
+
const row = telegramBots.findOne({ where: { id } });
|
|
729
|
+
return row ? rowToTelegramBot(row) : void 0;
|
|
730
|
+
},
|
|
731
|
+
saveTelegramBot: (bot) => {
|
|
732
|
+
const existing = telegramBots.findOne({ where: { id: bot.id } });
|
|
733
|
+
const row = telegramBotToRow(bot);
|
|
734
|
+
if (existing) {
|
|
735
|
+
telegramBots.update(row, { where: { id: bot.id } });
|
|
736
|
+
} else {
|
|
737
|
+
telegramBots.insert(row);
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
deleteTelegramBot: (id) => {
|
|
741
|
+
telegramConnections.deleteRows({ where: { bot_id: id } });
|
|
742
|
+
telegramBots.deleteRows({ where: { id } });
|
|
743
|
+
},
|
|
744
|
+
getTelegramConnections: () => telegramConnections.all().map((row) => rowToTelegramConnection(row)),
|
|
745
|
+
getTelegramConnectionsForBot: (botId) => telegramConnections.findMany({ where: { bot_id: botId } }).map((row) => rowToTelegramConnection(row)),
|
|
746
|
+
saveTelegramConnection: (connection) => {
|
|
747
|
+
const existing = telegramConnections.findOne({ where: { id: connection.id } });
|
|
748
|
+
const row = telegramConnectionToRow(connection);
|
|
749
|
+
if (existing) {
|
|
750
|
+
telegramConnections.update(row, { where: { id: connection.id } });
|
|
751
|
+
} else {
|
|
752
|
+
telegramConnections.insert(row);
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
deleteTelegramConnection: (id) => telegramConnections.deleteRows({ where: { id } }),
|
|
756
|
+
getHttpEndpoints: () => httpEndpoints.all().map((row) => rowToHttpEndpoint(row)),
|
|
757
|
+
getHttpEndpoint: (id) => {
|
|
758
|
+
const row = httpEndpoints.findOne({ where: { id } });
|
|
759
|
+
return row ? rowToHttpEndpoint(row) : void 0;
|
|
760
|
+
},
|
|
761
|
+
getHttpEndpointByPath: (path) => {
|
|
762
|
+
const row = httpEndpoints.findOne({ where: { path } });
|
|
763
|
+
return row ? rowToHttpEndpoint(row) : void 0;
|
|
764
|
+
},
|
|
765
|
+
saveHttpEndpoint: (endpoint) => {
|
|
766
|
+
const existing = httpEndpoints.findOne({ where: { id: endpoint.id } });
|
|
767
|
+
const row = httpEndpointToRow(endpoint);
|
|
768
|
+
if (existing) {
|
|
769
|
+
httpEndpoints.update(row, { where: { id: endpoint.id } });
|
|
770
|
+
} else {
|
|
771
|
+
httpEndpoints.insert(row);
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
deleteHttpEndpoint: (id) => {
|
|
775
|
+
httpConnectionsTable.deleteRows({ where: { endpoint_id: id } });
|
|
776
|
+
httpEndpoints.deleteRows({ where: { id } });
|
|
777
|
+
},
|
|
778
|
+
getHttpConnections: () => httpConnectionsTable.all().map((row) => rowToHttpConnection(row)),
|
|
779
|
+
getHttpConnectionsForEndpoint: (endpointId) => httpConnectionsTable.findMany({ where: { endpoint_id: endpointId } }).map((row) => rowToHttpConnection(row)),
|
|
780
|
+
saveHttpConnection: (connection) => {
|
|
781
|
+
const existing = httpConnectionsTable.findOne({ where: { id: connection.id } });
|
|
782
|
+
const row = httpConnectionToRow(connection);
|
|
783
|
+
if (existing) {
|
|
784
|
+
httpConnectionsTable.update(row, { where: { id: connection.id } });
|
|
785
|
+
} else {
|
|
786
|
+
httpConnectionsTable.insert(row);
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
deleteHttpConnection: (id) => httpConnectionsTable.deleteRows({ where: { id } }),
|
|
790
|
+
getCronJobs: () => cronJobsTable.all().map((row) => rowToCronJob(row)),
|
|
791
|
+
getCronJob: (id) => {
|
|
792
|
+
const row = cronJobsTable.findOne({ where: { id } });
|
|
793
|
+
return row ? rowToCronJob(row) : void 0;
|
|
794
|
+
},
|
|
795
|
+
saveCronJob: (job) => {
|
|
796
|
+
const existing = cronJobsTable.findOne({ where: { id: job.id } });
|
|
797
|
+
const row = cronJobToRow(job);
|
|
798
|
+
if (existing) {
|
|
799
|
+
cronJobsTable.update(row, { where: { id: job.id } });
|
|
800
|
+
} else {
|
|
801
|
+
cronJobsTable.insert(row);
|
|
802
|
+
}
|
|
803
|
+
},
|
|
804
|
+
deleteCronJob: (id) => {
|
|
805
|
+
cronConnectionsTable.deleteRows({ where: { cron_job_id: id } });
|
|
806
|
+
cronJobsTable.deleteRows({ where: { id } });
|
|
807
|
+
},
|
|
808
|
+
getCronConnections: () => cronConnectionsTable.all().map((row) => rowToCronConnection(row)),
|
|
809
|
+
getCronConnectionsForJob: (cronJobId) => cronConnectionsTable.findMany({ where: { cron_job_id: cronJobId } }).map((row) => rowToCronConnection(row)),
|
|
810
|
+
saveCronConnection: (connection) => {
|
|
811
|
+
const existing = cronConnectionsTable.findOne({ where: { id: connection.id } });
|
|
812
|
+
const row = cronConnectionToRow(connection);
|
|
813
|
+
if (existing) {
|
|
814
|
+
cronConnectionsTable.update(row, { where: { id: connection.id } });
|
|
815
|
+
} else {
|
|
816
|
+
cronConnectionsTable.insert(row);
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
deleteCronConnection: (id) => cronConnectionsTable.deleteRows({ where: { id } }),
|
|
820
|
+
close: () => store.close()
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
// ../daemon/src/process-manager.ts
|
|
825
|
+
import { fork } from "child_process";
|
|
826
|
+
import { resolve, delimiter } from "path";
|
|
827
|
+
var MAX_RESTARTS = 10;
|
|
828
|
+
var BASE_RESTART_DELAY = 1e3;
|
|
829
|
+
var MAX_RESTART_DELAY = 6e4;
|
|
830
|
+
var HEALTH_CHECK_INTERVAL = 3e4;
|
|
831
|
+
var resolveEntryScript = (runnersDir, isDev, type, helperKind) => {
|
|
832
|
+
const runnerMap = {
|
|
833
|
+
agent: { dev: "agent-runner/src/entry.ts", cli: "agent-runner.mjs" },
|
|
834
|
+
cron: { dev: "cron-runner/src/entry.ts", cli: "cron-runner.mjs" },
|
|
835
|
+
"email-imap": { dev: "imap-runner/src/entry.ts", cli: "imap-runner.mjs" },
|
|
836
|
+
telegram: { dev: "telegram-runner/src/entry.ts", cli: "telegram-runner.mjs" }
|
|
837
|
+
};
|
|
838
|
+
const key = type === "agent" ? "agent" : helperKind;
|
|
839
|
+
const entry = key ? runnerMap[key] : void 0;
|
|
840
|
+
if (!entry) throw new Error(`Unknown helper kind: ${helperKind}`);
|
|
841
|
+
return resolve(runnersDir, isDev ? entry.dev : entry.cli);
|
|
842
|
+
};
|
|
843
|
+
var createProcessManager = (options) => {
|
|
844
|
+
const { hubId, runnersDir, isDev, callbacks } = options;
|
|
845
|
+
const processes = /* @__PURE__ */ new Map();
|
|
846
|
+
const setStatus = (id, status, pid) => {
|
|
847
|
+
const record = processes.get(id);
|
|
848
|
+
if (!record) return;
|
|
849
|
+
record.info.status = status;
|
|
850
|
+
if (pid !== void 0) record.info.pid = pid;
|
|
851
|
+
callbacks?.onStatusChange?.(id, status, pid);
|
|
852
|
+
};
|
|
853
|
+
const restartDelay = (restartCount) => Math.min(BASE_RESTART_DELAY * 2 ** restartCount, MAX_RESTART_DELAY);
|
|
854
|
+
const startHealthCheck = (id) => {
|
|
855
|
+
const record = processes.get(id);
|
|
856
|
+
if (!record?.child) return;
|
|
857
|
+
record.healthInterval = setInterval(() => {
|
|
858
|
+
if (record.awaitingPong) {
|
|
859
|
+
console.log(`[process-manager] ${id} failed health check, restarting...`);
|
|
860
|
+
record.child?.kill("SIGTERM");
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
record.awaitingPong = true;
|
|
864
|
+
record.child?.send({ type: "ping" });
|
|
865
|
+
}, HEALTH_CHECK_INTERVAL);
|
|
866
|
+
};
|
|
867
|
+
const stopHealthCheck = (id) => {
|
|
868
|
+
const record = processes.get(id);
|
|
869
|
+
if (record?.healthInterval) {
|
|
870
|
+
clearInterval(record.healthInterval);
|
|
871
|
+
record.healthInterval = void 0;
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
const forkProcess = (id, record) => {
|
|
875
|
+
const helperKind = record.info.type === "helper" ? record.info.helperKind : void 0;
|
|
876
|
+
const entryScript = resolveEntryScript(runnersDir, isDev, record.info.type, helperKind);
|
|
877
|
+
setStatus(id, "starting");
|
|
878
|
+
const execArgv = isDev ? ["--import", "tsx"] : [];
|
|
879
|
+
const globalNodeModules = isDev ? "" : resolve(runnersDir, "..");
|
|
880
|
+
const nodePath = [process.env["NODE_PATH"], globalNodeModules].filter(Boolean).join(delimiter);
|
|
881
|
+
const child = fork(entryScript, [], {
|
|
882
|
+
execArgv,
|
|
883
|
+
env: {
|
|
884
|
+
...process.env,
|
|
885
|
+
KINDFLOW_PROCESS_ID: id,
|
|
886
|
+
KINDFLOW_HUB_ID: hubId,
|
|
887
|
+
NODE_PATH: nodePath
|
|
888
|
+
},
|
|
889
|
+
stdio: ["pipe", "pipe", "pipe", "ipc"]
|
|
890
|
+
});
|
|
891
|
+
record.child = child;
|
|
892
|
+
record.info.pid = child.pid;
|
|
893
|
+
record.info.lastStartedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
894
|
+
child.stdout?.on("data", (data) => {
|
|
895
|
+
callbacks?.onLog?.(id, "stdout", data.toString());
|
|
896
|
+
});
|
|
897
|
+
child.stderr?.on("data", (data) => {
|
|
898
|
+
callbacks?.onLog?.(id, "stderr", data.toString());
|
|
899
|
+
});
|
|
900
|
+
child.on("message", (msg) => {
|
|
901
|
+
switch (msg.type) {
|
|
902
|
+
case "ready":
|
|
903
|
+
setStatus(id, "running", child.pid);
|
|
904
|
+
startHealthCheck(id);
|
|
905
|
+
console.log(`[process-manager] ${id} is ready (PID ${child.pid})`);
|
|
906
|
+
break;
|
|
907
|
+
case "pong":
|
|
908
|
+
record.awaitingPong = false;
|
|
909
|
+
break;
|
|
910
|
+
case "agent:sdk-message":
|
|
911
|
+
callbacks?.onSdkMessage?.(id, msg.message);
|
|
912
|
+
break;
|
|
913
|
+
case "log":
|
|
914
|
+
callbacks?.onLog?.(id, "stdout", `[${msg.level}] ${msg.message}`);
|
|
915
|
+
break;
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
child.on("exit", (code) => {
|
|
919
|
+
stopHealthCheck(id);
|
|
920
|
+
record.child = void 0;
|
|
921
|
+
record.info.pid = void 0;
|
|
922
|
+
record.info.lastStoppedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
923
|
+
if (record.info.status === "stopping" || record.info.status === "stopped") {
|
|
924
|
+
setStatus(id, "stopped");
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
record.info.restartCount++;
|
|
928
|
+
if (record.info.restartCount > MAX_RESTARTS) {
|
|
929
|
+
console.log(`[process-manager] ${id} crashed too many times (${MAX_RESTARTS}), giving up`);
|
|
930
|
+
setStatus(id, "crashed");
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
const delay = restartDelay(record.info.restartCount);
|
|
934
|
+
console.log(`[process-manager] ${id} exited (code ${code}), restarting in ${delay}ms (attempt ${record.info.restartCount}/${MAX_RESTARTS})`);
|
|
935
|
+
setTimeout(() => forkProcess(id, record), delay);
|
|
936
|
+
});
|
|
937
|
+
child.send({ type: "config", config: record.config });
|
|
938
|
+
};
|
|
939
|
+
return {
|
|
940
|
+
start(id, type, config) {
|
|
941
|
+
if (processes.has(id)) {
|
|
942
|
+
console.log(`[process-manager] ${id} already exists, stopping first`);
|
|
943
|
+
this.stop(id);
|
|
944
|
+
}
|
|
945
|
+
const record = {
|
|
946
|
+
info: {
|
|
947
|
+
id,
|
|
948
|
+
type,
|
|
949
|
+
helperKind: type === "helper" ? config.kind : void 0,
|
|
950
|
+
status: "stopped",
|
|
951
|
+
restartCount: 0
|
|
952
|
+
},
|
|
953
|
+
config,
|
|
954
|
+
awaitingPong: false
|
|
955
|
+
};
|
|
956
|
+
processes.set(id, record);
|
|
957
|
+
forkProcess(id, record);
|
|
958
|
+
},
|
|
959
|
+
async stop(id) {
|
|
960
|
+
const record = processes.get(id);
|
|
961
|
+
if (!record?.child) return;
|
|
962
|
+
setStatus(id, "stopping");
|
|
963
|
+
stopHealthCheck(id);
|
|
964
|
+
record.child.send({ type: "stop" });
|
|
965
|
+
await new Promise((resolve7) => {
|
|
966
|
+
const timeout = setTimeout(() => {
|
|
967
|
+
record.child?.kill("SIGKILL");
|
|
968
|
+
resolve7();
|
|
969
|
+
}, 5e3);
|
|
970
|
+
record.child?.on("exit", () => {
|
|
971
|
+
clearTimeout(timeout);
|
|
972
|
+
resolve7();
|
|
973
|
+
});
|
|
974
|
+
});
|
|
975
|
+
setStatus(id, "stopped");
|
|
976
|
+
},
|
|
977
|
+
async restart(id) {
|
|
978
|
+
const record = processes.get(id);
|
|
979
|
+
if (!record) return;
|
|
980
|
+
await this.stop(id);
|
|
981
|
+
record.info.restartCount = 0;
|
|
982
|
+
forkProcess(id, record);
|
|
983
|
+
},
|
|
984
|
+
getAll: () => [...processes.values()].map((r) => ({ ...r.info })),
|
|
985
|
+
get: (id) => {
|
|
986
|
+
const record = processes.get(id);
|
|
987
|
+
return record ? { ...record.info } : void 0;
|
|
988
|
+
},
|
|
989
|
+
sendToChild(id, msg) {
|
|
990
|
+
const record = processes.get(id);
|
|
991
|
+
record?.child?.send(msg);
|
|
992
|
+
},
|
|
993
|
+
async shutdownAll() {
|
|
994
|
+
console.log(`[process-manager] Shutting down ${processes.size} process(es)...`);
|
|
995
|
+
const stopPromises = [...processes.keys()].map((id) => this.stop(id));
|
|
996
|
+
await Promise.all(stopPromises);
|
|
997
|
+
console.log("[process-manager] All processes stopped");
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
// ../daemon/src/terminal-manager.ts
|
|
1003
|
+
import { execSync } from "child_process";
|
|
1004
|
+
import * as pty from "node-pty";
|
|
1005
|
+
import { listSessions } from "@anthropic-ai/claude-agent-sdk";
|
|
1006
|
+
var resolveClaudePath = () => {
|
|
1007
|
+
try {
|
|
1008
|
+
return execSync("which claude", { encoding: "utf-8" }).trim();
|
|
1009
|
+
} catch {
|
|
1010
|
+
return "claude";
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
var createTerminalManager = (options) => {
|
|
1014
|
+
const sessions = /* @__PURE__ */ new Map();
|
|
1015
|
+
const idleTimeout = options.idleTimeoutMs ?? 10 * 60 * 1e3;
|
|
1016
|
+
const resetIdleTimer = (sessionId) => {
|
|
1017
|
+
const session = sessions.get(sessionId);
|
|
1018
|
+
if (!session) return;
|
|
1019
|
+
if (session.idleTimer) clearTimeout(session.idleTimer);
|
|
1020
|
+
session.idleTimer = setTimeout(() => {
|
|
1021
|
+
console.log(`[terminal] Session ${sessionId} idle timeout, closing`);
|
|
1022
|
+
manager.close(sessionId);
|
|
1023
|
+
}, idleTimeout);
|
|
1024
|
+
};
|
|
1025
|
+
const manager = {
|
|
1026
|
+
async open(sessionId, agentId, agentCwd) {
|
|
1027
|
+
const existing = this.getByAgent(agentId);
|
|
1028
|
+
if (existing) this.close(existing.id);
|
|
1029
|
+
const previousSessions = await listSessions({ dir: agentCwd });
|
|
1030
|
+
const hasPreviousSession = previousSessions.length > 0;
|
|
1031
|
+
const claudePath = resolveClaudePath();
|
|
1032
|
+
const shell = process.env["SHELL"] ?? "/bin/bash";
|
|
1033
|
+
const continueFlag = hasPreviousSession ? " '--continue'" : "";
|
|
1034
|
+
const fullCommand = `'${claudePath}' '--permission-mode' 'acceptEdits'${continueFlag}`;
|
|
1035
|
+
console.log(`[terminal] ${hasPreviousSession ? "Resuming" : "Starting new"} session for ${agentId} (cwd: ${agentCwd})`);
|
|
1036
|
+
const ptyProcess = pty.spawn(shell, ["-l", "-c", fullCommand], {
|
|
1037
|
+
name: "xterm-256color",
|
|
1038
|
+
cols: 120,
|
|
1039
|
+
rows: 30,
|
|
1040
|
+
cwd: agentCwd,
|
|
1041
|
+
env: { ...process.env }
|
|
1042
|
+
});
|
|
1043
|
+
const session = {
|
|
1044
|
+
info: {
|
|
1045
|
+
id: sessionId,
|
|
1046
|
+
agentId,
|
|
1047
|
+
status: "running",
|
|
1048
|
+
lastActivity: /* @__PURE__ */ new Date()
|
|
1049
|
+
},
|
|
1050
|
+
ptyProcess,
|
|
1051
|
+
outputBuffer: [],
|
|
1052
|
+
flushed: false
|
|
1053
|
+
};
|
|
1054
|
+
sessions.set(sessionId, session);
|
|
1055
|
+
let helloSent = hasPreviousSession;
|
|
1056
|
+
ptyProcess.onData((data) => {
|
|
1057
|
+
session.info.lastActivity = /* @__PURE__ */ new Date();
|
|
1058
|
+
if (!helloSent && data.includes("accept edits")) {
|
|
1059
|
+
helloSent = true;
|
|
1060
|
+
setTimeout(() => {
|
|
1061
|
+
if (session.info.status === "running") {
|
|
1062
|
+
ptyProcess.write("hello\r");
|
|
1063
|
+
}
|
|
1064
|
+
}, 500);
|
|
1065
|
+
}
|
|
1066
|
+
if (session.flushed) {
|
|
1067
|
+
options.callbacks?.onOutput?.(sessionId, data);
|
|
1068
|
+
} else {
|
|
1069
|
+
session.outputBuffer.push(data);
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
ptyProcess.onExit(({ exitCode }) => {
|
|
1073
|
+
console.log(`[terminal] PTY exited for session ${sessionId} (code ${exitCode})`);
|
|
1074
|
+
manager.close(sessionId);
|
|
1075
|
+
});
|
|
1076
|
+
resetIdleTimer(sessionId);
|
|
1077
|
+
console.log(`[terminal] Opened PTY session ${sessionId} for agent ${agentId} (cwd: ${agentCwd})`);
|
|
1078
|
+
return session.info;
|
|
1079
|
+
},
|
|
1080
|
+
flush(sessionId) {
|
|
1081
|
+
const session = sessions.get(sessionId);
|
|
1082
|
+
if (!session || session.flushed) return;
|
|
1083
|
+
session.flushed = true;
|
|
1084
|
+
console.log(`[terminal] Flushing ${session.outputBuffer.length} buffered chunks for session ${sessionId}`);
|
|
1085
|
+
for (const buffered of session.outputBuffer) {
|
|
1086
|
+
options.callbacks?.onOutput?.(sessionId, buffered);
|
|
1087
|
+
}
|
|
1088
|
+
session.outputBuffer = [];
|
|
1089
|
+
},
|
|
1090
|
+
write(sessionId, data) {
|
|
1091
|
+
const session = sessions.get(sessionId);
|
|
1092
|
+
if (!session || session.info.status !== "running") return;
|
|
1093
|
+
if (!session.flushed) this.flush(sessionId);
|
|
1094
|
+
session.info.lastActivity = /* @__PURE__ */ new Date();
|
|
1095
|
+
resetIdleTimer(sessionId);
|
|
1096
|
+
session.ptyProcess.write(data);
|
|
1097
|
+
},
|
|
1098
|
+
resize(sessionId, cols, rows) {
|
|
1099
|
+
const session = sessions.get(sessionId);
|
|
1100
|
+
if (!session || session.info.status !== "running") return;
|
|
1101
|
+
session.ptyProcess.resize(cols, rows);
|
|
1102
|
+
},
|
|
1103
|
+
close(sessionId) {
|
|
1104
|
+
const session = sessions.get(sessionId);
|
|
1105
|
+
if (!session) return;
|
|
1106
|
+
session.info.status = "closed";
|
|
1107
|
+
if (session.idleTimer) clearTimeout(session.idleTimer);
|
|
1108
|
+
try {
|
|
1109
|
+
session.ptyProcess.kill();
|
|
1110
|
+
} catch {
|
|
1111
|
+
}
|
|
1112
|
+
sessions.delete(sessionId);
|
|
1113
|
+
options.callbacks?.onClose?.(sessionId);
|
|
1114
|
+
console.log(`[terminal] Closed session ${sessionId}`);
|
|
1115
|
+
},
|
|
1116
|
+
get(sessionId) {
|
|
1117
|
+
return sessions.get(sessionId)?.info;
|
|
1118
|
+
},
|
|
1119
|
+
getByAgent(agentId) {
|
|
1120
|
+
for (const session of sessions.values()) {
|
|
1121
|
+
if (session.info.agentId === agentId) return session.info;
|
|
1122
|
+
}
|
|
1123
|
+
return void 0;
|
|
1124
|
+
},
|
|
1125
|
+
closeAll() {
|
|
1126
|
+
for (const sessionId of [...sessions.keys()]) {
|
|
1127
|
+
this.close(sessionId);
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
};
|
|
1131
|
+
return manager;
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
// ../daemon/src/web-server.ts
|
|
1135
|
+
import { fork as fork2 } from "child_process";
|
|
1136
|
+
import { resolve as resolve2 } from "path";
|
|
1137
|
+
import { existsSync } from "fs";
|
|
1138
|
+
var createWebServer = (options) => {
|
|
1139
|
+
let child = null;
|
|
1140
|
+
const candidates = [
|
|
1141
|
+
resolve2(options.webAppDir, "standalone", "server.js"),
|
|
1142
|
+
resolve2(options.webAppDir, ".next", "standalone", "server.js"),
|
|
1143
|
+
resolve2(options.webAppDir, ".next", "standalone", "apps", "web", "server.js")
|
|
1144
|
+
];
|
|
1145
|
+
const standaloneServer = candidates.find((p) => existsSync(p));
|
|
1146
|
+
return {
|
|
1147
|
+
start() {
|
|
1148
|
+
return new Promise((resolvePromise, reject) => {
|
|
1149
|
+
if (!standaloneServer) {
|
|
1150
|
+
reject(new Error(
|
|
1151
|
+
`No standalone server.js found. Run "npm run build --workspace=apps/web" first.
|
|
1152
|
+
Looked in:
|
|
1153
|
+
${candidates.join("\n ")}`
|
|
1154
|
+
));
|
|
1155
|
+
return;
|
|
1156
|
+
}
|
|
1157
|
+
child = fork2(standaloneServer, [], {
|
|
1158
|
+
env: {
|
|
1159
|
+
...process.env,
|
|
1160
|
+
PORT: String(options.port),
|
|
1161
|
+
HOSTNAME: "0.0.0.0"
|
|
1162
|
+
},
|
|
1163
|
+
stdio: ["ignore", "pipe", "pipe", "ipc"]
|
|
1164
|
+
});
|
|
1165
|
+
let started = false;
|
|
1166
|
+
child.stdout?.on("data", (data) => {
|
|
1167
|
+
const line = data.toString();
|
|
1168
|
+
process.stdout.write(`[web] ${line}`);
|
|
1169
|
+
if (!started && (line.includes("Ready") || line.includes("Listening"))) {
|
|
1170
|
+
started = true;
|
|
1171
|
+
resolvePromise();
|
|
1172
|
+
}
|
|
1173
|
+
});
|
|
1174
|
+
child.stderr?.on("data", (data) => {
|
|
1175
|
+
process.stderr.write(`[web] ${data.toString()}`);
|
|
1176
|
+
});
|
|
1177
|
+
child.on("error", (err) => {
|
|
1178
|
+
console.error(`[web] Failed to start: ${err.message}`);
|
|
1179
|
+
if (!started) reject(err);
|
|
1180
|
+
});
|
|
1181
|
+
child.on("exit", (code) => {
|
|
1182
|
+
console.log(`[web] Process exited (code ${code})`);
|
|
1183
|
+
child = null;
|
|
1184
|
+
if (!started) reject(new Error(`Web server exited with code ${code}`));
|
|
1185
|
+
});
|
|
1186
|
+
setTimeout(() => {
|
|
1187
|
+
if (!started) {
|
|
1188
|
+
started = true;
|
|
1189
|
+
console.log("[web] Startup timeout \u2014 assuming ready");
|
|
1190
|
+
resolvePromise();
|
|
1191
|
+
}
|
|
1192
|
+
}, 3e4);
|
|
1193
|
+
});
|
|
1194
|
+
},
|
|
1195
|
+
stop() {
|
|
1196
|
+
if (child) {
|
|
1197
|
+
console.log("[web] Stopping web server...");
|
|
1198
|
+
child.kill("SIGTERM");
|
|
1199
|
+
setTimeout(() => {
|
|
1200
|
+
if (child) {
|
|
1201
|
+
child.kill("SIGKILL");
|
|
1202
|
+
child = null;
|
|
1203
|
+
}
|
|
1204
|
+
}, 5e3);
|
|
1205
|
+
}
|
|
1206
|
+
},
|
|
1207
|
+
isRunning() {
|
|
1208
|
+
return child !== null;
|
|
1209
|
+
}
|
|
1210
|
+
};
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
// ../daemon/src/api/server.ts
|
|
1214
|
+
import { createServer } from "http";
|
|
1215
|
+
import { WebSocketServer } from "ws";
|
|
1216
|
+
var parsePath = (path) => {
|
|
1217
|
+
const paramNames = [];
|
|
1218
|
+
const regexStr = path.replace(/:([^/]+)/g, (_, name) => {
|
|
1219
|
+
paramNames.push(name);
|
|
1220
|
+
return "([^/]+)";
|
|
1221
|
+
});
|
|
1222
|
+
return { pattern: new RegExp(`^${regexStr}$`), paramNames };
|
|
1223
|
+
};
|
|
1224
|
+
var readBody = (req) => new Promise((resolve7) => {
|
|
1225
|
+
const chunks = [];
|
|
1226
|
+
req.on("data", (chunk) => chunks.push(chunk));
|
|
1227
|
+
req.on("end", () => {
|
|
1228
|
+
const raw = Buffer.concat(chunks).toString();
|
|
1229
|
+
if (!raw) return resolve7(null);
|
|
1230
|
+
try {
|
|
1231
|
+
resolve7(JSON.parse(raw));
|
|
1232
|
+
} catch {
|
|
1233
|
+
resolve7(null);
|
|
1234
|
+
}
|
|
1235
|
+
});
|
|
1236
|
+
});
|
|
1237
|
+
var sendJson = (res, statusCode, body) => {
|
|
1238
|
+
const json = JSON.stringify(body);
|
|
1239
|
+
res.writeHead(statusCode, {
|
|
1240
|
+
"Content-Type": "application/json",
|
|
1241
|
+
"Access-Control-Allow-Origin": "*",
|
|
1242
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
|
|
1243
|
+
"Access-Control-Allow-Headers": "Content-Type, Authorization"
|
|
1244
|
+
});
|
|
1245
|
+
res.end(json);
|
|
1246
|
+
};
|
|
1247
|
+
var createApiServer = () => {
|
|
1248
|
+
const routes = [];
|
|
1249
|
+
const wsClients = /* @__PURE__ */ new Set();
|
|
1250
|
+
let wsCommandHandler = null;
|
|
1251
|
+
const httpServer = createServer(async (req, res) => {
|
|
1252
|
+
if (req.method === "OPTIONS") {
|
|
1253
|
+
res.writeHead(204, {
|
|
1254
|
+
"Access-Control-Allow-Origin": "*",
|
|
1255
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
|
|
1256
|
+
"Access-Control-Allow-Headers": "Content-Type, Authorization"
|
|
1257
|
+
});
|
|
1258
|
+
res.end();
|
|
1259
|
+
return;
|
|
1260
|
+
}
|
|
1261
|
+
const url = req.url ?? "/";
|
|
1262
|
+
const [path] = url.split("?");
|
|
1263
|
+
const method = req.method ?? "GET";
|
|
1264
|
+
for (const route of routes) {
|
|
1265
|
+
if (route.method !== method) continue;
|
|
1266
|
+
const match = path?.match(route.pattern);
|
|
1267
|
+
if (!match) continue;
|
|
1268
|
+
const params = {};
|
|
1269
|
+
route.paramNames.forEach((name, i) => {
|
|
1270
|
+
params[name] = match[i + 1] ?? "";
|
|
1271
|
+
});
|
|
1272
|
+
const body = await readBody(req);
|
|
1273
|
+
try {
|
|
1274
|
+
await route.handler(req, res, params, body);
|
|
1275
|
+
} catch (err) {
|
|
1276
|
+
console.error(`[api] Error handling ${method} ${path}:`, err);
|
|
1277
|
+
sendJson(res, 500, { error: "INTERNAL_ERROR", message: "Internal server error", statusCode: 500 });
|
|
1278
|
+
}
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: `No route for ${method} ${path}`, statusCode: 404 });
|
|
1282
|
+
});
|
|
1283
|
+
const wss = new WebSocketServer({ server: httpServer });
|
|
1284
|
+
wss.on("connection", (ws) => {
|
|
1285
|
+
wsClients.add(ws);
|
|
1286
|
+
ws.on("message", (data) => {
|
|
1287
|
+
try {
|
|
1288
|
+
const command = JSON.parse(data.toString());
|
|
1289
|
+
wsCommandHandler?.(ws, command);
|
|
1290
|
+
} catch {
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
ws.on("close", () => {
|
|
1294
|
+
wsClients.delete(ws);
|
|
1295
|
+
});
|
|
1296
|
+
});
|
|
1297
|
+
return {
|
|
1298
|
+
listen(port) {
|
|
1299
|
+
return new Promise((resolve7) => {
|
|
1300
|
+
httpServer.listen(port, () => {
|
|
1301
|
+
console.log(`[api] HTTP + WebSocket server listening on port ${port}`);
|
|
1302
|
+
resolve7();
|
|
1303
|
+
});
|
|
1304
|
+
});
|
|
1305
|
+
},
|
|
1306
|
+
route(method, path, handler) {
|
|
1307
|
+
const { pattern, paramNames } = parsePath(path);
|
|
1308
|
+
routes.push({ method, pattern, paramNames, handler });
|
|
1309
|
+
},
|
|
1310
|
+
onWsCommand(handler) {
|
|
1311
|
+
wsCommandHandler = handler;
|
|
1312
|
+
},
|
|
1313
|
+
broadcast(event) {
|
|
1314
|
+
const data = JSON.stringify(event);
|
|
1315
|
+
for (const ws of wsClients) {
|
|
1316
|
+
if (ws.readyState === ws.OPEN) {
|
|
1317
|
+
ws.send(data);
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
close() {
|
|
1322
|
+
return new Promise((resolve7) => {
|
|
1323
|
+
wss.close();
|
|
1324
|
+
httpServer.close(() => resolve7());
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1327
|
+
};
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
// ../daemon/src/api/routes/agents.ts
|
|
1331
|
+
import { randomUUID } from "crypto";
|
|
1332
|
+
import { resolve as resolve4 } from "path";
|
|
1333
|
+
|
|
1334
|
+
// ../daemon/src/agent-scanner.ts
|
|
1335
|
+
import { resolve as resolve3, join as join2 } from "path";
|
|
1336
|
+
import { readdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2, cpSync, rmSync } from "fs";
|
|
1337
|
+
var generateSlug = (name) => name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
1338
|
+
var scanAgents = (agentsDir) => {
|
|
1339
|
+
if (!existsSync2(agentsDir)) return [];
|
|
1340
|
+
const agents = [];
|
|
1341
|
+
for (const name of readdirSync(agentsDir, { withFileTypes: true })) {
|
|
1342
|
+
if (!name.isDirectory()) continue;
|
|
1343
|
+
const configPath = join2(agentsDir, name.name, "agent", "config.json");
|
|
1344
|
+
if (!existsSync2(configPath)) continue;
|
|
1345
|
+
try {
|
|
1346
|
+
const raw = readFileSync2(configPath, "utf-8");
|
|
1347
|
+
const config = JSON.parse(raw);
|
|
1348
|
+
const dir = join2(agentsDir, name.name);
|
|
1349
|
+
agents.push({
|
|
1350
|
+
id: name.name,
|
|
1351
|
+
dir,
|
|
1352
|
+
config,
|
|
1353
|
+
sdkOptions: {
|
|
1354
|
+
cwd: join2(dir, "agent"),
|
|
1355
|
+
model: config.model ?? void 0,
|
|
1356
|
+
permissionMode: config.permissionMode ?? "bypassPermissions",
|
|
1357
|
+
allowDangerouslySkipPermissions: config.permissionMode === "bypassPermissions"
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1360
|
+
} catch {
|
|
1361
|
+
console.warn(`[scanner] Failed to read config for ${name.name}, skipping`);
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
return agents;
|
|
1365
|
+
};
|
|
1366
|
+
var readAgent = (agentsDir, id) => {
|
|
1367
|
+
const dir = resolve3(agentsDir, id);
|
|
1368
|
+
const configPath = join2(dir, "agent", "config.json");
|
|
1369
|
+
if (!existsSync2(configPath)) return void 0;
|
|
1370
|
+
try {
|
|
1371
|
+
const raw = readFileSync2(configPath, "utf-8");
|
|
1372
|
+
const config = JSON.parse(raw);
|
|
1373
|
+
return {
|
|
1374
|
+
id,
|
|
1375
|
+
dir,
|
|
1376
|
+
config,
|
|
1377
|
+
sdkOptions: {
|
|
1378
|
+
cwd: join2(dir, "agent"),
|
|
1379
|
+
model: config.model ?? void 0,
|
|
1380
|
+
permissionMode: config.permissionMode ?? "bypassPermissions",
|
|
1381
|
+
allowDangerouslySkipPermissions: config.permissionMode === "bypassPermissions"
|
|
1382
|
+
}
|
|
1383
|
+
};
|
|
1384
|
+
} catch {
|
|
1385
|
+
return void 0;
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
var writeAgentConfig = (agentsDir, id, config) => {
|
|
1389
|
+
const configPath = resolve3(agentsDir, id, "agent", "config.json");
|
|
1390
|
+
writeFileSync2(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
1391
|
+
};
|
|
1392
|
+
var createAgentFromTemplate = (agentsDir, templateDir, id, name, autoStart = true) => {
|
|
1393
|
+
const agentDir = resolve3(agentsDir, id);
|
|
1394
|
+
cpSync(templateDir, agentDir, { recursive: true });
|
|
1395
|
+
const config = {
|
|
1396
|
+
name,
|
|
1397
|
+
autoStart,
|
|
1398
|
+
model: null,
|
|
1399
|
+
permissionMode: "bypassPermissions",
|
|
1400
|
+
env: {}
|
|
1401
|
+
};
|
|
1402
|
+
writeAgentConfig(agentsDir, id, config);
|
|
1403
|
+
return {
|
|
1404
|
+
id,
|
|
1405
|
+
dir: agentDir,
|
|
1406
|
+
config,
|
|
1407
|
+
sdkOptions: {
|
|
1408
|
+
cwd: join2(agentDir, "agent"),
|
|
1409
|
+
permissionMode: "bypassPermissions",
|
|
1410
|
+
allowDangerouslySkipPermissions: true
|
|
1411
|
+
}
|
|
1412
|
+
};
|
|
1413
|
+
};
|
|
1414
|
+
var listAgentCommands = (agentsDir, id) => {
|
|
1415
|
+
const commandsDir = resolve3(agentsDir, id, "agent", ".claude", "commands");
|
|
1416
|
+
if (!existsSync2(commandsDir)) return [];
|
|
1417
|
+
return readdirSync(commandsDir).filter((f) => f.endsWith(".md")).map((f) => f.replace(/\.md$/, ""));
|
|
1418
|
+
};
|
|
1419
|
+
var deleteAgentDir = (agentsDir, id) => {
|
|
1420
|
+
const agentDir = resolve3(agentsDir, id);
|
|
1421
|
+
if (existsSync2(agentDir)) {
|
|
1422
|
+
rmSync(agentDir, { recursive: true, force: true });
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1426
|
+
// ../daemon/src/api/routes/agents.ts
|
|
1427
|
+
var cascadeDeleteAgentConnections = (configStore, agentId) => {
|
|
1428
|
+
for (const conn of configStore.getCronConnections()) {
|
|
1429
|
+
if (conn.targetAgent === agentId) configStore.deleteCronConnection(conn.id);
|
|
1430
|
+
}
|
|
1431
|
+
for (const conn of configStore.getHttpConnections()) {
|
|
1432
|
+
if (conn.targetAgent === agentId) configStore.deleteHttpConnection(conn.id);
|
|
1433
|
+
}
|
|
1434
|
+
for (const conn of configStore.getEmailConnections()) {
|
|
1435
|
+
if (conn.targetAgent === agentId) configStore.deleteEmailConnection(conn.id);
|
|
1436
|
+
}
|
|
1437
|
+
for (const conn of configStore.getTelegramConnections()) {
|
|
1438
|
+
if (conn.targetAgent === agentId) configStore.deleteTelegramConnection(conn.id);
|
|
1439
|
+
}
|
|
1440
|
+
for (const conn of configStore.getS3Connections()) {
|
|
1441
|
+
if (conn.targetAgent === agentId) configStore.deleteS3Connection(conn.id);
|
|
1442
|
+
}
|
|
1443
|
+
for (const conn of configStore.getDatabaseConnections()) {
|
|
1444
|
+
if (conn.targetAgent === agentId) configStore.deleteDatabaseConnection(conn.id);
|
|
1445
|
+
}
|
|
1446
|
+
};
|
|
1447
|
+
var registerAgentRoutes = (server, processManager, terminalManager, agentsDir, templateDir, configStore) => {
|
|
1448
|
+
server.route("GET", "/api/agents", async (_req, res) => {
|
|
1449
|
+
const agents = scanAgents(agentsDir);
|
|
1450
|
+
sendJson(res, 200, { agents });
|
|
1451
|
+
});
|
|
1452
|
+
server.route("GET", "/api/agents/:id", async (_req, res, params) => {
|
|
1453
|
+
const agent = readAgent(agentsDir, params["id"]);
|
|
1454
|
+
if (!agent) {
|
|
1455
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Agent not found", statusCode: 404 });
|
|
1456
|
+
return;
|
|
1457
|
+
}
|
|
1458
|
+
sendJson(res, 200, agent);
|
|
1459
|
+
});
|
|
1460
|
+
server.route("POST", "/api/agents", async (_req, res, _params, body) => {
|
|
1461
|
+
const input = body;
|
|
1462
|
+
if (!input?.name) {
|
|
1463
|
+
sendJson(res, 400, { error: "BAD_REQUEST", message: "name is required", statusCode: 400 });
|
|
1464
|
+
return;
|
|
1465
|
+
}
|
|
1466
|
+
const slug = generateSlug(input.name);
|
|
1467
|
+
const id = slug || randomUUID().slice(0, 8);
|
|
1468
|
+
const agent = createAgentFromTemplate(agentsDir, templateDir, id, input.name, input.autoStart ?? true);
|
|
1469
|
+
sendJson(res, 201, agent);
|
|
1470
|
+
});
|
|
1471
|
+
server.route("PUT", "/api/agents/:id", async (_req, res, params, body) => {
|
|
1472
|
+
const agent = readAgent(agentsDir, params["id"]);
|
|
1473
|
+
if (!agent) {
|
|
1474
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Agent not found", statusCode: 404 });
|
|
1475
|
+
return;
|
|
1476
|
+
}
|
|
1477
|
+
const updates = body;
|
|
1478
|
+
const updated = { ...agent.config, ...updates };
|
|
1479
|
+
writeAgentConfig(agentsDir, params["id"], updated);
|
|
1480
|
+
const refreshed = readAgent(agentsDir, params["id"]);
|
|
1481
|
+
sendJson(res, 200, refreshed);
|
|
1482
|
+
});
|
|
1483
|
+
server.route("DELETE", "/api/agents/:id", async (_req, res, params, body) => {
|
|
1484
|
+
const id = params["id"];
|
|
1485
|
+
const agent = readAgent(agentsDir, id);
|
|
1486
|
+
if (!agent) {
|
|
1487
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Agent not found", statusCode: 404 });
|
|
1488
|
+
return;
|
|
1489
|
+
}
|
|
1490
|
+
const { confirm } = body ?? {};
|
|
1491
|
+
if (!confirm) {
|
|
1492
|
+
sendJson(res, 200, {
|
|
1493
|
+
confirm: false,
|
|
1494
|
+
willDelete: {
|
|
1495
|
+
agent: agent.config.name,
|
|
1496
|
+
agentDir: agent.dir,
|
|
1497
|
+
process: processManager.get(id)?.status ?? null,
|
|
1498
|
+
terminalSession: terminalManager.getByAgent(id)?.id ?? null
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
return;
|
|
1502
|
+
}
|
|
1503
|
+
const session = terminalManager.getByAgent(id);
|
|
1504
|
+
if (session) terminalManager.close(session.id);
|
|
1505
|
+
const proc = processManager.get(id);
|
|
1506
|
+
if (proc && (proc.status === "running" || proc.status === "starting")) {
|
|
1507
|
+
await processManager.stop(id);
|
|
1508
|
+
}
|
|
1509
|
+
cascadeDeleteAgentConnections(configStore, id);
|
|
1510
|
+
deleteAgentDir(agentsDir, id);
|
|
1511
|
+
sendJson(res, 200, { deleted: true });
|
|
1512
|
+
});
|
|
1513
|
+
server.route("POST", "/api/agents/:id/message", async (_req, res, params, body) => {
|
|
1514
|
+
const id = params["id"];
|
|
1515
|
+
const proc = processManager.get(id);
|
|
1516
|
+
if (!proc || proc.status !== "running") {
|
|
1517
|
+
sendJson(res, 400, { error: "NOT_RUNNING", message: "Agent is not running", statusCode: 400 });
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
const { text } = body;
|
|
1521
|
+
if (!text) {
|
|
1522
|
+
sendJson(res, 400, { error: "BAD_REQUEST", message: "text is required", statusCode: 400 });
|
|
1523
|
+
return;
|
|
1524
|
+
}
|
|
1525
|
+
sendJson(res, 200, { sent: true });
|
|
1526
|
+
});
|
|
1527
|
+
server.route("GET", "/api/agents/:id/commands", async (_req, res, params) => {
|
|
1528
|
+
const id = params["id"];
|
|
1529
|
+
const agent = readAgent(agentsDir, id);
|
|
1530
|
+
if (!agent) {
|
|
1531
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Agent not found", statusCode: 404 });
|
|
1532
|
+
return;
|
|
1533
|
+
}
|
|
1534
|
+
const commands = listAgentCommands(agentsDir, id);
|
|
1535
|
+
sendJson(res, 200, { commands });
|
|
1536
|
+
});
|
|
1537
|
+
server.route("POST", "/api/agents/:id/terminal", async (_req, res, params) => {
|
|
1538
|
+
const id = params["id"];
|
|
1539
|
+
const agent = readAgent(agentsDir, id);
|
|
1540
|
+
if (!agent) {
|
|
1541
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Agent not found", statusCode: 404 });
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
const sessionId = randomUUID();
|
|
1545
|
+
const masterCwd = resolve4(agent.dir, "master");
|
|
1546
|
+
await terminalManager.open(sessionId, id, masterCwd);
|
|
1547
|
+
sendJson(res, 200, { sessionId });
|
|
1548
|
+
});
|
|
1549
|
+
server.route("DELETE", "/api/agents/:id/terminal", async (_req, res, params) => {
|
|
1550
|
+
const id = params["id"];
|
|
1551
|
+
const session = terminalManager.getByAgent(id);
|
|
1552
|
+
if (!session) {
|
|
1553
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "No terminal session for this agent", statusCode: 404 });
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
terminalManager.close(session.id);
|
|
1557
|
+
sendJson(res, 200, { closed: true });
|
|
1558
|
+
});
|
|
1559
|
+
};
|
|
1560
|
+
|
|
1561
|
+
// ../daemon/src/api/routes/processes.ts
|
|
1562
|
+
var registerProcessRoutes = (server, processManager, configStore, agentsDir) => {
|
|
1563
|
+
server.route("GET", "/api/processes", async (_req, res) => {
|
|
1564
|
+
sendJson(res, 200, { processes: processManager.getAll() });
|
|
1565
|
+
});
|
|
1566
|
+
server.route("GET", "/api/processes/:id", async (_req, res, params) => {
|
|
1567
|
+
const proc = processManager.get(params["id"]);
|
|
1568
|
+
if (!proc) {
|
|
1569
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Process not found", statusCode: 404 });
|
|
1570
|
+
return;
|
|
1571
|
+
}
|
|
1572
|
+
sendJson(res, 200, proc);
|
|
1573
|
+
});
|
|
1574
|
+
server.route("POST", "/api/processes/:id/start", async (_req, res, params) => {
|
|
1575
|
+
const id = params["id"];
|
|
1576
|
+
const agent = readAgent(agentsDir, id);
|
|
1577
|
+
if (agent) {
|
|
1578
|
+
processManager.start(id, "agent", agent);
|
|
1579
|
+
sendJson(res, 200, { started: true });
|
|
1580
|
+
return;
|
|
1581
|
+
}
|
|
1582
|
+
const helper = configStore.getHelper(id);
|
|
1583
|
+
if (helper) {
|
|
1584
|
+
processManager.start(id, "helper", helper);
|
|
1585
|
+
sendJson(res, 200, { started: true });
|
|
1586
|
+
return;
|
|
1587
|
+
}
|
|
1588
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "No agent or helper with this ID", statusCode: 404 });
|
|
1589
|
+
});
|
|
1590
|
+
server.route("POST", "/api/processes/:id/stop", async (_req, res, params) => {
|
|
1591
|
+
const proc = processManager.get(params["id"]);
|
|
1592
|
+
if (!proc) {
|
|
1593
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Process not found", statusCode: 404 });
|
|
1594
|
+
return;
|
|
1595
|
+
}
|
|
1596
|
+
await processManager.stop(params["id"]);
|
|
1597
|
+
sendJson(res, 200, { stopped: true });
|
|
1598
|
+
});
|
|
1599
|
+
server.route("POST", "/api/processes/:id/restart", async (_req, res, params) => {
|
|
1600
|
+
const proc = processManager.get(params["id"]);
|
|
1601
|
+
if (!proc) {
|
|
1602
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Process not found", statusCode: 404 });
|
|
1603
|
+
return;
|
|
1604
|
+
}
|
|
1605
|
+
await processManager.restart(params["id"]);
|
|
1606
|
+
sendJson(res, 200, { restarted: true });
|
|
1607
|
+
});
|
|
1608
|
+
};
|
|
1609
|
+
|
|
1610
|
+
// ../daemon/src/api/routes/s3.ts
|
|
1611
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
1612
|
+
|
|
1613
|
+
// ../daemon/src/capability-files.ts
|
|
1614
|
+
import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync3, unlinkSync, rmSync as rmSync2, existsSync as existsSync3, readdirSync as readdirSync2 } from "fs";
|
|
1615
|
+
import { resolve as resolve5, dirname as dirname2 } from "path";
|
|
1616
|
+
var generateCapabilityFile = (agentsDir, agentId, capabilityType, connectionId, content) => {
|
|
1617
|
+
const filePath = resolve5(agentsDir, agentId, "agent", "capabilities", capabilityType, `${connectionId}.md`);
|
|
1618
|
+
mkdirSync3(dirname2(filePath), { recursive: true });
|
|
1619
|
+
writeFileSync3(filePath, content, "utf-8");
|
|
1620
|
+
};
|
|
1621
|
+
var removeCapabilityFile = (agentsDir, agentId, capabilityType, connectionId) => {
|
|
1622
|
+
const filePath = resolve5(agentsDir, agentId, "agent", "capabilities", capabilityType, `${connectionId}.md`);
|
|
1623
|
+
try {
|
|
1624
|
+
unlinkSync(filePath);
|
|
1625
|
+
} catch {
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
|
|
1629
|
+
// ../daemon/src/api/routes/s3.ts
|
|
1630
|
+
var verifyProfile = async (profile) => {
|
|
1631
|
+
const bucket = createS3Bucket({
|
|
1632
|
+
bucket: profile.bucket,
|
|
1633
|
+
region: profile.region,
|
|
1634
|
+
profile: profile.awsProfile ?? void 0
|
|
1635
|
+
});
|
|
1636
|
+
return bucket.verify();
|
|
1637
|
+
};
|
|
1638
|
+
var buildS3CapabilityContent = (profile, connection) => {
|
|
1639
|
+
const profileName = profile.awsProfile ? `'${profile.awsProfile}'` : "undefined";
|
|
1640
|
+
return [
|
|
1641
|
+
`# S3: ${profile.name}`,
|
|
1642
|
+
`Bucket: ${profile.bucket}`,
|
|
1643
|
+
`Region: ${profile.region}`,
|
|
1644
|
+
profile.awsProfile ? `AWS Profile: ${profile.awsProfile}` : null,
|
|
1645
|
+
"",
|
|
1646
|
+
"## Usage",
|
|
1647
|
+
connection.purpose,
|
|
1648
|
+
"",
|
|
1649
|
+
"## Code",
|
|
1650
|
+
"```ts",
|
|
1651
|
+
"import { createS3Bucket } from 'kindflow/s3';",
|
|
1652
|
+
"const bucket = createS3Bucket({",
|
|
1653
|
+
` bucket: '${profile.bucket}',`,
|
|
1654
|
+
` region: '${profile.region}',`,
|
|
1655
|
+
` profile: ${profileName}`,
|
|
1656
|
+
"});",
|
|
1657
|
+
"```"
|
|
1658
|
+
].filter((line) => line !== null).join("\n");
|
|
1659
|
+
};
|
|
1660
|
+
var registerS3Routes = (server, configStore, agentsDir) => {
|
|
1661
|
+
server.route("GET", "/api/s3/profiles", async (_req, res) => {
|
|
1662
|
+
sendJson(res, 200, { profiles: configStore.getS3Profiles() });
|
|
1663
|
+
});
|
|
1664
|
+
server.route("GET", "/api/s3/profiles/:id", async (_req, res, params) => {
|
|
1665
|
+
const profile = configStore.getS3Profile(params["id"]);
|
|
1666
|
+
if (!profile) {
|
|
1667
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "S3 profile not found", statusCode: 404 });
|
|
1668
|
+
return;
|
|
1669
|
+
}
|
|
1670
|
+
sendJson(res, 200, profile);
|
|
1671
|
+
});
|
|
1672
|
+
server.route("POST", "/api/s3/profiles", async (_req, res, _params, body) => {
|
|
1673
|
+
const input = body;
|
|
1674
|
+
if (!input?.name || !input?.bucket || !input?.region) {
|
|
1675
|
+
sendJson(res, 400, { error: "BAD_REQUEST", message: "name, bucket, and region are required", statusCode: 400 });
|
|
1676
|
+
return;
|
|
1677
|
+
}
|
|
1678
|
+
const profile = {
|
|
1679
|
+
id: input.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || randomUUID2().slice(0, 8),
|
|
1680
|
+
name: input.name,
|
|
1681
|
+
bucket: input.bucket,
|
|
1682
|
+
region: input.region,
|
|
1683
|
+
awsProfile: input.awsProfile ?? null,
|
|
1684
|
+
verified: false,
|
|
1685
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1686
|
+
};
|
|
1687
|
+
const error = await verifyProfile(profile);
|
|
1688
|
+
if (error) {
|
|
1689
|
+
sendJson(res, 400, { error: "VERIFICATION_FAILED", message: error, statusCode: 400 });
|
|
1690
|
+
return;
|
|
1691
|
+
}
|
|
1692
|
+
profile.verified = true;
|
|
1693
|
+
configStore.saveS3Profile(profile);
|
|
1694
|
+
sendJson(res, 201, profile);
|
|
1695
|
+
});
|
|
1696
|
+
server.route("POST", "/api/s3/profiles/:id/verify", async (_req, res, params) => {
|
|
1697
|
+
const profile = configStore.getS3Profile(params["id"]);
|
|
1698
|
+
if (!profile) {
|
|
1699
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "S3 profile not found", statusCode: 404 });
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
const error = await verifyProfile(profile);
|
|
1703
|
+
if (error) {
|
|
1704
|
+
profile.verified = false;
|
|
1705
|
+
configStore.saveS3Profile(profile);
|
|
1706
|
+
sendJson(res, 200, { verified: false, error });
|
|
1707
|
+
return;
|
|
1708
|
+
}
|
|
1709
|
+
profile.verified = true;
|
|
1710
|
+
configStore.saveS3Profile(profile);
|
|
1711
|
+
sendJson(res, 200, { verified: true });
|
|
1712
|
+
});
|
|
1713
|
+
server.route("PUT", "/api/s3/profiles/:id", async (_req, res, params, body) => {
|
|
1714
|
+
const existing = configStore.getS3Profile(params["id"]);
|
|
1715
|
+
if (!existing) {
|
|
1716
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "S3 profile not found", statusCode: 404 });
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
const updates = body;
|
|
1720
|
+
const updated = { ...existing, ...updates, id: existing.id, createdAt: existing.createdAt };
|
|
1721
|
+
if (updates.bucket || updates.region || updates.awsProfile !== void 0) {
|
|
1722
|
+
const error = await verifyProfile(updated);
|
|
1723
|
+
updated.verified = !error;
|
|
1724
|
+
}
|
|
1725
|
+
configStore.saveS3Profile(updated);
|
|
1726
|
+
sendJson(res, 200, updated);
|
|
1727
|
+
});
|
|
1728
|
+
server.route("DELETE", "/api/s3/profiles/:id", async (_req, res, params) => {
|
|
1729
|
+
const existing = configStore.getS3Profile(params["id"]);
|
|
1730
|
+
if (!existing) {
|
|
1731
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "S3 profile not found", statusCode: 404 });
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
const connections = configStore.getS3ConnectionsForProfile(params["id"]);
|
|
1735
|
+
for (const conn of connections) {
|
|
1736
|
+
removeCapabilityFile(agentsDir, conn.targetAgent, "s3", conn.id);
|
|
1737
|
+
configStore.deleteS3Connection(conn.id);
|
|
1738
|
+
}
|
|
1739
|
+
configStore.deleteS3Profile(params["id"]);
|
|
1740
|
+
sendJson(res, 200, { deleted: true });
|
|
1741
|
+
});
|
|
1742
|
+
server.route("GET", "/api/s3/connections", async (_req, res) => {
|
|
1743
|
+
sendJson(res, 200, { connections: configStore.getS3Connections() });
|
|
1744
|
+
});
|
|
1745
|
+
server.route("POST", "/api/s3/connections", async (_req, res, _params, body) => {
|
|
1746
|
+
const input = body;
|
|
1747
|
+
if (!input?.profileId || !input?.targetAgent || !input?.purpose) {
|
|
1748
|
+
sendJson(res, 400, { error: "VALIDATION", message: "profileId, targetAgent, and purpose are required", statusCode: 400 });
|
|
1749
|
+
return;
|
|
1750
|
+
}
|
|
1751
|
+
const profile = configStore.getS3Profile(input.profileId);
|
|
1752
|
+
if (!profile) {
|
|
1753
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "S3 profile not found", statusCode: 404 });
|
|
1754
|
+
return;
|
|
1755
|
+
}
|
|
1756
|
+
if (!readAgent(agentsDir, input.targetAgent)) {
|
|
1757
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Target agent not found", statusCode: 404 });
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
const connection = {
|
|
1761
|
+
id: randomUUID2(),
|
|
1762
|
+
profileId: input.profileId,
|
|
1763
|
+
targetAgent: input.targetAgent,
|
|
1764
|
+
purpose: input.purpose,
|
|
1765
|
+
enabled: true,
|
|
1766
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1767
|
+
};
|
|
1768
|
+
configStore.saveS3Connection(connection);
|
|
1769
|
+
generateCapabilityFile(agentsDir, connection.targetAgent, "s3", connection.id, buildS3CapabilityContent(profile, connection));
|
|
1770
|
+
sendJson(res, 201, connection);
|
|
1771
|
+
});
|
|
1772
|
+
server.route("PUT", "/api/s3/connections/:id", async (_req, res, params, body) => {
|
|
1773
|
+
const existing = configStore.getS3Connections().find((c) => c.id === params["id"]);
|
|
1774
|
+
if (!existing) {
|
|
1775
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
1776
|
+
return;
|
|
1777
|
+
}
|
|
1778
|
+
const updates = body ?? {};
|
|
1779
|
+
const updated = {
|
|
1780
|
+
...existing,
|
|
1781
|
+
targetAgent: updates.targetAgent ?? existing.targetAgent,
|
|
1782
|
+
purpose: updates.purpose ?? existing.purpose,
|
|
1783
|
+
enabled: updates.enabled ?? existing.enabled
|
|
1784
|
+
};
|
|
1785
|
+
configStore.saveS3Connection(updated);
|
|
1786
|
+
const profile = configStore.getS3Profile(updated.profileId);
|
|
1787
|
+
if (profile) {
|
|
1788
|
+
if (updates.targetAgent && updates.targetAgent !== existing.targetAgent) {
|
|
1789
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "s3", existing.id);
|
|
1790
|
+
}
|
|
1791
|
+
generateCapabilityFile(agentsDir, updated.targetAgent, "s3", updated.id, buildS3CapabilityContent(profile, updated));
|
|
1792
|
+
}
|
|
1793
|
+
sendJson(res, 200, updated);
|
|
1794
|
+
});
|
|
1795
|
+
server.route("DELETE", "/api/s3/connections/:id", async (_req, res, params) => {
|
|
1796
|
+
const existing = configStore.getS3Connections().find((c) => c.id === params["id"]);
|
|
1797
|
+
if (!existing) {
|
|
1798
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
1799
|
+
return;
|
|
1800
|
+
}
|
|
1801
|
+
configStore.deleteS3Connection(params["id"]);
|
|
1802
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "s3", existing.id);
|
|
1803
|
+
sendJson(res, 200, { deleted: true });
|
|
1804
|
+
});
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
// ../daemon/src/api/routes/email.ts
|
|
1808
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
1809
|
+
|
|
1810
|
+
// ../crypto/src/crypto.ts
|
|
1811
|
+
import { randomBytes, createCipheriv, createDecipheriv } from "crypto";
|
|
1812
|
+
import { readFileSync as readFileSync3, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4 } from "fs";
|
|
1813
|
+
import { join as join3 } from "path";
|
|
1814
|
+
import { homedir as homedir2 } from "os";
|
|
1815
|
+
var IV_LENGTH = 16;
|
|
1816
|
+
var ALGORITHM = "aes-256-cbc";
|
|
1817
|
+
var keyPath = () => join3(process.env["KINDFLOW_DATA_DIR"] ?? join3(homedir2(), ".kindflow"), ".encryption-key");
|
|
1818
|
+
var getOrCreateKey2 = () => {
|
|
1819
|
+
const path = keyPath();
|
|
1820
|
+
try {
|
|
1821
|
+
return readFileSync3(path, "utf-8").trim();
|
|
1822
|
+
} catch {
|
|
1823
|
+
const key = randomBytes(32).toString("hex");
|
|
1824
|
+
mkdirSync4(join3(path, ".."), { recursive: true });
|
|
1825
|
+
writeFileSync4(path, key, { mode: 384 });
|
|
1826
|
+
return key;
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
var encrypt2 = (text, key) => {
|
|
1830
|
+
const iv = randomBytes(IV_LENGTH);
|
|
1831
|
+
const cipher = createCipheriv(ALGORITHM, Buffer.from(key, "hex"), iv);
|
|
1832
|
+
let encrypted = cipher.update(text, "utf8", "hex");
|
|
1833
|
+
encrypted += cipher.final("hex");
|
|
1834
|
+
return `${iv.toString("hex")}:${encrypted}`;
|
|
1835
|
+
};
|
|
1836
|
+
var decrypt2 = (text, key) => {
|
|
1837
|
+
if (!text) return "";
|
|
1838
|
+
if (!text.includes(":")) {
|
|
1839
|
+
console.warn("[crypto] decrypt called on value without iv:ciphertext format \u2014 returning raw value.");
|
|
1840
|
+
return text;
|
|
1841
|
+
}
|
|
1842
|
+
const [ivHex, encrypted] = text.split(":");
|
|
1843
|
+
const decipher = createDecipheriv(ALGORITHM, Buffer.from(key, "hex"), Buffer.from(ivHex, "hex"));
|
|
1844
|
+
let decrypted = decipher.update(encrypted, "hex", "utf8");
|
|
1845
|
+
decrypted += decipher.final("utf8");
|
|
1846
|
+
return decrypted;
|
|
1847
|
+
};
|
|
1848
|
+
|
|
1849
|
+
// ../daemon/src/api/routes/email.ts
|
|
1850
|
+
var escapeHtml = (str) => str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1851
|
+
var buildEmailCapabilityContent = (account, connection) => [
|
|
1852
|
+
`# Email: ${account.name}`,
|
|
1853
|
+
`Account: ${account.email}`,
|
|
1854
|
+
`Command: /${connection.command}`,
|
|
1855
|
+
`Connected to agent: ${connection.targetAgent}`
|
|
1856
|
+
].join("\n");
|
|
1857
|
+
var registerEmailRoutes = (server, processManager, configStore, daemonPort, agentsDir) => {
|
|
1858
|
+
let encryptionKey = null;
|
|
1859
|
+
const getKey = () => {
|
|
1860
|
+
if (!encryptionKey) encryptionKey = getOrCreateKey2();
|
|
1861
|
+
return encryptionKey;
|
|
1862
|
+
};
|
|
1863
|
+
const pendingOAuthStates = /* @__PURE__ */ new Map();
|
|
1864
|
+
const OAUTH_STATE_TTL = 10 * 60 * 1e3;
|
|
1865
|
+
setInterval(() => {
|
|
1866
|
+
const now = Date.now();
|
|
1867
|
+
for (const [state, expiry] of pendingOAuthStates) {
|
|
1868
|
+
if (now > expiry) pendingOAuthStates.delete(state);
|
|
1869
|
+
}
|
|
1870
|
+
}, 5 * 60 * 1e3).unref();
|
|
1871
|
+
const syncImapRunner = () => {
|
|
1872
|
+
const proc = processManager.get("email-imap");
|
|
1873
|
+
const oauthCreds = configStore.getOAuthCredentials("gmail");
|
|
1874
|
+
const accounts = configStore.getEmailAccounts();
|
|
1875
|
+
const connections = configStore.getEmailConnections();
|
|
1876
|
+
if (proc && proc.status === "running") {
|
|
1877
|
+
if (!oauthCreds) return;
|
|
1878
|
+
processManager.sendToChild("email-imap", {
|
|
1879
|
+
type: "email:update-accounts",
|
|
1880
|
+
accounts,
|
|
1881
|
+
oauthCredentials: oauthCreds
|
|
1882
|
+
});
|
|
1883
|
+
processManager.sendToChild("email-imap", {
|
|
1884
|
+
type: "email:update-connections",
|
|
1885
|
+
connections
|
|
1886
|
+
});
|
|
1887
|
+
} else if (accounts.length > 0 && connections.length > 0 && oauthCreds) {
|
|
1888
|
+
const key = getKey();
|
|
1889
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
1890
|
+
processManager.start("email-imap", "helper", {
|
|
1891
|
+
id: "email-imap",
|
|
1892
|
+
kind: "email-imap",
|
|
1893
|
+
name: "Email IMAP Watcher",
|
|
1894
|
+
config: {
|
|
1895
|
+
accounts: accounts.map((a) => ({
|
|
1896
|
+
...a,
|
|
1897
|
+
refreshToken: decrypt2(a.refreshToken, key)
|
|
1898
|
+
})),
|
|
1899
|
+
connections,
|
|
1900
|
+
oauthCredentials: {
|
|
1901
|
+
clientId: oauthCreds.clientId,
|
|
1902
|
+
clientSecret: decrypt2(oauthCreds.clientSecret, key)
|
|
1903
|
+
}
|
|
1904
|
+
},
|
|
1905
|
+
autoStart: true,
|
|
1906
|
+
createdAt: now,
|
|
1907
|
+
updatedAt: now
|
|
1908
|
+
});
|
|
1909
|
+
console.log(`[email] Auto-started email-imap runner with ${accounts.length} account(s)`);
|
|
1910
|
+
}
|
|
1911
|
+
};
|
|
1912
|
+
server.route("POST", "/api/email/oauth/credentials", async (_req, res, _params, body) => {
|
|
1913
|
+
const { clientId, clientSecret } = body ?? {};
|
|
1914
|
+
if (!clientId || !clientSecret) {
|
|
1915
|
+
sendJson(res, 400, { error: "VALIDATION", message: "clientId and clientSecret are required", statusCode: 400 });
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
1918
|
+
const encrypted = {
|
|
1919
|
+
clientId,
|
|
1920
|
+
clientSecret: encrypt2(clientSecret, getKey())
|
|
1921
|
+
};
|
|
1922
|
+
configStore.saveOAuthCredentials("gmail", encrypted);
|
|
1923
|
+
sendJson(res, 200, { saved: true });
|
|
1924
|
+
});
|
|
1925
|
+
server.route("GET", "/api/email/oauth/credentials", async (_req, res) => {
|
|
1926
|
+
const creds = configStore.getOAuthCredentials("gmail");
|
|
1927
|
+
sendJson(res, 200, { configured: !!creds, clientId: creds?.clientId ?? null });
|
|
1928
|
+
});
|
|
1929
|
+
server.route("GET", "/api/email/oauth/start", async (_req, res) => {
|
|
1930
|
+
const creds = configStore.getOAuthCredentials("gmail");
|
|
1931
|
+
if (!creds) {
|
|
1932
|
+
sendJson(res, 400, { error: "NOT_CONFIGURED", message: "OAuth credentials not configured", statusCode: 400 });
|
|
1933
|
+
return;
|
|
1934
|
+
}
|
|
1935
|
+
const redirectUri = `http://localhost:${daemonPort}/api/email/oauth/callback`;
|
|
1936
|
+
const state = randomUUID3();
|
|
1937
|
+
pendingOAuthStates.set(state, Date.now() + OAUTH_STATE_TTL);
|
|
1938
|
+
const url = buildConsentUrl(creds.clientId, redirectUri, state);
|
|
1939
|
+
sendJson(res, 200, { url, state });
|
|
1940
|
+
});
|
|
1941
|
+
server.route("GET", "/api/email/oauth/callback", async (req, res) => {
|
|
1942
|
+
const url = new URL(req.url ?? "/", `http://localhost:${daemonPort}`);
|
|
1943
|
+
const code = url.searchParams.get("code");
|
|
1944
|
+
const state = url.searchParams.get("state");
|
|
1945
|
+
if (!code) {
|
|
1946
|
+
sendJson(res, 400, { error: "MISSING_CODE", message: "Authorization code not found", statusCode: 400 });
|
|
1947
|
+
return;
|
|
1948
|
+
}
|
|
1949
|
+
if (!state || !pendingOAuthStates.has(state)) {
|
|
1950
|
+
sendJson(res, 400, { error: "INVALID_STATE", message: "Invalid or missing OAuth state parameter", statusCode: 400 });
|
|
1951
|
+
return;
|
|
1952
|
+
}
|
|
1953
|
+
const expiry = pendingOAuthStates.get(state);
|
|
1954
|
+
pendingOAuthStates.delete(state);
|
|
1955
|
+
if (Date.now() > expiry) {
|
|
1956
|
+
sendJson(res, 400, { error: "EXPIRED_STATE", message: "OAuth state has expired, please try again", statusCode: 400 });
|
|
1957
|
+
return;
|
|
1958
|
+
}
|
|
1959
|
+
const creds = configStore.getOAuthCredentials("gmail");
|
|
1960
|
+
if (!creds) {
|
|
1961
|
+
sendJson(res, 400, { error: "NOT_CONFIGURED", message: "OAuth credentials not configured", statusCode: 400 });
|
|
1962
|
+
return;
|
|
1963
|
+
}
|
|
1964
|
+
const clientSecret = decrypt2(creds.clientSecret, getKey());
|
|
1965
|
+
const redirectUri = `http://localhost:${daemonPort}/api/email/oauth/callback`;
|
|
1966
|
+
try {
|
|
1967
|
+
const tokens = await exchangeCodeForTokens(code, creds.clientId, clientSecret, redirectUri);
|
|
1968
|
+
const userInfo = await fetch("https://www.googleapis.com/oauth2/v2/userinfo", {
|
|
1969
|
+
headers: { Authorization: `Bearer ${tokens.accessToken}` }
|
|
1970
|
+
});
|
|
1971
|
+
const { email } = await userInfo.json();
|
|
1972
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
1973
|
+
const account = {
|
|
1974
|
+
id: randomUUID3(),
|
|
1975
|
+
name: email,
|
|
1976
|
+
email,
|
|
1977
|
+
refreshToken: encrypt2(tokens.refreshToken, getKey()),
|
|
1978
|
+
createdAt: now,
|
|
1979
|
+
updatedAt: now
|
|
1980
|
+
};
|
|
1981
|
+
configStore.saveEmailAccount(account);
|
|
1982
|
+
syncImapRunner();
|
|
1983
|
+
const safeEmail = escapeHtml(email);
|
|
1984
|
+
res.writeHead(200, { "Content-Type": "text/html" });
|
|
1985
|
+
res.end(`<html><body><script>window.close();</script><p>Account added: ${safeEmail}. You can close this window.</p></body></html>`);
|
|
1986
|
+
} catch (err) {
|
|
1987
|
+
const message = err instanceof Error ? err.message : "Unknown error";
|
|
1988
|
+
sendJson(res, 500, { error: "OAUTH_EXCHANGE_FAILED", message, statusCode: 500 });
|
|
1989
|
+
}
|
|
1990
|
+
});
|
|
1991
|
+
server.route("GET", "/api/email/accounts", async (_req, res) => {
|
|
1992
|
+
const accounts = configStore.getEmailAccounts().map((a) => ({
|
|
1993
|
+
...a,
|
|
1994
|
+
refreshToken: "***"
|
|
1995
|
+
}));
|
|
1996
|
+
sendJson(res, 200, { accounts });
|
|
1997
|
+
});
|
|
1998
|
+
server.route("DELETE", "/api/email/accounts/:id", async (_req, res, params) => {
|
|
1999
|
+
const account = configStore.getEmailAccount(params["id"]);
|
|
2000
|
+
if (!account) {
|
|
2001
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Account not found", statusCode: 404 });
|
|
2002
|
+
return;
|
|
2003
|
+
}
|
|
2004
|
+
const connections = configStore.getEmailConnectionsForAccount(params["id"]);
|
|
2005
|
+
for (const conn of connections) {
|
|
2006
|
+
removeCapabilityFile(agentsDir, conn.targetAgent, "email", conn.id);
|
|
2007
|
+
}
|
|
2008
|
+
configStore.deleteEmailAccount(params["id"]);
|
|
2009
|
+
syncImapRunner();
|
|
2010
|
+
sendJson(res, 200, { deleted: true });
|
|
2011
|
+
});
|
|
2012
|
+
server.route("POST", "/api/email/accounts/:id/test", async (_req, res, params) => {
|
|
2013
|
+
const account = configStore.getEmailAccount(params["id"]);
|
|
2014
|
+
if (!account) {
|
|
2015
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Account not found", statusCode: 404 });
|
|
2016
|
+
return;
|
|
2017
|
+
}
|
|
2018
|
+
const creds = configStore.getOAuthCredentials("gmail");
|
|
2019
|
+
if (!creds) {
|
|
2020
|
+
sendJson(res, 400, { error: "NOT_CONFIGURED", message: "OAuth credentials not configured", statusCode: 400 });
|
|
2021
|
+
return;
|
|
2022
|
+
}
|
|
2023
|
+
try {
|
|
2024
|
+
const refreshToken = decrypt2(account.refreshToken, getKey());
|
|
2025
|
+
const clientSecret = decrypt2(creds.clientSecret, getKey());
|
|
2026
|
+
const { accessToken } = await refreshAccessToken(refreshToken, creds.clientId, clientSecret);
|
|
2027
|
+
const client = new ImapClient();
|
|
2028
|
+
await client.connect();
|
|
2029
|
+
const token = buildXOAuth2Token(account.email, accessToken);
|
|
2030
|
+
await client.authenticate(token);
|
|
2031
|
+
const messageCount = await client.select("INBOX");
|
|
2032
|
+
await client.logout();
|
|
2033
|
+
sendJson(res, 200, { success: true, messageCount });
|
|
2034
|
+
} catch (err) {
|
|
2035
|
+
const message = err instanceof Error ? err.message : "Connection failed";
|
|
2036
|
+
sendJson(res, 200, { success: false, error: message });
|
|
2037
|
+
}
|
|
2038
|
+
});
|
|
2039
|
+
server.route("GET", "/api/email/connections", async (_req, res) => {
|
|
2040
|
+
sendJson(res, 200, { connections: configStore.getEmailConnections() });
|
|
2041
|
+
});
|
|
2042
|
+
server.route("POST", "/api/email/connections", async (_req, res, _params, body) => {
|
|
2043
|
+
const { accountId, targetAgent, command, enabled } = body ?? {};
|
|
2044
|
+
if (!accountId || !targetAgent || !command) {
|
|
2045
|
+
sendJson(res, 400, { error: "VALIDATION", message: "accountId, targetAgent, and command are required", statusCode: 400 });
|
|
2046
|
+
return;
|
|
2047
|
+
}
|
|
2048
|
+
if (!configStore.getEmailAccount(accountId)) {
|
|
2049
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Account not found", statusCode: 404 });
|
|
2050
|
+
return;
|
|
2051
|
+
}
|
|
2052
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
2053
|
+
const connection = {
|
|
2054
|
+
id: randomUUID3(),
|
|
2055
|
+
accountId,
|
|
2056
|
+
targetAgent,
|
|
2057
|
+
command,
|
|
2058
|
+
enabled: enabled !== false,
|
|
2059
|
+
createdAt: now,
|
|
2060
|
+
updatedAt: now
|
|
2061
|
+
};
|
|
2062
|
+
configStore.saveEmailConnection(connection);
|
|
2063
|
+
const parentAccount = configStore.getEmailAccount(accountId);
|
|
2064
|
+
if (parentAccount) {
|
|
2065
|
+
generateCapabilityFile(agentsDir, connection.targetAgent, "email", connection.id, buildEmailCapabilityContent(parentAccount, connection));
|
|
2066
|
+
}
|
|
2067
|
+
syncImapRunner();
|
|
2068
|
+
sendJson(res, 201, connection);
|
|
2069
|
+
});
|
|
2070
|
+
server.route("PUT", "/api/email/connections/:id", async (_req, res, params, body) => {
|
|
2071
|
+
const existing = configStore.getEmailConnection(params["id"]);
|
|
2072
|
+
if (!existing) {
|
|
2073
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
2074
|
+
return;
|
|
2075
|
+
}
|
|
2076
|
+
const updates = body ?? {};
|
|
2077
|
+
const updated = {
|
|
2078
|
+
...existing,
|
|
2079
|
+
targetAgent: updates.targetAgent ?? existing.targetAgent,
|
|
2080
|
+
command: updates.command ?? existing.command,
|
|
2081
|
+
enabled: updates.enabled ?? existing.enabled,
|
|
2082
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2083
|
+
};
|
|
2084
|
+
configStore.saveEmailConnection(updated);
|
|
2085
|
+
const parentAccount = configStore.getEmailAccount(updated.accountId);
|
|
2086
|
+
if (parentAccount) {
|
|
2087
|
+
if (updates.targetAgent && updates.targetAgent !== existing.targetAgent) {
|
|
2088
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "email", existing.id);
|
|
2089
|
+
}
|
|
2090
|
+
generateCapabilityFile(agentsDir, updated.targetAgent, "email", updated.id, buildEmailCapabilityContent(parentAccount, updated));
|
|
2091
|
+
}
|
|
2092
|
+
syncImapRunner();
|
|
2093
|
+
sendJson(res, 200, updated);
|
|
2094
|
+
});
|
|
2095
|
+
server.route("DELETE", "/api/email/connections/:id", async (_req, res, params) => {
|
|
2096
|
+
const existing = configStore.getEmailConnection(params["id"]);
|
|
2097
|
+
if (!existing) {
|
|
2098
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
2099
|
+
return;
|
|
2100
|
+
}
|
|
2101
|
+
configStore.deleteEmailConnection(params["id"]);
|
|
2102
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "email", existing.id);
|
|
2103
|
+
syncImapRunner();
|
|
2104
|
+
sendJson(res, 200, { deleted: true });
|
|
2105
|
+
});
|
|
2106
|
+
};
|
|
2107
|
+
|
|
2108
|
+
// ../daemon/src/api/routes/database.ts
|
|
2109
|
+
import { randomUUID as randomUUID4 } from "crypto";
|
|
2110
|
+
var redactPassword = (profile) => ({
|
|
2111
|
+
...profile,
|
|
2112
|
+
password: profile.password ? "***" : null
|
|
2113
|
+
});
|
|
2114
|
+
var verifyProfile2 = async (profile, key) => {
|
|
2115
|
+
try {
|
|
2116
|
+
const client = await createDatabaseClient({
|
|
2117
|
+
type: profile.type,
|
|
2118
|
+
host: profile.host ?? void 0,
|
|
2119
|
+
port: profile.port ?? void 0,
|
|
2120
|
+
database: profile.database,
|
|
2121
|
+
username: profile.username ?? void 0,
|
|
2122
|
+
password: profile.password ? decrypt2(profile.password, key) : void 0,
|
|
2123
|
+
sslMode: profile.sslMode ?? void 0
|
|
2124
|
+
});
|
|
2125
|
+
const error = await client.verify();
|
|
2126
|
+
await client.close();
|
|
2127
|
+
return error;
|
|
2128
|
+
} catch (err) {
|
|
2129
|
+
return err instanceof Error ? err.message : String(err);
|
|
2130
|
+
}
|
|
2131
|
+
};
|
|
2132
|
+
var buildDatabaseCapabilityContent = (profile, connection) => {
|
|
2133
|
+
const lines = [
|
|
2134
|
+
`# Database: ${profile.name}`,
|
|
2135
|
+
`Type: ${profile.type}`
|
|
2136
|
+
];
|
|
2137
|
+
if (profile.host) lines.push(`Host: ${profile.host}${profile.port ? `:${profile.port}` : ""}`);
|
|
2138
|
+
lines.push(`Database: ${profile.database}`);
|
|
2139
|
+
lines.push("", "## Usage", connection.purpose);
|
|
2140
|
+
lines.push("", "## Code", "```ts");
|
|
2141
|
+
lines.push("import { createDatabaseClient } from 'kindflow/database';");
|
|
2142
|
+
lines.push("const db = await createDatabaseClient({");
|
|
2143
|
+
lines.push(` type: '${profile.type}',`);
|
|
2144
|
+
if (profile.host) lines.push(` host: '${profile.host}',`);
|
|
2145
|
+
if (profile.port) lines.push(` port: ${profile.port},`);
|
|
2146
|
+
lines.push(` database: '${profile.database}',`);
|
|
2147
|
+
if (profile.username) lines.push(` username: '...',`);
|
|
2148
|
+
if (profile.password) lines.push(` password: '...',`);
|
|
2149
|
+
lines.push("});");
|
|
2150
|
+
lines.push("```");
|
|
2151
|
+
return lines.join("\n");
|
|
2152
|
+
};
|
|
2153
|
+
var registerDatabaseRoutes = (server, configStore, agentsDir) => {
|
|
2154
|
+
let encryptionKey = null;
|
|
2155
|
+
const getKey = () => {
|
|
2156
|
+
if (!encryptionKey) encryptionKey = getOrCreateKey2();
|
|
2157
|
+
return encryptionKey;
|
|
2158
|
+
};
|
|
2159
|
+
server.route("GET", "/api/database/profiles", async (_req, res) => {
|
|
2160
|
+
sendJson(res, 200, { profiles: configStore.getDatabaseProfiles().map(redactPassword) });
|
|
2161
|
+
});
|
|
2162
|
+
server.route("GET", "/api/database/profiles/:id", async (_req, res, params) => {
|
|
2163
|
+
const profile = configStore.getDatabaseProfile(params["id"]);
|
|
2164
|
+
if (!profile) {
|
|
2165
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Database profile not found", statusCode: 404 });
|
|
2166
|
+
return;
|
|
2167
|
+
}
|
|
2168
|
+
sendJson(res, 200, redactPassword(profile));
|
|
2169
|
+
});
|
|
2170
|
+
server.route("POST", "/api/database/profiles", async (_req, res, _params, body) => {
|
|
2171
|
+
const input = body;
|
|
2172
|
+
if (!input?.name || !input?.type || !input?.database) {
|
|
2173
|
+
sendJson(res, 400, { error: "BAD_REQUEST", message: "name, type, and database are required", statusCode: 400 });
|
|
2174
|
+
return;
|
|
2175
|
+
}
|
|
2176
|
+
const profile = {
|
|
2177
|
+
id: input.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || randomUUID4().slice(0, 8),
|
|
2178
|
+
name: input.name,
|
|
2179
|
+
type: input.type,
|
|
2180
|
+
host: input.host ?? null,
|
|
2181
|
+
port: input.port ?? null,
|
|
2182
|
+
database: input.database,
|
|
2183
|
+
username: input.username ?? null,
|
|
2184
|
+
password: input.password ? encrypt2(input.password, getKey()) : null,
|
|
2185
|
+
sslMode: input.sslMode ?? null,
|
|
2186
|
+
verified: false,
|
|
2187
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2188
|
+
};
|
|
2189
|
+
const error = await verifyProfile2(profile, getKey());
|
|
2190
|
+
if (error) {
|
|
2191
|
+
sendJson(res, 400, { error: "VERIFICATION_FAILED", message: error, statusCode: 400 });
|
|
2192
|
+
return;
|
|
2193
|
+
}
|
|
2194
|
+
profile.verified = true;
|
|
2195
|
+
configStore.saveDatabaseProfile(profile);
|
|
2196
|
+
sendJson(res, 201, redactPassword(profile));
|
|
2197
|
+
});
|
|
2198
|
+
server.route("POST", "/api/database/profiles/:id/verify", async (_req, res, params) => {
|
|
2199
|
+
const profile = configStore.getDatabaseProfile(params["id"]);
|
|
2200
|
+
if (!profile) {
|
|
2201
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Database profile not found", statusCode: 404 });
|
|
2202
|
+
return;
|
|
2203
|
+
}
|
|
2204
|
+
const error = await verifyProfile2(profile, getKey());
|
|
2205
|
+
profile.verified = !error;
|
|
2206
|
+
configStore.saveDatabaseProfile(profile);
|
|
2207
|
+
sendJson(res, 200, { verified: !error, error: error ?? void 0 });
|
|
2208
|
+
});
|
|
2209
|
+
server.route("PUT", "/api/database/profiles/:id", async (_req, res, params, body) => {
|
|
2210
|
+
const existing = configStore.getDatabaseProfile(params["id"]);
|
|
2211
|
+
if (!existing) {
|
|
2212
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Database profile not found", statusCode: 404 });
|
|
2213
|
+
return;
|
|
2214
|
+
}
|
|
2215
|
+
const updates = body;
|
|
2216
|
+
const updatedPassword = updates.password !== void 0 ? updates.password ? encrypt2(updates.password, getKey()) : null : existing.password;
|
|
2217
|
+
const updated = {
|
|
2218
|
+
...existing,
|
|
2219
|
+
...updates,
|
|
2220
|
+
id: existing.id,
|
|
2221
|
+
createdAt: existing.createdAt,
|
|
2222
|
+
password: updatedPassword
|
|
2223
|
+
};
|
|
2224
|
+
if (updates.host !== void 0 || updates.port !== void 0 || updates.database !== void 0 || updates.username !== void 0 || updates.password !== void 0 || updates.sslMode !== void 0 || updates.type !== void 0) {
|
|
2225
|
+
const error = await verifyProfile2(updated, getKey());
|
|
2226
|
+
updated.verified = !error;
|
|
2227
|
+
}
|
|
2228
|
+
configStore.saveDatabaseProfile(updated);
|
|
2229
|
+
sendJson(res, 200, redactPassword(updated));
|
|
2230
|
+
});
|
|
2231
|
+
server.route("DELETE", "/api/database/profiles/:id", async (_req, res, params) => {
|
|
2232
|
+
const existing = configStore.getDatabaseProfile(params["id"]);
|
|
2233
|
+
if (!existing) {
|
|
2234
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Database profile not found", statusCode: 404 });
|
|
2235
|
+
return;
|
|
2236
|
+
}
|
|
2237
|
+
const connections = configStore.getDatabaseConnectionsForProfile(params["id"]);
|
|
2238
|
+
for (const conn of connections) {
|
|
2239
|
+
removeCapabilityFile(agentsDir, conn.targetAgent, "database", conn.id);
|
|
2240
|
+
configStore.deleteDatabaseConnection(conn.id);
|
|
2241
|
+
}
|
|
2242
|
+
configStore.deleteDatabaseProfile(params["id"]);
|
|
2243
|
+
sendJson(res, 200, { deleted: true });
|
|
2244
|
+
});
|
|
2245
|
+
server.route("GET", "/api/database/connections", async (_req, res) => {
|
|
2246
|
+
sendJson(res, 200, { connections: configStore.getDatabaseConnections() });
|
|
2247
|
+
});
|
|
2248
|
+
server.route("POST", "/api/database/connections", async (_req, res, _params, body) => {
|
|
2249
|
+
const input = body;
|
|
2250
|
+
if (!input?.profileId || !input?.targetAgent || !input?.purpose) {
|
|
2251
|
+
sendJson(res, 400, { error: "VALIDATION", message: "profileId, targetAgent, and purpose are required", statusCode: 400 });
|
|
2252
|
+
return;
|
|
2253
|
+
}
|
|
2254
|
+
const profile = configStore.getDatabaseProfile(input.profileId);
|
|
2255
|
+
if (!profile) {
|
|
2256
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Database profile not found", statusCode: 404 });
|
|
2257
|
+
return;
|
|
2258
|
+
}
|
|
2259
|
+
if (!readAgent(agentsDir, input.targetAgent)) {
|
|
2260
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Target agent not found", statusCode: 404 });
|
|
2261
|
+
return;
|
|
2262
|
+
}
|
|
2263
|
+
const connection = {
|
|
2264
|
+
id: randomUUID4(),
|
|
2265
|
+
profileId: input.profileId,
|
|
2266
|
+
targetAgent: input.targetAgent,
|
|
2267
|
+
purpose: input.purpose,
|
|
2268
|
+
enabled: true,
|
|
2269
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2270
|
+
};
|
|
2271
|
+
configStore.saveDatabaseConnection(connection);
|
|
2272
|
+
generateCapabilityFile(agentsDir, connection.targetAgent, "database", connection.id, buildDatabaseCapabilityContent(profile, connection));
|
|
2273
|
+
sendJson(res, 201, connection);
|
|
2274
|
+
});
|
|
2275
|
+
server.route("PUT", "/api/database/connections/:id", async (_req, res, params, body) => {
|
|
2276
|
+
const existing = configStore.getDatabaseConnections().find((c) => c.id === params["id"]);
|
|
2277
|
+
if (!existing) {
|
|
2278
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
2279
|
+
return;
|
|
2280
|
+
}
|
|
2281
|
+
const updates = body ?? {};
|
|
2282
|
+
const updated = {
|
|
2283
|
+
...existing,
|
|
2284
|
+
targetAgent: updates.targetAgent ?? existing.targetAgent,
|
|
2285
|
+
purpose: updates.purpose ?? existing.purpose,
|
|
2286
|
+
enabled: updates.enabled ?? existing.enabled
|
|
2287
|
+
};
|
|
2288
|
+
configStore.saveDatabaseConnection(updated);
|
|
2289
|
+
const profile = configStore.getDatabaseProfile(updated.profileId);
|
|
2290
|
+
if (profile) {
|
|
2291
|
+
if (updates.targetAgent && updates.targetAgent !== existing.targetAgent) {
|
|
2292
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "database", existing.id);
|
|
2293
|
+
}
|
|
2294
|
+
generateCapabilityFile(agentsDir, updated.targetAgent, "database", updated.id, buildDatabaseCapabilityContent(profile, updated));
|
|
2295
|
+
}
|
|
2296
|
+
sendJson(res, 200, updated);
|
|
2297
|
+
});
|
|
2298
|
+
server.route("DELETE", "/api/database/connections/:id", async (_req, res, params) => {
|
|
2299
|
+
const existing = configStore.getDatabaseConnections().find((c) => c.id === params["id"]);
|
|
2300
|
+
if (!existing) {
|
|
2301
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
2302
|
+
return;
|
|
2303
|
+
}
|
|
2304
|
+
configStore.deleteDatabaseConnection(params["id"]);
|
|
2305
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "database", existing.id);
|
|
2306
|
+
sendJson(res, 200, { deleted: true });
|
|
2307
|
+
});
|
|
2308
|
+
};
|
|
2309
|
+
|
|
2310
|
+
// ../daemon/src/api/routes/http.ts
|
|
2311
|
+
import { randomUUID as randomUUID5, timingSafeEqual } from "crypto";
|
|
2312
|
+
var PATH_SLUG_REGEX = /^[a-z0-9][a-z0-9-]*$/;
|
|
2313
|
+
var extractBearerToken = (req) => {
|
|
2314
|
+
const header = req.headers["authorization"];
|
|
2315
|
+
if (!header || !header.startsWith("Bearer ")) return null;
|
|
2316
|
+
return header.slice(7);
|
|
2317
|
+
};
|
|
2318
|
+
var safeEqual = (a, b) => {
|
|
2319
|
+
const bufA = Buffer.from(a);
|
|
2320
|
+
const bufB = Buffer.from(b);
|
|
2321
|
+
if (bufA.length !== bufB.length) return false;
|
|
2322
|
+
return timingSafeEqual(bufA, bufB);
|
|
2323
|
+
};
|
|
2324
|
+
var buildHttpCapabilityContent = (endpoint, connection) => [
|
|
2325
|
+
`# HTTP: ${endpoint.name}`,
|
|
2326
|
+
`Path: /api/trigger/${endpoint.path}`,
|
|
2327
|
+
connection.command ? `Command: /${connection.command}` : "Command: (free-form text from request body)",
|
|
2328
|
+
`Connected to agent: ${connection.targetAgent}`
|
|
2329
|
+
].join("\n");
|
|
2330
|
+
var registerHttpRoutes = (server, processManager, ipcHub, configStore, agentsDir) => {
|
|
2331
|
+
let encryptionKey = null;
|
|
2332
|
+
const getKey = () => {
|
|
2333
|
+
if (!encryptionKey) encryptionKey = getOrCreateKey2();
|
|
2334
|
+
return encryptionKey;
|
|
2335
|
+
};
|
|
2336
|
+
const redactApiKey = (endpoint) => ({
|
|
2337
|
+
...endpoint,
|
|
2338
|
+
apiKey: endpoint.apiKey ? "***" : null
|
|
2339
|
+
});
|
|
2340
|
+
server.route("POST", "/api/trigger/:path", async (req, res, params, body) => {
|
|
2341
|
+
const pathSlug = params["path"];
|
|
2342
|
+
const endpoint = configStore.getHttpEndpointByPath(pathSlug);
|
|
2343
|
+
if (!endpoint) {
|
|
2344
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Endpoint not found", statusCode: 404 });
|
|
2345
|
+
return;
|
|
2346
|
+
}
|
|
2347
|
+
if (!endpoint.enabled) {
|
|
2348
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Endpoint is disabled", statusCode: 404 });
|
|
2349
|
+
return;
|
|
2350
|
+
}
|
|
2351
|
+
if (endpoint.apiKey) {
|
|
2352
|
+
const token = extractBearerToken(req);
|
|
2353
|
+
const decryptedKey = decrypt2(endpoint.apiKey, getKey());
|
|
2354
|
+
if (!token || !safeEqual(token, decryptedKey)) {
|
|
2355
|
+
sendJson(res, 401, { error: "UNAUTHORIZED", message: "Invalid or missing API key", statusCode: 401 });
|
|
2356
|
+
return;
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
const connections = configStore.getHttpConnectionsForEndpoint(endpoint.id).filter((c) => c.enabled);
|
|
2360
|
+
if (connections.length === 0) {
|
|
2361
|
+
sendJson(res, 200, { queued: false, reason: "No enabled connections for this endpoint" });
|
|
2362
|
+
return;
|
|
2363
|
+
}
|
|
2364
|
+
let queued = 0;
|
|
2365
|
+
for (const connection of connections) {
|
|
2366
|
+
const proc = processManager.get(connection.targetAgent);
|
|
2367
|
+
if (!proc || proc.status !== "running") continue;
|
|
2368
|
+
let promptText;
|
|
2369
|
+
if (connection.command) {
|
|
2370
|
+
promptText = `/${connection.command}`;
|
|
2371
|
+
} else {
|
|
2372
|
+
const { text } = body ?? {};
|
|
2373
|
+
if (!text) continue;
|
|
2374
|
+
promptText = text;
|
|
2375
|
+
}
|
|
2376
|
+
const message = createMessage("http-trigger", connection.targetAgent, "prompt", {
|
|
2377
|
+
text: promptText,
|
|
2378
|
+
metadata: {
|
|
2379
|
+
source: "http",
|
|
2380
|
+
endpointId: endpoint.id,
|
|
2381
|
+
endpointName: endpoint.name,
|
|
2382
|
+
endpointPath: endpoint.path,
|
|
2383
|
+
connectionId: connection.id
|
|
2384
|
+
}
|
|
2385
|
+
});
|
|
2386
|
+
ipcHub.sendTo(connection.targetAgent, message);
|
|
2387
|
+
queued++;
|
|
2388
|
+
}
|
|
2389
|
+
if (queued === 0) {
|
|
2390
|
+
sendJson(res, 200, { queued: false, count: 0, reason: "No agents were available to receive the message" });
|
|
2391
|
+
return;
|
|
2392
|
+
}
|
|
2393
|
+
sendJson(res, 202, { queued: true, count: queued });
|
|
2394
|
+
});
|
|
2395
|
+
server.route("GET", "/api/http/endpoints", async (_req, res) => {
|
|
2396
|
+
const endpoints = configStore.getHttpEndpoints().map(redactApiKey);
|
|
2397
|
+
sendJson(res, 200, { endpoints });
|
|
2398
|
+
});
|
|
2399
|
+
server.route("POST", "/api/http/endpoints", async (_req, res, _params, body) => {
|
|
2400
|
+
const input = body;
|
|
2401
|
+
if (!input?.name || !input?.path) {
|
|
2402
|
+
sendJson(res, 400, { error: "VALIDATION", message: "name and path are required", statusCode: 400 });
|
|
2403
|
+
return;
|
|
2404
|
+
}
|
|
2405
|
+
if (!PATH_SLUG_REGEX.test(input.path)) {
|
|
2406
|
+
sendJson(res, 400, { error: "BAD_REQUEST", message: "path must contain only lowercase letters, numbers, and hyphens", statusCode: 400 });
|
|
2407
|
+
return;
|
|
2408
|
+
}
|
|
2409
|
+
const existing = configStore.getHttpEndpointByPath(input.path);
|
|
2410
|
+
if (existing) {
|
|
2411
|
+
sendJson(res, 409, { error: "CONFLICT", message: `An endpoint with path "${input.path}" already exists`, statusCode: 409 });
|
|
2412
|
+
return;
|
|
2413
|
+
}
|
|
2414
|
+
const rawApiKey = input.generateApiKey ? randomUUID5() : null;
|
|
2415
|
+
const endpoint = {
|
|
2416
|
+
id: randomUUID5(),
|
|
2417
|
+
name: input.name,
|
|
2418
|
+
path: input.path,
|
|
2419
|
+
apiKey: rawApiKey ? encrypt2(rawApiKey, getKey()) : null,
|
|
2420
|
+
enabled: true,
|
|
2421
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2422
|
+
};
|
|
2423
|
+
configStore.saveHttpEndpoint(endpoint);
|
|
2424
|
+
sendJson(res, 201, redactApiKey(endpoint));
|
|
2425
|
+
});
|
|
2426
|
+
server.route("GET", "/api/http/endpoints/:id", async (_req, res, params) => {
|
|
2427
|
+
const endpoint = configStore.getHttpEndpoint(params["id"]);
|
|
2428
|
+
if (!endpoint) {
|
|
2429
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Endpoint not found", statusCode: 404 });
|
|
2430
|
+
return;
|
|
2431
|
+
}
|
|
2432
|
+
sendJson(res, 200, redactApiKey(endpoint));
|
|
2433
|
+
});
|
|
2434
|
+
server.route("PUT", "/api/http/endpoints/:id", async (_req, res, params, body) => {
|
|
2435
|
+
const existing = configStore.getHttpEndpoint(params["id"]);
|
|
2436
|
+
if (!existing) {
|
|
2437
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Endpoint not found", statusCode: 404 });
|
|
2438
|
+
return;
|
|
2439
|
+
}
|
|
2440
|
+
const updates = body ?? {};
|
|
2441
|
+
if (updates.path !== void 0 && !PATH_SLUG_REGEX.test(updates.path)) {
|
|
2442
|
+
sendJson(res, 400, { error: "BAD_REQUEST", message: "path must contain only lowercase letters, numbers, and hyphens", statusCode: 400 });
|
|
2443
|
+
return;
|
|
2444
|
+
}
|
|
2445
|
+
if (updates.path && updates.path !== existing.path) {
|
|
2446
|
+
const dup = configStore.getHttpEndpointByPath(updates.path);
|
|
2447
|
+
if (dup) {
|
|
2448
|
+
sendJson(res, 409, { error: "CONFLICT", message: `An endpoint with path "${updates.path}" already exists`, statusCode: 409 });
|
|
2449
|
+
return;
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
const rawApiKey = updates.regenerateApiKey ? randomUUID5() : null;
|
|
2453
|
+
const updated = {
|
|
2454
|
+
...existing,
|
|
2455
|
+
name: updates.name ?? existing.name,
|
|
2456
|
+
path: updates.path ?? existing.path,
|
|
2457
|
+
enabled: updates.enabled ?? existing.enabled,
|
|
2458
|
+
apiKey: rawApiKey ? encrypt2(rawApiKey, getKey()) : existing.apiKey
|
|
2459
|
+
};
|
|
2460
|
+
configStore.saveHttpEndpoint(updated);
|
|
2461
|
+
sendJson(res, 200, redactApiKey(updated));
|
|
2462
|
+
});
|
|
2463
|
+
server.route("DELETE", "/api/http/endpoints/:id", async (_req, res, params) => {
|
|
2464
|
+
const endpoint = configStore.getHttpEndpoint(params["id"]);
|
|
2465
|
+
if (!endpoint) {
|
|
2466
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Endpoint not found", statusCode: 404 });
|
|
2467
|
+
return;
|
|
2468
|
+
}
|
|
2469
|
+
const connections = configStore.getHttpConnectionsForEndpoint(params["id"]);
|
|
2470
|
+
for (const conn of connections) {
|
|
2471
|
+
removeCapabilityFile(agentsDir, conn.targetAgent, "http", conn.id);
|
|
2472
|
+
}
|
|
2473
|
+
configStore.deleteHttpEndpoint(params["id"]);
|
|
2474
|
+
sendJson(res, 200, { deleted: true });
|
|
2475
|
+
});
|
|
2476
|
+
server.route("GET", "/api/http/connections", async (_req, res) => {
|
|
2477
|
+
sendJson(res, 200, { connections: configStore.getHttpConnections() });
|
|
2478
|
+
});
|
|
2479
|
+
server.route("POST", "/api/http/connections", async (_req, res, _params, body) => {
|
|
2480
|
+
const input = body;
|
|
2481
|
+
if (!input?.endpointId || !input?.targetAgent) {
|
|
2482
|
+
sendJson(res, 400, { error: "VALIDATION", message: "endpointId and targetAgent are required", statusCode: 400 });
|
|
2483
|
+
return;
|
|
2484
|
+
}
|
|
2485
|
+
if (!configStore.getHttpEndpoint(input.endpointId)) {
|
|
2486
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Endpoint not found", statusCode: 404 });
|
|
2487
|
+
return;
|
|
2488
|
+
}
|
|
2489
|
+
const connection = {
|
|
2490
|
+
id: randomUUID5(),
|
|
2491
|
+
endpointId: input.endpointId,
|
|
2492
|
+
targetAgent: input.targetAgent,
|
|
2493
|
+
command: input.command ?? null,
|
|
2494
|
+
enabled: true,
|
|
2495
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2496
|
+
};
|
|
2497
|
+
configStore.saveHttpConnection(connection);
|
|
2498
|
+
const parentEndpoint = configStore.getHttpEndpoint(input.endpointId);
|
|
2499
|
+
if (parentEndpoint) {
|
|
2500
|
+
generateCapabilityFile(agentsDir, connection.targetAgent, "http", connection.id, buildHttpCapabilityContent(parentEndpoint, connection));
|
|
2501
|
+
}
|
|
2502
|
+
sendJson(res, 201, connection);
|
|
2503
|
+
});
|
|
2504
|
+
server.route("PUT", "/api/http/connections/:id", async (_req, res, params, body) => {
|
|
2505
|
+
const existing = configStore.getHttpConnections().find((c) => c.id === params["id"]);
|
|
2506
|
+
if (!existing) {
|
|
2507
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
2508
|
+
return;
|
|
2509
|
+
}
|
|
2510
|
+
const updates = body ?? {};
|
|
2511
|
+
const updated = {
|
|
2512
|
+
...existing,
|
|
2513
|
+
targetAgent: updates.targetAgent ?? existing.targetAgent,
|
|
2514
|
+
command: updates.command !== void 0 ? updates.command : existing.command,
|
|
2515
|
+
enabled: updates.enabled ?? existing.enabled
|
|
2516
|
+
};
|
|
2517
|
+
configStore.saveHttpConnection(updated);
|
|
2518
|
+
const parentEndpoint = configStore.getHttpEndpoint(updated.endpointId);
|
|
2519
|
+
if (parentEndpoint) {
|
|
2520
|
+
if (updates.targetAgent && updates.targetAgent !== existing.targetAgent) {
|
|
2521
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "http", existing.id);
|
|
2522
|
+
}
|
|
2523
|
+
generateCapabilityFile(agentsDir, updated.targetAgent, "http", updated.id, buildHttpCapabilityContent(parentEndpoint, updated));
|
|
2524
|
+
}
|
|
2525
|
+
sendJson(res, 200, updated);
|
|
2526
|
+
});
|
|
2527
|
+
server.route("DELETE", "/api/http/connections/:id", async (_req, res, params) => {
|
|
2528
|
+
const existing = configStore.getHttpConnections().find((c) => c.id === params["id"]);
|
|
2529
|
+
if (!existing) {
|
|
2530
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
2531
|
+
return;
|
|
2532
|
+
}
|
|
2533
|
+
configStore.deleteHttpConnection(params["id"]);
|
|
2534
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "http", existing.id);
|
|
2535
|
+
sendJson(res, 200, { deleted: true });
|
|
2536
|
+
});
|
|
2537
|
+
};
|
|
2538
|
+
|
|
2539
|
+
// ../daemon/src/api/routes/telegram.ts
|
|
2540
|
+
import { randomUUID as randomUUID6 } from "crypto";
|
|
2541
|
+
var buildTelegramCapabilityContent = (bot, connection) => [
|
|
2542
|
+
`# Telegram: ${bot.name}`,
|
|
2543
|
+
`Bot: @${bot.botUsername}`,
|
|
2544
|
+
`Chat ID: ${connection.chatId}`,
|
|
2545
|
+
`Connected to agent: ${connection.targetAgent}`
|
|
2546
|
+
].join("\n");
|
|
2547
|
+
var registerTelegramRoutes = (server, processManager, configStore, agentsDir) => {
|
|
2548
|
+
let encryptionKey = null;
|
|
2549
|
+
const getKey = () => {
|
|
2550
|
+
if (!encryptionKey) encryptionKey = getOrCreateKey2();
|
|
2551
|
+
return encryptionKey;
|
|
2552
|
+
};
|
|
2553
|
+
const syncTelegramRunner = () => {
|
|
2554
|
+
const proc = processManager.get("telegram");
|
|
2555
|
+
const bots = configStore.getTelegramBots();
|
|
2556
|
+
const connections = configStore.getTelegramConnections();
|
|
2557
|
+
const decryptedBots = bots.map((b) => ({
|
|
2558
|
+
...b,
|
|
2559
|
+
token: decrypt2(b.token, getKey())
|
|
2560
|
+
}));
|
|
2561
|
+
if (proc && proc.status === "running") {
|
|
2562
|
+
processManager.sendToChild("telegram", { type: "telegram:update-bots", bots: decryptedBots });
|
|
2563
|
+
processManager.sendToChild("telegram", { type: "telegram:update-connections", connections });
|
|
2564
|
+
} else if (bots.length > 0 && connections.length > 0) {
|
|
2565
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
2566
|
+
processManager.start("telegram", "helper", {
|
|
2567
|
+
id: "telegram",
|
|
2568
|
+
kind: "telegram",
|
|
2569
|
+
name: "Telegram Runner",
|
|
2570
|
+
config: { bots: decryptedBots, connections },
|
|
2571
|
+
autoStart: true,
|
|
2572
|
+
createdAt: now,
|
|
2573
|
+
updatedAt: now
|
|
2574
|
+
});
|
|
2575
|
+
console.log(`[telegram] Auto-started telegram-runner with ${bots.length} bot(s)`);
|
|
2576
|
+
}
|
|
2577
|
+
};
|
|
2578
|
+
server.route("GET", "/api/telegram/bots", async (_req, res) => {
|
|
2579
|
+
const bots = configStore.getTelegramBots().map((b) => ({
|
|
2580
|
+
...b,
|
|
2581
|
+
token: "***"
|
|
2582
|
+
}));
|
|
2583
|
+
sendJson(res, 200, { bots });
|
|
2584
|
+
});
|
|
2585
|
+
server.route("POST", "/api/telegram/bots", async (_req, res, _params, body) => {
|
|
2586
|
+
const input = body;
|
|
2587
|
+
if (!input?.name || !input?.token) {
|
|
2588
|
+
sendJson(res, 400, { error: "VALIDATION", message: "name and token are required", statusCode: 400 });
|
|
2589
|
+
return;
|
|
2590
|
+
}
|
|
2591
|
+
const client = createTelegramClient({ token: input.token });
|
|
2592
|
+
const result = await client.verify();
|
|
2593
|
+
if (!result.ok) {
|
|
2594
|
+
sendJson(res, 400, { error: "VERIFICATION_FAILED", message: `Token verification failed: ${result.error}`, statusCode: 400 });
|
|
2595
|
+
return;
|
|
2596
|
+
}
|
|
2597
|
+
const bot = {
|
|
2598
|
+
id: randomUUID6(),
|
|
2599
|
+
name: input.name,
|
|
2600
|
+
token: encrypt2(input.token, getKey()),
|
|
2601
|
+
botUsername: result.username,
|
|
2602
|
+
polling: true,
|
|
2603
|
+
webhookUrl: null,
|
|
2604
|
+
verified: true,
|
|
2605
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2606
|
+
};
|
|
2607
|
+
configStore.saveTelegramBot(bot);
|
|
2608
|
+
syncTelegramRunner();
|
|
2609
|
+
sendJson(res, 201, { ...bot, token: "***" });
|
|
2610
|
+
});
|
|
2611
|
+
server.route("GET", "/api/telegram/bots/:id", async (_req, res, params) => {
|
|
2612
|
+
const bot = configStore.getTelegramBot(params["id"]);
|
|
2613
|
+
if (!bot) {
|
|
2614
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Bot not found", statusCode: 404 });
|
|
2615
|
+
return;
|
|
2616
|
+
}
|
|
2617
|
+
sendJson(res, 200, { ...bot, token: "***" });
|
|
2618
|
+
});
|
|
2619
|
+
server.route("PUT", "/api/telegram/bots/:id", async (_req, res, params, body) => {
|
|
2620
|
+
const existing = configStore.getTelegramBot(params["id"]);
|
|
2621
|
+
if (!existing) {
|
|
2622
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Bot not found", statusCode: 404 });
|
|
2623
|
+
return;
|
|
2624
|
+
}
|
|
2625
|
+
const updates = body ?? {};
|
|
2626
|
+
const updated = {
|
|
2627
|
+
...existing,
|
|
2628
|
+
name: updates.name ?? existing.name,
|
|
2629
|
+
polling: updates.polling ?? existing.polling,
|
|
2630
|
+
webhookUrl: updates.webhookUrl !== void 0 ? updates.webhookUrl : existing.webhookUrl
|
|
2631
|
+
};
|
|
2632
|
+
configStore.saveTelegramBot(updated);
|
|
2633
|
+
syncTelegramRunner();
|
|
2634
|
+
sendJson(res, 200, { ...updated, token: "***" });
|
|
2635
|
+
});
|
|
2636
|
+
server.route("DELETE", "/api/telegram/bots/:id", async (_req, res, params) => {
|
|
2637
|
+
const bot = configStore.getTelegramBot(params["id"]);
|
|
2638
|
+
if (!bot) {
|
|
2639
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Bot not found", statusCode: 404 });
|
|
2640
|
+
return;
|
|
2641
|
+
}
|
|
2642
|
+
const connections = configStore.getTelegramConnectionsForBot(params["id"]);
|
|
2643
|
+
for (const conn of connections) {
|
|
2644
|
+
removeCapabilityFile(agentsDir, conn.targetAgent, "telegram", conn.id);
|
|
2645
|
+
}
|
|
2646
|
+
configStore.deleteTelegramBot(params["id"]);
|
|
2647
|
+
syncTelegramRunner();
|
|
2648
|
+
sendJson(res, 200, { deleted: true });
|
|
2649
|
+
});
|
|
2650
|
+
server.route("POST", "/api/telegram/bots/:id/verify", async (_req, res, params) => {
|
|
2651
|
+
const bot = configStore.getTelegramBot(params["id"]);
|
|
2652
|
+
if (!bot) {
|
|
2653
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Bot not found", statusCode: 404 });
|
|
2654
|
+
return;
|
|
2655
|
+
}
|
|
2656
|
+
const token = decrypt2(bot.token, getKey());
|
|
2657
|
+
const client = createTelegramClient({ token });
|
|
2658
|
+
const result = await client.verify();
|
|
2659
|
+
if (!result.ok) {
|
|
2660
|
+
bot.verified = false;
|
|
2661
|
+
configStore.saveTelegramBot(bot);
|
|
2662
|
+
sendJson(res, 200, { verified: false, error: result.error });
|
|
2663
|
+
return;
|
|
2664
|
+
}
|
|
2665
|
+
bot.verified = true;
|
|
2666
|
+
bot.botUsername = result.username;
|
|
2667
|
+
configStore.saveTelegramBot(bot);
|
|
2668
|
+
syncTelegramRunner();
|
|
2669
|
+
sendJson(res, 200, { verified: true, username: result.username });
|
|
2670
|
+
});
|
|
2671
|
+
server.route("GET", "/api/telegram/connections", async (_req, res) => {
|
|
2672
|
+
sendJson(res, 200, { connections: configStore.getTelegramConnections() });
|
|
2673
|
+
});
|
|
2674
|
+
server.route("POST", "/api/telegram/connections", async (_req, res, _params, body) => {
|
|
2675
|
+
const input = body;
|
|
2676
|
+
if (!input?.botId || !input?.targetAgent) {
|
|
2677
|
+
sendJson(res, 400, { error: "VALIDATION", message: "botId and targetAgent are required", statusCode: 400 });
|
|
2678
|
+
return;
|
|
2679
|
+
}
|
|
2680
|
+
if (!configStore.getTelegramBot(input.botId)) {
|
|
2681
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Bot not found", statusCode: 404 });
|
|
2682
|
+
return;
|
|
2683
|
+
}
|
|
2684
|
+
const connection = {
|
|
2685
|
+
id: randomUUID6(),
|
|
2686
|
+
botId: input.botId,
|
|
2687
|
+
targetAgent: input.targetAgent,
|
|
2688
|
+
chatId: input.chatId ?? "*",
|
|
2689
|
+
enabled: input.enabled !== false,
|
|
2690
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2691
|
+
};
|
|
2692
|
+
configStore.saveTelegramConnection(connection);
|
|
2693
|
+
const parentBot = configStore.getTelegramBot(input.botId);
|
|
2694
|
+
if (parentBot) {
|
|
2695
|
+
generateCapabilityFile(agentsDir, connection.targetAgent, "telegram", connection.id, buildTelegramCapabilityContent(parentBot, connection));
|
|
2696
|
+
}
|
|
2697
|
+
syncTelegramRunner();
|
|
2698
|
+
sendJson(res, 201, connection);
|
|
2699
|
+
});
|
|
2700
|
+
server.route("PUT", "/api/telegram/connections/:id", async (_req, res, params, body) => {
|
|
2701
|
+
const existing = configStore.getTelegramConnections().find((c) => c.id === params["id"]);
|
|
2702
|
+
if (!existing) {
|
|
2703
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
2704
|
+
return;
|
|
2705
|
+
}
|
|
2706
|
+
const updates = body ?? {};
|
|
2707
|
+
const updated = {
|
|
2708
|
+
...existing,
|
|
2709
|
+
targetAgent: updates.targetAgent ?? existing.targetAgent,
|
|
2710
|
+
chatId: updates.chatId ?? existing.chatId,
|
|
2711
|
+
enabled: updates.enabled ?? existing.enabled
|
|
2712
|
+
};
|
|
2713
|
+
configStore.saveTelegramConnection(updated);
|
|
2714
|
+
const parentBot = configStore.getTelegramBot(updated.botId);
|
|
2715
|
+
if (parentBot) {
|
|
2716
|
+
if (updates.targetAgent && updates.targetAgent !== existing.targetAgent) {
|
|
2717
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "telegram", existing.id);
|
|
2718
|
+
}
|
|
2719
|
+
generateCapabilityFile(agentsDir, updated.targetAgent, "telegram", updated.id, buildTelegramCapabilityContent(parentBot, updated));
|
|
2720
|
+
}
|
|
2721
|
+
syncTelegramRunner();
|
|
2722
|
+
sendJson(res, 200, updated);
|
|
2723
|
+
});
|
|
2724
|
+
server.route("DELETE", "/api/telegram/connections/:id", async (_req, res, params) => {
|
|
2725
|
+
const existing = configStore.getTelegramConnections().find((c) => c.id === params["id"]);
|
|
2726
|
+
if (!existing) {
|
|
2727
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
2728
|
+
return;
|
|
2729
|
+
}
|
|
2730
|
+
configStore.deleteTelegramConnection(params["id"]);
|
|
2731
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "telegram", existing.id);
|
|
2732
|
+
syncTelegramRunner();
|
|
2733
|
+
sendJson(res, 200, { deleted: true });
|
|
2734
|
+
});
|
|
2735
|
+
};
|
|
2736
|
+
|
|
2737
|
+
// ../daemon/src/api/routes/cron.ts
|
|
2738
|
+
import { randomUUID as randomUUID7 } from "crypto";
|
|
2739
|
+
var buildCronRunnerConfig = (configStore) => {
|
|
2740
|
+
const jobs = configStore.getCronJobs().filter((j) => j.enabled);
|
|
2741
|
+
const configs = [];
|
|
2742
|
+
for (const job of jobs) {
|
|
2743
|
+
const connections = configStore.getCronConnectionsForJob(job.id).filter((c) => c.enabled);
|
|
2744
|
+
for (const conn of connections) {
|
|
2745
|
+
configs.push({
|
|
2746
|
+
id: `${job.id}-${conn.id}`,
|
|
2747
|
+
name: job.name,
|
|
2748
|
+
schedule: job.schedule,
|
|
2749
|
+
command: conn.command ?? job.name,
|
|
2750
|
+
targetAgent: conn.targetAgent,
|
|
2751
|
+
enabled: true,
|
|
2752
|
+
createdAt: job.createdAt,
|
|
2753
|
+
updatedAt: job.createdAt
|
|
2754
|
+
});
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
return configs;
|
|
2758
|
+
};
|
|
2759
|
+
var syncCronRunner = (processManager, configStore) => {
|
|
2760
|
+
const allJobs = buildCronRunnerConfig(configStore);
|
|
2761
|
+
const cronProcess = processManager.get("cron");
|
|
2762
|
+
if (cronProcess && cronProcess.status === "running") {
|
|
2763
|
+
processManager.sendToChild("cron", { type: "cron:update-jobs", jobs: allJobs });
|
|
2764
|
+
} else if (allJobs.length > 0) {
|
|
2765
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
2766
|
+
processManager.start("cron", "helper", {
|
|
2767
|
+
id: "cron",
|
|
2768
|
+
kind: "cron",
|
|
2769
|
+
name: "Cron Runner",
|
|
2770
|
+
config: { cronJobs: allJobs },
|
|
2771
|
+
autoStart: true,
|
|
2772
|
+
createdAt: now,
|
|
2773
|
+
updatedAt: now
|
|
2774
|
+
});
|
|
2775
|
+
console.log(`[cron] Auto-started cron-runner with ${allJobs.length} job(s)`);
|
|
2776
|
+
}
|
|
2777
|
+
console.log(`[cron] Synced ${allJobs.length} cron job config(s)`);
|
|
2778
|
+
};
|
|
2779
|
+
var buildCronCapabilityContent = (job, connection) => [
|
|
2780
|
+
`# Cron: ${job.name}`,
|
|
2781
|
+
`Schedule: ${job.schedule}`,
|
|
2782
|
+
`Command: /${connection.command ?? job.name}`,
|
|
2783
|
+
`Connected to agent: ${connection.targetAgent}`
|
|
2784
|
+
].join("\n");
|
|
2785
|
+
var registerCronRoutes = (server, processManager, configStore, agentsDir) => {
|
|
2786
|
+
server.route("GET", "/api/cron/jobs", async (_req, res) => {
|
|
2787
|
+
sendJson(res, 200, { cronJobs: configStore.getCronJobs() });
|
|
2788
|
+
});
|
|
2789
|
+
server.route("POST", "/api/cron/jobs", async (_req, res, _params, body) => {
|
|
2790
|
+
const input = body;
|
|
2791
|
+
if (!input?.name || !input?.schedule) {
|
|
2792
|
+
sendJson(res, 400, { error: "VALIDATION", message: "name and schedule are required", statusCode: 400 });
|
|
2793
|
+
return;
|
|
2794
|
+
}
|
|
2795
|
+
const job = {
|
|
2796
|
+
id: randomUUID7(),
|
|
2797
|
+
name: input.name,
|
|
2798
|
+
schedule: input.schedule,
|
|
2799
|
+
enabled: true,
|
|
2800
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2801
|
+
};
|
|
2802
|
+
configStore.saveCronJob(job);
|
|
2803
|
+
syncCronRunner(processManager, configStore);
|
|
2804
|
+
sendJson(res, 201, job);
|
|
2805
|
+
});
|
|
2806
|
+
server.route("GET", "/api/cron/jobs/:id", async (_req, res, params) => {
|
|
2807
|
+
const job = configStore.getCronJob(params["id"]);
|
|
2808
|
+
if (!job) {
|
|
2809
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Cron job not found", statusCode: 404 });
|
|
2810
|
+
return;
|
|
2811
|
+
}
|
|
2812
|
+
sendJson(res, 200, job);
|
|
2813
|
+
});
|
|
2814
|
+
server.route("PUT", "/api/cron/jobs/:id", async (_req, res, params, body) => {
|
|
2815
|
+
const existing = configStore.getCronJob(params["id"]);
|
|
2816
|
+
if (!existing) {
|
|
2817
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Cron job not found", statusCode: 404 });
|
|
2818
|
+
return;
|
|
2819
|
+
}
|
|
2820
|
+
const updates = body ?? {};
|
|
2821
|
+
const updated = {
|
|
2822
|
+
...existing,
|
|
2823
|
+
name: updates.name ?? existing.name,
|
|
2824
|
+
schedule: updates.schedule ?? existing.schedule,
|
|
2825
|
+
enabled: updates.enabled ?? existing.enabled
|
|
2826
|
+
};
|
|
2827
|
+
configStore.saveCronJob(updated);
|
|
2828
|
+
syncCronRunner(processManager, configStore);
|
|
2829
|
+
sendJson(res, 200, updated);
|
|
2830
|
+
});
|
|
2831
|
+
server.route("DELETE", "/api/cron/jobs/:id", async (_req, res, params) => {
|
|
2832
|
+
const job = configStore.getCronJob(params["id"]);
|
|
2833
|
+
if (!job) {
|
|
2834
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Cron job not found", statusCode: 404 });
|
|
2835
|
+
return;
|
|
2836
|
+
}
|
|
2837
|
+
const connections = configStore.getCronConnectionsForJob(params["id"]);
|
|
2838
|
+
for (const conn of connections) {
|
|
2839
|
+
removeCapabilityFile(agentsDir, conn.targetAgent, "cron", conn.id);
|
|
2840
|
+
}
|
|
2841
|
+
configStore.deleteCronJob(params["id"]);
|
|
2842
|
+
syncCronRunner(processManager, configStore);
|
|
2843
|
+
sendJson(res, 200, { deleted: true });
|
|
2844
|
+
});
|
|
2845
|
+
server.route("GET", "/api/cron/connections", async (_req, res) => {
|
|
2846
|
+
sendJson(res, 200, { connections: configStore.getCronConnections() });
|
|
2847
|
+
});
|
|
2848
|
+
server.route("POST", "/api/cron/connections", async (_req, res, _params, body) => {
|
|
2849
|
+
const input = body;
|
|
2850
|
+
if (!input?.cronJobId || !input?.targetAgent || !input?.command) {
|
|
2851
|
+
sendJson(res, 400, { error: "VALIDATION", message: "cronJobId, targetAgent, and command are required", statusCode: 400 });
|
|
2852
|
+
return;
|
|
2853
|
+
}
|
|
2854
|
+
if (!configStore.getCronJob(input.cronJobId)) {
|
|
2855
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Cron job not found", statusCode: 404 });
|
|
2856
|
+
return;
|
|
2857
|
+
}
|
|
2858
|
+
const connection = {
|
|
2859
|
+
id: randomUUID7(),
|
|
2860
|
+
cronJobId: input.cronJobId,
|
|
2861
|
+
targetAgent: input.targetAgent,
|
|
2862
|
+
command: input.command,
|
|
2863
|
+
enabled: true,
|
|
2864
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2865
|
+
};
|
|
2866
|
+
configStore.saveCronConnection(connection);
|
|
2867
|
+
const parentJob = configStore.getCronJob(input.cronJobId);
|
|
2868
|
+
if (parentJob) {
|
|
2869
|
+
generateCapabilityFile(agentsDir, connection.targetAgent, "cron", connection.id, buildCronCapabilityContent(parentJob, connection));
|
|
2870
|
+
}
|
|
2871
|
+
syncCronRunner(processManager, configStore);
|
|
2872
|
+
sendJson(res, 201, connection);
|
|
2873
|
+
});
|
|
2874
|
+
server.route("PUT", "/api/cron/connections/:id", async (_req, res, params, body) => {
|
|
2875
|
+
const existing = configStore.getCronConnections().find((c) => c.id === params["id"]);
|
|
2876
|
+
if (!existing) {
|
|
2877
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
2878
|
+
return;
|
|
2879
|
+
}
|
|
2880
|
+
const updates = body ?? {};
|
|
2881
|
+
const updated = {
|
|
2882
|
+
...existing,
|
|
2883
|
+
targetAgent: updates.targetAgent ?? existing.targetAgent,
|
|
2884
|
+
command: updates.command !== void 0 ? updates.command : existing.command,
|
|
2885
|
+
enabled: updates.enabled ?? existing.enabled
|
|
2886
|
+
};
|
|
2887
|
+
configStore.saveCronConnection(updated);
|
|
2888
|
+
const parentJob = configStore.getCronJob(updated.cronJobId);
|
|
2889
|
+
if (parentJob) {
|
|
2890
|
+
if (updates.targetAgent && updates.targetAgent !== existing.targetAgent) {
|
|
2891
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "cron", existing.id);
|
|
2892
|
+
}
|
|
2893
|
+
generateCapabilityFile(agentsDir, updated.targetAgent, "cron", updated.id, buildCronCapabilityContent(parentJob, updated));
|
|
2894
|
+
}
|
|
2895
|
+
syncCronRunner(processManager, configStore);
|
|
2896
|
+
sendJson(res, 200, updated);
|
|
2897
|
+
});
|
|
2898
|
+
server.route("DELETE", "/api/cron/connections/:id", async (_req, res, params) => {
|
|
2899
|
+
const existing = configStore.getCronConnections().find((c) => c.id === params["id"]);
|
|
2900
|
+
if (!existing) {
|
|
2901
|
+
sendJson(res, 404, { error: "NOT_FOUND", message: "Connection not found", statusCode: 404 });
|
|
2902
|
+
return;
|
|
2903
|
+
}
|
|
2904
|
+
configStore.deleteCronConnection(params["id"]);
|
|
2905
|
+
removeCapabilityFile(agentsDir, existing.targetAgent, "cron", existing.id);
|
|
2906
|
+
syncCronRunner(processManager, configStore);
|
|
2907
|
+
sendJson(res, 200, { deleted: true });
|
|
2908
|
+
});
|
|
2909
|
+
};
|
|
2910
|
+
|
|
2911
|
+
// ../daemon/src/paths.ts
|
|
2912
|
+
import { resolve as resolve6, dirname as dirname3 } from "path";
|
|
2913
|
+
import { fileURLToPath } from "url";
|
|
2914
|
+
import { homedir as homedir3 } from "os";
|
|
2915
|
+
var __dirname = dirname3(fileURLToPath(import.meta.url));
|
|
2916
|
+
var detectMode = () => {
|
|
2917
|
+
if (process.env["KINDFLOW_DEV"] === "1") return "dev";
|
|
2918
|
+
if (import.meta.url.endsWith(".ts")) return "dev";
|
|
2919
|
+
return "cli";
|
|
2920
|
+
};
|
|
2921
|
+
var devPaths = () => {
|
|
2922
|
+
const repoRoot = resolve6(__dirname, "../../..");
|
|
2923
|
+
return {
|
|
2924
|
+
agentsDir: resolve6(repoRoot, "apps"),
|
|
2925
|
+
templateDir: resolve6(repoRoot, "templates/agent"),
|
|
2926
|
+
dataDir: process.env["KINDFLOW_DATA_DIR"] ?? resolve6(homedir3(), ".kindflow"),
|
|
2927
|
+
runnersDir: resolve6(repoRoot, "packages"),
|
|
2928
|
+
webDir: null
|
|
2929
|
+
};
|
|
2930
|
+
};
|
|
2931
|
+
var cliPaths = () => {
|
|
2932
|
+
const dataDir = process.env["KINDFLOW_DATA_DIR"] ?? resolve6(homedir3(), ".kindflow");
|
|
2933
|
+
return {
|
|
2934
|
+
agentsDir: resolve6(dataDir, "agents"),
|
|
2935
|
+
templateDir: resolve6(__dirname, "templates/agent"),
|
|
2936
|
+
dataDir,
|
|
2937
|
+
runnersDir: __dirname,
|
|
2938
|
+
webDir: resolve6(__dirname, "web")
|
|
2939
|
+
};
|
|
2940
|
+
};
|
|
2941
|
+
var resolvePaths = (overrides) => {
|
|
2942
|
+
const mode = detectMode();
|
|
2943
|
+
const base = mode === "dev" ? devPaths() : cliPaths();
|
|
2944
|
+
return { ...base, ...overrides };
|
|
2945
|
+
};
|
|
2946
|
+
|
|
2947
|
+
// ../daemon/src/daemon.ts
|
|
2948
|
+
var DEFAULT_PORT = 7777;
|
|
2949
|
+
var DEFAULT_WEB_PORT = 7001;
|
|
2950
|
+
var HUB_ID = "kindflow-hub";
|
|
2951
|
+
var startDaemon = async (options) => {
|
|
2952
|
+
const paths = resolvePaths(options?.paths);
|
|
2953
|
+
console.log("[daemon] Starting Kindflow daemon...");
|
|
2954
|
+
console.log(`[daemon] Agents dir: ${paths.agentsDir}`);
|
|
2955
|
+
console.log(`[daemon] Data dir: ${paths.dataDir}`);
|
|
2956
|
+
console.log(`[daemon] Runners dir: ${paths.runnersDir}`);
|
|
2957
|
+
const configStore = await createConfigStore(paths.dataDir);
|
|
2958
|
+
console.log("[daemon] Config store initialized");
|
|
2959
|
+
const configPort = parseInt(configStore.getSetting("daemon.port") ?? "", 10);
|
|
2960
|
+
const configWebPort = parseInt(configStore.getSetting("web.port") ?? "", 10);
|
|
2961
|
+
const port = options?.port ?? (configPort || DEFAULT_PORT);
|
|
2962
|
+
const webPort = options?.webPort ?? (configWebPort || DEFAULT_WEB_PORT);
|
|
2963
|
+
const apiServer = createApiServer();
|
|
2964
|
+
const ipcHub = createIpcHub({
|
|
2965
|
+
id: HUB_ID,
|
|
2966
|
+
onMessage: (msg) => {
|
|
2967
|
+
if (msg.to !== "*") {
|
|
2968
|
+
ipcHub.sendTo(msg.to, msg);
|
|
2969
|
+
} else {
|
|
2970
|
+
ipcHub.broadcast(msg);
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
});
|
|
2974
|
+
await ipcHub.start();
|
|
2975
|
+
console.log("[daemon] IPC hub started");
|
|
2976
|
+
const processManager = createProcessManager({
|
|
2977
|
+
hubId: HUB_ID,
|
|
2978
|
+
runnersDir: paths.runnersDir,
|
|
2979
|
+
isDev: detectMode() === "dev",
|
|
2980
|
+
callbacks: {
|
|
2981
|
+
onStatusChange: (id, status, pid) => {
|
|
2982
|
+
apiServer.broadcast({ type: "process:status", id, status, pid });
|
|
2983
|
+
},
|
|
2984
|
+
onLog: (id, stream, data) => {
|
|
2985
|
+
apiServer.broadcast({ type: "process:log", id, stream, data });
|
|
2986
|
+
},
|
|
2987
|
+
onSdkMessage: (id, message) => {
|
|
2988
|
+
apiServer.broadcast({ type: "process:log", id, stream: "stdout", data: JSON.stringify(message) });
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
});
|
|
2992
|
+
console.log("[daemon] Process manager initialized");
|
|
2993
|
+
const terminalManager = createTerminalManager({
|
|
2994
|
+
callbacks: {
|
|
2995
|
+
onOutput: (sessionId, data) => {
|
|
2996
|
+
apiServer.broadcast({ type: "terminal:output", sessionId, data });
|
|
2997
|
+
},
|
|
2998
|
+
onClose: (sessionId) => {
|
|
2999
|
+
apiServer.broadcast({ type: "terminal:closed", sessionId });
|
|
3000
|
+
}
|
|
3001
|
+
}
|
|
3002
|
+
});
|
|
3003
|
+
console.log("[daemon] Terminal manager initialized");
|
|
3004
|
+
registerAgentRoutes(apiServer, processManager, terminalManager, paths.agentsDir, paths.templateDir, configStore);
|
|
3005
|
+
registerProcessRoutes(apiServer, processManager, configStore, paths.agentsDir);
|
|
3006
|
+
registerS3Routes(apiServer, configStore, paths.agentsDir);
|
|
3007
|
+
registerEmailRoutes(apiServer, processManager, configStore, port, paths.agentsDir);
|
|
3008
|
+
registerDatabaseRoutes(apiServer, configStore, paths.agentsDir);
|
|
3009
|
+
registerHttpRoutes(apiServer, processManager, ipcHub, configStore, paths.agentsDir);
|
|
3010
|
+
registerTelegramRoutes(apiServer, processManager, configStore, paths.agentsDir);
|
|
3011
|
+
registerCronRoutes(apiServer, processManager, configStore, paths.agentsDir);
|
|
3012
|
+
apiServer.onWsCommand((_ws, command) => {
|
|
3013
|
+
switch (command.type) {
|
|
3014
|
+
case "terminal:ready":
|
|
3015
|
+
terminalManager.flush(command.sessionId);
|
|
3016
|
+
break;
|
|
3017
|
+
case "terminal:input":
|
|
3018
|
+
terminalManager.write(command.sessionId, command.data);
|
|
3019
|
+
break;
|
|
3020
|
+
case "terminal:resize":
|
|
3021
|
+
terminalManager.resize(command.sessionId, command.cols, command.rows);
|
|
3022
|
+
break;
|
|
3023
|
+
}
|
|
3024
|
+
});
|
|
3025
|
+
await apiServer.listen(port);
|
|
3026
|
+
const allAgents = scanAgents(paths.agentsDir);
|
|
3027
|
+
const agents = allAgents.filter((a) => a.config.autoStart);
|
|
3028
|
+
const helpers = configStore.getHelpers().filter((h) => h.autoStart);
|
|
3029
|
+
for (const agent of agents) {
|
|
3030
|
+
console.log(`[daemon] Auto-starting agent: ${agent.config.name}`);
|
|
3031
|
+
processManager.start(agent.id, "agent", agent);
|
|
3032
|
+
}
|
|
3033
|
+
for (const helper of helpers) {
|
|
3034
|
+
console.log(`[daemon] Auto-starting helper: ${helper.name}`);
|
|
3035
|
+
processManager.start(helper.id, "helper", helper);
|
|
3036
|
+
}
|
|
3037
|
+
console.log(`[daemon] Discovered ${allAgents.length} agent(s), auto-started ${agents.length}`);
|
|
3038
|
+
const emailAccounts = configStore.getEmailAccounts();
|
|
3039
|
+
const oauthCreds = configStore.getOAuthCredentials("gmail");
|
|
3040
|
+
if (emailAccounts.length > 0 && oauthCreds && !processManager.get("email-imap")) {
|
|
3041
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3042
|
+
const imapHelper = {
|
|
3043
|
+
id: "email-imap",
|
|
3044
|
+
kind: "email-imap",
|
|
3045
|
+
name: "Email IMAP Watcher",
|
|
3046
|
+
config: {
|
|
3047
|
+
accounts: emailAccounts,
|
|
3048
|
+
connections: configStore.getEmailConnections(),
|
|
3049
|
+
oauthCredentials: oauthCreds
|
|
3050
|
+
},
|
|
3051
|
+
autoStart: true,
|
|
3052
|
+
createdAt: now,
|
|
3053
|
+
updatedAt: now
|
|
3054
|
+
};
|
|
3055
|
+
configStore.saveHelper(imapHelper);
|
|
3056
|
+
console.log(`[daemon] Auto-starting email-imap helper (${emailAccounts.length} account(s))`);
|
|
3057
|
+
processManager.start("email-imap", "helper", imapHelper);
|
|
3058
|
+
}
|
|
3059
|
+
const telegramBots = configStore.getTelegramBots();
|
|
3060
|
+
const telegramConns = configStore.getTelegramConnections();
|
|
3061
|
+
if (telegramBots.length > 0 && telegramConns.length > 0 && !processManager.get("telegram")) {
|
|
3062
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3063
|
+
const telegramEncKey = getOrCreateKey2();
|
|
3064
|
+
const decryptedBots = telegramBots.map((b) => ({
|
|
3065
|
+
...b,
|
|
3066
|
+
token: decrypt2(b.token, telegramEncKey)
|
|
3067
|
+
}));
|
|
3068
|
+
const telegramHelper = {
|
|
3069
|
+
id: "telegram",
|
|
3070
|
+
kind: "telegram",
|
|
3071
|
+
name: "Telegram Bot Runner",
|
|
3072
|
+
config: {
|
|
3073
|
+
bots: decryptedBots,
|
|
3074
|
+
connections: telegramConns
|
|
3075
|
+
},
|
|
3076
|
+
autoStart: true,
|
|
3077
|
+
createdAt: now,
|
|
3078
|
+
updatedAt: now
|
|
3079
|
+
};
|
|
3080
|
+
configStore.saveHelper(telegramHelper);
|
|
3081
|
+
console.log(`[daemon] Auto-starting telegram helper (${telegramBots.length} bot(s), ${telegramConns.length} connection(s))`);
|
|
3082
|
+
processManager.start("telegram", "helper", telegramHelper);
|
|
3083
|
+
}
|
|
3084
|
+
const cronRunnerJobs = buildCronRunnerConfig(configStore);
|
|
3085
|
+
if (cronRunnerJobs.length > 0 && !processManager.get("cron")) {
|
|
3086
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3087
|
+
const cronHelper = {
|
|
3088
|
+
id: "cron",
|
|
3089
|
+
kind: "cron",
|
|
3090
|
+
name: "Cron Runner",
|
|
3091
|
+
config: { cronJobs: cronRunnerJobs },
|
|
3092
|
+
autoStart: true,
|
|
3093
|
+
createdAt: now,
|
|
3094
|
+
updatedAt: now
|
|
3095
|
+
};
|
|
3096
|
+
configStore.saveHelper(cronHelper);
|
|
3097
|
+
console.log(`[daemon] Auto-starting cron-runner (${cronRunnerJobs.length} job config(s))`);
|
|
3098
|
+
processManager.start("cron", "helper", cronHelper);
|
|
3099
|
+
}
|
|
3100
|
+
let webServer = null;
|
|
3101
|
+
if (paths.webDir) {
|
|
3102
|
+
webServer = createWebServer({ port: webPort, webAppDir: paths.webDir });
|
|
3103
|
+
try {
|
|
3104
|
+
await webServer.start();
|
|
3105
|
+
console.log(`[daemon] Web UI: http://localhost:${webPort}`);
|
|
3106
|
+
} catch (err) {
|
|
3107
|
+
console.error(`[daemon] Failed to start web UI: ${err instanceof Error ? err.message : err}`);
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
console.log(`[daemon] API: http://localhost:${port}`);
|
|
3111
|
+
const shutdown = async () => {
|
|
3112
|
+
console.log("[daemon] Shutting down...");
|
|
3113
|
+
webServer?.stop();
|
|
3114
|
+
terminalManager.closeAll();
|
|
3115
|
+
await processManager.shutdownAll();
|
|
3116
|
+
ipcHub.stop();
|
|
3117
|
+
await apiServer.close();
|
|
3118
|
+
configStore.close();
|
|
3119
|
+
console.log("[daemon] Shutdown complete");
|
|
3120
|
+
};
|
|
3121
|
+
return { configStore, processManager, terminalManager, ipcHub, apiServer, webServer, shutdown };
|
|
3122
|
+
};
|
|
3123
|
+
|
|
3124
|
+
export {
|
|
3125
|
+
generateSlug,
|
|
3126
|
+
scanAgents,
|
|
3127
|
+
createAgentFromTemplate,
|
|
3128
|
+
detectMode,
|
|
3129
|
+
devPaths,
|
|
3130
|
+
cliPaths,
|
|
3131
|
+
resolvePaths,
|
|
3132
|
+
startDaemon
|
|
3133
|
+
};
|
|
3134
|
+
//# sourceMappingURL=chunk-UGIMNC7O.js.map
|