wtt-connect 0.2.18 → 0.2.20
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/package.json +2 -5
- package/src/adapters/codex.js +144 -2
- package/src/runner.js +258 -0
- package/src/store.js +6 -0
- package/src/terminal-session.js +12 -1
- package/node_modules/node-addon-api/LICENSE.md +0 -9
- package/node_modules/node-addon-api/README.md +0 -319
- package/node_modules/node-addon-api/common.gypi +0 -20
- package/node_modules/node-addon-api/except.gypi +0 -25
- package/node_modules/node-addon-api/index.js +0 -12
- package/node_modules/node-addon-api/napi-inl.deprecated.h +0 -186
- package/node_modules/node-addon-api/napi-inl.h +0 -6607
- package/node_modules/node-addon-api/napi.h +0 -3201
- package/node_modules/node-addon-api/node_addon_api.gyp +0 -32
- package/node_modules/node-addon-api/node_api.gyp +0 -9
- package/node_modules/node-addon-api/noexcept.gypi +0 -26
- package/node_modules/node-addon-api/nothing.c +0 -0
- package/node_modules/node-addon-api/package-support.json +0 -21
- package/node_modules/node-addon-api/package.json +0 -480
- package/node_modules/node-addon-api/tools/README.md +0 -73
- package/node_modules/node-addon-api/tools/check-napi.js +0 -99
- package/node_modules/node-addon-api/tools/clang-format.js +0 -71
- package/node_modules/node-addon-api/tools/conversion.js +0 -301
- package/node_modules/node-addon-api/tools/eslint-format.js +0 -79
- package/node_modules/node-pty/LICENSE +0 -69
- package/node_modules/node-pty/README.md +0 -165
- package/node_modules/node-pty/binding.gyp +0 -111
- package/node_modules/node-pty/build/Makefile +0 -369
- package/node_modules/node-pty/build/Release/pty.node +0 -0
- package/node_modules/node-pty/build/binding.Makefile +0 -6
- package/node_modules/node-pty/build/config.gypi +0 -503
- package/node_modules/node-pty/build/pty.target.mk +0 -168
- package/node_modules/node-pty/deps/.editorconfig +0 -2
- package/node_modules/node-pty/deps/winpty/.drone.yml +0 -17
- package/node_modules/node-pty/deps/winpty/.gitattributes +0 -19
- package/node_modules/node-pty/deps/winpty/LICENSE +0 -21
- package/node_modules/node-pty/deps/winpty/Makefile +0 -166
- package/node_modules/node-pty/deps/winpty/README.md +0 -151
- package/node_modules/node-pty/deps/winpty/RELEASES.md +0 -280
- package/node_modules/node-pty/deps/winpty/VERSION.txt +0 -1
- package/node_modules/node-pty/deps/winpty/configure +0 -167
- package/node_modules/node-pty/deps/winpty/misc/BufferResizeTests.cc +0 -90
- package/node_modules/node-pty/deps/winpty/misc/ChangeScreenBuffer.cc +0 -53
- package/node_modules/node-pty/deps/winpty/misc/ClearConsole.cc +0 -72
- package/node_modules/node-pty/deps/winpty/misc/ConinMode.cc +0 -117
- package/node_modules/node-pty/deps/winpty/misc/ConinMode.ps1 +0 -116
- package/node_modules/node-pty/deps/winpty/misc/ConoutMode.cc +0 -113
- package/node_modules/node-pty/deps/winpty/misc/DebugClient.py +0 -42
- package/node_modules/node-pty/deps/winpty/misc/DebugServer.py +0 -63
- package/node_modules/node-pty/deps/winpty/misc/DumpLines.py +0 -5
- package/node_modules/node-pty/deps/winpty/misc/EnableExtendedFlags.txt +0 -46
- package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP437-Consolas.txt +0 -528
- package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP437-Lucida.txt +0 -633
- package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP932.txt +0 -630
- package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP936.txt +0 -630
- package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP949.txt +0 -630
- package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP950.txt +0 -630
- package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/MinimumWindowWidths.txt +0 -16
- package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/Results.txt +0 -4
- package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/Windows10SetFontBugginess.txt +0 -144
- package/node_modules/node-pty/deps/winpty/misc/FontSurvey.cc +0 -100
- package/node_modules/node-pty/deps/winpty/misc/FormatChar.h +0 -21
- package/node_modules/node-pty/deps/winpty/misc/FreezePerfTest.cc +0 -62
- package/node_modules/node-pty/deps/winpty/misc/GetCh.cc +0 -20
- package/node_modules/node-pty/deps/winpty/misc/GetConsolePos.cc +0 -41
- package/node_modules/node-pty/deps/winpty/misc/GetFont.cc +0 -261
- package/node_modules/node-pty/deps/winpty/misc/IdentifyConsoleWindow.ps1 +0 -51
- package/node_modules/node-pty/deps/winpty/misc/IsNewConsole.cc +0 -87
- package/node_modules/node-pty/deps/winpty/misc/MouseInputNotes.txt +0 -90
- package/node_modules/node-pty/deps/winpty/misc/MoveConsoleWindow.cc +0 -34
- package/node_modules/node-pty/deps/winpty/misc/Notes.txt +0 -219
- package/node_modules/node-pty/deps/winpty/misc/OSVersion.cc +0 -27
- package/node_modules/node-pty/deps/winpty/misc/ScreenBufferFreezeInactive.cc +0 -101
- package/node_modules/node-pty/deps/winpty/misc/ScreenBufferTest.cc +0 -671
- package/node_modules/node-pty/deps/winpty/misc/ScreenBufferTest2.cc +0 -151
- package/node_modules/node-pty/deps/winpty/misc/SelectAllTest.cc +0 -45
- package/node_modules/node-pty/deps/winpty/misc/SetBufferSize.cc +0 -32
- package/node_modules/node-pty/deps/winpty/misc/SetCursorPos.cc +0 -10
- package/node_modules/node-pty/deps/winpty/misc/SetFont.cc +0 -145
- package/node_modules/node-pty/deps/winpty/misc/SetWindowRect.cc +0 -36
- package/node_modules/node-pty/deps/winpty/misc/ShowArgv.cc +0 -12
- package/node_modules/node-pty/deps/winpty/misc/ShowConsoleInput.cc +0 -40
- package/node_modules/node-pty/deps/winpty/misc/Spew.py +0 -5
- package/node_modules/node-pty/deps/winpty/misc/TestUtil.cc +0 -172
- package/node_modules/node-pty/deps/winpty/misc/UnicodeDoubleWidthTest.cc +0 -102
- package/node_modules/node-pty/deps/winpty/misc/UnicodeWideTest1.cc +0 -246
- package/node_modules/node-pty/deps/winpty/misc/UnicodeWideTest2.cc +0 -130
- package/node_modules/node-pty/deps/winpty/misc/UnixEcho.cc +0 -89
- package/node_modules/node-pty/deps/winpty/misc/Utf16Echo.cc +0 -46
- package/node_modules/node-pty/deps/winpty/misc/VeryLargeRead.cc +0 -122
- package/node_modules/node-pty/deps/winpty/misc/VkEscapeTest.cc +0 -56
- package/node_modules/node-pty/deps/winpty/misc/Win10ResizeWhileFrozen.cc +0 -52
- package/node_modules/node-pty/deps/winpty/misc/Win10WrapTest1.cc +0 -57
- package/node_modules/node-pty/deps/winpty/misc/Win10WrapTest2.cc +0 -30
- package/node_modules/node-pty/deps/winpty/misc/Win32Echo1.cc +0 -26
- package/node_modules/node-pty/deps/winpty/misc/Win32Echo2.cc +0 -19
- package/node_modules/node-pty/deps/winpty/misc/Win32Test1.cc +0 -46
- package/node_modules/node-pty/deps/winpty/misc/Win32Test2.cc +0 -70
- package/node_modules/node-pty/deps/winpty/misc/Win32Test3.cc +0 -78
- package/node_modules/node-pty/deps/winpty/misc/Win32Write1.cc +0 -44
- package/node_modules/node-pty/deps/winpty/misc/WindowsBugCrashReader.cc +0 -27
- package/node_modules/node-pty/deps/winpty/misc/WriteConsole.cc +0 -106
- package/node_modules/node-pty/deps/winpty/misc/build32.sh +0 -9
- package/node_modules/node-pty/deps/winpty/misc/build64.sh +0 -9
- package/node_modules/node-pty/deps/winpty/misc/color-test.sh +0 -212
- package/node_modules/node-pty/deps/winpty/misc/font-notes.txt +0 -300
- package/node_modules/node-pty/deps/winpty/misc/winbug-15048.cc +0 -201
- package/node_modules/node-pty/deps/winpty/ship/build-pty4j-libpty.bat +0 -36
- package/node_modules/node-pty/deps/winpty/ship/common_ship.py +0 -53
- package/node_modules/node-pty/deps/winpty/ship/make_msvc_package.py +0 -165
- package/node_modules/node-pty/deps/winpty/ship/ship.py +0 -108
- package/node_modules/node-pty/deps/winpty/src/agent/Agent.cc +0 -613
- package/node_modules/node-pty/deps/winpty/src/agent/Agent.h +0 -103
- package/node_modules/node-pty/deps/winpty/src/agent/AgentCreateDesktop.cc +0 -84
- package/node_modules/node-pty/deps/winpty/src/agent/AgentCreateDesktop.h +0 -28
- package/node_modules/node-pty/deps/winpty/src/agent/ConsoleFont.cc +0 -632
- package/node_modules/node-pty/deps/winpty/src/agent/ConsoleFont.h +0 -28
- package/node_modules/node-pty/deps/winpty/src/agent/ConsoleInput.cc +0 -852
- package/node_modules/node-pty/deps/winpty/src/agent/ConsoleInput.h +0 -109
- package/node_modules/node-pty/deps/winpty/src/agent/ConsoleInputReencoding.cc +0 -121
- package/node_modules/node-pty/deps/winpty/src/agent/ConsoleInputReencoding.h +0 -36
- package/node_modules/node-pty/deps/winpty/src/agent/ConsoleLine.cc +0 -152
- package/node_modules/node-pty/deps/winpty/src/agent/ConsoleLine.h +0 -41
- package/node_modules/node-pty/deps/winpty/src/agent/Coord.h +0 -87
- package/node_modules/node-pty/deps/winpty/src/agent/DebugShowInput.cc +0 -239
- package/node_modules/node-pty/deps/winpty/src/agent/DebugShowInput.h +0 -32
- package/node_modules/node-pty/deps/winpty/src/agent/DefaultInputMap.cc +0 -422
- package/node_modules/node-pty/deps/winpty/src/agent/DefaultInputMap.h +0 -28
- package/node_modules/node-pty/deps/winpty/src/agent/DsrSender.h +0 -30
- package/node_modules/node-pty/deps/winpty/src/agent/EventLoop.cc +0 -99
- package/node_modules/node-pty/deps/winpty/src/agent/EventLoop.h +0 -47
- package/node_modules/node-pty/deps/winpty/src/agent/InputMap.cc +0 -246
- package/node_modules/node-pty/deps/winpty/src/agent/InputMap.h +0 -114
- package/node_modules/node-pty/deps/winpty/src/agent/LargeConsoleRead.cc +0 -71
- package/node_modules/node-pty/deps/winpty/src/agent/LargeConsoleRead.h +0 -68
- package/node_modules/node-pty/deps/winpty/src/agent/NamedPipe.cc +0 -378
- package/node_modules/node-pty/deps/winpty/src/agent/NamedPipe.h +0 -125
- package/node_modules/node-pty/deps/winpty/src/agent/Scraper.cc +0 -699
- package/node_modules/node-pty/deps/winpty/src/agent/Scraper.h +0 -103
- package/node_modules/node-pty/deps/winpty/src/agent/SimplePool.h +0 -75
- package/node_modules/node-pty/deps/winpty/src/agent/SmallRect.h +0 -143
- package/node_modules/node-pty/deps/winpty/src/agent/Terminal.cc +0 -535
- package/node_modules/node-pty/deps/winpty/src/agent/Terminal.h +0 -69
- package/node_modules/node-pty/deps/winpty/src/agent/UnicodeEncoding.h +0 -157
- package/node_modules/node-pty/deps/winpty/src/agent/UnicodeEncodingTest.cc +0 -189
- package/node_modules/node-pty/deps/winpty/src/agent/Win32Console.cc +0 -107
- package/node_modules/node-pty/deps/winpty/src/agent/Win32Console.h +0 -67
- package/node_modules/node-pty/deps/winpty/src/agent/Win32ConsoleBuffer.cc +0 -193
- package/node_modules/node-pty/deps/winpty/src/agent/Win32ConsoleBuffer.h +0 -99
- package/node_modules/node-pty/deps/winpty/src/agent/main.cc +0 -114
- package/node_modules/node-pty/deps/winpty/src/agent/subdir.mk +0 -61
- package/node_modules/node-pty/deps/winpty/src/configurations.gypi +0 -60
- package/node_modules/node-pty/deps/winpty/src/debugserver/DebugServer.cc +0 -117
- package/node_modules/node-pty/deps/winpty/src/debugserver/subdir.mk +0 -41
- package/node_modules/node-pty/deps/winpty/src/include/winpty.h +0 -242
- package/node_modules/node-pty/deps/winpty/src/include/winpty_constants.h +0 -131
- package/node_modules/node-pty/deps/winpty/src/libwinpty/AgentLocation.cc +0 -75
- package/node_modules/node-pty/deps/winpty/src/libwinpty/AgentLocation.h +0 -28
- package/node_modules/node-pty/deps/winpty/src/libwinpty/LibWinptyException.h +0 -54
- package/node_modules/node-pty/deps/winpty/src/libwinpty/WinptyInternal.h +0 -72
- package/node_modules/node-pty/deps/winpty/src/libwinpty/subdir.mk +0 -46
- package/node_modules/node-pty/deps/winpty/src/libwinpty/winpty.cc +0 -970
- package/node_modules/node-pty/deps/winpty/src/shared/AgentMsg.h +0 -38
- package/node_modules/node-pty/deps/winpty/src/shared/BackgroundDesktop.cc +0 -122
- package/node_modules/node-pty/deps/winpty/src/shared/BackgroundDesktop.h +0 -73
- package/node_modules/node-pty/deps/winpty/src/shared/Buffer.cc +0 -103
- package/node_modules/node-pty/deps/winpty/src/shared/Buffer.h +0 -102
- package/node_modules/node-pty/deps/winpty/src/shared/DebugClient.cc +0 -187
- package/node_modules/node-pty/deps/winpty/src/shared/DebugClient.h +0 -38
- package/node_modules/node-pty/deps/winpty/src/shared/GenRandom.cc +0 -138
- package/node_modules/node-pty/deps/winpty/src/shared/GenRandom.h +0 -55
- package/node_modules/node-pty/deps/winpty/src/shared/GetCommitHash.bat +0 -13
- package/node_modules/node-pty/deps/winpty/src/shared/Mutex.h +0 -54
- package/node_modules/node-pty/deps/winpty/src/shared/OsModule.h +0 -63
- package/node_modules/node-pty/deps/winpty/src/shared/OwnedHandle.cc +0 -36
- package/node_modules/node-pty/deps/winpty/src/shared/OwnedHandle.h +0 -45
- package/node_modules/node-pty/deps/winpty/src/shared/PrecompiledHeader.h +0 -43
- package/node_modules/node-pty/deps/winpty/src/shared/StringBuilder.h +0 -227
- package/node_modules/node-pty/deps/winpty/src/shared/StringBuilderTest.cc +0 -114
- package/node_modules/node-pty/deps/winpty/src/shared/StringUtil.cc +0 -55
- package/node_modules/node-pty/deps/winpty/src/shared/StringUtil.h +0 -80
- package/node_modules/node-pty/deps/winpty/src/shared/TimeMeasurement.h +0 -63
- package/node_modules/node-pty/deps/winpty/src/shared/UnixCtrlChars.h +0 -45
- package/node_modules/node-pty/deps/winpty/src/shared/UpdateGenVersion.bat +0 -20
- package/node_modules/node-pty/deps/winpty/src/shared/WindowsSecurity.cc +0 -460
- package/node_modules/node-pty/deps/winpty/src/shared/WindowsSecurity.h +0 -104
- package/node_modules/node-pty/deps/winpty/src/shared/WindowsVersion.cc +0 -252
- package/node_modules/node-pty/deps/winpty/src/shared/WindowsVersion.h +0 -29
- package/node_modules/node-pty/deps/winpty/src/shared/WinptyAssert.cc +0 -55
- package/node_modules/node-pty/deps/winpty/src/shared/WinptyAssert.h +0 -64
- package/node_modules/node-pty/deps/winpty/src/shared/WinptyException.cc +0 -57
- package/node_modules/node-pty/deps/winpty/src/shared/WinptyException.h +0 -43
- package/node_modules/node-pty/deps/winpty/src/shared/WinptyVersion.cc +0 -42
- package/node_modules/node-pty/deps/winpty/src/shared/WinptyVersion.h +0 -27
- package/node_modules/node-pty/deps/winpty/src/shared/winpty_snprintf.h +0 -99
- package/node_modules/node-pty/deps/winpty/src/subdir.mk +0 -5
- package/node_modules/node-pty/deps/winpty/src/tests/subdir.mk +0 -28
- package/node_modules/node-pty/deps/winpty/src/tests/trivial_test.cc +0 -158
- package/node_modules/node-pty/deps/winpty/src/unix-adapter/InputHandler.cc +0 -114
- package/node_modules/node-pty/deps/winpty/src/unix-adapter/InputHandler.h +0 -56
- package/node_modules/node-pty/deps/winpty/src/unix-adapter/OutputHandler.cc +0 -80
- package/node_modules/node-pty/deps/winpty/src/unix-adapter/OutputHandler.h +0 -53
- package/node_modules/node-pty/deps/winpty/src/unix-adapter/Util.cc +0 -86
- package/node_modules/node-pty/deps/winpty/src/unix-adapter/Util.h +0 -31
- package/node_modules/node-pty/deps/winpty/src/unix-adapter/WakeupFd.cc +0 -70
- package/node_modules/node-pty/deps/winpty/src/unix-adapter/WakeupFd.h +0 -42
- package/node_modules/node-pty/deps/winpty/src/unix-adapter/main.cc +0 -729
- package/node_modules/node-pty/deps/winpty/src/unix-adapter/subdir.mk +0 -41
- package/node_modules/node-pty/deps/winpty/src/winpty.gyp +0 -234
- package/node_modules/node-pty/deps/winpty/vcbuild.bat +0 -83
- package/node_modules/node-pty/lib/conpty_console_list_agent.js +0 -16
- package/node_modules/node-pty/lib/conpty_console_list_agent.js.map +0 -1
- package/node_modules/node-pty/lib/eventEmitter2.js +0 -47
- package/node_modules/node-pty/lib/eventEmitter2.js.map +0 -1
- package/node_modules/node-pty/lib/eventEmitter2.test.js +0 -30
- package/node_modules/node-pty/lib/eventEmitter2.test.js.map +0 -1
- package/node_modules/node-pty/lib/index.js +0 -52
- package/node_modules/node-pty/lib/index.js.map +0 -1
- package/node_modules/node-pty/lib/interfaces.js +0 -7
- package/node_modules/node-pty/lib/interfaces.js.map +0 -1
- package/node_modules/node-pty/lib/shared/conout.js +0 -11
- package/node_modules/node-pty/lib/shared/conout.js.map +0 -1
- package/node_modules/node-pty/lib/terminal.js +0 -190
- package/node_modules/node-pty/lib/terminal.js.map +0 -1
- package/node_modules/node-pty/lib/terminal.test.js +0 -139
- package/node_modules/node-pty/lib/terminal.test.js.map +0 -1
- package/node_modules/node-pty/lib/testUtils.test.js +0 -28
- package/node_modules/node-pty/lib/testUtils.test.js.map +0 -1
- package/node_modules/node-pty/lib/types.js +0 -7
- package/node_modules/node-pty/lib/types.js.map +0 -1
- package/node_modules/node-pty/lib/unixTerminal.js +0 -346
- package/node_modules/node-pty/lib/unixTerminal.js.map +0 -1
- package/node_modules/node-pty/lib/unixTerminal.test.js +0 -351
- package/node_modules/node-pty/lib/unixTerminal.test.js.map +0 -1
- package/node_modules/node-pty/lib/utils.js +0 -39
- package/node_modules/node-pty/lib/utils.js.map +0 -1
- package/node_modules/node-pty/lib/windowsConoutConnection.js +0 -125
- package/node_modules/node-pty/lib/windowsConoutConnection.js.map +0 -1
- package/node_modules/node-pty/lib/windowsPtyAgent.js +0 -320
- package/node_modules/node-pty/lib/windowsPtyAgent.js.map +0 -1
- package/node_modules/node-pty/lib/windowsPtyAgent.test.js +0 -90
- package/node_modules/node-pty/lib/windowsPtyAgent.test.js.map +0 -1
- package/node_modules/node-pty/lib/windowsTerminal.js +0 -199
- package/node_modules/node-pty/lib/windowsTerminal.js.map +0 -1
- package/node_modules/node-pty/lib/windowsTerminal.test.js +0 -219
- package/node_modules/node-pty/lib/windowsTerminal.test.js.map +0 -1
- package/node_modules/node-pty/lib/worker/conoutSocketWorker.js +0 -22
- package/node_modules/node-pty/lib/worker/conoutSocketWorker.js.map +0 -1
- package/node_modules/node-pty/node-addon-api/node_addon_api.Makefile +0 -6
- package/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +0 -106
- package/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +0 -110
- package/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +0 -106
- package/node_modules/node-pty/package.json +0 -64
- package/node_modules/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
- package/node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
- package/node_modules/node-pty/prebuilds/darwin-x64/pty.node +0 -0
- package/node_modules/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/conpty.pdb +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.pdb +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/pty.node +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/pty.pdb +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.exe +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.pdb +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/winpty.dll +0 -0
- package/node_modules/node-pty/prebuilds/win32-arm64/winpty.pdb +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/conpty.node +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/conpty.pdb +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.pdb +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/pty.node +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/pty.pdb +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.pdb +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
- package/node_modules/node-pty/prebuilds/win32-x64/winpty.pdb +0 -0
- package/node_modules/node-pty/scripts/gen-compile-commands.js +0 -8
- package/node_modules/node-pty/scripts/increment-version.js +0 -54
- package/node_modules/node-pty/scripts/post-install.js +0 -80
- package/node_modules/node-pty/scripts/prebuild.js +0 -34
- package/node_modules/node-pty/src/conpty_console_list_agent.ts +0 -15
- package/node_modules/node-pty/src/eventEmitter2.test.ts +0 -30
- package/node_modules/node-pty/src/eventEmitter2.ts +0 -48
- package/node_modules/node-pty/src/index.ts +0 -52
- package/node_modules/node-pty/src/interfaces.ts +0 -130
- package/node_modules/node-pty/src/native.d.ts +0 -54
- package/node_modules/node-pty/src/shared/conout.ts +0 -15
- package/node_modules/node-pty/src/terminal.test.ts +0 -119
- package/node_modules/node-pty/src/terminal.ts +0 -211
- package/node_modules/node-pty/src/testUtils.test.ts +0 -23
- package/node_modules/node-pty/src/tsconfig.json +0 -22
- package/node_modules/node-pty/src/types.ts +0 -15
- package/node_modules/node-pty/src/unix/pty.cc +0 -799
- package/node_modules/node-pty/src/unix/spawn-helper.cc +0 -23
- package/node_modules/node-pty/src/unixTerminal.test.ts +0 -367
- package/node_modules/node-pty/src/unixTerminal.ts +0 -388
- package/node_modules/node-pty/src/utils.ts +0 -29
- package/node_modules/node-pty/src/win/conpty.cc +0 -583
- package/node_modules/node-pty/src/win/conpty.h +0 -41
- package/node_modules/node-pty/src/win/conpty_console_list.cc +0 -44
- package/node_modules/node-pty/src/win/path_util.cc +0 -95
- package/node_modules/node-pty/src/win/path_util.h +0 -26
- package/node_modules/node-pty/src/win/winpty.cc +0 -333
- package/node_modules/node-pty/src/windowsConoutConnection.ts +0 -82
- package/node_modules/node-pty/src/windowsPtyAgent.test.ts +0 -94
- package/node_modules/node-pty/src/windowsPtyAgent.ts +0 -321
- package/node_modules/node-pty/src/windowsTerminal.test.ts +0 -229
- package/node_modules/node-pty/src/windowsTerminal.ts +0 -203
- package/node_modules/node-pty/src/worker/conoutSocketWorker.ts +0 -22
- package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/OpenConsole.exe +0 -0
- package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/conpty.dll +0 -0
- package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/OpenConsole.exe +0 -0
- package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/conpty.dll +0 -0
- package/node_modules/node-pty/typings/node-pty.d.ts +0 -211
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wtt-connect",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "WTT-native connector daemon for Codex, Claude Code, Cursor, Gemini, ACP, and other coding agent surfaces.",
|
|
6
6
|
"type": "module",
|
|
@@ -18,12 +18,9 @@
|
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">=22"
|
|
20
20
|
},
|
|
21
|
-
"
|
|
21
|
+
"optionalDependencies": {
|
|
22
22
|
"node-pty": "^1.1.0"
|
|
23
23
|
},
|
|
24
|
-
"bundledDependencies": [
|
|
25
|
-
"node-pty"
|
|
26
|
-
],
|
|
27
24
|
"files": [
|
|
28
25
|
"bin",
|
|
29
26
|
"src",
|
package/src/adapters/codex.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
+
import { execFile } from 'node:child_process';
|
|
2
3
|
import readline from 'node:readline';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
3
5
|
import { log } from '../logger.js';
|
|
4
6
|
|
|
7
|
+
const execFileAsync = promisify(execFile);
|
|
8
|
+
|
|
5
9
|
export class CodexAdapter {
|
|
6
10
|
constructor(config, deps = {}) {
|
|
7
11
|
this.config = config;
|
|
@@ -35,6 +39,45 @@ export class CodexAdapter {
|
|
|
35
39
|
return result.text.trim();
|
|
36
40
|
}
|
|
37
41
|
|
|
42
|
+
async handleSlashCommand(commandText, context = {}) {
|
|
43
|
+
const parsed = parseSlashCommand(commandText);
|
|
44
|
+
if (!parsed) return null;
|
|
45
|
+
const sessionKey = context.sessionKey || 'default';
|
|
46
|
+
|
|
47
|
+
switch (parsed.command) {
|
|
48
|
+
case '/help':
|
|
49
|
+
return [
|
|
50
|
+
'Codex slash commands supported by WTT:',
|
|
51
|
+
'- `/status`: show Codex runtime/session status.',
|
|
52
|
+
'- `/model`: show the model selected by WTT for this run. Use the WTT model picker to switch models.',
|
|
53
|
+
'- `/approvals`: show the current approval/sandbox mode.',
|
|
54
|
+
'- `/diff`: show current git diff summary and patch excerpt.',
|
|
55
|
+
'- `/review`: run Codex native code review for the current workspace.',
|
|
56
|
+
'- `/init`: ask Codex to inspect the workspace and create/update AGENTS.md guidance.',
|
|
57
|
+
'- `/clear`: clear the stored Codex resume thread for this WTT topic.',
|
|
58
|
+
'- `/compact`: non-interactive Codex cannot compact an existing TUI context; WTT clears the stored resume thread instead.',
|
|
59
|
+
].join('\n');
|
|
60
|
+
case '/status':
|
|
61
|
+
return this.codexStatus(sessionKey, context);
|
|
62
|
+
case '/model':
|
|
63
|
+
return this.codexModel(context, parsed.args);
|
|
64
|
+
case '/approvals':
|
|
65
|
+
return this.codexApprovals();
|
|
66
|
+
case '/diff':
|
|
67
|
+
return this.gitDiff();
|
|
68
|
+
case '/clear':
|
|
69
|
+
return this.clearSession(sessionKey, 'clear');
|
|
70
|
+
case '/compact':
|
|
71
|
+
return this.clearSession(sessionKey, 'compact');
|
|
72
|
+
case '/review':
|
|
73
|
+
return this.runNativeReview(context, sessionKey);
|
|
74
|
+
case '/init':
|
|
75
|
+
return this.runInit(context, sessionKey);
|
|
76
|
+
default:
|
|
77
|
+
return `Unsupported Codex slash command: ${parsed.command}\n\nTry \`/help\` for supported WTT/Codex commands.`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
38
81
|
async runWithArgs(args, prompt, context, sessionKey) {
|
|
39
82
|
return runJsonCli(this.config.codexBin, args, prompt, this.config.workDir, (event) => {
|
|
40
83
|
const eventThreadId = event.thread_id || event.session_id || event.conversation_id;
|
|
@@ -47,6 +90,12 @@ export class CodexAdapter {
|
|
|
47
90
|
}
|
|
48
91
|
|
|
49
92
|
buildArgs(threadId, context = {}) {
|
|
93
|
+
const options = this.buildOptions(context);
|
|
94
|
+
if (threadId) return ['exec', 'resume', ...options, threadId, '-'];
|
|
95
|
+
return ['exec', ...options, '--cd', this.config.workDir, '-'];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
buildOptions(context = {}) {
|
|
50
99
|
const options = ['--skip-git-repo-check', '--json'];
|
|
51
100
|
options.push(...(this.permissions?.codexArgs() || []));
|
|
52
101
|
const model = modelForCodex(this.config, context);
|
|
@@ -54,9 +103,102 @@ export class CodexAdapter {
|
|
|
54
103
|
for (const img of context.images || []) options.push('--image', img);
|
|
55
104
|
const reasoningEffort = reasoningEffortForRun(this.config, context);
|
|
56
105
|
if (reasoningEffort && reasoningEffort !== 'off') options.push('-c', `model_reasoning_effort=${JSON.stringify(reasoningEffort)}`);
|
|
57
|
-
|
|
58
|
-
|
|
106
|
+
return options;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async codexStatus(sessionKey, context = {}) {
|
|
110
|
+
const stored = this.store?.getSession(sessionKey) || {};
|
|
111
|
+
const threadId = this.threadBySession.get(sessionKey) || stored.codexThreadId || '';
|
|
112
|
+
const version = await commandOutput(this.config.codexBin, ['--version'], this.config.workDir);
|
|
113
|
+
const model = modelForCodex(this.config, context) || '(config/default)';
|
|
114
|
+
return [
|
|
115
|
+
'Codex status',
|
|
116
|
+
`- binary: ${this.config.codexBin}`,
|
|
117
|
+
`- version: ${version || 'unknown'}`,
|
|
118
|
+
`- workdir: ${this.config.workDir}`,
|
|
119
|
+
`- mode: ${this.config.mode}`,
|
|
120
|
+
`- model: ${model}`,
|
|
121
|
+
`- resume thread: ${threadId || '(none)'}`,
|
|
122
|
+
].join('\n');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
codexModel(context = {}, args = '') {
|
|
126
|
+
const model = modelForCodex(this.config, context) || '(config/default)';
|
|
127
|
+
if (args.trim()) {
|
|
128
|
+
return [
|
|
129
|
+
`Current Codex model: ${model}`,
|
|
130
|
+
'',
|
|
131
|
+
'WTT runs Codex in non-interactive `codex exec` mode. Use the WTT Web model picker for per-message model switching; `/model <name>` is not applied to local Codex config.',
|
|
132
|
+
].join('\n');
|
|
133
|
+
}
|
|
134
|
+
return `Current Codex model: ${model}\nUse the WTT Web model picker to switch the model for the next message.`;
|
|
59
135
|
}
|
|
136
|
+
|
|
137
|
+
codexApprovals() {
|
|
138
|
+
const approvalArgs = (this.permissions?.codexArgs() || []).join(' ') || '(default Codex permissions)';
|
|
139
|
+
return [
|
|
140
|
+
'Codex approvals / sandbox',
|
|
141
|
+
`- WTT mode: ${this.config.mode}`,
|
|
142
|
+
`- Codex args: ${approvalArgs}`,
|
|
143
|
+
].join('\n');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async gitDiff() {
|
|
147
|
+
const stat = await commandOutput('git', ['diff', '--stat'], this.config.workDir);
|
|
148
|
+
const patch = await commandOutput('git', ['diff', '--', '.'], this.config.workDir, 120000, 20000);
|
|
149
|
+
if (!stat && !patch) return 'No git diff in the current workspace.';
|
|
150
|
+
return [
|
|
151
|
+
'Current git diff',
|
|
152
|
+
stat ? `\n${stat}` : '',
|
|
153
|
+
patch ? `\nPatch excerpt:\n\`\`\`diff\n${truncate(patch, 12000)}\n\`\`\`` : '',
|
|
154
|
+
].filter(Boolean).join('\n');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
clearSession(sessionKey, reason) {
|
|
158
|
+
this.threadBySession.delete(sessionKey);
|
|
159
|
+
this.store?.clearSession(sessionKey, { adapter: this.name, codexThreadId: '', clearedBy: `/${reason}` });
|
|
160
|
+
return reason === 'compact'
|
|
161
|
+
? 'Codex compact: non-interactive `codex exec` has no TUI context compaction. Cleared the stored WTT resume thread instead; the next turn starts a fresh Codex thread.'
|
|
162
|
+
: 'Codex session cleared for this WTT topic. The next turn starts a fresh Codex thread.';
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async runNativeReview(context = {}, sessionKey = 'default') {
|
|
166
|
+
const args = ['exec', ...this.buildOptions(context), '--cd', this.config.workDir, 'review'];
|
|
167
|
+
const result = await this.runWithArgs(args, '', context, sessionKey);
|
|
168
|
+
return result.text.trim() || 'Codex review completed with no output.';
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
async runInit(context = {}, sessionKey = 'default') {
|
|
172
|
+
const prompt = [
|
|
173
|
+
'Inspect this workspace and create or update AGENTS.md with concise repository guidance for future coding agents.',
|
|
174
|
+
'Keep it specific to this repo. Include build/test commands and deployment notes only if discoverable from the workspace.',
|
|
175
|
+
].join('\n');
|
|
176
|
+
const result = await this.runWithArgs(this.buildArgs('', context), prompt, context, sessionKey);
|
|
177
|
+
return result.text.trim() || 'Codex init completed with no output.';
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function parseSlashCommand(text) {
|
|
182
|
+
const trimmed = String(text || '').trim();
|
|
183
|
+
if (!trimmed.startsWith('/')) return null;
|
|
184
|
+
const [command, ...rest] = trimmed.split(/\s+/);
|
|
185
|
+
return { command: command.toLowerCase(), args: rest.join(' ') };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
async function commandOutput(bin, args, cwd, timeoutMs = 30000, maxChars = 8000) {
|
|
189
|
+
try {
|
|
190
|
+
const { stdout, stderr } = await execFileAsync(bin, args, { cwd, timeout: timeoutMs, maxBuffer: Math.max(maxChars * 4, 1024 * 1024) });
|
|
191
|
+
return truncate((stdout || stderr || '').trim(), maxChars);
|
|
192
|
+
} catch (err) {
|
|
193
|
+
const detail = `${err.stdout || ''}\n${err.stderr || ''}`.trim() || err.message;
|
|
194
|
+
return truncate(detail, maxChars);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function truncate(text, maxChars) {
|
|
199
|
+
const value = String(text || '');
|
|
200
|
+
if (value.length <= maxChars) return value;
|
|
201
|
+
return `${value.slice(0, maxChars)}\n...[truncated ${value.length - maxChars} chars]`;
|
|
60
202
|
}
|
|
61
203
|
|
|
62
204
|
function modelForCodex(config, context = {}) {
|
package/src/runner.js
CHANGED
|
@@ -180,6 +180,22 @@ export class Runner {
|
|
|
180
180
|
const discussionRouting = renderDiscussionRoutingInstruction(m, this.config);
|
|
181
181
|
const currentDisplayName = effectiveAgentDisplayName(this.config, agentProfile);
|
|
182
182
|
const isSlashPassthrough = isAgentSlashCommand(m, content);
|
|
183
|
+
if (isSlashPassthrough) {
|
|
184
|
+
const localSlash = await this.handleLocalSlashCommand(content, adapter, {
|
|
185
|
+
sessionKey: `wtt:topic:${topicId}:${adapter.name}:${sessionModelKey(modelConfig)}`,
|
|
186
|
+
topicId,
|
|
187
|
+
modelConfig,
|
|
188
|
+
files: staged.files,
|
|
189
|
+
images: staged.images,
|
|
190
|
+
onProgress: (event) => this.maybePublishProgress(topicId, event, adapter.name),
|
|
191
|
+
});
|
|
192
|
+
if (localSlash !== null) {
|
|
193
|
+
const reply = stripHiddenContextLeak(localSlash || '(empty response)') || '(empty response)';
|
|
194
|
+
await this.wtt.publish(topicId, reply, 'CHAT_REPLY');
|
|
195
|
+
log('info', 'slash command replied', { topicId, adapter: adapter.name, chars: reply.length });
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
183
199
|
const prompt = isSlashPassthrough ? content : [
|
|
184
200
|
'You are replying to a WTT Web conversation. Do not mention implementation internals unless asked.',
|
|
185
201
|
`WTT topic_id: ${topicId}`,
|
|
@@ -306,6 +322,62 @@ export class Runner {
|
|
|
306
322
|
}
|
|
307
323
|
}
|
|
308
324
|
|
|
325
|
+
async handleLocalSlashCommand(content, adapter, context = {}) {
|
|
326
|
+
const parsed = parseSlashCommand(content);
|
|
327
|
+
if (!parsed) return null;
|
|
328
|
+
if (parsed.command === '/wtt') {
|
|
329
|
+
const nested = parseSlashCommand(`/${parsed.args}`);
|
|
330
|
+
if (!nested) return wttSlashHelp();
|
|
331
|
+
parsed.command = nested.command;
|
|
332
|
+
parsed.args = nested.args;
|
|
333
|
+
}
|
|
334
|
+
if (parsed.command === '/upgrade') {
|
|
335
|
+
return this.handleUpgradeCommand(parsed.args);
|
|
336
|
+
}
|
|
337
|
+
if (adapter.name === 'codex' && typeof adapter.handleSlashCommand === 'function') {
|
|
338
|
+
return adapter.handleSlashCommand(content, context);
|
|
339
|
+
}
|
|
340
|
+
if (parsed.command === '/status') {
|
|
341
|
+
return this.runtimeStatusText(adapter, context);
|
|
342
|
+
}
|
|
343
|
+
if (parsed.command === '/clear') {
|
|
344
|
+
this.store.clearSession(context.sessionKey || 'default', { adapter: adapter.name, clearedBy: '/clear' });
|
|
345
|
+
if (adapter.threadBySession?.delete) adapter.threadBySession.delete(context.sessionKey || 'default');
|
|
346
|
+
if (adapter.sessionByKey?.delete) adapter.sessionByKey.delete(context.sessionKey || 'default');
|
|
347
|
+
return `${adapterDisplayName(adapter.name)} session cleared for this WTT topic.`;
|
|
348
|
+
}
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
runtimeStatusText(adapter, context = {}) {
|
|
353
|
+
const runtime = this.runtimeInfo();
|
|
354
|
+
const modelConfig = context.modelConfig || {};
|
|
355
|
+
const model = modelConfig.model || runtime.current_model || runtime.model || this.config.model || '(config/default)';
|
|
356
|
+
return [
|
|
357
|
+
'WTT agent runtime status',
|
|
358
|
+
`- agent_id: ${this.config.agentId || '(unbound)'}`,
|
|
359
|
+
`- adapter: ${adapter.name}`,
|
|
360
|
+
`- model: ${model}`,
|
|
361
|
+
`- workdir: ${this.config.workDir}`,
|
|
362
|
+
`- mode: ${this.permissions.describe()}`,
|
|
363
|
+
`- node: ${process.version}`,
|
|
364
|
+
`- wtt-connect: ${runtime.wtt_connect || runtime.wttConnect || '(unknown)'}`,
|
|
365
|
+
`- claude: ${runtime.claude_code || runtime.claude || '(unknown)'}`,
|
|
366
|
+
`- codex: ${runtime.codex || '(unknown)'}`,
|
|
367
|
+
].join('\n');
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
async handleUpgradeCommand(argsText = '') {
|
|
371
|
+
const parsed = parseUpgradeArgs(argsText);
|
|
372
|
+
if (parsed.help) return upgradeHelp();
|
|
373
|
+
const result = await upgradeToolchain(this.config, parsed.targets);
|
|
374
|
+
this.store.patchRuntime({
|
|
375
|
+
toolchain_updated_at: new Date().toISOString(),
|
|
376
|
+
toolchain_update: result.summary,
|
|
377
|
+
});
|
|
378
|
+
return result.message;
|
|
379
|
+
}
|
|
380
|
+
|
|
309
381
|
recordRuntimeSelection(adapter, modelConfig = {}, status = 'idle') {
|
|
310
382
|
const model = String(modelConfig.model || modelConfig.model_id || modelConfig.modelId || '').trim();
|
|
311
383
|
const reasoning = String(modelConfig.reasoning_effort || modelConfig.reasoningEffort || '').trim().toLowerCase();
|
|
@@ -444,6 +516,192 @@ function adapterDisplayName(name) {
|
|
|
444
516
|
return name || 'Agent';
|
|
445
517
|
}
|
|
446
518
|
|
|
519
|
+
function parseSlashCommand(text) {
|
|
520
|
+
const trimmed = String(text || '').trim();
|
|
521
|
+
if (!trimmed.startsWith('/')) return null;
|
|
522
|
+
const [command, ...rest] = trimmed.split(/\s+/);
|
|
523
|
+
return { command: command.toLowerCase(), args: rest.join(' ') };
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function wttSlashHelp() {
|
|
527
|
+
return [
|
|
528
|
+
'WTT slash commands:',
|
|
529
|
+
'- `/upgrade codex`: install the latest Codex CLI into the persistent toolchain.',
|
|
530
|
+
'- `/upgrade claude-code`: install the latest Claude Code CLI into the persistent toolchain.',
|
|
531
|
+
'- `/upgrade wtt-connect`: install the latest wtt-connect package into the persistent toolchain. Restart is required to use the new connector process.',
|
|
532
|
+
'- `/upgrade all`: install all three tools.',
|
|
533
|
+
'- `/status`: show WTT agent runtime status.',
|
|
534
|
+
'- `/clear`: clear this WTT topic session state.',
|
|
535
|
+
].join('\n');
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
function upgradeHelp() {
|
|
539
|
+
return [
|
|
540
|
+
'Usage:',
|
|
541
|
+
'- `/upgrade codex`',
|
|
542
|
+
'- `/upgrade claude-code`',
|
|
543
|
+
'- `/upgrade wtt-connect`',
|
|
544
|
+
'- `/upgrade all`',
|
|
545
|
+
'',
|
|
546
|
+
'Aliases: `claude`, `claude_code`, `connect`, `connector`, `tools`.',
|
|
547
|
+
'Installs use the current persistent npm prefix when available, for example `/workspace/toolchain/node-global` in Cloudflare Sandbox.',
|
|
548
|
+
].join('\n');
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
function parseUpgradeArgs(argsText = '') {
|
|
552
|
+
const tokens = String(argsText || '').trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
553
|
+
if (!tokens.length || tokens.includes('--help') || tokens.includes('-h') || tokens.includes('help')) {
|
|
554
|
+
return { help: true, targets: [] };
|
|
555
|
+
}
|
|
556
|
+
const targets = new Set();
|
|
557
|
+
for (const token of tokens) {
|
|
558
|
+
if (['all', 'tools', 'toolchain'].includes(token)) {
|
|
559
|
+
targets.add('wtt-connect');
|
|
560
|
+
targets.add('codex');
|
|
561
|
+
targets.add('claude-code');
|
|
562
|
+
} else if (['wtt-connect', 'connect', 'connector'].includes(token)) {
|
|
563
|
+
targets.add('wtt-connect');
|
|
564
|
+
} else if (['codex', 'openai-codex', 'openai'].includes(token)) {
|
|
565
|
+
targets.add('codex');
|
|
566
|
+
} else if (['claude-code', 'claude_code', 'claude', 'anthropic'].includes(token)) {
|
|
567
|
+
targets.add('claude-code');
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
if (!targets.size) return { help: true, targets: [] };
|
|
571
|
+
return { help: false, targets: Array.from(targets) };
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
async function upgradeToolchain(config, targets) {
|
|
575
|
+
const specs = [];
|
|
576
|
+
if (targets.includes('wtt-connect')) specs.push('wtt-connect@latest');
|
|
577
|
+
if (targets.includes('codex')) specs.push('@openai/codex@latest');
|
|
578
|
+
if (targets.includes('claude-code')) specs.push('@anthropic-ai/claude-code@latest');
|
|
579
|
+
if (!specs.length) return { message: upgradeHelp(), summary: {} };
|
|
580
|
+
|
|
581
|
+
const prefix = await resolveNpmPrefix(config);
|
|
582
|
+
const cache = process.env.NPM_CONFIG_CACHE
|
|
583
|
+
|| process.env.npm_config_cache
|
|
584
|
+
|| (prefix.endsWith('/node-global') ? path.join(path.dirname(prefix), 'npm-cache') : path.join(prefix, '.npm-cache'));
|
|
585
|
+
const registry = process.env.NPM_CONFIG_REGISTRY || process.env.npm_config_registry || 'https://registry.npmjs.org';
|
|
586
|
+
await fsp.mkdir(prefix, { recursive: true });
|
|
587
|
+
await fsp.mkdir(cache, { recursive: true });
|
|
588
|
+
|
|
589
|
+
const before = await toolVersions(config);
|
|
590
|
+
const env = {
|
|
591
|
+
...process.env,
|
|
592
|
+
NPM_CONFIG_PREFIX: prefix,
|
|
593
|
+
npm_config_prefix: prefix,
|
|
594
|
+
NPM_CONFIG_CACHE: cache,
|
|
595
|
+
npm_config_cache: cache,
|
|
596
|
+
npm_config_nodedir: process.env.npm_config_nodedir || '/usr/local',
|
|
597
|
+
};
|
|
598
|
+
const install = await execFileAsync('npm', [
|
|
599
|
+
'install',
|
|
600
|
+
'-g',
|
|
601
|
+
'--prefix',
|
|
602
|
+
prefix,
|
|
603
|
+
'--cache',
|
|
604
|
+
cache,
|
|
605
|
+
`--registry=${registry}`,
|
|
606
|
+
...specs,
|
|
607
|
+
], {
|
|
608
|
+
cwd: config.workDir,
|
|
609
|
+
env,
|
|
610
|
+
timeout: 10 * 60_000,
|
|
611
|
+
maxBuffer: 2 * 1024 * 1024,
|
|
612
|
+
});
|
|
613
|
+
const after = await toolVersions(config, prefix);
|
|
614
|
+
const lines = [
|
|
615
|
+
'Toolchain upgrade completed.',
|
|
616
|
+
`- npm prefix: ${prefix}`,
|
|
617
|
+
`- npm cache: ${cache}`,
|
|
618
|
+
`- packages: ${specs.join(', ')}`,
|
|
619
|
+
'',
|
|
620
|
+
'Versions:',
|
|
621
|
+
`- wtt-connect: ${before.wtt_connect || 'unknown'} -> ${after.wtt_connect || 'unknown'}`,
|
|
622
|
+
`- codex: ${before.codex || 'unknown'} -> ${after.codex || 'unknown'}`,
|
|
623
|
+
`- claude-code: ${before.claude_code || 'unknown'} -> ${after.claude_code || 'unknown'}`,
|
|
624
|
+
];
|
|
625
|
+
if (targets.includes('wtt-connect')) {
|
|
626
|
+
lines.push('', 'Note: `wtt-connect` was upgraded on disk. Restart this agent process to run the new connector version; Claude Code and Codex upgrades are used on the next run because they are spawned per request.');
|
|
627
|
+
}
|
|
628
|
+
const stdout = String(install.stdout || '').trim();
|
|
629
|
+
if (stdout) lines.push('', 'npm output:', truncate(stdout, 4000));
|
|
630
|
+
return {
|
|
631
|
+
message: lines.join('\n'),
|
|
632
|
+
summary: {
|
|
633
|
+
prefix,
|
|
634
|
+
cache,
|
|
635
|
+
packages: specs,
|
|
636
|
+
before,
|
|
637
|
+
after,
|
|
638
|
+
installed_at: new Date().toISOString(),
|
|
639
|
+
},
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
async function resolveNpmPrefix(config) {
|
|
644
|
+
const envPrefix = process.env.NPM_CONFIG_PREFIX || process.env.npm_config_prefix || '';
|
|
645
|
+
if (envPrefix) return path.resolve(envPrefix);
|
|
646
|
+
const bin = await commandPath('wtt-connect').catch(() => '');
|
|
647
|
+
if (bin && path.basename(path.dirname(bin)) === 'bin') {
|
|
648
|
+
return path.dirname(path.dirname(bin));
|
|
649
|
+
}
|
|
650
|
+
const stateDir = config.stateDir || path.join(config.workDir || process.cwd(), '.wtt-connect');
|
|
651
|
+
return path.join(stateDir, 'toolchain', 'node-global');
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
async function commandPath(bin) {
|
|
655
|
+
const { stdout } = await execFileAsync('which', [bin], { timeout: 10000 });
|
|
656
|
+
return String(stdout || '').trim().split('\n')[0] || '';
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
async function toolVersions(config, prefix = '') {
|
|
660
|
+
const binDir = prefix ? path.join(prefix, 'bin') : '';
|
|
661
|
+
const wttConnectBin = binDir ? path.join(binDir, 'wtt-connect') : 'wtt-connect';
|
|
662
|
+
const codexBin = binDir ? path.join(binDir, 'codex') : config.codexBin;
|
|
663
|
+
const claudeBin = binDir ? path.join(binDir, 'claude') : config.claudeBin;
|
|
664
|
+
const [wttConnect, codex, claude] = await Promise.all([
|
|
665
|
+
npmPackageVersion('wtt-connect', prefix),
|
|
666
|
+
commandVersion(codexBin, ['--version'], config.workDir),
|
|
667
|
+
commandVersion(claudeBin, ['--version'], config.workDir),
|
|
668
|
+
]);
|
|
669
|
+
return {
|
|
670
|
+
wtt_connect: wttConnect || await commandVersion(wttConnectBin, ['help'], config.workDir, /^wtt-connect\b/im),
|
|
671
|
+
codex,
|
|
672
|
+
claude_code: claude,
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
async function npmPackageVersion(packageName, prefix = '') {
|
|
677
|
+
try {
|
|
678
|
+
const args = ['list', '-g', packageName, '--depth=0', '--json'];
|
|
679
|
+
if (prefix) args.splice(2, 0, '--prefix', prefix);
|
|
680
|
+
const { stdout } = await execFileAsync('npm', args, { timeout: 30000, maxBuffer: 1024 * 1024 });
|
|
681
|
+
const parsed = JSON.parse(stdout || '{}');
|
|
682
|
+
return parsed.dependencies?.[packageName]?.version || '';
|
|
683
|
+
} catch {
|
|
684
|
+
return '';
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
async function commandVersion(bin, args, cwd, pattern = null) {
|
|
689
|
+
try {
|
|
690
|
+
const { stdout, stderr } = await execFileAsync(bin, args, { cwd, timeout: 30000, maxBuffer: 256 * 1024 });
|
|
691
|
+
const text = String(stdout || stderr || '').trim();
|
|
692
|
+
if (pattern && !pattern.test(text)) return '';
|
|
693
|
+
return text.split('\n')[0] || '';
|
|
694
|
+
} catch {
|
|
695
|
+
return '';
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
function truncate(text, maxChars) {
|
|
700
|
+
const value = String(text || '');
|
|
701
|
+
if (value.length <= maxChars) return value;
|
|
702
|
+
return `${value.slice(0, maxChars)}\n...[truncated ${value.length - maxChars} chars]`;
|
|
703
|
+
}
|
|
704
|
+
|
|
447
705
|
function renderGeneratedFileArtifactInstruction(config, topicId = '') {
|
|
448
706
|
const workDir = config.workDir || process.cwd();
|
|
449
707
|
const uploadCommand = `wtt-connect upload-file --topic-id ${topicId || '<topic_id>'} --title "optional display name" <file-or-files>`;
|
package/src/store.js
CHANGED
|
@@ -37,6 +37,12 @@ export class DurableStore {
|
|
|
37
37
|
this.save();
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
clearSession(sessionKey, patch = {}) {
|
|
41
|
+
this.load();
|
|
42
|
+
this.data.sessions[sessionKey] = { ...patch, updatedAt: new Date().toISOString() };
|
|
43
|
+
this.save();
|
|
44
|
+
}
|
|
45
|
+
|
|
40
46
|
getRuntime() {
|
|
41
47
|
this.load();
|
|
42
48
|
return this.data.runtime || {};
|
package/src/terminal-session.js
CHANGED
|
@@ -2,10 +2,10 @@ import os from 'node:os';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
5
|
-
import * as pty from 'node-pty';
|
|
6
5
|
import { log } from './logger.js';
|
|
7
6
|
|
|
8
7
|
const require = createRequire(import.meta.url);
|
|
8
|
+
let nodePty = null;
|
|
9
9
|
|
|
10
10
|
export class TerminalSessionManager {
|
|
11
11
|
constructor(config, sendJson) {
|
|
@@ -32,6 +32,7 @@ export class TerminalSessionManager {
|
|
|
32
32
|
|
|
33
33
|
try {
|
|
34
34
|
ensureNodePtyHelperExecutable();
|
|
35
|
+
const pty = await loadNodePty();
|
|
35
36
|
const proc = pty.spawn(shell, [], {
|
|
36
37
|
name: 'xterm-256color',
|
|
37
38
|
cols,
|
|
@@ -119,6 +120,16 @@ export class TerminalSessionManager {
|
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
|
|
123
|
+
async function loadNodePty() {
|
|
124
|
+
if (nodePty) return nodePty;
|
|
125
|
+
try {
|
|
126
|
+
nodePty = await import('node-pty');
|
|
127
|
+
return nodePty;
|
|
128
|
+
} catch (err) {
|
|
129
|
+
throw new Error(`node-pty is not installed or failed to load; terminal sessions are unavailable in this runtime: ${err.message}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
122
133
|
function resolveDir(dir) {
|
|
123
134
|
const resolved = path.resolve(String(dir || process.cwd()));
|
|
124
135
|
if (!fs.existsSync(resolved)) fs.mkdirSync(resolved, { recursive: true });
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017 [Node.js API collaborators](https://github.com/nodejs/node-addon-api#collaborators)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|