vibeman 0.0.12 → 0.0.14
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/api.js +688 -116
- package/dist/commit.txt +1 -1
- package/dist/index.js +30 -6
- package/dist/node_modules/node-pty/LICENSE +69 -0
- package/dist/node_modules/node-pty/README.md +165 -0
- package/dist/node_modules/node-pty/binding.gyp +111 -0
- package/dist/node_modules/node-pty/deps/.editorconfig +2 -0
- package/dist/node_modules/node-pty/deps/winpty/.drone.yml +17 -0
- package/dist/node_modules/node-pty/deps/winpty/.gitattributes +19 -0
- package/dist/node_modules/node-pty/deps/winpty/LICENSE +21 -0
- package/dist/node_modules/node-pty/deps/winpty/Makefile +166 -0
- package/dist/node_modules/node-pty/deps/winpty/README.md +151 -0
- package/dist/node_modules/node-pty/deps/winpty/RELEASES.md +280 -0
- package/dist/node_modules/node-pty/deps/winpty/VERSION.txt +1 -0
- package/dist/node_modules/node-pty/deps/winpty/configure +167 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/BufferResizeTests.cc +90 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/ChangeScreenBuffer.cc +53 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/ClearConsole.cc +72 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/ConinMode.cc +117 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/ConinMode.ps1 +116 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/ConoutMode.cc +113 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/DebugClient.py +42 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/DebugServer.py +63 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/DumpLines.py +5 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/EnableExtendedFlags.txt +46 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP437-Consolas.txt +528 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP437-Lucida.txt +633 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP932.txt +630 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP936.txt +630 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP949.txt +630 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP950.txt +630 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/MinimumWindowWidths.txt +16 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/Results.txt +4 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/Windows10SetFontBugginess.txt +144 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/FontSurvey.cc +100 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/FormatChar.h +21 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/FreezePerfTest.cc +62 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/GetCh.cc +20 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/GetConsolePos.cc +41 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/GetFont.cc +261 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/IdentifyConsoleWindow.ps1 +51 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/IsNewConsole.cc +87 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/MouseInputNotes.txt +90 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/MoveConsoleWindow.cc +34 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Notes.txt +219 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/OSVersion.cc +27 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/ScreenBufferFreezeInactive.cc +101 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/ScreenBufferTest.cc +671 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/ScreenBufferTest2.cc +151 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/SelectAllTest.cc +45 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/SetBufferSize.cc +32 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/SetCursorPos.cc +10 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/SetFont.cc +145 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/SetWindowRect.cc +36 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/ShowArgv.cc +12 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/ShowConsoleInput.cc +40 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Spew.py +5 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/TestUtil.cc +172 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/UnicodeDoubleWidthTest.cc +102 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/UnicodeWideTest1.cc +246 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/UnicodeWideTest2.cc +130 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/UnixEcho.cc +89 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Utf16Echo.cc +46 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/VeryLargeRead.cc +122 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/VkEscapeTest.cc +56 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Win10ResizeWhileFrozen.cc +52 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Win10WrapTest1.cc +57 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Win10WrapTest2.cc +30 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Win32Echo1.cc +26 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Win32Echo2.cc +19 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Win32Test1.cc +46 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Win32Test2.cc +70 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Win32Test3.cc +78 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/Win32Write1.cc +44 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/WindowsBugCrashReader.cc +27 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/WriteConsole.cc +106 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/build32.sh +9 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/build64.sh +9 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/color-test.sh +212 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/font-notes.txt +300 -0
- package/dist/node_modules/node-pty/deps/winpty/misc/winbug-15048.cc +201 -0
- package/dist/node_modules/node-pty/deps/winpty/ship/build-pty4j-libpty.bat +36 -0
- package/dist/node_modules/node-pty/deps/winpty/ship/common_ship.py +53 -0
- package/dist/node_modules/node-pty/deps/winpty/ship/make_msvc_package.py +165 -0
- package/dist/node_modules/node-pty/deps/winpty/ship/ship.py +108 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Agent.cc +613 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Agent.h +103 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/AgentCreateDesktop.cc +84 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/AgentCreateDesktop.h +28 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleFont.cc +632 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleFont.h +28 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleInput.cc +852 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleInput.h +109 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleInputReencoding.cc +121 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleInputReencoding.h +36 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleLine.cc +152 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleLine.h +41 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Coord.h +87 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/DebugShowInput.cc +239 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/DebugShowInput.h +32 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/DefaultInputMap.cc +422 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/DefaultInputMap.h +28 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/DsrSender.h +30 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/EventLoop.cc +99 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/EventLoop.h +47 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/InputMap.cc +246 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/InputMap.h +114 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/LargeConsoleRead.cc +71 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/LargeConsoleRead.h +68 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/NamedPipe.cc +378 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/NamedPipe.h +125 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Scraper.cc +699 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Scraper.h +103 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/SimplePool.h +75 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/SmallRect.h +143 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Terminal.cc +535 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Terminal.h +69 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/UnicodeEncoding.h +157 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/UnicodeEncodingTest.cc +189 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Win32Console.cc +107 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Win32Console.h +67 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Win32ConsoleBuffer.cc +193 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/Win32ConsoleBuffer.h +99 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/main.cc +114 -0
- package/dist/node_modules/node-pty/deps/winpty/src/agent/subdir.mk +61 -0
- package/dist/node_modules/node-pty/deps/winpty/src/configurations.gypi +60 -0
- package/dist/node_modules/node-pty/deps/winpty/src/debugserver/DebugServer.cc +117 -0
- package/dist/node_modules/node-pty/deps/winpty/src/debugserver/subdir.mk +41 -0
- package/dist/node_modules/node-pty/deps/winpty/src/include/winpty.h +242 -0
- package/dist/node_modules/node-pty/deps/winpty/src/include/winpty_constants.h +131 -0
- package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/AgentLocation.cc +75 -0
- package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/AgentLocation.h +28 -0
- package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/LibWinptyException.h +54 -0
- package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/WinptyInternal.h +72 -0
- package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/subdir.mk +46 -0
- package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/winpty.cc +970 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/AgentMsg.h +38 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/BackgroundDesktop.cc +122 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/BackgroundDesktop.h +73 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/Buffer.cc +103 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/Buffer.h +102 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/DebugClient.cc +187 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/DebugClient.h +38 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/GenRandom.cc +138 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/GenRandom.h +55 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/GetCommitHash.bat +13 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/Mutex.h +54 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/OsModule.h +63 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/OwnedHandle.cc +36 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/OwnedHandle.h +45 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/PrecompiledHeader.h +43 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/StringBuilder.h +227 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/StringBuilderTest.cc +114 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/StringUtil.cc +55 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/StringUtil.h +80 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/TimeMeasurement.h +63 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/UnixCtrlChars.h +45 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/UpdateGenVersion.bat +20 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/WindowsSecurity.cc +460 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/WindowsSecurity.h +104 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/WindowsVersion.cc +252 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/WindowsVersion.h +29 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyAssert.cc +55 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyAssert.h +64 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyException.cc +57 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyException.h +43 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyVersion.cc +42 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyVersion.h +27 -0
- package/dist/node_modules/node-pty/deps/winpty/src/shared/winpty_snprintf.h +99 -0
- package/dist/node_modules/node-pty/deps/winpty/src/subdir.mk +5 -0
- package/dist/node_modules/node-pty/deps/winpty/src/tests/subdir.mk +28 -0
- package/dist/node_modules/node-pty/deps/winpty/src/tests/trivial_test.cc +158 -0
- package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/InputHandler.cc +114 -0
- package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/InputHandler.h +56 -0
- package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/OutputHandler.cc +80 -0
- package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/OutputHandler.h +53 -0
- package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/Util.cc +86 -0
- package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/Util.h +31 -0
- package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/WakeupFd.cc +70 -0
- package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/WakeupFd.h +42 -0
- package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/main.cc +729 -0
- package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/subdir.mk +41 -0
- package/dist/node_modules/node-pty/deps/winpty/src/winpty.gyp +234 -0
- package/dist/node_modules/node-pty/deps/winpty/vcbuild.bat +83 -0
- package/dist/node_modules/node-pty/lib/conpty_console_list_agent.js +16 -0
- package/dist/node_modules/node-pty/lib/conpty_console_list_agent.js.map +1 -0
- package/dist/node_modules/node-pty/lib/eventEmitter2.js +47 -0
- package/dist/node_modules/node-pty/lib/eventEmitter2.js.map +1 -0
- package/dist/node_modules/node-pty/lib/eventEmitter2.test.js +30 -0
- package/dist/node_modules/node-pty/lib/eventEmitter2.test.js.map +1 -0
- package/dist/node_modules/node-pty/lib/index.js +52 -0
- package/dist/node_modules/node-pty/lib/index.js.map +1 -0
- package/dist/node_modules/node-pty/lib/interfaces.js +7 -0
- package/dist/node_modules/node-pty/lib/interfaces.js.map +1 -0
- package/dist/node_modules/node-pty/lib/shared/conout.js +11 -0
- package/dist/node_modules/node-pty/lib/shared/conout.js.map +1 -0
- package/dist/node_modules/node-pty/lib/terminal.js +190 -0
- package/dist/node_modules/node-pty/lib/terminal.js.map +1 -0
- package/dist/node_modules/node-pty/lib/terminal.test.js +139 -0
- package/dist/node_modules/node-pty/lib/terminal.test.js.map +1 -0
- package/dist/node_modules/node-pty/lib/testUtils.test.js +28 -0
- package/dist/node_modules/node-pty/lib/testUtils.test.js.map +1 -0
- package/dist/node_modules/node-pty/lib/types.js +7 -0
- package/dist/node_modules/node-pty/lib/types.js.map +1 -0
- package/dist/node_modules/node-pty/lib/unixTerminal.js +346 -0
- package/dist/node_modules/node-pty/lib/unixTerminal.js.map +1 -0
- package/dist/node_modules/node-pty/lib/unixTerminal.test.js +351 -0
- package/dist/node_modules/node-pty/lib/unixTerminal.test.js.map +1 -0
- package/dist/node_modules/node-pty/lib/utils.js +39 -0
- package/dist/node_modules/node-pty/lib/utils.js.map +1 -0
- package/dist/node_modules/node-pty/lib/windowsConoutConnection.js +125 -0
- package/dist/node_modules/node-pty/lib/windowsConoutConnection.js.map +1 -0
- package/dist/node_modules/node-pty/lib/windowsPtyAgent.js +320 -0
- package/dist/node_modules/node-pty/lib/windowsPtyAgent.js.map +1 -0
- package/dist/node_modules/node-pty/lib/windowsPtyAgent.test.js +90 -0
- package/dist/node_modules/node-pty/lib/windowsPtyAgent.test.js.map +1 -0
- package/dist/node_modules/node-pty/lib/windowsTerminal.js +199 -0
- package/dist/node_modules/node-pty/lib/windowsTerminal.js.map +1 -0
- package/dist/node_modules/node-pty/lib/windowsTerminal.test.js +219 -0
- package/dist/node_modules/node-pty/lib/windowsTerminal.test.js.map +1 -0
- package/dist/node_modules/node-pty/lib/worker/conoutSocketWorker.js +22 -0
- package/dist/node_modules/node-pty/lib/worker/conoutSocketWorker.js.map +1 -0
- package/dist/node_modules/node-pty/package.json +64 -0
- package/dist/node_modules/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
- package/dist/node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
- package/dist/node_modules/node-pty/prebuilds/darwin-x64/pty.node +0 -0
- package/dist/node_modules/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty.pdb +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.pdb +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/pty.node +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/pty.pdb +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.exe +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.pdb +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/winpty.dll +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-arm64/winpty.pdb +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty.node +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty.pdb +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.pdb +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/pty.node +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/pty.pdb +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.pdb +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
- package/dist/node_modules/node-pty/prebuilds/win32-x64/winpty.pdb +0 -0
- package/dist/node_modules/node-pty/scripts/gen-compile-commands.js +8 -0
- package/dist/node_modules/node-pty/scripts/increment-version.js +54 -0
- package/dist/node_modules/node-pty/scripts/post-install.js +80 -0
- package/dist/node_modules/node-pty/scripts/prebuild.js +34 -0
- package/dist/node_modules/node-pty/src/conpty_console_list_agent.ts +15 -0
- package/dist/node_modules/node-pty/src/eventEmitter2.test.ts +30 -0
- package/dist/node_modules/node-pty/src/eventEmitter2.ts +48 -0
- package/dist/node_modules/node-pty/src/index.ts +52 -0
- package/dist/node_modules/node-pty/src/interfaces.ts +130 -0
- package/dist/node_modules/node-pty/src/native.d.ts +54 -0
- package/dist/node_modules/node-pty/src/shared/conout.ts +15 -0
- package/dist/node_modules/node-pty/src/terminal.test.ts +119 -0
- package/dist/node_modules/node-pty/src/terminal.ts +211 -0
- package/dist/node_modules/node-pty/src/testUtils.test.ts +23 -0
- package/dist/node_modules/node-pty/src/tsconfig.json +22 -0
- package/dist/node_modules/node-pty/src/types.ts +15 -0
- package/dist/node_modules/node-pty/src/unix/pty.cc +799 -0
- package/dist/node_modules/node-pty/src/unix/spawn-helper.cc +23 -0
- package/dist/node_modules/node-pty/src/unixTerminal.test.ts +367 -0
- package/dist/node_modules/node-pty/src/unixTerminal.ts +388 -0
- package/dist/node_modules/node-pty/src/utils.ts +29 -0
- package/dist/node_modules/node-pty/src/win/conpty.cc +583 -0
- package/dist/node_modules/node-pty/src/win/conpty.h +41 -0
- package/dist/node_modules/node-pty/src/win/conpty_console_list.cc +44 -0
- package/dist/node_modules/node-pty/src/win/path_util.cc +95 -0
- package/dist/node_modules/node-pty/src/win/path_util.h +26 -0
- package/dist/node_modules/node-pty/src/win/winpty.cc +333 -0
- package/dist/node_modules/node-pty/src/windowsConoutConnection.ts +82 -0
- package/dist/node_modules/node-pty/src/windowsPtyAgent.test.ts +94 -0
- package/dist/node_modules/node-pty/src/windowsPtyAgent.ts +321 -0
- package/dist/node_modules/node-pty/src/windowsTerminal.test.ts +229 -0
- package/dist/node_modules/node-pty/src/windowsTerminal.ts +203 -0
- package/dist/node_modules/node-pty/src/worker/conoutSocketWorker.ts +22 -0
- package/dist/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/OpenConsole.exe +0 -0
- package/dist/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/conpty.dll +0 -0
- package/dist/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/OpenConsole.exe +0 -0
- package/dist/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/conpty.dll +0 -0
- package/dist/node_modules/node-pty/typings/node-pty.d.ts +211 -0
- package/dist/ui/assets/{index-C11szUfi.js → index-B65NvzF3.js} +194 -188
- package/dist/ui/assets/{index-BSBd0iNJ.js → index-B6f0IvI8.js} +1 -1
- package/dist/ui/assets/{index-CGuNU-ZD.js → index-BCfnrf9x.js} +1 -1
- package/dist/ui/assets/{index-BaXVaxHx.js → index-BHpxmbNr.js} +1 -1
- package/dist/ui/assets/{index-D_jkO9O-.js → index-BRbvQP4r.js} +1 -1
- package/dist/ui/assets/{index-BmtnQPpD.js → index-BcFJG3pn.js} +1 -1
- package/dist/ui/assets/{index-ByZHh-PW.js → index-Bepe4gRM.js} +1 -1
- package/dist/ui/assets/{index-DLmnpfog.js → index-BkA7So3L.js} +1 -1
- package/dist/ui/assets/{index-F9P0dYhi.css → index-BlYNw2Nz.css} +1 -1
- package/dist/ui/assets/{index-C_fbobmw.js → index-BxqUzAmT.js} +1 -1
- package/dist/ui/assets/{index-DLpjBSMu.js → index-C86nRoc4.js} +1 -1
- package/dist/ui/assets/{index-BuwohDsu.js → index-CUwqevMv.js} +1 -1
- package/dist/ui/assets/{index-CKMfCp4z.js → index-ClTXL7da.js} +1 -1
- package/dist/ui/assets/{index-BRRYaPwU.js → index-CyH0t-7C.js} +1 -1
- package/dist/ui/assets/{index-DPowuqxK.js → index-DQJMJ04n.js} +1 -1
- package/dist/ui/assets/{index-B7jXVZvp.js → index-Dc4Up0Ir.js} +1 -1
- package/dist/ui/assets/{index-BAQhZ7Ry.js → index-DdwbXAJq.js} +1 -1
- package/dist/ui/assets/{index-BjdJVJkF.js → index-DfsBdEGr.js} +1 -1
- package/dist/ui/assets/{index-CjUsp5je.js → index-GYxfKBT1.js} +1 -1
- package/dist/ui/assets/{index-DlmuGNPY.js → index-KwWhSMUi.js} +1 -1
- package/dist/ui/assets/{index-DRxfqe2a.js → index-R05wI85b.js} +1 -1
- package/dist/ui/assets/{index-CTP1vZJL.js → index-TlK-Z_4f.js} +1 -1
- package/dist/ui/assets/{index-BunmAvtt.js → index-iiYTe0B1.js} +1 -1
- package/dist/ui/assets/{index-B8A4iBxI.js → index-kh7xKB6N.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/package.json +2 -2
package/dist/api.js
CHANGED
|
@@ -15677,6 +15677,51 @@ var init_zod = __esm(() => {
|
|
|
15677
15677
|
init_external();
|
|
15678
15678
|
});
|
|
15679
15679
|
|
|
15680
|
+
// ../shared/runtime/vibeman-env.ts
|
|
15681
|
+
function readVibemanEnv(env, key) {
|
|
15682
|
+
const value = env[key];
|
|
15683
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
15684
|
+
return value.trim();
|
|
15685
|
+
}
|
|
15686
|
+
return;
|
|
15687
|
+
}
|
|
15688
|
+
var VIBEMAN_ENV_PREFIX = "VIBEMAN_", VIBEMAN_ENV_KEYS;
|
|
15689
|
+
var init_vibeman_env = __esm(() => {
|
|
15690
|
+
VIBEMAN_ENV_KEYS = {
|
|
15691
|
+
ROOT: "VIBEMAN_ROOT",
|
|
15692
|
+
PORT: "VIBEMAN_PORT",
|
|
15693
|
+
DATABASE_URL: "VIBEMAN_DATABASE_URL",
|
|
15694
|
+
VERBOSE: "VIBEMAN_VERBOSE",
|
|
15695
|
+
LOG_FORMAT: "VIBEMAN_LOG_FORMAT",
|
|
15696
|
+
UI_DIST: "VIBEMAN_UI_DIST",
|
|
15697
|
+
CODEX_PATH: "VIBEMAN_CODEX_PATH",
|
|
15698
|
+
GEMINI_PATH: "VIBEMAN_GEMINI_PATH",
|
|
15699
|
+
CLAUDE_CODE_PATH: "VIBEMAN_CLAUDE_CODE_PATH",
|
|
15700
|
+
TRACE: "VIBEMAN_TRACE",
|
|
15701
|
+
DIST_ROOT: "VIBEMAN_DIST_ROOT",
|
|
15702
|
+
DB_AUTORECOVER: "VIBEMAN_DB_AUTORECOVER"
|
|
15703
|
+
};
|
|
15704
|
+
});
|
|
15705
|
+
|
|
15706
|
+
// ../api/src/services/env-policy.ts
|
|
15707
|
+
function isVibemanPrefixedEnvKey(key) {
|
|
15708
|
+
return key.startsWith(VIBEMAN_ENV_PREFIX);
|
|
15709
|
+
}
|
|
15710
|
+
function shouldFilterForExternalAppLaunch(input) {
|
|
15711
|
+
if (isVibemanPrefixedEnvKey(input.key))
|
|
15712
|
+
return true;
|
|
15713
|
+
return false;
|
|
15714
|
+
}
|
|
15715
|
+
function shouldFilterForWorktreeShellInheritance(input) {
|
|
15716
|
+
if (isVibemanPrefixedEnvKey(input.key))
|
|
15717
|
+
return true;
|
|
15718
|
+
return false;
|
|
15719
|
+
}
|
|
15720
|
+
var init_env_policy = __esm(() => {
|
|
15721
|
+
init_vibeman_env();
|
|
15722
|
+
init_vibeman_env();
|
|
15723
|
+
});
|
|
15724
|
+
|
|
15680
15725
|
// ../../node_modules/pino-std-serializers/lib/err-helpers.js
|
|
15681
15726
|
var require_err_helpers = __commonJS((exports, module) => {
|
|
15682
15727
|
var isErrorLike = (err) => {
|
|
@@ -19959,7 +20004,7 @@ function formatExtraPayloadWithMode(payload, verboseDetails) {
|
|
|
19959
20004
|
kvParts.push(`${key}=${summarizeSuppressedValue(value)}`);
|
|
19960
20005
|
}
|
|
19961
20006
|
if (hiddenDetailCount > 0 && !verboseDetails) {
|
|
19962
|
-
kvParts.push(
|
|
20007
|
+
kvParts.push(`detail=hidden(use ${VIBEMAN_ENV_KEYS.VERBOSE}=debug|trace)`);
|
|
19963
20008
|
}
|
|
19964
20009
|
return kvParts.join(" ");
|
|
19965
20010
|
}
|
|
@@ -20109,15 +20154,16 @@ function parseBooleanEnv(raw2) {
|
|
|
20109
20154
|
}
|
|
20110
20155
|
var import_pino, levelEnv, allowedLevels, level, logFormatEnv, logFormat, usePrettyLogs, useColor, includeVerboseDetails, homeDir, cwd, levelLabels, colors, hiddenDetailKeyMatchers, sensitiveKeySegments, sensitiveSegmentPairs, bannerPrinted = false, stream, logger;
|
|
20111
20156
|
var init_log = __esm(() => {
|
|
20157
|
+
init_env_policy();
|
|
20112
20158
|
import_pino = __toESM(require_pino(), 1);
|
|
20113
|
-
levelEnv = process.env.VERBOSE?.toLowerCase();
|
|
20159
|
+
levelEnv = readVibemanEnv(process.env, VIBEMAN_ENV_KEYS.VERBOSE)?.toLowerCase();
|
|
20114
20160
|
allowedLevels = new Set(["error", "warn", "info", "debug", "trace"]);
|
|
20115
20161
|
level = allowedLevels.has(levelEnv ?? "") ? levelEnv : "info";
|
|
20116
|
-
logFormatEnv = process.env.LOG_FORMAT?.toLowerCase();
|
|
20162
|
+
logFormatEnv = readVibemanEnv(process.env, VIBEMAN_ENV_KEYS.LOG_FORMAT)?.toLowerCase();
|
|
20117
20163
|
logFormat = logFormatEnv === "json" || logFormatEnv === "pretty" ? logFormatEnv : "pretty";
|
|
20118
20164
|
usePrettyLogs = logFormat === "pretty";
|
|
20119
20165
|
useColor = Boolean(process.stdout.isTTY) && !process.env.NO_COLOR;
|
|
20120
|
-
includeVerboseDetails = level === "debug" || level === "trace" || parseBooleanEnv(process.env.
|
|
20166
|
+
includeVerboseDetails = level === "debug" || level === "trace" || parseBooleanEnv(process.env[VIBEMAN_ENV_KEYS.TRACE]);
|
|
20121
20167
|
homeDir = homedir();
|
|
20122
20168
|
cwd = process.cwd();
|
|
20123
20169
|
levelLabels = {
|
|
@@ -42319,23 +42365,29 @@ var init_log_sanitizer = __esm(() => {
|
|
|
42319
42365
|
import { execFile, spawn } from "node:child_process";
|
|
42320
42366
|
import { existsSync as existsSync3 } from "node:fs";
|
|
42321
42367
|
import { delimiter, resolve as resolve3 } from "node:path";
|
|
42368
|
+
function safeLog(method, ...args) {
|
|
42369
|
+
const fn = logger[method];
|
|
42370
|
+
if (typeof fn === "function") {
|
|
42371
|
+
fn.call(logger, ...args);
|
|
42372
|
+
}
|
|
42373
|
+
}
|
|
42322
42374
|
function resolveClaudeCodeCliPath(env, logContext) {
|
|
42323
|
-
const envOverride = env?.CLAUDE_CODE_PATH ?? process.env.CLAUDE_CODE_PATH;
|
|
42375
|
+
const envOverride = env?.[VIBEMAN_ENV_KEYS.CLAUDE_CODE_PATH] ?? process.env[VIBEMAN_ENV_KEYS.CLAUDE_CODE_PATH];
|
|
42324
42376
|
if (envOverride) {
|
|
42325
42377
|
const resolved = envOverride.trim();
|
|
42326
42378
|
if (resolved && existsSync3(resolved)) {
|
|
42327
42379
|
if (logContext) {
|
|
42328
|
-
|
|
42380
|
+
safeLog("debug", { ...logContext, executable: resolved, source: "env" }, "Claude CLI resolved.");
|
|
42329
42381
|
}
|
|
42330
42382
|
return resolved;
|
|
42331
42383
|
}
|
|
42332
42384
|
if (logContext) {
|
|
42333
|
-
|
|
42385
|
+
safeLog("warn", { ...logContext, executable: resolved }, "Claude CLI path override not found.");
|
|
42334
42386
|
}
|
|
42335
42387
|
}
|
|
42336
42388
|
const fromPath = findClaudeExecutableOnPath();
|
|
42337
42389
|
if (fromPath && logContext) {
|
|
42338
|
-
|
|
42390
|
+
safeLog("debug", { ...logContext, executable: fromPath }, "Claude CLI resolved.");
|
|
42339
42391
|
}
|
|
42340
42392
|
return fromPath || undefined;
|
|
42341
42393
|
}
|
|
@@ -42758,7 +42810,7 @@ function formatParamsForLog(params) {
|
|
|
42758
42810
|
agentTurnOptionsKeys: params.agentTurnOptions ? Object.keys(params.agentTurnOptions).sort() : undefined,
|
|
42759
42811
|
signal: params.signal ? { aborted: params.signal.aborted } : undefined,
|
|
42760
42812
|
logContext: params.logContext,
|
|
42761
|
-
detail:
|
|
42813
|
+
detail: `hidden (set ${VIBEMAN_ENV_KEYS.VERBOSE}=debug|trace for full prompt/env/context)`
|
|
42762
42814
|
});
|
|
42763
42815
|
try {
|
|
42764
42816
|
return JSON.stringify(summarized, null, 2);
|
|
@@ -42768,6 +42820,7 @@ function formatParamsForLog(params) {
|
|
|
42768
42820
|
}
|
|
42769
42821
|
var CLAUDE_EXECUTABLE_CANDIDATES, ClaudeRunError, ClaudeCodeCliProvider;
|
|
42770
42822
|
var init_claude_code_cli_provider = __esm(() => {
|
|
42823
|
+
init_env_policy();
|
|
42771
42824
|
init_log();
|
|
42772
42825
|
init_log_sanitizer();
|
|
42773
42826
|
CLAUDE_EXECUTABLE_CANDIDATES = process.platform === "win32" ? ["claude.exe", "claude.cmd", "claude.bat"] : ["claude"];
|
|
@@ -42865,10 +42918,10 @@ ${formatParamsForLog(params)}`);
|
|
|
42865
42918
|
resolveExecutable() {
|
|
42866
42919
|
const resolved = findClaudeExecutableOnPath();
|
|
42867
42920
|
if (resolved) {
|
|
42868
|
-
|
|
42921
|
+
safeLog("debug", { ...this.logContext, executable: resolved }, "Claude CLI resolved.");
|
|
42869
42922
|
return resolved;
|
|
42870
42923
|
}
|
|
42871
|
-
|
|
42924
|
+
safeLog("warn", this.logContext, "Claude CLI not found on PATH.");
|
|
42872
42925
|
return "";
|
|
42873
42926
|
}
|
|
42874
42927
|
async validateSetup() {
|
|
@@ -42881,7 +42934,7 @@ ${formatParamsForLog(params)}`);
|
|
|
42881
42934
|
};
|
|
42882
42935
|
}
|
|
42883
42936
|
const version3 = await this.getVersion(executable);
|
|
42884
|
-
|
|
42937
|
+
safeLog("info", { ...this.logContext, executable, version: version3 }, "Claude CLI validated.");
|
|
42885
42938
|
return { success: true, message: "Claude CLI available.", version: version3 };
|
|
42886
42939
|
}
|
|
42887
42940
|
async getVersion(executable) {
|
|
@@ -43324,23 +43377,29 @@ function buildCodexTurnOptions(params) {
|
|
|
43324
43377
|
import { execFile as execFile2 } from "node:child_process";
|
|
43325
43378
|
import { existsSync as existsSync4 } from "node:fs";
|
|
43326
43379
|
import { delimiter as delimiter2, dirname as dirname2, resolve as resolve4 } from "node:path";
|
|
43380
|
+
function safeLog2(method, ...args) {
|
|
43381
|
+
const fn = logger[method];
|
|
43382
|
+
if (typeof fn === "function") {
|
|
43383
|
+
fn.call(logger, ...args);
|
|
43384
|
+
}
|
|
43385
|
+
}
|
|
43327
43386
|
function resolveCodexCliPath(env, logContext) {
|
|
43328
|
-
const envOverride = env?.CODEX_PATH ?? process.env.CODEX_PATH;
|
|
43387
|
+
const envOverride = env?.[VIBEMAN_ENV_KEYS.CODEX_PATH] ?? process.env[VIBEMAN_ENV_KEYS.CODEX_PATH];
|
|
43329
43388
|
if (envOverride) {
|
|
43330
43389
|
const resolved = envOverride.trim();
|
|
43331
43390
|
if (resolved && existsSync4(resolved)) {
|
|
43332
43391
|
if (logContext) {
|
|
43333
|
-
|
|
43392
|
+
safeLog2("debug", { ...logContext, executable: resolved, source: "env" }, "Codex CLI resolved.");
|
|
43334
43393
|
}
|
|
43335
43394
|
return resolved;
|
|
43336
43395
|
}
|
|
43337
43396
|
if (logContext) {
|
|
43338
|
-
|
|
43397
|
+
safeLog2("warn", { ...logContext, executable: resolved }, "Codex CLI path override not found.");
|
|
43339
43398
|
}
|
|
43340
43399
|
}
|
|
43341
43400
|
const fromPath = findCodexExecutableOnPath();
|
|
43342
43401
|
if (fromPath && logContext) {
|
|
43343
|
-
|
|
43402
|
+
safeLog2("debug", { ...logContext, executable: fromPath }, "Codex CLI resolved.");
|
|
43344
43403
|
}
|
|
43345
43404
|
return fromPath || undefined;
|
|
43346
43405
|
}
|
|
@@ -43495,7 +43554,7 @@ function summarizeRunParamsForLog(params) {
|
|
|
43495
43554
|
agentThreadOptionsKeys: params.agentThreadOptions ? Object.keys(params.agentThreadOptions).sort() : undefined,
|
|
43496
43555
|
agentTurnOptionsKeys: params.agentTurnOptions ? Object.keys(params.agentTurnOptions).sort() : undefined,
|
|
43497
43556
|
logContext: params.logContext,
|
|
43498
|
-
detail:
|
|
43557
|
+
detail: `hidden (set ${VIBEMAN_ENV_KEYS.VERBOSE}=debug|trace for full prompt/env/context)`
|
|
43499
43558
|
});
|
|
43500
43559
|
}
|
|
43501
43560
|
return sanitizeForLog({
|
|
@@ -43541,6 +43600,7 @@ function emitRunEvent(onEvent, event, log) {
|
|
|
43541
43600
|
var CodexRunError, CodexCliProvider;
|
|
43542
43601
|
var init_codex_cli_provider = __esm(() => {
|
|
43543
43602
|
init_dist3();
|
|
43603
|
+
init_env_policy();
|
|
43544
43604
|
init_log_sanitizer();
|
|
43545
43605
|
init_log();
|
|
43546
43606
|
CodexRunError = class CodexRunError extends Error {
|
|
@@ -43674,10 +43734,10 @@ ${formatParamsForLog2(summarizeRunParamsForLog(params))}`);
|
|
|
43674
43734
|
resolveExecutable() {
|
|
43675
43735
|
const resolved = findCodexExecutableOnPath();
|
|
43676
43736
|
if (resolved) {
|
|
43677
|
-
|
|
43737
|
+
safeLog2("debug", { ...this.logContext, executable: resolved }, "Codex CLI resolved.");
|
|
43678
43738
|
return resolved;
|
|
43679
43739
|
}
|
|
43680
|
-
|
|
43740
|
+
safeLog2("warn", this.logContext, "Codex CLI not found on PATH.");
|
|
43681
43741
|
return "";
|
|
43682
43742
|
}
|
|
43683
43743
|
async validateSetup() {
|
|
@@ -43697,7 +43757,7 @@ ${formatParamsForLog2(summarizeRunParamsForLog(params))}`);
|
|
|
43697
43757
|
details: "Ensure the CLI can execute (for example, `node` is available on PATH)."
|
|
43698
43758
|
};
|
|
43699
43759
|
}
|
|
43700
|
-
|
|
43760
|
+
safeLog2("info", { ...this.logContext, executable, version: version3 }, "Codex CLI validated.");
|
|
43701
43761
|
return { success: true, message: "Codex CLI available.", version: version3 };
|
|
43702
43762
|
}
|
|
43703
43763
|
async getVersion(executable) {
|
|
@@ -43718,23 +43778,29 @@ ${formatParamsForLog2(summarizeRunParamsForLog(params))}`);
|
|
|
43718
43778
|
import { execFile as execFile3, spawn as spawn3 } from "node:child_process";
|
|
43719
43779
|
import { existsSync as existsSync5 } from "node:fs";
|
|
43720
43780
|
import { delimiter as delimiter3, resolve as resolve5 } from "node:path";
|
|
43781
|
+
function safeLog3(method, ...args) {
|
|
43782
|
+
const fn = logger[method];
|
|
43783
|
+
if (typeof fn === "function") {
|
|
43784
|
+
fn.call(logger, ...args);
|
|
43785
|
+
}
|
|
43786
|
+
}
|
|
43721
43787
|
function resolveGeminiCliPath(env, logContext) {
|
|
43722
|
-
const envOverride = env?.GEMINI_PATH ?? process.env.GEMINI_PATH;
|
|
43788
|
+
const envOverride = env?.[VIBEMAN_ENV_KEYS.GEMINI_PATH] ?? process.env[VIBEMAN_ENV_KEYS.GEMINI_PATH];
|
|
43723
43789
|
if (envOverride) {
|
|
43724
43790
|
const resolved = envOverride.trim();
|
|
43725
43791
|
if (resolved && existsSync5(resolved)) {
|
|
43726
43792
|
if (logContext) {
|
|
43727
|
-
|
|
43793
|
+
safeLog3("debug", { ...logContext, executable: resolved, source: "env" }, "Gemini CLI resolved.");
|
|
43728
43794
|
}
|
|
43729
43795
|
return resolved;
|
|
43730
43796
|
}
|
|
43731
43797
|
if (logContext) {
|
|
43732
|
-
|
|
43798
|
+
safeLog3("warn", { ...logContext, executable: resolved }, "Gemini CLI path override not found.");
|
|
43733
43799
|
}
|
|
43734
43800
|
}
|
|
43735
43801
|
const fromPath = findGeminiExecutableOnPath();
|
|
43736
43802
|
if (fromPath && logContext) {
|
|
43737
|
-
|
|
43803
|
+
safeLog3("debug", { ...logContext, executable: fromPath }, "Gemini CLI resolved.");
|
|
43738
43804
|
}
|
|
43739
43805
|
return fromPath || undefined;
|
|
43740
43806
|
}
|
|
@@ -44082,7 +44148,7 @@ function formatParamsForLog3(params) {
|
|
|
44082
44148
|
agentTurnOptionsKeys: params.agentTurnOptions ? Object.keys(params.agentTurnOptions).sort() : undefined,
|
|
44083
44149
|
signal: params.signal ? { aborted: params.signal.aborted } : undefined,
|
|
44084
44150
|
logContext: params.logContext,
|
|
44085
|
-
detail:
|
|
44151
|
+
detail: `hidden (set ${VIBEMAN_ENV_KEYS.VERBOSE}=debug|trace for full prompt/env/context)`
|
|
44086
44152
|
});
|
|
44087
44153
|
try {
|
|
44088
44154
|
return JSON.stringify(summarized, null, 2);
|
|
@@ -44092,6 +44158,7 @@ function formatParamsForLog3(params) {
|
|
|
44092
44158
|
}
|
|
44093
44159
|
var GEMINI_EXECUTABLE_CANDIDATES, GeminiRunError, GeminiCliProvider;
|
|
44094
44160
|
var init_gemini_cli_provider = __esm(() => {
|
|
44161
|
+
init_env_policy();
|
|
44095
44162
|
init_log();
|
|
44096
44163
|
init_log_sanitizer();
|
|
44097
44164
|
GEMINI_EXECUTABLE_CANDIDATES = process.platform === "win32" ? ["gemini.exe", "gemini.cmd", "gemini.bat"] : ["gemini"];
|
|
@@ -44189,10 +44256,10 @@ ${formatParamsForLog3(params)}`);
|
|
|
44189
44256
|
resolveExecutable() {
|
|
44190
44257
|
const resolved = findGeminiExecutableOnPath();
|
|
44191
44258
|
if (resolved) {
|
|
44192
|
-
|
|
44259
|
+
safeLog3("debug", { ...this.logContext, executable: resolved }, "Gemini CLI resolved.");
|
|
44193
44260
|
return resolved;
|
|
44194
44261
|
}
|
|
44195
|
-
|
|
44262
|
+
safeLog3("warn", this.logContext, "Gemini CLI not found on PATH.");
|
|
44196
44263
|
return "";
|
|
44197
44264
|
}
|
|
44198
44265
|
async validateSetup() {
|
|
@@ -44205,7 +44272,7 @@ ${formatParamsForLog3(params)}`);
|
|
|
44205
44272
|
};
|
|
44206
44273
|
}
|
|
44207
44274
|
const version3 = await this.getVersion(executable);
|
|
44208
|
-
|
|
44275
|
+
safeLog3("info", { ...this.logContext, executable, version: version3 }, "Gemini CLI validated.");
|
|
44209
44276
|
return { success: true, message: "Gemini CLI available.", version: version3 };
|
|
44210
44277
|
}
|
|
44211
44278
|
async getVersion(executable) {
|
|
@@ -44235,6 +44302,7 @@ var init_dist_layout = __esm(() => {
|
|
|
44235
44302
|
prismaRoot: "prisma",
|
|
44236
44303
|
prismaSchema: "prisma/schema.prisma",
|
|
44237
44304
|
resourcesRoot: "resources",
|
|
44305
|
+
nodePtyPackageRoot: "node_modules/node-pty",
|
|
44238
44306
|
scriptsRoot: "scripts",
|
|
44239
44307
|
fixtureInitScript: "scripts/init-test-repo.mjs",
|
|
44240
44308
|
fixtureSeedScript: "scripts/seed-test-fixtures.mjs",
|
|
@@ -44249,8 +44317,9 @@ import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
|
44249
44317
|
var currentDir, distRoot, packagedSchema, isPackaged, packagedDistRoot, apiRoot, schemaPath, prismaConfigPath, migrationsDir;
|
|
44250
44318
|
var init_paths = __esm(() => {
|
|
44251
44319
|
init_dist_layout();
|
|
44320
|
+
init_vibeman_env();
|
|
44252
44321
|
currentDir = dirname3(fileURLToPath3(import.meta.url));
|
|
44253
|
-
distRoot = process.env.
|
|
44322
|
+
distRoot = process.env[VIBEMAN_ENV_KEYS.DIST_ROOT];
|
|
44254
44323
|
packagedSchema = distRoot ? resolve6(distRoot, DIST_LAYOUT.prismaSchema) : "";
|
|
44255
44324
|
isPackaged = Boolean(packagedSchema) && existsSync6(packagedSchema);
|
|
44256
44325
|
packagedDistRoot = isPackaged && distRoot ? distRoot : "";
|
|
@@ -45339,7 +45408,7 @@ async function initializeDatabase(root) {
|
|
|
45339
45408
|
const localDbPath = dbPath;
|
|
45340
45409
|
await ensureGitignoreHasDbFile(root);
|
|
45341
45410
|
const databaseUrl = `file:${dbPath}`;
|
|
45342
|
-
process.env.DATABASE_URL = databaseUrl;
|
|
45411
|
+
process.env[VIBEMAN_ENV_KEYS.DATABASE_URL] = databaseUrl;
|
|
45343
45412
|
const databaseTarget = { kind: "local", path: localDbPath };
|
|
45344
45413
|
startupStatus = { state: "initializing", database: databaseTarget };
|
|
45345
45414
|
const migrationError = await runMigrations(databaseUrl, databaseTarget, localDbPath);
|
|
@@ -45416,7 +45485,7 @@ async function runMigrations(databaseUrl, databaseTarget, localDbPath) {
|
|
|
45416
45485
|
} catch (error48) {
|
|
45417
45486
|
const kind = classifyMigrationError(error48);
|
|
45418
45487
|
const details = formatMigrationDetails(error48);
|
|
45419
|
-
const canAutoRecover = databaseTarget.kind === "local" && localDbPath && (kind === "failed-migrations" || kind === "schema-mismatch") && process.env.
|
|
45488
|
+
const canAutoRecover = databaseTarget.kind === "local" && localDbPath && (kind === "failed-migrations" || kind === "schema-mismatch") && process.env[VIBEMAN_ENV_KEYS.DB_AUTORECOVER] === "1";
|
|
45420
45489
|
if (canAutoRecover) {
|
|
45421
45490
|
console.warn(`[db] Migration failed (${kind}). Attempting auto-recovery by backing up and recreating the local database.`);
|
|
45422
45491
|
try {
|
|
@@ -45689,18 +45758,18 @@ function logStartupError(error48) {
|
|
|
45689
45758
|
`));
|
|
45690
45759
|
}
|
|
45691
45760
|
async function ensureCodexCliPath(db) {
|
|
45692
|
-
const envPath = process.env.CODEX_PATH
|
|
45761
|
+
const envPath = readVibemanEnv(process.env, VIBEMAN_ENV_KEYS.CODEX_PATH);
|
|
45693
45762
|
if (envPath) {
|
|
45694
45763
|
if (existsSync10(envPath)) {
|
|
45695
45764
|
await setCodexCliPathSetting(db, envPath);
|
|
45696
45765
|
return "env";
|
|
45697
45766
|
}
|
|
45698
|
-
console.warn(`[config] CODEX_PATH is invalid and will be ignored: ${envPath}`);
|
|
45767
|
+
console.warn(`[config] ${VIBEMAN_ENV_KEYS.CODEX_PATH} is invalid and will be ignored: ${envPath}`);
|
|
45699
45768
|
}
|
|
45700
45769
|
const storedPath = await getCodexCliPathSetting(db);
|
|
45701
45770
|
if (storedPath) {
|
|
45702
45771
|
if (existsSync10(storedPath)) {
|
|
45703
|
-
process.env.CODEX_PATH = storedPath;
|
|
45772
|
+
process.env[VIBEMAN_ENV_KEYS.CODEX_PATH] = storedPath;
|
|
45704
45773
|
return "db";
|
|
45705
45774
|
}
|
|
45706
45775
|
await clearCodexCliPathSetting(db);
|
|
@@ -45709,24 +45778,24 @@ async function ensureCodexCliPath(db) {
|
|
|
45709
45778
|
const detectedPath = resolveCodexCliPath();
|
|
45710
45779
|
if (detectedPath && existsSync10(detectedPath)) {
|
|
45711
45780
|
await setCodexCliPathSetting(db, detectedPath);
|
|
45712
|
-
process.env.CODEX_PATH = detectedPath;
|
|
45781
|
+
process.env[VIBEMAN_ENV_KEYS.CODEX_PATH] = detectedPath;
|
|
45713
45782
|
return "auto-detected";
|
|
45714
45783
|
}
|
|
45715
45784
|
return "none";
|
|
45716
45785
|
}
|
|
45717
45786
|
async function ensureGeminiCliPath(db) {
|
|
45718
|
-
const envPath = process.env.GEMINI_PATH
|
|
45787
|
+
const envPath = readVibemanEnv(process.env, VIBEMAN_ENV_KEYS.GEMINI_PATH);
|
|
45719
45788
|
if (envPath) {
|
|
45720
45789
|
if (existsSync10(envPath)) {
|
|
45721
45790
|
await setGeminiCliPathSetting(db, envPath);
|
|
45722
45791
|
return "env";
|
|
45723
45792
|
}
|
|
45724
|
-
console.warn(`[config] GEMINI_PATH is invalid and will be ignored: ${envPath}`);
|
|
45793
|
+
console.warn(`[config] ${VIBEMAN_ENV_KEYS.GEMINI_PATH} is invalid and will be ignored: ${envPath}`);
|
|
45725
45794
|
}
|
|
45726
45795
|
const storedPath = await getGeminiCliPathSetting(db);
|
|
45727
45796
|
if (storedPath) {
|
|
45728
45797
|
if (existsSync10(storedPath)) {
|
|
45729
|
-
process.env.GEMINI_PATH = storedPath;
|
|
45798
|
+
process.env[VIBEMAN_ENV_KEYS.GEMINI_PATH] = storedPath;
|
|
45730
45799
|
return "db";
|
|
45731
45800
|
}
|
|
45732
45801
|
await clearGeminiCliPathSetting(db);
|
|
@@ -45735,24 +45804,24 @@ async function ensureGeminiCliPath(db) {
|
|
|
45735
45804
|
const detectedPath = resolveGeminiCliPath();
|
|
45736
45805
|
if (detectedPath && existsSync10(detectedPath)) {
|
|
45737
45806
|
await setGeminiCliPathSetting(db, detectedPath);
|
|
45738
|
-
process.env.GEMINI_PATH = detectedPath;
|
|
45807
|
+
process.env[VIBEMAN_ENV_KEYS.GEMINI_PATH] = detectedPath;
|
|
45739
45808
|
return "auto-detected";
|
|
45740
45809
|
}
|
|
45741
45810
|
return "none";
|
|
45742
45811
|
}
|
|
45743
45812
|
async function ensureClaudeCodeCliPath(db) {
|
|
45744
|
-
const envPath = process.env.CLAUDE_CODE_PATH
|
|
45813
|
+
const envPath = readVibemanEnv(process.env, VIBEMAN_ENV_KEYS.CLAUDE_CODE_PATH);
|
|
45745
45814
|
if (envPath) {
|
|
45746
45815
|
if (existsSync10(envPath)) {
|
|
45747
45816
|
await setClaudeCodeCliPathSetting(db, envPath);
|
|
45748
45817
|
return "env";
|
|
45749
45818
|
}
|
|
45750
|
-
console.warn(`[config] CLAUDE_CODE_PATH is invalid and will be ignored: ${envPath}`);
|
|
45819
|
+
console.warn(`[config] ${VIBEMAN_ENV_KEYS.CLAUDE_CODE_PATH} is invalid and will be ignored: ${envPath}`);
|
|
45751
45820
|
}
|
|
45752
45821
|
const storedPath = await getClaudeCodeCliPathSetting(db);
|
|
45753
45822
|
if (storedPath) {
|
|
45754
45823
|
if (existsSync10(storedPath)) {
|
|
45755
|
-
process.env.CLAUDE_CODE_PATH = storedPath;
|
|
45824
|
+
process.env[VIBEMAN_ENV_KEYS.CLAUDE_CODE_PATH] = storedPath;
|
|
45756
45825
|
return "db";
|
|
45757
45826
|
}
|
|
45758
45827
|
await clearClaudeCodeCliPathSetting(db);
|
|
@@ -45761,7 +45830,7 @@ async function ensureClaudeCodeCliPath(db) {
|
|
|
45761
45830
|
const detectedPath = resolveClaudeCodeCliPath();
|
|
45762
45831
|
if (detectedPath && existsSync10(detectedPath)) {
|
|
45763
45832
|
await setClaudeCodeCliPathSetting(db, detectedPath);
|
|
45764
|
-
process.env.CLAUDE_CODE_PATH = detectedPath;
|
|
45833
|
+
process.env[VIBEMAN_ENV_KEYS.CLAUDE_CODE_PATH] = detectedPath;
|
|
45765
45834
|
return "auto-detected";
|
|
45766
45835
|
}
|
|
45767
45836
|
return "none";
|
|
@@ -45772,6 +45841,7 @@ var init_db = __esm(() => {
|
|
|
45772
45841
|
init_claude_code_cli_provider();
|
|
45773
45842
|
init_codex_cli_provider();
|
|
45774
45843
|
init_gemini_cli_provider();
|
|
45844
|
+
init_env_policy();
|
|
45775
45845
|
init_paths();
|
|
45776
45846
|
init_migrate();
|
|
45777
45847
|
init_storage();
|
|
@@ -101110,6 +101180,12 @@ var init_dist8 = __esm(() => {
|
|
|
101110
101180
|
});
|
|
101111
101181
|
|
|
101112
101182
|
// ../api/src/services/workflows/logs.ts
|
|
101183
|
+
function safeLog4(method, ...args) {
|
|
101184
|
+
const fn = logger[method];
|
|
101185
|
+
if (typeof fn === "function") {
|
|
101186
|
+
fn.call(logger, ...args);
|
|
101187
|
+
}
|
|
101188
|
+
}
|
|
101113
101189
|
async function appendRunLog(db, runId, entry) {
|
|
101114
101190
|
maybeCleanupWorkflowLogs(db);
|
|
101115
101191
|
await db.workflowRunLog.create({
|
|
@@ -101211,7 +101287,7 @@ async function cleanupWorkflowLogs(db, now = Date.now()) {
|
|
|
101211
101287
|
}
|
|
101212
101288
|
});
|
|
101213
101289
|
if (result.count > 0) {
|
|
101214
|
-
|
|
101290
|
+
safeLog4("info", {
|
|
101215
101291
|
module: "workflow",
|
|
101216
101292
|
retentionDays: workflowLogRetentionDays,
|
|
101217
101293
|
deletedCount: result.count
|
|
@@ -101220,7 +101296,7 @@ async function cleanupWorkflowLogs(db, now = Date.now()) {
|
|
|
101220
101296
|
return { deletedCount: result.count, skipped: false };
|
|
101221
101297
|
} catch (error48) {
|
|
101222
101298
|
const message = error48 instanceof Error ? error48.message : String(error48);
|
|
101223
|
-
|
|
101299
|
+
safeLog4("warn", { module: "workflow", errorMessage: message }, `Workflow log cleanup failed: ${message}`);
|
|
101224
101300
|
return { deletedCount: 0, skipped: false, error: message };
|
|
101225
101301
|
}
|
|
101226
101302
|
}
|
|
@@ -101911,6 +101987,7 @@ var init_prompt_builder = __esm(() => {
|
|
|
101911
101987
|
// ../api/src/services/workflows/executor.ts
|
|
101912
101988
|
import { spawn as spawn5 } from "node:child_process";
|
|
101913
101989
|
import { readFileSync as readFileSync4 } from "node:fs";
|
|
101990
|
+
import { resolve as resolvePath4 } from "node:path";
|
|
101914
101991
|
function createExecutorControl() {
|
|
101915
101992
|
const abortController = new AbortController;
|
|
101916
101993
|
let child = null;
|
|
@@ -102757,9 +102834,13 @@ function hasBunScript(cwd2, scriptName) {
|
|
|
102757
102834
|
}
|
|
102758
102835
|
}
|
|
102759
102836
|
function buildShellEnv(input) {
|
|
102837
|
+
const isolateWorktreeInheritedEnv = shouldIsolateWorktreeInheritedEnv(input);
|
|
102760
102838
|
const baseEnv = {};
|
|
102761
102839
|
for (const [key, value] of Object.entries(process.env)) {
|
|
102762
102840
|
if (typeof value === "string") {
|
|
102841
|
+
if (isolateWorktreeInheritedEnv && shouldFilterForWorktreeShellInheritance({ env: process.env, key, value })) {
|
|
102842
|
+
continue;
|
|
102843
|
+
}
|
|
102763
102844
|
baseEnv[key] = value;
|
|
102764
102845
|
}
|
|
102765
102846
|
}
|
|
@@ -102788,6 +102869,26 @@ function buildShellEnv(input) {
|
|
|
102788
102869
|
}
|
|
102789
102870
|
return baseEnv;
|
|
102790
102871
|
}
|
|
102872
|
+
function shouldIsolateWorktreeInheritedEnv(input) {
|
|
102873
|
+
const payload = input.runPayload ?? {};
|
|
102874
|
+
const worktreePath = normalizeEnvPath(payload.worktreePath);
|
|
102875
|
+
if (!worktreePath) {
|
|
102876
|
+
return false;
|
|
102877
|
+
}
|
|
102878
|
+
const repoRoot = normalizeEnvPath(payload.repoRoot ?? payload.root ?? input.root);
|
|
102879
|
+
if (!repoRoot) {
|
|
102880
|
+
return true;
|
|
102881
|
+
}
|
|
102882
|
+
return worktreePath !== repoRoot;
|
|
102883
|
+
}
|
|
102884
|
+
function normalizeEnvPath(raw2) {
|
|
102885
|
+
if (typeof raw2 !== "string")
|
|
102886
|
+
return null;
|
|
102887
|
+
const trimmed2 = raw2.trim();
|
|
102888
|
+
if (trimmed2.length === 0)
|
|
102889
|
+
return null;
|
|
102890
|
+
return resolvePath4(trimmed2);
|
|
102891
|
+
}
|
|
102791
102892
|
function summarizeShellFailure(command, result) {
|
|
102792
102893
|
const SNIPPET_LINES = 30;
|
|
102793
102894
|
const statusLine = [
|
|
@@ -102878,6 +102979,7 @@ var init_executor = __esm(() => {
|
|
|
102878
102979
|
init_codex_cli_provider();
|
|
102879
102980
|
init_gemini_cli_provider();
|
|
102880
102981
|
init_runtime_backend();
|
|
102982
|
+
init_env_policy();
|
|
102881
102983
|
init_provider_factory();
|
|
102882
102984
|
init_provider_registry();
|
|
102883
102985
|
init_model_aliases();
|
|
@@ -102891,6 +102993,12 @@ var init_executor = __esm(() => {
|
|
|
102891
102993
|
// ../api/src/services/workflows/runner.ts
|
|
102892
102994
|
import { readFile as readFile3, writeFile as writeFile2 } from "node:fs/promises";
|
|
102893
102995
|
import { normalize as normalize7, resolve as resolve13 } from "node:path";
|
|
102996
|
+
function safeLog5(method, ...args) {
|
|
102997
|
+
const fn = logger[method];
|
|
102998
|
+
if (typeof fn === "function") {
|
|
102999
|
+
fn.call(logger, ...args);
|
|
103000
|
+
}
|
|
103001
|
+
}
|
|
102894
103002
|
function isTerminalRunStatus(status) {
|
|
102895
103003
|
return TERMINAL_RUN_STATUSES.has(status);
|
|
102896
103004
|
}
|
|
@@ -103178,7 +103286,7 @@ function queueWorkflowExecution(db, input) {
|
|
|
103178
103286
|
executorType: "coding_agent",
|
|
103179
103287
|
error: error48
|
|
103180
103288
|
});
|
|
103181
|
-
|
|
103289
|
+
safeLog5("error", { module: "workflow", runId: input.runId, error: classified.message }, "safeExecuteWorkflow wrapper failed. Marking workflow run failed.");
|
|
103182
103290
|
markRunFailedFromUnhandledError(db, input.runId, {
|
|
103183
103291
|
message: classified.message,
|
|
103184
103292
|
failureReason: input.failureReason ?? classified.failureReason,
|
|
@@ -103186,7 +103294,7 @@ function queueWorkflowExecution(db, input) {
|
|
|
103186
103294
|
currentNodeKey: input.currentNodeKey
|
|
103187
103295
|
}).catch((persistError) => {
|
|
103188
103296
|
const persistMessage = persistError instanceof Error ? persistError.message : String(persistError);
|
|
103189
|
-
|
|
103297
|
+
safeLog5("error", { module: "workflow", runId: input.runId, error: persistMessage }, "Unable to persist failed status after safeExecuteWorkflow wrapper failure.");
|
|
103190
103298
|
});
|
|
103191
103299
|
});
|
|
103192
103300
|
}
|
|
@@ -103198,7 +103306,7 @@ async function safeExecuteWorkflow(db, input) {
|
|
|
103198
103306
|
executorType: "coding_agent",
|
|
103199
103307
|
error: error48
|
|
103200
103308
|
});
|
|
103201
|
-
|
|
103309
|
+
safeLog5("error", { module: "workflow", runId: input.runId, error: classified.message }, "Workflow failed.");
|
|
103202
103310
|
await markRunFailedFromUnhandledError(db, input.runId, {
|
|
103203
103311
|
message: classified.message,
|
|
103204
103312
|
failureReason: input.failureReason ?? classified.failureReason,
|
|
@@ -103261,7 +103369,7 @@ async function markRunFailedFromUnhandledError(db, runId, input) {
|
|
|
103261
103369
|
});
|
|
103262
103370
|
} catch (error48) {
|
|
103263
103371
|
const message = error48 instanceof Error ? error48.message : String(error48);
|
|
103264
|
-
|
|
103372
|
+
safeLog5("error", { module: "workflow", runId, error: message }, "Failed to persist workflow state via read/persist path. Trying fallback update.");
|
|
103265
103373
|
await updateRunFailureFallback(db, {
|
|
103266
103374
|
runId,
|
|
103267
103375
|
message: input.message,
|
|
@@ -103709,7 +103817,7 @@ function createNode(db, node) {
|
|
|
103709
103817
|
}));
|
|
103710
103818
|
if (result.paused) {
|
|
103711
103819
|
const detail = formatExecutorFailureForLog(result);
|
|
103712
|
-
|
|
103820
|
+
safeLog5("warn", { module: "workflow", runId: state.runId, nodeKey: node.nodeKey, attempt }, `Node paused: ${node.nodeKey} (attempt ${attempt})${detail ? `
|
|
103713
103821
|
${detail}` : ""}`);
|
|
103714
103822
|
} else if (result.success) {
|
|
103715
103823
|
logWorkflow(state.runId, `Node completed: ${node.nodeKey} (attempt ${attempt})`, {
|
|
@@ -103718,7 +103826,7 @@ ${detail}` : ""}`);
|
|
|
103718
103826
|
});
|
|
103719
103827
|
} else {
|
|
103720
103828
|
const detail = formatExecutorFailureForLog(result);
|
|
103721
|
-
|
|
103829
|
+
safeLog5("error", { module: "workflow", runId: state.runId, nodeKey: node.nodeKey, attempt }, `Node failed: ${node.nodeKey} (attempt ${attempt})${detail ? `
|
|
103722
103830
|
${detail}` : ""}`);
|
|
103723
103831
|
}
|
|
103724
103832
|
const basePayload = buildRunPayloadAfterNodeResult({
|
|
@@ -103930,13 +104038,13 @@ async function updateRunStatus(db, runId, status, nodeKey, message, options2) {
|
|
|
103930
104038
|
if (status === "failed") {
|
|
103931
104039
|
const detail = typeof message === "string" && message.trim().length > 0 ? `
|
|
103932
104040
|
${tailText(message, 8000)}` : "";
|
|
103933
|
-
|
|
104041
|
+
safeLog5("error", logData, `Run status: failed${nodeSuffix}${detail}`);
|
|
103934
104042
|
} else if (status === "paused") {
|
|
103935
104043
|
const detail = typeof message === "string" && message.trim().length > 0 ? `
|
|
103936
104044
|
${tailText(message, 8000)}` : "";
|
|
103937
|
-
|
|
104045
|
+
safeLog5("warn", logData, `Run status: paused${nodeSuffix}${detail}`);
|
|
103938
104046
|
} else {
|
|
103939
|
-
|
|
104047
|
+
safeLog5("info", logData, `Run status: ${status}${nodeSuffix}`);
|
|
103940
104048
|
}
|
|
103941
104049
|
const current = await readRunState(db, runId);
|
|
103942
104050
|
if (isTerminalRunStatus(current.status)) {
|
|
@@ -104750,7 +104858,7 @@ async function updateTaskStatusForRunPayload(input) {
|
|
|
104750
104858
|
}
|
|
104751
104859
|
} catch (error48) {
|
|
104752
104860
|
const message = error48 instanceof Error ? error48.message : String(error48);
|
|
104753
|
-
|
|
104861
|
+
safeLog5("warn", {
|
|
104754
104862
|
module: "workflow",
|
|
104755
104863
|
runId: input.runId,
|
|
104756
104864
|
nodeKey: input.nodeKey,
|
|
@@ -104785,7 +104893,7 @@ async function autoCommitTaskStatusUpdate(input) {
|
|
|
104785
104893
|
if (isNothingToCommitError(message)) {
|
|
104786
104894
|
return;
|
|
104787
104895
|
}
|
|
104788
|
-
|
|
104896
|
+
safeLog5("warn", {
|
|
104789
104897
|
module: "workflow",
|
|
104790
104898
|
runId: input.runId,
|
|
104791
104899
|
nodeKey: input.nodeKey,
|
|
@@ -104798,7 +104906,7 @@ function createLog2(event, data) {
|
|
|
104798
104906
|
return { ts: new Date().toISOString(), level: "info", event, data };
|
|
104799
104907
|
}
|
|
104800
104908
|
function logWorkflow(runId, message, data) {
|
|
104801
|
-
|
|
104909
|
+
safeLog5("info", { module: "workflow", runId, ...data }, message);
|
|
104802
104910
|
}
|
|
104803
104911
|
function tailText(text, maxChars) {
|
|
104804
104912
|
const normalized = text.replace(/\r\n/g, `
|
|
@@ -107486,6 +107594,17 @@ function isWithin2(rootPath, targetPath) {
|
|
|
107486
107594
|
const relativePath = relative6(rootPath, targetPath);
|
|
107487
107595
|
return relativePath === "" || !relativePath.startsWith("..") && !relativePath.startsWith(`..${sep3}`);
|
|
107488
107596
|
}
|
|
107597
|
+
function buildAppLaunchEnv(env) {
|
|
107598
|
+
const next = {};
|
|
107599
|
+
for (const [key, value] of Object.entries(env)) {
|
|
107600
|
+
if (typeof value !== "string")
|
|
107601
|
+
continue;
|
|
107602
|
+
if (shouldFilterForExternalAppLaunch({ env, key, value }))
|
|
107603
|
+
continue;
|
|
107604
|
+
next[key] = value;
|
|
107605
|
+
}
|
|
107606
|
+
return next;
|
|
107607
|
+
}
|
|
107489
107608
|
function resolveDetectionPath(rawPath) {
|
|
107490
107609
|
if (rawPath.startsWith("~/")) {
|
|
107491
107610
|
return resolve16(homedir2(), rawPath.slice(2));
|
|
@@ -107543,7 +107662,10 @@ function resolveAppDefinition(category, appId) {
|
|
|
107543
107662
|
return app;
|
|
107544
107663
|
}
|
|
107545
107664
|
async function openInApp(appName, targetPath) {
|
|
107546
|
-
const child = spawn7("open", ["-a", appName, targetPath], {
|
|
107665
|
+
const child = spawn7("open", ["-a", appName, targetPath], {
|
|
107666
|
+
stdio: "ignore",
|
|
107667
|
+
env: buildAppLaunchEnv(process.env)
|
|
107668
|
+
});
|
|
107547
107669
|
await new Promise((resolvePromise, rejectPromise) => {
|
|
107548
107670
|
child.once("error", (error48) => rejectPromise(error48));
|
|
107549
107671
|
child.once("close", (code) => {
|
|
@@ -107560,6 +107682,7 @@ var init_system2 = __esm(() => {
|
|
|
107560
107682
|
init_dist4();
|
|
107561
107683
|
init_zod();
|
|
107562
107684
|
init_trpc();
|
|
107685
|
+
init_env_policy();
|
|
107563
107686
|
init_remote_access();
|
|
107564
107687
|
appCategories = ["terminal", "editor"];
|
|
107565
107688
|
appCatalog = [
|
|
@@ -108307,6 +108430,7 @@ var init_cli_settings = __esm(() => {
|
|
|
108307
108430
|
init_model_catalog();
|
|
108308
108431
|
init_model_aliases();
|
|
108309
108432
|
init_settings();
|
|
108433
|
+
init_env_policy();
|
|
108310
108434
|
cliIdSchema = exports_external.enum(AGENT_PROVIDER_IDS);
|
|
108311
108435
|
updatePathSchema = exports_external.object({
|
|
108312
108436
|
id: cliIdSchema,
|
|
@@ -108357,9 +108481,9 @@ var init_cli_settings = __esm(() => {
|
|
|
108357
108481
|
id: exports_external.string().trim().min(1)
|
|
108358
108482
|
});
|
|
108359
108483
|
CLI_ENV_BY_PROVIDER = {
|
|
108360
|
-
"codex-cli":
|
|
108361
|
-
"gemini-cli":
|
|
108362
|
-
"claude-code":
|
|
108484
|
+
"codex-cli": VIBEMAN_ENV_KEYS.CODEX_PATH,
|
|
108485
|
+
"gemini-cli": VIBEMAN_ENV_KEYS.GEMINI_PATH,
|
|
108486
|
+
"claude-code": VIBEMAN_ENV_KEYS.CLAUDE_CODE_PATH
|
|
108363
108487
|
};
|
|
108364
108488
|
BASE_PROVIDER_BY_RUNTIME_ADAPTER = new Map(AGENT_PROVIDER_IDS.map((providerId) => {
|
|
108365
108489
|
const definition = getAgentProviderDefinition(providerId);
|
|
@@ -122980,16 +123104,463 @@ function isAddressInUseError(error48) {
|
|
|
122980
123104
|
var MIN_PORT = 1, MAX_PORT = 65535;
|
|
122981
123105
|
var init_port_utils = () => {};
|
|
122982
123106
|
|
|
123107
|
+
// ../api/src/services/pty-session.ts
|
|
123108
|
+
import { chmodSync, statSync as statSync3 } from "node:fs";
|
|
123109
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
123110
|
+
import { dirname as dirname6, join as join8 } from "node:path";
|
|
123111
|
+
import * as pty from "node-pty";
|
|
123112
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
123113
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
123114
|
+
function buildShellCandidates() {
|
|
123115
|
+
if (process.platform === "win32") {
|
|
123116
|
+
return ["powershell.exe", "pwsh.exe", "cmd.exe"];
|
|
123117
|
+
}
|
|
123118
|
+
const candidates = new Set;
|
|
123119
|
+
const configured = process.env.SHELL?.trim();
|
|
123120
|
+
if (configured) {
|
|
123121
|
+
candidates.add(configured);
|
|
123122
|
+
}
|
|
123123
|
+
for (const fallbackShell of NON_WINDOWS_FALLBACK_SHELLS) {
|
|
123124
|
+
try {
|
|
123125
|
+
const stats = statSync3(fallbackShell);
|
|
123126
|
+
if (stats.isFile()) {
|
|
123127
|
+
candidates.add(fallbackShell);
|
|
123128
|
+
}
|
|
123129
|
+
} catch {}
|
|
123130
|
+
}
|
|
123131
|
+
return Array.from(candidates);
|
|
123132
|
+
}
|
|
123133
|
+
function generateId() {
|
|
123134
|
+
return `pty_${randomUUID2()}`;
|
|
123135
|
+
}
|
|
123136
|
+
function ensureNodePtySpawnHelperExecutable() {
|
|
123137
|
+
if (process.platform !== "darwin")
|
|
123138
|
+
return;
|
|
123139
|
+
const helperCandidates = new Set;
|
|
123140
|
+
try {
|
|
123141
|
+
const packageJsonPath = require2.resolve("node-pty/package.json");
|
|
123142
|
+
helperCandidates.add(join8(dirname6(packageJsonPath), "prebuilds", `darwin-${process.arch}`, "spawn-helper"));
|
|
123143
|
+
} catch {}
|
|
123144
|
+
const bundledDistHelperPath = join8(dirname6(fileURLToPath4(import.meta.url)), "prebuilds", `darwin-${process.arch}`, "spawn-helper");
|
|
123145
|
+
helperCandidates.add(bundledDistHelperPath);
|
|
123146
|
+
for (const helperPath of helperCandidates) {
|
|
123147
|
+
try {
|
|
123148
|
+
const stats = statSync3(helperPath);
|
|
123149
|
+
if ((stats.mode & 73) !== 0) {
|
|
123150
|
+
return;
|
|
123151
|
+
}
|
|
123152
|
+
chmodSync(helperPath, stats.mode | 493);
|
|
123153
|
+
log.info({ helperPath }, "Restored execute bit on node-pty spawn-helper");
|
|
123154
|
+
return;
|
|
123155
|
+
} catch {}
|
|
123156
|
+
}
|
|
123157
|
+
log.warn({ helperPaths: Array.from(helperCandidates) }, "Failed to ensure node-pty spawn-helper is executable");
|
|
123158
|
+
}
|
|
123159
|
+
function createSession(options2) {
|
|
123160
|
+
const id = generateId();
|
|
123161
|
+
const cols = options2.cols ?? DEFAULT_COLS;
|
|
123162
|
+
const rows = options2.rows ?? DEFAULT_ROWS;
|
|
123163
|
+
const shellCandidates = buildShellCandidates();
|
|
123164
|
+
const env = {
|
|
123165
|
+
...process.env,
|
|
123166
|
+
TERM: "xterm-256color",
|
|
123167
|
+
COLORTERM: "truecolor",
|
|
123168
|
+
VIBEMAN_TERMINAL: options2.scope
|
|
123169
|
+
};
|
|
123170
|
+
ensureNodePtySpawnHelperExecutable();
|
|
123171
|
+
let proc = null;
|
|
123172
|
+
let resolvedShell = "";
|
|
123173
|
+
let lastError;
|
|
123174
|
+
for (const shell of shellCandidates) {
|
|
123175
|
+
try {
|
|
123176
|
+
proc = pty.spawn(shell, [], {
|
|
123177
|
+
name: "xterm-256color",
|
|
123178
|
+
cols,
|
|
123179
|
+
rows,
|
|
123180
|
+
cwd: options2.cwd,
|
|
123181
|
+
env
|
|
123182
|
+
});
|
|
123183
|
+
resolvedShell = shell;
|
|
123184
|
+
break;
|
|
123185
|
+
} catch (error48) {
|
|
123186
|
+
lastError = error48;
|
|
123187
|
+
log.warn({ shell, error: error48 }, "Failed to spawn PTY with shell candidate");
|
|
123188
|
+
}
|
|
123189
|
+
}
|
|
123190
|
+
if (!proc) {
|
|
123191
|
+
const fallbackText = shellCandidates.length > 0 ? shellCandidates.join(", ") : process.platform === "win32" ? "powershell.exe" : NON_WINDOWS_FALLBACK_SHELLS.join(", ");
|
|
123192
|
+
const suffix = lastError instanceof Error ? `${lastError.name}: ${lastError.message}` : typeof lastError === "string" ? lastError : "unknown error";
|
|
123193
|
+
throw new Error(`Failed to spawn terminal shell. Tried: ${fallbackText}. Last error: ${suffix}`);
|
|
123194
|
+
}
|
|
123195
|
+
const session = {
|
|
123196
|
+
meta: { id, scope: options2.scope, cwd: options2.cwd, createdAt: Date.now() },
|
|
123197
|
+
process: proc,
|
|
123198
|
+
listeners: new Set,
|
|
123199
|
+
exitListeners: new Set,
|
|
123200
|
+
scrollback: [],
|
|
123201
|
+
scrollbackBytes: 0,
|
|
123202
|
+
exited: false
|
|
123203
|
+
};
|
|
123204
|
+
proc.onData((data) => {
|
|
123205
|
+
session.scrollback.push(data);
|
|
123206
|
+
session.scrollbackBytes += data.length;
|
|
123207
|
+
if (session.scrollback.length > SCROLLBACK_LIMIT) {
|
|
123208
|
+
const removed = session.scrollback.splice(0, session.scrollback.length - SCROLLBACK_LIMIT);
|
|
123209
|
+
for (const chunk of removed)
|
|
123210
|
+
session.scrollbackBytes -= chunk.length;
|
|
123211
|
+
}
|
|
123212
|
+
while (session.scrollbackBytes > SCROLLBACK_BYTE_LIMIT && session.scrollback.length > 0) {
|
|
123213
|
+
const removed = session.scrollback.shift();
|
|
123214
|
+
session.scrollbackBytes -= removed.length;
|
|
123215
|
+
}
|
|
123216
|
+
for (const listener of session.listeners) {
|
|
123217
|
+
try {
|
|
123218
|
+
listener(data);
|
|
123219
|
+
} catch {}
|
|
123220
|
+
}
|
|
123221
|
+
});
|
|
123222
|
+
proc.onExit(({ exitCode, signal }) => {
|
|
123223
|
+
log.info({ sessionId: id, exitCode, signal }, "PTY session exited");
|
|
123224
|
+
session.exited = true;
|
|
123225
|
+
const exitInfo = { exitCode, signal };
|
|
123226
|
+
for (const listener of session.exitListeners) {
|
|
123227
|
+
try {
|
|
123228
|
+
listener(exitInfo);
|
|
123229
|
+
} catch {}
|
|
123230
|
+
}
|
|
123231
|
+
session.exitListeners.clear();
|
|
123232
|
+
setTimeout(() => {
|
|
123233
|
+
if (sessions.get(id) === session) {
|
|
123234
|
+
sessions.delete(id);
|
|
123235
|
+
log.debug({ sessionId: id }, "Exited session removed after retention period");
|
|
123236
|
+
}
|
|
123237
|
+
}, EXITED_SESSION_RETENTION_MS);
|
|
123238
|
+
});
|
|
123239
|
+
sessions.set(id, session);
|
|
123240
|
+
log.info({ sessionId: id, scope: options2.scope, cwd: options2.cwd, shell: resolvedShell }, "PTY session created");
|
|
123241
|
+
return session.meta;
|
|
123242
|
+
}
|
|
123243
|
+
function writeToSession(sessionId, data) {
|
|
123244
|
+
const session = sessions.get(sessionId);
|
|
123245
|
+
if (!session)
|
|
123246
|
+
return false;
|
|
123247
|
+
try {
|
|
123248
|
+
session.process.write(data);
|
|
123249
|
+
} catch (error48) {
|
|
123250
|
+
log.warn({ sessionId, error: error48 }, "Failed to write to PTY session");
|
|
123251
|
+
return false;
|
|
123252
|
+
}
|
|
123253
|
+
return true;
|
|
123254
|
+
}
|
|
123255
|
+
function resizeSession(sessionId, cols, rows) {
|
|
123256
|
+
const session = sessions.get(sessionId);
|
|
123257
|
+
if (!session)
|
|
123258
|
+
return false;
|
|
123259
|
+
try {
|
|
123260
|
+
session.process.resize(cols, rows);
|
|
123261
|
+
} catch (error48) {
|
|
123262
|
+
log.warn({ sessionId, cols, rows, error: error48 }, "Failed to resize PTY");
|
|
123263
|
+
}
|
|
123264
|
+
return true;
|
|
123265
|
+
}
|
|
123266
|
+
function destroySession(sessionId) {
|
|
123267
|
+
const session = sessions.get(sessionId);
|
|
123268
|
+
if (!session)
|
|
123269
|
+
return false;
|
|
123270
|
+
try {
|
|
123271
|
+
session.process.kill();
|
|
123272
|
+
} catch {}
|
|
123273
|
+
sessions.delete(sessionId);
|
|
123274
|
+
log.info({ sessionId }, "PTY session destroyed");
|
|
123275
|
+
return true;
|
|
123276
|
+
}
|
|
123277
|
+
function getSession(sessionId) {
|
|
123278
|
+
return sessions.get(sessionId)?.meta ?? null;
|
|
123279
|
+
}
|
|
123280
|
+
function addDataListener(sessionId, listener) {
|
|
123281
|
+
const session = sessions.get(sessionId);
|
|
123282
|
+
if (!session)
|
|
123283
|
+
return false;
|
|
123284
|
+
session.listeners.add(listener);
|
|
123285
|
+
return true;
|
|
123286
|
+
}
|
|
123287
|
+
function removeDataListener(sessionId, listener) {
|
|
123288
|
+
sessions.get(sessionId)?.listeners.delete(listener);
|
|
123289
|
+
}
|
|
123290
|
+
function addExitListener(sessionId, listener) {
|
|
123291
|
+
const session = sessions.get(sessionId);
|
|
123292
|
+
if (!session)
|
|
123293
|
+
return false;
|
|
123294
|
+
if (session.exited) {
|
|
123295
|
+
try {
|
|
123296
|
+
listener({ exitCode: -1 });
|
|
123297
|
+
} catch {}
|
|
123298
|
+
return true;
|
|
123299
|
+
}
|
|
123300
|
+
session.exitListeners.add(listener);
|
|
123301
|
+
return true;
|
|
123302
|
+
}
|
|
123303
|
+
function removeExitListener(sessionId, listener) {
|
|
123304
|
+
sessions.get(sessionId)?.exitListeners.delete(listener);
|
|
123305
|
+
}
|
|
123306
|
+
function getScrollback(sessionId) {
|
|
123307
|
+
return sessions.get(sessionId)?.scrollback ?? [];
|
|
123308
|
+
}
|
|
123309
|
+
function destroyAllSessions() {
|
|
123310
|
+
for (const [id] of sessions) {
|
|
123311
|
+
destroySession(id);
|
|
123312
|
+
}
|
|
123313
|
+
}
|
|
123314
|
+
async function gracefulShutdownSessions(timeoutMs = 3000) {
|
|
123315
|
+
const ids = Array.from(sessions.keys());
|
|
123316
|
+
if (ids.length === 0)
|
|
123317
|
+
return;
|
|
123318
|
+
log.info({ count: ids.length }, "Gracefully shutting down PTY sessions");
|
|
123319
|
+
for (const id of ids) {
|
|
123320
|
+
const session = sessions.get(id);
|
|
123321
|
+
if (!session || session.exited)
|
|
123322
|
+
continue;
|
|
123323
|
+
try {
|
|
123324
|
+
session.process.kill();
|
|
123325
|
+
} catch {}
|
|
123326
|
+
}
|
|
123327
|
+
const deadline = Date.now() + timeoutMs;
|
|
123328
|
+
while (sessions.size > 0 && Date.now() < deadline) {
|
|
123329
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
123330
|
+
}
|
|
123331
|
+
if (sessions.size > 0) {
|
|
123332
|
+
log.warn({ remaining: sessions.size }, "Force destroying remaining PTY sessions");
|
|
123333
|
+
destroyAllSessions();
|
|
123334
|
+
}
|
|
123335
|
+
}
|
|
123336
|
+
var log, require2, SCROLLBACK_LIMIT = 500, SCROLLBACK_BYTE_LIMIT, DEFAULT_COLS = 120, DEFAULT_ROWS = 30, EXITED_SESSION_RETENTION_MS = 60000, NON_WINDOWS_FALLBACK_SHELLS, sessions;
|
|
123337
|
+
var init_pty_session = __esm(() => {
|
|
123338
|
+
init_log();
|
|
123339
|
+
log = logger.child({ module: "pty-session" });
|
|
123340
|
+
require2 = createRequire3(import.meta.url);
|
|
123341
|
+
SCROLLBACK_BYTE_LIMIT = 1024 * 1024;
|
|
123342
|
+
NON_WINDOWS_FALLBACK_SHELLS = ["/bin/bash", "/bin/zsh", "/bin/sh"];
|
|
123343
|
+
sessions = new Map;
|
|
123344
|
+
});
|
|
123345
|
+
|
|
123346
|
+
// ../api/src/server/terminal-ws.ts
|
|
123347
|
+
import { dirname as dirname7, resolve as resolve21, sep as sep6 } from "node:path";
|
|
123348
|
+
import { existsSync as existsSync13, statSync as statSync4 } from "node:fs";
|
|
123349
|
+
function validateCwd(cwd2, root) {
|
|
123350
|
+
if (!cwd2 || typeof cwd2 !== "string")
|
|
123351
|
+
return null;
|
|
123352
|
+
const resolved = resolve21(cwd2);
|
|
123353
|
+
const resolvedRoot = resolve21(root);
|
|
123354
|
+
const parentDir = dirname7(resolvedRoot) + sep6;
|
|
123355
|
+
const isWithinRoot2 = resolved === resolvedRoot || resolved.startsWith(resolvedRoot + sep6);
|
|
123356
|
+
const isSibling = resolved.startsWith(parentDir);
|
|
123357
|
+
if (!isWithinRoot2 && !isSibling)
|
|
123358
|
+
return null;
|
|
123359
|
+
if (!existsSync13(resolved))
|
|
123360
|
+
return null;
|
|
123361
|
+
try {
|
|
123362
|
+
if (!statSync4(resolved).isDirectory())
|
|
123363
|
+
return null;
|
|
123364
|
+
} catch {
|
|
123365
|
+
return null;
|
|
123366
|
+
}
|
|
123367
|
+
return resolved;
|
|
123368
|
+
}
|
|
123369
|
+
function createTerminalWebSocketServer(root) {
|
|
123370
|
+
if (root)
|
|
123371
|
+
configuredRoot = root;
|
|
123372
|
+
if (wss)
|
|
123373
|
+
return wss;
|
|
123374
|
+
wss = new import_websocket_server.default({ noServer: true });
|
|
123375
|
+
wss.on("connection", (ws) => {
|
|
123376
|
+
let currentSessionId = null;
|
|
123377
|
+
let dataListener = null;
|
|
123378
|
+
let exitListener = null;
|
|
123379
|
+
const cleanup = () => {
|
|
123380
|
+
if (currentSessionId && dataListener) {
|
|
123381
|
+
removeDataListener(currentSessionId, dataListener);
|
|
123382
|
+
}
|
|
123383
|
+
if (currentSessionId && exitListener) {
|
|
123384
|
+
removeExitListener(currentSessionId, exitListener);
|
|
123385
|
+
}
|
|
123386
|
+
dataListener = null;
|
|
123387
|
+
exitListener = null;
|
|
123388
|
+
currentSessionId = null;
|
|
123389
|
+
};
|
|
123390
|
+
const sendJson = (payload) => {
|
|
123391
|
+
if (ws.readyState === import_websocket.default.OPEN) {
|
|
123392
|
+
ws.send(JSON.stringify(payload));
|
|
123393
|
+
}
|
|
123394
|
+
};
|
|
123395
|
+
const attachToSession = (sessionId) => {
|
|
123396
|
+
cleanup();
|
|
123397
|
+
cancelOrphanDestroy(sessionId);
|
|
123398
|
+
const meta3 = getSession(sessionId);
|
|
123399
|
+
if (!meta3) {
|
|
123400
|
+
sendJson({ type: "error", message: `Session ${sessionId} not found` });
|
|
123401
|
+
return false;
|
|
123402
|
+
}
|
|
123403
|
+
currentSessionId = sessionId;
|
|
123404
|
+
dataListener = (data) => {
|
|
123405
|
+
sendJson({ type: "output", data });
|
|
123406
|
+
};
|
|
123407
|
+
exitListener = (info) => {
|
|
123408
|
+
sendJson({ type: "exited", exitCode: info.exitCode });
|
|
123409
|
+
cleanup();
|
|
123410
|
+
};
|
|
123411
|
+
const scrollback = getScrollback(sessionId);
|
|
123412
|
+
if (scrollback.length > 0) {
|
|
123413
|
+
sendJson({ type: "output", data: scrollback.join("") });
|
|
123414
|
+
}
|
|
123415
|
+
addDataListener(sessionId, dataListener);
|
|
123416
|
+
addExitListener(sessionId, exitListener);
|
|
123417
|
+
return true;
|
|
123418
|
+
};
|
|
123419
|
+
ws.on("message", (raw2) => {
|
|
123420
|
+
let msg;
|
|
123421
|
+
try {
|
|
123422
|
+
msg = JSON.parse(typeof raw2 === "string" ? raw2 : raw2.toString("utf-8"));
|
|
123423
|
+
} catch {
|
|
123424
|
+
sendJson({ type: "error", message: "Invalid JSON" });
|
|
123425
|
+
return;
|
|
123426
|
+
}
|
|
123427
|
+
switch (msg.type) {
|
|
123428
|
+
case "create": {
|
|
123429
|
+
if (!msg.cwd || !msg.scope) {
|
|
123430
|
+
sendJson({ type: "error", message: "Missing required fields: scope, cwd" });
|
|
123431
|
+
return;
|
|
123432
|
+
}
|
|
123433
|
+
const root2 = configuredRoot;
|
|
123434
|
+
if (!root2) {
|
|
123435
|
+
sendJson({ type: "error", message: "Server root not configured" });
|
|
123436
|
+
return;
|
|
123437
|
+
}
|
|
123438
|
+
const validatedCwd = validateCwd(msg.cwd, root2) ?? root2;
|
|
123439
|
+
try {
|
|
123440
|
+
const meta3 = createSession({
|
|
123441
|
+
scope: msg.scope,
|
|
123442
|
+
cwd: validatedCwd,
|
|
123443
|
+
cols: msg.cols,
|
|
123444
|
+
rows: msg.rows
|
|
123445
|
+
});
|
|
123446
|
+
sendJson({ type: "created", sessionId: meta3.id, scope: meta3.scope, cwd: meta3.cwd });
|
|
123447
|
+
attachToSession(meta3.id);
|
|
123448
|
+
} catch (error48) {
|
|
123449
|
+
log2.error({ error: error48, cwd: validatedCwd, scope: msg.scope }, "Failed to create PTY session");
|
|
123450
|
+
sendJson({
|
|
123451
|
+
type: "error",
|
|
123452
|
+
message: `Failed to create terminal session: ${error48 instanceof Error ? error48.message : "unknown error"}`
|
|
123453
|
+
});
|
|
123454
|
+
}
|
|
123455
|
+
break;
|
|
123456
|
+
}
|
|
123457
|
+
case "attach": {
|
|
123458
|
+
if (!msg.sessionId) {
|
|
123459
|
+
sendJson({ type: "error", message: "Missing sessionId" });
|
|
123460
|
+
return;
|
|
123461
|
+
}
|
|
123462
|
+
const attached = attachToSession(msg.sessionId);
|
|
123463
|
+
if (attached) {
|
|
123464
|
+
sendJson({ type: "attached", sessionId: msg.sessionId });
|
|
123465
|
+
}
|
|
123466
|
+
break;
|
|
123467
|
+
}
|
|
123468
|
+
case "input": {
|
|
123469
|
+
if (!currentSessionId) {
|
|
123470
|
+
sendJson({ type: "error", message: "No active session" });
|
|
123471
|
+
return;
|
|
123472
|
+
}
|
|
123473
|
+
if (!writeToSession(currentSessionId, msg.data)) {
|
|
123474
|
+
sendJson({ type: "exited" });
|
|
123475
|
+
cleanup();
|
|
123476
|
+
}
|
|
123477
|
+
break;
|
|
123478
|
+
}
|
|
123479
|
+
case "resize": {
|
|
123480
|
+
if (!currentSessionId)
|
|
123481
|
+
return;
|
|
123482
|
+
if (typeof msg.cols === "number" && typeof msg.rows === "number" && msg.cols > 0 && msg.rows > 0) {
|
|
123483
|
+
resizeSession(currentSessionId, msg.cols, msg.rows);
|
|
123484
|
+
}
|
|
123485
|
+
break;
|
|
123486
|
+
}
|
|
123487
|
+
case "destroy": {
|
|
123488
|
+
if (currentSessionId) {
|
|
123489
|
+
const sid = currentSessionId;
|
|
123490
|
+
cleanup();
|
|
123491
|
+
destroySession(sid);
|
|
123492
|
+
sendJson({ type: "exited" });
|
|
123493
|
+
}
|
|
123494
|
+
break;
|
|
123495
|
+
}
|
|
123496
|
+
default:
|
|
123497
|
+
sendJson({ type: "error", message: `Unknown message type` });
|
|
123498
|
+
}
|
|
123499
|
+
});
|
|
123500
|
+
ws.on("close", () => {
|
|
123501
|
+
const sid = currentSessionId;
|
|
123502
|
+
log2.debug({ sessionId: sid }, "Terminal WebSocket closed");
|
|
123503
|
+
cleanup();
|
|
123504
|
+
if (sid) {
|
|
123505
|
+
scheduleOrphanDestroy(sid);
|
|
123506
|
+
}
|
|
123507
|
+
});
|
|
123508
|
+
ws.on("error", (error48) => {
|
|
123509
|
+
const sid = currentSessionId;
|
|
123510
|
+
log2.warn({ sessionId: sid, error: error48 }, "Terminal WebSocket error");
|
|
123511
|
+
cleanup();
|
|
123512
|
+
if (sid) {
|
|
123513
|
+
scheduleOrphanDestroy(sid);
|
|
123514
|
+
}
|
|
123515
|
+
});
|
|
123516
|
+
});
|
|
123517
|
+
return wss;
|
|
123518
|
+
}
|
|
123519
|
+
function scheduleOrphanDestroy(sessionId) {
|
|
123520
|
+
if (orphanTimers.has(sessionId))
|
|
123521
|
+
return;
|
|
123522
|
+
const timer = setTimeout(() => {
|
|
123523
|
+
orphanTimers.delete(sessionId);
|
|
123524
|
+
if (getSession(sessionId)) {
|
|
123525
|
+
log2.info({ sessionId }, "Destroying orphaned PTY session after timeout");
|
|
123526
|
+
destroySession(sessionId);
|
|
123527
|
+
}
|
|
123528
|
+
}, ORPHAN_SESSION_TIMEOUT_MS);
|
|
123529
|
+
orphanTimers.set(sessionId, timer);
|
|
123530
|
+
}
|
|
123531
|
+
function cancelOrphanDestroy(sessionId) {
|
|
123532
|
+
const timer = orphanTimers.get(sessionId);
|
|
123533
|
+
if (timer) {
|
|
123534
|
+
clearTimeout(timer);
|
|
123535
|
+
orphanTimers.delete(sessionId);
|
|
123536
|
+
}
|
|
123537
|
+
}
|
|
123538
|
+
function handleTerminalUpgrade(req, socket, head) {
|
|
123539
|
+
const server = createTerminalWebSocketServer();
|
|
123540
|
+
server.handleUpgrade(req, socket, head, (ws) => {
|
|
123541
|
+
server.emit("connection", ws, req);
|
|
123542
|
+
});
|
|
123543
|
+
}
|
|
123544
|
+
var log2, ORPHAN_SESSION_TIMEOUT_MS, orphanTimers, wss = null, configuredRoot = null;
|
|
123545
|
+
var init_terminal_ws = __esm(() => {
|
|
123546
|
+
init_wrapper();
|
|
123547
|
+
init_pty_session();
|
|
123548
|
+
init_log();
|
|
123549
|
+
log2 = logger.child({ module: "terminal-ws" });
|
|
123550
|
+
ORPHAN_SESSION_TIMEOUT_MS = 5 * 60 * 1000;
|
|
123551
|
+
orphanTimers = new Map;
|
|
123552
|
+
});
|
|
123553
|
+
|
|
122983
123554
|
// ../api/src/server/http.ts
|
|
122984
123555
|
var exports_http = {};
|
|
122985
123556
|
__export(exports_http, {
|
|
122986
123557
|
startServer: () => startServer
|
|
122987
123558
|
});
|
|
122988
123559
|
import { createServer as createServer2 } from "node:http";
|
|
122989
|
-
import { existsSync as
|
|
123560
|
+
import { existsSync as existsSync14 } from "node:fs";
|
|
122990
123561
|
import { createReadStream } from "node:fs";
|
|
122991
123562
|
import { stat as stat2 } from "node:fs/promises";
|
|
122992
|
-
import { extname as extname2, resolve as
|
|
123563
|
+
import { extname as extname2, resolve as resolve22, sep as sep7 } from "node:path";
|
|
122993
123564
|
async function startServer(options2) {
|
|
122994
123565
|
const startedAt = Date.now();
|
|
122995
123566
|
const taskFileWatch = createTaskFileWatchService(options2.root);
|
|
@@ -123011,7 +123582,7 @@ async function startServer(options2) {
|
|
|
123011
123582
|
logger.error(`tRPC request failed ${JSON.stringify(details, (_key, value) => value === undefined ? "[undefined]" : value)}`);
|
|
123012
123583
|
}
|
|
123013
123584
|
});
|
|
123014
|
-
const hasUi = Boolean(options2.uiRoot &&
|
|
123585
|
+
const hasUi = Boolean(options2.uiRoot && existsSync14(options2.uiRoot));
|
|
123015
123586
|
const server = createServer2(async (req, res) => {
|
|
123016
123587
|
const url2 = new URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
|
|
123017
123588
|
if (url2.pathname === "/api/health/live") {
|
|
@@ -123067,10 +123638,26 @@ async function startServer(options2) {
|
|
|
123067
123638
|
res.end(`Server error: ${error48 instanceof Error ? error48.message : "unknown"}`);
|
|
123068
123639
|
}
|
|
123069
123640
|
});
|
|
123070
|
-
|
|
123641
|
+
createTerminalWebSocketServer(options2.root);
|
|
123642
|
+
server.on("upgrade", (req, socket, head) => {
|
|
123643
|
+
const url2 = new URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
|
|
123644
|
+
if (url2.pathname === "/api/terminal") {
|
|
123645
|
+
const remoteAddr = req.socket.remoteAddress ?? "";
|
|
123646
|
+
const isLocalhost2 = remoteAddr === "127.0.0.1" || remoteAddr === "::1" || remoteAddr === "::ffff:127.0.0.1";
|
|
123647
|
+
if (!isLocalhost2) {
|
|
123648
|
+
logger.warn({ remoteAddress: remoteAddr }, "Rejected terminal WebSocket from non-localhost address");
|
|
123649
|
+
socket.destroy();
|
|
123650
|
+
return;
|
|
123651
|
+
}
|
|
123652
|
+
handleTerminalUpgrade(req, socket, head);
|
|
123653
|
+
} else {
|
|
123654
|
+
socket.destroy();
|
|
123655
|
+
}
|
|
123656
|
+
});
|
|
123657
|
+
const log3 = logger.child({ module: "api" });
|
|
123071
123658
|
const portResolution = await listenWithPortFallback(server, options2.port);
|
|
123072
123659
|
if (portResolution.fallbackUsed) {
|
|
123073
|
-
|
|
123660
|
+
log3.warn({
|
|
123074
123661
|
event: "startup.port.conflict",
|
|
123075
123662
|
requestedPort: portResolution.requestedPort,
|
|
123076
123663
|
resolvedPort: portResolution.resolvedPort,
|
|
@@ -123078,17 +123665,23 @@ async function startServer(options2) {
|
|
|
123078
123665
|
});
|
|
123079
123666
|
}
|
|
123080
123667
|
const apiUrl = `http://localhost:${portResolution.resolvedPort}`;
|
|
123081
|
-
|
|
123668
|
+
log3.info({
|
|
123082
123669
|
event: "startup.ready",
|
|
123083
123670
|
apiUrl,
|
|
123084
123671
|
hint: "Press Ctrl+C to stop"
|
|
123085
123672
|
}, `Ready: ${apiUrl} (Ctrl+C to stop)`);
|
|
123086
123673
|
server.on("close", () => {
|
|
123087
123674
|
taskFileWatch.stop();
|
|
123088
|
-
|
|
123089
|
-
|
|
123090
|
-
}, "API server closed.");
|
|
123675
|
+
destroyAllSessions();
|
|
123676
|
+
log3.info({ event: "startup.closed" }, "API server closed.");
|
|
123091
123677
|
});
|
|
123678
|
+
const gracefulShutdown = async () => {
|
|
123679
|
+
log3.info({ event: "startup.shutting_down" }, "Graceful shutdown initiated");
|
|
123680
|
+
await gracefulShutdownSessions();
|
|
123681
|
+
server.close();
|
|
123682
|
+
};
|
|
123683
|
+
process.once("SIGINT", () => void gracefulShutdown());
|
|
123684
|
+
process.once("SIGTERM", () => void gracefulShutdown());
|
|
123092
123685
|
return {
|
|
123093
123686
|
server,
|
|
123094
123687
|
port: portResolution.resolvedPort
|
|
@@ -123174,8 +123767,8 @@ async function serveVibemanImage(options2) {
|
|
|
123174
123767
|
return;
|
|
123175
123768
|
}
|
|
123176
123769
|
const requested = decodedPath.replace(/^\//, "");
|
|
123177
|
-
const absoluteTarget =
|
|
123178
|
-
if (!absoluteTarget.startsWith(imagesDir +
|
|
123770
|
+
const absoluteTarget = resolve22(rootPath, requested);
|
|
123771
|
+
if (!absoluteTarget.startsWith(imagesDir + sep7)) {
|
|
123179
123772
|
res.statusCode = 404;
|
|
123180
123773
|
res.setHeader("content-type", "text/plain; charset=utf-8");
|
|
123181
123774
|
res.end("Not found");
|
|
@@ -123241,6 +123834,8 @@ var init_http2 = __esm(() => {
|
|
|
123241
123834
|
init_task_file_watch();
|
|
123242
123835
|
init_port_utils();
|
|
123243
123836
|
init_health_report();
|
|
123837
|
+
init_terminal_ws();
|
|
123838
|
+
init_pty_session();
|
|
123244
123839
|
import_serve_handler = __toESM(require_src3(), 1);
|
|
123245
123840
|
});
|
|
123246
123841
|
|
|
@@ -123404,35 +123999,12 @@ function isNodeVersionCompatible(currentNodeVersion, requiredRange) {
|
|
|
123404
123999
|
|
|
123405
124000
|
// ../api/src/services/config.ts
|
|
123406
124001
|
init_zod();
|
|
124002
|
+
init_env_policy();
|
|
123407
124003
|
import { existsSync as existsSync2, statSync } from "node:fs";
|
|
123408
124004
|
import { isAbsolute, resolve as resolvePath } from "node:path";
|
|
123409
124005
|
var LOG_LEVELS = ["error", "warn", "info", "debug", "trace"];
|
|
123410
124006
|
var LOG_FORMATS = ["pretty", "json"];
|
|
123411
|
-
var startupEnvSchema = exports_external.object({
|
|
123412
|
-
PORT: exports_external.string().optional(),
|
|
123413
|
-
VIBEMAN_ROOT: exports_external.string().optional(),
|
|
123414
|
-
UI_DIST: exports_external.string().optional(),
|
|
123415
|
-
VERBOSE: exports_external.string().optional(),
|
|
123416
|
-
LOG_FORMAT: exports_external.string().optional(),
|
|
123417
|
-
CODEX_PATH: exports_external.string().optional(),
|
|
123418
|
-
GEMINI_PATH: exports_external.string().optional(),
|
|
123419
|
-
CLAUDE_CODE_PATH: exports_external.string().optional(),
|
|
123420
|
-
DEBUG: exports_external.string().optional(),
|
|
123421
|
-
ENABLE_VIBEMAN_CA_TESTS: exports_external.string().optional(),
|
|
123422
|
-
ENABLE_VIBEMAN_CA_TESTS_CODEX: exports_external.string().optional(),
|
|
123423
|
-
ENABLE_VIBEMAN_CA_TESTS_GEMINI: exports_external.string().optional(),
|
|
123424
|
-
ENABLE_VIBEMAN_CA_TESTS_CLAUDE: exports_external.string().optional(),
|
|
123425
|
-
VIBEMAN_WORKFLOW_RUN_ID: exports_external.string().optional(),
|
|
123426
|
-
VIBEMAN_WORKFLOW_STEP_ID: exports_external.string().optional(),
|
|
123427
|
-
VIBEMAN_WORKFLOW_ROOT: exports_external.string().optional(),
|
|
123428
|
-
VIBEMAN_TASK_PATH: exports_external.string().optional(),
|
|
123429
|
-
VIBEMAN_TASK_NAME: exports_external.string().optional(),
|
|
123430
|
-
VIBEMAN_TASK_BRANCH: exports_external.string().optional(),
|
|
123431
|
-
VIBEMAN_TASK_WORKTREE: exports_external.string().optional(),
|
|
123432
|
-
VIBEMAN_REPO_ROOT: exports_external.string().optional(),
|
|
123433
|
-
VIBEMAN_DEFAULT_BRANCH: exports_external.string().optional(),
|
|
123434
|
-
NODE_ENV: exports_external.string().optional()
|
|
123435
|
-
}).passthrough();
|
|
124007
|
+
var startupEnvSchema = exports_external.object({}).catchall(exports_external.string().optional());
|
|
123436
124008
|
|
|
123437
124009
|
class StartupConfigError extends Error {
|
|
123438
124010
|
details;
|
|
@@ -123446,7 +124018,7 @@ function loadStartupConfig(input) {
|
|
|
123446
124018
|
const cwd = input.cwd ?? process.cwd();
|
|
123447
124019
|
const parsed = startupEnvSchema.parse(input.env);
|
|
123448
124020
|
const warnings = [];
|
|
123449
|
-
const rootRaw = parsed.
|
|
124021
|
+
const rootRaw = parsed[VIBEMAN_ENV_KEYS.ROOT]?.trim();
|
|
123450
124022
|
if (!rootRaw) {
|
|
123451
124023
|
throw new StartupConfigError("Missing required environment variable VIBEMAN_ROOT.", [
|
|
123452
124024
|
"Set VIBEMAN_ROOT to the target project directory before starting the API."
|
|
@@ -123458,13 +124030,13 @@ function loadStartupConfig(input) {
|
|
|
123458
124030
|
`Resolved path does not exist or is not a directory: ${root}`
|
|
123459
124031
|
]);
|
|
123460
124032
|
}
|
|
123461
|
-
const port = parsePort(parsed.PORT, warnings);
|
|
123462
|
-
const uiDist = parseOptionalDirectory(parsed.UI_DIST,
|
|
123463
|
-
const verbose = parseLogLevel(parsed.VERBOSE, warnings);
|
|
123464
|
-
const logFormat = parseLogFormat(parsed.LOG_FORMAT, parsed.NODE_ENV, warnings);
|
|
123465
|
-
const codexPath = parseOptionalCliPath(parsed.CODEX_PATH,
|
|
123466
|
-
const geminiPath = parseOptionalCliPath(parsed.GEMINI_PATH,
|
|
123467
|
-
const claudeCodePath = parseOptionalCliPath(parsed.CLAUDE_CODE_PATH,
|
|
124033
|
+
const port = parsePort(readVibemanEnv(parsed, VIBEMAN_ENV_KEYS.PORT), warnings);
|
|
124034
|
+
const uiDist = parseOptionalDirectory(readVibemanEnv(parsed, VIBEMAN_ENV_KEYS.UI_DIST), VIBEMAN_ENV_KEYS.UI_DIST, cwd, warnings);
|
|
124035
|
+
const verbose = parseLogLevel(readVibemanEnv(parsed, VIBEMAN_ENV_KEYS.VERBOSE), warnings);
|
|
124036
|
+
const logFormat = parseLogFormat(readVibemanEnv(parsed, VIBEMAN_ENV_KEYS.LOG_FORMAT), parsed.NODE_ENV, warnings);
|
|
124037
|
+
const codexPath = parseOptionalCliPath(readVibemanEnv(parsed, VIBEMAN_ENV_KEYS.CODEX_PATH), VIBEMAN_ENV_KEYS.CODEX_PATH, warnings);
|
|
124038
|
+
const geminiPath = parseOptionalCliPath(readVibemanEnv(parsed, VIBEMAN_ENV_KEYS.GEMINI_PATH), VIBEMAN_ENV_KEYS.GEMINI_PATH, warnings);
|
|
124039
|
+
const claudeCodePath = parseOptionalCliPath(readVibemanEnv(parsed, VIBEMAN_ENV_KEYS.CLAUDE_CODE_PATH), VIBEMAN_ENV_KEYS.CLAUDE_CODE_PATH, warnings);
|
|
123468
124040
|
const debug = parseBoolean(parsed.DEBUG).value;
|
|
123469
124041
|
const caAll = parseBoolean(parsed.ENABLE_VIBEMAN_CA_TESTS).value;
|
|
123470
124042
|
const caCodex = parseBoolean(parsed.ENABLE_VIBEMAN_CA_TESTS_CODEX);
|
|
@@ -123522,7 +124094,7 @@ function parsePort(raw2, warnings) {
|
|
|
123522
124094
|
}
|
|
123523
124095
|
const value = Number(raw2);
|
|
123524
124096
|
if (!Number.isInteger(value) || value < 1 || value > 65535) {
|
|
123525
|
-
warnings.push(
|
|
124097
|
+
warnings.push(`${VIBEMAN_ENV_KEYS.PORT}="${raw2}" is invalid; using default 6969.`);
|
|
123526
124098
|
return 6969;
|
|
123527
124099
|
}
|
|
123528
124100
|
return value;
|
|
@@ -123549,7 +124121,7 @@ function parseLogLevel(raw2, warnings) {
|
|
|
123549
124121
|
}
|
|
123550
124122
|
const parsed = exports_external.enum(LOG_LEVELS).safeParse(normalized);
|
|
123551
124123
|
if (!parsed.success) {
|
|
123552
|
-
warnings.push(
|
|
124124
|
+
warnings.push(`${VIBEMAN_ENV_KEYS.VERBOSE}="${raw2}" is invalid; using "info".`);
|
|
123553
124125
|
return "info";
|
|
123554
124126
|
}
|
|
123555
124127
|
return parsed.data;
|
|
@@ -123562,7 +124134,7 @@ function parseLogFormat(raw2, nodeEnv, warnings) {
|
|
|
123562
124134
|
}
|
|
123563
124135
|
const parsed = exports_external.enum(LOG_FORMATS).safeParse(normalized);
|
|
123564
124136
|
if (!parsed.success) {
|
|
123565
|
-
warnings.push(
|
|
124137
|
+
warnings.push(`${VIBEMAN_ENV_KEYS.LOG_FORMAT}="${raw2}" is invalid; using "${defaultValue}".`);
|
|
123566
124138
|
return defaultValue;
|
|
123567
124139
|
}
|
|
123568
124140
|
return parsed.data;
|
|
@@ -123609,14 +124181,14 @@ function warnInvalidBoolean(key, raw2, parsed, warnings) {
|
|
|
123609
124181
|
warnings.push(`${key}="${raw2}" is invalid; treating it as false.`);
|
|
123610
124182
|
}
|
|
123611
124183
|
function applyConfigToEnv(config2, env) {
|
|
123612
|
-
env.
|
|
123613
|
-
env.PORT = String(config2.port);
|
|
123614
|
-
env.VERBOSE = config2.verbose;
|
|
123615
|
-
env.LOG_FORMAT = config2.logFormat;
|
|
123616
|
-
setOptionalEnv(env,
|
|
123617
|
-
setOptionalEnv(env,
|
|
123618
|
-
setOptionalEnv(env,
|
|
123619
|
-
setOptionalEnv(env,
|
|
124184
|
+
env[VIBEMAN_ENV_KEYS.ROOT] = config2.root;
|
|
124185
|
+
env[VIBEMAN_ENV_KEYS.PORT] = String(config2.port);
|
|
124186
|
+
env[VIBEMAN_ENV_KEYS.VERBOSE] = config2.verbose;
|
|
124187
|
+
env[VIBEMAN_ENV_KEYS.LOG_FORMAT] = config2.logFormat;
|
|
124188
|
+
setOptionalEnv(env, VIBEMAN_ENV_KEYS.UI_DIST, config2.uiDist);
|
|
124189
|
+
setOptionalEnv(env, VIBEMAN_ENV_KEYS.CODEX_PATH, config2.codexPath);
|
|
124190
|
+
setOptionalEnv(env, VIBEMAN_ENV_KEYS.GEMINI_PATH, config2.geminiPath);
|
|
124191
|
+
setOptionalEnv(env, VIBEMAN_ENV_KEYS.CLAUDE_CODE_PATH, config2.claudeCodePath);
|
|
123620
124192
|
}
|
|
123621
124193
|
function setOptionalEnv(env, key, value) {
|
|
123622
124194
|
if (value === undefined) {
|