@vibedeckx/linux-x64 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-provider.d.ts +92 -0
- package/dist/agent-provider.js +8 -0
- package/dist/agent-session-manager.d.ts +165 -0
- package/dist/agent-session-manager.js +985 -0
- package/dist/agent-types.d.ts +148 -0
- package/dist/agent-types.js +4 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +4 -0
- package/dist/browser-manager.d.ts +46 -0
- package/dist/browser-manager.js +182 -0
- package/dist/chat-session-manager.d.ts +101 -0
- package/dist/chat-session-manager.js +1425 -0
- package/dist/command.d.ts +1 -0
- package/dist/command.js +163 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.js +5 -0
- package/dist/conversation-patch.d.ts +103 -0
- package/dist/conversation-patch.js +69 -0
- package/dist/dialog.d.ts +1 -0
- package/dist/dialog.js +41 -0
- package/dist/entry-index-provider.d.ts +74 -0
- package/dist/entry-index-provider.js +105 -0
- package/dist/event-bus.d.ts +47 -0
- package/dist/event-bus.js +16 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/plugins/shared-services.d.ts +8 -0
- package/dist/plugins/shared-services.js +65 -0
- package/dist/process-manager.d.ts +146 -0
- package/dist/process-manager.js +779 -0
- package/dist/providers/claude-code-provider.d.ts +13 -0
- package/dist/providers/claude-code-provider.js +127 -0
- package/dist/providers/codex-provider.d.ts +41 -0
- package/dist/providers/codex-provider.js +354 -0
- package/dist/providers/index.d.ts +5 -0
- package/dist/providers/index.js +19 -0
- package/dist/remote-patch-cache.d.ts +67 -0
- package/dist/remote-patch-cache.js +190 -0
- package/dist/reverse-connect-client.d.ts +27 -0
- package/dist/reverse-connect-client.js +255 -0
- package/dist/reverse-connect-manager.d.ts +31 -0
- package/dist/reverse-connect-manager.js +287 -0
- package/dist/reverse-connect-types.d.ts +55 -0
- package/dist/reverse-connect-types.js +7 -0
- package/dist/routes/agent-session-routes.d.ts +4 -0
- package/dist/routes/agent-session-routes.js +442 -0
- package/dist/routes/browser-proxy-routes.d.ts +25 -0
- package/dist/routes/browser-proxy-routes.js +421 -0
- package/dist/routes/browser-routes.d.ts +4 -0
- package/dist/routes/browser-routes.js +73 -0
- package/dist/routes/chat-session-routes.d.ts +7 -0
- package/dist/routes/chat-session-routes.js +69 -0
- package/dist/routes/diff-routes.d.ts +4 -0
- package/dist/routes/diff-routes.js +208 -0
- package/dist/routes/event-routes.d.ts +4 -0
- package/dist/routes/event-routes.js +52 -0
- package/dist/routes/executor-group-routes.d.ts +4 -0
- package/dist/routes/executor-group-routes.js +76 -0
- package/dist/routes/executor-routes.d.ts +4 -0
- package/dist/routes/executor-routes.js +106 -0
- package/dist/routes/file-routes.d.ts +4 -0
- package/dist/routes/file-routes.js +331 -0
- package/dist/routes/process-routes.d.ts +4 -0
- package/dist/routes/process-routes.js +183 -0
- package/dist/routes/project-remote-routes.d.ts +4 -0
- package/dist/routes/project-remote-routes.js +82 -0
- package/dist/routes/project-routes.d.ts +4 -0
- package/dist/routes/project-routes.js +286 -0
- package/dist/routes/remote-routes.d.ts +4 -0
- package/dist/routes/remote-routes.js +59 -0
- package/dist/routes/remote-server-routes.d.ts +4 -0
- package/dist/routes/remote-server-routes.js +157 -0
- package/dist/routes/reverse-connect-routes.d.ts +4 -0
- package/dist/routes/reverse-connect-routes.js +33 -0
- package/dist/routes/settings-routes.d.ts +4 -0
- package/dist/routes/settings-routes.js +129 -0
- package/dist/routes/task-routes.d.ts +4 -0
- package/dist/routes/task-routes.js +107 -0
- package/dist/routes/terminal-routes.d.ts +4 -0
- package/dist/routes/terminal-routes.js +187 -0
- package/dist/routes/translate-routes.d.ts +4 -0
- package/dist/routes/translate-routes.js +38 -0
- package/dist/routes/websocket-routes.d.ts +4 -0
- package/dist/routes/websocket-routes.js +604 -0
- package/dist/routes/worktree-routes.d.ts +4 -0
- package/dist/routes/worktree-routes.js +511 -0
- package/dist/server-types.d.ts +41 -0
- package/dist/server-types.js +1 -0
- package/dist/server.d.ts +23 -0
- package/dist/server.js +238 -0
- package/dist/storage/sqlite.d.ts +2 -0
- package/dist/storage/sqlite.js +1073 -0
- package/dist/storage/types.d.ts +281 -0
- package/dist/storage/types.js +1 -0
- package/dist/ui/404/index.html +1 -0
- package/dist/ui/404.html +1 -0
- package/dist/ui/__next.__PAGE__.txt +10 -0
- package/dist/ui/__next._full.txt +25 -0
- package/dist/ui/__next._head.txt +6 -0
- package/dist/ui/__next._index.txt +9 -0
- package/dist/ui/__next._tree.txt +6 -0
- package/dist/ui/_next/static/7vIIuOQPJu8rdb6uAhwtg/_buildManifest.js +11 -0
- package/dist/ui/_next/static/7vIIuOQPJu8rdb6uAhwtg/_clientMiddlewareManifest.json +1 -0
- package/dist/ui/_next/static/7vIIuOQPJu8rdb6uAhwtg/_ssgManifest.js +1 -0
- package/dist/ui/_next/static/chunks/002f5a047b8d07d4.js +1 -0
- package/dist/ui/_next/static/chunks/01178e167ba3e5b4.js +1 -0
- package/dist/ui/_next/static/chunks/020d675d21be28d4.js +1 -0
- package/dist/ui/_next/static/chunks/024926197424b4a5.js +1 -0
- package/dist/ui/_next/static/chunks/02c93f6ca211a65d.js +1 -0
- package/dist/ui/_next/static/chunks/0364437dee56dc96.js +1 -0
- package/dist/ui/_next/static/chunks/03fc6b527b16efdc.js +1 -0
- package/dist/ui/_next/static/chunks/04f9a7932751cf2d.js +1 -0
- package/dist/ui/_next/static/chunks/0624b8204e5ae457.js +136 -0
- package/dist/ui/_next/static/chunks/067d8978cf41b901.js +1 -0
- package/dist/ui/_next/static/chunks/06d96238e85cdbb3.js +1 -0
- package/dist/ui/_next/static/chunks/071b9575dbdf1dcb.js +1 -0
- package/dist/ui/_next/static/chunks/073d5b9dc87ceab0.js +1 -0
- package/dist/ui/_next/static/chunks/0876a7111934d6f7.js +1 -0
- package/dist/ui/_next/static/chunks/08ffc3bf406c665d.js +1 -0
- package/dist/ui/_next/static/chunks/0969e8274c92c2d8.js +1 -0
- package/dist/ui/_next/static/chunks/0a3f62f00d7bec78.js +1 -0
- package/dist/ui/_next/static/chunks/0b80166023d89049.js +5 -0
- package/dist/ui/_next/static/chunks/0c2a941e61c395b6.js +1 -0
- package/dist/ui/_next/static/chunks/0c5eac8493334420.js +1 -0
- package/dist/ui/_next/static/chunks/0cc61d37b2333469.js +1 -0
- package/dist/ui/_next/static/chunks/0d440843348b2871.js +1 -0
- package/dist/ui/_next/static/chunks/0da3d15845f17208.js +1 -0
- package/dist/ui/_next/static/chunks/0e1982b1a6cbd127.js +53 -0
- package/dist/ui/_next/static/chunks/0e81d5bc1c725b75.js +1 -0
- package/dist/ui/_next/static/chunks/0e862e51b01e904b.js +63 -0
- package/dist/ui/_next/static/chunks/0ed7b6d86744b723.js +1 -0
- package/dist/ui/_next/static/chunks/0f0b3025f4e268b1.js +1 -0
- package/dist/ui/_next/static/chunks/10a30eb52825da36.js +1 -0
- package/dist/ui/_next/static/chunks/10c48da576fd8eef.js +1 -0
- package/dist/ui/_next/static/chunks/133e9f1435ca5f45.js +29 -0
- package/dist/ui/_next/static/chunks/16f4db3a54f167fd.js +1 -0
- package/dist/ui/_next/static/chunks/1988e3ecf5ad06d3.js +1 -0
- package/dist/ui/_next/static/chunks/1acfae010fd77014.js +152 -0
- package/dist/ui/_next/static/chunks/1ae53c2f1fff8cc2.js +1 -0
- package/dist/ui/_next/static/chunks/1af4fbc6c1256fae.js +1 -0
- package/dist/ui/_next/static/chunks/1b758c732032b236.js +1 -0
- package/dist/ui/_next/static/chunks/1ba26455a9f70c08.js +1 -0
- package/dist/ui/_next/static/chunks/1d22644cb4049d6b.css +1 -0
- package/dist/ui/_next/static/chunks/1d241f3b57c14cf7.js +1 -0
- package/dist/ui/_next/static/chunks/1d640bbe1c2c7869.js +1 -0
- package/dist/ui/_next/static/chunks/1da6354c9cb6f0de.js +1 -0
- package/dist/ui/_next/static/chunks/1dcd49914412f67b.js +1 -0
- package/dist/ui/_next/static/chunks/1e3b3771294825a4.js +1 -0
- package/dist/ui/_next/static/chunks/1eaa8ad7eca7f957.js +1 -0
- package/dist/ui/_next/static/chunks/1ebc88f60cadb128.js +1 -0
- package/dist/ui/_next/static/chunks/1ecb57b258088259.js +1 -0
- package/dist/ui/_next/static/chunks/1f5ba6b80fe19200.js +1 -0
- package/dist/ui/_next/static/chunks/20a5531534828366.js +1 -0
- package/dist/ui/_next/static/chunks/20b511fc299dfe9a.js +1 -0
- package/dist/ui/_next/static/chunks/20bff4eb9a0a6872.css +1 -0
- package/dist/ui/_next/static/chunks/219b7d9e437c6bd8.js +15 -0
- package/dist/ui/_next/static/chunks/21b32f530e0df2c5.js +1 -0
- package/dist/ui/_next/static/chunks/21fc6dc60e7647b1.js +1 -0
- package/dist/ui/_next/static/chunks/221a27e65aa5fbfd.js +1 -0
- package/dist/ui/_next/static/chunks/23a1e247c32bcc61.js +93 -0
- package/dist/ui/_next/static/chunks/2473c16c0c2f6b5f.css +2 -0
- package/dist/ui/_next/static/chunks/2615c71c0f8fe9bd.js +1 -0
- package/dist/ui/_next/static/chunks/263327288d5e2703.js +1 -0
- package/dist/ui/_next/static/chunks/2663fbaf43239e38.js +1 -0
- package/dist/ui/_next/static/chunks/27332c590d59f4e5.js +1 -0
- package/dist/ui/_next/static/chunks/27ca4a4e8191093f.js +1 -0
- package/dist/ui/_next/static/chunks/29b7618dcaa8edba.js +1 -0
- package/dist/ui/_next/static/chunks/2ba1d2b55b82f4da.js +21 -0
- package/dist/ui/_next/static/chunks/2cb23686e72468c8.js +1 -0
- package/dist/ui/_next/static/chunks/2d46f05dcbf1cbc2.js +1 -0
- package/dist/ui/_next/static/chunks/2d4c0fd06ca34510.js +2 -0
- package/dist/ui/_next/static/chunks/2f3d1d07474b8f79.js +1 -0
- package/dist/ui/_next/static/chunks/2f85c2849249a0dd.js +1 -0
- package/dist/ui/_next/static/chunks/3001d378f166eec9.js +1 -0
- package/dist/ui/_next/static/chunks/3018714f3827e360.js +1 -0
- package/dist/ui/_next/static/chunks/301cc25e0d489351.js +1 -0
- package/dist/ui/_next/static/chunks/305242b22ba8b49b.js +1 -0
- package/dist/ui/_next/static/chunks/3067c6e369066bd6.js +1 -0
- package/dist/ui/_next/static/chunks/311a77c9d5cb9de9.js +1 -0
- package/dist/ui/_next/static/chunks/320c001380e81470.js +1 -0
- package/dist/ui/_next/static/chunks/329db6c551df0faf.js +1 -0
- package/dist/ui/_next/static/chunks/33da178724072b3d.js +1 -0
- package/dist/ui/_next/static/chunks/33e8248c9296537a.js +1 -0
- package/dist/ui/_next/static/chunks/35a9992a8958f93b.js +1 -0
- package/dist/ui/_next/static/chunks/35bb90cf09892b72.js +1 -0
- package/dist/ui/_next/static/chunks/379f91b92366dc15.js +1 -0
- package/dist/ui/_next/static/chunks/391f22359769763f.js +1 -0
- package/dist/ui/_next/static/chunks/39231cb1044f7823.js +1 -0
- package/dist/ui/_next/static/chunks/394e8b7a1c2c58c6.js +1 -0
- package/dist/ui/_next/static/chunks/3a2cfdeb5f76ebd2.js +1 -0
- package/dist/ui/_next/static/chunks/3a3bd015fd042386.js +1 -0
- package/dist/ui/_next/static/chunks/3ad1bee238af9b5a.js +1 -0
- package/dist/ui/_next/static/chunks/3b2b2f7a9b7b130d.js +1 -0
- package/dist/ui/_next/static/chunks/3b586f80547e3a22.js +1 -0
- package/dist/ui/_next/static/chunks/3ca412e72bd3707a.js +1 -0
- package/dist/ui/_next/static/chunks/3cbb3bdceb4230af.js +1 -0
- package/dist/ui/_next/static/chunks/3ed1465109fecc2d.js +1 -0
- package/dist/ui/_next/static/chunks/3fd0801238b3b099.js +1 -0
- package/dist/ui/_next/static/chunks/401df66bd5da2115.js +15 -0
- package/dist/ui/_next/static/chunks/4211f4efe510f7ac.js +1 -0
- package/dist/ui/_next/static/chunks/43085364d0a41d1d.js +1 -0
- package/dist/ui/_next/static/chunks/4310c821dbee7a16.js +1 -0
- package/dist/ui/_next/static/chunks/46382f31f63e59cf.js +1 -0
- package/dist/ui/_next/static/chunks/468836b90ddf24d6.js +1 -0
- package/dist/ui/_next/static/chunks/470d091143104517.js +1 -0
- package/dist/ui/_next/static/chunks/4712e4f7e6b6ddc1.js +1 -0
- package/dist/ui/_next/static/chunks/4899f1e3f21c077e.js +1 -0
- package/dist/ui/_next/static/chunks/492ce6930bf61811.js +1 -0
- package/dist/ui/_next/static/chunks/494485a20952ffa3.js +1 -0
- package/dist/ui/_next/static/chunks/49535db309898f43.js +1 -0
- package/dist/ui/_next/static/chunks/4b8d2612d69e2013.js +1 -0
- package/dist/ui/_next/static/chunks/4c4a0f67891826a3.js +1 -0
- package/dist/ui/_next/static/chunks/4cc11ce32f4453b0.js +1 -0
- package/dist/ui/_next/static/chunks/4d03a0bc963fc3d4.js +1 -0
- package/dist/ui/_next/static/chunks/4d603a66c067134e.js +1 -0
- package/dist/ui/_next/static/chunks/4d8d7e62c2743f71.js +15 -0
- package/dist/ui/_next/static/chunks/4da42f10a5460b36.js +1 -0
- package/dist/ui/_next/static/chunks/4e832ffb65e75807.js +1 -0
- package/dist/ui/_next/static/chunks/4e954e1cec89a9ea.js +1 -0
- package/dist/ui/_next/static/chunks/4f2bc7a7a6b05a8b.js +55 -0
- package/dist/ui/_next/static/chunks/4f9c934abf34ceb9.js +1 -0
- package/dist/ui/_next/static/chunks/4fa248b0d2586928.js +1 -0
- package/dist/ui/_next/static/chunks/4fafbac2156844ca.js +1 -0
- package/dist/ui/_next/static/chunks/502039e483cc5e48.js +1 -0
- package/dist/ui/_next/static/chunks/509c91c38224448a.js +1 -0
- package/dist/ui/_next/static/chunks/5159d6f8d4307f36.js +1 -0
- package/dist/ui/_next/static/chunks/5179ab56aaaed42d.js +1 -0
- package/dist/ui/_next/static/chunks/5269ea07faff562d.js +1 -0
- package/dist/ui/_next/static/chunks/529f3f0f7d42444a.js +1 -0
- package/dist/ui/_next/static/chunks/5317db6783ee8dc9.js +1 -0
- package/dist/ui/_next/static/chunks/53a7b7c0ab020902.js +1 -0
- package/dist/ui/_next/static/chunks/544869c670c1dd8e.js +1 -0
- package/dist/ui/_next/static/chunks/547c0db6a433370e.js +1 -0
- package/dist/ui/_next/static/chunks/54d5670f5fa2abbe.css +1 -0
- package/dist/ui/_next/static/chunks/55761e35a8946a1d.js +15 -0
- package/dist/ui/_next/static/chunks/558f73c16b7ff14f.js +1 -0
- package/dist/ui/_next/static/chunks/55c76f605958d671.js +1 -0
- package/dist/ui/_next/static/chunks/55dc6750fb117bf9.js +1 -0
- package/dist/ui/_next/static/chunks/584bad9cf2498405.js +1 -0
- package/dist/ui/_next/static/chunks/593b85b9abea3ea6.js +1 -0
- package/dist/ui/_next/static/chunks/5a79af73c96155d4.js +1 -0
- package/dist/ui/_next/static/chunks/5ee54b9b6b400134.js +1 -0
- package/dist/ui/_next/static/chunks/5f27ee48dc820109.js +1 -0
- package/dist/ui/_next/static/chunks/5ffd50a08d82e2f3.js +1 -0
- package/dist/ui/_next/static/chunks/61d65fe807f69413.js +62 -0
- package/dist/ui/_next/static/chunks/626a650bcaaecdb8.js +1 -0
- package/dist/ui/_next/static/chunks/62baecafed4dbced.js +1 -0
- package/dist/ui/_next/static/chunks/634a4b5b6a38ccab.js +1 -0
- package/dist/ui/_next/static/chunks/643c359cf3f7364e.js +1 -0
- package/dist/ui/_next/static/chunks/649e65f4820a772b.js +1 -0
- package/dist/ui/_next/static/chunks/65028938188a230c.js +1 -0
- package/dist/ui/_next/static/chunks/65b3658348e8d4fd.js +1 -0
- package/dist/ui/_next/static/chunks/65eed220466cbdbc.js +1 -0
- package/dist/ui/_next/static/chunks/66714687cfd91953.js +1 -0
- package/dist/ui/_next/static/chunks/66ccaa3e69ed7a69.js +1 -0
- package/dist/ui/_next/static/chunks/6754600af0c6b3a8.js +1 -0
- package/dist/ui/_next/static/chunks/67a1d37727697340.js +1 -0
- package/dist/ui/_next/static/chunks/67e965a7f9531cee.js +1 -0
- package/dist/ui/_next/static/chunks/6816bf02e4c22a55.js +1 -0
- package/dist/ui/_next/static/chunks/68621b90909ec4e6.js +1 -0
- package/dist/ui/_next/static/chunks/6929ceb718c6e4c6.js +1 -0
- package/dist/ui/_next/static/chunks/69362fff2240a17b.js +1 -0
- package/dist/ui/_next/static/chunks/69dab47a307b1a37.js +1 -0
- package/dist/ui/_next/static/chunks/6afa71c8b3358dd5.js +1 -0
- package/dist/ui/_next/static/chunks/6bf54dc328e667f7.js +1 -0
- package/dist/ui/_next/static/chunks/6c44508faf13f6f0.js +1 -0
- package/dist/ui/_next/static/chunks/6c9c2b61c905a2de.js +1 -0
- package/dist/ui/_next/static/chunks/6cc2e3d7873522b9.js +1 -0
- package/dist/ui/_next/static/chunks/6d01e8902e85bfe0.js +1 -0
- package/dist/ui/_next/static/chunks/6dc69e4a91f7a353.js +1 -0
- package/dist/ui/_next/static/chunks/6e832e016b60ae19.js +1 -0
- package/dist/ui/_next/static/chunks/6eab0d8815c18a6d.js +1 -0
- package/dist/ui/_next/static/chunks/6f862eb588fa3b7e.js +1 -0
- package/dist/ui/_next/static/chunks/6ff7b0a8653036b2.js +1 -0
- package/dist/ui/_next/static/chunks/710ce144a9645f3c.js +1 -0
- package/dist/ui/_next/static/chunks/71293e300c639b6b.js +1 -0
- package/dist/ui/_next/static/chunks/7186d7cce354a012.js +1 -0
- package/dist/ui/_next/static/chunks/7215d586009e8158.js +1 -0
- package/dist/ui/_next/static/chunks/726fdeaff53a89ac.js +1 -0
- package/dist/ui/_next/static/chunks/7322a00d61e7ffad.js +1 -0
- package/dist/ui/_next/static/chunks/73c60ee9f233051d.js +1 -0
- package/dist/ui/_next/static/chunks/740f5627b5c57baa.js +1 -0
- package/dist/ui/_next/static/chunks/74438794a8e9ba80.js +1 -0
- package/dist/ui/_next/static/chunks/74ffcd7d13b3fea0.js +1 -0
- package/dist/ui/_next/static/chunks/7510496048ab1ad4.js +1 -0
- package/dist/ui/_next/static/chunks/7636f89f38cbc3e3.js +1 -0
- package/dist/ui/_next/static/chunks/782a93ec4348b666.js +1 -0
- package/dist/ui/_next/static/chunks/7850bbac1925646c.js +1 -0
- package/dist/ui/_next/static/chunks/790dcc1e825d2504.js +1 -0
- package/dist/ui/_next/static/chunks/798597a1c1248d29.js +1 -0
- package/dist/ui/_next/static/chunks/7a70641f70a5c72d.js +60 -0
- package/dist/ui/_next/static/chunks/7c62789391c35dce.js +1 -0
- package/dist/ui/_next/static/chunks/7d533d3f2ab624f2.js +1 -0
- package/dist/ui/_next/static/chunks/7d6087c3fabf9ded.js +1 -0
- package/dist/ui/_next/static/chunks/7d84c9cb810e6902.js +1 -0
- package/dist/ui/_next/static/chunks/7dc4f5ba8c25c409.js +1 -0
- package/dist/ui/_next/static/chunks/7e10c0644fbb99d1.js +1 -0
- package/dist/ui/_next/static/chunks/7e7aaacf104c17f4.js +1 -0
- package/dist/ui/_next/static/chunks/7e92979509de57ed.js +1 -0
- package/dist/ui/_next/static/chunks/7f9a52e36f9f001e.js +1 -0
- package/dist/ui/_next/static/chunks/7fc4ae2e7cf2e37e.js +1 -0
- package/dist/ui/_next/static/chunks/801232fdde8ce252.js +1 -0
- package/dist/ui/_next/static/chunks/808ed0f189237446.js +1 -0
- package/dist/ui/_next/static/chunks/8199e6b3fa54b2ff.js +1 -0
- package/dist/ui/_next/static/chunks/81fa0fa05a94eb02.js +1 -0
- package/dist/ui/_next/static/chunks/821b5389566b82d2.js +1 -0
- package/dist/ui/_next/static/chunks/82b9e04f88e657df.js +1 -0
- package/dist/ui/_next/static/chunks/830c79cc12f2c5a4.js +1 -0
- package/dist/ui/_next/static/chunks/8388ae863590404b.js +4 -0
- package/dist/ui/_next/static/chunks/83ab70f11a82a8c6.js +1 -0
- package/dist/ui/_next/static/chunks/83faf7904ac18d7f.js +1 -0
- package/dist/ui/_next/static/chunks/850d850bd879606f.js +1 -0
- package/dist/ui/_next/static/chunks/864d4b5cf4ae2226.js +1 -0
- package/dist/ui/_next/static/chunks/86d8962196053f53.js +139 -0
- package/dist/ui/_next/static/chunks/8723d7000b263475.js +1 -0
- package/dist/ui/_next/static/chunks/87e5597a4336e2c1.js +1 -0
- package/dist/ui/_next/static/chunks/899fe56c4c707c65.js +1 -0
- package/dist/ui/_next/static/chunks/8bda52f55493ae9b.js +1 -0
- package/dist/ui/_next/static/chunks/8ce5668c3da0679a.js +1 -0
- package/dist/ui/_next/static/chunks/8d1c22aafb4783c5.js +1 -0
- package/dist/ui/_next/static/chunks/8deda0adfe811d18.js +1 -0
- package/dist/ui/_next/static/chunks/8eed597098a27801.js +1 -0
- package/dist/ui/_next/static/chunks/8ff7a1947b8d114b.js +1 -0
- package/dist/ui/_next/static/chunks/90367a2ee1e720b2.js +1 -0
- package/dist/ui/_next/static/chunks/9097640e1931c0de.js +1 -0
- package/dist/ui/_next/static/chunks/912457473a4c91c3.js +1 -0
- package/dist/ui/_next/static/chunks/91f7dd388c6b88c6.js +1 -0
- package/dist/ui/_next/static/chunks/932d4334e5f98b7c.js +1 -0
- package/dist/ui/_next/static/chunks/94b1efc14d44707b.js +1 -0
- package/dist/ui/_next/static/chunks/956107bc3ba52911.js +1 -0
- package/dist/ui/_next/static/chunks/962e5cad8ea716fc.js +36 -0
- package/dist/ui/_next/static/chunks/96acf903dff8ecf7.js +1 -0
- package/dist/ui/_next/static/chunks/96b274c82c194b4f.js +1 -0
- package/dist/ui/_next/static/chunks/96b3c1b1afe3201d.js +1 -0
- package/dist/ui/_next/static/chunks/9880c26551206d33.js +1 -0
- package/dist/ui/_next/static/chunks/98ea228d01556617.js +1 -0
- package/dist/ui/_next/static/chunks/9951c25a8b05148f.js +1 -0
- package/dist/ui/_next/static/chunks/9b10895d33be5f6e.js +1 -0
- package/dist/ui/_next/static/chunks/9b50a76ddbe4934d.js +1 -0
- package/dist/ui/_next/static/chunks/9bbb1c0146042008.js +1 -0
- package/dist/ui/_next/static/chunks/9ccab70823e99451.js +1 -0
- package/dist/ui/_next/static/chunks/9cd7bcb29e0b3418.js +24 -0
- package/dist/ui/_next/static/chunks/9d06bd5d701ace73.js +1 -0
- package/dist/ui/_next/static/chunks/9e5d9fc30c12fbdd.js +1 -0
- package/dist/ui/_next/static/chunks/9ec3bc5544bcc15a.js +1 -0
- package/dist/ui/_next/static/chunks/9f47133184a7455a.js +1 -0
- package/dist/ui/_next/static/chunks/a002d3850b7c7c59.js +1 -0
- package/dist/ui/_next/static/chunks/a0bc5573cadd1377.js +1 -0
- package/dist/ui/_next/static/chunks/a1d3de9e7615662e.js +160 -0
- package/dist/ui/_next/static/chunks/a2ce60768a8373e7.js +1 -0
- package/dist/ui/_next/static/chunks/a305087b1a55b367.js +1 -0
- package/dist/ui/_next/static/chunks/a41df0d443f66c68.js +1 -0
- package/dist/ui/_next/static/chunks/a49d2e9f31886b5e.js +1 -0
- package/dist/ui/_next/static/chunks/a50922e0883f65cd.js +1 -0
- package/dist/ui/_next/static/chunks/a60e84ee8b6c5ffc.js +43 -0
- package/dist/ui/_next/static/chunks/a6dad97d9634a72d.js +1 -0
- package/dist/ui/_next/static/chunks/a6dad97d9634a72d.js.map +1 -0
- package/dist/ui/_next/static/chunks/a7c40c289b5e2384.js +1 -0
- package/dist/ui/_next/static/chunks/a7fdfeea5fd894c1.js +59 -0
- package/dist/ui/_next/static/chunks/a81381241f4f484c.js +1 -0
- package/dist/ui/_next/static/chunks/a8a3989305bcc136.js +215 -0
- package/dist/ui/_next/static/chunks/a8cf26088e63128c.js +1 -0
- package/dist/ui/_next/static/chunks/aac4ca816d9ccdb6.js +1 -0
- package/dist/ui/_next/static/chunks/ab432bc28a971c8f.js +1 -0
- package/dist/ui/_next/static/chunks/abccff1b09b6effa.js +1 -0
- package/dist/ui/_next/static/chunks/ac8a8986f09ec520.js +1 -0
- package/dist/ui/_next/static/chunks/accbf306b5ddb732.js +1 -0
- package/dist/ui/_next/static/chunks/af7b09aba1d477ff.js +1 -0
- package/dist/ui/_next/static/chunks/af8114430894d79e.js +1 -0
- package/dist/ui/_next/static/chunks/afe2ff5d0727a240.js +1 -0
- package/dist/ui/_next/static/chunks/b096fa008120f0ae.js +1 -0
- package/dist/ui/_next/static/chunks/b0bc568eaff56dad.js +1 -0
- package/dist/ui/_next/static/chunks/b225dddc0852f85c.js +215 -0
- package/dist/ui/_next/static/chunks/b2342c5099957971.js +1 -0
- package/dist/ui/_next/static/chunks/b2d8c64d7d6a06b7.js +1 -0
- package/dist/ui/_next/static/chunks/b331c855cfc8fd57.js +1 -0
- package/dist/ui/_next/static/chunks/b356ee8615740392.js +1 -0
- package/dist/ui/_next/static/chunks/b3beaac9b7957d3f.js +1 -0
- package/dist/ui/_next/static/chunks/b4e7d4a109c4c080.js +1 -0
- package/dist/ui/_next/static/chunks/b5010f2ea9df9d00.js +77 -0
- package/dist/ui/_next/static/chunks/b5f9d21bd1b51a48.js +1 -0
- package/dist/ui/_next/static/chunks/b6a16eb77c5c9831.js +1 -0
- package/dist/ui/_next/static/chunks/b6a8e7c2216683ca.js +262 -0
- package/dist/ui/_next/static/chunks/b873c4d327a450e0.js +1 -0
- package/dist/ui/_next/static/chunks/b8aec8caed569fd2.js +24 -0
- package/dist/ui/_next/static/chunks/b8e7601e2379fd74.js +1 -0
- package/dist/ui/_next/static/chunks/ba3d03bf2f33f2a3.js +1 -0
- package/dist/ui/_next/static/chunks/ba698805336b2cb2.js +1 -0
- package/dist/ui/_next/static/chunks/bc48735eee7d1345.js +1 -0
- package/dist/ui/_next/static/chunks/bcb48aab1bdae96a.js +1 -0
- package/dist/ui/_next/static/chunks/bde2ca9d150d96ff.js +1 -0
- package/dist/ui/_next/static/chunks/be4af851547fc916.js +1 -0
- package/dist/ui/_next/static/chunks/be70ba8c4ba5cdb6.js +1 -0
- package/dist/ui/_next/static/chunks/be87578ee895734b.js +1 -0
- package/dist/ui/_next/static/chunks/c0aeb40fcca7d006.js +1 -0
- package/dist/ui/_next/static/chunks/c32156843c32ebca.js +1 -0
- package/dist/ui/_next/static/chunks/c57a3e045f3722c1.js +1 -0
- package/dist/ui/_next/static/chunks/c5add23cde4a234a.js +1 -0
- package/dist/ui/_next/static/chunks/c60897f3554a9388.js +1 -0
- package/dist/ui/_next/static/chunks/c648a36722afd12a.js +1 -0
- package/dist/ui/_next/static/chunks/c652f05e0a0d7b81.js +1 -0
- package/dist/ui/_next/static/chunks/c678d9303ed453b4.js +1 -0
- package/dist/ui/_next/static/chunks/c681430c24597d06.js +1 -0
- package/dist/ui/_next/static/chunks/c890870fb65940bc.js +1 -0
- package/dist/ui/_next/static/chunks/c94c394aeec71e21.js +1 -0
- package/dist/ui/_next/static/chunks/ca1eb1e2978389e4.js +1 -0
- package/dist/ui/_next/static/chunks/ca3512025a981c82.js +1 -0
- package/dist/ui/_next/static/chunks/ca6db0d999bad46b.js +1 -0
- package/dist/ui/_next/static/chunks/ca926babdf75597c.js +1 -0
- package/dist/ui/_next/static/chunks/cb0877764d4a31f2.js +1 -0
- package/dist/ui/_next/static/chunks/cb15e0c2ff49cf52.js +1 -0
- package/dist/ui/_next/static/chunks/cb1ae84204260ecd.js +1 -0
- package/dist/ui/_next/static/chunks/cb2ef733c53d80f7.js +1 -0
- package/dist/ui/_next/static/chunks/cbaa87ba8930fb75.js +1 -0
- package/dist/ui/_next/static/chunks/cbd29ba61906e19f.js +1 -0
- package/dist/ui/_next/static/chunks/ccf1e618faea3d02.js +148 -0
- package/dist/ui/_next/static/chunks/cd91712ea04f43ba.js +13 -0
- package/dist/ui/_next/static/chunks/cdd85dc039d450f3.js +1 -0
- package/dist/ui/_next/static/chunks/ce663833f73b1ec5.js +1 -0
- package/dist/ui/_next/static/chunks/ceda8fcac21d8e70.js +1 -0
- package/dist/ui/_next/static/chunks/cf565875b66f8cad.js +1 -0
- package/dist/ui/_next/static/chunks/d127ded39a594c84.js +1 -0
- package/dist/ui/_next/static/chunks/d34124988f5b8f6d.js +1 -0
- package/dist/ui/_next/static/chunks/d36807add3e11d59.js +60 -0
- package/dist/ui/_next/static/chunks/d3f2e4603faebed8.js +1 -0
- package/dist/ui/_next/static/chunks/d414302c23047b9b.js +1 -0
- package/dist/ui/_next/static/chunks/d42adc0237103e65.js +1 -0
- package/dist/ui/_next/static/chunks/d4a06b205f0a641b.js +1 -0
- package/dist/ui/_next/static/chunks/d4e5289ace3acef0.js +1 -0
- package/dist/ui/_next/static/chunks/d53b4725d3328076.js +1 -0
- package/dist/ui/_next/static/chunks/d5bd04634f922925.js +1 -0
- package/dist/ui/_next/static/chunks/d642c9229900dc48.js +1 -0
- package/dist/ui/_next/static/chunks/d6651bb78c09d144.js +5 -0
- package/dist/ui/_next/static/chunks/d7276c56aa62ceed.js +1 -0
- package/dist/ui/_next/static/chunks/d85cd9cda46f2d1b.js +1 -0
- package/dist/ui/_next/static/chunks/d8978f4b468bbad4.js +1 -0
- package/dist/ui/_next/static/chunks/d8fb9668a83c0603.js +1 -0
- package/dist/ui/_next/static/chunks/d95c62472fc41baf.js +1 -0
- package/dist/ui/_next/static/chunks/da13170b983f7ebf.js +1 -0
- package/dist/ui/_next/static/chunks/dae86e12c7741e6c.js +19 -0
- package/dist/ui/_next/static/chunks/db44023a744297d1.js +1 -0
- package/dist/ui/_next/static/chunks/dbe7840308be36b8.js +1 -0
- package/dist/ui/_next/static/chunks/dc0a4df8f7080b29.js +1 -0
- package/dist/ui/_next/static/chunks/dc4a6f59be156511.js +1 -0
- package/dist/ui/_next/static/chunks/dcda5e7b57ed88e0.js +1 -0
- package/dist/ui/_next/static/chunks/de9ff8c97f75b947.js +1 -0
- package/dist/ui/_next/static/chunks/df6abcdb3eb0b236.js +1 -0
- package/dist/ui/_next/static/chunks/df8a0933ca385a63.js +1 -0
- package/dist/ui/_next/static/chunks/dff6434c44c2dfaa.js +1 -0
- package/dist/ui/_next/static/chunks/e037ec5e62b2bdc3.js +1 -0
- package/dist/ui/_next/static/chunks/e212cf1f5a503899.js +1 -0
- package/dist/ui/_next/static/chunks/e2bfdac0a2305cc1.js +1 -0
- package/dist/ui/_next/static/chunks/e2dce648399ad4d4.js +1 -0
- package/dist/ui/_next/static/chunks/e318291bb8d74aee.js +1 -0
- package/dist/ui/_next/static/chunks/e33e40c2e7ab7629.js +1 -0
- package/dist/ui/_next/static/chunks/e410dfbcccddc478.js +1 -0
- package/dist/ui/_next/static/chunks/e411d58b52ab342b.js +1 -0
- package/dist/ui/_next/static/chunks/e57f7ffd0803a922.js +117 -0
- package/dist/ui/_next/static/chunks/e6b56ceb762e84c4.js +1 -0
- package/dist/ui/_next/static/chunks/e6d9a6ca68017eef.js +1 -0
- package/dist/ui/_next/static/chunks/e6ec2663605cf5a7.js +29 -0
- package/dist/ui/_next/static/chunks/e834330589be0639.js +1 -0
- package/dist/ui/_next/static/chunks/e8f662ba8bc76802.js +1 -0
- package/dist/ui/_next/static/chunks/e9e8e72d7ff45812.js +1 -0
- package/dist/ui/_next/static/chunks/eadd25eb66104a63.js +1 -0
- package/dist/ui/_next/static/chunks/ec3a7a7f48a8aca9.js +1 -0
- package/dist/ui/_next/static/chunks/ed62e349fb1ce14c.js +1 -0
- package/dist/ui/_next/static/chunks/ed6caa113f5769a5.js +1 -0
- package/dist/ui/_next/static/chunks/f02ac565bb5bc450.js +1 -0
- package/dist/ui/_next/static/chunks/f1a7a173e3da4ff4.js +1 -0
- package/dist/ui/_next/static/chunks/f268093817d3b260.js +1 -0
- package/dist/ui/_next/static/chunks/f6f811ccfe79e963.js +1 -0
- package/dist/ui/_next/static/chunks/f8955634331fd956.js +1 -0
- package/dist/ui/_next/static/chunks/f8c965a996875e30.js +56 -0
- package/dist/ui/_next/static/chunks/f9bb8411d37b06d7.js +1 -0
- package/dist/ui/_next/static/chunks/f9d4f77d8c130497.js +1 -0
- package/dist/ui/_next/static/chunks/fba113a516eb485f.js +1 -0
- package/dist/ui/_next/static/chunks/fc069e49a569d83c.js +1 -0
- package/dist/ui/_next/static/chunks/fc245016ffebdde3.js +1 -0
- package/dist/ui/_next/static/chunks/fc2d01d74dcf3921.js +1 -0
- package/dist/ui/_next/static/chunks/fe2ad0e00041a87d.js +1 -0
- package/dist/ui/_next/static/chunks/fe571740188dea3a.js +1 -0
- package/dist/ui/_next/static/chunks/turbopack-a5ce95b200d58f7a.js +4 -0
- package/dist/ui/_next/static/media/4fa387ec64143e14-s.c1fdd6c2.woff2 +0 -0
- package/dist/ui/_next/static/media/7178b3e590c64307-s.b97b3418.woff2 +0 -0
- package/dist/ui/_next/static/media/797e433ab948586e-s.p.dbea232f.woff2 +0 -0
- package/dist/ui/_next/static/media/8a480f0b521d4e75-s.8e0177b5.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_AMS-Regular.892f691b.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_AMS-Regular.c30af439.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_AMS-Regular.e6a3cada.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Caligraphic-Bold.2f97783e.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Caligraphic-Bold.a36b8125.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Caligraphic-Bold.db991531.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Caligraphic-Regular.2b13f013.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Caligraphic-Regular.7c50032c.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Caligraphic-Regular.c20eee08.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Fraktur-Bold.5fa2f5e4.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Fraktur-Bold.d514bd28.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Fraktur-Bold.e311399d.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Fraktur-Regular.18139813.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Fraktur-Regular.2a73476d.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Fraktur-Regular.5d62e468.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-Bold.6d137c77.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-Bold.c24b5ba7.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-Bold.f4e2828d.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-BoldItalic.079b33ae.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-BoldItalic.c003d3ec.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-BoldItalic.f1884480.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-Italic.26a3619b.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-Italic.61da3e93.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-Italic.a3746929.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-Regular.12644167.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-Regular.876b86ad.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Main-Regular.d511f158.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Math-BoldItalic.5c6a6a93.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Math-BoldItalic.ad4dffd5.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Math-BoldItalic.e73b3bf0.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Math-Italic.03974bc4.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Math-Italic.1cd2c488.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Math-Italic.d8564edb.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_SansSerif-Bold.a03f9428.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_SansSerif-Bold.d4608ed5.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_SansSerif-Bold.ff51ef5c.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_SansSerif-Italic.8ed740d6.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_SansSerif-Italic.9245afda.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_SansSerif-Italic.c0b22b1e.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_SansSerif-Regular.128c9bc2.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_SansSerif-Regular.156dbd4e.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_SansSerif-Regular.ee7b0a16.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Script-Regular.00d9a561.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Script-Regular.186c7155.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Script-Regular.afc2fd5a.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size1-Regular.4450ef36.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size1-Regular.9aaff96b.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size1-Regular.e5bf4c74.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size2-Regular.6a97527b.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size2-Regular.8fbd32af.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size2-Regular.f11810ed.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size3-Regular.45ae8eba.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size3-Regular.54b7ce9d.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size3-Regular.9812ade2.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size4-Regular.44a4d487.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size4-Regular.927fc5b9.woff2 +0 -0
- package/dist/ui/_next/static/media/KaTeX_Size4-Regular.b211e3d3.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Typewriter-Regular.68b6c3a9.woff +0 -0
- package/dist/ui/_next/static/media/KaTeX_Typewriter-Regular.a1a7ff52.ttf +0 -0
- package/dist/ui/_next/static/media/KaTeX_Typewriter-Regular.ff99d643.woff2 +0 -0
- package/dist/ui/_next/static/media/bbc41e54d2fcbd21-s.799d8ef8.woff2 +0 -0
- package/dist/ui/_next/static/media/caa3a2e1cccd8315-s.p.853070df.woff2 +0 -0
- package/dist/ui/_next/static/media/favicon.0b3bf435.ico +0 -0
- package/dist/ui/_not-found/__next._full.txt +18 -0
- package/dist/ui/_not-found/__next._head.txt +6 -0
- package/dist/ui/_not-found/__next._index.txt +9 -0
- package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +5 -0
- package/dist/ui/_not-found/__next._not-found.txt +4 -0
- package/dist/ui/_not-found/__next._tree.txt +3 -0
- package/dist/ui/_not-found/index.html +1 -0
- package/dist/ui/_not-found/index.txt +18 -0
- package/dist/ui/favicon.ico +0 -0
- package/dist/ui/file.svg +1 -0
- package/dist/ui/globe.svg +1 -0
- package/dist/ui/index.html +1 -0
- package/dist/ui/index.txt +25 -0
- package/dist/ui/next.svg +1 -0
- package/dist/ui/vercel.svg +1 -0
- package/dist/ui/window.svg +1 -0
- package/dist/utils/chat-model.d.ts +11 -0
- package/dist/utils/chat-model.js +37 -0
- package/dist/utils/diff-parser.d.ts +20 -0
- package/dist/utils/diff-parser.js +100 -0
- package/dist/utils/proxy-manager.d.ts +18 -0
- package/dist/utils/proxy-manager.js +42 -0
- package/dist/utils/remote-proxy.d.ts +40 -0
- package/dist/utils/remote-proxy.js +145 -0
- package/dist/utils/worktree-paths.d.ts +13 -0
- package/dist/utils/worktree-paths.js +64 -0
- package/dist/virtual-ws-adapter.d.ts +26 -0
- package/dist/virtual-ws-adapter.js +54 -0
- package/package.json +19 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import fp from "fastify-plugin";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import fs from "fs/promises";
|
|
4
|
+
import { createReadStream } from "fs";
|
|
5
|
+
import { Readable } from "stream";
|
|
6
|
+
import { proxyToRemoteAuto, proxyToRemoteRaw } from "../utils/remote-proxy.js";
|
|
7
|
+
import { resolveWorktreePath } from "../utils/worktree-paths.js";
|
|
8
|
+
import { requireAuth } from "../server.js";
|
|
9
|
+
import "../server-types.js";
|
|
10
|
+
function getRemoteConfig(fastify, project) {
|
|
11
|
+
// Check project_remotes table first (new approach)
|
|
12
|
+
const remotes = fastify.storage.projectRemotes.getByProject(project.id);
|
|
13
|
+
if (remotes.length > 0) {
|
|
14
|
+
const primary = remotes[0]; // sorted by sort_order
|
|
15
|
+
return {
|
|
16
|
+
serverId: primary.remote_server_id,
|
|
17
|
+
url: primary.server_url ?? "",
|
|
18
|
+
apiKey: primary.server_api_key ?? "",
|
|
19
|
+
remotePath: primary.remote_path,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// Fallback to legacy project fields
|
|
23
|
+
if (project.remote_url && project.remote_api_key && project.remote_path) {
|
|
24
|
+
return {
|
|
25
|
+
serverId: "",
|
|
26
|
+
url: project.remote_url,
|
|
27
|
+
apiKey: project.remote_api_key,
|
|
28
|
+
remotePath: project.remote_path,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const MAX_FILE_SIZE = 1 * 1024 * 1024; // 1MB
|
|
34
|
+
function isPathSafe(basePath, relativePath) {
|
|
35
|
+
const normalizedBase = path.resolve(basePath);
|
|
36
|
+
const resolved = path.resolve(normalizedBase, relativePath);
|
|
37
|
+
return resolved.startsWith(normalizedBase + path.sep) || resolved === normalizedBase;
|
|
38
|
+
}
|
|
39
|
+
async function isBinaryFile(filePath) {
|
|
40
|
+
const fd = await fs.open(filePath, "r");
|
|
41
|
+
try {
|
|
42
|
+
const buf = Buffer.alloc(8192);
|
|
43
|
+
const { bytesRead } = await fd.read(buf, 0, 8192, 0);
|
|
44
|
+
for (let i = 0; i < bytesRead; i++) {
|
|
45
|
+
if (buf[i] === 0)
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
await fd.close();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function browseDirectory(dirPath) {
|
|
55
|
+
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
56
|
+
const items = [];
|
|
57
|
+
for (const entry of entries) {
|
|
58
|
+
if (entry.name.startsWith("."))
|
|
59
|
+
continue;
|
|
60
|
+
if (entry.name === "node_modules")
|
|
61
|
+
continue;
|
|
62
|
+
if (entry.isDirectory()) {
|
|
63
|
+
try {
|
|
64
|
+
const stat = await fs.stat(path.join(dirPath, entry.name));
|
|
65
|
+
items.push({ name: entry.name, type: "directory", mtime: stat.mtime.toISOString() });
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
items.push({ name: entry.name, type: "directory" });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else if (entry.isFile()) {
|
|
72
|
+
try {
|
|
73
|
+
const stat = await fs.stat(path.join(dirPath, entry.name));
|
|
74
|
+
items.push({ name: entry.name, type: "file", size: stat.size, mtime: stat.mtime.toISOString() });
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
items.push({ name: entry.name, type: "file" });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Sort: directories first, then alphabetical
|
|
82
|
+
items.sort((a, b) => {
|
|
83
|
+
if (a.type !== b.type)
|
|
84
|
+
return a.type === "directory" ? -1 : 1;
|
|
85
|
+
return a.name.localeCompare(b.name);
|
|
86
|
+
});
|
|
87
|
+
return { path: dirPath, items };
|
|
88
|
+
}
|
|
89
|
+
const routes = async (fastify) => {
|
|
90
|
+
// Browse directory (path-based, for remote execution)
|
|
91
|
+
fastify.get("/api/path/browse", async (req, reply) => {
|
|
92
|
+
const projectPath = req.query.path;
|
|
93
|
+
if (!projectPath) {
|
|
94
|
+
return reply.code(400).send({ error: "Path is required" });
|
|
95
|
+
}
|
|
96
|
+
const branch = req.query.branch;
|
|
97
|
+
const cwd = resolveWorktreePath(projectPath, branch ?? null);
|
|
98
|
+
try {
|
|
99
|
+
const result = await browseDirectory(cwd);
|
|
100
|
+
return reply.code(200).send(result);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return reply.code(500).send({ error: "Failed to browse directory" });
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
// Get file content (path-based, for remote execution)
|
|
107
|
+
fastify.get("/api/path/file-content", async (req, reply) => {
|
|
108
|
+
const projectPath = req.query.path;
|
|
109
|
+
const filePath = req.query.filePath;
|
|
110
|
+
if (!projectPath || !filePath) {
|
|
111
|
+
return reply.code(400).send({ error: "Path and filePath are required" });
|
|
112
|
+
}
|
|
113
|
+
const branch = req.query.branch;
|
|
114
|
+
const basePath = resolveWorktreePath(projectPath, branch ?? null);
|
|
115
|
+
if (!isPathSafe(basePath, filePath)) {
|
|
116
|
+
return reply.code(403).send({ error: "Path traversal not allowed" });
|
|
117
|
+
}
|
|
118
|
+
const fullPath = path.resolve(basePath, filePath);
|
|
119
|
+
try {
|
|
120
|
+
const stat = await fs.stat(fullPath);
|
|
121
|
+
if (stat.size > MAX_FILE_SIZE) {
|
|
122
|
+
return reply.code(200).send({ binary: false, tooLarge: true, content: null, size: stat.size });
|
|
123
|
+
}
|
|
124
|
+
const binary = await isBinaryFile(fullPath);
|
|
125
|
+
if (binary) {
|
|
126
|
+
return reply.code(200).send({ binary: true, content: null, size: stat.size });
|
|
127
|
+
}
|
|
128
|
+
const content = await fs.readFile(fullPath, "utf-8");
|
|
129
|
+
return reply.code(200).send({ binary: false, content, size: stat.size });
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return reply.code(404).send({ error: "File not found" });
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
// Download file (path-based, for remote execution)
|
|
136
|
+
fastify.get("/api/path/file-download", async (req, reply) => {
|
|
137
|
+
const projectPath = req.query.path;
|
|
138
|
+
const filePath = req.query.filePath;
|
|
139
|
+
if (!projectPath || !filePath) {
|
|
140
|
+
return reply.code(400).send({ error: "Path and filePath are required" });
|
|
141
|
+
}
|
|
142
|
+
const branch = req.query.branch;
|
|
143
|
+
const basePath = resolveWorktreePath(projectPath, branch ?? null);
|
|
144
|
+
if (!isPathSafe(basePath, filePath)) {
|
|
145
|
+
return reply.code(403).send({ error: "Path traversal not allowed" });
|
|
146
|
+
}
|
|
147
|
+
const fullPath = path.resolve(basePath, filePath);
|
|
148
|
+
const fileName = path.basename(fullPath);
|
|
149
|
+
try {
|
|
150
|
+
await fs.access(fullPath);
|
|
151
|
+
const stream = createReadStream(fullPath);
|
|
152
|
+
return reply
|
|
153
|
+
.header("Content-Disposition", `attachment; filename="${fileName}"`)
|
|
154
|
+
.type("application/octet-stream")
|
|
155
|
+
.send(stream);
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
return reply.code(404).send({ error: "File not found" });
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
// Browse project directory (project-scoped)
|
|
162
|
+
fastify.get("/api/projects/:id/browse", async (req, reply) => {
|
|
163
|
+
const userId = requireAuth(req, reply);
|
|
164
|
+
if (userId === null)
|
|
165
|
+
return;
|
|
166
|
+
const project = fastify.storage.projects.getById(req.params.id, userId);
|
|
167
|
+
if (!project) {
|
|
168
|
+
return reply.code(404).send({ error: "Project not found" });
|
|
169
|
+
}
|
|
170
|
+
const relativePath = req.query.path || "";
|
|
171
|
+
const branch = req.query.branch;
|
|
172
|
+
const target = req.query.target;
|
|
173
|
+
const useRemote = target === "remote"
|
|
174
|
+
|| (!target && !project.path);
|
|
175
|
+
if (useRemote) {
|
|
176
|
+
const remoteConfig = getRemoteConfig(fastify, project);
|
|
177
|
+
if (!remoteConfig) {
|
|
178
|
+
return reply.code(400).send({ error: "Project has no remote configuration" });
|
|
179
|
+
}
|
|
180
|
+
const remotePath = relativePath
|
|
181
|
+
? path.posix.join(remoteConfig.remotePath, relativePath)
|
|
182
|
+
: remoteConfig.remotePath;
|
|
183
|
+
const params = [`path=${encodeURIComponent(remotePath)}`];
|
|
184
|
+
if (branch)
|
|
185
|
+
params.push(`branch=${encodeURIComponent(branch)}`);
|
|
186
|
+
const result = await proxyToRemoteAuto(remoteConfig.serverId, remoteConfig.url, remoteConfig.apiKey, "GET", `/api/path/browse?${params.join("&")}`, undefined, { reverseConnectManager: fastify.reverseConnectManager });
|
|
187
|
+
return reply.code(result.status || 200).send(result.data);
|
|
188
|
+
}
|
|
189
|
+
if (!project.path) {
|
|
190
|
+
return reply.code(400).send({ error: "Project has no local path" });
|
|
191
|
+
}
|
|
192
|
+
const basePath = resolveWorktreePath(project.path, branch ?? null);
|
|
193
|
+
const dirPath = relativePath ? path.resolve(basePath, relativePath) : basePath;
|
|
194
|
+
if (!isPathSafe(basePath, relativePath || ".")) {
|
|
195
|
+
return reply.code(403).send({ error: "Path traversal not allowed" });
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
const result = await browseDirectory(dirPath);
|
|
199
|
+
return reply.code(200).send(result);
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
return reply.code(500).send({ error: "Failed to browse directory" });
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
// Get file content (project-scoped)
|
|
206
|
+
fastify.get("/api/projects/:id/file-content", async (req, reply) => {
|
|
207
|
+
const userId = requireAuth(req, reply);
|
|
208
|
+
if (userId === null)
|
|
209
|
+
return;
|
|
210
|
+
const project = fastify.storage.projects.getById(req.params.id, userId);
|
|
211
|
+
if (!project) {
|
|
212
|
+
return reply.code(404).send({ error: "Project not found" });
|
|
213
|
+
}
|
|
214
|
+
const filePath = req.query.path;
|
|
215
|
+
if (!filePath) {
|
|
216
|
+
return reply.code(400).send({ error: "File path is required" });
|
|
217
|
+
}
|
|
218
|
+
const branch = req.query.branch;
|
|
219
|
+
const target = req.query.target;
|
|
220
|
+
const useRemote = target === "remote"
|
|
221
|
+
|| (!target && !project.path);
|
|
222
|
+
if (useRemote) {
|
|
223
|
+
const remoteConfig = getRemoteConfig(fastify, project);
|
|
224
|
+
if (!remoteConfig) {
|
|
225
|
+
return reply.code(400).send({ error: "Project has no remote configuration" });
|
|
226
|
+
}
|
|
227
|
+
const params = [
|
|
228
|
+
`path=${encodeURIComponent(remoteConfig.remotePath)}`,
|
|
229
|
+
`filePath=${encodeURIComponent(filePath)}`,
|
|
230
|
+
];
|
|
231
|
+
if (branch)
|
|
232
|
+
params.push(`branch=${encodeURIComponent(branch)}`);
|
|
233
|
+
const result = await proxyToRemoteAuto(remoteConfig.serverId, remoteConfig.url, remoteConfig.apiKey, "GET", `/api/path/file-content?${params.join("&")}`, undefined, { reverseConnectManager: fastify.reverseConnectManager });
|
|
234
|
+
return reply.code(result.status || 200).send(result.data);
|
|
235
|
+
}
|
|
236
|
+
if (!project.path) {
|
|
237
|
+
return reply.code(400).send({ error: "Project has no local path" });
|
|
238
|
+
}
|
|
239
|
+
const basePath = resolveWorktreePath(project.path, branch ?? null);
|
|
240
|
+
if (!isPathSafe(basePath, filePath)) {
|
|
241
|
+
return reply.code(403).send({ error: "Path traversal not allowed" });
|
|
242
|
+
}
|
|
243
|
+
const fullPath = path.resolve(basePath, filePath);
|
|
244
|
+
try {
|
|
245
|
+
const stat = await fs.stat(fullPath);
|
|
246
|
+
if (stat.size > MAX_FILE_SIZE) {
|
|
247
|
+
return reply.code(200).send({ binary: false, tooLarge: true, content: null, size: stat.size });
|
|
248
|
+
}
|
|
249
|
+
const binary = await isBinaryFile(fullPath);
|
|
250
|
+
if (binary) {
|
|
251
|
+
return reply.code(200).send({ binary: true, content: null, size: stat.size });
|
|
252
|
+
}
|
|
253
|
+
const content = await fs.readFile(fullPath, "utf-8");
|
|
254
|
+
return reply.code(200).send({ binary: false, content, size: stat.size });
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
return reply.code(404).send({ error: "File not found" });
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
// Download file (project-scoped)
|
|
261
|
+
fastify.get("/api/projects/:id/file-download", async (req, reply) => {
|
|
262
|
+
const userId = requireAuth(req, reply);
|
|
263
|
+
if (userId === null)
|
|
264
|
+
return;
|
|
265
|
+
const project = fastify.storage.projects.getById(req.params.id, userId);
|
|
266
|
+
if (!project) {
|
|
267
|
+
return reply.code(404).send({ error: "Project not found" });
|
|
268
|
+
}
|
|
269
|
+
const filePath = req.query.path;
|
|
270
|
+
if (!filePath) {
|
|
271
|
+
return reply.code(400).send({ error: "File path is required" });
|
|
272
|
+
}
|
|
273
|
+
const branch = req.query.branch;
|
|
274
|
+
const target = req.query.target;
|
|
275
|
+
const useRemote = target === "remote"
|
|
276
|
+
|| (!target && !project.path);
|
|
277
|
+
if (useRemote) {
|
|
278
|
+
const remoteConfig = getRemoteConfig(fastify, project);
|
|
279
|
+
if (!remoteConfig) {
|
|
280
|
+
return reply.code(400).send({ error: "Project has no remote configuration" });
|
|
281
|
+
}
|
|
282
|
+
const params = [
|
|
283
|
+
`path=${encodeURIComponent(remoteConfig.remotePath)}`,
|
|
284
|
+
`filePath=${encodeURIComponent(filePath)}`,
|
|
285
|
+
];
|
|
286
|
+
if (branch)
|
|
287
|
+
params.push(`branch=${encodeURIComponent(branch)}`);
|
|
288
|
+
const rcm = fastify.reverseConnectManager;
|
|
289
|
+
if (rcm && rcm.isConnected(remoteConfig.serverId)) {
|
|
290
|
+
// Reverse-connect: proxy through WebSocket tunnel (returns JSON)
|
|
291
|
+
const result = await proxyToRemoteAuto(remoteConfig.serverId, remoteConfig.url, remoteConfig.apiKey, "GET", `/api/path/file-download?${params.join("&")}`, undefined, { reverseConnectManager: rcm });
|
|
292
|
+
return reply.code(result.status || 200).send(result.data);
|
|
293
|
+
}
|
|
294
|
+
// Outbound: direct HTTP fetch for raw streaming response
|
|
295
|
+
const result = await proxyToRemoteRaw(remoteConfig.url, remoteConfig.apiKey, `/api/path/file-download?${params.join("&")}`);
|
|
296
|
+
if (!result.ok) {
|
|
297
|
+
return reply.code(result.status || 500).send({ error: "Failed to download file from remote" });
|
|
298
|
+
}
|
|
299
|
+
const fileName = path.basename(filePath);
|
|
300
|
+
reply.header("Content-Disposition", `attachment; filename="${fileName}"`);
|
|
301
|
+
reply.type("application/octet-stream");
|
|
302
|
+
if (result.body) {
|
|
303
|
+
// Convert web ReadableStream to Node.js Readable for Fastify
|
|
304
|
+
const nodeStream = Readable.fromWeb(result.body);
|
|
305
|
+
return reply.send(nodeStream);
|
|
306
|
+
}
|
|
307
|
+
return reply.code(500).send({ error: "No response body from remote" });
|
|
308
|
+
}
|
|
309
|
+
if (!project.path) {
|
|
310
|
+
return reply.code(400).send({ error: "Project has no local path" });
|
|
311
|
+
}
|
|
312
|
+
const basePath = resolveWorktreePath(project.path, branch ?? null);
|
|
313
|
+
if (!isPathSafe(basePath, filePath)) {
|
|
314
|
+
return reply.code(403).send({ error: "Path traversal not allowed" });
|
|
315
|
+
}
|
|
316
|
+
const fullPath = path.resolve(basePath, filePath);
|
|
317
|
+
const fileName = path.basename(fullPath);
|
|
318
|
+
try {
|
|
319
|
+
await fs.access(fullPath);
|
|
320
|
+
const stream = createReadStream(fullPath);
|
|
321
|
+
return reply
|
|
322
|
+
.header("Content-Disposition", `attachment; filename="${fileName}"`)
|
|
323
|
+
.type("application/octet-stream")
|
|
324
|
+
.send(stream);
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
return reply.code(404).send({ error: "File not found" });
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
};
|
|
331
|
+
export default fp(routes, { name: "file-routes" });
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import fp from "fastify-plugin";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { randomUUID } from "crypto";
|
|
4
|
+
import { proxyToRemoteAuto } from "../utils/remote-proxy.js";
|
|
5
|
+
import { resolveWorktreePath } from "../utils/worktree-paths.js";
|
|
6
|
+
import { requireAuth } from "../server.js";
|
|
7
|
+
import "../server-types.js";
|
|
8
|
+
const routes = async (fastify) => {
|
|
9
|
+
// Execute command at a path (for remote executor)
|
|
10
|
+
fastify.post("/api/path/execute", async (req, reply) => {
|
|
11
|
+
const { path: projectPath, command, executor_type, prompt_provider, cwd, branch, pty } = req.body;
|
|
12
|
+
if (!projectPath || !command) {
|
|
13
|
+
return reply.code(400).send({ error: "Path and command are required" });
|
|
14
|
+
}
|
|
15
|
+
const resolvedBase = resolveWorktreePath(projectPath, branch ?? null);
|
|
16
|
+
const resolvedCwd = cwd ? path.join(resolvedBase, cwd) : null;
|
|
17
|
+
const tempExecutor = {
|
|
18
|
+
id: randomUUID(),
|
|
19
|
+
project_id: "remote",
|
|
20
|
+
group_id: "",
|
|
21
|
+
name: "remote-command",
|
|
22
|
+
command,
|
|
23
|
+
executor_type: (executor_type === 'prompt' ? 'prompt' : 'command'),
|
|
24
|
+
prompt_provider: (prompt_provider === 'codex' ? 'codex' : 'claude'),
|
|
25
|
+
cwd: resolvedCwd,
|
|
26
|
+
pty: pty !== false,
|
|
27
|
+
position: 0,
|
|
28
|
+
created_at: new Date().toISOString(),
|
|
29
|
+
};
|
|
30
|
+
try {
|
|
31
|
+
const processId = fastify.processManager.start(tempExecutor, resolvedBase, true);
|
|
32
|
+
return reply.code(200).send({ processId });
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return reply.code(500).send({ error: String(error) });
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
// 启动 Executor
|
|
39
|
+
fastify.post("/api/executors/:id/start", async (req, reply) => {
|
|
40
|
+
const userId = requireAuth(req, reply);
|
|
41
|
+
if (userId === null)
|
|
42
|
+
return;
|
|
43
|
+
const executor = fastify.storage.executors.getById(req.params.id);
|
|
44
|
+
if (!executor) {
|
|
45
|
+
return reply.code(404).send({ error: "Executor not found" });
|
|
46
|
+
}
|
|
47
|
+
const project = fastify.storage.projects.getById(executor.project_id, userId);
|
|
48
|
+
if (!project) {
|
|
49
|
+
return reply.code(404).send({ error: "Project not found" });
|
|
50
|
+
}
|
|
51
|
+
const branch = req.body?.branch;
|
|
52
|
+
// Use explicit target from request if provided, otherwise fall back to project setting
|
|
53
|
+
let executorMode = req.body?.target || project.executor_mode;
|
|
54
|
+
let useRemoteExecutor = executorMode !== 'local';
|
|
55
|
+
// Fallback: legacy "remote" value → resolve to actual remote server ID
|
|
56
|
+
if (useRemoteExecutor && executorMode === 'remote') {
|
|
57
|
+
const remotes = fastify.storage.projectRemotes.getByProject(project.id);
|
|
58
|
+
if (remotes.length > 0) {
|
|
59
|
+
const fallback = remotes[0];
|
|
60
|
+
executorMode = fallback.remote_server_id;
|
|
61
|
+
fastify.storage.projects.update(project.id, { executor_mode: fallback.remote_server_id });
|
|
62
|
+
console.log(`[API] Auto-resolved executor_mode from 'remote' to '${fallback.remote_server_id}' (legacy value)`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Fallback: if local mode but no local path, try to find a remote to use
|
|
66
|
+
if (!useRemoteExecutor && !project.path) {
|
|
67
|
+
const remotes = fastify.storage.projectRemotes.getByProject(project.id);
|
|
68
|
+
if (remotes.length > 0) {
|
|
69
|
+
const fallback = remotes[0];
|
|
70
|
+
useRemoteExecutor = true;
|
|
71
|
+
executorMode = fallback.remote_server_id;
|
|
72
|
+
fastify.storage.projects.update(project.id, { executor_mode: fallback.remote_server_id });
|
|
73
|
+
console.log(`[API] Auto-resolved executor_mode from 'local' to '${fallback.remote_server_id}' (no local path)`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// When remote, resolve connection info from project_remotes table
|
|
77
|
+
const remoteConfig = useRemoteExecutor
|
|
78
|
+
? fastify.storage.projectRemotes.getByProjectAndServer(project.id, executorMode)
|
|
79
|
+
: undefined;
|
|
80
|
+
console.log(`[API] POST executors/${req.params.id}/start: ` +
|
|
81
|
+
`executor_mode=${executorMode}, useRemoteExecutor=${useRemoteExecutor}, ` +
|
|
82
|
+
`remoteConfig=${remoteConfig ? `url=${remoteConfig.server_url}, path=${remoteConfig.remote_path}` : 'none'}`);
|
|
83
|
+
if (useRemoteExecutor) {
|
|
84
|
+
if (!remoteConfig) {
|
|
85
|
+
return reply.code(400).send({ error: `Remote server configuration not found for executor_mode="${executorMode}"` });
|
|
86
|
+
}
|
|
87
|
+
const result = await proxyToRemoteAuto(executorMode, remoteConfig.server_url ?? "", remoteConfig.server_api_key || "", "POST", `/api/path/execute`, {
|
|
88
|
+
path: remoteConfig.remote_path,
|
|
89
|
+
command: executor.command,
|
|
90
|
+
executor_type: executor.executor_type,
|
|
91
|
+
prompt_provider: executor.prompt_provider,
|
|
92
|
+
branch: branch ?? undefined,
|
|
93
|
+
cwd: executor.cwd || undefined,
|
|
94
|
+
pty: executor.pty,
|
|
95
|
+
}, { reverseConnectManager: fastify.reverseConnectManager });
|
|
96
|
+
if (result.ok) {
|
|
97
|
+
const remoteData = result.data;
|
|
98
|
+
const localProcessId = `remote-${executor.id}-${remoteData.processId}`;
|
|
99
|
+
fastify.remoteExecutorMap.set(localProcessId, {
|
|
100
|
+
remoteServerId: executorMode,
|
|
101
|
+
remoteUrl: remoteConfig.server_url ?? "",
|
|
102
|
+
remoteApiKey: remoteConfig.server_api_key || "",
|
|
103
|
+
remoteProcessId: remoteData.processId,
|
|
104
|
+
executorId: executor.id,
|
|
105
|
+
projectId: project.id,
|
|
106
|
+
});
|
|
107
|
+
fastify.eventBus.emit({
|
|
108
|
+
type: "executor:started",
|
|
109
|
+
projectId: project.id,
|
|
110
|
+
executorId: executor.id,
|
|
111
|
+
processId: localProcessId,
|
|
112
|
+
target: executorMode,
|
|
113
|
+
});
|
|
114
|
+
return reply.code(200).send({ processId: localProcessId });
|
|
115
|
+
}
|
|
116
|
+
return reply.code(result.status || 502).send(result.data);
|
|
117
|
+
}
|
|
118
|
+
if (!project.path) {
|
|
119
|
+
return reply.code(400).send({ error: "Project has no local path" });
|
|
120
|
+
}
|
|
121
|
+
const basePath = resolveWorktreePath(project.path, branch ?? null);
|
|
122
|
+
try {
|
|
123
|
+
const processId = fastify.processManager.start(executor, basePath);
|
|
124
|
+
return reply.code(200).send({ processId });
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
console.error("[API] Failed to start executor:", error);
|
|
128
|
+
return reply.code(500).send({ error: String(error) });
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
// 停止进程
|
|
132
|
+
fastify.post("/api/executor-processes/:processId/stop", async (req, reply) => {
|
|
133
|
+
console.log(`[API] Stop process requested: ${req.params.processId}`);
|
|
134
|
+
if (req.params.processId.startsWith("remote-")) {
|
|
135
|
+
const remoteInfo = fastify.remoteExecutorMap.get(req.params.processId);
|
|
136
|
+
if (!remoteInfo) {
|
|
137
|
+
return reply.code(404).send({ error: "Remote process not found" });
|
|
138
|
+
}
|
|
139
|
+
const result = await proxyToRemoteAuto(remoteInfo.remoteServerId, remoteInfo.remoteUrl, remoteInfo.remoteApiKey, "POST", `/api/executor-processes/${remoteInfo.remoteProcessId}/stop`, undefined, { reverseConnectManager: fastify.reverseConnectManager });
|
|
140
|
+
if (result.ok) {
|
|
141
|
+
fastify.eventBus.emit({
|
|
142
|
+
type: "executor:stopped",
|
|
143
|
+
projectId: remoteInfo.projectId ?? "",
|
|
144
|
+
executorId: remoteInfo.executorId,
|
|
145
|
+
processId: req.params.processId,
|
|
146
|
+
exitCode: 0,
|
|
147
|
+
target: remoteInfo.remoteServerId,
|
|
148
|
+
});
|
|
149
|
+
fastify.remoteExecutorMap.delete(req.params.processId);
|
|
150
|
+
}
|
|
151
|
+
return reply.code(result.status || 200).send(result.data);
|
|
152
|
+
}
|
|
153
|
+
const stopped = fastify.processManager.stop(req.params.processId);
|
|
154
|
+
console.log(`[API] Stop result: ${stopped}`);
|
|
155
|
+
if (!stopped) {
|
|
156
|
+
return reply.code(404).send({ error: "Process not found or already stopped" });
|
|
157
|
+
}
|
|
158
|
+
return reply.code(200).send({ success: true });
|
|
159
|
+
});
|
|
160
|
+
// 获取所有运行中的进程
|
|
161
|
+
fastify.get("/api/executor-processes/running", async (req, reply) => {
|
|
162
|
+
// Local processes
|
|
163
|
+
const runningProcessIds = fastify.processManager.getRunningProcessIds();
|
|
164
|
+
const processes = runningProcessIds.map((id) => {
|
|
165
|
+
const dbProcess = fastify.storage.executorProcesses.getById(id);
|
|
166
|
+
return dbProcess ? { ...dbProcess, target: "local" } : null;
|
|
167
|
+
}).filter(Boolean);
|
|
168
|
+
// Remote processes (tracked in remoteExecutorMap)
|
|
169
|
+
for (const [localProcessId, info] of fastify.remoteExecutorMap) {
|
|
170
|
+
processes.push({
|
|
171
|
+
id: localProcessId,
|
|
172
|
+
executor_id: info.executorId,
|
|
173
|
+
status: "running",
|
|
174
|
+
exit_code: null,
|
|
175
|
+
started_at: new Date().toISOString(),
|
|
176
|
+
finished_at: null,
|
|
177
|
+
target: info.remoteServerId,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return reply.code(200).send({ processes });
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
export default fp(routes, { name: "process-routes" });
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import fp from "fastify-plugin";
|
|
2
|
+
import { requireAuth } from "../server.js";
|
|
3
|
+
import "../server-types.js";
|
|
4
|
+
function sanitizeProjectRemote(pr) {
|
|
5
|
+
const { server_api_key: _, ...safe } = pr;
|
|
6
|
+
return safe;
|
|
7
|
+
}
|
|
8
|
+
const routes = async (fastify) => {
|
|
9
|
+
// GET /api/projects/:id/remotes — list all remotes for a project (api_key sanitized)
|
|
10
|
+
fastify.get("/api/projects/:id/remotes", async (request, reply) => {
|
|
11
|
+
const userId = requireAuth(request, reply);
|
|
12
|
+
if (userId === null)
|
|
13
|
+
return;
|
|
14
|
+
const { id } = request.params;
|
|
15
|
+
const project = fastify.storage.projects.getById(id, userId);
|
|
16
|
+
if (!project)
|
|
17
|
+
return reply.code(404).send({ error: "Project not found" });
|
|
18
|
+
const remotes = fastify.storage.projectRemotes.getByProject(id);
|
|
19
|
+
return reply.send(remotes.map(sanitizeProjectRemote));
|
|
20
|
+
});
|
|
21
|
+
// POST /api/projects/:id/remotes — add a remote to a project
|
|
22
|
+
fastify.post("/api/projects/:id/remotes", async (request, reply) => {
|
|
23
|
+
const userId = requireAuth(request, reply);
|
|
24
|
+
if (userId === null)
|
|
25
|
+
return;
|
|
26
|
+
const { id } = request.params;
|
|
27
|
+
const { remoteServerId, remotePath, sortOrder, syncUpConfig, syncDownConfig } = request.body;
|
|
28
|
+
if (!remoteServerId || !remotePath)
|
|
29
|
+
return reply
|
|
30
|
+
.code(400)
|
|
31
|
+
.send({ error: "remoteServerId and remotePath are required" });
|
|
32
|
+
const project = fastify.storage.projects.getById(id, userId);
|
|
33
|
+
if (!project)
|
|
34
|
+
return reply.code(404).send({ error: "Project not found" });
|
|
35
|
+
const server = fastify.storage.remoteServers.getById(remoteServerId, userId);
|
|
36
|
+
if (!server)
|
|
37
|
+
return reply.code(404).send({ error: "Remote server not found" });
|
|
38
|
+
const existing = fastify.storage.projectRemotes.getByProjectAndServer(id, remoteServerId);
|
|
39
|
+
if (existing)
|
|
40
|
+
return reply
|
|
41
|
+
.code(409)
|
|
42
|
+
.send({ error: "This remote server is already associated with the project" });
|
|
43
|
+
const projectRemote = fastify.storage.projectRemotes.add({
|
|
44
|
+
project_id: id,
|
|
45
|
+
remote_server_id: remoteServerId,
|
|
46
|
+
remote_path: remotePath,
|
|
47
|
+
sort_order: sortOrder,
|
|
48
|
+
sync_up_config: syncUpConfig,
|
|
49
|
+
sync_down_config: syncDownConfig,
|
|
50
|
+
});
|
|
51
|
+
return reply.code(201).send(projectRemote);
|
|
52
|
+
});
|
|
53
|
+
// PUT /api/projects/:id/remotes/:rid — update a project-remote association
|
|
54
|
+
fastify.put("/api/projects/:id/remotes/:rid", async (request, reply) => {
|
|
55
|
+
const userId = requireAuth(request, reply);
|
|
56
|
+
if (userId === null)
|
|
57
|
+
return;
|
|
58
|
+
const { rid } = request.params;
|
|
59
|
+
const { remotePath, sortOrder, syncUpConfig, syncDownConfig } = request.body;
|
|
60
|
+
const updated = fastify.storage.projectRemotes.update(rid, {
|
|
61
|
+
remote_path: remotePath,
|
|
62
|
+
sort_order: sortOrder,
|
|
63
|
+
sync_up_config: syncUpConfig,
|
|
64
|
+
sync_down_config: syncDownConfig,
|
|
65
|
+
});
|
|
66
|
+
if (!updated)
|
|
67
|
+
return reply.code(404).send({ error: "Project remote not found" });
|
|
68
|
+
return reply.send(updated);
|
|
69
|
+
});
|
|
70
|
+
// DELETE /api/projects/:id/remotes/:rid — remove a remote from a project
|
|
71
|
+
fastify.delete("/api/projects/:id/remotes/:rid", async (request, reply) => {
|
|
72
|
+
const userId = requireAuth(request, reply);
|
|
73
|
+
if (userId === null)
|
|
74
|
+
return;
|
|
75
|
+
const { rid } = request.params;
|
|
76
|
+
const removed = fastify.storage.projectRemotes.remove(rid);
|
|
77
|
+
if (!removed)
|
|
78
|
+
return reply.code(404).send({ error: "Project remote not found" });
|
|
79
|
+
return reply.send({ success: true });
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
export default fp(routes, { name: "project-remote-routes" });
|