@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,779 @@
|
|
|
1
|
+
import { spawn, execFileSync } from "child_process";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import * as pty from "node-pty";
|
|
4
|
+
const LOG_RETENTION_MS = 5 * 60 * 1000; // 5 minutes
|
|
5
|
+
const TERMINAL_MAX_LOG_ENTRIES = 5000;
|
|
6
|
+
export class ProcessManager {
|
|
7
|
+
processes = new Map();
|
|
8
|
+
storage;
|
|
9
|
+
eventBus = null;
|
|
10
|
+
terminalCounter = 0;
|
|
11
|
+
binaryCache = new Map();
|
|
12
|
+
constructor(storage) {
|
|
13
|
+
this.storage = storage;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Detect a CLI binary by name, caching the result.
|
|
17
|
+
*/
|
|
18
|
+
detectBinary(name) {
|
|
19
|
+
if (this.binaryCache.has(name)) {
|
|
20
|
+
return this.binaryCache.get(name);
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
const cmd = process.platform === "win32" ? "where" : "which";
|
|
24
|
+
const result = execFileSync(cmd, [name], {
|
|
25
|
+
encoding: "utf-8",
|
|
26
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
27
|
+
}).trim();
|
|
28
|
+
const path = result || null;
|
|
29
|
+
this.binaryCache.set(name, path);
|
|
30
|
+
console.log(`[ProcessManager] ${name} binary found: ${result}`);
|
|
31
|
+
return path;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
this.binaryCache.set(name, null);
|
|
35
|
+
console.log(`[ProcessManager] ${name} binary not found, will use npx`);
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Build the shell command string for a prompt executor.
|
|
41
|
+
* Supports claude and codex providers.
|
|
42
|
+
*/
|
|
43
|
+
buildPromptCommand(prompt, provider) {
|
|
44
|
+
const escapedPrompt = prompt.replace(/'/g, "'\\''");
|
|
45
|
+
if (provider === 'codex') {
|
|
46
|
+
const binary = this.detectBinary('codex');
|
|
47
|
+
if (binary) {
|
|
48
|
+
return `${binary} --dangerously-bypass-approvals-and-sandbox exec '${escapedPrompt}'`;
|
|
49
|
+
}
|
|
50
|
+
return `npx -y @openai/codex --dangerously-bypass-approvals-and-sandbox exec '${escapedPrompt}'`;
|
|
51
|
+
}
|
|
52
|
+
// Default: claude
|
|
53
|
+
const binary = this.detectBinary('claude');
|
|
54
|
+
if (binary) {
|
|
55
|
+
return `${binary} -p '${escapedPrompt}' --dangerously-skip-permissions --verbose`;
|
|
56
|
+
}
|
|
57
|
+
return `npx -y @anthropic-ai/claude-code -p '${escapedPrompt}' --dangerously-skip-permissions --verbose`;
|
|
58
|
+
}
|
|
59
|
+
setEventBus(eventBus) {
|
|
60
|
+
this.eventBus = eventBus;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Start a new process for the given executor
|
|
64
|
+
* Returns the process ID
|
|
65
|
+
* @param skipDb - When true, skip database operations (used for remote path-based execution
|
|
66
|
+
* where the executor doesn't exist in the local DB)
|
|
67
|
+
*/
|
|
68
|
+
start(executor, projectPath, skipDb = false) {
|
|
69
|
+
const processId = crypto.randomUUID();
|
|
70
|
+
// Create process record in database (skip for remote path-based execution)
|
|
71
|
+
if (!skipDb) {
|
|
72
|
+
this.storage.executorProcesses.create({
|
|
73
|
+
id: processId,
|
|
74
|
+
executor_id: executor.id,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Determine working directory
|
|
78
|
+
// If executor.cwd is set, resolve it relative to the worktree/project path
|
|
79
|
+
// so that sub-directory paths work correctly across worktrees
|
|
80
|
+
const cwd = executor.cwd
|
|
81
|
+
? (path.isAbsolute(executor.cwd) ? executor.cwd : path.join(projectPath, executor.cwd))
|
|
82
|
+
: projectPath;
|
|
83
|
+
// For claude prompt executors, use stream-json mode for real-time streaming
|
|
84
|
+
if (executor.executor_type === 'prompt' && (executor.prompt_provider ?? 'claude') === 'claude') {
|
|
85
|
+
console.log(`[ProcessManager] Starting stream-json process ${processId}`);
|
|
86
|
+
console.log(`[ProcessManager] Type: prompt (claude stream-json)`);
|
|
87
|
+
console.log(`[ProcessManager] Prompt: ${executor.command.slice(0, 100)}${executor.command.length > 100 ? '...' : ''}`);
|
|
88
|
+
console.log(`[ProcessManager] CWD: ${cwd}`);
|
|
89
|
+
this.startClaudeStreamProcess(processId, executor, cwd, skipDb);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
// For non-claude prompt executors, build the provider-specific command
|
|
93
|
+
const effectiveExecutor = executor.executor_type === 'prompt'
|
|
94
|
+
? { ...executor, command: this.buildPromptCommand(executor.command, executor.prompt_provider ?? 'claude') }
|
|
95
|
+
: executor;
|
|
96
|
+
console.log(`[ProcessManager] Starting process ${processId}`);
|
|
97
|
+
console.log(`[ProcessManager] Type: ${executor.executor_type || 'command'}${executor.executor_type === 'prompt' ? ` (${executor.prompt_provider ?? 'claude'})` : ''}`);
|
|
98
|
+
console.log(`[ProcessManager] Command: ${effectiveExecutor.command}`);
|
|
99
|
+
console.log(`[ProcessManager] CWD: ${cwd}`);
|
|
100
|
+
console.log(`[ProcessManager] Forcing PTY mode for ANSI color support`);
|
|
101
|
+
// Always use PTY mode for proper ANSI color support
|
|
102
|
+
try {
|
|
103
|
+
this.startPtyProcess(processId, effectiveExecutor, cwd, skipDb);
|
|
104
|
+
console.log(`[ProcessManager] PTY mode started successfully`);
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
// PTY failed (e.g., native module not compiled), fallback to regular process
|
|
108
|
+
console.warn(`[ProcessManager] PTY spawn failed, falling back to regular process: ${error}`);
|
|
109
|
+
this.startRegularProcess(processId, effectiveExecutor, cwd, skipDb);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Store PID in database for recovery after server restart
|
|
113
|
+
if (!skipDb) {
|
|
114
|
+
const runningProcess = this.processes.get(processId);
|
|
115
|
+
if (runningProcess) {
|
|
116
|
+
const pid = runningProcess.isPty
|
|
117
|
+
? runningProcess.process.pid
|
|
118
|
+
: runningProcess.process.pid;
|
|
119
|
+
if (pid) {
|
|
120
|
+
this.storage.executorProcesses.updatePid(processId, pid);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
this.eventBus?.emit({ type: "executor:started", projectId: executor.project_id, executorId: executor.id, processId, target: "local" });
|
|
125
|
+
return processId;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Start an interactive terminal session (persistent shell, no command)
|
|
129
|
+
* Returns the process ID and name
|
|
130
|
+
*/
|
|
131
|
+
startTerminal(projectId, cwd, branch = null) {
|
|
132
|
+
const processId = crypto.randomUUID();
|
|
133
|
+
this.terminalCounter++;
|
|
134
|
+
const name = `Terminal ${this.terminalCounter}`;
|
|
135
|
+
let shell;
|
|
136
|
+
if (process.platform === "win32") {
|
|
137
|
+
shell = "powershell.exe";
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
shell = process.env.SHELL || "/bin/zsh";
|
|
141
|
+
if (!shell.includes("/")) {
|
|
142
|
+
shell = `/bin/${shell}`;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
console.log(`[ProcessManager] Starting terminal ${processId} (${name}) in ${cwd}`);
|
|
146
|
+
const ptyProcess = pty.spawn(shell, [], {
|
|
147
|
+
name: "xterm-256color",
|
|
148
|
+
cols: 80,
|
|
149
|
+
rows: 24,
|
|
150
|
+
cwd,
|
|
151
|
+
env: { ...process.env, TERM: "xterm-256color", FORCE_COLOR: "1" },
|
|
152
|
+
});
|
|
153
|
+
const runningProcess = {
|
|
154
|
+
process: ptyProcess,
|
|
155
|
+
isPty: true,
|
|
156
|
+
isTerminal: true,
|
|
157
|
+
name,
|
|
158
|
+
logs: [],
|
|
159
|
+
subscribers: new Set(),
|
|
160
|
+
executorId: "",
|
|
161
|
+
projectId,
|
|
162
|
+
projectPath: cwd,
|
|
163
|
+
branch,
|
|
164
|
+
skipDb: true,
|
|
165
|
+
};
|
|
166
|
+
this.processes.set(processId, runningProcess);
|
|
167
|
+
ptyProcess.onData((data) => {
|
|
168
|
+
const msg = { type: "pty", data };
|
|
169
|
+
runningProcess.logs.push(msg);
|
|
170
|
+
if (runningProcess.logs.length > TERMINAL_MAX_LOG_ENTRIES) {
|
|
171
|
+
runningProcess.logs = runningProcess.logs.slice(-TERMINAL_MAX_LOG_ENTRIES);
|
|
172
|
+
}
|
|
173
|
+
this.broadcast(processId, msg);
|
|
174
|
+
});
|
|
175
|
+
ptyProcess.onExit(({ exitCode }) => {
|
|
176
|
+
const code = exitCode ?? 0;
|
|
177
|
+
console.log(`[ProcessManager] Terminal ${processId} exited with code ${code}`);
|
|
178
|
+
const msg = { type: "finished", exitCode: code };
|
|
179
|
+
runningProcess.logs.push(msg);
|
|
180
|
+
this.broadcast(processId, msg);
|
|
181
|
+
this.processes.delete(processId);
|
|
182
|
+
});
|
|
183
|
+
return { id: processId, name };
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Start a process using node-pty (for interactive commands)
|
|
187
|
+
*/
|
|
188
|
+
startPtyProcess(processId, executor, cwd, skipDb = false) {
|
|
189
|
+
// Use user's default shell or fall back to common shell paths
|
|
190
|
+
let shell;
|
|
191
|
+
if (process.platform === "win32") {
|
|
192
|
+
shell = "powershell.exe";
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
// Try SHELL env var first, then common paths
|
|
196
|
+
shell = process.env.SHELL || "/bin/zsh";
|
|
197
|
+
// If SHELL is just "bash" or "zsh" without path, prepend /bin/
|
|
198
|
+
if (shell === "bash" || shell === "zsh" || shell === "sh") {
|
|
199
|
+
shell = `/bin/${shell}`;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const args = process.platform === "win32" ? ["-Command", executor.command] : ["-c", executor.command];
|
|
203
|
+
console.log(`[ProcessManager] Using shell: ${shell}`);
|
|
204
|
+
const ptyProcess = pty.spawn(shell, args, {
|
|
205
|
+
name: "xterm-256color",
|
|
206
|
+
cols: 80,
|
|
207
|
+
rows: 24,
|
|
208
|
+
cwd,
|
|
209
|
+
env: { ...process.env, TERM: "xterm-256color", FORCE_COLOR: "1" },
|
|
210
|
+
});
|
|
211
|
+
const runningProcess = {
|
|
212
|
+
process: ptyProcess,
|
|
213
|
+
isPty: true,
|
|
214
|
+
isTerminal: false,
|
|
215
|
+
name: "",
|
|
216
|
+
logs: [],
|
|
217
|
+
subscribers: new Set(),
|
|
218
|
+
executorId: executor.id,
|
|
219
|
+
projectId: executor.project_id,
|
|
220
|
+
projectPath: cwd,
|
|
221
|
+
branch: null,
|
|
222
|
+
skipDb,
|
|
223
|
+
};
|
|
224
|
+
this.processes.set(processId, runningProcess);
|
|
225
|
+
console.log(`[ProcessManager] PTY process ${processId} added to map, PID: ${ptyProcess.pid}`);
|
|
226
|
+
// Handle PTY data output
|
|
227
|
+
ptyProcess.onData((data) => {
|
|
228
|
+
const msg = { type: "pty", data };
|
|
229
|
+
runningProcess.logs.push(msg);
|
|
230
|
+
if (runningProcess.logs.length > TERMINAL_MAX_LOG_ENTRIES) {
|
|
231
|
+
runningProcess.logs = runningProcess.logs.slice(-TERMINAL_MAX_LOG_ENTRIES);
|
|
232
|
+
}
|
|
233
|
+
this.broadcast(processId, msg);
|
|
234
|
+
});
|
|
235
|
+
// Handle PTY exit
|
|
236
|
+
ptyProcess.onExit(({ exitCode }) => {
|
|
237
|
+
const code = exitCode ?? 0;
|
|
238
|
+
const status = code === 0 ? "completed" : "failed";
|
|
239
|
+
console.log(`[ProcessManager] PTY process ${processId} exited with code ${code}`);
|
|
240
|
+
if (!skipDb) {
|
|
241
|
+
this.storage.executorProcesses.updateStatus(processId, status, code);
|
|
242
|
+
}
|
|
243
|
+
const msg = { type: "finished", exitCode: code };
|
|
244
|
+
runningProcess.logs.push(msg);
|
|
245
|
+
this.broadcast(processId, msg);
|
|
246
|
+
this.eventBus?.emit({ type: "executor:stopped", projectId: runningProcess.projectId, executorId: runningProcess.executorId, processId, exitCode: code, target: "local" });
|
|
247
|
+
// Schedule cleanup after retention period
|
|
248
|
+
setTimeout(() => {
|
|
249
|
+
console.log(`[ProcessManager] Cleaning up process ${processId}`);
|
|
250
|
+
this.processes.delete(processId);
|
|
251
|
+
}, LOG_RETENTION_MS);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Start a process using regular spawn (for non-interactive commands)
|
|
256
|
+
*/
|
|
257
|
+
startRegularProcess(processId, executor, cwd, skipDb = false) {
|
|
258
|
+
const childProcess = spawn(executor.command, {
|
|
259
|
+
shell: true,
|
|
260
|
+
cwd,
|
|
261
|
+
detached: true,
|
|
262
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
263
|
+
env: { ...process.env, FORCE_COLOR: "1" },
|
|
264
|
+
});
|
|
265
|
+
const runningProcess = {
|
|
266
|
+
process: childProcess,
|
|
267
|
+
isPty: false,
|
|
268
|
+
isTerminal: false,
|
|
269
|
+
name: "",
|
|
270
|
+
logs: [],
|
|
271
|
+
subscribers: new Set(),
|
|
272
|
+
executorId: executor.id,
|
|
273
|
+
projectId: executor.project_id,
|
|
274
|
+
projectPath: cwd,
|
|
275
|
+
branch: null,
|
|
276
|
+
skipDb,
|
|
277
|
+
};
|
|
278
|
+
this.processes.set(processId, runningProcess);
|
|
279
|
+
console.log(`[ProcessManager] Regular process ${processId} added to map, PID: ${childProcess.pid}`);
|
|
280
|
+
// Handle stdout
|
|
281
|
+
childProcess.stdout?.on("data", (data) => {
|
|
282
|
+
const msg = { type: "stdout", data: data.toString() };
|
|
283
|
+
runningProcess.logs.push(msg);
|
|
284
|
+
if (runningProcess.logs.length > TERMINAL_MAX_LOG_ENTRIES) {
|
|
285
|
+
runningProcess.logs = runningProcess.logs.slice(-TERMINAL_MAX_LOG_ENTRIES);
|
|
286
|
+
}
|
|
287
|
+
this.broadcast(processId, msg);
|
|
288
|
+
});
|
|
289
|
+
// Handle stderr
|
|
290
|
+
childProcess.stderr?.on("data", (data) => {
|
|
291
|
+
const msg = { type: "stderr", data: data.toString() };
|
|
292
|
+
runningProcess.logs.push(msg);
|
|
293
|
+
if (runningProcess.logs.length > TERMINAL_MAX_LOG_ENTRIES) {
|
|
294
|
+
runningProcess.logs = runningProcess.logs.slice(-TERMINAL_MAX_LOG_ENTRIES);
|
|
295
|
+
}
|
|
296
|
+
this.broadcast(processId, msg);
|
|
297
|
+
});
|
|
298
|
+
// Handle process exit
|
|
299
|
+
childProcess.on("close", (code) => {
|
|
300
|
+
const exitCode = code ?? 0;
|
|
301
|
+
const status = exitCode === 0 ? "completed" : "failed";
|
|
302
|
+
console.log(`[ProcessManager] Process ${processId} exited with code ${exitCode}`);
|
|
303
|
+
if (!skipDb) {
|
|
304
|
+
this.storage.executorProcesses.updateStatus(processId, status, exitCode);
|
|
305
|
+
}
|
|
306
|
+
const msg = { type: "finished", exitCode };
|
|
307
|
+
runningProcess.logs.push(msg);
|
|
308
|
+
this.broadcast(processId, msg);
|
|
309
|
+
this.eventBus?.emit({ type: "executor:stopped", projectId: runningProcess.projectId, executorId: runningProcess.executorId, processId, exitCode, target: "local" });
|
|
310
|
+
// Schedule cleanup after retention period
|
|
311
|
+
setTimeout(() => {
|
|
312
|
+
console.log(`[ProcessManager] Cleaning up process ${processId}`);
|
|
313
|
+
this.processes.delete(processId);
|
|
314
|
+
}, LOG_RETENTION_MS);
|
|
315
|
+
});
|
|
316
|
+
// Handle spawn errors
|
|
317
|
+
childProcess.on("error", (error) => {
|
|
318
|
+
const msg = { type: "stderr", data: `Error: ${error.message}` };
|
|
319
|
+
runningProcess.logs.push(msg);
|
|
320
|
+
this.broadcast(processId, msg);
|
|
321
|
+
if (!skipDb) {
|
|
322
|
+
this.storage.executorProcesses.updateStatus(processId, "failed", 1);
|
|
323
|
+
}
|
|
324
|
+
const finishMsg = { type: "finished", exitCode: 1 };
|
|
325
|
+
runningProcess.logs.push(finishMsg);
|
|
326
|
+
this.broadcast(processId, finishMsg);
|
|
327
|
+
this.eventBus?.emit({ type: "executor:stopped", projectId: runningProcess.projectId, executorId: runningProcess.executorId, processId, exitCode: 1, target: "local" });
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Start a Claude prompt executor using stream-json mode for real-time output.
|
|
332
|
+
* Spawns claude with --output-format=stream-json --input-format=stream-json,
|
|
333
|
+
* sends the prompt via stdin, and parses JSON output into formatted terminal text.
|
|
334
|
+
*/
|
|
335
|
+
startClaudeStreamProcess(processId, executor, cwd, skipDb) {
|
|
336
|
+
const binary = this.detectBinary('claude');
|
|
337
|
+
const args = [
|
|
338
|
+
'--output-format=stream-json',
|
|
339
|
+
'--input-format=stream-json',
|
|
340
|
+
'--dangerously-skip-permissions',
|
|
341
|
+
'--verbose',
|
|
342
|
+
];
|
|
343
|
+
const command = binary || 'npx';
|
|
344
|
+
const fullArgs = binary ? args : ['-y', '@anthropic-ai/claude-code', ...args];
|
|
345
|
+
const childProcess = spawn(command, fullArgs, {
|
|
346
|
+
cwd,
|
|
347
|
+
detached: true,
|
|
348
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
349
|
+
env: { ...process.env, FORCE_COLOR: '1' },
|
|
350
|
+
});
|
|
351
|
+
const runningProcess = {
|
|
352
|
+
process: childProcess,
|
|
353
|
+
isPty: false,
|
|
354
|
+
isTerminal: false,
|
|
355
|
+
name: '',
|
|
356
|
+
logs: [],
|
|
357
|
+
subscribers: new Set(),
|
|
358
|
+
executorId: executor.id,
|
|
359
|
+
projectId: executor.project_id,
|
|
360
|
+
projectPath: cwd,
|
|
361
|
+
branch: null,
|
|
362
|
+
skipDb,
|
|
363
|
+
};
|
|
364
|
+
this.processes.set(processId, runningProcess);
|
|
365
|
+
console.log(`[ProcessManager] Stream process ${processId} added to map, PID: ${childProcess.pid}`);
|
|
366
|
+
// Send prompt via stdin and close to signal single-turn
|
|
367
|
+
const userMessage = JSON.stringify({ type: 'user', message: { role: 'user', content: executor.command } }) + '\n';
|
|
368
|
+
childProcess.stdin?.write(userMessage, () => {
|
|
369
|
+
childProcess.stdin?.end();
|
|
370
|
+
});
|
|
371
|
+
// Stream-JSON parsing state
|
|
372
|
+
let stdoutBuffer = '';
|
|
373
|
+
const prevTextByIndex = new Map();
|
|
374
|
+
const seenToolUseIds = new Set();
|
|
375
|
+
const RESET = '\x1b[0m';
|
|
376
|
+
const DIM = '\x1b[2m';
|
|
377
|
+
const CYAN = '\x1b[36m';
|
|
378
|
+
const GREEN = '\x1b[32m';
|
|
379
|
+
const RED = '\x1b[31m';
|
|
380
|
+
const BOLD = '\x1b[1m';
|
|
381
|
+
const pushLog = (data) => {
|
|
382
|
+
const msg = { type: 'stdout', data };
|
|
383
|
+
runningProcess.logs.push(msg);
|
|
384
|
+
if (runningProcess.logs.length > TERMINAL_MAX_LOG_ENTRIES) {
|
|
385
|
+
runningProcess.logs = runningProcess.logs.slice(-TERMINAL_MAX_LOG_ENTRIES);
|
|
386
|
+
}
|
|
387
|
+
this.broadcast(processId, msg);
|
|
388
|
+
};
|
|
389
|
+
// Parse stream-json stdout into formatted terminal output
|
|
390
|
+
childProcess.stdout?.on('data', (data) => {
|
|
391
|
+
stdoutBuffer += data.toString();
|
|
392
|
+
const lines = stdoutBuffer.split('\n');
|
|
393
|
+
stdoutBuffer = lines.pop() || '';
|
|
394
|
+
for (const line of lines) {
|
|
395
|
+
if (!line.trim())
|
|
396
|
+
continue;
|
|
397
|
+
let parsed;
|
|
398
|
+
try {
|
|
399
|
+
parsed = JSON.parse(line);
|
|
400
|
+
}
|
|
401
|
+
catch {
|
|
402
|
+
pushLog(line + '\n');
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if (parsed.type === 'assistant') {
|
|
406
|
+
const message = parsed.message;
|
|
407
|
+
const content = message?.content;
|
|
408
|
+
if (!content || !Array.isArray(content))
|
|
409
|
+
continue;
|
|
410
|
+
let output = '';
|
|
411
|
+
for (let i = 0; i < content.length; i++) {
|
|
412
|
+
const block = content[i];
|
|
413
|
+
if (block.type === 'text') {
|
|
414
|
+
const fullText = block.text || '';
|
|
415
|
+
const prev = prevTextByIndex.get(i) || '';
|
|
416
|
+
if (fullText.length > prev.length && fullText.startsWith(prev)) {
|
|
417
|
+
output += fullText.slice(prev.length);
|
|
418
|
+
}
|
|
419
|
+
else if (fullText !== prev) {
|
|
420
|
+
output += fullText;
|
|
421
|
+
}
|
|
422
|
+
prevTextByIndex.set(i, fullText);
|
|
423
|
+
}
|
|
424
|
+
else if (block.type === 'tool_use' && block.id && !seenToolUseIds.has(block.id)) {
|
|
425
|
+
seenToolUseIds.add(block.id);
|
|
426
|
+
output += `\n${CYAN}${BOLD}> ${block.name}${RESET}\n`;
|
|
427
|
+
const input = block.input;
|
|
428
|
+
if (input && Object.keys(input).length > 0) {
|
|
429
|
+
const inputStr = JSON.stringify(input, null, 2);
|
|
430
|
+
const truncated = inputStr.length > 500 ? inputStr.slice(0, 500) + '...' : inputStr;
|
|
431
|
+
output += `${DIM}${truncated}${RESET}\n`;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
if (output)
|
|
436
|
+
pushLog(output);
|
|
437
|
+
}
|
|
438
|
+
else if (parsed.type === 'user') {
|
|
439
|
+
const message = parsed.message;
|
|
440
|
+
const content = message?.content;
|
|
441
|
+
if (!content || !Array.isArray(content))
|
|
442
|
+
continue;
|
|
443
|
+
for (const block of content) {
|
|
444
|
+
if (block.type === 'tool_result') {
|
|
445
|
+
const resultStr = typeof block.content === 'string'
|
|
446
|
+
? block.content
|
|
447
|
+
: JSON.stringify(block.content);
|
|
448
|
+
if (resultStr && resultStr.length > 0) {
|
|
449
|
+
const truncated = resultStr.length > 2000 ? resultStr.slice(0, 2000) + '...' : resultStr;
|
|
450
|
+
pushLog(`${DIM}${truncated}${RESET}\n`);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
else if (parsed.type === 'system') {
|
|
456
|
+
const msg = parsed.message || parsed.subtype;
|
|
457
|
+
if (msg) {
|
|
458
|
+
pushLog(`${DIM}${msg}${RESET}\n`);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
else if (parsed.type === 'result') {
|
|
462
|
+
if (parsed.subtype === 'error') {
|
|
463
|
+
pushLog(`\n${RED}Error: ${parsed.error || 'Unknown error'}${RESET}\n`);
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
const parts = [];
|
|
467
|
+
if (parsed.duration_ms)
|
|
468
|
+
parts.push(`${(parsed.duration_ms / 1000).toFixed(1)}s`);
|
|
469
|
+
if (parsed.cost_usd)
|
|
470
|
+
parts.push(`$${parsed.cost_usd.toFixed(4)}`);
|
|
471
|
+
const info = parts.length > 0 ? ` (${parts.join(', ')})` : '';
|
|
472
|
+
pushLog(`\n${GREEN}Done${info}${RESET}\n`);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
// Ignore stderr (Claude Code uses it for progress/debug info)
|
|
478
|
+
childProcess.stderr?.on('data', () => { });
|
|
479
|
+
// Handle process exit
|
|
480
|
+
childProcess.on('close', (code) => {
|
|
481
|
+
const exitCode = code ?? 0;
|
|
482
|
+
const status = exitCode === 0 ? 'completed' : 'failed';
|
|
483
|
+
console.log(`[ProcessManager] Stream process ${processId} exited with code ${exitCode}`);
|
|
484
|
+
if (!skipDb) {
|
|
485
|
+
this.storage.executorProcesses.updateStatus(processId, status, exitCode);
|
|
486
|
+
}
|
|
487
|
+
const msg = { type: 'finished', exitCode };
|
|
488
|
+
runningProcess.logs.push(msg);
|
|
489
|
+
this.broadcast(processId, msg);
|
|
490
|
+
this.eventBus?.emit({ type: 'executor:stopped', projectId: runningProcess.projectId, executorId: runningProcess.executorId, processId, exitCode, target: "local" });
|
|
491
|
+
// Schedule cleanup after retention period
|
|
492
|
+
setTimeout(() => {
|
|
493
|
+
console.log(`[ProcessManager] Cleaning up process ${processId}`);
|
|
494
|
+
this.processes.delete(processId);
|
|
495
|
+
}, LOG_RETENTION_MS);
|
|
496
|
+
});
|
|
497
|
+
// Handle spawn errors
|
|
498
|
+
childProcess.on('error', (error) => {
|
|
499
|
+
const msg = { type: 'stderr', data: `Error: ${error.message}` };
|
|
500
|
+
runningProcess.logs.push(msg);
|
|
501
|
+
this.broadcast(processId, msg);
|
|
502
|
+
if (!skipDb) {
|
|
503
|
+
this.storage.executorProcesses.updateStatus(processId, 'failed', 1);
|
|
504
|
+
}
|
|
505
|
+
const finishMsg = { type: 'finished', exitCode: 1 };
|
|
506
|
+
runningProcess.logs.push(finishMsg);
|
|
507
|
+
this.broadcast(processId, finishMsg);
|
|
508
|
+
this.eventBus?.emit({ type: 'executor:stopped', projectId: runningProcess.projectId, executorId: runningProcess.executorId, processId, exitCode: 1, target: "local" });
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Stop a running process
|
|
513
|
+
*/
|
|
514
|
+
stop(processId) {
|
|
515
|
+
const runningProcess = this.processes.get(processId);
|
|
516
|
+
if (!runningProcess) {
|
|
517
|
+
console.log(`[ProcessManager] Process ${processId} not found in memory map. Map has ${this.processes.size} entries: [${Array.from(this.processes.keys()).join(", ")}]`);
|
|
518
|
+
// Process not in memory (e.g., server was restarted or PTY exited early) — try to kill by PID from DB
|
|
519
|
+
return this.stopByPid(processId);
|
|
520
|
+
}
|
|
521
|
+
let killed = false;
|
|
522
|
+
if (runningProcess.isPty) {
|
|
523
|
+
// For PTY processes, kill the process group to ensure all children are terminated
|
|
524
|
+
const ptyProcess = runningProcess.process;
|
|
525
|
+
const pid = ptyProcess.pid;
|
|
526
|
+
killed = this.killProcessGroup(pid);
|
|
527
|
+
if (!killed) {
|
|
528
|
+
// Fallback to node-pty's kill method
|
|
529
|
+
ptyProcess.kill();
|
|
530
|
+
killed = true;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
// For regular processes, kill the process group (detached: true makes them group leaders)
|
|
535
|
+
const childProcess = runningProcess.process;
|
|
536
|
+
const pid = childProcess.pid;
|
|
537
|
+
if (pid) {
|
|
538
|
+
killed = this.killProcessGroup(pid);
|
|
539
|
+
console.log(`[ProcessManager] Process group kill (pid=${pid}): ${killed}`);
|
|
540
|
+
}
|
|
541
|
+
if (!killed) {
|
|
542
|
+
killed = childProcess.kill("SIGTERM");
|
|
543
|
+
console.log(`[ProcessManager] Direct SIGTERM kill (pid=${pid}): ${killed}`);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
if (killed && !runningProcess.skipDb) {
|
|
547
|
+
this.storage.executorProcesses.updateStatus(processId, "killed");
|
|
548
|
+
}
|
|
549
|
+
return killed;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Kill a process group by sending SIGTERM to the negative PID
|
|
553
|
+
*/
|
|
554
|
+
killProcessGroup(pid) {
|
|
555
|
+
try {
|
|
556
|
+
process.kill(-pid, "SIGTERM");
|
|
557
|
+
return true;
|
|
558
|
+
}
|
|
559
|
+
catch {
|
|
560
|
+
return false;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Try to stop a process by looking up its PID in the database (for orphaned processes after server restart)
|
|
565
|
+
*/
|
|
566
|
+
stopByPid(processId) {
|
|
567
|
+
const dbProcess = this.storage.executorProcesses.getById(processId);
|
|
568
|
+
if (!dbProcess || !dbProcess.pid) {
|
|
569
|
+
console.log(`[ProcessManager] Process ${processId} not found in DB or has no PID (status=${dbProcess?.status})`);
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
572
|
+
console.log(`[ProcessManager] Process ${processId} not in memory (db status=${dbProcess.status}), attempting to kill by PID ${dbProcess.pid}`);
|
|
573
|
+
let killed = false;
|
|
574
|
+
// Try process group kill first
|
|
575
|
+
try {
|
|
576
|
+
process.kill(-dbProcess.pid, "SIGTERM");
|
|
577
|
+
killed = true;
|
|
578
|
+
}
|
|
579
|
+
catch {
|
|
580
|
+
// Process group kill failed, try direct kill
|
|
581
|
+
try {
|
|
582
|
+
process.kill(dbProcess.pid, "SIGTERM");
|
|
583
|
+
killed = true;
|
|
584
|
+
}
|
|
585
|
+
catch {
|
|
586
|
+
// Process already dead
|
|
587
|
+
console.log(`[ProcessManager] PID ${dbProcess.pid} is already dead`);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
this.storage.executorProcesses.updateStatus(processId, "killed");
|
|
591
|
+
return killed;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Handle input from the client (for PTY processes)
|
|
595
|
+
*/
|
|
596
|
+
handleInput(processId, message) {
|
|
597
|
+
const runningProcess = this.processes.get(processId);
|
|
598
|
+
if (!runningProcess || !runningProcess.isPty) {
|
|
599
|
+
return false;
|
|
600
|
+
}
|
|
601
|
+
const ptyProcess = runningProcess.process;
|
|
602
|
+
if (message.type === "input") {
|
|
603
|
+
ptyProcess.write(message.data);
|
|
604
|
+
return true;
|
|
605
|
+
}
|
|
606
|
+
else if (message.type === "resize") {
|
|
607
|
+
ptyProcess.resize(message.cols, message.rows);
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
return false;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Send a command to a running terminal session (fire-and-forget).
|
|
614
|
+
* Writes the command + newline to the PTY. Does not wait for output.
|
|
615
|
+
*/
|
|
616
|
+
sendToTerminal(processId, command) {
|
|
617
|
+
const runningProcess = this.processes.get(processId);
|
|
618
|
+
if (!runningProcess) {
|
|
619
|
+
throw new Error(`Terminal ${processId} not found`);
|
|
620
|
+
}
|
|
621
|
+
if (!runningProcess.isPty || !runningProcess.isTerminal) {
|
|
622
|
+
throw new Error(`Process ${processId} is not an interactive terminal`);
|
|
623
|
+
}
|
|
624
|
+
const lastLog = runningProcess.logs[runningProcess.logs.length - 1];
|
|
625
|
+
if (lastLog?.type === "finished") {
|
|
626
|
+
throw new Error(`Terminal ${processId} has already exited`);
|
|
627
|
+
}
|
|
628
|
+
const ptyProcess = runningProcess.process;
|
|
629
|
+
ptyProcess.write(`${command}\n`);
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Get recent output lines from a terminal's log buffer.
|
|
633
|
+
* Returns stripped ANSI text from the last N lines.
|
|
634
|
+
*/
|
|
635
|
+
getRecentOutput(processId, maxLines = 50) {
|
|
636
|
+
const runningProcess = this.processes.get(processId);
|
|
637
|
+
if (!runningProcess)
|
|
638
|
+
return "";
|
|
639
|
+
const textLogs = runningProcess.logs
|
|
640
|
+
.filter((l) => l.type !== "finished")
|
|
641
|
+
.map((l) => l.data);
|
|
642
|
+
const joined = textLogs.join("");
|
|
643
|
+
const lines = joined.split("\n");
|
|
644
|
+
const tail = lines.slice(-maxLines).join("\n");
|
|
645
|
+
// Strip ANSI escape codes
|
|
646
|
+
return tail.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><~]/g, "");
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Check if a process is using PTY mode
|
|
650
|
+
*/
|
|
651
|
+
isPtyProcess(processId) {
|
|
652
|
+
const runningProcess = this.processes.get(processId);
|
|
653
|
+
return runningProcess?.isPty ?? false;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Subscribe to log updates for a process
|
|
657
|
+
* Returns an unsubscribe function
|
|
658
|
+
*/
|
|
659
|
+
subscribe(processId, callback) {
|
|
660
|
+
const runningProcess = this.processes.get(processId);
|
|
661
|
+
if (!runningProcess) {
|
|
662
|
+
return null;
|
|
663
|
+
}
|
|
664
|
+
runningProcess.subscribers.add(callback);
|
|
665
|
+
return () => {
|
|
666
|
+
runningProcess.subscribers.delete(callback);
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Get all historical logs for a process
|
|
671
|
+
*/
|
|
672
|
+
getLogs(processId) {
|
|
673
|
+
const runningProcess = this.processes.get(processId);
|
|
674
|
+
return runningProcess?.logs ?? [];
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Check if a process is still running
|
|
678
|
+
*/
|
|
679
|
+
isRunning(processId) {
|
|
680
|
+
const runningProcess = this.processes.get(processId);
|
|
681
|
+
if (!runningProcess) {
|
|
682
|
+
return false;
|
|
683
|
+
}
|
|
684
|
+
if (runningProcess.isPty) {
|
|
685
|
+
// PTY processes: check if the last log is a "finished" message
|
|
686
|
+
const lastLog = runningProcess.logs[runningProcess.logs.length - 1];
|
|
687
|
+
return lastLog?.type !== "finished";
|
|
688
|
+
}
|
|
689
|
+
else {
|
|
690
|
+
// Regular processes: check killed and exitCode
|
|
691
|
+
const childProcess = runningProcess.process;
|
|
692
|
+
return !childProcess.killed && childProcess.exitCode === null;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Get all running process IDs
|
|
697
|
+
*/
|
|
698
|
+
getRunningProcessIds() {
|
|
699
|
+
return Array.from(this.processes.entries())
|
|
700
|
+
.filter(([id, proc]) => {
|
|
701
|
+
if (proc.isPty) {
|
|
702
|
+
const lastLog = proc.logs[proc.logs.length - 1];
|
|
703
|
+
return lastLog?.type !== "finished";
|
|
704
|
+
}
|
|
705
|
+
else {
|
|
706
|
+
const childProcess = proc.process;
|
|
707
|
+
return !childProcess.killed && childProcess.exitCode === null;
|
|
708
|
+
}
|
|
709
|
+
})
|
|
710
|
+
.map(([id]) => id);
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Get all running terminal sessions for a project
|
|
714
|
+
*/
|
|
715
|
+
getTerminals(projectId, branch) {
|
|
716
|
+
const terminals = [];
|
|
717
|
+
const filterBranch = branch === undefined ? undefined : (branch ?? null);
|
|
718
|
+
for (const [id, proc] of this.processes) {
|
|
719
|
+
if (proc.isTerminal && proc.projectId === projectId) {
|
|
720
|
+
if (filterBranch !== undefined && proc.branch !== filterBranch)
|
|
721
|
+
continue;
|
|
722
|
+
const lastLog = proc.logs[proc.logs.length - 1];
|
|
723
|
+
if (lastLog?.type !== "finished") {
|
|
724
|
+
terminals.push({ id, projectId: proc.projectId, name: proc.name, cwd: proc.projectPath, branch: proc.branch });
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
return terminals;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Get all processes for a given executor ID with their status and logs
|
|
732
|
+
*/
|
|
733
|
+
getProcessesByExecutorId(executorId) {
|
|
734
|
+
const results = [];
|
|
735
|
+
for (const [processId, proc] of this.processes) {
|
|
736
|
+
if (proc.executorId === executorId) {
|
|
737
|
+
results.push({
|
|
738
|
+
processId,
|
|
739
|
+
isRunning: this.isRunning(processId),
|
|
740
|
+
logs: proc.logs,
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
return results;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Kill all running processes and clear state for graceful shutdown
|
|
748
|
+
*/
|
|
749
|
+
shutdown() {
|
|
750
|
+
for (const [id, proc] of this.processes) {
|
|
751
|
+
try {
|
|
752
|
+
if (proc.isPty) {
|
|
753
|
+
proc.process.kill();
|
|
754
|
+
}
|
|
755
|
+
else {
|
|
756
|
+
proc.process.kill("SIGTERM");
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
catch { /* ignore - process may already be dead */ }
|
|
760
|
+
}
|
|
761
|
+
this.processes.clear();
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Broadcast a message to all subscribers of a process
|
|
765
|
+
*/
|
|
766
|
+
broadcast(processId, msg) {
|
|
767
|
+
const runningProcess = this.processes.get(processId);
|
|
768
|
+
if (!runningProcess)
|
|
769
|
+
return;
|
|
770
|
+
for (const subscriber of runningProcess.subscribers) {
|
|
771
|
+
try {
|
|
772
|
+
subscriber(msg);
|
|
773
|
+
}
|
|
774
|
+
catch (error) {
|
|
775
|
+
console.error("Error in log subscriber:", error);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|