@oddessentials/agent-guild 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +162 -0
- package/bin/agent-guild-report.mjs +134 -0
- package/bin/agent-guild.mjs +240 -0
- package/config/providers.default.json +124 -0
- package/examples/claude-code-settings.json +48 -0
- package/examples/codex-hooks.json +45 -0
- package/examples/gemini-settings.json +61 -0
- package/examples/grok-hooks.json +55 -0
- package/examples/providers.json +27 -0
- package/node_modules/@xterm/addon-fit/LICENSE +19 -0
- package/node_modules/@xterm/addon-fit/README.md +24 -0
- package/node_modules/@xterm/addon-fit/lib/addon-fit.js +2 -0
- package/node_modules/@xterm/addon-fit/lib/addon-fit.js.map +1 -0
- package/node_modules/@xterm/addon-fit/lib/addon-fit.mjs +18 -0
- package/node_modules/@xterm/addon-fit/lib/addon-fit.mjs.map +7 -0
- package/node_modules/@xterm/addon-fit/package.json +26 -0
- package/node_modules/@xterm/addon-fit/src/FitAddon.ts +92 -0
- package/node_modules/@xterm/addon-fit/typings/addon-fit.d.ts +55 -0
- package/node_modules/@xterm/addon-serialize/README.md +42 -0
- package/node_modules/@xterm/addon-serialize/lib/addon-serialize.js +2 -0
- package/node_modules/@xterm/addon-serialize/lib/addon-serialize.js.map +1 -0
- package/node_modules/@xterm/addon-serialize/lib/addon-serialize.mjs +19 -0
- package/node_modules/@xterm/addon-serialize/lib/addon-serialize.mjs.map +7 -0
- package/node_modules/@xterm/addon-serialize/package.json +29 -0
- package/node_modules/@xterm/addon-serialize/src/SerializeAddon.ts +695 -0
- package/node_modules/@xterm/addon-serialize/typings/addon-serialize.d.ts +116 -0
- package/node_modules/@xterm/addon-web-links/LICENSE +19 -0
- package/node_modules/@xterm/addon-web-links/README.md +21 -0
- package/node_modules/@xterm/addon-web-links/lib/addon-web-links.js +2 -0
- package/node_modules/@xterm/addon-web-links/lib/addon-web-links.js.map +1 -0
- package/node_modules/@xterm/addon-web-links/lib/addon-web-links.mjs +18 -0
- package/node_modules/@xterm/addon-web-links/lib/addon-web-links.mjs.map +7 -0
- package/node_modules/@xterm/addon-web-links/package.json +26 -0
- package/node_modules/@xterm/addon-web-links/src/WebLinkProvider.ts +199 -0
- package/node_modules/@xterm/addon-web-links/src/WebLinksAddon.ts +58 -0
- package/node_modules/@xterm/addon-web-links/typings/addon-web-links.d.ts +57 -0
- package/node_modules/@xterm/headless/README.md +31 -0
- package/node_modules/@xterm/headless/lib-headless/xterm-headless.js +2 -0
- package/node_modules/@xterm/headless/lib-headless/xterm-headless.js.map +1 -0
- package/node_modules/@xterm/headless/lib-headless/xterm-headless.mjs +46 -0
- package/node_modules/@xterm/headless/lib-headless/xterm-headless.mjs.map +7 -0
- package/node_modules/@xterm/headless/package.json +29 -0
- package/node_modules/@xterm/headless/typings/xterm-headless.d.ts +1385 -0
- package/node_modules/@xterm/xterm/LICENSE +21 -0
- package/node_modules/@xterm/xterm/README.md +243 -0
- package/node_modules/@xterm/xterm/css/xterm.css +285 -0
- package/node_modules/@xterm/xterm/lib/xterm.js +2 -0
- package/node_modules/@xterm/xterm/lib/xterm.js.map +1 -0
- package/node_modules/@xterm/xterm/lib/xterm.mjs +53 -0
- package/node_modules/@xterm/xterm/lib/xterm.mjs.map +7 -0
- package/node_modules/@xterm/xterm/package.json +111 -0
- package/node_modules/@xterm/xterm/src/browser/AccessibilityManager.ts +435 -0
- package/node_modules/@xterm/xterm/src/browser/Clipboard.ts +93 -0
- package/node_modules/@xterm/xterm/src/browser/ColorContrastCache.ts +34 -0
- package/node_modules/@xterm/xterm/src/browser/CoreBrowserTerminal.ts +1339 -0
- package/node_modules/@xterm/xterm/src/browser/Linkifier.ts +403 -0
- package/node_modules/@xterm/xterm/src/browser/LocalizableStrings.ts +23 -0
- package/node_modules/@xterm/xterm/src/browser/OscLinkProvider.ts +129 -0
- package/node_modules/@xterm/xterm/src/browser/RenderDebouncer.ts +84 -0
- package/node_modules/@xterm/xterm/src/browser/TimeBasedDebouncer.ts +86 -0
- package/node_modules/@xterm/xterm/src/browser/Types.ts +226 -0
- package/node_modules/@xterm/xterm/src/browser/Viewport.ts +192 -0
- package/node_modules/@xterm/xterm/src/browser/decorations/BufferDecorationRenderer.ts +139 -0
- package/node_modules/@xterm/xterm/src/browser/decorations/ColorZoneStore.ts +117 -0
- package/node_modules/@xterm/xterm/src/browser/decorations/OverviewRulerRenderer.ts +214 -0
- package/node_modules/@xterm/xterm/src/browser/input/CompositionHelper.ts +248 -0
- package/node_modules/@xterm/xterm/src/browser/input/Mouse.ts +54 -0
- package/node_modules/@xterm/xterm/src/browser/input/MoveToCell.ts +251 -0
- package/node_modules/@xterm/xterm/src/browser/public/Terminal.ts +275 -0
- package/node_modules/@xterm/xterm/src/browser/renderer/dom/DomRenderer.ts +542 -0
- package/node_modules/@xterm/xterm/src/browser/renderer/dom/DomRendererRowFactory.ts +546 -0
- package/node_modules/@xterm/xterm/src/browser/renderer/dom/WidthCache.ts +167 -0
- package/node_modules/@xterm/xterm/src/browser/renderer/shared/Constants.ts +6 -0
- package/node_modules/@xterm/xterm/src/browser/renderer/shared/RendererUtils.ts +95 -0
- package/node_modules/@xterm/xterm/src/browser/renderer/shared/SelectionRenderModel.ts +93 -0
- package/node_modules/@xterm/xterm/src/browser/renderer/shared/Types.ts +84 -0
- package/node_modules/@xterm/xterm/src/browser/selection/SelectionModel.ts +144 -0
- package/node_modules/@xterm/xterm/src/browser/selection/Types.ts +15 -0
- package/node_modules/@xterm/xterm/src/browser/services/CharSizeService.ts +127 -0
- package/node_modules/@xterm/xterm/src/browser/services/CharacterJoinerService.ts +339 -0
- package/node_modules/@xterm/xterm/src/browser/services/CoreBrowserService.ts +137 -0
- package/node_modules/@xterm/xterm/src/browser/services/LinkProviderService.ts +28 -0
- package/node_modules/@xterm/xterm/src/browser/services/MouseService.ts +46 -0
- package/node_modules/@xterm/xterm/src/browser/services/RenderService.ts +376 -0
- package/node_modules/@xterm/xterm/src/browser/services/SelectionService.ts +1039 -0
- package/node_modules/@xterm/xterm/src/browser/services/Services.ts +158 -0
- package/node_modules/@xterm/xterm/src/browser/services/ThemeService.ts +198 -0
- package/node_modules/@xterm/xterm/src/browser/shared/Constants.ts +8 -0
- package/node_modules/@xterm/xterm/src/common/CircularList.ts +241 -0
- package/node_modules/@xterm/xterm/src/common/Clone.ts +23 -0
- package/node_modules/@xterm/xterm/src/common/Color.ts +376 -0
- package/node_modules/@xterm/xterm/src/common/CoreTerminal.ts +283 -0
- package/node_modules/@xterm/xterm/src/common/InputHandler.ts +3495 -0
- package/node_modules/@xterm/xterm/src/common/MultiKeyMap.ts +42 -0
- package/node_modules/@xterm/xterm/src/common/Platform.ts +44 -0
- package/node_modules/@xterm/xterm/src/common/SortedList.ts +194 -0
- package/node_modules/@xterm/xterm/src/common/TaskQueue.ts +166 -0
- package/node_modules/@xterm/xterm/src/common/TypedArrayUtils.ts +17 -0
- package/node_modules/@xterm/xterm/src/common/Types.ts +552 -0
- package/node_modules/@xterm/xterm/src/common/WindowsMode.ts +27 -0
- package/node_modules/@xterm/xterm/src/common/buffer/AttributeData.ts +211 -0
- package/node_modules/@xterm/xterm/src/common/buffer/Buffer.ts +662 -0
- package/node_modules/@xterm/xterm/src/common/buffer/BufferLine.ts +551 -0
- package/node_modules/@xterm/xterm/src/common/buffer/BufferRange.ts +13 -0
- package/node_modules/@xterm/xterm/src/common/buffer/BufferReflow.ts +226 -0
- package/node_modules/@xterm/xterm/src/common/buffer/BufferSet.ts +134 -0
- package/node_modules/@xterm/xterm/src/common/buffer/CellData.ts +94 -0
- package/node_modules/@xterm/xterm/src/common/buffer/Constants.ts +157 -0
- package/node_modules/@xterm/xterm/src/common/buffer/Marker.ts +43 -0
- package/node_modules/@xterm/xterm/src/common/buffer/Types.ts +52 -0
- package/node_modules/@xterm/xterm/src/common/data/Charsets.ts +256 -0
- package/node_modules/@xterm/xterm/src/common/data/EscapeSequences.ts +153 -0
- package/node_modules/@xterm/xterm/src/common/input/Keyboard.ts +373 -0
- package/node_modules/@xterm/xterm/src/common/input/TextDecoder.ts +346 -0
- package/node_modules/@xterm/xterm/src/common/input/UnicodeV6.ts +145 -0
- package/node_modules/@xterm/xterm/src/common/input/WriteBuffer.ts +247 -0
- package/node_modules/@xterm/xterm/src/common/input/XParseColor.ts +80 -0
- package/node_modules/@xterm/xterm/src/common/parser/Constants.ts +58 -0
- package/node_modules/@xterm/xterm/src/common/parser/DcsParser.ts +192 -0
- package/node_modules/@xterm/xterm/src/common/parser/EscapeSequenceParser.ts +792 -0
- package/node_modules/@xterm/xterm/src/common/parser/OscParser.ts +238 -0
- package/node_modules/@xterm/xterm/src/common/parser/Params.ts +229 -0
- package/node_modules/@xterm/xterm/src/common/parser/Types.ts +275 -0
- package/node_modules/@xterm/xterm/src/common/public/AddonManager.ts +53 -0
- package/node_modules/@xterm/xterm/src/common/public/BufferApiView.ts +35 -0
- package/node_modules/@xterm/xterm/src/common/public/BufferLineApiView.ts +29 -0
- package/node_modules/@xterm/xterm/src/common/public/BufferNamespaceApi.ts +36 -0
- package/node_modules/@xterm/xterm/src/common/public/ParserApi.ts +37 -0
- package/node_modules/@xterm/xterm/src/common/public/UnicodeApi.ts +27 -0
- package/node_modules/@xterm/xterm/src/common/services/BufferService.ts +154 -0
- package/node_modules/@xterm/xterm/src/common/services/CharsetService.ts +34 -0
- package/node_modules/@xterm/xterm/src/common/services/CoreMouseService.ts +365 -0
- package/node_modules/@xterm/xterm/src/common/services/CoreService.ts +92 -0
- package/node_modules/@xterm/xterm/src/common/services/DecorationService.ts +140 -0
- package/node_modules/@xterm/xterm/src/common/services/InstantiationService.ts +85 -0
- package/node_modules/@xterm/xterm/src/common/services/LogService.ts +124 -0
- package/node_modules/@xterm/xterm/src/common/services/OptionsService.ts +212 -0
- package/node_modules/@xterm/xterm/src/common/services/OscLinkService.ts +115 -0
- package/node_modules/@xterm/xterm/src/common/services/ServiceRegistry.ts +49 -0
- package/node_modules/@xterm/xterm/src/common/services/Services.ts +396 -0
- package/node_modules/@xterm/xterm/src/common/services/UnicodeService.ts +111 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/browser.ts +141 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/canIUse.ts +49 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/dom.ts +2369 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/fastDomNode.ts +316 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/globalPointerMoveMonitor.ts +112 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/iframe.ts +135 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/keyboardEvent.ts +213 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/mouseEvent.ts +229 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/touch.ts +372 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts +303 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts +114 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/ui/scrollbar/scrollableElement.ts +720 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts +165 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/ui/scrollbar/scrollbarArrow.ts +114 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/ui/scrollbar/scrollbarState.ts +243 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.ts +118 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts +116 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/ui/widget.ts +57 -0
- package/node_modules/@xterm/xterm/src/vs/base/browser/window.ts +14 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/arrays.ts +887 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/arraysFind.ts +202 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/assert.ts +71 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/async.ts +1992 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/cancellation.ts +148 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/charCode.ts +450 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/collections.ts +140 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/decorators.ts +130 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/equals.ts +146 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/errors.ts +303 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/event.ts +1778 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/functional.ts +32 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/hash.ts +316 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/iterator.ts +159 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/keyCodes.ts +526 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/keybindings.ts +284 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/lazy.ts +47 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/lifecycle.ts +801 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/linkedList.ts +142 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/map.ts +202 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/numbers.ts +98 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/observable.ts +76 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/observableInternal/api.ts +31 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/observableInternal/autorun.ts +281 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/observableInternal/base.ts +489 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/observableInternal/debugName.ts +145 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/observableInternal/derived.ts +428 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/observableInternal/lazyObservableValue.ts +146 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/observableInternal/logging.ts +328 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/observableInternal/promise.ts +209 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/observableInternal/utils.ts +610 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/platform.ts +281 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/scrollable.ts +522 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/sequence.ts +34 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/stopwatch.ts +43 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/strings.ts +557 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/symbols.ts +9 -0
- package/node_modules/@xterm/xterm/src/vs/base/common/uint.ts +59 -0
- package/node_modules/@xterm/xterm/src/vs/patches/nls.ts +90 -0
- package/node_modules/@xterm/xterm/src/vs/typings/base-common.d.ts +20 -0
- package/node_modules/@xterm/xterm/src/vs/typings/require.d.ts +42 -0
- package/node_modules/@xterm/xterm/src/vs/typings/vscode-globals-nls.d.ts +36 -0
- package/node_modules/@xterm/xterm/src/vs/typings/vscode-globals-product.d.ts +33 -0
- package/node_modules/@xterm/xterm/typings/xterm.d.ts +1957 -0
- package/node_modules/node-addon-api/LICENSE.md +9 -0
- package/node_modules/node-addon-api/README.md +319 -0
- package/node_modules/node-addon-api/common.gypi +20 -0
- package/node_modules/node-addon-api/except.gypi +25 -0
- package/node_modules/node-addon-api/index.js +12 -0
- package/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
- package/node_modules/node-addon-api/napi-inl.h +6607 -0
- package/node_modules/node-addon-api/napi.h +3201 -0
- package/node_modules/node-addon-api/node_addon_api.gyp +32 -0
- package/node_modules/node-addon-api/node_api.gyp +9 -0
- package/node_modules/node-addon-api/noexcept.gypi +26 -0
- package/node_modules/node-addon-api/nothing.c +0 -0
- package/node_modules/node-addon-api/package-support.json +21 -0
- package/node_modules/node-addon-api/package.json +480 -0
- package/node_modules/node-addon-api/tools/README.md +73 -0
- package/node_modules/node-addon-api/tools/check-napi.js +99 -0
- package/node_modules/node-addon-api/tools/clang-format.js +71 -0
- package/node_modules/node-addon-api/tools/conversion.js +301 -0
- package/node_modules/node-addon-api/tools/eslint-format.js +79 -0
- package/node_modules/node-pty/LICENSE +69 -0
- package/node_modules/node-pty/README.md +164 -0
- package/node_modules/node-pty/binding.gyp +150 -0
- package/node_modules/node-pty/lib/conpty_console_list_agent.js +25 -0
- package/node_modules/node-pty/lib/eventEmitter2.js +47 -0
- package/node_modules/node-pty/lib/index.js +52 -0
- package/node_modules/node-pty/lib/interfaces.js +7 -0
- package/node_modules/node-pty/lib/shared/conout.js +10 -0
- package/node_modules/node-pty/lib/terminal.js +190 -0
- package/node_modules/node-pty/lib/types.js +7 -0
- package/node_modules/node-pty/lib/unixTerminal.js +351 -0
- package/node_modules/node-pty/lib/utils.js +38 -0
- package/node_modules/node-pty/lib/windowsConoutConnection.js +131 -0
- package/node_modules/node-pty/lib/windowsPtyAgent.js +344 -0
- package/node_modules/node-pty/lib/windowsTerminal.js +209 -0
- package/node_modules/node-pty/lib/worker/conoutSocketWorker.js +22 -0
- package/node_modules/node-pty/package.json +66 -0
- 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/linux-arm64/pty.node +0 -0
- package/node_modules/node-pty/prebuilds/linux-x64/pty.node +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-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/scripts/post-install.js +76 -0
- package/node_modules/node-pty/scripts/prebuild.js +34 -0
- package/node_modules/node-pty/src/unix/pty.cc +876 -0
- package/node_modules/node-pty/src/unix/spawn-helper.cc +23 -0
- package/node_modules/node-pty/src/win/conpty.cc +616 -0
- package/node_modules/node-pty/src/win/conpty.h +41 -0
- package/node_modules/node-pty/src/win/conpty_console_list.cc +44 -0
- package/node_modules/node-pty/src/win/path_util.cc +95 -0
- package/node_modules/node-pty/src/win/path_util.h +26 -0
- package/node_modules/node-pty/third_party/conpty/1.25.260303002/win10-arm64/OpenConsole.exe +0 -0
- package/node_modules/node-pty/third_party/conpty/1.25.260303002/win10-arm64/conpty.dll +0 -0
- package/node_modules/node-pty/third_party/conpty/1.25.260303002/win10-x64/OpenConsole.exe +0 -0
- package/node_modules/node-pty/third_party/conpty/1.25.260303002/win10-x64/conpty.dll +0 -0
- package/node_modules/node-pty/typings/node-pty.d.ts +215 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +530 -0
- package/node_modules/ws/lib/receiver.js +743 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1421 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/package.json +52 -0
- package/src/manager/command-resolver.mjs +140 -0
- package/src/manager/config.mjs +94 -0
- package/src/manager/install-channels.mjs +268 -0
- package/src/manager/main.mjs +136 -0
- package/src/manager/providers.mjs +601 -0
- package/src/manager/report-shims.mjs +104 -0
- package/src/manager/server.mjs +421 -0
- package/src/manager/session-manager.mjs +306 -0
- package/src/manager/session.mjs +531 -0
- package/src/manager/shell-env.mjs +150 -0
- package/src/manager/usage.mjs +535 -0
- package/src/manager/versions.mjs +62 -0
- package/src/report/hooks.mjs +150 -0
- package/web/app.js +916 -0
- package/web/art/art.css +186 -0
- package/web/art/characters/anthropic/idle.png +0 -0
- package/web/art/characters/anthropic/locked.png +0 -0
- package/web/art/characters/anthropic/working.png +0 -0
- package/web/art/characters/google/idle.png +0 -0
- package/web/art/characters/google/locked.png +0 -0
- package/web/art/characters/google/working.png +0 -0
- package/web/art/characters/openai/idle.png +0 -0
- package/web/art/characters/openai/locked.png +0 -0
- package/web/art/characters/openai/working.png +0 -0
- package/web/art/characters/shell/idle.png +0 -0
- package/web/art/characters/shell/locked.png +0 -0
- package/web/art/characters/shell/working.png +0 -0
- package/web/art/characters/xai/idle.png +0 -0
- package/web/art/characters/xai/locked.png +0 -0
- package/web/art/characters/xai/working.png +0 -0
- package/web/art/familiars/aether.png +0 -0
- package/web/art/familiars/flame.png +0 -0
- package/web/art/familiars/leaf.png +0 -0
- package/web/art/familiars/night.png +0 -0
- package/web/art/icons/anthropic.png +0 -0
- package/web/art/icons/google.png +0 -0
- package/web/art/icons/openai.png +0 -0
- package/web/art/icons/shell.png +0 -0
- package/web/art/icons/xai.png +0 -0
- package/web/art/page.png +0 -0
- package/web/art/ui/frame.png +0 -0
- package/web/art/ui/gem-mana.png +0 -0
- package/web/art/ui/gem-vitality.png +0 -0
- package/web/art/ui/guild-crest.png +0 -0
- package/web/art/ui/level-medallion.png +0 -0
- package/web/art/ui/padlock.png +0 -0
- package/web/icons/README.md +8 -0
- package/web/index.html +154 -0
- package/web/styles.css +226 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License)
|
|
4
|
+
* Copyright (c) 2016, Daniel Imms (MIT License).
|
|
5
|
+
* Copyright (c) 2018, Microsoft Corporation (MIT License).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.WindowsPtyAgent = void 0;
|
|
9
|
+
exports.argsToCommandLine = argsToCommandLine;
|
|
10
|
+
var fs = require("fs");
|
|
11
|
+
var path = require("path");
|
|
12
|
+
var child_process_1 = require("child_process");
|
|
13
|
+
var net_1 = require("net");
|
|
14
|
+
var windowsConoutConnection_1 = require("./windowsConoutConnection");
|
|
15
|
+
var eventEmitter2_1 = require("./eventEmitter2");
|
|
16
|
+
var utils_1 = require("./utils");
|
|
17
|
+
var conptyNative;
|
|
18
|
+
/**
|
|
19
|
+
* The amount of time to wait for additional data after the conpty shell process has exited before
|
|
20
|
+
* shutting down the socket. The timer will be reset if a new data event comes in after the timer
|
|
21
|
+
* has started.
|
|
22
|
+
*/
|
|
23
|
+
var FLUSH_DATA_INTERVAL = 1000;
|
|
24
|
+
var CONNECTION_TIMEOUT = 5000;
|
|
25
|
+
var defaultWindowsPtyAgentOptions = {
|
|
26
|
+
connectionTimeout: CONNECTION_TIMEOUT,
|
|
27
|
+
conoutConnectionFactory: function (conoutPipeName, useConptyDll) { return new windowsConoutConnection_1.ConoutConnection(conoutPipeName, useConptyDll); }
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* This agent sits between the WindowsTerminal class and provides an interface for conpty.
|
|
31
|
+
*/
|
|
32
|
+
var WindowsPtyAgent = /** @class */ (function () {
|
|
33
|
+
function WindowsPtyAgent(file, args, env, cwd, cols, rows, debug, _useConptyDll, conptyInheritCursor, options) {
|
|
34
|
+
if (_useConptyDll === void 0) { _useConptyDll = false; }
|
|
35
|
+
if (conptyInheritCursor === void 0) { conptyInheritCursor = false; }
|
|
36
|
+
if (options === void 0) { options = defaultWindowsPtyAgentOptions; }
|
|
37
|
+
var _this = this;
|
|
38
|
+
this._useConptyDll = _useConptyDll;
|
|
39
|
+
this._innerPid = 0;
|
|
40
|
+
this._onError = new eventEmitter2_1.EventEmitter2();
|
|
41
|
+
if (!conptyNative) {
|
|
42
|
+
conptyNative = (0, utils_1.loadNativeModule)('conpty').module;
|
|
43
|
+
}
|
|
44
|
+
this._ptyNative = conptyNative;
|
|
45
|
+
// Sanitize input variable.
|
|
46
|
+
cwd = path.resolve(cwd);
|
|
47
|
+
// Compose command line
|
|
48
|
+
var commandLine = argsToCommandLine(file, args);
|
|
49
|
+
// Open pty session.
|
|
50
|
+
var term = conptyNative.startProcess(file, cols, rows, debug, this._generatePipeName(), conptyInheritCursor, this._useConptyDll);
|
|
51
|
+
// Not available on windows.
|
|
52
|
+
this._fd = term.fd;
|
|
53
|
+
// Generated incremental number that has no real purpose besides using it
|
|
54
|
+
// as a terminal id.
|
|
55
|
+
this._pty = term.pty;
|
|
56
|
+
// Create terminal pipe IPC channel and forward to a local unix socket.
|
|
57
|
+
this._outSocket = new net_1.Socket();
|
|
58
|
+
this._outSocket.setEncoding('utf8');
|
|
59
|
+
// The conout socket must be ready out on another thread to avoid deadlocks
|
|
60
|
+
// We must wait for the worker to connect before calling conptyNative.connect()
|
|
61
|
+
// to avoid blocking the Node.js event loop in ConnectNamedPipe.
|
|
62
|
+
// See https://github.com/microsoft/node-pty/issues/763
|
|
63
|
+
this._conoutSocketWorker = options.conoutConnectionFactory(term.conout, this._useConptyDll);
|
|
64
|
+
// Store pending connection info - we'll complete the connection when worker is ready
|
|
65
|
+
this._pendingPtyInfo = { pty: this._pty, commandLine: commandLine, cwd: cwd, env: env };
|
|
66
|
+
// Never call connect() before the worker is ready, as ConnectNamedPipe
|
|
67
|
+
// would block the Node.js event loop while waiting for the output client.
|
|
68
|
+
this._connectionTimeout = setTimeout(function () {
|
|
69
|
+
_this._failPtyConnection(new Error('Timed out waiting for ConPTY output worker'));
|
|
70
|
+
}, options.connectionTimeout);
|
|
71
|
+
this._conoutSocketWorker.onReady(function () {
|
|
72
|
+
if (!_this._pendingPtyInfo) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
_this._clearConnectionTimeout();
|
|
76
|
+
_this._conoutSocketWorker.connectSocket(_this._outSocket);
|
|
77
|
+
// Now that the worker has connected to the output pipe, we can safely call
|
|
78
|
+
// conptyNative.connect() which calls ConnectNamedPipe - it won't block because
|
|
79
|
+
// the client (worker) is already connected
|
|
80
|
+
_this._completePtyConnection();
|
|
81
|
+
});
|
|
82
|
+
this._conoutSocketWorker.onError(function (error) { return _this._failPtyConnection(error); });
|
|
83
|
+
this._outSocket.on('connect', function () {
|
|
84
|
+
_this._outSocket.emit('ready_datapipe');
|
|
85
|
+
});
|
|
86
|
+
var inSocketFD = fs.openSync(term.conin, 'w');
|
|
87
|
+
this._inSocket = new net_1.Socket({
|
|
88
|
+
fd: inSocketFD,
|
|
89
|
+
readable: false,
|
|
90
|
+
writable: true
|
|
91
|
+
});
|
|
92
|
+
this._inSocket.setEncoding('utf8');
|
|
93
|
+
}
|
|
94
|
+
Object.defineProperty(WindowsPtyAgent.prototype, "onError", {
|
|
95
|
+
get: function () { return this._onError.event; },
|
|
96
|
+
enumerable: false,
|
|
97
|
+
configurable: true
|
|
98
|
+
});
|
|
99
|
+
Object.defineProperty(WindowsPtyAgent.prototype, "inSocket", {
|
|
100
|
+
get: function () { return this._inSocket; },
|
|
101
|
+
enumerable: false,
|
|
102
|
+
configurable: true
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(WindowsPtyAgent.prototype, "outSocket", {
|
|
105
|
+
get: function () { return this._outSocket; },
|
|
106
|
+
enumerable: false,
|
|
107
|
+
configurable: true
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(WindowsPtyAgent.prototype, "fd", {
|
|
110
|
+
get: function () { return this._fd; },
|
|
111
|
+
enumerable: false,
|
|
112
|
+
configurable: true
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(WindowsPtyAgent.prototype, "innerPid", {
|
|
115
|
+
get: function () { return this._innerPid; },
|
|
116
|
+
enumerable: false,
|
|
117
|
+
configurable: true
|
|
118
|
+
});
|
|
119
|
+
Object.defineProperty(WindowsPtyAgent.prototype, "pty", {
|
|
120
|
+
get: function () { return this._pty; },
|
|
121
|
+
enumerable: false,
|
|
122
|
+
configurable: true
|
|
123
|
+
});
|
|
124
|
+
WindowsPtyAgent.prototype._completePtyConnection = function () {
|
|
125
|
+
var _this = this;
|
|
126
|
+
var _a;
|
|
127
|
+
if (!this._pendingPtyInfo) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this._clearConnectionTimeout();
|
|
131
|
+
var _b = this._pendingPtyInfo, pty = _b.pty, commandLine = _b.commandLine, cwd = _b.cwd, env = _b.env;
|
|
132
|
+
this._pendingPtyInfo = undefined;
|
|
133
|
+
try {
|
|
134
|
+
var connect = conptyNative.connect(pty, commandLine, cwd, env, this._useConptyDll, function (c) { return _this._$onProcessExit(c); });
|
|
135
|
+
this._innerPid = connect.pid;
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
// connect() runs from the conout worker's onReady callback, so a throw
|
|
139
|
+
// here would otherwise surface as an
|
|
140
|
+
// uncaughtException with no way for the consumer to observe it.
|
|
141
|
+
var code = (_a = /error code: (\d+)/.exec(err.message)) === null || _a === void 0 ? void 0 : _a[1];
|
|
142
|
+
this._exitCode = code ? parseInt(code, 10) : -1;
|
|
143
|
+
try {
|
|
144
|
+
this._ptyNative.kill(this._pty, this._useConptyDll);
|
|
145
|
+
}
|
|
146
|
+
catch ( /* already gone */_c) { /* already gone */ }
|
|
147
|
+
this._conoutSocketWorker.dispose();
|
|
148
|
+
this._inSocket.destroy();
|
|
149
|
+
this._outSocket.destroy();
|
|
150
|
+
this._onError.fire(err);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
WindowsPtyAgent.prototype._failPtyConnection = function (error) {
|
|
154
|
+
if (!this._pendingPtyInfo) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
this._clearConnectionTimeout();
|
|
158
|
+
this._pendingPtyInfo = undefined;
|
|
159
|
+
this._exitCode = -1;
|
|
160
|
+
try {
|
|
161
|
+
this._ptyNative.kill(this._pty, this._useConptyDll);
|
|
162
|
+
}
|
|
163
|
+
catch ( /* already gone */_a) { /* already gone */ }
|
|
164
|
+
this._conoutSocketWorker.dispose();
|
|
165
|
+
this._inSocket.destroy();
|
|
166
|
+
this._outSocket.destroy();
|
|
167
|
+
this._onError.fire(error);
|
|
168
|
+
};
|
|
169
|
+
WindowsPtyAgent.prototype._clearConnectionTimeout = function () {
|
|
170
|
+
if (this._connectionTimeout) {
|
|
171
|
+
clearTimeout(this._connectionTimeout);
|
|
172
|
+
this._connectionTimeout = undefined;
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
WindowsPtyAgent.prototype.resize = function (cols, rows) {
|
|
176
|
+
if (this._exitCode !== undefined) {
|
|
177
|
+
throw new Error('Cannot resize a pty that has already exited');
|
|
178
|
+
}
|
|
179
|
+
this._ptyNative.resize(this._pty, cols, rows, this._useConptyDll);
|
|
180
|
+
};
|
|
181
|
+
WindowsPtyAgent.prototype.clear = function () {
|
|
182
|
+
this._ptyNative.clear(this._pty, this._useConptyDll);
|
|
183
|
+
};
|
|
184
|
+
WindowsPtyAgent.prototype.kill = function () {
|
|
185
|
+
var _this = this;
|
|
186
|
+
// Prevent deferred connection from completing after kill
|
|
187
|
+
this._clearConnectionTimeout();
|
|
188
|
+
this._pendingPtyInfo = undefined;
|
|
189
|
+
// Tell the agent to kill the pty, this releases handles to the process
|
|
190
|
+
if (!this._useConptyDll) {
|
|
191
|
+
this._inSocket.readable = false;
|
|
192
|
+
this._outSocket.readable = false;
|
|
193
|
+
this._getConsoleProcessList().then(function (consoleProcessList) {
|
|
194
|
+
consoleProcessList.forEach(function (pid) {
|
|
195
|
+
try {
|
|
196
|
+
process.kill(pid);
|
|
197
|
+
}
|
|
198
|
+
catch (e) {
|
|
199
|
+
// Ignore if process cannot be found (kill ESRCH error)
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
this._ptyNative.kill(this._pty, this._useConptyDll);
|
|
204
|
+
this._conoutSocketWorker.dispose();
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
// Close the input write handle to signal the end of session.
|
|
208
|
+
this._inSocket.destroy();
|
|
209
|
+
this._ptyNative.kill(this._pty, this._useConptyDll);
|
|
210
|
+
this._outSocket.on('data', function () {
|
|
211
|
+
_this._conoutSocketWorker.dispose();
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
WindowsPtyAgent.prototype._getConsoleProcessList = function () {
|
|
216
|
+
var _this = this;
|
|
217
|
+
if (this._innerPid <= 0) {
|
|
218
|
+
return Promise.resolve([]);
|
|
219
|
+
}
|
|
220
|
+
return new Promise(function (resolve) {
|
|
221
|
+
var agent = (0, child_process_1.fork)(path.join(__dirname, 'conpty_console_list_agent'), [_this._innerPid.toString()]);
|
|
222
|
+
agent.on('message', function (message) {
|
|
223
|
+
clearTimeout(timeout);
|
|
224
|
+
resolve(message.consoleProcessList);
|
|
225
|
+
});
|
|
226
|
+
var timeout = setTimeout(function () {
|
|
227
|
+
// Something went wrong, just send back the shell PID
|
|
228
|
+
agent.kill();
|
|
229
|
+
resolve([_this._innerPid]);
|
|
230
|
+
}, 5000);
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
Object.defineProperty(WindowsPtyAgent.prototype, "exitCode", {
|
|
234
|
+
get: function () {
|
|
235
|
+
return this._exitCode;
|
|
236
|
+
},
|
|
237
|
+
enumerable: false,
|
|
238
|
+
configurable: true
|
|
239
|
+
});
|
|
240
|
+
WindowsPtyAgent.prototype._generatePipeName = function () {
|
|
241
|
+
return "conpty-".concat(Math.random() * 10000000);
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Triggered from the native side when a contpy process exits.
|
|
245
|
+
*/
|
|
246
|
+
WindowsPtyAgent.prototype._$onProcessExit = function (exitCode) {
|
|
247
|
+
var _this = this;
|
|
248
|
+
this._exitCode = exitCode;
|
|
249
|
+
if (!this._useConptyDll) {
|
|
250
|
+
this._flushDataAndCleanUp();
|
|
251
|
+
this._outSocket.on('data', function () { return _this._flushDataAndCleanUp(); });
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
WindowsPtyAgent.prototype._flushDataAndCleanUp = function () {
|
|
255
|
+
var _this = this;
|
|
256
|
+
if (this._useConptyDll) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (this._closeTimeout) {
|
|
260
|
+
clearTimeout(this._closeTimeout);
|
|
261
|
+
}
|
|
262
|
+
this._closeTimeout = setTimeout(function () { return _this._cleanUpProcess(); }, FLUSH_DATA_INTERVAL);
|
|
263
|
+
};
|
|
264
|
+
WindowsPtyAgent.prototype._cleanUpProcess = function () {
|
|
265
|
+
if (this._useConptyDll) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
this._inSocket.readable = false;
|
|
269
|
+
this._outSocket.readable = false;
|
|
270
|
+
this._outSocket.destroy();
|
|
271
|
+
};
|
|
272
|
+
return WindowsPtyAgent;
|
|
273
|
+
}());
|
|
274
|
+
exports.WindowsPtyAgent = WindowsPtyAgent;
|
|
275
|
+
// Convert argc/argv into a Win32 command-line following the escaping convention
|
|
276
|
+
// documented on MSDN (e.g. see CommandLineToArgvW documentation). Copied from
|
|
277
|
+
// winpty project.
|
|
278
|
+
function argsToCommandLine(file, args) {
|
|
279
|
+
if (isCommandLine(args)) {
|
|
280
|
+
if (args.length === 0) {
|
|
281
|
+
return file;
|
|
282
|
+
}
|
|
283
|
+
return "".concat(argsToCommandLine(file, []), " ").concat(args);
|
|
284
|
+
}
|
|
285
|
+
var argv = [file];
|
|
286
|
+
Array.prototype.push.apply(argv, args);
|
|
287
|
+
var result = '';
|
|
288
|
+
for (var argIndex = 0; argIndex < argv.length; argIndex++) {
|
|
289
|
+
if (argIndex > 0) {
|
|
290
|
+
result += ' ';
|
|
291
|
+
}
|
|
292
|
+
var arg = argv[argIndex];
|
|
293
|
+
// if it is empty or it contains whitespace and is not already quoted
|
|
294
|
+
var hasLopsidedEnclosingQuote = xOr((arg[0] !== '"'), (arg[arg.length - 1] !== '"'));
|
|
295
|
+
var hasNoEnclosingQuotes = ((arg[0] !== '"') && (arg[arg.length - 1] !== '"'));
|
|
296
|
+
var quote = arg === '' ||
|
|
297
|
+
(arg.indexOf(' ') !== -1 ||
|
|
298
|
+
arg.indexOf('\t') !== -1) &&
|
|
299
|
+
((arg.length > 1) &&
|
|
300
|
+
(hasLopsidedEnclosingQuote || hasNoEnclosingQuotes));
|
|
301
|
+
if (quote) {
|
|
302
|
+
result += '\"';
|
|
303
|
+
}
|
|
304
|
+
var bsCount = 0;
|
|
305
|
+
for (var i = 0; i < arg.length; i++) {
|
|
306
|
+
var p = arg[i];
|
|
307
|
+
if (p === '\\') {
|
|
308
|
+
bsCount++;
|
|
309
|
+
}
|
|
310
|
+
else if (p === '"') {
|
|
311
|
+
result += repeatText('\\', bsCount * 2 + 1);
|
|
312
|
+
result += '"';
|
|
313
|
+
bsCount = 0;
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
result += repeatText('\\', bsCount);
|
|
317
|
+
bsCount = 0;
|
|
318
|
+
result += p;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (quote) {
|
|
322
|
+
result += repeatText('\\', bsCount * 2);
|
|
323
|
+
result += '\"';
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
result += repeatText('\\', bsCount);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return result;
|
|
330
|
+
}
|
|
331
|
+
function isCommandLine(args) {
|
|
332
|
+
return typeof args === 'string';
|
|
333
|
+
}
|
|
334
|
+
function repeatText(text, count) {
|
|
335
|
+
var result = '';
|
|
336
|
+
for (var i = 0; i < count; i++) {
|
|
337
|
+
result += text;
|
|
338
|
+
}
|
|
339
|
+
return result;
|
|
340
|
+
}
|
|
341
|
+
function xOr(arg1, arg2) {
|
|
342
|
+
return ((arg1 && !arg2) || (!arg1 && arg2));
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=windowsPtyAgent.js.map
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License)
|
|
4
|
+
* Copyright (c) 2016, Daniel Imms (MIT License).
|
|
5
|
+
* Copyright (c) 2018, Microsoft Corporation (MIT License).
|
|
6
|
+
*/
|
|
7
|
+
var __extends = (this && this.__extends) || (function () {
|
|
8
|
+
var extendStatics = function (d, b) {
|
|
9
|
+
extendStatics = Object.setPrototypeOf ||
|
|
10
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
11
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
12
|
+
return extendStatics(d, b);
|
|
13
|
+
};
|
|
14
|
+
return function (d, b) {
|
|
15
|
+
if (typeof b !== "function" && b !== null)
|
|
16
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
17
|
+
extendStatics(d, b);
|
|
18
|
+
function __() { this.constructor = d; }
|
|
19
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
20
|
+
};
|
|
21
|
+
})();
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.WindowsTerminal = void 0;
|
|
24
|
+
var terminal_1 = require("./terminal");
|
|
25
|
+
var windowsPtyAgent_1 = require("./windowsPtyAgent");
|
|
26
|
+
var utils_1 = require("./utils");
|
|
27
|
+
var DEFAULT_FILE = 'cmd.exe';
|
|
28
|
+
var DEFAULT_NAME = 'Windows Shell';
|
|
29
|
+
var WindowsTerminal = /** @class */ (function (_super) {
|
|
30
|
+
__extends(WindowsTerminal, _super);
|
|
31
|
+
function WindowsTerminal(file, args, opt) {
|
|
32
|
+
var _this = _super.call(this, opt) || this;
|
|
33
|
+
_this._checkType('args', args, 'string', true);
|
|
34
|
+
// Initialize arguments
|
|
35
|
+
args = args || [];
|
|
36
|
+
file = file || DEFAULT_FILE;
|
|
37
|
+
opt = opt || {};
|
|
38
|
+
opt.env = opt.env || process.env;
|
|
39
|
+
if (opt.encoding) {
|
|
40
|
+
console.warn('Setting encoding on Windows is not supported');
|
|
41
|
+
}
|
|
42
|
+
var env = (0, utils_1.assign)({}, opt.env);
|
|
43
|
+
_this._cols = opt.cols || terminal_1.DEFAULT_COLS;
|
|
44
|
+
_this._rows = opt.rows || terminal_1.DEFAULT_ROWS;
|
|
45
|
+
var cwd = opt.cwd || process.cwd();
|
|
46
|
+
var name = opt.name || env.TERM || DEFAULT_NAME;
|
|
47
|
+
var parsedEnv = _this._parseEnv(env);
|
|
48
|
+
// If the terminal is ready
|
|
49
|
+
_this._isReady = false;
|
|
50
|
+
// Functions that need to run after `ready` event is emitted.
|
|
51
|
+
_this._deferreds = [];
|
|
52
|
+
// Create new termal.
|
|
53
|
+
_this._agent = new windowsPtyAgent_1.WindowsPtyAgent(file, args, parsedEnv, cwd, _this._cols, _this._rows, false, opt.useConptyDll, opt.conptyInheritCursor);
|
|
54
|
+
_this._socket = _this._agent.outSocket;
|
|
55
|
+
// The socket 'close' handler that drives 'exit' is only attached after
|
|
56
|
+
// ready_datapipe, which never fires when connect() fails.
|
|
57
|
+
_this._agent.onError(function () {
|
|
58
|
+
_this._close();
|
|
59
|
+
_this.emit('exit', _this._agent.exitCode);
|
|
60
|
+
});
|
|
61
|
+
// Not available until `ready` event emitted.
|
|
62
|
+
_this._pid = _this._agent.innerPid;
|
|
63
|
+
_this._fd = _this._agent.fd;
|
|
64
|
+
_this._pty = _this._agent.pty;
|
|
65
|
+
// The forked windows terminal is not available until `ready` event is
|
|
66
|
+
// emitted.
|
|
67
|
+
_this._socket.on('ready_datapipe', function () {
|
|
68
|
+
// Update pid now that the agent has connected
|
|
69
|
+
_this._pid = _this._agent.innerPid;
|
|
70
|
+
// Run deferreds and set ready state once the first data event is received.
|
|
71
|
+
_this._socket.once('data', function () {
|
|
72
|
+
// Wait until the first data event is fired then we can run deferreds.
|
|
73
|
+
if (!_this._isReady) {
|
|
74
|
+
// Terminal is now ready and we can avoid having to defer method
|
|
75
|
+
// calls.
|
|
76
|
+
_this._isReady = true;
|
|
77
|
+
// Execute all deferred methods
|
|
78
|
+
_this._deferreds.forEach(function (fn) {
|
|
79
|
+
// NB! In order to ensure that `this` has all its references
|
|
80
|
+
// updated any variable that need to be available in `this` before
|
|
81
|
+
// the deferred is run has to be declared above this forEach
|
|
82
|
+
// statement.
|
|
83
|
+
fn.run();
|
|
84
|
+
});
|
|
85
|
+
// Reset
|
|
86
|
+
_this._deferreds = [];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
// Shutdown if `error` event is emitted.
|
|
90
|
+
_this._socket.on('error', function (err) {
|
|
91
|
+
// Close terminal session.
|
|
92
|
+
_this._close();
|
|
93
|
+
// EIO, happens when someone closes our child process: the only process
|
|
94
|
+
// in the terminal.
|
|
95
|
+
// node < 0.6.14: errno 5
|
|
96
|
+
// node >= 0.6.14: read EIO
|
|
97
|
+
if (err.code) {
|
|
98
|
+
if (~err.code.indexOf('errno 5') || ~err.code.indexOf('EIO'))
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
// Throw anything else.
|
|
102
|
+
if (_this.listeners('error').length < 2) {
|
|
103
|
+
throw err;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
// Cleanup after the socket is closed.
|
|
107
|
+
_this._socket.on('close', function () {
|
|
108
|
+
_this.emit('exit', _this._agent.exitCode);
|
|
109
|
+
_this._close();
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
_this._file = file;
|
|
113
|
+
_this._name = name;
|
|
114
|
+
_this._readable = true;
|
|
115
|
+
_this._writable = true;
|
|
116
|
+
_this._forwardEvents();
|
|
117
|
+
return _this;
|
|
118
|
+
}
|
|
119
|
+
WindowsTerminal.prototype._write = function (data) {
|
|
120
|
+
this._defer(this._doWrite, data);
|
|
121
|
+
};
|
|
122
|
+
WindowsTerminal.prototype._doWrite = function (data) {
|
|
123
|
+
this._agent.inSocket.write(data);
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* openpty
|
|
127
|
+
*/
|
|
128
|
+
WindowsTerminal.open = function (options) {
|
|
129
|
+
throw new Error('open() not supported on windows, use Fork() instead.');
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* TTY
|
|
133
|
+
*/
|
|
134
|
+
WindowsTerminal.prototype.resize = function (cols, rows, pixelSize) {
|
|
135
|
+
var _this = this;
|
|
136
|
+
if (cols <= 0 || rows <= 0 || isNaN(cols) || isNaN(rows) || cols === Infinity || rows === Infinity) {
|
|
137
|
+
throw new Error('resizing must be done using positive cols and rows');
|
|
138
|
+
}
|
|
139
|
+
this._deferNoArgs(function () {
|
|
140
|
+
_this._agent.resize(cols, rows);
|
|
141
|
+
_this._cols = cols;
|
|
142
|
+
_this._rows = rows;
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
WindowsTerminal.prototype.clear = function () {
|
|
146
|
+
var _this = this;
|
|
147
|
+
this._deferNoArgs(function () {
|
|
148
|
+
_this._agent.clear();
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
WindowsTerminal.prototype.destroy = function () {
|
|
152
|
+
var _this = this;
|
|
153
|
+
this._deferNoArgs(function () {
|
|
154
|
+
_this.kill();
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
WindowsTerminal.prototype.kill = function (signal) {
|
|
158
|
+
var _this = this;
|
|
159
|
+
this._deferNoArgs(function () {
|
|
160
|
+
if (signal) {
|
|
161
|
+
throw new Error('Signals not supported on windows.');
|
|
162
|
+
}
|
|
163
|
+
_this._close();
|
|
164
|
+
_this._agent.kill();
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
WindowsTerminal.prototype._deferNoArgs = function (deferredFn) {
|
|
168
|
+
var _this = this;
|
|
169
|
+
// If the terminal is ready, execute.
|
|
170
|
+
if (this._isReady) {
|
|
171
|
+
deferredFn.call(this);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
// Queue until terminal is ready.
|
|
175
|
+
this._deferreds.push({
|
|
176
|
+
run: function () { return deferredFn.call(_this); }
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
WindowsTerminal.prototype._defer = function (deferredFn, arg) {
|
|
180
|
+
var _this = this;
|
|
181
|
+
// If the terminal is ready, execute.
|
|
182
|
+
if (this._isReady) {
|
|
183
|
+
deferredFn.call(this, arg);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
// Queue until terminal is ready.
|
|
187
|
+
this._deferreds.push({
|
|
188
|
+
run: function () { return deferredFn.call(_this, arg); }
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
Object.defineProperty(WindowsTerminal.prototype, "process", {
|
|
192
|
+
get: function () { return this._name; },
|
|
193
|
+
enumerable: false,
|
|
194
|
+
configurable: true
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(WindowsTerminal.prototype, "master", {
|
|
197
|
+
get: function () { throw new Error('master is not supported on Windows'); },
|
|
198
|
+
enumerable: false,
|
|
199
|
+
configurable: true
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(WindowsTerminal.prototype, "slave", {
|
|
202
|
+
get: function () { throw new Error('slave is not supported on Windows'); },
|
|
203
|
+
enumerable: false,
|
|
204
|
+
configurable: true
|
|
205
|
+
});
|
|
206
|
+
return WindowsTerminal;
|
|
207
|
+
}(terminal_1.Terminal));
|
|
208
|
+
exports.WindowsTerminal = WindowsTerminal;
|
|
209
|
+
//# sourceMappingURL=windowsTerminal.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2020, Microsoft Corporation (MIT License).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var worker_threads_1 = require("worker_threads");
|
|
7
|
+
var net_1 = require("net");
|
|
8
|
+
var conout_1 = require("../shared/conout");
|
|
9
|
+
var conoutPipeName = worker_threads_1.workerData.conoutPipeName;
|
|
10
|
+
var conoutSocket = new net_1.Socket();
|
|
11
|
+
conoutSocket.setEncoding('utf8');
|
|
12
|
+
conoutSocket.connect(conoutPipeName, function () {
|
|
13
|
+
var server = (0, net_1.createServer)(function (workerSocket) {
|
|
14
|
+
conoutSocket.pipe(workerSocket);
|
|
15
|
+
});
|
|
16
|
+
server.listen((0, conout_1.getWorkerPipeName)(conoutPipeName));
|
|
17
|
+
if (!worker_threads_1.parentPort) {
|
|
18
|
+
throw new Error('worker_threads parentPort is null');
|
|
19
|
+
}
|
|
20
|
+
worker_threads_1.parentPort.postMessage(1 /* ConoutWorkerMessage.READY */);
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=conoutSocketWorker.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "node-pty",
|
|
3
|
+
"description": "Fork pseudoterminals in Node.JS",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Microsoft Corporation"
|
|
6
|
+
},
|
|
7
|
+
"version": "1.2.0-beta.15",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"main": "./lib/index.js",
|
|
10
|
+
"types": "./typings/node-pty.d.ts",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git://github.com/microsoft/node-pty.git"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"binding.gyp",
|
|
17
|
+
"lib/**/*.js",
|
|
18
|
+
"!lib/**/*.test.js",
|
|
19
|
+
"scripts/post-install.js",
|
|
20
|
+
"scripts/prebuild.js",
|
|
21
|
+
"src/**/*.{cc,h}",
|
|
22
|
+
"prebuilds/",
|
|
23
|
+
"third_party/",
|
|
24
|
+
"typings/"
|
|
25
|
+
],
|
|
26
|
+
"homepage": "https://github.com/microsoft/node-pty",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/microsoft/node-pty/issues"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"pty",
|
|
32
|
+
"tty",
|
|
33
|
+
"terminal",
|
|
34
|
+
"pseudoterminal",
|
|
35
|
+
"forkpty",
|
|
36
|
+
"openpty"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc -b ./src/tsconfig.json",
|
|
40
|
+
"watch": "tsc -b -w ./src/tsconfig.json",
|
|
41
|
+
"lint": "eslint src/",
|
|
42
|
+
"install": "node scripts/prebuild.js || node-gyp rebuild",
|
|
43
|
+
"postinstall": "node scripts/post-install.js",
|
|
44
|
+
"compileCommands": "node scripts/gen-compile-commands.js",
|
|
45
|
+
"test": "cross-env NODE_ENV=test mocha -R spec --exit lib/*.test.js",
|
|
46
|
+
"posttest": "npm run lint",
|
|
47
|
+
"prepare": "npm run build",
|
|
48
|
+
"prepublishOnly": "npm run build"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"node-addon-api": "^7.1.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/mocha": "^7.0.2",
|
|
55
|
+
"@types/node": "12",
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
57
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
58
|
+
"cross-env": "^5.1.4",
|
|
59
|
+
"eslint": "^10.4.0",
|
|
60
|
+
"globals": "^14.0.0",
|
|
61
|
+
"mocha": "10",
|
|
62
|
+
"node-gyp": "^11.4.2",
|
|
63
|
+
"ps-list": "^6.0.0",
|
|
64
|
+
"typescript": "^5.0.0"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|